Evaluating Latent Space Robustness and Uncertainty of EEG-ML Models under Realistic Distribution Shifts

Neeraj Wagh, Jionghao Wei, Samarth Rawal, Brent M. Berry, Yogatheesan VaratharajahNeurIPS 2022

TL;DR

This paper introduces a diagnostic toolkit to stress-test EEG-based machine learning models before they reach the clinic. By simulating realistic "distribution shifts"—like hardware noise or different filtering settings—the researchers show that analyzing a model’s internal latent space and its predictive uncertainty can provide early warning signs of performance collapse in the real world.

What Problem Does This Paper Address?

Machine learning models for electroencephalograms (EEGs) show great promise in diagnosing neurological disorders, but they often "break" when moved from the lab to the hospital. This is usually due to distribution shifts: the data the model sees during deployment (the "target") looks different from the data it was trained on (the "source").

In the world of EEG, these shifts are caused by mundane but critical factors: different electrode brands, varying hardware filters, or even the electrical noise of a specific room. Currently, researchers usually only test models on a "held-out" portion of their original dataset. This paper argues that this isn't enough; we need ways to anticipate how a model will fail under realistic instrumentation-related variability before it is deployed.

Methods

The authors propose a multi-pronged evaluation framework consisting of three main components:

Overview of the proposed evaluation framework
  1. Realistic Data Shifts (EEG-DS): Instead of generic data augmentations, they developed four domain-specific transformations that mimic real-world hardware variability:
  2. Band-pass filtering: Simulating different hardware cut-off frequencies.
  3. Quantization precision: Simulating different analog-to-digital converter bit-depths.
  4. Impedance noise: Narrow-band low-frequency noise from poor sensor contact.
  5. Broadband noise: General Gaussian noise.
  6. Latent Space Integrity: To see how these shifts distort the model's internal "understanding," they used Delaunay neighborhood graphs. By mapping how "neighbors" in the latent space change when data is shifted, they calculated an integrity score ($q(\mathcal{G})$). If the shifted data points still mingle well with the original points, integrity is high; if they drift apart, the model is likely to fail.
  7. Predictive Uncertainty: They used Monte Carlo (MC) Dropout—running the same input through the model multiple times with different neurons "turned off"—to see how much the model's predictions fluctuated. High fluctuation (variance) indicates the model is "unsure."

They tested these methods across three types of encoders: Fully-Supervised (FSE), Self-Supervised (SSE), and traditional Power Spectral Density (PSDE) features.

Datasets

The study utilized two large-scale clinical EEG databases:

  • TUH-EEG (Temple University Hospital): Specifically the TUAB subset (2,993 EEGs). This served as the primary training and "in-sample" testing ground.
  • NMT Dataset: A separate dataset from Pak-Emirates Military Hospital (1,369 EEGs). This was used as a true "out-of-sample" benchmark to represent "in-the-wild" clinical deployment.

Key Insights and Ideas

  • The "Early Warning" Latent Space: The most striking insight is that latent space integrity ($q(\mathcal{G})$) is a powerful proxy for performance. When the integrity score drops, task performance (like AUC) almost always follows. This allows researchers to detect potential failures without needing ground-truth labels for the new data.
Degradation of latent space integrity under increasing noise
  • The Overconfidence Trap: Self-supervised (SSE) and traditional (PSDE) models were found to be dangerously "overconfident." Even when their accuracy plummeted under heavy noise, their uncertainty measures remained low. They were confidently wrong.
  • Accuracy vs. Stability Trade-off: Fully-supervised models (FSE) achieved the highest absolute accuracy but were the most sensitive to shifts. Because they have more trainable parameters, they "specialize" too much on the training distribution, making them brittle when the hardware changes.
  • Noise Sensitivity: Broadband noise and band-pass filtering settings had the most significant impact on model robustness, suggesting these are the most critical factors for engineers to standardize.

Key Results

  • Performance Drop: Under the strongest broadband noise ($\sigma=0.1$), the FSE model’s AUC for EEG grade classification dropped from 0.92 to 0.86, while its Mean Absolute Error (MAE) for age prediction jumped from 9.47 to 14.05 years.
  • Latent Integrity: SSE and PSDE encoders generally preserved latent space integrity better than FSE, even if their raw task performance was lower.
  • Out-of-Sample Validation: When moving from the TUH dataset to the NMT dataset (a real-world shift), all models saw a "universal degradation" in performance. The FSE model's AUC dropped from 0.92 to 0.72, confirming that standard test sets vastly overestimate real-world utility.

Limitations and Future Work

The authors acknowledge several areas for growth:

  • Scope of Shifts: This study focused on instrumentation noise. It did not account for physiological shifts, such as the patient being awake vs. asleep, which also significantly alters EEG signals.
  • Quantization Modeling: The current quantization shift is a simple decimal truncation; a more rigorous approach would involve re-mapping signals to specific discrete bit-levels.
  • Mitigation: The paper focuses on detecting robustness issues rather than fixing them. Future work will explore whether training models explicitly on these realistic shifts (adversarial training) can improve their "in-the-wild" resilience.

Summary updated

BibTeX
@inproceedings{wagh2022evaluating,
  author = {Neeraj Wagh and Jionghao Wei and Samarth Rawal and Brent M. Berry and Yogatheesan Varatharajah},
  title = {{Evaluating Latent Space Robustness and Uncertainty of EEG-ML Models under Realistic Distribution Shifts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure