diverse image captioning with context-object split latent ......a single accurate caption containing...

12
Diverse Image Captioning with Context-Object Split Latent Spaces Shweta Mahajan Stefan Roth Dept. of Computer Science, TU Darmstadt {mahajan@aiphes, stefan.roth@visinf}.tu-darmstadt.de Abstract Diverse image captioning models aim to learn one-to-many mappings that are innate to cross-domain datasets, such as of images and texts. Current methods for this task are based on generative latent variable models, e.g. VAEs with structured latent spaces. Yet, the amount of multimodality captured by prior work is limited to that of the paired training data – the true diversity of the underlying generative process is not fully captured. To address this limitation, we leverage the contextual descriptions in the dataset that explain similar contexts in different visual scenes. To this end, we introduce a novel factorization of the latent space, termed context- object split, to model diversity in contextual descriptions across images and texts within the dataset. Our framework 1 not only enables diverse captioning through context-based pseudo supervision, but extends this to images with novel objects and without paired captions in the training data. We evaluate our COS-CVAE approach on the standard COCO dataset and on the held-out COCO dataset consisting of images with novel objects, showing significant gains in accuracy and diversity. 1 Introduction Modeling cross-domain relations such as that of images and texts finds application in many real- world tasks such as image captioning [5, 9, 20, 23, 26, 31, 33, 48]. Many-to-many relationships are innate to such cross-domain tasks, where a data point in one domain can have multiple pos- sible correspondences in the other domain and vice-versa. In particular for image captioning, A couple of <s> sitting on a <s> in front of a forest A <s> on leash sitting in a park Annotated paired data A black bear sitting on a chair in front of a forest A bear sitting on a chair in a park Context-object split latent space Diverse captions A couple of mountain bikers sitting on a bench in front of a forest A dog on leash sitting in a park Input image Contextual descriptions in training data Figure 1: Context-object split latent space of our COS-CVAE to ex- ploit similarities in the contextual annotations for diverse captioning. given an image there are many likely sentences that can describe the un- derlying semantics of the image. It is thus desirable to model this multi- modal conditional distribution of cap- tions (texts) given an image to gener- ate plausible, varied captions. Recent work has, therefore, explored generating multiple captions condi- tioned on an image to capture these diverse relationships in a (condi- tional) variational framework [6, 14, 32, 42]. These variational frameworks encode the conditional distribution of texts given the image in a low-dimensional latent space, allowing for efficient sampling. However, the diversity captured by current state-of-the-art latent variable models, e.g.[6, 42], is limited to the paired annotations provided for an image. While the recently proposed LNFMM approach [32] allows for additional unpaired data of images or texts to be incorporated, the amount of diversity for a given image is again limited to the paired annotated data. 1 Code available at https://github.com/visinf/cos-cvae 34th Conference on Neural Information Processing Systems (NeurIPS 2020), Vancouver, Canada.

Upload: others

Post on 30-Dec-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Diverse Image Captioning withContext-Object Split Latent Spaces

Shweta Mahajan Stefan RothDept. of Computer Science, TU Darmstadt

{mahajan@aiphes, stefan.roth@visinf}.tu-darmstadt.de

Abstract

Diverse image captioning models aim to learn one-to-many mappings that areinnate to cross-domain datasets, such as of images and texts. Current methods forthis task are based on generative latent variable models, e.g. VAEs with structuredlatent spaces. Yet, the amount of multimodality captured by prior work is limitedto that of the paired training data – the true diversity of the underlying generativeprocess is not fully captured. To address this limitation, we leverage the contextualdescriptions in the dataset that explain similar contexts in different visual scenes.To this end, we introduce a novel factorization of the latent space, termed context-object split, to model diversity in contextual descriptions across images and textswithin the dataset. Our framework1 not only enables diverse captioning throughcontext-based pseudo supervision, but extends this to images with novel objects andwithout paired captions in the training data. We evaluate our COS-CVAE approachon the standard COCO dataset and on the held-out COCO dataset consisting ofimages with novel objects, showing significant gains in accuracy and diversity.

1 Introduction

Modeling cross-domain relations such as that of images and texts finds application in many real-world tasks such as image captioning [5, 9, 20, 23, 26, 31, 33, 48]. Many-to-many relationshipsare innate to such cross-domain tasks, where a data point in one domain can have multiple pos-sible correspondences in the other domain and vice-versa. In particular for image captioning,

A couple of <s> sitting on a <s> in front of a forest

A <s> on leash sitting in a park

Annotated paired data

A black bear sitting on a chair in

front of a forest

A bear sitting on a chair in a park

Context-object split latent space

Diverse captions

A couple of mountain bikers

sitting on a bench in front of

a forest

A dog on leash sitting in a park

Input image

Contextual descriptions in training data

Figure 1: Context-object split latent space of our COS-CVAE to ex-ploit similarities in the contextual annotations for diverse captioning.

given an image there are many likelysentences that can describe the un-derlying semantics of the image. Itis thus desirable to model this multi-modal conditional distribution of cap-tions (texts) given an image to gener-ate plausible, varied captions.

Recent work has, therefore, exploredgenerating multiple captions condi-tioned on an image to capture thesediverse relationships in a (condi-tional) variational framework [6, 14, 32, 42]. These variational frameworks encode the conditionaldistribution of texts given the image in a low-dimensional latent space, allowing for efficient sampling.However, the diversity captured by current state-of-the-art latent variable models, e.g. [6, 42], islimited to the paired annotations provided for an image. While the recently proposed LNFMMapproach [32] allows for additional unpaired data of images or texts to be incorporated, the amountof diversity for a given image is again limited to the paired annotated data.

1Code available at https://github.com/visinf/cos-cvae

34th Conference on Neural Information Processing Systems (NeurIPS 2020), Vancouver, Canada.

Page 2: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Since standard learning objectives reward only the generated captions that belong to ground-truthannotations, the underlying multimodality of the conditional image and text distributions in the latentspace can be better captured with access to more annotated paired data. To this end, the initial work ofKalyan et al. [21] improves multimodality of the input-output mappings with additional supervisionfrom annotations of ‘nearby’ images. However, Kalyan et al. model one-to-many relationships in theposterior distribution, where the sampling time grows exponentially in the sequence length. Thusbeam search is required for sampling diverse captions, which makes it computationally inefficient [5].

In this work, we propose a novel factorized latent variable model, termed context-object splitconditional variational autoencoder (COS-CVAE), to encode object and contextual information forimage-text pairs in a factorized latent space (Fig. 1). We make the following contributions: (i) OurCOS-CVAE framework exploits contextual similarities between the images and captions within thedataset in a pseudo-supervised setup. Specifically, the COS factorization in addition to annotatedpaired data leverages diverse contextual descriptions from captions of images that share similarcontextual information, thus encoding the differences in human captions that can be attributed tothe many ways of describing the contexts. (ii) This additionally allows extending COS-CVAE topreviously unseen (novel) objects in images. To the best of our knowledge, this is the first (variational)framework that allows to describe images with novel objects in a setup for diverse caption generation.(iii) We show the benefits of our approach on the COCO dataset [29], with a significant boost inaccuracy and diversity. Moreover, varied samples can be efficiently generated in parallel.

2 Related Work

Image captioning. Classical approaches for image captioning are framed as sequence modelingtask, where image representations from convolutional neural networks (CNNs) are input to recurrentneural networks (RNNs) to generate a single caption for an image [15, 19, 23, 30, 33, 41, 46]. Insteadof RNNs, recent work uses convolutional networks [5] or transformer-based networks [11] for captiongeneration. Anderson et al. [1] have proposed an attention-based architecture, which attends toobjects for generating captions. Lu et al. [31] generate caption templates with slots explicitly tied toimage regions, which are filled with objects from object detectors [35]. These methods optimize forsingle accurate captions for an image and, therefore, cannot model one-to-many relationships.

