Skip to main content

I Built a Real-Time Money-Mule Detector on IBM LinuxONE in a Weekend

Network features took PR-AUC from 0.064 to 0.525, and the Telum II accelerator lost to the CPU

Updated 13 min readMarkdown
I Built a Real-Time Money-Mule Detector on IBM LinuxONE in a Weekend

I spent the IBM Z Datathon 2026 weekend building TrustPulse AI, a real-time risk engine for instant payments, on an IBM LinuxONE VM. It scores each payment as it arrives and returns one of three decisions, each with a reason a bank analyst can read. This post covers what I built, what the numbers looked like, and the one result I did not expect: the on-chip AI accelerator lost to the CPU for my model.

Links: GitHub repo · 3-minute demo video

TrustPulse live console running on the LinuxONE VM

The problem: money mules hide in plain sight

I picked Theme 1, Real-Time AI for Critical Decisions, and aimed it at instant-payment mule networks.

A mule account rarely does anything odd in a single transfer. The amounts are normal and the channels are normal. What gives it away is how accounts behave together. Money lands in an account and leaves again within hours. One account suddenly collects from many new senders. A chain of first-time counterparties forms. With instant payments, by the time the last transfer clears, the money is gone.

So the goal was to score every payment before the money moves, using what is already known about both accounts and the links between them. Each payment gets one of three decisions:

  • APPROVE: let it through.
  • VERIFY: add friction, such as confirmation of payee or step-up authentication.
  • REVIEW: hold it for an analyst.

The platform

Everything ran on an IBM LinuxONE Community Cloud VM: Ubuntu 24.04 on s390x, 3 vCPUs, 8 GB RAM. The host is an IBM z17 (machine type 9175) with the Telum II processor.

The first lesson came within the first hour. Pip has no s390x wheels for SciPy or scikit-learn, and building them from source needs a Fortran compiler and a lot of time. Ubuntu's own packages solved it:

sudo apt install -y python3-venv python3-dev build-essential tmux \
    python3-numpy python3-pandas python3-scipy python3-sklearn python3-matplotlib
python3 -m venv --system-site-packages ~/tp

The --system-site-packages flag lets the venv use the native builds while pip handles everything else. XGBoost was out for the same reason: no s390x wheel on PyPI.

Choosing data that has a network in it

I started with PaySim, the popular synthetic mobile-money dataset. Two things made it a poor fit for the main result:

  1. Its balance columns leak the label. PaySim cancels fraudulent transactions, so the balance fields tell the model which rows are fraud. I dropped them.
  2. It has almost no network. 99.85% of PaySim senders appear only once, so there are no account relationships to learn from.

PaySim stayed as a per-transaction baseline. The main evaluation moved to IBM's Transactions for Anti-Money Laundering, HI-Small dataset: 5,078,345 transactions across 515,088 accounts, with labelled laundering patterns such as fan-in, fan-out, cycles and scatter-gather.

I used a strict time split: train on 1–6 Sep, validate on 7–8 Sep, test on 9–10 Sep 2022. The laundering rate is about 0.1% in all three. I also dropped rows after 10 Sep, because they are almost entirely the tails of laundering patterns (over 60% laundering) and do not look like real traffic.

Features without leakage

Every transaction becomes two events: an outgoing event for the sender and an incoming event for the receiver. Running totals exclude the current event, so each row only sees activity that happened strictly before it. That matters because a real-time system never knows the future.

Per account, the features include:

  • counts and amounts in and out
  • distinct counterparties
  • pass-through ratio (money out compared with money in)
  • account age and time since last activity
  • whether this sender and receiver have transacted before

On top of that sits a scikit-learn HistGradientBoostingClassifier. The alert thresholds are fixed on the validation days and then frozen before the test days are touched.

Results

The network features did most of the work. Same model, same alert budget (about 0.6% of transactions flagged):

Features PR-AUC ROC-AUC Recall Precision
Transaction only (amount, channel, currency, hour) 0.064 0.910 0.354 0.073
Transaction + network 0.525 0.958 0.719 0.129

PR-AUC went from 0.064 to 0.525. With a 0.1% positive rate, PR-AUC is the number that matters, and the jump is the whole argument for network-aware scoring.

Feature ablation

I also checked for a dataset shortcut. About 87% of laundering in HI-Small uses ACH, so a model could cheat by learning "ACH is suspicious". With channel and currency removed, recall held at 0.714 and PR-AUC stayed at 0.469. The network signal is real. Channel mostly adds precision.

