UMAR SAYYAD

PRINCIPAL SOFTWARE ENGINEER

Predictive ML

AI-Powered Fraud Detection

Real-time transaction scoring and behavioural anomaly detection that cut fraud losses while keeping false-positive rates low enough for production.

Designed and led the fraud detection ML pipeline at PwC, combining gradient-boosted transaction scoring with graph-based behavioural anomaly detection. The system processed millions of transactions daily, scoring each in under 50ms while maintaining a false-positive rate that kept manual review queues manageable.

Expertise
Designed and led
Patterns
4
Industries
1
Applied
Jan 2022 — Dec 2023

Full stack

  • Python
  • XGBoost
  • scikit-learn
  • Kafka
  • Redis
  • PostgreSQL
  • MLflow
  • NetworkX
  • Docker
  • AWS

Capability Overview

Capability Overview

  • Real-time transaction fraud scoring processing millions of transactions daily with sub-50ms p95 latency.
  • Gradient-boosted model ensemble combining transaction features, velocity checks, and device fingerprinting signals.
  • Graph-based anomaly detection identifying coordinated fraud rings that individual transaction scoring misses.
  • Feedback loop from investigator dispositions retraining models weekly on confirmed fraud patterns.

AI-Powered Fraud Detection covers the end-to-end system that scores every transaction in real time for fraud probability, flags anomalous behavioural patterns, and routes suspicious activity to investigators with explainable risk factors.

The core challenge was balancing detection rate against false positives. A model that flags everything catches all fraud but makes the system unusable. A model tuned for precision misses novel attack patterns. The solution was a multi-layer approach: a fast scoring model for every transaction, a slower graph analysis for relationship patterns, and a human-in-the-loop feedback system that kept models current as fraud tactics evolved.

Tech in this section

  • Python
  • scikit-learn
  • XGBoost
  • PostgreSQL

Implementation Patterns

Implementation Patterns

  • Gradient-boosted ensemble scoring each transaction against 200+ engineered features in real time.
  • Velocity-based feature engineering capturing spending acceleration, geographic spread, and merchant category shifts.
  • Graph-based ring detection linking accounts by shared devices, addresses, and beneficiaries.
  • Champion-challenger model deployment with automatic rollback on precision regression.

The fraud detection system used four patterns working in concert. The gradient-boosted ensemble was the primary scorer, evaluating each transaction against engineered features covering amount patterns, merchant categories, geographic signals, device fingerprints, and temporal patterns.

Velocity features captured behavioural shifts that raw transaction data missed — a card used twice a year suddenly making ten purchases in an hour scores differently from a daily-use card doing the same.

Graph analysis ran asynchronously, building relationship networks across accounts. Shared devices, overlapping addresses, and rapid fund transfers between new accounts formed the edges. Clusters with fraud-like topology triggered elevated monitoring on all connected accounts.

Champion-challenger deployment ensured model updates improved detection. New models scored shadow traffic alongside the champion; promotion required better precision-recall on a held-out fraud dataset.

  • Gradient-boosted ensemble

    XGBoost model scoring 200+ features per transaction in real time with sub-50ms latency.

    Why this
    Gradient boosting handles the heterogeneous feature space (categorical, numerical, temporal) without extensive preprocessing. Ensemble of specialised models outperforms a single general model.
    What it cost
    Model complexity grows with feature count. Kept inference fast by pruning low-importance features quarterly and limiting tree depth.
    • XGBoost
    • Python
  • Velocity-based feature engineering

    Engineered features capturing spending acceleration, geographic spread, and merchant category shifts over sliding windows.

    Why this
    Raw transaction features miss behavioural context. A $500 purchase is normal for one cardholder and anomalous for another. Velocity features encode personal baselines.
    What it cost
    Sliding-window features require maintaining per-account state. Redis TTL-based counters kept memory bounded while preserving the most recent behavioural signal.
    • Redis
    • Python
  • Graph-based ring detection

    Relationship graphs linking accounts by shared devices, addresses, and beneficiaries. Clusters with fraud-like topology elevate monitoring.

    Why this
    Individual transaction scoring misses coordinated fraud where each transaction looks normal in isolation. Graph structure reveals the coordination.
    What it cost
    Graph queries are expensive. Ran asynchronously rather than in the transaction path, accepting a detection delay for ring patterns.
    • NetworkX
    • PostgreSQL
  • Champion-challenger deployment

    New models score shadow traffic alongside the production model. Promotion requires better precision-recall on held-out fraud data.

    Why this
    Fraud model updates carry high stakes — a regression means either missed fraud or blocked legitimate customers. Shadow scoring catches regressions before they reach production.
    What it cost
    Shadow scoring doubles inference cost during evaluation periods. Justified by the cost of a bad model reaching production.
    • Python
    • MLflow

