Skip to main content

How This Helps

Duplicate detection helps you identify redundant images or frames across your dataset. Use it to streamline cleanup, reduce storage, and improve data quality before training or export.

Prerequisites

  • A dataset in READY status.
  • A dataset ID (visible in the browser URL when viewing a dataset: https://app.visual-layer.com/dataset/<dataset_id>/data).
  • A valid JWT token. See Authentication.

Find Duplicates Using VQL

The preferred approach uses the Visual Query Language (VQL) filter on the Explore endpoint. The duplicates filter groups visually similar media into duplicate clusters.

VQL Duplicates Filter

Pass a duplicates filter in the vql array:
The value field sets the similarity threshold (0.0–1.0). A value of 0.95 returns only clusters where images are at least 95% similar to each other. Lower values return more permissive groupings.

Example

Decoded VQL:

Response

Each cluster in the response contains a group of near-duplicate images. The previews array shows representative images from the group.

Find Duplicates Using duplicate_threshold

You can also use the duplicate_threshold query parameter directly on the Explore endpoint as a simpler alternative to VQL.

Filter by Uniqueness

To find the most unique images (the opposite of duplicates), use the uniqueness VQL filter.
This returns images with a uniqueness score above the specified threshold. Higher values mean more unique content.

Python Example

The following example retrieves all duplicate clusters and prints a summary.

Response Codes

See Error Handling for the error response format and Python handling patterns.

Semantic Search

Search using natural language text queries with VQL.

Export a Dataset

Export duplicate clusters for downstream deduplication.