This project implements drowning behavior recognition based on human pose estimation using OpenPose and deep learning classifiers.
This project is published at IEEE:
- Title: A Drowning Detection System Based on Human Pose Estimation and Deep Learning
- Conference: 2022 International Symposium on Computer, Consumer and Control (IS3C)
- DOI: 10.1109/IS3C53992.2022.9704884
This work proposes a real-time drowning detection system based on human skeletal motion analysis using AI techniques:
-
Pose Estimation:
- Uses OpenPose with a lightweight Thin-MobileNet backbone to detect 13 body keypoints.
- Camera is mounted underwater; pose estimation remains accurate despite splashes.
-
Feature Extraction:
- Extracts joint coordinates and calculates geometric angles between limbs.
- Converts the skeleton data into structured feature vectors.
-
Action Classification:
- A shallow Recurrent Neural Network (RNN) is trained to classify actions as either “drowning” or “normal”.
- The system is optimized for real-time operation with minimal GPU load.
- Training data collected through simulated drowning scenarios in a swimming pool.
- Final classification accuracy: 89.4%
- Evaluation metrics:
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| Drowning | 0.98 | 0.67 | 0.79 |
| Normal | 0.96 | 1.00 | 0.98 |
| Macro Avg | 0.97 | 0.83 | 0.89 |
In most realistic simulated drowning situations, the system could correctly identify the drowning behavior with high precision.
src/- Main source codemodel/- Pretrained classifier (.pickle)data_test/- Example video for testingoutput/- Output results and visualizations
Additional data, pretrained models and demo videos are hosted on Google Drive
conda create -n drown python=3.6.12
conda activate drown
pip install -r requirements.txtcd src/depends/tf-pose-estimation
pip install -r requirements.txt
bash models/graph/cmu/download.sh
cd tf_pose/pafprocess
swig -python -c++ pafprocess.i && python3 setup.py build_ext --inplace
cd ../../../
python setup.py installTo test on the sample video:
python src/s5_test.py \
--model_path model/trained_classifier.pickle \
--data_type video \
--data_path data_test/exercise.avi \
--output_folder outputIf you encounter errors related to OpenPose, run:
cd src/depends/tf-pose-estimation
python setup.py installIf you use this code or find it helpful, please consider citing our work:
@inproceedings{jian2022drown,
title={A Drowning Detection System Based on Human Pose Estimation and Deep Learning},
author={Jian, Jia-Xian and others},
booktitle={2022 International Symposium on Computer, Consumer and Control (IS3C)},
year={2022},
organization={IEEE}
}
This work is based on:
If you have any questions or suggestions, feel free to open an issue or reach me at:
Jia-Xian Jian – allensa119625@gmail.com

