braindecode.models.EEGInceptionERP#

class braindecode.models.EEGInceptionERP(n_chans=None, n_outputs=None, n_times=1000, sfreq=128, drop_prob=0.5, scales_samples_s=(0.5, 0.25, 0.125), n_filters=8, activation: ~torch.nn.modules.module.Module = <class 'torch.nn.modules.activation.ELU'>, batch_norm_alpha=0.01, depth_multiplier=2, pooling_sizes=(4, 2, 2, 2), chs_info=None, input_window_seconds=None)[source]#

EEG Inception for ERP-based from Santamaria-Vazquez et al (2020) [santamaria2020].

EEGInceptionERP Architecture

The code for the paper and this model is also available at [santamaria2020] and an adaptation for PyTorch [2].

The model is strongly based on the original InceptionNet for an image. The main goal is to extract features in parallel with different scales. The authors extracted three scales proportional to the window sample size. The network had three parts: 1-larger inception block largest, 2-smaller inception block followed by 3-bottleneck for classification.

One advantage of the EEG-Inception block is that it allows a network to learn simultaneous components of low and high frequency associated with the signal. The winners of BEETL Competition/NeurIps 2021 used parts of the model [beetl].

The model is fully described in [santamaria2020].

Parameters:
  • n_chans (int) – Number of EEG channels.

  • n_outputs (int) – Number of outputs of the model. This is the number of classes in the case of classification.

  • n_times (int, optional) – Size of the input, in number of samples. Set to 128 (1s) as in [santamaria2020].

  • sfreq (float, optional) – EEG sampling frequency. Defaults to 128 as in [santamaria2020].

  • drop_prob (float, optional) – Dropout rate inside all the network. Defaults to 0.5 as in [santamaria2020].

  • scales_samples_s (list(float), optional) – Windows for inception block. Temporal scale (s) of the convolutions on each Inception module. This parameter determines the kernel sizes of the filters. Defaults to 0.5, 0.25, 0.125 seconds, as in [santamaria2020].

  • n_filters (int, optional) – Initial number of convolutional filters. Defaults to 8 as in [santamaria2020].

  • activation (nn.Module, optional) – Activation function. Defaults to ELU activation as in [santamaria2020].

  • batch_norm_alpha (float, optional) – Momentum for BatchNorm2d. Defaults to 0.01.

  • depth_multiplier (int, optional) – Depth multiplier for the depthwise convolution. Defaults to 2 as in [santamaria2020].

  • pooling_sizes (list(int), optional) – Pooling sizes for the inception blocks. Defaults to 4, 2, 2 and 2, as in [santamaria2020].

  • chs_info (list of dict) – Information about each individual EEG channel. This should be filled with info["chs"]. Refer to mne.Info for more details.

  • input_window_seconds (float) – Length of the input window in seconds.

Raises:
  • ValueError – If some input signal-related parameters are not specified: and can not be inferred.

  • FutureWarning – If add_log_softmax is True, since LogSoftmax final layer: will be removed in the future.

Notes

This implementation is not guaranteed to be correct, has not been checked by original authors, only reimplemented from the paper based on [2].

References

[santamaria2020] (1,2,3,4,5,6,7,8,9,10,11)

Santamaria-Vazquez, E., Martinez-Cagigal, V., Vaquerizo-Villar, F., & Hornero, R. (2020). EEG-inception: A novel deep convolutional neural network for assistive ERP-based brain-computer interfaces. IEEE Transactions on Neural Systems and Rehabilitation Engineering , v. 28. Online: http://dx.doi.org/10.1109/TNSRE.2020.3048106

[2] (1,2)

Grifcc. Implementation of the EEGInception in torch (2022). Online: Grifcc/EEG

[beetl]

Wei, X., Faisal, A.A., Grosse-Wentrup, M., Gramfort, A., Chevallier, S., Jayaram, V., Jeunet, C., Bakas, S., Ludwig, S., Barmpas, K., Bahri, M., Panagakis, Y., Laskaris, N., Adamos, D.A., Zafeiriou, S., Duong, W.C., Gordon, S.M., Lawhern, V.J., Śliwowski, M., Rouanne, V. &amp; Tempczyk, P. (2022). 2021 BEETL Competition: Advancing Transfer Learning for Subject Independence &amp; Heterogeneous EEG Data Sets. Proceedings of the NeurIPS 2021 Competitions and Demonstrations Track, in Proceedings of Machine Learning Research 176:205-219 Available from https://proceedings.mlr.press/v176/wei22a.html.