Source-linked AI summary

Best Practices in EEG Analysis: Preprocessing, Modeling, and Machine Learning

Parsa Razmara, Woojae Jeong, Aditya Kommineni, Raymundo Cassani, Richard Leahy, Takfarinas Medani

arXiv:2609.36609v1eess.SPcs.LG

TL;DR

EEG analysis faces low signal-to-noise ratio, volume conduction, and heterogeneous recording conditions. This chapter surveys best practices in preprocessing, computational modeling, statistical inference, and machine learning; it also describes lower-field simultaneous EEG-fMRI findings and limits of ICA.

  • Problem

    EEG presents methodological challenges from low signal-to-noise ratio, volume conduction, and heterogeneous recording conditions.

    Source: §1 · p. 1
  • Method

    The chapter provides a practice-oriented overview of EEG preprocessing, computational modeling, statistical inference, and machine learning, emphasizing transparent reporting and preservation of raw data.

    Source: §1 · p. 1
  • Results

    At 0.55T, reduced BCG amplitude facilitated denoising, and alpha activity and stimulus-locked steady-state visual responses were preserved after correction.

    Source: §2.6 · p. 16
  • Takeaways & Limitations

    Rigorous artifact handling is essential because unaddressed artifacts can lead to false findings.

    Source: §2.1 · p. 4

    ICA assumes linear mixing and statistically independent sources, works best with high-density, longer recordings, and may mix brain and artifact signals in components.

    Source: Application of the ICA on the Data · p. 12

Abstract

from arXiv · show

Electroencephalography (EEG) analysis requires careful choices in preprocessing, statistical modeling, and machine learning because EEG signals are highly susceptible to artifacts, volume conduction, low signal-to-noise ratio, and substantial inter-subject variability. This chapter provides a practical and methodological guide to modern EEG analysis, spanning EEG preprocessing, artifact removal, filtering, bad-channel detection and interpolation, re-referencing, independent component analysis (ICA), and preprocessing of simultaneous EEG-fMRI recordings. We review major approaches for computational EEG analysis, including event-related potentials (ERPs), time-frequency analysis, functional and effective connectivity, source localization, multivariate decoding, permutation testing, and multiple-comparison correction. We then examine machine-learning methods for EEG, from feature-based classifiers to deep learning and emerging EEG foundation models, with emphasis on cross-subject generalization, limited-data regimes, data leakage, evaluation metrics, and fair benchmarking. Reproducibility is treated as a core requirement throughout, including transparent preprocessing, BIDS-EEG data organization, standardized derivatives, preservation of raw data, and FAIR data practices. The chapter is intended as a practical reference for researchers developing reliable, interpretable, and reproducible EEG analysis and machine-learning pipelines.

1 Introduction and Scope

EEG offers millisecond-scale access to brain dynamics, but low signal-to-noise ratio, volume conduction, and heterogeneous recording conditions create substantial methodological challenges. This chapter surveys preprocessing, computational modeling, statistical inference, and machine learning, while treating reproducibility as foundational.

1 Introduction and Scope

  • The chapter presents a practical overview of EEG preprocessing, computational modeling, statistical inference, and machine learning.It is intended as a self-contained reference for neuroscientists and neuroengineers developing robust, reproducible EEG research.Source: §1 · pp. 1–2
  • Preprocessing guidance covers artifact identification and correction, filtering, bad-channel handling, referencing, ICA, and simultaneous EEG-fMRI, alongside BIDS-EEG organization and derivative management.The chapter also emphasizes transparent reporting, preservation of raw data, and FAIR data practices.Source: §1 · pp. 1–2
  • Computational approaches reviewed include ERPs, time-frequency analysis, connectivity, source localization, and multivariate decoding, with attention to assumptions, interpretability, permutation testing, and multiple-comparison correction.Source: §1 · p. 1
  • Machine-learning coverage ranges from feature-based classifiers to deep learning and foundation models, addressing cross-subject generalization, limited data, evaluation, data leakage, and fair benchmarking.Source: §1 · p. 1

2 Preprocessing EEG Signals

EEG preprocessing aims to improve signal quality by removing or correcting artifacts and noise, while making methodological choices that support valid and reliable analyses.

2 Preprocessing EEG Signals

  • Preprocessing is an initial analysis stage that enhances EEG signal quality by removing or correcting artifacts and noise.Source: §2 · p. 2
  • The section covers noise identification, filtering, bad electrodes and referencing, artifact removal, epoching with baseline correction, and objective trial rejection.Methods include ICA and regression.Source: §2 · p. 2
  • BIDS-EEG organization, transparent pipelines, and quality control are included as reproducibility practices.The focus is on methodological choices for valid and reliable analyses.Source: §2 · p. 2

