The Virtual Neurosurgeon: computer models to optimise epilepsy surgery

Computer models of brain dynamics can provide new insights into neurological disorders, including seizure propagation in epilepsy. Here we present our research into the clinical applicability of computer models of seizure propagation in relation with virtual resections. With these models we want to predict, and ultimately improve, the outcome of epilepsy surgery.

Epilepsy surgery is the treatment of choice for drug-resistant patients with epilepsy, if a focal onset of their seizures can be found. The surgery consists of the removal or disconnection of the brain regions that generate and/or propagate seizures, the so-called epileptogenic zone (EZ). Extensive presurgical evaluations are needed prior to the surgery to identify the possible location of the EZ, and determine whether a resection strategy can be found that is unlikely to cause neurological or cognitive problems. Typically, this includes electroencephalography (EEG), magnetic resonance imaging (MRI), magnetoencephalography (MEG), positron emission tomography (PET), single photon emission computed tomography (SPECT), and, if required, invasive EEG. Despite this thorough and intensive evaluation, 10 to 50 percent (depending on the presence of a lesion, and the type of lesion and epilepsy) of patients who underwent surgery will continue to present seizures. In order to improve these outcome rates, we are studying, using computer modelling, the role of large-scale brain networks in epilepsy and the surgical intervention.

Large-scale brain networks

The large-scale organisation of the brain can be described as a complex network, in which nodes represent brain regions and links the connections between those regions. These links may be structural, if they stand for anatomical connections, or functional, if they stand for statistical dependencies between the time-series of activity (referred to as “functional connectivity”).

One way to infer functional connectivity is through the analysis of MEG (magnetoencephalography) data. MEG is a neurophysiological technique that measures the magnetic fields that are induced by neuronal activity. MEG is non-invasive, and can trace activity throughout the brain with millisecond temporal resolution and good spatial resolution. The integration of MEG in the presurgical protocol for epilepsy surgery has led to better outcomes: more patients are seizure free, especially those patients with complicated aetiology (Rampp et al., 2019). In particular, MEG can aid the identification of  eloquent cortex and help localise the irritative zone (a region that generates epileptiform activity, and that is typically larger than the epileptogenic zone), so that an hypothesis about the location of the EZ can be generated. MEG is most sensitive to cortical sources (Hillebrand & Barnes, 2002), yet its sensitivity and specificity for deep sources is still 0.80 and 0.93, compared to 0.84 and 0.91 for superficial sources (Velmurugan et al., 2022).

MEG also provides information on the global organisation of the brain. First, the activity of different brain regions is estimated using source-reconstruction techniques, resulting in so-called ‘virtual electrodes’ (Hillebrand et al., 2016). Subsequently, different metrics can be used to quantify the statistical dependency between the time-series of the virtual electrodes, providing an estimate of their functional interactions. The interacting brain regions form functional networks. The role that different regions play within these networks can be characterised. Some regions turn out to play a central role in the network: these so-called hubs are highly connected and/or mediate the routing of information between other regions. If a hub is present at the wrong location, or plays a too dominant role in the network, then we refer to this as a pathological hub (figure 1).

Pathological hubs

Brain networks of patients with epilepsy deviate from those of healthy controls and show abnormal or pathological patterns of connectivity. A recurrent finding in epilepsy and other neurophysiological disorders is the association of disease with network hubs.

Figure 1: Schematic figure of the notion of epileptogenic networks. A pathological hub is located in the proximity of the epileptogenic zone (EZ), with an established connection to it. Epileptiform activity may spread from the EZ to the pathological hub and from there to the rest of the brain network.

In epilepsy, hubs may facilitate the propagation of seizure activity throughout the brain. In a recent study involving 22 patients who underwent epilepsy surgery at VUmc, we found that the removal of a pathological hub always led to seizure-freedom (Nissen et al. 2017). For the eight patients with remaining seizures, and for six of the fourteen seizure-free patients, no hubs were removed during the resection (57% sensitivity, 100% specificity, 73% accuracy). For five of these latter cases, however, a hub was located either in the lobe of the resection or contralateral to it, that is, in regions that were likely to be strongly connected to the resected regions. This supports the concept of a pathological hub in, or in the vicinity of, the EZ, that has an established connection with the EZ during seizures. This has been observed by other groups as well (da Silva et al. 2003, Sinha et al. 2017). Removal of the pathological hub instead of the epileptogenic tissue, or even their disconnection, might be enough to lead to seizure freedom (see figure 1).

