Embedding Label Structures for Fine-Grained Feature Representation

Xiaofan Zhang, Feng Zhou, Yuanqing Lin, Shaoting Zhang

Fine-grained image recognition presents a unique challenge in computer vision: distinguishing between subordinate classes that are visually nearly identical, such as specific car models (e.g., a 2012 vs. a 2014 Audi S4) or distinct food dishes sharing common ingredients. Standard Convolutional Neural Networks (CNNs) typically rely on softmax loss for classification, which excels at categorization but often collapses internal class structures in the feature space. Conversely, metric learning approaches like triplet loss capture similarity well but suffer from slow convergence and a lack of global category awareness.

This paper introduces a multi-task learning framework that bridges this gap by jointly optimizing for classification and similarity while explicitly embedding complex label structures—such as hierarchies and shared attributes—directly into the image features.

Multi-Task Joint Optimization

The core of the proposed method is a joint optimization strategy. Instead of treating classification and similarity as separate objectives, the authors define a total loss function as a weighted combination of softmax loss and a novel "generalized triplet loss."

The proposed multi-task learning framework jointly optimizes for classification and similarity using a parameter-sharing CNN and structured labels.

This architecture uses a parameter-sharing CNN to process training data. The softmax loss acts as a global regularizer, providing a stable guide that helps the similarity task converge significantly faster. While pure triplet loss is notoriously difficult to train due to the cubic growth of possible triplets ($N^3$), the inclusion of the classification task stabilizes the feature space during the early stages of training.

Embedding Structured Labels

A key innovation of this work is the move beyond binary "same/different" labels toward "structured labels" that reflect real-world relationships:

  1. Hierarchical Labels: For tree-like structures (e.g., Make > Model > Year), the authors utilize quadruplets ($r, p^+, p^-, n$). This ensures a reference image ($r$) is closest to its exact match ($p^+$), slightly further from a different model within the same broader category ($p^-$), and furthest from a completely different category ($n$).
  2. Shared Attributes: For overlapping labels, such as food ingredients, the network employs an adaptive margin. The distance the network enforces between two images is determined by their Jaccard similarity. If two dishes share 80% of their ingredients, the loss function allows them to remain closer in the feature space, preventing the model from overfitting on subtle, irrelevant noise.

Experimental Results

The framework was evaluated on three challenging datasets: Stanford Cars, Car-333 (a large-scale hierarchical dataset), and a newly introduced Fine-Grained Food Dataset containing nearly 1,000 menu items annotated with shared ingredients.

Quantitatively, the method achieved state-of-the-art results for models not using expensive part-based annotations. On the Stanford Cars dataset, it reached 88.4% classification accuracy and a 13.5% improvement in coarse-level retrieval precision compared to standard triplet-based methods.

t-SNE visualization of the learned feature space, demonstrating clearer class separation and more meaningful semantic clustering when label structures are embedded.

Qualitatively, t-SNE visualizations (as seen above) demonstrate that embedding label structures results in a much more discriminative and semantically meaningful feature space. Without label structures, classes often overlap or form fragmented clusters. With the proposed method, the distance between points in the feature space correlates directly to semantic relevance, with broader categories (like SUVs) forming large clusters containing distinct sub-clusters for specific models.

Conclusion

By integrating classification and structured similarity learning, this research provides a robust framework for fine-grained feature representation. The use of softmax as a regularizer addresses the efficiency issues of metric learning, while generalized triplets allow the model to respect the inherent hierarchies and attribute overlaps found in real-world data. Future work may explore methods to automatically discover these label structures from raw data, reducing the reliance on manual hierarchical annotations.

Summary updated

BibTeX
@inproceedings{zhang2016embedding,
  author = {Xiaofan Zhang and Feng Zhou and Yuanqing Lin and Shaoting Zhang},
  title = {{Embedding Label Structures for Fine-Grained Feature Representation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2016},
  doi = {10.1109/cvpr.2016.126},
}
Figure