Hybrid ML + GenAI fraud detection platform — XGBoost classifier with SHAP explainability and Anthropic Claude AI investigation reports.
| Feature | Detail |
|---|---|
| Fraud detection | XGBoost + SMOTE, trained on 50,000 transactions (1:578 imbalance handled) |
| Explainability | SHAP TreeExplainer — waterfall plot + top-5 risk factors per transaction |
| AI reports | Gemini (optional) writes investigation reports grounded in SHAP values |
| Bulk scoring | Upload any CSV, score all rows, download results with risk scores |
| Performance dashboard | ROC curve, PR curve, confusion matrix, feature importance |
- Fork this repo on GitHub
- Go to share.streamlit.io → New app
- Select your fork, branch
main, fileapp.py - In Advanced settings → Secrets, paste:
GEMINI_API_KEY = "sk-ant-your-key-here"
- Click Deploy — live in ~2 minutes
git clone https://github.com/SAMBIT-318/fraud-risk-intelligence.git
cd fraud-risk-intelligence
pip install -r requirements.txt
# Optional: add Gemini API key
cp .streamlit/secrets.toml.example .streamlit/secrets.toml
# Edit secrets.toml and replace the placeholder key
streamlit run app.py# With Gemini (set your key in .env or export GEMINI_API_KEY=sk-ant-...)
docker-compose up --build
# App available at http://localhost:8501The app generates 50,000 synthetic transactions by default. For the full 284,807-transaction dataset:
- Download
creditcard.csvfrom Kaggle ULB Fraud Detection - Place it in the
data/folder - Restart the app — it auto-detects the real dataset
Raw transaction (Amount, Time, V1–V28)
↓
Feature engineering → Amount_log, Amount_zscore, Hour, Is_night (32 features)
↓
StandardScaler → SMOTE (train only) → XGBoost (200 estimators)
↓
Risk score (0–100) + SHAP TreeExplainer → top-5 feature attributions
↓
Gemini Google-genai gemini 2.5 flash → structured investigation report
↓
Streamlit (3 tabs): Analyzer | Bulk Scoring | Performance Dashboard
| Score | Verdict |
|---|---|
| 0–30 | Legitimate |
| 31–60 | Needs review |
| 61–85 | High risk |
| 86–100 | Confirmed fraud |
Python · scikit-learn · XGBoost · SMOTE / imbalanced-learn · SHAP · Gemini API · Streamlit · Docker · Feature Engineering · Predictive Modeling · Plotly · Pandas · NumPy
Sambit Swain — MCA Candidate | Data Science & AI/GenAI