2.1 Common EEG Noise Sources and Artifacts

EEG artifacts arise from physiological and non-physiological sources and can reduce effective signal-to-noise ratio or mimic neural activity. Inspecting raw recordings helps identify which artifacts are present and guides preprocessing.

2.1 Common EEG Noise Sources and Artifacts

  • Physiological artifacts include eye movements, muscle activity, cardiac and pulse effects, and slow fluctuations from sweat or respiration.Eye artifacts can overlap with low-frequency neural activity; muscle activity can contaminate higher frequencies and, when strong, lower frequencies too.Source: §2.1 · pp. 2–3
  • Non-physiological sources include line noise and electromagnetic interference, electrode pops, cable movement, and head motion.Electrode pops and cable movement can indicate data that cannot be trusted, while motion artifacts can be difficult to fully remove in high-motion settings.Source: §2.1 · p. 3
  • Blink and muscle artifacts can exceed typical EEG amplitudes, and untreated artifacts can produce false neural interpretations.Blink or muscle amplitudes may be 50–100 µV versus 5–20 µV for typical EEG signals.Source: §2.1 · p. 4
  • Visually inspect continuous raw data for blinks, movement, line noise, and other artifacts before choosing preprocessing steps.Figure 1 contrasts a raw trace containing artifacts with the same data after artifact correction, illustrating improved signal quality.Source: §2.1 · p. 4, Figure 1 · p. 4

2.2 Filtering: High-Pass, Low-Pass, Notch, and Anti-Alias Considerations

EEG filters should attenuate unwanted frequency components while preserving neural signals of interest. Cutoffs and filter designs require care because filtering can distort timing, create artifacts, or remove relevant signal.

2.2 Filtering: High-Pass, Low-Pass, Notch, and Anti-Alias Considerations

  • High-pass cutoffs that are too high can distort slow ERP components, shift their time course, or generate spurious peaks; around 0.1 Hz is recommended for many ERP analyses.A 0.3–0.5 Hz high-pass can induce noticeable latency shifts in N400 or P600 components.Source: §2.2 · pp. 4–5
  • A 30–40 Hz low-pass is common for typical ERP or oscillation analyses, while gamma analyses may require a higher cutoff or no low-pass filtering.Faster events such as epilepsy spike-wave discharges may require bandwidth above 70 Hz.Source: §2.2 · p. 5
  • A narrow notch can remove 50/60 Hz line noise but may cause ringing or remove genuine neural power; CleanLine and spectrum interpolation are alternatives.A notch can also produce a dip in the spectrum and slight ripples.Source: §2.2 · pp. 5–6
  • Downsampling requires low-pass anti-alias filtering at or below the new Nyquist frequency to prevent higher-frequency signals from aliasing into lower frequencies.For downsampling to 250 Hz, a filter near 125 Hz, often somewhat lower, is used before decimation.Source: §2.2 · p. 6
  • FIR filters can preserve phase when applied forward-backward, whereas IIR filters can introduce nonlinear phase unless applied zero-phase; filter order and transition bandwidth affect kernel length and edge behavior.MNE's default low-pass transition bandwidth is 0.5 Hz, which can produce very long filters.Source: §2.2 · p. 6
  • Report filter cutoffs and type, and disclose targeted line-noise removal; avoid overly aggressive notch filtering, particularly when short or heavily time-locked data could be temporally distorted.When line noise is strong, a narrow band-stop filter or adaptive removal such as CleanLine is described as an option.Source: §2.2 · pp. 6–7
  • Filter convolution can create edge transients, and sharp events can produce ringing; padding or ignoring an edge margin can mitigate edge artifacts.Zero-phase filtering is preferable for offline timing analyses, while minimum-phase filters may suit real-time applications.Source: §2.2 · p. 7
  • Use conservative filters and verify that important ERP onsets or oscillation peaks remain intact; a gentle high-pass and moderate low-pass are suggested defaults for many EEG studies.The suggested ranges are approximately 0.1–0.5 Hz for high-pass and 30–80 Hz for low-pass, depending on needs.Source: §2.2 · p. 7

2.3 Detecting and Repairing Bad Channels

Bad channels can contaminate referencing and bias ICA or other multivariate analyses. The section recommends combining automated detection with human review, then excluding or interpolating flagged channels as appropriate.

