Contrastive and Multi-Task Learning on Noisy Brain Signals with Nonlinear Dynamical Signatures

Sucheta Ghosh, Zahra Monfared, Felix Dietrich

Abstract: We introduce a two-stage multitask learning framework for analyzing Electroencephalography (EEG) signals that integrates denoising, dynamical modeling, and representation learning. In the first stage, a denoising autoencoder is trained to suppress artifacts and stabilize temporal dynamics, providing robust signal representations. In the second stage, a multitask architecture processes these denoised signals to achieve three objectives: motor imagery classification, chaotic versus non-chaotic regime discrimination using Lyapunov exponent-based labels, and self-supervised contrastive representation learning with NT-Xent loss. A convolutional backbone combined with a Transformer encoder captures spatial-temporal structure, while the dynamical task encourages sensitivity to nonlinear brain dynamics. This staged design mitigates interference between reconstruction and discriminative goals, improves stability across datasets, and supports reproducible training by clearly separating noise reduction from higher-level feature learning. Empirical studies show that our framework not only enhances robustness and generalization but also surpasses strong baselines and recent state-of-the-art methods in EEG decoding, highlighting the effectiveness of combining denoising, dynamical features, and self-supervised learning.

Introduction

Brain-Computer Interfaces (BCIs) rely heavily on Electroencephalography (EEG) to decode user intentions. A classic BCI task is Motor Imagery (MI) classification—distinguishing whether a person is actually moving a limb or just imagining moving it.

However, EEG signals are notoriously noisy, non-stationary, and vary wildly between subjects. While deep learning models like CNNs and Transformers have improved MI classification, they often struggle with this noise and require massive amounts of labeled data to generalize well. Furthermore, traditional models treat EEG data purely as standard time-series signals, ignoring the rich, underlying nonlinear dynamical behaviors of the brain. Brain waves can exhibit distinct mathematical states—such as chaotic attractors or non-chaotic (periodic) patterns—but these dynamical signatures are rarely utilized in standard deep learning pipelines.

Methods

The authors propose a two-stage architecture to tackle noise, representation learning, and dynamical modeling:

  1. Stage 1: Denoising Autoencoder (DAE): A 1D convolutional network first cleans the raw EEG data. It is trained unsupervised to suppress artifacts (like eye blinks or muscle twitches) while preserving essential spectral features, providing a clean foundation for the next stage.
  2. Stage 2: Multitask Transformer: The cleaned signals pass through a shared CNN-Transformer backbone that branches into three distinct heads, trained jointly:
  3. Motor Imagery Classification (Supervised): A standard classification head predicting real vs. imagined movement.
  4. Chaos Detection (Pseudo-supervised): A novel head that classifies the signal's underlying dynamics as chaotic or non-chaotic. The "ground truth" labels for this are generated offline using Lyapunov Exponents (calculated via Piecewise-Linear RNNs) and entropy measures.
  5. Contrastive Learning (Self-supervised): A projection head using NT-Xent loss. It takes augmented versions of the EEG signals (adding jitter, scaling, time masking, and channel dropout) and forces the model to learn representations that are invariant to these nuisance perturbations.
The two-stage multitask learning architecture for EEG signal analysis.

By splitting the architecture into a dedicated denoising stage and a feature-learning stage, the framework prevents the reconstruction objective from interfering with the discriminative goals. The effectiveness of the denoising stage is evident in the preservation of key frequency bands while suppressing high-frequency noise.

Power Spectral Density (PSD) comparison between original and reconstructed EEG signals.

Experimental Setup

The framework was evaluated on two widely used BCI benchmarks:

  • BCI2000: A large dataset featuring 109 subjects (64 channels, 160 Hz) performing real and imagined motor tasks. It is highly noisy, making it a great testbed for the denoising module.
  • BNCI Horizon 2020 (004/008/009): Standard BCI benchmark datasets containing left- vs. right-hand motor imagery tasks from smaller pools of subjects (9 to 14 subjects, 15-22 channels).

Key Insights and Results

Dynamical Signatures as a Regularizer

Forcing the network to identify whether a brain signal is chaotic or periodic acts as a powerful inductive bias. It teaches the model to care about the fundamental physics and complexity of the brain state, not just superficial time-domain patterns. The model successfully learned to classify chaotic vs. non-chaotic dynamics with over 90% accuracy.

Performance and Ablation

The proposed framework achieved the highest F1 scores on both datasets under a strict Leave-One-Subject-Out (LOSO) evaluation protocol. It reached an F1 score of 0.84 on BCI2000 and 0.83 on BNCI Horizon 2020, outperforming strong baselines like EEGNet (0.70/0.68) and recent self-supervised methods like TS-TCC (0.80/0.78).

Ablation studies confirmed the importance of each component: removing the contrastive learning module dropped the F1 score from 0.82 to 0.78, while removing the denoising autoencoder caused a severe drop to 0.75, proving that upfront noise reduction is vital for downstream Transformer performance.

Conclusion

While the model demonstrates state-of-the-art performance, its generalization remains bottlenecked by the scarcity of high-quality, large-scale annotated EEG datasets. Future work will explore expanding dynamical classification to include specific periodic or quasi-periodic states and integrating Graph Neural Networks (GNNs) to better map the spatial relationships between EEG electrodes on the scalp.

Summary updated

BibTeX
@misc{ghosh2026contrastive,
  author = {Sucheta Ghosh and Zahra Monfared and Felix Dietrich},
  title = {{Contrastive and Multi-Task Learning on Noisy Brain Signals with Nonlinear Dynamical Signatures}},
  year = {2026},
  eprint = {2601.08549},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.08549},
}
Figure