Diverse image captioning. Recent work on image captioning has focused on generating multiplecaptions to describe an image. Vijayakumar et al. [40] generate diverse captions based on a word-to-word Hamming distance in the high-dimensional output space of captions. Kalyan et al. [22] improvethe accuracy of [40] by optimizing for a set of sequences. Cornia et al. [10] predict saliency maps fordifferent regions in the images for diverse captioning. Wang and Chan [43] encourage diversity usinga determinantal point process. To mitigate the limitations of sampling in high-dimensional spaces,recent work leverages generative models such as generative adversarial networks (GANs) [36] orVariational Autoencoders (VAEs). Since GANs for diverse caption generation have limited accuracy,recent works [6, 32, 44] have used VAEs to learn latent representations conditioned on images tosample diverse captions. Wang et al. [44] learn latent spaces conditioned on objects whereas Chenet al. [8] leverage syntactic or lexical domain knowledge. Aneja et al. [6] enforce sequential Gaussianpriors and Mahajan et al. [32] learn domain-specific variations in a latent space based on normalizingflows. In all cases, the amount of diversity that can be modeled is limited to the availability of pairedtraining data. Here, in contrast, we extend the task of diverse image captioning to exploit informationfrom the annotations in the dataset through context-based pseudo supervision.

Novel object captioning. Recent works [3, 12, 17, 27, 31, 39, 45, 47] have focused on generatinga single accurate caption containing novel objects, for which no paired training data is provided. Manyproposed approaches [27, 31, 47] explicitly use object detectors at test time to generate captions withnovel objects. Lu et al. [31] generate slotted captions, where the slots are filled with novel objectsusing object detectors. Li et al. [27] extend the copying mechanism of Yao et al. [47] with pointernetworks to point where to copy the novel objects in the caption and Cao et al. [7] use meta learningfor improved accuracy. In contrast, our framework does not require class labels of novel objects attest time. Constrained beam search [2] based on beam search enforces the generated sequence tocontain certain words. Anderson et al. [3] use constrained beam search where objects detected fromimages serve as constraints to be included in the generated captions for novel objects, which are thenused for training to generate a single caption. In this work, we extend novel object captioning to thetask of diverse captioning with our COS-CVAE through context-based pseudo supervision.

2

Page 3: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Table 1: Context-based pseudo supervision from captions of the COCO dataset.Image Human annotations Retrieved contexts Generated pseudo captions

• a man taking a picture of people on abench near a beach

• there are many kites that are beingflown on the beach

• a man is taking photos of kites in the air• a man is taking a picture of people fly-

ing kites• a person taking a photo of a kite in the

sky

• a <s> holding on to a <s> while <s> sailin the background

• a <s> flying a <s> in the blue cloudfilled sky

• large <s> are being flown in the air• several octopus <s> are being flown in

a blue sky• two <s> flying in the sky next to a

smoke stack

• a person holding on to a bench whilekites sail in the background

• a person flying a kite in the blue cloudfilled sky

• large kite are being flown in the air• several octopus kites are being flown in

a blue sky• two kites flying in the sky next to a

smoke stack

3 COS-CVAE Approach

Consider the example in Tab. 1. As shown, the COCO dataset [29] provides provides five humanannotations for the image (1st and 2nd column). However, there are multiple possible contextualdescriptions in the dataset that can describe the image similarly well. For example, the trainingdataset contains a caption “a woman holding onto a kite while sailboats sail in the background” foran image (distinct from that in Tab. 1). The contextual description for this caption (3rd column) –where the objects in the caption are replaced with a placeholder – can describe the context of theimage in Tab. 1, combining it with the concepts “person”, “bench”, and “kite”. In this work, we aimto utilize these contexts in the latent space to capture one-to-many relationships for image captioning.Our novel COS-CVAE framework is able to better capture diversity through generated context-basedpseudo supervision (4th column).

Preliminaries. We first split each ground-truth caption from the paired data as x = {xm, xo},where xo represents the objects in the visual scene that are described in the caption while xm isthe contextual description in the caption. Note that contextual description here refers to the sceneinformation of the image excluding the objects or visible concepts. This can include the scenebackground, (spatial) relationships between the objects, or attributes descriptive of the objects inthe image (Tab. 1, 3rd column). To provide context-based pseudo supervision, in a first step we usethe method of [16] to learn a joint embedding of the paired image-(con)text data {xm, I} on thetraining set. Importantly, we encode these similarities using contextual descriptions xm instead ofthe caption x itself. For an image I ′ in the training set, with or without human annotated captions,this contextual embedding allows us to then find the nearest neighboring contextual descriptionsym ∈ N(I ′). Equipped with these additional descriptions, we can eventually overcome the limitedexpressiveness and variability of the annotated paired data in the dataset.

Problem formulation. To train a conditionally generative model for image captioning, onetypically aims to maximize the conditional likelihood2 of the conditional distribution pφ(x | I),parameterized by φ, for the caption sequence x = (x1, . . . , xT ) of length T given an image I . Asone of our principal aims here is to ensure diverse image-text mappings, we need to capture themultimodality of this generative process. To that end, we introduce explicit sequential latent variablesz = (z1, . . . , zT ) and define the latent variable model over the data {x, I} as

pφ(x, z | I) =∏t

pφ(xt | x<t, z≤t, I) pφ(zt | z<t, x<t, I), (1)

where we have applied the product rule to obtain the temporal factorization (w.l.o.g.). The formulationof the latent distribution is crucial for encoding and capturing the multimodality of the underlyingdistribution, hence we introduce a novel factorization of the latent space that can leverage variationsin the contextual representations within the dataset. Specifically, we factorize the latent variable zt =[zmt , z

ot ] at each timestep t to separately encode the contextual and object information, conditioned

on the given image, where zmt is encoded independently of xo. This allows our framework to utilize

contextual descriptions from captions explaining similar contexts but not necessarily the same objectsin a visual scene. We use an attention-based decoder [4] to model the posterior pφ(xt | x<t, z≤t, I).With this attention-based posterior, the latent vector zt encoding the contextual and object informationat each timestep guides the attention module of the decoder [4] to attend to regions in the imagewhen modeling the distribution of xt. The benefit of our proposed factorization is two-fold: First, wecan exploit different contextual descriptions describing similar contexts in images within the dataset

2For simplicity of notation, written for a single data point. We assume the training dataset is i.i.d.

3

Page 4: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

to improve the diversity of the generated captions. Second, this allows us to extend our model tocaptions for novel objects with zo

t guiding the attention module to attend to regions in the imagecontaining novel objects given the context zm

t . Next, we formalize our proposed context-object split(COS) factorization of the latent space in a variational framework.

3.1 The log-evidence lower bound

We maximize the log-likelihood under the conditional distribution pφ(x | I) from Eq. (1) in avariational framework [25]. The log-evidence lower bound (ELBO) consists of the data log-likelihoodterm and the KL-divergence between the posterior and a conditional prior at each timestep,

log pφ(x | I) ≥ Eqθ(z|x,I)

[∑t

log pφ(xt | x<t, z≤t, I)

]−∑t

DKL(qθ(zt | z<t, x, I) ‖ pφ(zt | z<t, x<t, I)

).

(2)

Next, we introduce our posterior distribution qθ and conditional prior distribution pφ, parameterizedby θ and φ respectively, for the latent variables zt = [zm

t , zot ] in our variational inference framework.

The context-object split posterior. The posterior qθ(z | x, I) in the latent space is factorizedinto qθm and qθo , encoding contextual description xm and object description xo at each timestep,parameterized by θm and θo respectively, with θ = {θm, θo},

qθ(z | x, I) =∏t

qθ(zt | z<t, x, I) (3a)

=∏t

qθ(zot , z

mt | zo

<t, zm<t, x, I) (3b)

=∏t

qθo(zot | zo

<t, zm≤t, x

o, I) qθm(zmt | zm

<t, xm, I). (3c)

In Eq. (3c), we assume that zmt is conditionally independent of zo

<t and xo given xm. Similarly, zot is

assumed to be conditionally independent of xm given zm≤t and zo

<t. This factorization of the posterioris chosen such that we can encode the contextual information in the scene conditionally independentlyof the object information in the scene. Specifically, the posterior qθm(zm

t | zm<t, x

m, I) at eachtimestep is conditioned on the contextual description xm, allowing to encode the contexts of the scene(cf. Tab. 1) directly in the latent space, independently of the objects described in the particular scene.The dependence of qθm on zm

<t and xm implies that the posterior encodes the likely (future) contextsfor a visual scene given the previously observed context. The posterior qθo(zo

t | zo<t, z

m≤t, x

o, I) ateach timestep encodes the likely object information in the scene. As we will see in Sec. 3.2, thisfactorization of the posterior enables us to leverage contextual descriptions for an image beyondhuman annotations (Tab. 1, 3rd column) by encoding retrieved contextual descriptions in qθm .

