fraud-shield · fraud detection

Fraud detection for the
real fintech constraints.

An end-to-end fraud detection pipeline for financial transactions, built for the constraints of a real banking or fintech environment: severe class imbalance, the cost of false negatives, interpretability for audit, and a structure that extends to batch or streaming production.

01
problem What it solves
Financial fraud is rare but high-impact. Fraud represents ~0.1% of transactions, so naive models are useless and standard accuracy is misleading. The system is designed around the consequences: precision-recall on the fraud class as the primary lens, class weighting plus threshold tuning for the imbalance, and feature engineering that captures account behaviour.
Dataset
PaySim (~6.3M transactions, ~0.1% fraud)
Model
LightGBM with class_weight='balanced'
Tracking
MLflow (runs, params, registered models)
02
features Engineering decisions
Account drain signals: balance_diff_orig / balance_diff_dest capture the strongest fraud behaviour.
Risk-channel encoding: is_high_risk_type (TRANSFER/CASH_OUT), where fraud actually occurs.
Log transforms: log1p compresses heavy-tailed amount distributions.
No leakage: isFlaggedFraud (unavailable in production) is dropped.
Evaluated on PR: precision-recall on the fraud class, not accuracy on the 99.9% majority.
Interpretability: feature importance plots for auditability.
03
results Real numbers
ROC-AUC 0.998: verified in the logged MLflow run, with fraud-class precision/recall/F1 around 0.84 / 0.77 / 0.80 at the tuned decision threshold.
Trade-off Accuracy 0.9996 is present but presented as secondary; the metric that matters is catching the 0.1% that is fraud.