Inspiration

In an era where school safety has become a critical concern, our team recognized the urgent need for innovative solutions that can prevent threats before they escalate. We were inspired by the potential of AI and computer vision to serve as proactive guardians in educational settings. After learning about the limitations of traditional security camera systems—which rely entirely on human monitoring and often fail to detect threats in real-time—we envisioned SafeAI as a critical layer of protection for schools, empowering security personnel with AI-powered threat detection to dramatically reduce response times when every second counts.

What it does

SafeAI transforms ordinary security cameras into intelligent threat detection systems that can identify weapons and alert authorities instantly. The system:

  • Analyzes live camera feeds in real-time using advanced AI vision models
  • Immediately detects potential weapons with high accuracy
  • Categorizes threats by severity (LOW, MEDIUM, HIGH)
  • Alerts security personnel through a comprehensive dashboard
  • Provides AI-generated security recommendations for appropriate response
  • Supports multiple camera locations across different school campuses
  • Offers one-click emergency actions including lockdown initiation and emergency alerts

Additional Features

  • Gemini AI Analysis: Uses Google's Gemini 2.0 Flash model to analyze threat situations and provide contextual recommendations on response strategies, evacuation needs, and security personnel requirements
  • Interactive Map View: School floor plans with color-coded camera locations showing real-time threat status
  • Multi-campus Support: Ability to monitor different school locations from a single dashboard
  • Emergency Response Tools: Integrated tools for calling emergency services, initiating lockdowns, and sending SMS alerts
  • Security Dispatch System: Intelligent assignment of security personnel with estimated response times
  • Device Assignment: Flexible assignment of available cameras to specific monitoring locations

How we built it

SafeAI is built using a modern tech stack that combines powerful frontend visualization with robust backend AI processing:

  • Frontend: Next.js, Tailwind CSS, Framer Motion, Leaflet, OpenStreetMaps
  • Backend: Flask, CLIP, Pillow, Hugging Face, PyTorch, Moondream 2, Hardware acceleration for CUDA GPUs and Apple Silicon, HF-Transfer, OpenCV, Pyvips
  • API Integration: Google's Gemini 2.0 Flash, WebRTC

Challenges we ran into

So so many challenges. Some of them include:

  1. Processing Speed: Achieving real-time analysis of video feeds required significant optimization to maintain low latency while processing multiple camera streams simultaneously.
  2. False Positives: Balancing sensitivity was critical—we needed to detect actual threats while minimizing false alarms that could lead to alert fatigue.
  3. Cross-platform Hardware Acceleration: Developing a solution that could leverage different hardware (CUDA GPUs, Apple Silicon, standard CPUs) required creating adaptive code paths.
  4. Camera Integration: Securely accessing and processing camera feeds from various sources presented unique challenges in different browser environments.
  5. Real-time UI Updates: Ensuring that threat notifications propagated instantly throughout the application required careful state management.

Accomplishments that we're proud of

  • Developing a computer vision AI system that can detect weapons in under 1 second
  • Creating an intuitive UI that security personnel can use with minimal training
  • Collaborating as a team under stress and managing to write about 10k lines of code
  • Building a solution that works across different hardware configurations
  • Designing an architecture that can scale to support multiple school campuses

What we learned

  • The intricacies of real-time computer vision processing at scale
  • Techniques for optimizing AI models for edge devices
  • The importance of thoughtful UX design for emergency systems
  • Methods for balancing AI processing requirements with available hardware resources
  • How to collaborate on a full stack app as a team effectively and efficiently

What's next for SafeAI

  • Developing a mobile mirror to increase accessibility
  • Upgrading the GPUs for faster compute for inferencing
  • Restructuring our custom algorithms to be more computationally efficient

Built With

+ 7 more
Share this project:

Updates