SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 1 BreakingNews: Article Annotation by Image and Text Processing Arnau Ramisa*, Fei Yan*, Francesc Moreno-Noguer, and Krystian Mikolajczyk, Member, IEEE Abstract—Building upon recent Deep Neural Network architectures, current approaches lying in the intersection of Computer Vision and Natural Language Processing have achieved unprecedented breakthroughs in tasks like automatic captioning or image retrieval. Most of these learning methods, though, rely on large training sets of images associated with human annotations that specifically describe the visual content. In this paper we propose to go a step further and explore the more complex cases where textual descriptions are loosely related to the images. We focus on the particular domain of news articles in which the textual content often expresses connotative and ambiguous relations that are only suggested but not directly inferred from images. We introduce an adaptive CNN architecture that shares most of the structure for multiple tasks including source detection, article illustration and geolocation of articles. Deep Canonical Correlation Analysis is deployed for article illustration, and a new loss function based on Great Circle Distance is proposed for geolocation. Furthermore, we present BreakingNews, a novel dataset with approximately 100K news articles including images, text and captions, and enriched with heterogeneous meta-data (such as GPS coordinates and user comments). We show this dataset to be appropriate to explore all aforementioned problems, for which we provide a baseline performance using various Deep Learning architectures, and different representations of the textual and visual features. We report very promising results and bring to light several limitations of current state-of-the-art in this kind of domain, which we hope will help spur progress in the field. Index Terms—News Dataset, Story Illustration, Geolocation, Caption Generation, Vision and Text. F 1 INTRODUCTION INrecent years, there has been a growing interest in exploring the relation between images and language. Simultaneous progress in the fields of Computer Vision (CV) and Natural Language Processing (NLP) has led to impressive results in learning both image-to-text and text-to-image connections. Tasks such as automatic image captioning [8], [16], [37], [41], [75], [82], image retrieval [21], [31], [45], [48] or image generation from sentences [6], [88] have shown unprecedented results, which claimed to be similar to the performance expected from a three-year old child1. One of the main reasons behind the success of these approaches is the resurgence of deep learning for modeling data, which has been possible due to the development of new parallel computers and GPU architectures and due to the release of new large datasets, used to train deep models with many parameters. The popularity of crowd sourcing tools has facilitated the proliferation of a number of these datasets combining visual and language content. Among them, •Arnau Ramisa and Francesc Moreno-Noguer are with the Institut de Robòtica i Informàtica Industrial, CSIC-UPC, Barcelona, 08028, Spain. Email: {aramisa, fmoreno}@iri.upc.edu. •Fei Yan is with the Centre for Vision, Speech and Signal Processing, University of Surrey, Guildford, UK. Email:
[email protected]. •Krystian Mikolajczyk is with the Department of Electrical and Electronic Engineering, Imperial College London, UK. Email: [email protected]. * The first two authors contributed equally. 1. http://www.ted.com/talks/fei_fei_li_how_we_re_teaching_ computers_to_understand_pictures the most widely known are the UIUC Pascal Sentence Dataset [66], the SBU captioned photo dataset [61], Flickr8K [31], Flickr30K [84] and MS-COCO [51]. All these datasets consist of a number of images (from 1K to 1M), each annotated by human written sentences (between 1 and 5 per image). The annotations are typically short and accurate sentences (of less than 20 words) describing the visual content of the image and the action taking place. In contrast, other and more complex types of documents, like illustrated news articles, have been barely explored. We believe that current successes in the crossroads between NLP and Computer Vision indicate that the techniques are mature for more challenging objectives than those posed by existing datasets. The NLP community has been addressing tasks such as sentiment analysis, popularity prediction, summarization, source identification or geolocation to name a few that have been relatively little explored in Computer Vision. In this paper we propose several learning schemes. Specifically, for the source detection, article illustration and geolocation prediction, we consider an adaptive CNN architecture, that shares most of the structure for all the problems, and just requires replacing and retraining the last layers in order to tackle each particular problem. For the caption generation task, image and text representations are combined in a Long Short-Term Network (LSTM). In order to evaluate these algorithms, we have collected BreakingNews, a large-scale dataset of news articles with rich meta-data. Our dataset consists of approximately 100K news articles, illustrated by one to three images and their corresponding captions. Addi-
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 2 Fig. 1: BreakingNews dataset. The dataset contains a variety of news-related information including: the text of the article, captions, related images, part-of-speech tagging, GPS coordinates, semantic topics list or results of sentiment analysis, for about 100K news articles. The figure shows two sample images. All this volume of heterogeneous data makes BreakingNews an appropriate benchmark for several tasks exploring the relation between text and images. tionally, each article is enriched with other data like related images from Google Images, tags, shallow and deep linguistic features (e.g. parts of speech, semantic topics or outcome of a sentiment analyzer), GPS latitude/longitude coordinates and reader comments. The articles cover the whole year 2014 and are collected from various reference newspapers and media agencies like BBC News, The Guardian or the Washington Post. This dataset is an excellent benchmark for taking joint vision and language developments a step further. In contrast to existing datasets, the link between images and text in BreakingNews is not as direct, i.e., the objects, actions and attributes of the images may not explicitly appear as words in the text (see examples in Fig. 1). The visual-language connections are more subtle and learning them will require the development of new inference tools able to reason at a higher and more abstract level. Furthermore, besides tackling article illustration or image captioning tasks, the proposed dataset is intended to address new challenges, such as source/media agency detection or estimation of GPS coordinates. For each of these tasks we benchmark several learning schemes based on state-of-the-art deep neural network architectures and different feature representations for text and images. For GPS regression and text and image correlation we propose novel loss functions, namely the Great Circle Distance and Deep Canonical Correlation Analysis. Overall results are very promising, but there is still much room for improvement, and the dataset can be easily extended with additional annotations to explore other problems such as visual question answering or text summarization. Both the baseline results we obtain and the dataset will be made publicly available, and we hope it will inspire future research in the field. Overview: The rest of the paper is organized as follows. In Section 2 we present the different vision and language processing tasks that will be addressed in this paper, with a thorough review of the related work for each case. In Section 3 we introduce BreakingNews, the news article dataset. The following two sections, describe the technical details about how the visual and textual data is represented (Section 4), and which CNN architectures we have built to tackle each of the tasks (Section 5). A extensive evaluation is reported in Section 6. 2 TASKS DESCRIPTION AND RELATED WORK We next describe the tasks that will be tackled in this article and the related work for each of them, as well as the existing datasets. 2.1 Source detection This tasks deals with analyzing the content of the news articles, and detecting in which news media agency it has been originally published. It can also be used for more sociological-oriented research. As an example, we tackle the task of quantitatively assessing the intuition that different news agencies have their clear, distinctive style. This problem can be addressed by modeling the type of language, images and topical preference for each news agency, but also from correctly modeling the sentiment in each news article based on the political orientation of the agency, or other similar refinements. Although we are not aware of other approaches explicitly tackling source identification in news articles, there exists a vast amount of related works, mostly motivated by detection of plagiarism or dealing with the authorship identification problem [44], [58], [72]. 2.2 Text Illustration This task deals with automatically retrieving the appropriate image (or a small subset) from a pool of images given a textual query of a news story.
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 3 Some approaches tackle this problem by learning classifiers to represent images through intermediate semantic concepts, that can then be easily assigned to individual keywords or to multi-attribute textual descriptions [3], [4], [45], [48], [67], [17]. Richer textual queries are allowed in [21], [31], [29], [19], [76] by mapping both image and sentences to intermediate spaces where direct comparison is possible. For all these methods, the textual input consists on keywords or short sentences at most. There have been some efforts specifically addressing the domain of news articles. For instance [22] builds a system based on joint topic models to link text to images, and evaluates the results in the BBC News dataset [23]. In [9], it is assumed that there exist short text descriptions and tags accompanying the images, which can then be easily matched to text documents represented by means of word frequencies. Other approaches perform article illustration by exploiting Google’s search engine (which also assumes text associated with each image of the database), and combine multiple queries generated from the title of the article [50], or from the narrative keywords [34]. Similarly, [38] proposes a story picturing engine, that first processes a story to detect certain keywords, and then uses these to select annotated images from a database. Alternatively to image retrieval strategies, text illustration can be carried out from a generative perspective. There exist early approaches that extracted object arrangements from sentences to then generate computer graphic representations of static [11] and dynamic [64] scenes. [25] proposed a system to animate a human avatar based on the emotions inferred from text. And very recently, advanced sentence parsers have been used to extract objects and their relations from sentences, and then automatically render 2D [88] and 3D [6] scenes. Finally, illustration of short texts, like chat messages or tweets, has also been investigated [36], [78]. 2.3 Geolocation This task considers the problem of geographically referencing news articles based on text and image cues. One of the pioneering works on a related topic proposed an approach for geolocating web documents by detecting and disambiguating location names in the text [15]. Also only using text information, [68] matched a predefined tagged map to the most likely GPS location of tagged Flickr photos. On the other hand, several image-based methods leverage massive datasets of geotagged images for geolocation of generic scenes on the global Earth scale [28], [40], [79], or for place recognition tasks [7]. There has been also work on this area by combining text and image information [5], [12]. For the specific domain of news articles, most existing works use only text information [50], [80]. One interesting exception is [87], which combines textual descriptors with global image representations based on GIST [59] to infer geolocation of nearly two thousand NY Times articles. 2.4 Caption Generation Among the tasks dealing with image and text interactions, automatically generating photo captions is the one receiving most attention. Early work in this area focused in annotating images with single words [3], [70], phrases with a reduced vocabulary [21], [47] or with semantic tuples [60], [65]. The problem has also been tackled from a ranking perspective, in which given a query image, one needs to rank a set of human generated captions. Projecting images and captions to a joint representation space using Kernel or Normalized Canonical Correlation Analysis has been used for this purpose [26], [31]. The largest body of recent work, though, share a basic approach, which consists in using a Recurrent Neural Network (RNN) to learn to “translate” the image features into a sentence in English, one word at a time [8], [16], [20], [37], [41], [43], [54], [75], [82]. Yet, while the results obtained by the RNN-based approaches are outstanding, they are all focused on accurately describing the content of the picture, which is significantly different than generating a suitable caption for the illustration of a news article, in which the relation between the visual content of the image and the corresponding captions is more indirect and subtle than in typical image captioning datasets. This is precisely the main challenge posed by the BreakingNews dataset we present. There exists some previous work in automatic caption generation for images of the BBC News Dataset [23]. However, as we will discuss later, BreakingNews is about two orders of magnitude larger than BBC News Dataset, and incorporates a variety of metadata that brings the opportunity to develop new Computer Vision approaches for the analysis of multimodal and large-scale multimedia data. 2.5 Image and Text Datasets There is no doubt that one of the pillars on which the recent advent of Deep Learning holds is the proliferation of large object classification and detection datasets like ImageNet [13], PASCAL VOC 2012 [18] and SUN [81]. Similarly, the progress on the joint processing of natural language and images largely depends on several datasets of images with human written descriptions. For instance, the UIUC Pascal Sentence Dataset [66] consists of 1,000 images each annotated by 5 relatively simple sentences, even lacking verb in a large percentage of them. The SBU photo dataset [61] consists of one million web images with one description per image. These descriptions are automatically mined and do not always describe the visual content of the image. Flickr8K [31], Flickr30K [84] and MS-COCO [51] contain five sentences for a collection of 8K, 30K and 100K images, respectively. In these datasets, the sentences specifically describe the visual content and actions occurring in the image. Relevant work has also been done in the area of Visual Question Answering VQA [2]. DAQUAR [53], Visual Madlibs [85] and KB-VQA [77] were designed
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 4 News article tags World news, UK news, Business, Politics, Society, Australia, Life and style, Sport, United States, World, Europe, Health, Entertainment, Australian politics, Nation, Football, Culture, Middle East and North Africa, Asia Pacific, Comment, Media, Sports, Law, Soccer, Environment, Africa, Labour, Conservatives, Russia, Blogposts, London, David Cameron, Features, Australia news, Technology, Money, Scotland, China, Food and drink, Ukraine, Education, NHS, Women, Sci/Tech, Tony Abbott, US politics, European Union, Editorial, Iraq, Economics, Barack Obama, Books, US news, Syria, Children, Music, Religion, Premier League, Film, Top Stories, Family, Scottish independence, US foreign policy, Science, Ed Miliband, Crime, Liberal Democrats, France, England, Internet, Retail industry, Israel, Television, Race issues, Labor party, Police, Economic policy, New South Wales, Gender, Victoria, Vladimir Putin, Local government, UK Independence party (Ukip) TABLE 1: Some popular tags associated to news articles in the dataset. Source num. articles avg. len. article avg. num. images avg. len. caption avg. num. comments avg. len. comment avg. num. shares % geolocated Yahoo News 10,834 521 ±338 1.00 ±0.00 40 ±33 126 ±658 39 ±71 n/a 65.2% BBC News 17,959 380 ±240 1.54 ±0.82 14 ±4 7 ±78 48 ±21 n/a 48.7% The Irish Independent 4,073 555 ±396 1.00 ±0.00 14 ±14 1 ±6 17 ±5 4 ±20 52.3% Sydney Morning Herald 6,025 684 ±395 1.38 ±0.71 14 ±10 6 ±37 58 ±55 718 ±4976 60.4% The Telegraph 29,757 700 ±449 1.01 ±0.12 16 ±8 59 ±251 45 ±65 355 ±2867 59.3% The Guardian 20,141 786 ±527 1.18 ±0.59 20 ±8 180 ±359 53 ±64 1509 ±7555 61.5% The Washington Post 9,839 777 ±477 1.10 ±0.43 25 ±17 98 ±342 43 ±50 n/a 61.3% TABLE 2: BreakingNews dataset statistics. Mean and standard deviation, usually rounded to the nearest integer. specifically for VQA and evaluating algorithms capable of answering high level questions and reasoning about image contents using external information. The goal is slightly different than for analysis of illustrated articles as it typically involves complex reasoning on the image content, however it is also similar in a sense that VQA require specific information about the image for which generic image captions are of little use. In this paper, we focus on illustrated news articles datasets, which differ from previous image and text datasets in that the captions or the text of the article do not necessarily describe the objects and actions in the images. The relation between text and images may express connotative relations rather than specific content relations. The only dataset similar to BreakingNews is the BBC News dataset [23], which contains 3,361 articles with images, captions and body text. However, this dataset is mainly intended for caption generation tasks although it is small for training data-hungry models like LSTM recurrent neural networks, that are the state-of- the-art techniques for caption generation. Furthermore, in addition to the difference in size, the BBC News does not include geolocation information, tags, social network shares or user comments, and all articles come from a single source. In BreakingNews, we provide a two order of magnitude larger dataset, that besides images and text, contains other metadata (GPS location, user comments, semantic topics, etc) which allows exploring a much wider set of problems and exploit the power of current Deep Learning algorithms. After the initial submission of this work, another large-scale news dataset was published: the ION corpus [32]. However, in contrast with BreakingNews, it includes only the article text, images and captions. 3 BREAKINGNEWS DATASET We have come a long way since the days when a news article consisted solely of a few paragraphs of text: online articles are illustrated by pictures and even videos, and readers can share their comments on the story in the same web-page, complementing the original document. Studying the effects and interactions of these multiple modalities has clear interesting applications, such as easing the work of journalist by automatically suggesting pictures from a repository, or determining the best way to promote a given article in order to reach the widest readership. Yet, no benchmarks that capture this multimodality are available for scientific research. For these reasons, we propose a novel dataset of news articles2with images, captions, geolocation information and comments, which we will use to evaluate CNN and LSTM architectures on a variety of tasks. Our models are based on the most recent state-or-the-art approaches in deep learning, and thus, this dataset is intended to be a touchstone to explore the current limits of these methodologies, shown to be very effective when dealing with images associated with visually descriptive text. 3.1 Description of the Dataset The dataset consists of approximately 100,000 articles published between the 1st of January and the 31th of December of 2014. All articles include at least one image, and cover a wide variety of topics, including sports, politics, arts, healthcare or local news. Table 1 shows some of the most popular topics. The main text of the articles was downloaded using the IJS newsfeed [73], which provides a clean stream of semantically enriched news articles in multiple languages from a pool of RSS feeds. We restricted the articles to those that were written in English and originated from a shortlist of highlyranked news media agencies (see Table 2) to ensure a degree of consistency and quality. Given the geographic distribution of the news agencies, most of the dataset is 2. The BreakingNews dataset is publicly available at http://www. iri.upc.edu/people/aramisa/BreakingNews/index.html
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 5 -180 ° - 90 ° 0 ° 90 ° 180 ° -90 ° -45 ° 0 ° 45 ° 90 ° Fig. 2: Ground truth geolocations of the articles. made of news stories in English-speaking countries in general, and the United Kingdom in particular. For each article we downloaded the images, image captions and user comments from the original article web-page. News article images are quite different from those in existing captioned images datasets like Flickr8K [31] or MS-COCO [51]: often include close-up views of a person (46% of the pictures in BreakingNews contain faces) or complex scenes. Furthermore, news image captions use a much richer vocabulary than in existing datasets (e.g. Flickr8K has a total of 8,918 unique tokens, while eight thousand random captions from BreakingNews already have 28,028), and they rarely describe the exact contents of the picture. We complemented the original article images with additional pictures downloaded from Google Images, using the full title of the article as search query. After manually verifying the results of a large subset of articles, we found that using the title as the query term was sufficiently precise and more stable than the full article text. The five top ranked images of sufficient size in each search were downloaded as potentially related images (the original article image usually appears among them). Interestingly, the articles are annotated with user comments and the number of shares on different social networks (e.g. Twitter, Facebook, LinkedIn) if this information was available. Whenever possible, in addition to the full text of the comments, we recovered the thread structure, as well as the author, publication date, likes (and dislikes) and number of replies. Since there were no share or comments information available for "The Irish Independent", we searched Twitter using the full title of the articles, and collected the tweets with links to the original article, or that mentioned a name associated with the newspaper (e.g. @Independent_ie, Irish Independent, @IndoBusiness) in place of comments. We considered the collective number of re-tweets as shares of the article. Even though in this paper we do not specifically exploit this type of annotation, we believe it would be useful for methods analysing article popularity. The IJS Newsfeed annotates the articles with geolocation information both for the news agency and for the article content. This information is primarily taken from the provided RSS summary, but sometimes it is not available and then it is inferred from the article using heuristics such as the location of the publisher, TLD country, or the story text. Fig. 2 shows a distribution of news story geolocation. Finally, the dataset is annotated with shallow and deep linguistic features (e.g. part of speech tags, inferred semantic topics, named entity detection and resolution, sentiment analysis) with the XLike (http://www.xlike. org/language-processing-pipeline/) and the Enrycher (http://ailab.ijs.si/tools/enrycher/) NLP pipelines. 4 REPRESENTATION In this section we discuss text and image representations for news article analysis. We first present Bag-of-Words and Word2Vec text embeddings and then image representations based on deep CNNs. 4.1 Text representation Bag-of-Words (BoW) with TF-IDF weighting: Bag-of- Words is one of the most established text representations, and their reliability and generalization capabilities have been demonstrated in countless publications. Therefore, we adopt it as a baseline for our approach. The BoW representation requires a vocabulary, which we established as unique lemmatised tokens from the training data that appear more than Ltimes in the articles. This leads to Dbdimensional Bag-of-Words (BoW) vectors where the jth dimension is given by tjlog M cj+1 , where tjis the frequency of the jth token (i.e. the number of times it appears in the article), cjis document frequency of the token (i.e. the number of training articles where it appears), and Mis the total number of training articles. A common practice is to truncate the BoW vector based on inverse document frequency. It has been demonstrated that performance typically improves monotonically with the number of retained dimensions. Word2Vec: Recently, distributed representations for text, and Word2vec [49], [56], [57] in particular, are gaining a lot of attention in the NLP community. This representation encodes every word in a real-valued vector that preserves semantic similarity, e.g. "king" minus "man" plus "woman" will be close to "queen" in the embedding space. Using a two-layer neural network, words are modeled based on their context, defined as a window that spans both past and future words. Two methods have been proposed to learn the representations: the Continuous bag of words (cbow) model, where the objective is predicting a word given its context, and the Continuous skip-gram model, where the objective is the opposite; i.e. trying to predict the context given the word being modeled. The negative sampling objective function, where the target word has to be distinguished from random negative words, is used as an efficient alternative to hierarchical soft max. We investigated both cbow and skip-gram methods3and found that the later performed better in our applications. 3. Code available at https://code.google.com/p/word2vec/
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 6 The trained model is used to encode each article by stacking the representation for every word and symbol in a matrix with dimension Dwtimes the number of tokens in the article, where Dwis the size of the embedding space. From this matrix we investigate three representations: 1) full matrix as input for the convolutional layers of a deep network; 2) mean or 3) max along the sentence dimension to construct a single Dwdimensional vector for each article. Another possible strategy would be to first apply pooling independently for each sentence, and next for all the sentence representations in a single document vector. We have however observed in early experiments that allowing the system to learn from all features and their ordering by using a convolutional layer, performs better than pooling the representations beforehand. 4.2 Image representation Our image representations are based on pre-trained deep CNNs. We follow the state-of-the-art CNN representation developed for object recognition [69] with 19 convolutional layers (VGG19). More specifically, we compute the activations of the last ReLU layers of the VGG19 and the Places scene recognition CNN [86]. Each of these activations are 4,096 dimensional sparse vectors, and have been shown to perform well in various vision tasks. We also `2normalize the two vectors and concatenate them to form a third image representation of size 8,192. 5 LEARNING In this section we describe the learning schemes based on deep neural networks that will be used for the proposed tasks. We first discuss in Section 5.1 a CNN for article illustration, source detection, and geolocation prediction. In Section 5.2 we extend the state-of-the-art LSTM approach for caption generation. 5.1 Article analysis CNN architecture: CNNs have recently proven successful in many NLP tasks such as sentiment analysis, machine translation or paraphrase identification [10], [39], [42]. We consider a CNN architecture, as illustrated in Fig. 3-a1, for various article analysis tasks. In the figure, dashed boxes are the inputs to the network, and solid boxes are the layers. Moreover, white boxes denote data and layers that are shared by all tasks (we denote the group by "Shared Textual CNN"), while shaded ones are task specific. Assuming Word2Vec embeddings have been learnt, an article can be represented by a Dw×nimatrix, where Dwis the dimensionality of the embedding space, and niis the number of tokens in the ith article. Such matrix is zeros-padded to Dw×N, where Nis the number of tokens in the longest article (we add N−nicolumns of zeros). The convolution layer convolves the Word2Vec matrices with 256 rectangular kernels of size Dw×5at a stride of 1, capturing local correlations in the tokens. The output of the convolution layer are 256 feature channels of dimension N−4each. Effectively, the convolutional kernels act as learnable feature detectors. The activations of the convolution layer are maxpooled (pooling) along each channel. The resulting 256 dimensional vectors are transformed into 64 channels in a fully connected linear layer (FC), before nonlinearity is applied. Although Tanh or Absolute nonlinearities were observed to have a small accuracy advantage, we found that ReLU [46] is numerically more stable in terms of gradient computation. Dropout has been proven a simple yet effective way of preventing overfitting in large networks [71]. We found that a small dropout ratio (e.g. 0.1) is sufficient for our tasks. Finally, after dropout, the 64 dimensional vectors are transformed in a second linear layer (FCo) to vectors with appropriate length. Let the output of FCo be z∈Rd for each article, which will then be used in a task specific loss function, together with a task specific label. The gradient of the loss with respect to zwill be computed and backpropagated to update the CNN parameters. The parameters of the CNN architecture for various tasks are given in Fig. 3-a1. The network described above takes as input textual features i.e. Word2Vec embeddings. We also propose the simple nonlinear network in Fig. 3-a2 that takes image features as input, including VGG19, Places, and the concatenation of the two. Moreover, in Fig. 3-a3 the text CNN and image CNN are combined in a concatenation layer. Fig. 3-a1,a2,a3 allow us to evaluate the performance of various features and their combinations in the context of different tasks. We next describe the configuration details of the last layer FCo and the loss functions (and when necessary their corresponding derivatives), that make the CNN architecture of Fig. 3-a1,a2,a3 problem specific. Source detection: For source detection, the label y is in the set {1,··· , d}, being dthe number of news agencies where the articles originate from. The loss layer implements the multinomial logistic loss that maximizes the cross entropy, whose gradients for backpropagation are readily available. Article illustration: For article illustration, we use the image representation discussed in Section 4.2 as the label y∈R8,192, which is a concatenation of `2normalized VGG19 and Places activations. The output of the FCo layer zalso has a dimensionality d= 8,192. For a batch of mdata points, the inputs to the loss layer are two d×mmatrices Zand Y(see [83] for details). Let the covariances of Zand Ybe Σzz and Σyy respectively, and let the cross covariance be Σzy, all of them Rd×dmatrices. A good loss function for article illustration is the Canonical Correlation Analysis (CCA) loss [33], [27], which seeks pairs of linear projections wz,wy∈Rdthat maximize the correlation between the
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 7 (a1) W2V matrix Loss Label Convolution 256 Dwx5 kernels stride: 1 Pooling max pooling, 1x(N-4) kernel Fully Connected 64 channels Nonlinearity ReLU Dropout dropout ratio: 0.1 FCo task-dependant number of channels Shared Textual CNN (b2) Caption W2V matrix Image LSTM VGG19 CNN FCo' Shared Textual CNN FCo LSTM W2V mean Image CNN FC7 Caption (b1) (a2) Image CNN FC7 Loss Label Fully Connected 4096 channels Nonlinearity ReLU FCo task-dependant number of channels (a3) Loss Label FCo task-dependant number of channels W2V matrix Shared Textual CNN Concatenation Image CNN FC7 Fully Connected 4096 channels Nonlinearity ReLU Fully Connected 64 channels Dropout dropout ratio: 0.1 Fig. 3: CNN and LSTM architectures for article analysis and caption generation. (a1-3) CNN for article analysis. Dashed boxes are the CNN inputs, and solid boxes correspond to the layers. White boxes (enclosed within the "Shared Textual CNN" box) are shared by all tasks, and shaded boxes are task specific layers. (b1, b2) Models for caption generation: (b1) LSTM with fixed features, and (b2) end-to-end learning with CNNs+LSTM. Note that the "Shared Textual CNN" from (a1) is used in the textual branch. articles and the images: (w∗ z,w∗ y) = arg max wz,wy corr(w> zZ, w> yY) = arg max wz,wy w> zΣzywy qw> zΣzzwzw> yΣyywy (1) Using the fact that the objective is invariant to scaling of wxand wy, and assembling the top projection vectors into the columns of projection matrices Wzand Wy, the CCA objective can be written as: max Wz,Wy tr(W> zΣzyWy)(2) s.t. :W> zΣzzWz=W> yΣyyWy=Id where Idis the d−dimensional identity matrix. Let us define Γ=Σ−1/2 zz ΣzyΣ−1/2 yy , and let Ukand Vkbe the matrices of the first kleft- and rightsingular vectors of Γ, respectively. In [1], [55] it is shown that the optimal objective value is the sum of the top ksingular values of Γ, and the optimum is attained at (W∗ z, W∗ y) = (Σ−1/2 zz Uk,Σ−1/2 yy Vk)(3) When k=d, the total correlation objective in Eq. (2) is equal to the trace norm of Γ: corr(Z, Y ) = ||Γ||tr =tr((Γ>Γ)1/2)(4) We define the CCA-based loss as L=−corr(Z, Y ). If we consider the singular value decomposition (SVD) of Γto be Γ = UDV >, recent works [1], [83], have shown that the gradient of Lwith respect to Zis given by: ∂L ∂Z =−1 m−1(2∇zz ¯ Z+∇zy ¯ Y)(5) where ¯ Zand ¯ Yare the centered data matrices, and ∇zz =−1 2Σ−1/2 zz UDU>Σ−1/2 zz (6) ∇zy = Σ−1/2 zz UV >Σ−1/2 yy (7) Note that with CCA loss we do not directly predict the image feature vector, instead, we maximise the correlation of the text and the image features (after CNN layers). Geolocation prediction: For geolocation prediction, the label y= [y1, y2]>is a pair of latitude and longitude values, where the latitude y1∈[−π/2, π/2] and the longitude y2∈[−π, π]. Fig. 2 illustrates the ground truth geolocations in the training set. The output of the FCo layer z∈R2can be thought of as the predicted latitude and longitude. In the loss layer, we could minimize the Euclidean distance between the two geolocations zand y. However, the Euclidean loss does not take into account the fact that the two meridians near −πand πrespectively are actually close to each other. To address this, we minimize the Great Circle Distance (GCD) between zand y, which is defined as the geodesic distance on the surface of a sphere, measured along the surface. We use the spherical law of cosines approximation of GCD: GCD =R·arccos(sin y1sin z1+ cos y1cos z1cos δ)(8) where δ=z2−y2, and R= 6,137 km is the radius of the Earth. Ignoring constant Rwe define our geolocation loss function as L= arccos(sin y1sin z1+ cos y1cos z1cos δ)(9)
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 8 Using the chain rule, the gradient of Lwith respect to z can be shown to be: ∂L ∂z= −1 √1−φ2(sin y1cos z1−cos y1sin z1cos δ) −1 √1−φ2(−cos y1cos z1sin δ) (10) where φ= sin y1sin z1+ cos y1cos z1cos δ. In practice, to ensure numerical stability, the term 1−φ2is discarded when it is too close to zero. 5.2 Caption generation Image and video captioning has made significant progress in the last few years. State-of-the-art approaches use CNNs to encode image and video as a fixed-length vectors, and employ recurrent neural networks (RNNs) in the particular form of Long Short-Term Memory Networks (LSTMs) [30] to decode the vector into a caption [16], [75], [82]. By using an input gate, an output gate and a forget gate, LSTMs are capable of learning longterm temporal dependences between important events. Moreover, LSTMs successfully deal with the vanishing and exploding gradients problem by keeping the errors being backpropagated in their memory. In this paper we consider the following LSTM-based architectures to tackle the caption generation problem. LSTM with fixed features: The task of news image captioning differs from most existing works on image captioning in two aspects. First, captions for news images are often only loosely related to what is illustrated in the images, making it much more challenging to learn the mapping between images and captions. Consequently, the approaches designed to improve the description of image, object and action such as the attention mechanism [82] were not used as a baseline here. Second, instead of conditioning only on images, news captions are conditioned both on the articles and images. To address the second difference, we extend the recent techniques in [16], [75], [82]. We take the mean of a Word2Vec matrix as the fixed article representation, and VGG19 and/or Places activations as the fixed image representation, and train an LSTM using either representation, or a concatenation of the two. The architecture of such a scheme is illustrated in Fig. 3-b1. End-to-end learning with CNNs+LSTM: The language CNN described earlier in this section (Fig. 3- a1), the VGG19 (or Places) image CNN, and the LSTM for caption generation are all neural networks trained with backpropagation. We propose to connect the three networks as illustrated in Fig. 3-b2, achieving end-to- end learning of caption generation from raw articles and raw images. In this setting, the VGG19 CNN and the language CNN have FCo’ and FCo as their last layers respectively, which encode image and article information into a 500 dimensional vector each. The VGG19 CNN is also filled with parameters pretrained on ImageNet. During training, the gradients in LSTM are propagated backward in time, and backward into the two CNNs. In addition to the LSTM approaches, we also experimented with extractive captioning. To generate a new caption, we selected the sentence from the article that is most compatible with the image according to the CCA projection, as presented for the article illustration. Sentences shorter than 5 words or longer than 50 words were discarded. We termed this approach CCA-Sentence selection (CCA-SS). 6 RESULTS In this section, we present experimental results on the four tasks we considered. We first discuss CNN results for source detection, geolocation prediction and article illustration, followed by a discussion on LSTM and a mixed LSTM/CNNs model for caption generation. 6.1 Implementation Details Before describing the experimental results, we discuss the technical aspects related to the preparation of the dataset and to the implementation details, including the hyper-parameters set-up for representation and learning. Dataset considerations for the experimental setup: The BreakingNews dataset is split into train, validation and test sets with 60%, 20% and 20% articles respectively. To ensure fairness in the experiments, we also checked there was almost no overlap of images between the sets using the VGG19 features and a cosine distance. This ratio of near-identical image pairs was in the order of 10−6. Textual representations: In total there are 47,677 unique tokens with frequency 5 or more in the training set (out of 115,427), so the BoW representation is Db= 47,677 dimensional. Regarding the captions, the BoW size is 13,507 (out of 89,262 unique terms). For Word2Vec, we used the BreakingNews training set with the skipgram method to learn the embedding space. The size of the embedding space was Dw= 500, the window size was 30, the sampling rate was set to 1e-5, and the number of negative samples was set to 5. These hyperparameters were chosen based on the article illustration task for a small subset. We also experimented with a publicly available Word2Vec model trained with the Google 100 billion words dataset, but the performance was worse. Furthermore, we considered using Glove [63] and Doc2Vec [49] instead of Word2Vec. However, we have found these embeddings to perform worse in our dataset. For instance, for the illustration task, when trained on a subset with 5,000 pairs and evaluated on a subset with 1,000 pairs, the Word2Vec features have a median rank (MR) of 60 (lower is better), while Glove features have 100 and Doc2Vec features 200. We therefore focused on Word2Vec features in other tasks. Article analysis: The proposed CNN architecture including our novel GCD and CCA losses were implemented using the Caffe framework [35]. Unless specified otherwise, in the experiments we used a base learning rate of
SUBMITTED TO IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE 9 -150 -100 -50 0 50 100 150 -150 -100 -50 0 50 100 150 BBC Ind. SMH Guard. Tel. Yahoo WP BoW TF-IDF -150 -100 -50 0 50 100 150 -150 -100 -50 0 50 100 150 BBC Ind. SMH Guard. Tel. Yahoo WP W2V mean -150 -100 -50 0 50 100 150 -150 -100 -50 0 50 100 150 BBC Ind. SMH Guard. Tel. Yahoo WP CNN FCo layer Fig. 4: Source detection: t-SNE embedding of shallow and deep features for the articles in the test set. 0.05, which dropped by a factor of 0.1 after every 1,000 iterations. Stochastic gradient descent was employed as the solver, for which the momentum was set to 0.9. The regularisation parameter weight decay was set to 0.0005. The results reported in this paper were obtained with a batch size of m= 64, which was cross-validated on the validation set. For the illustration task the dimensionality of the projection space was also cross-validated, and the cosine distance was used to measure the distance in the projection space. While exhaustive search was not realistic, we experimented as much as possible with network architectures and hyper-parameters of the various layers. For instance, for the convolutional layer we experimented with size and stride, and found that a kernel width of 5 and a stride of 1 produced the best performance. For the source prediction task, with textual features, using a kernel size of 500 ×7instead of 500 ×5 reduced the accuracy by ∼5 points, and a kernel size of 500 ×3instead of 500 ×5reduced it by ∼2 points. On the other hand, a stride of 2 and 5 instead of 1 decreased the accuracy by ∼1 and ∼5 points, respectively. All our experiments were performed on an NVIDIA Tesla K40C GPU with 12G memory. It takes approximately 10 hours for training to converge. Depending on the task, the total number of parameters learnt in the CNN ranges from approximately 0.7M to 1.2M. LSTMs for caption generation: The two architectures in Fig. 3-b1,b2 were implemented using Neuraltalk24. We set both the input encoding size and LSTM memory size to 256, the learning rate to 0.0002, the batch size to 4, and kept all other parameters default. On the NVIDIA K40C GPU it typically took several days for the training to converge. The total number of parameters was approximately 50M and 200M for the two architectures. 6.2 CNNs for article analysis Source detection: For this task we compare the proposed CNN trained with the full 500 ×8,000 Word2Vec matrix with the popular shallow learner linear SVM. For the latter, we consider four versions of shallow textual 4. https://github.com/karpathy/neuraltalk2 features: the full 47,677 dimensional TF-IDF weighted BoW feature; its truncated version with 5,000 dimensions; the mean of Word2Vec matrix; and the max of Word2Vec matrix (direct usage of the full matrix was discarded right away as impractical and not robust to sentence variations). Additionally, note that the source detection problem is unbalanced, as can be seen in Table 2. We therefore use two performance metrics: the overall accuracy, and the balanced accuracy which is the average of per-class accuracies. Results in Table 3 show that the full BoW feature outperforms its truncated version, and the mean of Word2Vec is much better than the max version. When comparing the two types of text features, BoW’s small advantage may be attributed to its much higher dimensionality (47,677/5,000 vs. 500). The proposed CNN architecture produces accuracies significantly higher than the best shallow feature. As expected, image features alone have lower performance than the text features, yet they still produce surprisingly good results, indicating that the different media agencies have distinctive ways of illustrating their articles. Another noteworthy conclusion is that the shallow learners benefit more from the additional data than the CNN, which seems to already have saturated its performance by fully utilizing the text information. In Fig. 4 we plot the 2D t-SNE [52] embedding of the shallow features and the output of the FCo layer of the CNN for the test set, where the points are colourcoded with class labels. It is evident that the deeplylearnt representation in CNN provides a much better separation of the different classes. Article illustration: We compare the CNN with the Canonical Correlation Analysis (CCA), which is a standard shallow learner for text and image matching [26], [31]. Given textual and visual representations for a pair of article and image, CCA finds the optimal projection that maximises the correlation between the two modalities. For textual representation on the CCA we again consider both BoW and Word2Vec mean; and for image representation we use activations of the pretrained VGG19 and Places models, and the concatenation of the two.