EITransformer: A Neurophysiology-Constrained Gray-Box Transformer for High-Fidelity EEG Generation
Abstract
Understanding and simulating spontaneous brain activity is a central goal in neuroscience. Conventional neural mass models are interpretable but rely on fixed equations, which limits their ability to capture individual-specific nonlinear dynamics. Purely data-driven approaches fit data well but ignore the critical neurophysiological constraint of excitation-inhibition balance. To reconcile interpretability and flexibility, we propose EITransformer, a high-fidelity EEG-generation framework based on physics-enhanced gray-box modeling. The architecture integrates an excitatory-inhibitory (E-I) linear layer into the Transformer’s core computation and enforces weight sign separation via a Dale’s mask, thereby constraining the solution space to a biologically plausible subspace. Training minimizes a joint time-frequency loss that combines mean squared error in the time domain with mean squared error in the complex FFT frequency domain. On the 64-channel EmoEEG-MC emotion dataset, EITransformer outperforms existing models across multiple metrics. The model synthesizes recognizable EEG waveforms at signal-to-noise ratios as low as 5 dB, and generated dynamics under half-channel masking closely match full-channel results. Ablation experiments show that the EI constraint, the frequency-domain loss, and the sign-enforcing Dale mask each provide substantial performance gains. Layer-by-layer analysis of inhibition rates reveals emotion-dependent hierarchical inhibitory regulation, offering interpretable gray-box evidence for underlying neural mechanisms.