Epilepsy is thus increasingly seen as a network disorder, which implies that the behaviour of the whole (epileptogenic) network should be considered in order to provide adequate treatment. Interestingly, for patients for whom the EZ cannot be resected due to, for example, overlap with eloquent cortex, the network perspective can help in identifying alternative resections that also lead to seizure freedom, such as the resection of a pathological hub.

Computer model for epilepsy surgery

Ideally, a neurosurgeon would test the effect of several alternative resection strategies before performing the actual surgery. In order to aid presurgical planning and predict postsurgical outcome on a patient-by-patient basis, we therefore developed a computer model that integrates all the data that is available from the presurgical evaluation of each patient, such as MRI, EEG, MEG, and PET. This is combined with a dynamic computer model to simulate seizure propagation and the effect of resections (figure 2). We named this the ESSES framework: Epidemic Spreading Seizure and Epilepsy Surgery model.

Computer model of seizure propagation

Figure 2: Sketch of the ESSES framework. A seizure-propagation pattern (top) is derived from stereotactic EEG (SEEG) data, depicting the order in which different regions become involved in the seizure (indicated by the color code, from red to yellow). This is compared with the modelled seizure-propagation pattern (bottom). It is necessary to indicate in the model where the seizures start. In a retrospective study, where patients have already undergone surgery, one can use the resection area as a proxy for the origin of the seizures (Seizure Onset Zone; SOZ). 

ESSES uses an abstract description of the seizures: ictal activity is considered as an abnormal state of a brain region that can spread throughout the brain network, akin to the spreading of an infectious disease or a computer virus. This allows for a simplified description: it only contains one parameter that controls the propagation of ictal activity, and one parameter that determines the average duration of the ictal state in each region. The model has few underlying assumptions, and can be easily adapted for each patient. 

The patient-specific brain network is derived from the presurgical MEG data, and is used as the network backbone over which seizures propagate. On the basis of the clinical hypothesis, the origin of the seizures is provided to the model, following which the computer model simulates how the seizure propagates from this region through the brain network. The propagation pattern that is generated by the model was compared with the clinically observed seizure propagation patterns in the invasive EEG recordings (see figure 2). The parameters of the model could subsequently be adjusted in order to obtain the best match between the simulated and clinically recorded seizures.

To test the validity of this approach, we used retrospective data from fifteen patients and modelled the propagation patterns for seizures that were started in the regions that had been resected during surgery (the resection area). We found that with this simple model (figure 2) the main aspects of seizure propagation as recorded via invasive EEG of these patients could be reproduced (Millán 2022, Millán 2023). Remarkably, patients with a good surgical outcome also presented a better match between the modelled seizures and the clinically recorded seizures (area under the curve AUC = 0.79). Subsequently, in order to align the approach better with clinical practice, where the resection areas is of course not known a priori, we constructed probability maps that display the likelihood that seizures start in a given region (figure 3).These maps combine the results from all presurgical scanning modalities, where more localizing modalities such as invasive EEG contribute more than, for example, PET.

Computer model of surgical resections

As a final component of ESSES, the effect of a planned resection is simulated by means of a virtual resection, in which the brain regions that correspond to a planned resection are “removed” from the modelled network. The effect of this removal on the propagation of simulated seizure activity in the network is subsequently quantified. This allows for the in silico testing of different resection strategies, in order to find the most effective, yet minimal, resection (i.e. a small resection that stops or minimises seizure propagation).

