title: Attr2Style: A Transfer Learning Approach for Inferring Fashion Styles via Apparel Attributes
authors: Rajdeep Hazra Banerjee Abhinav Ravi Ujjal Kr Dutta
text: 
  
  DeepVOX: Discovering Features from Raw Audio for Speaker Recognition in 
  		Non-ideal Audio Signals
      Anurag Chowdhury, Member, IEEE,
  		Arun Ross, Senior Member, IEEE
  		Both authors are with the Department
  			of Computer Science Engineering, Michigan State University, East Lansing,
  			MI, 48823, USA, 
  			e-mail: {chowdh51, rossarun}@msu.edu.
  	
      
  =======================================================================================================================================================================================================================================================
  
  
  
  
  Popular fashion e-commerce platforms mostly provide details about low-level attributes of an apparel (for example, neck type, dress length, collar type, print etc) on their product detail pages. However, customers usually prefer to buy apparel based on their style information, or simply put, occasion (for example, party wear, sports wear, casual wear etc). Application of a supervised image-captioning model to generate style-based image captions is limited because obtaining ground-truth annotations in the form of style-based captions is difficult. This is because annotating style-based captions requires a certain amount of fashion domain expertise, and also adds to the costs and manual effort. On the contrary, low-level attribute based annotations are much more easily available. To address this issue, we propose a transfer-learning based image captioning model that is trained on a source dataset with sufficient attribute-based ground-truth captions, and used to predict style-based captions on a target dataset. The target dataset has only a limited amount of images with style-based ground-truth captions. The main motivation of our approach comes from the fact that most often there are correlations among the low-level attributes and the higher-level styles for an apparel. We leverage this fact and train our model in an encoder-decoder based framework using attention mechanism. In particular, the encoder of the model is first trained on the source dataset to obtain latent representations capturing the low-level attributes. The trained model is fine-tuned to generate style-based captions for the target dataset. To highlight the effectiveness of our method, we qualitatively and quantitatively demonstrate that the captions generated by our approach are close to the actual style information for the evaluated apparel. A Proof Of Concept (POC) for our model is under pilot at Myntra (www.myntra.com) where it is exposed to some internal users for feedback.
  
  
  
  
  § INTRODUCTION
  
  
  
  
  
  
  
  Catalog images of fashion e-commerce websites are mostly annotated with captions providing details about the low-level attributes of an apparel (for example, neck type, dress length, collar type, print etc). Such captions are easier to annotate as low-level attributes being generic in nature are easier to obtain. Often, apparel manufacturers themselves provide such information. However, captions providing nature or style (or looks) information of an apparel (Figure <ref>) are relatively less common (for example, party wear, sports wear, casual looks etc). This is despite the fact that users have a higher preference for style information over low-level attributes while buying apparel for occasions. A straightforward solution to address this problem would be to annotate a dataset with style information based captions and train an image captioning model. However, annotating style-based captions is not trivial, and requires a certain amount of fashion domain knowledge, in addition to economic expenses and manual efforts.
  
  A clear look at apparel indicates that attributes and styles often have correlations among them. For example, as shown in Figure <ref>, a high percentage of party dresses have embellished prints as the dominant attribute, with floral prints as the minor one. On the other hand the vintage style has the floral prints as the dominant attribute. Due to this observation, we conjecture that the lack of style-based ground truth captions for images could be addressed by a transfer learning approach via attribute-based information.
  
  In this paper, we propose an innovative AI system that addresses the above issue by transfer learning. In particular, we apply our method to overcome the scarcity of style-based image captions on our own fashion e-commerce platform called Myntra (www.myntra.com). Figure <ref> shows sample images of Product Display Pages (PDP) on our platform, showing both types of captions, and Figure <ref> shows common types of looks. However, we would like to note that the style-based captions are available for only a handful of images, whereas there is an abundance of images with attribute-based captions. To learn the style-based captions via images with attribute-based captions, we cast our problem into a transfer learning setting. Specifically, we consider the large set of images with attribute-based captions as a source domain dataset, and the handful of images with style-based captions as a target domain dataset.
  
  Firstly, we train a machine learning model on the source domain dataset to learn latent information corresponding to the attributes, and then transfer this knowledge to that of the target domain dataset to learn information corresponding to the styles (i.e., looks). To this end, we propose an attention-based image captioning model with an encoder-decoder that leverages transfer learning to obtain style-based captions for target domain images. We first train our model on a source dataset which has abundant attribute-based ground truth captions. The encoder of the trained model now captures the attribute information in the form of latent embeddings. The model is then fine-tuned on the target dataset, which has only a limited number of images with ground truth style-based captions. By virtue of the latent representations learned by the encoder, we are able to transfer knowledge of the attributes from the source domain and learn better style-based captions for images from the target domain.
  
  
  Discussion on the transfer method: The transfer mechanism of our proposed approach is similar in spirit to that of the Domain-Adversarial training of Neural Networks (DANN) method <cit.>, that studied a representation learning approach for domain adaptation. Their approach is directly inspired by the theory on domain adaptation suggesting that, for effective domain transfer to be achieved, predictions must be made based on features (that cannot discriminate between the source and target domains). They make use of an adversarial loss to learn latent features. Their features are very generic in nature. However, in our case, as shown in Figure <ref>, there is a well-known correlation between lower level attributes and higher level styles. Thus, the encoder of the network trained on attribute level captions produces latent representations which are agnostic to the domain knowledge (thus, satisfying the theory on domain adaptation). Now this same latent representation helps in transferring the low-level attribute information to the higher level styles, and hence act as good representations for caption generation. Despite the two-phase like training, in principle, transfer learning is achieved by virtue of the latent features learned. Our approach is indeed a crafty and subtle way of performing transfer learning. 
  
  
  
  § PROPOSED METHOD
  
  
  Model architecture: Figure <ref> illustrates our proposed encoder-decoder based image captioning model, that consists of the following major components: i) An encoder, wherein we make use of a ResNet101 <cit.> (pretrained on Imagenet <cit.>) to obtain the latent representations (that help in transfer learning), and ii) A decoder (a LSTM network <cit.>), that makes use of the latent features to provide image captions. We incorporate an attention mechanism in the decoder to obtain a correspondence between the feature vectors and portions of the 2-D image. For this, we extract features from a lower convolution layer of the network, hence allowing the decoder to selectively focus on certain parts of an image (soft attention as in <cit.>). The ResNet based encoder has the option of fine-tuning convolution blocks 2 through 4. The final encoding produced by our ResNet101 encoder has a size of 14× 14 with 2048 channels.
  
  
  
  
  Attention-based LSTM model
  For a pair of sequences A={w_1^a,⋯,w_m^a} and B={w_1^b,⋯,w_n^b}, let their LSTM encoding be denoted as:
  
      h_t^a=lstm(e(w_t^a),h_t-1^a), ∀ t ∈ [1,m]
         h_t^b=lstm(e(w_t^b),h_t-1^b), ∀ t ∈ [1,n]
  
  Here, e(w) is the corresponding embedding for the word w. The last hidden state h_n^b ∈ℝ^d is used to attend the intermediate representations H^a={h_1^a ,⋯, h_m^a}∈ℝ^m × d of A, using the attention-mechanism <cit.>:
  
      α_t = v^⊤tanh (W_1h_t^a+W_2h_n^b+b), ∀ t ∈[1,m] 
         α_t = softmax(α_t) 
         c_α=∑_t=1^m α_t h_t^a
  
  Here, W_1 ∈ℝ^d1 × d, W_2 ∈ℝ^d1 × d, b∈ℝ^d1 and v∈ℝ^d1 are parameters to be learned, and c_α is called the context vector.
  
  In our case, the LSTM network generates captions one word at every time step t conditioned on the context vector c_α, the previous hidden state h_t-1 and the previously generated words. The context vector c_α is a dynamic representation of the relevant part of the image input at time t.
  
  Let, 𝐚_i, i=1,...,L denote annotation vectors that are features extracted at different image locations. Using the soft-attention mechanism discussed as above, we can redefine our context vector z_t as:
  
      z_t = ∑_iα_t,i𝐚_i
  
  Here, we have,
  
      α_t,i = exp(e_ti)/∑_k=1^L exp(e_tk)
  
  
      e_ti = f_att(𝐚_i,𝐡_t-1)
  
  where f_att is a multilayer perceptron.
  
  Training: We first train the caption generator network using attention to generate attribute captions using the source dataset. We use the learned image encoder weights to fine tune the network for generating style-based captions using the target dataset.
  
  
  
  § EXPERIMENTS
  
  
  To evaluate the proposed method, we made use of images from our fashion e-commerce website www.myntra.com. As the source dataset, we collected a subset of 20000 images that have captions providing low-level attribute information (but no style-based captions). We collected another limited small subset of 2500 images for which we already had in-house annotated captions describing the style information. This second subset is considered as the target dataset, for which we do not make use of the attribute based annotations. We make use of a distinct set of 430 test images (with ground truth style-captions) for evaluating the generated captions. The test data has the following styles: party, cocktail, feminine, summer, winter, and none (for rest of images).
  
  Models compared: To demonstrate the effectiveness of the proposed transfer learning based approach, we conduct an experiment comparing two models: i) Baseline Model: We directly use the available labeled data from the target dataset (with style-based annotations) and train an image captioning model end-to-end using the same architecture as ours (with ImageNet based pretrained weights), for 30 epochs. ii) AL-model: The Attribute-Looks model(AL-model) refers to our proposed method. Essentially, we first train our model using the labeled data from the source dataset (with attribute based annotations) in an end-to-end fashion for 30 epochs. Now, we use the same weights for the trained encoder, and fine-tune the model using the limited labeled data from the target dataset (with style-based annotations) for 30 epochs.
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  Results: Figure <ref> shows the empirical performance of both the approaches, using confusion matrices, and the corresponding per look precision and recall values are reported in Table <ref>. In Table <ref>, we also report the BLEU score to quantify the quality of image captions, and the accuracy over all the looks. A higher value of both these metrics indicates a better captioning performance, and both of these are computed in the range of 0-1.
  
  For a particular test image, we have a ground truth caption corresponding to one of the ground truth styles (eg, party, cocktail etc). We make use of our model to predict caption for a test image, and obtain the predicted style. Please note that the predicted style is inferred from the generated caption based on the presence of style key words in the caption (eg, party, cocktail etc). Using the ground truth and predicted styles for the set of test images, we can compute the performance metrics like precision, recall, and accuracy using standard definitions in a multi-class classification setting. For eg, to calculate accuracy, we can use the following formula: (TP+TN)/(TP+TN+FP+FN). Here, TP: True Positive, TN: True Negative, FP: False Positive, and FN: False Negative. Note that in Table <ref> we report the class-wise Precision and Recall values (in this case a class refers to a style). In Table <ref>, we report the accuracy across all the classes.
  
  The best performing method is shown in bold. The superiority of our proposed AL-model highlights the benefit of transfer learning employed by our model. Figure <ref> compares the captions generated by the baseline and our proposed method. The generated captions by our method are closer to the ground truth. We also show the attention maps corresponding to both the baseline and our approach, in Figure <ref>. We observed that the maps are more focused to specific regions of an image in our method. This eventually leads to the generation of better quality image captions by our method.
  
  Further details of the system: Following are some of the brief details of the proposed system: i) The hardware used was a Nvidia Tesla V-100 GPU, where the training time was around 2 days. ii) Our model was built for the dresses article type on our platform. iii) A pilot was run for around 8-9 months, based on which we figured out that this is a category of focus / emerging category in our geography. Also, studies have revealed that women consumers engage more when styling details are present in the Product Display Page (PDP).
  
  
  
  § RELATED WORK
  
  Before concluding the paper, we would also like to highlight some important developments in the probem of image captioning. It is a challenging problem that spans concepts from across image understanding as well as natural language generation. Encoder-decoder based deep models (as used in our paper) have shown state-of-the-art performance in image captioning [Yao et al., 2018]. In general, the de-facto approach is to exploit a Convolutional Neural Network (CNN) (eg., ResNet <cit.>) to encode image features, followed by a Recurrent Neural Network (RNN) (eg., LSTM <cit.>) to generate the caption statements with attention mechanism <cit.>.
  
  Considerable efforts have been made to obtain specific improvements. <cit.> incorporated object-oriented representations. By making use of textual attributes and image regions, some recent works have addressed the problem from a cross-modal point of view <cit.>. However, these approaches instead of comprehending general correlations among image parts, consider an image as unrelated parts <cit.>.
  
  Some recent works learn a visual relationship and context-aware attention for image captioning <cit.>. Recently <cit.>, presented a novel model to capture the second order interactions with channel-wise and spatial bilinear attention. <cit.> proposed a novel Transformer-based image captioning architecture.
  
  However, as observed, the discussed approaches aim at solving specific problems pertaining to the general image captioning problem by following sophisticated schemes. On the other hand, in our method we wanted to emphasize the transfer learning component, rather than addressing the advancement of image captioning. For this reason, we do not use a sophisticated image captioning model. To the best of our knowledge, our application of the image captioning model to perform transfer learning in the fashion application discussed in our paper is novel on its own. The major contribution of the paper can be seen as the study of the correlation among the low-level attributes and higher level styles, and its empirical establishment, by means of both qualitative as well as quantitative observations. We believe, this could open up newer studies to further leverage such correlations present within fashion article information.
  
  
  
  § CONCLUSIONS
  
  In this paper, we propose a simple, yet effective, transfer learning based approach to address the issue of style-based image captioning for a target dataset. We employ an attention-based image captioning model using an encoder-decoder to obtain style-based captions for an apparel. Because of the correlation among low-level attributes and higher-level style of an apparel, we first train the model on a source dataset with attribute-based ground truth captions. The latent representations obtained by the encoder helps in transfer learning of attribute information to the higher level style-based caption generation. We establish this fact by comparing our model with another version of our model with the same architecture, but without pretraining on the source dataset with attribute information. The captions generated by our model are closer to the actual ground truths, thus showing the benefit of transfer learning. Our method could be used to provide additional style-based captions for fashion apparel, thus improving the overall customer experience, and possibly increasing add-to-cart ratio.
  
  
  
  § ACKNOWLEDGEMENT
  
  We would like to thank our colleague Anoop KR for his contribution in reviewing the core of our work and sharing his insights. We are also grateful to our manager Ravindra Babu for his support and in being a source of inspiration and encouragement throughout the project.
  
  
  
  
  
  