Describing Differences in Image Sets with Natural Language

Lisa Dunlap, Yuhui Zhang, Xiaohan Wang, Ruiqi Zhong, Trevor Darrell, Jacob Steinhardt, Joseph E. Gonzalez, Serena Yeung-Levy · DOI

Abstract

How do two sets of images differ? Discerning set-level differences is crucial for understanding model behaviors and analyzing datasets, yet manually sifting through thousands of images is impractical. To aid in this discovery process, we explore the task of automatically describing the differences between two $\textbf{sets}$ of images, which we term Set Difference Captioning. This task takes in image sets $D_A$ and $D_B$, and outputs a description that is more often true on $D_A$ than $D_B$. We outline a two-stage approach that first proposes candidate difference descriptions from image sets and then re-ranks the candidates by checking how well they can differentiate the two sets. We introduce VisDiff, which first captions the images and prompts a language model to propose candidate descriptions, then re-ranks these descriptions using CLIP. To evaluate VisDiff, we collect VisDiffBench, a dataset with 187 paired image sets with ground truth difference descriptions. We apply VisDiff to various domains, such as comparing datasets (e.g., ImageNet vs. ImageNetV2), comparing classification models (e.g., zero-shot CLIP vs. supervised ResNet), summarizing model failure modes (supervised ResNet), characterizing differences between generative models (e.g., StableDiffusionV1 and V2), and discovering what makes images memorable. Using VisDiff, we are able to find interesting and previously unknown differences in datasets and models, demonstrating its utility in revealing nuanced insights.

Introduction

Machine learning researchers frequently encounter the need to understand distributional shifts between datasets. For instance, determining why a model performs significantly worse on ImageNetV2 compared to the original ImageNet, or identifying the visual features that make an image "memorable" to humans, requires identifying subtle, set-level patterns.

Example of a social dining scene from Set A.

Manually sifting through thousands of images to find these "statistical needles in the haystack" is a Herculean task for humans and computationally impossible for current Vision-Language Models (VLMs) due to context window limits. Existing methods typically describe single images or changes between pairs, but they lack a scalable way to describe differences between entire distributions. To address this, we introduce VisDiff, a framework designed for Set Difference Captioning.

Methodology: The Proposer-Ranker Framework

VisDiff utilizes a two-stage "proposer-ranker" framework to bridge the gap between large-scale visual data and semantic reasoning:

  1. The Proposer: Because thousands of images cannot be fed directly into a prompt, VisDiff uses BLIP-2 to generate captions for random subsets of both image sets. These captions are then processed by GPT-4, which acts as a detective to brainstorm candidate descriptions of concepts that appear more frequently in Set A than Set B.
  2. The Ranker: To ground these candidates in visual reality and prevent hallucinations, a CLIP-based ranker evaluates every candidate against all images in both sets. It calculates a "difference score" (using AUROC) to determine how effectively a description distinguishes the two distributions.

This hybrid approach leverages GPT-4 for semantic flexibility and CLIP for large-scale visual verification.

VisDiffBench and Evaluation

To evaluate this framework, we introduced VisDiffBench, a benchmark consisting of 187 paired image sets with ground-truth difference descriptions. This includes PairedImageSets across three difficulty levels (Easy, Medium, Hard), ranging from obvious differences like "dogs vs. cats" to subtle shifts like "people practicing yoga" vs. "people meditating."

VisDiff achieved 88% Acc@1 on "Easy" tasks and 61% Acc@1 on "Hard" tasks. The system proved remarkably robust; even when sets were "polluted" (e.g., Set A only contained 70% of the target class), VisDiff could still identify the primary difference with high accuracy.

Key Insights: From Temporal Shifts to Model Auditing

Applying VisDiff to real-world datasets revealed several nuanced insights:

  • Temporal Shifts in ImageNet: VisDiff discovered that ImageNetV2 contains significantly more "Instagram-style" photos—close-ups, selfies, and images with filters—compared to the original ImageNet collected a decade earlier. This suggests model performance drops may be due to cultural shifts in photography.
  • Model Auditing: The framework revealed that CLIP outperforms ResNet at recognizing text and labels, while ResNet models tend to fail more frequently on images where humans are interacting with objects.
  • Generative Evolution: When comparing Stable Diffusion v1 to v2, VisDiff identified that v2 produces more vibrant colors and is more likely to include white borders or frames, a previously undocumented quirk.

Conclusion

VisDiff demonstrates that using language as a reasoning bridge allows models to capture high-level semantic concepts that raw pixel embeddings might miss. While the system is currently limited by the quality of initial captions and inherent CLIP biases, it serves as a powerful assistive tool for dataset analysis and model auditing. Future work will explore using native multi-modal models to process large batches of images more efficiently.

Summary updated

BibTeX
@inproceedings{dunlap2023describing,
  author = {Lisa Dunlap and Yuhui Zhang and Xiaohan Wang and Ruiqi Zhong and Trevor Darrell and Jacob Steinhardt and Joseph E. Gonzalez and Serena Yeung-Levy},
  title = {{Describing Differences in Image Sets with Natural Language}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  doi = {10.1109/cvpr52733.2024.02284},
}
Figure