Skip to content

threed2y/railway-tampering-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚄 RailRakshak: AI-Powered Autonomous Railway Surveillance

Python Streamlit YOLOv8 HuggingFace

"Eyes on the Track, Safety on the Rack." An intelligent, real-time Computer Vision system designed to prevent railway accidents caused by vandalism, unauthorized human access, and wildlife collisions.


🚨 The Problem

Railway safety is compromised by unauthorized track access, vandalism, and wildlife collisions. Traditional manual monitoring is slow and error-prone.

💡 The Solution: RailRakshak

RailRakshak is a smart surveillance node deployed on CCTVs or Drones. It acts as a "Third Eye" for the pilot/station master.

Key Capabilities:

  • 🟢 Dynamic Track Segmentation: Uses a custom trained YOLOv8-Seg model to identify the "Safe Zone."
  • 🐘 Multi-Class Threat Detection: Identifies Humans (Vandalism), Elephants, Bears, and Cattle.
  • 📐 Geometric Danger Logic: Calculates if objects are physically intersecting the track's danger zone (Buffer +30px).
  • 🔊 Instant Alerts: Triggers visual alarms and audio warnings (Siren/Voice) via Base64 injection.
  • 📹 Black Box Recording: Automatically saves video clips of incidents to /recordings.

🎥 Demo

RailRakshak Demo


🛠️ Installation & Setup

1. Clone the Repository

git clone [https://github.com/YOUR_USERNAME/RailRakshak.git](https://github.com/YOUR_USERNAME/RailRakshak.git)
cd RailRakshak

2. Install Dependencies

pip install -r requirements.txt

3. 📥 Download Assets (CRITICAL)

Due to file size limits, the AI Models and Data are hosted externally.

Asset Type Description Download Link
🧠 AI Model track_model.pt (Custom Binary) Download from Github Releases
📹 Samples Test Videos & Audio Files Download from Google Drive
📊 Dataset Training Data (Images/Labels) View on Hugging Face

4. Organize Files

Place the downloaded files as shown below. (Note: The system uses a recursive search, so as long as files are inside the project, it will work!)

railway-tampering-system/
│
├── track_model.pt            <-- 🚨 PASTE MODEL HERE
├── requirements.txt
├── README.md
│
└── vision_module/
    ├── app.py                # Main Application
    │
    ├── assets/
    │   ├── danger.mp3        # 🚨 PASTE AUDIO HERE
    │   └── warning.mp3
    │
    └── data/
        └── samples/
            ├── test.mp4      # 🚨 PASTE VIDEOS HERE
            └── Test2.mp4

5. Launch the Dashboard

streamlit run vision_module/app.py

🧠 How It Works (The Math)

  1. Segmentation: The system predicts a polygon mask for the railway track.
  2. Buffering: We apply a Buffer(+30px) to this polygon to create a "Danger Zone."
  3. Intersection over Union (IoU):
  • Humans (Class 0): Trigger ALERT at 1% overlap (High sensitivity for vandalism).
  • Elephants/Animals: Trigger ALERT at 10% overlap.
  1. Feedback Loop: If status is "DANGER", the system locks the frame, writes it to disk, and plays the audio alert.

🏆 Team

  • Developer: Ethan Hunt
  • Role: AI & Machine Learning
  • Team: RAT

Built with sheer fking will

About

an intelligent, real-time Computer Vision system designed to prevent railway accidents caused by vandalism, unauthorized human access, and wildlife collisions.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages