ECOR: Explainable CLIP for Object Recognition

Ali Rasekh, Sepehr Kazemi Ranjbar, Milad Heidari, Wolfgang NejdlarXiv 2024

Abstract

Large Vision Language Models (VLMs), such as CLIP, have significantly contributed to various computer vision tasks, including object recognition and object detection. Their open vocabulary feature enhances their value. However, their black-box nature and lack of explainability in predictions make them less trustworthy in critical domains. Recently, some work has been done to force VLMs to provide reasonable rationales for object recognition, but this often comes at the expense of classification accuracy. In this paper, we first propose a mathematical definition of explainability in the object recognition task based on the joint probability distribution of categories and rationales, then leverage this definition to fine-tune CLIP in an explainable manner. Through evaluations of different datasets, our method demonstrates state-of-the-art performance in explainable classification. Notably, it excels in zero-shot settings, showcasing its adaptability. This advancement improves explainable object recognition, enhancing trust across diverse applications.

Introduction

Large Vision-Language Models (VLMs) like CLIP have transformed computer vision, offering impressive zero-shot capabilities. However, they remain "black boxes"—they might correctly identify a "castle," but they often cannot explain if they did so because of the "tall walls" or irrelevant background features. ECOR (Explainable CLIP for Object Recognition) addresses this by forcing the model to identify visual rationales before making a final classification, ensuring the prediction is grounded in specific, human-understandable attributes.

Methodology: The Two-Stage Framework

In critical fields like healthcare and autonomous driving, a "trust me" approach is insufficient. ECOR redefines explainability through the lens of joint probability. Instead of just predicting a category ($c$), the model predicts the joint distribution of the category and its rationales ($r$) given an image ($I$).

The two-stage ECOR framework: Stage 1 identifies visual rationales, which then condition the Stage 2 category prediction.

The core of ECOR is a two-stage autoregressive process:

  1. Rationale Prediction: The model first identifies the most likely visual attributes in the image (e.g., "bushy tail") using a prompt-based approach to calculate $P(r|I)$.
  2. Category Prediction: The model then predicts the category (e.g., "fox"), conditioned on those identified rationales, calculating $P(c|r, I)$.

To implement this efficiently, the authors used Prompt-Tuning, adding a small number of learnable parameters to the input layers of the CLIP vision transformer rather than performing full fine-tuning.

Experimental Evaluation

The study utilized the DROR datasets, which consist of (image, category, rationale) triplets. Evaluation focused on the "Gold Standard" metric: RR (Right category, Right rationale). The model was tested across diverse datasets including CIFAR-100, Caltech-101, and ImageNet.

Results and Qualitative Analysis

ECOR achieved state-of-the-art performance across almost all benchmarks. On the complex ImageNet dataset, ECOR achieved an 8.87% RR score, representing a 144% improvement over the previous state-of-the-art.

Qualitative comparison showing that ECOR provides more accurate rationales and better visual grounding (saliency maps) than the DROR baseline.

Qualitative results via saliency maps show that ECOR focuses on the actual object parts described in the rationale. For example, as seen in the comparison above, while baseline models like DROR might identify a dog based on "two legs," ECOR correctly identifies the "mane of hair on its head" and visually grounds the prediction on the correct part of the image. This "step-by-step" thinking makes the model more robust and generalizable, as evidenced by its superior performance in zero-shot settings.

Conclusion

ECOR demonstrates that explainability can be integrated into VLMs without sacrificing accuracy. By anchoring category predictions to simpler visual cues, the model becomes more transparent and trustworthy. Future work will explore extending this method to generative VLMs and specialized domains such as medical imaging.

Summary updated

BibTeX
@misc{rasekh2024ecor,
  author = {Ali Rasekh and Sepehr Kazemi Ranjbar and Milad Heidari and Wolfgang Nejdl},
  title = {{ECOR: Explainable CLIP for Object Recognition}},
  year = {2024},
  eprint = {2404.12839},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.12839},
}
Figure