🛡️ KAWACH (कवच) — AI-Driven State Crime Intelligence & Public Safety Platform

Problem Statement: Zoho Challenge 02 — State-Wide AI-Driven Crime Analytics & Visualization Platform
Target Agency: State Crime Records Bureau (SCRB), Karnataka Police (1,100+ Police Stations)


Inspiration

Every single day, over 1,100+ police stations across Karnataka generate hundreds of thousands of FIRs, emergency 112 dispatch calls, chargesheets, CDR call detail records, and civic safety complaints. Today, this vital wealth of information remains trapped in static, siloed databases and manual paper registers.

Command officers—from Station House Officers (SHOs) to Superintendents of Police (SPs) and Director Generals of Police (DGPs)—lack a unified, real-time operational window. As a result, inter-district criminal syndicates operate undetected across station boundaries, money mules funnel cybercrime proceeds before banks can freeze them, and localized crime spikes escalate unaddressed.

We were inspired to build KAWACH (कवच)—a state-wide AI public safety and threat intelligence ecosystem designed to bridge this divide. KAWACH transforms fragmented law enforcement records into proactive, spatial, and predictive intelligence, empowering officers to stop crimes before they happen while safeguarding citizen rights through explainable, court-admissible AI.


What it does

KAWACH provides a unified 20-module intelligence grid serving both law enforcement agencies and citizens:

1. Police Command Console (20 Specialized Modules)

  • Interactive GIS Hotspot Mapping: Multi-tier spatial map (State → District → Station) utilizing Haversine DBSCAN density clustering ($Eps=1.5\text{ km}$) and counterfeit note seizure overlays.
  • Predictive Risk Engine: XGBoost Regressor paired with SHAP TreeExplainer (89.45% R² Accuracy) providing 0–100 district risk scores alongside natural-language feature attributions ("Risk driven by unemployment rate +23.5pts").
  • Criminal Network Graph & Money Mule AI: Heterogeneous graph (Persons, Gangs, Phones, Vehicles, Accounts) powered by Louvain community modularity to uncover syndicates and flag low-history money mules. Features a 1-tap Emergency Bank Hold Directive sealed with SHA-256 hashes under BSA §63.
  • Trend & Anomaly Detection: 30-day Poisson Z-score spike alerts ($Z > 3.0$ Critical), 90-day Facebook Prophet crime category forecasts (95% CI), and Isolation Forest multi-dimensional crime fingerprint anomaly mining.
  • Socio-Economic Correlation Engine: Pearson correlation matrix ($r$) mapping crime rates against census metrics (literacy, unemployment, GDP per capita, police density).
  • Advanced AI & Field Tools: Real-time CCTV ANPR license plate simulator, Biometric facial recognition matching, Officer Mobile Field App with offline store-and-forward sync, and SHA-256 PDF evidence dossiers compliant with Bharatiya Sakshya Adhiniyam (BSA) Section 63.

2. Citizen Safety PWA & Nayak AI Counsel

  • Bilingual Legal RAG Assistant: Multi-turn legal counsel indexing 3,974 sections across BNS, BNSS, BSA, IT Act, and Motor Vehicles Act in 12 regional languages (English, Kannada, Hindi, etc.) powered by Google Gemini 2.5 Flash.
  • Voice & Scam Call Verification: Browser Web Speech API mic (Kannada kn-IN & English en-IN) integrated with Groq Whisper (whisper-large-v3-turbo) to transcribe and analyze digital arrest scam calls in real time.
  • Counterfeit Currency Scanner: Neural network image scanner (EfficientNet-B0 + EasyOCR) analyzing user-uploaded INR notes with 91.9% accuracy and auto-logging seizure coordinates to the police GIS map.
  • 11 Civic Department SLA Engine: Automatic complaint router and shared SLA escalation engine (15m Critical/Fire, 4h High/Police, 24h Medium, 72h Low) with automated countdown timers.

How we built it

KAWACH is built on a decoupled, production-grade microservices architecture:

  • Frontend Console & Citizen PWA: Built with React 19 and compiled via Vite 8. Styled using a custom Dark Glassmorphism Vanilla CSS design system tokens. Geospatial views are rendered via Leaflet.js with custom Canvas DBSCAN layers; data analytics are powered by Recharts and Lucide React. Court-admissible PDF dossiers are compiled client-side using jsPDF, AutoTable, and html2canvas.
  • Backend REST API: Powered by FastAPI (Python 3.11) running on Uvicorn ASGI. Implements Pydantic v2 schemas, OpenAPI standards, PyJWT (HS256) + Passlib Bcrypt for Role-Based Access Control (DGP, SP, SHO, Constable), and SQLAlchemy 2.0 ORM with connection pooling.
  • Database & Data Storage: PostgreSQL hosted on Supabase for production with dynamic JSONB column support, paired with a zero-config local SQLite fallback engine (kawach_dev.db).
  • Machine Learning Pipelines:
    • Risk Model: XGBoost Regressor + SHAP TreeExplainer trained on real Karnataka Census (2011), GDP, and NCRB IPC data (R² = 0.8945, RMSE = 32.92).
    • Time-Series Forecasting: 11 Facebook Prophet model binaries predicting 30/60/90-day crime volume trends.
    • Anomaly Detection: Isolation Forest (200 estimators, contamination=0.05).
    • Vision Microservice: PyTorch microservice on HuggingFace Spaces hosting EfficientNet-B0/B7 dual ensembles for deepfake detection and a 6,304-image trained Counterfeit INR CNN, alongside YOLO12s road damage detection and SigLIP (google/siglip-base-patch16-224) scene classification.
    • Speech & Generative AI: Groq LPU Engine running whisper-large-v3-turbo for speech transcription, Google Gemini 2.5 Flash for Nayak RAG legal reasoning, and Web Speech API (webkitSpeechRecognition) for Kannada/English speech-to-text.
  • Hosting & Deployment: Backend deployed to Zoho Catalyst AppSail (PaaS) and Render; Frontends hosted on Zoho Catalyst Web Client CDN and Vercel; AI Classifiers hosted on HuggingFace Spaces.

