betaFeedback

WorksEngineering

Transition Dynamics Matter: Hidden Markov Scoring of Epileptogenic Channels in SEEG

Abstract

Stereo-electroencephalography (SEEG) represents the most effective technique for the detection of the Epileptogenic Zone (EZ) in drug-resistant epilepsy. This procedure produces a multi-dimensional signal with hundreds of components, named channels, each associated with a different brain location. In this work, we propose a joint Hidden Markov Model (HMM), in which each SEEG channel is described by a latent Markov chain, with states shared across the network and channel-specific transition probabilities. Accordingly, we develop a detection algorithm that identifies the channels belonging to the EZ by quantifying, through the Kullback-Leibler divergence, the difference between their transition probabilities in the inter-ictal period and at seizure onset. We evaluate our framework in SEEG recordings from 30 patients with drug-resistant epilepsy and compare it with a benchmark that operates in the same observation space but does not consider a latent-state structure. Compared against medically validated EZ definitions, our study shows that modeling channel-specific temporal transitions can improve EZ localization and offer a data-driven framework to investigate the latent dynamics underlying seizures.

Introduction

This paper has been submitted to the IEEE International Conference on Communications (ICC) 2027.

In drug-resistant epilepsy, surgery is the treatment with the highest likelihood of achieving long-term seizure freedom [1]. The goal is to resect the Epileptogenic Zone (EZ), defined as the cortical area indispensable for the generation of seizures. Accurate localization of the EZ is then essential to maximize the probability of seizure freedom after surgical intervention while preserving the eloquent cortex. When noninvasive evaluation is not conclusive, clinical practice involves the use of invasive techniques such as Stereo-Electroencephalography (SEEG) to identify the EZ. This procedure is based on implantation of needle electrodes, which record electrical activity from the deep brain structures with high temporal resolution, although with a limited spatial sampling [2].

The outcome of SEEG monitoring is a multi-dimensional signal with hundreds of components, named channels, each associated with a different recording site. These signals provide fundamental information about both the ictal periods, i.e., seizures, and inter-ictal periods, i.e., the intervals occurring between consecutive seizures. In a clinical context, the analysis of SEEG signals is primarily based on visual interpretation, focusing on the detection of the channels that change most prominently during the transition to the ictal phase [3]. Such a procedure requires the participation of highly specialized neurologists and can still be subject to interpretative errors due to the complexity of the signals and the necessity of integrating spatial and temporal information.

In recent years, SEEG interpretation has been supported by quantitative techniques with the aim of providing new biomarkers of epileptogenic activities. In particular, the most common biomarker of seizure onset is given by Low-Voltage Fast Oscillations (LVFOs), i.e., low-amplitude activity spanning beta and gamma frequencies (f≥14f \ge14 Hz) [4]. To detect LVFOs, it is common to map SEEG signals to their time-frequency representations via the short-time Fourier transform, and then quantify the energy increase in high-frequency bands. This is the approach used by the Epileptogenic Index (EI) [5], which is the most well-established technique to assist clinicians during SEEG review. On a practical level, the EI characterizes each SEEG channel through local features, i.e., quantities computed from the target channel at a specific time point, regardless of the rest of the SEEG network. However, seizure generation is recognized as a network phenomenon, and looking at channels as independent processes may be insufficient for the EZ delineation [6].

More advanced models treat SEEG signals as graphs, where nodes denote recording sites, and edges denote inter-channel connectivity. Recent studies report that seizure onset is characterized by a reduction in connectivity for epileptogenic channels [7], followed by a hyper-synchronization during the propagation of epileptic discharges [8]. This pattern is well explained by the inter-ictal suppression hypothesis, which proposes that the EZ is restrained by surrounding structures during the inter-ictal period [9]. However, approaches in the literature often consider time-resolved graphs, i.e., sequences of graphs computed on successive time windows, and analyze each graph independently, without modeling the fact that SEEG signals span both space and time. As suggested by the inter-ictal suppression hypothesis, seizures are not abrupt events but result from the brain evolving from a pre-ictal condition, where the EZ is inhibited, to an ictal condition, where the EZ takes control over the brain [10].

A suitable approach for modeling the evolution of brain states is given by Hidden Markov Models (HMMs), a probabilistic framework in which a sequence of observations is generated by latent states evolving as a Markov chain [11]. This method separates the emission process (observations given states) from the transition process (temporal evolution among states). In the literature, HMMs have been used to differentiate between inter-ictal and ictal periods, enabling the development of seizure prediction methods [12] and the mapping between non-invasive features and intracranial patterns [13]. However, these previous works focused on modeling the whole-brain evolution and did not consider the possibility of modeling the latent states that characterize each brain location.

