# FraudX Analyst: A Credit Card Fraud Detection Mobile App Integrating Machine Learning, SHAP Explainability, and RAG Chatbot

> An end-to-end fraud detection system that integrates three machine learning models, SHAP feature importance visualization, Google Gemini AI explanations, and a RAG chatbot based on Pinecone vector database, presented as a Flutter mobile app.

- 板块: [Openclaw Geo](https://www.zingnex.cn/en/forum/board/openclaw-geo)
- 发布时间: 2026-06-07T14:15:26.000Z
- 最近活动: 2026-06-07T14:23:43.333Z
- 热度: 154.9
- 关键词: 信用卡欺诈检测, 机器学习, SHAP可解释性, Flutter, XGBoost, LightGBM, RAG, Google Gemini, Pinecone, FastAPI
- 页面链接: https://www.zingnex.cn/en/forum/thread/fraudx-analyst-shaprag
- Canonical: https://www.zingnex.cn/forum/thread/fraudx-analyst-shaprag
- Markdown 来源: floors_fallback

---

## FraudX Analyst: Overview of Credit Card Fraud Detection Mobile App

FraudX Analyst is a Flutter-based mobile app for credit card fraud detection, integrating triple machine learning models (XGBoost, LightGBM, Autoencoder), SHAP explainability, and a RAG chatbot (Google Gemini + Pinecone). Key features include auto-selection of optimal models via F1 score, SHAP feature importance visualization, 16-step interactive tutorial, and smart model upgrade. It is a graduation project from the University of Sarawak Malaysia (UNIMAS), aiming to provide a transparent and user-friendly fraud detection experience.

## Project Background & Dataset Information

**Author & Source**: Avinaash A/L Loganathan, GitHub repo [fraudX-analyst](https://github.com/Avinaash2002/fraudX-analyst), published in June 2026 as a UNIMAS graduation project.

**Dataset**: Based on Kaggle's credit card fraud dataset (284,807 transactions, 0.17% fraud rate, 28 PCA features + time/amount, 2013 European cardholder data).

## Core Technologies & Implementation Methods

**Core Technologies**: 
- **ML Models**: XGBoost (excellent fraud detection), LightGBM (fast training), Autoencoder (unsupervised anomaly detection; auto-select best via F1 score).
- **SHAP Explainability**: Tree/KernelExplainer generates visualizations (red bars: fraud-pushing features, green bars: normal-pushing features) with feature explanations (e.g., V14 = historical fraud correlation).
- **RAG Chatbot**: Google Gemini 2.5 Flash + Pinecone (2048D embeddings) with 6-message context, answering fraud detection queries.
- **Tech Stack**: Frontend (Flutter 3.29), Backend (FastAPI), DB (Supabase), Deployment (Docker/Render), Hyperopt (Optuna).

## Model Performance & Evidence

**Model Performance Metrics**: 
| Model | Accuracy | Precision | Recall | F1 Score | AUC-ROC |
|-------|----------|-----------|--------|----------|---------|
| XGBoost | 99.95% |87.14%|82.43%|84.72%|0.9787|
| LightGBM |99.95%|88.24%|81.08%|84.51%|0.9722|
| Autoencoder |99.81%|44.30%|47.30%|45.75%|0.9490|

**Analysis**: XGBoost/LightGBM balance precision/recall well; Autoencoder suits unsupervised scenarios.

## Key Functional Modules

**Key Modules**: 
1. **Real-time Stats**: Displays safe/fraud counts, model accuracy, AUC-ROC; allows viewing recent transactions.
2. **Simulation**: Loads test data, validates input, selects models (auto/manual), shows SHAP + AI explanations.
3. **Training**: Built-in dataset, custom CSV upload, Optuna tuning (10 trials/model), smart upgrade (only if new F1 > existing), PDF report export.
4. **Model Comparison**: Side-by-side bar charts for metrics, best model badge, PDF report.
5. **Chatbot**: Explains simulation results and fraud detection knowledge.
6. **16-step Tutorial**: Interactive, visual hints, one-time display.

## Deployment & Local Usage Guide

**Deployment**: Backend deployed on Render: [Online URL](https://fraudx-analyst.onrender.com), [API Docs](https://fraudx-analyst.onrender.com/docs) (note: free tier sleeps after 15min inactivity, 30s wakeup).

**Local Usage**: 
- **Backend**: Create venv → install reqs → copy .env → upload knowledge → run `uvicorn app.main:app --reload`.
- **Frontend**: `flutter pub get` → update API URL → `flutter run` or build APK.

## Project Value & Insights

**Project Value**: 
- Demonstrates a complete AI app pipeline (development → deployment).
- Highlights explainable AI (SHAP) to build user trust.
- Shows multi-model strategy and RAG chatbot for enhanced usability.
- UX design (16-step tutorial) lowers entry barrier.

**Insights**: Provides a reference for developers building AI-driven mobile apps, emphasizing practical integration of ML, explainability, and generative AI.
