All models

Object Relation Transformer

An image captioning Transformer whose encoder attention accounts for the relative geometry of detected objects.

Multimodal · 1,181 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (26 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
54.9M
Operations
1,181
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2019
Cited by
366 (as of 28 October 2026)
Authors
Simao Herdade, Armin Kappeler, Kofi Boakye, Joao Soares
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m18961
Graph hash
7942da5a332281e850b5640439c99fc7468a18d9d8a59a1f1291ef777dd2cefe
Skeleton hash
f2f557083e39617f6c7d0915636075c6b47ad832594227dc41cd6e67627f6a38
Architecture hash
faf4e1df342028b9893291ec44923d85c2d524d9e73dbd5aa58dbe46d72cafaa
Diagram SHA-256
33947a21ad76886f495eb5259c33e96a49e7971e9e39cd54bd95db371563719b
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

The Object Relation Transformer is an image captioning model that works from detected objects and explicitly tells its attention how those objects are placed relative to one another. The approach it builds on feeds the encoder with feature vectors extracted from the region proposals of an object detector.

Object features come from Faster R-CNN with ResNet-101 as the base CNN. The Transformer has an encoder and a decoder, each a stack of 6 layers. In the encoder's self-attention, the appearance-based attention weight of two objects is multiplied by a learned function of their relative position and size. The paper credits geometric attention to Hu et al., who introduced it for object detection. The authors describe it as a replacement for the positional encoding of the original Transformer, since objects have no inherent order.

The code repository is largely based on Ruotian Luo's Self-critical Sequence Training for Image Captioning repository. Training starts with 30 epochs of pre-training with a softmax cross-entropy loss. After fine-tuning with self-critical training optimized for CIDEr-D and beam search with beam size 5, the paper reports a 6.8% relative improvement over the Up-Down baseline.

Key idea. The Object Relation Transformer adds box relational encoding to the Transformer encoder, so attention between detected objects is weighted by their relative position and size.

  • Object Relation Transformer
  • ORT
  • image captioning
  • geometric attention
  • box relational encoding
  • spatial relationships
  • bottom-up features
  • MS-COCO captioning
  • relation transformer

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{herdade2020imagecaptioningtransformingobjects,
      title={Image Captioning: Transforming Objects into Words}, 
      author={Simao Herdade and Armin Kappeler and Kofi Boakye and Joao Soares},
      year={2020},
      eprint={1906.05963},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1906.05963}, 
}