In this work, we develop a new framework to characterize SEEG signals, explicitly modeling the transition dynamics that characterizes single channels. We hypothesize that the generation of epileptic discharges can be represented through a transition between latent states, leading the channel from a baseline to abnormal (ictal-like) dynamics. Therefore, the ease with which a channel transitions towards ictal-like states differentiates epileptogenic structures from non-epileptogenic ones. Practically, we assume that each channel evolves according to a latent Markov chain, with each state associated with an observation pattern comprising local, e.g., spectral energy, and spatial features, e.g., functional connectivity. The state occupied by a channel at a given time point determines not only the distribution of its features, but also the probabilities of transiting towards other states.

Our model assumes that the number of states and their emission probabilities are shared throughout the SEEG signal, while each channel is characterized by its own transition probability matrix. In addition, the transition probabilities are not static but change when the brain changes its macroconditions and, e.g., enters the ictal phase. Since states and emissions are shared, the transition matrix is the only channel-and condition-specific parameter, and we can compare different channels, or different conditions of the same channel, by computing the Kullback–Leibler (KL) divergence between the corresponding transition probability matrices. Hence, we assume that epileptogenic channels can be detected by looking at those channels that more prominently change the transition probabilities at the onset of the seizure.

The main contributions of this study are the following:

  • We propose a joint HMM framework to characterize SEEG signals, where each channel is associated with its own transition matrix, while all channels share the same latent states and emission distributions;

  • We develop a detection algorithm that identifies the channels belonging to the EZ by computing the KL divergence between the transition matrices estimated during the inter-ictal period and at the beginning of the seizure;

  • We evaluate our methodology on a dataset of 30 patients with drug-resistant epilepsy who underwent SEEG monitoring at the IRCCS Institute of Neurological Sciences of Bologna, using medically validated labels as ground truth for the EZ definition;

  • We compare the performance of our method against a benchmark approach, which characterizes each channel only through static emission probabilities, without considering the channel’s temporal evolution.

Our results indicate that explicitly modeling the transition dynamics at the level of individual SEEG channels, as done by our framework, can improve the localization of the EZ with respect to an approach based on time-resolved features. This may provide new solutions to investigate the latent dynamics behind seizure generation in drug-resistant epilepsy.

Signal Model

We model an SEEG signal as a multivariate discrete-time series s[n]\mathbf{s}[n], n=0,…,N−1n = 0, \ldots, N - 1, with si[n]∈Rs_i[n] \in\mathbb{R} denoting the value of channel i∈Ci \in\mathcal{C} at sample nn. Given the sampling frequency fsf_s and the duration of the signal TT, the total number of samples is N=fs⋅TN = f_s \cdot T. We segment the signal into overlapping windows of duration τ\tau, with Δτ<τ\Delta\tau< \tau denoting the time shift between consecutive windows.

We choose TT, τ\tau and Δτ\Delta\tau to be multiples of the sampling period 1/fs1/f_s, so that each window contains an integer number M=fs⋅τM = f_s \cdot\tau of samples, and consecutive windows are spaced apart by K=fs⋅ΔτK = f_s \cdot\Delta\tau samples. Therefore, the total number of windows is W=⌊T−τΔτ⌋+1W = \left\lfloor\frac{T-\tau}{\Delta\tau} \right\rfloor+ 1, and each window w∈{0,1,…,W−1}w \in\{0,1,\ldots,W-1\} contains the samples from w⋅Kw \cdot K to w⋅K+M−1w \cdot K + M - 1. We denote by xi[w,m]x_i[w,m] the mm-th sample of the channel ii within the ww-th window, i.e., xi[w,m]=si[wK+m]x_i[w,m] = s_i[wK + m], with m∈{0,1,…,M−1}m \in\{0,1,\ldots,M-1\}.

We consider that the signal comprises both a baseline (inter-ictal) and seizure (ictal) condition, and denote by w∗w^* the window associated with the onset of the seizure. Each channel i∈Ci \in\mathcal{C} and window w∈[0,W−1]w \in[0,W-1] is associated with a vector of features oi[w]∈RF\mathbf{o}_i[w] \in\mathbb{R}^F, characterizing the SEEG signal for that specific channel and window. As formalized in the following section, the vectors {oi[w]}\{\mathbf{o}_i[w]\} constitute the observations of our joint HMM model and take values in the same space for all channels i∈Ci \in\mathcal{C}.

We consider a set B\mathcal{B} of frequency bands, with ∣B∣=B|\mathcal{B}| = B. Each band b∈Bb \in\mathcal{B} is defined by the frequency interval [flowb,fhighb)[f_{\mathrm{low}}^b, f_{\mathrm{high}}^b), expressed in Hz, with 0≤flowb<fhighb≤fs/20 \le f_{\mathrm{low}}^b < f_{\mathrm{high}}^b \le f_s/2. The Discrete Fourier Transform (DFT) of xi[w,m]x_i[w,m] is

