NeuroStimFlow: A Conditional Flow Matching Emulator for Biophysical Neural Circuit Dynamics in Depression and Brain Stimulation
Abstract
Biophysical neural simulators allow systematic study of changes in brain activity under different disorder conditions and treatments. However, these simulations are computationally expensive, which limits large-scale exploration, optimization, and application of machine learning methods. To address this challenge, we developed a two-stage electroencephalogram (EEG) surrogate emulator based on Conditional Flow Matching (CFM). We used an EEG data set (40, 000 Hz) generated by a high-fidelity biophysical simulator that models healthy and depression-related neural dynamics and transcranial electrical stimulation with varying current amplitudes and frequencies as treatment: 1) a disorder-conditioned CFM learns the underlying EEG and disorder-related dynamics, serving as a backbone network; 2) residual adapters are trained to capture treatment-induced changes in brain activity. To model realistic EEG transitions while preserving disorder-relevant signal, we trained a 100 Hz CFM model, achieving realism scores of 0.807–0.841 and a disorder-classification AUC of 0.830. To preserve high-frequency treatment effects, we trained a 500 Hz model that retained disorder-relevant information but at the cost of decreased spectral realism. Using this higher-resolution model as the backbone, Low-Rank Adaptation-style residual adapters generated the most plausible treatment-conditioned EEG endpoints. Therefore, disorder-conditioned flow matching provides a useful surrogate for EEG dynamics and a promising foundation for modeling treatment responses, although reliable prediction of therapeutic outcomes remains a distinct transdisciplinary challenge.