Code for analyzing EEG collected during the EEG study. Protocol discussion: Choose or Fuse: Enriching Data Views with Multi-label Emotion Dynamics. Cang et al. (ACII 2022)
The dataset consists of comma separated value (.csv) files organized by participant. For each participant there are four csv files: brain activity, keypress, calibrated words and joystick data. The structure looks something like the following:
├── feel
│ ├── p10
│ │ ├── calibrated_words.csv
│ │ ├── eeg.csv
│ │ ├── fsr.csv
│ │ └── joystick.csv
│ ├── p12
│ │ ├── calibrated_words.csv
│ │ ├── eeg.csv
│ │ ├── fsr.csv
│ │ └── joystick.csv
- unzip FEEL_DATA.zip and the subsequent zip files within: File structure should look like feel/p* where * is an integers(should contain .csv files). Consider using the following command:
for p in *; do unzip $p; done
to unzip all the files at once. Also ensure that you remove zip files within the feel folder after unzipping. - run setup.py from the src directory to prepare the dataset for the model (ensure you have the correct path for the feel folder)
- run the train_hc.py from the src directory to run hyperparameter search
- run
hyperparameter_results.py
to create a csv of the hyperparameters in the validation folder - run
val_hc.py
to validate the model on unseen data - run
validation_results.py
to generate the validation results in the validation folder
read_data.py
: utils to load CSV files and optionally save to a pickle fileclean_data.py
: utils to clean up raw files, i.e., fix sampling to 1kHz, apply notch filter to eeg, apply bandpass to eeg, etc.calculate_features.py
: utils to calculate features from EEG data (2D Differential Entropy)calculate_labels.py
: utils to calculate labelscalculate_validation.py
: util to calculate train/validation split (train is later further split into train\test)config.py
: constant declarationstrain_hc.py
: main training scriptutils.py
: general purpose methods (pickle and load pickled files)