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

# Find copies

> Find images that are exact or flipped and rotated copies of each other, in one split or across splits, and check whether the copies carry the same labels. Also groups images whose file names mark one source scene.

## Overview

Finds pictures that appear more than once in a dataset: byte-for-byte equal images, and copies made by a flip or a rotation. A picture that sits in two splits is seen in training and scored in validation or test, and a picture that sits twice in one split counts twice. The node also compares the boxes of the copies, because copies of one picture should carry the same labels, and optionally groups images by file name, which catches frames of one scene that no pixel test relates.

Nothing in the dataset changes. The report lists copy groups and pairs, and its findings can be read by [Dataset insights](/node-library/nodes/dataset-ops-dataset-insights) through its **Findings from other nodes** input. The badge shows how many images sit in how many copy groups, for example **1357 images in 400 copy groups**.

```mermaid
flowchart LR
  n1["Dataset"] --> n2["Find copies"] --> n3["Copies report"]
```

## Prerequisites

| Requirement              | What you need                                                                                                                                                                    |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Images**               | A dataset of images. Every image is downloaded and decoded once, so the run takes time in proportion to the dataset size. Images that cannot be decoded are skipped and counted. |
| **Split tag** (optional) | An image tag named `split` (train, val, test). Without it the report still lists copy groups, but cannot say which copies cross splits.                                          |
| **Boxes** (optional)     | Object annotations of any geometry, read as bounding boxes. Without them the label checks are left out.                                                                          |

## How it works

Lists the images with their file names, split tag and boxes.

Downloads each image once and reduces it to a pixel hash, a perceptual hash that survives the eight flips and rotations, and a 64x64 grey thumbnail.

Calls two images copies when their pixels are equal, or when the perceptual hashes are within 4 bits under one transform and the thumbnails correlate at 0.95 or more after it. Quarter turns and transposes count only between square images.

Joins copies into groups. A group is named by its smallest asset id.

With **Group by file name** on, gives images one name key: the text before `_jpg.rf.` in a Roboflow export name, else the name without extension, one trailing letter after a number and a trailing number after a separator. Images with one key form a group. The rule is skipped when it leaves fewer than two distinct keys or fewer than 1% of the names distinct.

Maps the boxes of each flipped copy onto the group's reference copy (the one with the shortest file name) and matches same-class boxes at 0.3 IoU.

Finds pixel-identical images in labelled splits whose box sets differ.

Counts the images that have a copy in their own split, and those outside the reference split (the largest labelled split) that have a copy in another split.

## Inputs

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

Dataset to search. Every image is downloaded and decoded once. The split of an image is read from its split tag. Key: `DATASET`.

---

**`Group by file name`** `boolean` — default: true

Also group images whose file names differ only by a copy suffix, a frame number or a Roboflow hash. The groups are written to the report and can keep a source scene on one side of a split. Key: `NAME_GROUPS`.

---

**`Group tag`** `string`

Image tag that gets a copy-group id on every image with a copy, for example copy_group. Pick the same tag in "Group by tags" of a Train/validation split node to keep the copies of a picture on one side of the split. Images without a copy lose the tag. Leave empty to write no tags. The name `split` is refused. Key: `GROUP_TAG`.

---

## Outputs

**`Copies report`** `report`

Copy groups and pairs, copies inside and across splits, label agreement between copies, identical images labelled differently, file-name groups, and findings.json for analytical nodes. Shown as an artifact. Key: `REPORT_ID`.

---

**`Copy count`** `string`

How many images sit in how many copy groups. Shown on the node as a badge. Key: `COPY_COUNT`.

---

## Report

Only copies made by a flip or half turn that keep the image size are mapped onto the reference copy for the label checks; other copies, and images of splits without any box, are left out of them. Besides `index.md` the report holds `copy_groups.parquet` (one row per image: group, transform to the reference copy, split, name group, file name), `copy_pairs.parquet`, `labels_mismatch.parquet`, `name_groups.json`, the agreement and gallery files, and `findings.json`.

The report starts with the counts, then has sections for copies inside a split, copies across splits, label consistency across copies, identical images labelled differently, and groups by file name. A section appears only when the run found something to show.

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Find copies",
  "description": "Find images that are exact or flipped and rotated copies of each other, in one split or across splits, and check whether the copies carry the same labels. Also groups images whose file names mark one source scene.",
  "category": "Datasets",
  "namespace": null,
  "templateKey": "dataset_ops/find_copies",
  "version": "v1",
  "inputs": [
    {
      "key": "DATASET",
      "label": "Dataset",
      "type": "dataset",
      "description": "Dataset to search. Every image is downloaded and decoded once. The split of an image is read from its split tag.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "creatable": false
      }
    },
    {
      "key": "NAME_GROUPS",
      "label": "Group by file name",
      "type": "boolean",
      "description": "Also group images whose file names differ only by a copy suffix, a frame number or a Roboflow hash. The groups are written to the report and can keep a source scene on one side of a split.",
      "required": false,
      "default": true,
      "visibleWhen": null
    },
    {
      "key": "GROUP_TAG",
      "label": "Group tag",
      "type": "string",
      "description": "Image tag that gets a copy-group id on every image with a copy, for example copy_group. Pick the same tag in \"Group by tags\" of a Train/validation split node to keep the copies of a picture on one side of the split. Images without a copy lose the tag. Leave empty to write no tags. The name `split` is refused.",
      "required": false,
      "default": null,
      "visibleWhen": null
    }
  ],
  "outputs": [
    {
      "key": "REPORT_ID",
      "label": "Copies report",
      "type": "report",
      "kind": [
        "dataset_intelligence_findings_v1",
        "find_copies_v1"
      ],
      "description": "Copy groups and pairs, copies inside and across splits, label agreement between copies, identical images labelled differently, file-name groups, and findings.json for analytical nodes.",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "COPY_COUNT",
      "label": "Copy count",
      "type": "string",
      "description": "How many images sit in how many copy groups.",
      "artifact": false,
      "badge": true,
      "badgeOpens": null,
      "hidden": false
    }
  ],
  "widgets": {
    "secondaryWidget": {
      "id": "report-preview",
      "settings": {
        "reportAsset": {
          "type": "variable",
          "value": "self.outputs.REPORT_ID"
        },
        "name": {
          "type": "input",
          "value": "Open report"
        }
      }
    }
  }
}
```