loss float64 0.7 0.96 | accuracy float64 0.38 0.69 | precision float64 0.33 0.57 | recall float64 0.16 1 | specificity float64 0.11 0.94 ⌀ | balanced_accuracy float64 0.52 0.64 ⌀ | f1 float64 0.25 0.67 | mcc float64 0.05 0.27 ⌀ | predicted_positive_rate float64 0.09 0.9 ⌀ | tp int64 2 304 | tn int64 0 645 | fp int64 2 607 | fn int64 0 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
0.949398 | 0.650888 | 0.469697 | 0.563636 | 0.692982 | 0.628309 | 0.512397 | 0.246452 | 0.390533 | 186 | 474 | 210 | 144 |
0.900964 | 0.679487 | 0.509881 | 0.390909 | 0.818713 | 0.604811 | 0.442539 | 0.226971 | 0.249507 | 129 | 560 | 124 | 201 |
0.956653 | 0.634122 | 0.453089 | 0.6 | 0.650585 | 0.625292 | 0.516297 | 0.237089 | 0.430966 | 198 | 445 | 239 | 132 |
0.923857 | 0.648915 | 0.466495 | 0.548485 | 0.697368 | 0.622927 | 0.504178 | 0.237005 | 0.382643 | 181 | 477 | 207 | 149 |
0.877255 | 0.66568 | 0.488127 | 0.560606 | 0.716374 | 0.63849 | 0.521862 | 0.268242 | 0.373767 | 185 | 490 | 194 | 145 |
0.876179 | 0.37574 | 0.333699 | 0.921212 | 0.112573 | 0.516893 | 0.489927 | 0.0524 | 0.898422 | 304 | 77 | 607 | 26 |
0.842814 | 0.687377 | 0.571429 | 0.157576 | 0.942982 | 0.550279 | 0.247031 | 0.164847 | 0.089744 | 52 | 645 | 39 | 278 |
0.734208 | 0.647929 | 0.451613 | 0.381818 | 0.776316 | 0.579067 | 0.413793 | 0.165907 | 0.275148 | 126 | 531 | 153 | 204 |
0.700204 | 0.5 | 0.5 | 1 | null | null | 0.666667 | null | null | 2 | 0 | 2 | 0 |
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Pose-Guided Temporal Modeling for Robust Vision-Based Fall Detection
This repository contains a reproducible vision-based fall detection pipeline for an ICTA-style technical paper. It focuses on pose/keypoint dynamics, lightweight temporal modeling, ablation, and robustness tests on a 24 GB RTX 3090.
What is included
- Dataset manifest builder for URFD, Multiple Cameras Fall Dataset, and generic video folders.
- Pose extraction with YOLO pose models from sampled video frames.
- Pose normalization, velocity features, keypoint confidence handling, frame-drop and keypoint-noise transforms.
- Models:
- RGB frame CNN baseline
- RGB CNN-LSTM baseline
- RGB ResNet18-LSTM pretrained baseline
- Pose-LSTM baseline
- Pose-GRU-Attention baseline
- Pose-TCN-Attention proposed model
- Training, evaluation, cross-dataset evaluation, ablation, robustness tests, and paper table export.
- Figure export for the paper, including result charts, robustness plots, confusion matrices, pipeline diagrams, and pose-overlay examples.
- A LaTeX paper skeleton in
paper/main.tex.
Environment for RTX 3090 24 GB
Use Python 3.10-3.12. Install PyTorch with a CUDA wheel first, then install the project dependencies.
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu129
pip install -r requirements.txt
pip install -e .
If the CUDA 12.9 wheel is unavailable for your Python version, use the latest CUDA wheel listed by PyTorch. The installed NVIDIA driver shown by nvidia-smi supports modern CUDA runtime wheels.
Directory layout
data/raw/ downloaded datasets, not tracked
data/manifests/ CSV files: video_path,label,dataset,subject,scenario,split
data/poses/ extracted pose .npy files
outputs/ training runs, checkpoints, metrics, plots
configs/ experiment configs
paper/ manuscript skeleton
Current completed run
This workspace now uses the Multiple Cameras Fall Dataset (MCFD) as the main evaluation protocol. URFD is still available locally, but its 70-sequence split is too small for meaningful model comparison because several models reached perfect scores on the 11-sequence test split.
MCFD ZIP archives: 24 valid files, 3.52 GB compressed
Extracted camera-view videos: 192 AVI files
Segment annotations: OmniFall MCFD labels
Class count: 440 fall-positive, 912 ADL/non-fall
Cross-view split: 169 train, 169 val, 1014 test segments
Pose extractor: YOLOv8n-Pose, 32 sampled frames
Pose shape: [32, 17, 3]
Zero-pose frames: 13908 / 43264 = 32.15%
Empty pose sequences: 46 / 1352
RGB cache: 1352 segments, 32 frames, 112x112
Main result CSV:
outputs/tables/mcfd_results.csv
Key test results on the 1,014-segment MCFD cross-view test split:
| Model | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| RGB-CNN | 0.376 | 0.334 | 0.921 | 0.490 |
| RGB-CNN-LSTM | 0.687 | 0.571 | 0.158 | 0.247 |
| RGB-ResNet18-LSTM | 0.648 | 0.452 | 0.382 | 0.414 |
| Pose-LSTM | 0.649 | 0.466 | 0.548 | 0.504 |
| Pose-GRU-Attention | 0.634 | 0.453 | 0.600 | 0.516 |
| Proposed TCN-Attention | 0.666 | 0.488 | 0.561 | 0.522 |
| TCN-Attention w/o velocity | 0.679 | 0.510 | 0.391 | 0.443 |
| TCN-Attention w/o confidence | 0.651 | 0.470 | 0.564 | 0.512 |
These are real MCFD results, not smoke tests. RGB checkpoints are selected with MCC rather than raw F1 to avoid all-positive/all-negative checkpoints. The RGB-CNN trained from scratch is still strongly biased toward fall predictions, while the ImageNet-pretrained RGB-ResNet18-LSTM baseline is more balanced but remains below the pose-guided temporal models. MCFD uses different camera views for train/validation/test and includes substantial pose-estimation failure, which makes it more suitable for comparing baselines than the small URFD split.
Paper figures are exported to:
outputs/figures/
paper/figures/
Useful generated figures:
main_results_metrics.png
main_results_f1.png
ablation_metrics.png
robustness_frame_drop_f1.png
robustness_keypoint_noise_f1.png
confusion_mcfd_pose_tcn_attention.png
pose_sequence_fall.png
pose_sequence_adl.png
pipeline.png
architecture.png
1. Build a video manifest
Place datasets under data/raw, for example:
data/raw/URFD/
data/raw/MCFD/
For the main MCFD protocol, download the official scenario archives and generate segment-level labels from OmniFall:
python scripts/download_mcfd.py --out-dir data/raw/MCFD/chute-zip --workers 8
python scripts/extract_mcfd.py --zip-dir data/raw/MCFD/chute-zip --out-dir data/raw/MCFD/extracted
python scripts/make_omnifall_mcfd_manifest.py \
--video-root data/raw/MCFD/extracted \
--labels data/raw/OmniFall/labels/mcfd.csv \
--splits-dir data/raw/OmniFall/splits/cv/mcfd \
--out data/manifests/mcfd_omnifall_segments.csv
For URFD, the official release provides RGB streams as ZIP image sequences. It is useful for a small auxiliary validation run:
python scripts/download_urfd.py --out-dir data/raw/URFD
Then build manifests:
python scripts/make_manifest.py \
--dataset urfd \
--root data/raw/URFD \
--out data/manifests/urfd_videos.csv
The scanner uses conservative label heuristics. Always inspect the generated CSV before training.
For official URFD ZIP archives, it selects cam0-rgb archives by default to keep the expected 30 fall and 40 ADL sequences.
2. Extract pose features
Default is YOLOv8 pose with 17 keypoints. The output format is one .npy file per video with shape [T, K, 3], where channels are x, y, confidence in pixel coordinates.
python scripts/extract_pose.py \
--manifest data/manifests/mcfd_omnifall_segments.csv \
--out-dir data/poses/mcfd_yolov8n_t32 \
--out-manifest data/manifests/mcfd_pose_t32.csv \
--frames 32 \
--backend yolo \
--model yolov8n-pose.pt \
--device cuda:0
For higher pose quality on the RTX 3090, use yolov8s-pose.pt or yolov8m-pose.pt.
RGB baselines use cached frame tensors so training does not repeatedly decode AVI files:
python scripts/extract_rgb.py \
--manifest data/manifests/mcfd_omnifall_segments.csv \
--out-dir data/rgb/mcfd_t32_s112 \
--out-manifest data/manifests/mcfd_rgb_t32.csv \
--frames 32 \
--image-size 112
3. Train the proposed model
python scripts/train.py --config configs/mcfd_pose_tcn_attention.yaml
The default config is tuned for pose features and should fit comfortably on a 24 GB RTX 3090. It uses AMP, batch_size: 128, num_workers: 8, and early stopping.
4. Evaluate
python scripts/evaluate.py \
--config configs/mcfd_pose_tcn_attention.yaml \
--checkpoint outputs/mcfd_pose_tcn_attention/best.pt \
--split test \
--tag test
5. Robustness tests
python scripts/robustness.py \
--config configs/mcfd_pose_tcn_attention.yaml \
--checkpoint outputs/mcfd_pose_tcn_attention/best.pt \
--split test \
--out outputs/mcfd_pose_tcn_attention/robustness.csv
This runs frame-drop and keypoint-noise sweeps and writes CSV results suitable for Table 5 and Figure 3.
Generate all paper figures after collecting results:
python scripts/make_figures.py
Smoke test
Run this before using a real dataset:
pytest -q
python scripts/smoke_train.py
6. Cross-dataset test
URFD can still be used as an auxiliary cross-dataset check after training on MCFD or vice versa:
python scripts/evaluate.py \
--config configs/mcfd_pose_tcn_attention.yaml \
--checkpoint outputs/mcfd_pose_tcn_attention/best.pt \
--manifest data/manifests/urfd_pose_t32.csv \
--split all \
--tag cross_mcfd_to_urfd
7. Suggested experiment order
# Proposed
python scripts/train.py --config configs/mcfd_pose_tcn_attention.yaml
# Pose baselines
python scripts/train.py --config configs/mcfd_pose_lstm.yaml
python scripts/train.py --config configs/mcfd_pose_gru_attention.yaml
# RGB baselines after video manifest is ready
python scripts/train.py --config configs/mcfd_rgb_cnn.yaml
python scripts/train.py --config configs/mcfd_rgb_cnn_lstm.yaml
python scripts/train.py --config configs/mcfd_rgb_resnet18_lstm.yaml
Notes for the paper
- Do not claim state of the art unless you reproduce enough prior work.
- Emphasize recall and F1 because false negatives are more costly in fall detection.
- Report mean and standard deviation over at least 3 seeds if time allows.
- Use cross-dataset and robustness results even if absolute scores drop; the key claim is graceful degradation relative to RGB baselines.
- Downloads last month
- 55