Real-time fraud detection pipeline
Streaming velocity features, a champion model with a shadow challenger, a rules fallback for model timeouts, and a human review queue for the gray zone.
What this design does
Fraud systems fail in two directions: block good customers or approve criminals — and both happen when the model is treated as an oracle instead of a component. This pipeline computes velocity features over sliding windows, scores with a champion model while a challenger shadow-scores the same traffic for offline comparison, falls back to deterministic rules when the model misses its deadline, and routes low-confidence decisions to human analysts whose labels feed the next retrain.
The patterns it composes
- Streaming windows — velocity features (txns/5min, amount/1h) from sliding windows
- Champion–challenger — the challenger shadow-scores real traffic but never decides
- Fallback model — deadline miss → deterministic rules, never an unscored approval
- Feature store — one feature definition serves both training and scoring — no skew
- Human-in-the-loop — gray-zone scores go to analysts; their labels close the loop
Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.