/wesad

Classifying WESAD mental stress data using autoencoder to extract features

Primary LanguageJupyter Notebook

Stress Detection from Multimodal Wearable Sensor Data using autoencoder latent features

Dataset: WESAD

https://uni-siegen.sciebo.de/s/HGdUkoNlW1Ub0Gx

Classifying WESAD mental stress data using autoencoder to extract features

Run scripts in the following order (can take a while) to prepare data and extract features from the latent layer of autoencoder model:

1. Preprocess and merge subject data


Command:
python merge_subj_data.py

Input data path: 'data/WESAD/'
Generates the following files in data folder:
in subj_merged_acc_w.pkl
subj_merged_bvp_w.pkl
subj_merged_eda_temp_w.pkl
merged_chest_fltr.pkl

2. Create autoencoder model and extract latent features


Command:
python extract_ae_latent_features.py

Input files:
subj_merged_acc_w.pkl
subj_merged_bvp_w.pkl
subj_merged_eda_temp_w.pkl
merged_chest_fltr.pkl

  • Uses ae_feature_extractor.py to build and train autoencoder model and extract features.
  • Save extracted features leaving one subject out into pickle files in features/train and features/test directories. The number in the filename indicates which subject was left out in each fold.

3. SVM_classifier.ipynb

  • Build SVM classifier that uses latent features extracted by autoencoder for three class classification of WESAD dataset: neutral, stress, and ammusement. Results analysis also included.

4. MLP_classifier.ipynb

  • Build MLP (Multi Layer Perceptron) classifier that uses latent features extracted by autoencoder for three class classification of WESAD dataset: neutral, stress, and ammusement. Results analysis also included.