Kent0625/Intelligent_Mobile_Wallet_Fraud_Detection_System
0
Intelligent Mobile Wallet Fraud Detection System
A real-time fraud detection pipeline combining Machine Learning with Generative AI forensics for automated transaction analysis.
Overview
This system processes mobile money transactions to detect fraudulent activity in real-time. It uses a supervised learning model to flag suspicious transactions and a Large Language Model (LLM) to provide an explainable forensic report for analysts.
Key Features
- Real-time Inference: Low-latency detection using a specialized Random Forest model.
- Generative AI Forensics: Automated narrative analysis of fraud using Hugging Face's Inference API (Qwen 2.5).
- Explainable AI (XAI): SHAP (SHapley Additive exPlanations) values visualize specific feature contributions for every decision.
- Production Pipeline: Robust stateful preprocessing using
OneHotEncoderandStandardScalerto handle live data streams.
Technical Architecture
- Model: Random Forest Classifier (Scikit-learn) trained on the PaySim dataset.
- LLM Integration:
huggingface_hubInferenceClient (Qwen/Qwen2.5-7B-Instruct). - Frontend: Streamlit for live monitoring and alert visualization.
- Evaluation: Optimized for AUPRC (Area Under Precision-Recall Curve) on highly imbalanced data (1:1000).
Quick Start
1. Installation
git clone https://github.com/Kent0625/Intelligent-Mobile-Wallet-Fraud-Detection-System-Real-time-Detection-Generative-AI-Forensics.git
cd Intelligent-Mobile-Wallet-Fraud-Detection-System-Real-time-Detection-Generative-AI-Forensics
pip install -r requirements.txt2. Configuration
Create a .env file with your Hugging Face token (required for AI analysis):
HF_TOKEN=your_token_here3. Run Application
streamlit run src/dashboard.pyProject Structure
src/: Source code for data pipelines, feature engineering, and the dashboard.models/: Serialized model artifacts (.pkl).tests/: Unit tests for schema validation and pipeline integrity.
