Fintech • Security AI

[REDACTED] GCC Fintech

Transformer-Based Anomaly Detection

Client:Saudi Arabia Fintech (Riyadh)
Timeline:12 months (2022-2023)
Team:AI Engineering, Backend, MLOps & Compliance
TransformersPyTorchKafkaSHAPMLOpsFastAPIKubernetes
System Architecture

The Challenge

A leading Saudi fintech processing over 4 million daily transactions faced a 38% false positive rate using traditional rule-based logic. This inefficiency triggered customer churn, overwhelmed manual fraud review teams, and complicated compliance with SAMA (Saudi Central Bank) guidelines.

  • High churn rate due to legitimate transactions being incorrectly flagged
  • Inability to detect novel, non-linear fraud patterns
  • Operational bottlenecks in manual transaction review
  • Stringent regulatory requirements for AI explainability and governance

The Solution

Developed a dual-layer detection system centered on a custom transformer-based model fine-tuned on three years of transaction history. Unlike generic wrappers, this domain-specific architecture was trained entirely on the client's internal dataset.

  • Custom Transformer-Based Anomaly Detection Model fine-tuned on historical data
  • Real-time feature engineering pipeline via Apache Kafka for sub-100ms extraction
  • Unsupervised autoencoder for novel fraud pattern discovery
  • Explainable AI (XAI) layer using SHAP values for regulatory transparency
  • Automated MLOps retraining pipeline with model versioning via MLflow

Lexer System's Approach

1

Custom Architecture Design

Built a specialized transformer architecture optimized for tabular transaction sequences, capturing behavioral nuances that traditional models miss.

2

High-Throughput Feature Pipeline

Leveraged Apache Kafka to process 47 behavioral signals per event, ensuring the model has full context within milliseconds of a transaction trigger.

3

Explainable AI Integration

Integrated SHAP values into a custom React dashboard, allowing fraud analysts to see the specific weight of factors behind every flagged event.

4

Sovereign Deployment

Deployed the inference engine on a hardened Kubernetes cluster within the client's VPC, ensuring full data residency and security.

Results & Impact

79% Reduction
False Positive Rate

Dropped from 38% to 8% post-deployment

94.3%
Detection Precision

Highly accurate identification of fraudulent events

<85ms
Inference Latency

Real-time response at p99 throughput

100%
Compliance

Passed SAMA AI governance audit with full audit trails

Technical Highlights

Sub-100ms Latency

Optimized inference engine capable of processing 4M+ daily events without impacting customer experience.

Governance-First AI

Automated documentation and XAI layers designed specifically for high-stakes regulatory environments.

Hybrid Detection

Simultaneous execution of supervised classifiers and unsupervised anomaly detectors for zero-day fraud prevention.

Lessons Learned

  • Domain-specific transformer architectures significantly outperform generic ensembles for sequential transaction data
  • Explainability is not just a feature, but a core requirement for fintech AI adoption
  • MLOps automation is critical for maintaining model performance in rapidly shifting fraud landscapes

Next Steps

  • Expand detection to cross-border P2P transfers and crypto-gateway integrations
  • Implement federated learning to leverage network-wide signals while preserving data privacy
  • Enhance XAI with natural language summaries for non-technical compliance officers

Have a Similar Challenge?

We specialize in building production-grade systems that solve complex operational problems. Let's discuss how we can help architect your solution.