Silver Spectrum TechFest 2025 A National Level 48-Hour Hackathon - 28, 29, and 30 October 2025
# AI Intrusion Detection System
Adaptive home security system that learns your environment using neural networks.
Runs on Raspberry Pi with camera, microphone, and door/window sensors.
---
## Prerequisites
- Basic knowledge of Raspberry Pi and GPIO setup
- Python 3.11+ installed
- Virtual environment (`venv`) installed
- Internet connection for model training and updates
---
## Requirements
### Hardware
- Raspberry Pi 4 (or 3B+)
- Pi Camera or USB webcam
- USB microphone
- Door/window contact sensors
- Buzzer (optional)
### Software
- Raspberry Pi OS
- Python 3.11+
---
## Installation
```bash
# Clone and setup
cd ~/MASTER_NHCE
python3 -m venv MASTER_NHCE
source MASTER_NHCE/bin/activate
# Install dependencies
pip install -r requirements.txt
sudo apt-get install python3-pyaudio portaudio19-dev
# Find audio device
arecord -l
# Update AUDIO_DEVICE in dotenv fileGPIO 5 → Door sensor
GPIO 6 → Window sensor
GPIO 16 → Buzzer
Edit .env file:
AUDIO_DEVICE=plughw:3,0
GPIO_DOOR_PIN=5
GPIO_WINDOW_PIN=6
GPIO_BUZZER_PIN=16
LEARNING_RATE=0.01python3 main_system.py- Learning Mode (0–100 clips): Records 15-second clips, sends for feedback
- Confidence Mode (100–250 clips): Refines detection
- Production Mode (250+ clips): Auto-detects intrusions, activates buzzer
Send via WebSocket:
{"jsonType": "feedback_response", "requestId": "timestamp", "label": 0}Label definitions:
0= normal1= intrusion
Add known faces to the images/ folder:
mkdir images
# Add images/John.jpg, images/Jane.png, etc.- Camera error: Enable legacy camera in
raspi-config - Audio error: Check
arecord -land update.env - High probability stuck: Delete
models/andsystem_state.json, then restart
- Multi-sensor fusion (camera, audio, GPIO)
- Temporal pattern recognition (1-second windows)
- Face recognition for known persons
- Real-time alerts via WebSocket
- Buzzer activation on high threat
- 19-feature neural network