Real-Time-Person-Elderly-Fall-Detection-System README

The project's README from github.com/AwaisShah75/Real-Time-Person-Elderly-Fall-Detection-System. As one markdown file: README.md.

🛡️ Real-Time Person & Elderly Fall Detection System

Advanced Occlusion Resilience, Kinematic State Machine & Edge AI Architecture

An enterprise-grade, edge-compatible AI computer vision system designed to detect accidental falls in real-time under severe visual occlusions (behind furniture, tables, beds, couches) while completely eliminating false positives from daily activities such as sitting down, tying shoelaces, or sleeping in bed.


🌟 Key Highlights


🚀 Quickstart Guide (1 Command to Run)

You only need ONE command:

python run.py

*(Or on Windows, simply double-click run.bat)*

🎮 Interactive Menu Options:

======================================================================
  🛡️  AI PERSON & ELDERLY FALL DETECTION SYSTEM
  Advanced Occlusion Resilience & Kinematic Tracking
======================================================================
  Select an input option:
   [1] 📹 Live Webcam (Real-time monitoring)
   [2] 📁 Custom Video File (Auto-detects videos + Drag & Drop)
   [3] 🧪 Synthetic Occlusion Fall Demo (Built-in test)
   [4] ❌ Exit
======================================================================

📦 Included Benchmark Video Suite (sample_videos/)

The repository includes real-world benchmark fall test videos:

# Video File Scenario & Purpose Expected Result
1 sample_videos/standing_fall_1.mp4 🏃 Sudden collapse fall from standing Instant [ALERT] FALL DETECTED
2 sample_videos/standing_fall_2.mp4 🍌 Slip & backward fall from standing Instant [ALERT] FALL DETECTED
3 sample_videos/sitting_to_fall.mp4 🪑 Senior citizen falling off chair Instant [ALERT] FALL DETECTED
4 sample_videos/bed_rollout_fall.mp4 🛏️ Roll-out fall from bed onto floor Instant [ALERT] FALL DETECTED
5 sample_videos/normal_activity_no_fall.mp4 🚶 Walking, sitting & sleeping (ADL) MONITORING (RESTING) (Zero False Alarms)

🧠 Technical Architecture & Biomechanical Pipeline

  ┌─────────────────┐     ┌──────────────────────┐     ┌────────────────────────┐
  │ Video / Webcam  │ ──> │ YOLOv8-Pose Backbone │ ──> │  Occlusion Resilience  │
  │     Stream      │     │  Keypoint Extractor  │     │   & Bone Imputation    │
  └─────────────────┘     └──────────────────────┘     └────────────────────────┘
                                                                    │
  ┌─────────────────┐     ┌──────────────────────┐                  ▼
  │ HUD Visualizer  │ <── │ Multi-Stage Fall FSM │ <── ┌────────────────────────┐
  │  & Alert Engine │     │  State Transitions   │     │  Kinematic Extractor   │
  └─────────────────┘     └──────────────────────┘     │ (v_y, Angle, ω, Energy)│
                                                       └────────────────────────┘

1. Biomechanical Features

2. State Machine Logic Flow

 [ MONITORING ] ──( v_y > 0.7 h/s OR ω > 35°/s )──> [ FALL_DETECTED ]
       ▲                                                     │
       │                                            ( > 1.5s Stillness )
  ( Stands Up )                                              │
       │                                                     ▼
 [ MONITORING ] <──────( Upright Motion )─────── [ CONFIRMED_FALL ]

📁 Repository File Structure

