Final Year Project • Sep 2020 • 16★ / 16 forks

Credit Card Fraud Detection

Python • Scikit-learn • SMOTE • Flask • Docker • Heroku

ML-based fraud system with REST APIs, built for extreme imbalance. github.com/saarques/credit-card-fraud-detection →

PythonScikit-learnSMOTEFlaskDocker
Fraud detection — Transaction → Flask → SMOTE → 97.6% → Docker
Transaction (0.17% fraud) → Flask → SMOTE balanced → 97.6% / 89.6% → Docker/Heroku — Click to enlarge →
PROBLEM

Fraud is ~0.17% of transactions. Naive classifiers learn to predict “not fraud” and score 99% accuracy while missing the cases that matter. Need recall without drowning in false positives, plus a service that other systems can call.

APPROACH
  • Handled imbalance with SMOTE + balanced class weights + dimensionality reduction — not just undersampling.
  • Logistic Regression with tuned threshold → 97.6% accuracy, 89.6% recall — optimized for recall/precision tradeoff.
  • Flask REST with validation/error handling, rate limiting, query optimization, caching.
  • Containerized with Docker, deployed on Heroku with structured logging/monitoring.
Flow: Transaction → Flask (validate) → Model (predict) → Response + log → Dashboard. CI via Git, deploy via Heroku.
RESULT

97.6% accuracy, 89.6% recall — useful, not just accurate.

16 stars / 16 forks, reproducible via Docker. Lessons directly applied to BNY anomaly detection thinking.

Stack & links
Python, Scikit-learn, Flask, REST, Docker, Heroku
GitHub → • Docker →