GitHunt
ZO

ZohaibHassan16/FraudGuard

A real-time fraud detection pipeline using an Autoencoder to monitor and flag anomalies in streaming financial transaction data.

Real-Time Fraud Detection (Autoencoder)

This project uses an Autoencoder neural network to detect fraudulent mobile money transactions in real-time. It includes a web-based dashboard that simulates a live security monitor.

Demo

The dashboard visualizes the reconstruction error (MSE). Normal transactions (blue) have low error, while fraud (red spikes) exceeds the threshold.
Screenshot 2025-12-29 214211

Concept

The model is an anomaly detector trained only on normal transactions.

  1. Normal Input: The model reconstructs it well (Low MSE).
  2. Fraud Input: The model cannot reconstruct it (High MSE).
  3. Threshold: If MSE > 95th percentile of normal data, the transaction is flagged.

Dataset

  • Source: PaySim (Mobile Money Simulation) on Kaggle.
  • Filtering: Used only TRANSFER and CASHOUT types.
  • Preprocessing: Log transformation and Standard Scaling applied to amounts and balances.

Tech Stack

  • ML: TensorFlow/Keras, Scikit-learn
  • Backend: FastAPI, Uvicorn
  • Visualization: Chart.js (Frontend), Matplotlib
  • Tunneling: Pyngrok (to expose the local server)

How to Run

  1. Open RT_FraudDetection.ipynb in Google Colab or Jupyter.
  2. Upload the CSV you downloaded from Kaggle.
  3. Run the cells to train the Autoencoder.
  4. The final cell launches the server and generates a public URL (e.g., ngrok-free.dev).
  5. Click the link to view the live simulation.

Languages

Jupyter Notebook100.0%

Contributors

Created December 29, 2025
Updated December 29, 2025