2.3 Detecting and Repairing Bad Channels

  • Bad channels can introduce spikes or noise that propagate under average referencing and bias ICA or other multivariate analyses.They may result from high impedance, detachment, wiring, or amplifier problems.Source: §2.3 · p. 7
  • Automated metrics flag channel spectrum deviations, flatlines, high variance, and low correlation with neighboring channels.Common criteria include flatlines longer than 5 seconds and correlation below r < 0.8.Source: §2.3 · pp. 7–8
  • Interpolation estimates bad-channel data from neighboring electrodes to preserve topography or equal channel counts, but repairing more than 10% of channels may degrade data.Common approaches include spherical splines and nearest-neighbor averaging.Source: §2.3 · p. 8
  • Automated flags need visual review because strict thresholds can mark many channels, while expert inspection alone is subjective and does not scale well.A pipeline example removes channels with flatline >5 s or correlation <0.8 before interpolating them.Source: §2.3 · pp. 7–8
  • After channel repair, recompute the average reference; some pipelines instead exclude bad channels through referencing and ICA, then interpolate at the end.Source: §2.3 · p. 8

2.4 Reference Schemes: Average, REST, Laplacian, and Source Derivations

EEG voltages are measured relative to a reference, so the chosen scheme shapes the recorded potential distribution. The section compares common approaches and ties their suitability to scalp coverage, spatial goals, and model requirements.

2.4 Reference Schemes: Average, REST, Laplacian, and Source Derivations

  • Average reference subtracts the across-channel mean at each time point and is a reasonable choice for high-density recordings with whole-head coverage.It can reduce the influence of a single noisy reference and improve SNR when many channels are present.Source: §2.4 · pp. 8–9
  • A low-density average reference can be biased when scalp regions are uncovered, so adequate electrode coverage matters.The text gives 20 electrodes as an example where incomplete coverage may bias the average.Source: §2.4 · p. 9
  • REST uses electrode coordinates and estimated head conductivity in a forward model to approximate a zero reference at infinity.It can yield results similar to average reference for many datasets, under assumptions such as sources summing to zero at infinity.Source: §2.4 · p. 9
  • Laplacian or CSD transforms emphasize local activity and attenuate volume-conducted far-field signals, but may amplify noise when coverage is sparse.The transformation computes a spatial second derivative using electrode positions and typically spline interpolation on the head surface.Source: §2.4 · p. 9
  • Linked references can spread reference-site activity with opposite sign across channels; no truly neutral site exists, and single-electrode references may propagate activity to all channels.For high-density recordings with adequate coverage, the chapter favors common average reference; it also recommends preserving the acquisition reference for offline re-referencing.Source: §2.4 · pp. 9–10

2.5 Artifact Correction Techniques: ICA Variants, GEDAI, and Beyond

Artifact correction methods aim to suppress contamination while retaining neural data, but their assumptions and suitability differ. The section reviews ICA and alternatives, emphasizing method selection, validation, and transparent reporting.

2.5 Artifact Correction Techniques: ICA Variants, GEDAI, and Beyond

  • Artifact correction seeks to isolate and remove artifact contributions while salvaging data, using approaches including ICA, SSP/SSS, ASR, and source-informed methods.Method choice depends on artifact characteristics and data conditions rather than one universally suitable technique.Source: §2.5 · p. 10, Emerging and Complementary Approaches · p. 14

Independent Component Analysis (ICA)

  • ICA models EEG as linear mixtures of independent sources; conventional ICA remains widely adopted, while AMICA can yield high-quality decompositions at greater computational cost.SOBI can be effective for temporally structured or periodic artifacts such as ECG or eye blinks.Source: Independent Component Analysis (ICA) · pp. 10–11

Application of the ICA on the Data

  • Component review uses scalp topography, time series, spectra, and EOG or ECG correlations to identify artifacts before rejecting components and reconstructing EEG.ICA can preserve time points, but its assumptions are approximate; short recordings or few channels may limit separation, and components can mix brain and artifact.Source: Application of the ICA on the Data · pp. 11–12

Automated IC Classification (ICLabel)

  • ICLabel classifies independent components probabilistically using topography, power spectrum, and activity patterns, supporting standardized artifact rejection but not replacing expert inspection.Its categories include Brain, Eye, Muscle, Heart, Line Noise, Channel Noise, and Other.Source: Automated IC Classification (ICLabel) · p. 12

Other Artifact Removal Methods: Regression, SSP/SSS, ASR and GEDAI

  • Regression subtracts artifact contributions predicted from reference channels, SSP projects out spatial artifact patterns, and ASR reconstructs transient high-variance subspaces; GEDAI uses forward-model information without auxiliary channels.Regression can remove correlated neural activity; ASR thresholds trade artifact suppression against overcorrection, while GEDAI depends on accurate sensor geometry and head modeling.Source: Other Artifact Removal Methods:… · pp. 12–13

