extract 0 0 0

t22000t/anonymization-before-after

published by @t22000t

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
120
Last 30 days
15
Likes
-
Size
104 KB
Created on HF
2026-05-27
Age
4 months ago

Description

Anonymization Before/After

A small paired tabular dataset showing the same records before and after

a 10-step anonymization pipeline. Useful as a teaching fixture for privacy

courses, a benchmark for anonymization toolkits, and a sanity-check input

for red-team / membership-inference experiments.

Important: the PII in sample_raw.csv is entirely synthetic.

Names follow the pattern Person_001, emails are [email protected],

phone numbers are 555-00XX, and "national IDs" are… See the full description on the dataset page: https://huggingface.co/datasets/t22000t/anonymization-before-after.

Tags

task_categories:tabular-classificationtask_categories:tabular-regressiontask_categories:otherlanguage:enlicense:mitsize_categories:n<1Kformat:csvmodality:tabularmodality:textlibrary:datasetslibrary:pandaslibrary:polarslibrary:mlcroissantregion:usprivacyanonymizationk-anonymitysynthetic-piitabularteachingbenchmarkred-team

README current version from Hugging Face


license: mit
pretty_name: Anonymization Before/After
size_categories:

  • n<1K
    language:
  • en
    task_categories:
  • tabular-classification
  • tabular-regression
  • other
    tags:
  • privacy
  • anonymization
  • k-anonymity
  • synthetic-pii
  • tabular
  • teaching
  • benchmark
  • red-team
    configs:
  • config_name: raw
    data_files: sample_raw.csv
  • config_name: anonymized
    data_files: sample_anonymized.csv

Anonymization Before/After

A small paired tabular dataset showing the same records before and after
a 10-step anonymization pipeline. Useful as a teaching fixture for privacy
courses, a benchmark for anonymization toolkits, and a sanity-check input
for red-team / membership-inference experiments.

Important: the PII in sample_raw.csv is entirely synthetic.
Names follow the pattern Person_001, emails are [email protected],
phone numbers are 555-00XX, and "national IDs" are random 9-digit strings.
No real individual is represented. The dataset is published precisely so
researchers can demonstrate privacy techniques on PII-shaped data without
handling real PII.

At a glance

raw anonymized
Rows 500 339
Columns 16 10
Direct identifiers ✅ present (4) ❌ dropped
Fingerprint columns ✅ present (2) ❌ dropped
Quasi-identifiers exact values generalised (bands / top-N / "Other")
Numeric fields exact values multiplicative noise injected
Dates exact dates HMAC-perturbed ±7 days
k-anonymity (over age/region/gender) k=1 in many groups k≥5 (rest suppressed)

The 161 missing rows in anonymized were suppressed during k-anonymity
enforcement: every combination of (age band, region, gender) appears at
least 5 times in the released data.

What changed, column by column

Raw column Action Anonymized column
full_name dropped (direct ID) -
email dropped (direct ID) -
phone_number dropped (direct ID) -
national_id dropped (direct ID) -
source_system_code dropped (fingerprint) -
internal_batch_id dropped (fingerprint) -
age (int) banded into 10-year ranges age (e.g. "50 - 60")
region (str) rare categories collapsed to "Other" (top-6 kept) region
gender (str) passthrough gender
marital_status (str) passthrough marital_status
income (float) ±5% multiplicative noise, rounded to 2dp income
balance (float) ±3% multiplicative noise, rounded to 2dp balance
credit_score (int) passthrough credit_score
transaction_amount (float) passthrough transaction_amount
created_date (date) HMAC-deterministic ±7-day offset created_date
last_login_date (date) HMAC-deterministic ±7-day offset last_login_date

After all transforms, columns in the anonymized split are sorted
alphabetically and rows are deterministically shuffled (seed=42).

How to use

from datasets import load_dataset

raw  = load_dataset("t22000t/anonymization-before-after", "raw",        split="train")
anon = load_dataset("t22000t/anonymization-before-after", "anonymized", split="train")

print(raw[0])
# {'full_name': 'Person_001', 'email': '[email protected]', ...,
#  'age': 51, 'region': 'Northeast', 'income': 40617.24, ...}

print(anon[0])
# {'age': '50 - 60', 'region': 'Other', 'income': 100899.98, ...}

Or plain pandas:

import pandas as pd
raw  = pd.read_csv("hf://datasets/t22000t/anonymization-before-after/sample_raw.csv")
anon = pd.read_csv("hf://datasets/t22000t/anonymization-before-after/sample_anonymized.csv")

Suggested uses

  1. Teaching privacy concepts. The before/after diff makes k-anonymity,
    QI generalisation, and direct-ID suppression concrete in a single
    side-by-side view.
  2. Benchmarking anonymization toolkits. Re-run a different tool on
    raw and compare its output to anonymized (or to your own
    adversarial baseline).
  3. Red-team / membership-inference fixtures. Train an MIA classifier
    to separate raw from anonymized; the AUC quantifies how much
    identifying signal survived the pipeline.
  4. Sanity-checking a synthetic-data generator. Use raw as the
    target distribution and compare against the generator's output on the
    same schema.

How it was produced

sample_raw.csv is generated by
scripts/create_sample_data.py
in the data-anonymization-toolkit
repo (seed=42, deterministic).

sample_anonymized.csv is the output of running the toolkit's full
10-step pipeline on raw with the config
config/example_simple_anonymization.yaml
(profile ml, k_target=5).

Reproduce locally:

git clone https://github.com/timothy22000/data-anonymization-toolkit
cd data-anonymization-toolkit
pip install -e .

python scripts/create_sample_data.py
python scripts/anonymize_data.py \
    --input data/sample.csv \
    --output data/anonymized.csv \
    --config config/example_simple_anonymization.yaml

Limitations and caveats

  • Small. 500 rows is enough to demonstrate the pipeline behaviour but
    not enough for serious statistical evaluation of a generator.
  • Synthetic PII. Names, emails, IDs are templated, not realistic.
    Adversarial fingerprinting attacks that exploit real-world string
    distributions (e.g. uncommon surnames) won't find anything interesting
    here. Use a realistic synthetic-PII library (Faker, mimesis) if that
    matters for your research.
  • One profile, one config. Only the ml profile (k=5) is provided.
    The public profile (k=20, stronger generalisation) would suppress
    many more rows.
  • The "Other" category dominates region. Because the toy generator
    uses 8 regions but top-N keeps only 6, two regions get collapsed to
    "Other" in the anonymized split. Real-world QI generalisation is
    usually more nuanced.

Personal and sensitive information

None. All PII-shaped fields are deterministically generated from row
indices. No real individual's data was used to create this dataset.

Citation

If you use this dataset in a paper or tutorial, please cite the toolkit
it came from:

@software{data_anonymization_toolkit,
  author = {Mun, Timothy},
  title  = {data-anonymization-toolkit: Config-driven anonymization,
            synthetic data, and red-team validation for tabular data},
  url    = {https://github.com/timothy22000/data-anonymization-toolkit},
  year   = {2026}
}

License

MIT - see the parent toolkit repo for the full license text.

Related

README history 2 revisions

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.

  1. 2026-05-27Initial dataset: anonymization before/after pair3ee8d987.2 KB
    Loading...
  2. 2026-05-27initial commit093d32d0 B
    Loading...

Used by abliterated models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.

Related datasets same stage · extract

Read further

Metadata

License
mit

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("t22000t/anonymization-before-after")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="t22000t/anonymization-before-after", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/t22000t/anonymization-before-after
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration