Low-latency closed loop electroencephalography sleep neurofeedback inside the MR scanner
OA Version
Citation
Abstract
Close loop auditory stimulation (CLAS) is an experimental protocol in which subject fall asleep while wearing an electroencephalography (EEG) headset, and the EEG data is used in real-time to provide short burst of auditory stimuli, timed to coincide with the peaks of sleep slow-waves, a key marker of deep sleep. This protocol has attracted attention because it was found to improve performance on sleep and memory tasks upon waking. However, the mechanisms underlying CLAS have remained mysterious. We hoped to learn more about CLAS by using simultaneous EEG and functional magnetic resonance imaging (fMRI), which has not been done before. Simultaneous EEG and (fMRI) provide complementary advantages for studying the brain. EEG offers high temporal resolution, which is needed to identify short-duration neurological markers, such as slow waves and spindles during sleep, while fMRI offers high spatial resolution and the ability to measure subcortical brain structures. However, EEG-fMRI also presents challenges which would otherwise make the proposed experiment unfeasible. fMRI creates high amplitude artifacts in EEG signals which must be removed before those signals can be used to time the auditory stimuli necessary for CLAS. While techniques for removing these artifacts do exist, existing techniques are not suitable for experiments that require both low-latency and high accuracy de-noising, such as the one we describe. To overcome this obstacle, we built an open-source software package that removed MR artifacts with lower latency and greater accuracy that had been previously possible called EEG Low-Latency Artifact Mitigation Acquisition Software (EEG-LLAMAS). To do this, we used an EEG reference layer to isolate some EEG channels from the scalp so that they only collected artifact signals, and then used a Kalman filter to continuously learn weights in order model the artifact signal, so that it could be subtracted from the remaining EEG channels. We found that EEG-LLAMAS was able to remove artifacts with less than 50ms of latency on average, and that it more accurately removed artifacts than existing real-time artifact removal algorithms. Although it does not remove artifacts perfectly, EEG-LLAMAS allowed us remove to de-noise with greater speed and reliability than would otherwise be possible.
An additional challenge that prevented us from performing CLAS inside the MR scanner is that previous algorithms for stimulus timing are not well suited to that noisy environment. Even with the benefit of LLAMAS, EEG signals collected with simultaneous fMRI are noisier than those collected without it. This makes the precise timing needed to ensure that auditory stimuli occur during slow-wave peaks difficult, because these peaks tend to be less well defined. To make more accurate stimulus timing possible, we trained and validated a recurrent neural network (RNN) using noisy EEG data collected inside the scanner to predict future slow-wave phase. When tested on held-out data, we found that our RNN was able to predict slow-wave phase with a mean error of 44.1 degrees.
With these developments, we were able to proceed with our CLAS experiment. We recruited 14 healthy adults to sleep inside the scanner while wearing an EEG headset. While they slept, we used LLAMAS and our RNN to play auditory and sham stimuli in phase with their slow-waves. We found that our stimuli increased slow-wave duration compared to sham, and found that the stimulus also increased cerebrospinal fluid (CSF) flow through the 4th ventricle into brain. In addition, we found that both of these effects were dependent upon the phase at the stimulus was delivered; those stimuli delivered near a slow wave peak had a greater effect than those delivered near a trough. Finally, we found a widespread pattern of blood oxygen level-dependent (BOLD) deactivation in the cortex and subcortex, including both in task-relevant areas like the transtemporal lobe, which contains much of the auditory cortex, and other areas like V1, which are less obviously related to the task.
This experiment shows that it is possible to perform complex and technically challenging EEG neurofeedback experiments inside the MR scanner with low latency, by using appropriate pre-processing and computational tools. We also showed that CLAS is linked to increased CSF flow, a novel discovery that could shed light on its mechanisms, and further supports our understanding of the relationship between slow waves and CSF.
Description
2026
License
Attribution-NonCommercial 4.0 International