Why Rule-Based Fraud Detection Fails at Scale
Traditional rule-based systems flag transactions based on fixed thresholds: amount > £5,000, foreign IP, new device. The problem: fraudsters learn the rules. A sophisticated attacker splits a £10,000 transfer into 9 transactions of £1,100 each — every rule passes. Meanwhile, your rules are blocking 3% of legitimate transactions, frustrating real customers.
The UK financial sector loses over £1.2 billion annually to fraud (UK Finance, 2024). FCA-regulated firms face direct liability when controls are demonstrably inadequate. ML-based detection doesn't replace compliance requirements — it makes them achievable at modern transaction volumes.
How ML Fraud Detection Works
An ML fraud system combines several model types working in parallel:
**Anomaly Detection (Unsupervised)** — Isolation Forest or Autoencoder models learn what 'normal' looks like for each customer. A transaction that deviates significantly from the customer's behavioural baseline gets flagged regardless of absolute amount.
**Binary Classification (Supervised)** — XGBoost or LightGBM trained on labelled fraud/non-fraud data. Features include: velocity (5 transactions in 2 minutes), geolocation delta (London → Lagos in 3 hours), device fingerprint, merchant category, time-of-day patterns.
**Graph Neural Networks** — Detect fraud rings by mapping relationships between accounts, devices, and IP addresses. A single fraudster controlling 40 synthetic accounts leaves a detectable network signature.
**Real-time Feature Store** — All three models need features computed in <5ms. This requires a streaming feature store (Redis + Apache Flink) that maintains rolling aggregates: last 1h/24h/7d spend by merchant category, velocity per card, etc.
Architecture for 10,000 TPS
The GuardAI system we built for an FCA-regulated payment processor handles 10,000+ transactions per second:
```
Transaction Event → Kafka Topic (3ms)
↓
Flink Stream Processor → Feature Computation (8ms)
↓
Model Ensemble (XGBoost + Isolation Forest) → Score (12ms)
↓
Decision Engine → Block / Review / Allow (5ms)
↓
Case Management System + Real-time Alerts
```
Total latency: 28ms p50, 47ms p99. The Kafka buffer absorbs traffic spikes (Black Friday peaks at 3x baseline). Models are deployed via MLflow with A/B traffic splitting — new model versions receive 5% traffic before full rollout.
Infrastructure: 6× c5.2xlarge (model serving), 3× r5.4xlarge (feature store), managed Kafka on AWS MSK. Monthly infrastructure cost: £4,200.
Handling Class Imbalance
Fraud rates in production are typically 0.1-0.3%. Training a model on raw data means 99.7% of examples are 'not fraud' — the model learns to always predict 'not fraud' and achieves 99.7% accuracy while being completely useless.
Solution: SMOTE (Synthetic Minority Over-sampling Technique) combined with cost-sensitive learning. We assign a misclassification cost of £150 per missed fraud (average transaction value) vs £2 per false positive (manual review cost). The model optimises for business cost, not raw accuracy.
Metrics that matter: Precision-Recall curve, not ROC-AUC. At 0.5% FPR (false positive rate), our model achieves 94.3% recall — meaning we catch 94 out of every 100 fraud cases while blocking only 1 in 200 legitimate transactions.
Deployment, Monitoring, and Model Drift
Fraud patterns evolve. A model trained in January 2025 will degrade by June 2025 as fraudsters adapt. Production ML fraud detection requires:
**Champion-Challenger Testing** — Run the new model on 10% of traffic. Compare precision, recall, and £-value of caught fraud vs. the production model. Promote only when statistically significant.
**Feature Drift Monitoring** — Track the distribution of each input feature daily. If 'foreign IP' rate jumps from 2% to 8%, it might mean your customer base changed, or it might mean a fraud campaign has started — either way, you need to know.
**Feedback Loop** — Investigators must label reviewed cases within 48 hours. These labels feed the weekly retraining pipeline. Without closed-loop feedback, model accuracy degrades 15-20% over 6 months.
Results from the GuardAI deployment: fraud losses reduced by 67% in year one, false positive rate reduced from 2.1% (rule-based) to 0.4% (ML), £2.3M annual saving net of system costs. The FCA compliance team cited the system's explainability layer (SHAP values per decision) as a key factor in their supervisory review.
Related Codeworth Services
Need Help with Implementation?
The Codeworth team is ready to implement these ideas in your project. Free consultation.
Discuss the ProjectCo-founder of Codeworth with 7 years of UK fintech ML experience. Specialises in credit scoring with FCA compliance, ensemble methods including XGBoost and LightGBM, and ML experiment management via Python and MLflow. Has built production systems for credit decisioning processing millions of applications annually under FCA oversight. Holds deep knowledge of FCA model explainability requirements and Consumer Duty documentation standards.