> ML_RECIPE // REALTIME-FINANCIAL-FRAUD-DETECTION_v1.0
Real-Time Financial Transaction Fraud Detection
Evaluate card payments and wire transactions for fraud probability under a target SLA of sub-10ms p99 latency, preventing financial loss while minimizing false declines.
Business Outcome
Evaluate card payments and wire transactions for fraud probability under a target SLA of sub-10ms p99 latency, preventing financial loss while minimizing false declines.
Must reduce false declines by >= 40% compared to legacy rules while detecting >= 95% of confirmed fraud dollar volume under SLA.
Heuristic Baseline
Hardcoded rule engine: Flag transactions with amount > $5,000 or country mismatch between cardholder and merchant IP.
Legacy static rules captured only 62% of fraud dollar volume with a 2.4% false decline rate.
Phase 1: Prototype Path
Train XGBoost on anonymized historical transaction logs with SMOTE/class weighting. Measure PR-AUC and False Positive Ratio at 99% recall.
Phase 2: Production Path
Compile XGBoost model to Treelite C-runtime. Stream real-time features from in-memory Redis cluster to achieve sub-10ms p99 target SLA with stateless CPU microservice.
Compute & Placement Topologies
Scheduled daily retraining on CPU/GPU server cluster with temporal cross-validation
Stateless auto-scaling CPU microservice co-located with transaction payment gateway
3-Plan Placement Alternatives
Synchronous Python FastAPI service querying PostgreSQL features and evaluating XGBoost on CPU server.
Go/Rust wrapper invoking compiled ONNX/Treelite runtime on existing payment cluster CPU nodes.
Redis feature store with sub-millisecond lookup + compiled Treelite C++ engine on stateless auto-scaling CPU cluster (Target SLA: Sub-10ms p99 latency) + human investigation queue.
Recommended Libraries & Tools
Governance, Safeguards & Risks
- Regulated explainability & adverse action: TreeSHAP provides post-hoc feature importance and serves strictly as an engineering interpretability aid, not automated legal compliance. In regulated credit decisioning under FCRA and ECOA, model-generated SHAP values alone do not guarantee legally compliant adverse action notices; institutions must perform jurisdiction and applicability determinations, reason-code fidelity testing, and formal legal and compliance reviews to ensure principal reasons accurately reflect actual decision factors. Crucially, distinguish payment-fraud anomaly controls (fraud risk scoring) from consumer credit underwriting decisions (adverse action credit eligibility).
- Human contestability & appeal: Maintain a dedicated human fraud investigation queue and appeal workflow per GDPR Article 22; borderline risk scores (0.35 - 0.70) trigger human analyst review rather than automated decline, ensuring human contestability and intervention rights.
- Enforce PCI-DSS tokenization; never expose raw PAN or CVV in ML training datasets.
- Fair lending audit: Audit model outputs annually across protected categories to prove zero disparate impact.