The context-object split prior. Equipped with the context-object split factorization of the latentvariable zt = [zm

t , zot ] and the latent variable model from Eq. (1), our COS conditional prior at each

timestep, pφ(zt | z<t, x<t, I), factorizes as

pφ(zt | z<t, x<t, I) = pφo(zot | zo

<t, zm≤t, x<t, I) pφm(zm

t | zm<t, x<t, I). (4)

Here, φ = {φm, φo} are the parameters of the conditional priors pφm and pφo , respectively. Notethat we assume conditional independence of zm

t from zo<t given zm

<t, i.e. we do not need latentobject information to specify the context prior. That is, the conditional prior pφm(zm

t | zm<t, x<t, I)

autoregressively encodes at each timestep the likely contextual information of the observed scenesbased on the words sampled at previous timesteps (and the image). Given the contextual informationzmt , the conditional prior pφo(zo

t | zo<t, z

m≤t, x<t, I) encodes the object information required to

generate the word at the particular timestep.

Under our factorization of the posterior and conditional priors from Eqs. (3) and (4), the KL-divergence term decomposes at every timestep as

DKL(qθ(zt|z<t, x, I)

∥∥ pφ(zt|z<t, x<t,I))

= DKL(qθm(zm

t |zm<t, x

m, I)∥∥ pφm(zm

t |zm<t, x<t, I)

)+DKL

(qθo(zo

t |zo<t, z

m≤t, x

o, I)∥∥ pφo(zo

t |zo<t, z

m≤t, x<t, I)

).

(5)

4

Page 5: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

x<latexit sha1_base64="hL+FaLtOT9luwfLW3Ut08xl3Pcw=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELx4hkUcCGzI79MLI7OxmZtZICF/gxYPGePWTvPk3DrAHBSvppFLVne6uIBFcG9f9dnJr6xubW/ntws7u3v5B8fCoqeNUMWywWMSqHVCNgktsGG4EthOFNAoEtoLR7cxvPaLSPJb3ZpygH9GB5CFn1Fip/tQrltyyOwdZJV5GSpCh1it+dfsxSyOUhgmqdcdzE+NPqDKcCZwWuqnGhLIRHWDHUkkj1P5kfuiUnFmlT8JY2ZKGzNXfExMaaT2OAtsZUTPUy95M/M/rpCa89idcJqlByRaLwlQQE5PZ16TPFTIjxpZQpri9lbAhVZQZm03BhuAtv7xKmpWyd1Gu1C9L1ZssjjycwCmcgwdXUIU7qEEDGCA8wyu8OQ/Oi/PufCxac042cwx/4Hz+AOeHjQA=</latexit>

Attend

p(x | I)<latexit sha1_base64="7YUsPHEB+yO/y59Twi6sP+P3+RA=">AAAB8nicbVBNSwMxEM3Wr1q/qh69BItQL2W3CnosetFbBVsL26Vks9k2NJssyaxYSn+GFw+KePXXePPfmLZ70NYHA4/3ZpiZF6aCG3Ddb6ewsrq2vlHcLG1t7+zulfcP2kZlmrIWVULpTkgME1yyFnAQrJNqRpJQsIdweD31Hx6ZNlzJexilLEhIX/KYUwJW8tPqE+4mPMK3p71yxa25M+Bl4uWkgnI0e+WvbqRoljAJVBBjfM9NIRgTDZwKNil1M8NSQoekz3xLJUmYCcazkyf4xCoRjpW2JQHP1N8TY5IYM0pC25kQGJhFbyr+5/kZxJfBmMs0AybpfFGcCQwKT//HEdeMghhZQqjm9lZMB0QTCjalkg3BW3x5mbTrNe+sVr87rzSu8jiK6Agdoyry0AVqoBvURC1EkULP6BW9OeC8OO/Ox7y14OQzh+gPnM8fxq2QRA==</latexit>

I<latexit sha1_base64="2YL8+LeSuf2tkZkxzVvgMLFabyk=">AAAB6HicbVDLSgNBEOyNrxhfUY9eBoPgKexGQY9BL3pLwDwgWcLspDcZMzu7zMwKIeQLvHhQxKuf5M2/cZLsQRMLGoqqbrq7gkRwbVz328mtrW9sbuW3Czu7e/sHxcOjpo5TxbDBYhGrdkA1Ci6xYbgR2E4U0igQ2ApGtzO/9YRK81g+mHGCfkQHkoecUWOl+n2vWHLL7hxklXgZKUGGWq/41e3HLI1QGiao1h3PTYw/ocpwJnBa6KYaE8pGdIAdSyWNUPuT+aFTcmaVPgljZUsaMld/T0xopPU4CmxnRM1QL3sz8T+vk5rw2p9wmaQGJVssClNBTExmX5M+V8iMGFtCmeL2VsKGVFFmbDYFG4K3/PIqaVbK3kW5Ur8sVW+yOPJwAqdwDh5cQRXuoAYNYIDwDK/w5jw6L86787FozTnZzDH8gfP5A6BLjNE=</latexit>

Top-down attention

LSTMA dog is sleeping on top of a couch A <s> is sleeping

on top of a <s>

dog, couch

p�m(zm|I)<latexit sha1_base64="CBF4vwjLxnGupdunhKo52ghh+vk=">AAACXXicdVHPT9swGHWysUHGoIwDBy7Wq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lCC9tABOkTHqI0o+uOteh+8j95fP/TX/U93pb4317xH/4S/eQsym7qJ</latexit>

zm<latexit sha1_base64="JfG5LNdVuxVCIBu9Cw9BNN5FsZ0=">AAACgHicdVFtT9swEHayNxb20o2P+2KtitRpXZcwpE1ISAi+bN+YtAJSm0aOe6UWdhzsy9Q25Hfwv/jGj0HCLUUwGCdZ99zz3J3tu6yQwmIUXXj+k6fPnr9YeRmsvnr95m3j3ft9q0vDocu11OYwYxakyKGLAiUcFgaYyiQcZMe7c/3gLxgrdP4HpwUkih3lYiQ4Q0eljbNwRrdobzZQbTob6CQIT9Kqj2NANnAeJljpuq5bs8FNQE/pTaDqNp20f30Kwls5rfBzXAfhxAHnCtetGItHep3e7eT63IZpoxl1ooXRhyBegiZZ2l7aOO8PNS8V5Mgls7YXRwUmFTMouIQ66JcWCsaP2RH0HMyZAptUiwHWNHTMkI60cSdHumDvVlRMWTtVmctUDMf2vjYn/6f1Shz9SCqRFyVCzq8vGpWSoqbzbdChMMBRTh1g3Aj3VsrHzDCObmeBG0J8/8sPwf56J/7WWf+90dzeWY5jhXwgH0mLxOQ72SY/yR7pEk4uvabX9r74vt/yv/rxdarvLWvWyD/mb14BfePDtQ==</latexit>

zo<latexit sha1_base64="4iq2TtblezBFn7TXdtDGTMthonA=">AAACgHicdVHbahsxENVumzbd3tzmsS+iZsElrrObFlIKgdC8tG8JxEnAXhutPLZFpNVWmg22N/sd+a+89WMClR2HOpcOiDlzZuZImklzKSxG0R/Pf/J07dnz9RfBy1ev37ytvXt/bHVhOLS5ltqcpsyCFBm0UaCE09wAU6mEk/Rsf54/OQdjhc6OcJpDotgoE0PBGTqqX7sMZ3SXdmY91aSznk6C8He/7OIYkPWchwmWuqqqxqx3G9ALehuoqkknzV+fgvBful/iZlwF4cQB53Knlo/Ff7QuVpWczopMrR61ooXRhyBegjpZ2kG/dtUdaF4oyJBLZm0njnJMSmZQcAlV0C0s5IyfsRF0HMyYApuUiwFWNHTMgA61cSdDumBXO0qmrJ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LeuIb7wex52MT3dk41b8qj8I+hUEQ1Ahwzhrus+NVsrzGBLkkmldD/wMw4IpFFxC6TRyDRnjt+wG6gYmLAYdFoNxltQzTIu2U2VOgnTAjlcULNa6F0cmM2bY0Z+1Pvk/rZ5jeycsRJLlCAl/a9TOJcWU9ndDW0IBR9kzgHElzFsp7zDFOJoNOmYIwecvfwUX69Vgo7p+vlk5PBqOY5oskWWyQgKyTQ7JCTkjNcKtWSuwdq0927W37H374C3VtoY1i+RD2Cevg9XJdA==</latexit>

