Skip to content

Commit 5a72f74

Browse files
Adopt Scott's paper review: EEG/MEG framing (#205)
* Adopt Scott's paper review: EEG/MEG framing * Rebuild paper.pdf [skip ci] * Cite Frank et al. for iterations and data-adequacy * Rebuild paper.pdf [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8556f38 commit 5a72f74

3 files changed

Lines changed: 61 additions & 12 deletions

File tree

paper.bib

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,34 @@ @article{delorme2012independent
1818
doi = {10.1371/journal.pone.0030135}
1919
}
2020

21+
@inproceedings{makeig1995independent,
22+
title = {Independent component analysis of electroencephalographic data},
23+
author = {Makeig, Scott and Bell, Anthony J. and Jung, Tzyy-Ping and Sejnowski, Terrence J.},
24+
booktitle = {Advances in Neural Information Processing Systems},
25+
volume = {8},
26+
pages = {145--151},
27+
year = {1995}
28+
}
29+
30+
@inproceedings{vigario1997independent,
31+
title = {Independent component analysis for identification of artifacts in magnetoencephalographic recordings},
32+
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},
33+
booktitle = {Advances in Neural Information Processing Systems},
34+
volume = {10},
35+
pages = {229--235},
36+
year = {1997}
37+
}
38+
39+
@incollection{iversen2019megeeg,
40+
title = {{MEG/EEG} data analysis using {EEGLAB}},
41+
author = {Iversen, John R. and Makeig, Scott},
42+
booktitle = {Magnetoencephalography: From Signals to Dynamic Cortical Networks},
43+
pages = {391--406},
44+
year = {2019},
45+
publisher = {Springer International Publishing},
46+
address = {Cham}
47+
}
48+
2149
@article{delorme2004eeglab,
2250
title = {{EEGLAB}: an open source toolbox for analysis of single-trial {EEG} dynamics including independent component analysis},
2351
author = {Delorme, Arnaud and Makeig, Scott},
@@ -188,3 +216,23 @@ @misc{mlx2023
188216
note = {Version 0.x, accessed 2026},
189217
howpublished = {\url{https://github.com/ml-explore/mlx}}
190218
}
219+
220+
@inproceedings{frank2023optimal,
221+
title = {An exploration of optimal parameters for efficient blind source separation of {EEG} recordings using {AMICA}},
222+
author = {Frank, Gwenevere and Shirazi, Seyed Yahya and Palmer, Jason and Cauwenberghs, Gert and Makeig, Scott and Delorme, Arnaud},
223+
booktitle = {2023 IEEE 23rd International Conference on Bioinformatics and Bioengineering (BIBE)},
224+
pages = {205--210},
225+
year = {2023},
226+
publisher = {IEEE},
227+
doi = {10.1109/BIBE60311.2023.00040}
228+
}
229+
230+
@inproceedings{frank2025sufficient,
231+
title = {Quantitative exploration of sufficient data quantities for {EEG} decomposition using {AMICA}},
232+
author = {Frank, Gwenevere and Shirazi, Seyed Yahya and Palmer, Jason and Cauwenberghs, Gert and Makeig, Scott and Delorme, Arnaud},
233+
booktitle = {2025 12th International IEEE/EMBS Conference on Neural Engineering (NER)},
234+
pages = {532--536},
235+
year = {2025},
236+
publisher = {IEEE},
237+
doi = {10.1109/NER61569.2025.11588993}
238+
}

paper.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ bibliography: paper.bib
2929

3030
# Summary
3131

32-
Independent Component Analysis (ICA) is a standard method for separating electroencephalography (EEG) and electromyography (EMG) recordings into maximally independent sources
33-
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,
34-
and produces the most dipolar (and thus most physiologically interpretable) component decompositions of EEG among the widely used algorithms benchmarked by @delorme2012independent.
35-
Its reference implementation is a Fortran program parallelized with the Message Passing Interface (MPI) and distributed as a compiled binary driven from MATLAB/EEGLAB,
32+
Independent Component Analysis (ICA) is a widely applied method for separating electroencephalographic and magnetoencephalographic (EEG/MEG) recordings into maximally independent sources
33+
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,
34+
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.
35+
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,
3636
which is difficult to install, runs only on the central processing unit (CPU), and is not usable from a Python scientific workflow.
3737

3838
`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]).
@@ -50,14 +50,14 @@ The software is at <https://github.com/sccn/pAMICA> (archived at doi:10.5281/zen
5050

5151
# Statement of need
5252

53-
AMICA's decompositions are well suited to equivalent-dipole source localization and automated component classification [@piontonachini2019iclabel].
53+
AMICA decompositions of neuroelectromagnetic data are well suited to equivalent-dipole source localization and automated component classification [@piontonachini2019iclabel].
5454
Yet its reference implementation is MATLAB-only Fortran, an increasing obstacle as neuroimaging analysis moves toward Python, for example MNE-Python [@gramfort2013meg]:
5555
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.
5656

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

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

7171
`pamica`'s conformity with the reference binary is measured with two complementary metrics: Hungarian-matched component correlation
7272
and the Amari distance [@amari1996new], a relabeling- and scale-invariant unmixing-matrix metric that needs no assignment step.
73-
Both implementations were run for AMICA's usual 2000 iterations with Newton off (`do_newton=0`) and otherwise-default parameters
73+
Both implementations were run for the AMICA heuristic default of 2000 iterations with Newton off (`do_newton=0`) and otherwise-default parameters
7474
(settings transcribed between `pamica`'s JSON and Fortran's native text format).
75-
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/)).
76-
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.
75+
This 2000-iteration budget is a practical stopping point, not a convergence point: source separation keeps improving slowly at higher iteration counts [@frank2023optimal].
76+
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/)).
77+
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.
7778
Score functions and per-block sufficient statistics are exact to floating-point resolution against the literal Fortran expressions on the bundled sample.
7879
A mixture of ICA models is not partition-identifiable, so exact partition parity is the wrong bar for the multi-model case;
7980
it is instead assessed by whether the two implementations sample a similar distribution of solutions, across ensembles of 20 runs each (\autoref{fig:ensemble}).
@@ -130,15 +131,15 @@ and step-by-step reproduction commands are in the [documentation](https://eeglab
130131

131132
# State of the field
132133

133-
`pamica` complements rather than replaces EEGLAB [@delorme2004eeglab] and its Fortran AMICA plugin: it shares EEGLAB's output format,
134+
`pamica` complements rather than replaces the reference Fortran AMICA used with EEGLAB [@delorme2004eeglab]: it uses the same output format as that Fortran version,
134135
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).
135136
Two other Python AMICA reimplementations have appeared [@esmaeili2025amica; @herforth2026pyamica],
136137
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.
137138
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.
138139

139140
# Acknowledgements
140141

141-
We thank Jason Palmer and Ken Kreutz-Delgado, co-developers of AMICA, for the reference implementation.
142+
We thank Jason Palmer and his advisor Ken Kreutz-Delgado, co-developers of AMICA, for the reference implementation.
142143
We also thank the EEGLAB community for the tools and sample data used to validate this work.
143144
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].
144145
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.).

paper.pdf

4.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)