Abstract
Deep learning image classifiers often struggle with domain shift, leading to significant performance degradation in real-world applications. In this paper, we introduce our CROCODILE framework, showing how tools from causality can foster a model’s robustness to domain shift via feature disentanglement, contrastive learning losses, and the injection of prior knowledge. This way, the model relies less on spurious correlations, learns the mechanism bringing from images to prediction better, and outperforms baselines on out-of-distribution (OOD) data. We apply our method to multi-label lung disease classification from chest X-rays (CXRs), utilizing over 750000 images from four datasets. Our bias-mitigation method improves domain generalization, broadening the applicability and reliability of deep learning models for a safer medical image analysis. Find our code at: https://github.com/gianlucarloni/crocodile.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bercean, B., Buburuzan, A., Birhala, A., Avramescu, C., Tenescu, A., Marcu, M.: Breaking down covariate shift on pneumothorax chest X-ray classification. In: Sudre, C.H., Baumgartner, C.F., Dalca, A., Mehta, R., Qin, C., Wells, W.M. (eds.) Uncertainty for Safe Utilization of Machine Learning in Medical Imaging: 5th International Workshop, UNSURE 2023, Held in Conjunction with MICCAI 2023, Vancouver, BC, Canada, October 12, 2023, Proceedings, pp. 157–166. Springer Nature Switzerland, Cham (2023). https://doi.org/10.1007/978-3-031-44336-7_16
Bustos, A., Pertusa, A., Salinas, J.M., De La Iglesia-Vaya, M.: PadChest: a large chest X-ray image dataset with multi-label annotated reports. Med. Image Anal. 66, 101797 (2020)
Cao, C., Zhang, Y.: Learning to compare relation: semantic alignment for few-shot learning. IEEE Trans. Image Process. 31, 1462–1474 (2022)
Carloni, G., Colantonio, S.: Exploiting causality signals in medical images: a pilot study with empirical results. Expert Syst. Appl., 123433 (2024)
Carloni, G., Pachetti, E., Colantonio, S.: Causality-driven one-shot learning for prostate cancer grading from MRI. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2616–2624 (2023)
Castro, D.C., Walker, I., Glocker, B.: Causality matters in medical imaging. Nat. Commun. 11(1), 3673 (2020)
Cohen, J.P., Hashir, M., Brooks, R., Bertrand, H.: On the limits of cross-domain generalization in automated X-ray prediction. In: Medical Imaging with Deep Learning. pp. 136–155. PMLR (2020)
Hartley, J., Sanchez, P.P., Haider, F., Tsaftaris, S.A.: Neural networks memorise personal information from one sample. Sci. Rep. 13(1), 21366 (2023)
Irvin, J., 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)
Johnson, A.E., et al.: MIMIC-CXR-JPG, a large publicly available database of labeled chest radiographs. arXiv preprint arXiv:1901.07042 (2019)
Li, Z., et al.: Domain generalization for mammography detection via multi-style and multi-view contrastive learning. In: de Bruijne, M., et al. (eds.) Medical Image Computing and Computer Assisted Intervention – MICCAI 2021: 24th International Conference, Strasbourg, France, September 27 – October 1, 2021, Proceedings, Part VII, pp. 98–108. Springer International Publishing, Cham (2021). https://doi.org/10.1007/978-3-030-87234-2_10
Nie, W., Zhang, C., Song, D., Bai, Y., Xie, K., Liu, A.-A.: Chest X-ray image classification: a causal perspective. In: Greenspan, H., et al. (eds.) Medical Image Computing and Computer Assisted Intervention – MICCAI 2023: 26th International Conference, Vancouver, BC, Canada, October 8–12, 2023, Proceedings, Part III, pp. 25–35. Springer Nature Switzerland, Cham (2023). https://doi.org/10.1007/978-3-031-43898-1_3
Ouyang, C., et al.: Causality-inspired single-source domain generalization for medical image segmentation. IEEE Trans. Med. Imaging 42(4), 1095–1106 (2022)
Pan, X., Ge, C., Lu, R., Song, S., Chen, G., Huang, Z., Huang, G.: On the integration of self-attention and convolution. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 815–825 (2022)
Pearl, J.: Causal inference. Causality: objectives and assessment, pp. 39–58 (2010)
Pearl, J.: Interpretation and identification of causal mediation. Psychol. Methods 19(4), 459 (2014)
Pham, H.H., Le, T.T., Tran, D.Q., Ngo, D.T., Nguyen, H.Q.: Interpreting chest x-rays via CNNs that exploit hierarchical disease dependencies and uncertainty labels. Neurocomputing 437, 186–194 (2021)
Pooch, E.H., Ballester, P., Barros, R.C.: Can we trust deep learning based diagnosis? The impact of domain shift in chest radiograph classification. In: Thoracic Image Analysis: Second International Workshop, TIA 2020, Held in Conjunction with MICCAI 2020, Lima, Peru, October 8, 2020, Proceedings 2, pp. 74–83. Springer (2020). https://doi.org/10.1007/978-3-030-62469-9_7
Rajaraman, S., Antani, S.: Training deep learning algorithms with weakly labeled pneumonia chest X-ray data for Covid-19 detection. MedRxiv (2020)
Sanchez, P., Voisey, J.P., Xia, T., Watson, H.I., O’Neil, A.Q., Tsaftaris, S.A.: Causal machine learning for healthcare and precision medicine. Royal Soc. Open Sci. 9(8), 220638 (2022)
Sui, Y., Wang, X., Wu, J., Lin, M., He, X., Chua, T.S.: Causal attention for interpretable and generalizable graph classification. In: Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 1696–1705 (2022)
Sung, F., Yang, Y., Zhang, L., Xiang, T., Torr, P.H., Hospedales, T.M.: Learning to compare: Relation network for few-shot learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1199–1208 (2018)
Teney, D., Lin, Y., Oh, S.J., Abbasnejad, E.: ID and OOD performance are sometimes inversely correlated on real-world datasets. In: Advances in Neural Information Processing Systems, vol. 36 (2024)
Vaswani, A., et al.: Attention is all you need. In: Advances in Neural Information Processing Systems, vol. 30 (2017)
Wang, J., et al.: Generalizing to unseen domains: a survey on domain generalization. IEEE Trans. Knowl. Data Eng. 35(8), 8052–8072 (2022)
Wang, T., Zhou, C., Sun, Q., Zhang, H.: Causal attention for unbiased visual recognition. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3091–3100 (2021)
Wang, X., Peng, Y., Lu, L., Lu, Z., Bagheri, M., Summers, R.M.: ChestX-ray8: Hospital-scale chest X-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2097–2106 (2017)
Zhang, J., et al.: Learning towards synchronous network memorizability and generalizability for continual segmentation across multiple sites. In: Wang, L., Dou, Q., Fletcher, P.T., Speidel, S., Li, S. (eds.) Medical Image Computing and Computer Assisted Intervention – MICCAI 2022: 25th International Conference, Singapore, September 18–22, 2022, Proceedings, Part V, pp. 380–390. Springer Nature Switzerland, Cham (2022). https://doi.org/10.1007/978-3-031-16443-9_37
Zunaed, M., Haque, M.A., Hasan, T.: Learning to generalize towards unseen domains via a content-aware style invariant model for disease detection from chest X-rays. IEEE J. Biomedical Health Inform. 28(6), 3626–3636 (2024). https://doi.org/10.1109/JBHI.2024.3372999
Acknowledgments
This study has received funding from the European Union’s Horizon 2020 program under grant No 952159 (ProCAncer-I) and the Tuscany Project PAR-FAS PRAMA. The funders had no role in the design of the study, the collection, analysis, and interpretation of data, or writing the manuscript. We acknowledge the CINECA award under the ISCRA initiative for the availability of high-performance computing resources and support.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Ethics declarations
Disclosure of Interests
The authors have no competing interests to declare.
Rights and permissions
Copyright information
© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Carloni, G., Tsaftaris, S.A., Colantonio, S. (2025). CROCODILE: Causality Aids RObustness via COntrastive DIsentangled LEarning. In: Sudre, C.H., Mehta, R., Ouyang, C., Qin, C., Rakic, M., Wells, W.M. (eds) Uncertainty for Safe Utilization of Machine Learning in Medical Imaging. UNSURE 2024. Lecture Notes in Computer Science, vol 15167. Springer, Cham. https://doi.org/10.1007/978-3-031-73158-7_10
Download citation
DOI: https://doi.org/10.1007/978-3-031-73158-7_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-73157-0
Online ISBN: 978-3-031-73158-7
eBook Packages: Computer ScienceComputer Science (R0)