xm<latexit sha1_base64="R4iFlURDV+mfcPeOXidjZijZG2I=">AAACjnicdVHbTuMwEHUCyyXssll45MWiigRaVCUs2kUgBIIXeGMlCkhtiBx3Si2cy9oT1BLyOfwQb/wNbinQ5TKS5eNzZo7tmTiXQqPvP1j2xOSXqemZWWfu67f57+6PhVOdFYpDg2cyU+cx0yBFCg0UKOE8V8CSWMJZfHUw0M+uQWmRpSfYzyFM2GUqOoIzNFTk3nk3dIc2by5aCD0sk2qNPuOsCh3vX1S2sAvILspntqpWXlPoLR2v7a0drTreqxyV+DOoHK9ngNly45Z3xSdet+NOxqf3cozcml/3h0Hfg2AEamQUx5F732pnvEggRS6Z1s3AzzEsmULBJVROq9CQM37FLqFpYMoS0GE5bGdFPcO0aSdTZqVIh+x4RckSrftJbDIThl39VhuQH2nNAjubYSnSvEBI+dNFnUJSzOhgNrQtFHCUfQMYV8K8lfIuU4yjmaBjmhC8/fJ7cLpeD37V1/9u1Pb2R+2YIUtkmayQgPwhe+SQHJMG4dacFVhb1rbt2r/tHXv3KdW2RjWL5L+wDx8BgMvJcg==</latexit>

Language LSTM

{v1, . . . , vk}<latexit sha1_base64="6eTRgk0AZ/rKZh58M6vGucCE7T8=">AAACo3icdVFdT9swFHUytrHsg7I97sWiigRaVSVs0vaChDZpYuKBMlFAakLkuLfUqvMx+6ZqMflj/Iy97d/MLQU6GFeyfHzuPefa12kphcYg+OO4T1aePnu++sJ7+er1m7XG+ttjXVSKQ5cXslCnKdMgRQ5dFCjhtFTAslTCSTr6NsufjEFpUeRHOC0hzth5LgaCM7RU0rjyL+gO7V2cRQgTNFndoje4qGPP/5WYCIeA7MzcsHW9eVdCL+mydtL6seX5d+nE4Iew9vyJBXYrrVs5FI94XS47zXwmt2cvMuMkbNGoX6Bu0XEyiuqk0QzawTzoQxAuQJMsopM0fls5rzLIkUumdS8MSowNUyi4BNuj0lAyPmLn0LMwZxno2MxnXFPfMn06KJRdOdI5u6wwLNN6mqW2MmM41PdzM/J/uV6Fgy+xEXlZIeT8utGgkhQLOvsw2hcKOMqpBYwrYe9K+ZApxtF+q2eHEN5/8kNwvN0OP7a3Dz81d78uxrFK3pMNsklC8pnskj3SIV3CHep8dw6cjuu7++5P9+i61HUWmnfkn3Djv2t00Rc=</latexit>

v<latexit sha1_base64="LYdDonMW9U1x8+xTyzziRKmKIBE=">AAACrHicdVFdb9MwFHXC1whfZXvkxaKKtImqSgbSeJk0sRd4YkjrVpRkkePerFadj9k3VTsvv45/wBv/BrfrWNngSpaPz7n32L43q6XQGAS/HPfBw0ePn2w89Z49f/HyVef15omuGsVhwCtZqWHGNEhRwgAFShjWCliRSTjNJocL/XQKSouqPMZ5DUnBzkuRC87QUmnnh39J92l0eRYjzNAUbY/e4KpNPP8iNTGOAdmZuWHbdvs2hV7R9dpZ78uO59/KqcF3Yev5MwvsVlu3eiz+43W17rTwmf05e35spmnYo/GoQt2j03QSt16cMWWmbdrpBv1gGfQ+CFegS1ZxlHZ+WhveFFAil0zrKAxqTAxTKLgE69toqBmfsHOILCxZAToxy2a31LfMiOaVsqtEumTXKwwrtJ4Xmc0sGI71XW1B/kuLGsw/JkaUdYNQ8uuL8kZSrOhicnQkFHCUcwsYV8K+lfIxU4yjna9nmxDe/fJ9cLLbD9/3d7996B58WrVjg7whb8k2CckeOSCfyREZEO7sOF+dofPd7bvHbuQm16mus6rZIn+Fm/8GFOzUnw==</latexit>

v<latexit sha1_base64="LYdDonMW9U1x8+xTyzziRKmKIBE=">AAACrH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C8OhxbXU5jhlFqTIoIUCJRznBphKJRylp79H/tEZGCt09hcHOcSKnWSiJzhDJyW13caQbtH2sKO+02FHx34jT8oI+4AsKVVVrTuHRkp06f5XvzHsRAjnWOoqKfFbWPnnk57U6kEzGIO+JeGU1MkUB0ntKupqXijIkEtmbTsMcoxLZlBwCZUfFRZyxk/ZCbQdzZgCG5fjcyvacEqX9rRxlSEdq883SqasHajUTSqGffvaG4n/89oF9jbjUmR5gZDxyUO9QlLUdJQd7QoDHOXAEcaNcH+lvM8M4+gS9l0I4euT35LDjWb4o7nx52d9e2caxzxZJWtknYTkF9kme+SAtAgnF+SS3JI775937d17D5PRGW+6s0JewHt8Aupjp00=</latexit>

zot

<latexit sha1_base64="BDNoM+dZkFksH3eHgFuCH/PSkBM=">AAACIXicbVBNa9tAEF0lbeOqX2577GWpMaRQjOQU4kvBNJfm5kD9AZYsVutxvGRXK3ZHIbbQX8klf6WXHlqCb6V/JuuPQ5v0wcDjvRlm5qW5FBaD4Le3t//o8ZOD2lP/2fMXL1/VX78ZWF0YDn2upTajlFmQIoM+CpQwyg0wlUoYphcna394CcYKnX3DRQ6xYueZmAnO0ElJvdNc0s90vJyoj3Q50bHfzJMywjkgS0pVVYfOoZESU3r6wV9OIoQrLHWVYFJvBK1gA/qQhDvSIDv0kvoqmmpeKMiQS2btOAxyjEtmUHAJlR8VFnLGL9g5jB3NmAIbl5sPK9p0ypTOtHGVId2of0+UTFm7UKnrVAzn9r63Fv/njQucdeJSZHmBkPHtolkhKWq6jotOhQGOcuEI40a4WymfM8M4ulB9F0J4/+WHZNBuhUet9tmnRvfLLo4aeUfek0MSkmPSJV9Jj/QJJ9fkO/lJfnk33g/v1lttW/e83cxb8g+8P3eqFaKp</latexit>

zot�1

<latexit sha1_base64="/L+bKbcF2rLRXKjP/H1ipUeFR3U=">AAACJXicbVBNSxxBEO3RaMz4teoxlybLgoIuMxrQg4KYS7wZyKqwMzv09Na6zXZPD9014u4wf8aLf8VLDhERPOWvpHfdQ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="1tqFgXEdaUQ3PekxnF+H52hv0BY=">AAACJXicbVDLSitBEO3x7fi4ubp00xgCihJmvMK9CwXRje4UjAqZydDTqZjG7pmhu+ZiMszPuPFX3LhQRHDlr9iJWfg6UHA4p4qqOnEmhUHPe3HGxicmp6ZnZt25+YXFX5XfS2cmzTWHBk9lqi9iZkCKBBooUMJFpoGpWMJ5fHUw8M//gzYiTU6xl0Go2GUiOoIztFJU2an16S5t9ltqk/ZbaejWsqgIsAvIokKV5Zp1aKBEmx6tu/1WgHCNVo8K3PDLqFL16t4Q9DvxR6RKRjiOKo9BO+W5ggS5ZMY0fS/DsGAaBZdQukFuIGP8il1C09KEKTBhMfyypDWrtGkn1bYSpEP140TBlDE9FdtOxbBrvnoD8SevmWPnX1iIJMsREv6+qJNLiikdREbbQgNH2bOEcS3srZR3mWYcbbCuDcH/+vJ3crZV9//Ut062q3v7ozhmyApZJWvEJ3/JHjkkx6RBOLkhd+SBPDq3zr3z5Dy/t445o5ll8gnO6xuRc6Qj</latexit>

