Caption Anything: Interactive Image Description with Diverse Multimodal Controls

Teng Wang, Jinrui Zhang, Junjie Fei, Hao Zheng, Yunlong Tang, Zhe Li, Mingqi Gao, Shanshan ZhaoarXiv 2023 · DOI

Abstract

Traditional image captioning models often produce generic descriptions that fail to capture specific user interests. We present Caption Anything (CAT), a training-free, highly interactive framework that unifies visual and linguistic controls. By leveraging foundation models like SAM, BLIP-2, and ChatGPT, CAT enables zero-shot, object-centric captioning and chatting, allowing users to define regions of interest through diverse prompts and refine outputs according to preferred styles.

Introduction

Standard image captioning systems typically generate a single "vanilla" description for an entire scene. This approach lacks the flexibility required for real-world applications where users may be interested in specific details or require descriptions in particular formats. Existing Controllable Image Captioning (CIC) methods attempt to solve this but are hindered by the scarcity of large-scale annotated datasets and the rigidity of their control mechanisms.

Overview of the CAT framework's multimodal capabilities, including visual controls, style refinement, and interactive chatting.

Caption Anything (CAT) addresses these challenges by adopting a modular architecture. Instead of training a new model from scratch, CAT chains together state-of-the-art foundation models to achieve multimodal controllability in a zero-shot manner. This training-free approach inherits the power of massive datasets like SA-1B and web-scale vision-language data without the need for task-specific fine-tuning.

Methodology: The Triplet Solver

The CAT framework is structured as a "triplet solver," where each module handles a specific part of the interactive pipeline:

1. Segmenter (SAM)

The process begins with the Segment Anything Model (SAM). CAT accepts various visual prompts—including points, bounding boxes, and mouse trajectories—and converts them into precise pixel-level masks. This allows the system to isolate the user's specific object of interest from the rest of the scene.

Demonstration of diverse visual controls (trajectory, bounding box, and points) used to define regions of interest.

2. Captioner (BLIP-2) and Visual Chain-of-Thought

Once the object is masked, a pre-trained captioner like BLIP-2 generates a raw description. To prevent "background pollution"—where the model incorrectly includes surrounding elements in the object's description—the authors implement a Visual Chain-of-Thought (VCoT). The system crops the masked object, replaces the background with a neutral white, and prompts the model to identify the object's category before generating the final descriptive text.

3. Text Refiner (LLMs)

The raw caption is then passed to a Large Language Model (LLM), such as ChatGPT. The LLM acts as a refiner, incorporating user-specified linguistic controls. This allows the output to be adjusted for sentiment (positive/negative), length (short/long), language (e.g., English/Chinese), and factual style.

Key Insights

The success of CAT stems from three core principles:

  • Modularity: The decoupled design allows for "plug-and-play" upgrades. As vision and language models evolve, they can be integrated into CAT without retraining the entire system.
  • Unified Representation: By converting all visual inputs into masks and all linguistic inputs into text prompts, CAT creates a flexible interface for diverse interactions.
  • Contextual Focus: The VCoT mechanism ensures that the captioner maintains high fidelity to the selected region, even in complex or cluttered environments.

Results and Extensions

CAT demonstrates exceptional zero-shot performance across various tasks. Beyond simple object captioning, the framework supports:

  • Object-Centric Chatting: Users can engage in a dialogue about a specific region, asking follow-up questions about attributes like color or origin.
  • Paragraph Captioning: The system can aggregate descriptions of multiple objects into a cohesive, narrative-style paragraph, effectively summarizing a complex scene.

Discussion and Limitations

While CAT offers unprecedented flexibility, it faces challenges related to inference latency due to the sequential execution of three large models. Additionally, as a pipeline-based system, it is susceptible to error propagation; a failure in the initial segmentation phase will inevitably lead to an incorrect caption. Future research will focus on optimizing the pipeline for real-time interaction and exploring additional input modalities like audio prompts.

Summary updated

BibTeX
@misc{wang2023caption,
  author = {Teng Wang and Jinrui Zhang and Junjie Fei and Hao Zheng and Yunlong Tang and Zhe Li and Mingqi Gao and Shanshan Zhao},
  title = {{Caption Anything: Interactive Image Description with Diverse Multimodal Controls}},
  year = {2023},
  eprint = {2305.02677},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.02677},
}
Figure