NagaYu/sludge-ui-counterfactuals
Sludge counterfactual UI corpus This model does not determine legality. It reports provisions that may be implicated and the screen elements that are the factual basis for looking at them. Whether a provision is actually engaged depends on facts no UI tree contains — the purposes of processing, the legal basis relied on, the audience, the rest of the journey, prior consent, sector rules — and is an assessment for a qualified human. It has no feature that labels a… See the full description on the dataset page: https://huggingface.co/datasets/NagaYu/sludge-ui-counterfactuals.
Sludge counterfactual UI corpus
## This model does not determine legality. It reports provisions that may be implicated and the screen elements that are the factual basis for looking at them. Whether a provision is actually engaged depends on facts no UI tree contains — the purposes of processing, the legal basis relied on, the audience, the rest of the journey, prior consent, sector rules — and is an assessment for a qualified human. It has no feature that labels a named company's product as unlawful, and it is not built to acquire one. It is a tool for reviewing interfaces, not for publishing verdicts about them.
A fully synthetic corpus of UI trees for deceptive-design-pattern detection, built from counterfactual pairs: a fair screen, and the same screen with exactly one thing changed.
fair unfair
───────────────────────────── ─────────────────────────────
[ Accept all ] [ Reject all ] [ Accept all ] [Reject all]
200×52px 200×52px 200×52px 95×29px
▲
one edit: bbox + font_size
evidence: cook_reject_6
remediation: the inverseBecause the twins are identical everywhere else, the edit defines the class label, the localisation target and the remediation simultaneously. There is no annotation pass, and no way for the three to drift apart.
- Model: `NagaYu/sludge-small`
- Demo: `NagaYu/sludge`
Splits — by template, never by sample
25,200 rows total. No UI layout is shared across the train/test boundary, and every one of the 27 classes appears in both a train template and a test template.
validation re-uses the training templates, so a model that has learned those layouts reaches ~1.00 micro-F1 on it within two epochs. It is published for completeness; the reference pipeline holds out two training templates as a dev split for model selection and threshold tuning instead, and never touches test or hard for either.
The fair screens are deliberately hard
Fair screens contain honest urgency (a dated sale), honest scarcity (a sourced stock count), honest social proof (an attributed review) — and a set of hard negatives: benign designs that trip naive thresholds.
Without these, hand-written rules scored 0.84 micro-F1 on this corpus — far above what rule-and-screenshot systems reach on real interfaces. That gap was a property of the corpus, not a discovery about rules.
Fields
Two label sets ship on every row — the taxonomy class and the jurisdiction-resolved provision elements — so you can train or evaluate against either, and audit the mapping without running the code.
Realism: what was deliberately removed
The generator can annotate a node with facts no real interface exposes ("this stock figure came from the warehouse feed"). Training on those would inflate every number. The reference pipeline strips them and derives each feature from what an AX/DOM traversal genuinely reports:
The annotations remain in tree_json so you can measure what provenance metadata would be worth if a platform exposed it. A behavioural test enforces that the reference featuriser reads none of them.
Taxonomy
7 categories / 27 classes, all from published work: Mathur et al. (2019) CSCW · Gray et al. (2018) CHI · Brignull, deceptive.design · EDPB Guidelines 03/2022 · OECD (2022) DEP No. 336 · Gray et al. (2024) CHI.
Intended use, and what this is not
For: training and evaluating UI-tree pattern detectors; testing whether a detector reacts to a design change rather than to a template; measuring what screenshot-based perception costs.
Not for: asserting that any real product is unlawful. The labels identify design patterns from a research taxonomy and provisions that may be implicated. They are not legal findings, and the corpus contains no real application.
No real-world data. No screenshot or UI tree from any real application appears here. Public dark-pattern datasets are for evaluation only, under their own terms.
Licence: Apache-2.0.