(b) Generative model with our COS latentspace

Figure 2: Diverse image captioning with our COS-CVAE model. (a) Neural network architecturewith posteriors and conditional priors in two sequential latent spaces for encoding objects or contextsin a visual scene. (b) The generative model allowing for sequential sampling in the contextual latentspace of zm and the object-based latent space zo for generating a caption sequence.

With zt = [zmt , z

ot ] and using Eqs. (2) and (5), the final ELBO, L(x, I), with our sequential context-

object split decomposition of the latent space is given as

log pφ(x | I) ≥ Eqθ(z|x,I)

[∑t

log pφ(xt | x<t, z≤t, I)

]−∑t

DKL(qθm(zm

t | zm<t, x

m, I)∥∥ pφm(zm

t | zm<t, x<t, I)

)−∑t

DKL(qθo(zo

t | zo<t, z

m≤t, x

o, I)∥∥ pφo(zo

t | zo<t, z

m≤t, x<t, I)

)= L(x, I).

(6)

3.2 Context-based pseudo supervision

Next, we show how our COS-CVAE equipped with our context-object split latent space leveragesannotations of captions N(I), where N(I) are the “neighboring” contextual descriptions explainingsimilar contexts retrieved from the joint contextual embedding space (see Preliminaries, above).Consider an image I with paired caption x and let ym ∈ N (I) be a contextual description of sequencelength T such that ym contains contextual information at timesteps t′ and the placeholders <s> attimesteps t′′ (see Tab. 1, 3rd column). For supervised learning using the ELBO (Eq. 6), we requireobject information at timesteps t′′. Therefore, we construct a context-based pseudo-supervisionsignal y = {ym, yo} from the retrieved neighboring context. To obtain the object information yo, weleverage C(I), the set of objects in the image I corresponding to the image regions from Faster R-CNN [35], and design the following procedure to construct yo

t′′ ∈ C(I). We encode zmt directly from

ym independent of the object information, facilitated by the conditional independence assumptionsof COS, and leverage the conditional prior pφo to obtain zo

t . Note that, when training on pairedtraining data, given zt = [zm

t , zot ] our model learns to point to regions in the image relevant for

generating the caption at each timestep. We can thus identify objects yot′′ likely to occur at timesteps

t′′ through the region attended to at that timestep, given the context ym and latent variables zt. Thetarget caption then assumes the form y = {ym, yo} (cf. Tab. 1, col. 4). The data term in Eq. (6) forpseudo supervision from y and image I is then computed with∏

t

pφ(yt | y<t, z≤t, I) =∏t′

pφ(ymt′ | ym

<t′ , zo≤t′ , z

m≤t′ , I)

∏t′′

pφ(yot′′ | ym

<t′′ , zo≤t′′ , z

m≤t′′ , I). (7)

To encode the variation in contextual descriptions given the image from the pseudo-supervision signal,we additionally enforce the posterior to match the conditional prior pφm by minimizing the KL diver-gence DKL

(qθm(zm

t | zm<t, y

m, I)∥∥ pφm(zm

t | zm<t, y

m<t, I)

). Note that the posterior qθo is not utilized

for encoding the latent variable zo. Instead, zo is directly obtained from the informative conditionalprior pφo learnt on the paired training data {x, I} and, therefore, contains object information for theimage I . Thus, the ELBO, L(y, I), for the augmented data point {y, I} is

L(y, I) = Eqθm ,pφo

[log pφ(y | z, I)

]−∑t

DKL(qθm(zm

t |zm<t, y

m, I)∥∥ pφm(zm

t |zm<t, y

m<t, I)

). (8)

5

Page 6: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Taken together, our context-object split latent space can be leveraged to overcome the limited pairedannotations by augmenting with neighboring captions where different images can share contextualinformation despite showing different objects, thereby encouraging multimodality in the latent space.

Extension to novel objects. Another benefit of the proposed COS factorization is that it allows togenerate diverse captions for images with novel objects. Consider an image I containing novel objectsfor which no caption annotations are available in the dataset. We first retrieve contextual descriptionsym ∈ N(I) as above. To construct the supervision signal, we use ym and Ck(I), the top-k objectsfrom Faster R-CNN [35], including novel objects in the image I . However, the latent space ofzo learnt from the paired training data may be suboptimal (observed empirically) for attending toregions in an image with novel objects. We thus learn a weaker posterior qθo(zo

t | zo<t, z

m≤t, Ck(I), I),

conditioned on Ck(I) instead of xo otherwise available from paired training data, at each timestepduring training. With this formulation of the posterior and ym, we encode the representation [zm

t , zot ],

which guides the attention LSTM to attend to regions in the image, including regions with novelobjects, yo ∈ Ck(I), to generate the word at a certain timestep. Here, we assume that the descriptionym has been observed in the paired training data and thus zm

t can guide the attention LSTM to attendto salient regions in the image. The target caption is of the form y = {ym, yo} (Eq. 7) and thusdescribes the image I with novel objects (Ck(I)). Maximizing the ELBO in Eq. (6) with the data pair{y, I} allows to describe images with novel objects in a variational framework for diverse mappings.

3.3 Network architecture

We illustrate our complete network architecture in Fig. 2a. Given the image-caption paired traininginput, we first extract image features {v1, . . . , vk} with Faster R-CNN [35] and average the obtainedfeatures to serve as input image representation v [3, 31]. For the caption x, we first extract thesequence xm, replacing the occurences of objects within x with the placeholder <s>. We denote thelist of objects extracted from x as xo. During training, we enforce our COS latent space with twoLSTMs, modeling the posterior distributions qθo and qθm in sequential latent spaces, parameterizedby θo and θm respectively. As shown in Fig. 2a, the LSTM qθm takes as input the sequence xm andthe image features v to encode the contextual information zm. Similarly, the LSTM qθo takes as inputxo, zm, and image features v to encode the object information in zo. Analogously, the conditionalpriors pφm and pφo , parameterized by φm and φo, are modeled with LSTMs. The conditional priorpφm takes the image features v as input and the conditional prior pφo takes the image features v aswell as the encoded zm for the same caption. The priors are conditional Gaussian distributions at eachtimestep. We use the attention LSTM of Anderson et al. [4] as the decoder for modeling the posteriordistribution. The input to the standard attention LSTM is the hidden state of the language LSTMat the previous timestep, the context vector, and the ground-truth word of the caption at timestept− 1. In our model, instead of v as context vector, we input [zt, v] to the LSTM as the context at eachtimestep. Thus, the feature weights processing {v1, . . . , vk} depend on the vector [zt, v], guiding theattention LSTM to attend to certain regions in the image. The output of the attention LSTM alongwith the attended image features is input to the language LSTM to generate the word at timestep t.More details can be found in the supplemental material.

Generative model. As shown is Fig. 2b, given an image I , we first sample the latent representationzm from the prior pφm , i.e. zm

t ∼ N (µmt , σ

mt ) where µm

t , σmt are the mean and variance of the

conditional sequential prior at timestep t. With zm and I , we sample zo from the conditionalsequential prior pφo . [zm

t , zot ] is then input to the attention LSTM to generate a caption for the image.

4 Experiments

To show the advantages of our method for diverse and accurate image captioning, we performexperiments on the COCO dataset [29], consisting of 82 783 training and 40 504 validation images,each with five captions. Consistent with [6, 14, 44], we use 118 287 train, 4000 validation, and 1000test images. We additionally perform experiments on the held-out COCO dataset [17] to show thatour COS-CVAE framework can be extended to training on images with novel objects. This datasetis a subset of the COCO dataset and excludes all the image-text pairs containing at least one of theeight specific objects (in any one of the human annotations) in COCO: “bottle”, “bus”, “couch”,“microwave”, “pizza”, “racket”, “suitcase”, and “zebra”. The training set consists of 70 000 images.For this setting, COCO validation [29] is split into two equal halves for validation and test data.

