🧡 About the Project — Trinetra: AI Crowd Safety System

🌟 Inspiration

Every year, major Indian temples see massive crowd surges—especially during festivals and peak seasons. These unmanaged crowds often lead to:

  • Long, confusing queues
  • Unpredictable wait times
  • Stampede-like situations
  • Slow response during emergencies

We were inspired to build Trinetra after reading multiple reports of overcrowding incidents and realizing how little real-time intelligence exists in Indian pilgrimage management. Our idea: Use AI + ML + Computer Vision to prevent crowd disasters before they happen.

We wanted to build something meaningful, deployable, and socially impactful—not just another hackathon prototype.


🔍 Problem We Are Solving

Temples face three major challenges:

  1. Unpredictable daily footfall — Devotees don’t know the right time to visit safely.
  2. Lack of real-time queue visibility — People stand for hours without any clarity.
  3. Poor emergency response — No centralized SOS system for rapid action.

These challenges collectively increase crowd stress and risk.


💡 What We Built

Trinetra is a full-stack crowd safety intelligence system featuring:

🧠 1. Next-day crowd prediction (ML + XGBoost)

  • Uses 80+ engineered features
  • Predicts temple footfall for the next day
  • Helps authorities plan resources ahead of time
  • Gives devotees safer, lower-crowd visiting slots

🎥 2. Real-time crowd detection (Computer Vision + ResNet)

  • Counts people from video feeds
  • Alerts when density crosses thresholds
  • Achieved 85%+ detection accuracy

📱 3. Mobile App (React Native)

  • Quick actions: Queue Status, Bookings, Emergency SOS
  • Clean, intuitive interface for all age groups
  • Multi-lingual support

🗣️ 4. Nandi AI – Temple Voice Assistant (Gemini Flash)

Devotees ask:

“When should I plan my darshan?”

Nandi AI analyzes:

  • Footfall predictions
  • Live queue data And responds in Hindi/English in a short, polite tone.

🚨 5. SOS Emergency System

  • 5-second countdown
  • Sends alert to server
  • Vibrates device
  • Notifies helpdesk

🛠️ How We Built It

Tech Stack:

  • ML: Python, XGBoost, Pandas, Scikit-learn
  • Computer Vision: ResNet pretrained model
  • Backend: Node.js, Express
  • Mobile App: React Native + Expo
  • AI Assistant: Google Gemini Flash
  • Database: MongoDB
  • Hosting: Appwrite Cloud (Auth + Storage + Realtime) (planned)

Pipeline Overview:

  • Trained ML models on historical pilgrimage, weather, and seasonal data
  • Converted CV model outputs into real-time crowd metrics
  • Created REST APIs for prediction, queue, SOS, and AI assistant
  • Integrated Gemini to make Nandi AI conversational
  • Built a clean admin dashboard + user mobile app

📚 What We Learned

  • How to convert a chaotic real-world crowd problem into a structured ML pipeline
  • How to design multi-modal AI flows (voice → language → prediction → response)
  • Efficient API design for mobile apps
  • Managing state + navigation in React Native
  • Importance of KISS (Keep It Simple) for emergency systems
  • Optimization of ML models for latency-critical applications

🚧 Challenges We Faced

  • Getting reliable prediction accuracy with noisy real-world data
  • Integrating CV outputs into real-time dashboard
  • Handling mobile permissions for microphone + SOS
  • Gemini API errors during multi-lingual responses
  • Ensuring UI simplicity for older age groups
  • Debugging Expo networking (local IP changes, routing issues)

🚀 What’s Next

  • Integrating full Appwrite Cloud stack (Auth, DB, Storage, Realtime)
  • Adding geofencing alerts for crowd density
  • Deploying on actual temple CCTV feeds
  • Adding triage-level emergency categories in SOS
  • Voice-controlled darshan booking
  • Multilingual support for all major Indian languages

Built With

Share this project:

Updates