The University of British Columbia, Vancouver, BC, Canada 11email: {dwenlong,xiaoxiao.li}@ece.ubc.ca 22institutetext: Department of Computer Science and Engineering,
The Chinese University of Hong Kong, Hong Kong, China 22email: {yzhong22,qdou}@cse.cuhk.edu.hk
On Fairness of Medical Image Classification
with Multiple Sensitive Attributes via
Learning Orthogonal Representations
Abstract
Mitigating the discrimination of machine learning models has gained increasing attention in medical image analysis. However, rare works focus on fair treatments for patients with multiple sensitive demographic attributes, which is a crucial yet challenging problem for real-world clinical applications. In this paper, we propose a novel method for fair representation learning with respect to multi-sensitive attributes. We pursue the independence between target and multi-sensitive representations by achieving orthogonality in the representation space. Concretely, we enforce the column space orthogonality by keeping target information on the complement of a low-rank sensitive space. Furthermore, in the row space, we encourage feature dimensions between target and sensitive representations to be orthogonal. The effectiveness of the proposed method is demonstrated with extensive experiments on the CheXpert dataset. To our best knowledge, this is the first work to mitigate unfairness with respect to multiple sensitive attributes in the field of medical imaging. The code is available at https://github.com/ubc-tea/FCRO-Fair-Classification-Orthogonal-Representation.
1 Introduction
With the increasing application of artificial intelligence systems for medical image diagnosis, it is notably important to ensure fairness of image classification models and investigate concealed model biases that are to-be-encountered in complex real-world situations. Unfortunately, sensitive attributes (e.g., race and gender) accompanied by medical images are prone to be inherently encoded by machine learning models [5], and affect the model’s discrimination property [20]. Recently, fair representation learning has shown great potential as it acts as a group parity bottleneck that mitigates discrimination when generalized to downstream tasks. Existing methods [1, 4, 15, 16] have studied the parity between privileged and unprivileged groups upon just a single sensitive attribute, but neglecting the flexibility with respect to multiple sensitive attributes, in which the conjunctions of unprivileged attributes might deteriorate discrimination. This is a crucial yet challenging problem hindering the applicability of machine learning models, especially for medical image classification where patients always have many demographic attributes.

To date, it is still challenging to effectively learn target-related representations which are both fair and flexible to multiple sensitive attributes, regardless of some promising investigations recently. For instance, adversarial methods [1, 11] produce robust representations by formulating a min-max game between an encoder that learns class-related representation and an adversary that removes sensitive information from it. Disentanglement-based methods [4] achieve separation by minimizing the mutual information between target and sensitive attribute representations. These methods typically gain efficacy by means of carefully designed objectives. To extend them to the multi-attribute setting, additional loss functions have to be explored, which should handle gradient conflict or interference. Methods using variational autoencoder [3] decompose the latent distributions of target and sensitive and penalize their correlation for disentanglement. However, aligning the distribution of the sensitive attributes is difficult or even intractable given the complex combination of multiple factors. Besides, there are some fairness methods based on causal inference [12] or bi-level optimization [16], which also learn debiased while multi-attributes inflexible representations. Recently, disentanglement is vigorously interpreted as the orthogonality of a decomposed target-sensitive latent representation pair by [15], where they predefine a pair of orthogonal subspaces for target and sensitive attribute representations. However, in the multi-sensitive attributes setting, the dimension of the target space would be continuously compressed and how to solve it is still an open problem.
In this paper, we propose a new method to achieve Fairness via Column-Row space Orthogonality (dubbed FCRO) by learning fair representations with respect to multiple sensitive attributes for medical image classification. FCRO considers multi-sensitive attributes by encoding them into a unified attribute representation. It achieves a best trade-off for fairness and data utility (see illustrations in Fig. 1) via orthogonality in both column and row spaces. Our contributions are summarized as follows: (1) We tackle the practical and challenging problem of fairness given multiple sensitive attributes for medical image classification. To the best of our knowledge, this is the first work to study fairness with respect to multi-sensitive attributes in the field of medical imaging. (2) We relax the independence of target and sensitive attribute representations by orthogonality which can be achieved by our proposed novel column and row losses. (3) We conduct extensive experiments on the CheXpert [7] dataset with over 80,000 chest X-rays. FCRO achieves a superior fairness-utility trade-off over state-of-the-art methods regarding multiple sensitive attributes race, sex, and age.
2 Methodology
2.1 Problem Formulation
Notations. We consider group fairness in this work. While keeping the model utility for the privileged group, group fairness articulates the equality of some statistics like predictive rate between certain groups. Considering a binary classification problem with column vector inputs , labels . Multi-sensitive attributes is vector of attributes sampled from the conjunction of binary attributes, i.e., Cartesian product of sensitive attributes ***, where is the -th sensitive attribute. Our training data consist of tuples . We denote the classification model that predicts a class label given , where is a feature encoder for target embeddings, and is a scoring function. Similarly, we consider a sensitive attribute model that predicts sensitive attributes associated with input . Given the number of samples , the input data representation is and we denote the feature representation , .

Fairness with multiple sensitive attributes. A classifier predicts given an input by estimating the posterior probability . When inputs that are affected by their associated attributes (i.e., ) are fed into the network, the posterior probability is written as . Since biased information from is encoded, this can lead to an unfair prediction by the classifier. For example, in the diagnosis of a disease with sensitive attributes age, sex, and race, a biased classifier will result in . In this work, we focus on equalized odds (ED), which is a commonly used and crucial criterion of fair classification in the medical domain [19]. In our case, ED regarding multiple sensitive attributes can be formulated as follows:
(1) |
A classifier satisfies ED with respect to group and the target if the model prediction and are conditionally independent given , i.e., .
Fair representation. To enforce our aforementioned conditions, we follow [15] and introduce target embedding and multi-attribute embedding that is generated from . As in the causal structure graph for the classifier depicted in Fig. 2 (a), our objective is to find a fair model that maximizes the log-likelihood function of the distribution , where:
(2) | ||||
(3) |
and we call fair representation for the target task (e.g., disease diagnosis). To this end, we aim to maximize Eq. (3) with the conditional independence constraint to train a fair classifier. It is noteworthy that in the multi-sensitive attributes setting, forcing to be independent on all is challenging and even intractable when is large. Therefore, we propose to encode multi-sensitive attributes into a single compact encoding that is still predictive for classifying attributes (i.e., ). Then we can rewrite Eq. (3) as likelihood with the independence constraint on and :
(4) |
However, maximizing Eq. (4) brings two technical questions:
Q1: How to satisfy the independence constraint for and ?
A1:
We relax independence by enforcing orthogonality in a finite vector space. Different from predefined orthogonal space in [15], we enforce orthogonality in both column spaces (Sec. 2.2) and row spaces (Sec. 2.3) of and .
Q2: How to estimate , , , ?
A2: We train two convolutional encoders and to approximate and respectively; And we train two multi-layer perception classifiers and to approximate and respectively (Sec. 2.4).
2.2 Column Space Orthogonality
First, we focus on the column space of the target and the sensitive attribute representations. Column space orthogonality aims to learn target representations that fulfill the following two aims: 1) have the least projection onto the sensitive space and 2) preserve the representation power to predict .
Denote the target representation and the sensitive attribute representation , where is a column vector for , we represent the column space for and as and respectively. Aim 1 can be achieved by forcing . Although both , their coordinates may not be aligned as they are generated from two separate encoders. As a result, if , then there is no straightforward way to achieve by directly constraining (e.g., forcing ). Aim 2 can be achieved by seeking a low-rank representation for , whose rank is such that , because we have if holds. Then would be a high-dimensional space with sufficient representation power for target embeddings. This is especially important when we face multiple sensitive attributes, as the total size of the space is , and increasing the number of sensitive attributes would limit the capacity of to learn predictive . To this end, we first propose to find the low rank sensitive attribute representation space , and then encourage to be in ’s complement .
Construct low-rank multi-sensitive space. We apply Singular Value Decomposition (SVD) on to construct the low-rank space , where are orthogonal matrices with left and right singular vectors and respectively. And is a diagonal matrix with descending non-negative singular values . Then we extract the most important left singular vectors to construct , where controls how much sensitive information to be captured in . It is notable that is agnostic to the number of sensitive attributes because they share the same . For situations that can not get the whole dataset at once, we follow [8] to select the most important bases from both bases of old iterations and newly constructed ones, thus providing an accumulative low-rank space construction variant to update iteratively. As we do not observe significant performance differences between these two variants (Fig. 4 (a)), we use and refer to the first one in this paper if there is no special clarification.
Column orthogonal loss. With the low-rank space for multiple sensitive attributes, we encourage to learn representations in its complement . Notice that can also be interpreted as the kernel of the projection onto , i.e., . Therefore, we achieve column orthogonal loss by minimizing the projection of to , which can be defined as:
(5) |
As is a low-rank space, will have abundant freedom for to extract target information, thus reserving predictive ability.
2.3 Row Space Orthogonality
Then, we study the row space of target and sensitive attribute representations. Row space orthogonality aims to learn target representations that have the least projection onto the sensitive row space . In other words, we want to ensure orthogonality on each feature dimension between and . Denote target representation and sensitive attribute representation , where is a row vector for . We represent row space for target representations and sensitive attribute representations as and correspondingly. As the coordinates (i.e., the index of samples) of and are aligned, forcing can be directly applied by pushing and to be orthogonal for arbitrary .
Unlike column space, the orthogonality here won’t affect the utility, since the row vector is not directly correlated to the target . To be specific, we let pair-wise row vectors and have a zero inner dot-product. Then for any , we try to minimize . Here we slightly modify the orthogonality by extra subtracting the mean vector and from and respectively, where . Then orthogonality loss will naturally be integrated into a covariance loss:
(6) |
In this way, the resulting loss encourages each feature of to be independent of features in thus suppressing the sensitive-encoded covariances that cause the unfairness.
2.4 Overall Training
In this section, we introduce the overall training schema as shown in Fig. 2 (c). For the sensitive branch, we noticed that training a shared encoder can pose a risk of sensitive-related features being used for the target classification [4], and we pre-train separate for multiple sensitive attributes using the sensitive loss as . Here we use cross-entropy loss as for the -th sensitive attribute. Hence and in Eq. (4) can be obtained. Then, the multi-sensitive space is constructed as in Section 2.2 over the training data. For the target branch, we use cross-entropy loss as our classification objective to supervise the training of and and estimate and in Eq. (4) respectively. Here we do not make additional constraints to , which means it can be replaced by any other task-specific losses. At last, we apply our column and row orthogonality losses and to representations as introduced in Section 2.2 and Section 2.3 along with detached and to approximate independence between and . The overall target objective is given as:
(7) |
where and are hyper-parameters to weigh orthogonality and balance fairness and utility.
3 Experiments
Dataset | #Sample | Group Positive Rate | ||
Race | Sex | Age | ||
(White/Non-white/gap) | (Male/Female/gap) | (>60/ 60/gap) | ||
Original | 127130 | .410/.393/.017 | .405/.408/.003 | .440/.359/.081 |
Augmented | 88215 | .264/.386/.122 | .254/.379/.125 | .264/.386/.122 |
3.1 Setup
Dataset. We adopt CheXpert dataset [7] to predict Pleural Effusion in chest X-rays, as it’s crucial for chronic obstructive pulmonary disease diagnosis with high incidence. Subgroups are defined based on the following binarized sensitive attributes: self-reported race and ethnicity, sex, and age. Note that data bias (positive rate gap) is insignificant in the original dataset (see Table 1, row ’original’). To demonstrate the effectiveness of bias mitigation methods, we amplify the data bias by (1) firstly dividing the data into different groups according to the conjunction of multi-sensitive labels; (2) secondly calculating the positive rate of each subgroup; (3) sampling out patients and increase each subgroup’s positive rate gap to 0.12 (see Table 1, row ‘augmented’). We resize all images to and split the dataset into a 15% test set, and an 85% 5-fold cross-validation set.
Evaluation metrics. We use the area under the ROC curve (AUC) to evaluate the utility of classifiers. To measure fairness, we follow [13] and compute subgroup disparity with respect to ED (denoted as , which is based on true positive rate (TPR) and true negative rate (TNR)) in Eq. (1) as:
(8) |
We also follow [20] and compare subgroup disparity regarding AUC (denoted as ), which gives a threshold-free fairness metric. Note that we evaluate disparities both jointly and individually. The joint disparities assess multi-sensitive fairness by computing disparity across subgroups defined by the combination of multiple sensitive attributes . On the other hand, individual disparities are calculated based on a specific binary sensitive attribute .
Methods AUC () Subgroup Disparity () Joint Race Sex Age ERM [17] 0.863 0.119 0.224 0.018 0.055 0.046 0.142 0.023 0.038 (.005) (.017) (.013) (.009) (.017) (.008) (.014) (.004) (.010) G-DRO [14] 0.854 0.101 0.187 0.015 0.048 0.034 0.105 0.035 0.051 (.004) (.012) (.034) (.003) (.014) (.010) (.025) (.002) (.010) JTT [9] 0.834 0.103 0.166 0.019 0.056 0.026 0.079 0.017 0.030 (.020) (.017) (.023) (.008) (.016) (.002) (.004) (.006) (.007) Adv [18] 0.854 0.089 0.130 0.017 0.027 0.022 0.039 0.016 0.023 (.002) (.009) (.018) (.004) (.009) (.003) (.008) (.004) (.004) BR-Net [1] 0.849 0.113 0.200 0.018 0.051 0.037 0.109 0.027 0.039 (.001) (.025) (.023) (.008) (.013) (.012) (.025) (.006) (.006) PARADE [4] 0.857 0.103 0.193 0.017 0.052 0.042 0.104 0.026 0.031 (.002) (.022) (.032) (.002) (.010) (.006) (.023) (.006) (.011) Orth [15] 0.856 0.084 0.177 0.012 0.045 0.022 0.083 0.025 0.032 (.007) (.022) (.016) (.005) (.012) (.009) (.012) (.006) (.005) FCRO (ours) 0.858 0.057 0.107 0.012 0.033 0.015 0.024 0.013 0.019 (.001) (.022) (.013) (.003) (.008) (.004) (.008) (.004) (.006)
Implementation details. In our implementation, all methods use the same training protocol. We choose DenseNet-121 [6] as the backbone, but replace the final layer with a linear layer to extract 128-dimensional representations. The optimizer is Adam with learning rate of , and weight decay of . We train for 40 epochs with a batch size of 128. We sweep a range of hyper-parameters for each method and empirically set , , and for FCRO. We train models in 5-fold with different random seeds. In each fold, we sort all the validations according to utility and select the best model with the lowest average regarding each sensitive attribute among the top 5 utilities.
Baselines. We compare our method with (i) G-DRO [14] and (ii) JTT [9] – methods that seek low worst-group error by minimax optimization on group fairness and target task error, which can be naturally regarded as multi-sensitive fairness methods by defining subgroups with multi-sensitive attributes conjunctions. We also extend recent state-of-the-art fair representation learning methods on single sensitive attributes to multiple ones and compare our method with them, including (iii) Adv [18] and (iv) BR-Net [1] – methods that achieve fair representation via disentanglement using adversarial training, (v) PARADE [4] – a state-of-the-art method that adversarially eliminates mutual information between target and sensitive attribute representations and (vi) Orth [15] – a recent work closest to our method. Orth hard codes the means of both sensitive and target prior distributions to orthogonal means and re-parameterize the encoder output on the orthogonal priors. Besides, we give the result of (vii) ERM [17] – the vanilla classifier trained without any bias mitigation techniques.

