Commit ยท
b3875cc
1
Parent(s): 82f8273
Clean up and simplify README for better readability
Browse files
README.md
CHANGED
|
@@ -7,16 +7,14 @@ sdk: docker
|
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
-
|
| 11 |
# ๐ก๏ธ AI-Powered Transaction Fraud Detection System
|
| 12 |
|
| 13 |
[](https://www.python.org/downloads/)
|
| 14 |
[](https://flask.palletsprojects.com/)
|
| 15 |
[](LICENSE)
|
| 16 |
-
[](https://mlflow.org/)
|
| 17 |
[](https://huggingface.co/spaces)
|
| 18 |
|
| 19 |
-
A
|
| 20 |
|
| 21 |
## ๐ Quick Start (Windows)
|
| 22 |
|
|
@@ -32,184 +30,60 @@ A production-grade, real-time financial fraud detection system that combines mul
|
|
| 32 |
- Launches Flask app
|
| 33 |
- Opens browser at `http://127.0.0.1:5000`
|
| 34 |
|
| 35 |
-
## ๐ค Try it Live
|
| 36 |
|
| 37 |
[](https://huggingface.co/spaces/Learnerbegginer/fraud-detection-system)
|
| 38 |
|
| 39 |
-
##
|
| 40 |
-
|
| 41 |
-
**Hugging Face Space Demo**: The deployed Hugging Face Space runs a lightweight, optimized demo version of the fraud detection system for fast, reliable public access and demonstration purposes.
|
| 42 |
-
|
| 43 |
-
**Full ML Pipeline**: The complete machine learning pipeline (Isolation Forest, XGBoost, Graph Neural Network using PyTorch) with full training capabilities is available in the main repository and can be deployed on GPU-enabled or VM-based infrastructure for production use cases.
|
| 44 |
-
|
| 45 |
-
**Demo Features**:
|
| 46 |
-
- โ
Real-time fraud scoring logic
|
| 47 |
-
- โ
Risk visualization and explanations
|
| 48 |
-
- โ
SHAP-style interpretability
|
| 49 |
-
- โ
Health monitoring endpoints
|
| 50 |
-
- โ
Responsive web interface
|
| 51 |
-
|
| 52 |
-
This architecture ensures maximum reliability for demo/review purposes while maintaining full ML capabilities for production deployment.
|
| 53 |
-
|
| 54 |
-
## ๏ฟฝ๐ Table of Contents
|
| 55 |
|
| 56 |
- [๐ฏ Project Overview](#-project-overview)
|
| 57 |
- [โจ Key Features](#-key-features)
|
| 58 |
- [๐๏ธ System Architecture](#๏ธ-system-architecture)
|
| 59 |
- [๐ Quick Start](#-quick-start)
|
| 60 |
-
- [๐ค Hugging Face Deployment](#-hugging-face-deployment)
|
| 61 |
- [๐ Project Structure](#-project-structure)
|
| 62 |
- [๐ง Installation](#-installation)
|
| 63 |
- [๐ฎ Usage](#-usage)
|
| 64 |
- [๐ API Documentation](#-api-documentation)
|
| 65 |
- [๐งช Model Details](#-model-details)
|
| 66 |
-
- [ Performance
|
| 67 |
-
- [๐ Security
|
| 68 |
-
- [๐ง Future Enhancements](#-future-enhancements)
|
| 69 |
- [๐ค Contributing](#-contributing)
|
| 70 |
- [๐ License](#-license)
|
| 71 |
|
| 72 |
## ๐ฏ Project Overview
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
- **
|
| 79 |
-
- **
|
| 80 |
-
- **
|
| 81 |
-
- **
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
-
|
| 85 |
-
-
|
| 86 |
-
- ๐ **Data Science & Analytics**
|
| 87 |
-
- ๐ **Full-Stack Web Development**
|
| 88 |
-
- ๐ **MLOps & Model Monitoring**
|
| 89 |
-
|
| 90 |
-
## โจ Key Features
|
| 91 |
-
|
| 92 |
-
### ๐ Real-Time Transaction Monitoring
|
| 93 |
-
- Live transaction feed with automatic refresh
|
| 94 |
-
- Risk-based color coding (Low/Medium/High)
|
| 95 |
-
- Configurable monitoring thresholds
|
| 96 |
-
- Real-time alert system
|
| 97 |
-
|
| 98 |
-
### ๐ง Multi-Model Fraud Detection
|
| 99 |
-
- **Isolation Forest**: Anomaly detection for unusual patterns
|
| 100 |
-
- **XGBoost**: Supervised classification with high accuracy
|
| 101 |
-
- **Graph Neural Networks**: Relationship-based fraud detection
|
| 102 |
-
- **Ensemble Scoring**: Weighted composite risk scoring
|
| 103 |
-
|
| 104 |
-
### ๐ฏ Explainable AI (XAI)
|
| 105 |
-
- **SHAP (SHapley Additive exPlanations)** for model interpretability
|
| 106 |
-
- Feature importance visualization
|
| 107 |
-
- Decision transparency for compliance
|
| 108 |
-
- Analyst-friendly explanations
|
| 109 |
-
|
| 110 |
-
### ๐ Advanced Analytics Dashboard
|
| 111 |
-
- Interactive risk distribution charts
|
| 112 |
-
- Transaction trend analysis
|
| 113 |
-
- Network graph visualization
|
| 114 |
-
- Customer risk profiling
|
| 115 |
-
- Performance metrics tracking
|
| 116 |
-
|
| 117 |
-
### ๐ Regulatory Compliance
|
| 118 |
-
- **Suspicious Activity Reports (SAR)** generation
|
| 119 |
-
- PDF export functionality
|
| 120 |
-
- Audit trail maintenance
|
| 121 |
-
- Compliance-ready reporting
|
| 122 |
-
|
| 123 |
-
### ๐ Continuous Learning
|
| 124 |
-
- **Concept Drift Detection** with statistical monitoring
|
| 125 |
-
- **AutoML-based retraining** on scheduled intervals
|
| 126 |
-
- **MLflow integration** for experiment tracking
|
| 127 |
-
- Model versioning and rollback capabilities
|
| 128 |
|
| 129 |
## ๐๏ธ System Architecture
|
| 130 |
|
| 131 |
```
|
| 132 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 133 |
-
โ
|
| 134 |
-
โ
|
| 135 |
-
โ โข HTML5/CSS3 โโโโโบโ โข Flask API โโโโโบโ โข Isolation โ
|
| 136 |
-
โ โข Chart.js โ โ โข REST Endpointsโ โ Forest โ
|
| 137 |
-
โ โข Vis.js โ โ โข Background โ โ โข XGBoost โ
|
| 138 |
-
โ โข Bootstrap โ โ Threads โ โ โข GNN โ
|
| 139 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 140 |
-
|
| 141 |
-
โ โ โ
|
| 142 |
-
โผ โผ โผ
|
| 143 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 144 |
-
โ
|
| 145 |
-
โ
|
| 146 |
-
โ โข CSV Files โ โ โข MLflow โ โ โข Drift Detectorโ
|
| 147 |
-
โ โข In-Memory โ โ โข AutoML โ โ โข Logging โ
|
| 148 |
-
โ โข File Storage โ โ โข Model Registryโ โ โข Metrics โ
|
| 149 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 150 |
```
|
| 151 |
|
| 152 |
-
###
|
| 153 |
-
|
| 154 |
-
**Frontend**
|
| 155 |
-
- HTML5, CSS3, Bootstrap 5
|
| 156 |
-
- Chart.js for data visualization
|
| 157 |
-
- Vis.js for network graphs
|
| 158 |
-
- JavaScript ES6+
|
| 159 |
-
|
| 160 |
-
**Backend**
|
| 161 |
-
- Flask (Python Web Framework)
|
| 162 |
-
- RESTful API design
|
| 163 |
-
- Background task processing
|
| 164 |
-
- Real-time transaction simulation
|
| 165 |
-
|
| 166 |
-
**Machine Learning**
|
| 167 |
-
- Scikit-learn (Isolation Forest, Random Forest)
|
| 168 |
-
- XGBoost (Gradient Boosting)
|
| 169 |
-
- PyTorch Geometric (Graph Neural Networks)
|
| 170 |
-
- SHAP (Explainable AI)
|
| 171 |
-
|
| 172 |
-
**MLOps & Monitoring**
|
| 173 |
-
- MLflow (Experiment Tracking)
|
| 174 |
-
- Concept Drift Detection
|
| 175 |
-
- AutoML for automated retraining
|
| 176 |
-
- Model versioning and registry
|
| 177 |
-
|
| 178 |
-
## ๐ Quick Start
|
| 179 |
-
|
| 180 |
-
### ๐ค Hugging Face Deployment (Recommended)
|
| 181 |
-
|
| 182 |
-
1. **Clone/Download** this repository
|
| 183 |
-
2. **Create a new Hugging Face Space** at [huggingface.co/new-space](https://huggingface.co/new-space)
|
| 184 |
-
3. **Choose Docker SDK** and give your space a name
|
| 185 |
-
4. **Upload** all files to the Space repository
|
| 186 |
-
5. **Wait for build** - Hugging Face will automatically build and deploy
|
| 187 |
-
6. **Access your app** at `https://your-username.hf.space/your-space-name`
|
| 188 |
-
|
| 189 |
-
**Features:**
|
| 190 |
-
- โ
Zero configuration deployment
|
| 191 |
-
- โ
Free tier available
|
| 192 |
-
- โ
Automatic HTTPS
|
| 193 |
-
- โ
Built-in CI/CD
|
| 194 |
-
- โ
GPU support (if needed)
|
| 195 |
-
|
| 196 |
-
### ๐ฅ๏ธ Local Development
|
| 197 |
-
|
| 198 |
-
```bash
|
| 199 |
-
# Install dependencies
|
| 200 |
-
pip install -r requirements.txt
|
| 201 |
-
|
| 202 |
-
# Run the application
|
| 203 |
-
python app.py
|
| 204 |
-
|
| 205 |
-
# Or use the startup scripts
|
| 206 |
-
# Windows
|
| 207 |
-
start-project.bat
|
| 208 |
-
|
| 209 |
-
# PowerShell
|
| 210 |
-
start-project.ps1
|
| 211 |
-
```
|
| 212 |
|
|
|
|
|
|
|
|
|
|
| 213 |
Access the application at [http://localhost:5000](http://localhost:5000)
|
| 214 |
|
| 215 |
## ๐ค Hugging Face Deployment
|
|
|
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
| 9 |
---
|
|
|
|
| 10 |
# ๐ก๏ธ AI-Powered Transaction Fraud Detection System
|
| 11 |
|
| 12 |
[](https://www.python.org/downloads/)
|
| 13 |
[](https://flask.palletsprojects.com/)
|
| 14 |
[](LICENSE)
|
|
|
|
| 15 |
[](https://huggingface.co/spaces)
|
| 16 |
|
| 17 |
+
A real-time financial fraud detection system that combines multiple machine learning approaches with explainable AI to identify suspicious transactions with high accuracy and transparency.
|
| 18 |
|
| 19 |
## ๐ Quick Start (Windows)
|
| 20 |
|
|
|
|
| 30 |
- Launches Flask app
|
| 31 |
- Opens browser at `http://127.0.0.1:5000`
|
| 32 |
|
| 33 |
+
## ๐ค Try it Live
|
| 34 |
|
| 35 |
[](https://huggingface.co/spaces/Learnerbegginer/fraud-detection-system)
|
| 36 |
|
| 37 |
+
## Table of Contents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
- [๐ฏ Project Overview](#-project-overview)
|
| 40 |
- [โจ Key Features](#-key-features)
|
| 41 |
- [๐๏ธ System Architecture](#๏ธ-system-architecture)
|
| 42 |
- [๐ Quick Start](#-quick-start)
|
|
|
|
| 43 |
- [๐ Project Structure](#-project-structure)
|
| 44 |
- [๐ง Installation](#-installation)
|
| 45 |
- [๐ฎ Usage](#-usage)
|
| 46 |
- [๐ API Documentation](#-api-documentation)
|
| 47 |
- [๐งช Model Details](#-model-details)
|
| 48 |
+
- [๐ Performance](#-performance)
|
| 49 |
+
- [๐ Security](#-security)
|
|
|
|
| 50 |
- [๐ค Contributing](#-contributing)
|
| 51 |
- [๐ License](#-license)
|
| 52 |
|
| 53 |
## ๐ฏ Project Overview
|
| 54 |
|
| 55 |
+
This system addresses the critical challenge of financial fraud detection, which costs the global economy over $32 billion annually. By leveraging advanced machine learning techniques, we provide real-time fraud detection with explainable AI capabilities.
|
| 56 |
+
|
| 57 |
+
### ๐ฏ Key Features
|
| 58 |
+
|
| 59 |
+
- **๏ฟฝ Multi-Model Approach**: Isolation Forest, XGBoost, and Graph Neural Networks
|
| 60 |
+
- **โก Real-time Processing**: Sub-250ms transaction analysis
|
| 61 |
+
- **๐ Explainable AI**: SHAP-based feature importance for transparency
|
| 62 |
+
- **๐ Risk Profiling**: Customer-specific risk assessment
|
| 63 |
+
- **๏ฟฝ Continuous Learning**: Automatic model retraining and drift detection
|
| 64 |
+
- **๐ฑ Modern UI**: Responsive web dashboard
|
| 65 |
+
- **๐ Reporting**: SAR (Suspicious Activity Report) generation
|
| 66 |
+
- **๐ Deployment Ready**: Docker containerization and cloud deployment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
## ๐๏ธ System Architecture
|
| 69 |
|
| 70 |
```
|
| 71 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 72 |
+
โ Transaction โโโโโถโ Feature Eng. โโโโโถโ ML Models โ
|
| 73 |
+
โ Input โ โ Pipeline โ โ Ensemble โ
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 75 |
+
โ
|
|
|
|
|
|
|
| 76 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 77 |
+
โ Dashboard โโโโโโ Results โโโโโโ Explainable โ
|
| 78 |
+
โ UI โ โ Processing โ โ AI โ
|
|
|
|
|
|
|
|
|
|
| 79 |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 80 |
```
|
| 81 |
|
| 82 |
+
### ๐ง Machine Learning Models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
+
1. **Isolation Forest**: Unsupervised anomaly detection for novel fraud patterns
|
| 85 |
+
2. **XGBoost**: Supervised gradient boosting for high-accuracy classification
|
| 86 |
+
3. **Graph Neural Networks**: Relationship-based fraud detection using transaction networks
|
| 87 |
Access the application at [http://localhost:5000](http://localhost:5000)
|
| 88 |
|
| 89 |
## ๐ค Hugging Face Deployment
|