Cleaning EEG Before It Reaches Your Decoder: ICA, Artifact Rejection, and EOG Removal in Nimbus Studio
Artifact contamination is one of the most underappreciated sources of BCI performance loss. A motor-imagery pipeline with textbook CSP spatial filters and a well-tuned NimbusLDA classifier can still fail in practice if the epochs fed into training are riddled with eye blinks, muscle bursts, or electrode pop artifacts. The decoder does not distinguish between a genuine beta-band desynchronization and a 100 µV frontal spike — it simply learns from whatever data it receives, often producing confidence scores that are not trustworthy without careful uncertainty quantification.
Nimbus Studio addresses this with a dedicated set of preprocessing nodes that sit between raw EEG acquisition and feature extraction: ica, eog_removal, and artifact_rejection. This post explains what each node does, when to use it, how to sequence them into a clean pipeline, and what trade-offs exist between offline and live-streaming contexts.
Note: Before diving in, confirm you have reviewed the Nimbus Studio node documentation. All node names, capabilities, and pipeline conventions referenced here come directly from the documented node registry.
Why Artifacts Destroy Downstream Classifiers
EEG signals are small — typically 1–100 µV for cortical rhythms of interest. Eye blinks generate potentials an order of magnitude larger (50–150 µV), and jaw clenches or scalp muscle tension can exceed that by a further factor of ten. When those artifact trials enter your training set, two things happen.
First, the covariance structure your spatial filters (CSP, xDAWN) learn becomes distorted. A CSP filter trained on data that contains 5% blink trials will learn partly to separate eye-movement variance rather than motor-imagery variance — a latent source of confusion that no amount of classifier tuning can fix after the fact.
Second, Bayesian classifiers such as NimbusLDA or NimbusQDA will absorb artifact-contaminated examples into their likelihood estimates. The resulting posterior probabilities will be systematically miscalibrated, which undermines the confidence-gated rejection policies that make Bayesian decoding useful in real deployments (and is one reason Nimbus treats decoding as a BCI decision layer, not just a classifier call).
The solution is to intervene before feature extraction — in the preprocessing layer.

The Three Preprocessing Nodes and What They Do
ICA — ica
Independent Component Analysis decomposes the multi-channel EEG into statistically independent sources and identifies which components correspond to ocular, muscular, or electrical artifacts using spatial heuristics. Crucially, when channel names are available (configured in hardware_device via semantic channel mapping), the node can use anatomical priors — for example, frontal channel topographies for blink components — to improve automatic rejection.
After ICA fits and scores components, the artifact components are subtracted from the signal and the remaining neural sources are back-projected to channel space. This is a non-destructive operation: the artifact topology is removed, but the spatial relationships between neural channels are preserved. The node emits an ica_result artifact alongside the cleaned eeg_data, which you can inspect in the results pane for component-level transparency.
ICA is best run offline on calibration data. The node description explicitly warns that running ICA on short sliding windows in streaming mode is fragile — it requires sufficient data for stable component estimation. The recommended workflow is to fit ICA on a long calibration segment using custom_data or calibration_recorder output, then carry the resulting mixing matrix through to evaluation and (where your pipeline supports it) deploy.
EOG Removal — eog_removal
Where ICA works at the component level, EOG Removal targets eye-movement artifacts directly using one of two strategies: regression-based cleaning (acausal, best for offline use) or adaptive LMS filtering (causal, suitable for streaming).
Regression requires reliable EOG proxy channels — typically frontal electrodes near the eyes. When your headset has dedicated EOG channels, this approach is efficient and interpretable. When it does not, ICA is usually the better choice because it does not require external reference signals.
The adaptive LMS path is what makes eog_removal uniquely valuable for live streaming deploy. Unlike ICA, which fits a fixed mixing matrix, LMS continuously adapts its filter weights to track slow changes in the EOG-EEG coupling — for example, as electrode contact shifts during a long session. This makes it the preferred first line of defense for online eye-movement removal when latency and continuous operation matter.
Artifact Rejection — artifact_rejection
Where ICA and EOG removal repair contaminated data, artifact rejection removes trials that are too corrupted to be saved. The node flags epochs exceeding variance or kurtosis thresholds, optionally repairs individual bad channels, and can invoke AutoReject-style pipelines for more principled threshold estimation.
A key output is rejection_report — a structured artifact that logs how many trials were removed per class. This is not just metadata: monitoring rejection percentages is essential for catching silent problems. If 30% of your target class is being discarded and only 5% of your non-target class, your classifier will train on a class-imbalanced set without any warning in the accuracy metric.
For deploy use, the node description recommends lightweight variance/kurtosis thresholds over the full AutoReject pipeline, which can violate latency budgets in streaming contexts.

