Investigating and Mitigating Object Hallucinations in Pretrained Vision-Language (CLIP) Models

Yufang Liu, Tao Ji, Changzhi Sun, Yuanbin Wu, Aimin Zhou

Introduction

Large Vision-Language Models (LVLMs) like LLaVA or GPT-4V are impressive, but they frequently "hallucinate"—claiming to see objects in an image that simply aren't there. While many researchers blamed the "brain" of the system (the Large Language Model), this research investigates the "eyes": the CLIP (Contrastive Language-Image Pre-training) encoder.

The authors hypothesize that because CLIP is trained to match images with general captions, it acts like a "bag of words." It might see a dog and a park and give a high score to the caption "a dog in a park," even if the image actually shows a dog in a house. This lack of fine-grained discrimination at the visual encoding stage trickles up, causing the entire AI system to hallucinate.

The OHD-Caps Benchmark and Mitigation Strategy

To address this, the researchers developed a two-stage approach: detection and mitigation.

OHD-Caps Benchmark

They created a "stress test" for CLIP called OHD-Caps. Using images from COCO, Flickr30K, and NoCaps, they employed GPT-4 to generate 27 "negative" captions for every "positive" (correct) caption. These negatives were surgically edited to add nonexistent objects (popular, random, or adversarial), remove existing ones, or alter object properties.

The OHD-Caps benchmark generation pipeline uses segmentation and LLMs to create challenging negative captions.

Fine-grained Contrastive Fine-tuning

To fix the model, they used counterfactual data augmentation. They trained CLIP using a specialized loss function that included:

  • Margin Loss: Forcing the model to ensure the similarity score for the correct caption is higher than the "almost-correct" hallucinated captions by a specific threshold.
  • Object-level Contrast: Specifically teaching the model to distinguish between a caption and its slightly altered, hallucinated version.

Key Results

The study confirms that vanilla CLIP is surprisingly "blind." The most common CLIP model (ViT-L/14) correctly identified the true caption among hallucinated ones only 19.0% of the time. This confirms that the visual encoder is a major bottleneck for truthfulness.

After applying the proposed fine-tuning, the models showed massive accuracy gains on the OHD-Caps benchmark. For instance, the accuracy of CLIP ViT-B/32 jumped from a dismal 14.3% to 82.5%.

Comparison of the proposed method against CLIP-Large baselines on the OHD-Caps benchmark showing significant performance jumps.

Furthermore, when this improved CLIP was used as the visual backbone for LLaVA-1.5, the model's F1 score on the POPE (NoCaps) hallucination benchmark improved from 80.2 to 83.2. Importantly, the average top-1 accuracy across seven zero-shot classification datasets remained stable (65.6% for vanilla vs. 66.0% for the improved version), proving the method doesn't cause "catastrophic forgetting."

Conclusion

By identifying the visual encoder as a primary source of object hallucinations, this work provides a clear path toward more reliable LVLMs. The OHD-Caps benchmark serves as a rigorous evaluation tool, while the fine-grained contrastive learning approach demonstrates that models can be trained to be more "honest" without sacrificing general recognition capabilities. Future work may expand these techniques to address attribute and spatial relationship hallucinations.

Summary updated

BibTeX
@inproceedings{liu2024investigating,
  author = {Yufang Liu and Tao Ji and Changzhi Sun and Yuanbin Wu and Aimin Zhou},
  title = {{Investigating and Mitigating Object Hallucinations in Pretrained Vision-Language (CLIP) Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1016},
}
Figure