We validated the presurgical use of ESSES with a blind, independent pseudo-prospective study (N=34; Millán et al. 2023b). For each patient, using data from the presurgical evaluation, the brain network and abnormality-probability map was constructed, and ESSES was used to find the optimal resection strategies that lead to the largest decreases in seizure propagation in the model. The identified ideal resections were smaller for patients with good seizure-outcome (AUC=0.71), indicating intrinsic differences in the presurgical evaluation or large-scale brain organisation between patients with good and bad outcome. The ideal virtual resections were also more similar to the actual resections for patients with a good outcome (AUC=0.69), suggesting that ESSES can aid the surgical planning. Interestingly, simulating the effect of the actual resection in the model (that is, a virtual resection of the regions that belonged to the actual resection area) led to a larger decrease in seizure propagation for patients with a good outcome (AUC=0.78). Overall, ESSES could correctly predict 75% of cases with a bad outcome and 81% of cases with a good outcome.

Figure 3. Resection area (left) and abnormality-probability map (right), depicting the likelihood that seizures start in a certain region (darker colours = higher probability), for a representative seizure-free patient.


Individualised computational models may inform surgical planning by suggesting optimal resection strategies and informing on the likelihood of a good outcome after a proposed resection strategy. We have validated the use of such a model in a fully independent cohort, without the need for invasive EEG recordings, and using a pseudo-prospective setting that emulated the pre-surgical conditions.

The model can be further improved by incorporating additional constraints, like the exclusion of regions with important functions from proposed resection strategies. Moreover, its performance, and its contribution to clinical decision making, should be quantified in a prospective study with more patients who are followed-up for a longer period after the surgery. It should also be investigated if the performance of our approach is depends on the type of epilepsy.


da Silva FL, Blanes W, Kalitzin SN, et al. (2003) Epilepsies as dynamical diseases of brain systems: basic models of the transition between normal and epileptic activity.
Epilepsia, 44, 72-83.
Hillebrand A, Barnes GR (2002) A quantitative assessment of the sensitivity of whole-head MEG to activity in the adult human cortex. Neuroimage, 16(3 Pt 1), 638-50.
Hillebrand A, Nissen IA, Ris-Hilgersom I, et al. (2016) Detecting epileptiform activity from deeper brain regions in spatially filtered MEG data. Clinical Neurophysiology, 127(8), 2766-2769.
Millán AP, van Straaten ECW, Stam CJ, et al. (2022) Epidemic models characterize seizure propagation and the effects of epilepsy surgery in individualized brain networks based on MEG and invasive EEG recordings. Scientific Reports, 12(1), 4086.
Millán AP, van Straaten ECW, Stam CJ, et al. (2023a) The role of epidemic spreading in seizure dynamics and epilepsy surgery. Network Neuroscience, 7(2), 811-843.
Millán AP, van Straaten ECW, Stam CJ, et al. (2023b) Individualized epidemic spreading models predict epilepsy surgery outcomes: a pseudo-prospective study. medRxiv, doi:10.1101/2023.03.16.23287370.
Nissen IA, Stam CJ, Reijneveld JC, et al. (2017) Identifying the epileptogenic zone in interictal resting-state MEG source-space networks. Epilepsia, 58(1), 137-148.
Nissen IA, Stam CJ, van Straaten ECW, et al. (2018) Localization of the epileptogenic zone using interictal MEG and machine learning in a large cohort of drugresistant
epilepsy patients. Frontiers in Neurology, 9, 647.
Nissen IA, Millán AP, Stam CJ, et al. (2021) Optimization of epilepsy surgery through virtual resections on individual structural brain networks. Scientific Reports, 11,
Rampp S, Stefan H, Wu X, et al. (2019) Magnetoencephalography for epileptic focus localization in a series of 1000 cases. Brain, 142(10), 3059–3071.
Sinha N, Dauwels J, Kaiser M, et al. (2017) Predicting neurosurgical outcomes in focal epilepsy patients using computational modelling. Brain, 140(2), 319-332.
Velmurugan J, Badier JM, Pizzo F, et al. (2022) Virtual MEG sensors based on beamformer and independent component analysis can reconstruct epileptic activity as
measured on simultaneous intracerebral recordings. Neuroimage, 264, 119681.