Skip to content

2025 - Heart Rate Variability Processing with Artificial Intelligence Techniques.

License

Notifications You must be signed in to change notification settings

alexsalman/Heart-Rate-Variability

Repository files navigation

Heart Rate Variability (HRV) Processing

Framework Schematic Overview of HRV Classification Pipeline.

Citation

If you use this work, please cite it as:

@article{goretti2025deep,
  title={Deep Learning for Risky Cardiovascular and Cerebrovascular Event Prediction in Hypertensive Patients},
  author={Goretti, F. and Salman, A. and Cartocci, A. and Luschi, A. and Pecchia, L. and Milli, M. and Iadanza, E.},
  journal={Applied Sciences},
  volume={15},
  number={3},
  pages={1178},
  year={2025},
  publisher={MDPI},
  doi={10.3390/app15031178}
}

Overview

In this study, we tackle the processing of patients’ heart rate variability (HRV) datasets for two classification tasks employing resource-efficient methods, synthetic data generation, deep learning techniques, and transfer learning.

Table of Contents

License

You are free to use, modify, and distribute this project for any purpose. However, if you use this project in your work or derive from it, you must provide appropriate attribution by referencing this repository.

Refer to our, MIT License.

Installation

Clone the repository
git clone https://github.com/alexsalman/heart_rate_variability.git
Change directory
cd heart_rate_variability
Create conda environment
conda create -n <env-name>
Activate conda environment
source activate <env-name>
Install software requirements
pip install -r requirements.txt

Usage

Data processing
Load datasets, undersample records, select features, shuffle, and split into train/test
python src/data/make_dataset.py data/raw/<Atrial Fibrillation Data> data/interim/
python src/data/make_dataset.py data/raw/<Cardiovascular Event Data> data/interim/
Synthetic data generation
Create metadata for training sets and data generator objects, models fitting, and sample synthetic records
python src/data/generate_synthetic.py data/interim/<Atrial Fibrillation Training Data> data/processed/
python src/data/generate_synthetic.py data/interim/<Cardiovascular Event Training Data> data/processed/
Deep learning model: Atrial Fibrillation task
Train fully connected neural network model on synthetic data
python src/models/train_model.py data/processed/<Atrial Fibrillation Synthetic Training Data> models/
Test model on real data of Atrial Fibrillation
python src/models/test_model.py data/interim/<Atrial Fibrillation Real Test Data> reports/figures/
Deep/ transfer learning model: Cardiovascular Event task
Train fully connected neural network model on synthetic + real data
python src/models/train_model.py data/processed/<Cardiovascular Event Synthetic/Real Training Data> models/
Test model on real data of Cardiovascular Event
python src/models/test_model.py data/interim/<Cardiovascular Event Real Test Data> reports/figures/

Project Organization


├── LICENSE
├── Makefile           <- Makefile with commands like `make data` or `make train`
├── README.md          <- The top-level README for developers using this project.
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
│
├── docs               <- A default Sphinx project; see sphinx-doc.org for details
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
│                         the creator's initials, and a short `-` delimited description, e.g.
│                         `1.0-jqp-initial-data-exploration`.
│
├── references         <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures        <- Generated graphics and figures to be used in reporting
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── setup.py           <- makes project pip installable (pip install -e .) so src can be imported
├── src                <- Source code for use in this project.
│   ├── __init__.py    <- Makes src a Python module
│   │
│   ├── data           <- Scripts to download or generate data
│   │   └── make_dataset.py
│   │
│   ├── features       <- Scripts to turn raw data into features for modeling
│   │   └── build_features.py
│   │
│   ├── models         <- Scripts to train models and then use trained models to make
│   │   │                 predictions
│   │   ├── predict_model.py
│   │   └── train_model.py
│   │
│   └── visualization  <- Scripts to create exploratory and results oriented visualizations
│       └── visualize.py
│
└── tox.ini            <- tox file with settings for running tox; see tox.readthedocs.io

Project based on the cookiecutter data science project template. #cookiecutterdatascience

About

2025 - Heart Rate Variability Processing with Artificial Intelligence Techniques.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published