{'fraction_non_alphanumeric': 0.0367718142432597, 'fraction_numerical': 0.012209531311539977, 'mean_word_length': 4.953954380729056, 'pattern_counts': {'":': 1, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Learning the Latent"Look": Unsupervised Discovery of a Style-Coherent Embedding from Fashion Images

What defines a visual style? Fashion styles emerge organically from how people assemble outfits of clothing, making them difficult to pin down with a computational model. Low-level visual similarity can be too specific to detect stylistically similar images, while manually crafted style categories can be too abstract to capture subtle style differences. We propose an unsupervised approach to learn a style-coherent representation. Our method leverages probabilistic polylingual topic models based on visual attributes to discover a set of latent style factors. Given a collection of unlabeled fashion images, our approach mines for the latent styles, then summarizes outfits by how they mix those styles. Our approach can organize galleries of outfits by style without requiring any style labels. Experiments on over 100K images demonstrate its promise for retrieving, mixing, and summarizing fashion images by their style.


Introduction
Computer vision methods that can understand fashion could transform how individual consumers shop for their clothing as well as how the fashion industry can analyze its own trends at scale. The scope for impact is high: fashion is already a $1.2 trillion USD global industry, popular social commerce websites like Chictopia and Polyvore draw millions of users, and online subscription services like Stitch-Fix blend algorithms and stylists to personalize shopping selections. In sync with these growing possibilities, recent research explores new vision methods for fashion, with exciting advances for parsing clothing [39,38], recognizing clothing, attributes [5,40], and styles [20,33], matching clothing seen on the street to catalogs [19,25,18,37,26], and recommending clothing [24,28,36,14,16].
Despite substantial progress on all these fronts, capturing the style-coherent similarity between outfits remains an important challenge. In particular, a visual representation with style coherency would capture the relationship between clothing outfits that share a "look", even though they may differ in their specific composition of garments.
A style-coherent representation would be valuable for i) browsing, where a consumer wants to peruse diverse outfits similar in style, ii) recommendation, where a system should suggest new items that add novelty to a consumer's closet without straying from his/her personal style, and iii) style trend tracking, where analysts would like to understand the popularity of items over time. Style coherency differs from traditional notions of visual similarity. The problem of style coherency sits between the two extremes currently studied in the literature: on one end of the spectrum are methods that seek robust instance matching, e.g., to allow a photo of a garment seen on the street to be matched to a catalog [19,25,18,37,26] (see Figure 1(a)); on the other end of the spectrum are methods that seek coarse style classification, e.g., to label an outfit as one of a small number predefined categories like Hipster, Preppy, or Goth [20,33] (see Figure 1(b)). In contrast to these two extremes, style coherency refers to consistent fine-grained trends exhibited by distinct assemblies of garments. In other words, coherent styles reflect some latent "look". See Figure 1(c).
We propose an unsupervised approach to learn a stylecoherent representation. Given a large repository of unlabeled fashion images, the goal is to discover the latent factors that naturally guide how people dress-that is, the underlying compositions of visual attributes that define styles. To this end, we explore probabilistic topic models. Topic models in natural language processing [3,31] represent text documents as distributions over concepts, each of which is a distribution over words. In our case, an outfit is a "document", a predicted visual attribute (e.g., polka dotted, flowing, wool) is a "word", and each style is a discovered "topic". Furthermore, we consider polylingual topic models [29] in order to model style consistency across multiple regions of the body, enforcing that the discovered style factors for each region of the body should interact compatibly. Our idea makes it possible to organize galleries of outfits by style without any style labels. Building on the proposed model, we develop methods to mix styles or summarize an image gallery by its styles.
The proposed approach is well-suited for the problem at hand, for several reasons. First, being unsupervised, our algorithm discovers the underlying elements of style, as opposed to us manually defining them. It is often difficult to manually craft labels, especially in the domain of fashion. Clothing styles emerge organically from instances of what people choose to wear-not from some top-down preordained bins of outfit types-and furthermore they evolve over time, meaning today's hand-crafted lexicon will eventually fade in relevance. Secondly, our approach accounts for the fact that style is about the Gestalt: individual items do not dictate a style; rather, it is their composition that creates a look [2]. Finally, our topic model approach also naturally accounts for the soft boundaries of style, describing outfits as mixtures of overlapping styles.
Our experiments on two challenging fashion datasets [20,26] demonstrate the advantages of our unsupervised representation compared to style-based CNNs and more basic attribute descriptions. We validate that our styles align well with human perceived styles. We further show their value for retrieval, mixing, and summarization. As a secondary contribution, we introduce a new dataset of 19K images labeled for fine-grained, body-localized attributes relevant for fashion analysis.

