eegFloss: A Python package for refining sleep EEG recordings using machine learning models

πŸ“… 2025-07-08
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF

career value

225K/year
πŸ€– AI Summary
Sleep EEG analysis is highly susceptible to both endogenous device-related and exogenous environmental noise, leading to erroneous automatic sleep staging and inaccurate scoring. To address this, we propose an end-to-end, open-source quality control framework. First, we introduce *eegUsability*, a deep learning model trained on multi-subject, multi-night manually annotated data, achieving high recall (94%) for usable signal detection and strong cross-subject generalizability (F1 = 0.85, Cohen’s ΞΊ = 0.78). Second, we develop *eegMobility*, a model enabling fully automated bed-time detection. Together, these components enable integrated artifact filtering, sleep staging, and statistical analysis while maintaining compatibility across diverse EEG acquisition devices. The framework significantly enhances data reliability and automatic analysis accuracy in large-scale sleep studies.

Technology Category

Application Category

πŸ“ Abstract
Electroencephalography (EEG) allows monitoring of brain activity, providing insights into the functional dynamics of various brain regions and their roles in cognitive processes. EEG is a cornerstone in sleep research, serving as the primary modality of polysomnography, the gold standard in the field. However, EEG signals are prone to artifacts caused by both internal (device-specific) factors and external (environmental) interferences. As sleep studies are becoming larger, most rely on automatic sleep staging, a process highly susceptible to artifacts, leading to erroneous sleep scores. This paper addresses this challenge by introducing eegFloss, an open-source Python package to utilize eegUsability, a novel machine learning (ML) model designed to detect segments with artifacts in sleep EEG recordings. eegUsability has been trained and evaluated on manually artifact-labeled EEG data collected from 15 participants over 127 nights using the Zmax headband. It demonstrates solid overall classification performance (F1-score is approximately 0.85, Cohens kappa is 0.78), achieving a high recall rate of approximately 94% in identifying channel-wise usable EEG data, and extends beyond Zmax. Additionally, eegFloss offers features such as automatic time-in-bed detection using another ML model named eegMobility, filtering out certain artifacts, and generating hypnograms and sleep statistics. By addressing a fundamental challenge faced by most sleep studies, eegFloss can enhance the precision and rigor of their analysis as well as the accuracy and reliability of their outcomes.
Problem

Research questions and friction points this paper is trying to address.

Detects artifacts in sleep EEG recordings using ML
Improves accuracy of automatic sleep staging
Provides tools for EEG data refinement and analysis
Innovation

Methods, ideas, or system contributions that make the work stand out.

Python package for EEG artifact detection
Machine learning model eegUsability
Automatic time-in-bed detection
πŸ”Ž Similar Papers
No similar papers found.
N
Niloy Sikder
Donders Institute for Brain, Cognition and Behaviour, Radboud University Medical Center, Nijmegen, The Netherlands; Faculty of Technology and Bionics, Rhine-Waal University of Applied Sciences, Kleve, Germany.
Paul Zerr
Paul Zerr
Donders Institute, Radboud Universiteit Nijmegen
sleep & lucid dreamingbig health datapsychophysics eye movementsBCI/EEGbrain stimulation
M
Mahdad Jafarzadeh Esfahani
Donders Institute for Brain, Cognition and Behaviour, Radboud University Medical Center, Nijmegen, The Netherlands
Martin Dresler
Martin Dresler
Donders Sleep & Memory Lab
Sleep
M
Matthias Krauledat
Faculty of Technology and Bionics, Rhine-Waal University of Applied Sciences, Kleve, Germany