0%
AI/ML 2024

Real-Time Fraud Detection POC

Kafka + Graph ML + Ensemble Models

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.

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

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.

02

The Solution

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.

Technology Stack

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
03

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
04

Key Features

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

Results & Impact

  • 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

Explore This Project