Skip to content

In this project, we propose a CNN model to classify single-channel EEG for driver drowsiness detection. We use the Class Activation Map (CAM) method for visualization. Results show that the model not only has a high accuracy but also learns biologically explainable features, e.g., Alpha spindles and Theta burst, as evidence for the drowsy state.

License

cuijiancorbin/A-Compact-and-Interpretable-Convolutional-Neural-Network-for-Single-Channel-EEG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Compact and Interpretable Convolutional Neural Network for Cross-Subject Driver Drowsiness Detection from Single-Channel EEG

Pytorch implementation of the paper "A Compact and Interpretable Convolutional Neural Network for Cross-Subject Driver Drowsiness Detection from Single-Channel EEG".

If you find the codes useful, pls cite the paper:

"Jian Cui, Zirui Lan, Yisi Liu, Ruilin Li, Fan Li, Olga Sourina, Wolfgang Müller-Wittig, A Compact and Interpretable Convolutional Neural Network for Cross-Subject Driver Drowsiness Detection from Single-Channel EEG, Methods, 2021, ISSN 1046-2023, https://doi.org/10.1016/j.ymeth.2021.04.017."

The project contains 3 code files. They are implemented with Python 3.6.6.

"CompactCNN.py" contains the model. required library: torch

"LeaveOneOut_acc.py" contains the leave-one-subject-out method to get the classifcation accuracies. It requires the computer to have cuda supported GPU installed. required library:torch,scipy,numpy,sklearn

"VisualizationTech.py" contains the visualization technique based on the CAM method (Class Activation Map). It requires the computer to have cuda supported GPU installed. required library:torch,scipy,numpy,matplotlib,mne

The processed dataset has been uploaded to: https://figshare.com/articles/dataset/EEG_driver_drowsiness_dataset/14273687

If you have any problems, please Contact Dr. Cui Jian at cuij0006@ntu.edu.sg

About

In this project, we propose a CNN model to classify single-channel EEG for driver drowsiness detection. We use the Class Activation Map (CAM) method for visualization. Results show that the model not only has a high accuracy but also learns biologically explainable features, e.g., Alpha spindles and Theta burst, as evidence for the drowsy state.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages