Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Interpreting CLIP's Image Representation via Text-Based Decomposition

About

We investigate the CLIP image encoder by analyzing how individual model components affect the final representation. We decompose the image representation as a sum across individual image patches, model layers, and attention heads, and use CLIP's text representation to interpret the summands. Interpreting the attention heads, we characterize each head's role by automatically finding text representations that span its output space, which reveals property-specific roles for many heads (e.g. location or shape). Next, interpreting the image patches, we uncover an emergent spatial localization within CLIP. Finally, we use this understanding to remove spurious features from CLIP and to create a strong zero-shot image segmenter. Our results indicate that a scalable understanding of transformer models is attainable and can be used to repair and improve models.

Yossi Gandelsman, Alexei A. Efros, Jacob Steinhardt• 2023

Related benchmarks

TaskDatasetResultRank
Medical Image ClassificationOrganMNIST3D
Accuracy12.42
44
SegmentationPascalVOC Single-Class 2012 (val)
Accuracy75
23
SegmentationImageNet Segmentation (test)
Accuracy75.81
23
Image ClassificationGalaxy10
Accuracy24.07
19
Multi-concept groundingMulti-Concept Confusion Dataset
mIoU (fg)25.47
13
Image ClassificationBloodMNIST
Top-1 Accuracy11.04
10
Concept-based ClassificationGravity Spy
Top-1 Accuracy4.25
6
Concept-based ClassificationiNaturalist
Top-1 Accuracy20
6
Concept-based ClassificationHAM10000
Top-1 Accuracy17.1
6
Concept-based ClassificationOrganCMNIST
Top-1 Accuracy7.4
6
Showing 10 of 10 rows

Other info

Follow for update