darkknight25/fraud_ensemble_onnx
By darkknight25 · ↓ 0 · ♥ 0 · Updated 2025-07-11
What's in this repo
This page lists the files in darkknight25/fraud_ensemble_onnx, including cat_model.onnx, lgb_model.onnx, meta_model.onnx and more.
- 5 ONNX models (.onnx files)
- 11 files, including 5 .onnx, 2 .json, 1 .md, 1 .zip, 1 .pkl
- Last updated 2025-07-11
ONNX files
| File | Size | Download |
|---|---|---|
| cat_model.onnx | — | Download |
| lgb_model.onnx | — | Download |
| meta_model.onnx | — | Download |
| rf_model.onnx | — | Download |
| xgb_model.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
🛡️ Fraud Detection Ensemble Suite - ONNX Format
Author: darkknight25
Models: XGBoost, LightGBM, CatBoost, Random Forest, Meta Learner
Format: ONNX for production-ready deployment
Tags: fraud-detection, onnx, ensemble, real-world, ml, lightweight, financial-security
🔍 Overview
This repository provides a high-performance fraud detection ensemble trained on real-world financial datasets and exported in ONNX format for lightning-fast inference.
Each model is optimized for different fraud signals and then blended via a meta-model for enhanced generalization.
🎯 Real-World Use Cases
✅ Credit card fraud detection
✅ Transaction monitoring systems
✅ Risk scoring engines
✅ Insurance fraud
✅ Online payment gateways
✅ Embedded or edge deployments using ONNX
🧠 Models Included
| Model | Format | Status | Notes |
|---|---|---|---|
| XGBoost | ONNX | ✅ Ready | Best for handling imbalanced data |
| LightGBM | ONNX | ✅ Ready | Fast, efficient gradient boosting |
| CatBoost | ONNX | ✅ Ready | Handles categorical features well |
| RandomForest | ONNX | ✅ Ready | Stable classical ensemble |
| Meta Model | ONNX | ✅ Ready | Trained on outputs of above models |
🧾 Feature Schema
feature_names.json contains the exact input features expected by all models.
You must preprocess data to match this schema before ONNX inference.
["amount", "time", "is_foreign", "txn_type", ..., "ratio_to_median_purchase_price"]
Shape: (None, 29)
Dtype: float32
import onnxruntime as ort
import numpy as np
import json
# Load feature schema
with open("feature_names.json") as f:
feature_names = json.load(f)
# Dummy input (replace with your real preprocessed data)
X = np.random.rand(1, len(feature_names)).astype(np.float32)
# Load ONNX model
session = ort.InferenceSession("xgb_model.onnx", providers=["CPUExecutionProvider"])
# Inference
input_name = session.get_inputs()[0].name
output = session.run(None, {input_name: X})
print("Fraud probability:", output[0])
Example Inference Code:
import onnxruntime as ort
import numpy as np
session = ort.InferenceSession("meta_model.onnx")
input_data = np.array([[...]], dtype=np.float32) # shape (1, 29)
inputs = {session.get_inputs()[0].name: input_data}
outputs = session.run(None, inputs)
print("Fraud Probability:", outputs[0])
🧪 Training Pipeline
All models were trained using the following:
✅ Stratified train/test split
✅ StandardScaler normalization
✅ Log loss and AUC optimization
✅ Early stopping and feature importance
✅ Light-weight autoencoder anomaly filter (not included here)
🔐 Security Focus
Ensemble modeling reduces false positives and model drift.
Models are robust against outliers and data shifts.
TFLite autoencoder (optional) can detect unknown fraud patterns.
📁 Files
models/
├── xgb_model.onnx
├── lgb_model.onnx
├── cat_model.onnx
├── rf_model.onnx
├── meta_model.onnx
├── feature_names.json
🛠️ Advanced Users
Easily convert ONNX to TFLite, TensorRT, or CoreML.
Deploy via FastAPI, Flask, Streamlit, or ONNX runtime on edge devices.
🤝 License
MIT License. You are free to use, modify, and deploy with attribution. 🙌 Author
Made with ❤️ by darkknight25,SUNNYTHAKUR Contact for enterprise deployments, smart contract forensics, or advanced ML pipelines
Model info
Created: 2025-07-11
Updated: 2025-07-11
View on Hugging FaceFiles (11)
Related models
More from darkknight25
More models
No task type declared.