Targeted Image Data Augmentation Increases Basic Skills Captioning Robustness

Valentin Barrière, Felipe del Río, Andres Carvallo De Ferari, Carlos Aspillaga, Eugenio Herrera-Berg, Cristian Buc CalderonarXiv 2023 · OpenReview

Abstract

Artificial neural networks typically struggle in generalizing to out-of-context examples. One reason for this limitation is caused by having datasets that incorporate only partial information regarding the potential correlational structure of the world. In this work, we propose TIDA (Targeted Image-editing Data Augmentation), a targeted data augmentation method focused on improving models' human-like abilities (e.g., gender recognition) by filling the correlational structure gap using a text-to-image generative model. More specifically, TIDA identifies specific skills in captions describing images (e.g., the presence of a specific gender in the image), changes the caption (e.g., "woman" to "man"), and then uses a text-to-image model to edit the image in order to match the novel caption (e.g., uniquely changing a woman to a man while maintaining the context identical). Based on the Flickr30K benchmark, we show that, compared with the original data set, a TIDA-enhanced dataset related to gender, color, and counting abilities induces better performance in several image captioning metrics. Furthermore, on top of relying on the classical BLEU metric, we conduct a fine-grained analysis of the improvements of our models against the baseline in different ways. We compared text-to-image generative models and found different behaviors of the image captioning models in terms of encoding visual encoding and textual decoding.

Introduction

Artificial neural networks are notorious for "taking shortcuts." If a training dataset frequently depicts women in kitchens and men in offices, a model might learn a biased correlation rather than actually recognizing the people. When faced with an out-of-context example—such as a man in a kitchen—the model often fails because it relies on the partial correlational structure of its training data rather than true conceptual understanding. This is a significant hurdle for Image Captioning (IC) models, which struggle with basic human-like skills like gender identification, color recognition, and counting when visual context is unusual.

The TIDA Framework

To address these limitations, we propose TIDA (Targeted Image-editing Data Augmentation), a two-step framework designed to "fill the gaps" in a dataset's correlational structure by creating counterfactual training data.

  1. Skill-Related Retrieval & Perturbation: The system uses regular expressions to scan existing image captions for specific skills (e.g., "woman" for gender, "red" for color, or "two" for counting). It then creates a counterfactual caption by perturbing that skill—changing "woman" to "man," "red" to "blue," or "two" to "three."
  2. Targeted Image Editing: Instead of retrieving a new image, TIDA uses a text-to-image generative model (such as Stable Diffusion) to edit the original image. The goal is to change only the target attribute while keeping the background and context identical, forcing the model to decouple the object from its surroundings.
The TIDA framework: perturbing captions and editing images to create counterfactual training pairs.

Experimental Results

The study utilized the Flickr30K benchmark, generating 20,000 augmented images per skill. We fine-tuned a state-of-the-art vision-language model (BLIP) on this augmented dataset. The TIDA-augmented models outperformed the vanilla baseline across almost all metrics. For instance, the overall BLEU@1-4 score rose from 49.7 to 50.5 when trained on all three skills.

Fine-grained analysis revealed significant gains in specific skill areas. In the counting category, the recall for the "negative class" (correctly identifying when a count is not present) improved from 39.1 to 45.9, suggesting the model became less prone to "hallucinating" numbers. Similarly, color and gender recognition showed improved F1 scores through targeted augmentation.

Fine-grained performance metrics across color, counting, and gender skills showing improvements over the baseline.

Probing the Model: Encoder vs. Decoder

One of the most surprising findings came from probing the model's internal components. We tested whether the image encoder (the part that "sees") improved at detecting gender or color. Interestingly, it did not. Instead, the improvement resided in the text decoder. The model did not necessarily "see" better; it learned to be more pertinent and robust in how it translated visual features into descriptive words, effectively becoming a better "student" of the visual input.

Conclusion and Limitations

TIDA demonstrates that targeted, counterfactual data augmentation can significantly improve the robustness of image captioning models. However, challenges remain. Generating tens of thousands of high-quality images is computationally expensive, and the quality of the augmentation is inherently capped by the generative model's ability to render specific edits (e.g., counting remains difficult for current diffusion models). Future work will explore using Large Language Models (LLMs) to automate more complex perturbations and expanding the framework to spatial relationships and actions.

Summary updated

BibTeX
@misc{barriere2023targeted,
  author = {Valentin Barrière and Felipe del Río and Andres Carvallo De Ferari and Carlos Aspillaga and Eugenio Herrera-Berg and Cristian Buc Calderon},
  title = {{Targeted Image Data Augmentation Increases Basic Skills Captioning Robustness}},
  year = {2023},
  eprint = {2309.15991},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.15991},
}
Figure