> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ovalbee.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ovalbee.com/_mcp/server.

# Kfold label check

> Find labels a detector that never saw the image disagrees with (object not labelled, box too large, box badly placed, label with nothing under it) and measure how hard the dataset is to learn, from the held-out predictions of K-fold training.

Dockerfile

> **Note**
>
> First run can take longer while the worker pulls the configured Docker image.

## Overview

Reads the held-out ("out of fold") predictions of [Train Kfold YOLO](/node-library/nodes/models-yolo-train-kfold-yolo), where every image was predicted by a detector that did not train on it, and compares them with the labels. Labels the detector disagrees with in four fixed ways are listed as suspicious: an object nobody labelled, a box that covers several objects or is much larger than its object, a box that sits badly on its object, and a label with no detector box near it whose crop looks unlike the other labels of its class. The same predictions give the difficulty of the dataset: mAP per class, by box size and by split.

These are labels to look at, found by a detector. The report does not say how many of them are wrong. Nothing in the dataset changes. The report carries `label_issues.json`, which [Review suspected label errors](/node-library/nodes/sample-review-suspected-label-errors) reads, and `findings.json` for [Dataset insights](/node-library/nodes/dataset-ops-dataset-insights). The badges show the number of suspicious labels and the held-out mAP50.

```mermaid
flowchart LR
  n1["Dataset"] --> n3["Train K-fold YOLO"] --> n4["Kfold label check"]
  n1 --> n4
  n2["Find copies"] --> n4
```

## Prerequisites

| Requirement                       | What you need                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **K-fold report**                 | The report of Train K-fold YOLO on the same dataset: `oof.parquet` (columns `asset_id, fold, cls, x1, y1, x2, y2, score`; pixel corners, `cls` the position in the class list), `folds.parquet` (`asset_id, split, fold, group`) and `kfold_meta.json` (`k`, and `classes`, the class names in the order of `cls`; without it the sorted class names of the labels are used). |
| **AI index**                      | The dataset's objects indexed with DINOv3 by AI Index Embeddings. Without it the type "Label with nothing under it" is reported as not measured; everything else still runs.                                                                                                                                                                                                  |
| **Find copies report** (optional) | Copies of one image are then never used to judge each other's crops.                                                                                                                                                                                                                                                                                                          |

## How it works

Reads the labels as boxes, with the class order of the K-fold node. A rectangle over a polygon or mask of the same class (bounding-box IoU above 0.9) is the same object labelled twice and is read once, as the rectangle; two rectangles are never merged. Then sets aside boxes that are plain defects: outside the frame, degenerate, or an exact duplicate in one image.

Reads the DINOv3 vector of every label from the AI index and measures how far each crop is from its 20 nearest crops of other labels (1 minus the mean cosine). Labels of the same copy group are never neighbours.

Scores every label and every held-out box against each other: the support of a label (its best same-class box at 0.5 IoU), the owner of every box, and the ObjectLab scores for badly placed boxes and swapped classes.

Collects candidates and keeps them by fixed rules. Objects without a label: the most confident ones, up to **Objects without a label to list**. Boxes too large and boxes badly placed: all. Labels with nothing under them: only in a class the detector finds well, with no detector box of any score near, and a crop past the 99.5th percentile of its class. Images whose labels mostly lack any support are treated as not belonging to the image and give no candidates.

Measures difficulty with a COCO-style evaluator: AP at IoU 0.5 to 0.95, per class, by box side at a 640 px input, by split, and precision and recall at the best F1 threshold.

## Inputs

**`Dataset`** `dataset` — required

Dataset whose labels are checked. It must be the dataset the K-fold node trained on, and its objects must already be indexed with DINOv3 by an AI Index Embeddings node, without that index the crops of labels with nothing under them cannot be compared and that type is reported as not measured. Key: `DATASET`.

---

**`K-fold report`** `report` — required

Report of Train K-fold YOLO holding oof.parquet (held-out predictions), folds.parquet and kfold_meta.json. Key: `KFOLD_REPORT`.

---

**`Copies report`** `report`

Report of Find copies. Copies of one image are never used to judge each other's crops, and images with a pixel-identical twin labelled differently are marked in the issue table. Leave empty to treat every image as its own group. Key: `COPY_REPORT`.

---

**`Objects without a label to list`** `integer` — required, default: 30

How many of the most confident objects without a label are listed. The ranking and this default were tuned against spot checks of 30. Minimum: `1`. Maximum: `1000`. Step: `1`. Key: `MISSING_TOP`.

---

## Outputs

**`Report`** `report`

