Skip to content

yassinekolsi/TechResolveChallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EyeQ — AI-Powered Campus Safety Platform

"Cameras were installed, but they were passive. They recorded events, yet they did not prevent them. That failure is exactly why we built this platform."

EyeQ transforms passive surveillance infrastructure into an active, real-time decision system — detecting, prioritizing, and routing incidents so security teams can act within seconds, not hours.


The Problem

Campus security cameras generate enormous amounts of footage, yet most incidents are only discovered after the fact. Human operators cannot monitor every feed simultaneously. Alerts get buried. Response is reactive, never preventive.

EyeQ was built to close that gap.


What EyeQ Does

EyeQ ingests live camera feeds, runs multi-model AI detection in real time, and surfaces structured, actionable incidents through a unified command dashboard. Every detected anomaly becomes a case with timestamp, location, confidence score, and photographic evidence — ready for operator review and response.

Four core detection classes:

Anomaly Description
Fight / Violence Physical altercations, aggressive behavior
Person Fall Sudden falls, medical emergencies
Fire / Smoke Early fire and smoke detection
Illegal Waste Dumping Unauthorized littering and dumping events

SDG Alignment

EyeQ was designed with the United Nations Sustainable Development Goals at its core.

SDG 11 — Sustainable Cities and Communities

Safe, inclusive, and resilient communities require proactive security infrastructure. EyeQ provides campuses with the tools to respond instantly to threats, reducing harm and improving the safety of shared spaces for all residents and visitors.

SDG 13 — Climate Action

Fire and smoke detection enables rapid early response to environmental hazards, limiting property damage, reducing carbon emissions from uncontrolled fires, and protecting ecosystems adjacent to campus facilities.

SDG 15 — Life on Land

Automated detection of illegal waste dumping directly addresses land degradation and pollution. By flagging dump events in real time, EyeQ enables faster clean-up response and deters repeat environmental violations.

SDG 16 — Peace, Justice and Strong Institutions

Violence and fall detection strengthens campus governance by supporting evidence-based security operations. The platform's analytics layer provides administrators with measurable accountability data — accuracy rates, true-positive rates, and incident trends — replacing assumptions with verified performance metrics.


Platform Features

Dashboard

Full operational picture in one command view: live cameras, active incidents, risk signals, and recent activity. Real-time stat cards display total incidents, confirmed threats, and AI model performance at a glance.

Live Cameras

Camera feeds monitored in real time with zone and status filtering. When an anomaly is detected, the relevant camera tile is immediately highlighted — operators jump directly to the event without scrubbing through hours of footage.

Incidents

Each alert becomes an actionable case:

  • Timestamp, camera location, and severity level
  • Confidence score from the detection model
  • Evidence image captured at detection time
  • Actions: Confirm, Dismiss, or Escalate

The confirm/dismiss workflow does more than drive response — it separates true threats from false alarms, continuously improving model quality through real-world feedback.

Risk Map

Campus zones are dynamically classified by recent incident intensity. Security patrols and interventions are directed to highest-risk areas, maximizing the impact of limited human resources.

Analytics

Accountability by the numbers:

  • Detection accuracy and true-positive rate
  • False-positive rate over time
  • Incident volume trends by category and hour

Environmental Monitoring

Dedicated view for fire/smoke and illegal dumping events — providing environmental officers with a focused feed separate from general security incidents.


Architecture

┌─────────────────────────────────────────────────────────────┐
│                        EyeQ System                          │
│                                                             │
│  Camera Hardware                                            │
│       │                                                     │
│       ▼                                                     │
│  camera_stream.py  ──►  Flask MJPEG Server (port 5000)     │
│                                                             │
│  main.py (Detection Engine)                                 │
│  ┌──────────────────────────────────────────────────┐       │
│  │  YOLOv8 + Specialized Models                     │       │
│  │  - Fight/Violence  (Hugging Face fine-tune)      │       │
│  │  - Fall Detection                                │       │
│  │  - Fire/Smoke Detection                          │       │
│  │  - Illegal Dumping Detection                     │       │
│  │                                                  │       │
│  │  Sustained Detection Tracker                     │       │
│  │  (fires alert after N continuous seconds)        │       │
│  └──────────────────┬───────────────────────────────┘       │
│                     │ POST /api/alerts                       │
│                     ▼                                        │
│  Next.js 15 API Routes                                       │
│       │                                                      │
│       ▼                                                      │
│  SQLite (WAL mode)  ◄──►  better-sqlite3                    │
│       │                                                      │
│       ▼                                                      │
│  React Dashboard (TypeScript + Radix UI + Tailwind)         │
│  ┌──────────┬───────────┬──────────┬──────────┬──────────┐  │
│  │Dashboard │  Cameras  │Incidents │Analytics │Environ.  │  │
│  └──────────┴───────────┴──────────┴──────────┴──────────┘  │
└─────────────────────────────────────────────────────────────┘

Stack summary:

Layer Technology
Frontend Next.js 15, React 19, TypeScript
UI Radix UI, shadcn/ui, Tailwind CSS 4
Charts Recharts
API Next.js App Router API Routes
Database SQLite (WAL mode) via better-sqlite3
Detection Python, YOLOv8 (Ultralytics), PyTorch
Vision OpenCV, NumPy
Streaming Flask MJPEG server
Models Hugging Face Hub (auto-download)

Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • A connected webcam or IP camera

1. Install frontend dependencies

npm install

2. Install Python dependencies

pip install -r requirements.txt

3. Download detection models

python download_models.py

4. Start the full system

Terminal 1 — Frontend:

npm run dev

Terminal 2 — Detection backend:

python run_backend.py

Open http://localhost:3000 to access the dashboard.

Environment Variables

Configure .env as needed:

Variable Default Description
ALERT_API_URL http://localhost:3000/api/alerts Alert POST endpoint
FRONTEND_EMIT_COOLDOWN_SECONDS 8 Minimum seconds between alerts per camera
PROCESSED_FEED_PORT 5001 Detection overlay stream port

Detection Pipeline

  1. Camera streams MJPEG frames to Flask server (port 5000)
  2. main.py reads frames and runs all four detection models in parallel
  3. Sustained detection tracking — an alert only fires after a detected class is continuously present for N seconds, suppressing transient false positives
  4. Confirmed incidents are POSTed to Next.js /api/alerts with metadata and a saved evidence image
  5. Next.js stores the incident in SQLite and broadcasts it to connected clients
  6. Incident images are saved to ./public/incidents/ and served statically

Privacy

EyeQ includes a configurable privacy filter (privacy_filter.py) that applies blur to sensitive regions such as faces and license plates in stored evidence images, in compliance with institutional privacy policies.


Impact

Metric Description
Response time Seconds from detection to operator alert
Incident workflow Confirm / Dismiss / Escalate with audit trail
Model accountability True-positive and false-positive rates tracked over time
Environmental coverage Fire, smoke, and illegal dumping monitored continuously
Resource optimization Risk Map directs patrols to highest-need zones

Project Context

EyeQ was developed as part of a university innovation challenge, motivated by a real incident: three bicycles stolen on campus despite cameras being present. The cameras recorded the events but triggered no response.

This platform is the answer to that gap — not more cameras, but smarter ones.


Built with purpose. Aligned with the SDGs. Designed to prevent the next loss, not just document it.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors