M.A.R.G.A: MPLADS Analytics for Risk-Aware Governance & Assistance
Risk Detected, Trust Protected.
Built by Team Code of Chaos
What inspired us
Public money meant for schools, water plants and roads sometimes never becomes a school, a water plant or a road. It becomes a line in a ledger.
One CAG audit in Andhra Pradesh showed this clearly. 3,913 works were reported complete, but only 2,843 were physically verified. In another state, the reporting gap was ₹29.5 Cr (₹54.41 Cr reported vs ₹24.90 Cr in project ledgers).
The usual response is an audit that arrives years later, after the money is gone. We asked a different question: what if the system could flag the problem before the sanction, or while the work is still happening?
That became M.A.R.G.A, a low-power, AI-driven risk detection and decision-support platform for the MPLAD Scheme.
What it does
M.A.R.G.A follows a work through all five stages of its life, and each stage has a tool built for its problem:
| Stage | Problem | M.A.R.G.A solution |
|---|---|---|
| 1. Pre-Sanction | Inflated or prohibited proposals | Smart Proposal Checker (NLP rules + AI cost scoring) |
| 2. Execution | Fake photos, unverified progress | Marga Eyes, a field app with 3-tap geo-tagged updates |
| 3. Completion | Funds out of step with work | Fund & Milestone Checker (reconciliation, auto-generated UCs) |
| 4. Inspection | Scattered, hard-to-plan visits | Smart Inspection Planner (risk-ranked, optimised routes) |
| 5. Oversight | No unified view | Dashboard + Ask MARGA, role-based views with an AI chatbot |
Eight features power these stages:
- Cost & Time Predictor: predicts a fair cost and timeline from base rates, materials and location.
- Inflation Catcher: flags offices whose projects are consistently overpriced against the state average.
- Banned Work Scanner: catches disguised prohibited projects (temples, private property, personal names).
- Ghost Work Detector: compares site photos against reported completion to catch fake progress and empty sites.
- Fake GPS Blocker: verifies GPS and blocks fake photos within a 15 m radius.
- Dual-Lock Payment Guard: freezes payouts if payment outpaces work by 15%, pending approval.
- Citizen QR Code Audit: a QR plaque shows the contractor and warranty and lets citizens report issues.
- Inspection Router: links nearby high-risk sites so more projects are visited in fewer trips.
How we built it
Pipeline: Ingest (CSV, XLSX, PDF, photos) → Clean and normalise → Validate and risk-score → Reconcile records → Route inspections → Dashboards and alerts → Stakeholder action → Feedback into the model.
Tech stack
- PyTorch for deep learning models that verify photos and work stages
- scikit-learn for anomaly detection, plus BallTree nearest-site search for short inspection routes
- LightGBM to benchmark costs and catch inflated billing
- SHAP (TreeSHAP) so every cost flag comes with a feature-by-feature explanation
- Bhashini for alerts in the officer's own language, including voice
- WhatsApp to deliver alerts inside officers' daily workflow
- React for role-based dashboards for MPs, District Authorities, Implementing Agencies, State Nodal Authorities, MoSPI and CAG
The platform is designed to plug into existing government infrastructure: PFMS/SNA 2.0, ISRO NavIC, Aadhaar e-Sign, DigiLocker/NAD, PM GatiShakti and CPGRAMS.
The maths behind the alerts
To avoid flooding officers with noise, an agency's new work is flagged only when its cost is a statistical outlier against that agency's own last 50 works:
$$Z = \frac{x - \mu_{50}}{\sigma_{50}}, \qquad \text{flag if } Z > 3$$
The payment guard is a simple rule:
$$\text{Paid}\% - \text{Work Done}\% > 15\% \;\Rightarrow\; \text{freeze payout pending approval}$$
Why it is viable
- Lightweight: tree models score a work in under 10 ms on an ordinary CPU, with no GPU needed for the cost and NLP checks.
- Live from day one: rules and NLP check 15+ Annexure II clauses with zero training records, and ML joins in as data grows.
- Field-ready in 3 taps: photo, status and amount spent. That is about 100 photos per district per month at roughly 300 KB each.
- Near-zero cost: about 270 GB of compressed geo-photos at ₹1.9/GB is roughly
$$270 \times 1.9 \approx ₹513 \text{ per month nationwide.}$$
- No rule changes: it automates mandates that already exist: the 10% District and 1% State inspections, UCs and the 90-day sanction window.
Impact
$$\text{Verification gap closed} = \frac{3913 - 2843}{3913} \approx 27.3\%$$
$$\text{Inspection trips saved} = \frac{40 - 15}{40} = 62.5\%$$
- Verifying a random 10% quota across a 13,000 sq km district takes 40 scattered trips. Anchor-based spatial clustering reaches the same quota in 15.
- Fewer trips mean less fuel and fewer emissions, and paperless UCs and digital asset registers reduce paperwork.
- Each stakeholder sees exactly what their role needs, backed by a tamper-proof evidence trail.
Challenges we faced
- False alarms leading to ignored alerts. If everything is flagged, nothing gets read. We settled on the $Z > 3$ rule over an agency's last 50 works so that only genuine outliers reach an officer.
- Evidence tampering. A fraud-detection tool is only trusted if its own records can't be quietly edited. Every flag, photo and officer action is SHA-256 hash-chained, so editing or deleting any past record breaks the chain and is detected.
- Fake photos and weak networks. Field officers work with patchy connectivity. We combined geo and time stamps, duplicate-photo checks and offline sync, and added a rule that 90 idle days triggers a show-cause notice.
- Policy approval and adoption. Hard locks on payments are a big step for any department. We designed an advisory mode first, reading only from the eSAKSHI feed, with hard locks enabled only after MoSPI/State approval.
- Making it usable for non-technical officers. A good model is useless if officers can't use it. This pushed us toward simple dashboards, a three-tap geotagging app, and alerts in the officer's own language through familiar tools like WhatsApp.
What we learned
- The hardest part of fraud detection is trust, not accuracy. Explainability (SHAP), tamper-proof logs and a gentle advisory-first rollout matter as much as the model.
- Simple and lightweight wins. Rules plus tree models on a CPU were enough to be useful from day one, without waiting for big training datasets.
- Smart routing can reduce the cost of oversight as much as better detection can.
- Building around existing mandates (10% and 1% inspections, UCs, the sanction window) makes adoption far easier than asking for new rules.
What's next
- Move from advisory mode to hard payment locks, with MoSPI and State approval.
- Train the models further as real project data accumulates.
- Expand the field app and Bhashini voice alerts to more regions and languages.
Minimum Government, Maximum Governance.
Log in or sign up for Devpost to join the conversation.