Xi[w,k]=∑m=0M−1h[m]⋅xi[w,m]⋅e−j2πkm/M,(1)X_i[w,k] = \sum_{m=0}^{M-1} h[m] \cdot x_i[w,m] \cdot e^{-j2\pi km/M}, \tag*{(1)}

where k=0,…,M−1k = 0,\ldots,M-1 corresponds to the frequency k⋅fs/Mk \cdot f_s/M, and h[⋅]h[\cdot] is a Hanning window of length MM. Hence, the energy of xi[w,m]x_i[w,m] in band b∈Bb \in\mathcal{B} is then defined as

Eib[w]=1M∑k=klowbkhighb∣Xi[w,k]∣2,(2)E_i^b[w] = \frac{1}{M} \sum_{k=k_{\mathrm{low}}^b}^{k_{\mathrm{high}}^b} \left|X_i[w,k]\right|^2, \tag*{(2)}

where klowb=⌈flowb⋅M/fs⌉k_{\mathrm{low}}^{b}=\lceil f_{\mathrm{low}}^{b}\cdot M/f_s\rceil and khighb=⌈fhighb⋅M/fs⌉−1k_{\mathrm{high}}^{b}=\lceil f_{\mathrm{high}}^{b}\cdot M/f_s\rceil-1 are the indices of the first and last frequency bins of bb. We band-pass filter xi[w,m]x_i[w,m] over each frequency band b∈Bb\in\mathcal{B}, and denote by xib[w,m]x_i^b[w,m], m=0,…,M−1m=0,\ldots,M-1, the samples of xi[w]x_i[w] after being filtered in [flowb,fhighb)[f_{\mathrm{low}}^b,f_{\mathrm{high}}^b). Then, we compute the instantaneous phase of xib[w,m]x_i^b[w,m] as the argument of its analytic representation:

θib[w,m]=arg⁡(xib[w,m]+jHxib[w,⋅][m]),(3)\theta_i^b[w,m]=\arg\left(x_i^b[w,m]+j\mathcal{H}x_i^b[w,\cdot][m]\right), \tag*{(3)}

where H{⋅}\mathcal{H}\{\cdot\} denotes the discrete Hilbert transform. We then bin the phase values of the signal using the Sturges rule, so that the phase domain [−π,π)[-\pi,\pi) is segmented into L=⌈log⁡2M⌉+1L=\lceil\log_2 M\rceil+1 uniform bins. The entropy of xib[w,m]x_i^b[w,m] is then given by

Hib[w]=−∑ℓ=0L−1P(θib[w]∈ϑℓ)log⁡2(P(θib[w]∈ϑℓ)),(4)H_i^b[w]=-\sum_{\ell=0}^{L-1}P\left(\theta_i^b[w]\in\vartheta_\ell\right)\log_2\left(P\left(\theta_i^b[w]\in\vartheta_\ell\right)\right), \tag*{(4)}

where we denoted by P(θib[w]∈ϑℓ)P\left(\theta_i^b[w]\in\vartheta_\ell\right) the empirical probability that the samples θib[w,m]\theta_i^b[w,m] fall into bin ϑℓ\vartheta_\ell.

Finally, we exploit the instantaneous phase to estimate the connectivity between any pair (i,j)(i,j) of channels for each window. Given a frequency band b∈Bb\in\mathcal{B} and the phase sequences θib[w,m],θjb[w,m]\theta_i^b[w,m],\theta_j^b[w,m], m=0,…,M−1m=0,\ldots,M-1, we define the Mutual Information (MI) between ii and jj at window ww as

MIi,jb[w]=Hib[w]+Hjb[w]−Hi,jb[w],(5)MI_{i,j}^b[w]=H_i^b[w]+H_j^b[w]-H_{i,j}^b[w], \tag*{(5)}

where Hib[w]H_i^b[w] and Hjb[w]H_j^b[w] are the entropies defined above, and Hi,jb[w]H_{i,j}^b[w] is the joint entropy of the two phase sequences. To project mutual information values onto single channels for each window ww, we then compute the connectivity strength:

Sib[w]=∑j∈C∖iMIi,jb[w].(6)S_i^b[w]=\sum_{j\in\mathcal{C}\setminus i}MI_{i,j}^b[w]. \tag*{(6)}

This quantity denotes how strongly a specific channel is interconnected with the rest of the SEEG network at the considered window. The observation vector oi[w]\mathbf{o}_i[w] of channel ii in window ww is obtained by concatenating the energy, the entropy, and the strength over all frequency bands:

