Datasets:
|
Download README.md from thanatchon36/fraud-synth-bench: direct link, hf CLI and curl.
- Browser
- Download file 9.65 kB
-
https://huggingface.co/datasets/thanatchon36/fraud-synth-bench/resolve/main/README.md
- Command line
-
hf download hf://datasets/thanatchon36/fraud-synth-bench/README.md
-
curl -L -o README.md https://huggingface.co/datasets/thanatchon36/fraud-synth-bench/resolve/main/README.md
9.65 kB
| license: apache-2.0 | |
| pretty_name: "fraud-synth-bench: synthetic transaction data for fraud-detection experiments" | |
| language: | |
| - en | |
| size_categories: | |
| - 1M<n<10M | |
| task_categories: | |
| - tabular-classification | |
| tags: | |
| - fraud-detection | |
| - synthetic | |
| - finance | |
| - transactions | |
| - concept-drift | |
| - graph | |
| - class-imbalance | |
| - label-delay | |
| - benchmark | |
| - pre-registered | |
| configs: | |
| - config_name: small_transactions | |
| default: true | |
| data_files: | |
| - {split: seed0, path: data/small_fr0.005/seed0/transactions.parquet} | |
| - {split: seed1, path: data/small_fr0.005/seed1/transactions.parquet} | |
| - {split: seed2, path: data/small_fr0.005/seed2/transactions.parquet} | |
| - {split: seed3, path: data/small_fr0.005/seed3/transactions.parquet} | |
| - {split: seed4, path: data/small_fr0.005/seed4/transactions.parquet} | |
| - config_name: small_labels | |
| data_files: | |
| - {split: seed0, path: data/small_fr0.005/seed0/labels.parquet} | |
| - {split: seed1, path: data/small_fr0.005/seed1/labels.parquet} | |
| - {split: seed2, path: data/small_fr0.005/seed2/labels.parquet} | |
| - {split: seed3, path: data/small_fr0.005/seed3/labels.parquet} | |
| - {split: seed4, path: data/small_fr0.005/seed4/labels.parquet} | |
| - config_name: small_long_transactions | |
| data_files: | |
| - {split: seed0, path: data/small_long/seed0/transactions.parquet} | |
| - {split: seed1, path: data/small_long/seed1/transactions.parquet} | |
| - {split: seed2, path: data/small_long/seed2/transactions.parquet} | |
| - {split: seed3, path: data/small_long/seed3/transactions.parquet} | |
| - {split: seed4, path: data/small_long/seed4/transactions.parquet} | |
| - config_name: small_long_labels | |
| data_files: | |
| - {split: seed0, path: data/small_long/seed0/labels.parquet} | |
| - {split: seed1, path: data/small_long/seed1/labels.parquet} | |
| - {split: seed2, path: data/small_long/seed2/labels.parquet} | |
| - {split: seed3, path: data/small_long/seed3/labels.parquet} | |
| - {split: seed4, path: data/small_long/seed4/labels.parquet} | |
| - config_name: index | |
| data_files: index.parquet | |
| # fraud-synth-bench: synthetic transaction data | |
| Every dataset behind the paper *Classic and Modern Fraud Detectors under Controlled Imbalance, Drift, Ring Fraud and Label Delay: A Reproducible Study on Synthetic Data* (Chongmankhong, 2026): 45 generated datasets (9 experimental conditions × 5 seeds), about 200,000 transactions each, plus the per-run results of the experiments. | |
| 📄 [Paper (web)](https://thanatchon36.github.io/fraud-synth-bench/paper/) · [PDF](https://github.com/thanatchon36/fraud-synth-bench/raw/main/paper/paper.pdf) · 💻 [Code](https://github.com/thanatchon36/fraud-synth-bench) · 🔖 [DOI 10.5281/zenodo.23343483](https://doi.org/10.5281/zenodo.23343483) | |
| > **This is synthetic data.** No real transactions, customers or institutions were used to build, fit or calibrate the generator, and it contains no PII. Distributions are stylised from qualitative descriptions in the literature. Findings on this data are evidence about *mechanisms*, not about any real payment system. Absolute AUPRC values should not be compared with published numbers on real data. | |
| ## What's here | |
| | Condition (`data/<condition>/seed{0..4}/`) | Preset | Fraud rate | Manipulated | Used by | | |
| |---|---|---|---|---| | |
| | `small_fr0.001` | `small` | 0.1% | extreme imbalance | RQ1 | | |
| | `small_fr0.005` | `small` | 0.5% | baseline | RQ1, RQ5 | | |
| | `small_fr0.01` | `small` | 1% | imbalance | RQ1 | | |
| | `small_long_drift` | `small_long` | 0.5% | fraud tactics switch at day 54 | RQ2 | | |
| | `small_ring0.0`, `small_ring0.25`, `small_ring0.5`, `small_ring0.75` | `small` | 0.5% | share of fraud from ring scenarios | RQ3 | | |
| | `small_long` | `small_long` | 0.5% | baseline for label delay (the delay itself is in `labels`) | RQ4 | | |
| `small` has 20,000 accounts over 30 days. `small_long` has 8,000 accounts over 90 days. The total is 8.9M transactions, stored in about 190 MB. `small_fr0.005` and `small_long` are also what `make data` produces. | |
| Other files: | |
| - `index.parquet`: one row per dataset, with its path, sizes and full `content_hash`. | |
| - `results/runs/rq{1..4}.jsonl`: one line per model × condition × seed, with metrics and the `dataset_hash` of the data it ran on. RQ5 is computed from the RQ1 runs. | |
| - `results/summary.json`, `results/summary/`: the aggregates that fill in the paper's numbers. `results/skipped.json` records the skipped model (TabPFN). | |
| - `docs/DATA_CARD.md`: the full data card (simulation details, validation, limitations). `docs/DATA_CARD_STATS.md`: descriptive statistics. | |
| ## Tables | |
| Each `data/<condition>/seed<n>/` directory holds: | |
| | File | Grain | Columns | | |
| |---|---|---| | |
| | `transactions.parquet` | one row per transaction | `tx_id`, `timestamp`, `account_id`, `merchant_id` (null for transfers), `counterparty_id` (null for card payments), `device_id` (null for card-present), `amount`, `mcc`, `channel` (pos / online / transfer), `country` | | |
| | `labels.parquet` | one row per transaction | `tx_id`, `is_fraud`, `observed_label`, `label_available_at`, `scenario`, `fraud_event_id` | | |
| | `accounts.parquet` | one row per account | `account_id`, `opened_at`, `home_country`, `segment`, `account_role` | | |
| | `merchants.parquet` | one row per merchant | `merchant_id`, `mcc`, `country`, `opened_at` | | |
| | `edges.parquet` | one row per (src, dst, type) | `src_type`, `src_id`, `dst_type`, `dst_id`, `edge_type` (pays / transfers / uses_device), `first_seen`, `last_seen`, `n_tx` | | |
| | `manifest.json` | per dataset | generator version, preset, seed, all parameters, content hash, summary stats, library versions | | |
| IDs are only meaningful within one dataset. Don't pool seeds or conditions without keying on them. | |
| Fraud comes from eight scenarios: `card_testing`, `account_takeover`, `velocity_abuse`, `friendly_fraud`, `bust_out`, and three ring scenarios, `mule_network`, `merchant_collusion` and `synthetic_identity`. | |
| ## ⚠️ Avoiding leakage | |
| - `labels.is_fraud`, `labels.scenario`, `labels.fraud_event_id` and `accounts.account_role` reveal the answer. Use them for evaluation and analysis, **never as model features**. | |
| - Train on `observed_label` only where `label_available_at` ≤ your training cutoff. Undetected fraud keeps `observed_label = 0` forever. | |
| - `edges` is aggregated over the whole timeline, so using it directly as a feature source leaks the future. Build time-respecting graph features from `transactions` with a cutoff. | |
| - Split by time, not at random. | |
| ## Usage | |
| The viewer configs cover the two baseline conditions, with one split per seed: | |
| ```python | |
| from datasets import load_dataset | |
| tx = load_dataset("thanatchon36/fraud-synth-bench", "small_transactions", split="seed0") | |
| labels = load_dataset("thanatchon36/fraud-synth-bench", "small_labels", split="seed0") | |
| ``` | |
| Any condition or table can be read by path: | |
| ```python | |
| import polars as pl | |
| base = "hf://datasets/thanatchon36/fraud-synth-bench/data/small_long_drift/seed0" | |
| df = pl.read_parquet(f"{base}/transactions.parquet").join( | |
| pl.read_parquet(f"{base}/labels.parquet"), on="tx_id" | |
| ) | |
| ``` | |
| To use a whole directory with the project's loader, which restores the column types and exposes the content hash: | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| from fraudlab.synth import load # https://github.com/thanatchon36/fraud-synth-bench | |
| root = snapshot_download("thanatchon36/fraud-synth-bench", repo_type="dataset", | |
| allow_patterns="data/small_ring0.5/seed0/*") | |
| ds = load(f"{root}/data/small_ring0.5/seed0") | |
| ``` | |
| ## Reproducing it | |
| The output is a pure function of the config. These are the commands that produced this upload (with `--seed 0` to `4`, generator version 0.1.0): | |
| ```bash | |
| fraudlab generate --preset small --fraud-rate 0.005 --seed 0 --out data/small_fr0.005/seed0 | |
| fraudlab generate --preset small --fraud-rate 0.005 --ring-share 0.25 --seed 0 --out data/small_ring0.25/seed0 | |
| fraudlab generate --preset small_long --drift rq2 --seed 0 --out data/small_long_drift/seed0 | |
| fraudlab generate --preset small_long --fraud-rate 0.005 --seed 0 --out data/small_long/seed0 | |
| ``` | |
| The `content_hash` covers column names, dtypes and values, not parquet writer metadata. All 45 datasets here were checked against the `dataset_hash` values recorded in `results/runs/*.jsonl`, and all match. The `tiny` (20k transactions) and `full` (2M) presets aren't in the paper and aren't uploaded. The commands above generate them. | |
| ## Limitations | |
| 1. **Not calibrated to real data.** Real data has heavier tails, more merchant categories, and seasonality that the generator doesn't model. | |
| 2. **Fraud is more mechanistic than in reality.** Each scenario has a clean signature, and most are easier to detect than real fraud, except `friendly_fraud`, which is close to undetectable by design. | |
| 3. **Few ring events.** At `small` with 0.5% fraud, ring scenarios contribute about 4–8 events each, so per-scenario results have high variance. | |
| 4. **No adaptive adversary.** Drift is scheduled, not a reaction to a deployed model, and legitimate behaviour doesn't drift. | |
| 5. **Single currency and abstract countries** (`C00`–`C11`). | |
| Not intended for estimating real-world fraud prevalence or losses, benchmarking vendor products, or training production models. | |
| ## Citation | |
| ```bibtex | |
| @software{chongmankhong2026fraudsynthbench, | |
| author = {Chongmankhong, Thanatchon}, | |
| title = {fraud-synth-bench: Reproducible fraud-analytics research on synthetic data}, | |
| year = {2026}, | |
| doi = {10.5281/zenodo.23343483}, | |
| url = {https://github.com/thanatchon36/fraud-synth-bench} | |
| } | |
| ``` | |
| ## License | |
| Apache-2.0, the same as the code. | |