Suspicious labels with galleries, label_issues.json for Review suspected label errors, the difficulty of the dataset (overall, per class, by box size, by split), and findings.json for analytical nodes. Shown as an artifact. Key: `REPORT_ID`.

---

**`Suspicious labels`** `string`

How many labels the report lists as suspicious. Shown on the node as a badge. Key: `SUSPICIOUS_COUNT`.

---

**`Held-out mAP50`** `string`

mAP50 of the held-out predictions against the labels. Shown on the node as a badge. Key: `HELD_OUT_MAP50`.

---

## Report

The report holds `index.md`, `label_issues.parquet` (one row per listed label: type, rank, asset, annotation, object index, class, split, label box, detector box), `label_issue_summary.parquet` (candidates, listed, dropped per type), four galleries (the label outlined in amber, the detector's box dashed in green), `label_issues.json`, `difficulty.json`, `difficulty_by_class.json`, `difficulty_by_size.json`, `difficulty_by_split.parquet`, `score_meta.json` (thresholds, fences, counts) and `findings.json`.

The findings are `labels.suspicious.missing`, `labels.suspicious.too_large`, `labels.suspicious.badly_placed`, `labels.suspicious.nothing_under` (each present only when something is listed) and `kfold.learnability`. In `label_issues.json` the types read as `missing_objects` (an image-level row), `misplaced` (too large, badly placed) and `not_an_object` (nothing under).

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Kfold label check",
  "description": "Find labels a detector that never saw the image disagrees with (object not labelled, box too large, box badly placed, label with nothing under it) and measure how hard the dataset is to learn, from the held-out predictions of K-fold training.",
  "category": "Models",
  "namespace": "ovalbee",
  "templateKey": "models/clip/kfold_label_check",
  "version": "v1",
  "inputs": [
    {
      "key": "DATASET",
      "label": "Dataset",
      "type": "dataset",
      "description": "Dataset whose labels are checked. It must be the dataset the K-fold node trained on, and its objects must already be indexed with DINOv3 by an AI Index Embeddings node; without that index the crops of labels with nothing under them cannot be compared and that type is reported as not measured.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "creatable": false
      }
    },
    {
      "key": "KFOLD_REPORT",
      "label": "K-fold report",
      "type": "report",
      "kind": "kfold_oof_v1",
      "description": "Report of Train K-fold YOLO holding oof.parquet (held-out predictions), folds.parquet and kfold_meta.json.",
      "required": true,
      "default": null,
      "visibleWhen": null
    },
    {
      "key": "COPY_REPORT",
      "label": "Copies report",
      "type": "report",
      "kind": "dataset_intelligence_findings_v1",
      "description": "Report of Find copies. Copies of one image are never used to judge each other's crops, and images with a pixel-identical twin labelled differently are marked in the issue table. Leave empty to treat every image as its own group.",
      "required": false,
      "default": null,
      "visibleWhen": null
    },
    {
      "key": "MISSING_TOP",
      "label": "Objects without a label to list",
      "type": "number",
      "description": "How many of the most confident objects without a label are listed. The ranking and this default were tuned against spot checks of 30.",
      "required": true,
      "default": 30,
      "visibleWhen": null,
      "options": {
        "type": "integer",
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": false
      }
    }
  ],
  "outputs": [
    {
      "key": "REPORT_ID",
      "label": "Report",
      "type": "report",
      "kind": [
        "dataset_intelligence_findings_v1",
        "kfold_label_check_v1"
      ],
      "description": "Suspicious labels with galleries, label_issues.json for Review suspected label errors, the difficulty of the dataset (overall, per class, by box size, by split), and findings.json for analytical nodes.",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "SUSPICIOUS_COUNT",
      "label": "Suspicious labels",
      "type": "string",
      "description": "How many labels the report lists as suspicious.",
      "artifact": false,
      "badge": true,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "HELD_OUT_MAP50",
      "label": "Held-out mAP50",
      "type": "string",
      "description": "mAP50 of the held-out predictions against the labels.",
      "artifact": false,
      "badge": true,
      "badgeOpens": null,
      "hidden": false
    }
  ],
  "runtime": {
    "type": "docker",
    "devices": [
      "cpu"
    ],
    "dockerImage": "ovalbee/node-clip-vectors:0.0.12"
  },
  "automation": {
    "isolated": true,
    "requires_configuration": true,
    "manual_run": true,
    "discard_history": "on_success"
  },
  "widgets": {
    "secondaryWidget": {
      "id": "report-preview",
      "settings": {
        "reportAsset": {
          "type": "variable",
          "value": "self.outputs.REPORT_ID"
        },
        "name": {
          "type": "input",
          "value": "Open report"
        }
      }
    }
  }
}
```