Team ID: UIDAI_7554
Author: S Aadarsh (@adarshvision1)
Kaggle Notebook: UIDAI-7554
The UIDAI Enrolment Risk Engine is a compact, reproducible machine learning pipeline designed to identify district-months where Aadhaar enrolments deviate materially from learned norms. The system combines statistical baselines, temporal concentration metrics, demographic segmentation, and behavioral anomaly detection to create actionable risk assessments for policy intervention.
- Processed: 1,006,007 raw enrolment records (MarโDec 2025)
- Generated: 4,848 monthly feature rows across districts
- Scored: 3,847 district-month combinations
- Flagged: 77 high-risk cases requiring attention
- Forecast: ~36,049 daily enrolments (national average)
- โ Decision Map โ Interactive visualization prioritizing audit-worthy districts
- โ Top-10 Flagged Cases โ C3 priority list with detailed metadata
- โ District Segmentation โ Demographic clusters for customized verification
- โ 30-Day Forecast โ Proactive resource planning for workload management
- Problem Statement
- Approach
- Technical Architecture
- Dataset
- Methods
- Results
- Operational Playbook
- Installation & Usage
- Artifacts
- Limitations
- Future Work
- License
Aadhaar enrolment volumes are influenced by social, administrative, and operational events. UIDAI requires a reliable, interpretable system that distinguishes:
- โ Routine demographic demand
โ ๏ธ Concentrated surges requiring verification- ๐จ Anomalous patterns meriting policy attention
Challenge: Identify high-risk enrolment patterns without overwhelming audit resources or creating false positives.
The system employs a multi-layered anomaly detection strategy:
-
Dynamic Baselining (Context)
- LightGBM quantile regressors (q50, q90) predict district-specific demand
- q90 represents upper bounds of historically plausible volumes
-
Temporal Burstiness (Behavior)
- Gini coefficient measures intra-month concentration
- Identifies whether volume is distributed or concentrated into few days
-
Operational Segmentation (Demographics)
- K-Means clustering on child/adult ratios
- Creates operational archetypes: Newborn Hubs, Camp/Sporadic, Mixed
-
Composite Risk Scoring
- IsolationForest behavioral scores
- Weighted anomaly score combining excess, burst, and peer deviation
- Policy mapping: A1 (Monitor) โ B2 (Analyst Review) โ C3 (Field Verification)
graph LR
A[Raw Data] --> B[ETL & Canonicalization]
B --> C[District-Month Aggregation]
C --> D[Feature Engineering]
D --> E[Quantile Baseline Models]
E --> F[Temporal & Demographic Features]
F --> G[Risk Scoring Engine]
G --> H[Policy Classification]
H --> I[Interactive Dashboards]
- Machine Learning: LightGBM (quantile regression), IsolationForest, Exponential Smoothing
- Data Processing: Pandas, NumPy
- Visualization: Plotly (interactive HTML dashboards)
- Storage: Parquet (efficient columnar format)
| Choice | Rationale |
|---|---|
| District-month units | Aligns with administrative action, reduces daily noise |
| Quantile baselines | Avoids mean-driven false positives in heavy-tailed data |
| Gini coefficient | Single interpretable signal for temporal concentration |
| Composite scoring | Balances statistical deviation and behavioral irregularity |
- Source: Anonymized Aadhaar enrolment CSV shards
- Required Columns:
dateโ Enrolment datestate,district,pincodeโ Geographic identifiersage_0_5,age_5_17,age_18_greaterโ Demographic buckets
- Raw Records: 1,006,007
- Time Period: MarchโDecember 2025
- Districts Covered: Multi-state coverage with 4,848 district-month combinations
- Text canonicalization (lowercase, strip whitespace)
- Date parsing and validation
- Compute
total_enrolmentsfrom age buckets or fallback fields - Aggregate to
(state, district, month)level
Lag Features: 1, 2, 3, 6-month historical volumes
Rolling Statistics: 3-month mean and standard deviation
Event Intensity: Month-based proxies (admissions, fiscal windows)
Peer Deviation: Comparison to state/regional averages
- q50 (Median): Expected typical demand
- q90 (Upper Baseline): Extreme but historically plausible demand
- Features: Lags, rolling stats, demographic ratios, event intensity, peer deviation
- Detects unusual patterns in feature space
- Identifies outliers not captured by quantile models
- National-level 30-day daily enrolment forecast
- Resource planning and workload anticipation
risk_index = MinMaxScale(
weighted_sum(
excess_score,
burstiness_score,
peer_deviation_score,
isolation_forest_score
)
)Policy Mapping:
- C3 (Field Verification):
risk_index >= threshold_highAND no exoneration - B2 (Analyst Review):
threshold_med <= risk_index < threshold_high - A1 (Monitor):
risk_index < threshold_med
Exoneration Rule:
If event_intensity >= 0.8 AND demographic ratios match expected patterns โ Classified as authorized surge
| State | District | Month | Total Enrolments | Age 0-5 | Age 5-17 | Age 18+ |
|---|---|---|---|---|---|---|
| West Bengal | Murshidabad | 2025-09 | 13,877 | 12,270 | 1,592 | 15 |
| Karnataka | Bengaluru Urban | 2025-07 | 12,219 | 6,740 | 3,752 | 1,727 |
| West Bengal | North 24 Parganas | 2025-09 | 10,642 | 8,255 | 2,149 | 238 |
| Uttar Pradesh | Bahraich | 2025-07 | 10,547 | 3,919 | 6,096 | 532 |
| Karnataka | Bengaluru Urban | 2025-06 | 10,123 | 5,062 | 3,223 | 1,838 |
| State | District | Month | Total | Expected q90 | Excess | Burst Gini | Risk Index | Policy |
|---|---|---|---|---|---|---|---|---|
| Gujarat | Banas Kantha | 2025-07 | 9,228 | 6,907 | 2,321 | 0.96 | 1.00 | C3 |
| West Bengal | Murshidabad | 2025-09 | 13,877 | 7,409 | 6,468 | 0.34 | 1.00 | C3 |
| Bihar | Pashchim Champaran | 2025-07 | 9,642 | 7,342 | 2,300 | 0.95 | 0.98 | C3 |
| Gujarat | Dohad | 2025-07 | 8,001 | 6,310 | 1,691 | 0.90 | 0.95 | C3 |
| Meghalaya | East Khasi Hills | 2025-04 | 7,798 | 5,057 | 2,741 | 0.82 | 0.93 | C3 |
Note: High Burst Gini (>0.7) indicates concentration into few days
{
"rows_processed_raw": 1006007,
"monthly_feature_rows": 4848,
"scored_rows": 3847,
"high_risk_count_ge_t_med": 77,
"forecast_mean_per_day": 36049,
"anomalies_detected": 0,
"run_timestamp_utc": "2026-01-23T16:47:38.968599"
}The system generates three interactive HTML dashboards:
-
๐บ๏ธ Decision Map (
decision_map.html)- X-axis: Burstiness (Gini coefficient)
- Y-axis: Excess over q90 baseline
- Upper-right quadrant = High priority audit targets
-
๐ถ District Segmentation (
district_segmentation.html)- Child vs Adult enrolment mix
- Clusters: Newborn Hubs, Camp/Sporadic, Mixed demographics
-
๐ Workload Forecast (
workload_forecast.html)- Historical daily series + 30-day forecast
- Spike detection and trend analysis
For Every C3 Case, Auto-Generate:
- Daily time series visualization
- Top-3 PIN codes (geographic concentration)
- Top operator IDs (account review)
- Event intensity score
- Excess and burstiness metrics
Auto-Call Checklist:
if burst_gini > 0.7 and top_3_day_share > 0.6:
flag_for_immediate_operator_audit()Exoneration Check:
if event_intensity >= 0.8 and demographic_mix_matches_expected:
classify_as("Administrative surge - Request documentation")
else:
proceed_to_field_audit()| Policy Class | Action Required | Responsibility |
|---|---|---|
| C3 | Field verification, document check, operator review, temporary suspension if breach found | District Officers |
| B2 | Request event permits and rosters, monitor recurrence | State Analysts |
| A1 | Monitor only, include in resource planning | Regional Coordinators |
- Week 1-2: Run programmatic triage checks (PIN, operator, temporal concentration)
- Week 3-4: Contact district offices, request permits/rosters
- Week 5-6: Schedule and conduct field audits for cases without valid documentation
- Week 7-8: Log audit outcomes, compute Precision@10, retrain models
# Python 3.8+
pip install pandas numpy lightgbm scikit-learn plotly statsmodels joblib# Clone the repository
git clone https://github.com/adarshvision1/UIDAI_7554.git
cd UIDAI_7554
# Open Jupyter Notebook
jupyter notebook uidai-7554.ipynbThe notebook executes the following stages:
- Data Loading โ Read anonymized CSV shards
- ETL โ Clean and aggregate to district-month level
- Feature Engineering โ Generate lags, rolling stats, event proxies
- Model Training โ Fit quantile regressors and anomaly detectors
- Scoring โ Compute risk indices and policy classifications
- Visualization โ Generate interactive HTML dashboards
- Export โ Save artifacts to
results/uidai_artifacts/
All outputs are saved to results/uidai_artifacts/:
feature_store_enrolment.parquetโ Engineered features (4,848 rows)engineered_with_predictions.parquetโ Features + baseline predictionsscored_cases.parquetโ Full risk scoring resultstop_cases.jsonโ Top-N flagged district-monthsdaily_forecast_30d.csvโ National workload forecast
model_q50.txt/.joblibโ Median quantile regressormodel_q90.txt/.joblibโ Upper baseline regressormodel_training_meta.jsonโ Training configuration and metrics
decision_map.htmlโ Interactive burstiness vs excess plotdistrict_segmentation.htmlโ Demographic clustering visualizationworkload_forecast.htmlโ Time series forecast with anomalies
summary.jsonโ Pipeline run statisticsfeature_store_preview_top10.csvโ Sample feature data
-
Data Anonymization
- Flags indicate risk, not proof of wrongdoing
- All investigations must follow due process
-
Missing External Data
- No official camp calendars or event schedules
- Missing population denominators for rate calculations
- Recommendation: Integrate government event calendars (schools, health, welfare schemes)
-
Detector Inconsistency
- Daily anomaly detector reported 0 anomalies
- Monthly quantile detector flagged many cases
- Action: Do not rely on single detector; use combined resolution checks
-
Temporal Scope
- Limited to MarchโDecember 2025
- Requires continuous retraining with new data
-
Causal Attribution
- Statistical association โ causation
- Field verification required for definitive conclusions
- Integrate official event calendars (admissions, immunization, PDS deadlines)
- Add operator registry for cross-referencing
- Implement real-time alerting system
- Develop mobile audit app for field officers
- Deploy to state UIDAI dashboards with role-based access
- Build feedback loop: audit outcomes โ label store โ model retraining
- Add explainability module (SHAP values for individual cases)
- Extend to sub-district (tehsil/block) level granularity
- Multi-modal anomaly detection (biometric quality, document types)
- Predictive resource allocation optimization
- Natural language query interface for policy analysts
- Integration with national identity management systems
Evidence: Few districts (Murshidabad, Bengaluru Urban, etc.) account for national-scale volumes
Policy Use: Pre-authorize camps, negotiate scheduling with state offices
Evidence: High burstiness (Gini >0.9) in Banas Kantha, Pashchim Champaran
Policy Use: Require advance notification, implement camp authorization protocols
Evidence: Murshidabad shows high excess but low Gini (sustained demand)
Policy Use: Differentiate scaling (multi-week campaigns) from audit (single-day batches)
Evidence: Districts flagged multiple months
Policy Use: Watchlist for root-cause analysis (operator behavior, local incentives)
Evidence: High child-ratio in flagged months (12,270 of 13,877 in Murshidabad)
Policy Use: Coordinate with health/education departments, use pediatric audit checklists
This project is developed for UIDAI's operational use. Data is anonymized and handled in compliance with privacy regulations. For access or collaboration inquiries, please contact the development team.
This repository represents a submission to UIDAI's enrolment analytics initiative. For questions or suggestions:
- Author: S Aadarsh
- GitHub: @adarshvision1
- Kaggle: aadarshvision1
- Project: Kaggle Notebook
If you use this work in research or policy documentation:
@misc{uidai_risk_engine_2026,
author = {S. Aadarsh},
title = {UIDAI Enrolment Risk Engine: Anomaly Detection for Identity Management},
year = {2026},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/adarshvision1/UIDAI_7554}},
note = {Team ID: UIDAI\_7554}
}Built with ๐ง Machine Learning for ๐ฎ๐ณ Digital India