Challenges we ran into

  1. Strict Production Database Safety: During early deployments, automated database seeding scripts risked dropping live production tables (Base.metadata.drop_all()). We engineered a 100% idempotent SEED_MODE=additive architecture that verifies existing records across all 20 modules before performing targeted, non-destructive inserts.
  2. Explainable AI vs. Black-Box Predictions: Law enforcement cannot act on unexplained AI risk scores. We integrated SHAP (SHapley Additive exPlanations) directly into our XGBoost inference pipeline, transforming mathematical feature weights into human-readable attributions ("Risk score 74.2% driven by 3-month crime momentum (+23.5pts) and police density deficit (+14.1pts)").
  3. High-Memory Deepfake & Currency Inference on Free-Tier Containers: Running MTCNN face extraction alongside dual EfficientNet-B7 ensembles on memory-constrained 512 MB containers caused out-of-memory crashes. We implemented chunked frame batching (FRAMES_PER_VIDEO=32) and decoupled the vision pipeline into a dedicated PyTorch microservice on HuggingFace Spaces.
  4. Bilingual Real-Time Voice Processing: Capturing live scam calls in regional Indian languages required precise speech recognition. We combined browser-native Web Speech API (kn-IN/en-IN) with Groq's LPU-accelerated whisper-large-v3-turbo endpoint to achieve sub-second speech-to-text transcription.

Accomplishments that we're proud of

  • High-Accuracy ML Models: Achieved 89.45% R² Accuracy on our XGBoost district risk scoring model trained on real Karnataka Census and NCRB IPC datasets.
  • Court-Admissible BSA §63 Dossiers: Developed an automated evidence export system that calculates SHA-256 cryptographic hashes over exported PDF dossiers and records them in immutable audit logs compliant with Section 63 of Bharatiya Sakshya Adhiniyam.
  • 1-Tap Emergency Bank Hold Directive: Built an actionable network analysis tool that automatically isolates money mule accounts in cybercrime networks and generates a signed PDF freezing order for partner banks in a single click.
  • Complete 20-Module Implementation: Successfully built, integrated, and verified all 20 Master Plan modules across 5 operational groups without relying on static mockups or broken endpoints.
  • Multi-Cloud Zero-Cost Deployment: Deployed the entire ecosystem across Zoho Catalyst, Render, Vercel, HuggingFace Spaces, and Supabase using production-ready free-tier configurations.

What we learned

  • Explainability is Non-Negotiable in Public Safety: Predictive policing models must be transparent, audit-checked, and strictly human-in-the-loop to eliminate demographic profiling and prevent biased enforcement.
  • Heterogeneous Graph Analysis Uncovers Hidden Crime: Traditional relational queries miss multi-entity fraud loops. Structuring data into NetworkX graph nodes (Person, Phone, Vehicle, Bank Account, Location) and running Louvain modularity reveals syndicate structures instantly.
  • Seamless Local-to-Cloud Database Abstraction: Abstracting SQLAlchemy models to support dynamic JSONB columns on PostgreSQL while maintaining SQLite compatibility enabled rapid offline development without sacrificing production scalability.

What's next for Kawach

  • Native CCTNS & ICJS Integration: Expanding data ingestion connectors to interface directly with the national Crime and Criminal Tracking Network & Systems (CCTNS) and Inter-operable Criminal Justice System (ICJS) APIs.
  • On-Edge Mobile Deployment: Quantizing vision models (YOLO12s and EfficientNet) using TensorRT and ONNX Runtime to enable offline edge execution on police bodycams and patrol vehicle dashboards.
  • Federated Cross-State Intelligence Sharing: Introducing privacy-preserving federated learning nodes to enable inter-state intelligence sharing between Karnataka SCRB and neighboring state crime records bureaus without exposing raw PII data.
  • Real-Time Automated Drones & CCTV Stream Processing: Scaling WebSockets and RTSP video ingestion pipelines to process live municipal CCTV feeds for automated crowd surge alerts and traffic anomaly detection. ```

Built With

Share this project:

Updates