Skip to content

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš” KSP Hackathon - Crime Intelligence Platform

An AI-powered Crime Intelligence Platform built for Karnataka State Police Hackathon to visualize crime patterns, detect hotspots, analyze criminal networks, and predict future crime risk using GIS and Machine Learning.


πŸ“Έ Project Demo

Dashboard

Screenshot 2026-07-19 215313

Crime Heatmap

Screenshot 2026-07-19 215348

Criminal Network Analysis

Screenshot 2026-07-19 215403

Risk Prediction Dashboard

Screenshot 2026-07-19 215417

Ground Truth Recovery

Screenshot 2026-07-19 215425

✨ Features

🟒 Phase 1 – Crime Mapping & Visualization

  • Interactive Karnataka crime map
  • Live crime incident visualization
  • PostgreSQL + PostGIS integration
  • Synthetic crime data generation
  • District-wise filtering
  • REST APIs using FastAPI

🟑 Phase 2 – Hotspot Detection

  • Crime Heatmaps
  • Station-wise density visualization
  • Red Zone Detection using Z-Score
  • Day/Night crime filtering
  • Weekday vs Weekend analysis

πŸ”΅ Phase 3 – Criminal Network Analysis

  • Modus Operandi (MO) clustering
  • Interactive criminal relationship graph
  • Force-directed visualization
  • Crime pattern discovery
  • Cluster-based suspect analysis

🟣 Phase 4 – AI Risk Prediction

  • XGBoost-based crime forecasting
  • SHAP Explainability
  • Station-wise risk scores
  • Feature importance visualization
  • Ground Truth Recovery Dashboard

πŸ”΄ Phase 5 – Officer Dashboard

  • Station Officer View
  • SCRB Analyst View
  • Role-based dashboard UI
  • Improved user experience
  • Shared dashboard components

πŸ—οΈ System Architecture

                    React Frontend
                           β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                                 β”‚
      FastAPI Backend                 ML Services
          β”‚                                 β”‚
     PostgreSQL + PostGIS         XGBoost + SHAP
          β”‚
   Synthetic Crime Generator

πŸ› οΈ Tech Stack

Frontend

  • React
  • Vite
  • Leaflet
  • React Force Graph
  • Recharts

Backend

  • Python
  • FastAPI

Database

  • PostgreSQL
  • PostGIS

Machine Learning

  • Scikit-learn
  • XGBoost
  • SHAP
  • Pandas
  • NumPy

πŸ“‚ Project Structure

KSP-Crime-Intelligence/
β”‚
β”œβ”€β”€ backend/
β”œβ”€β”€ frontend/
β”œβ”€β”€ ml/
β”œβ”€β”€ docs/
β”œβ”€β”€ images/
β”œβ”€β”€ requirements.txt
└── README.md

πŸš€ Installation

Clone Repository

git clone <repository-url>
cd KSP-Crime-Intelligence

Database Setup

createdb ksp_crime

psql -U postgres -d ksp_crime -f backend/schema.sql

Backend

cd backend

python -m venv venv

source venv/bin/activate
# Windows
venv\Scripts\activate

pip install -r requirements.txt

python generate_data.py

uvicorn main:app --reload

Frontend

cd frontend

npm install

npm run dev

Visit:

http://localhost:5173

πŸ“Š Future Enhancements

  • Real-time CCTNS Integration
  • Authentication & Authorization
  • Live Crime Streaming
  • AI-based Anomaly Detection
  • Predictive Patrol Route Planning
  • Cloud Deployment

πŸ‘¨β€πŸ’» Author

Keerthana K

AI & Machine Learning Enthusiast | Full Stack Developer | ML Engineer Aspirant


⭐ If you found this project useful, consider giving it a star!

About

An AI-powered crime intelligence platform developed for a hackathon to help law enforcement detect crime hotspots, analyze criminal networks, and predict crime risk using geospatial analytics, machine learning, and interactive dashboards.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages