F AIRNESS - AWARE C ONTRASTIVE L EARNING WITH P ARTIALLY A NNOTATED S ENSITIVE A TTRIBUTES
Anonymous authors
Paper under double-blind review
A BSTRACT
Learning high-quality representation is important and essential for visual recognition.
Unfortunately, traditional representation learning suffers from fairness issuessince the model may learn information of sensitive attributes.
Recently, a series ofstudies have been proposed to improve fairness by explicitly decorrelating targetlabels and sensitive attributes.
Most of these methods, however, rely on the assumption that fully annotated labels on target variable and sensitive attributes areavailable, which is unrealistic due to the expensive annotation cost.
In this paper,we investigate a novel and practical problem of F air U nsupervised R epresentation
L earning with P artially annotated S ensitive labels (FURL-PS).
FURL-PS has twokey challenges: 1) how to make full use of the samples that are not annotated withsensitive attributes; 2) how to eliminate bias in the dataset without target labels.
To address these challenges, we propose a general Fair ness-aware C ontrastive
L earning ( FairCL ) framework consisting of two stages.
Firstly, we generate contrastive sample pairs, which share the same visual information apart from sensitiveattributes, for each instance in the original dataset.
In this way, we construct a balanced and unbiased dataset.
Then, we execute fair contrastive learning by closingthe distance between representations of contrastive sample pairs.
Besides, we alsopropose an unsupervised way to balance the utility and fairness of learned representations by feature reweighting.
Extensive experimental results illustrate theeffectiveness of our method in terms of fairness and utility, even with very limitedsensitive attributes and serious data bias.
I NTRODUCTION
Learning powerful representation takes an important role in visual recognition, and there are a lot ofworks proposed to learn visual representations (Bengio et al., 2013; Kolesnikov et al., 2019; Wanget al., 2020a).
Among them, contrastive learning achieves state-of-the-art performance on variouscomputer vision tasks (Tian et al., 2020; Chuang et al., 2020).
Contrastive learning first generatesviews (patches) from original images by random data augmentation, and the views from the sameimage are defined as positive samples.
Then the model can learn effective representations by closingthe distance between representations of positive samples, while being protected from mode collapsevia an additional module such as negative samples (Chen et al., 2020a;
He et al., 2020; Chen et al.,2020b), momentum update (Grill et al., 2020), and stopping gradient (Chen & He, 2021).
Unfortunately, traditional representation learning methods ignore potential fairness issues, whichbecomes an increasing concern as recognition systems are widely used in the real world (Zemelet al., 2013; Madras et al., 2018; Creager et al., 2019).
For example, the model trained by contrastive learning may learn the information of sensitive attributes ( e.g., gender, race) by using it as ashortcut to minimize the distance between representations of positive samples in the training stage,since the positive samples have the same sensitive attributes.
As a result, decisions based on biasedrepresentation models may discriminate against certain groups or individuals in practice, by usingspurious correlations between predictive target and sensitive attributes (Wang et al., 2020b; Parket al., 2021).
Therefore, how to develop a fair representation model is of paramount importance forboth academic research and real applications.
Most of existing works achieve fairness via decorrelating target labels and sensitive attributes explicitly, which rely on the data annotations (Mehrabi et al., 2021; Zhu et al., 2022).
However, assuming that all data have fully annotated labels can be unrealistic (Jung et al., 2022; Zhang et al., 2020a;b).
In many real scenarios, the target labels and even downstream tasks are not provided, and all we haveare images and limited annotations of sensitive attributes.
Data labels require additional expensivecost of human annotations, which naturally leads us to ask the following question: Can we train afair unsupervised representation model with only partially annotated sensitive attributes?
In this paper, we investigate a practical and novel problem of Fair Unsupervised Representation
Learning with Partially annotated Sensitive attributes (FURL-PS).
Our goal is to utilize the imagesand limited sensitive labels to learn visual representations that can be used for various downstreamtasks of visual recognition, while achieving fairness by being minimally correlated with sensitive attributes.
It is challenging to solve the proposed problem.
Firstly, most samples are not labeled withsensitive attributes.
A natural idea is to pseudo-label the unlabeled data by a sensitive attribute classifier.
However, it is not advisable to train a representation model on the data with pseudo-sensitivelabels, since the noises in pseudo labels may severely affect the fairness performance.
Secondly,there may be data imbalance between demographic groups.
Assuming that the female group has alarge proportion of samples of blond hair, while the male group has the opposite proportion.
As aresult, the models trained on the above biased data may learn spurious correlation between genderand blond hair.
Unfortunately, it is difficult to balance the data distribution of different groups without the prior of downstream tasks or annotated target labels.
Generally, FURL-PS problem has twomain challenges:
1) How to make full use of the data that are not annotated with sensitive attributes?2) How to balance the possible agnostic bias in data without target labels?
To address these challenges, our idea is to construct a balanced dataset annotated with sensitivelabels based on the original dataset, and then train a representation model with fair contrastive learning on the unbiased dataset.
We propose a two-stage Fairness-aware Contrastive Learning ( FairCL )framework to implement the above idea.
In the first stage, we design a semi-supervised learningalgorithm to train the image attribute editor with limited sensitive labels, which is used to edit thepre-defined sensitive attributes of a given image.
In the second stage, we train a representation modelby fair contrastive learning with balanced augmentation.
Specifically, based on the image attributeeditor, we can generate contrastive sample pairs, which share the same visual information apart fromsensitive attributes ( e.g., male and female), for each sample in the original dataset.
By closing thedistance between representations of contrastive sample pairs, the model can learn powerful and fairrepresentations.
Our approach has two advantages: 1) we can get the utmost out of unlabeled images by generating samples with given sensitive attributes from them; 2) the augmented dataset isunbiased, since it consists of contrastive sample pairs and thus the data proportions are naturallybalanced for different demographic groups.
Furthermore, we also develop an unsupervised way tobalance the utility and fairness of learned representations by feature reweighting.
We validate the effectiveness of our method on two facial attribute recognition datasets: CelebA (Liuet al., 2018) and UTK-Face (Zhang et al., 2017).
Extensive experimental results show that the proposed method outperforms the existing unsupervised learning methods in terms of both classification accuracy and fairness, and even achieves comparable performance with the semi-supervisedmethods that require annotations on the target labels.
Besides, our method is robust to the ratio ofsensitive labels and severity of data bias.
Furthermore, we also show the extensibility of our generalframework to different contrastive learning algorithms through experiments.
Main Contributions: 1) To the best our knowledge, we are the first one to propose the practical andchallenging problem of Fair Unsupervised Representation Learning with only Partially annotated
Sensitive attributes (FURL-PS).
We develop the Fairness-aware Contrastive Learning ( FairCL )framework to solve the proposed problem, which can be compatible with all of contrastive learningalgorithms to learn a fair and powerful representation model.
3) Extensive experiments illustrate theeffectiveness of our proposed method in terms of fairness and utility.
R ELATED W ORK
Fairness in Unsupervised and Semi-supervised Learning.
There are three branches to guaranteefairness in unsupervised learning.
Firstly, fair feature selection, a pre-processing paradigm, findsa subset of features that preserve the original information as much as possible while being minimally correlated with sensitive attributes (Grgic-Hlaca et al., 2016;
Grgi´c-Hlaˇca et al., 2018; Xinget al., 2021).
However, this kind of methods is designed for structured data, and cannot be applied to images data and deep models.
Secondly, fair clustering balances the distribution of differentsubgroups formed by sensitive attributes in each cluster, but it cannot yield a model for variousdownstream tasks (Chierichetti et al., 2017; Kleindessner et al., 2019;
Li et al., 2020).
At last, somestudies based on fair representation learning have been bringing a paradigm for fair unsupervisedlearning (Louizos et al., 2015; Raff & Sylvester, 2018).
As for fair semi-supervised learning, mostexisting methods first pseudo-label the unlabeled data via a classifier, and then train a model on thesedata with fairness constraints (Jung et al., 2022; Zhang et al., 2020a;b).
However, the pseudo-labelnoise may exacerbate model unfairness in turn.
Instead, our proposed method does not directly usepseudo-labels when training the fair representation model.
Contrastive Learning.
Self-supervised contrastive learning provides a representation learningparadigm without target labels, and achieves better accuracy than the state-of-the-art methods onvarious tasks (Xiao et al., 2020).
Some methods such as SimCLR (Chen et al., 2020a) and MoCo (Heet al., 2020) first define the positive/negative samples as patches generated from the same/differentimages via random data augmentation, and then train a representation model by closing/pushingaway the distance between representations of positive/negative samples.
Recent studies argue thatnegative samples are not necessary for contrastive learning, and they use some techniques, e.g., momentum update (Grill et al., 2020) and stopping gradient (Chen & He, 2021) to protect the modelfrom mode collapse instead of negative samples.
Afterwards, supervised contrastive learning outperforms other state-of-the-art methods based on traditional cross-entropy loss (Khosla et al., 2020).
However, existing self-supervised contrastive learning methods ignore potential fairness issues.
Tothis end, FSCL proposes a fair supervised contrastive loss to train a fair representation model (Parket al., 2022).
However, FSCL relies on target labels and sensitive attributes.
Besides, FSCL is basedon supervised contrastive learning which needs negative samples, while our proposed framework isgeneral to be applied to any contrastive learning algorithm to improve fairness.
Image Generation.
Our proposed method involves the task of image attribute editing, which takesan image as input and aims to generate a new image with desired attributes while preserving otherdetails (Liu et al., 2019;
He et al., 2019; Dogan & Keles, 2020).
We emphasize that advances in thefield of image attribute editing can help improve the performance of our work, since the subsequentmethods can also be used here.
Some studies aim to construct a balanced and unbiased dataset bydata augmentation (Ramaswamy et al., 2021).
However, they need the prior of downstream task togenerate new samples.
Recent works have proposed to evaluate counterfactual fairness by generatingcounterfactual samples (Denton et al., 2019; Joo & K ¨ arkk ¨ ainen, 2020; Dash et al., 2022).
Differentfrom them, we consider a more challenging problem to train a fair representation model.
Moreover,we consider a more practical setting where there are no target labels and fully annotated sensitiveattributes.
M ETHOD
In this section, we start with a brief introduction of the problem formulation of FURL-PS and overallflow of our proposed method in Sec.
Then we display how to generate augmented samples ofdifferent sensitive attributes with limited annotated sensitive labels in Sec. 3.2.
We elaborate on howto execute fair contrastive learning with balanced augmentation in Sec. 3.3.
Lastly, to balance thetrade-off between utility and fairness of learned representations, we propose a feature reweightingmodule for those sensitive attribute-dependent sub-features in Sec. 3.4.
3. P ROBLEM F ORMULATION AND O VERALL F LOW
Assume that we have n original images { x k } k
=1 , 2 ,..,n , where x k ∈ X ⊂ R d .
Labeled dataset isdenoted as D l = { x k , s k } n l k =1 , where n l is the number of images with annotated sensitive labels, ands k ∈ { 0 , 1 , ..., M S − 1 } represents the sensitive attribute label ( e.g., male and female).
Unlabeleddataset is denoted as D u = { x k } n k = n l +1 .
The target labels { y k } k
=1 , 2 ,..,n are not available in thetraining state, where y k ∈ { 0 , 1 , ..., M Y − 1 } .
In this paper, we assume that both target labelsand sensitive attributes are binary variables for convenience, i.e., M S = M Y
=
We emphasize,however, that our proposed problem and framework can be easily generalized to multivariate setting.
The goal is to train an effective and fair encoder network F ( · ) that maps the image x k ∈ X intorepresentation h k ∈ H , where the representations can be used for various downstream tasks whilenot discriminating against demographic groups with given sensitive attributes.
[Figure]
𝒕𝒉𝒓
[Figure]
𝒕𝒉𝒓
[Figure]
Our proposed method consists of two stages: 1) Contrastive Sample Generation and 2) Fairnessaware Contrastive Learning .
We first define the contrastive samples as a pair of images that sharethe same visual information except for sensitive attributes.
In the first stage, our goal is to preparecontrastive samples { ( x 0 k , x 1 k ) } k
=1 , 2 ,..,n based on the original dataset.
To achieve it, we design asemi-supervised algorithm to train an image sensitive attribute editor G ( · , · ) , which takes an imagex k and sensitive attribute s ∈ { 0 , 1 } as input and can map the original image to a new image x skwith given sensitive attribute s while keeping other information as unchanged as possible.
In thesecond stage, we execute fairness-aware contrastive learning on the augmented dataset to train arepresentation model F ( · ) without any target label or sensitive label.
3. C ONTRASTIVE S AMPLE G ENERATION WITH L IMITED S ENSITIVE A TTRIBUTE L ABELS
We start with training a generative model used to generate contrastive samples.
We implement itbased on AttGAN (He et al., 2019), but we emphasize that any approach designed for image attributeediting can be adapted to be a backbone method.
The training architecture of generative model Gis shown in Figure 1(a).
The encoder G enc maps an input image x to latent representation z .
Thenthe decoder G dec takes z and sensitive attributes as input, and generates images with correspondingsensitive attributes.
There are three loss optimized jointly: 1) discriminative loss l dis given by thediscriminator D guaranteeing that the generated images look realistic enough, 2) classification lossl cls guaranteeing that the generated images have given sensitive attributes, and 3) reconstruction lossl rec given by the classifier C encourages the generator to preserve the sensitive attribute-excludinginformation as much as possible.
Note that the sensitive labels are needed in the training stage of the image attribute editor G , whilewe only have limited annotated sensitive sensitive labels.
To this end, we develop a semi-supervisedlearning algorithm to train the sensitive attribute classifier and image editor by making them mutually promote each other.
We first train a classifier C and image editor G on the labeled data.
Then,as shown in Figure 1(b), we assign the predictive sensitive labels to the unlabeled data by C .
Weonly select pseudo-labeled samples with confidence cf ( i.e., Softmax output score) above a certainthreshold thr , and train the generative model G on them.
Afterwards, we use G to generate additional images with sensitive labels, of which high-confidence images are used to train the classifier C .
We repeat the above steps until there is no new high-confidence data.
Note that the classifier Cis used to pseudo-label the unlabeled data, thereby providing the generator G with more annotatedtraining data.
Meanwhile, the generator G also generates additional high-quality training data forthe classifier C .
In this way, the two can promote each other.
Please refer to Appendix A for thedetails of the above algorithm.
The discussion of hyper-parameter thr is in Appendix B. Here we get an image attribute editor G , based on which we can generate an augmented dataset{ ( x 0 k , x 1 k ) } k
=1 , 2 ,..,n from original dataset, even without the knowledge of the sensitive attributes ofthe original images.
It is worth mentioning that we only use pseudo-sensitive labels in the contrastivesample generation stage, which avoids the direct impact of pseudo-label noise on learning fair representation.
Furthermore
[Figure]
𝒙 𝒂
[Figure]
𝒂 ෝ𝒙 𝟐𝒂−
[Figure]
ෝ𝒙 𝟐𝒂
[Figure]
𝟐𝒂−
[Figure]
𝒙
[Figure]
Our proposed FairCL closes the distance between representations of positive samples ( i.e., the views from the same original image but have different sensitive attributes), and pushes away the distance between representations of negative samples ( i.e., the views from different original images but have the same sensitive attributes).
3. F AIRNESS - AWARE C ONTRASTIVE L EARNING WITH B ALANCED A UGMENTATION
Based on the balanced augmented dataset generated by the image attribute editor G , our goal is totrain a fair and powerful representation model.
To this end, we develop a fairness-aware contrastivelearning framework, and elaborate how it works based on SimCLR .
However, we emphasize thatour proposed general framework is not confined to SimCLR but can be easily applied to any contrastive learning algorithm.
The key idea is to define the positive samples as the contrastive sampleswith different sensitive attributes generated by the image attribute editor G , and define the negative samples as the views generated from the different images with the same sensitive attributes.
Based on it, for a minibatch of contrastive image pairs { ( x 0 k , x 1 k ) } k =1 , 2 ,..,N , we first generate views{ (ˆ x 02 k − 1 , ˆ x 02 k , ˆ x 12 k − 1 , ˆ x 12 k ) } k
=1 , 2 ,..,N by data augmentation.
An encoder F ( · ) maps the views intorepresentations { (ˆ h 02 k − 1 , ˆ h 02 k , ˆ h 12 k − 1 , ˆ h 12 k ) } k =1 , 2 ,..,N , then a projection head P ( · ) maps h k into another representations { (ˆ z 02 k − 1 , ˆ z 02 k , ˆ z 12 k [Equation] , ˆ z [Equation]
k ) } k
=1 , 2 ,..,N for contrastive learning.
Then we define 200 fairness-aware contrastive loss as:
[Equation]
where τ is a temperature parameter.
As shown in Figure 2, a fair and effective representation modelcan be trained on the balanced augmented dataset with the proposed fairness-aware contrastive loss.
3. B ALANCE U TILITY AND F AIRNESS VIA F EATURE R EWEIGHTING
There is often a trade-off between utility and fairness of representation (Zhao & Gordon, 2019).
To balance them without target labels, we propose the feature reweighting module.
Our idea isto identify the sensitive attribute-dependent sub-features and reweight them when computing thesimilarity/distance between representations in contrastive learning.
Intuitively, larger weights forthose sensitive attribute-dependent sub-features will result in a fairer model.
The challenge is to judge whether a sub-feature is related to a sensitive attribute.
Suppose thatwe train a linear classifier C probe to classify sensitive attributes, which takes the representationsgenerated by the fixed encoder F ( · ) and projection head P ( · ) as input.
An intuition is that thosesensitive attribute-dependent sub-features are easier to activate when predicting sensitive attributes,and the corresponding parameters of trained classifier C probe will have a larger absolute value.
Basedon it, we propose a simple but effective solution.
We alternately optimize the representation model
F ( · ) , P ( · ) and an additional linear classifier C probe .
We can strengthen the fairness constraint byassigning more weights to those sub-features where the absolute values of corresponding classifierparameters are large.
We use the soft selection which is more flexible and general.
Assuming that theparameters of C probe is ( θ 1 , θ 2 , ..., θ d ) , where d is the number of dimensions of latent representation.
Then we can compute the weights w = ( w 1 , w 2 , ..., w d ) of sub-features as:
[Equation]
where α ∈ R is a scaling parameter, and a larger α means a stronger fairness constraint.
Now wecan balance the utility and fairness of learned representation in fairness-aware contrastive learningvia the weights w as the following:
[Equation]
E XPERIMENTS4. E XPERIMENTAL S ETUP
Datasets.
We validate our method on the following datasets: 1) CelebA (Liu et al., 2018) is a datasetwith over 200k facial images, each with 40 binary attributes labels.
In this paper, we follow thesetting of the previous works (Park et al., 2022).
We select Male ( m ) and Young ( y ) as the sensitiveattributes, and set Attractive ( a ), Big Nose ( b ), and Bags Under Eyes ( e ) as target attributes, whichhave the highest Pearson correlation with the sensitive attributes.
Besides, to verify the performanceof our method in the setting of multi-target labels and multi-sensitive attributes, we also set { Male ,
Young } as sensitive attribute and { Big Nose , Bags Under Eyes } as target label.
The downstreamtask is unknown and only 5% sensitive attribute labels are available in the training stage.
2) UTKFace (Zhang et al., 2017) contains over 20k facial images, each with attributes labels.
We first definea binary sensitive attribute Young based on whether age is under 35 or not and construct a task topredict whether the facial image is Male or not.
We further validate the robustness of our method tothe ratio of sensitive labels and data bias on UTK-Face dataset. More details are in Appendix F.
Evaluation Metrics.
The goal of FURL-PS is to learn a fair and powerful representation model.
To validate the fairness and utility of the learned representations, we train a linear classifier on topof the frozen representation model and then use the test performance of the classifier as a proxy forrepresentation quality.
In this paper, we use Equal Odds (EO)
(Hardt et al., 2016), one of the mostcommonly used notion of group fairness (Dwork et al., 2012), as the fairness metric:
[Equation]
where (cid:80) is the averaged sum, Y is target label, ˆ Y is predictive label given by the classifier, ands 0 , s 1 ∈ S is the value of sensitive attributes.
Following (Jung et al., 2022), we extend EO tomulti-sensitive attribute setting:
[Equation]
where s i , s j ∈ S is the value of sensitive attributes.
A smaller EO means a fairer model.
Besides,we use top-1 accuracy (%) to measure the effectiveness of learned representations.
Baselines.
To our best knowledge, there is no existing work focusing on dealing with the problemof FURL-PS.
Therefore, we construct some powerful baselines by combining the SOTA methodsto solve partially annotated sensitive labels and the advanced methods designed for fair unsupervised representation learning.
Specifically, CGL (Jung et al., 2022) is the SOTA method to solvethe problem of partially annotated sensitive attribute labels by assigning pseudo sensitive labelsbased on confidence.
VFAE
(Louizos et al., 2015) is a fair representation learning method basedon a variational autoencoding architecture with priors that encourage latent factors of variationto be independent of sensitive attribute.
We implement its unsupervised version and combine itwith CGL as a baseline ( CGL + VFAE ).
We also compare our method with the combination of CGLand GRL (Raff & Sylvester, 2018), which is an adversarial method used for fair representations( CGL + GRL ).
Since there are few existing methods for fair unsupervised representation learning, wealso implement some fair supervised representation learning methods which rely on target labels.
Group DRO ( G-DRO ) (Sagawa et al., 2019) is a classical and powerful method for robust and fairlearning by learning a set of weights for different data subgroups.
FSCL (Park et al., 2022) learnsfair representations based on supervised contrastive learning.
For those 5% samples annotated withsensitive attributes, their target labels are available for G-DRO and FSCL .
The CGL strategy is alsoused for them ( CGL + G-DRO , CGL + FSCL ). [Figure]
Implementation Details.
We resize the images of CelebA and UTK-Face to 128 × 128, and use a5-layer CNN (Krizhevsky et al., 2017) as the encoder of generative model.
Besides, the decoder alsohas 5 layers.
Since the quality of some generated samples may not be good enough, we select imagesbased on confidence.
Specifically, we use the trained classifier to predict the sensitive attributesof the generated images, and then remove some low-confidence samples whose Softmax outputscores are lower than thr = 0 .
More details are in Appendix B. Besides, to further improvethe quality of training data, we use high-confidence of original images instead of correspondinggenerated samples.
We use the same random data augmentation strategy as (Chen et al., 2020a).
The projection head P ( · ) is only used in contrastive learning, and then we remove it.
We use the
ResNet-18 (He et al., 2016) as encoder model and a MLP as projection head, and train them viaweighted fairness-aware contrastive loss for 100 epochs.
Afterwards, we train a linear classifier ontop of the frozen representation given by encoder F ( · ) for 10 epochs on the training dataset.
4. C ONTRASTIVE S AMPLE G ENERATION E XPERIMENTS
We set Male as the sensitive attribute, and select some contrastive samples generated by the sensitiveattribute editor, which is trained on CelebA dataset with partially annotated sensitive attributes, asshown in Figure 3.
As can be seen, the generated contrastive samples remain most of the visualdetails of the original images, but have different sensitive attributes.
We next discuss the issues of proxy variables.
First, for those proxy variables which have thecausal/stable correlation with the sensitive attributes, e.g. Beard and Moustache , we note that thesensitive attribute editor can learn the correlation between them as we expected.
For example, theoutput female does not have a beard, even if the input image is a male face with a beard.
Unfortunately, for those proxy variables having the extreme spurious correlation with the sensitive attributes,e.g., Heavy Makeup and Lipstick , the sensitive attribute editor also learns it. Note that almost all maleimages have no lipstick (less than 1%), while most female images have lipstick (more than 80%).
As a result, as shown in Figure 3, the generated female images sometimes have lipstick, even if theoriginal image is a male face without lipstick.
This will result in the representation model not beingable to learn information about these proxy variables and thus unable to make accurate predictionsabout these attributes.
We would like to emphasize that this issues is an open problem and, to ourbest knowledge, there is no existing method that can solve it without any prior.
However, we findthat our method exhibits robustness to data bias caused by spurious correlations.
Specifically, thesensitive attribute editor would not change the attributes which have the high Pearson correlationwith the sensitive attributes, e.g., Big Nose , due to the reconstruction loss.
4. R ESULTS OF F AIRNESS AND A CCURACY ON C ELEB A DATASET
We report the classification results of unsupervised methods on CelebA dataset in Table 1.
We useequalized odds (EO) and top-1 accuracy (Acc.) of trained linear classifier to evaluate the fairness andutility of learned representations, respectively.
A smaller EO means a fairer model.
We find that themodels trained via SimCLR achieves the best accuracy, but suffer from fairness issues.
Our proposed
FairCL based on SimCLR improves the fairness of learned representations.
FairCL outperformsother unsupervised baselines ( CGL + VFAE and CGL + GRL ) in terms of EO and accuracy. We also compare our FairCL with the methods relying on target labels, as shown in Table 2. Notably, FairCL even outperforms semi-supervised methods in some cases.
The reason may be that semi-
[Table] [Table]
a / S= m
T= a / S= y
T= b / S= m
T= b / S= y
T= e / S= m
T= e / S= y
T= b & e / S= y T= a / S= y & m EO Acc. EO Acc. EO Acc.
EO Acc. EO Acc. EO Acc. EO
Acc. EO Acc. CE 27.8 77.
[Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table]
77.9 CGL + G-DRO
[Table]
[Table]
[Table]
[Table]
[Table] [Table] [Table] 4 CGL + FSCL
[Table] [Table] [Table] [Table]
[Table]
FairCL (Ours) [Table] [Table] [Table]
[Table]
[Table]
[Table]
[Table] [Table] [Table] supervised methods suffers from the issues of pseudo-label noise.
Besides, CGL + G-DRO achievesexcellent EO but has low accuracy due to the over pessimism problem (Hu et al., 2018). 4. T-SNE V ISUALIZATION
[Figure]
To further evaluate the quality ofour learned representations and explain how our method works, wesample 1000 images from testdataset and visualize the representations of them via t-SNE (Van der
Maaten & Hinton, 2008), as shownin Figure 4.
We find that both
FairCL and SimCLR can assignsimilar features to the images withsame target labels.
However, SimCLR also learn information of sensitive attributes, so that the representations given by SimCLR canalso be divided by the sensitive attributes.
In contrast, our proposed
FairCL focuses on both utility and fairness by closing the distance between representations of contrastive samples, which have similar visual information but have different sensitive attributes.
4. E FFECTIVENESS OF F EATURE R EWEIGHTING
We provide an unsupervised way to balance the fairness and utility of learned representation byfeature reweighting.
To analyze the effectiveness of feature reweighting, we set the scaling parameter α as different values, and train the representation models.
The performance of linear classifierin terms of EO and accuracy is reported in Table 3.
As can be seen, we find that a larger scalingparameter α can yield a fairer model but with lower accuracy.
This is in line with our expectations,since the feature weights will be hard if the scaling parameter α is large, and then the sensitiveattribute-dependent features will have a greater impact on the similarity/distance calculation.
4. C OMPATIBILITY WITH C ONTRASTIVE L EARNING A LGORITHMS
Our proposed fairness-aware contrastive learning framework is general and flexible that can be usedfor any contrastive learning algorithm.
We have shown the effectiveness of SimCLR -based FairCL inthe previous subsection.
To further illustrate the compatibility of FairCL , we apply it to BYOL (Grill
[Table] [Table]
et al., 2020), a widely used contrastive learning method without negative samples.
Due to the absence of target labels, negative sample-based methods ( e.g., SimCLR ) may incorrectly push the representations of semantically similar samples farther away, which may lead to compromised accuracyon downstream tasks.
BYOL overcomes this problem by not using negative samples.
Therefore, asshown in Table 4, BYOL achieves excellent accuracy.
However, it also suffers from fairness issues.
Notably, FairCL* improves EO over it while keeping comparable accuracy.
4. R OBUSTNESS TO R ATIO OF A NNOTATED S ENSITIVE L ABELS AND D ATA B IAS
[Figure]
To further validate the robustness of our proposedmethod to ratio of annotated sensitive labels and unknown data bias, we run different methods on UTKFace dataset.
We set Y oung as the sensitive attribute,and the target label is Male .
Only 5% samples are annotated with sensitive attributes.
Besides, the datasetis unbalanced, where the Young group has 65% female data and 35% male, while another sensitive grouphas the opposite gender ratio.
As can be seen in Figure 5, our proposed FairCL / FairCL* improves fairnesscompared with SimCLR / BYOL , while keeping high accuracy.
Our method outperforms other unsupervisedmethods and even achieves comparable performancewith the target label-dependent methods ( CGL + G-DROand CGL + FSCL ), in terms of the trade-off between accuracy and EO, which illustrates that our method is robust to annotation ratio and data bias. More experimentswith various settings are in Appendix E.
C ONCLUSIONS
In this paper, we investigate a novel and practical problem of which the goal is to learn a fairand powerful representation model with no target label and limited sensitive attributes.
To solvethis problem, we develop a general contrastive learning-based framework FairCL consisting of twostages: contrastive sample generation and fairness-aware contrastive learning with feature reweighting.
Extensive experiments show that our proposed method can yield a fair representation modeleven with limited sensitive attributes and imbalanced data.
We admit that there are some limitations of our method and can be improved in the future work.
Firstly, our work relies on the quality of the generated images.
More effective image attribute editingmethods can help improve the representation model trained by our method in terms of both fairnessand utility.
Secondly, our method still requires a small number of sensitive attribute labels.
How tolearn a fair representation model without any demographic information is still an open problem.
Wehope our study can bring some inspiration for future work.
A S EMI - SUPERVISED A LGORITHM FOR L EARNING C LASSIFIER ANDG ENERATOR
The detailed presentation of the method for training generator with limited sensitive attribute labels is shown in Algorithm 1.
The semi-supervised algorithm for learning classifier and generatorconsists of three stages: warm-up training (line 1), dataset extension (lines 2 to 13), and follow-uptraining (line 14).
B D ISCUSSIONS OF H YPER - PARAMETERSB. H YPER - PARAMETER thr
For classifier and generator.
The pseudo-labels given by the classifier may be wrong and not allof the generated samples are high-quality.
As a result, there may be some label noises.
When weassign a pseudo-label to a sample, intuitively, a high Softmax score means less probability of beingclassified incorrectly.
Therefore, to mitigate the label noises, we introduce the hyper-parameter thrto decide whether an image could be used as a training sample for classifier and generator.
For representation model.
Before we perform fairness-aware contrastive learning, we first preparecontrastive sample pairs using the trained generator.
Then we remove some low-confidence generated samples, since there are a few low-quality generated samples with wrong sensitive attributes,which may introduce bias in the training process of the representation model.
Specifically, we compute the average Softmax score for each pair of contrastive samples, and the sample pairs with lowaverage Softmax scores (less than thr ) will be removed.
Effect of thr .
To explore the effect of hyper-parameter thr , we do ablation studies by settingthr to different values.
As shown in Table 5, we can observe that the model’s Equal Odds (EO)gradually decreases with the increase of thr .
This experimental phenomenon is consistent with ourexpectation, since large values of thr guarantee the correctness of the sensitive attributes of thetraining samples.
However, the increase of thr results in a slight decrease in accuracy, which maybe due to that the number and diversity of training samples is reduced.
How to choose thr ?
There is no criterion to choose thr , since the datasets, generative models,training algorithms and requirements are not invariant.
However, we can randomly sample from
[Table]
the data at different thr to assess the quality of the data at different thr .
In this paper, we setthr = 0 .
9 to balance the fairness and accuracy.
In practice, we recommend that the users who arevery concerned about fairness set the thr to a large value.
B. H YPER - PARAMETER α
We introduce the hyper-parameter α to control the trade-off between accuracy and fairness for ourproposed algorithms.
As shown in Table 3, a larger scaling parameter α can yield a fairer model butwith lower accuracy.
B. H YPER - PARAMETER τ
Hyper-parameter τ is a temperature parameter, which is widely used in contrastive loss computationfor sharper distribution of the Softmax output.
In this paper, we follow the setting in (Chen et al.
,2020a)
and set τ = 0 . 5 .
C E XPERIMENTS OF F AIRNESS - ACCURACY T RADE - OFFS
The classification results of our proposed method and the compared unsupervised baseline methodsare reported in Table 1.
There are two main metrics we focus on: fairness (EO) and accuracy.
Fromthe perspective of multi-objective optimization, we can observe that our FairCL strongly Paretodominates CGL+VFAE and CGL+GRL , since FairCL outperforms them in terms of both fairness(EO) and accuracy.
However, we find that FairCL achieves the best performance in terms of fairness, while SimCLR achieves the best accuracy.
To further compare these two methods in terms ofthe trade-off between fairness and accuracy, we plot the trade-off curves according to the EO andaccuracy during the training process of the linear classifier, as shown in Figure 6.
Obviously, ourmethod has a lower EO value when the two achieve the same accuracy, which means that our FairCLhas a better trade-off between accuracy and fairness.
D B EYOND F AIRNESS : G ENERAL B IAS M ITIGATION ON N ON - FACIALD ATASET
To explore how our proposed framework performs on general bias mitigation, we run different unsupervised algorithms on a non-facial dataset, Dogs and Cats (dog, 2013), which is commonly usedin the previous debiasing studies.
Dataset.
Dogs and Cats dataset consists of dog and cat images.
Kim et al.
(2019) provide additionalannotations for partial images about whether the color of dog/cat is dark or not.
We set color as thesensitive attribute, and the task is to predict if the image is a cat or a dog.
We construct a biasedtraining set consisting of 2,000 bright cat images, 4,000 bright dog images, 4,000 dark cat images,and 2,000 dark cat images.
The Pearson correlation coefficient between target label and sensitiveattribute is -0.33, so that the model may learn the spurious correlation between species and colors.
We assume that 10% of the samples are annotated with sensitive attributes.
The test set is balanced(unbiased) and consists of 2,400 images.
We use the same experimental setups (training strategies,models, and hyper-parameters) as before.
Experimental Results.
We randomly select some generated contrastive sample pairs.
as shown in
Figure 7.
We can observe that the generated contrastive samples remain most of the visual details
[Figure]
[Figure]
of the original images,
but have different sensitive attributes (colors).
We report the classificationresults in Table 6.
Our proposed FairCL improves fairness compared to SimCLR with only a slightdrop in accuracy.
Moreover, FairCL outperforms all baseline methods in terms of both fairnessand accuracy.
The above experimental results illustrate that our FairCL can prevent representationmodels from learning spurious correlations.
T= color , S= species
EO ( ↓ )
Acc. ( ↑ )
CGL+VFAE 10.
CGL+GRL 9.
SimCLR 12.
FairCL (Ours) 8.
[Figure]
E C OMPATIBILITY WITH G ENERATIVE F RAMEWORKS
Our proposed fairness-aware contrastive learning is compatible with different generative methods.
The descriptions of the contrastive sample generation in the previous section are basedon AttGAN (He et al., 2019).
To verify the compatibility, we use another generative method,
HFGI (Wang et al., 2022), to generate contrastive sample pairs.
Contrastive Sample Generation based on HFGI.
We design a simple pipeline of contrastive sample generation based on HFGI, which consists of three steps: generator training, classifier training,and image editing.
First, we train an inverse GAN using the same experimental settings as HFGI.
Inthis process, we do not need to use any data annotations.
Secondly, we train a robust classifier using
JTT (Liu et al., 2021) as the training strategy with limited sensitive attributes.
The trained classifier is used to assign pseudo-sensitive labels to the unlabeled images.
Finally, we get the editingdirection w.r.t.
sensitive attribute based on InterFaceGAN (Shen et al., 2020).
Then we can generatecontrastive sample pairs based on the editing direction.
We recommend the readers to read the abovereferences for implementation details.
Experimental Setup.
We use UTK-Face as the dataset.
We set race as the sensitive attribute.
Forconvenience, we consider a binary setting, and put white people in one group and other races inanother.
We would like to state that this grouping is only due to the large proportion of white peoplein the dataset.
The task is to predict the gender for a given image.
We construct three unbalancedsettings where the Pearson correlation coefficients of race and gender in the training dataset are -0.2,-0.4, and -0.6, respectively.
The size of training set is 10,000 in each setting.
We also constructa balanced (unbiased) test set with 3,200 images for each setting.
We assume that 10% of thesamples are annotated with sensitive attributes.
To demonstrate the compatibility of our frameworkto contrastive learning algorithms, we compare BYOL and FairCL* on this dataset, neither of whichrequires negative samples.
Other experimental setups are the same as before.
Experimental Results.
We randomly select some generated contrastive sample pairs, as shown in
Figure 8.
We report the classification results in Table 7.
We observe that our proposed FairCL*improves BYOL in terms of both fairness and accuracy in three settings, which illustrates that therepresentation models trained by our framework is more effective and fairer.
We also find that thevisual quality of the generated images is not as high as we would like, and the racial changes inthe edited images are not very obvious.
However, the classification results of our method are stillgreatly improved compared with the baseline, which means that a good representation model can belearned by our proposed framework even the quality of the generated samples is not very high.
Discussion.
Our proposed framework is based on the generation techniques to prepare contrastivesample pairs for fairness-aware contrastive learning.
The above experimental results demonstrate thecompatibility of our framework to different generative methods.
Moreover, we would like to emphasize that the goal of our study is to learn fair and effective representations, and non-high-qualitygenerative samples do NOT mean bad representations.
At last, we believe that the applicability ofour method will get stronger and stronger with the development of generation techniques.
[Table]
[Table]
F O VERVIEW OF E XPERIMENTAL S ETUP
The overview of our experimental settings is shown in Table 8.
For CelebA dataset, the sample sizesof Wearing Lipstick, Male , Heavy Makeup, Male , Mustache, Female , and No Beard, Female in testset are 47, 22, 0, and 10, respectively.
All of them have a fraction less than 0.25% in the test set, sowe do not use these attributes in experiments.