NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

Biased Binary Attribute Classifiers Ignore the Majority Classes

Xinyi Zhang, Johanna Sophie Bieri, Manuel Günther · DOI

Abstract

Binary facial attribute classifiers are ubiquitous in computer vision, yet their performance is often masked by significant class imbalances in training data. This paper investigates how these models make decisions, revealing a startling "shortcut": when trained on imbalanced data, models frequently ignore the image content entirely to predict the majority class, relying instead on bias neurons or image corners. By adapting Class Activation Mapping (CAM) for binary outputs and employing balanced training techniques (AFFACT-b), the researchers demonstrate that models can be forced to learn meaningful features for both majority and minority classes, significantly improving both fairness and interpretability.

Introduction

In computer vision, binary classification—determining the presence or absence of specific attributes like "Smiling" or "Wearing Hat"—is a foundational task. However, real-world datasets are rarely balanced. For instance, if 95% of training images show individuals without hats, a model can achieve 95% accuracy by simply predicting "no hat" for every input. While the existence of such bias is well-documented, the internal mechanisms of how these models arrive at these biased decisions have remained opaque.

Standard interpretability tools, such as Class Activation Mapping (CAM), are typically designed for multi-class categorical models using SoftMax layers. Binary classifiers, which often utilize a single output neuron, do not translate directly to these methods. This research bridges that gap, providing a framework to visualize what binary classifiers are actually "looking at" and how data imbalance fundamentally breaks the learning process.

Methodology

Binary-Adapted CAM

To visualize the decision-making process of binary classifiers, the authors introduced a technical adaptation of gradient-based CAM. For a binary logit $z$, they propose using the gradient of the absolute value of the logit: $\partial |z| / \partial f_k$. This modification allows the visualization to highlight regions that contribute to a "positive" prediction (when $z > 0$) as well as those contributing to a "negative" prediction (when $z < 0$). This is crucial for understanding why a model might decide an attribute is absent.

Balanced Training (AFFACT-b)

To contrast biased models with fairer alternatives, the authors utilized the AFFACT architecture integrated with the MOON (Mixed Objective Optimization Network) debiasing technique. This approach employs attribute-specific class weights within a Euclidean loss function, ensuring that the minority class carries sufficient weight during the optimization process to prevent it from being ignored.

Evaluation Metrics

The study introduced Proportional Energy to quantify interpretability. This metric measures the ratio of the model's visual attention (activation) that falls within a manually defined mask relevant to the attribute (e.g., the mouth area for the "Smiling" attribute).

Experimental Setup

The researchers utilized the CelebA dataset, a benchmark containing over 200,000 celebrity images with 40 facial attributes. These attributes range from nearly balanced (e.g., "Attractive") to highly imbalanced (e.g., "Bald" or "Mustache"). To ensure the clarity of the CAM visualizations and avoid blurring caused by head poses, the test set was filtered to 10,458 frontal faces.

Key Insights

The "Default" Shortcut

The most significant finding is the discovery of the "default" shortcut in biased models (AFFACT-u). For highly imbalanced attributes, the model often fails to learn any features associated with the majority class. Instead, it predicts the majority class by focusing on the corners of the image or relying entirely on the bias neuron. In these cases, the model treats the majority class as a "background" state rather than a learned visual concept.

Minority Class Effort

Interestingly, even biased models tend to exert more "effort" to find relevant features for the minority class. Even when the model's overall accuracy is poor due to bias, its visual attention is often correctly localized (e.g., looking at the chin area when evaluating the "Goatee" attribute), suggesting that the model attempts to learn the rarer features even while defaulting on the common ones.

Bias Contamination

Because the models are often trained to recognize 40 attributes simultaneously, the "corner-looking" behavior learned for imbalanced attributes can "bleed" into more balanced attributes. This contamination degrades the overall interpretability of the entire network, not just the imbalanced categories.

Results

  • Quantitative Improvements: In the biased AFFACT-u model, the Proportional Energy for the majority class of the "Bald" attribute was nearly zero (0.001). After applying the balanced AFFACT-b training, this metric rose to 0.431, indicating the model had shifted its attention to the subject's head.
  • Error Distribution: The balanced model demonstrated a much more equitable distribution of False Negative Rates (FNR) and False Positive Rates (FPR). In contrast, the biased model showed near-zero error for majority classes but failed significantly on minority classes.
  • Visualization Clarity: The authors noted that HiResCAM and Element-wise Grad-CAM provided the most localized and clear visualizations for binary attributes, outperforming standard Grad-CAM or Grad-CAM++.

