Generating Image-Specific Text Improves Fine-grained Image Classification

Emily Mu, Kathleen M. Lewis, Adrian V. Dalca, John V. GuttagarXiv 2023 · DOI

Introduction

Vision-language models (VLMs), such as CLIP, have significantly advanced computer vision by learning robust representations from large-scale image-caption pairs. However, these models often suffer from a "coarse-grained" limitation. While they excel at broad categorization (e.g., distinguishing a dog from a car), they frequently struggle with fine-grained classification tasks, such as identifying specific bird species or rare medical conditions.

The primary bottleneck is the lack of detailed, descriptive training data. Most fine-grained datasets provide only a categorical label (e.g., "Western Meadowlark") without describing the specific visual features that define that label. Standard captioning models typically produce generic descriptions like "a bird on a branch," which fail to capture the discriminative details necessary for expert-level classification. This paper introduces GIST (Generating Image-Specific Text), a framework that leverages the internal knowledge of Large Language Models (LLMs) to generate detailed, image-specific descriptions to bridge this information gap.

Methodology: The GIST Pipeline

The GIST framework operates by generating a rich library of domain-specific descriptions and then aligning them with individual training images. The pipeline consists of four primary stages:

  1. Domain-Specific Prompting: Rather than using generic queries, the system employs structured, domain-specific prompts (e.g., "Describe what a male Western Meadowlark looks like") to extract detailed morphological and visual features from an LLM.
  2. Image-Text Matching: For each training image, a pre-trained CLIP model is used to search the generated library. It selects the $n$ descriptions that most closely match the visual features of that specific image while ensuring the label remains correct (label-preserving).
  3. Concise Summarization: To reduce noise and focus on discriminative features, GPT is used to summarize the matched descriptions into a concise, feature-rich caption.
  4. Contrastive Fine-tuning: Finally, the CLIP model is fine-tuned using these high-quality image-text pairs, aligning the visual representation space with expert-level linguistic knowledge.
The GIST pipeline: GPT generates a library of descriptions, which are then matched to images via CLIP and summarized into concise captions for fine-tuning.

Experimental Setup and Datasets

The authors evaluated GIST across four diverse fine-grained domains to test its versatility:

  • CUB200-2011: 200 species of birds.
  • Flowers102: 102 categories of flowers.
  • FGVC-Aircraft: 100 different aircraft models.
  • Fitzpatrick40: A newly introduced benchmark created by the authors. This is a manually cleaned subset of the Fitzpatrick17k dermatology dataset, containing 40 classes of skin diseases with corrected labels and removed duplicates.

Key Insights

The Importance of Specificity and Brevity

Experimental results indicate that generic prompts perform significantly worse than domain-specific ones. Expert-level prompting is required to extract useful "priors" from the LLM. Furthermore, the authors found that image-specific descriptions are superior to class-specific ones. By matching captions to individual images, the model can account for variations in lighting, pose, and sexual dimorphism (e.g., male vs. female plumage).

Additionally, the summarization step proved critical. Automatically shortening long-winded LLM outputs into concise summaries improved downstream performance by removing "fluff" and focusing the model on discriminative visual markers.

Results and Discussion

GIST achieved state-of-the-art (SOTA) results across multiple evaluation regimes. In full-shot performance, GIST improved accuracy by an average of 4.1% over standard CLIP linear probes and 1.1% over previous SOTA image-text methods. The framework also demonstrated high robustness in few-shot scenarios (3-shot and 5-shot), consistently outperforming competitors like LaBo and FLYP.

Qualitative comparison of GIST against other methods across four datasets. GIST produces more detailed and discriminative text aligned with the specific visual features of the training images.

Qualitative analysis (as seen in the figure above) shows that GIST captions capture relevant details—such as "raised, red lesions with bruise-like appearance" in dermatology or specific wing configurations in aircraft—that off-the-shelf captioners and generic prompts ignore.

Conclusion and Future Work

GIST demonstrates that LLMs already possess the "expert knowledge" required for specialized fields like dermatology or ornithology. The challenge lies in mapping that knowledge onto pixels. While GIST effectively bridges this gap, limitations remain, including the potential for LLM hallucinations and a performance bottleneck in extreme 1-shot regimes. Future work will focus on automating the verification of generated text to ensure reliability in high-stakes domains without manual intervention.

Summary updated

BibTeX
@misc{mu2023generating,
  author = {Emily Mu and Kathleen M. Lewis and Adrian V. Dalca and John V. Guttag},
  title = {{Generating Image-Specific Text Improves Fine-grained Image Classification}},
  year = {2023},
  eprint = {2307.11315},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.11315},
}
Figure