kashishcrafts/Fraud-Detection-Intelligence-Platform
GitHub: kashishcrafts/Fraud-Detection-Intelligence-Platform
一个基于随机森林模型和 FastAPI 构建的机器学习欺诈检测平台,支持实时与批量金融交易风险预测,并配有可视化仪表板。
Stars: 0 | Forks: 0
# 🛡️ 欺诈检测智能平台
一个使用 FastAPI、Streamlit、PostgreSQL、Docker 和机器学习构建的 AI 驱动的欺诈检测智能平台。
该平台使用训练有素的 Random Forest 模型检测潜在的欺诈性金融交易,并提供交互式分析仪表板、JWT 身份验证、预测历史跟踪和欺诈概率评分。
该应用程序支持实时和批量欺诈检测,同时维护安全的用户身份验证和预测历史管理。
## 🚀 功能
* 使用 Random Forest Classifier 进行欺诈检测
* FastAPI REST API
* 批量预测 API
* 预测历史跟踪
* PostgreSQL 数据库集成
* 交互式 Streamlit 仪表板
* CSV 上传与分析
* 欺诈与真实交易可视化
* Docker 多容器部署
## 🏗️ 架构

## 安装说明
### 克隆仓库
```
git clone https://github.com/kashishcrafts/Fraud-Detection-Intelligence-Platform.git
cd Fraud-Detection-Intelligence-Platform
```
### 创建虚拟环境
```
python -m venv venv
```
### 激活虚拟环境
Windows:
```
venv\Scripts\activate
```
### 安装依赖
```
pip install -r requirements.txt
```
## Docker 设置
### 构建容器
```
docker compose up --build -d
```
### 查看正在运行的容器
```
docker ps
```
### 停止容器
```
docker compose down
```
### 访问服务
FastAPI
```
http://localhost:8000
```
Swagger 文档:
```
http://localhost:8000/docs
```
Streamlit 仪表板:
```
http://localhost:8501
```
## API 端点
GET /
GET /health
POST /register
POST /login
POST /predict
POST /predict-batch
GET /predictions
## 截图
### 登录页面

### 仪表板

### 预测历史

### ROC 曲线

## 📊 仪表板功能
* 上传交易数据集
* 检测欺诈交易
* 查看欺诈统计数据
* 交互式图表
* 下载预测结果
* 预测历史
## 🛠️ 技术栈
* Python
* Scikit-Learn
* FastAPI
* Streamlit
* PostgreSQL
* SQLAlchemy
* Docker
* Docker Compose
## 📂 项目结构
```
Fraud-Detection-Intelligence-Platform/
│
├── backend/
├── database/
├── models/
├── docs/
├── screenshots/
├── app.py
├── Dockerfile
├── Dockerfile.streamlit
├── docker-compose.yml
├── requirements.txt
└── README.md
```
## ⚙️ 使用 Docker 运行
```
docker compose up --build
```
### 服务
* Streamlit 仪表板 → http://localhost:8501
* FastAPI 后端 → http://localhost:8000
* Swagger 文档 → http://localhost:8000/docs
* PostgreSQL → 端口 5432
## 🔮 未来增强功能
* 实时欺诈检测
* Kafka 流处理 pipeline
* 云部署
* 高级 ML 模型
* 监控与日志记录
## 👩💻 作者
Kashish Shaikh
计算机工程学生 | AI/ML | 数据工程 | 网络安全
标签:Apex, AV绕过, FastAPI, Kubernetes, PostgreSQL, Streamlit, 反欺诈检测, 机器学习, 测试用例, 版权保护, 访问控制, 请求拦截, 逆向工具