Emerging and Complementary Approaches

  • Deep-learning artifact removal can outperform traditional pipelines in specific scenarios but typically needs large characterized datasets; its cross-setup generalizability remains under study.Transform-based methods exploit time-frequency structure but are less commonly integrated into standard toolboxes; the chapter recommends dataset-adapted combinations and transparent parameter reporting.Source: Emerging and Complementary Approaches · p. 14

2.6 Simultaneous EEG-fMRI: Cardiac and Pulse Artifacts, Field Dependence, and Practical Guidance

Simultaneous EEG-fMRI adds gradient and pulse artifacts that require dedicated correction before standard EEG methods. The section describes their properties, correction sequence, and practical considerations for reducing and validating residual contamination.

2.6 Simultaneous EEG-fMRI: Cardiac and Pulse Artifacts, Field Dependence, and Practical Guidance

  • Gradient and pulse artifacts require dedicated correction before standard methods such as ICA, ASR, or regression can be applied meaningfully to residual EEG.Pulse or ballistocardiogram artifacts arise through cardiac-cycle interactions with the static magnetic field, including blood-flow and electrode or wire movement effects.Source: §2.6 · p. 16
  • Template-based correction models repeating artifacts: gradient artifact is time-locked to slice acquisition, whereas pulse artifact is quasi-periodic and non-stationary across time and channels.The recommended sequence is gradient correction, downsampling, then ECG-informed pulse correction; verify R-peak detection manually or semi-automatically.Source: §2.6 · p. 16
  • Pulse-artifact amplitude increases with magnetic field strength, and 0.55T feasibility studies observed reduced BCG amplitude relative to high-field reports.The lower amplitude facilitated denoising with synchronized AAS combined with ECG-informed template correction.Source: §2.6 · p. 16
  • Capturing gradient-artifact transients typically requires a 5 kHz sampling rate, and precise synchronization between MRI and EEG clocks minimizes residual artifact.Source: §2.6 · p. 16
  • After correction, validation should demonstrate preserved physiological rhythms and task-evoked responses; 0.55T recordings retained alpha activity and occipital stimulus-locked steady-state visual responses.Figure 2 contrasts outside-scanner, scanner-off, scanner-on, and cleaned recordings; the active imaging sequence shows high-amplitude gradient artifact.Source: §2.6 · p. 16, Figure 2 · p. 17

2.7 Organizing Data with BIDS-EEG and Maintaining Reproducibility

EEG preprocessing choices affect downstream measures, so structured data organization and transparent records are central to reproducible analysis. BIDS-EEG standardizes dataset structure, while preserving raw recordings and documenting derivatives supports traceability and comparison.

2.7 Organizing Data with BIDS-EEG and Maintaining Reproducibility

  • Preprocessing choices affect ERP amplitudes, spectral power, connectivity, and decoding, while incomplete documentation can contribute to data leakage or inflated machine-learning performance.Structured organization reduces hidden analytic flexibility and supports valid statistical inference.Source: §2.7 · pp. 17–18
  • BIDS provides a machine-readable framework for consistent neuroimaging organization, and BIDS-EEG adapts it to electrophysiological data with standardized names, directories, and metadata files.This structure improves transparency, software interoperability, and long-term usability.Source: §2.7 · pp. 17–18
  • Subject- and session-based BIDS-EEG datasets link raw recordings to acquisition, channel, electrode, coordinate-system, and event metadata, supporting automated processing.Examples include JSON sidecars and channels.tsv, electrodes.tsv, coordsystem.json, and events.tsv files.Source: §2.7 · p. 18
  • Keep raw recordings unchanged and store preprocessing outputs as derivatives with metadata on parameters and software versions, enabling reproduction and comparison of alternative strategies.Documented derivative details include filters, references, ICA settings, rejected components, artifact correction, and channel interpolation.Source: §2.7 · p. 18
  • Scripted, version-controlled workflows should record software versions and stochastic-procedure seeds; automation reduces manual variability and improves consistency across subjects and sessions.Source: §2.7 · p. 18
  • BIDS-EEG aligns with FAIR principles, and adopting BIDS even for nonpublic datasets can support collaboration, lab continuity, and methodological consistency.The chapter recommends conversion soon after acquisition; several EEG toolboxes support BIDS import and export.Source: §2.7 · p. 18

3 Computational Modeling of EEG Data

