TT Lab
Blog

한국어 English 日本語 中文

Get started
Blog

Blog

Open-Vocabulary Detection: Attaching CLIP Text Embeddings to Detectors — OWL-ViT, OWLv2, Grounding DINO, YOLO-World, YOLOE

Status: Draft (2026-10-13), partially measured. The classification head example merely mimics the structure without real CLIP weights (code/12_open_vocab_head.py, under 1 second on a laptop CPU). The models in this post were not run in our environment (unmeasured). Paper metrics are transcribed from the original texts along with their conditions, and hardware is denoted by tier. The learning principles of CLIP itself are covered in the sister series (self-supervised, video, pose, sports). Writing rules: Measured data is the default, and unmeasured items are marked as "Unmeasured".

Table of Contents

1. The Wall of Closed Vocabulary

The detectors in parts 5, 6, and 8 are closed-vocabularymodels. When trained on COCO, they only find 80 categories (person, car, tennis racket...). To detect a "ping-pong racket" or "ping-pong table," you must collect data labeled with those terms and retrain.

From a structural standpoint, the reason is simple. The final classification head of a detector has the form (영역 특징) · Wᵀ , where W is a fixed matrix(80×d) with one row per class. Adding a new class requires an additional row in W, the values of which can only be obtained through data training.

열린 어휘 검출: 고정 분류 머리를 글자 임베딩으로 바꾼다 닫힌 어휘(보통 검출기) 영역 특징 분류 머리 W (80×d) COCO 80종만. 새 종류는 다시 학습 열린 어휘(OWL-ViT · Grounding DINO · YOLO-World · YOLOE) 영역 임베딩 r 글자 인코더(CLIP 계열) 입력: "racket", "ball", "table" … 유사도 r·tᵢ / τ 어휘마다 점수 어휘 = 그때그때 적는 글자 클래스 추가 = 행 하나 추가 어휘를 미리 정하면 글자 임베딩을 한 번만 계산해 가중치로 「구워」 둘 수 있다(YOLO-World·YOLOE).
Figure: Comparison between the fixed classification head of a closed-vocabulary detector and the open-vocabulary detector which replaces it with embeddings created by a text encoder

2. The Key: CLIP Text Embeddings

CLIP (2021) is a model trained on 400 million internet image-caption pairs such that its image encoder and text encoder output vectors in the same space. It uses contrastive learningto bring matching images and texts close together while pushing non-matching ones apart. As a result, the text vector for "a photo of a racket" and the image vector of a racket photo become close. Using this text vector as the classifier's weights achieved 76.2% ImageNet top-1 zero-shot without using a single ImageNet training image (ViT-L/14, 336px). This is on par with ResNet-50 trained directly on ImageNet.

Why CLIP learns this way is covered in the sister series; this post only looks at how these text vectors are attached to the detector. The idea boils down to a single line: Instead of learning the rows of W, generate them by passing class names into the text encoder.

닫힌 어휘:  점수 = r · W[클래스]ᵀ               (W 는 학습한 80×d 행렬)
열린 어휘:  점수 = r · 글자인코더("racket")ᵀ / τ  (어휘는 쓸 때 적는다)

Try It Yourself: Adding a Class = Adding a Row

Instead of real CLIP, a random 2-layer MLP was used to mimic the text encoder, and a classification head was attached to an 80×80 feature map (640px input, corresponding to a stride of 8) (measured; the numbers themselves have no meaning, we only observe the structure).

어휘 3개 → 분류 머리 행렬 (3, 256)
「racket」을 더하면 (4, 256) — 다른 가중치는 그대로, 출력 칸마다 로짓이 4개
두 방식 출력 최대 차 0.0e+00, 프레임당 9.09 ms → 2.71 ms

The last row compares the approach of feeding the vocabulary into the text encoder on every frame versus "pre-cooking" the vocabulary once into a matrix. The answers are entirely identical, and only time is reduced. Since the mock encoder is very small, the difference is only about 3x, but with a real CLIP text encoder being a Transformer, this difference will likely be larger (unmeasured). This is what YOLO-World and YOLOE in Section 6 aim for.

3. OWL-ViT (2022): One Box per ViT Token

OWL-ViT by Minderer et al. demonstrated the simplest method.

  1. 1. Take a contrastively trained ViT (Part 7) like CLIP.
  2. 2. Remove the final pooling layer that aggregates tokens into one. As a result, outputs remain for each patch token.
  3. 3. Attach a lightweight box head(bounding box of the object assigned to this token) and a classification head(token embedding) to each token. The weights of the classification head are the text embeddings of the class names.
  4. 4. Fine-tune on detection data (a mix of two out of OpenImages, Objects365, and Visual Genome).

Much like DETR in Part 8, a single token (slot) is responsible for a single object, and matching also uses the DETR-style set loss. The difference is that instead of having separate slots, image patch tokens serve directly as slots.

Result (paper): AP of 34.6 on LVIS v1.0 validation, with rare class AP of 31.2(ViT-L/14, trained on Objects365+VG, 840px). Since rare class names were omitted from training, 31.2 represents the zero-shot value for previously unseen classes.

You can also query using example imagesinstead of text. Using the embedding of an image patch as a query translates to "find something similar to this." On unseen COCO classes, the one-shot detection AP50 rose from the previous best of 26.0 to 41.8.

4. OWLv2 (2023): Scaling Up with Self-Labeling

Detection labels are expensive. Minderer et al. overcome this wall in OWLv2 through self-training.

  1. 1. Annotate the entire WebLI web image dataset (approx. 10 billion image-alt-text pairs) with pseudo box labelsusing the existing OWL-ViT (CLIP L/14). The vocabulary consists of terms extracted from the images' alt text.
  2. 2. Train a new model (OWL-ST) using these pseudo labels. The training examples exceed 1 billion.
  3. 3. Fine-tune on detection data.

Result (paper): LVIS rare class AP reached 31.2% → 44.6%(L/14, 43% relative improvement), while the larger G/14 reached 47.2%. As the scale grew, training efficiency was also tuned: combining an "objectness" head that computes boxes only for the top-k tokens, discarding 50% of patches with low pixel variance during training, and stitching multiple images into mosaics cut training computation roughly in half and doubled throughput.

This is the same concept as the data engine of SAM in Part 9: The model generates labels, and those labels build a better model. Part 11's SAM 3 compared its PCS accuracy against this OWLv2.

5. GLIP & Grounding DINO: Deeply Fusing Text and Images

OWL-ViT meets image features and text embeddings with only a final single dot product. This falls short when relationships within a sentence matter, such as "the racket held by the player on the left." Another branch fuses the two deeply from the start.

The price of deep fusion is speed. Since image-side computations must be rerun whenever the text changes, vocabularies cannot be pre-cooked.

6. YOLO-World & YOLOE: Going Real-Time

This is an attempt to bring open vocabulary to the speed of the YOLO family from Part 6.

YOLO-World (2024): Employs RepVL-PAN, which fuses text embeddings into YOLO's feature pyramid, along with a region-text contrastive loss. The key is **"Prompt first, detect later."** Once the user defines the vocabulary, it is encoded once and re-parameterized into the network weights, allowing the text encoder to be completely stripped away during inference. This is the "pre-cooking" from the Section 2 example.

Result (paper Table 2): LVIS minival zero-shot 35.4 AP, 52.0 FPS. This figure comes with many conditions attached: the largest YOLO-World-L (48 million parameters after pre-cooking, 110 million before, 17.6 FPS), trained on Objects365 + GoldG + 246k pseudo-labeled CC3M images, measured on a single datacenter GPU without FP16 or TensorRT. The official repository is GPL-3.0 , and commercial use requires separate inquiries.

YOLOE (2025): Incorporates three types of prompts into a single model:

Result (paper): Compared to YOLO-Worldv2-S, LVIS minival +3.5 AP, about 1/3 the training cost, and 1.4x faster inference (inference datacenter GPU, TensorRT). The official repository is AGPL-3.0 .

Both models are also included in the Ultralytics package (AGPL-3.0), inheriting the AGPL conditions from Section 5 of Part 6.

7. Summary: How to Choose

Model Text-Image Meeting Point Vocabulary Pre-cooking Strengths License
OWL-ViT / OWLv2 Final dot product Possible Simple, example image query, scale Code in google-research/scenic repository. License not verified in this post
Grounding DINO Deep from the start Difficult Sentence-level relationships, accuracy Apache-2.0
YOLO-World Feature pyramid Pre-cooked into weights Real-time GPL-3.0
YOLOE Classification head Pre-cooked into weights Real-time, three prompt types AGPL-3.0
SAM 3 (Part 11) Detector query + presence token — Extends to masks and video SAM License

8. Limitations and Our Project

This post concludes Part 1 of the series. Self-supervised learning without name tags, CLIP, and video, pose, and sports models continue in the sister series (Self-Supervised, Video, Pose, and Sports Folder).

TT in a Word. To teach an older detector what a "racket" is, you had to gather a bunch of racket photos. Now, just the single word "racket" is enough. However, if you just say "table", it might bring up a dining table, so you have to choose your words carefully.

References

Sign in to like

Comments

No comments yet.

Sign in to leave a comment