3.2 Comparsion with Baselines
Quantitative results. We summarize quantitative comparisons in Table 2. It can be observed that all the bias mitigation methods can improve fairness compared to ERM [17] at the cost of utility. While ensuring considerable classification accuracy, FCRO achieves significant fairness improvement both jointly and individually, demonstrating the effectiveness of our representation orthogonality motivation. To summarize, compared with the best performance in each metric, FCRO reduced classification disparity on subgroups with joint by 2.7% and joint by 2.3% respectively, and experienced 0.5% and 0.4% boosts regarding the average of three sensitive attributes. As medical applications are sensitive to classification thresholds, we further show calibration curves with the mean and standard deviation of subgroups defined on the conjunction of multiple sensitive attributes in Fig. 3 (a). The vanilla ERM [17] suffers from biased calibration among subgroups. Fairness algorithms can help mitigate this, while FCRO shows the most harmonious deviation and the most trustworthy classification. Qualitative results. We present the class activation map [2] in Fig. 3 (b). We observe that the vanilla ERM [17] model tends to look for sensitive evidence outside the lung regions, e.g., breast, which threatens unfairness. FCRO focuses on the pathology-related part only for fair Pleural Effusion classification, which visually confirms the validity of our method.

3.3 Ablation Studies
Loss modules and hyperparameters. To evaluate the impact of loss weights and critical components of FCRO, we delve into different choices of hyperparameters and alternative designs. As depicted in Fig. 4 (a), we showcase the significance of the key components and the Pareto fronts (i.e., the set of optimal points) curve that results from a range of hyperparameters and . Increasing and resulted in a small decrease in AUC (0.5% and 0.12%, respectively). However, this was offset by significant gains in fairness (4% and 1.5%, respectively). The observation confirms the goal of managing multiple sensitive attributes effectively without sacrificing accuracy. Besides, We observe that removing either column or row space orthogonality shows a decrease in joint of 2.4% and 1.8% respectively, but still being competitive. We also observe accumulative space introduced in Section 2.2 achieves a comparable performance.
Training with different sensitive attributes. We present an in-depth ablation study on multiple sensitive attributes in Fig. 4 (b), where models are trained with various numbers and permutations of attributes. We show all methods perform reasonably better than ERM when trained with a single sensitive attribute but FCRO brought significantly more benefits when trained with the union of discriminated attributes (e.g., Sex Age), which consolidate FCRO’s ability for multi-sensitive attributes fairness. FCRO stand out among all methods.
Different rank for . We show the effect of choosing different for column space orthogonality. As shown in Fig. 4 (c), a lower rank benefits convergence of the model thus improving accuracy, which validates our insights in Section. 2.2 that lower sensitive space rank will improve the utility of target representations. In Fig. 4 (d), we show that is enough to capture over sensitive information and keep increasing it does not bring too much benefit for fairness, thus we choose to achieve the best utility-fairness trade off.
4 Conclusion and Future Work
This work studies an essential yet under-explored fairness problem in medical image classification where samples are with sets of sensitive attributes. We formulate this problem mathematically and propose a novel fair representation learning algorithm named FCRO, which pursues orthogonality between sensitive and target representations. Extensive experiments on a large public chest X-rays demonstrate that FCRO significantly boosts the fairness-utility trade-off both jointly and individually. Moreover, we show that FCRO performs stably under different situations with in-depth ablation studies. For future work, we plan to test the scalability of FCRO on an extremely large number of sensitive attributes.
Acknowledgments
This work is supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC), Public Safety Canada (NS-5001-22170), in part by NVIDIA Hardware Award, and in part by the Hong Kong Innovation and Technology Commission under Project No. ITS/238/21.
References
- [1] Adeli, E., Zhao, Q., Pfefferbaum, A., Sullivan, E.V., Fei-Fei, L., Niebles, J.C., Pohl, K.M.: Representation learning with statistical independence to mitigate bias. In: IEEE/CVF Winter Conference on Applications of Computer Vision (2021)
- [2] Chattopadhay, A., Sarkar, A., Howlader, P., Balasubramanian, V.N.: Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks. In: IEEE winter conference on applications of computer vision (2018)
- [3] Creager, E., Madras, D., Jacobsen, J.H., Weis, M., Swersky, K., Pitassi, T., Zemel, R.: Flexibly fair representation learning by disentanglement. In: International conference on machine learning. pp. 1436–1445. PMLR (2019)
- [4] Dullerud, N., Roth, K., Hamidieh, K., Papernot, N., Ghassemi, M.: Is fairness only metric deep? evaluating and addressing subgroup gaps in deep metric learning. The International Conference on Learning Representations (2022)
- [5] Glocker, B., Jones, C., Bernhardt, M., Winzeck, S.: Algorithmic encoding of protected characteristics in image-based models for disease detection. arXiv preprint arXiv:2110.14755 (2021)
- [6] Huang, G., Liu, Z., Van Der Maaten, L., Weinberger, K.Q.: Densely connected convolutional networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 4700–4708 (2017)
- [7] Irvin, J., Rajpurkar, P., Ko, M., Yu, Y., Ciurea-Ilcus, S., Chute, C., Marklund, H., Haghgoo, B., Ball, R., Shpanskaya, K., et al.: Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In: Proceedings of the AAAI conference on artificial intelligence. vol. 33, pp. 590–597 (2019)
- [8] Lin, S., Yang, L., Fan, D., Zhang, J.: Trgp: Trust region gradient projection for continual learning. International Conference on Learning Representations (2022)
- [9] Liu, E.Z., Haghgoo, B., Chen, A.S., Raghunathan, A., Koh, P.W., Sagawa, S., Liang, P., Finn, C.: Just train twice: Improving group robustness without training group information. In: International Conference on Machine Learning (2021)
- [10] Van der Maaten, L., Hinton, G.: Visualizing data using t-sne. Journal of machine learning research 9(11) (2008)
- [11] Madras, D., Creager, E., Pitassi, T., Zemel, R.: Learning adversarially fair and transferable representations. In: International Conference on Machine Learning. pp. 3384–3393. PMLR (2018)
- [12] Madras, D., Creager, E., Pitassi, T., Zemel, R.: Fairness through causal awareness: Learning causal latent-variable models for biased data. In: Proceedings of the conference on fairness, accountability, and transparency. pp. 349–358 (2019)
- [13] Roh, Y., Lee, K., Whang, S.E., Suh, C.: Fairbatch: Batch selection for model fairness. International Conference on Learning Representations (2020)
- [14] Sagawa, S., Koh, P.W., Hashimoto, T.B., Liang, P.: Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. International Conference on Learning Representations (2019)
- [15] Sarhan, M.H., Navab, N., Eslami, A., Albarqouni, S.: Fairness by learning orthogonal disentangled representations. In: European Conference on Computer Vision. pp. 746–761. Springer (2020)
- [16] Shui, C., Xu, G., Chen, Q., Li, J., Ling, C., Arbel, T., Wang, B., Gagné, C.: On learning fairness and accuracy on multiple subgroups. Advances in Neural Information Processing Systems (2022)
- [17] Vapnik, V.: Principles of risk minimization for learning theory. In: Advances in Neural Information Processing Systems. vol. 4 (1991)
- [18] Wadsworth, C., Vera, F., Piech, C.: Achieving fairness through adversarial learning: an application to recidivism prediction. arXiv preprint arXiv:1807.00199 (2018)
- [19] Xu, Z., Li, J., Yao, Q., Li, H., Shi, X., Zhou, S.K.: A survey of fairness in medical image analysis: Concepts, algorithms, evaluations, and challenges. arXiv preprint arXiv:2209.13177 (2022)
- [20] Zhang, H., Dullerud, N., Roth, K., Oakden-Rayner, L., Pfohl, S., Ghassemi, M.: Improving the fairness of chest x-ray classifiers. In: Conference on Health, Inference, and Learning. pp. 204–233. PMLR (2022)