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.
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.
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
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
Key Features
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