braindecode.models.EEGMiner#

class braindecode.models.EEGMiner(method='plv', n_chans=None, n_outputs=None, n_times=None, chs_info=None, input_window_seconds=None, sfreq=None, filter_f_mean=(23.0, 23.0), filter_bandwidth=(44.0, 44.0), filter_shape=(2.0, 2.0), group_delay=(20.0, 20.0), clamp_f_mean=(1.0, 45.0))[source]#

EEGMiner from Ludwig et al (2024) [eegminer].

Convolution Interpretability

EEGMiner Architecture

EEGMiner is a neural network model for EEG signal classification using learnable generalized Gaussian filters. The model leverages frequency domain filtering and connectivity metrics or feature extraction, such as Phase Locking Value (PLV) to extract meaningful features from EEG data, enabling effective classification tasks.

The model has the following steps:

  • Generalized Gaussian filters in the frequency domain to the input EEG signals.

  • Connectivity estimators (corr, plv) or Electrode-Wise Band Power (mag), by default (plv).
    • ‘corr’: Computes the correlation of the filtered signals.

    • ‘plv’: Computes the phase locking value of the filtered signals.

    • ‘mag’: Computes the magnitude of the filtered signals.

  • Feature Normalization
    • Apply batch normalization.

  • Final Layer
    • Feeds the batch-normalized features into a final linear layer for classification.

Depending on the selected method (mag, corr, or plv), it computes the filtered signals’ magnitude, correlation, or phase locking value. These features are then normalized and passed through a batch normalization layer before being fed into a final linear layer for classification.

The input to EEGMiner should be a three-dimensional tensor representing EEG signals:

(batch_size, n_channels, n_timesteps).

Notes

EEGMiner incorporates learnable parameters for filter characteristics, allowing the model to adaptively learn optimal frequency bands and phase delays for the classification task. By default, using the PLV as a connectivity metric makes EEGMiner suitable for tasks requiring the analysis of phase relationships between different EEG channels.

The model and the module have patent [eegminercode], and the code is CC BY-NC 4.0.

Added in version 0.9.

Parameters:
  • method (str, default="plv") – The method used for feature extraction. Options are: - “mag”: Electrode-Wise band power of the filtered signals. - “corr”: Correlation between filtered channels. - “plv”: Phase Locking Value connectivity metric.

  • filter_f_mean (list of float, default=[23.0, 23.0]) – Mean frequencies for the generalized Gaussian filters.

  • filter_bandwidth (list of float, default=[44.0, 44.0]) – Bandwidths for the generalized Gaussian filters.

  • filter_shape (list of float, default=[2.0, 2.0]) – Shape parameters for the generalized Gaussian filters.

  • group_delay (tuple of float, default=(20.0, 20.0)) – Group delay values for the filters in milliseconds.

  • clamp_f_mean (tuple of float, default=(1.0, 45.0)) – Clamping range for the mean frequency parameters.

References

[eegminer]

Ludwig, S., Bakas, S., Adamos, D. A., Laskaris, N., Panagakis, Y., & Zafeiriou, S. (2024). EEGMiner: discovering interpretable features of brain activity with learnable filters. Journal of Neural Engineering, 21(3), 036010.

[eegminercode]

Ludwig, S., Bakas, S., Adamos, D. A., Laskaris, N., Panagakis, Y., & Zafeiriou, S. (2024). EEGMiner: discovering interpretable features of brain activity with learnable filters. SMLudwig/EEGminer. Cogitat, Ltd. “Learnable filters for EEG classification.” Patent GB2609265. https://www.ipo.gov.uk/p-ipsum/Case/ApplicationNumber/GB2113420.0

Methods

forward(x)[source]#

x: (batch, electrodes, time)