APICE-Py: An Open-Source MNE-Python Pipeline for Scalable EEG Preprocessing
Nicolo Formento MolettaiD, Ana FlóiD, Ghislaine Dehaene‐LambertziD, Jhunlyn LorenzoiD
Abstract
Electroencephalography (EEG) is fundamental to cognitive neuroscience as it provides a direct measure of human neural activities with millisecond precision. Its noninvasive nature allows for the study of brain function across diverse age groups and experimental contexts--from newborns to adults, and from tightly controlled laboratory environments to more naturalistic real-world settings. However, EEG signals--especially those recorded from infants--are highly prone to noise and arti-facts, posing significant challenges for data analysis. To address these issues, we present APICE-Py (Automated Preprocessing for Infants Continuous EEG), an open-source preprocessing pipeline originally designed as a matlab toolbox for infant EEG and now re-implemented in Python to support scalable and flexible analysis across developmental and adult datasets. APICE-Py is built upon three core principles: (i) adaptive artifact detection on continuous data using data-driven thresholds rather than fixed cutoffs; (ii) hierarchical artifact correction, combining short-segment correction via Principal Component Analysis (PCA) with broader segment and continuous data correction using Spherical Spline Interpolation (SSI); and (iii)transparent reporting, providing comprehensive quality logs and decision-tracking to ensure reproducibility and informed analysis. We summarize the underlying algorithms, release an implementation compatible with common EEG formats, and demonstrate its use on three datasets spanning neonates, 5-month-old infants, and child-parent hyperscanned data, acquired using high-density wet electrodes and mobile gel-based EEG systems. When benchmarked against the original MATLAB implementation, APICE-Py achieved comparable levels of data quality and trial retention. While the original pipeline was developed for early developmental EEG (e.g., infants), we show that the pipeline further extends its applicability to both children and adult datasets, enabling robust preprocessing across a broad age range. Moreover, it supports data acquired using a variety of EEG configurations and experimental settings, highlighting its flexibility across age groups, hardware systems, and paradigms. The APICE-Py source code and documentation are freely available at https://github.com/neurokidslab/apice-py.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 0
- Organism
- Assay
- Research Focus
- Approach
In-depth summary
Claude Opus 5.5 · xhigh effort · 8 Nov 2026 · from the full text of version 1 (27 Jul 2026) · CC BY 4.0
A Python/MNE port of the APICE infant EEG preprocessing pipeline flags more artifacts than the MATLAB original but gives similar ERP measurement error in neonates and 5-month-olds.
Infant and other developmental EEG is heavily contaminated by artifacts, and many existing pipelines rely on ICA component rejection, fixed amplitude thresholds, or trained models and calibration periods that suit short, noisy infant recordings poorly. APICE-Py brings the adaptive-threshold, ICA-free APICE approach from MATLAB/EEGLAB into MNE-Python and tests it beyond infants, on children and adults recorded with a low-density gel-based mobile system.
Key results
SuggestedAPICE-Py discarded more epochs than MATLAB APICE, but its ERP data quality (standardized measurement error, SME) and its grand-average ERP amplitudes were similar to MATLAB APICE in neonates and 5-month-olds.
SME, APICE-Py vs APICE: Dataset 1 (neonates, 250–350 ms, central ROI) 0.51 ± 0.12% for both, p = 0.75; Dataset 2 (5-month-olds, 550–560 ms, occipital ROI) 3.92 ± 2.01% vs 3.42 ± 1.28%, p = 0.09. Mean ERP: 0.44 vs 0.39 µV (Dataset 1); 1.84 vs 1.96 µV (Dataset 2). · B.1. Standardized measurement error (SME); D. Standardized Measurement Error (SME)
ShownWith identical parameters (k = 3), the Python port flagged a larger share of bad samples than MATLAB APICE. The difference was significant in 5-month-olds and in 7-year-old children.
Bad channel-and-time (BCT) percentage, Python vs MATLAB: Dataset 2, 30.09 ± 13.62% vs 25.81 ± 10.58%, p = 0.005; Dataset 3a (children), 10.52 ± 14.46% vs 8.28 ± 5.33%, p = 0.025. Python also detected more bad channels in Dataset 2. Tests were paired t-tests or Wilcoxon signed-rank tests, depending on normality. · C. Data Retention
ShownUnder the same epoch-rejection criteria, APICE-Py kept significantly fewer epochs than the MATLAB version. This fits with its higher artifact detection on continuous data.
Epoch retention, APICE-Py vs APICE: Dataset 1 (24 neonates) 86.50 ± 8.22% vs 90.84 ± 7.13%, p < 0.001; Dataset 2 (26 infants aged 5 months) 75.57 ± 15.03% vs 84.38 ± 15.16%, p < 0.001. · A. Datasets Description; D. Standardized Measurement Error (SME)
SuggestedOn 32-channel mobile hyperscanning recordings of children and parents interacting freely, APICE-Py output had higher mean SNR than MATLAB APICE. A particularly noticeable difference was at the prefrontal electrodes Fp1 and Fp2, where MATLAB SNR was substantially lower.
Global SNR (0.2–40 Hz, 1-minute windows with 10-second overlap), APICE-Py vs APICE: children 0.68 dB vs –0.47 dB; adults –0.29 dB vs –1.84 dB; 31 child–parent pairs. No statistical test is reported for this comparison. · A. Datasets Description; B.2. Signal-to-Noise ratio (SNR); E. Signal-to-Noise Ratio (SNR)
SuggestedFor short segments, MNE's interpolate_bads was replaced with a custom parallelized spherical spline interpolation. This made runtime grow much more slowly as artifact load increased, although MATLAB was still the fastest.
Test: one Dataset 2 recording (128 channels x 250 seconds) with simulated artifacts on 10% to 50% of electrodes (1 to 10 segments of 0.5 to 10 s each), using the same BCT matrices for all versions. Pure MNE-Python runtime rose steeply and almost linearly; the custom version's slope was much flatter; MATLAB was lowest and most stable. Absolute times are not given in the text. · B.3. Processing time; F. Computational Time
Methods, data and reproducibility
APICE (MATLAB/EEGLAB) was re-implemented on MNE-Python. Adaptive Tukey thresholds (k = 3) flag artifacts in continuous data; these are corrected in stages by target PCA and spherical spline interpolation, and bad epochs are then rejected. Both versions were run with identical settings on three EEG datasets and compared on artifact rates, epoch retention, SME, SNR and interpolation runtime.
- Dataset 1: auditory syllable task in full-term neonates during sleep or quiet rest; 128-electrode EGI HydroCel net, 250 Hz, 216 trials each · human · n = 24 healthy full-term infants (11 males)
- Dataset 2: visual association task in 5-month-old infants; 128-channel EGI HydroCel net, 500 Hz · human · n = 26 (12 males)
- Dataset 3: hyperscanning EEG during a collaborative number-puzzle task, (a) 7-year-old children and (b) their parents; synchronized 32-channel gel-based Smarting Pro, 500 Hz · human · n = 31 child–parent pairs
- Runtime benchmark: one Dataset 2 recording with simulated artifact segments on 10% to 50% of electrodes · human · n = 128 channels x 250 seconds
- Methods & tools
- APICE-Py, APICE (MATLAB/EEGLAB), MNE-Python, EEGLAB, MATLAB, MNE interpolate_bads, EGI HydroCel net (128 channels), Smarting Pro (mBrain-Train, 32 channels), principal component analysis (target PCA), spherical spline interpolation
- Reproducibility gaps
- There is no data availability statement and there are no accessions for the three EEG datasets. Software versions and the hardware used for the runtime benchmark are not reported, and runtimes appear only in a figure.
Limitations (5)
- There is no ground-truth EEG signal, so the authors cannot say whether APICE-Py's extra artifact flags mean better sensitivity or over-rejection compared with MATLAB APICE. · stated by the authors
- MNE-Python and EEGLAB implement filtering and interpolation differently, so the authors expect small numerical discrepancies between the two implementations. · stated by the authors
- Lower epoch retention in APICE-Py could reduce statistical power and increase ERP variability, although SME did not rise significantly. · stated by the authors
- APICE-Py is validated only against the authors' own MATLAB version, with no comparison to other pipelines (e.g., HAPPE, MADE, NEAR). The 'comparable' SME result rests on non-significant tests in 24 and 26 infants, with no equivalence test. · noted in this summary
- The runtime test uses a single recording with simulated artifact tags and gives no absolute times, hardware or software versions. The SNR comparison in Dataset 3 has no statistical test. · noted in this summary
Who should read:Read this if you preprocess infant, child or naturalistic hyperscanning EEG in Python and want an ICA-free, adaptive-threshold pipeline whose outputs were checked against the original MATLAB APICE.
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Automated Pipeline for Infants Continuous EEG (APICE): a flexible pipeline for developmental studies
Ana Fló, Giulia Gennari, … Ghislaine Dehaene‐Lambertz·Developmental Cognitive NeurosciencePeer-reviewed·Jan 25, 2022
- The Maryland Analysis of Developmental EEG (MADE) Pipeline
Ranjan Debnath, George Arthur Buzzell, … Nathan A. Fox·PsychophysiologyPeer-reviewed·Apr 15, 2020
- RELAX-Jr: An Automated Pre-Processing Pipeline for Developmental EEG Recordings
Aron T. Hill, Peter G. Enticott, … Neil Wayne Bailey·Human Brain MappingPeer-reviewed·Oct 1, 2024
- PyLossless: A non-destructive EEG processing pipeline
Scott Huberty, James A. Desjardins, … Christian O’Reilly·Behavior Research MethodsPeer-reviewed·Jul 6, 2026
- Automatic classification of ICA components from infant EEG using MARA
Ira Marriott Haresign, Emily Phillips, … Sam V. Wass·Developmental Cognitive NeurosciencePeer-reviewed·Oct 22, 2021
- AUTOMAGIC: Standardized Preprocessing of Big EEG Data
Andreas Pedroni, Amirreza Bahreini, Nicolas Langer·NeuroImagePeer-reviewed·Jun 21, 2019