6

Page 7: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Table 2: Best-1 accuracy for an oracle evaluation with different metrics on the COCO dataset.

Method #Samples B-4 (↑) B-3 (↑) B-2 (↑) B-1 (↑) C (↑) R (↑) M (↑) S (↑)Div-BS [40]

20

0.383 0.538 0.687 0.837 1.405 0.653 0.357 0.269POS [14] 0.449 0.593 0.737 0.874 1.468 0.678 0.365 0.277AG-CVAE [42] 0.471 0.573 0.698 0.834 1.259 0.638 0.309 0.244Seq-CVAE [6] 0.445 0.591 0.727 0.870 1.448 0.671 0.356 0.279

Seq-CVAE (attn) 20 0.486 0.629 0.762 0.893 1.599 0.692 0.261 0.291

COS-CVAE (paired) 20 0.492 0.634 0.764 0.895 1.604 0.700 0.382 0.291COS-CVAE 0.500 0.640 0.771 0.903 1.624 0.706 0.387 0.295

Div-BS [40]

100

0.402 0.555 0.698 0.846 1.448 0.666 0.372 0.290POS [14] 0.550 0.672 0.787 0.909 1.661 0.725 0.409 0.311AG-CVAE [42] 0.557 0.654 0.767 0.883 1.517 0.690 0.345 0.277Seq-CVAE [6] 0.575 0.691 0.803 0.922 1.695 0.733 0.410 0.320LNFMM [32] 0.597 0.695 0.802 0.920 1.705 0.729 0.402 0.316

Seq-CVAE (attn) 100 0.592 0.710 0.821 0.929 1.808 0.747 0.433 0.327

COS-CVAE (paired) 100 0.593 0.712 0.823 0.930 1.812 0.748 0.436 0.329COS-CVAE 0.633 0.739 0.842 0.942 1.893 0.770 0.450 0.339

Evaluation metrics. The accuracy of the captions is evaluated with standard metrics – Bleu (B)1–4 [34], CIDEr [C; 38], ROUGE [R; 28], METEOR [M; 13], and SPICE [S; 1]. The diversity of thegenerated samples is compared using the metrics used in competing methods following the standardprotocol [6, 14, 32, 44]: Uniqueness is the percentage of unique captions generated by sampling fromthe latent space. Novel sentences are the captions not seen in the training data. m-Bleu-4 computesBleu-4 for each diverse caption with respect to the remaining diverse captions per image. The Bleu-4obtained is averaged across all images. Lower m-Bleu indicates higher diversity. Div-n is the ratio ofdistinct n-grams per caption to the total number of words generated per set of diverse captions.

Evaluation on the COCO dataset. We evaluate our approach against state-of-the-art methods fordiverse image captioning. We include DIV-BS [40], which extends beam search and POS [14], withparts-of-speech supervision. We compare against variational methods: AG-CVAE [44], Seq-CVAE[6], and LNFMM [32]. We further include various ablations of our model to show the effectivenessof the components of our model. Seq-CVAE (attn) non-trivially extends Seq-CVAE [6], where thesampled zt at each timestep is input to the attention LSTM of Anderson et al. [1]. This baselineshows the effect of a strong decoder with the structured latent space of prior work. We further includeCOS-CVAE (paired) with only paired data for supervision (i.e. without pseudo supervision).

Table 2 shows the oracle performance, where the caption with maximum score per metric is chosenas best-1 [6, 44]. We consider 20 and 100 samples of z, consistent with prior work. The oracleevaluation scores the top sentence, but is evaluated for a limited number of sentences per image andaveraged across the test set. Thus, for a high oracle score the model needs to put high probability masson the likely captions for an image. Our complete COS-CVAE model, which leverages context-basedpseudo supervision from the neighboring contextual descriptions, outperforms the previous stateof the art by a large margin in terms of accuracy. We improve the CIDEr and Bleu score over theprevious state of the art for 100 sampled captions by ∼11.0% and ∼6.0%, respectively. The averageand worst CIDEr on the 20 samples for COS-CVAE are 0.920 and 0.354, respectively, comparedto the the average and worst CIDEr of 0.875 and 0.351 for Seq-CVAE. The high gain in accuracymetrics shows that our context-object split latent space succeeds at modeling the semantics and therelevant variations in contextual descriptions for a given image in the dataset. This leads to bettergeneralization on the test dataset. Comparing COS-CVAE and COS-CVAE (paired) further shows

Table 3: Consensus re-ranking for captioning using CIDEr on the COCO dataset.

Method B-4 (↑) B-3 (↑) B-2 (↑) B-1 (↑) C (↑) R (↑) M (↑) S (↑)Div-BS [40] 0.325 0.430 0.569 0.734 1.034 0.538 0.255 0.187POS [14] 0.316 0.425 0.569 0.739 1.045 0.532 0.255 0.188AG-CVAE [42] 0.311 0.417 0.559 0.732 1.001 0.528 0.245 0.179LNFMM [32] 0.318 0.433 0.582 0.747 1.055 0.538 0.247 0.188

COS-CVAE (paired) 0.354 0.473 0.620 0.777 1.144 0.563 0.270 0.204COS-CVAE 0.348 0.468 0.616 0.774 1.120 0.561 0.267 0.201

7

Page 8: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Table 4: Qualitative comparison of captions generated by our COS-CVAE with different methods.Image DIV-BS Seq-CVAE COS-CVAE (paired) COS-CVAE

• a cat is sitting in a suit-case

• a black and white cat sit-ting on top of a piece ofluggage

• a black and white cat issitting in a suitcase

• a cat is sitting on a suit-case on a bed

• cat sitting on a piece ofluggage

• a small cat sitting on theback of a suitcase

• a close up of a cat on topof a suitcase

• a cat sitting on top of apiece of luggage

• a cat laying on top of asuitcase

• a cat sitting on top of lug-gage on the floor

• a cat curled up on a pieceof luggage

• a close up of a very cutecat in a red suitcase

that the annotated paired data is insufficient to fully capture the multimodality of the underlyinggenerative process. Moreover, our context-based pseudo-supervision signal contributes to generatingcoherent and meaningful captions without loss of structure in the generated captions, see Tab. 4.

Table 3 shows the results on various accuracy metrics for captioning after consensus re-ranking. Inconsensus re-ranking, given a test image, the nearest neighboring image is found in the training setand the captions of the neighbors are used as reference to evaluate the accuracy metrics [33]. COS-CVAE (paired) and COS-CVAE outperform the previous state of the art on all accuracy metrics. Theaccuracy of captions with consensus re-ranking using COS-CVAE (paired) shows that our method cangenerate captions representative of the paired training data. Furthermore, the accuracy from consensusre-ranking of COS-CVAE is competitive to that of COS-CVAE (paired), showing that even whentrained with additional context-based pseudo supervision, COS-CVAE can model the distributionfrom the paired training data. However, as consensus re-ranking considers image similarities in thepaired training data, generalization to unseen images, such as the test set, is not rewarded. Therefore,the benefit of context-based pseudo supervision is not fully apparent in an evaluation using consensusre-ranking. In fact, as shown in Tab. 2, COS-CVAE offers better generalization beyond the supervisionavailable from the paired training data. In Fig. 3, we compare the best-10 sentences after consensusre-ranking against prior work and beam search on a standard captioning method [4], which has thesame base network. COS-CVAE is competitive to the computationally expensive beam search andhas better CIDEr scores compared to competiting methods, thus is diverse yet accurate.

Our COS-CVAE model expresses high diversity in the context-object split latent space, utilizingcontextual descriptions beyond that presented in the paired training data. This is reflected in them-BLEU-4, Div-1, and Div-2 scores (Tab. 5), where our model outperforms the previous state ofthe art by ∼11.6%, ∼5.4%, and ∼10.5% respectively, showing much higher n-gram diversity in thegenerated samples of captions. Furthermore, the qualitative results in Tab. 4 show that the COS-CVAEgenerates more diverse captions, e.g. containing varied contextual information “curled up on a piece”or “of a very cute” compared to competing methods.