Conclusion and Future Work

This research serves as a wake-up call for the computer vision community, demonstrating that high accuracy in imbalanced binary classification can be a facade for models that aren't actually "looking" at the data. While balanced training (AFFACT-b) effectively forces the model to learn actual facial features, some limitations remain. Future research is needed to determine if these findings hold for non-CNN architectures like Transformers and to extend binary interpretability to non-gradient-based methods like Score-CAM.

Summary updated

Abstract

To visualize the regions of interest that classifiers base their decisions on, different Class Activation Mapping (CAM) methods have been developed. However, all of these techniques target categorical classifiers only, though most real-world tasks are binary classification. In this paper, we extend gradient-based CAM techniques to work with binary classifiers and visualize the active regions for binary attribute classifiers. When training an unbalanced binary classifier on a biased dataset, it is well-known that the majority class is mostly predicted much better than minority class. In our experiments on the CelebA dataset, we verify these results, when training an unbalanced classifier to extract 40 facial attributes simultaneously. One would expect that the biased classifier has learned to extract features mainly for the majority classes and that the proportional energy of the activations mainly reside in certain specific regions of the image where the attribute is located. However, we find very little regular activation for samples of majority classes, while the active regions for minority classes seem mostly reasonable and overlap with our expectations. These results suggest that biased classifiers only rely on bias activation for majority classes. When training a balanced classifier on the unbalanced data by employing attribute-specific class weights, positive and negative classes are classified similarly well and show expected activations for almost all attributes.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CelebA · Chubby (p_m=0.058AFFACT-b + HiResCAMProportional Energy (Pos)0.967Visual Explanation · attribute=Chubby · classifier=class-balanced · class-prevalence=0.058 · explanation-method=HiResCAM
Source quote
L571: HiResCAM │ 0.993 │ 0.688 │ 0.967 │ 0.951 \\*
CelebA · Chubby (p_m=0.058AFFACT-b + HiResCAMProportional Energy (Neg)0.951+0.17 vs baselineVisual Explanation · attribute=Chubby · classifier=class-balanced · class-prevalence=0.058 · explanation-method=HiResCAM
Source quote
L571: HiResCAM │ 0.993 │ 0.688 │ 0.967 │ 0.951 \\*
CelebA · Attractive (p_m=0.514AFFACT-b + HiResCAMProportional Energy (Neg)0.916+0.13 vs baselineVisual Explanation · attribute=Attractive · classifier=class-balanced · class-prevalence=0.514 · explanation-method=HiResCAM
Source quote
L416: HiResCAM │ 0.977 │ 0.784 │ 0.966 │ 0.916 \\*
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
CelebA · Chubby (p_m=0.058AFFACT-u + HiResCAM baselineProportional Energy (Pos)0.993Visual Explanation · attribute=Chubby · classifier=unbalanced · class-prevalence=0.058 · explanation-method=HiResCAM
Source quote
L571: HiResCAM │ 0.993 │ 0.688 │ 0.967 │ 0.951 \\*
CelebA · Chubby (p_m=0.058AFFACT-u + HiResCAM baselineProportional Energy (Neg)0.688Visual Explanation · attribute=Chubby · classifier=unbalanced · class-prevalence=0.058 · explanation-method=HiResCAM
Source quote
L571: HiResCAM │ 0.993 │ 0.688 │ 0.967 │ 0.951 \\*
CelebA · Attractive (p_m=0.514AFFACT-u + HiResCAM baselineProportional Energy (Neg)0.784Visual Explanation · attribute=Attractive · classifier=unbalanced · class-prevalence=0.514 · explanation-method=HiResCAM
Source quote
L416: HiResCAM │ 0.977 │ 0.784 │ 0.966 │ 0.916 \\*
BibTeX
@inproceedings{zhang2024biased,
  author = {Xinyi Zhang and Johanna Sophie Bieri and Manuel Günther},
  title = {{Biased Binary Attribute Classifiers Ignore the Majority Classes}},
  booktitle = {Sds},
  year = {2024},
  doi = {10.1109/sds60720.2024.00035},
}
Figure