Learning Spatial-Semantic Relationship for Facial Attribute Recognition With Limited Labeled Data

Ying Shu, Yan Yan, Si Chen, Jing-Hao Xue, Chunhua Shen, Hanzi Wang

Abstract

Facial Attribute Recognition (FAR) typically requires massive labeled datasets to achieve high performance. This paper introduces Spatial-Semantic Patch Learning (SSPL), a two-stage framework designed to improve FAR under extreme data scarcity. By leveraging large-scale unlabeled data through three auxiliary tasks—Patch Rotation (PRT), Patch Segmentation (PST), and Patch Classification (PCT)—the model learns robust spatial and semantic facial representations. Experimental results on CelebA and LFWA benchmarks demonstrate that SSPL achieves state-of-the-art performance with as little as 0.2% of labeled training data.

Introduction

Identifying diverse facial traits, such as "smiling," "wearing glasses," or "pointy nose," is a fundamental task in computer vision. However, the high cost of manual annotation for dozens of attributes across hundreds of thousands of images poses a significant barrier. Standard deep learning models often fail to generalize when labeled data is limited, as they struggle to capture the fine-grained relationships between localized facial regions.

Existing self-supervised methods often focus on global features, which lack the precision needed for localized attributes. To address this, the authors propose SSPL, which forces the model to learn both where facial features are (spatial) and what they represent (semantic) at a patch level.

Methodology: Spatial-Semantic Patch Learning (SSPL)

The SSPL framework operates in two distinct stages: multi-task pre-training on unlabeled data followed by fine-tuning on a limited labeled set.

Stage 1: Multi-Task Pre-training

The model utilizes a ResNet-50 backbone to process image patches. Three auxiliary tasks are performed simultaneously to build a comprehensive understanding of facial geometry:

  1. Patch Rotation Task (PRT): An image is divided into a grid, and one patch is randomly rotated. The model must identify the rotated patch, forcing it to learn the global spatial layout of a face.
  2. Patch Segmentation Task (PST): Using proxy labels from an off-the-shelf facial parser (BiSeNet), the model learns pixel-level segmentation within patches (e.g., distinguishing skin from hair or eyes).
  3. Patch Classification Task (PCT): A higher-level task where the model predicts the presence of specific facial components within a given patch.
The detailed architecture of the SSPL framework, illustrating the ResNet-50 backbone and the three auxiliary task branches (PRT, PST, PCT).

Stage 2: Fine-tuning

The pre-trained backbone is transferred to the target FAR task. The final layers are replaced with a classification head for 40 attributes and fine-tuned using a small fraction of labeled data. This stage benefits from the rich spatial-semantic features acquired during pre-training.

Experiments and Results

The researchers evaluated SSPL on the CelebA and LFWA datasets. To simulate real-world constraints, they tested scenarios with only 0.2% to 2% of the original labels.

Quantitative Performance

SSPL consistently outperformed supervised baselines and other self-supervised methods:

  • CelebA (0.2% labels): SSPL achieved 86.67% accuracy, compared to an 82.57% baseline.
  • LFWA (20% labels): The model reached 83.45% accuracy, nearly matching the performance of fully supervised models using 100% of the data.

Qualitative Analysis

Visualizations of the learned features show that SSPL captures much cleaner and more accurate facial component boundaries compared to models trained without the spatial-semantic auxiliary tasks. This precision is key to identifying fine-grained attributes.

Qualitative comparison of facial parsing results on CelebA and LFWA datasets with (w) and without (w/o) the proposed SSPL framework.

Discussion and Conclusion

The success of SSPL highlights that facial attribute recognition is inherently local. Combining rotation prediction with segmentation allows the model to learn the necessary pillars of facial geometry. While the method relies on proxy labels from external parsers like BiSeNet, it proves that "noisy" supervision is sufficient for learning transferable features. Future work may involve refining these proxy labels or exploring more complex spatial tasks to further improve performance in low-data regimes.

Summary updated

BibTeX
@inproceedings{shu2021learning,
  author = {Ying Shu and Yan Yan and Si Chen and Jing-Hao Xue and Chunhua Shen and Hanzi Wang},
  title = {{Learning Spatial-Semantic Relationship for Facial Attribute Recognition With Limited Labeled Data}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01174},
}
Figure