All models

CTNet

Convolutional module plus Transformer encoder for classifying motor imagery from EEG.

Neuroscience signals · 160 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (26 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
27.3K
Operations
160
Framework
PyTorch
Recurrent
No
Published
2024, Scientific Reports 14:20237
Cited by
190 (as of 28 October 2026)
Authors
Wei Zhao, Xiaolu Jiang, Baocan Zhang and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m15201
Graph hash
aae5cef0b2cc6571a3b459b71c90a501de5199e028969b47d8c2d86c8ef4cb25
Skeleton hash
d3742c145dfed0876b50cb287d37f0c8e3eddca4e914d1b15f1a8e5ff531e966
Architecture hash
f216e3f44c47ae37c18065408ec77b440cba8d1b4476753e88a5c3eb316aaf44
Diagram SHA-256
843b6a0c63db72aa23fb5b0c8d22e8efb94c9b258136cb6bd726d8939eeb8e30
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

braindecode.models.CTNet(n_chans=22, n_outputs=4, n_times=1000, num_heads=2, embed_dim=16, num_layers=6, n_filters_time=8, kernel_size=64, depth_multiplier=2, pool_size_1=8, pool_size_2=8, cnn_drop_prob=0.5, att_positional_drop_prob=0.1, final_drop_prob=0.5)

What it is

CTNet is a convolutional Transformer network that classifies motor imagery from EEG trials, a task used in brain-computer interfaces. It has three parts: a convolutional module, a Transformer encoder and a fully connected classifier.

The convolutional module draws on EEGNet and applies three layers in turn: a temporal convolution, a depth-wise convolution across the electrode channels for spatial filtering, and a spatial convolution, with two average pooling layers that shorten the sequence. The second pooling size sets how many tokens reach the Transformer, and each token holds all feature channels at one time point. The encoder's multi-head attention relates positions across the whole sequence, which the paper presents as a complement to the limited receptive field of the convolutions. Before classification the convolutional features are added to the encoder output, flattened and passed through dropout to a fully connected layer with one unit per class.

The paper reports subject-specific accuracies of 82.52% on BCI IV-2a and 88.49% on BCI IV-2b, and cross-subject accuracies of 58.64% and 76.27% on the same datasets. It found the best results with two attention heads and an encoder depth of 6, and lists sensitivity to these hyperparameters and to token size as a limitation.

Key idea. CTNet feeds features from an EEGNet-like convolutional module into a Transformer encoder so that attention models global dependencies in EEG for motor imagery classification.

  • CTNet
  • convolutional Transformer network
  • EEG classification
  • motor imagery
  • MI-EEG decoding
  • brain-computer interface
  • BCI
  • EEG transformer

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{Zhao_2024, title={CTNet: a convolutional transformer network for EEG-based motor imagery classification}, volume={14}, ISSN={2045-2322}, url={http://dx.doi.org/10.1038/s41598-024-71118-7}, DOI={10.1038/s41598-024-71118-7}, number={1}, journal={Scientific Reports}, publisher={Springer Science and Business Media LLC}, author={Zhao, Wei and Jiang, Xiaolu and Zhang, Baocan and Xiao, Shixiao and Weng, Sujun}, year={2024}, month=Aug }