CoolFace
Datasetpublic

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.

sourceHugging Faceapache-2.0updated 7d agoView on Hugging Face
0likes53downloads
Dataset Card

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 inverse

Because 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.

Splits — by template, never by sample

splitrowslayoutscontents
train18,00011 train-only templatesfair + single-pattern + 12 seen class combinations
validation1,800same templates, disjoint seedssanity check (it saturates — see below)
test3,6006 held-out templatesfair + single pattern
hard1,800the same held-out templates18 class combinations that never appear in training

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.

hard negativewhich rule it defeats
a smaller secondary link beside a primary buttonfalse_hierarchy on area ratio
a countdown to a real, stated, persistent deadlinecountdown_timer on "clock present"
"Only 2 left — 2 units remain in the Rotterdam warehouse"low_stock_message on scarcity wording
a box ticked by default because ticking it is the privacy-protective choicepreselection on default_selected
faint text that is a build number, not a decisionvisual_interference on contrast
a one-button "OK" on an informational dialogforced_enrollment on "no decline present"

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

fieldwhat it is
tree_jsonthe UI tree: nodes with role, text, bbox, colours, font, depth, default-selected state, link target, screen index
pattern_idstaxonomy classes present (empty for fair rows)
evidence_jsonper class, the node ids that constitute the evidence
provision_elements_jsonthe same finding resolved to provision elements, for every configured jurisdiction (eu, us_federal, us_ca)
diffs_jsonexactly what the edit changed: node, field, before, after
remediation_jsonthe inverse of the edit, with target values
pair_idlinks a fair row to its unfair twin
edit_scopesingle_field, single_decision, or combination
template, family, fair, n_nodes, n_screensprovenance and shape

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:

once an annotationderived instead from
deadlinean explicit date in the visible text
inventory_sourcea sourcing phrase in the visible text
authoran attribution line beside the quote
label_action_conflictcomparing the accessible name to the link target
the generator's slot namesnothing — never read

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.

Category (Mathur et al. 2019)Classes
Sneakingsneak_into_basket · hidden_costs · hidden_subscription · bait_and_switch · hidden_information
Urgencycountdown_timer · limited_time_message
Misdirectionconfirmshaming · visual_interference · false_hierarchy · preselection · trick_question · pressured_selling · disguised_ad
Social Proofactivity_message · testimonials_uncertain_origin
Scarcitylow_stock_message · high_demand_message
Obstructionhard_to_cancel · price_comparison_prevention · intermediate_currency · privacy_maze · dead_end
Forced Actionforced_enrollment · forced_registration · privacy_zuckering · nagging

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.