An advanced state-of-the-art fraud detection system that significantly outperforms traditional baselines by combining Graph Neural Networks (features), Deep Learning (TabNet), and GPU-accelerated Gradient Boosting into a robust meta-ensemble.
Status: Achieved 0.997+ PR-AUC, representing a 14%+ improvement over the original paper methodology.
The system utilizes a multi-stage architecture that processes 6.3M+ transactions through specialized engines before making a final prediction.
graph TD
A[Transaction Data] --> B[Feature Engine]
A --> C[Graph Engine]
A --> D[Filter Engine]
B --> E[Feature Matrix]
C --> E
D --> E
E --> F[LightGBM - GPU]
E --> G[XGBoost - GPU]
E --> H[TabNet - Deep Learning]
E --> I[Isolation Forest - Unsupervised]
F --> J[Meta-Learner]
G --> J
H --> J
I --> J
J[Logistic Regression] --> K[Final Fraud Prediction]
- Graph Engine (NetworkX)
- Computes PageRank, Degree Centrality, and interaction ratios.
- Identifies "fraud rings" and mule accounts based on network topology.
- Deep Learning (TabNet)
- Uses attention mechanisms to learn feature importance automatically.
- Provides diversity against tree-based models.
- GPU Acceleration (CUDA)
- LightGBM and XGBoost trained on GPU for 7-8x speedup.
- Robust Stacking Ensemble
- Combines Supervised (LGBM, XGB, TabNet) and Unsupervised (Isolation Forest) models.
- Meta-learner (Logistic Regression) optimizes the final probability.
| Rank | Model | PR-AUC | Precision | Recall | Improvement |
|---|---|---|---|---|---|
| 1 | SOTA Ensemble | 0.997+ | 99%+ | 99%+ | +14.1% |
| 2 | Stacking V1 | 0.9973 | 100% | 69% | +14.1% |
| 3 | LightGBM (GPU) | 0.9970 | 99%+ | 99%+ | +14.0% |
| 4 | Improved RF | 0.9961 | 100% | 29.5% | +13.9% |
| 5 | Baseline RF | 0.8743 | 6.3% | 99.3% | - |
Detailed architecture and implementation details can be found in the docs/ directory:
- Advanced SOTA Architecture: Full breakdown of the final system including Graph features and TabNet.
- Stacking Ensemble Architecture: Details on the initial stacking approach and base model selection.
- Python 3.9+
- CUDA-capable GPU (Recommended for TabNet/XGBoost)
- RAM: 16GB+ (32GB+ recommended for full graph features)
# 1. Setup environment
.\setup_environment.ps1
# 2. Download PaySim dataset from Kaggle
kaggle datasets download -d ntnu-testimon/paysim1 -p data/
# 3. Extract dataset
Expand-Archive data/paysim1.zip -DestinationPath data/
# 4. Start Jupyter
jupyter notebook notebooks/Open notebooks/07_advanced_sota.ipynb to run the full pipeline including graph feature extraction and ensemble training.
fraud-detection/
├── configs/ # Model configurations (YAML)
├── docs/ # Detailed architecture documentation
├── notebooks/ # Jupyter notebooks (01-07)
│ ├── 06_stacking_ensemble.ipynb # Stacking implementation
│ └── 07_advanced_sota.ipynb # Final SOTA implementation
├── src/ # Source code modules
│ ├── models/ # TabNet, LGBM, XGBoost wrappers
│ ├── feature_engineering.py # Graph & statistical features
│ └── sampling.py # SMOTE-ENN handling
├── results/ # Figures and metrics
└── data/ # Dataset (gitignored)
MIT License
