Skip to content
Data Science · Finance · Anti-money laundering

Phantom AI

Graph neural networks to find money laundering that traditional rules miss. A proof of concept on synthetic data.

https://fraude-bancario-2026.vercel.app1/4
Phantom AI — red (screenshot 1 of 4)
0.943

GraphSAGE PR-AUC, versus 0.882 for XGBoost

90%

Of fraud detected with 9 in 10 alerts real

13% vs 21%

Undetected fraud: graph versus best tabular model

Context

Banks' anti-money-laundering systems run on rules: amounts, frequencies, thresholds. They work for the isolated transaction, but modern laundering is designed to dodge them, splitting large sums into small movements across accounts that each look normal on their own.

The Challenge

Detect the pattern in the network rather than in the transaction: cycles, structuring, fund aggregation, flow-through accounts, shell companies, reactivated dormant accounts, mule networks and round-tripping — in a way a compliance officer can use and explain to a regulator.

My Role

Personal project end to end: synthetic data generator, exploratory graph analysis, tabular and graph models, explainability, calibration, source tracing, the FastAPI backend and the Next.js compliance application.

Approach

A simulated bank with 75,000 accounts and 11.2 million synthetic transactions covering eight FATF-aligned laundering typologies. On that graph I compared logistic regression, XGBoost, Node2Vec, GAT and GraphSAGE on the same metrics. The best model was calibrated, explained account by account with GNNExplainer, and complemented with backward tracing that follows the money to its source.

Stack — why each technology

PyTorch GeometricGraphSAGE and GAT learn from each account and its neighbours at once: the laundering signal lives in the connections
XGBoost + logistic regressionTabular baselines to measure how much the graph really adds
GNNExplainerFor each alert, which connections and variables triggered it: what an officer needs to justify a report
Isotonic calibrationTurns the score into a reliable probability to rank the case queue
FastAPI on RenderA public API with interactive documentation, to plug the scoring into other systems
Next.jsThe compliance app: alerts, cases with report deadlines, KYC, screening, network investigation and model governance

Key Decisions

Synthetic data, and say so everywhere

There's no public laundering data with reliable labels. I built a reproducible generator with the eight FATF typologies and state it in the app, the README and here: it's a proof of concept, not a model validated on a real bank's data.

Measure what the graph adds, don't assume it

Before using graph neural networks I compared them with tabular models on the same metrics. GraphSAGE reaches 0.943 PR-AUC versus 0.882 for XGBoost, and lets 13% of fraud slip through versus 21%: the graph helps, by a concrete margin.

An ablation to understand where the signal comes from

Node2Vec learns only from the shape of the network, without each account's behaviour, and drops to 0.235. The signal isn't pure topology: it takes structure plus behaviour, which is exactly what GraphSAGE combines.

Calibrate before prioritising

51% of the raw scores were saturated at 1.0, and the thousand riskiest accounts shared only four distinct values: the case queue couldn't be ranked. Isotonic calibration cut the calibration error from 0.043 to 0.003.

Results

GraphSAGE detects 90% of fraud while requiring 9 in 10 alerts to be real, with a PR-AUC of 0.943. Mule accounts look normal from a credit standpoint and give themselves away through their connections: a fraudulent account's neighbour is 2.9 times more likely to be fraudulent too. Backward tracing found 149 source accounts, 98 of them invisible to the main model.

What I Learned

A good score isn't enough: it has to be rankable, explainable and defensible before a regulator. And in fraud, the hardest part isn't finding the mule but whoever uses it — something a node classifier misses without a second look at the network.

A project like this for your organization?

Tell me the problem and we'll work out how to solve it with data.

Let's talk

Next case

Atlas Analytics →

View case