Abstract
Contextualized Image Captioning (CIC) leverages surrounding text to generate relevant image descriptions. However, existing models lack the ability to focus on specific user-defined aspects within a broad context. We introduce Controllable Contextualized Image Captioning (Ctrl-CIC), a task where users guide captions by highlighting text segments. We propose two lightweight controllers: a prompting-based (P-Ctrl) and a recalibration-based (R-Ctrl) approach. Despite having only 5% of the parameters, our models outperform large-scale vision-language models like LLaVA-1.5 in following user intent.
Introduction: The Need for User-Defined Focus
Traditional image captioning often produces generic descriptions, such as "a succulent plant." While Contextualized Image Captioning (CIC) improved this by incorporating surrounding text to generate more specific captions (e.g., "an Aloe plant"), it remains limited. A single image in a long article might relate to several distinct themes—anatomical structure, geographical origin, or chemical properties.
Current CIC models lack a mechanism for users to specify which aspect of the context they want the caption to focus on. Simply truncating the text to the "relevant" part is insufficient, as the model loses the broader background knowledge necessary to interpret the scene correctly. The challenge lies in maintaining the full context while "steering" the model toward a specific user-defined highlight.
Methodology: P-Ctrl and R-Ctrl
We propose two primary methods to achieve this control without altering the underlying model architecture, using a weakly-supervised approach to train on existing image-context-caption triplets.
1. Prompting-based Controller (P-Ctrl)
This method treats the user highlight as a prefix. It prepends the target caption with a "highlight-driven" prompt (e.g., <PRE> water content <SEP> <CPT>...). This encourages the autoregressive language model to attend specifically to the highlighted keywords during the generation process.
2. Recalibration-based Controller (R-Ctrl)
This approach is more surgical, calculating "relevance scores" for every token in the context. During training, it scales the encoder embeddings of highlighted tokens. At inference, a separate weight predictor identifies which tokens should be emphasized, allowing the model to focus its attention precisely on the user's intent.
Datasets and Evaluation
Models were trained and evaluated on the Wiki-Web2M dataset. For high-quality assessment, we utilized Wiki-Web2M₅ₖ, a subset featuring Ctrl-CIC labels generated by GPT-4 to serve as a "silver standard."
Because standard metrics like BLEU or ROUGE fail to measure adherence to user intent, we developed a GPT-4V empowered evaluator. This tool uses Chain-of-Thought (CoT) reasoning to score captions based on context relevance, highlight alignment, and image consistency, showing a high correlation with human judgment.
Key Results and Insights
- Efficiency over Scale: A specialized LongT5-base model achieved a "Highlight Relevance" (HR) score of 1.73, significantly outperforming the much larger LLaVA-1.5 (1.27). This suggests that task-specific steering is more effective than raw model size for controllability.
- Precision vs. Diversity: R-Ctrl proved more precise in following highlights, while P-Ctrl was better at generating a diverse range of captions for the same image when different highlights were provided.
- The Importance of Global Context: Results confirm that keeping the full context is vital for accuracy, while the highlight provides the necessary narrative direction.
Conclusion and Future Work
Ctrl-CIC represents a significant step toward interactive and personalized image captioning. While current methods show strong controllability, future work will address limitations such as the tendency for R-Ctrl to repeat highlight keywords and the current bias toward encyclopedic linguistic styles. Developing adaptive recalibration strategies and tuning for varied tones (e.g., social media vs. academic) remain key areas for exploration.
Summary updated