0dina/fall-detection-skeleton
Skeleton-Based Fall Detection Model Audit and Verification
2 min readupdated
The repository features two ready-to-use models for skeleton-based fall detection (Baseline temporal CNN and Enhanced ST-GCN), bundled with an in-depth analysis of their architecture, weights, and diagnostics. While the weights were not retrained from scratch, they have been thoroughly examined and converted to PyTorch safetensors and ONNX formats. Instead of raw video pixels, the models take joint coordinates—extracted via MediaPipe, for instance—and output logits for no_fall and fall classes. This release is ideal for developers and researchers looking to run motion analysis safely and reproducibly without writing boilerplate code.
Key features
- Two architecture options: Baseline (a temporal CNN with 75.6K parameters) and Enhanced (a graph-based ST-GCN with 786K parameters).
- Ready-to-use weights and ONNX: The models are fully verified, including an ONNX export (opset 17) with dynamic batch sizing.
- Clear preprocessing contract: Features precise documentation on coordinate normalization relative to the pelvis and neck for 18 keypoints.
- Diagnostics and verification scripts: Includes numerical accuracy tests, tensor statistics, and validation scripts to ensure parity with original definitions.
What you can do
- Run PyTorch inference: Use the provided model loading function and skeleton preprocessing script to analyze movement sequences.
- Integrate the ONNX version: Drop the optimized model.onnx files from the baseline or enhanced folders directly into third-party pipelines.
- Audit and test: Run the verify.py script to check artifact hashes and output accuracy between PyTorch and ONNX.
Example
import torch
from modeling_fall import load_model
from preprocessing import read_skeleton_csv, model_input
sequence, observed = read_skeleton_csv("examples/synthetic_rotation.csv")
model = load_model("baseline") # или "enhanced"
with torch.inference_mode():
logits = model(torch.from_numpy(model_input(sequence[:30])))
print(logits.softmax(dim=1)) # [скор no_fall, скор fall]
Read more
DetailsParameters: Baseline — 75,586 parameters, Enhanced — 785,922 parameters.
Input format: float32 tensor of shape [B, 3, 30, 18] (batch, x/y/z coordinates, time, joints).
Limitations: This repository is not a certified medical alert system; historical notebook accuracies (97.37% and 74.07%) are provided for reference only without fresh validation on new datasets.
Test environment: Python 3.12, PyTorch 2.15+cpu, ONNX Runtime 1.32.










Comments