Logo Lanfrica

petero33/Mpesa_Fraud_Shield

Domaine:

digital infrastructure

Type de record:

software
Créateur:
pet
Hôte:
Real-time M-Pesa fraud detection web app using Flask, MySQL, and machine learning to score transaction risk and flag suspicious activity. # 🛡️ MPESA Fraud Shield A real-time machine learning-powered fraud detection system for M-Pesa transactions in Kenya. Built with Flask backend, vanilla JavaScript frontend, and MySQL database. ## GitHub Repo Description Real-time M-Pesa fraud detection web app using Flask, MySQL, and machine learning to score transaction risk and flag suspicious activity. ## About This Project MPESA Fraud Shield is an end-to-end fraud detection platform built for M-Pesa transaction monitoring. It combines a trained machine learning model, a Flask API, and a web dashboard to help users assess transaction risk in real time. The system captures transaction details, predicts fraud probability, stores outcomes in MySQL, and provides analytics through dashboard metrics, history views, and alert feeds. It is designed as a practical student project that demonstrates applied machine learning, backend API development, and data-driven decision support in a financial use case. ## 📋 Overview **Architecture:** - **Frontend**: HTML/CSS/JavaScript (Single-Page Application) - **Backend**: Flask REST API (Python) - **Database**: MySQL - **ML Model**: Pre-trained fraud model (`fraud_model.pkl`) with retraining support for KNN, Logistic Regression, and Linear Regression **User Flow:** 1. User enters transaction details → 2. Frontend sends data to Flask API → 3. Model makes prediction → 4. System returns risk score (0-100%) → 5. Dashboard displays outcome ## 🎯 Features ### 1. **Dashboard** 📊 - Total transactions count - Fraud count - Transactions flagged today - Fraud rate percentage - Average fraud risk score visualization ### 2. **Live Transaction Checker** 🔍 - Enter transaction details: - Amount (KES) - Sender/Receiver balances - Transaction type (peer, till, paybill, airtime) - Hour of transaction - Month and day of week - Device type - Region - Instant fraud risk prediction (0-100%) - Visual result (Safe ✅ or Suspicious ⚠️) ### …

Languages