Inspiration
Digital-payment fraud creates a difficult trade-off: blocking too little can cause financial losses, while blocking too much creates false declines and unnecessary friction for legitimate customers.
We wanted to build a fraud detection system that does more than output a risk score. A real transaction decision should answer three questions:
How risky is this transaction? What should we do about it? Why did the system make that decision?
This led us to build RXT-J+ Glass Box, a real-time fraud decision engine designed around cost-aware decisions, explainability, and model auditing.
What we built
Glass Box processes a transaction through a multi-stage pipeline:
Transaction → Feature Assembly → Ring Graph → ML Scorer → Cost Router → Explanation → Audit Gate
The system combines transaction amount, frequency, location, device, timing, and account history into a behavioural profile. It also supports graph-based enrichment using card-device and card-address relationships to identify patterns that may not be visible from a single transaction.
The scoring layer uses LightGBM with isotonic calibration so that the output can be treated as a calibrated probability rather than an arbitrary model score.
Instead of applying one fixed fraud threshold to every transaction, our cost-sensitive router compares the expected rupee cost of three possible actions:
Allow Step-up verification Block
This means the same probability can lead to different actions depending on the transaction amount and configured costs.
The explanation layer uses TreeSHAP contributions, fixed reason codes, and counterfactual explanations. The goal is to make every decision understandable to both analysts and customers.
Finally, our Glass Box audit gate checks the model before deployment for issues such as class-balance drift, degenerate features, label leakage, invalid chronological splits, and implausible flag rates.
How we built it
Our architecture uses:
FastAPI + Pydantic for the real-time service LightGBM for fraud scoring Isotonic regression for probability calibration TreeSHAP for model explanations NetworkX for transaction relationship graphs SQLite/PostgreSQL for behavioural profiles and transaction data Dashboard views for decisions, alerts, explanations, and monitoring
The scoring path was measured at under 1 ms in our implementation. The full explained decision path is part of our Round 2 target.
What we learned
One of our biggest lessons was that a strong benchmark score does not automatically mean a useful fraud system.
Our initial baseline reported an AUC of 0.9624 on a class-balanced evaluation, but when evaluated at the real fraud rate, it produced an unusable flag rate. This motivated us to build the audit harness that now acts as a deployment gate.
We then evaluated a gradient-boosted baseline using a chronological hold-out. It achieved ROC-AUC 0.7892 and PR-AUC 0.2072. On 1,210 transactions from cards not seen during training, the model achieved an AUC of 0.8182, giving us evidence that the result was not simply account memorisation.
Challenges
The biggest challenges were dealing with fraud's class imbalance, preventing temporal leakage, designing meaningful cost functions, and making explanations correspond to the actual factors affecting a decision.
We also found an important limitation in the current version: device telemetry is missing on 79.9% of rows, so graph-based ring detection currently covers only part of the traffic. We therefore treat the graph-based lift as a hypothesis for the next build stage rather than claiming an improvement we have not yet measured.
What's next
Our Round 2 build path is to strengthen the audit gate first, then connect the calibrated scorer, cost router, SHAP reason codes, ring graph, and operations dashboard into the complete flow.
The goal is not simply to make a model that scores fraud accurately. It is to build a system where every important decision can be priced, explained, inspected, and challenged before deployment.
RXT-J+ Glass Box — we don't just score fraud. We price the decision.
Built With
- ai
- analytics
- api
- detection
- explainable
- fastapi
- financial
- fraud
- graph
- isotonic
- learning
- lightgbm
- machine
- networkx
- postgresql
- pydantic
- python
- regression
- rest
- risk
- scoring
- shap
- sqlite
Log in or sign up for Devpost to join the conversation.