--- pretty_name: COCOLogic-V2 license: cc-by-4.0 language: - en source_datasets: - extended|coco task_categories: - image-classification task_ids: - multi-label-image-classification size_categories: - 10K `sample_type` contains a coarse distinction between `positive`, `near_boundary` and `far_from_boundary`, > while `boundary_type` contains the specific near_boundary type of the sample. ## Columns Both configs share this per-image block: | column | type | meaning | |---|---|---| | `labels` | `list[int8]` (10) | per-rule binary label, index `r-1` ↔ rule `r` | | `sample_type` | `list[string]` (10) | per-rule `positive` / `near_boundary` / `far_from_boundary` | | `rule_variants` | `list[list[int8]]` (10) | per-rule 1-based variant ids; non-empty iff the label is 1 | | `boundary_type` | `list[int8]` (10) | per-rule NB type; **only meaningful for negatives** | | `category_counts` | `list[int16]` (91) | object counts **indexed by COCO category id**; slot 0 and the 10 unused ids (12, 26, 29, 30, 45, 66, 68, 69, 71, 83) are always 0 | | `object_names` | `list[string]` | names of the non-zero categories, ascending category id | | `object_counts` | `list[int16]` | counts aligned with `object_names` | | `n_objects` | `int32` | `sum(category_counts)` | `full` adds `image_id`, `image_index`, `file_name`, and the 10 boolean `label_` columns (the exploded form of `labels`, so the viewer can filter and sort per rule). `fewshot` adds the rule the row belongs to, and the per-image block *specialized to that rule*: | column | type | meaning | |---|---|---| | `rule_id` / `rule_name` | `int8` / `string` | 1..10, e.g. `Single Mode Traffic` | | `rule_sample_type` | `string` | `positive` / `near_boundary` / `far_from_boundary` — the scalar form of `sample_type[rule_id - 1]` | | `group_index` | `int8` | *which* group within that type: the variant number for `positive`, the NB type for `near_boundary`, `0` for `far_from_boundary` (which has no groups) | | `group_position` | `int32` | position within that group, preserving source order | | `rule_label` | `int8` | `labels[rule_id - 1]` | | `rule_variant_ids` | `list[int8]` | `rule_variants[rule_id - 1]` | | `rule_boundary_type` | `int8` | `boundary_type[rule_id - 1]` | ## Few-shot / in-context learning The `fewshot` config *is* the task definition: it states which images are relevant for evaluating each rule. Each rule gets 24 train examples (8 positive + 16 negative) and 40 test examples (20 + 20). Reconstruct one rule's task with a single filter — no join needed, since each row already carries its image's metadata: ```python fs = load_dataset("AIML-TUDA/COCOLogic-v2", "fewshot", split="train") rule_8 = fs.filter(lambda x: x["rule_id"] == 8) positives = rule_8.filter(lambda x: x["rule_sample_type"] == "positive") negatives = rule_8.filter(lambda x: x["rule_sample_type"] != "positive") ``` Note **rule 4 ("Either Dog or Car") has no far-from-boundary examples** — all of its negatives are near-boundary. The few-shot version assumes a working perception module: images are manually curated so that the relevant objects are clearly visible and the labels are correct. It is intended for few-shot / in-context rule learning, not for training perception from scratch. ## Source JSON files The four original JSONs (`cocologic_{train,test}[_fewshot].json`) sit at the repo root, byte-for-byte as the code repository reads them. The parquet configs above are generated from them and round-trip back to them exactly. Note the `rules` block of the **full** JSONs is not exported to parquet: its integers are not COCO image ids but positional indices into the source COCO split's candidate pools, recorded before subsampling (and one group, `rule_7.near_boundary[2]` in train, mixes raw ids into that index space). The per-image `labels` / `rule_variants` / `boundary_type` fields carry the same information, are self-consistent, and are in real COCO id space. The `rules` block of the **fewshot** JSONs does use real COCO image ids and is exported as the `fewshot` config. ## Row order Parquet row order matches the source JSON key order, and `image_index` records it. This matters only if you reuse the precomputed tensors from the code repository, which are index-aligned to that order. ## Licensing The COCOLogic-V2 annotations are released under **CC BY 4.0**, consistent with the MSCOCO annotations they are derived from (© COCO Consortium). **Images are not redistributed here**; they remain subject to the [COCO terms of use](https://cocodataset.org/#termsofuse) and the Flickr terms for the individual photographs. Please cite both COCO and COCOLogic-V2. ## Citation ```bibtex @article{steinmann2026cocologic, title={COCOLogic-V2: Identifying Logical Inconsistencies via Truly Hard-Negatives}, author={Steinmann, David and W{\"u}st, Antonia and Kersting, Kristian and Stammer, Wolfgang}, journal={arXiv preprint arXiv:2606.28194}, year={2026} } @inproceedings{lin2014microsoft, title={Microsoft coco: Common objects in context}, author={Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C Lawrence}, booktitle={European conference on computer vision}, pages={740--755}, year={2014}, organization={Springer} } ```