This repository provides the implementation of the PLTA framework corresponding to the manuscript "Enhancing Real-Time Cross-Subject EEG Decoding via Pseudo-Label Tuning and Adaptation", currently under peer review.
The code is shared for the purpose of facilitating reproducibility during the review process. A fully documented release will be made available upon official publication of the paper.
To use the repository, install the conda dependencies using the following command:
conda env create -f environment.yml
conda activate pltaThe entire adaptation pipeline (download data → train source model → test-time adaptation) can be executed using the following shell scripts.
For more detailed hyperparameter configuration (e.g., learning rate, optimizer, batch size), please refer to the argparse arguments defined in the python script.
To download the datasets used in our experiment, run:
python download_data.pySupported datasets are: BNCI2014001, BNCI2014002, BNCI2015001
To train only the source-domain model, run:
python train_source.pyFor more detailed hyperparameter configuration (e.g., learning rate, optimizer, batch size), please refer to the argparse arguments defined in the python script.
The trained source model along with the training log will be saved under
./ckpt/{dataset_name}
To perform online adaptation during testing, run:
python test_time.py --method "your_method_name"Supported methods are (check the test_time.py script for the corresponding name used in the command):
- Source (without adaptation)
- RA-MDRM
- CORAL
- T3A
- PredBN
- PredBN+
- Tent
- COTTA
- LAME
- SAR
- TIPI
- EATA
- T-TIME
- PLTA (our work)
To modify the hyperparameters of a specific method, edit the corresponding YAML file:
./cfg/MotorImagery/{method_name}.yaml
Adaptation results and logs will be saved under under
./test-time-evaluation/{dataset_name}
For questions or requests, please contact: linzh23@m.fudan.edu.cn
- The base framework of this repository is built upon: Benchmark-TTA
- Part of the data processing code and the T-TIME implementation: T-TIME