Related Work
Attributes for fashion Describable attributes, such as floral, denim, long-sleeved, are often of interest in analyzing fashion images. Prior work explores a variety of recognition schemes [9,40,5,4,26,7], including ways to jointly recognize attributes [40,5] or simultaneously detect clothing articles and attributes [4]. In our work, attributes serve as a starting point for discovering styles (i.e., the "words" in our topic model), and improvements in attribute prediction from work like the above would also benefit our model.
Retrieval and matching for clothing Given an image of a garment, clothing retrieval methods identify exact or close matches, which supports shopping needs. Clothing deformations and complex body poses make retrieval challenging, so researchers develop ways to learn the similarity of outfits or garments [12,25,18,37,23]. Matching clothing seen "on the street" to instances stored in catalogs "at the shop" requires new ideas in domain adaptation [19,15,18,25]. Existing methods are largely supervised, i.e., provided with street-shop pairs or pairs of outfits judged as similar by human annotators. In contrast, we develop an unsupervised approach that can leverage ample unlabeled data. More importantly, whereas retrieval work aims to match the same (or similar) garment(s), we aim to identify style-coherent complete outfits.
Models of style, fashionability, compatibility Previous work offers a few perspectives on the meaning of visual style. The Hipster Wars project defines five style categories (Hipster, Goth, Preppy, Pinup, Bohemian) and recognizes them based on patches on body part keypoints [20]. Another approach pre-trains a neural network for style using weak meta-data labels [33]. Compared to the retrieval work above, both (like us) aim to capture a broader notion of style. However, unlike [20,33] we treat styles as discoverable latent factors rather than manually defined categories, which has the advantages discussed in the Introduction.
Whereas style refers to a characterization of whatever it is people wear, compatibility refers to how well-coordinated individual garments are [36,16,24], and fashionability refers to the popularity of clothing items, e.g., as judged by the number of "like" votes on an image posted online [32]. Recent work explores forecasting the popularity of styles [1].
Topic models Topic models originate in text processing. The well-known topic model Latent Dirichlet Allocation (LDA) [3] and its polylingual extension [29] use multinomial distributions to represent the generation of documents comprised of words. Polylingual topic models are applied to Web fashion data in [35] to discover links between textual design elemen meta-data and textual style meta-data, with no computer vision. Early uses of topic models in vision relied on "visual words" (quantized image patches) to discover representations for scene recognition [10] or perform object category discovery in unlabeled images [34]. More recently, topic models are used to recommend a colorcoordinating garment in [16]. To our knowledge, we are the first to propose discovering visual styles for outfits using topic models. Deriving topic models on top of semantic visual attributes is also new, and has the added benefit of yielding interpretable latent topics.

Approach
After providing background on topic models in Section 3.1, we introduce our visual fashion topic model in Section 3.2. Next in Section 3.3 we overview the fine-grained localized attributes used in our model. Finally, we leverage the learned style-coherent embedding for retrieval, mixing, and summarization tasks in Section 3.4.

Background: Topic models
We explore unsupervised topic models originating from text analysis to discover visual styles. In particular, we employ Latent Dirichlet Allocation (LDA) [3]. LDA is a Bayesian multinomial mixture model that supposes a small number of K latent topics account for the distribution of observed words in any given document. It uses the following generative process for a corpus D consisting of M documents each of length N i : Only the word occurrences are observed. Polylingual LDA [29] extends LDA (we will call it MonoLDA) to process an aligned corpus of documents expressed in multiple languages. The idea is to recover topics that preserve the ties between translated text. In particular, translated documents form a tuple, and all documents in a tuple have the same distribution over topics. Each topic is produced from a set of distributions over words, one distribution per language.

