| --- |
| title: Fraud Guard Intelligence |
| emoji: π‘οΈ |
| colorFrom: blue |
| colorTo: indigo |
| sdk: streamlit |
| sdk_version: 1.57.0 |
| app_file: app/streamlit_app.py |
| pinned: true |
| license: mit |
| --- |
| |
| # π³ Fraud Guard Intelligence: Adaptive MLOps System |
|
|
| This repository hosts the interactive frontend for a production-ready Fraud Detection system. The architecture is designed to handle non-static fraud patterns through real-time inference, explainable AI, and a human-in-the-loop retraining pipeline. |
|
|
| ## π System Architecture |
| This is a **Microservices-based Deployment**: |
| 1. **Frontend (This Space):** Streamlit UI for transaction input and SHAP-based risk visualization. |
| 2. **Backend (Render/Railway):** FastAPI server handling high-concurrency inference requests. |
| 3. **Data Layer (Neon DB):** PostgreSQL cloud database logging real-time telemetry for drift analysis. |
| 4. **Experiment Tracking (DagsHub/MLflow):** Versioned model registry and performance tracking. |
|
|
| ## π§ Key Features |
| - **Explainable AI:** Uses SHAP Waterfall plots to visualize why a specific transaction was flagged. |
| - **Dynamic Sensitivity:** Stakeholders can adjust the "AI Sensitivity" slider to balance False Positives vs. False Negatives. |
| - **Drift Monitoring:** Integrated with Evidently AI to detect statistical shifts in incoming data distribution. |
| - **Auto-Retraining:** Trigger a model refresh directly from the UI when enough human-verified data is collected. |
|
|
| ## π οΈ Tech Stack |
| - **Languages:** Python |
| - **ML Frameworks:** Scikit-Learn, XGBoost (v2.0.3) |
| - **APIs:** FastAPI, Uvicorn |
| - **Tracking:** MLflow, DagsHub |
| - **Database:** SQLAlchemy, PostgreSQL (Neon) |
| - **Monitoring:** Evidently AI, SHAP |
|
|
| ## π Environment Setup |
| To run this project locally or on your own Space, ensure the following **Secrets** are configured: |
| - `DATABASE_URL`: Cloud PostgreSQL connection string. |
| - `API_URL`: The URL of your deployed FastAPI backend. |
| - `DAGSHUB_USER_TOKEN`: For MLflow logging. |
| - `MLFLOW_TRACKING_URI`: DagsHub MLflow remote URI. |
|
|
| ## π Project Structure |
| - `app/`: Contains the Streamlit dashboard logic. |
| - `src/`: Modular code for pipelines (Predict, Train, Drift). |
| - `artifacts/`: Serialized model files (`.pkl`) and scalers. |
| - `app.py`: The entry point for Hugging Face deployment. |
|
|
| --- |
| **Author:** Mohit Parmar |
| **GitHub:** [MohitParmar78](https://github.com/MohitParmar78) |