Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nimbusbci.com/llms.txt

Use this file to discover all available pages before exploring further.

Feature Normalization For BCI

Feature normalization keeps calibration, evaluation, and deployment data on the same scale. It is especially important for cross-session BCI, where electrode impedance, skin conductance, amplifier gain, and user state can shift feature amplitudes.
Estimate normalization parameters from training or calibration data only. Reuse those exact parameters for test and deployment data.

When To Normalize

Normalize when:
  • using a model across sessions or days
  • combining subjects or recording systems
  • mixing feature families with different scales
  • running long sessions where electrode/contact quality may drift
Do not normalize raw EEG before feature extraction. Extract CSP, bandpower, ERP, or other features first.
from nimbus_bci import estimate_normalization_params, apply_normalization

norm = estimate_normalization_params(X_train, method="zscore")

X_train_norm = apply_normalization(X_train, norm)
X_test_norm = apply_normalization(X_test, norm)

clf.fit(X_train_norm, y_train)
predictions = clf.predict(X_test_norm)

Method Choice

MethodUse WhenTradeoff
zscoreDefault BCI workflowSensitive to extreme outliers.
robustNoisy data with artifactsLess standard, more resilient.
minmaxBounded feature ranges are requiredVery sensitive to outliers.
Start with zscore. Switch to robust when artifacts or heavy-tailed features make mean/std unstable.

Common Pitfalls

  • Normalizing train and test separately: causes scale leakage and unstable evaluation.
  • Normalizing raw EEG: can break feature extraction assumptions.
  • Forgetting to save parameters: makes deployment data incompatible with training scale.
  • Changing preprocessing after calibration: invalidates the saved normalization parameters.

What To Save

Save normalization parameters next to the model:
{
  "normalization": "zscore",
  "estimated_from": "training-session-001",
  "feature_type": "csp",
  "n_features": 8
}
Also save the SDK version, feature extraction settings, label mapping, and validation metrics.

Quality Checks

Before inference:
  • feature values are finite
  • feature count matches model metadata
  • normalization params came from training/calibration data
  • test/deployment data used the same preprocessing pipeline
If confidence drops unexpectedly, run preprocessing diagnostics and inspect whether feature scale changed between sessions.

Next Read

Preprocessing Requirements

Prepare valid features before normalization.

External Preprocessing Integration

Export/import feature arrays across tools.

Batch Processing

Offline evaluation with normalized data.

Error Handling

Diagnose bad scale, shape, or confidence.