braindecode.models.EEGInception#

class braindecode.models.EEGInception(in_channels, n_classes, input_window_samples=1000, sfreq=128, drop_prob=0.5, scales_samples_s=(0.5, 0.25, 0.125), n_filters=8, activation=ELU(alpha=1.0), batch_norm_alpha=0.01, depth_multiplier=2, pooling_sizes=(4, 2, 2, 2))[source]#

EEG Inception.

EEG Inception for ERP-based classification described in [Santamaria2020]. 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 [R15fdf33b022f-beetl].

The model is fully described in [Santamaria2020].

Notes

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

Parameters
  • in_channels (int) – Number of EEG channels.

  • n_classes (int) – Number of classes.

  • input_size_ms (int) – Size of the input, in milliseconds. Set to 1000 in [Santamaria2020].

  • sfreq (float) – EEG sampling frequency.

  • drop_prob (float) – Dropout rate inside all the network.

  • scales_time (list(int)) – Windows for inception block, must be a list with proportional values of the input_size_ms. According to the authors: temporal scale (ms) of the convolutions on each Inception module. This parameter determines the kernel sizes of the filters.

  • n_filters (int) – Initial number of convolutional filters. Set to 8 in [Santamaria2020].

  • activation (nn.Module) – Activation function, default: ELU activation.

  • batch_norm_alpha (float) – Momentum for BatchNorm2d.

  • depth_multiplier (int) – Depth multiplier for the depthwise convolution.

  • pooling_sizes (list(int)) – Pooling sizes for the inception block.

References

Santamaria2020(1,2,3,4,5)

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