Abstract
Self-supervised learning (SSL) has become a cornerstone of modern AI, enabling models to learn robust representations from unlabeled data. However, standard contrastive SSL methods often inadvertently capture sensitive attributes—such as race or gender—as "shortcuts" for distinguishing data points, leading to biased downstream predictions. This paper introduces Conditional Contrastive Learning (CCL), a novel pre-training strategy that conditions the contrastive objective on sensitive attributes. By sampling positive and negative pairs from within the same sensitive group, CCL incentivizes the model to learn features independent of the sensitive variable. Empirical evaluations across seven datasets demonstrate that CCL significantly mitigates bias and, in many cases, improves downstream accuracy compared to standard SSL baselines.
Introduction: The Shortcut Problem in SSL
Contrastive SSL works by teaching a model to pull "positive pairs" (different views of the same image) together and push "negative pairs" (different images) apart in an embedding space. A critical flaw in this paradigm is that models are prone to learning the simplest visual features to satisfy this objective. If a dataset contains sensitive attributes like gender, the model may use them as easy discriminators.
As illustrated in Figure 1, if a negative pair consists of individuals of different genders, the model learns gender-related shortcuts rather than more nuanced semantic features. This results in an embedding space where sensitive attributes are highly separable, leading to biased and unfair predictions in downstream tasks like hiring or credit scoring.
Methodology: Conditional Contrastive Learning
The proposed Conditional Contrastive Learning (CCL) framework modifies the sampling process to "blind" the model to a known sensitive attribute $Z$ (e.g., race or gender).
1. Conditional Sampling
During pre-training, CCL ensures that both positive and negative pairs are sampled from the same sensitive group. By only asking the model to distinguish between individuals who share the same sensitive attribute, the model is forced to ignore that attribute and focus on other distinguishing characteristics.
2. Information Theoretic Grounding
While standard contrastive learning (e.g., InfoNCE) maximizes the Mutual Information (MI) between views $X$ and $Y$—which often includes sensitive information—CCL targets the Conditional Mutual Information (CMI), denoted as $I(X; Y | Z)$. By conditioning on $Z$, the model is mathematically incentivized to capture features shared between views that are independent of the information provided by the sensitive variable.
Experimental Results
The researchers evaluated CCL across seven diverse datasets, including tabular fairness benchmarks (Adult, Compas, Crime, German, Law School) and vision datasets (CelebA, UTKFace).
Fairness and Accuracy
CCL significantly outperformed the SimCLR baseline across all fairness metrics, including Demographic Parity ($\Delta_{DP}$) and Equalized Odds ($\Delta_{EO}$). For instance, on the Adult dataset, the fairness gap ($\Delta_{DP}$) was reduced from 0.210 to 0.110.
Crucially, CCL challenges the assumption that fairness requires an accuracy trade-off. In many cases, by removing the "noise" of sensitive attributes, the model focuses on more robust features, leading to better downstream accuracy than standard unsupervised methods. On 4 out of 5 tabular datasets, CCL achieved state-of-the-art accuracy among self-supervised baselines.
Visualizing Representation Blindness
t-SNE visualizations of the embedding space provide striking evidence of CCL's effectiveness. In standard SimCLR, male and female samples form distinct, easily separable clusters. In contrast, CCL produces an intertwined embedding space where gender groups are visually inseparable, confirming that the model has effectively "forgotten" how to distinguish the sensitive attribute.
Conclusion
Conditional Contrastive Learning provides a powerful yet simple framework for improving fairness in self-supervised learning. By leveraging conditional sampling and CMI maximization, CCL effectively removes undesirable information from representations without sacrificing performance. While the current implementation requires labeled sensitive attributes during pre-training, it represents a significant step toward developing unbiased AI systems that do not rely on discriminatory shortcuts.
Summary updated