Skip to content
ichenwsPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Uni-DMFM: A Universal Dynamic Multi-Scale Foundation Model for EEG Representation Learning

Official implementation of Uni-DMFM: A Universal Dynamic Multi-Scale Foundation Model for EEG Representation Learning, published in Pattern Recognition, 2026.

Installation

conda create -n unidmfm python=3.10
conda activate unidmfm
pip install -r requirements.txt

Data Preparation

Pretraining Data

Uni-DMFM is pretrained on the TUEG corpus. Before running the script, set the raw TUEG dataset path and the output path in the file. Then run:

python preprocessing/TUEG_dataset/preprocessing_tueg_for_pretraining.py

Pretrained Weights

The pretrained checkpoint can be downloaded from here. After downloading, place it under:

checkpoint/pretrained_weights.pth

Fine-tuning Data

Place downstream EEG classification datasets under the project-level DATA directory. Then run the preprocessing script:

bash preprocessing/data_preprocess.sh

Then generate JSON split files for downstream fine-tuning:

bash preprocessing/json_process.sh

Pretraining

Run pretraining with:

python pretrain.py \
  --epochs 50 \
  --batch_size 32 \
  --cuda 0 \
  --pretrain_data DATA/TUEG_dataset \
  --model_dir

Fine-tuning

Run downstream classification fine-tuning with:

python finetune.py \
  --dataset SEED \
  --subject_mod cross \
  --finetune_mod full \
  --epochs 50 \
  --batch_size 64 \
  --device cuda

Citation

If you find this repository useful for your research, please cite:

@article{CHEN2026114221,
title = {Uni-DMFM: A universal dynamic multi-scale foundation model for EEG representation learning},
journal = {Pattern Recognition},
volume = {180},
pages = {114221},
year = {2026},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2026.114221},
url = {https://www.sciencedirect.com/science/article/pii/S0031320326011866},
author = {Wensheng Chen and Yurong Li and Jiyu Tan and Xiaojing Xue and Zhenhua Zhao},
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages