{"title": "Training and Evaluating Multimodal Word Embeddings with Large-scale Web Annotated Images", "book": "Advances in Neural Information Processing Systems", "page_first": 442, "page_last": 450, "abstract": "In this paper, we focus on training and evaluating effective word embeddings with both text and visual information. More specifically, we introduce a large-scale dataset with 300 million sentences describing over 40 million images crawled and downloaded from publicly available Pins (i.e. an image with sentence descriptions uploaded by users) on Pinterest. This dataset is more than 200 times larger than MS COCO, the standard large-scale image dataset with sentence descriptions. In addition, we construct an evaluation dataset to directly assess the effectiveness of word embeddings in terms of finding semantically similar or related words and phrases. The word/phrase pairs in this evaluation dataset are collected from the click data with millions of users in an image search system, thus contain rich semantic relationships. Based on these datasets, we propose and compare several Recurrent Neural Networks (RNNs) based multimodal (text and image) models. Experiments show that our model benefits from incorporating the visual information into the word embeddings, and a weight sharing strategy is crucial for learning such multimodal embeddings. The project page is: http://www.stat.ucla.edu/~junhua.mao/multimodal_embedding.html (The datasets introduced in this work will be gradually released on the project page.).", "full_text": "Training and Evaluating Multimodal Word\n\nEmbeddings with Large-scale Web Annotated Images\n\nJunhua Mao1\n\nJiajing Xu2\n\n1University of California, Los Angeles\n3Johns Hopkins University\nmjhustc@ucla.edu, {jiajing,jing}@pinterest.com, alan.l.yuille@gmail.com\n\n2Pinterest Inc.\n\nYushi Jing2\n\nAlan Yuille1,3\n\nAbstract\n\nIn this paper, we focus on training and evaluating effective word embeddings with\nboth text and visual information. More speci\ufb01cally, we introduce a large-scale\ndataset with 300 million sentences describing over 40 million images crawled and\ndownloaded from publicly available Pins (i.e. an image with sentence descriptions\nuploaded by users) on Pinterest [2]. This dataset is more than 200 times larger than\nMS COCO [22], the standard large-scale image dataset with sentence descriptions.\nIn addition, we construct an evaluation dataset to directly assess the effectiveness\nof word embeddings in terms of \ufb01nding semantically similar or related words\nand phrases. The word/phrase pairs in this evaluation dataset are collected from\nthe click data with millions of users in an image search system, thus contain\nrich semantic relationships. Based on these datasets, we propose and compare\nseveral Recurrent Neural Networks (RNNs) based multimodal (text and image)\nmodels. Experiments show that our model bene\ufb01ts from incorporating the visual\ninformation into the word embeddings, and a weight sharing strategy is crucial for\nlearning such multimodal embeddings. The project page is: http://www.stat.\nucla.edu/~junhua.mao/multimodal_embedding.html1.\n\nIntroduction\n\n1\nWord embeddings are dense vector representations of words with semantic and relational information.\nIn this vector space, semantically related or similar words should be close to each other. A large-scale\ntraining dataset with billions of words is crucial to train effective word embedding models. The\ntrained word embeddings are very useful in various tasks and real-world applications that involve\nsearching for semantically similar or related words and phrases.\nA large proportion of the state-of-the-art word embedding models are trained on pure text data only.\nSince one of the most important functions of language is to describe the visual world, we argue that\nthe effective word embeddings should contain rich visual semantics. Previous work has shown that\nvisual information is important for training effective embedding models. However, due to the lack\nof large training datasets of the same scale as the pure text dataset, the models are either trained on\nrelatively small datasets (e.g. [13]), or the visual contraints are only applied to limited number of\npre-de\ufb01ned visual concepts (e.g. [21]). Therefore, such work did not fully explore the potential of\nvisual information in learning word embeddings.\nIn this paper, we introduce a large-scale dataset with both text descriptions and images, crawled and\ncollected from Pinterest, one of the largest database of annotated web images. On Pinterest, users\nsave web images onto their boards (i.e. image collectors) and supply their descriptions of the images.\nMore descriptions are collected when the same images are saved and commented by other users.\nCompared to MS COCO (i.e. the image benchmark with sentences descriptions [22]), our dataset is\nmuch larger (40 million images with 300 million sentences compared to 0.2 million images and 1\nmillion sentences in the current release of MS COCO) and is at the same scale as the standard pure\n\n1The datasets introduced in this work will be gradually released on the project page.\n\n30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain.\n\n\ftext training datasets (e.g. Wikipedia Text Corpus). Some sample images and their descriptions are\nshown in Figure 1 in Section 3.1. We believe training on this large-scale dataset will lead to richer\nand better generalized models. We denote this dataset as the Pinterest40M dataset.\nOne challenge for word embeddings learning is how to directly evaluate the quality of the model\nwith respect to the tasks (e.g. the task of \ufb01nding related or similar words and phrases). State-of-\nthe-art neural language models often use the negative log-likelihood of the predicted words as their\ntraining loss, which is not always correlated with the effectiveness of the learned embedding. Current\nevaluation datasets (e.g. [5, 14, 11]) for word similarity or relatedness contain only less than a\nthousand word pairs and cannot comprehensively evaluate all the embeddings of the words appearing\nin the training set.\nThe challenge of constructing large-scale evaluation datasets is partly due to the dif\ufb01culty of \ufb01nding a\nlarge number of semantically similar or related word/phrase pairs. In this paper, we utilize user click\ninformation collected from Pinterest\u2019s image search system to generate millions of these candidate\nword/phrase pairs. Because user click data are somewhat noisy, we removed inaccurate entries in\nthe dataset by using crowdsourcing human annotations. This led to a \ufb01nal gold standard evaluation\ndataset consists of 10,674 entries.\nEquipped with these datasets, we propose, train and evaluate several Recurrent Neural Network (RNN\n[10]) based models with input of both text descriptions and images. Some of these models directly\nminimize the Euclidean distance between the visual features and the word embeddings or RNN states,\nsimilar to previous work (e.g. [13, 21]). The best performing model is inspired by recent image\ncaptioning models [9, 24, 36], with the additional weight-sharing strategy originally proposed in [23]\nto learn novel visual concepts. This strategy imposes soft constraints between the visual features and\nall the related words in the sentences. Our experiments validate the effectiveness and importance of\nincorporating visual information into the learned word embeddings.\nWe make three major contributions: Firstly, we constructed a large-scale multimodal dataset with both\ntext descriptions and images, which is at the same scale as the pure text training set. Secondly, we\ncollected and labeled a large-scale evaluation dataset for word and phrase similarity and relatedness\nevaluation. Finally, we proposed and compared several RNN based models for learning multimodal\nword embeddings effectively. To facilitate research in this area, we will gradually release the datasets\nproposed in this paper on our project page.\n\n2 Related Work\nImage-Sentence Description Datasets The image descriptions datasets, such as Flickr8K [15],\nFlickr30K [37], IAPR-TC12 [12], and MS COCO [22], greatly facilitated the development of models\nfor language and vision tasks such as image captioning. Because it takes lots of resources to label\nimages with sentences descriptions, the scale of these datasets are relatively small (MS COCO, the\nlargest dataset among them, only contains 1 million sentences while our Pinterest40M dataset has 300\nmillion sentences). In addition, the language used to describe images in these datasets is relatively\nsimple (e.g. MS COCO only has around 10,000 unique words appearing at least 3 times while there\nare 335,323 unique words appearing at least 50 times in Pinterest40M). The Im2Text dataset proposed\nin [28] adopts a similar data collection process to ours by using 1 million images with 1 million user\nannotated captions from Flickr. But its scale is still much smaller than our Pinterest40M dataset.\nRecently, [34] proposed and released the YFCC100M dataset, which is a large-scale multimedia\ndataset contains metadata of 100 million Flickr images. It provides rich information about images,\nsuch as tags, titles, and locations where they were taken. The users\u2019 comments can be obtained\nby querying the Flickr API. Because of the different functionality and user groups between Flickr\nand Pinterest, the users\u2019 comments of Flickr images are quite different from those of Pinterest\n(e.g. on Flickr, users tend to comment more on the photography techniques). This dataset provides\ncomplementary information to our Pinterest40M dataset.\nWord Similarity-Relatedness Evaluation The standard benchmarks, such as WordSim-353/WS-\nSim [11, 3], MEN [5], and SimLex-999 [14], consist of a couple hundreds of word pairs and their\nsimilarity or relatedness scores. The word pairs are composed by asking human subjects to write\nthe \ufb01rst related, or similar, word that comes into their mind when presented with a concept word\n(e.g. [27, 11]), or by randomly selecting frequent words in large text corpus and manually searching\nfor useful pairs (e.g. [5]). In this work, we are able to collect a large number of word/phrase pairs\n\n2\n\n\fFigure 1: Sample images and their sample descriptions collected from Pinterest.\n\nwith good quality by mining them from the click data of Pinterest\u2019s image search system used by\nmillions of users. In addition, because this dataset is collected through a visual search system, it is\nmore suitable to evaluate multimodal embedding models. Another related evaluation is the analogy\ntask proposed in [25]. They ask the model questions like \u201cman to woman is equal king to what?\u201d as\ntheir evaluation. But such questions do not directly measure the word similarity or relatedness, and\ncannot cover all the semantic relationships of million of words in the dictionary.\nRNN for Language and Vision Our models are inspired by recent RNN-CNN based image cap-\ntioning models [9, 24, 36, 16, 6, 18, 23], which can be viewed as a special case of the sequence-to-\nsequence learning framework [33, 7]. We adopt Gated Recurrent Units (GRUs [7]), a variation of the\nsimple RNN model.\nMultimodal Word Embedding Models For pure text, one of the most effective approaches to learn\nword embeddings is to train neural network models to predict a word given its context words in\na sentence (i.e. the continuous bag-of-word model [4]) or to predict the context words given the\ncurrent word (i.e. the skip-gram model [25]). There is a large literature on word embedding models\nthat utilize visual information. One type of methods takes a two-step strategy that \ufb01rst extracts text\nand image features separately and then fuses them together using singular value decomposition [5],\nstacked autoencoders [31], or even simple concatenation [17]. [13, 21, 19] learn the text and image\nfeatures jointly by fusing visual or perceptual information in a skip-gram model [25]. However,\nbecause of the lack of large-scale multimodal datasets, they only associate visual content with a\npre-de\ufb01ned set of nouns (e.g. [21]) or perception domains (e.g. [14]) in the sentences, or focus on\nabstract scenes (e.g. [19]). By contrast, our best performing model places a soft constraint between\nvisual features and all the words in the sentences by a weight sharing strategy as shown in Section 4.\n\n3 Datasets\nWe constructed two datasets: one for training our multimodal word-embeddings (see Section 3.1)\nand another one for the evaluation of the learned word-embeddings (see Section 3.2).\n\nTable 1: Scale comparison with other image\ndescriptions benchmarks.\n\n3.1 Training Dataset\nPinterest is one of the largest repository of Web images.\nUsers commonly tag images with short descriptions and\nshare the images (and desriptions) with others. Since\na given image can be shared and tagged by multiple,\nsometimes thousands of users, many images have a very\nrich set of descriptions, making this source of data ideal\nfor training model with both text and image inputs.\nThe dataset is prepared in the following way: \ufb01rst,\nwe crawled the public available data on Pinterest to\nconstruct our training dataset of more than 40 million\nimages. Each image is associated with an average of 12 sentences, and we removed duplicated or\nshort sentences with less than 4 words. The duplication detection is conducted by calculating the\n\nFlickr8K [15]\nFlickr30K [37]\nIAPR-TC12 [12]\nMS COCO [22]\nIm2Text [28]\nPinterset40M\n\nImage\n\nSentences\n\n8K\n30K\n20K\n200K\n1M\n40M\n\n40K\n150K\n34K\n1M\n1M\n300M\n\n3\n\nThis strawberry limeade cake is fruity, refreshing, and gorgeous! Those lovely layers are impossible to resist. Make two small fishtail braids on each side, then put them together with a ponytail. White and gold ornate library with decorated ceiling, iron-work balcony, crystal chandelier, and glass-covered shelves. (I don't know if you're allowed to read a beat-up paperback in this room.) This is the place I will be going (hopefully) on my first date with Prince Stephen. It's the palace gardens, and they are gorgeous. I cannot wait to get to know him and exchange photography ideas! This flopsy-wopsy who just wants a break from his walk. | 18 German Shepherd Puppies Who Need To Be Snuggled Immediately \fFigure 2: The illustration of the positive word/phrase pairs generation. We calculate a score for each\nannotation (i.e. a short phrase describes the items) by aggregating the click frequency of the items to\nwhich it belongs and rank them according to the score. The \ufb01nal list of positive phrases are generated\nfrom the top ranked phrases after removing phrases containing overlapping words with the user query\nphrase. See text for details.\n\noverlapped word unigram ratios. Some sample images and descriptions are shown in Figure 1. We\ndenote this dataset as the Pinterest40M dataset.\nOur dataset contains 40 million images with 300 million sentences (around 3 billion words), which\nis much larger than the previous image description datasets (see Table 1). In addition, because the\ndescriptions are annotated by users who expressed interest in the images, the descriptions in our\ndataset are more natural and richer than the annotated image description datasets. In our dataset,\nthere are 335,323 unique words with a minimum number of occurence of 50, compared with 10,232\nand 65,552 words appearing at least 3 times in MS COCO and IM2Text dataset respectively. To the\nbest of our knowledge, there is no previous paper that trains a multimodal RNN model on a dataset of\nsuch scale.\n\n3.2 Evaluation Datasets\nThis work proposes to use labeled phrase triplets \u2013 each triplet is a three-phrase tuple containing\nphrase A, phrase B and phrase C, where A is considered as semantically closer to B than A is to\nC. At testing time, we compute the distance in the word embedding space between A/B and A/C,\nand consider a test triplet as positive if d(A, B) < d(A, C). This relative comparison approach was\ncommonly used to evaluate and compare different word embedding models [30].\nIn order to generate large number of phrase triplets, we rely on user-click data collected from Pinterest\nimage search system. At the end, we construct a large-scale evaluation dataset with 9.8 million\ntriplets (see Section 3.2.1), and its cleaned up gold standard version with 10 thousand triplets (see\nSection 3.2.2).\n\n3.2.1 The Raw Evaluation Dataset from User Clickthrough Data\nIt is very hard to obtain a large number of semantically similar or related word and phrase pairs.\nThis is one of the challenges for constructing a large-scale word/phrase similarity and relatedness\nevaluation dataset. We address this challenge by utilizing the user clickthrough data from Pinterest\nimage search system, see Figure 2 for an illustration.\nMore speci\ufb01cally, given a query from a user (e.g. \u201chair styles\u201d), the search system returns a list of\nitems, and each item is composed of an image and a set of annotations (i.e. short phrases or words\nthat describe the item). Please note that the same annotation can appear in multiple items, e.g., \u201chair\ntutorial\u201d can describe items related to prom hair styles or ponytails. We derive a matching score\nfor each annotation by aggregating the click frequency of the items containing the annotation. The\nannotations are then ranked according to the matching scores, and the top ranked annotations are\nconsidered as the positive set of phrases or words with respect to the user query.\nTo increase the dif\ufb01culty of this dataset, we remove the phrases that share common words with the\nuser query from the initial list of positive phrases. E.g. \u201chair tutorials\u201d will be removed because the\nword \u201chair\u201d is contained in the query phrase \u201chair styles\u201d. A stemmer in Python\u2019s \u201cstemmer\u201d package\nis also adopted to \ufb01nd words with the same root (e.g. \u201ccake\u201d and \u201ccakes\u201d are considered as the same\nword). This pruning step also prevents giving bias to methods which measure the similarity between\nthe positive phrase and the query phrase by counting the number of overlapping words between them.\nIn this way, we collected 9,778,508 semantically similar phrase pairs.\n\n4\n\nUser Query hair styles Most Clicked Items Annotations: hair tutorial prom night ideas long hair beautiful \u2026 Annotations: pony tails unique hairstyles hair tutorial picture inspiration \u2026 \u2026 Positive Phrases for the Query hair tutorial pony tails makeup \u2026 inspiration ideas Remove overlapping words pony tails makeup \u2026 Sorted by Click Final List \fTable 2: Sample triplets from the Gold RP10K dataset.\n\nPositive Phrase\n\nNegative Phrase\n\nBase Phrase\nhair style\n\nsummer lunch\noil painting ideas\n\nla multi ani birthdays\n\nteach activities\n\nkarting\n\nlooking down\nblack ceiling\n\nnew marriage quotes\nsexy scientist costume\n\nframing a mirror\n\nponytail\n\nsalads sides\n\nart tips\nwishes\npreschool\ngo carts\nthe view\nhome ideas\ntrue love\n\nlabs\n\npink nail\n\npackaging bottle\n\nsnickerdoodle muf\ufb01ns\n\ntandoori\n\nrental house ideas\nof\ufb01ce waiting area\n\nsoft curls for medium hair\n\npaleo potluck\n\nwinter travel packing\npersonal word wall\n\ndecorating bathroom celebrity style inspiration\n\nPrevious word similarity/relatedness datasets (e.g. [11, 14]) manually annotated each word pair with\nan absolute score re\ufb02ecting how much the words in this pair are semantically related. In the testing\nstage, a predicted similarity score list of the word pairs generated by the model in the dataset is\ncompared with the groundtruth score list. The Spearman\u2019s rank correlation between the two lists is\ncalculated as the score of the model. However, it is often too hard and expensive to label the absolute\nrelated score and maintain the consistency across all the pairs in a large-scale dataset, even if we\naverage the scores of several annotators.\nWe adopt a simple strategy by composing triplets for the phrase pairs. More speci\ufb01cally, we randomly\nsample negative phrases from a pool of 1 billion phrases. The negative phrase should not contain any\noverlapping word (a stemmer is also adopted) with both of the phrases in the original phrase pair. In\nthis way, we construct 9,778,508 triplets with the format of (base phrase, positive phrase, negative\nphrase). In the evaluation, a model should be able to distinguish the positive phrase from the negative\nphrase by calculating their similarities with the base phrase in the embedding space. We denote this\ndataset as Related Phrase 10M (RP10M) dataset.\n3.2.2 The Cleaned-up Gold Standard Dataset\nBecause the raw Related Query 10M dataset is built upon user click information, it contains some\nnoisy triplets (e.g. the positive and base phrase are not related, or the negative phrase is strongly\nrelated to the base phrase). To create a gold standard dataset, we conduct a clean up step using the\ncrowdsourcing platform CrowdFlower [1] to remove these inaccurate triplets. A sample question and\nchoices for the crowdsourcing annotators are shown in Figure 3. The positive and negative phrases in\na triplet are randomly given as choice \u201cA\u201d or \u201cB\u201d. The annotators are required to choose which phrase\nis more related to the base phrase, or if they are both related or unrelated. To help the annotators\nunderstand the meaning of the phrases, they can click on the phrases to get Google search results.\nWe annotate 21,000 triplets randomly sampled from the raw Related Query 10M dataset. Three to\n\ufb01ve annotators are assigned to each question. A triplet is accepted and added in the \ufb01nal cleaned\nup dataset only if more than 50% of the annotators agree with the original positive and negative\nlabel of the queries (note that they do not know which one is positive in the annotation process). In\npractice, 70% of the selected phrases triplets have more than 3 annotators to agree. This leads to a\ngold standard dataset with 10,674 triplets. We denote this dataset as Gold Phrase Query 10K (Gold\nRP10K) dataset.\n\nFigure 3: The interface for the annotators. They are required to choose which phrase (positive and\nnegative phrases will be randomly labeled as \u201cA\u201d or \u201cB\u201d) is more related to base phrase. They can\nclick on the phrases to see Google search results.\n\n5\n\n\fFigure 4: The illustration of the structures of our model A, B, and C. We use a CNN to extract visual\nrepresentations and use a RNN to model sentences. The numbers on the bottom right corner of\nthe layers indicate their dimensions. We use a sampled softmax layer with 1024 negative words to\naccelerate the training. Model A, B, and C differ from each other by the way that we fuse the visual\nrepresentation into the RNN. See text for more details.\n\nThis dataset is very challenging and a successfully model should be able to capture a variety of\nsemantic relationships between words or phrases. Some sample triplets are shown in Table 2.\n4 The Multimodal Word Embedding Models\nWe propose three RNN-CNN based models to learn the multimodal word embeddings, as illustrated in\nFigure 4. All of the models have two parts in common: a Convolutional Neural Network (CNN [20])\nto extract visual representations and a Recurrent Neural Network (RNN [10]) to model sentences.\nFor the CNN part, we resize the images to 224 \u00d7 224, and adopt the 16-layer VGGNet [32] as the\nvisual feature extractor. The binarized activation (i.e. 4096 binary vectors) of the layer before its\nSoftMax layer are used as the image features and will be mapped to the same space of the state of\nRNN (Model A, B) or the word embeddings (Model C), depends on the structure of the model, by a\nfully connected layer and a Recti\ufb01ed Linear Unit function (ReLU [26], ReLU(x) = max(0, x)).\nFor the RNN part, we use a Gated Recurrent Unit (GRU [7]), an recently very popular RNN structure,\nwith a 512 dimensional state cell. The state of GRU ht for each word with index t in a sentence can\nbe represented as:\n\nrt = \u03c3(Wr[et, ht\u22121] + br)\nut = \u03c3(Wu[et, ht\u22121] + bu)\n\nct = tanh(Wc[et, rt (cid:12) ht\u22121] + bc)\nht = ut (cid:12) ht\u22121 + (1 \u2212 ut) (cid:12) ct\n\n(1)\n(2)\n(3)\n(4)\nwhere (cid:12) represents the element-wise product, \u03c3(.) is the sigmoid function, et denotes the word\nembedding for the word wt, rt and ut are the reset gate and update gate respectively. The inputs of\nthe GRU are words in a sentence and it is trained to predict the next words given the previous words.\nWe add all the words that appear more than 50 times in the Pinterest40M dataset into the dictionary.\nThe \ufb01nal vocabulary size is 335,323. Because the vocabulary size is very huge, we adopt the sampled\nSoftMax loss [8] to accelerate the training. For each training step, we sample 1024 negative words\naccording to their log frequency in the training data and calculate the sampled SoftMax loss for the\npositive word. This sampled SoftMax loss function of the RNN part is adopted with Model A, B and\nC. Minimizing this loss function can be considered as approximately maximizing the probability of\nthe sentences in the training set.\nAs illustrated in Figure 4, Model A, B and C have different ways to fuse the visual information in the\nword embeddings. Model A is inspired by the CNN-RNN based image captioning models [36, 23].\nWe map the visual representation in the same space as the GRU states to initialize them (i.e. set\nh0 = ReLU(WI fI )). Since the visual information is fed after the embedding layer, it is usually hard\nto ensure that this information is fused in the learned embeddings. We adopt a transposed weight\nsharing strategy proposed in [23] that was originally used to enhance the models\u2019 ability to learn novel\nvisual concepts. More speci\ufb01cally, we share the weight matrix of the SoftMax layer UM with the\nmatrix Uw of the word embedding layer in a transposed manner. In this way, U T\nw is learned to decode\nthe visual information and is enforced to incorporate this information into the word embedding matrix\n\n6\n\nImage CNN UW UWT One Hot Embedding (128) wt GRU (512) FC (128) Sampled SoftMax wt+1 Model A Set Image CNN Supervision on the final state Model B Image CNN Supervision Model C \fTable 3: Performance comparison of our Model A, B, C, their variants and a state-of-the-art skip-gram\nmodel [25] trained on Google News dataset with 300 billion words.\n\nPure text RNN\nModel A without weight sharing\nModel A (weight shared multimodal RNN)\nModel B (direct visual supervisions on the \ufb01nal RNN state)\nModel C (direct visual supervisions on the embeddings)\nWord2Vec-GoogleNews [25]\nGloVe-Twitter [29]\n\nGold RP10K RP10M dim\n128\n128\n128\n128\n128\n300\n200\n\n0.748\n0.773\n0.843\n0.705\n0.771\n0.716\n0.693\n\n0.633\n0.681\n0.725\n0.646\n0.687\n0.596\n0.617\n\nUw. In the experiments, we show that this strategy signi\ufb01cantly improve the performance of the\ntrained embeddings. Model A is trained by maximizing the log likelihood of the next words given the\nprevious words conditioned on the visual representations, similar to the image captioning models.\nCompared to Model A, we adopt a more direct way to utilize the visual information for Model B and\nModel C. We add direct supervisions of the \ufb01nal state of the GRU (Model B) or the word embeddings\n(Model C), by adding new loss terms, in addition to the negative log-likelihood loss from the sampled\nSoftMax layer:\n\n(5)\n\n(6)\n\n(cid:88)\n(cid:107) hls \u2212 ReLU(WI fIs) (cid:107)\n(cid:88)\n(cid:88)\n\n(cid:107) et \u2212 ReLU(WI fIs) (cid:107)\n\n1\nn\n\ns\n1\nls\n\ns\n\nt\n\nLstate =\n\nLemb =\n\n1\nn\n\nwhere ls is the length of the sentence s in a mini-batch with n sentences, Eqn. 5 and Eqn. 6 denote\nthe additional losses for model B and C respectively. The added loss term is balanced by a weight\nhyperparameter \u03bb with the negative log-likehood loss from the sampled SoftMax layer.\n5 Experiments\n5.1 Training Details\nWe convert the words in all sentences of the Pinterest40M dataset to lower cases. All the non-\nalphanumeric characters are removed. A start sign (cid:104)bos(cid:105) and an end sign (cid:104)eos(cid:105) are added at the\nbeginning and the end of all the sentences respectively.\nWe use the stochastic gradient descent method with a mini-batch size of 256 sentences and a learning\nrate of 1.0. The gradient is clipped to 10.0. We train the models until the loss does not decrease on a\nsmall validation set with 10,000 images and their descriptions. The models will scan the dataset for\nroughly \ufb01ve 5 epochs. The bias terms of the gates (i.e. br and bu in Eqn. 1 and 2) in the GRU layer\nare initialized to 1.0.\n\n5.2 Evaluation Details\nWe use the trained embedding models to extract embeddings for all the words in a phrase and\naggregate them by average pooling to get the phrase representation. We then check whether the\ncosine distance between the (base phrase, positive phrase) pair are smaller than the (base phrase,\nnegative phrase) pair. The average precision over all the triplets in the raw Related Phrases 10M\n(RP10M) dataset and the Gold standard Related Phrases 10K (Gold RP10K) dataset are reported.\n\n5.3 Results on the Gold RP10K and RP10M datasets\nWe evaluate and compare our Model A, B, C, their variants and several strong baselines on our\nRP10M and Gold RP10K datasets. The results are shown in Table 3. \u201cPure Text RNN\u201d denotes\nthe baseline model without input of the visual features trained on Pinterest40M. It have the same\nmodel structure as our Model A except that we initialize the hidden state of GRU with a zero vector.\n\u201cModel A without weight sharing\u201d denotes a variant of Model A where the weight matrix Uw of the\nword embedding layer is not shared with the weight matrix UM of the sampled SoftMax layer (see\nFigure 4 for details). 2 \u201cWord2Vec-GoogleNews\u201d denotes the state-of-the-art off-the-shelf word\n\n2We also try to adopt the weight sharing strategy in Model B and C, but the performance is very similar to\n\nthe non-weight sharing version.\n\n7\n\n\fembedding models of Word2Vec [25] trained on the Google-News data (about 300 billion words).\n\u201cGloVe-Twitter\u201d denotes the GloVe model [29] trained on the Twitter data (about 27 billion words).\nThey are pure text models, but trained on a very large dataset (our model only trains on 3 billion\nwords). Comparing these models, we can draw the following conclusions:\n\u2022 Under our evaluation criteria, visual information signi\ufb01cantly helps the learning of word embed-\ndings when the model successfully fuses the visual and text information together. E.g., our Model\nA outperforms the Word2Vec model by 9.5% and 9.2% on the Gold RP10K and RP10M datasets\nrespectively. Model C also outperforms the pure text RNN baselines.\n\u2022 The weight sharing strategy is crucial to enhance the ability of Model A to fuse visual information\ninto the learned embeddings. E.g., our Model A outperforms the baseline without this sharing\nstrategy by 7.0% and 4.4% on Gold RP10K and RP10M respectively.\n\u2022 Model A performs the best among all the three models. It shows that soft supervision imposed\nby the weight-sharing strategy is more effective than direct supervision. This is not surprising\nsince not all the words are semantically related to the content of the image and a direct and hard\nconstraint might hinder the learning of the embeddings for these words.\n\u2022 Model B does not perform very well. The reason might be that most of the sentences have more\nthan 8 words and the gradient from the \ufb01nal state loss term Lstate cannot be easily passed to the\nembedding of all the words in the sentence.\n\u2022 All the models trained on the Pinterest40M dataset performs better than the skip-gram model [25]\n\ntrained on a much larger dataset of 300 billion words.\n\n6 Discussion\nIn this paper, we investigate the task of training and evaluating word embedding models. We introduce\nPinterest40M, the largest image dataset with sentence descriptions to the best of our knowledge,\nand construct two evaluation dataset (i.e. RP10M and Gold RP10K) for word/phrase similarity and\nrelatedness evaluation. Based on these datasets, we propose several CNN-RNN based multimodal\nmodels to learn effective word embeddings. Experiments show that visual information signi\ufb01cantly\nhelps the training of word embeddings, and our proposed model successfully incorporates such\ninformation into the learned embeddings.\nThere are lots of possible extensions of the proposed model and the dataset. E.g., we plan to separate\nsemantically similar or related phrase pairs from the Gold RP10K dataset to better understand the\nperformance of the methods, similar to [3]. We will also give relatedness or similarity scores for\nthe pairs (base phrase, positive phrase) to enable same evaluation strategy as previous datasets (e.g.\n[5, 11]). Finally, we plan to propose better models for phrase representations.\nAcknowledgement We are grateful to James Rubinstein for setting up the crowdsourcing experiments\nfor dataset cleanup. We thank Veronica Mapes, Pawel Garbacki, and Leon Wong for discussions\nand support. We appreciate the comments and suggestions from anonymous reviewers of NIPS\n2016. This work is partly supported by the Center for Brains, Minds and Machines NSF STC award\nCCF-1231216 and the Army Research Of\ufb01ce ARO 62250-CS.\n\nFigure 5: t-SNE [35] visualization of the 500 most frequent words learned by our Model A.\n\n8\n\n\fReferences\n[1] The crowd\ufb02ower platform. https://www.crowdflower.com/.\n[2] Pinterest. https://www.pinterest.com/.\n[3] E. Agirre, E. Alfonseca, K. Hall, J. Kravalova, M. Pa\u00b8sca, and A. Soroa. A study on similarity and relatedness\n\nusing distributional and wordnet-based approaches. In NAACL HLT, pages 19\u201327, 2009.\n\n[4] Y. Bengio, H. Schwenk, J.-S. Sen\u00e9cal, F. Morin, and J.-L. Gauvain. Neural probabilistic language models. In\n\nInnovations in Machine Learning, pages 137\u2013186. Springer, 2006.\n\n[5] E. Bruni, N.-K. Tran, and M. Baroni. Multimodal distributional semantics. JAIR, 49(1-47), 2014.\n[6] X. Chen and C. L. Zitnick. Learning a recurrent visual representation for image caption generation. arXiv\n\npreprint arXiv:1411.5654, 2014.\n\n[7] K. Cho, B. Van Merri\u00ebnboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learn-\ning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint\narXiv:1406.1078, 2014.\n\n[8] S. J. K. Cho, R. Memisevic, and Y. Bengio. On using very large target vocabulary for neural machine\n\ntranslation. In ACL, 2015.\n\n[9] J. Donahue, L. Anne Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, K. Saenko, and T. Darrell.\n\nLong-term recurrent convolutional networks for visual recognition and description. In CVPR, 2015.\n\n[10] J. L. Elman. Finding structure in time. Cognitive science, 14(2):179\u2013211, 1990.\n[11] L. Finkelstein, E. Gabrilovich, Y. Matias, E. Rivlin, Z. Solan, G. Wolfman, and E. Ruppin. Placing search in\n\ncontext: The concept revisited. In WWW, pages 406\u2013414. ACM, 2001.\n\n[12] M. Grubinger, P. Clough, H. M\u00fcller, and T. Deselaers. The iapr tc-12 benchmark: A new evaluation resource\n\nfor visual information systems. In International Workshop OntoImage, pages 13\u201323, 2006.\n\n[13] F. Hill and A. Korhonen. Learning abstract concept embeddings from multi-modal data: Since you probably\n\ncan\u2019t see what i mean. In EMNLP, pages 255\u2013265. Citeseer, 2014.\n\n[14] F. Hill, R. Reichart, and A. Korhonen. Simlex-999: Evaluating semantic models with (genuine) similarity\n\nestimation. Computational Linguistics, 2015.\n\n[15] M. Hodosh, P. Young, and J. Hockenmaier. Framing image description as a ranking task: Data, models and\n\nevaluation metrics. Journal of Arti\ufb01cial Intelligence Research, pages 853\u2013899, 2013.\n\n[16] A. Karpathy and L. Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In CVPR,\n\npages 3128\u20133137, 2015.\n\n[17] D. Kiela and L. Bottou. Learning image embeddings using convolutional neural networks for improved\n\nmulti-modal semantics. In EMNLP, pages 36\u201345. Citeseer, 2014.\n\n[18] R. Kiros, R. Salakhutdinov, and R. S. Zemel. Unifying visual-semantic embeddings with multimodal neural\n\nlanguage models. arXiv preprint arXiv:1411.2539, 2014.\n\n[19] S. Kottur, R. Vedantam, J. M. Moura, and D. Parikh. Visual word2vec (vis-w2v): Learning visually grounded\n\nword embeddings using abstract scenes. arXiv preprint arXiv:1511.07067, 2015.\n\n[20] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classi\ufb01cation with deep convolutional neural net-\n\n[21] A. Lazaridou, N. T. Pham, and M. Baroni. Combining language and vision with a multimodal skip-gram\n\nworks. In NIPS, pages 1097\u20131105, 2012.\n\nmodel. arXiv preprint arXiv:1501.02598, 2015.\n\n[22] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Doll\u00e1r, and C. L. Zitnick. Microsoft\n\ncoco: Common objects in context. In ECCV, pages 740\u2013755. Springer, 2014.\n\n[23] J. Mao, X. Wei, Y. Yang, J. Wang, Z. Huang, and A. L. Yuille. Learning like a child: Fast novel visual concept\n\nlearning from sentence descriptions of images. In ICCV, pages 2533\u20132541, 2015.\n\n[24] J. Mao, W. Xu, Y. Yang, J. Wang, Z. Huang, and A. Yuille. Deep captioning with multimodal recurrent neural\n\nnetworks (m-rnn). In ICLR, 2015.\n\n[25] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed representations of words and\n\nphrases and their compositionality. In NIPS, pages 3111\u20133119, 2013.\n\n[26] V. Nair and G. E. Hinton. Recti\ufb01ed linear units improve restricted boltzmann machines. In Proceedings of\n\nthe 27th International Conference on Machine Learning (ICML-10), pages 807\u2013814, 2010.\n\n[27] D. L. Nelson, C. L. McEvoy, and T. A. Schreiber. The university of south \ufb02orida free association, rhyme, and\n\nword fragment norms. Behavior Research Methods, Instruments, & Computers, 36(3):402\u2013407, 2004.\n\n[28] V. Ordonez, G. Kulkarni, and T. L. Berg. Im2text: Describing images using 1 million captioned photographs.\n\nIn Advances in Neural Information Processing Systems, pages 1143\u20131151, 2011.\n\n[29] J. Pennington, R. Socher, and C. D. Manning. Glove: Global vectors for word representation. In EMNLP,\n\nvolume 14, pages 1532\u201343, 2014.\n\nIn EMNLP, pages 298\u2013307, 2015.\n\n[30] T. Schnabel, I. Labutov, D. Mimno, and T. Joachims. Evaluation methods for unsupervised word embeddings.\n\n[31] C. Silberer and M. Lapata. Learning grounded meaning representations with autoencoders. In ACL, pages\n\n721\u2013732, 2014.\n\nICLR, 2015.\n\n3104\u20133112, 2014.\n\n[32] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition.\n\nIn\n\n[33] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In NIPS, pages\n\n[34] B. Thomee, D. A. Shamma, G. Friedland, B. Elizalde, K. Ni, D. Poland, D. Borth, and L.-J. Li. Yfcc100m:\n\nThe new data in multimedia research. Communications of the ACM, 59(2):64\u201373, 2016.\n\n[35] L. Van der Maaten and G. Hinton. Visualizing data using t-sne. JMLR, 9(2579-2605):85, 2008.\n[36] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR,\n\npages 3156\u20133164, 2015.\n\n[37] P. Young, A. Lai, M. Hodosh, and J. Hockenmaier. From image descriptions to visual denotations: New\n\nsimilarity metrics for semantic inference over event descriptions. In ACL, pages 479\u2013488, 2014.\n\n9\n\n\f", "award": [], "sourceid": 253, "authors": [{"given_name": "Junhua", "family_name": "Mao", "institution": "UCLA"}, {"given_name": "Jiajing", "family_name": "Xu", "institution": "Pinterest"}, {"given_name": "Kevin", "family_name": "Jing", "institution": "Pinterest"}, {"given_name": "Alan", "family_name": "Yuille", "institution": "UCLA"}]}