Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

A deep learning approach to infer galaxy cluster masses from Planck Compton-y parameter maps


Galaxy clusters are useful laboratories to investigate the evolution of the Universe, and accurate measurement of their total masses allows us to constrain important cosmological parameters. However, estimating mass from observations that use different methods and spectral bands introduces various systematic errors. Here we evaluate the use of a convolutional neural network (CNN) to reliably and accurately infer the masses of galaxy clusters from the Compton-y parameter maps provided by the Planck satellite. The CNN is trained with mock images generated from hydrodynamic simulations of galaxy clusters, with Planck’s observational limitations taken into account. We observe that the CNN approach is not subject to the usual observational assumptions, and therefore is not affected by the same biases. By applying the trained CNNs to the real Planck maps, we find cluster masses compatible with Planck measurements within a 15% bias. Finally, we show that this mass bias can be explained by the well-known hydrostatic equilibrium assumption in Planck masses, and the different parameters in the integrated Compton-y signal and the mass scaling laws. This work highlights that CNNs, supported by hydrodynamic simulations, are a promising and independent tool for estimating cluster masses with high accuracy, which can be extended to other surveys as well as to observations in other bands.

This is a preview of subscription content, access via your institution

Access options

Rent or buy this article

Prices vary by article type



Prices may be subject to local taxes which are calculated during checkout

Fig. 1: Verifying CNN with mock maps.
Fig. 2: Comparing CNN predicted cluster mass with the mass estimated by Planck.
Fig. 3: Verifying the bias causes with YM relation.

Data availability

The catalogue of CNN-estimated masses for Planck clusters can be downloaded from The mock y maps used to train the different CNN models can be accessed upon request to the corresponding authors.

Code availability

