π Live Demo β fraudguard-ai.streamlit.app
FraudGuard AI is a Machine Learning-powered insurance claim fraud detection system designed to identify suspicious automobile insurance claims and support fraud investigation workflows.
The project combines:
- Machine Learning
- Business-rule intelligence
- Interactive analytics dashboards
- Risk scoring and reporting
Insurance fraud causes significant financial losses for insurance companies every year. Fraudulent claims may include:
- fake accidents
- exaggerated injury claims
- inflated repair costs
- staged collisions
- false theft reports
Manually reviewing every claim is expensive and time-consuming.
FraudGuard AI helps identify high-risk claims early, prioritize investigations, and improve fraud screening efficiency.
This project focuses on:
Automobile Insurance Claim Fraud Detection
The dataset contains automobile accident and insurance claim records including:
- customer information
- policy details
- accident details
- claim financials
- vehicle information
- fraud labels
Target Variable:
Fraudulent Claim vs Legitimate Claim
- total_claim_amount
- injury_claim
- vehicle_claim
- property_claim
- policy_annual_premium
- policy_deductable
- incident_type
- collision_type
- incident_severity
- incident_hour_of_the_day
- number_of_vehicles_involved
- bodily_injuries
- witnesses
- police_report_available
- property_damage
- age
- months_as_customer
- insured_occupation
- insured_education_level
- insured_relationship
- policy_state
- auto_make
- auto_model
- auto_year
- incident_state
- incident_city
Additional engineered features were created to improve fraud detection performance:
- claim_ratio
- incident_year
- vehicle_age
- days_between_policy_incident
- csl_per_person
- csl_per_accident
These engineered features help capture suspicious claim behavior and fraud-related patterns.
The final model selected for this project is XGBoost (Balanced & Tuned).
After dropping noisy features like insured_hobbies, multiple algorithms were evaluated using 5-fold cross-validation and hyperparameter tuning. XGBoost (Balanced) was chosen as the primary production model due to its high overall accuracy, balanced F2 score, and superior handling of non-linear feature interactions.
| Model | Accuracy | Recall | F1 Score | F2 Score | ROC-AUC |
|---|---|---|---|---|---|
| XGBoost (Balanced) β | 0.830 | 0.735 | 0.679 | 0.711 | 0.778 |
| Random Forest | 0.830 | 0.735 | 0.679 | 0.711 | 0.778 |
| Logistic Regression | 0.740 | 0.755 | 0.587 | 0.678 | 0.796 |
In insurance fraud detection, catching suspicious claims requires balancing accuracy, fraud recall, and feature interaction modeling. XGBoost (Balanced) was selected because:
- Higher Overall Accuracy & F1/F2 Balance: Achieves 83.0% accuracy with a solid 0.711 F2 score, outperforming Logistic Regression's overall classification precision.
- Handles Non-Linear Feature Interactions: Captures complex multi-variable risk signals (such as Major Damage combined with high claim ratios or short tenure) that simple linear models miss.
- Tree-Based SHAP Explainability: Pairs directly with
shap.Explainer(TreeExplainer) to provide exact instance-level feature attributions without linear model assumptions.
The final model is not intended to automatically reject claims. Instead, it acts as a fraud risk screening tool that helps prioritize claims for manual or SIU review.
FraudGuard AI uses SHAP (SHapley Additive exPlanations) via shap.Explainer (TreeExplainer)
to generate per-prediction, instance-level explanations for the XGBoost model.
Each prediction shows which features pushed the fraud probability up or down for that specific claim β providing claim-specific reasoning.
SHAP analysis revealed that incident_severity_major_damage is the strongest
global fraud signal. Dropping non-causal features like insured_hobbies removed spurious
correlations, resulting in clean, domain-backed SHAP explanations.
| Incident Severity | Total Claims | Fraud Claims | Fraud Rate (%) |
|---|---|---|---|
| Major Damage | 276 | 167 | 60.5% |
| Total Loss | 280 | 36 | 12.9% |
| Minor Damage | 354 | 38 | 10.7% |
| Trivial Damage | 90 | 6 | 6.7% |
Why Major Damage Dominates: Claims reporting Major Damage have a 60.5% fraud rate, compared to only 10.7% for Minor Damage. This massive 6x risk contrast justifies why XGBoost assigns its highest tree-split weightings to major incident severity.
Explanations support fraud-risk interpretation workflows but should not be treated as legal or causal proof of fraud.
FraudGuard AI combines:
- Machine Learning probability scoring
- Additional business-rule fraud analysis (post-model business-rule adjustment)
Example business-rule signals:
- unusually high injury claims
- missing police reports
- inconsistent claim breakdowns
- suspicious timing patterns
- inflated claim-to-premium ratios
This improves fraud-screening realism and operational interpretability.
- Multi-page Streamlit dashboard
- Fraud probability scoring
- Risk classification
- Explainable AI outputs
- Visual risk drivers
- Downloadable HTML investigation reports
-
Programming & Data Processing: Python,Pandas,NumPy
-
Machine Learning: Scikit-learn, Imbalanced-learn / SMOTE, Logistic Regression, Random Forest, XGBoost, Joblib for model serialization
-
Data Visualization: Plotly, Matplotlib, Seaborn
-
Web Application: Streamlit, Custom CSS
-
Model Explainability & Reporting: SHAP (TreeExplainer), per-prediction feature contributions, business-rule fraud signals, HTML and PDF investigation report generation
- Streamlit Community Cloud
FraudGuard-AI/
β
βββ app.py
βββ app_pages/
βββ src/
βββ models/
βββ data/
βββ assets/
βββ notebooks/
βββ tests/ (pytest suite for data pipeline and model validation)
βββ requirements.txt
βββ README.md
Raw Insurance Claim
β
βΌ
Feature Engineering
(claim_ratio, vehicle_age, days_between_policy_incident, csl splits)
β
βΌ
Balanced XGBoost Pipeline
(StandardScaler + OneHotEncoder + scale_pos_weight + XGBoost)
β
βΌ
Base Fraud Probability Score
β
βΌ
Business Rule Adjustment
(injury-to-damage ratio, missing police report, short tenure, claim dominance)
β
βΌ
Final Risk Score + Signals
β
βββ Low (<35%) β Auto-approve
βββ Medium (35β65%) β Manual review
βββ High (>65%) β Escalate to SIU
FraudGuard AI is a fraud-screening support tool, not a final fraud decision system.
- The predictions are based on probabilities, so the model may sometimes predict fraud incorrectly or miss some fraud cases.
- The dataset is synthetic and small in size. Real-world insurance fraud systems require significantly larger and more diverse datasets.
- Human investigation is still required for final fraud decisions.
- The deployed model prioritizes explainability and recall over maximum predictive performance.
- Some business-rule checks added in the app are manually designed and may not fully represent real insurance company workflows.
- Model performance is based on historical labeled data and may not perform well on completely new or evolving fraud patterns.
- Some input fields are simplified or internally generated for demo purposes.
- The model can produce false positives and false negatives.
- Feature contribution explanations only show which factors influenced the prediction. They should not be treated as legal proof of fraud.
- The app does not include production monitoring, drift detection, or real-time claim system integration.
FraudGuard AI should be viewed as a fraud risk assessment and investigation support tool rather than a fully automated fraud detection system.
- FastAPI backend for real-time claim scoring API
- Ensemble learning models (stacking LR + XGBoost)
- Real-time API integration with claims management systems
- User authentication and role-based access
- Claim history tracking and trend analysis
- Production-grade monitoring and model drift detection
- Larger, more diverse training dataset to reduce spurious correlations
- Built an end-to-end ML pipeline using XGBoost with
scale_pos_weightclass balancing inside a scikit-learnPipelineto prevent data leakage - Used
make_scorer(fbeta_score, beta=2)withRandomizedSearchCVso hyperparameter tuning optimized directly for fraud recall and F2 score - Integrated
shap.Explainer(TreeExplainer) to generate instance-level feature attributions for non-linear tree models - Designed business-rule post-processing on top of model probability scores to capture domain fraud signals that statistical features alone cannot express
- Identified and removed spurious feature correlations (
insured_hobbies) to ensure model explainability relies purely on genuine risk factors
FraudGuard AI demonstrates how Machine Learning and business-rule intelligence can work together to support insurance fraud investigation workflows.
The project focuses not only on prediction accuracy, but also on:
- explainability
- fraud reasoning
- business value
- investigation support
making it closer to a realistic fraud analytics application rather than a simple ML notebook project.