Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ @article{delorme2012independent
doi = {10.1371/journal.pone.0030135}
}

@inproceedings{makeig1995independent,
title = {Independent component analysis of electroencephalographic data},
author = {Makeig, Scott and Bell, Anthony J. and Jung, Tzyy-Ping and Sejnowski, Terrence J.},
booktitle = {Advances in Neural Information Processing Systems},
volume = {8},
pages = {145--151},
year = {1995}
}

@inproceedings{vigario1997independent,
title = {Independent component analysis for identification of artifacts in magnetoencephalographic recordings},
author = {Vig{\'a}rio, Ricardo and Jousm{\"a}ki, Veikko and H{\"a}m{\"a}l{\"a}inen, Matti and Hari, Riitta and Oja, Erkki},
booktitle = {Advances in Neural Information Processing Systems},
volume = {10},
pages = {229--235},
year = {1997}
}

@incollection{iversen2019megeeg,
title = {{MEG/EEG} data analysis using {EEGLAB}},
author = {Iversen, John R. and Makeig, Scott},
booktitle = {Magnetoencephalography: From Signals to Dynamic Cortical Networks},
pages = {391--406},
year = {2019},
publisher = {Springer International Publishing},
address = {Cham}
}

@article{delorme2004eeglab,
title = {{EEGLAB}: an open source toolbox for analysis of single-trial {EEG} dynamics including independent component analysis},
author = {Delorme, Arnaud and Makeig, Scott},
Expand Down Expand Up @@ -188,3 +216,23 @@ @misc{mlx2023
note = {Version 0.x, accessed 2026},
howpublished = {\url{https://github.com/ml-explore/mlx}}
}

@inproceedings{frank2023optimal,
title = {An exploration of optimal parameters for efficient blind source separation of {EEG} recordings using {AMICA}},
author = {Frank, Gwenevere and Shirazi, Seyed Yahya and Palmer, Jason and Cauwenberghs, Gert and Makeig, Scott and Delorme, Arnaud},
booktitle = {2023 IEEE 23rd International Conference on Bioinformatics and Bioengineering (BIBE)},
pages = {205--210},
year = {2023},
publisher = {IEEE},
doi = {10.1109/BIBE60311.2023.00040}
}

@inproceedings{frank2025sufficient,
title = {Quantitative exploration of sufficient data quantities for {EEG} decomposition using {AMICA}},
author = {Frank, Gwenevere and Shirazi, Seyed Yahya and Palmer, Jason and Cauwenberghs, Gert and Makeig, Scott and Delorme, Arnaud},
booktitle = {2025 12th International IEEE/EMBS Conference on Neural Engineering (NER)},
pages = {532--536},
year = {2025},
publisher = {IEEE},
doi = {10.1109/NER61569.2025.11588993}
}
25 changes: 13 additions & 12 deletions paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ bibliography: paper.bib

# Summary

Independent Component Analysis (ICA) is a standard method for separating electroencephalography (EEG) and electromyography (EMG) recordings into maximally independent sources
that isolate brain, muscle, and artifact activity for downstream analysis. Adaptive Mixture ICA (AMICA) [@palmer2012amica] generalizes single-model ICA to a mixture of such models with adaptive source densities,
and produces the most dipolar (and thus most physiologically interpretable) component decompositions of EEG among the widely used algorithms benchmarked by @delorme2012independent.
Its reference implementation is a Fortran program parallelized with the Message Passing Interface (MPI) and distributed as a compiled binary driven from MATLAB/EEGLAB,
Independent Component Analysis (ICA) is a widely applied method for separating electroencephalographic and magnetoencephalographic (EEG/MEG) recordings into maximally independent sources
that isolate brain, muscle, and artifact activities for downstream analysis [@makeig1995independent; @vigario1997independent; @iversen2019megeeg]. Adaptive Mixture ICA (AMICA) [@palmer2012amica] generalizes single-model ICA to a mixture of such models with adaptive source densities,
and produces both the least dependent and the most dipolar (and thus most physiologically interpretable) component decompositions of EEG among the algorithms benchmarked by @delorme2012independent.
Its reference implementation, written by Jason Palmer, is a Fortran program parallelized with the Message Passing Interface (MPI) and distributed as a compiled binary callable from MATLAB/EEGLAB,
which is difficult to install, runs only on the central processing unit (CPU), and is not usable from a Python scientific workflow.

`pamica` is a Python implementation of AMICA that reproduces the reference Fortran results within numerical tolerance while running on the CPU, NVIDIA graphics processing units (GPUs, via CUDA), and Apple GPUs (Apple's MLX array framework [@mlx2023]).
Expand All @@ -50,14 +50,14 @@ The software is at <https://github.com/sccn/pAMICA> (archived at doi:10.5281/zen

# Statement of need

AMICA's decompositions are well suited to equivalent-dipole source localization and automated component classification [@piontonachini2019iclabel].
AMICA decompositions of neuroelectromagnetic data are well suited to equivalent-dipole source localization and automated component classification [@piontonachini2019iclabel].
Yet its reference implementation is MATLAB-only Fortran, an increasing obstacle as neuroimaging analysis moves toward Python, for example MNE-Python [@gramfort2013meg]:
an AMICA that runs natively in Python and on a GPU, and that is validated to reproduce the Fortran reference numerically, is needed for modern pipelines.

General-purpose Python ICA implementations do not fill this gap. `scikit-learn` and `MNE-Python` provide FastICA [@hyvarinen2000independent] and Infomax [@bell1995information; @lee1999independent],
while Picard [@ablin2018faster] offers faster-converging maximum-likelihood ICA;
none implement AMICA's mixture of models, adaptive generalized-Gaussian source densities, or Newton updates,
so they do not reproduce AMICA decompositions. `pamica` targets EEG/EMG analysts who want AMICA-quality decompositions inside a Python pipeline,
so they do not reproduce AMICA decompositions. `pamica` targets EEG and MEG analysts who want AMICA-quality decompositions inside a Python pipeline,
users of GPU hardware who want faster runs than the CPU-only binary, and methodologists who need a transparent reference implementation to build on.

# Implementation and validation
Expand All @@ -66,14 +66,15 @@ users of GPU hardware who want faster runs than the CPU-only binary, and methodo
exact-EM mixture updates, a positive-definite Newton step [@palmer2008newton],
symmetric zero-phase-component-analysis (ZCA) sphering, the five source-density families of the reference (generalized Gaussian, Gaussian,
logistic, sub-Gaussian, and the extended-Infomax kurtosis switcher), a mixture of ICA models, and component sharing across models.
It also computes mutual information reduction (MIR) and pairwise mutual information (PMI), the separation-quality metrics used to benchmark ICA algorithms [@delorme2012independent].
It also computes mutual information reduction (MIR) and pairwise mutual information (PMI), separation-quality metrics useful for benchmarking ICA algorithms [@delorme2012independent; @frank2023optimal].

`pamica`'s conformity with the reference binary is measured with two complementary metrics: Hungarian-matched component correlation
and the Amari distance [@amari1996new], a relabeling- and scale-invariant unmixing-matrix metric that needs no assignment step.
Both implementations were run for AMICA's usual 2000 iterations with Newton off (`do_newton=0`) and otherwise-default parameters
Both implementations were run for the AMICA heuristic default of 2000 iterations with Newton off (`do_newton=0`) and otherwise-default parameters
(settings transcribed between `pamica`'s JSON and Fortran's native text format).
Newton is disabled here to isolate the algorithm from initialization: with Newton on, independently seeded runs can settle a few under-determined components in different, equally likely optima, though a matched initialization recovers agreement ([documentation](https://eeglab.org/pAMICA/guides/validation/)).
The single-model comparison uses a well-determined external recording (OpenNeuro ds002718, $k\approx153$, where $k$ = frames over squared channel count), well past the ~60 threshold where cross-backend agreement plateaus, together with the bundled 32-channel sample ($k\approx30$); Table 1 gives each metric's dataset.
This 2000-iteration budget is a practical stopping point, not a convergence point: source separation keeps improving slowly at higher iteration counts [@frank2023optimal].
Newton acceleration is disabled here to isolate the algorithm from initialization: the Newton update speeds convergence, but once enabled it lets independently seeded runs settle a few under-determined components into different, equally likely optima, whereas a matched initialization recovers agreement ([documentation](https://eeglab.org/pAMICA/guides/validation/)).
The single-model comparison uses a well-determined external recording (OpenNeuro ds002718, $k\approx153$, where $k$ = frames over squared channel count [@frank2025sufficient]), well past the ~60 threshold where cross-backend agreement plateaus, together with the bundled 32-channel sample ($k\approx30$); Table 1 gives each metric's dataset.
Score functions and per-block sufficient statistics are exact to floating-point resolution against the literal Fortran expressions on the bundled sample.
A mixture of ICA models is not partition-identifiable, so exact partition parity is the wrong bar for the multi-model case;
it is instead assessed by whether the two implementations sample a similar distribution of solutions, across ensembles of 20 runs each (\autoref{fig:ensemble}).
Expand Down Expand Up @@ -130,15 +131,15 @@ and step-by-step reproduction commands are in the [documentation](https://eeglab

# State of the field

`pamica` complements rather than replaces EEGLAB [@delorme2004eeglab] and its Fortran AMICA plugin: it shares EEGLAB's output format,
`pamica` complements rather than replaces the reference Fortran AMICA used with EEGLAB [@delorme2004eeglab]: it uses the same output format as that Fortran version,
adds a Python API with GPU support, and runs the reference Fortran itself through a bundled dependency-free native build (no Intel Math Kernel Library or MPI runtime).
Two other Python AMICA reimplementations have appeared [@esmaeili2025amica; @herforth2026pyamica],
both of which provide MNE-Python-compatible objects; `pamica` offers a scikit-learn-style array API, byte-identical EEGLAB I/O, an MLX backend for Apple GPUs, and an optional MNE-Python wrapper.
What sets `pamica` apart is the depth of its Fortran-parity validation (Table 1): source-density score functions bit-exact to floating-point resolution against the literal Fortran expressions, and a distributional-similarity framework for the non-identifiable multi-model case.

# Acknowledgements

We thank Jason Palmer and Ken Kreutz-Delgado, co-developers of AMICA, for the reference implementation.
We thank Jason Palmer and his advisor Ken Kreutz-Delgado, co-developers of AMICA, for the reference implementation.
We also thank the EEGLAB community for the tools and sample data used to validate this work.
Two of the authors are original developers of the methods `pamica` builds on: S.M. co-developed the AMICA algorithm [@palmer2012amica] and A.D. is a lead developer of EEGLAB [@delorme2004eeglab].
This work was supported by The Swartz Foundation (Old Field, NY) to the Swartz Center for Computational Neuroscience and by National Institutes of Health grant R01-NS047293 (to A.D. and S.M.).
Expand Down
Binary file modified paper.pdf
Binary file not shown.