+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+ +
+

braindecode.models.SCCNet#

+
+
+class braindecode.models.SCCNet(n_chans=None, n_outputs=None, n_times=None, chs_info=None, input_window_seconds=None, sfreq=None, n_spatial_filters: int = 22, n_spatial_filters_smooth: int = 20, drop_prob: float = 0.5, activation: ~torch.nn.modules.module.Module = <class 'braindecode.models.modules.LogActivation'>)[source]#
+

SCCNet from Wei, C S (2019) [sccnet].

+

Spatial component-wise convolutional network (SCCNet) for motor-imagery EEG +classification.

+
+Spatial component-wise convolutional network +
+
    +
  1. +
    Spatial Component Analysis: Performs convolution spatial filtering

    across all EEG channels to extract spatial components, effectively +reducing the channel dimension.

    +
    +
    +
  2. +
  3. +
    Spatio-Temporal Filtering: Applies convolution across the spatial

    components and temporal domain to capture spatio-temporal patterns.

    +
    +
    +
  4. +
  5. Temporal Smoothing (Pooling): Uses average pooling over time to smooth the +features and reduce the temporal dimension, focusing on longer-term patterns.

  6. +
  7. Classification: Flattens the features and applies a fully connected +layer.

  8. +
+
+
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) – Number of time samples of the input window.

  • +
  • 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.

  • +
  • sfreq (float) – Sampling frequency of the EEG recordings.

  • +
  • n_spatial_filters (int, optional) – Number of spatial filters in the first convolutional layer. Default is 22.

  • +
  • n_spatial_filters_smooth (int, optional) – Number of spatial filters used as filter in the second convolutional +layer. Default is 20.

  • +
  • drop_prob (float, optional) – Dropout probability. Default is 0.5.

  • +
  • activation (nn.Module, optional) – Activation function after the second convolutional layer. Default is +logarithm activation.

  • +
+
+
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 description and +the source that have not been tested [sccnetcode].

+

References

+
+
+[sccnet] +

Wei, C. S., Koike-Akino, T., & Wang, Y. (2019, March). Spatial +component-wise convolutional network (SCCNet) for motor-imagery EEG +classification. In 2019 9th International IEEE/EMBS Conference on +Neural Engineering (NER) (pp. 328-331). IEEE.

+
+
+[sccnetcode] +

Hsieh, C. Y., Chou, J. L., Chang, Y. H., & Wei, C. S. +XBrainLab: An Open-Source Software for Explainable Artificial +Intelligence-Based EEG Analysis. In NeurIPS 2023 AI for +Science Workshop.

+
+
+

Methods

+
+
+forward(x: Tensor) Tensor[source]#
+

Define the computation performed at every call.

+

Should be overridden by all subclasses.

+
+

Note

+

Although the recipe for forward pass needs to be defined within +this function, one should call the Module instance afterwards +instead of this since the former takes care of running the +registered hooks while the latter silently ignores them.

+
+
+
Parameters:
+

x – The description is missing.

+
+
+
+ +
+ +
+ + + +
+ + + + + + + +
+ + + + +
+ + +
+
+ +
+ +