Skip to content

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

Notifications You must be signed in to change notification settings

ZohaibHassan16/FraudGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published