Skip to content
/ EEG-DIF Public

EEG-DIF: Early Warning of Epileptic Seizures through Generative Diffusion Model-based Multi-channel EEG Signals Forecasting

License

Notifications You must be signed in to change notification settings

JZK00/EEG-DIF

Repository files navigation

EEG-DIF

Introduction

Early Warning of Epileptic Seizures through Generative Diffusion Model-based Multi-channel EEG Signals Forecasting.

Here, we provide a clean version of the EEG-DIF algorithm, allowing users to run the code on any EEG data to achieve future predictions for any time frame. This research is ongoing, and additional updates or code uploads will be made in the future.

The EEG-DIF algorithm: 本地图片描述

Installation

This project is based on Pytorch. You can use the following command to install the Pytorch.

create a virtual enviroment

conda create -n EEGDiff python=3.9
conda activate EEGDiff

linux user

pip3 install torch torchvision torchaudio
pip install -r requirements.txt

windows user

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
pip install -r requirements.txt

MacOS user

pip3 install torch torchvision torchaudio
pip install -r requirements.txt

Forecasting Model Training

You should fill your wandb key in:

/train_eegdiff.py

Then, you can use the following command to train your model.

python train_eegdiff.py

Forecasting Model Inference

You can use the following command to test your model.

python test_eegdiff.py

Forecasting Results

You can see some prediction results by using this code, like: 本地图片描述

And you can also calculate the corresponding prediction metrics. You can save the generated future data locally and then run the classification code to carry out early diagnosis and warning of related diseases. Our code is an initial version that offers a novel solution and approach, and we welcome everyone to further improve and enhance it based on this foundation.

About

EEG-DIF: Early Warning of Epileptic Seizures through Generative Diffusion Model-based Multi-channel EEG Signals Forecasting

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published