Views
No views yet
fraud-detection, onnx, ensemble, real-world, ml, lightweight, financial-security| 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_names.json contains the exact input features expected by all models.["amount", "time", "is_foreign", "txn_type", ..., "ratio_to_median_purchase_price"]1import onnxruntime as ort
2import numpy as np
3import json
4
5# Load feature schema
6with open("feature_names.json") as f:
7 feature_names = json.load(f)
8
9# Dummy input (replace with your real preprocessed data)
10X = np.random.rand(1, len(feature_names)).astype(np.float32)
11
12# Load ONNX model
13session = ort.InferenceSession("xgb_model.onnx", providers=["CPUExecutionProvider"])
14
15# Inference
16input_name = session.get_inputs()[0].name
17output = session.run(None, {input_name: X})
18
19print("Fraud probability:", output[0])1import onnxruntime as ort
2import numpy as np
3
4session = ort.InferenceSession("meta_model.onnx")
5input_data = np.array([[...]], dtype=np.float32) # shape (1, 29)
6inputs = {session.get_inputs()[0].name: input_data}
7outputs = session.run(None, inputs)
8print("Fraud Probability:", outputs[0])✅ Stratified train/test split
✅ StandardScaler normalization
✅ Log loss and AUC optimization
✅ Early stopping and feature importance
✅ Light-weight autoencoder anomaly filter (not included here)Ensemble modeling reduces false positives and model drift.
Models are robust against outliers and data shifts.
TFLite autoencoder (optional) can detect unknown fraud patterns.1models/
2├── xgb_model.onnx
3├── lgb_model.onnx
4├── cat_model.onnx
5├── rf_model.onnx
6├── meta_model.onnx
7├── feature_names.jsonEasily convert ONNX to TFLite, TensorRT, or CoreML.
Deploy via FastAPI, Flask, Streamlit, or ONNX runtime on edge devices.