Department of Electrical and Computer Engineering, Rice University, USA
Visualizing chest X-ray dataset biases using GANs
Abstract
Recent work demonstrates that images from various chest X-ray datasets contain visual features that are strongly correlated with protected demographic attributes like race and gender. This finding raises issues of fairness, since some of these factors may be used by downstream algorithms for clinical predictions. In this work, we propose a framework, using generative adversarial networks (GANs), to visualize what features are most different between X-rays belonging to two demographic subgroups.
keywords
Chest X-rays, fairness, bias, explainability, generative adversarial networks (GANs)1 Introduction
Recent studies have demonstrated that patient bio-information like age, race, and gender are predictable from chest X-ray (CXR) images alone using deep learning modelsGichoya et al. 2022; Karargyris et al. 2019; Duffy et al. 2022. For example, in the “Reading Race” study, deep classifiers trained to predict race achieve AUROC on several CXR datasets Gichoya et al. 2022. This finding raises the question: “What visual cues discriminate different races?” Answering such a question can help mitigate potentially biased behavior of downstream algorithms that make decisions using this data. In this work, we propose a framework to visually explain the principal differences between different demographic subgroups in a medical imaging dataset. We first train an unconditional generative adversarial network (GAN) Goodfellow et al. 2020; Liang et al. 2020; Lin et al. 2022 on the given image dataset. Next, we project the images onto the (trained) GAN’s latent space and compute a direction in the latent space that differentiates a pair of classes (e.g., “Black” vs. “White” race groups). We traverse the latent space along that direction to produce image sequences that depict the main morphological and appearance changes in moving from one class to another.
There are related works that focus on visualizing subgroup differences associated with clinical attributes. One such study uses autoencoders Cohen et al. 2021, which often produce blurry samples that do not clearly capture structural information. Others train conditional versions of GANs Singla et al. 2023; Dravid et al. 2022, an expensive process since the GAN must be trained from scratch for each attribute of interest. In contrast to all these works, we demonstrate that deep generative models may be a useful tool to the medical imaging community to understand the biases within a medical imaging dataset.
2 Method
Our method consists of several components, visualized in Fig. 2 and described below.
Generator training: We train an unconditional StyleGAN2 generator Karras et al. 2020a , following the default training procedure introduced in that paper. is the dimension of the “latent space” of the generator, and and are the height and width of the generated CXR. In our experiments, we trained on Chexpert Irvin et al. 2019, a large public dataset containing CXRs. We only used frontal views, yielding CXRs. The training procedure takes roughly 24 hours on two Nvidia A100 GPUs.
Attribute classifier training: We train a separate deep attribute classifier for each per-image binary attribute provided in the dataset. For multi-class labels such as race, we train a separate binary classifier for each pair of races.
Image projection/SVM training: Next, we follow the process introduced in Karras et al. 2020b to project a subset of CXR images onto ’s latent space, yielding latent codes . We only retain those projected images whose labels (predicted by ) are the same as the original labels , i.e., . We then train a linear SVM to predict from .
Image sequence generation: The normal vector of the trained SVM’s hyperplane identifies the direction that best differentiates the two classes. We will use this fact to generate image sequences depicting the principal perceptual changes needed to convert a CXR belonging to one demographic class to another. In particular, we select the latent vector corresponding to a random dataset CXR, and move towards the opposite class in latent space in the direction of . We concatenate images generated by intermediate latent codes along this traversal to produce a sequence.
3 Results and discussion
We demonstrate our framework on ChexPert with race as the target attribute. We also validate our approach on the clinical attribute Cardiomegaly, which induces a known physiological change (enlarged heart). Sample results are shown and explained in Fig. 2.
Conclusion Our results show that an unconditional generative adversarial network can be a useful tool for visualizing differences between demographic groups of a CXR dataset. Our framework is fast and flexible, and can be applied to any binary attribute labels in the dataset. Future work includes analyzing generated sequences to thoroughly investigate demographic differences, and comparing results across different generative models.
References
- Cohen et al. (2021) Joseph Paul Cohen, Rupert Brooks, Sovann En, Evan Zucker, Anuj Pareek, Matthew P Lungren, and Akshay Chaudhari. Gifsplanation via latent shift: a simple autoencoder approach to counterfactual generation for chest x-rays. In Medical Imaging with Deep Learning, pages 74–104. PMLR, 2021.
- Dravid et al. (2022) Amil Dravid, Florian Schiffers, Boqing Gong, and Aggelos K Katsaggelos. medxgan: Visual explanations for medical classifiers through a generative latent space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2936–2945, 2022.
- Duffy et al. (2022) Grant Duffy, Shoa L Clarke, Matthew Christensen, Bryan He, Neal Yuan, Susan Cheng, and David Ouyang. Confounders mediate ai prediction of demographics in medical imaging. npj Digital Medicine, 5(1):188, 2022.
- Gichoya et al. (2022) Judy Wawira Gichoya, Imon Banerjee, Ananth Reddy Bhimireddy, John L Burns, Leo Anthony Celi, Li-Ching Chen, Ramon Correa, Natalie Dullerud, Marzyeh Ghassemi, Shih-Cheng Huang, et al. Ai recognition of patient race in medical imaging: a modelling study. The Lancet Digital Health, 4(6):e406–e414, 2022.
- Goodfellow et al. (2020) Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020.
- Irvin et al. (2019) Jeremy Irvin, Pranav Rajpurkar, Michael Ko, Yifan Yu, Silviana Ciurea-Ilcus, Chris Chute, Henrik Marklund, Behzad Haghgoo, Robyn Ball, Katie Shpanskaya, et al. Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 590–597, 2019.
- Karargyris et al. (2019) Alexandros Karargyris, Satyananda Kashyap, Joy T Wu, Arjun Sharma, Mehdi Moradi, and Tanveer Syeda-Mahmood. Age prediction using a large chest x-ray dataset. In Medical Imaging 2019: Computer-Aided Diagnosis, volume 10950, pages 468–476. SPIE, 2019.
- Karras et al. (2020a) Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. Advances in neural information processing systems, 33:12104–12114, 2020a.
- Karras et al. (2020b) Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 8110–8119, 2020b.
- Liang et al. (2020) Hao Liang, Lulan Yu, Guikang Xu, Bhiksha Raj, and Rita Singh. Controlled autoencoders to generate faces from voices. In Advances in Visual Computing: 15th International Symposium, ISVC 2020, San Diego, CA, USA, October 5–7, 2020, Proceedings, Part I 15, pages 476–487. Springer, 2020.
- Lin et al. (2022) Zinan Lin, Hao Liang, Giulia Fanti, and Vyas Sekar. Raregan: Generating samples for rare classes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 7506–7515, 2022.
- Singla et al. (2023) Sumedha Singla, Motahhare Eslami, Brian Pollack, Stephen Wallace, and Kayhan Batmanghelich. Explaining the black-box smoothly—a counterfactual approach. Medical Image Analysis, 84:102721, 2023.