oi[w]=[Eib[w],…,Hib[w],…,Sib[w]]∈R3B.(7)\mathbf{o}_i[w]=\left[E_i^b[w],\ldots,H_i^b[w],\ldots,S_i^b[w]\right]\in\mathbb{R}^{3B}. \tag*{(7)}

Notably, the energy and the entropy capture the local properties of the channel, whereas the connectivity strength captures its spatial properties. We highlight that the model can be easily extended to other, more advanced features, as the observation space is not a constraint of our methodology.

Joint Hidden Markov Model

Given a SEEG signal s[n]\mathbf{s}[n], we assume that the feature sequence oi[0],…,oi[W−1]\mathbf{o}_i[0],\ldots,\mathbf{o}_i[W-1] associated with each channel i∈Ci\in\mathcal{C} represents the observable outcome of a latent process that can be modeled via an HMM. Accordingly, s[n]\mathbf{s}[n] can be modeled as ∣C∣|\mathcal{C}| parallel HMMs, each generating a sequence of latent states and associated observations. A sketch of the HMM associated with a channel is reported in Figure 1.

HMM associated with channel i

Figure 1. HMM associated with channel i∈Ci\in\mathcal{C}, with Z={q1,q2}\mathcal{Z}=\{q_1,q_2\}.

Model Parameter Definition

We denote by zi[w]∈Zz_i[w]\in\mathcal{Z} the latent state of channel ii in window ww, where Z\mathcal{Z} is a finite state space with ∣Z∣=Z|\mathcal{Z}|=Z states. Hence, we assume that zi[w]z_i[w] is a first-order Markov chain, with stationary transition probabilities, and that the observation oi[w]\mathbf{o}_i[w] depends only on the current state zi[w]z_i[w]. Formally, the HMM associated with channel i∈Ci\in\mathcal{C} is defined by the tuple (Ai,φ,ρ)(A_i,\varphi,\rho), where:

  • Ai(z,q)=P(zi[w+1]=q∣zi[w]=z)A_i(z,q)=P(z_i[w+1]=q\mid z_i[w]=z) is the transition probability that channel i∈Ci\in\mathcal{C} moves from state z∈Zz\in\mathcal{Z} to state q∈Zq\in\mathcal{Z}, with ∑q∈ZAi(z,q)=1, ∀z∈Z\sum_{q\in\mathcal{Z}}A_i(z,q)=1,\ \forall z\in\mathcal{Z};

  • φ(o∣z)\varphi(o\mid z), referred to as the emission density, reflects the probability of observing oi[w]∈RF\mathbf{o}_i[w]\in\mathbb{R}^{F} when channel i∈Ci\in\mathcal{C} is in state z∈Zz\in\mathcal{Z}, and is identical for all channels;

  • ρ(z)=P(zi[0]=z)\rho(z)=P(z_i[0]=z) is the initial probability that channel i∈Ci\in\mathcal{C} starts the process in state z∈Zz\in\mathcal{Z}, with ∑z∈Zρ(z)=1\sum_{z\in\mathcal{Z}}\rho(z)=1, and is also identical for all channels.

We note that, since the observations are continuous-valued, their statistical properties are expressed through probability density functions. In this work, we assume that, for each state z∈Zz\in\mathcal{Z}, the emission density φ(o∣z)\varphi(\mathbf{o}\mid z) is a multivariate Gaussian with mean μz∈RF\boldsymbol{\mu}_z\in\mathbb{R}^{F} and covariance Σz∈RF×F\boldsymbol{\Sigma}_z\in\mathbb{R}^{F\times F}, i.e., φ(o∣z)=N(o;μz,Σz)\varphi(\mathbf{o}\mid z)=\mathcal{N}(\mathbf{o};\boldsymbol{\mu}_z,\boldsymbol{\Sigma}_z). In particular, we consider Σz\boldsymbol{\Sigma}_z to be a diagonal matrix2, which means that the features are conditionally independent given the current state z∈Zz\in\mathcal{Z}. Once all of the parameters of the model have been defined, any sequence of observations oi[0],…,oi[W−1]\mathbf{o}_i[0],\ldots,\mathbf{o}_i[W-1] can be mapped to the most probable sequence of latent states zi[0],…,zi[W−1]z_i[0],\ldots,z_i[W-1] via the Viterbi algorithm.

Model Parameter Estimation

Given a SEEG signal x\mathbf{x}, we can estimate the parameters of the joint HMM by means of the Baum–Welch (BW) algorithm, a special case of the Expectation-Maximization (EM) algorithm [11]. This approach iteratively seeks a maximum likelihood estimate of the model parameters, given the observed sequences. To this end, it alternates an expectation step, computing the posterior probabilities of the latent states given the observations and the model parameters, and a maximization step, updating the parameters of the HMM model based on these posterior probabilities.