Ablation Studies. Next, we validate the design choice of including the attention LSTM [1].Although Seq-CVAE (attn) improves the accuracy of the generated captions over Seq-CVAE, thediversity with respect to the uniqueness and the m-Bleu-4 decreases in comparison to Seq-CVAE.Our COS-CVAE (paired) with COS factorization and strong conditional priors allows to integratean attention LSTM decoder in our model, and while being of comparable accuracy to Seq-CVAE(attn), improves the diversity over Seq-CVAE and Seq-CVAE (attn). This shows that our factorized

Table 5: Diversity evaluation on at most the best-5 sentencesafter consensus re-ranking.

Method Unique (↑) Novel (↑) mBLEU (↓) Div-1 (↑) Div-2 (↑)Div-BS [40] 100 3421 0.82 0.20 0.25POS [14] 91.5 3446 0.67 0.23 0.33AG-CVAE [42] 47.4 3069 0.70 0.23 0.32Seq-CVAE [6] 84.2 4215 0.64 0.33 0.48LNFMM [32] 97.0 4741 0.60 0.37 0.51

Seq-CVAE (attn) 61.9 4323 0.69 0.34 0.50

COS-CVAE (paired) 95.9 4411 0.67 0.34 0.50COS-CVAE 96.3 4404 0.53 0.39 0.57

1 2 3 4 5 6 7 8 9 10

Kth Ranked Caption

0.6

0.8

1.0

1.2

CID

Er

Sco

re

COS-CVAE

Beam Search

Seq-CVAE

POS

AG-CVAE

Figure 3: CIDEr score of con-sensus re-ranked best-10 captionsfrom 20 samples.

8

Page 9: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

(a) Diverse captions with novel objects (red) and the attended regions with our COS-CVAE.

0 20 40 60 80 100

Number of sampled captions

55.0

57.5

60.0

62.5

65.0

67.5

70.0

F1

scor

e

F1 score

Accuracy(CIDEr)

0.8

1.0

1.2

1.4

1.6

1.8

Acc

urac

y(C

IDE

r)

(b) F1 score (%, ↑) and CIDEr with differ-ent numbers of diverse samples.

Figure 4: COS-CVAE for captioning images with novel objects.

Table 6: F1 scores (%, ↑) for evaluation on the held-out COCO dataset.

Method bottle bus couch microwave pizza racket suitcase zebra average

DCC [17] 4.6 29.8 45.9 28.1 64.6 52.2 13.2 79.9 39.8NOC [39] 14.9 69.0 43.8 37.9 66.5 65.9 28.1 88.7 51.8NBT [31] 7.1 73.7 34.4 61.9 59.9 20.2 42.3 88.5 48.5PS3 [3] – – – – – – – – 63.0LSTM-P [27] 28.7 75.5 47.1 51.5 81.9 47.1 62.6 93.0 60.9

Seq-CVAE (attn, CBS) 32.4 80.9 27.0 55.1 63.8 25.8 44.7 94.4 53.0

COS-CVAE 35.4 83.6 53.8 63.2 86.7 69.5 46.1 81.7 65.0COS-CVAE (CBS) 33.5 81.9 58.3 57.8 88.3 63.4 65.7 96.2 68.1

latent space can better represent diversity even with strong posteriors. The improved accuracy of theCOS-CVAE (paired) over Seq-CVAE implies that we can generate coherent captions with our COSlatent space. Furthermore, the context-based pseudo supervision, which can only be leveraged withthe structure of our COS factorization, where contextual variations can be modeled independently ofthe object information, accounts for increased diversity with a high boost in performance.

Evaluation on novel object captioning. Our COS-CVAE framework can be trained on imageswith novel objects (without paired training data) by exploiting contextual descriptions of captions inthe dataset. At test time, we input the image and generate captions without any explicit object-basedinformation. For reference, we include the scores from approaches for novel object captioning,which are trained to generate a single caption for a given image: DCC [17], NOC [39], NBT [31],PS3 [3], and LSTM-P [27]. We further include Seq-CVAE (attn, CBS) and COS-CVAE (CBS) withconstrained beam search using two constraints [2]. The test data statistics for held-out COCO showthat ∼57% of the images with novel objects have at least one ground-truth caption without themention of the novel object. Therefore, it would be limiting to expect every caption from a diversecaptioning approach, which learns the distribution of likely captions, to mention the novel object. Themention of the novel object in any of the sampled captions for the image counts towards a positivescore. From the F1 scores in Tab. 6, we observe that our COS-CVAE achieves competitive results witha relative improvement of ∼3.1% over methods generating a single caption for images containingnovel concepts. Furthermore, the captions containing the mentions of the novel objects are coherentand exhibit diversity as shown in Fig. 4a. The high F1-score of COS-CVAE compared to Seq-CVAE(attn, CBS) highlights the benefit of training with context-based pseudo supervision for images withnovel objects. Adding CBS constraints to COS-CVAE further improves the F1-score. We show theF1-score and the highest CIDEr for sample sizes of z in {5, . . . , 100} in Fig. 4b. Here, even whensampling 5 diverse captions, the model generates captions with mentions of novel objects with an F1score of 62.5%, which increases by 2.5% points for 50 or 100 diverse samples. The high CIDEr scoreshows that the captions not only contain mentions of novel objects but are also accurate (cf. Fig. 4b).

5 Conclusion

In this paper, we presented a novel COS-CVAE framework for diverse image captioning, consisting ofa context-object split latent space, which exploits diversity in contextual descriptions from the captionsexplaining similar contexts through pseudo supervision. This leads to increased multimodality in thelatent spaces, better representing the underlying true data distribution. Furthermore, our frameworkis the first that allows for describing images containing novel objects in a setup for diverse imagecaptioning. Our experiments show that COS-CVAE achieves substantial improvements over theprevious state of the art, generating captions that are both diverse and accurate.

9

Page 10: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

Broader Impact

One of the promising applications of image captioning is to convert visual content on the web or fromphotographs to the form of text. This content can then be made more accessible to visually impairedpeople through text-to-speech synthesis [41]. Additionally, image captioning has been found usefulin application areas such as in the medical domain, where it can provide assistance for generatingdiagnostics from X-ray images [37]. Diverse image captioning, as presented in our work, aims toresolve the ambiguities or uncertainties that occur while explaining visual scenes. Multiple captionshelp in reducing the impact of errors in explanations, since a user then has a better overview of theconcepts and contexts represented in images.

Apart from such direct, positive impact on individuals or specific application domains, social mediaplatforms utilize image captioning to mine the visual content for data summarization [24]. Whilethis helps organizations in managing online content such as latest trends and may provide value tousers of the platform, it can also compromise the users’ privacy, e.g. summarizing user behavior orpreferences for targeted advertisement. Moreover, captioning algorithms are still limited by datasetbiases and the availability of exhaustive human annotations [18]. In this paper, we attempt to addressthe latter by leveraging annotations beyond that available from the paired training data. This isinspired from the observation that within the dataset, humans label captions of images with similarcontextual information in many possible variations – by focusing on different regions of imagesor through different interpretations. Thus we can generate diverse captions representative of theunderlying data distribution. Despite this, clearly more research is necessary to reach human-levelaccuracy and diversity.

Acknowledgments and Disclosure of Funding

This work has been supported by the German Research Foundation as part of the Research TrainingGroup Adaptive Preparation of Information from Heterogeneous Sources (AIPHES) under grantNo. GRK 1994/1. Further, this work has in part received funding from the European ResearchCouncil (ERC) under the European Union’s Horizon 2020 research and innovation programme (grantagreement No. 866008). We would like to thank the reviewers for their fruitful comments.

References[1] Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. SPICE: semantic

propositional image caption evaluation. In ECCV, volume 5, pages 382–398, 2016.

[2] Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. Guided open vocabularyimage captioning with constrained beam search. In EMNLP, pages 936–945, 2017.

[3] Peter Anderson, Stephen Gould, and Mark Johnson. Partially-supervised image captioning. InNeurIPS, pages 1879–1890, 2018.

[4] Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould,and Lei Zhang. Bottom-up and top-down attention for image captioning and visual questionanswering. In CVPR, pages 6077–6086, 2018.

[5] Jyoti Aneja, Aditya Deshpande, and Alexander G. Schwing. Convolutional image captioning.In CVPR, pages 5561–5570, 2018.

[6] Jyoti Aneja, Harsh Agrawal, Dhruv Batra, and Alexander G. Schwing. Sequential latent spacesfor modeling the intention during diverse image captioning. In ICCV, pages 4260–4269, 2019.

