Real-time AI security system that detects robbery and forced surrender in stores using 3-layer detection: LSTM pose analysis, YOLOv8 appearance classification, and weapon detection. Instantly alerts store owners and police via SMS when a criminal forces someone to surrender money. Built for Cameroon and African markets.
# SafeStore AI π
**Real-Time Robbery & Forced Surrender Detection System**
Detects criminals forcing store owners to surrender money using 3-layer AI detection.
Sends instant SMS alert to owner and police when robbery is detected.
---
## The Goal
Detect this specific scenario:
```
Criminal enters store β Points weapon β Forces owner to raise hands
β
AI detects surrender pose + weapon + masked face
β
INSTANT SMS to owner + police while robbery is happening
```
---
## Project Structure
```
SafeStoreAI/
β
βββ main.py β RUN THIS to start detection
βββ train.py β Train LSTM action model
βββ train_weapons.py β Train weapon detector
βββ train_appearance.py β Train appearance classifier
βββ requirements.txt
βββ .env.example β Copy to .env, add your details
β
βββ ai_engine/
β βββ pose_extractor.py β MediaPipe body keypoints
β βββ threat_engine.py β Combines 3 layers into threat score
β βββ hud.py β Live display overlay
β
βββ models/
β βββ violence_lstm.py β LSTM neural network
β βββ weapon_detector.py β YOLOv8 weapon detection
β βββ appearance_detector.py β YOLOv8 appearance classification
β βββ saved/ β Trained model weights go here
β
βββ alerts/
β βββ alert_system.py β SMS via Africa's Talking
β
βββ database/
β βββ models.py β Alert history database
β
βββ utils/
β βββ collect_data.py β Record training data from webcam
β βββ process_videos.py β Convert videos to .npy sequences
β
βββ tests/
β βββ test_webcam.py β Test 1: camera works
β βββ test_pose.py β Test 2: skeleton detection
β βββ test_pipeline.py β Test 3: full system simulation
β βββ test_model.py β Test 4: trained model accuracy
β
βββ data/
β
βββ sequences/ β AUTO-GENERATED .npy training files
β βββ normal_activity/
β βββ surrender_pose/
β βββ threatening_aggressor/
β βββ robbery β¦