# 🏦 BankShield-2M: Synthetic Banking & Fraud Detection Dataset > **2,000,000 records Β· 5 relational tables Β· 64 features Β· Multi-country Β· Analyst-labeled** > > **[⬇ Get the Full Dataset β†’](https://synthox.gumroad.com/l/jsyco)** --- ## Why This Dataset Exists Every serious fraud-detection, credit-risk, or behavioral-analytics model eventually hits the same wall: **real banking data is locked behind NDAs, GDPR constraints, and institutional gatekeepers**. Public alternatives are either too small, too narrow, or stripped of the relational structure that makes real-world models actually work. BankShield-2M was engineered to close that gap β€” a fully synthetic, privacy-safe dataset that mirrors the statistical properties, relational schema, and domain complexity of a real retail bank operating at scale. --- ## Dataset at a Glance | Table | Full Dataset | Sample | Key Features | |---|---|---|---| | `transactions` | 2,000,000 | 5,000 | 12 cols, fraud labels, geo, device, merchant | | `customers` | 50,000 | 2,500 | 16 cols, PII-safe, credit score, income, risk tier | | `accounts` | 75,000 | 3,750 | 11 cols, IBAN, multi-currency, balance, credit limit | | `fraud_alerts` | 22,000 | 1,100 | 9 cols, risk score, analyst notes, alert lifecycle | | `devices` | 35,000 | 1,750 | 10 cols, fingerprint, OS, browser, trust status | | **Total** | **2,182,000** | **14,100** | **58 features** | --- ## Schema & Relational Structure ``` customers (customer_id PK) β”‚ β”œβ”€β”€< accounts (account_id PK, customer_id FK) β”‚ β”‚ β”‚ └──< transactions (transaction_id PK, account_id FK) β”‚ β”‚ β”‚ └──< fraud_alerts (alert_id PK, transaction_id FK) β”‚ └──< devices (device_id PK, customer_id FK) ``` **Full referential integrity across all five tables.** Every `account_id` in transactions traces back to a `customer_id`; every `transaction_id` in alerts traces back to a flagged transaction. This is the graph structure that production fraud systems actually operate on. --- ## Feature Deep-Dive ### `transactions.csv` β€” The Core Signal Table ``` transaction_id β”‚ UUID, unique per event account_id β”‚ FK β†’ accounts transaction_date β”‚ ISO 8601 with milliseconds (2021–2024) merchant_name β”‚ 50+ real-world merchants (Walmart, Apple, Texaco…) merchant_category β”‚ 11 categories: ONLINE_RETAIL, GROCERY, RESTAURANT, β”‚ GAS_STATION, TRAVEL, ENTERTAINMENT, ATM_WITHDRAWAL, β”‚ HEALTHCARE, UTILITY, WIRE_TRANSFER, OTHER amount_usd β”‚ $0.67 – $49,622.28 (median $58, p95 $640) transaction_type β”‚ DEBIT / CREDIT / TRANSFER / REVERSAL location_city β”‚ Real city names across 10+ countries location_country β”‚ US(35%), GB(18%), DE(15%), AE(10%), ES/FR/NL/IT… device_type β”‚ MOBILE_APP(41%), POS_TERMINAL(30%), WEB_BROWSER(21%), β”‚ ATM(7%), PHONE(1%) ip_address β”‚ Unique IPv4 per transaction is_fraud β”‚ Binary label β€” 0.84% positive rate (realistic imbalance) ``` **Why it matters:** The class imbalance of 0.84% is not arbitrary β€” it mirrors the empirical 0.5–1.5% fraud rate documented across major card networks. Models trained on artificially balanced datasets fail in production; this one won't. --- ### `fraud_alerts.csv` β€” The Intelligence Layer ``` alert_id β”‚ UUID transaction_id β”‚ FK β†’ transactions alert_timestamp β”‚ When the alert was generated alert_type β”‚ GEO_ANOMALY(30%), ML_MODEL_FLAG(19%), β”‚ AMOUNT_ANOMALY(18%), VELOCITY_CHECK(15%), β”‚ BEHAVIORAL_ANOMALY(11%), DEVICE_FINGERPRINT(8%) risk_score β”‚ Continuous [0.102 – 0.989], mean=0.722 alert_status β”‚ CONFIRMED_FRAUD(42%), RESOLVED(21%), β”‚ INVESTIGATING(14%), FALSE_POSITIVE(12%), NEW(10%) analyst_notes β”‚ Free-text investigation notes (NLP-ready) resolution_timestamp β”‚ SLA-trackable, NULL for unresolved cases confirmed_fraud β”‚ Final binary label β€” 77.4% confirmation rate ``` **Why it matters:** Six alert types encode the real taxonomy of financial fraud detection β€” geographic impossibility, behavioral deviation, device compromise, velocity abuse, and ML-model flagging. The analyst notes column is a rare NLP training signal for financial domain adaptation. --- ### `customers.csv` β€” The Identity Graph ``` customer_id β”‚ UUID full_name β”‚ Internationalized (UK, US, DE, AE, FR, NL names) date_of_birth β”‚ Full age distribution gender β”‚ M / F / Non-binary national_id β”‚ Format-correct per country (SSN, NIN, UAE ID…) email β”‚ Realistic domain distribution phone β”‚ E.164 international format address/city/zip β”‚ Country-coherent (UK postcodes, US ZIPs, DE PLZs) country β”‚ US(39%), GB(20%), DE(15%), AE(11%), CH/IT/NL/FR… credit_score β”‚ FICO-range [300–850], mean=679, std=90 income_annual_usd β”‚ [$12K – $689K], realistic skew customer_since β”‚ 2010–2023 β€” enables customer lifetime features risk_tier β”‚ HIGH(36%), LOW(26%), MEDIUM(23%), VERY_HIGH(14%) is_fraud_suspect β”‚ 2.68% flagged β€” enables customer-level fraud scoring ``` --- ### `accounts.csv` β€” The Financial Ledger ``` account_id β”‚ UUID customer_id β”‚ FK β†’ customers (up to 3 accounts per customer) account_type β”‚ CHECKING(44%), SAVINGS(30%), CREDIT(20%), BUSINESS(5%) account_number β”‚ 10-digit synthetic number iban β”‚ Format-valid IBANs for GB, DE, US, AE currency β”‚ USD(40%), EUR(24%), GBP(21%), AED(10%), CHF(3%) opened_date β”‚ Account age signal balance β”‚ [-$63K – $1.44M] (negative balances included) credit_limit β”‚ Present only for CREDIT accounts [$517 – $74K] status β”‚ ACTIVE(88%), SUSPENDED(7%), CLOSED(5%) is_flagged β”‚ 2.9% β€” account-level risk signal ``` --- ### `devices.csv` β€” The Trust & Telemetry Layer ``` device_id β”‚ UUID customer_id β”‚ FK β†’ customers device_fingerprint β”‚ MD5-format hash β€” unique per device device_type β”‚ MOBILE(55%), DESKTOP(35%), TABLET(10%) os β”‚ iOS(36%), Android(29%), Windows(20%), macOS(11%), Linux(4%) browser β”‚ App(38%), Chrome(32%), Safari(18%), Firefox(6%), Edge(6%) first_seen β”‚ Device registration date last_seen β”‚ Last activity date β€” enables recency features is_trusted β”‚ 75.7% trusted baseline is_fraud_device β”‚ 3.8% compromise rate ``` --- ## What You Can Build ### Supervised Learning β€” Fraud Detection - Binary classifier on `is_fraud` with full feature engineering across all 5 tables - Multi-label classification (alert type prediction) - Probability calibration benchmarking under real class imbalance (0.84%) ### Risk Scoring & Regression - Customer-level risk score modeling using `credit_score`, `income_annual_usd`, `risk_tier`, transaction history - Account-level default probability from `balance`, `credit_limit`, `status`, `is_flagged` ### Anomaly Detection (Unsupervised) - Isolation Forest / Autoencoder baselines on transaction patterns - Device trust scoring from behavioral telemetry - Geographic impossibility detection from `location_city/country` + `ip_address` ### Graph Neural Networks - Heterogeneous graph: customer β†’ account β†’ transaction β†’ alert - Fraud ring detection via shared device fingerprints or IPs - Link prediction: which accounts belong to the same fraud ring? ### NLP / LLM Fine-Tuning - Analyst notes as training signal for financial-domain LLMs - Named entity recognition on merchant names - Text classification of `analyst_notes` β†’ `alert_type` ### Time-Series Analysis - Transaction velocity features (hourly/daily aggregations) - Customer behavioral drift detection over 2021–2024 - Seasonal fraud pattern analysis ### Multi-Task Learning - Simultaneous prediction of `is_fraud`, `risk_score`, and `alert_type` - Joint customer + account + transaction risk models ### MLOps & Benchmark Infrastructure - Reproducible train/val/test splits with temporal holdout - Class-imbalance benchmarking: SMOTE, focal loss, class-weighted XGBoost - Model performance baselines on a scale unavailable in public datasets --- ## Statistical Properties ### Realistic Class Distribution | Signal | Positive Rate | Notes | |---|---|---| | `transactions.is_fraud` | 0.84% | Matches real-world card fraud rates | | `fraud_alerts.confirmed_fraud` | 77.4% | High-quality alert pipeline | | `customers.is_fraud_suspect` | 2.68% | Customer-level exposure | | `accounts.is_flagged` | 2.93% | Account-level risk | | `devices.is_fraud_device` | 3.83% | Compromised device rate | ### Geographic Realism | Country | Customers | Primary Currency | |---|---|---| | United States | 39% | USD | | United Kingdom | 20% | GBP | | Germany | 15% | EUR | | UAE | 11% | AED | | Switzerland, Italy, Netherlands, France | 15% combined | CHF / EUR | ### Temporal Coverage - **Transaction window:** January 2021 – June 2024 (3.5 years) - **Customer tenure:** 2010–2023 (14-year range for long-term behavioral modeling) - **Alert resolution SLA:** Computable from `alert_timestamp` β†’ `resolution_timestamp` (27% unresolved β€” mirrors real investigation queues) --- ## Data Quality Notes | Table | Known Nulls | Notes | |---|---|---| | `transactions` | 0.38% in `transaction_date` | Realistic ETL artifacts | | `fraud_alerts` | 24.5% in `resolution_timestamp` | Unresolved/open investigations | | `accounts` | 79.8% in `credit_limit` | NULL only for non-CREDIT accounts | | `customers` | 0 | Complete | | `devices` | 0 | Complete | Nulls are **by design**, not data corruption. `credit_limit` is NULL for CHECKING/SAVINGS/BUSINESS accounts because it is inapplicable. Unresolved `resolution_timestamp` values represent active investigation cases β€” a feature, not a bug. --- ## Comparison to Existing Public Datasets | Dataset | Records | Tables | Fraud Labels | Relational | Multi-Country | Analyst Notes | |---|---|---|---|---|---|---| | **BankShield-2M** | **2M+** | **5** | **βœ… Multi-level** | **βœ… Full FK** | **βœ… 10+ countries** | **βœ… Yes** | | IEEE-CIS Fraud 2019 | 590K | 2 | βœ… | ❌ | ❌ | ❌ | | PaySim | 6.3M | 1 | βœ… | ❌ | ❌ | ❌ | | Credit Card Fraud (Kaggle) | 284K | 1 | βœ… | ❌ | ❌ | ❌ | | BankSim | 594K | 1 | βœ… | ❌ | ❌ | ❌ | --- ## License & Usage - **Fully synthetic** β€” no real individuals, no PII, GDPR/CCPA compliant - **Commercial use permitted** under the dataset license - Suitable for academic research, ML product development, FinTech prototyping, red-team simulation, and fraud analytics education --- ## Get the Full 2-Million-Record Dataset The files in this repository are a **0.25% sample** of the complete dataset. The full release includes: - `transactions.csv` β€” 2,000,000 rows - `customers.csv` β€” 50,000 rows - `accounts.csv` β€” 75,000 rows - `fraud_alerts.csv` β€” 22,000 rows - `devices.csv` β€” 35,000 rows - Data dictionary (`schema.md`) - Suggested train/val/test split methodology **[⬇ Purchase on Gumroad β†’](https://synthox.gumroad.com/l/jsyco)** --- ## Citation If you use this dataset in academic work: ```bibtex @dataset{BankShield2m_2024, title = {BankShield-2M: Synthetic Banking and Fraud Detection Dataset}, year = {2024}, publisher = {Synthox}, url = {https://synthox.gumroad.com/l/jsyco} } ``` --- *Dataset generated and maintained by [Synthox](https://synthox.gumroad.com). For questions, feature requests, or bulk licensing, contact via Gumroad.*