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

# Compare splits

> Compare the splits of a dataset by what the images look like - how many images of each split have a copy in the reference split, how many are unlike any image of it, and how that compares with a fresh split of the same images. Built with DINOv3.

Dockerfile

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

## Overview

Compares each split of a dataset with a reference split, usually the one a model learns from, by what the images look like. For every other split it reports how many images have a copy in the reference split, and how many are unlike any image of it. The share of unlike images is set next to the same measure on a fresh split made of the reference's own images, which is what a well-made split reaches.

The comparison uses the DINOv3 vector of every image, read from the AI index. A copy is an image in a group of [Find copies](/node-library/nodes/dataset-ops-find-copies) (pixel-identical, flipped or rotated) that has an image in the reference split. Without a connected Find copies report no image counts as a copy, and the report says so; a report in which no image of the dataset appears (one of another dataset) is treated the same, with a warning in the log. A similar vector alone is never called a copy: how close two different pictures are in DINOv3 space depends on the dataset. Nothing in the dataset changes. The report carries `findings.json` for [Dataset insights](/node-library/nodes/dataset-ops-dataset-insights). The badge shows the share of unlike images per split.

```mermaid
flowchart LR
  n1["Dataset"] --> n2["AI Index Embeddings"] --> n4["Compare splits"]
  n3["Find copies"] --> n4
```

## Prerequisites

| Requirement                       | What you need                                                                                                                                                 |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Split tags**                    | Images carry a `split` tag (`train`, `val`/`valid`/`validation`, `test`). Images without it are left out.                                                     |
| **AI index**                      | The dataset's images indexed with DINOv3 by AI Index Embeddings with the visual embedding on. Images without a vector are left out and counted in the report. |
| **Find copies report** (optional) | Its copy groups are what counts as a copy; without it no image does.                                                                                          |

## How it works

Reads the split tag and the DINOv3 vector of every image. The reference is the requested split, else the largest one.

Joins copies into clusters: the groups of Find copies.

Measures the distance (1 minus cosine similarity) of every reference image to its nearest neighbour outside its own cluster. The 95th percentile of these distances is the line past which an image counts as unlike the reference.

For every other split, measures the distance of each image to its nearest reference image and counts the images past the line (unlike) and the images with a copy in the reference.

Repeats the measure on five fresh splits made of whole reference clusters in the size of the split, compared with the rest of the reference. The rest is smaller than the real reference, so this baseline is slightly high.

Places the images on a t-SNE map (at most 6000, each split in its share) and counts copy groups by the splits they span.

## Inputs

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

Dataset whose splits are compared. The split of an image is read from its split tag, and its images must already be indexed with DINOv3 by an AI Index Embeddings node. Key: `DATASET`.

---

**`Embedding model`** `select` — required, default: dinov3

Model the images were indexed with. Only DINOv3 is offered, a dataset that is not indexed with it stops the run. Key: `EMBEDDING_MODEL`.

Options:

* DINOv3 (`dinov3`)

---

**`Reference split`** `string` — required, default: train

Split every other split is compared with, usually the one a model learns from. If the dataset has no split of this name, the largest split is used. Key: `REFERENCE_SPLIT`.

---

**`Copies report`** `report`

Report of Find copies. Only its copy groups (pixel-identical, flipped or rotated images) count as copies, and copies of one image are never used to judge how unlike each other two images are. Leave empty and no image counts as a copy. Key: `COPY_REPORT`.

---

## Outputs

**`Report`** `report`

Copies and novelty of each split against the reference split, a nearest-image distance chart, an embedding map, the placement of copy groups, and findings.json for analytical nodes. Shown as an artifact. Key: `REPORT_ID`.

---

**`Novel share`** `string`

Share of images of each split that are unlike any image of the reference split. Shown on the node as a badge. Key: `NOVEL_SHARE`.

---

## Report

The report holds `index.md`, `split_novelty.parquet` (per split: images, copies in the reference, novel images, shares, and the fresh-split shares), `split_distance.json` (cumulative share of images by distance to the nearest reference image), `split_map.json` (t-SNE scatter, one series per split), `copy_placement.parquet`, `gallery_split_copies.json`, `split_metrics.json` (the numbers behind the text) and `findings.json`.

The findings are `splits.copies_in_reference.<split>` (a violation, present when the split has an image with a copy in the reference) and `splits.novelty.<split>` (an observation). A dataset with one split gets the observation `splits.single_split`.

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Compare splits",
  "description": "Compare the splits of a dataset by what the images look like - how many images of each split have a copy in the reference split, how many are unlike any image of it, and how that compares with a fresh split of the same images. Built with DINOv3.",
  "category": "Models",
  "namespace": "ovalbee",
  "templateKey": "models/clip/compare_splits",
  "version": "v1",
  "inputs": [
    {
      "key": "DATASET",
      "label": "Dataset",
      "type": "dataset",
      "description": "Dataset whose splits are compared. The split of an image is read from its split tag, and its images must already be indexed with DINOv3 by an AI Index Embeddings node.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "creatable": false
      }
    },
    {
      "key": "EMBEDDING_MODEL",
      "label": "Embedding model",
      "type": "select",
      "description": "Model the images were indexed with. Only DINOv3 is offered; a dataset that is not indexed with it stops the run.",
      "required": true,
      "default": "dinov3",
      "visibleWhen": null,
      "options": {
        "options": [
          {
            "label": "DINOv3",
            "value": "dinov3"
          }
        ]
      }
    },
    {
      "key": "REFERENCE_SPLIT",
      "label": "Reference split",
      "type": "string",
      "description": "Split every other split is compared with, usually the one a model learns from. If the dataset has no split of this name, the largest split is used.",
      "required": true,
      "default": "train",
      "visibleWhen": null
    },
    {
      "key": "COPY_REPORT",
      "label": "Copies report",
      "type": "report",
      "kind": "dataset_intelligence_findings_v1",
      "description": "Report of Find copies. Only its copy groups (pixel-identical, flipped or rotated images) count as copies, and copies of one image are never used to judge how unlike each other two images are. Leave empty and no image counts as a copy.",
      "required": false,
      "default": null,
      "visibleWhen": null
    }
  ],
  "outputs": [
    {
      "key": "REPORT_ID",
      "label": "Report",
      "type": "report",
      "kind": [
        "dataset_intelligence_findings_v1",
        "compare_splits_v1"
      ],
      "description": "Copies and novelty of each split against the reference split, a nearest-image distance chart, an embedding map, the placement of copy groups, and findings.json for analytical nodes.",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "NOVEL_SHARE",
      "label": "Novel share",
      "type": "string",
      "description": "Share of images of each split that are unlike any image of the reference split.",
      "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"
        }
      }
    }
  }
}
```