In this work, we constrain the original BW algorithm so that the emission densities and the initial probabilities are shared across channels. For each signal s[n]s[n], we consider two stages: first, we consider the observation sequences of all channels as independent sequences sharing the same parameters, and estimate φ(o∣z)\varphi(o \mid z) and ρ(z)\rho(z) via the original BW algorithm. Then, for each channel i∈Ci \in\mathcal{C}, we run the algorithm to estimate the channel-specific transition matrix Ai(z,q)A_i(z,q) by using only the observations of channel ii and keeping φ(o∣z)\varphi(o \mid z) and ρ(z)\rho(z) fixed. In particular, the second stage can be restricted to a subset of windows, so that Ai(z,q)A_i(z,q) is estimated from the portion of the data of interest only. This yields piecewise time-homogeneous transition probabilities, i.e., constant within a portion of the signal, for each channel.

For each channel i∈Ci \in\mathcal{C}, we first estimate a baseline transition probability matrix Aibase(z,q)A_i^{\mathrm{base}}(z,q) using all the windows of the inter-ictal condition, i.e., w=0,…,w∗−1w=0,\ldots,w^{*}-1. We then estimate multiple ictal transition probability matrices {Ai,wictal(z,q)}w\{A_{i,w}^{\mathrm{ictal}}(z,q)\}_w, one for each window w≥w∗w \ge w^{*} of the ictal phase. We derive Ai,wictal(z,q)A_{i,w}^{\mathrm{ictal}}(z,q) using two different approaches: the cumulative approach considers the observations from the onset of the ictal phase, that is, window w∗w^{*}, up to the target time window ww; the sliding approach consider the observations from the range {w−L,…,w+L}\{w-L,\ldots,w+L\}, where LL is a hyperparameter determining the estimation horizon. Finally, we denote by πibase(z)\boldsymbol{\pi}_i^{\mathrm{base}}(z) and πi,wictal(z)\boldsymbol{\pi}_{i,w}^{\mathrm{ictal}}(z) the steady-state probability vectors of Aibase(z,q)A_i^{\mathrm{base}}(z,q) and Ai,wictal(z,q)A_{i,w}^{\mathrm{ictal}}(z,q), respectively, i.e., the vectors π(z)\boldsymbol{\pi}(z) that satisfy π(z)A(z,q)=π(z)\boldsymbol{\pi}(z)A(z,q)=\boldsymbol{\pi}(z), π(z)1=1\boldsymbol{\pi}(z)\mathbf{1}=1, and π(z)≥0\boldsymbol{\pi}(z)\ge0 for A(z,q)=Aibase(z,q)A(z,q)=A_i^{\mathrm{base}}(z,q) and A(z,q)=Ai,wictal(z,q)A(z,q)=A_{i,w}^{\mathrm{ictal}}(z,q). These vectors represent the fraction of time that channel ii would spend in each state in the long run.

Epileptogenic Channel Detection

To quantify how much the dynamics of channel i∈Ci \in\mathcal{C} change at the onset of the seizure, we consider two different implementations of the KL divergence. In the first, referred to as transition KL, corresponds to the KL divergence between the rows of the transition matrices AibaseA_i^{\mathrm{base}} and Ai,wictalA_{i,w}^{\mathrm{ictal}}, weighted by the stationary distribution πibase\boldsymbol{\pi}_i^{\mathrm{base}}, obtaining

Ditr(w)=∑z∈Zπibase(z)∑q∈ZAi,wictal(z,q)log⁡Ai,wictal(z,q)Aibase(z,q).(8)D_i^{\mathrm{tr}}(w)=\sum_{z\in\mathcal{Z}}\pi_i^{\mathrm{base}}(z)\sum_{q\in\mathcal{Z}}A_{i,w}^{\mathrm{ictal}}(z,q)\log\frac{A_{i,w}^{\mathrm{ictal}}(z,q)}{A_i^{\mathrm{base}}(z,q)}. \tag*{(8)}

The second implementation, referred to as occupancy KL, corresponds to the KL divergence between πibase\boldsymbol{\pi}_i^{\mathrm{base}} and πi,wictal\boldsymbol{\pi}_{i,w}^{\mathrm{ictal}}:

Diocc(w)=∑z∈Zπi,wictal(z)log⁡πi,wictal(z)πibase(z).(9)D_i^{\mathrm{occ}}(w)=\sum_{z\in\mathcal{Z}}\pi_{i,w}^{\mathrm{ictal}}(z)\log\frac{\pi_{i,w}^{\mathrm{ictal}}(z)}{\pi_i^{\mathrm{base}}(z)}. \tag*{(9)}

