CCDiff: Inverse Canonical Correlation Analysis for Discovering Visual Differences in Natural Language

Neelesh Bisht, Xingjian Li, Zihan Li, Bo Jiang, Runmin Jiang, Mostofa Rafid Uddin, Yang Liu, Min XuNeurIPS 2026

TL;DR

Comparing two massive folders of images to figure out what makes them systematically different usually requires either superhuman patience or burning through thousands of expensive LLM tokens. CCDiff solves this by flipping a classic statistical tool on its head—looking for anti-correlations in shared image-text embedding spaces rather than correlations. The result is a training-free, local-friendly algorithm that runs over twice as fast as GPT-4-powered baselines, uses zero LLM API tokens during discovery, and actually beats them in accuracy.

What Problem Does This Paper Address?

Imagine your autonomous driving model suddenly starts failing in a new city, or a medical AI acts strangely on X-rays from a different hospital. Manually eyeballing tens of thousands of images to spot the distribution shift is impossible.

This is the domain of Set Difference Captioning: given Image Set A and Image Set B, automatically generate natural language descriptions of concepts that are more true for A than B.

Figure 2: Examples of CCDiff across difficulty levels. Representative image-set pairs and the discovered textual differences for easy (top), medium (middle), and hard (bottom) comparisons. Easy cases differ by salient object categories (e.g., tulips vs. roses), medium cases require contextual discrimination within the same scene type (e.g., mushrooms vs. ferns in forests), and hard cases involve fine-grained semantic distinctions under similar visual contexts (e.g., chess vs. checkers played outdoors).

Current state-of-the-art methods (like VisDiff) tackle this by captioning images and repeatedly prompting massive LLMs (like GPT-4) to propose and rank differences. While clever, this creates a brutal bottleneck: it’s slow, expensive at scale, and completely off-limits in privacy-sensitive or low-resource environments (like hospitals) where you cannot beam proprietary data to closed commercial APIs.

Methods

Instead of outsourcing reasoning to an LLM, the authors treat difference discovery as a pure geometry problem inside CLIP’s multimodal embedding space (where images and text live as vectors in the same mathematical neighborhood).

Figure 1: Overview of the CCDiff framework. Given two image sets, CCDiff discovers set-level semantic differences using inverse CCA with significantly reduced LLM dependence. This figure illustrates a single directional comparison (e.g., concepts distinctive to set A relative to set B). The same procedure can be applied symmetrically by swapping the two sets to find concepts distinctive to the other set.

CCDiff is training-free and runs in three stages:

  1. Candidate Pool Creation & Selection (Standard): First, gather a broad pool of candidate text concepts—either from an existing domain vocabulary or a lightweight local captioner (like BLIP-2). Using CLIP cosine similarity, filter this pool down to the top-$k$ concepts most relevant to Set A, and do the same for Set B.
  2. Inverse-CCA (Novel): Classical Canonical Correlation Analysis (CCA) takes two sets of variables and finds linear projections that maximize their correlation. CCDiff turns this upside down. To find what makes Set A unique, it pairs Set A’s text embeddings with Set B’s image embeddings, runs CCA, and looks at the components with near-zero correlation. These "least-correlated directions" represent concepts present in Set A’s text space that Set B’s images completely fail to explain. Mapping these vectors back to the nearest text embeddings surfaces distinctive candidate concepts.
  3. CCDiff Scoring (Novel): A distinctive concept isn't useful if it only appears in one weird outlier image. So, CCDiff ranks final candidates using a weighted score that balances distinctiveness (how poorly it correlates with the opposing set) and within-set representativeness (how strongly it aligns with its own set).

Datasets

Because CCDiff is training-free, datasets are used strictly for evaluation:

  • VisDiffBench: The primary benchmark of 187 paired image sets (split into Easy, Medium, and Hard semantic differences).
  • MetaShift & BREEDS: Large-scale general vision datasets (1,379 pairs from Visual Genome and 50 superclass pairs from ImageNet, respectively) testing scalability and noise robustness.
  • MIMIC-CXR (Newly curated splits): The authors constructed 30 paired chest X-ray sets across 24 radiological categories to test specialized medical utility.
  • DTD (Describable Textures Dataset): 50 paired sets evaluating abstract texture differences.
  • Open-ended Application Datasets: ImageNet (debugging ResNet), PartiPrompts/DiffusionDB (comparing Stable Diffusion versions), and LaMem (image memorability).

