This repository is the official code for our IJCAI 2025 paper: "A Correlation Manifold Self-Attention Network for EEG Decoding".
If you have any problems, please don't hesitate to contact me.
Riemannian neural networks, which generalize the deep learning paradigm to non-Euclidean geometries, have garnered widespread attention across diverse applications in artificial intelligence. Among these, the representative attention models have been studied on various non-Euclidean spaces to geometrically capture the spatiotemporal dependencies inherent in time series data, e.g., electroencephalography (EEG). Recent studies have highlighted the full-rank correlation matrix as an advantageous alternative to the covariance matrix for data representation, owing to its invariance to the scale of variables. Motivated by these advancements, we propose the Correlation Attention Network (CorAtt) tailored for full-rank correlation matrices and implement it under the permutation-invariant and computationally efficient Off-Log and Log-Scaled geometries, respectively. Extensive evaluations on three benchmarking EEG datasets provide substantial evidence for the effectiveness of our introduced CorAtt.
To install the necessary dependencies by conda, run the following command:
conda env create CorAtt_env.yml
conda activate CorAtt
Please download the datasets and put them in the folder 'data'.
- BCIC-IV-2a: https://www.bbci.de/competition/iv/
- MAMEM-SSVEP-II: https://www.mamem.eu/results/datasets/
- BCI-ERN: https://www.kaggle.com/competitions/inria-bci-challenge/data
Link to download data. Please note that processed datasets provided by MAtt
To train and test the experiments on the Mamem and Bcicha datasets, run this command:
python CorrAttMamem.py
python CorrAttBciCha.py
python CorrAttBCI.py
We encourage you to reproduce the results with different hyperparameter settings. When adapting the model to new tasks, we highlight several implementation details that we found to be particularly important.
-
The backpropagation of
spd_scaling_finderinCorrAttention.lsm_diffeo. We observed that allowing gradients to propagate throughspd_scaling_finderdoes not lead to better performance. In our experiments, disabling backpropagation often yields more stable and better results. Therefore, we wrap this step withwith torch.no_grad(). However, this behavior may be task-specific, and you can experiment with enabling or disabling gradient propagation. -
Number of iterations in
spd_scaling_finder. In our tasks, a single iteration often provides a sufficient approximation, so we set the default number of iterations to 1. That said, in our earlier experiments, different settings (e.g., 1, 2, or 3 iterations) can lead to better performance under different scenarios. A similar phenomenon is also observed inhol_plus_finder, where the optimal number of iterations may vary across tasks.
@inproceedings{hu2025ijcai,
title={A Correlation Manifold Self-Attention Network for EEG Decoding},
author={Hu, Chen and Wang, Rui and Song, Xiaoning and Zhou, Tao and Wu, Xiao-Jun and Sebe, Nicu and Chen, Ziheng},
booktitle={Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, {IJCAI-25}},
pages={5372--5380},
year={2025},
}@inproceedings{wang2024grassmannian,
title={A Grassmannian Manifold Self-Attention Network for Signal Classification},
author={Wang, Rui and Hu, Chen and Chen, Ziheng and Wu, Xiao-Jun and Song, Xiaoning},
booktitle={Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence},
pages={5099--5107},
year={2024}
}