Skip to main content
QUICK REVIEW

[Paper Review] ReFormer: The Relational Transformer for Image Captioning

Xuewen Yang, Yingru Liu|arXiv (Cornell University)|Jul 29, 2021
Multimodal Machine Learning ApplicationsComputer Science45 references8 citations
TL;DR

ReFormer introduces a unified Transformer-based architecture that jointly optimizes image captioning and scene graph generation by embedding relational information directly into the encoder through a relation-centric loss. By training the encoder to predict object relationships while generating captions, ReFormer achieves state-of-the-art performance on both image captioning (CIDEr: 131.2) and scene graph generation, improving accuracy and model explainability.

ABSTRACT

Image captioning is shown to be able to achieve a better performance by using scene graphs to represent the relations of objects in the image. The current captioning encoders generally use a Graph Convolutional Net (GCN) to represent the relation information and merge it with the object region features via concatenation or convolution to get the final input for sentence decoding. However, the GCN-based encoders in the existing methods are less effective for captioning due to two reasons. First, using the image captioning as the objective (i.e., Maximum Likelihood Estimation) rather than a relation-centric loss cannot fully explore the potential of the encoder. Second, using a pre-trained model instead of the encoder itself to extract the relationships is not flexible and cannot contribute to the explainability of the model. To improve the quality of image captioning, we propose a novel architecture ReFormer -- a RElational transFORMER to generate features with relation information embedded and to explicitly express the pair-wise relationships between objects in the image. ReFormer incorporates the objective of scene graph generation with that of image captioning using one modified Transformer model. This design allows ReFormer to generate not only better image captions with the bene-fit of extracting strong relational image features, but also scene graphs to explicitly describe the pair-wise relation-ships. Experiments on publicly available datasets show that our model significantly outperforms state-of-the-art methods on image captioning and scene graph generation

Motivation & Objective

  • Address the limitation of existing image captioning models that fail to effectively learn and utilize object relationships due to misalignment between object regions and relation predictions.
  • Overcome the lack of explainability in current models that rely on pre-trained relation extractors instead of learning relationships end-to-end.
  • Improve caption quality by incorporating a scene graph generation objective into the training of the encoder, ensuring relational features are explicitly learned and embedded.
  • Enable the model to generate both accurate captions and interpretable scene graphs, enhancing model transparency and linguistic expressiveness.
  • Demonstrate that joint optimization of captioning and scene graph generation leads to better performance than sequential or independent training approaches.

Proposed method

  • Propose a novel ReFormer architecture that uses a single modified Transformer encoder to jointly learn image captioning and scene graph generation.
  • Introduce a sequential training strategy: first pre-train the encoder on scene graph generation using a relation-centric loss ($\mathcal{L}_r$), then fine-tune on image captioning using maximum likelihood estimation ($\mathcal{L}_c$).
  • Embed relational information directly into the visual features by modeling pairwise object interactions within the self-attention mechanism of the Transformer.
  • Use a multi-head attention mechanism that captures both local object features and global relational context, enabling the model to reason about object relationships.
  • Design a dual-head decoder head: one for generating natural language captions and another for predicting subject-predicate-object triplets in the scene graph.
  • Apply a contrastive learning loss to align the visual representations of object pairs with their predicted relations, improving generalization and robustness.
Figure 1. A scene graph containing entities, such as man , hair or racket , that are localized in the image with bounding boxes and the relationships between those entities, such as with , wearing and holding .
Figure 1. A scene graph containing entities, such as man , hair or racket , that are localized in the image with bounding boxes and the relationships between those entities, such as with , wearing and holding .

Experimental results

Research questions

  • RQ1Can joint optimization of image captioning and scene graph generation improve the quality of generated captions compared to separate training?
  • RQ2Does incorporating a relation-centric loss during encoder training lead to more accurate and interpretable relational representations in the image features?
  • RQ3Can a unified Transformer architecture effectively balance the demands of both captioning and scene graph generation without performance degradation?
  • RQ4To what extent does the model’s ability to generate explicit scene graphs enhance the explainability and linguistic richness of the captions?
  • RQ5How does ReFormer compare to state-of-the-art models in both image captioning and scene graph generation benchmarks?

Key findings

  • ReFormer achieves a CIDEr score of 131.2 on the COCO dataset, significantly outperforming existing state-of-the-art models in image captioning.
  • On the Visual Genome dataset, ReFormer achieves SOTA results in all three scene graph evaluation protocols: SGGen (25.4 R@20), SGCls (36.6 R@20), and PredCls (60.5 R@20).
  • Ablation studies show that removing the relation-centric loss ($\mathcal{L}_r$) reduces the CIDEr score from 131.2 to 128.9, proving its critical role in improving caption quality.
  • The model generates more accurate and detailed captions with explicit relational content, such as 'a man is holding a racket', which is supported by the generated scene graph.
  • Qualitative results demonstrate that ReFormer’s scene graphs provide additional interpretability, revealing object attributes and interactions not inferable from captions alone.
  • The sequential training strategy effectively transfers relational knowledge from scene graph generation to captioning, enabling the encoder to learn more semantically grounded representations.
(a) Two-encoder captioning model.
(a) Two-encoder captioning model.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.