By combining (8) and (9) with the cumulative and sliding strategies to estimate Ai,wictalA_{i,w}^{\mathrm{ictal}}, we obtain four variants of our framework. To obtain an aggregate score for each channel, we sum the values of the KL divergence over all the windows in the ictal phase, obtaining Di=∑w=w∗W−1Di(w)D_i=\sum_{w=w^{*}}^{W-1}D_i(w). This value denotes the deviation of channel ii from its baseline, representing a biomarker of channel epileptogenicity: the higher the score, the more likely the channel belongs to the EZ.

Finally, we define a benchmark that characterizes each channel through a single, channel-specific emission distribution, defined as ψi(o)=N(o;μi,Σi)\psi_i(o)=\mathcal{N}(o;\mu_i,\Sigma_i), with Σi\Sigma_i diagonal. In particular, this benchmark can be seen as a degenerate case of the joint HMM framework with a single state, i.e., Z=1Z=1. To implement the benchmark, we first estimate the emission density ψibase(o)\psi_i^{\mathrm{base}}(o) from the baseline windows 0,1,…,w∗−10,1,\ldots,w^{*}-1. Hence, we estimate the emission density ψi,wictal(o)\psi_{i,w}^{\mathrm{ictal}}(o) associated with each window ww of the ictal phase, considering the windows w∗,w∗+1,…,ww^{*},w^{*}+1,\ldots,w. The abnormality score of the benchmark is then obtained by computing the KL divergence between ψibase(o)\psi_i^{\mathrm{base}}(o) and ψi,wictal(o)\psi_{i,w}^{\mathrm{ictal}}(o), and then averaging across the ictal windows w=w∗,…,W−1w=w^{*},\ldots,W-1.

Results

We consider a dataset with a total of 30 patients that underwent SEEG monitoring at the IRCCS Institute of Neurological Science of Bologna, Italy. For each patient, we select a single seizure and extract a 200 s SEEG epoch including a 170 s pre-onset baseline and the first 30 s of the ictal phase, with the electrographic seizure onset marked by a clinician. Our preprocessing pipeline is the same as presented in [7]: each signal is segmented into overlapping windows of duration τ=1\tau=1 s and Δτ=0.25\Delta\tau=0.25 s shift, leading to an observation sequence oi[0],…,oi[W−1]o_i[0],\ldots,o_i[W-1] for each channel ii, with W=797W=797. To compute the observations, we consider B=7B=7 frequency bands, i.e., delta (1–4 Hz), theta (4–8 Hz), alpha (8–14 Hz), beta (14–30 Hz), low-gamma (30–70 Hz), high-gamma (70–150 Hz), and broadband (0–250 Hz).

We consider as reference for EZ localization the thermocoagulated channels, i.e., those channels whose recording sites underwent radiofrequency thermocoagulation at the end of the SEEG monitoring, and thus represent the initial surgical target identified by clinicians. Hence, we compare our framework against the benchmark approach presented at the end of § 2, in classifying epileptogenic vs non-epileptogenic channels. We measure classification performance using the Area Under the Receiver Operating Characteristic Curve (AUROC), the Area Under the Precision-Recall Curve (AUPRC), and the best F1, defined as the maximum F1-score over the evaluated decision thresholds. These metrics are computed separately for each of the 30 patients and summarized throughout the cohort through their mean and standard deviation.

To evaluate the framework robustness, we vary the strategy for estimating Ai,wictalA_{i,w}^{\mathrm{ictal}} (sliding vs cumulative), the approach for computing the abnormality score (transition KL vs occupancy KL), the number of states Z∈[1,7]Z \in[1,7] of the joint HMM model, the number L∈{10,20,40}L \in\{10,20,40\} of windows used for estimating Ai,wictalA_{i,w}^{\mathrm{ictal}}, and the feature set composition, which determines the size F∈{7,14,21}F \in\{7,14,21\} of the observations oi[w]∈RFo_i[w] \in\mathbb{R}^{F}.

Illustrative example

We first consider a seizure from a representative patient, using only the energy-based features and setting the number of states to Z=7Z = 7. Figure 2 shows the raw SEEG signals and the corresponding Viterbi-decoded state sequences for a subset of epileptogenic (i.e., part of the EZ) and non-epileptogenic channels, with the seizure onset starting at t∗=170t^* = 170 s. Interestingly, our framework reveals that the EZ channels A4 and B2 already differ from the others during the baseline, visiting critical states that, for the other channels, appear only during the ictal phase. After seizure onset, channels C2, C4, and A1 start visiting the same critical states more frequently, whereas non-epileptogenic channels such as T12 and I4 remain in normal states throughout the entire recording. These patterns illustrate differences in channel dynamics and motivate the comparison of their transition probabilities.

