Skip to content
All projects
PRJ-003/ DataResearch

Graph-Based Fraud Detection

A fraud detection prototype that stores accounts, customers and transfers in Neo4j and looks for suspicious shapes instead of suspicious amounts. Circular transfer loops, one identity quietly controlling many accounts, and rapid high-value movement inside a small cluster are all structural patterns — invisible when transactions are scored one at a time.

Pipeline

  1. Accounts & customers
  2. Transaction edges
  3. Graph traversal
  4. Structural patterns
  5. Investigation views
01

Problem

A transfer of ten thousand between two accounts is unremarkable. Five of them arranged in a ring that returns the money to where it started is money laundering. The signal is not in any single row — it is in how the rows connect, which is exactly what a relational schema makes expensive to ask about.

02

Approach

Accounts and customers become nodes, transfers and ownership become relationships, and the fraud questions become traversals. Cypher expresses 'find a cycle of transfers returning to its origin' or 'find one customer owning an unusual number of accounts' directly, in a way that does not degrade as the pattern gets deeper.

The dataset is synthetic and seeded with deliberately planted structures — normal banking activity, laundering loops, identity-fraud ownership rings and high-frequency high-value clusters — so a detection query can be checked against a known answer.

03

Implementation notes

  • FastAPI service wrapping the Neo4j driver, exposing transaction, account and detection endpoints.
  • React and Vite frontend with separate views for accounts, transactions, entity relations and circular-transfer detection.
  • Graph seeding is scripted in Cypher, so the whole dataset — including the fraud patterns — is reproducible from scratch.
04

Observations

The detection here is structural rather than statistical: it finds shapes it was asked to look for, and makes no claim to catch patterns nobody wrote a query for. That limit is the interesting part — it is what pushed me toward learned anomaly detection in later work.