For comparison with published work, the best F1 on the laundering class over the test days is 0.54. That is an upper bound, because the threshold for it is picked on test. Egressy et al. (AAAI 2024) report 0.57–0.68 for offline graph neural networks on HI-Small. TrustPulse lands close to that range with simple one-hop features that update one payment at a time.

What the decision bands look like

Validation quantiles set the bands: the top 0.5% of scores go to REVIEW, and scores between the top 0.5% and the top 2% go to VERIFY.

Decision Transactions Laundering Laundering rate
APPROVE 840,848 198 0.02%
VERIFY 16,609 71 0.43%
REVIEW 5,335 687 12.9%

REVIEW and VERIFY together catch 79% of laundering transactions while touching 2.5% of traffic. In the REVIEW queue, roughly one in eight payments is laundering, against one in a thousand overall.

Decision bands

Lead time and hard negatives

Catching a pattern after the last transfer is not much use, so I measured how early patterns get flagged. Of 79 laundering patterns that start inside the test window, 96% raise at least one alert, and 58% are flagged before their final transfer. The median lead is one transaction, about 4.7 hours. Patterns that run past the test window are cut off, so these numbers are a lower bound.

Lead time

The other worry with network features is that busy legitimate accounts look like mules. I picked 4,037 high-volume receiving accounts with no laundering involvement in training, as stand-ins for merchants and payroll accounts. Their false-alert rate was 0.60%, against 0.54% for all legitimate traffic. Busy accounts are not being over-flagged.

Reasons that come from the model

Every VERIFY and REVIEW decision comes with a reason. For each alert, the engine resets one feature group at a time to its typical value and measures how far the score drops. The three groups with the biggest drop become the reason text. Because the explanation is computed from the model's own scores, it cannot drift away from what the model actually did, which is a real risk with a separate set of hand-written rules.

From notebook to real-time engine

A notebook that scores five million rows in batch does not prove anything about real time. So I wrote trustpulse/engine.py, which works the way a bank would need it to: one payment in, one decision out.

  • Streaming state. The engine keeps a running profile per account and a count per sender-receiver pair. Each payment reads the profiles, gets a decision, and then updates them.
  • Portable model. The 300 trained trees are exported to flat arrays in JSON. The engine walks all trees at once with a few NumPy operations. Serving needs Python and NumPy only: no pandas, no scikit-learn, no compiler. On s390x, where the pip story is painful, that keeps deployment simple.
  • Parity check. I streamed 20,000 test payments through the engine one at a time and compared them with the batch notebook. The largest relative feature difference was 4.4e-14, and the decisions matched the batch pipeline in 100% of cases.

The speed on the LinuxONE VM:

Measurement Result
One payment end to end, p50 0.256 ms
One payment end to end, p99 0.395 ms
Throughput, one payment at a time 3,456 payments/s
scikit-learn predict_proba on one payment, same VM 2.78 ms

The exported scorer is about 11 times faster per payment than calling scikit-learn directly, mostly because it skips scikit-learn's per-call overhead.

On top of the engine sits a small Flask console. It replays the held-out test days in arrival order and shows decisions, latency, throughput, alerts with reasons, and how early each laundering pattern was caught. Ground truth is drawn as an overlay only and never reaches the engine. The same process exposes a REST endpoint:

curl -s localhost:8050/api/score -H 'Content-Type: application/json' \
     -d '{"src": 1057, "dst": 653, "amount": 942, "currency": "US Dollar", "format": "ACH"}'

The engine and console also run as an s390x Podman container. The engine state is mounted read-only, so the image itself holds no account data, and the container runs as a non-root user.

The Telum II result I did not expect

The z17's Telum II chip has an on-chip AI accelerator, the NNPA. The VM could see it: nnpa shows up in the CPU flags, and IBM's zDNN library reports it as installed. IBM Snap ML can run tree-ensemble inference on it through zDNN, so I trained a Snap ML boosting model on the same features and scored the test days both ways.

Snap ML inference CPU (compress_trees) Telum II NNPA (zdnn_tensors)
All 862,792 test payments 1.48 s 9.91 s
Batch of 10,000 18.0 ms 93.5 ms
One payment 0.020 ms 0.045 ms

The accelerator path was real. When I hid the zDNN library, Snap ML refused to use zdnn_tensors at all. Scores were identical on both paths. It was just slower.

One benchmark can mislead, so I ran a sweep: batch sizes from 1 to 862,792, one to three threads, and three model sizes. Across all 36 configurations, the CPU path won every time. The closest the NNPA got was 0.85 times CPU speed, with 50 shallow trees and one payment per call.

