{'fraction_non_alphanumeric': 0.031833660096997216, 'fraction_numerical': 0.013724073882984212, 'mean_word_length': 4.815481548154816, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
FairPrune: Achieving Fairness Through Pruning for Dermatological Disease Diagnosis

Many works have shown that deep learning-based medical image classification models can exhibit bias toward certain demographic attributes like race, gender, and age. Existing bias mitigation methods primarily focus on learning debiased models, which may not necessarily guarantee all sensitive information can be removed and usually comes with considerable accuracy degradation on both privileged and unprivileged groups. To tackle this issue, we propose a method, FairPrune, that achieves fairness by pruning. Conventionally, pruning is used to reduce the model size for efficient inference. However, we show that pruning can also be a powerful tool to achieve fairness. Our observation is that during pruning, each parameter in the model has different importance for different groups' accuracy. By pruning the parameters based on this importance difference, we can reduce the accuracy difference between the privileged group and the unprivileged group to improve fairness without a large accuracy drop. To this end, we use the second derivative of the parameters of a pre-trained model to quantify the importance of each parameter with respect to the model accuracy for each group. Experiments on two skin lesion diagnosis datasets over multiple sensitive attributes demonstrate that our method can greatly improve fairness while keeping the average accuracy of both groups as high as possible.


Introduction
In AI-assisted medical image analysis, deep neural networks (DNNs) tend to capture relevant statistical information such as colors and textures from the training data. This data-driven paradigm can help the network learn task-specific features for high accuracy on the target task. However, to maximize the accuracy, the network may use the information present in some data but not in other data, and thus show discrimination towards certain demographics (i.e. skin tone or gender). For example, [4,23] demonstrate that the network learned on the CelebA dataset [16] turns to perform better on the female group when the task is predicting facial attributes such as wavy hair and smiling. Dermatological disease arXiv:2203.02110v1 [eess.IV] 4 Mar 2022 classification networks trained on two public dermatology datasets Fitzpatrick-17k and ISIC 2018 Challenge have been reported to be biased across different skin tones [7,12]. However, no solution is proposed to mitigate the bias in these works. An X-ray computer-aided diagnosis (CAD) system was found to exhibit disparities across genders [13]. Once these biased models are deployed in the real-world system, they could be harmful to both individuals and society. For example, AI algorithms could misdiagnose people with different demographic groups, leading to increased health care disparities. This leads to a variety of research techniques that aim to alleviate the biased in DNNs.
One of the most widely used bias mitigation methods is adversarial training [11,21,6,1,24]. Normally, an adversarial network is added to the tail of an encoder or a classifier to predict the protected attributes and form a minimax game: maximize the network's ability to predict the class while minimizing the adversarial network's ability to predict the protected attributes. In this way, the model will be able to learn fair features that are irrelevant to the protected attributes. However, as mentioned in [22], the main drawback of this method is that even if the target protected attribute has been removed, the combination of other features may still be a proxy of this protected attribute. In addition, forcing the model to ignore the protected attribute relevant features may harm its classification accuracy as those features may contain important information for the final prediction [22]. Fairness through explanation is another bias mitigation technique [17,9,18], this technique requires fine-grained feature-level annotation as the domain knowledge to train the model to only focus on bias-unrelated features in the original input. Such suppression of sensitive information can also potentially remove useful information and thus greatly degrade the classification performance. Therefore, to achieve fairness, these state-of-the-art (SOTA) methods usually need to sacrifice considerable accuracy for both groups.
To avoid this, we introduce FairPrune, a technique to achieve fairness via pruning. Conventionally, pruning is used to reduce the model size for efficient inference. However, one interesting thing we found is that pruning can be a powerful tool for fairness. Our work is motivated by the observation that during pruning, the parameter that is important for one demographic group may be unimportant for another. By controlling the parameters to prune, we can reduce the accuracy difference between the privileged group and the unprivileged group to improve fairness while keeping their overall accuracy as high as possible. To this end, we utilize the saliency of each parameter (computed based on the second derivative [14]) to quantify its importance regarding the model accuracy. Specifically, we compute the saliencies of all parameters for each demographic group, which will then be used to prune the parameters that show large importance differences for these two groups to mitigate biases. Besides, the trade-off between fairness improvement and accuracy drop can be adjusted to satisfy different user requirements. As a byproduct, FairPrune can also reduce the network size for efficient deployment. We evaluate FairPrune on two skin lesion analysis datasets over two sensitive attributes and show improved fairness with a lower accuracy drop over SOTA methods for fairness.

Related Work
Existing bias mitigation methods can be generally categorized into three groups: pre-processing, in-processing, and post-processing.
For pre-processing methods, a straightforward solution is to remove the sensitive information from the training data. One could also assign different weights to different data samples to suppress the sensitive information during training [10]. These pre-processing techniques are not suitable for dermatological data because the sensitive information exists in the target (i.e., diseased area), which is necessary for diagnosis purposes and cannot be removed.
In-processing bias mitigation methods usually involve modifying the training loss function to regularize the model for fairness. For example, [15] added a task-specific prior to implicitly regularizing the model not to pay attention to the sensitive related information for its prediction. Adversarial training [24,20,21,11] achieve fairness by removing sensitive information with an adversarial learner. However, these methods can not explicitly protect the unprivileged group when enforcing the fairness constraints, and the accuracy of both groups will drop. Instead, our method can protect the accuracy of one group when achieving fairness goals, resulting in high overall accuracy and fairness simultaneously.
As for post-processing techniques, during the inference-time, calibration is performed by taking the model's prediction and the sensitive attribute as input [8,25,5]. The goal is to enforce the prediction distribution to match the training distribution or a specific fairness metric. While these methods show effectiveness for bias mitigation, they need access to the sensitive attribute for inference, which may not be available for disease diagnosis when taking images as input. Different from these methods, our method modifies the pre-trained model only based on the training set. During inference, the sensitive attribute is not needed.

Problem Definition
Given a dataset D = {x i , y i , c i }, i ∈ 1, ..., N where x i is the input image, y i is the class label, c i is the sensitive attribute (e.g., skin tone, gender, age), and a pretrained classification model f θ (·) with parameters θ that maps the input x i to the final predictionŷ i = f θ (x i ). Our goal is to reduce the discrimination in f θ (·) with respect to the sensitive attribute c by only modifying some of the parameters in f θ (·) without further finetuning. In this paper, we only consider the binary sensitive attribute (i.e., c i ∈ {0, 1}). c i = 0 represents unprivileged samples (the model shows discrimination against), while c i = 1 represents privileged samples.

Pruning for Fairness
Saliency reflects the accuracy drop after pruning. Given the pre-trained model f θ and its objective function E, the change of the objective function after  (2) the parameters' saliency distribution for dark and light skin tone groups on the Fitzpatrick-17k dataset. The x-axis is the index of parameters in the first layer of the VGG-11, the color represents the normalized saliency for each demographic group. The blue boxes highlight those parameters that have relatively low saliency for the light (unprivileged group) but high saliency for the dark (privileged group).
pruning parameters Θ can be approximated by a Taylor series [14]: where g i = ∂E ∂θi is the gradient of E with respect to θ i , which is close to 0 because we assume the pre-trained model has converged and the objective function is at its local minimum. h ii = ∂ 2 E ∂ 2 θi is the element at row i and column i of second derivative Hessian matrix H. The approximation assumes that ∆E caused by pruning several parameters is the sum of ∆E caused by pruning each parameter individually, so the third term is neglected. 1 2 h ii θ 2 i is called the saliency of θ i , which represents the increase of error after pruning this parameter. Using saliency to achieve group fairness. Our idea is based on our empirical observation that in a pre-trained network, the importance (saliency) of some parameters can be totally different for different demographic groups. That is, some parameters may have a small saliency for one group but a large saliency for another group. For example, Fig. 1 shows a dermatological disease diagnosis model pre-trained by vanilla training and is biased for patients with light skin tone, which is the unprivileged group. In the coordinate, we show the saliency distribution of the parameters in the first layer of VGG-11 for both dark and light groups. The x-axis represents parameter indices, where one coordinate shows the same parameter for both the light and the dark groups. The color denotes normalized saliency for both groups. It can be seen that there exist differences between the distribution of saliency for these two groups. In the blue boxes, we highlight those parameters with low saliency for the light group but high saliency for the dark group. By pruning these parameters, the accuracy difference of the privileged group (dark) and the unprivileged group (light) can be reduced. In this way, the model is pruned to be fair for the unprivileged group.
To identify those parameters to prune, we propose a fairness-aware saliency computation method to identify the parameters which are unimportant for the unprivileged group but important for the privileged group. The importance of each parameter for fairness is quantified by integrating the saliency of the unprivileged group and the saliency of the privileged group weighted by a negative scalar. To be specific, we formulate a multi-objective optimization problem: min ∆E c=0 (Θ), max ∆E c=1 (Θ).
To solve this problem, Eq. (2) can be transformed into a single objective as: min (4) where β is a hyper-parameter controlling the trade-off between minimizing ∆E c=0 and maximizing ∆E c=1 . θ i is the parameter of the model and can be treated as a constant. s i is the saliency of parameter θ i for achieving the fairness objective, where a smaller value represents a larger benefit when we prune it since a smaller s i contributes to minimizing the objective J. h c ii , c ∈ {0, 1} is the Hessian element of θ i for demographic group c, which is the juncture to inject the information of each group into the pruning process to achieve fairness.

Pruning Recipe
FairPrune prunes a pre-trained model by the following iterative steps.
1. Sample mini-batches {B 0 } and {B 1 } from the unprivileged group and privileged group, respectively. 2. For each pair of mini-batches (B 0 , B 1 ), compute the second derivatives h ii for each parameter, and compute parameter salience s i . 3. After several mini-batches, average the saliency of each parameter over the mini-batches. Remove p% parameters with the smallest saliency. 4. Repeat steps 1-3 until the target fairness metric is achieved.

Experiments and Results
Fairness Metrics. We use multi-class equalized opportunity (Eopp) and equalized Odds (Eodd) [8] to evaluate the fairness of the model. The Eopp0 is the True Negative Rate difference between two groups, the Eopp1 is the True Positive Rate difference between two groups, while the Eodd is the summation of the True Positive Rate difference and False Positive Rate difference. Suppose T P c k , F N c k , T N c k , and F P c k are the True Positive, False Negative, True Negative, and False Positive of class k and group c, then the True Positive Rate, True Negative Rate, and False Positive Rate of class k and group c can be computed by , respectively. The EOpp and Eodd can be computed by the following equations: Dataset and Preprocessing. The proposed methods are evaluated on two dermatology datasets for disease classification, including the Fitzpatrick-17k [7] and ISIC 2019 challenge [2,19] datasets. The Fitzpatrick-17k contains 16,577 images in 114 skin conditions. The skin tones are categorized in six levels from 1 to 6, where a smaller value represents lighter skin and a larger value means darker skin. We categorize the skin tones into two groups, where types 1 to 3 are light skin and types 4 to 6 are dark skin. The ISIC 2019 dataset contains 25,331 dermoscopic images in 9 diagnostic categories. Since skin tones are not provided by this dataset, we use the gender label to group the data as female and male.
Pre-training Details. We use VGG-11 as the backbone. On both datasets, we resize all the images to 128×128. Data augmentation includes random horizontal flipping, vertical flipping, rotation, scaling, and autoaugment [3]. We randomly split the dataset into training (60%), validation (20%), and test (20%) partitions. The model is pre-trained for 200 epochs with the Adam optimizer. The batch size is 256 and the learning rate is 1e-4 decayed by a factor of 10 at epoch 160.
Pruning Details. On the Fitzpatrick-17k dataset, the batch size for computing the saliency is 2. The saliency of each parameter is averaged every 500 minibatches to prune 5% of the parameters in each pruning iteration. On the ISIC 2019 dataset, the batch size for computing the saliency is 64. The saliency of each parameter is averaged every 200 mini-batches to prune 10% of the parameters. Grid search is used to find the best hyper-parameter β and pruning ratio with the optimal accuracy and fairness tradeoff on the validation set for each dataset. The pre-training and pruning are performed on one Nvidia V100 GPU. Baselines. We compare FairPrune with multiple baselines. Vanilla is standard training without fairness constraints. AdvConf and AdvRev are two adversarial training based de-biasing methods. AdvConf [1,20] employs a uniform confusion loss to minimize the classifier's ability for predicting the sensitive attribute. Ad-vRev [24] de-biases the model by maximizing the loss of predicting the sensitive attribute with loss reversal and gradient projection. DomainIndep [22] trains multiple classifiers, one classifier for each group to explicitly encode separate group information. OBD [14] is the pruning-based method, which uses all training data to compute the saliency without fairness constraints.
Results on Fitzpatrick-17k Dataset. Table 1 shows the accuracy and fairness results of all methods. For accuracy metrics, we report the precision, recall, and F1-score. From the table, we can see that when achieving a similar level of fairness, FairPrune shows better mean accuracy and a smaller accuracy difference in terms of F1-score compared with two adversarial training baselines AdvConf and AdvRev. This is because Fairprune can almost keep the accuracy of the unprivileged group unchanged when balancing the accuracy of two groups. We can also observe that although vanilla OBD has better overall accuracy than FairPrune, it does not show significant fairness improvements. Results on ISIC 2019 Dataset. Table 2 shows the comparison of accuracy and fairness results of all methods. FairPrune achieves significantly better fairness while preserving accuracy. First, our FairPrune method achieves significantly better fairness than the baselines. Our FairPrune method achieves 21.0 × 10 −3 Eopp1 and 28.8 × 10 −3 Eodd, which are 57.7% and 48.3% lower than 49.7 × 10 −3 and 55.8×10 −3 achieved by the best baseline. Second, the accuracy of FairPrune is comparable to the Vanilla method without fairness constraints, while the F1score difference between two groups of our method is only 0.003, an order of magnitude lower than the Vanilla training and other methods. Ablation Study. In this section, we discuss how the hyper-parameter β and pruning rate will affect the performance of FairPrune. We apply FairPrune to the model pre-trained on the Fitzpatrick-17k dataset and change β defined in Eq.(4) to see how the accuracy and fairness performance change. After that, we fix β and change the pruning ratio from 0 to 80% and repeat the evaluation. In Fig. 2(a), we show the accuracy (F1-Score) and fairness (Eopp1) trade-off by varying β under a fixed pruning ratio of 35%. Points on the upper left of this figure represent better fairness (smaller Eopp1) and higher accuracy (larger F1-score). With varying β, our methods achieve consistent better fairness and accuracy trade-off. We can see that when achieving the same fairness, FairPrune has higher accuracy than the baselines. At the same accuracy, FairPrune can also show better fairness than the baselines. Therefore, by tuning β, the trade-off between fairness and accuracy can be adjusted to satisfy the user requirement. Fig. 2(b) and Fig. 2(c) show the effect of the pruning ratio on accuracy and fairness, respectively. It can be seen that the mean recall drops slowly and then quickly, as well as the fairness metrics Eopp1. Although the fairness improvement can be larger at a larger pruning ratio (e.g., pruning ratio = 0.8), the accuracy may also be lower. Therefore, we suggest that the optimal pruning ratio usually exists at a lower pruning ratio where we do not see a significant accuracy drop on both groups but better fairness.

Conclusion
In this paper, we propose FairPrune, a method to achieve fairness by pruning. Based on our observation that each model parameter has different importance for different groups' accuracy, by pruning the parameters based on this importance difference, we can reduce the accuracy difference between the privileged group and the unprivileged group to improve fairness without a large accuracy drop. We evaluate our method on two skin lesion analysis datasets over multiple sensitive attributes. The experiment results show that FairPrune can greatly improve fairness while keeping the average accuracy of both groups as high as possible.