← all repositories
curiousily/Credit-Card-Fraud-Detection-using-Autoencoders-in-Keras

Fraud detection by teaching a network to forget fraud exists

An old-school Keras notebook that detects credit card fraud by training autoencoders only on normal transactions, then punishing anything that looks weird.

587 stars Jupyter Notebook ML FrameworksDomain Apps
Credit-Card-Fraud-Detection-using-Autoencoders-in-Keras
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

This repo is a single iPython notebook plus a pre-trained model that walks through building a deep autoencoder in Keras for anomaly detection. The trick: train the autoencoder only on legitimate transactions, so it learns to reconstruct “normal” well and chokes on fraud. The reconstruction error becomes your fraud score.

The interesting bit

The approach sidesteps the classic imbalanced-class headache by simply refusing to learn from the minority class at all. It’s a neat hack that turns a generative model into a one-class classifier without touching the fraud labels during training.

Key highlights

  • Pre-trained model included; you can run it without training from scratch
  • Full blog post walkthrough linked for the theory behind it
  • Uses standard deep autoencoder architecture in Keras/TensorFlow
  • Demonstrates anomaly detection as reconstruction error thresholding
  • Stars: 587, suggesting it resonated as a teaching example

Caveats

  • Code targets TensorFlow 1.1 and Keras 2.0.4 — ancient versions by deep learning standards
  • README is minimal; you’ll need the blog post for actual explanation
  • No mention of performance metrics, dataset size, or how well it actually works in practice

Verdict

Good for someone who wants to see the autoencoder-as-detector pattern in clean, dated code. Skip it if you need production-ready fraud detection or modern TensorFlow; the value is pedagogical, not practical.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.