CleanEEG is a comprehensive application that democratizes professional-grade EEG preprocessing for researchers and clinicians. Built on the proven MNE-Python ecosystem and industry-standard algorithms, it transforms complex signal processing workflows into an intuitive point-and-click interface.
Perfect for: Researchers transitioning from manual preprocessing, labs seeking standardized workflows, and anyone needing publication-ready EEG data without the programming overhead. CleanEEG bridges the gap between research-grade signal processing and practical usability, ensuring your EEG analysis starts with the cleanest possible data.
Built on the resting-state EEG preprocessing pipeline proposed by DISCOVER-EEG1—a peer-reviewed, standardized framework originally implemented in MATLAB—this Python implementation ensures reproducible, publication-ready results that align with established best practices in EEG research.
Below are two ways to set up a new environment and install all required dependencies: using pip (with a virtual environment) or conda.
- Clone or download the CleanEEG repository and navigate into it:
git clone https://github.com/aminkabir/cleaneeg
cd cleaneeg
- Create and activate a virtual environment:
# Create a new virtual environment named "cleaneeg"
python3 -m venv cleaneeg
# Activate the environment
# On Linux/macOS:
source cleaneeg/bin/activate
# On Windows (PowerShell):
.\cleaneeg\Scripts\Activate.ps1
# On Windows (cmd.exe):
# .\cleaneeg\Scripts\activate.bat
- Install all required packages from requirements.txt:
pip install --upgrade pip
pip install -r requirements.txt
- Create and activate a new conda environment from environment.yml:
conda update --name=base conda
conda env create -f environment.yml
conda activate cleaneeg
- Navigate into the CleanEEG directory (if not already there):
cd cleaneeg
- Launch the GUI:
python cleaneeg_gui.py
- Click "Select EEG Data Directory for Processing"
- Choose data format from dropdown (or use "Automatically find EEG files")
- Find data:
- "Find All Available EEG Data" - loads all compatible files
- "Find EEG Data with Specific Naming Convention" - filter by filename pattern
- Click "Import Data"2
- Select standard montage from dropdown (e.g., standard_1020)
- Or choose "Use Custom Montage" and load your own channel location file
- Preview appears in the right panel when you select a file
Check/uncheck the desired preprocessing options:
-
Line Noise Removal (DSS)3 - Remove 50/60 Hz interference
-
Bandpass Filter - Default: Highpass: 1 Hz - Lowpass: 100 Hz4
-
Downsample Data - Default: 500 Hz5
-
Bad Channel Rejection (PREP Pipeline)6
-
Independent Component Analysis (ICA)7
-
Auto-classify components (ICLabel)8: Muscle, Eye Blink, Heart Beat, Others
-
Bad Channel Interpolation9
-
Bad Time Segments Removal (ASR)10
- Select output format (Auto, BrainVision, EEGLAB, or EDF)11
- Click "Select Save Location" to choose output directory
- Check "Export Report" for detailed HTML preprocessing reports
- Click "Auto-Clean All Resting-State EEG"
- Monitor progress in the status bar
- Check log messages for real-time updates
For users new to EEG preprocessing or CleanEEG, open cleaneeg_tutorial.ipynb in Jupyter Notebook or JupyterLab. This tutorial provides:
-
Background on preprocessing steps.
-
Code examples illustrating each step (loading data, filtering, ICA, etc.).
-
Best practices for artifact detection and removal.
-
Exporting and inspecting cleaned data.
Running through the notebook ensures you understand how CleanEEG processes resting-state EEG and how to adjust parameters for your specific dataset.
Footnotes
-
https://nbara.github.io/python-meegkit/modules/meegkit.dss.html ↩
-
https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.filter ↩
-
https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.resample ↩
-
https://pyprep.readthedocs.io/en/latest/generated/pyprep.NoisyChannels.html ↩
-
https://mne.tools/stable/generated/mne.preprocessing.ICA.html ↩
-
https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.interpolate_bads ↩
-
https://nbara.github.io/python-meegkit/modules/meegkit.asr.html ↩
-
https://mne.tools/stable/generated/mne.export.export_raw.html ↩