Paraphrasing Is All You Need for Novel Object Captioning
Abstract
Novel object captioning (NOC) aims to describe images containing objects without observing their ground truth captions during training.
Due to the absence of caption annotation, captioning models cannot be directly optimized via sequenceto-sequence training or CIDEr optimization.
As a result, we present Paraphrasingto-Captioning (P2C) , a two-stage learning framework for NOC, which would heuristically optimize the output captions via paraphrasing.
With P2C, the captioning model first learns paraphrasing from a language model pre-trained on text-only corpus, allowing expansion of the word bank for improving linguistic fluency.
To further enforce the output caption sufficiently describing the visual content of the input image, we perform self-paraphrasing for the captioning model with fidelity and adequacy objectives introduced.
Since no ground truth captions are available for novel object images during training, our P2C leverages cross-modality (image-text) association modules to ensure the above caption characteristics can be properly preserved.
In the experiments, we not only show that our P2C achieves state-of-the-art performances on nocaps and COCO Caption datasets, we also verify the effectiveness and flexibility of our learning framework by replacing language and cross-modality association models for NOC.
Implementation details and code are available in the supplementary materials.
Introduction
Novel Object Captioning (NOC) [1] requires one to accurately describe images containing novel objects unseen during training captions.
Despite impressive benchmark performance on COCO
Captions [2] and Flickr30K [3], existing image captioning models [4, 5, 6, 7, 8] or unsupervised image captioning works [9, 10] cannot generalize well.
This is because existing unsupervised captioning models typically assume that training image and caption data share the same visual content (i.e., objects) of interest, which might not be held in practice [9, 10].
Without observing captions describing novel objects during training, a number of NOC works choose to rely on object detection results for filling in the generated slotted sentences [11, 12].
Since the object words and the template sentences are generated separately, their relationships might not be well described.
Therefore, Hu et al.
[13] propose to relate images and the produced captions by aligning the region features of an object and its associated word embedding, aiming at improved description of novel objects in scenes which are similar to the training ones.
However, if a word is not presented in the training corpus, it might not be properly presented in the predicted caption.
That is, the word embedding related to novel objects such as verbs and adjectives might not be fully exploited during inference, resulting in unsatisfactory linguistic fluency of output captions.
On the other hand, despite the visual feature of a novel object is aligned with textual feature, existing methods generally are not designed to sufficiently caption images containing such objects of interest.
In other words, the fidelity and adequacy of the output captions cannot be preserved.
In this paper, we uniquely approach the task of NOC by introducing and learning paraphrasing capabilities into state-of-the-art captioning models.
More specifically, we advance pre-trained language models to expand the word bank of a captioning model for NOC, followed by enforcing the self-paraphrasing ability of this NOC model.
The goal of the former stage is to preserve the linguistic fluency for NOC models, while that for the latter stage is deployed to exhibit improved fidelity and adequacy of the learned model.
Since no ground truth captions of novel object images are available during training, we apply cross-modality association model with objectives/critics particularly designed for NOC.
It is worth noting that, for the evaluation part of this work, we not only show that our method achieves state-of-the-art performances on the nocaps and COCO Caption datasets, we further assess the metrics reflecting the fluency, fidelity, and adequacy of output captions.
In addition, via ablation studies, we further confirm the practicality and flexibility of our learning framework, which does not limit to particular language or cross-modality association modules for paraphrasing and image-text alignment.
Related Work
Image captioning.
Recent progress of image captioning focuses on different model architectures and learning methods.
Huang et al.
[4], Wang et al.
[5], Guo et al.
[6], Cornia et al.
[7] design different attention mechanisms for image captioning.
Rennie et al.
[14], Li et al.
[15], Yang et al.
[16] adopt reinforcement learning to improve the performance.
On the other hand, some researchers consider more challenging settings, such as partially supervised [17, 18] or unpaired image captioning [9, 10].
However, these methods are restricted to the assumption that the unpaired images and captions share the same set of object class, and the number of object class is limited as well, which make them inapplicable to our task.
Novel object captioning.
Previously, novel object captioning approaches [19, 20, 21] were only tested on a restrictive dataset with only eight novel object classes held out from the COCO dataset.
Their extensions to large-scale image data with various novel objects are not sufficiently studied.
Recent studies mainly rely on object detection results to improve the performance on novel object captioning.
Lu et al.
[11], Wu et al.
[12] generate slotted caption templates, which are later filled in with visual concepts identified by object detectors.
Yao et al.
[22] exploit a copying mechanism to assemble words corresponding to object detector predictions to generate captions.
Similarly,
Constrained Beam Search (CBS)
[19] is an architecture-agnostic decoding algorithm that can be exploited during inference to enforce the inclusion of novel object classes in the captions.
Instead of explicitly using detection results, Hu et al.
[13] and Vo et al.
[23] learn the relationship between image and text by aligning object detection tags with their corresponding image region features.
Recently, Wang et al.
[24] indicate that a desirable caption should comprise properties of fluency, fidelity, and adequacy.
Nevertheless, most existing NOC approaches are not designed to handle language expression and cross-modal association with the above properties preserved.
Large-scale Vision and Language Pre-training (VLP).
Recently, researchers discover that scaling up the sizes of both captioning model and training dataset would be effective to improve the performance on vision and language tasks.
Dual-encoder frameworks such as CLIP [25] and ALIGN [26] scale-up contrastive pre-training [27] using 400M and 1.8B image-text pairs for cross-modal alignment.
On the other hand, Transformer-based models like [28, 29] not only scale up the training corpus to 5.65M image and caption pairs, but also increase the transformer layers from 12 to 24.
More recently, SimVLM [30] and LEMON [31] further explore the huge version of Transformer with a total of 32 layers, and scale up the pre-training corpus with 1.8B and 200M image-text pairs, respectively.
Despite the dataset scale as an important factor in image captioning, we will demonstrate that our model still performs favorably against current large-scale methods under the same model size (i.e., Transformer base version, 12 layers) and with a smaller training caption corpus.
[Figure]
Method
We first determine the notations and settings for the sake of completeness.
Given a small set of images
X l with the corresponding captions Y l , as well as a large set of uncaptioned images X u containing novel objects, our goal is to generate the captions ˆ Y u for X u via a captioning model C
θ ( θ describes the parameters for the captioning model C ).
To achieve this, we propose Paraphrasing-to-Captioning (P2C) , which allows C to perform paraphrasing to preserve linguistic fluency, and to self-paraphrase for boosting the associated fidelity and adequacy.
The former is regularized by a pre-trained language model P , while an image-text cross-modality model A is utilized for guiding the unsupervised learning process.
We note that the contribution of our proposed P2C lies in how to leverage the paraphrasing mechanism, together with the linguistic and visual information from pre-trained models
P and A , for performing NOC with sufficient caption fluency, fidelity and adequacy.
3.1 Describing Novel Objects with Linguistic Fluency
By observing image-caption pairs ( x l , y l ) , the captioning model C θ in Fig.
1 would learn the visual grounding (i.e., localization of known objects and referring their expressions) as well the linguistics information.
The training objective of such labelled data is a conventional sequence-to-sequence loss
L s 2 s , calculated on ground-truth caption y l .
That is, we have L s 2 s =
CrossEntropy (ˆ y l , y l ) .
However, using the image-caption pairs ( x l , y l ) alone is not sufficient to produce fluent captions for uncaptioned images X u .
We observe that some commonly-used wording of the associated novel objects, are not presented in the training corpus.
Therefore, we leverage a language model P , to learn its linguistic knowledge via paraphrasing .
That is, for uncaptioned images X u containing novel objects, we first generate a caption describing X u .
Then, we leverage pre-trained language models as the paraphrase model P , which replace the generated captions with the most probable wording of a given novel object context.
A semantic-preserving gate g is deployed to validate the paraphrased caption.
As detailed later, this gate g is realized by a cross-modal association model
A , which assesses the relationship between the paraphrased caption and the input image, ensuring semantics of the caption is not modified by P .
Learning to paraphrase via language model P .
We now present the detailed paraphrasing processing for learning C θ .
As illustrated in Fig.
1, given an uncaptioned image x u , the captioning model
C θ generates a caption ˆ y cu
=
C θ ( x u ) , ˆ y cu = { w c 1 , w c 2 , ..., w cT } , where w ci denotes the i th word, and
T is the caption length.
The superscript c represents it is generated by our captioning model.
We then obtain a masked caption ˆ y Mu
= { w c 1 , w c 2 , ..., w Mm , ..., w cT } with m indicating the mask index, by randomly masking out the words in the caption.
We note that, we do not mask nouns/objects in the above process, since they are related to objects grounded in the (novel) visual content and thus are not explicitly associated with caption fluency.
As a result, P takes the masked sequence ˆ y Mu as input and predicts the masked word w pm with the highest probability conditioned on the context of the entire sentence, producing the paraphrased caption
ˆ y pu
=
P
(ˆ y M u ) ,
ˆ y pu
= { w c 1 , w c 2 , ..., w p m , ..., w cT } .
Semantic-preserving gate g .
In the above paraphrasing process, however, not every word substitution from P is guaranteed to be semantically correct.
We thus require a proper image-text model (i.e., association model)
A to validate the paraphrasing output.
That is, if the paraphrased caption comprises a more accurate and associated word that human generally uses to describe the scene, then a higher
[Figure]
score would be obtained (than that of the original caption).
Thus, we propose the objective function
L P to calculate the loss for the replaced words, gated by the comparison of the association scores of the corresponding captions.
More precisely, L P is derived as:
[Equation]
where g is the gating function preventing C θ from learning from low-quality paraphrased captions, t is the one-hot representation of the paraphrased word, and s is the word distribution predicted by the captioning model at the masked timestep m , i.e., we have w cm
= arg max( s ) .
We have A ( x, y ) in g to calculate the association between an image x and its caption y , indicating how well the captions match the images, and α serves as the margin of the association scores for distinguishing between the two captions.
3.2 Improving Caption Fidelity and Adequacy via Self-Paraphrasing
Recall that, as discussed in Sec. 1, caption fidelity verifies whether the details of visual content are presented in the generated caption, while adequacy assesses whether the visual content is properly described been expressed in it.
While the previous paraphrasing stage increases the linguistic fluency for captions describing images containing novel objects, the novel object word itself still can be incorrectly predicted or missing in the output captions.
This is because that, the caption corpus
Y l does not contain any novel objects, and thus the novel object words have low probability to be captioned.
To tackle the above issues, one possible solution is to self-paraphrasing for C θ with captioning evaluation metric as a critic to reward the paraphrased captions.
For labeled images X l , we can exploit the CIDEr score [14], encouraging the generated caption to be consistent with that of the human annotated ones in the word level.
However, while CIDEr can be easily computed for captioning labeled images X l , it cannot be explicitly calculated for captioning uncaptioned images X u due to the absence of ground-truth captions.
To address this problem, we discover that cross-modal association is an ideal measurement to reflect the fidelity and adequacy for output captions (see remarks in Appendix A).
Specifically, we utilize an association model A to compute the association score between images and the generated captions, which serves as a label-free critic in our learning framework.
Then, when a paraphrased caption is rewarded by a higher association score, our P2C would increase the probability of using that word in the sentence to describe the image.
This learning strategy allows producing captions that precisely describe the objects with plentiful visual details.
Rewarding the generated captions.
As a potential challenge in NOC, we observe that captioning models would achieve improved association by simply repeating the same object that occurs in the image, which undermines the linguistic fluency of the captions.
For example, the image caption “a group of cans of soda and other items on a table" can be replaced by “a pile of cans and bottles of soda on a counter with cans of cans " with a higher association score.
To tackle this problem, we choose to impose a repetition penalty to avoid such trivial solutions.
For image-caption pairs ( x l , y l ) , we directly calculate the CIDEr reward for the predicted caption ˆ y l (i.e., r CIDEr = CIDEr (ˆ y l , y l ) ).
To enforce the generated captions for ( X, Y )
=
( X l , Y l ) ∪ ( X u , Y u ) with sufficient fidelity and adequacy, we exploit A to compute the association reward between X and ˆ
Y (i.e., r A =
A ( x, ˆ y ) ).
As for the repetition penalty to preserve linguistic fluency of the generated captions ˆ y u
= { w 1 , w 2 , ..., w T } for x u , we formulate it as a linear assignment problem, where every word is assigned to the most similar one in the same sentence except for itself.
Then, we calculate the similarity between such pairs for each sentence.
Intuitively, repetitive captions would have high similarity scores (with repeating words assigned to the exact same word)s.
Thus, we define the assignment ˆ α as the one that maximizes the average pairwise similarity of a sentence, i.e.,
[Equation]
where α ( i ) is the index of the word assigned to the i -th word in the caption, and C ( w i , w j ) is the cosine similarity between the GloVe [32] word representation of two words.
Since a desirable captioning model would encourage captions with low repetition (i.e., low average pairwise similarity), the reward for repetition penalty is defined as follows:
[Equation]
Note that we do not calculate repetition penalty for the labeled data ˆ Y l since they are regularized by the aforementioned CIDEr rewards.
With the above discussions, the total reward for caption-labeled data would be r (ˆ y l ) =
r CIDEr (ˆ y l , y l )+ r A ( x l , ˆ y l ) , and the total reward for uncaptioned data would be r (ˆ y u ) =
r A ( x u , ˆ y u ) + r rep (ˆ y u ) .
Back-propagation via reinforce algorithm.
Unfortunately, computation of the aforementioned rewards is non-differentiable.
Thus, we adopt reinforce algorithm
[33] to optimize our P2C learning.
As shown in Fig.
2, for an image x we use greedy decoding to obtain the baseline result ˆ y g , and the paraphrased captions ˆ y s are derived from randomly sampling from the word distribution.
If the sampled captions possess higher linguistic fluency or cross-modal association than the baseline caption, they will be encouraged by positive rewards and vice versa.
We follow Rennie et al.
[14], Liu et al.
[34, 17] and define the objective function as follows:
[Equation]
where d indicates the source of the image, θ being the parameters of captioning model, and p θ (ˆ y s ) represents the predicted word logits for the generated captions.
With the objective functions defined in equations (1), and (4), the NOC model C θ can be trained accordingly.
Experiments
Implementation details.
Following Hu et al.
[13], Li et al.
[28], Zhang et al.
[29], we consider a BERT-base [35] architecture for our captioning model C θ .
To demonstrate the flexibility of our learning framework, we apply two different versions of BERT, base and large , which are pretrained on large-scale text -only corpus to model human language as our paraphrase model P .
For the association model A , we have three different cross-modal association models, VIFIDEL [36],
SR-PL [17], and CLIP [25] with its version being ViT/B-32.
VIFIDEL associates image-caption data using word embedding of particular object labels, and SR-PL utilizes the triplet loss to learn the association of image captions, while CLIP is optimized via the contrastive pre-training.
For our model reported in the following subsections, we use BERT large for P , and CLIP for A .
Due to page limits, hyperparameters and other training details can be found in Appendix B.
Datasets.
The training data for the nocaps benchmark comprises the Open Images V4 [37] object detection training set (1.7M images annotated with bounding boxes for 600 object classes), plus the image-caption pairs from the COCO Captions 2017 [2] training set (0.5M image-caption pairs containing 80 object classes).
No additional image-caption pairs are provided for training.
We evaluate our model on the validation and test set of nocaps, which comprises 4500 and 10600 images from the Open Images validation and test sets, respectively.
To compare with current large-scale methods and investigate our model performance when scaling up the training dataset, we jointly trained our model on the Conceptual Caption dataset [38] and compare our method to other methods that access additional image-text pairs during their training on the nocaps-XD [1] benchmark (XD
[Table]
stands for extra data).
In addition, to demonstrate that our method also enhances model performance on the general image captioning, we evaluate our P2C on the COCO Captions dataset.
Due to page limits, the comparison on COCO Captions can be found in Appendix C.2.
4.1 Evaluation metrics
CIDEr.
Like the evaluation metrics [39, 40, 41] in NLP, Consensus-based Image Description
Evaluation (CIDEr) calculates the similarity between the reference and generated caption by n-gram overlap in a rule-based manner.
To capture human consensus in image captioning, it introduces the tf-idf weight to reduce the matching weight of the n-grams that are common in all image captions.
SPICE.
Semantic Propositional Image Caption Evaluation (SPICE) [42] matches the semantics between sentences, such as objects, relations, and attributes of objects.
Specifically, it converts sentences into semantic scene graphs, which allows evaluation to break grammatical constraints and focuses on propositional semantic content.
It reflects the accuracy of the visual content and considers less about linguistic properties.
Fluency.
To quantitatively evaluate fluency, we remove the effect of the visual information and focus on the quality of linguistic properties in the conventional caption evaluation metrics.
Specifically, we we disregard the n-grams containing the particular object word of interest during the computation
BLEU@4 [39] and CIDEr scores.
Take the sequence “a b c d” for example, when ‘b’ is the object word, only the unigram “a, c, d” and the bigram “cd” would be taken into account, n-grams such as “ab” or “abc” would be excluded from computation.
Note that the fluency experiment is conducted on a subset of the nocaps validation set, which contains 1000 images whose caption annotations are available on the official website of the nocaps dataset.
Fidelity & Adequacy.
Fidelity and adequacy evaluate how well the captions are associated with images.
As defined in Sec. 1, fidelity evaluates whether the objects described by the caption are actually presented in the images, while adequacy assesses how many objects in the images are described by the captions.
These two properties are analogous to the definition of precision and recall, respectively.
Therefore, we extract the objects mentioned in the captions and the ground-truth objects in the images and calculate the precision (for fidelity), recall (for adequacy), and F1 (for overall association) scores.
The experiment is performed on the validation set of nocaps.
Following Agrawal et al.
[1], we split the dataset into three subsets for evaluation: in-domain images only contain the seen objects that have been described during training, out-of-domain images are the unseen/uncaptioned (i.e., novel) ones, while near-domain ones contain both seen and unseen objects.
4.2 Quantitative analysis
For performance comparisons, we choose UpDown [1] as baselines, as well as Oscar [28] and
VinVL [29] which achieves SOTA results on the benchmark of nocaps.
All methods are trained via the SCST optimization [14] except for the UpDown baseline, and Constrained Beam Search (CBS) is exploited during inference.
In addition, VIVO [13] is a pre-training technique for captioning models, allowing them to recognize the novel objects.
Since VinVL did not report the numbers with CBS exploited during inference (CBS is known to improve model performance on out-of-domain data), we reproduce VinVL following details stated in the original paper.
For more details please refer to Appendix B. For a comprehensive comparison, we conduct experiments on the validation and test set of nocaps.
In addition, we compare our method with VinVL and VIVO in fluency, fidelity,
[Table] [Table]
and adequacy to demonstrate the improvement in terms of these properties.
We also evaluate on the
COCO Caption dataset and report in Appendix C.2.
The nocaps datasets.
The results on nocaps are shown in Table 1.
From this table, we see that our model performed favorably against baselines and SOTAs across different metrics.
We see that our method substantially improves the CIDEr scores in every domain, which verifies our design to generate more fluent and natural captions.
Also, it is worth noting that our model largely increased the performance in SPICE score for every data domain, which verifies that our method is able to generate captions with the improved image-language association.
The nocaps-XD datasets.
To compare with large-scale pre-training methods and investigate our model performance when scaling up training dataset, we evaluate our method on the nocaps-XD benchmark and show the results in Table 2.
Note that both VinVL, SimVLM, LEMON, and our method adopt BERT-based backbones for captioning.
From the above table, we see that our method still performs favorably against SOTAs on the benchmark even if we have the fewest training caption samples (3M).
Our model performance is only slightly below LEMON on the CIDEr score on validation set when it uses a larger training corpus (ALT200M), while we surpass LEMON by a significant margin when the same training corpus (CC3M) is used.
Thus, the effectiveness of our method when we scale up the training data can be verified.
For more detailed discussion and the ablation study on this model, please refer to Appendix C.3.
Fluency, fidelity, and adequacy.
As described in Sec.
4.1, we design additional experiments for evaluating fluency, fidelity, and adequacy and report the results in Table 3.
For fluency, we remove all the objects and nouns in the captions since they relate less to the linguistics of the captions.
We then calculate the BLEU@4 (B@4) and CIDEr (C) scores for the captions after removal.
For fidelity and adequacy, they indicate that captions should accurately (high precision) describe sufficient (high recall) visual details.
Therefore, we report the object precision and recall in this table, and object F scores represent the overall association between captions and images.
One can see that our method surpasses previous methods by a visible margin on all tasks except for in-domain object precision, which further verifies our model improves novel object captioning on fluency, fidelity, and adequacy.
4.3 Ablation studies
Following the same evaluation procedures in Sec.
4.1, we discuss the contributions of the uses of paraphrasing model P and association model A in terms of linguistic and semantic level metrics, and present their results in Table 4 and 5.
In addition, to verify the flexibility of our proposed P2C, we replace P and A with different implementations of language models and association models.
Then, we evaluate their performance on the nocaps validation set and report the results in Table 6.
Detailed ablation analysis of every objective can be further found in Appendix C.1.
[Table] [Table]
Paraphrase model P .
As shown in Table 4, the captioning model without P would observe a performance drop in CIDEr for linguistic fluency, but such drops for the metric of SPICE (related to visual content) would be less significant.
Similarly, as observed in Table 5, removing P would result in the lowest BLEU and CIDEr scores.
These results confirm our motivation and model design, since P is utilized to improve caption quality at the linguistics level.
To further verify the use and flexibility of paraphrase model P , we replace our paraphrase model
P (the large version of BERT) with the base version of BERT.
We found out that only a slight performance drop is produced.
We conjecture that this is because the two versions of BERT are trained on the same text corpus, which means they share the same word bank.
As a result, our model would distill similar linguistic knowledge when using either model to guide the training of our P2C.
Semantic-preserving gate g .
From Table 4, we see that captioning model would be misled by the wrong guidance produced by P , if no validation from g to ensure that the semantics of the original captions is not modified by P .
This results in a significant performance drop on nocaps.
Association model A .
As shown in Table 4, the model without the reward calculated by A showed significant drops in captioning metrics of CIDEr and SPICE.
However, the performance decrease in
SPICE is expected, since A is particularly deployed for preserving visual content in captions.
As for CIDEr, its decrease is mainly due to the deterioration of missing visual content in captions.
This is also confirmed by Table 5, in which mainly the metrics reflecting fidelity and adequacy would observe significant drops for model trained without the association rewards.
To further verify the use and flexibility of the association model A , we replace it with different models that also produce association scores between images and captions.
Specifically, we consider
VIFIDEL [36], SR-PL [17], and CLIP [25].
As the results shown in Table 6, one can see that the use of CLIP as A would achieve the best performance.
This is because that, VIFIDEL only associates image-caption data using word embedding of particular object labels, while CLIP assesses such cross-modal data in the instance level, i.e., taking the complete caption of an image into consideration.
As for SR-PL, it utilizes the triplet loss to learn the association of images and captions, while CLIP is optimized via the contrastive pre-training, which fully exploits the negative samples in a mini-batch to learn a more compact representation space, allowing it to estimate the association more accurately.
Repetition penalty.
Recall that, in Sec. 3.2, this penalty is to alleviate the association between images and captions with redundant visual information.
As seen in Table 4, the model without this penalty observed a significant performance drop in CIDEr scores.
We did not see such trends for SPICE.
This is because that, repetitive words in captions mainly violate linguistic structures rather then semantic accuracy, and thus the performance related to linguistic fluency would be more sensitive to the deployment of this penalty.
[Table]
4.4 Qualitative analysis
For qualitative comparisons
[Table]
we first conduct human study and ask individuals to evaluate a caption from three perspectives: fluency, fidelity, and adequacy.
Due to page limit, the experiment details and the corresponding results are presented in Appendix C.4.
For qualitative analysis, we empirically show captions in Fig.
3, which are generated by our model and VinVL, with both pre-trained from
VIVO for novel object detection.
In this figure, wordings that are less accurate or incorrectly describe the associated visual content are marked in bold.
And, our wording improvements are highlighted in red.
From this figure, one can see that for fluency, our model generated vivid captions with more proper wordings.
Take the image on the left for example, our model particularly described “posing for a picture” instead of “standing on a field” .
As for fidelity, our model is designed to accurately capture the visual content in an image.
Specifically, take the second image for example, we correctly described the number of gloves and the novel object red scarf , while VinVL failed to do so.
As for adequacy, take the bottom-right image for example, our model was able to recover visual details in the image (i.e., “people playing the accordion” and “sitting in a church” ).
For more qualitative examples, please refer to Appendix C.5.
Conclusion
In this paper, we proposed Paraphrasing-to-Captioning (P2C) for novel object captioning, with particular goals of improving caption fluency, fidelity, and adequacy.
In P2C, we advocate the learning of two paraphrasing capabilities for captioning models.
The first is language-level paraphrasing, which expands the word bank of a captioning model under the guidance of pre-trained language model, and thus preserves the linguistic fluency during NOC.
Secondly, we introduce the self-paraphrasing ability for the captioning model to sufficiently describe visual content of the input image, so that both caption fidelity and adequacy can be achieved.
Due to the lack of ground truth captions, image-text association is uniquely exploited for guiding the training process.
Empirically, we not only showed that our model achieved SOTA results on benchmark datasets, we also assessed the metrics associated with fluency, fidelity, and adequacy, confirming the effectiveness of our model.
Via our ablation studies, we further verified the flexibility of our learning framework by replacing language and cross-modality association modules for paraphrasing and image-text alignment.
Finally, since we apply pre-trained language and association models in P2C, their joint optimization would be among our future research directions.
Acknowledgement This work is supported in part by the Ministry of Science and Technology of
Taiwan under grant NSTC 110-2634-F-002-052.
Y.-H.H.T., R.S., and L.-P.M. was supported in part by the NSF IIS1763562, NSF Awards #1750439 #1722822, National Institutes of Health, IARPA
D17PC00340, ONR Grant N and Facebook PhD Fellowship.
We also thank to
National Center for High-performance Computing (NCHC) for providing computational and storage resources.
A Remarks on fluency, fidelity, and adequacy
We first discuss how fluency, fidelity, and adequacy can be fundamentally and technically related to language model and association model.
For caption fluency, one would expect that the image caption to be linguistically natural and fluent.
That is, the NOC model not only requires to capture the occurrence of novel-object vocabularies, the associated collocations such as verbs or modifiers are expected to be properly utilized.
Thus, given the context containing novel-object vocabularies as ˜y and the associated wordings as ˆw , we define fluency as the probability of the NOC model which correctly predicts the collocation given the novel image context p (ˆw | ˜y) ( N as the number of collocations).
In natural language processing, masked language models are widely applied to predict the masked word ˆw given the context ˜y .
Thus, the objective of a masked language model would be maximizing the log-likelihood of the masked word log( p (ˆw | ˜y)) given the context ˜y , which is equivalent to our definition of fluency with the log function explicitly calculated.
Therefore, this is the reason why we adopt language model to learn the co-occurrence of novel-object vocabularies and their associated collocations to improve the linguistic fluency.
We now relate fidelity and adequacy in image captions to cross-modal association.
We start by defining the probability of an object appearing in the images as p ( x ) , and the probability of an object mentioned by the captions as p ( y ) .
Relevant objects p ( x, y ) are defined as objects that are both included in the image and described by the associated caption.
Since fidelity assesses whether the visual content presented in the produced caption is correct, it can be defined as the fraction of relevant objects among objects in captions p ( x,y ) p ( y )
=
p ( x | y ) .
On the other hand, adequacy evaluates whether sufficient visual details have been expressed by captions, and it can be defined as the fraction of relevant objects among objects in an image p ( x,y ) p ( x )
= p ( y | x ) .
Thus, we can calculate the point-wise mutual information pmi of an image x and its caption y as follows:
[Equation]
with mutual information as the expected value of point-wise mutual information.
For the task of
NOC, both p ( x ) and p ( y ) are fixed (i.e., determined by the dataset).
Therefore, the above derivation implies that when the mutual information between an image and its captions increases, the resulting fidelity and adequacy would be jointly improved.
So that’s why we require CLIP to compute the association between images and captions.
Since it is trained via the InfoNCE objective, which is a lower bound estimation of mutual information [27].
ˆ g l ←
← r r A
ˆ
A rep θ
Update parameters: θ ←
[Table]
( θ, η it , ∇ θ L RL ) 10 end
[Table]
B Implementation details
Following Hu et al.
[13], Li et al.
[28], Zhang et al.
[29], we consider a BERT-base [35] architecture for our captioning model.
Given an image, the captioning model jointly takes the image region features and the predicted detection tags to generate the associated caption.
We use the same region features as VinVL [29], which are released on their project page.
Since the object detection model
Omni-detection used in previous works [13, 29] is not available, we replace it with a publicly available model of TSD [44] to generate the object detection tag.
Reproducing our method.
We perform VIVO [13] pre-training for 100 epochs with a batch size of 1024 and a learning rate of 5 × 10 − 5 , which are exactly the same as the parameters stated in the
VIVO paper.
After that, we propose to train our model following the training process described in
Algorithm 1 to learn to caption novel objects with linguistic fluency.
We train our model forepochs with an effective batch size of 512 (256 caption-labeled images and 256 uncaptioned images) and a learning rate of 1 . 5 × 10 − 5 .
Then, to learn novel object captions with fidelity and adequacy, we train our model as decsribed in Algorithm 2.
Specifically, we train our model for 4 epochs with an effective batch size of 128 (64 caption-labeled images and 64 uncaptioned images) and a learning rate of 2 .
5 × 10 − 6 .
We use 8 V100 GPUs to perform the above training algorithms.
Codes can be found in the supplementary materials.
Reproducing baseline methods.
For VinVL [29], we leverage the released model on their project page and directly inference on the nocaps dataset.
However, for VinVL+VIVO [29], since the pre-trained model is not publicily available, we reproduce this method using the image region features and object detection tags generated by models mentioned in the beginning of this section to train this model.
Specifically, the model is trained for 160K iterations (about 100 epochs) with a batch size of 1024 and a learning rate of 5 × 10 − 5 , and fine-tuned for 30 epochs with a batch size of 256 and a learning rate of 5 × 10 − 5 using the cross-entropy loss.
Last, we perform the SCST optimization [14] with a learning rate of 2 × 10 − 6 for 5 epochs to obtain the final model.
The numbers reported in
Table 7 are derived using this version of model.
[Table]
[Table]
C Additional experiments C.1 Detailed ablation analysis
Table 7 lists the performances and compares contributions of the imposed objectives in our P2C.
The baseline model in Table 7 is only trained on the COCO Caption dataset using the sequence-tosequence objective.
To confirm our introduction of exploiting BERT to learn the associated wordings of novel images, we apply L P to the baseline model, and report the results in the second row of
Table 7.
The CIDEr scores improve significantly after adopting reinforce algorithm [33] and using
CIDEr scores of the generated captions as reward, and the results are in the third row.
One can see that the SPICE scores largely increase but the CIDEr scores slightly decrease after the deployment of the association model A .
We hypothesize that the captioning model properly captures the visual content in images, but it describes the scene with poor linguistic fluency.
As the discussion in Sec. 3.2, we attribute the performance drop to the degenerate solution of increasing the association between the captions and the corresponding images.
Note that we further consider the repetition penalty to regularize the captioning model.
The results are shown in the last row of Table 7.
One can see that this regularization slightly improves the SPICE scores but significantly increase the CIDEr scores.
By comparing the performances listed in Table 7, we see that the full version of our P2C achieved the best performance in terms of CIDEr and SPICE.
Thus, the design of our P2C can be successfully verified.
C.2 Experiments on the COCO Caption dataset
To validate that our method generalize well on the task of describing the seen objects, we conduct experiments on the COCO Caption test set and report the numbers in Table 8.
The training data for
VinVL [29] is image caption pairs from the COCO [45] dataset.
While for VinVL + VIVO and our method, we additionally leverage the uncaptioned image from the Open Images [37] dataset as extra data.
One can see that our method outperforms the other competitive approaches on different metrics which verifies the effectiveness of our approach.
C.3 Experiments on the nocaps (XD) benchmark
Recall that in Sec.
4.2, we quantitatively show that our method surpasses current state-of-the-art large-scale methods even if we use a smaller training corpus.
In the subsection, we would like to investigate whether the improvement from our module design is still significant when we scale up training data.
To quantitatively show that the performance gain in Table 2 is not simply contributed by the additional data we considered, we ablate our model on the nocaps validation set and show the results in Table 9.
We observed a similar performance trend as we reported in Table 7, where L P slightly improves
[Table]
the CIDEr scores, and r A significantly boost SPICE but slightly deteriorates the CIDEr scores.
One can see that the regularization r rep slightly improves the SPICE scores but significantly increase the
CIDEr.
By comparing the performances listed in Table 7 and Table 9, we see that our design of using a paraphrase model P to enhance fluency (in terms of CIDEr) and the uses of the association model A to encourage captions with sufficient fidelity and adequacy (in terms of SPICE) still function properly when more diverse image-caption pairs are considered, verifying the design of our P2C.
C.4 Human study
To conduct human study, we randomly picked 60 images from the nocaps validation set, and compared the captions generated by our method to those generated by the SOTA of VinVL+VIVO [29], and the human-annotated captions provided by the nocaps dataset.
Following the evaluation protocols used in the COCO Captioning Challenge 2015 [45], we designed 4 different metrics and asked individuals to evaluate captions from these aspects.
The following are the four metrics we used in the experiment:
M1:
Is the caption generated by human (0: machine, 1: human)?
(Percentage of captions that pass the Turing Test.) M2: Rate the correctness of the captions on a scale 1-5 (incorrect-correct): Whether the described objects or activities are correct.
M3:
Rate the amount of detail of the captions on a scale 1-5 (lack of details - very detailed): Whether the caption has detailed all the objects and their attributes.
M4:
Rate the fluency of the captions on a scale 1-5 (lack of fluency-very fluent): Whether the caption use phrases/words that human generally would use to describe the scene, i.e.
, the caption is linguistically natural and fluent.
Specifically, M2, M3, M4 correspond to the fidelity, adequacy, and fluency, respectively, which are the particular objectives desired to be achieved.
We asked 24 people two answer 6 different questionnaires, and each questionnaire contains 10 captions from each method (i.e., ours, sota, and human caption presented in a random order).
We report the results in Table 10.
We see that our method surpassed the SOTA by clear margins, while our performances were comparable to those the human ones across different metrics.
This further supports the design of our model for NOC with sufficient fluency, fidelity, and adequacy.
C.5 More qualitative results
Qualitative comparison on fluency, fidelity and adequacy.
In this part, we provide more qualitative results on the nocaps validation/test set, and the results are shown in Fig.
4 and 5.
Note that wordings that are less accurate or incorrectly describe the associated visual content are marked in bold.
And, our wording improvements are highlighted in red.
Take results in the bottom row of Fig.
4 for example.
For the column of fluency, our model particularly described the turtle being “crawling on some rocks" instead of “sitting on the top of a beach" .
For fidelity, our model predicted the background preferably as “race track” instead of “street" from the prediction of VinVL model.
As for the column of adequacy, though both captions described a young men running, our model successfully captures more details in the image (i.e., “there are number on their shirts" ).
For more qualitative results, please refer to Fig.
Qualitative results of some failure cases.
In this part, we demonstrate some failure cases of our
P2C model.
We empirically observe that the failure cases mainly come from the wrong/missing detection tags predicted by the pre-trained object detectors.
To be more specific, the captioning model largely relies on the detection tags as clues to correctly describe novel objects.
Take the result in the left-side of Fig.
6 for example, the detection model falsely recognizes the raccoon as a squirrel, and this detection result consequently damages the caption prediction.
Therefore, how to jointly improve
[Table]
[Figure]
[Table]
the detection model and captioning model is still a open question, and we leave this problem for future research.
For more failure cases, please refer to Fig.
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure] [Figure]