Key Insights and Ideas

  • Flipping CCA for Multimodal Discovery: Using classical statistics to look at what doesn't correlate across modalities (Set A text vs. Set B images) is a remarkably clean mathematical substitute for LLM "reasoning."
  • Immunity to Caption Noise: In specialized domains like chest X-rays, captioning models are notoriously noisy. LLM-based pipelines get tripped up by weird caption artifacts because they only read the text. Because CCDiff cross-examines text embeddings directly against opposing image distributions via CCA, it filters out caption hallucinations naturally.
  • Uncovering Hidden Model Bugs: When auditing ImageNet images where ResNet-50 fails, CCDiff not only caught known failure modes (human presence) without human intervention, it uncovered a brand-new culprit: scene clutter.

Key Results

CCDiff consistently matches or beats heavyweight LLM pipelines while slashing compute costs:

  • VisDiffBench: Surpasses the best GPT-4V and GPT-4 baselines on Acc@1 across all splits—hitting 96% (Easy), 76% (Medium), and 70% (Hard).
Table 1: Results on VisDiffBench. CCDiff (with BLIP-2 captions and CLIP features) surpasses the best VisDiff pipelines (GPT-4V image-based and BLIP-2 + GPT-4 caption-based proposers with CLIP rankers) on Acc@1 across all difficulty levels, while significantly outperforming other proposer–ranker combinations and avoiding the use of GPT-4 during the core proposal and difference discovery stages. The three CCDiff variants using Linear (LK), Polynomial (PK), and Gaussian (GK) kernels show consistently high accuracy across all difficulty levels.
  • Efficiency: Achieves over a 2$\times$ speedup (48.6s vs. 108.2s per run) and drops discovery LLM token usage from ~3,369 tokens per pair to 0, running comfortably on a single RTX 3090 GPU.
  • Scale & Medical: Beats VisDiff by 33% relatively on the noisy MetaShift dataset (0.32 vs. 0.24 Acc@1) and dominates on MIMIC-CXR chest X-rays (73% vs. 59% Easy; 68% vs. 55% Medium).
  • Real-World Insights: Quantitatively confirmed that "scene clutter" correlates with a 7.4% accuracy drop in ResNet-50, and showed Stable Diffusion v2 generates higher color saturation, more white borders, and more "single centered subjects" than v1.

Limitations and Future Work

CCDiff trades generative creativity for speed and auditability. Because it selects concepts from a fixed candidate pool rather than generating new sentences on the fly, it is strictly bounded by the coverage of its input vocabulary or captioner. If a subtle visual difference isn't captured in that initial text pool (such as low-level pixel distortions), CCDiff cannot invent the words to describe it. Careful curation of domain lexicons or lightweight captioners remains essential, while future extensions are not explicitly discussed in the main text.

Summary updated

Abstract

Set-level visual difference discovery is increasingly important for dataset auditing and for understanding model behavior under distribution shift, yet manually inspecting thousands of images is impractical. This motivates the emerging task of *set difference captioning*, i.e., describing concepts that are more often true for one image set than another. Different from existing approaches which heavily rely on large language models (LLMs), incurring substantial computational cost in terms of time and tokens, we introduce **CCDiff**, a lightweight, statistically grounded, and training-free framework for set difference captioning that significantly reduces LLM dependence during core difference discovery, achieving over **$2\times$** speedup and reducing token usage to zero. CCDiff operates in three stages: constructing a shared pool of candidate concepts from domain vocabularies or lightweight captioning models, filtering candidates to obtain set-specific concept pools, and performing inverse canonical correlation analysis (CCA) across sets to identify low-correlation directions that correspond to set differences. Candidate concepts are then ranked using a CCDiff score that balances inverse correlation with within-set representativeness. We evaluate CCDiff on VisDiffBench and further validate it on additional domains including MetaShift and MIMIC-CXR. Across benchmarks and real-world settings, CCDiff matches or exceeds prior LLM-based approaches while being substantially more efficient and scalable.
BibTeX
@inproceedings{bisht2026ccdiff,
  author = {Neelesh Bisht and Xingjian Li and Zihan Li and Bo Jiang and Runmin Jiang and Mostofa Rafid Uddin and Yang Liu and Min Xu},
  title = {{CCDiff: Inverse Canonical Correlation Analysis for Discovering Visual Differences in Natural Language}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=w8mxaFucap},
}
Figure