Skip to content

Fine-tuned LLM for electroencephalography(EEG) data classification

Notifications You must be signed in to change notification settings

Mye0ngjuu/EEG-LLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fine-tuned LLM for Electroencephalography(EEG) data classification

This is LLM Fine tuning model that classifies four movements (left hand, right hand, tongue, foot) from EEG.

  • LLM performs its own classification operations based on EEG data.
  • We trained gpt-4o model utilizing fine-tuning for better performance.
figure1

Requirements

Python>=3.8, openai>=1.30.2, mne>=1.6.1
You can install all libraries entering the code:

!pip install -r requirements.txt

Data

Data description : https://www.bbci.de/competition/iii/desc_IIIa.pdf

  • cued motor imagery (multi-class) with 4 classes (left hand, right hand, foot, tongue) three subjects (ranging from quite good to fair performance)
  • EEG, 60 channels, 60 trials per class
  • performance measure: kappa-coefficient

Download : BBCI Competition III (https://www.bbci.de/competition/iii/download/index.html?agree=yes&submit=Submit)


Features

1) Power spectral density (PSD) is computed in 2Hz steps from 4Hz to 36Hz.

For feature selection, Fisher Ratio is utilized.

fr_label1 fr_label2 fr_label3 fr_label4

2) Common spatial pattern (CSP) is used to extract spatial features that maximize discriminability between classes.


Evaluation

To compare fine-tuned LLM classifier's performance with traditional ML models, we additionally trained SVM, RF and MLP in the same data and same preprocessing method.

Performance metrics:

  • Accuracy
  • F1 score
  • ROC-AUC

About

Fine-tuned LLM for electroencephalography(EEG) data classification

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •