Vaibhav Waghmare.

Projects / AI/ML / 2024

Real-Time Fraud Detection POC

Event-Driven ML Pipeline

500+ Events/Sec
<100ms P95 Latency
98.5% Precision
97.2% Recall
3 ensemble Models
Neo4j 5.16 Graph DB

Developed real-time fraud detection POC combining event-driven architecture (Kafka 3.6+) with graph ML and ensemble models. System ingests transaction events from Kafka streams, enriches with user behavior profiles, device fingerprints, geolocation data within <100ms window. Implements Neo4j graph database for fraud ring detection across connected accounts, TimescaleDB for time-series behavioral anomaly detection, Redis feature store for low-latency pattern matching. Tested with simulated transaction load demonstrating production-ready architecture.

The challenge

Traditional fraud detection relies solely on rules or static ML models. Rule-based systems generate high false positives. ML models degrade as fraud patterns evolve. Graph relationships between fraudulent accounts hard to detect. Need real-time scoring with explainability for investigation.

Implementation

Built POC demonstrating production-ready architecture combining rule engine (Drools) with ensemble ML models and graph analytics. Event-driven design enables real-time processing. SHAP values provide explainability. Automated retraining pipeline keeps models current. Tested architecture validates scalability approach.

Architecture

  • Event-driven architecture with Kafka 3.6+ streams
  • Neo4j graph database for fraud ring detection
  • TimescaleDB for time-series behavioral analytics
  • Redis 7.2 feature store with sub-5ms caching
  • Drools 8.44 rule engine + ML ensemble models
  • Ensemble voting (XGBoost + LightGBM + PyTorch)
  • SHAP explainability for model transparency
  • Circuit breaker patterns with Resilience4j fallback
  • FastAPI microservices architecture
  • Automated retraining pipeline with MLflow experiment tracking
  • Docker Compose multi-container deployment
  • Prometheus metrics + Grafana dashboards
  • OpenTelemetry distributed tracing
  • K6 load testing for throughput validation

Features

  • Kafka 3.6+ stream processing with consumer groups
  • Neo4j graph analysis for fraud ring detection via Cypher queries
  • Ensemble ML models (XGBoost 2.0, LightGBM 4.3) with voting classifier
  • Redis 7.2 feature store with <5ms lookup latency
  • Drools 8.44 rule engine for business logic validation
  • SHAP-based explainability dashboard built with React 18
  • Real-time velocity checks and behavioral anomaly detection
  • Device fingerprinting POC with metadata extraction
  • TimescaleDB 2.14 for time-series transaction analytics
  • Automated model retraining pipeline with MLflow 2.11 tracking
  • Docker Compose multi-container local deployment
  • Circuit breaker patterns with Resilience4j fallback to rules
  • Merchant risk scoring with PostgreSQL 16 lookup
  • Prometheus metrics + Grafana dashboards for monitoring

Results

  • Achieved 98.5% precision with 97.2% recall on test dataset
  • Scoring latency <100ms p95 in local Kafka + Redis setup
  • Graph analysis detects multi-account fraud rings via Neo4j traversal
  • Built automated retraining pipeline with MLflow experiment tracking
  • Implemented SHAP-based explainability dashboard for model transparency
  • Load tested with K6 handling 500+ events/sec throughput
  • Ensemble models (XGBoost + LightGBM) outperform single-model baseline 12%
  • Feature store caching reduces scoring latency 85% vs database lookup

Technologies

  • Apache Kafka 3.6+
  • Neo4j 5.16
  • TimescaleDB 2.14
  • PostgreSQL 16
  • Redis 7.2
  • XGBoost 2.0
  • LightGBM 4.3
  • PyTorch 2.2+
  • SHAP 0.44
  • MLflow 2.11
  • Drools 8.44
  • Spring Boot 3.3
  • Java 21
  • Python 3.11+
  • FastAPI 0.109
  • React 18
  • TypeScript 5.x
  • D3.js
  • Docker 24.0
  • Docker Compose
  • Prometheus + Grafana
  • OpenTelemetry
  • K6 (Load Testing)
  • Resilience4j