← All work

Fraud detection across 35 financial institutions

Canvia · Data Scientist · Dec 2023 – Dec 2024 · 1 min read

35 institutions~2% flagged, real time

Isolation Forest · anomaly detection · Python

Problem
Spot fraud in real-time transfers between 35 Peruvian financial institutions, with no fraud labels to learn from.
My role
I took over an MVP that flagged about 9% of transactions, redesigned the features and the Isolation Forest model, and served it through an on-premise FastAPI service.
Result
Flags brought in line with the client's ~2% review threshold, in real time.

What it watched

Interbank transfers between 35 of Peru's leading financial institutions, in real time. The feature engineering encoded what fraud tends to look like: account age, deviation from a person's normal transfer amounts, transfers between someone's own accounts across different banks, activity at unusual hours, unusual bank-to-bank combinations. The model then decided what was anomalous in that feature space.

Why Isolation Forest

The client could not provide fraud labels, which rules out supervised learning, so the model is unsupervised anomaly detection. The first MVP flagged around 9% of transactions, far more than the analysts could review. I redesigned the features and the model and brought flags down to the client's ~2% operating threshold. Once confirmed cases accumulate, a semi-supervised model trained on them is the natural next step.

Interbank transfer 35 institutions, live Features account age vs. usual amounts own accounts, other banks unusual hours unusual bank pairs Isolation Forest no fraud labels anomaly score Top ~2% to human review The other ~98% pass through served by a FastAPI service, on-premise, no cloud Share of transfers flagged first MVP, ~9%: more than review capacity redesign, ~2%: the client's threshold
What the model sees and where its output goes: flags sized to the client's ~2% review capacity.

What real time required

A fast, concurrent API (FastAPI), hosted on-premise with no cloud services allowed, which meant working hand in hand with the infrastructure team on latency and concurrency budgets.

What comes next

The client's analysts worked the alerts downstream. The next layer is a precision-recall view built from their confirmed cases, so the threshold can move from review capacity to the cost of a missed fraud.

More case studies