Effective Multi Modal Retrieval based on Stacked Auto Encoders
←
→
Page content transcription
If your browser does not render page correctly, please read the page content below
Effective Multi-Modal Retrieval based on Stacked Auto-Encoders Wei Wang† , Beng Chin Ooi† , Xiaoyan Yang‡ , Dongxiang Zhang† , Yueting Zhuang§ †School of Computing, National University of Singapore, Singapore ‡Advanced Digital Sciences Center, Illinois at Singapore Pte, Singapore §College of Computer Science, Zhejiang University, China †{wangwei, ooibc, zhangdo}@comp.nus.edu.sg, ‡xiaoyan.yang@adsc.com.sg, §yzhuang@zju.edu.cn ABSTRACT Big Data that can be exploited for insights and contextual observa- Multi-modal retrieval is emerging as a new search paradigm that tions. However, effective retrieval of such huge amounts of media enables seamless information retrieval from various types of me- data from heterogeneous sources remains a big challenge. dia. For example, users can simply snap a movie poster to search In this paper, we study the problem of large-scale information relevant reviews and trailers. To solve the problem, a set of map- retrieval from multiple modalities. Each modality represents one ping functions are learned to project high-dimensional features ex- type of multimedia, such as text, image or video, and depending tracted from data of different media types into a common low- on the heterogeneity of data sources, we can have two following dimensional space so that metric distance measures can be applied. searches: In this paper, we propose an effective mapping mechanism based 1. Intra-modal search has been extensively studied and widely on deep learning (i.e., stacked auto-encoders) for multi-modal re- used in commercial systems. Examples include web docu- trieval. Mapping functions are learned by optimizing a new ob- ment retrieval via keyword queries and content-based image jective function, which captures both intra-modal and inter-modal retrieval. semantic relationships of data from heterogeneous sources effec- tively. Compared with previous works which require a substan- 2. Cross-modal search enables users to explore more relevant tial amount of prior knowledge such as similarity matrices of intra- resources from different modalities. For example, a user can modal data and ranking examples, our method requires little prior use a tweet to retrieve relevant photos and videos from other knowledge. Given a large training dataset, we split it into mini- heterogeneous data sources, or search relevant textual de- batches and continually adjust the mapping functions for each batch scriptions or videos by submitting an interesting image as of input. Hence, our method is memory efficient with respect to the a query. data volume. Experiments on three real datasets illustrate that our proposed method achieves significant improvement in search accu- There has been a long stream of research on multi-modal re- racy over the state-of-the-art methods. trieval [27, 1, 15, 9, 25, 12, 26, 20]. These works share a sim- ilar query processing strategy which consists of two major steps. 1. INTRODUCTION First, they learn a set of mapping functions to project the high- dimensional features from different modalities into a common low- The prevalence of social networking has significantly increased dimensional latent space. Second, a multi-dimensional index for the volume and velocity of information shared on the Internet. A each modality in the metric space is built for efficient similarity tremendous amount of data in various media types is being gener- retrieval. Since the second step is a classic kNN problem and has ated every day in the social networking systems, and images and been extensively studied [6, 23], we shall focus on the optimiza- video contribute the main bulk of the data. For instance, Twit- tion of the first step and propose a novel learning algorithm to find ter recently reported that over 340 million tweets were sent each effective mapping functions. day1 , while Facebook reported around 300 million photos were We observe that most existing works, such as CVH [9], IMH [20], created each day2 . These data, together with other domain spe- MLBE [25], CMSSH [1], and LSCMR [12], require a substantial cific data, such as medical data, surveillance and sensory data, are amount of prior knowledge about the training data to learn effec- 1 https://blog.twitter.com/2012/twitter-turns-six tive mapping functions. Preparing prior knowledge in terms of 2 http://techcrunch.com/2012/08/22/how-big-is-facebooks-data-2- large training dataset is labor-intensive, and due to manual inter- 5-billion-pieces-of-content-and-500-terabytes-ingested-every-day/ vention, the prepared knowledge may not be comprehensive in cap- turing the regularities (e.g., distribution or similarity relationships) of data. For example, MLBE and IMH require the similarity matrix of intra-modal data (one for each modality). It is usually collected by retrieving k (set by humans) nearest neighbors of every object in the original high-dimensional space and setting the correspond- ing entries in the similarity matrix as 1 (other entries as 0). Each training input of LSCMR is a ranking example, i.e., a list of objects ranked based on their relevance to the first one. Ranking examples are generated based on the labels of objects, which have to be cre- ated manually. CMSSH requires irrelevant inter-modal data pairs 1
Latent Layer that are also not available directly in most cases. In addition, many ... 1 existing works (e.g., CVH, CMSSH, LCMH, IMH) have to load the Encoder Decoder whole training dataset into memory which becomes the bottleneck of training when the training dataset is too large to fit in memory. 1, 1 2, 2 To tackle the above issues, we propose a new mapping mech- anism for multi-modal retrieval. Our mapping mechanism, called 0 ... ... 2 Multi-modal Stacked Auto-Encoders (MSAE), builds one Stacked Input Layer Reconstruction Layer auto-encoders (SAE) [22] for each modality and projects features from different media types into a common latent space. The stacked Figure 1: Auto-Encoder auto-encoders is a form of deep learning and has been success- fully used in many unsupervised feature learning and classification tasks [16, 22, 4, 19]. The proposed MSAE has several advantages 2. PRELIMINARY over existing approaches. First, the stacked structure of MSAE ren- ders our mapping method (which is non-linear) more expressive 2.1 Problem Statements than linear projections used in previous studies, such as CVH and In our data model, the database D consists of objects from mul- LCMH. Second, compared with existing solutions, our method re- tiple modalities. For ease of presentation, we use images and text quires minimum amount of prior knowledge of the training data. Simple relevant pairs, e.g., images and their associated tags, are S modalities to explain our idea, i.e., we assume that D = as two DI DT , even though our proposal is general enough to support used as learning inputs. Third, the memory usage of our learning any number of domains. Formally, an image is said to be relevant algorithm is independent of the training dataset size, and can be set to a text document (e.g., a set of tags) if their semantic distance is to a constant. small. Since there is no widely accepted measure to calculate the For effective multi-modal retrieval, we need to learn a set of pa- distance between an image and text, a common approach is to map rameters in the MSAE such that the mapped latent features capture images and text into the same latent space in which the two types both inter-modal semantics and intra-modal semantics well. We of objects are comparable. design an objective function which takes the two requirements into consideration: the inter-modal semantics is preserved by minimiz- D EFINITION 1. Common Latent Space Mapping ing the distance of semantic relevant inter-modal pairs in the latent Given an image feature vector x ∈ DI and a text feature vector y ∈ space; the intra-modal semantics is captured by minimizing the re- DT , find two mapping functions fI : DI → Z and fT : DT → Z construction error (which will be discussed in detail in Section 2.2) such that if x and y are semantically relevant, the distance between of the SAE for each modality. By minimizing the reconstruction fI (x) and fT (y), denoted by dist(fI (x), fT (y)), is small in the error, SAEs preserve the regularities (e.g., distribution) of the orig- common latent space Z. inal features so that if the original features capture the semantics The common latent space mapping provides a unified approach of data well, so do the latent features. When the original features to measuring distance of objects from different modalities. As long of one modality are of low quality and cannot capture the intra- as all objects can be mapped into the same latent space, they be- modal semantics, we decrease its weight of reconstruction error come comparable. If the mapping functions fI and fT have been in the objective function. The intuition is that their intra-modal determined, the multi-modal search can then be transformed into semantics can be preserved or even enhanced through inter-modal the classic kNN problem, defined as following: relationships with other modalities whose features are of high qual- ity. Experiment results show that the latent features generated from D EFINITION 2. Multi-Modal Search our mapping mechanism are more effective than those generated Given a query object Q ∈ Dq (q ∈ {I, T }) and a target do- by existing methods for multi-modal retrieval. main Dt ⊂ D (t ∈ {I, T }), find a set O ⊂ Dt with k ob- The main contributions of this paper are: jects such that ∀o ∈ O and o′ ∈ Dt /O, dist(fq (Q), ft (o′ )) ≥ dist(fq (Q), ft (o)). • We propose a novel mapping mechanism based on stacked auto-encoders to project high-dimensional feature vectors for Since both q and t have two choices, four types of queries can data from different modalities into a common low-dimensional be derived, namely Qq→t and q, t ∈ {I, T }. For instance, QI→T latent space, which enables effective and efficient multi-modal searches relevant text (e.g., tags) in DT given an image from DI . retrieval. By mapping objects from high-dimensional feature space into low- dimensional latent space, queries can be efficiently processed using • We design a new learning objective function which takes existing multi-dimensional indexes [6, 23]. Our goal is then to learn both intra-modal and inter-modal semantics into considera- a set of effective mapping functions which preserve well both intra- tion, and thus generates effective mapping functions. modal semantics (i.e., semantic relationships within each modal- ity) and inter-modal semantics (i.e., semantic relationships across • We conduct extensive experiments on three real datasets to modalities) in the latent space. The effectiveness is measured by evaluate our proposed mapping mechanism. Experimental the accuracy of multi-modal retrieval using latent features. results show that the performance of our method is superior to state-of-art methods. 2.2 Auto-encoder Auto-encoder and its variants have been widely used in unsu- The remaining of the paper is organized as follows. Problem pervised feature learning and classification tasks [16, 22, 4, 19]. It statements and some backgrounds are provided in Section 2. After can be seen as a special neural network with three layers – the input that, we describe the algorithm for training our mapping method layer, the latent layer, and the reconstruction layer (as shown in Fig- in Section 3. Query processing is described in Section 4. Related ure 1). An auto-encoder contains two parts: (1) The encoder maps works are discussed in Section 5. Finally we report our experiments an input x0 ∈ Rd0 to the latent representation (feature) x1 ∈ Rd1 in Section 6. via a deterministic mapping fe : 2
Test Images Image Query x1 = fe (x0 ) = se (W1T x0 + b1 ) (1) Image SAE QI->I where se is the activation function of the encoder, whose input is QI->T called the activation of the latent layer, and {W1 , b1 } is the pa- MSAE Indexed Latent Training feature vectors rameter set with a weight matrix W1 ∈ Rd0 ×d1 and a bias vector QT->I QT->T b1 ∈ Rd1 . (2) The decoder maps the latent representation x1 back Training data to a reconstruction x2 ∈ Rd0 via another mapping function fd : Text SAE x2 = fd (x1 ) = sd (W2T x1 + b2 ) (2) Test Text Text Query Similarly, sd is the activation function of the decoder with pa- rameters {W2 , b2 }, W2 ∈ Rd1 ×d0 , b2 ∈ Rd0 . The input of Figure 3: Process Flow of Learning and Query Processing. sd is called the activation of the reconstruction layer. Parameters are learned through back-propagation [17] by minimizing the loss function L(x0 , x2 ) in Equation 3, fine-tuned based on a pre-defined objective. The latent layer of the top auto-encoder is the output of the stacked auto-encoders, which L(x0 , x2 ) = Lr (x0 , x2 ) + 0.5ξ(||W1 ||22 + ||W2 ||22 ) (3) can be further fed into other applications, such as SVM for classi- which consists of the reconstruction error Lr (x0 , x2 ) and the L2 fication. The unsupervised pre-training can automatically exploit regularization of W1 and W2 . By minimizing the reconstruction large amounts of unlabeled data to obtain a good weight initializa- error, we require the latent features should be able to reconstruct the tion for the neural network than traditional random initialization. original input as much as possible. In this way, the latent features preserve regularities of the original data. The squared Euclidean 2.4 Overview distance is often used for Lr (x0 , x2 ). Other loss functions such Taking the image and text modalities as an example, we provide as negative log likelihood and cross-entropy are also used. The L2 the process flow of the learning and query processing in Figure 3. regularization term is a weight-decay which is normally added to Our learning algorithm MSAE is trained with simple image-text the objective function to penalize large weights and reduce over- pairs. After training, we obtain one SAE for each modality. Test fitting [5] 3 . ξ is the weight decay cost, which is usually a small (database) images (resp. text), are mapped into the latent space number (e.g., 10−4 in our experiments). through the image SAE (resp. text SAE). To support efficient query processing, we create an index for the latent feature vectors of 2.3 Stacked Auto-encoders (SAE) each modality. All the steps are conducted offline. For real-time The stacked auto-encoders (SAE) is a neural network with multi- query processing, we map the query into the latent space through ple layers of auto-encoders. It has been widely used as a deep learn- its modal-specific SAE, and return the kNNs using an appropriate ing method for dimensionality reduction [18] and feature learning index based on the query type. For example, the image index is [16, 22, 4, 19]. used for queries against the image database, i.e., QI→I and QT →I . ... 3. TRAINING h-th (top) In this section, we design a two-stage training algorithm to learn auto-encoder the mapping functions of MSAE. A complete training process with ... image and text as two example modalities is illustrated in Figure 4. ... ... In stage I, one SAE is trained for each modality. This train- ... ing stage serves as the pre-training of stage II. As shown in step 1 and step 2 in the figure, we train each SAE independently with 2-th auto-encoder the objective to map similar features close to each other in the la- ... ... tent space. This pre-training stage provides a good initialization to 1-th (bottom) the parameters in MSAE and improves the training performance. auto-encoder In stage II, we iterate over all SAEs, adjusting the parameters in ... ... one SAE at a time with the goal to capture both intra-modal se- mantics and inter-modal semantics. The learned MSAE projects Figure 2: Stacked Auto-Encoders semantically relevant objects close to each other in the latent space as shown by step 3 and 4 in Figure 4. In the following, we first introduce the training algorithm of a As illustrated in Figure 2, there are h auto-encoders which are single SAE, i.e., Stage I. Then we describe the training algorithm trained in a bottom-up and layer-wise manner. The input vectors for MSAE, i.e., Stage II. (blue color in the figure) are fed to the bottom auto-encoder. After finishing training the bottom auto-encoder, the output latent repre- sentations are propagated to the higher layer. The sigmoid function 3.1 Single-Modal Training or tanh function is typically used for the activation functions se and Image Input We represent an image by a high dimensional real- sd . The same procedure is repeated until all the auto-encoders are valued vector. In the encoder, each input image is mapped to a trained. After such a pre-training stage, the whole neural network is latent vector using Sigmoid function as the activation function se (Equation 1). However, in the decoder, the Sigmoid activation func- 3 For ease of presentation, we time all squared terms in this paper tion, whose range is [0,1], performs poorly on reconstruction be- with a coefficient 0.5 to dismiss coefficients of the derivatives. E.g, cause the input unit (referring to a dimension of the input) is not 2 1| the derivative of ∂0.5|W ∂W1 = W1 necessarily within [0,1]. To solve the issue, we follow Hinton [5] 3
1 4 ... ... ... Image SAE (Adjust)Text SAE (Fix) Image SAE Train MSAE 2 3 ... ... ... Text SAE (Fix) Text SAE (Adjust)Image SAE (a)Input (b) Training Stage I (Step 1&2) (c) Training Stage II (Step 3&4) Figure 4: Flowchart of Training. Relevant images (or text) are associated with the same shape (e.g., ). 2.0 140 being the same as the input unit x0i is calculated as following: 120 1.5 100 p(x2i = x0i ) = P ois(x0i , x2i ) (5) 80 −λ n 1.0 where P ois(n, λ) = e λ /n!. Based on Equation 5, we define 60 the reconstruction error as the negative log likelihood: 40 0.5 Y 20 LTr (x0 , x2 ) = −log p(x2i = x0i ) (6) 0.0 0 i 0.0 0.5 1.0 1.5 2.0 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 average unit value average unit value ×10−2 Given a set of input feature vectors X 0 (each row is an image or (a) (b) text), the SAE consisting of h auto-encoders is trained by minimiz- ing the following objective function: Figure 5: Distribution of image (5a) and text (5b) features extracted h from NUS-WIDE training dataset (See Section 6). Each figure is L(X 0 ) = Lr (X 0 , X 2h ) + 0.5ξ (||W1i ||22 + ||W2i ||22 ) X generated by averaging the units for each feature vector, and then (7) i=1 plot the histogram for all data. where X 2h is the reconstruction of X 0 and Lr (X 0 , X 2h ) is the average reconstruction error over examples in X 0 calculated using and model the input unit as a linear unit with independent Gaus- either Equation 4 or 6. The second term is the L2 regularization of sian noise. The reason is that the unit of image feature typically all parameter matrices. The objective function can be considered follows Gaussian distribution as shown in Figure 5a. Furthermore, as an extension of Equation 3 to the stacked scenario. Generally the Gaussian noise term can be omitted if the input data is nor- speaking, if the reconstruction error is small, then the latent feature malized with zero mean and unit variance. Consequently, we can from the top auto-encoder would be able to reconstruct the original use an identity function, denoted as sId , for the activation function input well, and consequently, capture the regularities of the input sd in the decoder. We employ Euclidean distance to measure the data well. Therefore, if the feature vectors of two objects are simi- reconstruction error for images, denoted as LIr : lar in the original space, then they would be close in the latent space as shown by step 1 and step 2 in Figure 4. LIr (x0 , x2 ) = 0.5||x0 − x2 ||22 (4) The detailed procedure of training a single-modal SAE is shown in Algorithm 1. It consists of two major components: a layer-wise Text Input The text inputs are represented by word count vectors training stage (lines 1-3) which trains the auto-encoders from bot- or tag occurrence vectors 4 . We adopt the Rate Adapting Poisson tom to top with the objective function as Equation 3, and a fine- model [18] for the reconstruction because the histogram for text tuning stage (line 4) which adjusts all auto-encoders together to input unit generally follows Poisson distribution. Figure 5b shows minimize Equation 7. The layer-wise training learns one single the distribution of tags associated with the training images from auto-encoder at a time, which can be seen as a special SAE with NUS-WIDE training dataset. The P activation function P in the decoder only one auto-encoder, i.e., h = 1. Its objective function is similar is x2 = sTd (z2 ) = l × ez2 / j ez2j , where l = j x0j is the to that in the fine-tuning of SAE. Thus, they both call trainNN to number of words in input text, x1 is computed as in Equation 1 and perform the training task. z2 = W2T x1 + b2 . The probability of a reconstruction unit x2i trainNN is an adaptation of the back-propagation algorithm [10] for training neural networks. By unfolding the SAE in to a neural 4 network as shown in Figure 6, we can call trainNN to train it. As The value for each dimension indicates the corresponding tag ap- pears or not. in [5], we divide the training dataset X 0 into mini-batches of the 4
Encoders Decoders Algorithm 1 trainSAE(h, X 0 , d) Input: h, height of SAE Xh Input: X 0 , training data, one example per row 1 1 1, 1 ℎ ℎ 1 , 1 ℎ ℎ 2 , 2... 1 1 2, 2 ... Input: d, a sequence of dimensions for each layer 0 X X2h Output: θ = {θi }hi=1 , parameters of SAE ... ... 1 2 2ℎ−1 2ℎ 1. for i = 1 to h do 2. random init θi ← di−1 , di 3. (θi , X i )=trainNN(1, X i−1 , θi ) Input layer Latent layers Reconstruction layers 4. θ ←trainNN(h, X 0 , θ) fProp : bProp: trainNN(h, X, θ) 1. repeat Figure 6: Unfolded Stacked Auto-Encoders 2. for batch B 0 in X do 3. Z, B=fProp(2h, B 0 , θ) 0 4. δ 2h = ∂L(B ) tion on minimizing the inter-modal distance is enhanced relatively. ∂Z 2h 2h Consequently, the intra-modal semantics of low quality modalities 5. bProp(2h, δ , B, Z, θ) //(see Appendix) can be be preserved or even enhanced through their inter-modal re- 6. until converge lationships with the modalities of high quality features. For exam- 7. return fProp(h, X, θ) ple, let x0 , y0 be two semantic relevant objects from two different modalities, namely, x and y, where x’s feature is of high quality in capturing semantics while y’s feature is of low quality. If x1 and same size (line 2). For example, given a dataset with 60, 000 im- y1 are their latent features generated by minimizing the reconstruc- ages, we can divide them into 600 batches, each with 100 images. tion error, then y1 can preserve the semantics well, but x1 is not as For each mini-batch, we forward propagate the input to compute meaningful due to the low quality of x0 . To solve this problem, we the value of each layer (fProp in line 3). Specifically, the latent combine the inter-modal distance between x1 and y1 in the learning layers (in Figure 6) are calculated according to Equation 1. The objective function and assign smaller weight for the reconstruction reconstruction layers are calculated according to Equation 2 except error of x1 . The effect is the same as increasing the weight for min- that of the bottom auto-encoder (i.e., the right most layer in Fig- imizing the inter-modal distance with y1 . As a result, the objective ure 6), which is modal dependent. For image (resp. text) SAE the function will adjust the parameters to make the distance between x1 sd of the bottom auto-encoder (i.e., the right most sd in Figure 6) and y1 become smaller. In this way, the semantics of low quality is sId (resp. sTd ). In line 4, we calculate the partial derivative of x1 is indirectly enhanced by the high quality feature y1 . the objective function L w.r.t. the activation of the last layer. After With the above learning intuition, we define our objective func- that, we back-propagate the derivative to get gradients of param- tion for multi-modal training as follows, eters in each layer (bProp in line 5) and update them according to Stochastic Gradient Descent. The details of parameter updating L(X 0 , Y 0 ) = αLIr (X 0 , X 2h ) + βLTr (Y 0 , Y 2h ) are described in the Appendix section. In line 7, the latent features +Ld (X h , Y h ) + ξ(θ) (8) from the top auto-encoder are returned as the input for training up- per auto-encoders. where X 0 (resp. Y 0 ) is a matrix for the image (resp. text) training feature vectors; each row of X 0 and Y 0 makes a semantic relevant 3.2 Multi-Modal Training inter-modal pair, e.g., an image and its associated tags; X 2h (resp. Single modal training initializes one SAE for each modality with Y 2h ) is the corresponding reconstruction matrix, which is calcu- the objective to minimize the reconstruction error. The generated lated by forwarding the input through the unfolded image (resp. latent features thus preserve the regularities of the original features text) SAE as shown in Figure 7. X h and Y h are the latent fea- well. But it does not necessarily capture the semantics of the intra- ture matrices, which are the outputs of MSAE (see Figure 7). LIr modal data. If the original features do not capture the intra-modal (see Equation 4) is the reconstruction error from image SAE, and semantics well, the latent features would fail to capture the intra- LTr (see Equation 6) is the reconstruction error from text SAE. Ld modal semantics. Moreover, inter-modal semantics is not involved is the distance function for latent features, which is the Euclidean in the single modal training, thus cannot be captured by the latent distance (see Equation 4) in our implementation; similar to Equa- features. To preserve both intra-modal semantics and inter-modal tion 7, the last term ξ(θ) is the L2 regularization of the parameter semantics in the latent features, we combine all modalities together matrices involved in all SAEs. to learn an effective mapping mechanism. α and β are the weights for the reconstruction error of image and The intuition of multi-modal training is as follows. On the one text SAEs respectively, which are set according to the quality of the hand, in the learning objective function, we minimize the distance original features in capturing intra-modal semantics. After single of latent features of semantic relevant inter-modal pairs. The learned modal training, we can test the quality of the original features for mapping functions would then try to map semantic relevant inter- each modality on a validation dataset by performing intra-modal modal pairs into similar latent features. On the other hand, we search against the latent features. The weight, e.g., α, is assigned minimize the reconstruction error for the modalities whose original with smaller value if the performance is worse, i.e., the original features are of high quality in capturing intra-modal semantics. In features are not good at capturing semantics of the data. In this this way, the latent features preserve the regularities of the original manner, the weight of Ld would increase relatively in terms of the features well and thus captures semantics well. For modalities with image modality, which moves images close to their semantic rel- low quality features, we assign small weights for their reconstruc- evant text in the latent space. Consequently, the latent features of tion error in the objective function. In this manner, the restriction images would gain more semantics from the text latent features. of minimizing the reconstruction error is relaxed, while the restric- Since the dimensions of the latent space and the original space are 5
Encoders Decoders Indexed Text Latent Feature Vectors Text DB Offline ... Indexing QT->T fProp : Text Query Y0 ... Yh bProp: [0.2,0.4,…,0.1] QT->I Text SAE Online Querying Image Query [0.1,0.9,…,0.5] QI->T QI->I ... Offline Xh Image DB Indexing ... ... X0 X2h Image SAE Indexed Image Latent Feature Vectors ... ... 1 2 2ℎ−1 2ℎ Figure 8: Illustration of Query Processing Latent layers Reconstruction layers thus adjusts parameters based on Stochastic Gradient Descent as Figure 7: Unfolded Multi-modal Stacked Auto-Encoders well. We illustrate the training algorithm taking X being the image modality as an example. The unfolded image SAE is shown in Fig- ure 7, which is exactly the same as that in Figure 6. Since the text Algorithm 2 trainMSAE(h, X 0 , Y 0 , θ) SAE is fixed, LTr (Y 0 , Y 2h ) is a constant in Equation 8. The recon- Input: h, height of MSAE struction layers of the text SAE are then not involved in learning Input: X 0 , Y 0 , image and text input data parameters of the image SAE. Hence, we do not show them in Fig- Input: θ=(θX , θY ), parameters of MSAE, initialized by trainSAE ure 7. In line 3, we forward propagate the input through all layers Output: θ, updated parameters of the image SAE including latent layers and reconstruction layers. 1. repeat But we do not calculate the reconstruction layers for text SAE in 2. trainMNN(h, X 0 , Y 0 , θX , θY )//train image SAE line 4 because the reconstructions are constant and have no contri- 3. trainMNN(h, Y 0 , X 0 , θY , θX )//train text SAE bution to updating the image SAE. To update the parameters of the 4. until converge decoders, we firstly calculate the partial derivative of the objective function, i.e., Equation 8, w.r.t. the activation of the last reconstruc- trainMNN(h, X, Y, θX , θY ) tion layer. Next, we back-propagate the partial derivative to the top latent layer in line 6 calculating the gradients of parameters in each Input: X, input data for the modality whose SAE is to be updated decoder and updating them. In line 7, the partial derivative of Ld is Input: Y , input data for the modality whose SAE is fixed combined. In line 8, bProp updates the parameters of each encoder Input: θX , θY , parameters for the two SAEs. according to their gradients. 1. repeat 0 2. for batch (BX , BY0 ) in (X, Y ) do 0 3. BX , ZX =fProp(2h, BX , θX ) 4. BY , ZY =fProp(h, BY0 , θY ) 4. QUERY PROCESSING 0 0 5. δ 2h = ∂L(BX ,BY ) After training MSAE, each modality is associated with its own ∂Z 2h X SAE whose parameters are already well learned. Given a set of het- 6. δ h =bProp(h, δ 2h , {BX i 2h i 2h }i=h , {ZX i 2h }i=h , {θX }i=h ) erogeneous data sources, high-dimensional features are extracted h h ∂Ld (BX ,BY ) 7. δh+ = ∂ZX h from each source and mapped into a low-dimensional latent space using the trained SAE. For example, if we have one million images, 8. bProp(h, δ h , {BX i h i h }i=0 , {ZX i h }i=1 , {θX }i=1 ) we first convert them into bag-of-words representations. Specifi- 9. until converge cally, SIFT features are extracted from images and clustered into N bags. Each bag is considered a visual word and each image is represented by an N -dimensional vector. Our goal is to map the N - usually of different orders of magnitude, the scale of LIr , LTr and dimensional feature into a common latent space with m dimensions Ld are different. α and β need to be scaled to make them compa- (m is normally set small, e.g., 16, 24 or 32). The mapping proce- rable, i.e., within an order of magnitude. dure is illustrated in Algorithm 3. Image input (resp. text input) Algorithm 2 shows the procedure of training multi-modal SAE is forwarded through encoders of the image SAE (resp. text SAE) (MSAE). Instead of adjusting both SAEs simultaneously, we iterate to the top latent layer. Line 1 extracts parameters of the modal- over SAEs, adjusting one SAE at a time with the other one fixed, specific encoders (see Figure 6). The actual mapping is conducted as shown in lines 2-3. This is because the training of the neural by fProp (see Algorithm 1) at line 2. networks is prone to local optimum. Tuning multiple SAEs simul- After the mapping, we create VA-File [23] to index the latent fea- taneously makes the training algorithm more difficult to converge. tures (one index per modality). Given a query input, we check its By adjusting only one SAE with the other one fixed, the training of media type and map it into the low-dimensional space through its MSAE turns to be much easier. Experiments show that one to two modal-specific SAE as shown by Algorithm 3. Next, intra-modal iterations is enough for converging. The convergence is monitored and inter-modal searches are conducted against the corresponding by performing multi-modal retrieval on a validation dataset. index shown in Figure 8. For example, the task of searching rele- trainMNN in Algorithm 2 adjusts the SAE for modality X with vant tags of one image, i.e., QI→T , is processed by the index of the the SAE of modality Y fixed. It is an extension of tranNN, and text latent vectors. 6
Algorithm 3 Inference(D) Table 1: The Statistics of Datasets Input: D, high-dimensional (image/text) query feature vectors 1. θ → {(W11 , b11 ), (W12 , b21 ), · · · , (W1h , bh Dataset NUS-WIDE Wiki Flickr1M 1 )} //parameters of encoders Total size 190,421 2,866 1,000,000 2. return fProp(h, D, θ) Training set 60,000 2,000 975,000 Validation set 10,000 366 6,000 Test set 120,421 500 6,000 To further improve the search efficiency, we convert the real- Average Text Length 6 131 5 valued latent features into binary features, and search based on Hamming distance. The conversion is conducted using existing (e.g., image and its tags) as training input, thus no prior knowledge hash methods that preserve the neighborhood relationship based on such as irrelevant pairs, similarity matrix, ranking examples and Euclidean distance. For example, in our experiment, we choose labels of queries, is needed. Spectral Hashing [24], which converts real-valued vectors (data Multi-modal deep learning [14, 21] extends Deep Learning to points) into binary codes with the objective to minimize the Ham- multi-modal scenario. [21] combines two Deep Boltzman Ma- ming distance of data points who are close in the original Euclidean chines (DBM) (one for image, one for text) with a common latent space. layer to construct a Multi-modal DBM. [14] constructs a Bimodal However, the conversion from real-valued features to binary fea- deep auto-encoder with two deep auto-encoders (one for audio, one tures trades off effectiveness for efficiency. Since there is infor- for video). Both two models aim to improve the classification ac- mation loss when real-valued data is converted to binaries, it af- curacy of objects with features from multiple modalities. Thus fects the retrieval performance. We study the trade-off between they combine different features to learn a good (high dimensional) efficiency and effectiveness on binary features and real-valued fea- latent feature. In this paper, we aim to represent data with low- tures in the experiment section. dimensional latent features to enable effective and efficient multi- modal retrieval, where both the query and database objects may 5. RELATED WORK have features from only one modality. The key problem of multi-modal retrieval is to find an effective mapping mechanism, which maps data from different modalities 6. EXPERIMENTAL STUDY into a common latent space. An effective mapping mechanism This section provides an extensive performance study of our so- would preserve both intra-modal semantics and inter-modal seman- lution in comparison with the state-of-the-art methods: CVH [9], tics well in the latent space, and thus generates good retrieval per- CMSSH [1] and LCMH [26] 5 . We examine both efficiency and ef- formance. fectiveness of our method including training overhead, query pro- Linear projection has been studied to solve this problem [9, 20, cessing time and accuracy. All the experiments are conducted on 26]. Generally they try to find a linear projection matrix for each CentOS 6.4 using CUDA 5.0 with NVIDIA GPU (GeForce GTX modality which maps semantic relevant data into similar latent vec- TITAN). The size of main memory is 64GB and GPU memory is tors. However, if the distribution of the original data is non-linear, it 4GB. The code and hyper-parameter setting is available online 6 . would be hard to find a set of good projection matrices to make the latent vectors of relevant data close. CVH [9] extends the Spectral 6.1 Datasets Hashing [24] to multi-modal data by finding a linear projection for We evaluate the performance on three benchmark datasets—NUS- each modality that minimizes the Euclidean distance of relevant WIDE [2], Wiki [15] and Flickr1M [7]. data in the latent space. Similarity matrices for both inter-modal NUS-WIDE The dataset contains 269,648 images from Flickr, data and intra-modal data are required to learn a set of good map- each associated with 6 tags in average. We refer to the image and ping functions. IMH [20] learns the latent features of all training its tags as an image-text pair. There are 81 ground truth concepts data firstly, which costs expensively. LCMH [26] exploits the intra- manually annotated for evaluation. Following previous works [11, modal correlations by representing data from each modality using 26], we extract 190,421 image-text pairs annotated with the most its distance to cluster centroids of the training data. Projection ma- frequent 21 concepts and split them into three subsets for training, trices are then learned to minimize the distance of relevant data validation and test respectively. The size of each subset is shown (e.g., image and tags) from different modalities. in Table 1. For validation (resp. test), 100 (resp. 1000) queries Other recent works include CMSSH [1], MLBE [25] and LSCMR are randomly selected from the validation (resp. test) dataset. Im- [12]. CMSSH uses a boosting method to learn the projection func- age and text features have been provided in the dataset [2]. For tion for each dimension of the latent space. However, it requires images, SIFT features are extracted and clustered into 500 visual prior knowledge such as semantic relevant and irrelevant pairs. MLBE words. Hence, an image is represented by a 500 dimensional bag- learns the latent features of all training data using a probabilistic of-visual-words vector. Its associated tags are represented by a graphic model firstly. Then it learns the latent features of queries 1, 000 dimensional tag occurrence vector. based on their correlation with the training data. It does not con- Wiki This dataset contains 2,866 image-text pairs from Wikipedia’s sider the original features (e.g., image visual feature or text fea- featured articles. An article in Wikipedia contains multiple sec- ture). Instead, only the correlation of data (both inter-similarity and tions. The text information and its associated image in one sec- intra-similarity matrices) are involved in the probabilistic model. tion is considered as an image-text pair. Every image-text pair has However, the label of a query is usually not available in practice, 5 The code and parameter configurations for CVH and CMSSH are which makes it impossible to obtain its correlation with the training available online at http://www.cse.ust.hk/˜dyyeung/ data. LSCMR [12] learns the mapping functions with the objec- code/mlbe.zip; The code for LCMH is provided by the au- tive to optimize the ranking criteria (e.g., MAP) directly. Ranking thors. Parameters are set according to the suggestions provided in examples (a ranking example is a query and its ranking list) are the paper. 6 needed for training. In our algorithm, we use simple relevant pairs http://www.comp.nus.edu.sg/˜wangwei/code 7
a concept inherited from the article’s category (there are 10 cate- Firstly, following the training procedure in Section 3, we train gories in total). We randomly split the dataset into three subsets a 4-layer image SAE with the dimension of each layer as 500 → as shown in Table 1. For validation (resp. test), we randomly 128 → 16 → 2 using Algorithm 1. Similarly, a 4-layer text SAE select 50 (resp. 100) pairs from the validation (resp. test) set as (the structure is 1000 → 128 → 16 → 2) is trained. Latent fea- the query set. Images are represented by 128 dimensional bag-of- tures of sampled images from the validation set are plotted in blue visual-words vectors based on SIFT feature. For text, we construct circles as shown in Figure 9a. Similarly, latent features of sampled a vocabulary with the most frequent 1,000 words excluding stop text are plotted in white circles. This pre-training stage initializes words, and then represent one text section by 1,000 dimensional SAEs to capture regularities of the original features of each modal- word count vector like [12]. The average number of words in one ity in the latent features. On the one hand, the original features may section is 131 which is much higher than that in NUS-WIDE. To be of low quality to capture intra-modal semantics. In such a case, avoid overflow in Equation 5 and smooth the text input, we normal- the latent features would also fail to capture the intra-modal seman- ize each unit x as log(x + 1) [18]. tics. In fact, we evaluate the quality of the mapped latent features Flickr1M This dataset contains 1 million images associated with from each SAE by intra-modal search on the validation dataset. tags from Flickr. 25,000 of them are annotated with concepts (there The MAP of the image intra-modal search is about 0.37, while that are 38 concepts in total). The image feature is a 3,857 dimensional of the text intra-modal search is around 0.51. On the other hand, vector concatenated by SIFT feature, color histogram, and etc [21]. the SAEs are trained separately. Therefore, inter-modal semantics Like NUS-WIDE, the text feature is represented by a tag occur- are not considered. We randomly pick 25 relevant image-text pairs rence vector with 2,000 dimensions. All the image-text pairs with- and connect them with red lines in Figure 9b. We can see the latent out annotations are used for training. For validation and test, we features of most pairs are far away from each other, which indicates randomly select 6,000 pairs with annotations respectively, among that the inter-modal semantics are not captured by these latent fea- which 1,000 pairs are used as queries. tures. To solve the above problems, we resort to the multi-modal Before training, we use ZCA whitening [8] to normalize each training by Algorithm 2. In the following figures, we only plot the dimension of image feature to have zero mean and unit variance. distribution of these 25 pairs for easy of illustration. Given a query, the ground truth is defined as: if a result shares at least one common concept with the query, it is considered as a relevant result; otherwise it is irrelevant. 1.0 1.0 6.2 Evaluation Metrics 0.8 0.8 0.6 0.6 Firstly, we study the effectiveness of the mapping mechanism. It is reflected by the effectiveness of the multi-modal search, i.e., 0.4 0.4 Qq→t (q, t ∈ {T, I}), using the mapped latent features 7 . Hence, 0.2 0.2 we use the Mean Average Precision (MAP) [13], one of the stan- dard information retrieval metrics, as the major effectiveness eval- 0.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.0 0.2 0.4 0.6 0.8 1.0 uation metric. Given a set of queries, we first calculate the Average Precision (AP) for each query, (a) (b) PR i=1 P (i)δ(i) Figure 9: Latent Features (Blue circles are image latent features; AP (q) = P R White circles are text latent features) j=1 δ(j) where R is the size of the test dataset; δ(i) = 1 if the i-th result is relevant, otherwise δ(i) = 0; P (k) is the precision of the result Secondly, we adjust the image SAE with the text SAE fixed as ranked at position k, which is the fraction of true relevant docu- line 2 of Algorithm 2 from epoch 1 to epoch 30. One epoch means ments in the top k results. By averaging AP for all queries, we get one pass of the whole training dataset. Since the MAP of the image the MAP score. The larger the MAP score, the better the search intra-modal search is worse than that of the text intra-modal search, performance. In addition to MAP, we also measure the precision according to the analysis in Section 3.2, we should use small α to and recall of search tasks. decrease the weight of image reconstruction error LIr in the ob- Besides effectiveness, we also evaluate the training overhead in jective function, i.e., Equation 8. To verify the correctness of the terms of time cost and memory consumption. In addition, we report analysis, we compare the performance of two choices of α, namely the evaluation on query processing time at last. α = 0 and α = 0.01. The first two columns of Figure 10 show the latent features generated by the image SAE after epoch 1 and 6.3 Visualization of Training Process epoch 30. Comparing Figure 10b and 10e, we can see that with smaller α, the image latent features are moved closer to their rel- In this section we visualize the training process of MSAE using evant text latent features. This is in accordance with Equation 8, the NUS-WIDE dataset as an example to help understand the intu- where smaller α relaxes the restriction on the image reconstruction ition of the training algorithm and the setting of the weight param- error, and in turn increases the weight for Ld . By moving close eters, i.e., α and β. Our goal is to learn a set of mapping functions to relevant text latent features, the image latent features gain more such that the mapped latent features capture both intra-modal se- semantics. As shown in Figure 10c, the MAP curves keep increas- mantics and inter-modal semantics well. Generally, the inter-modal ing with the training going on and converge when inter-modal pairs semantics is preserved by minimizing the distance of the latent fea- are close enough. QT →T does not change because the text SAE is tures of relevant inter-modal pairs. The intra-modal semantics is fixed. Because image latent features are hardly moved close to the preserved by minimizing the reconstruction error of each SAE and relevant text latent features when α = 0.01 as shown in Figure 10d through inter-modal semantics (see Section 3 for details). and 10e, the MAP curves do not increase in Figure 10f. We use 7 Without specifications, searches are conducted against real-valued the results with α = 0 to continue the training procedure in the latent features using Euclidean distance. following section. 8
Table 2: Mean Average Precision on NUS-WIDE dataset Task QI→I QT →T QI→T QT →I Algorithm LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE Dimension of 16 0.353 0.355 0.365 0.417 0.373 0.400 0.374 0.498 0.328 0.391 0.359 0.447 0.331 0.337 0.368 0.432 Latent Space 24 0.343 0.356 0.358 0.412 0.373 0.402 0.364 0.480 0.333 0.388 0.351 0.444 0.323 0.336 0.360 0.427 L 32 0.343 0.357 0.354 0.413 0.374 0.403 0.357 0.470 0.333 0.382 0.345 0.402 0.324 0.335 0.355 0.435 1.0 1.0 0.5 ture the regularities (semantics) of the original features. Therefore, 0.8 0.8 0.4 both QT →T and QI→T grows gradually. Comparing Figure 11a ℚI → I MAP 0.6 0.6 0.3 ℚT → T and 11d, we can see the distance of relevant latent features in Fig- ℚI → T 0.4 0.4 0.2 0.2 0.2 ℚT → I ure 11d is larger than that in Figure 11a. The reason is that when β 0.0 0.0 0.10 5 10 15 20 25 30 is larger, the objective function, i.e., Equation 8, pays more effort 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 epoch (time) to minimize the reconstruction error LTr . Consequently, less effort (a) α = 0,epoch 1 (b) α = 0,epoch 30 (c) α = 0 is paid to minimize the inter-modal distance Ld . Hence, relevant 0.5 1.0 1.0 inter-modal pairs cannot be moved closer. This effect is reflected as 0.8 0.8 0.4 minor changes at epoch 31 in Figure 11f. Similarly, small changes MAP 0.6 0.6 0.3 0.4 0.4 ℚI → I ℚT → T happen between Figure 11d and 11e, which leads to minor changes 0.2 0.2 0.2 ℚI → T ℚT → I from epoch 32 to 60 in terms of MAP in Figure 11f. 0.0 0.0 0.10 5 10 15 20 25 30 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 epoch (time) (d) α = 0.01,epoch 1 (e) α = 0.01,epoch 30 (f) α = 0.01 6.4 Evaluation of Model Effectiveness Figure 10: Adjusting Image SAE with Different α 6.4.1 NUS-WIDE dataset We first examine the mean average precision (MAP) of our method 0.5 1.0 1.0 compared using Euclidean distance against the real-valued features. 0.8 0.8 0.4 ℚI → I Let L be the dimension of the latent space. Our MSAE is con- MAP 0.6 0.6 0.3 ℚT → T figured with 3 layers, where the image features are mapped from ℚI → T 0.4 0.4 0.2 0.2 0.2 ℚT → I 500 dimensions to 128, and finally to L. Similarly, the dimension 0.10 0.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.0 0.2 0.4 0.6 0.8 1.0 10 20 30 40 epoch (time) 50 60 of text features are reduced from 1000 → 128 → L by the text SAE. α and β are set to 0 and 0.01 respectively according to Sec- (a) β = 0.01,epoch 31 (b) β = 0.01,epoch 60 (c) β = 0.01 tion 6.3. We test L with values 16, 24 and 32. The results compared 1.0 1.0 0.5 0.8 0.8 with other methods are reported in Table 2. Our MSAE achieves 0.4 ℚI → I the best performance for all the four search tasks. It demonstrates MAP 0.6 0.6 0.3 ℚT → T an average improvement of 17%, 27%, 21%, and 26% for QI→I , ℚI → T 0.4 0.4 0.2 0.2 0.2 ℚT → I QT →T ,QI→T , and QT →I respectively. CVH and CMSSH prefer 0.10 0.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.0 0.2 0.4 0.6 0.8 1.0 10 20 30 40 epoch (time) 50 60 smaller L in queries QI→T and QT →I . The reason is that it needs to train far more parameters in higher dimensions and the learned (d) β = 0.1,epoch 31 (e) β = 0.1,epoch 60 (f) β = 0.1 models will be farther from the optimal solutions. Our method is Figure 11: Adjusting Text SAE with Different β less sensitive to the value of L. This is probably because with multi- ple layers, MSAE has stronger representation power and can better avoid local optimality by a good initialization from unsupervised pre-training, and thus is more robust under different L. Thirdly, according to line 3 of Algorithm 2, we adjust the text Figure 12 shows the precision-recall curves, and the recall-candidates SAE with the image SAE fixed from epoch 31 to epoch 60. We ratio curves (used by [25, 26]) which show the change of recall also compare two choices of β, namely 0.01 and 0.1. Figure 11 when inspecting more results on the returned rank list. Due to the shows the snapshots of latent features and the MAP curves of each space limitation, we only show the results of QT →I and QI→T . We setting. From Figure 10b to 11a, which are two consecutive snap- achieve similar trends on results of QT →T and QI→I . Our method shots taken from epoch 30 and 31 respectively, we can see that the shows the best accuracy except when recall is 0 8 , whose precision text latent features are moved much close to the relevant image la- p implies that the nearest neighbor of the query appears in the 1p -th tent features. It leads to the big changes at epoch 31 in Figure 11c. returned result. This indicates that our method performs the best For example, QT →T drops a lot. This is because the sudden move for general top-k similarity retrieval except k=1. For the measure changes the intra-modal relationships of text latent features. An- of recall-candidates ratio, our method is always superior to other other big change happens on QI→T , which increases dramatically. methods. The reason is that when we fix the text features from epoch 1 to Besides real-valued features, we also conduct an experiment against 30, an image feature I is pulled to be close to (or nearest neighbor binary latent features for which Hamming distance is used as the of) its relevant text feature T . However, T may not be the reverse distance function. In our implementation, we choose Spectral Hash- nearest neighbor of I. In epoch 31, we actually move T such that ing [24] to convert real-valued latent feature vectors into binary T is more likely to be the reverse nearest neighbor of I. Hence, the codes. Other comparison algorithms use their own conversion mech- MAP of query QI→T is greatly improved. On the opposite, QT →I anisms. The MAP scores are reported in Table 3. We can see that decreases. From epoch 32 to epoch 60, the text latent features on 1) MSAE still performs better than other methods. 2) The MAP the one hand move close to relevant image latent features slowly, on the other hand rebuild their intra-modal relationships. The latter 8 1 is achieved by minimizing the reconstruction error, i.e., LTr , to cap- Here, recall r = #all relevant results ≈ 0. 9
Table 3: Mean Average Precision on NUS-WIDE dataset (using Binary Latent Features) Task QI→I QT →T QI→T QT →I Algorithm LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE Dimension of 16 0.353 0.357 0.352 0.376 0.387 0.391 0.379 0.397 0.328 0.339 0.359 0.364 0.325 0.346 0.359 0.392 Latent Space 24 0.347 0.358 0.346 0.368 0.392 0.396 0.372 0.412 0.333 0.346 0.353 0.371 0.324 0.352 0.353 0.380 L 32 0.345 0.358 0.343 0.359 0.395 0.397 0.365 0.434 0.320 0.340 0.348 0.373 0.318 0.347 0.348 0.372 0.7 0.7 1.0 1.0 LCMH LCMH 0.9 0.9 0.6 CMSSH 0.6 CMSSH 0.8 0.8 CVH CVH 0.7 0.7 0.5 0.5 Precision Precision MSAE MSAE Recall Recall 0.6 0.6 0.4 0.4 0.5 LCMH 0.5 LCMH CMSSH CMSSH 0.4 0.4 0.3 0.3 CVH CVH 0.3 MSAE 0.3 MSAE 0.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.2 0.2 0.4 0.6 0.8 1.0 0.2 0.2 0.4 0.6 0.8 1.0 Recall Recall Candidate Ratio (%) Candidate Ratio (%) (a) QI→T , L = 16 (b) QT →I , L = 16 (c) QI→T , L = 16 (d) QT →I , L = 16 0.7 0.7 1.0 1.0 LCMH LCMH 0.9 0.9 0.6 CMSSH 0.6 CMSSH 0.8 0.8 CVH CVH 0.7 0.7 0.5 0.5 Precision Precision MSAE MSAE Recall Recall 0.6 0.6 0.4 0.4 0.5 LCMH 0.5 LCMH CMSSH CMSSH 0.4 0.4 0.3 0.3 CVH CVH 0.3 MSAE 0.3 MSAE 0.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.2 0.2 0.4 0.6 0.8 1.0 0.2 0.2 0.4 0.6 0.8 1.0 Recall Recall Candidate Ratio (%) Candidate Ratio (%) (e) QI→T , L = 24 (f) QT →I , L = 24 (g) QI→T , L = 24 (h) QT →I , L = 24 0.7 0.7 1.0 1.0 LCMH LCMH 0.9 0.9 0.6 CMSSH 0.6 CMSSH 0.8 0.8 CVH CVH 0.7 0.7 0.5 0.5 Precision Precision MSAE MSAE Recall Recall 0.6 0.6 0.4 0.4 0.5 LCMH 0.5 LCMH CMSSH CMSSH 0.4 0.4 0.3 0.3 CVH CVH 0.3 MSAE 0.3 MSAE 0.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.2 0.2 0.4 0.6 0.8 1.0 0.2 0.2 0.4 0.6 0.8 1.0 Recall Recall Candidate Ratio (%) Candidate Ratio (%) (i) QI→T , L = 32 (j) QT →I , L = 32 (k) QI→T , L = 32 (l) QT →I , L = 32 Figure 12: Precision-Recall and Recall-Candidates Ratio on NUS-WIDE dataset scores using Hamming distance is not as good as Euclidean dis- similar trends to those of NUS-WIDE except that the precisions are tance. This is caused by the information loss resulted from con- smaller due to low-quality images. verting real-valued features into binary features. 6.4.2 Wiki Dataset 6.4.3 Flickr1M Dataset We configure a 4-layer image SAE for this dataset as 3857 → We conduct similar evaluations on Wiki dataset as on NUS- 1000 → 128 → L, and the text SAE is configured as 2000 → WIDE. For MSAE with latent feature of dimension L, the structure 1000 → 128 → L. Because the image feature of this dataset of its image SAE is 128 → 128 → L, and the structure of its text consists of both local and global feature, its quality is better. In SAE is 1000 → 128 → L. Similar to the setting on NUS-WIDE, fact, the image latent feature performs equally well for intra-modal α is set to 0 due to the low quality of image features, and β is set search as the text latent feature. Hence, we set both α and β to to 0.01 to make LTr and Ld within the same scale. 0.01. The performance is report in Table 4. The MAPs on Wiki dataset We compare the MAP of MSAE and CVH in Table 5. MSAE are much smaller than those on NUS-WIDE except for QT →T . outperforms CVH in most of the search tasks. The results of LCMH This is because the images of Wiki are of much lower quality. and CMSSH cannot be reported as both methods run out of memory It contains only 2, 000 images that are highly diversified, mak- in the training stage. ing it difficult to capture the semantic relationships between im- ages and text. Query task QT →T is not affected as Wkipedia’s featured articles are well edited and rich in text information. In 6.5 Evaluation of Training Overhead general, our method achieves an average improvement of 8.1%, We use Flickr1M to evaluate the training time and memory con- 30.4%,32.8%,26.8% for QI→I , QT →T ,QI→T , and QT →I respec- sumption and report the results in Figure 13. The training cost of tively. We do not plot the precision-recall curves and recall-candidates LCMH and CMSSH are not reported because they run out of mem- ratio curves due to space limitation. Generally, these curves show ory on this dataset. We can see that the training time of MSAE 10
Table 4: Mean Average Precision on Wiki dataset Task QI→I QT →T QI→T QT →I Algorithm LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE LCMH CMSSH CVH MSAE Dimension of 16 0.146 0.148 0.147 0.162 0.359 0.318 0.153 0.462 0.133 0.138 0.126 0.182 0.117 0.140 0.122 0.179 Latent Space 24 0.149 0.151 0.150 0.161 0.345 0.320 0.151 0.437 0.129 0.135 0.123 0.176 0.124 0.138 0.123 0.168 L 32 0.147 0.149 0.148 0.162 0.333 0.312 0.152 0.453 0.137 0.133 0.128 0.187 0.119 0.137 0.123 0.179 Table 5: Mean Average Precision on Flickr1M dataset 300 Binary 250 Real-valued Querying Time (ms) Task QI→I QT →T QI→T QT →I Algorithm CVH MSAE CVH MSAE CVH MSAE CVH MSAE 200 Dimension of 16 0.622 0.621 0.610 0.624 0.610 0.632 0.616 0.608 Latent Space 24 0.616 0.619 0.604 0.629 0.605 0.628 0.612 0.612 150 L 32 0.603 0.622 0.587 0.630 0.588 0.632 0.598 0.614 100 105 60 50 CVH CVH Main Memory Usage (GB) 50 02 MSAE MSAE 4 6 8 Training Time (s) 104 40 Dataset Size ( ×105 ) 30 103 20 Figure 14: Querying Time Comparison Using Real-valued and Bi- 10 nary Latent Features 102 2 4 6 8 02 4 6 8 the querying time increases linearly with respect to the dataset size Training Dataset Size ( ×105 ) Training Dataset Size ( ×105 ) for both binary and real-valued latent features. But, the searching (a) (b) against binary latent features is 10× faster than that against real- valued latent features. This is because the computation of Ham- Figure 13: Training Time and Memory Consumption ming distance is more efficient than that of Euclidean distance. By taking into account the results from effectiveness evaluations, we and CVH increases linearly with respect to the size of the train- can see that there is a trade-off between efficiency and effectiveness ing dataset. Due to the stacked structure and multiple iterations of in feature representation. The binary encoding greatly improves the passing the dataset, MSAE is not as efficient as CVH. Roughly, the efficiency in the expense of accuracy degradation. overhead is the number of training iterations times the height of MSAE. Possible solutions for accelerating the MSAE training in- 7. CONCLUSION clude parallelizing the computation of image SAE and text SAE or In this paper, we have proposed a new mapping mechanism for adopting Distributed deep learning [3]. We leave this as our future multi-modal retrieval based on the stacked auto-encoders (SAE). work. Our mapping mechanism, called multi-modal stacked auto-encoders Figure 13b shows the memory usage of the training process. (MSAE), learns a set of SAEs (one for each modality) to map the Given a training dataset, MSAE splits them into mini-batches and high-dimensional features of different media types (i.e., modalities) conducts the training batch by batch (see Algorithm 2). It stores the into a common low-dimensional latent space so that metric dis- model parameters and one mini-batch in memory, both of which are tance measures can be applied efficiently. By considering both the independent of the training dataset size. Hence, the memory usage intra-modal semantics and the inter-modal semantics in the learn- stays constant when the size of the training dataset increases. In ing objective function, we learn a set of effective SAEs for feature fact, the minimum memory usage for MSAE is smaller than 10GB. mapping. Compared to existing methods which usually require a We allocate more space to load multiple mini-batches into memory substantial amount of prior knowledge about the training data, our to save disk reading cost. For CVH, it has to load all training data method requires little prior knowledge. Experiment results con- into memory for matrix operations. Therefore, the memory usage firmed the improvements of our method over previous works in increases with respect to the size of the training dataset. search accuracy. 6.6 Evaluation of Query Processing Efficiency Finally, we compare the efficiency of query processing using bi- 8. REFERENCES nary latent features and real-valued latent features. Notice that all [1] M. M. Bronstein, A. M. Bronstein, F. Michel, and methods (i.e., MSAE, CVH, CMSSH and LCMH) perform simi- N. Paragios. Data fusion through cross-modality metric larly in query processing after mapping the original data into la- learning using similarity-sensitive hashing. In CVPR, pages tent features of same dimensions. Data from the Flickr1M train- 3594–3601, 2010. ing dataset is mapped into a 32 dimensional latent space to form [2] T.-S. Chua, J. Tang, R. Hong, H. Li, Z. Luo, and Y.-T. Zheng. a large dataset for searching. To speed up the query processing of Nus-wide: A real-world web image database from national real-valued latent features, we create an index (i.e., VA-File [23]) university of singapore. In Proc. of ACM Conf. on Image and for each modality. For binary latent features, we do not create any Video Retrieval (CIVR’09), Santorini, Greece., July 8-10, indexes, because linear scan is fast enough as shown in Figure 14. 2009. It shows the time (averaged over 100 random queries) of search- [3] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, Q. V. ing 50 nearest neighbors against datasets represented using binary Le, M. Z. Mao, M. Ranzato, A. W. Senior, P. A. Tucker, latent features (based on Euclidean distance) and real-valued fea- K. Yang, and A. Y. Ng. Large scale distributed deep tures (based on Hamming distance) respectively. We can see that networks. In NIPS, pages 1232–1240, 2012. 11
You can also read