Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Lifeline: AI-Powered Fall Detection System

Team Details

Team Name: Photons

Team Members:

  • Abhinav Singh Yadav
  • Shubham Kumar
  • Anish Udupa

Domain of Project

HealthTech | AI | IoT | Elderly Care

Idea

Project Lifeline is a state-of-the-art intelligent IoT solution designed to provide safety and peace of mind for elderly individuals and patients living alone. By leveraging advanced computer vision and real-time monitoring, Project Lifeline instantly detects falls and triggers emergency alerts, ensuring that help is on the way when it matters most.

Unlike traditional wearables that can be forgotten or uncharged, Project Lifeline is a non-intrusive, camera-based system that works monitoring the environment. It combines a powerful AI engine with a modern, "Mission Control" style dashboard to keep caregivers informed in real-time.

Achievements thus far

  • Real-Time Fall Detection: Utilizes MediaPipe and OpenCV to track 33+ body landmarks and analyze posture (Aspect Ratio Logic) to detect falls with high accuracy.
  • Smart Audio Alarms: Immediately plays an audible siren upon detection to alert the user and anyone nearby.
  • Human-in-the-Loop Safety: Features a visual and audio countdown logic. If the user stands up or recovers within the 3-second safety window, the alarm cancels, and no emergency call is made—preventing false alarms.
  • Instant Alerts: If a fall persists beyond the safety buffer, the system automatically triggers an emergency call via Twilio.
  • Live Dashboard: A stunning, "Cyber-Medical" aesthetic frontend built with React, Vite, and Tailwind CSS that visualizes system status, real-time feedback, and countdown timers.
  • API-Driven: Robust FastAPI backend that orchestrates status updates, timer logic, and external communication.

Tech Stack Used

  • AI Engine: Python, OpenCV, MediaPipe (Computer Vision)
  • Backend: Python, FastAPI, Uvicorn, Twilio SDK (Logic & Alerts)
  • Frontend: React, Vite, Tailwind CSS, Lucide Icons, Framer Motion (UI/UX)

How to Execute Your Code

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • Webcam (Integrated or USB)

1. Installation

Backend & AI Engine

pip install -r requirements.txt

Frontend

cd frontend
npm install

2. Configuration

Open backend/main.py and update the Twilio credentials to enable calling:

TWILIO_SID = "your_sid"
TWILIO_AUTH_TOKEN = "your_token"
FROM_NUMBER = "+1234567890" // Your Twilio Number
TO_NUMBER = "+0987654321"   // Emergency Contact

3. Run the System (One-Click)

Double-click start_system.bat on Windows. This will spawn three terminal windows:

  1. Backend: Starts the API server on port 8000.
  2. AI Vision: Opens the camera feed for detection.
  3. Frontend: Launches the dashboard in your default browser.

4. Manual Run

If you prefer running components individually:

Backend

python backend/run.py

AI Engine

python ai-engine/detector.py

Frontend

cd frontend
npm run dev

Code Sample/Link to Hosted Website


📂 Project Structure

Project_lifeline/
├── ai-engine/         # Computer Vision Logic
│   └── detector.py    # Main detection script (Webcam stream analysis)
├── backend/           # API & Alert System
│   ├── main.py        # FastAPI App (State management, Twilio calls)
│   └── run.py         # Server Launcher
├── frontend/          # React Dashboard
│   └── src/           # Components & UI (SonarRadar, Status Cards)
└── start_system.bat   # One-Click Launch Script

🧠 Technical Details (How It Works)

  1. Visual Monitoring: The detector.py script continuously processes video frames. It calculates the bounding box of the person.
    • Aspect Ratio Analysis: If Width > Height * 1.15, the system infers a "Horizontal Posture" (Fall). If Height > Width, it infers a "Vertical Posture" (Safe).
  2. Status Sync: The AI engine pushes these status updates to the FastAPI backend (/update-status).
  3. Safety Buffer (Human-in-the-Loop):
    • When a fall is first detected, the backend starts a 10-second timer.
    • Frontend: The dashboard immediately turns RED, plays an alarm sound, and shows a countdown ("Calling in 10s...").
    • Cancellation: If the user stands up during this 10-second window, the status resets to "SAFE", the timer stops, and the alarm cuts off.
  4. Emergency Trigger: If the status remains "FALL DETECTED" for the full 10 continuous seconds, the backend executes the Twilio API call to notify the emergency contact.

🛡️ License

This project is developed for educational and hackathon purposes.

About

Project Lifeline: A real-time AI fall detection system built for elderly care. Analyzes human posture using computer vision (OpenCV/MediaPipe) to detect emergencies. Features a human-in-the-loop countdown buffer to prevent false alarms, a React dashboard for monitoring, and Twilio API integration for automated emergency SOS calls.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages