/hrv-emotion

dimensional emotion classifier based bio-signal(ECG)

Primary LanguagePythonMIT LicenseMIT

HRV-emotion package

HRV-emotion package including machine learning and statistical analysis

Dataset

Lab datasets collected from experiments

🚀Quick setup

# clone project
git clone https://github.com/DimensionSTP/hrv-emotion.git
cd hrv-emotion

# [OPTIONAL] create conda environment
conda create -n myenv python=3.8
conda activate myenv

# install requirements
pip install -r requirements.txt

ECG or rPPG signal to HRV

  • rename ECG data files before preprocessing
python rename_thirty_dataset_files_in_directory.py
  • rename rPPG data files before preprocessing
python rename_sl_rppg_dataset_files_in_directory.py
  • signal to HRV
./scripts/signal_to_hrv.sh

Preprocess HRV

  • file path setting, normalization, averaging, make test dataset, statistical_analysis
./scripts/preprocess_hrv.sh
  • concat augmented dataset for machine learning train dataset
python concat_augmented_dataset.py

Machine Learning(HRV-emotion classifier)

  • model tuning
python main.py mode=tune condition={arousal or valence}
  • model training
python main.py mode=train condition={arousal or valence} is_tuned={bool}
  • model testing
python main.py mode=test condition={arousal or valence} data_type={test data}
  • all model tuning
./scripts/tune.sh
  • all model training
./scripts/train.sh
  • all model testing
./scripts/test.sh

If you want to change main config, use --config-name={config_name}.

Also, you can use --multirun option.

You can set additional arguments through the command line.