NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A ChatGPT Aided Explainable Framework for Zero-Shot Medical Image Diagnosis

Jiaxiang Liu, Tianxiang Hu, Yan Zhang, Xiaotang Gai, Yang Feng, Zuozhu Liu · DOI

TL;DR

This paper introduces a novel framework that combines CLIP (a vision-language model) with ChatGPT to achieve explainable zero-shot medical image diagnosis. By leveraging ChatGPT to generate detailed symptom descriptions for medical conditions, the framework significantly improves diagnostic accuracy and provides interpretable insights, mimicking how human experts diagnose.

What Problem Does This Paper Address?

Diagnosing medical conditions from images is crucial, but it often requires extensive, labeled datasets that are difficult and expensive to acquire. Zero-shot learning, which aims to classify images into categories not seen during training, offers a promising solution. Vision-language models like CLIP have shown success in zero-shot natural image recognition, but their application to medical imaging faces challenges: 1) natural image pre-training might not capture medical nuances, leading to suboptimal performance, and 2) medical image diagnosis demands interpretability, which is often lacking in standard CLIP-based approaches where category names are abstract. This paper addresses the need for an explainable and accurate zero-shot medical image diagnosis system that can overcome these limitations.

Methods

The core of the proposed method is a "ChatGPT Aided Explainable Framework." Here's how it works:

  • CLIP as the Backbone: The framework utilizes a pre-trained CLIP model, specifically its visual and text encoders, for zero-shot classification. CLIP is adept at understanding the relationship between images and text.
  • ChatGPT for Enhanced Descriptions: Instead of just using simple category names (e.g., "Pneumonia"), the system queries ChatGPT with a specially designed prompt. This prompt asks ChatGPT to generate detailed, medically relevant visual features or symptoms associated with each diagnostic category. For example, for "Proliferative Retinopathy," ChatGPT might generate descriptions like "Neovascularization," "Vitreous hemorrhage," or "Tractional retinal detachment."
  • Textual Input Augmentation: These generated symptom descriptions are then fed into CLIP's text encoder. This effectively enriches the textual representation of each diagnostic category, providing CLIP with more nuanced information beyond just the category name.
  • Similarity-Based Diagnosis: The framework then computes similarity scores between the input medical image (processed by CLIP's visual encoder) and the enriched textual representations of the diagnostic categories. The category with the highest similarity score is predicted as the diagnosis.
  • Explainability through Symptoms: The generated symptoms themselves serve as the explanation. By observing which symptoms contribute most to the similarity score (visualized through attention maps), one can understand why the model made a particular diagnosis.

Datasets

The framework was evaluated on a combination of public and private datasets:

  • Public Datasets:
    • Pneumonia Chest X-ray Dataset
    • Montgomery Dataset (for Tuberculosis)
    • Shenzhen Dataset (for Tuberculosis)
    • Indian Diabetic Retinopathy Image Dataset (IDRID)
  • Private Dataset:
    • Brain Tumor Dataset (constructed by the authors, focusing on Glioblastoma Multiforme and Primary Central Nervous System Lymphoma, which are hard to distinguish). This dataset was specifically created to ensure the model was tested on data potentially unseen during CLIP's pre-training.

Key Insights and Ideas

  • LLMs as Medical Knowledge Augmenters: The paper demonstrates that Large Language Models (LLMs) like ChatGPT can be effectively used to augment the knowledge base of vision-language models for specialized domains like medical imaging. This is a significant step beyond using LLMs solely for text-based tasks.
  • Prompt Engineering is Crucial: The authors highlight that the quality of the generated symptoms heavily relies on the prompt design. A carefully crafted prompt that guides ChatGPT to focus on specific medical visual features, rather than general descriptions, leads to better performance and more relevant explanations.
  • Explainability as a Direct Output: The generated symptoms are not just a byproduct but a core component of the framework's explainability. This approach directly links diagnostic decisions to observable medical features, making the model's reasoning transparent.
  • Unlocking CLIP's Potential: The research suggests that while CLIP has inherent capabilities for medical image analysis, its full potential is unlocked when combined with domain-specific knowledge augmentation, as provided by LLMs.

Key Results

  • Significant Accuracy Boost: The proposed framework consistently outperformed the standard CLIP-based zero-shot classification across all tested datasets. Accuracy improvements ranged from a few percentage points to over 17% on specific datasets (e.g., Shenzhen).
  • Improved Performance on Challenging Cases: Notably, on the Shenzhen dataset, where standard CLIP struggled with a uniform accuracy of ~50.76% (close to random chance for the imbalanced classes), the proposed method achieved significantly higher accuracy.
  • Explainability Demonstrated: Visualizations (attention maps) showed that the model, when augmented with ChatGPT-generated symptoms, focused on more relevant areas of the medical images, aligning with the provided symptom descriptions. This provides qualitative evidence of the framework's interpretability.
  • Comparison with OpenFlamingo: The framework showed competitive or superior performance compared to OpenFlamingo, another large multimodal model, especially on the custom BrainTumor dataset, highlighting the effectiveness of the proposed approach.

Limitations and Future Work

  • ChatGPT Hallucinations: A significant limitation acknowledged is the potential for ChatGPT to generate inaccurate or "hallucinated" medical information. The authors emphasize the need for advanced algorithms to mitigate this in complex medical scenarios.
  • Performance on Severity Evaluation: The framework showed unsatisfactory performance on the IDRID dataset, which requires severity evaluation rather than simple classification. This suggests that tasks requiring fine-grained distinctions in severity might be more challenging.
  • Prompt Design Optimization: While the designed prompt improved performance, further exploration of prompt engineering and its impact on accuracy and explainability is suggested.
  • Feature Aggregation Strategies: The paper explored basic aggregation strategies (mean, max) for combining symptom features, with "mean" performing best. More sophisticated multi-modal feature aggregation mechanisms could be investigated.
  • Bridging the Gap with Supervised Methods: The zero-shot performance, while improved, still lags behind state-of-the-art supervised methods. Future work aims to narrow this gap through better architectures and prompt designs.

Summary updated

BibTeX
@misc{liu2023chatgpt,
  author = {Jiaxiang Liu and Tianxiang Hu and Yan Zhang and Xiaotang Gai and YANG FENG and Zuozhu Liu},
  title = {{A ChatGPT Aided Explainable Framework for Zero-Shot Medical Image Diagnosis}},
  year = {2023},
  eprint = {2307.01981},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.01981},
}
Figure