Public Revenue & Corporate Tax Evasion Audit Priority Classifier
Kiran Machha
Forward Deployed AI Solutions Architect · Singapore
Public Revenue & Corporate Tax Evasion Audit Priority Classifier
Engineering Field Notes & System Architecture • Domain Focus: Public Sector
🏢 1. The Real-World Industry Challenge
Government revenue authorities receive millions of corporate and individual tax filings each year, but only have enough human auditors to manually examine less than 1% of submissions.
🎯 2. Core Purpose & Architectural Solution
To develop a machine learning audit prioritization classifier that evaluates accounting anomalies, deduction ratios, and Benford's Law distribution compliance to rank tax returns by non-compliance risk.
📈 Tangible ROI & Business Impact
Directs audit investigations toward returns with high evasion probability, recovering millions in uncollected public tax revenue while reducing unnecessary audit disruption for honest tax-paying citizens.
- Operational Efficiency: Eliminates error-prone manual intervention through end-to-end automation.
- Latency & Reliability: Guarantees predictable, sub-second execution with defensive validation.
- Compliance & Auditability: Enforces strict audit trails, zero-drift precision, and explainable decisions.
🏛️ 3. Production System Architecture & Data Flow
flowchart TD
%% Node Definitions with High-Contrast Theme
classDef client fill:#1e40af,stroke:#60a5fa,stroke-width:2px,color:#ffffff,rx:8,ry:8;
classDef parser fill:#0f766e,stroke:#2dd4bf,stroke-width:2px,color:#ffffff,rx:8,ry:8;
classDef engine fill:#581c87,stroke:#c084fc,stroke-width:2px,color:#ffffff,rx:8,ry:8;
classDef store fill:#14532d,stroke:#4ade80,stroke-width:2px,color:#ffffff,rx:8,ry:8;
classDef alert fill:#7f1d1d,stroke:#f87171,stroke-width:2px,color:#ffffff,rx:8,ry:8;
classDef cloud fill:#78350f,stroke:#fbbf24,stroke-width:2px,color:#ffffff,rx:8,ry:8;
subgraph INBOUND[" Ingestion and Validation Gateway "]
IN1["Client Stream: Government Based"]:::client
IN2["Pydantic Contract Validator"]:::parser
end
subgraph CORE_ENGINE[" Processing and Inference Engine "]
CE1["Dynamic Feature Normalizer"]:::engine
CE2["Core System: Public Revenue & Corporate Tax Evasion Audit Priority Classifier"]:::engine
CE3["Output Guardrails and Rules"]:::cloud
end
subgraph PERSISTENCE[" Production Storage and Outbox "]
DB1["Primary Database and Vector Lake"]:::store
DB2["Audit Exception Queue"]:::alert
end
subgraph TELEMETRY[" Production Observability "]
M1["Prometheus and Grafana Metrics"]:::store
end
IN1 -->|1. Inbound Ingress| IN2
IN2 -->|2. Sanitized Data| CE1
CE1 -->|3. Feature Vector| CE2
CE2 -->|4. Predictions| CE3
CE3 -->|5. Verified Record| DB1
CE3 -->|6. Anomaly Detected| DB2
CE2 -.->|7. Latency and Drift| M1
CE3 -.->|8. Audit Health| M1
⚙️ 4. Engineering Specification & Stack Matrix
| Architectural Layer | Production Component & Selection | Free Tier / Open-Source Tooling |
|---|---|---|
| Core Model Engine | LightGBM / XGBoost / CatBoost with Optuna Bayesian Search & SHAP Governance | Open-source weights / Framework native |
| Training & Fine-Tuning | Cost-Sensitive Training, PR-AUC Threshold Tuning & 5-Fold Stratified CV | Kaggle GPU (Dual T4) / Colab / Unsloth |
| Benchmark Dataset | Supervised Government Based Historical Records with Class-Imbalanced Labels | Free public datasets (Kaggle, HF, Data.gov) |
| User Interface (UI) | Streamlit Interactive Web Cockpit & REST API | Streamlit UI (app.py) with reactive components |
| Live UI Hosting | Streamlit Community Cloud + Hugging Face Spaces (CPU Basic 16GB) | 100% Free Live Web Hosting |
| Validation & Test Suite | Pytest Unit/Integration Suite + Synthetic Evals | Automated pre-deployment verification |
🔗 Source Code & Repository
Explore the complete reproducible implementation, tests, and configuration manifests in the master GitHub repository:
👉 View Code on GitHub: 02_machine_learning/04_government_tax_evasion_anomaly_detector
Authored by Kiran Macha — Forward Deployed AI Solutions Architect.