a Neural Network Framework for Inferring MEG Spectra
My Master’s thesis with the Brain Networks Lab at UCSF focused on improving how we estimate parameters in computational models of the human brain, specifically using data from magnetoencephalography (MEG). These models help researchers understand how the brain’s structure relates to its function, which is essentially how different regions of the brain connect and interact.
Full thesis can be found on Google Scholar.
Early functional changes in neurological diseases such as autism, schizophrenia, epilepsy and dementia, are more readily and sensitively measured using MEG, which is a non-invasive way of measuring magnetic fields caused by direct neural activity with high temporal resolution. As seen below, the MEG power spectrum for healthy controls and subjects with Alzheimer’s disease presenting with various cognitive deficiencies is noticeably different, especially around the alpha band of frequencies (8-12 Hz), which is thought to represent resting-state brain activity
Understanding how the brain’s structural wiring gives rise to its functional dynamics is a central challenge in neuroscience, and interpreting this relationship through MEG could help assess diagnosis of neurocognitive disorders and predict outcomes in a fast manner.
Traditional models, such as neural mass
I worked with the spectral graph model (SGM), a relatively new and efficient approach proposed by Raj et al
Originally, parameter estimation in this model relied on Markov chain Monte Carlo (MCMC) methods
The architecture of the FCNN built with Keras/TensorFlow
consisted of three hidden layers, with the last layer comprising five nodes for each of the five global parameters for SGM: $\tau_e$, $\tau_i$, $\alpha$, $speed$, and $\tau_c$.
The dataset used to train the neural network was composed of 230,400 MCMC-simulated MEGs, consisting of spectra for the 86 parcellated regions of the brain, divided into 40 frequency bands, and their corresponding five global parameters. This simulated data was then split into a training set of 184,400 MEGs and an unseen validation set of 46,000 MEGs that was used to evaluate FCNN performance. Training was run for 200 epochs on the Extreme Science and Engineering Discovery Environment (XSEDE) cluster Comet, hosted by the San Diego Supercomputer Center at UC San Diego, through allocation TG-IBN180015
The fully connected neural network (FCNN) trained on MCMC-simulated MEG data was able to accurately predict the majority of SGM parameters ($\tau_e$, $\alpha$, $speed$; $R^2>0.84$). While some parameters ($\tau_i$ and $\tau_c$) had slightly higher variance in prediction and signs of overfitting, the overall fidelity was preserved, and model behavior under predicted parameters was consistent with MCMC-derived ground truth.
The FCNN predicted parameters in less than one second, compared to MCMC methods that can take hours to days, depending on the data and convergence requirements. This massive improvement in inference time opens up potential real-time or near real-time applications for functional neuroimaging analysis.
Parameters predicted by the neural network were plugged back into the SGM, and the resulting simulated functional connectivity patterns closely matched those from MCMC-optimized parameters. This indicates that even with faster predictions, the neurophysiological integrity of the model output is maintained, making the neural network approach viable for scientific and clinical use.
This thesis demonstrates the potential of using computational models to generate large-scale datasets for training deep neural networks, specifically in the context of inferring model parameters from MEG power spectra. While simulated data was successfully leveraged, differences from experimental MEG recordings remain a limitation.
The neural network trained in this study showed promise on simulated data but would benefit from longer training and integration of real MEG data for improved generalizability. Alternative architectures, such as CNNs or GANs, and further hyperparameter tuning may also enhance performance and efficiency. Lastly, this framework lays the groundwork for real-time parameter inference and potential clinical applications in distinguishing between healthy individuals and those with neurocognitive disorders based on MEG data.
I’d like to acknowledge Dr. Pablo Damasceno for simulating the data necessary for this work and his mentorship throughout this entire project and Dr. Xihe Xie for his work developing the SGM further.