Sequencing the Nodes: The Recommended Order
The order of preprocessing steps is not arbitrary — each stage assumes something about the input signal:
hardware_device— raw EEG acquisition with semantic channel mapping configuredhighpass_filter(0.5 Hz recommended) — removes slow drift that destabilizes ICA covariance estimatesnotch_filter(50/60 Hz) — removes power-line interferencerereferencing— apply CAR or linked mastoids; locks the reference before ICAica(offline) oreog_removal(online/offline) — artifact source removalartifact_rejection— remove residual bad trials after component cleaningepoching— event-locked segmentation; follows artifact cleaning so bad data does not contaminate epoch boundariesbaseline_correction— per-trial mean subtraction, especially important for ERP paradigms- Feature extraction (
csp,xdawn,spectral_features, etc.)
A note on ICA placement: highpass filtering before ICA is important because ICA component estimation is sensitive to low-frequency drift. The 0.5 Hz cutoff recommended in the highpass_filter documentation is not arbitrary — it stabilizes the covariance matrix ICA needs to decompose.
Offline vs. Streaming Trade-offs
Artifact handling looks different in batch training versus live deploy, and Nimbus Studio's node design reflects this.
For offline calibration pipelines, you have the full arsenal: ICA with stable component fits, AutoReject for principled threshold selection, and thorough rejection reports to audit data quality before model training. The data_augmentation node can partially compensate for rejected trials in minority classes, but it should be used as a supplement to good artifact removal, not a substitute.
For live streaming deploy, the picture changes (see also building your first real-time pipeline for the broader train-to-deploy workflow):
- Use
eog_removalwith LMS in place of (or after) a fixed ICA matrix for real-time eye-movement cleaning - Use
artifact_rejectionwith simple variance/kurtosis thresholds rather than AutoReject - Pair
quality_monitorupstream to detect electrode contact issues before they produce artifacts — its Signal Quality Indices can gatedecision_policyto freeze outputs during signal degradation rather than producing unreliable commands (or consider a learned preprocessing layer like REVE when classical filter chains are too brittle across sessions)

What Clean Data Actually Does to Your Bayesian Decoder
Beyond raw accuracy, artifact-free training data has a measurable effect on the calibration quality of Bayesian classifiers. NimbusLDA and NimbusSoftmax output posterior probabilities, not just class labels. For those probabilities to be meaningful for confidence gating or rejection policies, they need to be calibrated — meaning a 0.85 confidence score should correspond to roughly 85% actual accuracy.
Artifact-contaminated training data introduces outlier examples that pull class-conditional covariance estimates in non-physiological directions. The resulting posteriors are systematically overconfident in certain regions of feature space and underconfident in others. Temperature scaling and rejection policy tuning via evaluate_rejection_policy in the Nimbus Python SDK can partly correct for this — but they cannot fix miscalibration that originates in corrupted training data, or the broader failure modes caused by neural drift in long sessions. The right tool is cleaning the data in the first place.
Conclusion
Artifact removal is not glamorous infrastructure — it does not appear in conference paper titles. But it sits at the foundation of every reliable BCI deployment. The ica, eog_removal, and artifact_rejection nodes in Nimbus Studio provide a complete toolkit for addressing the three main sources of EEG contamination: ocular artifacts, muscle noise, and bad trials.
The key takeaways are straightforward: sequence highpass filtering before ICA, prefer LMS-based EOG removal for live streaming, monitor rejection reports to catch silent class imbalance, and remember that calibrated Bayesian posteriors depend on the quality of data used to estimate them. A clean epoch delivered to NimbusLDA is worth more than a sophisticated classifier trained on noisy data.
For the full node specifications and YAML parameters, see the Nimbus Studio pipeline nodes database and the node YAML files in nimbus-studio/backend-py/nimbus_backend/graph/nodes/preprocessing/.