This repository contains the original Python code for our paper Time-Frequency Transform Based Cross-Subject EEG Data Augmentation (KBS, 2025), featuring three key implementations:
- DWTaug: Discrete Wavelet Transform-based EEG data augmentation.
- HHTaug: Hilbert-Huang Transform-based EEG data augmentation.
- DWTaug-ML: A multi-level version of DWTaug.

This work aims to tackle key challenges in BCI applications, including data scarcity, EEG signal non-stationarity, as well as individual differences. The proposed DWTAug and HHTAug follow three steps: time-frequency domain signal decomposition, cross-subject sub-signal reassembling, and time domain reconstruction. Augmenting data expands the pool of labeled training samples, alleviating the data scarcity problem; time-frequency decomposition captures the non-stationary properties of EEG signals more effectively; finally, cross-subject reassembling of sub-signals handles individual differences.
The proposed approaches are effective for motor imagery (MI), P300, and SSVEP, especially when significant individual difference exists. Notably, DWTaug and HHTaug demonstrate high effectiveness in the SSVEP paradigm, particularly on Benchmark dataset, achieving an accuracy improvement exceeding 10%.
The proposed methods have been tested on 17 EEG datasets across multiple BCI paradigms, consistently outperforming existing data augmentation approaches.

(1) Visualizations of EEG trials before (blue lines) and after (orange lines) ten different data augmentation approaches:

(2)

If you find this repo helpful, please cite our work:
@Article{Wang2025CSDA,
title={Time-frequency transform based EEG data augmentation for brain-computer interfaces},
author={Wang, Ziwei and Li, Siyang and Chen, Xiaoqing and Wu, Dongrui},
journal={Knowledge-Based Systems},
pages={113074},
year={2025},
volume={311}
}
For any questions or collaborations, please feel free to reach out via [email protected] or open an issue in this repository.