SPD Learn: A Geometric Deep Learning Python Library for Neural Decoding Through Trivialization
Authors: Bruno Aristimunha, Ce Ju, Antoine Collas, Florent Bouchard, Ammar Mian, Bertrand Thirion, Sylvain Chevallier, Reinmar Kobler
Organizations: A&O, LISN, Université Paris-Saclay, CNRS, Inria TAU/NERV, France · Yneuro, France · University of San Diego, EUA · Inria, CEA, Université Paris-Saclay, Palaiseau, France · Université Paris-Saclay, CNRS, CentraleSupélec, L2S, France · Université Savoie Mont Blanc, LISTIC, France · A&O, LISN, Université Paris-Saclay, CNRS, Inria TAU, France · Advanced Telecommunications Research Institute International, Kyoto · RIKEN Artificial Intelligence Project, Tokyo, Japan
Implementations of symmetric positive definite (SPD) matrix-based neural networks for neural decoding remain fragmented across research codebases and Python packages. Existing implementations often employ ad hoc handling of manifold constraints and non-unified training setups, which hinders reproducibility and integration into modern deep-learning workflows. To address this gap, we introduce SPD Learn, a unified and modular Python package for geometric deep learning with SPD matrices. SPD Learn provides core SPD operators and neural-network layers, including numerically stable spectral operators, and enforces Stiefel/SPD constraints via trivialization-based parameterizations. This design enables standard backpropagation and optimization in unconstrained Euclidean spaces while producing manifold-constrained parameters by construction. The package also offers reference implementations of representative SPDNet-based models and interfaces with widely used brain computer interface/neuroimaging toolkits and modern machine-learning libraries (e.g., MOABB, Braindecode, Nilearn, and SKADA), facilitating reproducible benchmarking and practical deployment.
Figures & tables
Neural Decoding Model
Description
Tensor-CSPNet ( Ju and Guan, 2023 )
Captures discriminative information across temporal, spectral, and spatial domains separately using SPDNet for EEG motor imagery.
TSMNet ( Kobler et al., 2022 )
Introduces a sample covariance matrix pooling layer and a batch norm layer SPDBatchNormMeanVar followed by an SPDNet classifier for EEG motor imagery.
Matt ( Pan et al., 2022 )
Introduces a manifold-valued attention module to SPDNet under Log-Euclidean geometry.
Green ( Paillard et al., 2025 )
Uses learnable wavelet convolutional features from EEGs followed by an SPDNet classifier.
EEGSPDNet ( Wilson et al., 2025 )
Introduces a channel-specific convolutional layer and a sample covariance matrix pooling layer followed by an SPDNet classifier for EEG motor imagery.
Phase-SPDNet ( Carrara et al., 2025 )
Applies a phase-space embedding using time-delayed coordinates followed by an SPDNet classifier for EEG motor imagery.
Table 1: Neural decoding models from model supported by SPDLearn .
Figure 1: Literature Map: The x-axis denotes the released/publication date (more recent papers to the right) and the y-axis denotes citation count (more highly cited papers at the top). Directed edges indicate influence relationships, defined by citation links between papers. The map was generated with Litmaps using data available as of January 2026.
We introduce two federated learning frameworks for the classical SPDnet model operating on symmetric positive definite (SPD) matrices with Stiefel-constrained parameters. Unlike standard Euclidean averaging, which violates orthogonality, our approach preserves geometric structure through two efficient aggregation strategies: ProjAvg, projecting arithmetic means onto the Stiefel manifold, and RLAvg, approximating tangent-space averaging via retractions and liftings. Both methods are computationally efficient, independent of the optimizer, and enable scalable federated learning for signal processing applications whose features are SPD matrices. Simulations on EEG motor imagery benchmarks show that FedSPDnet outperforms federated EEGnet in F1 score and robustness to federation and partial participation, while using fewer parameters per communication round.
Thibault Pautrel, Florent Bouchard, Ammar Mian +1
CentraleSup´elec, L2S, France · Universit´e Savoie Mont-Blanc, LISTIC, France
Brain signal decoding is challenging because neural recordings are noisy and vary across individuals, while labeled data are often limited. Recent attention-based models on the symmetric positive definite (SPD) manifold have nevertheless achieved strong performance using covariance and connectivity representations, yet the contribution of learned token weighting remains unclear. We examine two representative architectures, MAtt (based on log-Euclidean geometry) and GBWAtt (based on generalized Bures--Wasserstein geometry), and find that their learned attention weights remain close to uniform after training. We relate this behavior to bounded similarity parameterizations that, under the original softmax scaling, limit attention-weight contrast. Moreover, replacing learned weights with uniform weights, throughout training and evaluation, has little effect on mean predictive performance while preserving each model's original aggregation geometry. Motivated by these findings, we introduce SPD-MetaFormer, an attention-free architecture built on uniformly weighted Fréchet aggregation under log-Euclidean geometry. Its backbone uses a geodesic residual to update a summary token and a shared spectral feedforward map to transform all tokens, followed by a learned weighted readout. Token states remain SPD-valued until tangent-space classification. Across three EEG benchmarks, SPD-MetaFormer achieves competitive results relative to published Euclidean and manifold baselines. Separate matched reproductions test learned versus uniform weighting within MAtt and GBWAtt. These results suggest that, in the short-sequence and limited-data regimes studied, carefully designed SPD architectures can provide a simpler and effective alternative to adaptive manifold attention.
Decoding brain activity from electroencephalography (EEG) is crucial for neuroscience and clinical applications. Among recent advances in deep learning for EEG, geometric learning stands out as its theoretical underpinnings on symmetric positive definite (SPD) allows revealing structural connectivity analysis in a physics-grounded manner. However, current SPD-based methods focus predominantly on statistical aggregation of EEGs, with frequency-specific synchronization and local topological structures of brain regions neglected. Given this, we propose RepSPD, a novel geometric deep learning (GDL)-based model. RepSPD implements a cross-attention mechanism on the Riemannian manifold to modulate the geometric attributes of SPD with graph-derived functional connectivity features. On top of this, we introduce a global bidirectional alignment strategy to reshape tangent-space embeddings, mitigating geometric distortions caused by curvature and thereby enhancing geometric consistency. Extensive experiments demonstrate that our proposed framework significantly outperforms existing EEG representation methods, exhibiting superior robustness and generalization capabilities.
Haohui Jia, Zheng Chen, Lingwei Zhu +4
Information Science and Techinology, Hokkaido University, Japan · SANKEN, The University of Osaka, Japan · Great Bay University, China +1