Discovering a style-coherent embedding
We propose to learn a style-coherent embedding using a topic model. In our setting, the latent topics will be dis-covered from unlabeled full-body fashion images, meaning images of people wearing an entire outfit (as opposed to catalog images of individual garments). In this way, we aim to discover the compositions of lower-level visual cues that characterize the main visual themes-styles-emerging in how people choose to assemble their outfits.
The basic mapping from document topic models to our visual style topic models is as follows: an observed outfit is a "document", a predicted visual attribute (e.g., polka dotted, flowing, wool) is a "word", and each style is a discovered "topic".
A potential limitation of this mapping, however, is that it treats an outfit as a bag of attributes. Thus it loses valuable information about the attributes' associated articles of clothing. For example, learned topics could interchange the appearance of wool pants with a wool jacket, when the two may in reality signify distinct latent styles. A partial solution is to specify localized attributes. For example, we could expand wool to wool pants and wool jacket. However, this expansion may suffer from allowing LDA to decouple topics across different regions of the body. For example, in Figure 3 (left), MonoLDA dedicates topic 1 to shirt and topic 2 to skirt.
Thus, we consider a polylingual LDA (PolyLDA) model [29]. In this case, each region of the body is a "language", and an outfit is a "document tuple" in multiple languages. As above, latent styles are topics and inferred clothing attributes are words. The body regions (denoted as R) we consider are: outer layer (i.e., where a jacket or blazer goes), upper body (shirt/blouse/sweater), lower body (pants/skirt/shorts), and hosiery (tights/leggings). The polylingual topic model adds a structural constraint that forces body regions to share styles, such that we can learn styles consistent across body regions. The generative process of PolyLDA is as follows: Figure 2 shows the associated graphical model. In contrast to MonoLDA, PolyLDA captures the interaction of garment regions, such that each style specifies a full-body trend (Figure 3, right). By applying PolyLDA to a database of unlabeled outfit images, we obtain a set of discovered styles (see Figure 7 in our experiment section for examples) with which to encode novel images. Each topic k has its attribute probability ϕ (r) k depending on body region r. Given an outfit d, we represent it in a style-coherent embedding by its topic proportions: where θ dk ≥ 0, Σ k θ dk = 1. The resulting embedding accounts for the fact that a composition of style elements defines a look [2].
We stress that our style-coherent embedding is fully unsupervised. Our method discovers styles from unlabeled images, as opposed to learning a style embedding with supervision. For example, one could gather pairs of fashion images and ask human annotators to label them as similar or dissimilar in style (or use noisy tags as labels [33]), then learn an embedding that keeps similar pairs close. Or, in the spirit of [19], one could train classifiers to target a predefined set of style categories. While the attribute models are trained on a disjoint pool of attribute labeled images, our style model runs on predicted attributes; annotators do not touch the images on which we perform discovery. Our unsupervised strategy saves manual effort. More importantly, it also addresses challenges specific to visual styles-namely, their ever-evolving nature, the difficulty in enumerating them with words, and their soft boundaries.

Fine-grained localized fashion attributes
We next discuss our approach to infer attributes in fullbody fashion images. We consider both global and local- Vocabulary and data collection As input to our style discovery model, we need a rich attribute vocabulary that is both localized and fine-grained. In existing fashion datasets, the attributes lack one or both of these aspects [4,5,9,40] or are not publicly available [25]. Thus, we curate a new dataset for attribute training.
For the vocabulary, we build on the 53 attributes enumerated in [25]. First we remove those too subtle for most annotators to discern (chiffon; jewel collar). Then we add missing but frequently appearing attributes (e.g., pink; polkadot). Finally, we expand the set so that color, material, and pattern are localized to each body region. This yields 195 total attributes (see Supp for details).
To gather images, we use keyword search with the attribute name on Google, then manually prune those where the attribute is absent. This yields 70 to 600 positive training images per attribute. We also gather 2000 random street images from chictopia.com (manually pruned for false-negatives) to serve as negative examples. In total, the new dataset has 18,878 images. 1 Training with multilabel outfits The clothing outfit images are multilabel in terms of their attributes. To circumvent the expense of labeling all 19K images for all 195 attributes, and to deal appropriately with highly localized attributes, we develop a piecewise training procedure. First we group the attributes into six types: pattern, material, shape, collar type, clothing article, and color. The types and all others from other keywords as negatives, while still yielding predictions at test time that are multilabel. We find it is also important during training to have negatives with none of the named attributes present, since such outfits are rather common.
Our attribute learning framework accounts for the challenge that many attributes occupy a small portion of a fashion image. First, we detect people using faster-RCNN [30], and extract a crop from the detected person bounding box according to whether the image is a training image for an upper or lower body attribute. We give the network both the whole-body person box and the crop as two instances with the same attribute label, allowing it to leverage any useful cues. We fine-tune our attribute prediction networks (one per type for the first four types) on ResNet-50 [13] pretrained with ImageNet [8].
For both the clothing article and color types, we train a segmentation network. For both, we fine-tune DeepLab's [6] repurposed VGG-16 network and apply DenseCRF [22]. The networks target 27 pixel-wise clothing article labels and 13 pixel-wise color labels from the Fashionista data [38], respectively. At test time, we i) record the detected clothing article names, and ii) intersect the color and clothing semantic segmentations to produce articlespecific color attributes, e.g., shirt-color-blue (Fig. 5).
The resulting attribute classifiers offer a fairly reliable basis for style discovery. For the validation split of our 19K image dataset, they attain 90% average precision. Figure 6 shows attribute predictions on novel test images.

