A production-style real-time fraud detection system built with an end-to-end ML pipeline, model tracking, a live inference API, and an interactive dashboard.
=======================
**Live Deployment: https://ai-fraud-detection-platform-1.onrender.com/
Frontend Dashboard: https://ai-fraud-detection-platform-1.onrender.com/
Backend API: https://ai-fraud-detection-platform.onrender.com
API Docs: https://ai-fraud-detection-platform.onrender.com/docs
This project was built to simulate a real fintech-grade fraud detection workflow where:
- transaction data is processed in real time,
- an ML model scores fraud risk,
- suspicious activity is flagged instantly,
- and live analytics are shown through a dashboard.
It is designed to demonstrate practical skills in:
- machine learning,
- MLOps,
- backend engineering,
- deployment,
- and real-time monitoring.
- Real-time fraud scoring using an XGBoost classifier.
- FastAPI inference service for low-latency prediction requests.
- Live Streamlit dashboard for monitoring risk scores and flagged transactions.
- MLflow experiment tracking to store metrics, parameters, and model artifacts.
- Transaction simulator to generate live traffic for testing the pipeline.
- Dockerized deployment for reproducible local and cloud execution.
- Cloud deployment on Render for public access.
flowchart TD
A[Transaction Simulator] --> B[FastAPI Fraud API]
B --> C[XGBoost Model]
C --> D[Fraud Probability]
D --> E[Decision: ALLOW / BLOCK]
E --> F[Streamlit Dashboard]
C --> G[MLflow Tracking]
| Layer | Technologies |
|---|---|
| Frontend / Dashboard | Streamlit |
| Backend API | FastAPI, Uvicorn |
| ML Model | XGBoost, scikit-learn |
| Data Handling | Pandas, NumPy |
| Experiment Tracking | MLflow |
| Containerization | Docker, Docker Compose |
| Cloud Deployment | Render |
| HTTP Communication | Requests |
| Configuration | python-dotenv |
| Metric | Value |
|---|---|
| ROC-AUC | 0.9750 |
| Fraud Recall | 0.76 |
| Precision (Fraud Class) | 0.94 |
| Training Time | ~8.9s |
| Decision Threshold | 0.80 |
AI-Fraud-Detection-Platform/
├── backend/
│ ├── api/
│ └── training/
├── monitoring/
├── scripts/
├── models/
├── docker/
├── requirements.txt
├── docker-compose.yml
└── README.md
- A transaction is generated by the simulator.
- The transaction is sent to the FastAPI
/predictendpoint. - The API converts input into the feature vector expected by the model.
- The XGBoost model returns a fraud probability.
- The result is displayed on the dashboard.
- MLflow stores the experiment parameters and performance metrics.
{
"amount": 1200,
"transaction_velocity": 6,
"merchant_risk": 0.8,
"device_score": 0.3
}{
"fraud_probability": 0.42,
"decision": "ALLOW"
}python -m venv venvvenv\Scripts\activatepip install -r requirements.txtuvicorn backend.api.main:app --reloadstreamlit run monitoring/dashboard.pypython scripts/transaction_simulator.py- Backend is deployed on Render as a web service.
- Dashboard is also deployed separately as a Streamlit web service.
- Make sure
fraud_model.pklis available during deployment. models/fraud_model.pklis required for inference.
This is not just a notebook demo. It includes:
- a training pipeline,
- model tracking,
- a live prediction API,
- a UI dashboard,
- real-time simulation,
- and cloud deployment.
That makes it a strong portfolio project for ML Engineer, Backend Engineer, and MLOps roles.
- Repository: https://github.com/Ayushb1234/AI-Fraud-Detection-Platform
- Live Dashboard: https://ai-fraud-detection-platform-1.onrender.com/


