Skip to content

Health-HCI-Group/rSpO2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpO2 Prediction Model Training Script

Overview

This repository contains the source code and related files for training a deep learning model to predict SpO2 (blood oxygen saturation) levels using video datasets. The script utilizes PyTorch for model implementation and includes functionalities for data preprocessing, training, evaluation, and result saving.


Folder Structure

Code/
│
├── Table1/
│   ├── THU/
│   │   ├── intra_main_script.py
│   │   └── ...
│   ├── TUAT-V1/
│   │   ├── intra_main_script.py
│   │   └── ...
│   ├── TUAT-V2/
│   │   ├── intra_main_script.py
│   │   └── ...
│   └── ...
│
├── Table2/
│   ├── THU/
│   │   ├── cross_main_script.py
│   │   └── ...
│   ├── TUAT-V1/
│   │   ├── cross_main_script.py
│   │   └── ...
│   ├── TUAT-V2/
│   │   ├── cross_main_script.py
│   │   └── ...
│   └── ...
│
├── h5_dataset/
│   └── <dataset_files.h5>
│
├── utils.py
├── requirements.txt

Requirements

Hardware

•	CUDA-compatible GPU (recommended for training).

Software

•	Python 3.9+
•	Required Python packages (listed in requirements.txt):
•	torch
•	torchvision
•	numpy
•	pandas
•	matplotlib
•	h5py
•	tqdm

Setup Instructions

  1. Download the Repository:
cd Code
  1. Install Dependencies:
pip install -r requirements.txt
  1. Prepare the Dataset:

    • Download the dataset and extract files into the h5_dataset/ folder. • Ensure file paths are correctly set in the scripts.

  2. Run the Training Script: To perform intra-dataset training:

python Table1/THU/intra_main_script.py --batch-size 500 --epochs 15 --lr 0.001 --momentum 0.5 --seed 42 --log-interval 60

To perform cross-dataset training:

python Table2/THU/cross_main_script.py --batch-size 500 --epochs 15 --lr 0.001 --momentum 0.5 --seed 42 --log-interval 60

Key Outputs

•	Model Checkpoints:
•	Saved in <output_directory>/model/ at specified epochs (e.g., epoch=5_model.pt and epoch=15_model.pt).
•	Figures and Metrics:
•	Stored in <output_directory>/fig/.
•	Includes training loss curves, evaluation metrics, and predictions.
•	Results:
•	Predictions and metrics saved in .h5 files for post-analysis.

Notes

•	Modify dataset paths and parameters in intra_main_script.py and cross_main_script.py as needed for your specific setup.
•	Use CUDA_VISIBLE_DEVICES to configure GPU usage.
•	Ensure all required datasets are available in the correct directories before running the scripts.

Contact

For questions, contributions, or bug reports, please contact paper authors.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages