A Novel Local Explainability Approach for Spectral Insight into Raw Eeg-Based Deep Learning Classifiers

Charles A. Ellis, Robyn L. Miller, Vince D. Calhoun

TL;DR

This paper introduces a novel "local spectral explainability" method to understand which specific EEG frequency bands are crucial for a deep learning model's classification of individual sleep stages. Unlike previous "global" methods that only tell us what's important overall, this new approach provides fine-grained insights into how frequency band importance shifts over time and even within the same sleep stage, offering a more nuanced understanding of raw EEG classification.

What Problem Does This Paper Address?

Electroencephalography (EEG) is rich in spectral information, making it valuable for understanding brain activity. While deep learning models excel at analyzing raw EEG data, interpreting why they make certain classifications remains a challenge. Traditional explainability methods often struggle with raw EEG because they're not designed to dissect the spectral features that deep learning models might implicitly learn. Existing "global" explainability methods can identify which frequency bands are generally important for a model's performance across all data, but they fail to capture how this importance might change for individual data points or over time. This is particularly problematic for dynamic processes like sleep, where brain states evolve continuously, and understanding the specific spectral drivers of each state transition is crucial.

Methods

The researchers developed a novel local spectral explainability approach called "EasyPEASI" (though the paper also refers to their own implementation of a similar concept). The core idea is to perturb the input EEG data in a controlled way and observe the impact on the classifier's output. Specifically:

  1. Frequency Domain Transformation: Raw EEG segments are converted into the frequency domain using a Fast Fourier Transform (FFT).
  2. Targeted Perturbation: For a given sample and a specific frequency band (e.g., delta, theta, alpha, beta, gamma), the spectral values within that band are replaced with values from other samples within the dataset. This is done multiple times (M=100 in their implementation) to ensure robustness.
  3. Classification Probability Change: The perturbed EEG segment is fed back into the classifier, and the change in classification probability is measured.
  4. Local Importance Score: The "local spectral importance" for a frequency band is calculated as the mean absolute percent change in classification probability across these perturbations. This score indicates how sensitive the classifier's prediction for that specific sample is to changes in that frequency band.
  5. Time-Series Analysis: This process is repeated for each 30-second segment of the EEG recording, allowing for the visualization of how frequency band importance evolves over time.

They also implemented a global explainability method, EasyPEASI, for comparison. Their local approach differs by not assuming a normal distribution of spectral values across samples and by perturbing individual samples with values from within the dataset, aiming to preserve the original data distribution.

Datasets

The study utilized the Sleep Cassette Data from the Sleep EDF Database available on Physionet. This dataset comprises approximately 20-hour recordings from 78 subjects, with EEG data from the Fpz-Cz electrode sampled at 100 Hz. The recordings were annotated with sleep stages: Unmarked, Movement, Awake, Rapid Eye Movement (REM), non-REM 1 (NREM1), NREM2, NREM3, or NREM4. For their analysis, NREM3 and NREM4 were consolidated into a single NREM3 class.

Key Insights and Ideas

  • Local vs. Global Importance: The most significant insight is the demonstration that frequency band importance is not static. What's crucial for classifying one sleep stage might be less important for another, and even within the same stage, the spectral drivers can shift over time.
  • Dynamic Spectral Signatures: The approach reveals that deep learning models learn complex, dynamic spectral patterns for sleep staging, which may not always align with traditional physician-based interpretations.
  • The Delta Band's Dominance: The delta (δ) band (0-4 Hz) consistently emerged as the most important frequency band for overall classification and for most individual sleep stages, aligning with known physiological characteristics of sleep.
  • Stage-Specific Nuances: While delta is generally dominant, the beta (β) band (12-25 Hz) was found to be most important for NREM2 sleep, and the theta (θ) band (4-8 Hz) played a particularly important role in distinguishing Awake and NREM1 states.
  • Limitations of Global Methods: The comparison with EasyPEASI highlights how global methods can mask important local variations and might rely on assumptions (like normal distribution) that don't hold true for complex biological data.

Key Results

  • Classifier Performance: The CNN achieved good performance across sleep stages, with the highest F1 scores for Awake (91.28%) and NREM2 (77.38%), and lower but still notable performance for NREM1 (41.94%).
  • Global Importance (EasyPEASI): Across all classes, the delta (δ) band was identified as most important, followed by theta (θ) and beta (β).
  • Global Importance (Local Approach): Their local approach also found delta (δ) to be generally most important, with beta (β) being key for NREM2. Theta (θ) was important for Awake and NREM1.
  • Local Temporal Variation: Figure 4 vividly illustrates how the importance of frequency bands, particularly delta and beta, fluctuates significantly even within a 2-hour window and across samples classified as the same sleep stage. For instance, delta's importance in NREM2 varied from 40-80% within a short time frame.

Limitations and Future Work

  • Sample Size and Perturbation Window: The study used 30-second segments for perturbation. While adequate for lower frequencies, higher frequency estimates might be less accurate. Future work could explore smaller segment sizes or simultaneous perturbation of smaller segments.
  • Unrealistic Samples: Perturbation methods can sometimes create unrealistic data points that don't accurately reflect what a classifier has learned. While the authors addressed this by using in-dataset values and avoiding normality assumptions, gradient-based explainability methods are suggested as an alternative that might avoid this issue.
  • Focus on Correctly Classified Samples: The analysis primarily focused on correctly classified samples. Examining incorrectly classified samples could provide deeper insights into misclassification drivers.
  • Demographic Comparisons: The authors suggest comparing local explainability results with statistical analyses to determine if demographic variables influence the model's spectral reliance.
  • Broader Applications: While demonstrated for sleep staging, the approach has potential for other EEG-based classification tasks, such as seizure prediction or neurological disorder diagnosis.

Summary updated

Abstract

ABSTRACT The frequency domain of electroencephalography (EEG) data has developed as a particularly important area of EEG analysis. EEG spectra have been analyzed with explainable machine learning and deep learning methods. However, as deep learning has developed, most studies use raw EEG data, which is not well-suited for traditional explainability methods. Several studies have introduced methods for spectral insight into classifiers trained on raw EEG data. These studies have provided global insight into the frequency bands that are generally important to a classifier but do not provide local insight into the frequency bands important for the classification of individual samples. This local explainability could be particularly helpful for EEG analysis domains like sleep stage classification that feature multiple evolving states. We present a novel local spectral explainability approach and use it to explain a convolutional neural network trained for automated sleep stage classification. We use our approach to show how the relative importance of different frequency bands varies over time and even within the same sleep stages. Furthermore, to better understand how our approach compares to existing methods, we compare a global estimate of spectral importance generated from our local results with an existing global spectral importance approach. We find that the δ band is most important for most sleep stages, though β is most important for the non-rapid eye movement 2 (NREM2) sleep stage. Additionally, θ is particularly important for identifying Awake and NREM1 samples. Our study represents the first approach developed for local spectral insight into deep learning classifiers trained on raw EEG time series.
BibTeX
@inproceedings{ellis2021novel,
  author = {Charles A. Ellis and Robyn L. Miller and Vince D. Calhoun},
  title = {{A Novel Local Explainability Approach for Spectral Insight into Raw Eeg-Based Deep Learning Classifiers}},
  booktitle = {BIBE},
  year = {2021},
  doi = {10.1109/bibe52308.2021.9635243},
}
Figure