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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🏦 BankShield-2M: Synthetic Banking & Fraud Detection Dataset
|
| 2 |
+
|
| 3 |
+
> **2,000,000 records · 5 relational tables · 64 features · Multi-country · Analyst-labeled**
|
| 4 |
+
>
|
| 5 |
+
> **[⬇ Get the Full Dataset →](https://synthox.gumroad.com/l/jsyco)**
|
| 6 |
+
|
| 7 |
---
|
| 8 |
+
|
| 9 |
+
## Why This Dataset Exists
|
| 10 |
+
|
| 11 |
+
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.
|
| 12 |
+
|
| 13 |
+
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.
|
| 14 |
+
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
## Dataset at a Glance
|
| 18 |
+
|
| 19 |
+
| Table | Full Dataset | Sample | Key Features |
|
| 20 |
+
|---|---|---|---|
|
| 21 |
+
| `transactions` | 2,000,000 | 5,000 | 12 cols, fraud labels, geo, device, merchant |
|
| 22 |
+
| `customers` | 50,000 | 2,500 | 16 cols, PII-safe, credit score, income, risk tier |
|
| 23 |
+
| `accounts` | 75,000 | 3,750 | 11 cols, IBAN, multi-currency, balance, credit limit |
|
| 24 |
+
| `fraud_alerts` | 22,000 | 1,100 | 9 cols, risk score, analyst notes, alert lifecycle |
|
| 25 |
+
| `devices` | 35,000 | 1,750 | 10 cols, fingerprint, OS, browser, trust status |
|
| 26 |
+
| **Total** | **2,182,000** | **14,100** | **58 features** |
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Schema & Relational Structure
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
customers (customer_id PK)
|
| 34 |
+
│
|
| 35 |
+
├──< accounts (account_id PK, customer_id FK)
|
| 36 |
+
│ │
|
| 37 |
+
│ └──< transactions (transaction_id PK, account_id FK)
|
| 38 |
+
│ │
|
| 39 |
+
│ └──< fraud_alerts (alert_id PK, transaction_id FK)
|
| 40 |
+
│
|
| 41 |
+
└──< devices (device_id PK, customer_id FK)
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
**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.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## Feature Deep-Dive
|
| 49 |
+
|
| 50 |
+
### `transactions.csv` — The Core Signal Table
|
| 51 |
+
```
|
| 52 |
+
transaction_id │ UUID, unique per event
|
| 53 |
+
account_id │ FK → accounts
|
| 54 |
+
transaction_date │ ISO 8601 with milliseconds (2021–2024)
|
| 55 |
+
merchant_name │ 50+ real-world merchants (Walmart, Apple, Texaco…)
|
| 56 |
+
merchant_category │ 11 categories: ONLINE_RETAIL, GROCERY, RESTAURANT,
|
| 57 |
+
│ GAS_STATION, TRAVEL, ENTERTAINMENT, ATM_WITHDRAWAL,
|
| 58 |
+
│ HEALTHCARE, UTILITY, WIRE_TRANSFER, OTHER
|
| 59 |
+
amount_usd │ $0.67 – $49,622.28 (median $58, p95 $640)
|
| 60 |
+
transaction_type │ DEBIT / CREDIT / TRANSFER / REVERSAL
|
| 61 |
+
location_city │ Real city names across 10+ countries
|
| 62 |
+
location_country │ US(35%), GB(18%), DE(15%), AE(10%), ES/FR/NL/IT…
|
| 63 |
+
device_type │ MOBILE_APP(41%), POS_TERMINAL(30%), WEB_BROWSER(21%),
|
| 64 |
+
│ ATM(7%), PHONE(1%)
|
| 65 |
+
ip_address │ Unique IPv4 per transaction
|
| 66 |
+
is_fraud │ Binary label — 0.84% positive rate (realistic imbalance)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
**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.
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
### `fraud_alerts.csv` — The Intelligence Layer
|
| 74 |
+
```
|
| 75 |
+
alert_id │ UUID
|
| 76 |
+
transaction_id │ FK → transactions
|
| 77 |
+
alert_timestamp │ When the alert was generated
|
| 78 |
+
alert_type │ GEO_ANOMALY(30%), ML_MODEL_FLAG(19%),
|
| 79 |
+
│ AMOUNT_ANOMALY(18%), VELOCITY_CHECK(15%),
|
| 80 |
+
│ BEHAVIORAL_ANOMALY(11%), DEVICE_FINGERPRINT(8%)
|
| 81 |
+
risk_score │ Continuous [0.102 – 0.989], mean=0.722
|
| 82 |
+
alert_status │ CONFIRMED_FRAUD(42%), RESOLVED(21%),
|
| 83 |
+
│ INVESTIGATING(14%), FALSE_POSITIVE(12%), NEW(10%)
|
| 84 |
+
analyst_notes │ Free-text investigation notes (NLP-ready)
|
| 85 |
+
resolution_timestamp │ SLA-trackable, NULL for unresolved cases
|
| 86 |
+
confirmed_fraud │ Final binary label — 77.4% confirmation rate
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
**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.
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
+
|
| 93 |
+
### `customers.csv` — The Identity Graph
|
| 94 |
+
```
|
| 95 |
+
customer_id │ UUID
|
| 96 |
+
full_name │ Internationalized (UK, US, DE, AE, FR, NL names)
|
| 97 |
+
date_of_birth │ Full age distribution
|
| 98 |
+
gender │ M / F / Non-binary
|
| 99 |
+
national_id │ Format-correct per country (SSN, NIN, UAE ID…)
|
| 100 |
+
email │ Realistic domain distribution
|
| 101 |
+
phone │ E.164 international format
|
| 102 |
+
address/city/zip │ Country-coherent (UK postcodes, US ZIPs, DE PLZs)
|
| 103 |
+
country │ US(39%), GB(20%), DE(15%), AE(11%), CH/IT/NL/FR…
|
| 104 |
+
credit_score │ FICO-range [300–850], mean=679, std=90
|
| 105 |
+
income_annual_usd │ [$12K – $689K], realistic skew
|
| 106 |
+
customer_since │ 2010–2023 — enables customer lifetime features
|
| 107 |
+
risk_tier │ HIGH(36%), LOW(26%), MEDIUM(23%), VERY_HIGH(14%)
|
| 108 |
+
is_fraud_suspect │ 2.68% flagged — enables customer-level fraud scoring
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
### `accounts.csv` — The Financial Ledger
|
| 114 |
+
```
|
| 115 |
+
account_id │ UUID
|
| 116 |
+
customer_id │ FK → customers (up to 3 accounts per customer)
|
| 117 |
+
account_type │ CHECKING(44%), SAVINGS(30%), CREDIT(20%), BUSINESS(5%)
|
| 118 |
+
account_number │ 10-digit synthetic number
|
| 119 |
+
iban │ Format-valid IBANs for GB, DE, US, AE
|
| 120 |
+
currency │ USD(40%), EUR(24%), GBP(21%), AED(10%), CHF(3%)
|
| 121 |
+
opened_date │ Account age signal
|
| 122 |
+
balance │ [-$63K – $1.44M] (negative balances included)
|
| 123 |
+
credit_limit │ Present only for CREDIT accounts [$517 – $74K]
|
| 124 |
+
status │ ACTIVE(88%), SUSPENDED(7%), CLOSED(5%)
|
| 125 |
+
is_flagged │ 2.9% — account-level risk signal
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
### `devices.csv` — The Trust & Telemetry Layer
|
| 131 |
+
```
|
| 132 |
+
device_id │ UUID
|
| 133 |
+
customer_id │ FK → customers
|
| 134 |
+
device_fingerprint │ MD5-format hash — unique per device
|
| 135 |
+
device_type │ MOBILE(55%), DESKTOP(35%), TABLET(10%)
|
| 136 |
+
os │ iOS(36%), Android(29%), Windows(20%), macOS(11%), Linux(4%)
|
| 137 |
+
browser │ App(38%), Chrome(32%), Safari(18%), Firefox(6%), Edge(6%)
|
| 138 |
+
first_seen │ Device registration date
|
| 139 |
+
last_seen │ Last activity date — enables recency features
|
| 140 |
+
is_trusted │ 75.7% trusted baseline
|
| 141 |
+
is_fraud_device │ 3.8% compromise rate
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
+
---
|
| 145 |
+
|
| 146 |
+
## What You Can Build
|
| 147 |
+
|
| 148 |
+
### Supervised Learning — Fraud Detection
|
| 149 |
+
- Binary classifier on `is_fraud` with full feature engineering across all 5 tables
|
| 150 |
+
- Multi-label classification (alert type prediction)
|
| 151 |
+
- Probability calibration benchmarking under real class imbalance (0.84%)
|
| 152 |
+
|
| 153 |
+
### Risk Scoring & Regression
|
| 154 |
+
- Customer-level risk score modeling using `credit_score`, `income_annual_usd`, `risk_tier`, transaction history
|
| 155 |
+
- Account-level default probability from `balance`, `credit_limit`, `status`, `is_flagged`
|
| 156 |
+
|
| 157 |
+
### Anomaly Detection (Unsupervised)
|
| 158 |
+
- Isolation Forest / Autoencoder baselines on transaction patterns
|
| 159 |
+
- Device trust scoring from behavioral telemetry
|
| 160 |
+
- Geographic impossibility detection from `location_city/country` + `ip_address`
|
| 161 |
+
|
| 162 |
+
### Graph Neural Networks
|
| 163 |
+
- Heterogeneous graph: customer → account → transaction → alert
|
| 164 |
+
- Fraud ring detection via shared device fingerprints or IPs
|
| 165 |
+
- Link prediction: which accounts belong to the same fraud ring?
|
| 166 |
+
|
| 167 |
+
### NLP / LLM Fine-Tuning
|
| 168 |
+
- Analyst notes as training signal for financial-domain LLMs
|
| 169 |
+
- Named entity recognition on merchant names
|
| 170 |
+
- Text classification of `analyst_notes` → `alert_type`
|
| 171 |
+
|
| 172 |
+
### Time-Series Analysis
|
| 173 |
+
- Transaction velocity features (hourly/daily aggregations)
|
| 174 |
+
- Customer behavioral drift detection over 2021–2024
|
| 175 |
+
- Seasonal fraud pattern analysis
|
| 176 |
+
|
| 177 |
+
### Multi-Task Learning
|
| 178 |
+
- Simultaneous prediction of `is_fraud`, `risk_score`, and `alert_type`
|
| 179 |
+
- Joint customer + account + transaction risk models
|
| 180 |
+
|
| 181 |
+
### MLOps & Benchmark Infrastructure
|
| 182 |
+
- Reproducible train/val/test splits with temporal holdout
|
| 183 |
+
- Class-imbalance benchmarking: SMOTE, focal loss, class-weighted XGBoost
|
| 184 |
+
- Model performance baselines on a scale unavailable in public datasets
|
| 185 |
+
|
| 186 |
+
---
|
| 187 |
+
|
| 188 |
+
## Statistical Properties
|
| 189 |
+
|
| 190 |
+
### Realistic Class Distribution
|
| 191 |
+
|
| 192 |
+
| Signal | Positive Rate | Notes |
|
| 193 |
+
|---|---|---|
|
| 194 |
+
| `transactions.is_fraud` | 0.84% | Matches real-world card fraud rates |
|
| 195 |
+
| `fraud_alerts.confirmed_fraud` | 77.4% | High-quality alert pipeline |
|
| 196 |
+
| `customers.is_fraud_suspect` | 2.68% | Customer-level exposure |
|
| 197 |
+
| `accounts.is_flagged` | 2.93% | Account-level risk |
|
| 198 |
+
| `devices.is_fraud_device` | 3.83% | Compromised device rate |
|
| 199 |
+
|
| 200 |
+
### Geographic Realism
|
| 201 |
+
|
| 202 |
+
| Country | Customers | Primary Currency |
|
| 203 |
+
|---|---|---|
|
| 204 |
+
| United States | 39% | USD |
|
| 205 |
+
| United Kingdom | 20% | GBP |
|
| 206 |
+
| Germany | 15% | EUR |
|
| 207 |
+
| UAE | 11% | AED |
|
| 208 |
+
| Switzerland, Italy, Netherlands, France | 15% combined | CHF / EUR |
|
| 209 |
+
|
| 210 |
+
### Temporal Coverage
|
| 211 |
+
- **Transaction window:** January 2021 – June 2024 (3.5 years)
|
| 212 |
+
- **Customer tenure:** 2010–2023 (14-year range for long-term behavioral modeling)
|
| 213 |
+
- **Alert resolution SLA:** Computable from `alert_timestamp` → `resolution_timestamp` (27% unresolved — mirrors real investigation queues)
|
| 214 |
+
|
| 215 |
+
---
|
| 216 |
+
|
| 217 |
+
## Data Quality Notes
|
| 218 |
+
|
| 219 |
+
| Table | Known Nulls | Notes |
|
| 220 |
+
|---|---|---|
|
| 221 |
+
| `transactions` | 0.38% in `transaction_date` | Realistic ETL artifacts |
|
| 222 |
+
| `fraud_alerts` | 24.5% in `resolution_timestamp` | Unresolved/open investigations |
|
| 223 |
+
| `accounts` | 79.8% in `credit_limit` | NULL only for non-CREDIT accounts |
|
| 224 |
+
| `customers` | 0 | Complete |
|
| 225 |
+
| `devices` | 0 | Complete |
|
| 226 |
+
|
| 227 |
+
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.
|
| 228 |
+
|
| 229 |
+
---
|
| 230 |
+
|
| 231 |
+
## Comparison to Existing Public Datasets
|
| 232 |
+
|
| 233 |
+
| Dataset | Records | Tables | Fraud Labels | Relational | Multi-Country | Analyst Notes |
|
| 234 |
+
|---|---|---|---|---|---|---|
|
| 235 |
+
| **BankShield-2M** | **2M+** | **5** | **✅ Multi-level** | **✅ Full FK** | **✅ 10+ countries** | **✅ Yes** |
|
| 236 |
+
| IEEE-CIS Fraud 2019 | 590K | 2 | ✅ | ❌ | ❌ | ❌ |
|
| 237 |
+
| PaySim | 6.3M | 1 | ✅ | ❌ | ❌ | ❌ |
|
| 238 |
+
| Credit Card Fraud (Kaggle) | 284K | 1 | ✅ | ❌ | ❌ | ❌ |
|
| 239 |
+
| BankSim | 594K | 1 | ✅ | ❌ | ❌ | ❌ |
|
| 240 |
+
|
| 241 |
+
---
|
| 242 |
+
|
| 243 |
+
## License & Usage
|
| 244 |
+
|
| 245 |
+
- **Fully synthetic** — no real individuals, no PII, GDPR/CCPA compliant
|
| 246 |
+
- **Commercial use permitted** under the dataset license
|
| 247 |
+
- Suitable for academic research, ML product development, FinTech prototyping, red-team simulation, and fraud analytics education
|
| 248 |
+
|
| 249 |
+
---
|
| 250 |
+
|
| 251 |
+
## Get the Full 2-Million-Record Dataset
|
| 252 |
+
|
| 253 |
+
The files in this repository are a **0.25% sample** of the complete dataset.
|
| 254 |
+
|
| 255 |
+
The full release includes:
|
| 256 |
+
- `transactions.csv` — 2,000,000 rows
|
| 257 |
+
- `customers.csv` — 50,000 rows
|
| 258 |
+
- `accounts.csv` — 75,000 rows
|
| 259 |
+
- `fraud_alerts.csv` — 22,000 rows
|
| 260 |
+
- `devices.csv` — 35,000 rows
|
| 261 |
+
- Data dictionary (`schema.md`)
|
| 262 |
+
- Suggested train/val/test split methodology
|
| 263 |
+
|
| 264 |
+
**[⬇ Purchase on Gumroad →](https://synthox.gumroad.com/l/jsyco)**
|
| 265 |
+
|
| 266 |
+
---
|
| 267 |
+
|
| 268 |
+
## Citation
|
| 269 |
+
|
| 270 |
+
If you use this dataset in academic work:
|
| 271 |
+
|
| 272 |
+
```bibtex
|
| 273 |
+
@dataset{BankShield2m_2024,
|
| 274 |
+
title = {BankShield-2M: Synthetic Banking and Fraud Detection Dataset},
|
| 275 |
+
year = {2024},
|
| 276 |
+
publisher = {Synthox},
|
| 277 |
+
url = {https://synthox.gumroad.com/l/jsyco}
|
| 278 |
+
}
|
| 279 |
+
```
|
| 280 |
+
|
| 281 |
+
---
|
| 282 |
+
|
| 283 |
+
*Dataset generated and maintained by [Synthox](https://synthox.gumroad.com). For questions, feature requests, or bulk licensing, contact via Gumroad.*
|