Embedding anomalies
Overview
Splits a dataset into anomalies and typical images by how far each image sits from its nearest neighbours in the embedding index, without being told what to look for.
Every image is scored by its mean cosine distance to its nearest neighbours in the reference set. Everything at or above the threshold goes to Anomalies, the rest to Typical. A clean batch therefore yields no anomalies, and a badly drifted one yields as many as it really has. Nothing is deleted and the input dataset is left untouched. Badges show the anomaly count, the typical count and the anomaly share, and the first two open their dataset.
There are two ways to use it:
- With a reference dataset — the incoming batch is compared against a baseline you trust, usually the pool your model already trained on. An anomaly means “unlike anything the model has seen”, which is domain drift.
- Without one — images are compared against the rest of their own dataset. This only holds while anomalies are rare in it: if half the dataset was shot at night, night is the norm and won’t surface.
The report can be passed to Dataset insights through its Findings from other nodes input.
An anomaly is not garbage. Rain and night shots are rare conditions, not defects — dropping them from a training set makes the model fail in rain. Send them to labeling or oversampling rather than to the bin.
Prerequisites
How it works
Lists the images of the input dataset and looks up their vectors in the index of the selected model. Images with no vector yet are reported and left in the typical dataset.
FAQ
What threshold should I set?
Read it off the report rather than guessing. The score at the 50th, 90th, 95th and 99th percentile of the run is printed there, so setting the threshold to the p95 value flags the top twentieth of that batch. A raw distance is not comparable between datasets or models, so check it again when the reference or the model changes.
How many neighbours does a score average over?
Set Neighbours to fix it. Left empty, it’s 1% of the reference size, kept between 5 and 50, and never more than the reference holds minus one.
What happens when the reference dataset has nothing indexed yet?
It’s not an error. An accumulating pool is empty on its first run, so the node says so in the log and the report, then scores the dataset against itself for that run.
Where do the results go on a rerun?
With no destination set, the first run creates one dataset for each side, and every rerun adds a new version to it, so earlier results stay in its history. A destination you pick gets the images added to what it already holds.
Why are the anomaly groups unnamed?
The clustering is a fact about the data, but any name put on a cluster would be a guess, and a fixed vocabulary of guesses only fits one domain. Four thumbnails per group say what it is faster and more accurately.
Does it detect blur, exposure, or corrupted files?
Not reliably. These embeddings are semantic — they separate weather, place, and scene type, not low-level image quality.
What happens to images that aren't indexed yet?
They can’t be scored, so they’re passed through to the typical dataset and their count is reported in the log and the report. Run AI index embeddings with the same model on the input dataset to cover them.
When does the run stop?
An input dataset with no images stops the flow with zero counts. The run fails when the workspace has no index for the selected model, or when none of the images, in the input or the reference, is indexed.
Is the input dataset modified?
No. Both outputs are new dataset memberships over the same images and annotations, and the source keeps every image.
Inputs
Dataset whose images are scored. Images not yet indexed by AI index embeddings with the selected model cannot be scored and are passed through as typical. Key: DATASET.
Model the images were indexed with. Choosing one they were not indexed with stops the run. Key: EMBEDDING_MODEL.
Options:
- CLIP (
clip) - PE-Core (
pecore) - SigLIP 2 (
siglip2)
Baseline the images are compared against, usually the pool the model already trained on. Leave empty to look for anomalies inside the scored dataset itself, which only works while anomalies are rare in it. Key: REFERENCE_DATASET.
Images scoring at or above this distance go to the anomalies dataset. Every image above it is returned, so a clean batch yields none. The report prints the score at each percentile of the run, which is what to set this from. Minimum: 0. Maximum: 1. Step: 0.01. Key: SCORE_THRESHOLD.
How many nearest reference images each score averages over. Derived from the reference size when empty. Minimum: 1. Maximum: 200. Step: 1. Key: NEIGHBORS.
Destination for the anomalies. Leave empty to use the node’s own output dataset. Key: DST_ANOMALIES_DATASET.
Destination for the remaining images. Leave empty to use the node’s own output dataset. Key: DST_TYPICAL_DATASET.
Clusters of similar anomalies previewed in the report, so it is clear what kinds of anomaly turned up. Which images are routed where is unchanged either way. Key: GROUP_ANOMALIES.
Outputs
Dataset holding the images that sit farthest from the reference. Shown as an artifact. Key: ANOMALIES.
Dataset holding the remaining scored images. Shown as an artifact. Key: TYPICAL.
Number of images routed to the anomalies dataset. Shown on the node as a badge. Selecting the badge opens ANOMALIES. Key: ANOMALIES_COUNT.
Number of images routed to the typical dataset. Shown on the node as a badge. Selecting the badge opens TYPICAL. Key: TYPICAL_COUNT.
Share of the scored images that were routed to the anomalies dataset. Shown on the node as a badge. Key: ANOMALIES_RATIO.
Score distribution, anomaly groups, and previews of the most and least typical images. Shown as an artifact. Key: REPORT.
JSON config
Machine-readable node interface for automation and advanced usage.