Abstract
MNE-ICALabel is an open-source Python package that integrates the ICLabel automated artifact detection model into the MNE-Python ecosystem. By reimplementing the original MATLAB-based model in PyTorch, the authors provide a robust, maintainable solution for automatically classifying independent components in EEG and MEG data, ensuring software longevity and cross-platform consistency.
Introduction
Recording brain activity via scalp electroencephalography (EEG) or magnetoencephalography (MEG) is inherently noisy. Sensors capture not only neural signals but also physiological artifacts such as heartbeats, eye blinks, and muscle movements. To isolate neural activity, researchers frequently employ Independent Component Analysis (ICA) to decompose recordings into independent components. Traditionally, identifying which components represent artifacts requires manual inspection by experts—a process that is time-consuming, subjective, and difficult to scale for large datasets.
While the ICLabel tool was developed in 2019 to automate this classification, its original implementation was restricted to MATLAB and relied on an unmaintained version of TensorFlow. This dependency created significant barriers for researchers using Python-based workflows and raised concerns regarding long-term software stability.
Methods
The authors developed MNE-ICALabel to bridge the gap between the ICLabel model and the MNE-Python ecosystem. The core technical contribution involves a PyTorch Reimplementation of the original ICLabel neural network. Migrating from an obsolete TensorFlow version to PyTorch ensures compatibility with modern deep-learning hardware and software environments.
The tool is designed for seamless MNE-Python Integration, allowing researchers to incorporate automated labeling into existing analysis pipelines with minimal code overhead. To ensure scientific validity, the authors performed rigorous validation for parity, confirming that the Python implementation produces outputs that match the original MATLAB version exactly.
Datasets
MNE-ICALabel utilizes pre-trained weights from the original ICLabel dataset (Pion-Tonachini et al., 2019). This dataset was constructed through a large-scale crowdsourcing effort where experts labeled thousands of ICA components, providing the ground truth necessary for the neural network to distinguish between brain signals and various artifact types.
Results and Discussion
The primary achievement of this work is the deployment of a stable, high-performance Python package that maintains 100% parity with the original MATLAB ICLabel output. This ensures that researchers transitioning to Python-based environments receive consistent and reliable results.
Beyond technical parity, the project emphasizes software sustainability. By moving the model to PyTorch and integrating it into the community-supported MNE-Python ecosystem, the authors prevent the tool from becoming "bit-rotted." Furthermore, the standardized API lowers the barrier to entry for automated ICA, promoting transparency and reproducibility across different research laboratories.
Limitations and Future Work
While MNE-ICALabel provides a powerful automated solution, the authors note several areas for future development. These include improving model robustness across different recording hardwares and sensor densities. Future work will also focus on model evolution to better distinguish subtle neural signals from complex artifacts and establishing community benchmarks to facilitate the testing of new labeling models.
Summary updated