Tech in this section

  • Python
  • XGBoost
  • NetworkX
  • Redis

Architecture

Architecture

  • Event-driven scoring pipeline processing transactions via Kafka with sub-50ms p95 latency.
  • Feature store serving precomputed and real-time features to the scoring model without duplicating logic.
  • Asynchronous graph analysis running on batch-updated relationship networks with results feeding back into real-time scores.
  • Investigator feedback loop — confirmed fraud and false-positive dispositions retrain models weekly.

Transactions entered via Kafka. The scoring service consumed events, enriched them with features from the feature store (precomputed account-level aggregates plus real-time velocity counters from Redis), and scored them through the XGBoost ensemble.

Scores above the threshold triggered an alert in the case management system. Investigators reviewed alerts with explainable risk factors — the top features driving the score, the account's recent activity timeline, and any graph-based risk signals.

The graph analysis pipeline ran on a schedule, rebuilding relationship networks from the transaction and account data, detecting clusters, and writing risk scores back to the feature store. Real-time scoring picked up graph-derived features on the next transaction.

Investigator dispositions (confirmed fraud, false positive, suspicious but inconclusive) flowed back as training labels. Weekly retraining incorporated fresh labels, and champion-challenger evaluation gated promotion.

Tech in this section

  • Kafka
  • Redis
  • PostgreSQL
  • Python
  • XGBoost

Stack & Tools

Stack & Tools

  • XGBoost for the production scoring model — fast inference, handles mixed feature types, interpretable feature importances.
  • Kafka for event-driven transaction ingestion with guaranteed ordering per account.
  • Redis for real-time velocity counters with TTL-based memory management.
  • PostgreSQL for the transaction store, feature store, and graph analysis source data.
  • MLflow for model versioning, experiment tracking, and champion-challenger evaluation.

XGBoost was chosen for its inference speed and interpretability. Fraud investigators need to understand why a transaction was flagged, and feature importances from gradient-boosted trees are more actionable than neural network attention weights.

Kafka provided the event backbone. Transactions arrived as events, scored in real time, with the score and risk factors published back for downstream consumption. Redis served velocity features — per-account counters with TTL expiration that naturally decayed old activity without explicit cleanup.

PostgreSQL stored everything persistent: transactions, account profiles, model features, graph edges, and investigator dispositions. MLflow tracked experiments and managed the model lifecycle from training through champion-challenger evaluation to production promotion.

Tech in this section

  • XGBoost
  • Python
  • Kafka
  • Redis
  • PostgreSQL
  • MLflow
  • Docker
  • AWS

Industry Applications

Industry Applications

  • Financial services: real-time payment fraud detection for card-present and card-not-present transactions.
  • Insurance: claims fraud detection scoring incoming claims against historical patterns and provider networks.
  • E-commerce: account takeover detection combining login anomalies with transaction behaviour shifts.

The fraud detection architecture applies wherever transactions need real-time risk scoring with explainable decisions. The feature engineering changes — insurance claims have different signals than payment transactions — but the scoring pipeline, feedback loop, and champion-challenger deployment pattern transfer directly.

  • Financial services

    Problem
    Legacy rule-based fraud detection missed novel attack patterns and generated excessive false positives, costing more in blocked legitimate transactions than in actual fraud losses.
    Approach
    ML-based scoring ensemble combining transaction features, velocity signals, device fingerprints, and graph-based ring detection with real-time inference and weekly retraining on investigator feedback.
    Impact
    40% reduction in fraud losses, 60% reduction in false positives, sub-50ms scoring latency.

Tech in this section

  • Python
  • XGBoost

Results & Evidence

Results & Evidence

  • 40% reduction in fraud losses compared to the previous rule-based system.
  • 60% reduction in false-positive rate, freeing investigator capacity for complex cases.
  • Sub-50ms p95 scoring latency on the real-time transaction path.
  • Weekly model retraining incorporating investigator feedback with champion-challenger gating.

The 40% fraud loss reduction measured the ML system against the rule-based baseline over a 6-month parallel run. The ML system caught patterns rules could not express — subtle velocity shifts, cross-merchant coordination, and device-sharing networks.

The 60% false-positive reduction was equally important. Every false positive blocks a legitimate customer and generates an investigation. Reducing false positives freed investigators to focus on genuinely suspicious cases, improving both customer experience and investigation quality.

  • Fraud loss reduction

    40%

    Rule-based detectionML ensemble scoring

    Measured over 6-month parallel run.

  • False-positive reduction

    60%

    Rule-based (high FP rate)ML scoring with tuned threshold

    Freed investigator capacity for complex cases.

  • Scoring latency

    <50ms p95

    Real-time transaction path, including feature enrichment.

  • Model retraining cadence

    Weekly

    Incorporates investigator dispositions as fresh training labels.

Tech in this section

  • Python
  • XGBoost