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.