Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ wesad Public

Classifying WESAD mental stress data using autoencoder to extract features

srovins/wesad

Repository files navigation

Stress Detection from Multimodal Wearable Sensor Data using autoencoder latent features

Dataset: WESAD

https://archive.ics.uci.edu/ml/datasets/WESAD+%28Wearable+Stress+and+Affect+Detection%29

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:
    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.

  1. 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.

  2. 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.

About

Classifying WESAD mental stress data using autoencoder to extract features

Resources

Stars

Watchers

Forks

Packages

No packages published