CPU vs Telum II across batch sizes and threads

So the live engine stays on the CPU, and the pitch says exactly that. IBM's own prerequisite labs, which I ran on the same VM, show the NNPA speeding up dense and LSTM layers. My model is a tree ensemble on a 3-vCPU guest, which is a different workload. The next thing to try would be a neural scorer compiled with the IBM Z Deep Learning Compiler, or a newer zDNN release.

It was tempting to write "accelerated on Telum II" in the deck. I am glad I measured it first.

Encrypting the engine state with CPACF

Every IBM Z core has CPACF, a built-in crypto unit, and OpenSSL uses it for AES-GCM. The engine's account-state snapshot and exported model are encrypted at rest with AES-256-GCM. On the VM, the 14.8 MB state snapshot encrypts in 15 ms (about 1 GB/s) and decrypts back to identical bytes. openssl speed reached 14.9 GB/s on one core at 16 KB blocks. Protecting the state the engine restarts from costs well under a second.

What did not work

I tried risk propagation: a flagged transaction leaves decaying risk on both accounts, and later payments that touch those accounts inherit some of it. I compared fourteen settings on the validation days, with attenuation from 0.2 to 0.95 and half-lives from 6 to 48 hours. None beat the plain network model, so propagation is switched off. The structural features already carry the linked-account signal, and propagation mostly added false alerts.

Surviving the VM

An 8 GB VM and a 5-million-row feature build do not get along. I hit OOM kills, a kernel crash and plenty of dropped SSH sessions. What kept the build alive:

  • 4 GB of swap. The feature build peaks at about 3 GB, and the notebook kernel competes with everything else.
  • tmux for everything. JupyterLab and the console both ran inside tmux, so a dropped SSH connection did not take the work with it.
  • SSH tunnels instead of public ports. ssh -L 8888:localhost:8888 -L 8050:localhost:8050 gave me JupyterLab and the console in my local browser.
  • Shutting down kernels before starting the console, to free RAM.

Limitations

  • Both datasets are synthetic. The results show the method works on realistic simulated behaviour, not on a bank's live traffic.
  • Lead time is measured on a two-day test window, so long patterns are cut short.
  • The model leans on payment channel for precision. The ablation above puts a number on how much.

How it went

I submitted TrustPulse AI on Hack2Skill on 18 October under the team name Project HailMary. It did not place when results came out on 4 November. Even so, it is the most complete system I have built in a weekend: a leakage-safe evaluation, a real-time engine with exact parity to the notebook, an honest accelerator benchmark, and a container that runs on s390x.

If you want to try it, the repo has full instructions for running on LinuxONE, plus a synthetic bundle so you can open the console without downloading the dataset:

python tests/make_synthetic_bundle.py /tmp/tp_demo
python app/server.py --model-dir /tmp/tp_demo/models --artifacts /tmp/tp_demo/engine

Repo: github.com/theflighttechofficial/TrustPulse-AI Demo: youtu.be/pyycgKfJAe8

References

  • E. Altman et al., "Realistic Synthetic Financial Transactions for Anti-Money Laundering Models", NeurIPS 2023 Datasets and Benchmarks.
  • B. Egressy et al., "Provably Powerful Graph Neural Networks for Directed Multigraphs", AAAI 2024 (arXiv:2306.11586).
  • E. A. Lopez-Rojas, A. Elmir, S. Axelsson, "PaySim: A financial mobile money simulator for fraud detection", EMSS 2016.

FAQ

What is TrustPulse AI? A real-time risk engine for instant payments. It scores each payment as it arrives and returns APPROVE, VERIFY or REVIEW with a readable reason. It was built for IBM Z Datathon 2026 and runs on IBM LinuxONE.

Why use network features for fraud detection? Mule accounts look normal one transfer at a time. Features such as fan-in, pass-through ratio and first-time counterparties raised PR-AUC from 0.064 to 0.525 on the IBM AML HI-Small dataset.

Does the Telum II accelerator speed up tree models? Not in this setup. IBM Snap ML on the NNPA was slower than the CPU path in all 36 configurations tested on a 3-vCPU LinuxONE VM, so the engine runs on the CPU.

Can I run it without the dataset? Yes. The repo includes a synthetic bundle that starts the live console without downloading any data.

About the author

  • Building cool stuff with code, coffee, and curiosity. Exploring AI, automation, and full stack development 🚀

No comments yet. Be the first to comment.

More from this blog