Text-Guided Image Clustering

Andreas Stephan, Lukas Miklautz, Kevin Sidak, Jan Philip Wahle, Bela Gipp, Claudia Plant, Benjamin Roth

Abstract

Traditional unsupervised image clustering often struggles with visual noise and a lack of interpretability. This paper introduces Text-Guided Image Clustering, a novel paradigm that utilizes multi-modal models to translate images into descriptive text or targeted keywords before clustering. By shifting the clustering process from high-dimensional pixel or latent spaces to a semantic language space, the researchers demonstrate improved accuracy, reduced sensitivity to background noise, and built-in human interpretability.

Introduction

In the realm of unsupervised learning, image clustering remains a significant challenge. Most state-of-the-art methods rely on learning visual representations that map "semantically similar" images close together. However, these models frequently fall victim to the "blue sky problem": a model might group a jet and a bird together simply because both feature a dominant blue background, failing to distinguish the actual objects of interest.

Furthermore, traditional clusters are often "black boxes." Once an algorithm partitions a dataset, a human must manually inspect the resulting groups to infer their meaning. This paper argues that because humans naturally use language to categorize the world, we should leverage generated text as an abstraction layer to make clustering both more accurate and inherently explainable.

Methodology

The authors propose a three-tiered approach to generating "visual language" for clustering, utilizing models like BLIP-2 and GIT to bridge the gap between pixels and semantics:

  1. Caption-Guided Clustering: Standard image captioning models generate brief, descriptive sentences for each image.
  2. Keyword-Guided Clustering: A Visual Question Answering (VQA) model is prompted with generic queries (e.g., "Which keywords describe the image?") to extract dense semantic tags.
  3. Prompt-Guided Clustering (Knowledge Injection): This novel approach allows researchers to inject domain knowledge to "steer" the clustering. By using specific prompts (e.g., "What room is shown in the picture?"), the model focuses on specific features like environment type rather than generic visual attributes.

Representation and Grouping

Once text is generated, it is converted into numerical vectors using two distinct methods:

  • TF-IDF: A classic frequency-based word-counting method.
  • SBERT: Neural sentence embeddings that capture deeper contextual meaning.

These vectors are then grouped using standard K-Means clustering. To address the interpretability gap, the authors introduce SimpleXAI, a counting-based explainability algorithm that identifies the most frequent and unique keywords for each cluster, providing an automatic label for the group's contents.

Experimental Setup

The approach was evaluated across eight diverse datasets, categorized by the specific challenges they present:

  • Standard Benchmarks: STL10, Cifar10, and ImageNet10 (object-centric).
  • Background Noise: Sports10 and iNaturalist2021 (where the "blue sky problem" is most prevalent).
  • Human-Interpretable Concepts: LSUN (scenes), Human Activity Recognition (HAR), and Facial Expression Recognition (FER2013).

Key Insights

Language as a Semantic Bottleneck

The researchers suggest that text acts as a "semantic bottleneck." Much like the human brain condenses visual information to transmit it between regions, using text filters out irrelevant visual noise—such as lighting conditions or background textures—while preserving the core semantic meaning of the image.

The Subjectivity of Clustering

One of the paper's most significant findings is that clustering is inherently subjective. By changing the VQA prompt, the researchers could reshape the clusters entirely. For instance, in a dataset of indoor scenes, one prompt might cluster by "room type," while another might focus on "furniture" or "lighting," demonstrating the power of prompt-guided knowledge injection.

Performance and Explainability

  • Text vs. Pixels: In many scenarios, clustering generated text outperformed clustering raw image features. On the LSUN dataset, BLIP-2 text features achieved significantly higher accuracy than the underlying image encoder.
  • Model Dominance: BLIP-2 emerged as the superior model for this task, likely due to its robust pre-training on ImageNet21k.
  • Explainability: The SimpleXAI algorithm provided descriptions that were often more accurate than the raw clustering metrics suggested. Even when an image was "misclassified" relative to ground truth, the generated keywords often revealed a logical reason for the grouping.

Limitations and Future Work

While promising, the method is heavily dependent on the quality of the "translator." If the image-to-text model fails to identify an object or hallucinates details, the clustering performance suffers. Additionally, there are notable domain gaps; models trained on general internet data may struggle with specialized fields like medical imaging or satellite photography without fine-tuning.

Future research may extend this paradigm to video, where temporal context is required, or to 3D point clouds. Furthermore, the subjectivity introduced by prompt bias requires careful handling to ensure consistency in automated pipelines.

Conclusion

Text-guided image clustering represents a shift toward more human-centric machine learning. By leveraging the descriptive power of multi-modal models, we can move beyond pixel-level similarities to create clusters that are not only more accurate but also immediately understandable to human users.

Summary updated

BibTeX
@inproceedings{stephan2024text,
  author = {Andreas Stephan and Lukas Miklautz and Kevin Sidak and Jan Philip Wahle and Bela Gipp and Claudia Plant and Benjamin Roth},
  title = {{Text-Guided Image Clustering}},
  booktitle = {EACL},
  year = {2024},
  url = {https://openreview.net/forum?id=wWx7bl17ND},
}
Figure