Introduction
Deep learning has increasingly shifted toward unsupervised and self-supervised learning paradigms, producing powerful models like SimCLR and CLIP. However, while these models are highly effective, they are notoriously difficult to interpret. Unlike supervised models that output simple, understandable class probabilities (e.g., "90% chance this is a dog"), unsupervised models output high-dimensional "representation vectors." Because the individual dimensions of these vectors usually lack human-understandable meaning, traditional explainability tools struggle to make sense of them.
To bridge this gap, researchers have introduced COCOA (COntrastive COrpus Attribution), a novel framework designed to explain the "black box" of unsupervised representation learning. Instead of trying to explain abstract vectors directly, COCOA asks semantically meaningful, contrastive questions: "What features make this sample similar to a specific group (the corpus) and different from another (the foil)?"
The Challenge of Explaining Representations
Traditional explainability tools, such as SHAP or Integrated Gradients, are built to explain scalar outputs. Explaining a representation vector requires a different approach. Previous attempts at "label-free" explanation focused on explaining why a representation is similar to the original image itself (explicand-centric attribution). However, this approach is often noisy and fails to capture why a model associates an image with a specific, human-understandable concept.
The authors of COCOA argue that human-centric explanation is naturally contrastive. We understand things better when we compare them to something else. Therefore, an effective explanation method for representations should leverage this comparative nature.
The COCOA Framework
To solve this, the authors introduce Contrastive Corpus Similarity as a novel "explanation target."
COCOA acts as a flexible wrapper. You can take an existing feature attribution method (like Integrated Gradients, RISE, or KernelSHAP) and point it at a new target function. Instead of targeting a class probability, the target is the difference between:
- The Corpus: The average similarity of the sample (the explicand) to a set of reference samples representing a specific concept.
- The Foil: The average similarity of the sample to a set of contrasting samples (or random noise).
Mathematically, this approach effectively identifies features that point the representation vector along a "contrastive direction" in the latent space—moving it toward the corpus mean and away from the foil mean.
Key Insights and Applications
The authors evaluated COCOA across diverse settings, including ImageNet (SimCLR), CIFAR-10 (SimSiam), MURA musculoskeletal radiographs (ResNet18), and public domain images using CLIP. The framework yielded several compelling insights:
- Semantic Meaning via Comparison: By carefully choosing the corpus and foil, users can "interrogate" the model. For example, you can ask, "What pixels make this image look like a dog rather than a cat?"
- Cross-Modality Explanations: Because models like CLIP map images and text into the same latent space, COCOA can use text as the corpus. You can localize a "bicycle" in an image simply by setting the corpus to the text "a photo of a bicycle" and the foil to "a photo of a car." In zero-shot object localization experiments, COCOA successfully isolated specific objects depending on the contrastive question asked, outperforming standard methods that produced blurry, non-localized heatmaps.
- Explaining Augmentations: In self-supervised models like SimCLR, which are trained to be invariant to augmentations (like cropping or color jitter), COCOA reveals that these models focus heavily on "class-preserving" features (like a dog's face) while ignoring background regions that are often destroyed during augmentation.
- Medical Utility: On the MURA dataset, COCOA successfully highlighted specific bone abnormalities by comparing "abnormal" X-ray cases against a "normal" foil set.
Furthermore, COCOA proved to be highly efficient. The authors demonstrated that a massive corpus is not required; even a small set of reference samples (as few as 20) provides stable and meaningful explanations.
Limitations and Future Work
While COCOA represents a significant step forward, it has limitations. First, it is model-dependent: COCOA can only explain concepts that the model has actually learned. If a model's representation doesn't capture the concept of "stripes," COCOA cannot use a "zebra" corpus to find them.
Additionally, the user must currently manually select the corpus and foil. Future work could involve "automatic concept discovery" to find these sets algorithmically. Finally, like many post-hoc explanation methods, COCOA can be computationally expensive, especially when paired with removal-based methods like RISE that require thousands of model forward passes.
Despite these constraints, COCOA offers a powerful, intuitive, and mathematically grounded way to peer into the representations of unsupervised models, turning abstract vectors into human-relatable insights.
Summary updated