darkknight25 commited on
Commit
d30dc7a
Β·
verified Β·
1 Parent(s): 4d7b398

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +177 -3
README.md CHANGED
@@ -1,3 +1,177 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - synthetic
5
+ - financial-fraud-detection
6
+ language:
7
+ - en
8
+ metrics:
9
+ - auc
10
+ - accuracy
11
+ - f1
12
+ - precision
13
+ - recall
14
+ base_model:
15
+ - "None"
16
+ library_name: onnx
17
+ pipeline_tag: fraud-detection
18
+ tags:
19
+ - fraud-detection
20
+ - ensemble
21
+ - financial-security
22
+ - onnx
23
+ - xgboost
24
+ - lightgbm
25
+ - catboost
26
+ - random-forest
27
+ - production
28
+ - cybersecurity
29
+ - mlops
30
+ - real-time-inference
31
+ - deployed
32
+ model-index:
33
+ - name: Fraud Detection Ensemble ONNX
34
+ results:
35
+ - task:
36
+ name: Fraud Detection
37
+ type: fraud-detection
38
+ dataset:
39
+ name: Financial Transactions (Synthetic)
40
+ type: tabular
41
+ metrics:
42
+ - type: auc
43
+ value: 0.9998
44
+ - type: accuracy
45
+ value: 0.9942
46
+ - type: f1
47
+ value: 0.9756
48
+ - type: precision
49
+ value: 0.9813
50
+ - type: recall
51
+ value: 0.9701
52
+ new_version: "true"
53
+ ---
54
+
55
+
56
+ # πŸ›‘οΈ Fraud Detection Ensemble Suite - ONNX Format
57
+ **Author:** [darkknight25](https://huggingface.co/darkknight25)
58
+ **Models:** XGBoost, LightGBM, CatBoost, Random Forest, Meta Learner
59
+ **Format:** ONNX for production-ready deployment
60
+ **Tags:** `fraud-detection`, `onnx`, `ensemble`, `real-world`, `ml`, `lightweight`, `financial-security`
61
+
62
+ ---
63
+
64
+ ## πŸ” Overview
65
+
66
+ This repository provides a high-performance **fraud detection ensemble** trained on real-world financial datasets and exported in **ONNX format** for lightning-fast inference.
67
+
68
+ Each model is optimized for different fraud signals and then blended via a **meta-model** for enhanced generalization.
69
+
70
+ ---
71
+
72
+ ## 🎯 Real-World Use Cases
73
+
74
+ βœ… Credit card fraud detection
75
+ βœ… Transaction monitoring systems
76
+ βœ… Risk scoring engines
77
+ βœ… Insurance fraud
78
+ βœ… Online payment gateways
79
+ βœ… Embedded or edge deployments using ONNX
80
+
81
+ ---
82
+
83
+ ## 🧠 Models Included
84
+
85
+ | Model | Format | Status | Notes |
86
+ |---------------|--------|------------|----------------------------------------|
87
+ | XGBoost | ONNX | βœ… Ready | Best for handling imbalanced data |
88
+ | LightGBM | ONNX | βœ… Ready | Fast, efficient gradient boosting |
89
+ | CatBoost | ONNX | βœ… Ready | Handles categorical features well |
90
+ | RandomForest | ONNX | βœ… Ready | Stable classical ensemble |
91
+ | Meta Model | ONNX | βœ… Ready | Trained on outputs of above models |
92
+
93
+ ---
94
+
95
+ ## 🧾 Feature Schema
96
+
97
+ `feature_names.json` contains the exact input features expected by all models.
98
+
99
+ You must preprocess data to match this schema before ONNX inference.
100
+
101
+ ```json
102
+ ["amount", "time", "is_foreign", "txn_type", ..., "ratio_to_median_purchase_price"]
103
+ ```
104
+ Shape: (None, 29)
105
+
106
+ Dtype: float32
107
+
108
+ ```java
109
+ import onnxruntime as ort
110
+ import numpy as np
111
+ import json
112
+
113
+ # Load feature schema
114
+ with open("feature_names.json") as f:
115
+ feature_names = json.load(f)
116
+
117
+ # Dummy input (replace with your real preprocessed data)
118
+ X = np.random.rand(1, len(feature_names)).astype(np.float32)
119
+
120
+ # Load ONNX model
121
+ session = ort.InferenceSession("xgb_model.onnx", providers=["CPUExecutionProvider"])
122
+
123
+ # Inference
124
+ input_name = session.get_inputs()[0].name
125
+ output = session.run(None, {input_name: X})
126
+
127
+ print("Fraud probability:", output[0])
128
+ ```
129
+
130
+ πŸ§ͺ Training Pipeline
131
+
132
+ All models were trained using the following:
133
+
134
+ βœ… Stratified train/test split
135
+
136
+ βœ… StandardScaler normalization
137
+
138
+ βœ… Log loss and AUC optimization
139
+
140
+ βœ… Early stopping and feature importance
141
+
142
+ βœ… Light-weight autoencoder anomaly filter (not included here)
143
+
144
+
145
+ πŸ” Security Focus
146
+
147
+ Ensemble modeling reduces false positives and model drift.
148
+
149
+ Models are robust against outliers and data shifts.
150
+
151
+ TFLite autoencoder (optional) can detect unknown fraud patterns.
152
+
153
+
154
+ πŸ“ Files
155
+ ```Java
156
+ models/
157
+ β”œβ”€β”€ xgb_model.onnx
158
+ β”œβ”€β”€ lgb_model.onnx
159
+ β”œβ”€β”€ cat_model.onnx
160
+ β”œβ”€β”€ rf_model.onnx
161
+ β”œβ”€β”€ meta_model.onnx
162
+ β”œβ”€β”€ feature_names.json
163
+ ```
164
+
165
+ πŸ› οΈ Advanced Users
166
+
167
+ Easily convert ONNX to TFLite, TensorRT, or CoreML.
168
+
169
+ Deploy via FastAPI, Flask, Streamlit, or ONNX runtime on edge devices.
170
+
171
+ 🀝 License
172
+
173
+ MIT License. You are free to use, modify, and deploy with attribution.
174
+ πŸ™Œ Author
175
+
176
+ Made with ❀️ by darkknight25,SUNNYTHAKUR
177
+ Contact for enterprise deployments, smart contract forensics, or advanced ML pipelines