YAML Metadata Warning: The pipeline tag "fraud-detection" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, text2text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

πŸ›‘οΈ 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

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results

  • auc on CREDIT CARD fraud detection credit card.csv
    self-reported
    1.000
  • accuracy on CREDIT CARD fraud detection credit card.csv
    self-reported
    0.994
  • f1 on CREDIT CARD fraud detection credit card.csv
    self-reported
    0.976
  • precision on CREDIT CARD fraud detection credit card.csv
    self-reported
    0.981
  • recall on CREDIT CARD fraud detection credit card.csv
    self-reported
    0.970