[7] Tingjia Cao, Ke Han, Xiaomei Wang, Lin Ma, Yanwei Fu, Yu-Gang Jiang, and XiangyangXue. Feature deformation meta-networks in image captioning of novel objects. In AAAI, pages10494–10501, 2020.

[8] Fuhai Chen, Rongrong Ji, Jiayi Ji, Xiaoshuai Sun, Baochang Zhang, Xuri Ge, Yongjian Wu,Feiyue Huang, and Yan Wang. Variational structured semantic inference for diverse imagecaptioning. In NeurIPS, pages 1929–1939, 2019.

10

Page 11: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

[9] Xinlei Chen and C. Lawrence Zitnick. Mind’s eye: A recurrent visual representation for imagecaption generation. In CVPR, pages 2422–2431, 2015.

[10] Marcella Cornia, Lorenzo Baraldi, Giuseppe Serra, and Rita Cucchiara. Paying more attention tosaliency: Image captioning with saliency and context attention. ACM TOMM, 14(2):48:1–48:21,2018.

[11] Marcella Cornia, Matteo Stefanini, Lorenzo Baraldi, and Rita Cucchiara. Meshed-memorytransformer for image captioning. In CVPR, pages 10575–10584, 2020.

[12] Gabriela Csurka. A comprehensive survey on domain adaptation for visual applications.Advances in Computer Vision and Pattern Recognition, pages 1–35. 2017.

[13] Michael J. Denkowski and Alon Lavie. Meteor universal: Language specific translationevaluation for any target language. In WMT@ACL, pages 376–380, 2014.

[14] Aditya Deshpande, Jyoti Aneja, Liwei Wang, Alexander G. Schwing, and David Forsyth. Fast,diverse and accurate image captioning guided by part-of-speech. In CVPR, pages 10695–10704,2019.

[15] Jeff Donahue, Lisa Anne Hendricks, Marcus Rohrbach, Subhashini Venugopalan, SergioGuadarrama, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks forvisual recognition and description. TPAMI, 39(4):677–691, 2017.

[16] Fartash Faghri, David J. Fleet, Jamie Ryan Kiros, and Sanja Fidler. VSE++: Improvingvisual-semantic embeddings with hard negatives. In BMVC, 2018.

[17] Lisa Anne Hendricks, Subhashini Venugopalan, Marcus Rohrbach, Raymond J. Mooney, KateSaenko, and Trevor Darrell. Deep compositional captioning: Describing novel object categorieswithout paired training data. In CVPR, pages 1–10, 2016.

[18] Lisa Anne Hendricks, Kaylee Burns, Kate Saenko, Trevor Darrell, and Anna Rohrbach. Womenalso snowboard: Overcoming bias in captioning models. In ECCV, volume 3, pages 793–811,2018.

[19] Lun Huang, Wenmin Wang, Jie Chen, and Xiaoyong Wei. Attention on attention for imagecaptioning. In ICCV, pages 4633–4642, 2019.

[20] Justin Johnson, Andrej Karpathy, and Li Fei-Fei. Densecap: Fully convolutional localizationnetworks for dense captioning. In CVPR, pages 4565–4574, 2016.

[21] Ashwin Kalyan, Stefan Lee, Anitha Kannan, and Dhruv Batra. Learn from your neighbor:Learning multi-modal mappings from sparse annotations. In ICML, pages 2454–2463, 2018.

[22] Ashwin Kalyan, Peter Anderson, Stefan Lee, and Dhruv Batra. Trainable decoding of sets ofsequences for neural sequence models. In ICML, pages 3211–3221, 2019.

[23] Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating imagedescriptions. TPAMI, 39(4):664–676, 2017.

[24] Gunhee Kim, Leonid Sigal, and Eric P. Xing. Joint summarization of large-scale collections ofweb images and videos for storyline reconstruction. In CVPR, pages 4225–4232, 2014.

[25] Diederik P. Kingma and Max Welling. Auto-encoding variational Bayes. In ICLR, 2014.

[26] Girish Kulkarni, Visruth Premraj, Vicente Ordonez, Sagnik Dhar, Siming Li, Yejin Choi,Alexander C. Berg, and Tamara L. Berg. Babytalk: Understanding and generating simple imagedescriptions. TPAMI, 35(12):2891–2903, 2013.

[27] Yehao Li, Ting Yao, Yingwei Pan, Hongyang Chao, and Tao Mei. Pointing novel objects inimage captioning. In CVPR, pages 12497–12506, 2019.

[28] Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summariza-tion Branches Out. ACL, 2004.

11

Page 12: Diverse Image Captioning with Context-Object Split Latent ......a single accurate caption containing novel objects, for which no paired training data is provided. Many proposed approaches

[29] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan,Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: common objects in context. In ECCV,volume 5, pages 740–755, 2014.

[30] Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. Knowing when to look: Adaptiveattention via a visual sentinel for image captioning. In CVPR, pages 3242–3250, 2017.

[31] Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Neural baby talk. In CVPR, pages7219–7228, 2018.

[32] Shweta Mahajan, Iryna Gurevych, and Stefan Roth. Latent normalizing flows for many-to-manycross-domain mappings. In ICLR, 2020.

[33] Junhua Mao, Wei Xu, Yi Yang, Jiang Wang, and Alan L. Yuille. Deep captioning withmultimodal recurrent neural networks (m-RNN). In ICLR, 2015.

[34] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automaticevaluation of machine translation. In ACL, pages 311–318, 2002.

[35] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-timeobject detection with region proposal networks. TPAMI, 39(6):1137–1149, 2017.

[36] Rakshith Shetty, Marcus Rohrbach, Lisa Anne Hendricks, Mario Fritz, and Bernt Schiele.Speaking the same language: Matching machine to human captions by adversarial training. InICCV, pages 4155–4164, 2017.

[37] Hoo-Chang Shin, Kirk Roberts, Le Lu, Dina Demner-Fushman, Jianhua Yao, and Ronald M.Summers. Learning to read chest X-rays: Recurrent neural cascade model for automated imageannotation. In CVPR, pages 2497–2506, 2016.

[38] Ramakrishna Vedantam, C. Lawrence Zitnick, and Devi Parikh. CIDEr: Consensus-basedimage description evaluation. In CVPR, pages 4566–4575, 2015.

[39] Subhashini Venugopalan, Lisa Anne Hendricks, Marcus Rohrbach, Raymond J. Mooney, TrevorDarrell, and Kate Saenko. Captioning images with diverse objects. In CVPR, pages 1170–1178,2017.

[40] Ashwin K. Vijayakumar, Michael Cogswell, Ramprasaath R. Selvaraju, Qing Sun, Stefan Lee,David J. Crandall, and Dhruv Batra. Diverse beam search for improved description of complexscenes. In AAAI, pages 7371–7379, 2018.

[41] Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neuralimage caption generator. In CVPR, pages 3156–3164, 2015.

[42] Liwei Wang, Alexander G. Schwing, and Svetlana Lazebnik. Diverse and accurate imagedescription using a variational auto-encoder with an additive Gaussian encoding space. In NIPS,pages 5756–5766, 2017.

[43] Qingzhong Wang and Antoni B. Chan. Towards diverse and accurate image captions viareinforcing determinantal point process. arXiv:1908.04919, 2019.

[44] Zhuhao Wang, Fei Wu, Weiming Lu, Jun Xiao, Xi Li, Zitong Zhang, and Yueting Zhuang.Diverse image captioning via grouptalk. In IJCAI, pages 2957–2964, 2016.

[45] Yu Wu, Linchao Zhu, Lu Jiang, and Yi Yang. Decoupled novel object captioner. In ACM MM,pages 1029–1037, 2018.

[46] Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C. Courville, Ruslan Salakhutdinov,Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generationwith visual attention. In ICML, pages 2048–2057, 2015.

[47] Ting Yao, Yingwei Pan, Yehao Li, and Tao Mei. Incorporating copying mechanism in imagecaptioning for learning novel objects. In CVPR, pages 5263–5271, 2017.

[48] Ting Yao, Yingwei Pan, Yehao Li, and Tao Mei. Hierarchy parsing for image captioning. InICCV, pages 2621–2629, 2019.

12