SlowGuess/ACL_2020_OCR huggingface dataset:
Malihe Alikhani
malihe. alikhani@rutgers.edu
Piyush Sharma
piyushsharma@google.com
Shengjie Li
s11560@rutgers.edu
Radu Soricut
rsoricut@google.com
Matthew Stone
mdstone@rutgers.edu
We use coherence relations inspired by computational models of discourse to study the information needs and goals of image captioning. Using an annotation protocol specifically devised for capturing image-caption coherence relations, we annotate 10,000 instances from publicly-available image-caption pairs. We introduce a new task for learning inferences in imagery and text, coherence relation prediction, and show that these coherence annotations can be exploited to learn relation classifiers as an intermediary step, and also train coherence-aware, controllable image captioning models. The results show a dramatic improvement in the consistency and quality of the generated captions with respect to information needs specified via coherence relations.
The task of image captioning is seemingly straightforward to define: use natural language to generate a description that captures the salient content of an image. Initial datasets, such as MSCOCO (Lin et al., 2014) and Flickr (Young et al., 2014), approached this task directly, by asking crowd workers to describe images in text. Unfortunately, such dedicated annotation efforts cannot yield enough data for training robust generation models; the resulting generated captions are plagued by content hallucinations (Rohrbach et al., 2018; Sharma et al., 2018) that effectively preclude them for being used in real-world applications.
In introducing the Conceptual Captions dataset, Sharma et al. (2018) show that this dataset is large enough, at 3.3M examples, to significantly alleviate content hallucination. However, because the technique for creating such a large-scale resource relies on harvesting existing data from the web, it no longer guarantees consistent image-text relations. For example, along with descriptive captions
Figure 1: Output of a coherence-aware model for various coherence relations. Content that establishes the intended relation is underlined. (Photo credit: Blue Destiny / Alamy Stock Photo)
Visible: horse and rider jumping a fence.
Meta: horse and rider jumping a fence during a race.
Subjective: the most beautiful horse in the world.
Story: horse competes in the event.
(e.g., "this is a person in a suit"), the dataset also includes texts that provide contextual background (e.g., "this is the new general manger of the team") and subjective evaluations (e.g., "this is stylish"). As a result, current captioning models trained on Conceptual Captions avoid content hallucination but also introduce different, more subtle and harderto-detect issues related to possible context hallucinations (i.e., is this actually the new general manager?) or subjective-judgement hallucinations (i.e., whose judgment is this anyway?).
In this paper, we propose to tackle this issue of large-scale image-caption consistency using a coherence-aware approach inspired by the framework of discourse coherence theory (Hobbs, 1978; Phillips, 1977). This framework characterizes the inferences that give discourse units a coherent joint interpretation using a constrained inventory of coherence relations. In multimodal presentations, discourse units can be images as well as text, so we appeal to new image-text coherence relations that
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6525-6535
capture the structural, logical, and purposeful relationships between the contributions of the visual modality and the contributions of the textual modality. For instance, a Visible relation characterizes grounding texts that serve to make key aspects of the image content common ground (perhaps to a visually-impaired reader), analogous to Restatement relations between one text unit and another; Visible relations are key to traditional descriptive captions such as "this is a person in a suit." Meanwhile, a Story relation characterizes texts that develop the circumstances depicted in the image in pursuit of free-standing communicative goals, analogous to Occasion or Narration relations in text; Story relations can go far beyond image content ("I hiked this mountain as we found it on a list for good hikes for kids") and so pinpoint one kind of risk for context hallucinations. The key contribution of our work is to show that image-text coherence can be systematized, recognized, and used to control image captioning models.
To support our argument, we create a coherence-relation annotation protocol for image-caption pairs, which we use to annotate 10,000 image-caption pairs over images coming from the Conceptual Captions (Sharma et al., 2018) and Open Images (Kuznetsova et al., 2020) datasets. We release this dataset, named Clue, to facilitate follow-up research. By annotating these coherence relations in the context of image captioning, we open up the possibility of analyzing patterns of information in image-text presentations at web scale.
In addition, we show that we can exploit these coherence-relation annotations by training models to automatically induce them, as well as by building models for coherence-aware image captioning. Because they are driven by input coherence relations, these captioning models can be used to generate captions that are better suited to meet specific information needs and goals.
There are diverse ways to characterize the communicative functions of text and images in multimodal documents (Marsh and Domas White, 2003), any of which can provide the basis for computational work. Some studies emphasize the distinctive cognitive effects of imagery in directing attention; engaging perceptual, spatial and embodied
reasoning; or eliciting emotion (Kruk et al., 2019; Shuster et al., 2019). Some look at contrasts across style and genre (Guo et al., 2019). Others look holistically at the content of text and imagery as complementary or redundant (Otto et al., 2019; Vempala and Preotiuc-Pietro, 2019). Unlike our approach, none of these methodologies attempt to characterize information-level inferences between images and text, so none is suitable for building generation models that control the information that text provides.
While coherence theory has been applied to a range of multimodal communication, including comics (McCloud, 1993), gesture (Lascarides and Stone, 2009), film (Cumming et al., 2017), and demonstrations and other real-world events (Hunter et al., 2018; Stojnic et al., 2013), applying coherence theory specifically to text-image presentations is less well explored. The closest work to ours is Alikhani et al. (2019), who explore coherence relations between images and text in a multimodal recipe dataset. Their relations are specialized to instructional discourse and they do not build machine learning models combining imagery and text. We consider more general coherence relations and a broader range of machine learning methods.
We use our relations and introduce a coherence-aware caption generation model that improves the rate of good Visible captions by around  $30\%$ . This is a considerable improvement over the recent models that have tried to achieve more control over neural language generation using an enhanced beam search (Anderson et al., 2017), a memory network with multiple context information (Chunseong Park et al., 2017), forced attentions (Sadler et al., 2019) and modeling and learning compositional semantics using fine-grained annotations of entities in MSCOCO (Cornia et al., 2019).
3 Coherence in Images and Captions
The first step toward our goals is to characterize image-text coherence and annotate a sizable corpus of image-text pairs with coherence relations.
We use an overlapping set of high-level relations, inspired both by theoretical work linking discourse coherence to discourse structure and discourse goals (Roberts, 2012; Webber et al., 1999), and by previous successful discourse annotation campaigns (Prasad et al., 2008). Crucially, following previous work on text (Rohde et al., 2018) and multimodal discourse (Alikhani et al., 2019),
<sup>1</sup>https://github.com/malihealikhani/Cross-modal_Coherence_Kodeling
6526
Visible, Meta
(a) CAPTION: forest on a sunny day
Figure 2: We use a constrained set of coherence relations to summarize the structural, logical and purposeful relationships between the contributions of text and the contributions of images. Multiple coherence relations can be found simultaneously. (Image-caption pairs are chosen from the Conceptual Caption dataset; photo credits: Dmytro Zinkevych; Shutterstock user yauhenka; Danilo Hegg; Andre Seale)
Visible, Action, Subjective
(b) CAPTION: young happy boy swimming in the lake.
Meta, Action, Story
(c) CAPTION: approaching our campsite, at  $1550\mathrm{m}$  of elevation on the slopes.
Irrelevant
(d) CAPTION: young girl walking on the dry grass field under daylight.
we assume that several of these relations can hold concurrently. The relations are:
Visible, where text presents information that is intended to recognizably characterize what is depicted in the image, analogous to Restatement relations in text (Prasad et al., 2008).
- Subjective, where the text describes the speaker's reaction to, or evaluation of, what is depicted in the image, analogous to Evaluation relations in text (Hobbs, 1985);
- Action, where the text describes an extended, dynamic process of which the moment captured in the image is a representative snapshot, analogous to *Elaboration* relations in text (Prasad et al., 2008);
- Story, where the text is understood as providing a free-standing description of the circumstances depicted in the image, analogous to the Occasion relation of Hobbs (1985) but including instructional, explanatory and other background relations; and
- Meta, where the text allows the reader to draw inferences not just about the scene depicted in the image but about the production and presentation of the image itself, analogous to Meta-talk relations in text (Schiffrin, 1980).
Figures 2(a), (b) and (c) show examples of image-caption pairs and the associated coherence relations. We can see that image-caption pairs often have multiple relations. For completeness, we also present in Figure 2(d) an example of an image-caption pair that does not fall into any of the above categories (and it is therefore labeled Irrelevant).
Clue includes a total of 10,000 annotated image-caption pairs. A first subset of 5,000 image-caption
pairs was randomly selected from the training split of the Conceptual Captions dataset (Sharma et al., 2018), as a representative sample of human-authored image captions. The Conceptual Captions dataset is a collection of web-harvested images paired with their associated ALT-TEXT, created by human authors under various non-public guidelines (regarding style, objectivity, etc.) for over 111,000 web pages including news articles, advertisements, educational posts, blogs, etc.
A second subset of 5,000 image-caption pairs, to be used as a representative sample of machine-authored captions, is obtained from the outputs of 5 of the top models that participated in the image-captioning challenge for the Conceptual Caption Workshop at the 2019 Conference on Computer Vision and Pattern Recognition (CVPR). These machine-authored captions are over a set of 1,000 images from the Open Images Dataset (Kuznetsova et al., 2020), and are publicly available.
Protocol Although specific inferences have been shown to be realizable by crowd workers (Alikhani et al., 2019), the results of our pilot studies for annotating these more general relations with the help of crowd workers were not satisfactory. We have found that expert raters' decisions, however, have high agreement on our discourse categories. The study has been approved by Rutgers's IRB; the annotators, two undergraduate linguistics students, were paid a rate of $20/h.
In our annotation protocol, we ask the annotators to label the main relations described in Section 3, as well as certain fine-grained sub-relations. The following briefly summarizes our guidelines; our GitHub repository includes an exact copy of what
<sup>2</sup>http://wwwconceptualcaptions.com/winners-and-data
6527
the annotators used.
Annotations of Visible are given for captions that present information intended to recognizably characterize what is depicted in the image, while annotations of Meta indicate not only information about the scene depicted but also about the production and presentation of the image itself. The Meta labels have additional fine-grained labels such as When, How, and Where. A few details regarding these fine-grained labels are worth mentioning: location mentions such as "in the city" are labeled as Meta-Where, but generic states, e.g., "in the snow," are merely annotated as Visible. Captions considering the view or the photo angles, or a photos composition, i.e. "portrait" or "close-up", are annotated as Meta-How.
Annotations of Subjective are primarily given for captions that included phrases with no objective truth value, i.e. phrases using predicates of personal taste. For example, captions including noun phrases like "pretty garden" are annotated as Subjective: whether the garden is pretty or not cannot be determined except by appeal to the opinions of an implicit judge. Note that first-person reports, like "I want ..." or "I need ..." are not annotated as Subjective but rather as Story, because they describe the speaker's definite state rather than an implicit judgment.
Captions annotated as Story cover a much wider range compared to captions in other categories, including Meta and Subjective. These captions range from those that read like instructions, i.e. "how to ...", to those that present speaker desires, i.e. "I want ..." or "I need ..." to those that give background information not captured in the image, i.e. "she is an actress and model", and more.
Other and Irrelevant Some of these image-caption pairs contain incomplete captions that are hard to understand. A number of these examples include images that contained text. The text in these cases is relevant to the image and the accompanying captions; in this cases, the coherence relations are marked as Other-Text (Figure 3). Some examples of such instances are images containing signs with text, greetings on cards, or text that does not affect the interpretation of the image or caption, such as city names or watermarks.
Other times, the caption text is irrelevant and indicate that the image and caption do not correlate. Some examples of these instances are captions of "digital art selected for" paired with an irrelevant
Other-Text
Other-Gibberish
Figure 3: Examples of image-caption pairs in the Other category. (Photo credit: santabanta.com; Mary Sollosi)
image, and images that clearly do not match the caption, such as an image of a man walking with the caption "a field of strawberries". We have specifically labeled cases where the caption is almost true or almost relevant to the image at hand, such as the caption "horses in a field" with an image containing donkeys with "minor error". Other cases include images that look like powerpoint slides with bullets and text. Our GitHub repository includes detailed examples and explanations.
Experiment Interface We have developed software for annotating coherence relations in image-text presentations that can flexibly and easily accommodate various annotation schema. The annotators used this software for annotating the image-text pairs. They had the option of choosing multiple items and leaving comments.
Agreement To assess the inter-rater agreement, we determine Cohens  $\kappa$ . For this, we randomly chose 300 image-caption pairs from the Conceptual Caption ground-truth data and assigned them to two annotators. The resulting  $\kappa$  coefficient is 0.81, which indicates a high agreement on these categorical decisions.
In this section we present the overall statistics of the dataset annotations, the limitations of the caption-generation models, and the correlation of the distribution of the coherence relations with genre.
Overall statistics The exact statistics over the resulting annotations are presented in Table 1 and Table 2. Overall, Visible captions constitute around  $65\%$  and  $70\%$  of captions for the ground-truth labels and the model outputs, respectively. The rate
6528
Visible	Subjective	Action	Story	Meta	Irrelevant
Ground-truth	64.97%	9.77%	18.77%	29.84%	24.59%	3.09%
Model output	69.72%	1.99%	11.22%	17.19%	58.94%	16.97%
Ground-truth + Model	66.91%	6.58%	15.68%	24.67%	38.65%	8.77%
Table 1: Distribution of coherence relations over the ground-truth and the model outputs.
When	How	Where
Ground-truth	33.74%	64.40%	28.60%
Model output	21.75%	72.84%	41.03%
Table 2: Distribution of fine-grain relations in the Meta category over the ground-truth and the model outputs.
of Subjective and Story captions decreases significantly for the model outputs (compared to ground-truth), indicating that the models learn to favor the Visible relation at the expense of Subjective and Story. However, the rate of Meta captions increases by around  $25\%$  in the model outputs, which points to potential context hallucination effects introduced by these models. As expected, the rate of Irrelevant captions increases to around  $17\%$  in the model-generated captions, compared to  $3\%$  in the ground-truth captions. Moreover, it appears that the models have some ability to learn to generate the locations that events take place; however, there is a drop in their ability to generate temporal information (see Table 2).
In terms of overlap, Visible and Meta overlap  $22.49\%$  of the time for the ground-truth captions, whereas this rate goes up to  $54.55\%$  in the model outputs. This "conflation" of these two relations is highly problematic, and one of the main motivations for building caption-generation models that have control over the type of discourse relation they create (see Section 5). Our GitHub page includes additional statistics about overlapping relations.
Coherence relations indicate Genre Coherence relations are indicative of the discourse type and its goals, and therefore our annotations correlate with the genre under which the captions have been produced. That is, image-caption pairs from different publication sources have different distributions of coherence relations. For instance, pairs from the Getty Images domain mostly come with the Meta and Visible relations. In contrast, from the Daily Mail domain are mostly story-like, and include very few captions that describe an action,
compared with the Getty Images and picdn domains. Figure 4 shows the distribution of the coherence labels for the top four domains from the Conceptual Caption dataset.
Figure 4: Different resources have different kinds image-caption pairs. The graph shows the distribution of labels in the top four domains present in the Conceptual Captions dataset.
4 Predicting Coherence Relations
In this section, we introduce the task of predicting cross-modal coherence relations. We describe a number of preliminary experiments that justify the potential of machine learning models in classifying coherence relations in text and imagery. To this end, we train and test different models on the Clue dataset to automatically predict the coherence labels given an image and its caption.
4.1 Multi-Label Prediction
We first treat the relation prediction problem in its original multi-label setting. The train-test split for all the models described in this section is  $80\% - 20\%$  and the numbers are reported using 5-fold cross validation.
As a baseline, we report the results of a SVM classifier that uses only the text to predict the relationship between image-caption pairs. We extract bag-of-words features by using N-grams (for N from 1 to 5), and pass them to the SVM classifier
6529
Visible	Subjective	Action	Story	Meta	Irrelevant	Weighted
SVM (text-only)	0.83	0.12	0.32	0.21	0.19	0.00	0.48
GloVe (text-only)	0.80	0.44	0.58	0.57	0.44	0.08	0.63
BERT (text-only)	0.82	0.35	0.62	0.62	0.44	0.06	0.65
GloVe + ResNet	0.81	0.36	0.58	0.60	0.45	0.07	0.64
BERT + ResNet	0.83	0.36	0.69	0.62	0.44	0.06	0.67
Table 3: The  $F_{1}$  scores of the multi-class classification methods described in Section 4.1; 80-20 train-test split; 5-fold cross validation.
as input. Next, we discuss two multi-modal classifiers for predicting the image-caption coherence relations.
GloVe + ResNet-50 This model contains a text encoder for textual-feature extraction and an image encoder for image-feature extraction. For the image encoder, we use a ResNet-50 (He et al., 2016) pre-trained on ImageNet followed by a Batch-Norm layer, a fully connected layer and a ReLU activation function. The text encoder takes as input word embeddings from the GloVe model (Pennington et al., 2014), and consists of an LSTM layer, a Batch-Norm layer, a fully connected layer with tanh activation function.
BERT + ResNet-50 To test the impact of the text encoder in this setup, we reuse the setup of the previous model with a different textual-feature extractor. We train and test using an encoder that takes sentence embeddings as input using the  $\langle \mathrm{CLS}\rangle$  representation produced by the BERT-base model (Devlin et al., 2018).
Results The results of all of our models are presented in Table 3, where we present the  $F_{1}$  scores over each of the individual relations, as well as an overall weighted average. The BERT+ResNet model achieves the highest performance  $(|t| > 9.54, p < 0.01)$ , with an overall  $F_{1}$  score of 0.67. For the interested reader, we present in the GitHub page the top features of the Naive Bayes SVM classifier (Wang and Manning, 2012).
4.2 Single-Label Prediction
To achieve the goal of generating captions with a desired coherence relation to the image, it is important to clearly differentiate between often cooccurring label types (such as Visible and Meta). To this end, we introduce a label-mapping strategy for predicting coherence relations, such that each image-caption pair is assigned a single coherence
label. We map the set of human-annotated coherence relations for an image-caption pair to a single label using the following heuristic:
1. If the set contains the Meta label, then the image-caption pair is assigned the Meta label.
2. If the set contains the Visible label and does not contain either Meta or Subjective, then the image-caption pair is set to Visible.
3. If none of the above rules are met for this image-caption pair, we randomly sample a label from its set of labels.
The distribution of labels after this mapping is given in the first row of Table 4. As opposed to the ground-truth label distribution in Table 1, these values add up to  $100\%$ .
Using the label mapping described above, we retrain and evaluate the BERT+ResNet classifier presented in Sec. 4.1. In addition, we perform additional experiments in which the caption text in encoded using the pre-trained Universal Sentence Encoder $^3$  (USE) (Cer et al., 2018), which returns a 512-dimensional embedding for the text. On the image encoding side, we also experiment with the pre-trained Graph-Regularized Image Semantic Embedding model (Juan et al., 2020), which is trained over ultra-fine-grained image labels over web-sized amounts of data – roughly 260M examples over roughly 40M labels; this model returns a compact, 64-dimensional representation for the image. We concatenate the text and image features into a single vector, and feed it to a fully-connected neural network with 3 hidden layers of 256 units each with ReLU activations (for all but the last one), followed by a softmax layer which computes the logits for the 6 target classes. We divide the 3910 labeled image-text pairs from the ground-truth split of our data into training and test sets, with 3400 and 510 samples, respectively. We use dropout with probability of 0.5, and tune the model
tfhub.dev/google/universal-sentence-encoder-large/3
6530
Visible	Subjective	Action	Story	Meta	Irrelevant	Weighted
Ground-truth Distribution	46.65%	7.07%	1.31%	19.09%	23.42%	2.46%
BERT + ResNet	0.64	0.26	0.02	0.52	0.46	0.07	0.52
BERT + GraphRise	0.59	0.15	0.00	0.42	0.34	0.00	0.45
USE + GraphRise	0.69	0.45	0.00	0.57	0.48	0.00	0.57