--- license: bsd-3-clause library_name: braindecode pipeline_tag: feature-extraction tags: - eeg - biosignal - pytorch - neuroscience - braindecode - convolutional --- # EEGITNet EEG-ITNet from Salami, et al (2022) > **Architecture-only repository.** This repo documents the > `braindecode.models.EEGITNet` class. **No pretrained weights are > distributed here** — instantiate the model and train it on your own > data, or fine-tune from a published foundation-model checkpoint > separately. ## Quick start ```bash pip install braindecode ``` ```python from braindecode.models import EEGITNet model = EEGITNet( n_chans=22, sfreq=250, input_window_seconds=4.0, n_outputs=4, ) ``` The signal-shape arguments above are example defaults — adjust them to match your recording. ## Documentation - Full API reference (parameters, references, architecture figure): - Interactive browser with live instantiation: - Source on GitHub: ## Architecture description The block below is the rendered class docstring (parameters, references, architecture figure where available).

EEG-ITNet from Salami, et al (2022) [Salami2022]_

ConvolutionRecurrent .. figure:: https://braindecode.org/dev/_static/model/eegitnet.jpg :align: center :alt: EEG-ITNet Architecture EEG-ITNet: An Explainable Inception Temporal Convolutional Network for motor imagery classification from Salami et al. 2022. See [Salami2022]_ for details. Code adapted from https://github.com/abbassalami/eeg-itnet Parameters ---------- drop_prob: float Dropout probability. activation: nn.Module, default=nn.ELU Activation function class to apply. Should be a PyTorch activation module class like ``nn.ReLU`` or ``nn.ELU``. Default is ``nn.ELU``. kernel_length : int, optional Kernel length for inception branches. Determines the temporal receptive field. Default is 16. pool_kernel : int, optional Pooling kernel size for the average pooling layer. Default is 4. tcn_in_channel : int, optional Number of input channels for Temporal Convolutional (TC) blocks. Default is 14. tcn_kernel_size : int, optional Kernel size for the TC blocks. Determines the temporal receptive field. Default is 4. tcn_padding : int, optional Padding size for the TC blocks to maintain the input dimensions. Default is 3. drop_prob : float, optional Dropout probability applied after certain layers to prevent overfitting. Default is 0.4. tcn_dilatation : int, optional Dilation rate for the first TC block. Subsequent blocks will have dilation rates multiplied by powers of 2. Default is 1. Notes ----- This implementation is not guaranteed to be correct, has not been checked by original authors, only reimplemented from the paper based on author implementation. References ---------- .. [Salami2022] A. Salami, J. Andreu-Perez and H. Gillmeister, "EEG-ITNet: An Explainable Inception Temporal Convolutional Network for motor imagery classification," in IEEE Access, doi: 10.1109/ACCESS.2022.3161489. .. rubric:: Hugging Face Hub integration When the optional ``huggingface_hub`` package is installed, all models automatically gain the ability to be pushed to and loaded from the Hugging Face Hub. Install with:: pip install braindecode[hub] **Pushing a model to the Hub:** .. code:: from braindecode.models import EEGITNet # Train your model model = EEGITNet(n_chans=22, n_outputs=4, n_times=1000) # ... training code ... # Push to the Hub model.push_to_hub( repo_id="username/my-eegitnet-model", commit_message="Initial model upload", ) **Loading a model from the Hub:** .. code:: from braindecode.models import EEGITNet # Load pretrained model model = EEGITNet.from_pretrained("username/my-eegitnet-model") # Load with a different number of outputs (head is rebuilt automatically) model = EEGITNet.from_pretrained("username/my-eegitnet-model", n_outputs=4) **Extracting features and replacing the head:** .. code:: import torch x = torch.randn(1, model.n_chans, model.n_times) # Extract encoder features (consistent dict across all models) out = model(x, return_features=True) features = out["features"] # Replace the classification head model.reset_head(n_outputs=10) **Saving and restoring full configuration:** .. code:: import json config = model.get_config() # all __init__ params with open("config.json", "w") as f: json.dump(config, f) model2 = EEGITNet.from_config(config) # reconstruct (no weights) All model parameters (both EEG-specific and model-specific such as dropout rates, activation functions, number of filters) are automatically saved to the Hub and restored when loading. See :ref:`load-pretrained-models` for a complete tutorial.
## Citation Please cite both the original paper for this architecture (see the *References* section above) and braindecode: ```bibtex @article{aristimunha2025braindecode, title = {Braindecode: a deep learning library for raw electrophysiological data}, author = {Aristimunha, Bruno and others}, journal = {Zenodo}, year = {2025}, doi = {10.5281/zenodo.17699192}, } ``` ## License BSD-3-Clause for the model code (matching braindecode). Pretraining-derived weights, if you fine-tune from a checkpoint, inherit the licence of that checkpoint and its training corpus.