NightWatch: A Live-Time Safety Detection System

A real-time video and audio detection system designed to keep women safe.


Why We Built This Project

Walking alone at night is an experience that should be safe for everyone, yet for millions of women, it remains a constant source of anxiety and fear. According to statistics from the Rape, Abuse & Incest National Network (RAINN), 1 in 6 women in the United States has experienced an attempted or completed sexual assault in their lifetime. Despite advancements in safety awareness, preventative measures remain inadequate, often relying on manual intervention—calling emergency services, sharing live locations, or carrying personal safety alarms.

However, in critical moments of danger, reacting quickly isn't always an option. Fear, shock, or physical restraint can prevent someone from reaching their phone or calling for help. This gap in safety solutions inspired us to create NightWatch, a proactive hands-free security system that listens for distress signals and automatically triggers emergency protocols. Our goal was to develop a system that does not rely on the victim’s ability to call for help but instead detects danger in real-time and responds immediately—whether through an audio cue to deter an attacker, sending automated alerts, or capturing crucial video evidence.


How We Built It

NightWatch is built on a robust and efficient architecture that enables real-time detection and emergency response. Our system integrates audio recognition, video analysis, real-time streaming, and automated emergency alerts, all optimized to run efficiently on a mobile device while leveraging cloud computing for enhanced processing power.

Audio Detection & Real-Time Keyword Recognition We utilized OpenAI’s Whisper model, a state-of-the-art speech recognition system, to analyze incoming audio data in real-time. Whisper is highly effective in noisy environments, making it well-suited for detecting distress signals in unpredictable outdoor conditions.

To implement real-time audio monitoring, we used:

1) PyAudio to continuously capture audio from the user’s microphone.

2) Whisper AI to transcribe the speech and check for distress keywords like “Help!” or “NightWatch Help!”.

3) Multiprocessing & threading to allow continuous background listening without blocking other operations.

Once a distress keyword is detected, NightWatch immediately triggers emergency actions such as sending alerts, playing a deterrent siren, and capturing video evidence.

Video Processing & Threat Detection For real-time visual analysis, we integrated YOLOv8 (You Only Look Once), a cutting-edge object detection model that efficiently processes incoming video frames to detect potential threats. The React Native frontend continuously streams video to our AWS EC2-hosted Flask & FastAPI backend. The backend processes each frame in real-time using YOLOv8 to detect people and assess their proximity. By combining real-time object detection with proximity analysis, NightWatch can assess environmental threats autonomously without requiring manual user intervention.

Mobile-First Architecture & Real-Time Streaming Because our goal was to build a mobile-first safety system, we designed NightWatch to work efficiently on smartphones without relying on external hardware. React Native was used to build the frontend, enabling seamless integration with device sensors (camera & microphone). WebSockets were implemented to enable continuous two-way communication between the mobile app and the backend, allowing live streaming of both audio and video. The backend runs on AWS EC2, ensuring low-latency processing of video and audio data, even under high workloads. To balance performance and battery efficiency, we optimized the mobile client to only transmit data when needed, reducing unnecessary background processing.

Automated Emergency Response System If a distress keyword is spoken or a potential threat is detected, NightWatch automatically triggers multiple real-time emergency actions:

1) A loud police siren plays to deter potential attackers.

2) An SMS alert is sent to the user’s emergency contacts via SMTP.


Challenges We Faced & Lessons Learned

Building a real-time safety application came with several challenges. The first major issue was selecting the right mobile framework. Our team, all using iOS devices, initially chose Swift, but our lack of experience with Xcode led to difficulties in debugging and integrating the frontend with the backend, costing us a lot of time.

Another obstacle was connecting our backend to the front-end devices. Testing was complicated because we had to validate the handling of audio and image files. Ensuring the microphone and camera worked seamlessly required a lot of troubleshooting.

Additionally, we faced unexpected costs, particularly with Twilio for SMS alerts. The service required payment for new phone numbers, so we spent a considerable amount of time finding a more affordable solution.

Perhaps the biggest challenge, though, was ensuring the app’s accessibility across devices. We almost couldn’t make it work on phones, which would have limited its value to just a proof of concept. In the end, though, through teamwork and persistence, we overcame these setbacks and delivered a functional, real-time safety app.


The Impact & Future Potential

With NightWatch, we aim to provide women with a sense of security that does not depend on active intervention. Unlike traditional safety apps that require manual input, our system works autonomously, offering an extra layer of protection in situations where every second matters.

Looking ahead, we envision expanding NightWatch’s capabilities to include automatic 911 calling, integration with smart wearables, and enhanced AI-driven threat detection. Additionally, we plan to refine our audio processing to recognize a wider range of distress signals and improve accuracy in noisy environments.

This project is more than just a technical challenge—it is a mission to empower women with tools that can help prevent harm before it happens. While we still have more work to do, we are incredibly proud of what we’ve built and excited for its future.

Share this project:

Updates