Skip to content
All case studies
FinanceLive2025

Real-time fraud detection for European cardholders

An end-to-end fraud-detection system that scores card transactions for fraud risk in real time — integrating machine learning, cloud deployment and a live web interface for analysts.

Real-time
Per-transaction fraud scoring
SMOTE
Handles severe class imbalance
Live
Deployed web application

The problem

Financial fraud is a persistent, high-cost problem in banking, and fraud signals are rare and highly imbalanced. The challenge was to score transactions for fraud instantly while keeping the system explainable and usable by non-technical analysts.

Approach

I built a Random Forest model with SMOTE to handle the extreme class imbalance typical of fraud data, then wrapped it in an interface that returns an instant fraud probability for each transaction and tracks history for analysis.

  • Random Forest classifier with SMOTE balancing
  • Instant fraud-probability scoring per transaction
  • Transaction history tracking with CSV export

Architecture

A FastAPI service exposes the model, while a Streamlit application provides the analyst-facing interface. The design separates the scoring API from the UI so each can scale and evolve independently.

  • FastAPI scoring service
  • Streamlit analyst interface
  • CSV export for downstream analysis

Deployment

The API was deployed serverless on AWS Lambda and on Render, with the Streamlit interface served from an AWS EC2 instance behind Nginx — demonstrating a full cloud path from model to usable product.

  • FastAPI on AWS Lambda + Render
  • Streamlit UI on AWS EC2 behind Nginx

Business value

The system shows how machine learning, MLOps and cloud deployment combine into a scalable, efficient fraud-screening tool — giving analysts instant, exportable risk signals rather than a static model.

Lessons learned

01

For rare-event problems like fraud, the modelling choice is inseparable from how you handle imbalance.

02

A thin, well-separated UI over a scoring API makes ML genuinely usable by business teams.

03

Deploying across Lambda, EC2 and Render proved the pipeline is portable across cloud targets.

Have an AI system that needs to reach production?

Let's talk about the problem you're trying to solve — and whether AI is the right tool for it. No buzzwords, just an honest technical read.