Open Vocabulary Detection
Open vocabulary detection finds objects named in plain words instead of a fixed label list, scoring each image region against each phrase so new names work with no retraining.
Why Does This Exist?
A standard detector only names the classes it trained on. A warehouse model taught 80 fixed labels walks past the one new machine part nobody labeled, because its final layer has no row for it. Adding each new object means collecting boxes and retraining, which never catches up with the long tail of rare things.
Open vocabulary detection breaks the fixed list. It trains region features and language features in one shared space using detection boxes plus phrase-to-box grounding pairs, so at test time any written phrase becomes a classifier on the spot. The object detection page covers boxes, scores and suppression; the concrete two-stage system lives in Grounding DINO. This page covers the scoring rule, the training mix and how the tail is graded.
The one idea you need first. A detector proposes boxes, then each box gets a feature vector. Closed models dot that vector with learned per-class rows. Open models dot it with the embedding of your phrase instead, so the vocabulary is decided at query time, not training time.
Think of It Like This
A lost-and-found desk that works from spoken descriptions
A lost-and-found desk holds hundreds of unclaimed items. Instead of memorizing a catalog, the clerk listens to your spoken description, walks the shelves, and holds up whatever matches best. A description heard for the first time still works, because matching happens at query time.
Phrases are the spoken descriptions, proposed boxes are the shelf items, and cosine similarity is the clerk judging fit. Where it stops: a clerk asks follow-up questions when two items match, while the detector scores each phrase once and keeps the top boxes.
How It Actually Works
Score every box against every phrase
Each proposed box carries a region embedding , a -dimensional vector ( is the feature length, a few hundred numbers). Each query phrase carries a text embedding from a language encoder, in the same space. The match score is cosine similarity:
where is the dot product and is vector length, so runs from (opposite) to (identical direction). Boxes scoring above a threshold (a cutoff like ) survive per phrase, then non-maximum suppression (NMS, the standard step that keeps the best box and deletes its heavy overlaps) removes duplicates. Proposals stay class-agnostic, meaning no base-class filter runs before language sees them, so novel shapes reach the scoring step.
Train regions and phrases together
Training mixes two supervisions. Detection data supplies plain boxes with fixed labels, which teaches where things are. Grounding data supplies phrase-to-box pairs in full sentences, which teaches what words attach to which regions. The text encoder usually starts from a pretrained vision-language model, so rare words already have sane embeddings before detection training begins. Evaluation holds out whole classes: LVIS splits its 1,200-plus labels into frequent, common and rare, and rare-class average precision grades exactly the names the detector never trained on.
Worked toy scores
Take 3-dimensional embeddings and the phrase "striped scooter" with , whose length is . Box embeds as with length :
so . Box embeds as with length :
so . With , box is kept and box is dropped: the phrase found its scooter in one scoring pass.
Code
import math
def cosine(a, b): dot = sum(x * y for x, y in zip(a, b)) na = math.sqrt(sum(x * x for x in a)) nb = math.sqrt(sum(x * x for x in b)) return dot / (na * nb)
box_a = [0.8, 0.6, 0.0]box_b = [0.2, 0.98, 0.0]phrase = [0.9, 0.4359, 0.0]scores = {"A": round(cosine(box_a, phrase), 4), "B": round(cosine(box_b, phrase), 4)}kept = [k for k, s in scores.items() if s >= 0.70]print(scores)# -> {'A': 0.9815, 'B': 0.6071}print(kept)# -> ['A']Watch Out For
Proposals trained only on base classes
When the proposer learns from base-class boxes alone, it suppresses unfamiliar shapes before language ever scores them. The symptom is rare-class recall near zero while base-class numbers look healthy. Fix it by training class-agnostic proposers on broad box data and measuring proposal recall on held-out classes, not just final precision on base ones.
Thresholds tuned on base names misfiring on new ones
A cutoff picked for familiar phrases can flood or starve new ones, because similarity scales shift across words. The symptom is a new query returning either the whole image or nothing. Fix it by calibrating on a validation set of held-out phrases and running suppression separately per phrase rather than once globally.
The Quick Version
- Open vocabulary detection replaces fixed class rows with phrase embeddings scored by cosine similarity.
- Any written phrase becomes a classifier at query time, so new names need no retraining.
- Training mixes detection boxes (where things are) with grounding pairs (which words attach where).
- Proposals must stay class-agnostic or novel shapes die before scoring.
- LVIS rare-class precision grades exactly the names missing from training.