Using the style-coherent embedding
Our method produces a style-coherent representation for fashion images. Our experiments consider a few tasks leveraging this representation: Retrieval of style-related images For retrieval, the system is given a query image and must return database images  that illustrate similar style. Here we simply use our learned embedding to retrieve images close to a query image, i.e., nearest neighbors in the space of θ q for query image q.
Our embedding retrieves images that maintain style coherence with the query. While conventional embeddings (e.g., CNNs) can return the examples closest in appearance, our embedding can return those that are close in style. Whereas the former is preferable when doing street-to-shop visual matching [19,15,18,25], the latter is preferable for many browsing scenarios, e.g., to view recommendations related to past purchases.
Mixing and "traversing between" styles A new task supported by our approach is to mix fashion styles. In this scenario, a user identifies T styles of interest S := {S 1 , . . . , S T }, S t ∈ {1, . . . , K}, and queries for images that exhibit a blend of those styles. For example, the user could manually select styles of interest by viewing images associated with each discovered style, or the styles for mixing could be automatically discovered based on the dominant styles in his photo album or shopping history. We measure the relevance of an image I i as: where θ i is the style embedding for I i . The min assures that an image is only as relevant to the requested style mix as it is close to its most distant style. Similarly, we can offer new browsing capabilities by depicting a gradual transition from one style to another (see Figure 9).
Summarizing styles A third application uses our stylecoherent embedding to summarize the styles in an image collection. Given images {I 1 , . . . , I N }, we calculate the relative influence of each style k as Influence(S k ) = N i=1 θ ik . With these frequencies we can visualize the collection compactly by sampling images dominant for each influential style (Figure 11 in our experiment section).

Experiments
We first show that our discovered topics align with human-perceived styles (Section 4.1). Then, we apply the embedding for retrieval (Section 4.2), mixing (Section 4.3), and summarizing styles (Section 4.4).
Datasets We use two datasets: (i) HipsterWars [20], which has 1,893 images, each labeled by one of 5 style labels: Hipster, Preppy, Goth, Pinup, Bohemian; (ii) Deep-Fashion [26], from which we take all 108,145 images that have at least one of the 230 style labels and a fully-visible person. Because the 230 style labels in DeepFashion are noisy labels, we collapse them into 42 higher level styles by affinity propagation [11] using cosine similarity to measure co-occurrence of styles in an outfit (see Supp). We use the attribute networks trained with our new 19K image dataset (Section 3.3) to predict the attributes in the HipsterWars and DeepFashion images.
Baselines We compare with four baseline: (i) StyleNet [33]: a state-of-the-art feature for clothing that fine-tunes a CNN using 123 metadata labels (e.g., redsweater) on images from the Fashion 144K dataset [32], (ii) vanilla ResNet-50 [13]: the last layer of a state-of-the-art CNN pretrained for ImageNet, (iii) Attr-ResNet: ResNet-50 fine-tuned to classify the same 148 attributes 3 used by our method with the same training data, and (iv) Attributes: indicator vectors using the same attributes as our model.

