Label2Label: A Language Modeling Framework for Multi-attribute Learning

Wanhua Li, Zhexuan Cao, Jianjiang Feng, Jie Zhou, Jiwen Lu

Abstract

Multi-attribute learning aims to predict several properties of an object simultaneously. Traditional methods often treat these as independent binary classification tasks, failing to capture complex instance-specific correlations. We present Label2Label, a novel framework that reformulates multi-attribute prediction as a language modeling task. By treating attribute labels as "words" in a descriptive "sentence" and employing an image-conditioned masked language model (IC-MLM), Label2Label learns to capture global attribute dependencies. The framework achieves state-of-the-art performance across facial, pedestrian, and clothing recognition benchmarks.

Introduction

In multi-attribute learning, the goal is to predict several properties of an object simultaneously (e.g., for a face: "smiling," "wearing glasses," "brown hair"). The core challenge is that these attributes are rarely independent; they exhibit high correlations. For instance, "beard" and "woman" are generally mutually exclusive, while "blond hair" and "heavy makeup" might frequently co-occur.

Traditional approaches typically use a multi-task learning framework with independent binary classifiers for each attribute. While some methods try to group attributes manually or use domain-specific priors, they often struggle to model instance-wise relationships—how attributes relate specifically within the context of a single, unique image. The authors aim to fill this gap with a generic, flexible framework that doesn't require task-specific manual tuning.

Comparison between existing multi-task learning and the proposed Label2Label framework.

Methods

The Label2Label framework consists of two primary stages that move from visual features to semantic "sentences":

  1. Attribute Query Network (AQN): This module uses a Transformer decoder to generate initial attribute predictions. It uses a set of learnable "query vectors" (one for each attribute) to pool relevant local features from the image. These initial guesses serve as "pseudo-labels."
  2. Image-Conditioned Masked Language Model (IC-MLM): Inspired by BERT, this module treats the pseudo-labels as a "sentence." During training, it randomly masks some of these labels. The model is then tasked with recovering the missing labels by looking at two things: the remaining unmasked labels (context) and the original image features (visual evidence).
Detailed architecture of the Image-Conditioned Masked Language Model (IC-MLM).

Key Innovation: Unlike standard language models that only look at surrounding words, the IC-MLM is "image-conditioned." This is crucial because a set of labels alone can be ambiguous; the image provides the ground truth necessary to resolve "one-to-many" mappings where the same partial label set could describe different objects.

Key Insights and Ideas

  • Labels as Semantic Tokens: Treating a list of labels as an unordered but meaningful "sentence" allows the model to leverage the powerful self-attention mechanisms developed for Natural Language Processing (NLP).
  • Refinement via Masking: The framework acts as a two-stage refinement process. The AQN provides a "rough draft," and the IC-MLM uses global attribute correlations to "proofread" and correct that draft.
  • Robustness to Noise: Because the IC-MLM is trained to recover masked tokens, it naturally becomes robust to incorrect predictions generated by the initial AQN stage.
  • Permutation Invariance: Unlike standard sentences, attribute lists have no inherent order. Omitting positional embeddings makes the model more effective, forcing it to focus purely on semantic co-occurrence.

Results

The authors evaluated Label2Label on three distinct multi-attribute tasks: LFWA (facial attributes), PA-100K (pedestrian attributes), and the Clothing Attributes Dataset. Label2Label achieved state-of-the-art (SOTA) results across all three benchmarks:

  • Facial Recognition (LFWA): Achieved a classification error of 12.49%, outperforming PS-MCNN (12.64%) and SSPL (13.47%).
  • Pedestrian Prediction (PA-100K): Reached a mean Accuracy (mA) of 82.24% and an F1 score of 87.08%, setting a new benchmark for the field.
  • Clothing Recognition: Attained a total accuracy of 92.87%, surpassing previous methods that used one dedicated CNN per attribute.

Ablation studies confirmed that "image-conditioning" was vital; a standard MLM (without image features) failed to improve upon the baseline AQN results.

Limitations and Future Work

While Label2Label sets new benchmarks, the use of Transformer decoders increases computational overhead (MACs) compared to simple linear classifiers, which may be a factor for real-time edge deployment. Additionally, the current implementation focuses primarily on binary attributes. Future directions include extending this "label-as-language" perspective to more complex, hierarchical label structures and other multi-label tasks such as general object detection or scene graph generation.

Summary updated

BibTeX
@inproceedings{li2022label,
  author = {Wanhua Li and Zhexuan Cao and Jianjiang Feng and Jie Zhou and Jiwen Lu},
  title = {{Label2Label: A Language Modeling Framework for Multi-attribute Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19775-8\_33},
}
Figure