Scalp EEG mixes task-related activity with background and artifacts, so computational modeling is used to extract meaningful structure and support inference. The section reviews complementary approaches for characterizing evoked responses, oscillations, connectivity, distributed representations, and statistical reliability.

3.1 Event-Related Potential Analysis

  • ERPs average event-locked epochs after baseline correction, enhancing task-relevant SNR and revealing voltage components by amplitude, latency, and scalp distribution.The method assumes stimulus-locked responses are temporally consistent across trials; latency variability and non-phase-locked activity can obscure averaged components, while distributed sources limit spatial specificity.Source: §3.1 · pp. 19, 21

3.2 Time–Frequency Analysis

  • Time–frequency analysis tracks oscillatory power and phase over time, capturing non-phase-locked activity that trial-averaged ERP waveforms may obscure.Methods include FFT, Welch’s method, STFT, wavelets, Hilbert transforms, and multitaper analysis; STFT uses a sliding window with a fixed temporal–frequency resolution trade-off.Source: §3.2 · pp. 21–22

3.3 Connectivity Analysis

  • Connectivity measures quantify statistical associations or directed interactions, but volume conduction and field spread can inflate apparent coupling between nearby sensors.Functional measures include correlation, coherence, PLV, and PLI; effective connectivity methods include Granger causality and DTF, whose interpretation or estimation depends on assumptions and data adequacy.Source: §3.3 · p. 23

3.4 Multivariate Analysis, Decoding, and Modeling

  • Multivariate methods analyze joint activity patterns to assess discriminability and representational structure across conditions, rather than testing each electrode or time point independently.Decoding, representational similarity analysis, temporal generalization, state-space models, and inverted encoding models characterize separability, geometry, temporal stability, dynamics, or reconstructed stimulus representations.Source: §3.4 · pp. 24–25

3.5 Statistical Inferences in EEG Analysis

  • Reliable EEG inference combines tests suited to their assumptions with multiple-comparison control across high-dimensional data.Permutation and cluster-based permutation tests provide nonparametric approaches, while Bonferroni, FDR, cluster-based, and max-statistic methods address inflated Type I error from testing many samples.Source: §3.5 · pp. 25–26

4 Machine Learning for EEG: From Features to Classifiers and Beyond

EEG machine learning ranges from engineered features and classical classifiers to deep learning and self-supervised foundation models. The section emphasizes EEG-specific evaluation challenges, including generalization, leakage, limited data, and fair comparison.

4.1 Classical Machine Learning Methods

  • Classical EEG pipelines combine feature engineering and dimensionality reduction with classifiers such as LDA, QDA, SVMs, and ensemble methods.ICA is used to isolate artifacts, while PCA reduces electrode-space dimensionality; LDA and QDA are noted for low latency and limited-data robustness in BCI applications.Source: §4.1 · p. 27

4.2 Deep Learning Models

  • Deep learning models learn representations from raw or minimally preprocessed EEG, using convolutional, graph-based, recurrent, or attention-based architectures.EEGNet is described as parameter-efficient for BCI tasks, SPaRCNet as achieving expert-level accuracy for ICU EEG classification, and attention models as capturing long-range temporal and spatial relationships.Source: §4.2 · p. 27

4.3 Self-Supervised Methods

  • Self-supervised EEG models learn representations from unannotated data using contrastive learning or masked reconstruction, with architectures addressing spatial, temporal, or dataset heterogeneity.Examples include BENDR, BIOT, CBraMod, CSBrain, and S4-based models; their described designs target cross-subject or hardware adaptation, mismatched channels, multi-scale structure, or long sequences.Source: §4.3 · p. 28

4.4 Comparative Analysis: The Discrepancy Between DL and SSL Performance

  • The chapter attributes compact deep models’ competitive performance relative to large self-supervised models to EEG-specific inductive biases, low SNR, and cross-dataset heterogeneity.The proposed explanations are that domain-specific architectures can learn efficiently from minimal data, reconstruction objectives may model noise, and heterogeneous datasets complicate universal feature alignment.Source: §4.4 · pp. 28–29

4.5 Evaluation Design, Data Leakage, and Performance Assessment

  • Evaluation should match the generalization goal and prevent leakage by splitting data across sessions, blocks, or subjects and keeping feature selection and tuning within training folds.The section recommends leave-one-subject-out evaluation for cross-subject generalization, block- or session-wise splits within subjects, metrics beyond accuracy for imbalanced data, and standardized benchmarks such as MOABB.Source: §4 · p. 26, §4.5 · p. 29
Loading 2609.36609v1…