CNN trained weights and data products are available at


  1. Kravtsov, A. V. & Borgani, S. Formation of galaxy clusters. Annu. Rev. Astron. Astrophys. 50, 353–409 (2012).

    Article  ADS  Google Scholar 

  2. Planck Collaboration et al. Planck 2018 results. VI. Cosmological parameters. Astron. Astrophys. 641, A6 (2020).

  3. Biviano, A. et al. On the efficiency and reliability of cluster mass estimates based on member galaxies. Astron. Astrophys. 456, 23–36 (2006).

  4. Becker, M. R. & Kravtsov, A. V. On the accuracy of weak-lensing cluster mass reconstructions. Astrophys. J. 740, 25 (2011).

    Article  ADS  Google Scholar 

  5. Bryan, G. L. & Norman, M. L. Statistical properties of X-ray clusters: analytic and numerical comparisons. Astrophys. J. 495, 80–99 (1998).

    Article  ADS  Google Scholar 

  6. Planck Collaboration Planck 2015 results. XXIV. Cosmology from Sunyaev–Zeldovich cluster counts. Astron. Astrophys. 594, A24 (2016).

    Article  Google Scholar 

  7. Salvati, L., Douspis, M. & Aghanim, N. Constraints from thermal Sunyaev–Zel’dovich cluster counts and power spectrum combined with CMB. Astron. Astrophys. 614, A13 (2018).

    Article  ADS  Google Scholar 

  8. Gianfagna, G. et al. Exploring the hydrostatic mass bias in MUSIC clusters: application to the NIKA2 mock sample. Mon. Not. R. Astron. Soc. 502, 5115–5133 (2021).

  9. Bishop, C. M., Nasrabadi, N. M. (2006) Pattern recognition and machine learning. Springer, New York.

  10. Baron, D. Machine learning in astronomy: a practical overview. Preprint at (2019).

  11. LeCun, Y., Bengio, Y. & Hinton, G. Deep learning. Nature 521, 436–444 (2015).

    Article  ADS  Google Scholar 

  12. Goodfellow, I., Bengio, Y. & Courville, A. Deep Learning (MIT Press, 2016);

  13. LeCun, Y. et al. Generalization and network design strategies. Connectionism Perspect. 19, 143–155 (1989).

    Google Scholar 

  14. Ntampaka, M. et al. A deep learning approach to galaxy cluster Xray masses. Astrophys. J. 876, 82 (2019).

    Article  ADS  Google Scholar 

  15. Gupta, N. & Reichardt, C. L. Mass estimation of galaxy clusters with deep learning. I. Sunyaev–Zel’dovich effect. Astrophys. J. 900, 110 (2020).

    Article  ADS  Google Scholar 

  16. Gupta, N. & Reichardt, C. L. Mass estimation of galaxy clusters with Deep Learning II. Cosmic microwave background cluster lensing. Astrophys. J. 923, 96 (2021).

    Article  ADS  Google Scholar 

  17. Yan, Z., Mead, A., Van Waerbeke, L., Hinshaw, G. & McCarthy, I. Galaxy cluster mass estimation with deep learning and hydrodynamical simulations. Mon. Not. R. Astron. Soc. 499, 3445–3458 (2020).

    Article  ADS  Google Scholar 

  18. Ho, M. et al. A robust and efficient deep learning method for dynamical mass measurements of galaxy clusters. Astrophys. J. 887, 25 (2019).

    Article  ADS  Google Scholar 

  19. Kodi Ramanah, D., Wojtak, R. & Arendse, N. Simulation-based inference of dynamical galaxy cluster masses with 3D convolutional neural networks. Mon. Not. R. Astron. Soc. 501, 4080–4091 (2021).

    Article  ADS  Google Scholar 

  20. Ho, M., Farahi, A., Rau, M. M. & Trac, H. Approximate Bayesian uncertainties on deep learning dynamical mass estimates of galaxy clusters. Astrophys. J. 908, 204 (2021).

    Article  ADS  Google Scholar 

  21. Planck Collaboration Planck 2015 results. XXVII. The second Planck catalogue of Sunyaev–Zeldovich sources. Astron. Astrophys. 594, A27 (2016).

    Article  Google Scholar 

  22. Cui, W. et al. The Three Hundred project: a large catalogue of theoretically modelled galaxy clusters for cosmological and astrophysical applications. Mon. Not. R. Astron. Soc. 480, 2898–2915 (2018).

    Article  ADS  Google Scholar 

  23. Planck Collaboration Planck 2013 results. XX. Cosmology from Sunyaev–Zeldovich cluster counts. Astron. Astrophys. 571, A20 (2014).

    Article  Google Scholar 

  24. Sunyaev, R. A. & Zeldovich, Y. B. The observations of relic radiation as a test of the nature of X-ray radiation from the clusters of galaxies. Comments Astrophys. Space Phys. 4, 173 (1972).

    ADS  Google Scholar 

  25. Kravtsov, A. V., Vikhlinin, A. & Nagai, D. A new robust low-scatter X-ray mass indicator for clusters of galaxies. Astrophys. J. 650, 128–136 (2006).

    Article  ADS  Google Scholar 

  26. Knollmann, S. R. & Knebe, A. AHF: Amiga’s Halo Finder. Astrophys. J. Suppl. Ser. 182, 608–624 (2009).

    Article  ADS  Google Scholar 

  27. Gianfagna, G., Rasia, E., Cui, W., De Petris, M. & Yepes, G. The hydrostatic mass bias in The Three Hundred clusters. EPJ Web Conf. 257, 00020 (2022).

    Article  Google Scholar 

  28. Yang, T. et al. Understanding the relation between thermal Sunyaev-Zeldovich decrement and halo mass using the Simba and TNG simulations. Mon. Not. R. Astron. Soc. (2022).

  29. Ferragamo, A. et al. Comparison of hydrostatic and lensing cluster mass estimates: a pilot study in MACS J0647.7+7015. Astron. Astrophys. 661, A65 (2022).

    Article  Google Scholar 

  30. Cui, W. et al. nIFTy galaxy cluster simulations—IV. Quantifying the influence of baryons on halo properties. Mon. Not. R. Astron. Soc. 458, 4052–4073 (2016).

    Article  ADS  Google Scholar 

  31. Cui, W. et al. The Three Hundred project: the GIZMO-SIMBA run. Mon. Not. R. Astron. Soc. 514, 977–996 (2022).

    Article  ADS  Google Scholar 

  32. Henden, N. A., Puchwein, E. & Sijacki, D. The redshift evolution of X-ray and Sunyaev–Zel’dovich scaling relations in the FABLE simulations. Mon. Not. R. Astron. Soc. 489, 2439–2470 (2019).

    Article  ADS  Google Scholar 

  33. Le Brun, A. M. C., McCarthy, I. G. & Melin, J.-B. Testing Sunyaev–Zel’dovich measurements of the hot gas content of dark matter haloes using synthetic skies. Mon. Not. R. Astron. Soc. 451, 3868–3881 (2015).

    Article  ADS  Google Scholar 

  34. Le Brun, A. M. C., McCarthy, I. G., Schaye, J. & Ponman, T. J. The scatter and evolution of the global hot gas properties of simulated galaxy cluster populations. Mon. Not. R. Astron. Soc. 466, 4442–4469 (2017).

    ADS  Google Scholar 

  35. Barnes, D. J. et al. The redshift evolution of massive galaxy clusters in the MACSIS simulations. Mon. Not. R. Astron. Soc. 465, 213–233 (2017).

    Article  ADS  Google Scholar 

  36. de Andres, D. et al. Machine learning methods to estimate observational properties of galaxy clusters in large volume cosmological N-body simulations. Preprint at (2022).

  37. Villaescusa-Navarro, F. et al. Robust marginalization of baryonic effects for cosmological inference at the field level. Preprint at (2021).

  38. Klypin, A., Yepes, G., Gottlöber, S., Prada, F. & Heß, S. MultiDark simulations: the story of dark matter halo concentrations and density profiles. Mon. Not. R. Astron. Soc. 457, 4340–4359 (2016).

    Article  ADS  Google Scholar 

  39. Planck Collaboration Planck 2015 results. XIII. Cosmological parameters. Astron. Astrophys. 594, A13 (2016).

    Article  Google Scholar 

  40. Sembolini, F. et al. The MUSIC of galaxy clusters—I. Baryon properties and scaling relations of the thermal Sunyaev–Zel’dovich effect. Mon. Not. R. Astron. Soc. 429, 323–343 (2013).

    Article  ADS  Google Scholar 

  41. Murante, G., Monaco, P., Giovalli, M., Borgani, S. & Diaferio, A. A subresolution multiphase interstellar medium model of star formation and supernova energy feedback. Mon. Not. R. Astron. Soc. 405, 1491–1512 (2010).

    ADS  Google Scholar 

  42. Rasia, E. et al. Cool core clusters from cosmological simulations. Astrophys. J. Lett. 813, L17 (2015).

    Article  ADS  Google Scholar 

  43. Davé, R. et al. SIMBA: cosmological simulations with black hole growth and feedback. Mon. Not. R. Astron. Soc. 486, 2827–2849 (2019).

    Article  ADS  Google Scholar 

  44. Baldi, A. S. et al. Kinetic Sunyaev–Zel’dovich effect in rotating galaxy clusters from MUSIC simulations. Mon. Not. R. Astron. Soc. 479, 4028–4040 (2018).

    Article  ADS  Google Scholar 

  45. Aguado-Barahona, A. et al. Optical validation and characterization of Planck PSZ2 sources at the Canary Islands observatories. II. Second year of LP15 observations. Astron. Astrophys. 631, A148 (2019).

    Article  Google Scholar 

  46. Wen, Z. L. & Han, J. L. Clusters of galaxies up to z = 1.5 identified from photometric data of the Dark Energy Survey and unWISE. Mon. Not. R. Astron. Soc. 513, 3946–3959 (2022).

    Article  ADS  Google Scholar 

  47. Ruppin, F. et al. Impact of ICM disturbances on the mean pressure profile of galaxy clusters: a prospective study of the NIKA2 SZ large program with MUSIC synthetic clusters. Astron. Astrophys. 631, A21 (2019).

    Article  Google Scholar 

  48. Simonyan, K. & Zisserman, A. Very deep convolutional networks for large-scale image recognition. Preprint at (2014).

