TLDR: RACap is a new lightweight AI model for image captioning that improves descriptions by explicitly understanding relationships between objects in an image and extracting structured relational information (Subject-Predicate-Object-Environment tuples) from retrieved captions. It achieves superior performance with significantly fewer trainable parameters compared to previous models, demonstrating strong adaptability across various datasets.
Image captioning, the task of generating descriptive text for images, has seen significant advancements with the rise of large language models (LLMs). However, these powerful models often come with substantial computational and resource demands. While some approaches integrate pre-trained vision encoders with LLMs to reduce trainable parameters, they frequently require extensive fine-tuning for optimal performance.
Recent innovations have turned to Retrieval-Augmented Generation (RAG) to incorporate external knowledge, effectively lowering computational costs and enhancing caption quality. Despite these improvements, existing RAG methods often struggle with accurately modeling the spatial and semantic relationships among fine-grained objects within an image. Their semantic prompts can be too coarse-grained, and they typically lack explicit modeling of image objects and their intricate connections.
Introducing RACap: A Relation-Aware Approach
To address these limitations, researchers have developed RACap (Relation-Aware Prompting for Lightweight Retrieval-Augmented Image Captioning). RACap is a novel model designed to not only mine structured relation semantics from retrieval captions but also to identify diverse objects directly from the image. This dual approach allows RACap to effectively retrieve structured relation features that contain heterogeneous visual information, leading to enhanced semantic consistency and relational expressiveness in generated captions.
One of RACap’s key innovations is its ability to extract Subject–Predicate–Object–Environment (S-P-O-E) tuples from retrieval captions. This structured information is less noisy and more accurately reflects object relationships compared to raw retrieval captions. Additionally, an object-aware module, based on the slot-attention mechanism, is introduced to identify distinct visual entities and extract key visual elements from the image. A subsequent slot retrieval module then aligns the most relevant textual features with these individual visual objects.
How RACap Works
The RACap framework leverages pre-trained models like CLIP for image and text encoding, and GPT-2 as a text decoder. It initializes learnable ‘slots’ that interact with image patch features to capture diverse semantics. These slots then guide the retrieval of relevant vectors from both the original retrieval captions and the extracted S-P-O-E tuples. These combined relational features are then fused with the image features to create a ‘relation-aware visual prompt,’ which is fed into the GPT-2 decoder for caption generation.
The process ensures that RACap can fully capture object relationships, leading to more detailed and accurate descriptions. For instance, instead of just identifying a ‘garage,’ RACap can describe a ‘white garage in disrepair sitting next to a brown building,’ highlighting both the object’s state and its relation to another object.
Also Read:
- Improving Text-to-Image Spatial Understanding Through Structured Information
- Tensor Decomposition: A Lightweight Shield for Vision-Language Models Against Adversarial Attacks
Performance and Efficiency
Despite having only 10.8 million trainable parameters (and 222.7 million total parameters), RACap demonstrates superior performance compared to many previous lightweight captioning models. Experimental results on benchmark datasets such as COCO, Flickr30k, and NoCaps show that RACap outperforms its counterparts, even surpassing models with substantially larger parameter counts. It also exhibits strong adaptability to out-of-domain data without requiring further fine-tuning or re-training.
Remarkably, RACap remains competitive even when compared to heavyweight-training models, achieving comparable performance with a fraction of their trainable parameters. This highlights RACap’s efficiency and strong transfer capabilities, making it a promising solution for resource-constrained environments.
For more technical details, you can refer to the full research paper: RACAP: RELATION-A WARE PROMPTING FOR LIGHTWEIGHT RETRIEV AL-AUGMENTED IMAGE CAPTIONING.