d:\A New Fall Detecion Sytem\
├── run.bat                          # One-click Windows desktop launcher
├── run.py                           # Interactive CLI runner with continuous loop
├── fall_detection_all_in_one.py     # Standalone all-in-one pipeline (Zero sub-dependencies)
├── core/
│   ├── detector.py                  # YOLOv8-Pose wrapper & keypoint extractor
│   ├── tracker.py                   # Multi-person temporal tracklet manager
│   ├── occlusion.py                 # Occlusion engine, Kalman extrapolation & bone imputation
│   ├── kinematics.py                # Biomechanical kinematic feature engine
│   ├── state_machine.py             # Multi-stage Fall State Machine
│   └── visualizer.py                # Telemetry HUD visualizer & alert banners
├── sample_videos/                   # Benchmark fall test dataset
│   ├── standing_fall_1.mp4          # Sudden collapse fall
│   ├── standing_fall_2.mp4          # Slip and fall
│   ├── sitting_to_fall.mp4          # Chair fall
│   ├── bed_rollout_fall.mp4         # Bed roll-out fall
│   └── normal_activity_no_fall.mp4  # Normal ADL baseline (zero false alarm test)
├── test_generator.py                # Synthetic occlusion test scenario generator
├── requirements.txt                 # Clean dependency manifest
├── FALL_DETECTION_SYSTEM_DESIGN.md  # Comprehensive research & mathematical design spec
└── README.md                        # Documentation & quickstart guide

🛠️ Advanced CLI Usage (Direct Bypass)

If you prefer direct command-line execution without the interactive menu:

# Run on webcam (device 0)
python fall_detection_all_in_one.py --source 0 --show

# Run on a specific video file
python fall_detection_all_in_one.py --source sample_videos/standing_fall_1.mp4 --show --save output_result.mp4

# Run synthetic occlusion demo
python fall_detection_all_in_one.py --source demo --show

📜 Scientific Reference & Design Document

For full mathematical formulations, biomechanical formulas, Kalman filter state equations, and multi-view homography matrices, refer to: 👉 FALL_DETECTION_SYSTEM_DESIGN.md

Real-Time-Person-Elderly-Fall-Detection-System (AwaisShah75/Real-Time-Person-Elderly-Fall-Detection-System)

Searching Database…

这是什么?这是一个边缘 AI 计算机视觉系统,可实时检测跌倒,尤其针对老年人,即使人被家具部分遮挡也能检测,同时避免把坐下或睡觉等正常活动误报为跌倒。
这是需要我自己配置的已训练模型,还是开箱即用的应用?它是一个开箱即用的 Python 应用,围绕一个本身就很轻量的姿态估计引擎构建;无需自定义模型训练。
怎么让它运行起来?用一条命令启动,或在 Windows 上直接双击 run.bat,它会打开一个交互式菜单,让你接入摄像头实时画面、导入自定义视频或运行模拟跌倒演示。
它能区分真正的跌倒和单纯的躺下或睡觉吗?能,它有专门的休息/睡眠排除逻辑,基于躯干角度和下落速度等生物力学信号,把在床上的水平休息状态保持在平静的“MONITORING (RESTING)”状态而不触发警报。
它只能在 Windows 上运行吗?不是,它是一个跨平台运行的 Python 脚本;Windows 用户只是额外多了一个方便的 run.bat 快捷方式。
当人被家具遮挡时,它如何继续跟踪跌倒?它使用四级遮挡韧性流水线:运动学骨骼约束插补、时间速度外推、家具 ROI 跟踪和骨长钳制,即使膝盖或脚踝被挡住也能重建并跟踪人体。
究竟什么情况会触发跌倒警报?当系统测到每秒超过 0.7 个身高的快速垂直下坠,或躯干角度每秒变化超过 35 度的突然姿态坍塌时,警报会立即触发。
项目自带哪些测试视频?samplevideos/ 文件夹自带基准片段,涵盖站立跌倒、椅子跌倒、床上翻滚跌倒和一段正常活动片段,用于验证警报正确且零误报。
在哪里能看到它背后的完整数学原理?仓库中的 FALLDETECTIONSYSTEMDESIGN.md 文件记录了检测流水线中使用的生物力学公式、卡尔曼滤波状态方程和单应性矩阵。
Size
6 MB
Stars
275
Updated
CommitAug 18
Age
2mo
Commits · 90 Days