Consistency with human labeled styles
First we analyze how well our discovered styles align with human perception, as captured by the datasets' style labels (never seen by our approach). We use two metrics: (i) Normalized Mutual Information (NMI), which captures the overall alignment of topics with ground truth (GT) styles; and (ii) averaged maximal average precision (AP) per style, which uses each topic's probability as a relevance score for a style to sort all images, then records the AP per topic per style. The best (max) AP a style has in all topics is that style's final score. We average the max AP scores of all styles (5 in HipsterWars and 200+ in DeepFashion) to get "avg maximal AP". To extract clusters for the baseline representations we use K-means clustering. We also tried GMM and AP-clustering and found the clustering algorithm itself has negligible impact on their results. For all methods, we set the number of clusters/topics to be the number of style labels in the respective dataset.
First we examine the impact of our polylingual model. Table 1 shows the results for both LDA variants on Hip-sterWars. Here we use ground truth attributes, in order to evaluate the LDA models independent of attribute prediction quality. We see that the polylingual model has an advantage, and thus adopt it as our model for all experiments.
Next we quantify discovery accuracy for our approach against the baselines. Table 2 shows the results on both datasets. For the attribute-indicator baseline and our approach, we show results with predicted and ground truth attributes in order to separate the success of discovery from the success of attribute prediction. 4 Overall, PolyLDA is the strongest. Both PolyLDA and Attributes perform better with perfect attributes, reinforcing that attribute precision is an important ongoing research challenge [40,5,4]. However, even with predicted attributes, we outperform all baselines on both datasets for both metrics. Despite having been pretrained to capture noisy fashion labels, the StyleNet CNN [33] does not discover the human-perceived styles as well, though it does soundly outperform the vanilla ResNet baseline. Attr-ResNet falls in between StyleNet and vanilla ResNet, as expected. The absolute accuracy on DeepFashion is much lower for all methods, a function of its larger size and more varied and noisy style labels. Whereas the Hipster style labels are manually curated through a rigorous crowdsourcing procedure [20], the DeepFashion style labels are gleaned from text meta-data [26]. Figure 7 shows the most central images for our discovered styles on HipsterWars (see Supp for DeepFashion).
The qualitative examples reinforce the quantitative result above. Our model discovers the human-perceived stylesbetter than the CNN and attributes clusters (see Supp). Our style-coherent embedding better tolerates superficial visual differences in intra-style images.

Style-coherent retrieval
Having shown that the discovered styles are meaningful, next we evaluate the style embedding for retrieval. In this task, a user queries by example for images related by style, e.g., for recommendation or catalog browsing relative to some currently viewed item (query). Recall, this is distinct from instance retrieval for near-duplicates. Thus, we evaluate performance simultaneously by style coherence and diversity or novelty. Diversity refers to the retrieved images' mutual visual dissimilarity with each other, and novelty refers to their collective dissimilarity to the query. The goal is to obtain retrieval results that maintain style coherence while avoiding redundancy. For style coherence, we evaluate NDCG [27] against ground truth style labels. For diversity/novelty, we learn a metric to mimic humanperceived dissimilarity, following [21]. In particular, we collect 350 triplets labeled by 5 human annotators and learn a ranking function [17] on top of the attribute and CNN descriptors that respects human-given judgments. Figure 8 shows the results for both datasets. For Hip-sterWars (top), we treat each image as a query in turn, and for DeepFashion (bottom) we sample 2,000 of the 108,145 images as queries. Our model offers a good combination of coherency and diversity/novelty. On HipsterWars, it maintains diversity/novelty while maintaining a similar or better level of coherence as the baselines. As before, predicted attributes diminish coherence, yet the topic model coherence appears to degrade more gracefully.

Mixing styles
Next we consider mixing styles. Since evaluation of mixing requires images labeled for multiple humanperceived styles as well as instances exhibiting exclusively one style, we collect a ground truthed test set of 177 Web images using the HipsterWars style names (see Supp). While our mixing approach (Sec 3.4) can blend arbitrary   selected styles, for sake of evaluation we focus on blending pairs of GT-labeled styles, then score the AP against the ground truth, i.e., images exhibiting both the initial selected styles. For the baselines, we use their clusters analogously to our topics, creating K-dim embeddings that record the distance of the image to each cluster's centroid. We use K = 25 topics/clusters; K ∈ (15, 30) gives similar results. Table 3 shows the results. On the whole, our approach does better than the baselines, and in most cases this is true even using predicted attributes. This result highlights the power of the topic model over the raw attributes, which are too low-level for adequate mixing. Figure 10 shows example images predicted as strong exemplars for two style blends. Figure 9 shows an example gradually mixing from a source style to a target style.

Style summaries
Finally, we demonstrate the power of our model to organize galleries of outfits. As proof of concept, we select two users from chictopia.com, and download 200 photos from each of their albums. Figure 11 shows the results. We show    snapshots from their albums along with summary piecharts computed by our approach to highlight the dominant styles. Gray pie slices indicate insignificant styles for a user. Our summaries convey the user's tastes in a glance. In contrast, the status quo would entail manually paging through all 200 photos in the album in an arbitrary order.

Conclusion
This work explores unsupervised discovery of complex styles in fashion. We develop an approach based on polylingual topic models to model the composition of outfits from visual attributes. The resulting styles offer a fine-grained representation valuable for organizing unlabeled fashion photos beyond their superficial visual ties (e.g., same literal garments or attributes). While by necessity our results rely on external style labels for evaluation, we stress that the generality of the discovered styles is an asset, and they offer representational power beyond what traditional (supervised) classification schemes can do. Our example results highlighting blended styles, trajectories between styles, and style summaries suggest a few such applications of interest.