--- license: mit language: - en tags: - fraud-detection - binary-classification - tabular-classification - explainable-ai - xai - trustworthy-ai - responsible-ai - finance - scikit-learn - lead-ai-labs - synthetic-data pipeline_tag: tabular-classification library_name: sklearn --- # Lead.AI Fraud Detection Model **Binary transaction fraud classifier with transparent decision reasoning and XAI explainability** > Part of the [Lead.AI Labs](https://www.lead-ai.us) Trustworthy AI Suite > Author: [Arun Kumar Gharami](https://huggingface.co/arun-gharami) | [Google Scholar](https://scholar.google.com/citations?user=uy4i5soAAAAJ&hl=en) --- ## Model Overview Lead.AI Fraud Detection Model is a binary tabular classifier that labels individual financial transactions as **Fraud** or **Safe** using behavioral and financial features. Alongside each prediction, the model surfaces a risk score and a plain-language explanation of the key factors driving the decision โ€” making AI-assisted fraud triage transparent and auditable. This is the foundational classifier in the Lead.AI Fraud Detection system. For the extended three-tier risk scorer (Low / Medium / High), see [lead-ai-fraud-shield](https://huggingface.co/arun-gharami/lead-ai-fraud-shield). The model is designed for **educational, research, prototyping, and demonstration** contexts. --- ## Intended Use **Appropriate uses:** - Research and experimentation with explainable fraud detection classifiers - Prototyping fraud risk dashboards, triage queues, and investigation tools - Educational demonstrations of XAI in financial ML contexts - Interactive demos (see [Fraud Detection XAI Demo](https://huggingface.co/spaces/arun-gharami/fraud-detection-xai-demo)) **Not intended for:** - Production fraud enforcement or automated transaction blocking - Sole basis for financial, legal, or fraud-related decisions about individuals - Deployment in regulated financial systems without proper validation and compliance review --- ## Features | Feature | Type | Description | |---------|------|-------------| | `transaction_amount` | float | Transaction value in currency units | | `transaction_hour` | int | Hour of transaction (0โ€“23) | | `account_age_days` | int | Days since account creation | | `previous_chargebacks` | int | Historical chargeback count | | `transaction_velocity_1h` | int | Number of transactions in last 1 hour | | `transaction_velocity_24h` | int | Number of transactions in last 24 hours | | `is_international` | int | Binary flag: 1 = international transaction | | `is_high_risk_merchant` | int | Binary flag: 1 = high-risk merchant category | | `customer_risk_score` | float | Aggregated customer risk indicator (0.0โ€“1.0) | --- ## Output Format ```json { "prediction": "Fraud", "risk_score": 0.91, "explanation": "High transaction velocity in the past hour, new account, and international flag are the primary risk drivers." } ``` | Output | Values | |--------|--------| | `prediction` | `Fraud` / `Safe` | | `risk_score` | Float 0.0โ€“1.0 (fraud probability) | | `explanation` | Natural-language explanation of top risk drivers | --- ## Example Usage ```python import joblib import pandas as pd model = joblib.load("model/model.joblib") sample = pd.DataFrame([{ "transaction_amount": 850.0, "transaction_hour": 2, "account_age_days": 12, "previous_chargebacks": 2, "transaction_velocity_1h": 5, "transaction_velocity_24h": 18, "is_international": 1, "is_high_risk_merchant": 1, "customer_risk_score": 0.87 }]) prediction = model.predict(sample) probability = model.predict_proba(sample) print(prediction, probability) ``` --- ## Interactive Demo Try the model live in your browser: ๐Ÿ–ฅ๏ธ **[Fraud Detection XAI Demo](https://huggingface.co/spaces/arun-gharami/fraud-detection-xai-demo)** Enter a transaction, get a fraud/safe prediction, and see the SHAP-style explanation instantly. --- ## Explainability / XAI This model surfaces a natural-language explanation with each prediction, identifying the top features that drove the fraud or safe classification. The explanation is designed to support: - Human review and investigation workflows - Audit trail generation for flagged transactions - User-facing transparency in decision-support tools - Research into XAI methods for tabular financial data --- ## Training Data Note This model was trained on the [lead-ai-fraud-detection-dataset-v2](https://huggingface.co/datasets/arun-gharami/lead-ai-fraud-detection-dataset-v2) โ€” a **fully synthetic 100K-transaction dataset** generated to simulate plausible fraud patterns. The dataset: - Contains **no real customer financial data** - Was generated for research, educational, and prototyping purposes - May not capture the full diversity of real-world fraud distributions --- ## Responsible AI & Limitations - **Synthetic training data:** Real-world performance is unknown and unvalidated - **No regulatory certification:** Not reviewed or certified by any financial regulatory body - **Binary framing:** Real fraud landscapes are probabilistic and contextual; a binary label is a simplification - **False positive risk:** Innocent transactions may be flagged; human review is essential - **Concept drift:** Fraud patterns evolve; models require periodic retraining --- ## Ethical Use Statement > This model is intended for educational, research, prototyping, and decision-support use only. > It **must not** be used as the sole basis for financial, legal, lending, or fraud enforcement > decisions affecting individuals. Users are responsible for all validation, bias testing, > legal review, and compliance requirements before any production deployment. --- ## Citation ```bibtex @misc{gharami2024frauddetection, author = {Arun Kumar Gharami}, title = {Lead.AI Fraud Detection Model: Binary Transaction Fraud Classifier with XAI}, year = {2024}, publisher = {Hugging Face}, howpublished = {\url{https://huggingface.co/arun-gharami/lead-ai-fraud-detection-model}} } ``` --- ## License MIT โ€” See [LICENSE](LICENSE) for details. --- *Lead.AI Labs โ€” Trustworthy AI Systems for Practical Business Intelligence* [lead-ai.us](https://www.lead-ai.us) ยท [GitHub](https://github.com/Arungharami) ยท [LinkedIn](https://www.linkedin.com/in/arunkgharami)