Overview
FraudSense is a containerized, real-time fraud detection system that evaluates 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 machine learning model to simulate a modern fraud scoring architecture used in financial risk systems.
FraudSense processes each transaction through the following pipeline:
1. Incoming transaction request hits a FastAPI scoring endpoint
2. Behavioral features are computed in real time using Redis-based rolling windows
3. Feature vector is evaluated by a trained fraud classification model
4. Rule-based policy is applied to determine the final decision
5. Transaction, prediction, and decision are persisted in PostgreSQL for auditing and retraining
The entire system is 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 using 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 real-world fraud detection scenarios.
Benchmarks
The scoring API was load-tested using a transaction replay pipeline.
Results:
These results demonstrate stable, low-latency fraud scoring performance under high transaction volume.