Machine-learning fraud detection has a blind spot built into how it works: it scores one row at a time. That's exactly right for the lone fraudster, whose payments are huge, at 3am, from abroad. It's useless against a fraud ring: five accounts that each spend like a normal customer, but share one phone and a couple of stolen card numbers.
The ring doesn't live in any row. It lives in the connections between rows. Here's a worked example, with real numbers from a demo you can run yourself.
The setup: 40 ordinary accounts, one lone fraudster, one hidden ring
- 123 transactions. Every account makes three ordinary payments ($20–$199, daytime, domestic).
- One lone fraudster. Account
ACC-33also makes three large 3am cross-border payments. - One ring. Accounts
ACC-11toACC-15behave exactly like everyone else, but they're linked: they share two devices and two card numbers in a chain. - One confirmed chargeback, on
ACC-13.
No fraud labels anywhere.
Step 1: the machine learning view (it works, partly)
Train an isolation forest, an unsupervised anomaly model, on amount, hour and cross-border flag, then score every transaction:
SELECT tx_id, account_id, amount,
ANOMALY_SCORE('recipe_ring_model', amount, hour_of_day, cross_border) AS score
FROM recipe_ring_tx
ORDER BY score DESC
LIMIT 10;
The result is what the model is good at: ACC-33's three 3am payments come out on top at ~0.82. Then the scores drop off a cliff. Every one of the 15 ring payments lands between 0.45 and 0.51, the same band as honest customers.
The model did its job. It just can't see the ring, because the ring was designed to look normal one row at a time.
Step 2: the graph view (one hop at a time)
Model the same data as a graph: accounts, devices and cards as nodes, and "used" relationships between them. Then start from the one thing you know for sure, the chargeback on ACC-13, and walk outward:
MATCH p = (s:Account {id: 'ACC-13'})-[*2..4]-(x:Account)
WHERE x.id <> 'ACC-13'
RETURN x.id AS linked_account, [n IN nodes(p) | n.id] AS via
ORDER BY length(p);
In under a millisecond it returns ACC-12 and ACC-14 (shared card and device), then ACC-11 and ACC-15 one step further out, each with the exact path that links it. A household pair that shares one device but nothing with the ring is correctly left out.
One seed, the whole ring: four accounts the model rated normal.