Machine Vision Therapy: Multimodal Large Language Models Can Enhance Visual Robustness via Denoising In-Context Learning

Zhuo Huang, Chang Liu, Yinpeng Dong, Hang Su, Shibao Zheng, Tongliang Liu

TL;DR

"Machine Vision Therapy" (MVT) is a novel framework that uses the superior visual reasoning of Multimodal Large Language Models (MLLMs) to "heal" smaller, specialized vision models. By using a strategy called Denoising In-Context Learning (DICL), the authors enable MLLMs to automatically identify and rectify errors in vision models deployed in out-of-distribution (OOD) scenarios, effectively providing high-quality supervision without the need for manual human labeling.

What Problem Does This Paper Address?

Modern vision models like CLIP are impressively versatile but notoriously fragile when they encounter Out-of-Distribution (OOD) data—images that look different from their training set (e.g., sketches, adversarial examples, or different lighting). Traditionally, fixing this requires human experts to manually label new data for fine-tuning, which is slow and expensive.

Comparison of MVT against standard fine-tuning and MLLM solutions.

While we now have powerful Multimodal Large Language Models (MLLMs) like GPT-4V or LLaVA that possess deep visual understanding, they aren't a "drop-in" replacement for specialized vision tasks. They are computationally heavy, slow for real-time inference, and often struggle with N-way classification because they weren't specifically trained for it (a problem the authors call "task incompatibility"). This paper asks: Can we use the "wisdom" of a giant MLLM to automatically supervise and improve a smaller, faster vision model?

Methods

The authors introduce Machine Vision Therapy (MVT), which treats the MLLM as a "doctor" that diagnoses and treats the errors of a "patient" (the vision model). The process consists of three main stages:

  1. Transition Matrix Estimation: To understand how the vision model fails, the authors estimate a transition matrix. This matrix identifies which classes are most likely to be confused with one another (e.g., mistaking a "beagle" for a "basset hound").
  2. Denoising In-Context Learning (DICL): This is the core innovation. Instead of asking the MLLM to pick one class out of a thousand, they simplify the task into binary verification. They construct a prompt containing:
  3. A Positive Exemplar: A correct match for the class in question.
  4. A Negative Exemplar: An image from the "most confusing" class identified by the transition matrix.
  5. A Query: The image the vision model got wrong. The MLLM then simply has to decide if the query matches the class. This "Positive vs. Negative" contrast helps the MLLM focus on the subtle features the smaller model missed.

  6. Diagnose and Therapy:

    • Diagnose: The MLLM first checks if the vision model's original prediction is likely correct.
  7. Therapy: If the prediction is flagged as an error, the MLLM evaluates the top-N most likely candidates (guided by the transition matrix) to find the true label.

Finally, the rectified labels from the MLLM are used to fine-tune the vision model, making it more robust for future deployment.

The complete Machine Vision Therapy workflow, from transition matrix estimation to MLLM-guided diagnosis and therapy.

Datasets

The authors evaluated MVT across a massive battery of benchmarks to test different types of robustness:

  • In-Distribution (ID): ImageNet-1K, CIFAR-10/100, MNIST.
  • Out-of-Distribution (OOD): ImageNet-A (adversarial), ImageNet-R (renditions), ImageNet-Sketch, ImageNet-V (various shifts), and iWildCam.
  • Domain Shift: DomainBed subsets including VLCS, PACS, OfficeHome, and DomainNet.
  • Corruptions: ImageNet-C (15 types of digital and physical corruptions).
  • Fine-grained Attributes: CelebA (for facial attribute recognition).

Key Insights and Ideas

  • Verification > Selection: MLLMs are much more accurate at saying "Is this a dog?" (verification) than "Which of these 100 dogs is this?" (selection). DICL leverages this by turning classification into a series of guided binary checks.
  • The Power of the "Negative Example": Simply showing an MLLM what a class is isn't enough. Showing it what the vision model confused it with (the negative exemplar) provides the necessary context to "denoise" the prediction.
  • Automated Supervision: MVT creates a nearly unsupervised pipeline. You only need a tiny "support set" (as few as 3 images per class) to start the process; the MLLM handles the rest of the labeling for the larger OOD dataset.
  • Theoretical Guarantee: The authors provide a theoretical proof showing that under mild assumptions, their DICL method is guaranteed to find the ground truth as the number of in-context examples increases.

Key Results

  • Significant Robustness Boost: On the challenging ImageNet-V dataset, MVT improved the accuracy of a ViT-L model by 17% compared to standard CLIP.
  • Superior to Human-in-the-Loop: MVT often outperformed "Vanilla Fine-Tuning" (which uses limited human-annotated data), proving that MLLM-generated labels can be higher quality for OOD tasks than small-scale human labeling.
  • Generalization across Architectures: The method successfully enhanced various backbones, including ResNet-50, ViT-B, and the massive ViT-g from EVA.
  • Spurious Correlation: MVT showed strong performance on the Spawrious dataset, proving it can ignore misleading backgrounds (like a dog on grass vs. a dog in a kennel) to focus on the actual object.

Limitations and Future Work

  • Computational Cost of "Therapy": While the final fine-tuned model is fast, the "therapy" phase requires running an MLLM, which is computationally expensive and slow.
  • Dependence on MLLM Quality: The "doctor" is only as good as its training. If the MLLM has its own biases or blind spots, the "therapy" might fail.
  • Support Set Requirement: Although minimal, the method still requires a small, clean support set to estimate the transition matrix and provide exemplars.
  • Future Directions: The authors suggest exploring more sophisticated retrieval strategies for exemplars and applying MVT to other modalities like video or 3D perception.

Summary updated

BibTeX
@inproceedings{huang2024machine,
  author = {Zhuo Huang and Chang Liu and Yinpeng Dong and Hang Su and Shibao Zheng and Tongliang Liu},
  title = {{Machine Vision Therapy: Multimodal Large Language Models Can Enhance Visual Robustness via Denoising In-Context Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=LwOfVWgEzS},
}
Figure