EEG Preprocessing Software for ADHD Research in Children and Adolescents: Data Curation, Feature Extraction and an XGBoost Example
Authors/Creators
Description
This Python software uses Docker to assess the quality of task electroencephalography (EEG) recordings, preprocess the signals and extract features for research on attention-deficit/hyperactivity disorder (ADHD) in children and adolescents. It implements the workflow behind EEG Dataset for ADHD Research in Children and Adolescents: Preprocessed Task Recordings and Seven Families of Aligned Features: 669 eligible BALLADEER recordings from 156 participants, with 115 feature definitions or templates across seven families.
Version 1.1.0 adds a worked XGBoost example and its saved aggregate results. To reproduce the curation, start from the original recordings. To run the predictive example, start from the curated feature dataset. To inspect the saved results, neither dataset nor Docker is needed.
EEG curation: from recordings to verified outputs
The input is the original BALLADEER dataset, version 2. The workflow covers five conditions: the CogniFit cognitive assessment, Attention Robots, and Attention Slackline levels 1, 6 and 11.
- Assess raw signal quality. Audit the source files and summarise quality at the window, channel and recording levels before any offline preprocessing.
- Apply the documented eligibility decisions. The supplied label-blind selection records identify eligible recordings and channels approved for interpolation. Reusing these decisions does not repeat the original manual review or establish eligibility for another cohort.
- Preprocess continuous EEG. Process each continuous block independently so that filtering does not bridge gaps. Apply a 0.5–40 Hz band-pass filter, resample to 128 Hz, interpolate only approved channels, then apply an average reference.
- Check the processed signals. Compare quality measurements before and after preprocessing and check recording duration, sample counts and block boundaries.
- Extract features on matched intervals. Use shared 2-, 4-, 8- and 16-second windows with 50% overlap. Windows never cross recording gaps. Each estimator is used only at the durations it supports.
- Verify outputs. Check the links between processing stages and verify the recorded checksums. Shared identifiers link feature measurements to their recording and analysis interval.
Seven EEG feature families
- Temporal and statistical features
- Conventional spectral features
- Aperiodic spectral features
- Complexity and fractal features
- Functional connectivity features
- Graph and network features
- Time-frequency decomposition features
The 115 definitions or templates do not correspond to 115 predictor columns: a definition can yield values for multiple channels, channel pairs or other indexed positions. Graph measures use the corresponding connectivity estimates. The configured aperiodic spectral analysis uses 8- and 16-second windows. Calculation states distinguish, for example, an unsupported duration, an absent spectral peak and a mathematically undefined value; none should be interpreted as zero.
Predictive utility: an XGBoost example
A separate workflow uses features from all seven families on eight-second windows to compare XGBoost with a predictor that uses no EEG. Within each fold, this comparator assigns every held-out participant the same probability: the proportion of training participants recruited into the ADHD group. The four overlapping task cohorts are Attention Robots and Attention Slackline levels 1, 6 and 11. CogniFit is part of curation but not this predictive comparison.
The saved evaluations used three repetitions of five outer participant folds, with four inner folds for model selection. All windows from a participant stayed together; imputation, scaling, feature selection and tuning used training data only. The target was recruitment group, not an assessment-derived diagnosis. The bundled aggregate results are existing evaluations, not a new experiment or an independent replication. Their intervals condition on fixed predictions.
Getting started
- Inspect the saved example: from
utility/, run./run.sh reference-results. This reads the bundled aggregate evidence without downloading EEG, building a container or fitting a model. - Reproduce curation: follow
README.mdanddocs/REPRODUCTION.md. Unpack the original Figshare data and point--input-dirto the directory containingusers_demographics.jsonand the pseudonymous participant folders. Preserve the original filenames and task subdirectories. The launcher mounts the input read-only; supply a separate writable output directory. Follow the Docker build and self-test instructions, then run one processing stage, one task and feature family, or the complete workflow. Verify the outputs and retain the manifests. - Run the XGBoost example: follow
utility/README.mdfor the curated dataset layout, separate Docker environment and execution command. The workflows use Linux containers and do not require a GPU. Full curation and predictive evaluation need substantial disk space and computation; consult the resource guidance before starting.
Package contents and reproducibility
The software archive contains Python source, configurations, dependency files, Dockerfiles, shell launchers, tests, documentation, frozen selection records with pseudonymous recording identifiers, and aggregate predictive results. Running curation produces preprocessed EEG in MNE-FIF format, feature tables, quality summaries, calculation states, configuration snapshots, manifests and checksums. The original EEG recordings, generated derivative dataset, participant-level predictions and fitted models are not distributed in the software archive.
SOURCE_REVISION identifies the base source revision; PACKAGE_AUDIT.json records whether the build included uncommitted changes. MANIFEST.sha256 authenticates packaged files. Retain these records when documenting a run.
Research uses and limits
Researchers can reproduce the curation, compare feature estimators on identical EEG intervals, or study redundancy and selection stability using filter, wrapper or embedded selection methods. For teaching, a single task and feature family provides a manageable example of signal processing and provenance. Predictive modelling is downstream of curation and does not determine which recordings or features are released.
The thresholds and processing choices were established for BALLADEER. Applying them to a different cohort requires adaptation and validation. Preprocessing does not guarantee artefact-free EEG, and common sampling does not make devices or montages equivalent. The overlapping cohorts and task-specific acquisition settings limit between-task interpretation. The XGBoost example illustrates reuse, not diagnostic validity or clinical utility.
Licensing and citation
Software is licensed under BSD-3-Clause. Saved aggregate results and new release documentation are licensed under CC BY 4.0. The original and curated datasets retain their own licences. Cite this software version and the data used separately. Machine-readable citation metadata and licence details are included in CITATION.cff and LICENSES.md.
Files
eeg-qc-preprocessing-feature-extraction-1.1.0.zip
Additional details
Related works
- Is supplement to
- Dataset: 10.5281/zenodo.21982978 (DOI)
Funding
- Conselleria d'Educació, Cultura i Universitats
- Subvenciones para estancias de personal investigador doctor en centros de investigación radicados fuera de la Comunitat Valenciana para el ejercicio 2026 - (CIBEST-2026) CIBEST/2026/181
- Conselleria de Educación, Cultura, Universidades y Empleo - Generalitat Valenciana
- A Big dAta analytical pLatform for the dIfferential Diagnosis of Attention deficit hyperactivity Disorder (ADHD) and Autism Spectrum Disorder (ASD) - (BALIDA-AA) CIPROM/2024/13
- Ministerio de Ciencia, Innovación y Universidades
- Potenciando los Ecosistemas de Compartición de Datos con un Enfoque Multidimensional Analítica de Datos en Entornos Federados - (KOSMOS-UA). PID2024-155363OB-C43