CogniSecure
Inspiration
In an era of increasing security concerns, traditional surveillance systems often lack real-time intelligence and automated response capabilities. We were inspired by the need for affordable, motion-powered security solutions that can run on low-cost hardware, such as the Raspberry Pi, enabling smart detection and instant incident reporting to help prevent crimes and respond more quickly to security threats.
What it does
CogniSecure is an intelligent motion detection system that runs on Raspberry Pi Zero. It continuously monitors camera feed using background subtraction algorithms, detects suspicious activity, and automatically:
- Saves a high-quality JPG snapshot of the detection moment
- Uploads both media files to Firebase Storage with public access
- Reports structured incident data to the Firestore database following a standardised JSON schema
- Stops detection after the first incident to conserve resources
The system integrates with a web dashboard for real-time incident monitoring and management.
How we built it
- Hardware: Raspberry Pi Zero W with camera module
- Backend: Python script using OpenCV for computer vision and motion detection with MOG2 background subtraction
- Cloud Integration: Firebase Admin SDK for Python to handle Storage uploads and real-time Firebase database operations
- Detection Logic: Continuous frame buffering, sustained detection threshold (3/5 frames), automatic media capture and upload
- Data Format: Structured JSON payload with incident metadata, media, and technical details
Challenges we ran into
- Optimising OpenCV performance on Raspberry Pi Zero's limited processing power
- Making OpenCV work on the Raspberry Pi.
- Managing memory efficiently with continuous frame buffering for rewind functionality
- Setting up Firebase service account authentication securely on an edge device
- Ensuring reliable internet connectivity for cloud uploads in various environments
- Balancing detection sensitivity to avoid false positives while catching real threats -Due to so many challenges, we were forced to start from the beginning 3 times, so we needed to add mock data, as you can see.
Accomplishments that we're proud of
- Successfully implemented end-to-end incident detection and reporting pipeline
- Achieved 5-second video rewind capability with minimal memory footprint
- Created a standardised, extensible data format for incident reporting
- Built a production-ready system that runs autonomously on low-power hardware
- Integrated cloud service with proper error handling
What we learned
- Advanced computer vision techniques and real-time video processing
- Firebase ecosystem integration for IoT applications
- Optimising Python applications for resource-constrained devices
- Importance of structured data formats for system interoperability
- Balancing security, performance, and reliability in edge computing
What's next for CogniSecure
- Integrate advanced AI models (YOLO, TensorFlow Lite) for object recognition and classification
- Add real-time push notifications and SMS alerts for critical incidents
- Develop a companion mobile app for remote monitoring and camera management
- Implement multi-camera support with a centralised dashboard
- Add facial recognition and license plate detection capabilities
- Explore edge AI acceleration with Coral TPU or similar hardware
- Create an analytics dashboard with incident trends and predictive insights.
Built With
- javascript
- openrouter
- python
- raspberry-pi
- typescript
- vite
Log in or sign up for Devpost to join the conversation.