SEEG signal and Viterbi-decoded state sequences

Figure 2. SEEG signal (top) and Viterbi-decoded state sequences (bottom) for a representative patient, with Z=7Z = 7; channel labels in red belong to the EZ.

Figure 3 reports the abnormality scores Di(w)D_i(w) of each channel during the ictal phase, obtained with the transition KL and the sliding strategy (L=40L = 40 windows). In particular, channel A1 exhibits the highest divergence immediately after seizure onset, while C2 and C4 show a marked increase approximately 20 s later, followed by B4 towards the end of the interval, while all channels outside the EZ retain a low divergence throughout the seizure. The timing and magnitude of the departure from the baseline dynamics thus vary across EZ channels. A possible explanation is that some channels (including those on electrode B) already manifest epileptogenic abnormalities during the inter-ictal period. In addition, since we consider only the first 25 s of the ictal phase, some epileptogenic channels may be recruited into the seizure later.

Transition KL divergence values

Figure 3. Transition KL divergence values, with L=40L = 40, and Z=7Z = 7, for the same channels of Figure 2; channel labels in red belong to the EZ.

Performance Analysis

We now analyze the performance of our framework across the entire cohort of patients, comparing the different configurations of the proposed detection algorithm.

Figure 4 reports the performance distribution for different compositions of the feature set, with the number of features varying from F=7F = 7 (in the case of only energy or MI being used) to F=21F = 21 (when all features are used). The number of states is fixed to Z=7Z = 7 while the estimation horizon is set to L=20L = 20.

AUROC across patients for the different feature sets

Figure 4. AUROC across patients for the different feature sets.

Interestingly, the HMM-based variants are marginally affected by the choice of the feature set. Using energy features only, occupancy KL - cumulative and transition KL - sliding achieve a mean AUROC of 0.790 and 0.788, respectively, and the inclusion of MI does not lead to any significant changes. Conversely, the Gaussian benchmark strongly depends on the observation space, as its mean AUROC increases from 0.529 with energy only, i.e., close to a random classifier, to 0.653 when all the features are included. Hence, the proposed joint HMM framework can successfully classify epileptogenic channels by exploiting the temporal evolution of the energy features, while the benchmark needs additional features to compensate for the lack of temporal modeling.

We focus on the scenario where the feature set includes only the energy and the mutual information (F=21F = 21). As shown in Tab. I, occupancy KL - cumulative achieves the highest mean AUROC, AUPRC, and Best F1, i.e., 0.797, 0.437, and 0.511, respectively, and is closely followed by transition KL - sliding and occupancy KL - sliding. Conversely, Transition KL - Cumulative does not significantly improve on the benchmark. According to a paired two-tailed t-test across patients, considering a significance level of 0.05 and uncorrected pp-values, these three variants significantly outperform the benchmark in all performance metrics (p<0.01p < 0.01), while no significant difference is observed among them. In particular, occupancy KL - cumulative outperforms the benchmark in 27 out of 30 patients, whereas the benchmark performs worse than a random classifier (AUROC = 0.5) in six patients.

MethodAUROCAUPRCBest F1
Transition KL - Cumulative0.688 ± 0.1230.316 ± 0.1680.404 ± 0.136
Transition KL - Sliding Window0.794 ± 0.1170.415 ± 0.1900.508 ± 0.139
Occupancy KL - Cumulative0.797 ± 0.1210.437 ± 0.1970.511 ± 0.153
Occupancy KL - Sliding Window0.790 ± 0.1250.426 ± 0.1970.497 ± 0.159
Gaussian Benchmark0.635 ± 0.1450.303 ± 0.1460.404 ± 0.131

Table 1. Mean ± std. deviation of AUROC, AUPRC and Best F1 across patients (Z=7Z = 7).

Hence, the performance depends not only on the feature set used to characterize the latent dynamics, but also on the temporal strategy used to estimate them. For transition KL, the sliding-window strategy raises the mean AUROC from 0.688 to 0.794 (p<0.001p < 0.001), whereas for occupancy KL, the cumulative strategy performs slightly better (0.797 vs. 0.790, p=0.40p = 0.40). Hence, detecting epileptogenic patterns while using transition probabilities leads to degraded results when the HMM model is estimated over the whole ictal interval, whereas using stationary state distribution, which summarizes the time spent in each state, is less sensitive to the interval used to estimate the latent model’s parameters.

ZZL=10L = 10L=20L = 20L=40L = 40L=10L = 10L=20L = 20L=40L = 40
20.7300.7370.7400.7360.7400.742
30.7650.7740.7660.7760.7750.770
40.7670.7820.7790.7760.7770.771
50.7770.7860.7860.7850.7880.780
60.7720.7870.7860.7820.7850.779
70.7770.7940.7930.7840.7900.785

