Hd-SleepCleaner: Open-source artifact removal for high-density sleep EEG
How do we keep sleep EEG data clean across hundreds of channels?
High-density electroencephalography (hd-EEG) with up to 256 channels has become an indispensable tool in sleep research, enabling the study of local brain activity, slow waves, sleep spindles, and their their various functional roles. However, the sheer volume of data produced by overnight hd-EEG recordings — across many channels and hours — makes the identification and removal of artifacts a substantial challenge.
Verfügbar auf GitHub: github.com/HuberSleepLab/Hd-SleepCleaner
Hd-SleepCleaner is a free, open-source MATLAB-based tool specifically designed to address this problem. It provides a graphical user interface (GUI) that lets researchers screen all channels and epochs simultaneously, based on four sleep-specific signal quality markers (SQMs): delta power, beta power, maximum amplitude deviation, and raw delta power. These markers are sensitive to the artifact types most common in sleep EEG — eye movements, body movements, sweat artifacts, and muscle noise — and are evaluated in both the original and mean-referenced EEG signal. The tool was validated on 54 overnight hd-EEG recordings and, in combination with epoch-wise interpolation, achieved a clean-data rate of approximately 99% of all NREM epochs. The full pipeline proceeds in several steps:
- Automatic outlier detection: Two built-in algorithms flag extreme outlier values channel-wise and epoch-wise, removing the most obvious artifacts automatically.
- Manual review with EEG and topography visualization: The researcher inspects conspicuous SQM values, views the raw EEG trace and topographic map for each epoch, and decides whether to mark it as artifactual.
Epoch-wise interpolation: Bad channels are interpolated only in the epochs where they are artifactual, recovering the maximum amount of usable data without discarding whole channels or epochs.
Research group
Group Leader: Prof. Dr. Reto Huber
Project Leader: Sven Leach
Co-author: Georgia Sousouri
Institution: Universitäts-Kinderspital Zürich
Universität Zürich
Funding
Schweizerischer Nationalfonds (SNF, Projektnummer 320030_179443)