Unlocking the potential of sequential modeling in fraud prevention: Insights from experts at Nubank

Nubank Editorial18 Dec 2024

Problem

Nubank's fraud data science team detects scams and account theft. Tabular models need engineered features such as "sum of a value in the last 24 hours", and every new event type or country adds feature work. The order of events and the time between them are critical signals for scams and theft, and aggregates do not carry them directly. In production, no single service returns a customer's full event history.

Example from the article: a customer makes a credit card purchase and then takes a loan. The order and the gap between the two events are the fraud signal.

Solution in brief

Feed a neural network raw, time-ordered events (each with the same fixed feature set) plus the usual tabular features, not aggregates. In production, a Flink application builds the per-customer event array from change-data-capture events on Kafka.

Questions this case answers
  • How to detect adversarial behavior from the order and timing of events without engineering window aggregates for every new event type
  • How to assemble a customer's recent event history in real time when the events live in many separate services
  • How to detect scams and account theft from the order and timing of customer events instead of hand-built window aggregates?
  • How to serve a sequence model in production when no single service holds a customer's full event history?

Tools and methods

  • Sequential neural network — scores the ordered event array together with tabular features
  • Apache Flink — streaming application that joins events per customer
  • Apache Kafka — topic carrying change-data-capture (CDC) events from the owning services
  • Apache Pinot — SQL query over the events joined by the streaming application
  • SHAP — per-event attributions, summed to read like ordinary feature attributions
Continue reading — it's free

Google or a one-time email code. No password.