Learning Unified Embedding for Apparel Recognition

Yang Song, Yuan Li, Bo Wu, Chao-Yeh Chen, Xiao Zhang, Hartwig Adam

Abstract

Researchers at Google have developed a two-stage learning framework to create a single, unified embedding model for apparel recognition that matches the performance of multiple specialized models. By using a "distillation-like" approach—training a student model with L2 loss to mimic the outputs of specialized "teacher" models—they achieved high retrieval accuracy across diverse categories (like shoes, dresses, and handbags) without the massive computational overhead of deploying separate networks.

Introduction

In computer vision, fine-grained recognition—distinguishing between very similar items like different types of summer dresses—is a significant challenge. Historically, the most effective approach has been specialization: building separate models for different product "verticals" (e.g., shoes, handbags, tops).

While specialized models offer high accuracy, they present substantial deployment hurdles. Maintaining ten different models for ten categories is computationally expensive, storage-intensive, and difficult to implement on mobile devices. Conversely, training a single "general" model on all data typically results in a performance drop due to the diverse feature distributions across categories. This research aims to bridge this gap, achieving the efficiency of a single model with the accuracy of a specialized ensemble.

Methodology

The proposed framework utilizes a two-stage training pipeline designed to consolidate specialized knowledge into a unified representation.

Overview of the apparel recognition pipeline, showing the transition from specialized models to a single unified embedding model.

Stage 1: Specialized Training with Triplet Loss

Initially, specialized embedding models are trained for individual verticals or small groups of compatible categories. These models use a standard Triplet Ranking Loss, which optimizes the feature space by pulling "anchor" images closer to "positive" matches and pushing them away from "negative" examples.

Stage 2: Unified Learning via L2 Distillation

The core innovation lies in the second stage. Rather than training a unified model from scratch using triplet loss—which is sensitive to sampling and difficult to converge—the authors use the specialized models as "teachers." A unified "student" model is trained using a simple L2 loss to replicate the embeddings produced by the specialized models. This distillation process makes training more stable and efficient.

The underlying architecture uses an Inception V2 base. An SSD (Single Shot MultiBox Detector) first localizes and classifies the apparel item, and the resulting crop is fed into the embedding network to produce a 256-dimensional vector.

Key Insights

  • Feature Space Consolidation: t-SNE visualizations revealed that specialized models occupy isolated regions of the feature space. The unified model acts as a consolidator, mapping all categories into a single, efficient space without interference.
  • The "Sweet Spot": While combining all data initially can hurt performance, certain categories (like dresses and tops) share enough features to be trained together effectively in the early stages.
  • L2 Loss Efficiency: By bypassing the complex "hard negative mining" required for triplet loss in the second stage, L2 distillation provides a much faster and more reliable path to convergence for the unified model.

Results

The unified model successfully matched or exceeded the performance of specialized ensembles across eight apparel categories.

Qualitative retrieval results across various apparel categories. Green boxes indicate correct matches for the query image on the left.
  • Retrieval Accuracy: On the "Where to Buy It" (WTB) task, the unified model achieved a Top-20 accuracy of 82.2% for bags and 80.8% for dresses, significantly outperforming previous benchmarks of ~37%.
  • Efficiency: The final model maintains the same complexity as a single specialized network, offering a massive reduction in storage and compute requirements.
  • Generalization: Interestingly, the unified model often showed superior generalization, likely due to the robust feature representations learned from seeing diverse apparel categories simultaneously during distillation.

Conclusion

This work demonstrates that knowledge distillation can effectively bridge the gap between specialized and general-purpose models in fine-grained recognition tasks. Future work includes automating the grouping of verticals and extending this unified embedding approach to other domains such as species identification or vehicle recognition.

Summary updated

BibTeX
@inproceedings{song2017learning,
  author = {Yang Song and Yuan Li and Bo Wu and Chao-Yeh Chen and Xiao Zhang and Hartwig Adam},
  title = {{Learning Unified Embedding for Apparel Recognition}},
  booktitle = {Workshops @ ICCV},
  year = {2017},
  doi = {10.1109/iccvw.2017.262},
}
Figure