Skip to content

Ali-Daher1/fall-detection

Repository files navigation

Fall Detection from Human Pose

A computer-vision system that detects human falls in video by estimating body pose and classifying the resulting keypoints. Instead of feeding raw pixels to a heavy model, it extracts a small set of body-joint coordinates per frame and runs a lightweight classifier on them — a design that stays fast and is well suited to running close to the camera.

Approach

The pipeline has three stages:

  1. Pose estimation. Each video frame is passed through OpenPose (the CMU Caffe model, loaded with OpenCV's DNN module, running on the CUDA backend for speed). This returns the coordinates of ~15 body keypoints. A YOLOv9-based pose approach was also explored as an alternative.
  2. Feature extraction. The keypoints are flattened into an (x, y) feature vector per frame, with missing joints handled explicitly.
  3. Classification. A classifier decides fall vs. no-fall from the keypoint vector. Several models were compared (decision tree, neural network, ensembles, and a baseline); a tuned Random Forest performed best, at roughly 94% accuracy on the held-out test set.

At inference time the system reads a video, samples frames at a fixed interval, runs pose → classify on each, and overlays "Fall detected" / "No fall" on the frame. An image-based version is included as well.

Notebooks

Notebook Stage
adding_dataset.ipynb Builds the labeled keypoint dataset from source images/video
fall_detection_randomforest.ipynb Trains and tunes the Random Forest classifier
fall_detection_model_comparison.ipynb Compares several classifiers on the keypoints
fall_detection_inference.ipynb OpenPose + classifier real-time inference pipeline
fall_detection_yolo.ipynb YOLOv9-based pose experiment

Models and data

  • Pose model: the OpenPose COCO model (pose_iter_440000.caffemodel) is not included in this repo — it's the public CMU model. Download it from the CMU OpenPose project and point the notebooks at it.
  • Classifier: the trained Random Forest is regenerated by running fall_detection_randomforest.ipynb; the pickled models are kept out of the repo to keep it light.

Stack

Python, OpenCV (DNN module), OpenPose, YOLOv9, scikit-learn (Random Forest and the classifier comparison), pandas / NumPy.

Credit

Final-year project built by a team. Contributors:

About

Fall detection from video using human pose estimation (OpenPose) and a Random Forest classifier on body keypoints - a lightweight, edge-friendly approach.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages