Non-Invasive Reconstruction of Intracranial EEG Across the Deep Temporal Lobe from Scalp EEG based on Conditional Normalizing Flow
Authors: Dongyi He, Bin Jiang, Kecheng Feng, Luyin Zhang, Ling Liu, Yuxuan Li, Yun Zhao, He Yan
Organizations: School of Artificial Intelligence, Chongqing University of Technology, Chongqing, 400054, China · School of Smart Health, Chongqing Polytechnic University of Electronic Technology, Chongqing, 401331, China
Although obtaining deep brain activity from non-invasive scalp electroencephalography (sEEG) is crucial for neuroscience and clinical diagnosis, directly generating high-fidelity intracranial electroencephalography (iEEG) signals remains a largely unexplored field, limiting our understanding of deep brain dynamics. Current research primarily focuses on traditional signal processing or source localization methods, which struggle to capture the complex waveforms and random characteristics of iEEG. To address this critical challenge, this paper introduces NeuroFlowNet, a novel cross-modal generative framework whose core contribution lies in the first-ever reconstruction of iEEG signals from the entire deep temporal lobe region using sEEG signals. NeuroFlowNet is built on Conditional Normalizing Flow (CNF), which directly models complex conditional probability distributions through reversible transformations, thereby explicitly capturing the randomness of brain signals and fundamentally avoiding the pattern collapse issues common in existing generative models. Additionally, the model integrates a multi-scale architecture and self-attention mechanisms to robustly capture fine-grained temporal details and long-range dependencies. Validation results on a publicly available synchronized sEEG-iEEG dataset demonstrate NeuroFlowNet's effectiveness in terms of temporal waveform fidelity, spectral feature reproduction, and functional connectivity restoration. This study establishes a more reliable and scalable new paradigm for non-invasive analysis of deep brain dynamics. The code of this study is available in https://github.com/hdy6438/NeuroFlowNet
Figures & tables
Figure 1: Overview of NeuroFlowNet architecture. The model consists of multiple scales, each containing a series of flow steps that transform the iEEG data conditioned on the EEG data. The final latent variable Z is obtained by concatenating the outputs from all scales.
Figure 2: Flow step composition in NeuroFlowNet. Each flow step consists of an invertible 1×1 convolution followed by a conditional affine coupling layer, which transforms the input data while conditioning on the EEG data Xc .
Figure 3: Medial temporal lobe (MTL) depth electrode locations for subjects used in this study (S1, S6 and S9). Each panel shows coronal, sagittal, and axial views of depth electrode trajectories within MTL subregions. Colors indicate anatomical targets: anterior hippocampus (AHL/AHR, red/light red), amygdala (AL/AR, orange/yellow), entorhinal cortex (ECL/ECR, green/light green), parahippocampal gyrus (PHL/PHR, purple/magenta), and lateral rhinal area (LR, blue). Each trajectory consists of eight electrode contacts positioned along a single stereotactic path.
Figure 4: Hyperparameter selection results for NeuroFlowNet. The performance of the model is evaluated on the validation set and averaged across all subjects and electrodes. The hyperparameters include NS , the number of scales (a); Nsteps , the number of flow steps per scale (b); and Ch , the number of channels in the hidden layers of the conditional neural network (c). The results indicate that the model achieves optimal performance with NS=2 , Nsteps=6 , and Ch=128 .
Figure 5: Ablation of the MHSA module in the conditional network gcond . Correlation (higher is better) and MAE (lower is better) are reported on the validation set. Bars indicate the mean across subjects and electrodes, and error bars denote the standard deviation across subjects
Subject
Region
Temporal waveform
PSD waveform (0.5-50Hz)
Alpha PSD waveform (8-13Hz)
MAE (µV)
Corr
Cosine
Corr
Cosine
Corr
Cosine
Power MAPE (%)
S1
AHL
40.66 ± 21.53
0.35 ± 0.28
0.47 ± 0.24
0.66 ± 0.22
0.70 ± 0.19
0.25 ± 0.53
0.70 ± 0.21
2.65 ± 4.40
AL
42.82 ± 28.98
0.39 ± 0.30
0.50 ± 0.26
0.67 ± 0.23
0.71 ± 0.20
0.29 ± 0.52
0.71 ± 0.21
3.33 ± 7.35
ECL
49.15 ± 27.35
0.40 ± 0.25
0.50 ± 0.21
0.66 ± 0.24
0.70 ± 0.21
0.32 ± 0.52
0.72 ± 0.21
6.49 ± 16.65
LR
33.86 ± 20.08
0.60 ± 0.28
0.65 ± 0.25
0.76 ± 0.23
0.79 ± 0.20
0.45 ± 0.48
0.78 ± 0.18
1.24 ± 2.18
PHL
35.68 ± 15.08
0.56 ± 0.33
0.62 ± 0.28
0.74 ± 0.23
0.77 ± 0.20
0.44 ± 0.49
0.77 ± 0.20
1.23 ± 2.87
Table 2: Cross-trial performance of NeuroFlowNet on iEEG signal generation.
Subject
Region
Temporal waveform
PSD waveform (0.5-50Hz)
Alpha PSD waveform (8-13Hz)
MAE (µV)
Corr
Cosine
Corr
Cosine
Corr
Cosine
Power MAPE (%)
S1
AHL
52.48 ± 25.26
0.32 ± 0.27
0.43 ± 0.24
0.71 ± 0.22
0.74 ± 0.20
0.17 ± 0.50
0.69 ± 0.19
3.00 ± 6.60
AL
67.56 ± 44.54
0.56 ± 0.23
0.63 ± 0.19
0.81 ± 0.19
0.83 ± 0.17
0.21 ± 0.52
0.69 ± 0.20
5.43 ± 16.05
ECL
67.11 ± 32.60
0.46 ± 0.24
0.55 ± 0.19
0.73 ± 0.23
0.76 ± 0.21
0.18 ± 0.50
0.68 ± 0.20
10.32 ± 21.51
LR
46.66 ± 23.64
0.83 ± 0.16
0.84 ± 0.14
0.93 ± 0.12
0.94 ± 0.11
0.40 ± 0.49
0.78 ± 0.18
1.15 ± 2.07
PHL
38.74 ± 17.30
0.84 ± 0.15
0.84 ± 0.13
0.93 ± 0.12
0.93 ± 0.11
0.41 ± 0.50
0.77 ± 0.19
0.71 ± 1.00
Table 3: Cross-session performance of NeuroFlowNet on iEEG signal generation.
Figure 6: Exemplar generated iEEG signals (orange) overlaid with ground truth iEEG signals (blue) for various MTL subregions, specifically showing a 200ms segment from Subject S6. The figure illustrates the performance of NeuroFlowNet in generating iEEG signals from EEG data across different anatomical targets, including anterior hippocampus (AHL/AHR), amygdala (AL/AR), entorhinal cortex (ECL/ECR), and parahippocampal gyrus (PHL/PHR).
Figure 7: Comparison of power spectral density (PSD) between ground truth iEEG signals (blue) and generated iEEG signals (orange) for a 200 ms segment from Subject S6. The figure shows the average PSD across all electrodes within each MTL subregion, including anterior hippocampus (AHL/AHR), amygdala (AL/AR), entorhinal cortex (ECL/ECR), and parahippocampal gyrus (PHL/PHR).
Figure 8: (a) Scatter plot of normalized true alpha power versus normalized generated alpha power. The red dashed line represents the ideal line (y = x), while the green solid line indicates the linear fit (y = 0.67x + 0.13). (b) Bland-Altman plot showing the difference in alpha power against the mean alpha power. The red dashed line indicates the mean difference (0.01), and the green and blue dashed lines represent the upper (95% CI, 0.28) and lower (95% CI, -0.27) limits of agreement, respectively.
Figure 9: Comparison of inter-channel correlation. Circular graphs show the connectivity patterns of (a) the original iEEG signals and (b) the generated iEEG signals. Both plots illustrate a 200 ms segment from Subject S6. Pairwise Pearson correlation coefficients are computed between all channels, and only the top 50 strongest absolute correlations are visualized for clarity.
Figure 10: Representative conditional sampling and uncertainty analysis for Subject S6. (a) For a fixed scalp EEG segment, K=20 independent latent samples generate multiple iEEG trajectories for channel mAHL1. The solid line denotes the sample mean, the shaded area denotes the empirical 90% predictive interval, and the dashed line denotes the ground-truth iEEG. (b) Across all validation segments of S6, each point represents one segment. Predictive uncertainty is defined as the mean sample variance across channels and time, and reconstruction error is defined as the MAE between the sample mean and the ground truth. Higher predictive uncertainty is strongly associated with larger reconstruction error ( ρ=0.858 , p=4.52×10−68 ).
Subject
Segments
Channels
Diversity RMSE
Corr. diversity
PICP 90
MPIW
Mean variance
Mean MAE
Mean Corr.
Unc.-error ρ
( μ V)
(Frobenius)
( μ V)
( μ V 2 )
( μ V)
S1
112
48
35.59
7.55
0.381
62.00
841.51
49.37
0.490
0.958 ( p=2.03×10−61 )
S6
231
64
28.56
8.64
0.432
51.57
434.66
35.78
0.599
0.858 ( p=4.52×10−68 )
S9
70
64
23.48
7.99
0.382
42.94
286.27
34.01
0.572
0.878 ( p=1.92×10−23 )
Table 4: Conditional sampling and uncertainty metrics on the validation set.
Matrix
Linear (1 × 1)
Shallow CNN
1D U-Net
Tiny Transformer
NeuroFlowNet (Ours)
EMAE(R)
0.426 ± 0.064
0.318 ± 0.032
0.302 ± 0.013
0.360 ± 0.080
0.288 ± 0.042
EF(R)
30.45 ± 6.45
23.37 ± 3.99
22.08 ± 2.57
26.04 ± 6.86
21.61 ± 4.69
Table 5: Functional connectivity fidelity (inter-channel correlation structure) comparison between NeuroFlowNet and regression baselines.
Electroencephalography (EEG) studies brain-generated electrical activity to understand cognition and support diagnosis, monitoring, and brain-computer interfaces.
Intracranial EEG (iEEG) provides high-fidelity neural recordings essential for clinical and brain-computer interface applications, but acquiring these signals requires invasive surgery. While recent studies have attempted to estimate iEEG from non-invasive scalp EEG, most rely on patient-specific models, creating a circular dependency: if surgery is required to collect training data, the non-invasive model offers limited practical benefit. In this study, we address the challenge of cross-subject iEEG reconstruction by predicting intracranial signals for unseen patients using models trained on other individuals. We propose CAST (Cross-Attention Spatial-Temporal Transformer), a machine learning framework that translates scalp EEG into multi-channel iEEG waveforms through a two-stage transfer learning strategy. First, a temporal encoder extracts multi-scale neural representations at three different resolutions. Then, because electrode placements vary substantially across patients, a channel-aware decoder is calibrated using only a few minutes of data from the target subject. We evaluated the proposed method using leave-one-subject-out cross-validation on two public datasets comprising 1,282 iEEG channels. Experimental results demonstrate that CAST reconstructs cortical signals located near the scalp surface substantially better than deep subcortical activity. In highly observable sensorimotor regions, the model achieved peak correlations of up to r=0.864 in the precentral gyrus. Furthermore, with a channel selection strategy, CAST obtained a mean correlation of r=0.545 on viable subjects, outperforming previous within-subject baselines. These findings indicate that cortical iEEG signals can be reconstructed for unseen subjects from scalp EEG without extensive patient-specific training, and that only a brief calibration phase is sufficient to adapt the model to new hardware configurations.
Tien-Dat Pham, Xuan-The Tran
HAI-Smartlink Research Lab, Anchi STE Company, Haiphong, Vietnam · School of Mechanical Engineering, Vietnam Maritime University, Haiphong, Vietnam
High-fidelity EEG generation is critical for alleviating data scarcity and addressing privacy constraints in large-scale neural modeling. Despite recent progress, most existing approaches formulate EEG generation via discrete denoising objectives, which inadequately reflect the inherently continuous temporal dynamics and spectral structure of neural activity. As a result, these methods often struggle to preserve long-range temporal dependencies and exhibit mismatches in the spectral and temporal structure of the generated signals. In this work, we argue that effective EEG generation requires models that operate directly on the continuous evolution of neural signals. We introduce Just EEG Transformer (JET), a generative framework based on conditional flow matching that models EEG as raw sequences evolving along continuous trajectories. By learning a smooth vector field that transports noise to the EEG data distribution, JET captures temporal continuity and transient dynamics without relying on discretized denoising schemes or domain-specific representations. To ensure that the learned dynamics remain consistent with key properties of EEG signals, we introduce principled constraints that preserve spectral structure, temporal stationarity, and signal-level statistics. Across three large-scale benchmarks, JET consistently achieves state-of-the-art performance, reducing TS-FID by over 40% compared to strong baselines. Extensive analyses show that JET captures key structural properties of neural dynamics, providing a scalable and principled approach to EEG generation. Project page: https://y-research-sbu.github.io/JET/ .
Yifan Wang, Yijia Ma, Wen Li +1
Stony Brook University · University of Texas Health Center at Houston.
Electroencephalography (EEG) has become one of the key modalities underpinning brain-computer interfaces (BCIs) due to its high temporal resolution, rapid responsiveness, non-invasiveness, low cost, and portability. However, EEG signals are substantially inferior to intracranial EEG (iEEG) in signal-to-noise ratio and local spatial resolution, whereas iEEG suffers from extremely limited clinical accessibility owing to its invasive nature, hindering widespread application. To address this challenge, this study proposes a unified data-and prior knowledge-driven framework for EEG-iEEG representational enhancement. Guided by the principle that "geometric structure dictates function", the framework maps static cortical anatomy onto dynamic constraints governing neural signal propagation and integrates general-purpose neural representations extracted by a pre-trained large EEG model to explicitly model signal transmission through the brain. Enhanced EEG signals are then synthesized via a multidimensional representation diffusion process. Numerous experimental results demonstrate that the generated enhanced EEG signals effectively recover the neural activity patterns lost during propagation through the brain. This finding indicates that the performance ceiling of BCIs is constrained not only by acquisition hardware but also by the depth to which the generative model resolves the mechanisms of neural signal propagation. Collectively, the proposed framework provides a viable pathway toward acquiring high-fidelity neural signals at low cost.
Yihang Dong, Changhong Jing, Shuqiang Wang
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences, Shenzhen, China. · University of Chinese Academy of Sciences, Beijing, China.