Overview
FraudSense is a containerized, real-time fraud detection system that scores transactions through a production-style API, enriches them with behavioral features, and returns actionable decisions (approve / review / decline).
The system combines online feature aggregation, rule-based decisioning, and a trained ML model to simulate a modern fraud scoring architecture.
FraudSense processes each transaction through the following pipeline:
1. Incoming transaction hits FastAPI endpoint
2. Behavioral features computed in real time using Redis
3. Feature vector scored by trained fraud classifier
4. Rule-based policy applied to determine final decision
5. Transaction, prediction, and decision persisted in PostgreSQL
The system is fully containerized using Docker.
Architecture
Backend: FastAPI
Data Store: PostgreSQL
Online Feature Store: Redis
Model Layer: Scikit-learn classifier
Containerization: Docker
Key system components:
Model Training
The fraud classifier was trained on Kaggle's 250K-row credit card fraud dataset.
Key metrics:
Imbalance awareness was critical due to the ~0.17% fraud rate in the dataset.
Thresholds were tuned to balance precision and recall appropriately for fraud detection environments.
Benchmarks
The live API was load-tested using a transaction replay pipeline.
Results:
This validated system stability and low-latency scoring under high-volume conditions.