Fair Contrastive Learning for Facial Attribute Classification

Sungho Park, Jewook Lee, Pilhyeon Lee, Sunhee Hwang, Dohyung Kim, Hyeran Byun

TL;DR

This paper introduces Fair Supervised Contrastive Loss (FSCL), a novel approach to prevent contrastive learning models from inheriting and amplifying biases found in training data. By redefining how models "contrast" different images and introducing group-wise normalization, the authors achieve a superior trade-off between classification accuracy and fairness compared to existing state-of-the-art methods.

What Problem Does This Paper Address?

Supervised Contrastive Learning (SupCon) has recently outperformed traditional cross-entropy methods in image classification by learning to pull similar images together and push different ones apart in a high-dimensional space. However, the authors identify a significant ethical risk: these models often achieve high accuracy by latching onto "sensitive attributes" (like gender, age, or ethnicity) as shortcuts.

For example, if a dataset contains a correlation between gender and a target attribute like "attractiveness," a standard SupCon model will learn to use gender as a proxy for the target. The authors mathematically prove that learning these sensitive attributes actually helps minimize the standard SupCon loss, effectively rewarding the model for being biased. Furthermore, data imbalances between demographic groups lead to disparities in how well the model represents majority vs. minority groups.

Methods

The authors propose two main interventions to create FSCL+:

  1. Fair Supervised Contrastive Loss (FSCL): Standard contrastive learning pushes an "anchor" image away from all images of different classes. FSCL changes this by specifically selecting negative samples that share the same sensitive attribute as the anchor. By forcing the model to distinguish between two images that share a sensitive attribute but belong to different target classes, the sensitive attribute becomes useless for the task. The model is thus forced to learn fairer, more relevant features.

    Figure 1. The concept of fair supervised contrastive loss (FSCL). It increases the similarity between an anchor and samples of the same target class (IG-SIM and SG-SIM). On the contrary, it decreases the similarity between the anchor and samples having different target classes and the same sensitive attribute, e.g., gender, (TG-SIM). Here TSG-SIM is not directly affected by the loss.
  2. Group-wise Normalization: To combat data imbalance, the authors introduce a normalization factor that balances the loss based on the number of samples in each demographic group. This ensures the model doesn't prioritize the "compactness" of majority groups at the expense of minority ones.

Datasets

The method was evaluated on three primary datasets:

  • CelebA: A large-scale face attribute dataset (200k images) used to test fairness across attributes like gender and age.
  • UTK Face: Used to evaluate robustness against varying levels of data imbalance (gender, age, and ethnicity).
  • Dogs and Cats: A dataset modified to include color bias (e.g., mostly black cats and white dogs) to test the method's extensibility to general bias mitigation beyond human attributes.

Key Insights and Ideas

  • The "Incentivized Bias" Proof: The authors provide a mathematical proof (Theorem 1) showing that in a biased dataset, a model must learn sensitive attribute information to reach the global minimum of the standard SupCon loss. This highlights that unfairness isn't just a side effect; it's often baked into the optimization goal itself.
  • Strategic Negatives: The core "aha" moment is realizing that fairness can be improved by carefully choosing which samples the model is forced to "push away." If the model has to tell two people of the same gender apart, it can't use gender as a shortcut.
  • Visualizing Fairness: Using t-SNE visualizations, the authors show that standard SupCon clusters images by both target class and sensitive attribute. In contrast, FSCL+ clusters images almost exclusively by the target class, demonstrating that the representation has become "attribute-agnostic."
Figure 3. Qualitative comparison using t-SNE visualizations. It is clearly shown that FSCL+ (b) learns representation more inde- pendent of the sensitive attribute than SupCon (a).

Key Results

  • Superior Trade-offs: On the CelebA dataset, FSCL+ significantly reduced the Equalized Odds (EO)—a key fairness metric where lower is better—from 30.5 to 6.5 for certain attributes, while maintaining competitive accuracy (79.1% vs 80.5% for SupCon).
  • Robustness to Imbalance: In tests on UTK Face, as the data imbalance grew more severe, the fairness gap between FSCL+ and other methods widened, showing that the proposed method is particularly effective for highly skewed real-world data.

    Figure 4. Classification results on UTK Face. We measure classi- fication accuracy and equalized odds (EO) under different severity levels of imbalance (α). We set gender and ethnicity to the target class and sensitive attribute, respectively. Larger α indicates that the training set is more imbalanced.
  • Incomplete Supervision: The method remains effective even when only a small fraction (e.g., 5%) of the data has sensitive attribute labels, thanks to a pseudo-labeling strategy.

Limitations and Future Work

  • Label Dependency: While the authors showed success with limited labels, the method still fundamentally relies on having some sensitive attribute labels during training. Annotating these can be expensive or ethically sensitive.
  • Task Specificity: The current study is confined to image classification. The authors note that extending this to other tasks like object detection or image-to-image translation would require modifying the loss function and architecture.
  • Future Direction: The authors suggest that developing a "fair contrastive loss" that requires zero sensitive attribute labels would be a major breakthrough for the field.

Summary updated

BibTeX
@misc{park2022fair,
  author = {Sungho Park and Jewook Lee and Pilhyeon Lee and Sunhee Hwang and Dohyung Kim and Hyeran Byun},
  title = {{Fair Contrastive Learning for Facial Attribute Classification}},
  year = {2022},
  eprint = {2203.16209},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.16209},
}
Figure