Abstract: In the era of Foundation Models' (FMs) rising prominence in AI, our study addresses the challenge of biases in medical images while using FM API, particularly spurious correlations between pixels and sensitive attributes. Traditional methods for bias mitigation face limitations due to the restricted access to web-hosted FMs and difficulties in addressing the underlying bias encoded within the FM API. We propose an U(niversal) D(ebiased) E(diting) strategy, termed UDE, which generates UDE noise to mask such spurious correlation. UDE is capable of mitigating bias both within the FM API embedding and the images themselves. Furthermore, UDE is suitable for both white-box and black-box FM APIs, where we introduced G(reedy) (Z)eroth-O(rder) (GeZO) optimization for it when the gradient is inaccessible in black-box APIs. Our whole pipeline enables fairness-aware image editing that can be applied across various medical contexts without requiring direct model manipulation or significant computational resources. Our empirical results demonstrate the method's effectiveness in maintaining fairness and utility across different patient groups and diseases. In the era of AI-driven medicine, this work contributes to making healthcare diagnostics more equitable, showcasing a practical solution for bias mitigation in pre-trained image FMs.
Introduction
Foundation Models (FMs) like MedLM or CLIP are increasingly becoming the backbone of medical image analysis. However, these models are often accessed via APIs as "black boxes," meaning users cannot see or modify their internal parameters. A critical issue in this context is fairness. Medical images often contain "sensitive attributes" (SAs) like gender, race, or age. If a training dataset has a higher prevalence of a disease in one group, a model might learn to use these sensitive features as a shortcut—a spurious correlation—rather than identifying actual clinical signs. Traditional debiasing methods usually require retraining the model or having access to its gradients, which is impossible with third-party APIs.
Methodology: Debiased Noise Editing (DNE)
To overcome these limitations, we propose Debiased Noise Editing (DNE), a strategy that shifts the focus from model modification to input modification. Instead of changing the model, we learn a "noise tensor" ($\epsilon$) that is added to every image to mask sensitive attributes.
The DNE process involves two primary steps:
- Learning the Noise: We optimize a noise mask to "confuse" a pre-trained sensitive attribute classifier. By maximizing the error of this classifier, the noise effectively hides gender- or race-related pixels from the FM.
- GeZO Optimization: For black-box APIs where gradients are unavailable, we developed Greedy Zeroth-Order (GeZO) optimization. GeZO estimates the best direction to update the noise by randomly perturbing it and "greedily" selecting directions that most effectively reduce the objective function. It utilizes a velocity mechanism to track and accumulate high-performing perturbations over time.
Once the DNE noise is learned, it is added to images before they are processed by the FM. The resulting "fair embeddings" are then used to train a simple, unbiased disease classifier.
Experimental Evaluation
We evaluated DNE using the CheXpert dataset, focusing on binary classification for Pleural Effusion, Pneumonia, and Edema with gender as the sensitive attribute. To rigorously test the method, we intentionally created biased training sets where disease prevalence was skewed between genders, forcing models to potentially rely on gender as a proxy for diagnosis.
As shown in the results, DNE significantly outperforms standard baselines. For Pleural Effusion, the "Equal Opportunity" (EO) gap and "Disparate Impact" (DI) were reduced by over 25% compared to standard Empirical Risk Minimization (ERM). Notably, removing bias often improved utility; for example, on Pleural Effusion, DNE achieved 75.1% accuracy compared to 72.9% for the baseline ERM. This suggests that forcing the model to ignore shortcuts leads to the learning of more robust clinical features.
Key Insights and Conclusion
A major advantage of DNE is its universality: a noise mask learned to hide gender features for one disease can be applied to other classification tasks using the same FM. Furthermore, by editing the image space rather than the embedding space, the method is interpretable; visualizations show the noise focuses on gender-discriminative regions or artifacts like text notations.
While GeZO introduces some computational overhead due to multiple API calls per iteration, it successfully enables debiasing for black-box models. This work provides a practical, resource-efficient solution for making AI-driven medical diagnostics more equitable across different patient groups.
Summary updated