Download references


We acknowledge helpful discussions with A. Ferragamo, F. De Luca and F. Sembolini. D.d.A., W.C. and G.Y. thank financial support from Ministerio de Ciencia e Innovación (Spain) under project grant PID2021-122603NB-C21. W.C. is supported by the STFC AGP Grant ST/V000594/1 and by the Atracción de Talento Contract no. 2020-T1/TIC-19882 granted by the Comunidad de Madrid in Spain. W.C. further acknowledges the science research grants from the China Manned Space Project with no. CMS-CSST-2021-A01 and no. CMS-CSST-2021-B01. M.D.P. acknowledges support from Sapienza Università di Roma thanks to Progetti di Ricerca Medi 2019, RM11916B7540DD8D and Progetti di Ricerca Medi 2020, RM120172B32D5BE2.

Author information

Authors and Affiliations



D.d.A. led the project, wrote and run the machine learning codes and contributed to most of the writing of the paper. W.C. developed, ran The300 simulation, prepared the mock observation images with PYMSZ and contributed to writing most of the paper. F.R. wrote and run the code pipeline to introduce Planck-like limitations into clean mock observations and assisted with the writing of the paper. M.D.P. and G.Y. assisted with interpretation, manuscript preparation and revision. G.G., I.L., G.A., R.D., M.J. and J.V.-F. contributed to this work with the writing of the project and with machine learning technicalities.

Corresponding authors

Correspondence to Daniel de Andres or Weiguang Cui.

Ethics declarations

Competing interests

The authors declare no competing interests.

Peer review

Peer review information

Nature Astronomy and the authors thank Ziang Yan and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary Information

Supplementary Figs. 1–11, Discussion and Tables 1–3.

Rights and permissions

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

de Andres, D., Cui, W., Ruppin, F. et al. A deep learning approach to infer galaxy cluster masses from Planck Compton-y parameter maps. Nat Astron 6, 1325–1331 (2022).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:

This article is cited by


Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing