This is the source code of our heart rate predictor.
The program was coded in Python 3.9 and you can find the require package in 'requirements.txt'.
- Preprocess training data
- Build model (classifier&predictor)
- Predict heart rate
- Edit ‘config.ini’: Modify the [Data_Merge] section according to the time schedule and the heart rate level bound
- Run 'main.py’
- Type 1 in the console
- Select the ECG and PPG file in the pop up window
- The merged file will be saved in ‘separate_data’ and the separated files will be saved in 'dataset/trainingdata/data4regression’
Remark: Make sure the time formats of ECG and PPG files and ‘config.ini’ are correct.
- Edit ‘config.ini’: Modify the parameters in [Model_Trainer] section.
- Run 'main.py’
- Type 2 in the console
- Select model type in the console
- Select training dataset in the pop up window
- The well trained model will be saved in ‘model/classifier’ or ‘model/predictor’
Remark: For keras predictor, the training results of all the parameters will be saved in ‘dataset/training_result/model_training_result.xls’.
- Edit ‘config.ini’: Modify the parameters in [HR_Predictor] section.
- Run 'main.py’
- Type 3 in the console
- Select dataset to be predicted
- Select models
- The prediction output will be saved in ‘HR_prediction.xlsx’