Table 2. Mean AUROC across patients of the sliding-window variants as a function of LL and ZZ.

We finally investigate whether our results depend on the choice of the hyperparameters. Figure 5 shows the distribution of AUROC across patients as a function of the number ZZ of states. Both the sliding-window approaches and occupancy KL- cumulative outperform the benchmark for all values of ZZ, with a median AUROC between 0.77 and 0.80 for Z≥3Z \ge3; instead, the KL cumulative transition tends to decrease as ZZ increases, consistently with the attenuation effect discussed above. Similarly, Tab. II analyzes whether the sliding-window approaches are affected by the choice of LL. These results show variations of the mean AUROC below 0.02 for every ZZ, with L=20L = 20 achieving the highest mean AUROC in most cases.

Box plots of AUROC across patients for different numbers of latent states $Z$

Figure 5. AUROC across patients versus number of states ZZ.

Conclusion

In this work, we proposed a new framework that models SEEG signals as a joint HMM, where each channel is associated with its own transition probability matrix, while all channels share the same state and observation spaces. The proposed methodology allows us to decode the latent state sequence associated with each channel and time point, potentially revealing the transition dynamics associated with epileptiform activity and seizure generation.

We defined an abnormality score for each channel based on the divergence between its temporal dynamics during the baseline and at the seizure onset. We then compared our methodology against a benchmark approach that does not consider state transitions to classify epileptogenic channels. Our results indicate that capturing latent state evolution, as done by our model, improves the characterization of the EZ. The proposed framework has hence the potential to support the clinical interpretation of SEEG signals and to improve our understanding of the hidden dynamics underlying seizure generation in drug-resistant epilepsy.

References

  1. [1]F. Rosenow and H. Lüders, “Presurgical evaluation of epilepsy,” Brain, vol. 124, no. 9, pp. 1683–1700, 09 2001.pubmed.ncbi.nlm.nih.gov/11522572
  2. [2]J. Isnard et al., “French guidelines for stereoelectroencephalography (SEEG),” Neurophysiol. Clin., vol. 48, no. 1, pp. 5–13, 2018.DOI
  3. [3]B. Frauscher et al., “International federation of clinical neurophysiology standardized stereo-electroencephalography terminology,” Clin. Neurophysiol., vol. 192, p. 2112374, 2026.DOI
  4. [4]Y. Wang et al., “Diagnostic value of high-frequency oscillations for the epileptogenic zone: a systematic review and meta-analysis,” Seizure, vol. 99, pp. 82–90, 2022.DOI
  5. [5]F. Bartolomei, P. Chauvel, and F. Wendling, “Epileptogenicity of brain structures in human temporal lobe epilepsy: a quantified study from intracerebral eeg,” Brain, vol. 131, no. 7, pp. 1818–1830, 2008.DOI
  6. [6]F. Bartolomei et al., “Functional epileptogenic networks: contribution of seeg and signal analysis,” Epilepsia, vol. 58, no. 7, pp. 1131–1147, 2017.DOI
  7. [7]F. Mason et al., “Desynchronization index: A new connectivity approach for exploring epileptogenic networks,” Biomed. Signal Process. Control, vol. 127, p. 111166, 2026.DOI
  8. [8]J. Cheng et al., “Localization of epileptogenic zone from SEEG: Combination of high-frequency energy and synchronous connection in epileptic network analysis,” Biomed. Signal Process. Control, vol. 100, p. 107056, 2025.DOI
  9. [9]J. D. Doss et al., “The interictal suppression hypothesis is the dominant differentiator of seizure onset zones in focal epilepsy,” Brain, vol. 147, no. 9, pp. 3009–3017, 2024.DOI
  10. [10]M. A. Kayabas, E. Köksal Ersöz, M. Yochum, F. Bartolomei, P. Benquet, and F. Wendling, “Transition to seizure in focal epilepsy: From SEEG phenomenology to underlying mechanisms,” Epilepsia, vol. 65, no. 12, pp. 3619–3630, 2024.DOI
  11. [11]L. R. Rabiner, “A tutorial on hidden markov models and selected applications in speech recognition,” Proc. IEEE, vol. 77, no. 2, pp. 257–286, 1989.
  12. [12]S. Baldassano et al., “A novel seizure detection algorithm informed by hidden Markov model event states,” J. Neural Eng., vol. 13, no. 3, p. 036011, 2016.DOI
  13. [13]S. Zhang et al., “Dynamic analysis on simultaneous iEEG-MEG data via hidden Markov model,” NeuroImage, vol. 233, p. 117923, 2021.DOI

Paper details

vlnc:W_bgtb4s86
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Engineering

Not recorded for this paper

View statement
Looking for related papers…
Contents