# Euclid preparation: XXIII. Derivation of galaxy physical properties with deep machine learning using mock fluxes and H-band images

L. Bisigello, C. J. Conselice, M. Baes, M. Bolzonella, M. Brescia, S. Cavuoti, O. Cucciati, A. Humphrey, L. K. Hunt, C. Maraston, et al.

<figure><img src="image_1.png" /></figure>

## To cite this version:

L. Bisigello, C. J. Conselice, M. Baes, M. Bolzonella, M. Brescia, et al., Euclid preparation: XXIII. Derivation of galaxy physical properties with deep machine learning using mock fluxes and H-band images. Monthly Notices of the Royal Astronomical Society: Letters, 2023, 520 (3), pp.3529-3548. 10.1093/mnras/stac3810. insu-03947319v2

HAL Id: insu-03947319

https://insu.hal.science/insu-03947319v2

Submitted on 13 Mar 2024

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Euclid preparation – XXIII. Derivation of galaxy physical properties with deep machine learning using mock fluxes and H-band images

Euclid Collaboration: L. Bisigello<sup>1,2,3*</sup> C. J. Conselice,<sup>4</sup> M. Baes<sup>5</sup> M. Bolzonella<sup>6</sup>,<sup>2</sup> M. Brescia<sup>6</sup>,<sup>6</sup> S. Cavuoti<sup>6,7,8</sup> O. Cucciati<sup>2</sup> A. Humphrey,<sup>9</sup> L. K. Hunt<sup>10</sup> C. Maraston<sup>11</sup> L. Pozzetti<sup>12</sup> C. Tortora<sup>7</sup> S. E. van Mierlo<sup>13</sup> N. Aghanim,<sup>14</sup> N. Auricchio<sup>2</sup> M. Baldi<sup>2,15,16</sup> R. Bender<sup>17,18</sup> C. Bodendorf,<sup>18</sup> D. Bonino,<sup>19</sup> E. Branchini<sup>20,21</sup> J. Brinchmann<sup>9</sup> S. Camera<sup>19,22,23</sup> V. Capobianco<sup>19</sup> C. Carbone,<sup>24</sup> J. Carretero<sup>25,26</sup> F. J. Castander<sup>27,28</sup> M. Castellano<sup>29</sup> A. Cimatti,<sup>10,30</sup> G. Congedo<sup>31</sup> L. Conversi<sup>32,33</sup> Y. Copin<sup>34</sup> L. Corcione<sup>19</sup> F. Courbin<sup>35</sup> M. Cropper<sup>36</sup> A. Da Silva<sup>37,38</sup> H. Degaudenzi<sup>39</sup> M. Douspis,<sup>14</sup> F. Dubath,<sup>39</sup> C. A. J. Duncan,<sup>4,40</sup> X. Dupac,<sup>32</sup> S. Dusini<sup>41</sup> S. Farrens<sup>42</sup> S. Ferriol,<sup>34</sup> M. Frailis<sup>43</sup> E. Franceschi<sup>2</sup> P. Franzetti,<sup>24</sup> M. Fumana<sup>24</sup> B. Garilli<sup>24</sup> W. Gillard<sup>44</sup> B. Gillis<sup>31</sup> C. Giocoli<sup>12,45</sup> A. Grazian<sup>46</sup> F. Grupp,<sup>17,18</sup> L. Guzzo,<sup>47,48,49</sup> S. V. H. Haugan<sup>50</sup> W. Holmes,<sup>51</sup> F. Hormuth,<sup>52</sup> A. Hornstrup<sup>53</sup> K. Jahnke<sup>54</sup> M. Kümmel,<sup>17</sup> S. Kermiche<sup>44</sup> A. Kiessling<sup>51</sup> M. Kilbinger<sup>42</sup> R. Kohley,<sup>32</sup> M. Kunz<sup>55</sup> H. Kurki-Suonio<sup>56</sup> S. Ligori<sup>19</sup> P. B. Lilje<sup>50</sup> I. Lloro,<sup>57</sup> E. Maiorano<sup>2</sup> O. Mansutti<sup>43</sup> O. Marggraf<sup>58</sup> K. Markovic<sup>51</sup> F. Marulli<sup>2,16,59</sup> R. Massey<sup>60</sup> S. Maurogordato,<sup>61</sup> E. Medinaceli<sup>2</sup> M. Meneghetti,<sup>2,16</sup> E. Merlin<sup>29</sup> G. Meylan,<sup>62</sup> M. Moresco<sup>2,59</sup> L. Moscardini<sup>2,16,59</sup> E. Munari<sup>43</sup> S. M. Niemi,<sup>63</sup> C. Padilla<sup>25</sup> S. Paltani,<sup>39</sup> F. Pasian,<sup>43</sup> K. Pedersen,<sup>64</sup> V. Pettorino,<sup>42</sup> G. Polenta<sup>65</sup> M. Poncet,<sup>66</sup> L. Popa,<sup>67</sup> F. Raison,<sup>18</sup> A. Renzi<sup>1,41</sup> J. Rhodes,<sup>51</sup> G. Riccio,<sup>7</sup> H.-W. Rix<sup>54</sup> E. Romelli<sup>43</sup> M. Roncarelli,<sup>2,59</sup> C. Rosset,<sup>68</sup> E. Rossetti,<sup>59</sup> R. Saglia<sup>17,18</sup> D. Sapone,<sup>69</sup> B. Sartoris,<sup>17,43</sup> P. Schneider,<sup>58</sup> M. Scodeggio,<sup>24</sup> A. Secroun<sup>44</sup> G. Seidel<sup>54</sup> C. Sirignano<sup>1,41</sup> G. Sirri<sup>16</sup> L. Stanco,<sup>41</sup> P. Tallada-Crespí,<sup>26,70</sup> D. Tavagnacco<sup>43</sup> A. N. Taylor,<sup>31</sup> I. Tereno,<sup>37,71</sup> R. Toledo-Moreo<sup>72</sup> F. Torradeflot<sup>26,70</sup> I. Tutusaus<sup>55</sup> E. A. Valentijn,<sup>13</sup> L. Valenziano<sup>2,16</sup> T. Vassallo<sup>43</sup> Y. Wang<sup>73</sup> A. Zacchei<sup>43</sup> G. Zamorani<sup>2</sup> J. Zoubian,<sup>44</sup> S. Andreon<sup>48</sup> S. Bardelli<sup>2</sup> A. Boucaud,<sup>68</sup> C. Colodro-Conde,<sup>74</sup> D. Di Ferdinando,<sup>16</sup> J. Graciá-Carpio,<sup>18</sup> V. Lindholm<sup>56</sup> D. Maino,<sup>24,47,49</sup> S. Mei<sup>68</sup> V. Scottez,<sup>75</sup> F. Sureau,<sup>76</sup> M. Tenti,<sup>16</sup> E. Zucca<sup>2</sup> A. S. Borlaff<sup>77</sup> M. Ballardini<sup>2,59,78</sup> A. Biviano<sup>43,79</sup> E. Bozzo<sup>39</sup> C. Burigana<sup>78,80,81</sup> R. Cabanac<sup>82</sup> A. Cappi,<sup>2,61</sup> C. S. Carvalho,<sup>71</sup> S. Casas<sup>83</sup> G. Castignani,<sup>2,59</sup> A. Cooray,<sup>84</sup> J. Coupon,<sup>39</sup> H. M. Courtois<sup>85</sup> J. Cuby,<sup>86</sup> S. Davini<sup>87</sup> G. De Lucia<sup>43</sup> G. Desprez,<sup>39</sup> H. Dole,<sup>14</sup> J. A. Escartin,<sup>18</sup> S. Escoffier<sup>44</sup> M. Farina,<sup>88</sup> S. Fotopoulou,<sup>89</sup> K. Ganga<sup>68</sup> J. Garcia-Bellido<sup>90</sup> K. George<sup>17</sup> F. Giacomini<sup>16</sup> G. Gozaliasl<sup>91</sup> H. Hildebrandt<sup>92</sup> I. Hook<sup>93</sup> M. Huertas-Company<sup>94,95</sup> V. Kansal,<sup>76</sup> E. Keihanen,<sup>91</sup> C. C. Kirkpatrick,<sup>56</sup> A. Loureiro<sup>31,96,97</sup> J. F. Macías-Pérez<sup>98</sup> M. Magliocchetti<sup>88</sup> G. Mainetti,<sup>99</sup> S. Marcin,<sup>100</sup> M. Martinelli<sup>29</sup> N. Martinet<sup>86</sup> R. B. Metcalf,<sup>2,59</sup> P. Monaco<sup>43,79,101,102</sup> G. Morgante,<sup>2</sup> S. Nadathur<sup>11</sup> A. A. Nucita,<sup>103,104</sup> L. Patrizii,<sup>16</sup> A. Peel<sup>62</sup> D. Potter<sup>105</sup> A. Pourtsidou<sup>31,106</sup> M. Pöntinen<sup>91</sup> P. Reimberg,<sup>107</sup> A. G. Sánchez<sup>18</sup> Z. Sakr<sup>82,108,109</sup> M. Schirmer<sup>54</sup> E. Sefusatti<sup>43,79,102</sup> M. Sereno<sup>2,45</sup> J. Stadel<sup>105</sup> R. Teyssier,<sup>110</sup> C. Valieri,<sup>16</sup> J. Valiviita<sup>111</sup> and M. Viel<sup>43,79,102,112</sup>

Affiliations are listed at the end of the paper

Accepted 2022 December 22. Received 2022 December 22; in original form 2022 June 28

<footnote>* E-mail: laura.bisigello@inaf.it</footnote>
## ABSTRACT

Next-generation telescopes, like *Euclid*, *Rubin*/LSST, and *Roman*, will open new windows on the Universe, allowing us to infer physical properties for tens of millions of galaxies. Machine-learning methods are increasingly becoming the most efficient tools to handle this enormous amount of data, because they are often faster and more accurate than traditional methods. We investigate how well redshifts, stellar masses, and star-formation rates (SFRs) can be measured with deep-learning algorithms for observed galaxies within data mimicking the *Euclid* and *Rubin*/LSST surveys. We find that deep-learning neural networks and convolutional neural networks (CNNs), which are dependent on the parameter space of the training sample, perform well in measuring the properties of these galaxies and have a better accuracy than methods based on spectral energy distribution fitting. CNNs allow the processing of multiband magnitudes together with $H_E$-band images. We find that the estimates of stellar masses improve with the use of an image, but those of redshift and SFR do not. Our best results are deriving (i) the redshift within a normalized error of <0.15 for 99.9 per cent of the galaxies with signal-to-noise ratio >3 in the $H_E$ band; (ii) the stellar mass within a factor of two (~0.3 dex) for 99.5 per cent of the considered galaxies; and (iii) the SFR within a factor of two (~0.3 dex) for ~70 per cent of the sample. We discuss the implications of our work for application to surveys as well as how measurements of these galaxy parameters can be improved with deep learning.

**Key words:** galaxies: evolution – galaxies: general – galaxies: photometry – galaxies: star formation.

## 1 INTRODUCTION

Understanding the physical processes driving galaxy evolution is one of the most outstanding issues in astronomy today. It is clear that galaxies are assembling through star formation and mergers through cosmic time (e.g. Conselice et al. 2014; Madau & Dickinson 2014), and morphologically evolve from irregular/peculiar galaxies at $z > 1$ to more normal regular systems at lower redshifts (e.g. Mortlock et al. 2013). Whilst these basic features are now well understood in a generalized way within an evolving galaxy population, the exact details of this process are still unknown but there will be significant improvements in their understanding in the next decade with large telescope projects such as the *Euclid Space Telescope* (Laureijs et al. 2011), the *Vera C. Rubin Observatory* (*Rubin*/LSST; Ivezic et al. 2008), and the *Nancy Roman Space Telescope* (Akeson et al. 2019).

One of the most important ways for carrying out the analysis of galaxy evolution is through measuring properties of galaxies, like stellar mass and star-formation rates (SFRs), at different distances (or redshifts). These properties of galaxies can be difficult to measure accurately even through standard methodologies (e.g. Bisigello et al. 2016, 2017; Ciesla, Elbaz & Fensch 2017), which are generally based on fitting the galaxy spectral energy distribution (SED) with theoretical or empirical models. In the epoch of large data projects such as *Euclid* and LSST the use of these standard techniques will require huge computing power in order to measure these properties for the hundreds of millions of galaxies that will be observed within these data. Therefore, these large surveys will require the use of methods that go beyond the traditional ones for an efficient and accurate data analysis (i.e. statistical methods, including those based on machine learning). This shows the necessity of improving machine-learning algorithms in the near future.

However, except for some pioneering works (e.g. Tagliaferri et al. 2003; Hoyle 2016; Stensbo-Smidt et al. 2016; D'Isanto & Polsterer 2018; Delli Veneri et al. 2019; Surana et al. 2020; Mucesh et al. 2021; Razim et al. 2021), the measurements of redshift, stellar mass, and SFR in an automatic way with machine learning is still largely under development. Other measurements, such as the galaxy morphology and structure, e.g. CAS parameters (i.e. concentration, asymmetry, and clumpiness; Conselice 2003), have been more extensively tested and can indeed be retrieved through deep-learning methods (e.g. Cheng et al. 2020; Tohill et al. 2021).

In a recent work by the Euclid Collaboration: Desprez et al. (2020), a careful comparison was performed between the photomet-

ric redshift obtained with different standard and machine-learning techniques, showing the strengths and weaknesses of both methods. In particular, the photometric redshift measurement obtained with machine learning is challenging where the colour space regions of the training sample are not well covered; while, traditional methods have issues at very low $z$ (i.e. $z < 0.5$), at least when considering optical and near-infrared (IR) filters, perhaps because of a lack of a valid set of templates or priors. Thus, various methods should be investigated to determine the optimal ways to measure these properties.

In general, galaxy images can contain more information than integrated magnitudes, as the morphology, size, and the presence of companions hold information about their nature. SED fitting methods and machine-learning networks used to derive physical properties are mainly based on integrated quantities. However, recent works (Hoyle 2016; Pasquet et al. 2019) have shown the power of using images to derive photometric redshifts and the improvement caused by adding morphological information when estimating stellar masses (Dobbels et al. 2019). A similar analysis on the direct use of images to estimate stellar masses and SFR is however still missing.

In this paper, we discuss if we can retrieve the most basic galaxy properties from deep-learning neural networks (DLNNs)<fnref n="1" /> and from convolutional neural networks (CNNs), which indeed can make use of galaxy images. We make use of the Cosmos Evolution Survey (COSMOS; Scoville et al. 2007) field and the catalogue from Laigle et al. (2016) as well as imaging from the COSMOS-Drift And SHift (COSMOS-DASH; Mowla et al. 2019) survey with the *Hubble Space Telescope* (HST) Wide Field Camera 3 (WFC3). Thanks to these data, we verify if we are able to retrieve with *Euclid* ($I_E$ previously called VIS, $Y_E$, $J_E$, $H_E$; Euclid Collaboration: Schirmer et al. 2022c) and *Rubin*/LSST filters ($u$, $g$, $r$, $i$, and $z$) the same SFRs and stellar masses derived through SED fitting, but based on a larger number of filters [i.e. 30 from ultraviolet (UV) to near-IR]. This would mean that the machine-learning networks are able to correctly interpolate between filters to retrieve the same output quantities using less input information. In this work, we perform a first step by deriving the point estimates of redshift, stellar mass, and SFR; while, we leave to a future work the complex analysis of the uncertainties and the probability distribution functions associate to each of them.

<footnote n="1">¹A DLNN is similar to a multilayer perceptron; however, it has more than one fully connected layer, as it happens in our case.</footnote>
<figure><img src="image_3.png" /><figcaption>**Figure 1.** Workflow illustrating the different steps considered in this work. We highlight in blue the parts derived from the COSMOS2015 catalogue and in orange the part derived from the COSMOS-DASH survey. The green part indicates the two machine-learning networks considered (see Section 3).</figcaption></figure>

This paper is organized as follows. In Section 2, we introduce the mock Euclid catalogue and the simulated $H_E$-band images. In Section 3, we describe the machine-learning algorithms considered; while, Section 4 contains the redshift, stellar mass, and SFR estimates. The main findings are summarized in Section 5. In this paper, we consider a Lambda cold dark matter cosmology with $H_0 = 70 \text{ km s}^{-1} \text{ Mpc}^{-1}$, $\Omega_m = 0.27$, and $\Omega_\Lambda = 0.73$, a Chabrier (2003) initial mass function (IMF), and all magnitudes are in the AB system (Oke & Gunn 1983).

## 2 MOCK OBSERVATIONS

In the next sections, we report the procedure considered to derive mock *Euclid* magnitudes and Euclidized $H_E$-band images starting from observed galaxies. These are the inputs required by the two neural networks analysed in this work, which are described in details in Section 3. In Fig. 1, we report the full workflow to guide the reader.

### 2.1 Mock catalogue and SED fitting procedure

In this work, we made use of an updated version of the mock catalogue of the Euclid Wide Survey presented by Bisigello et al. (2020). This mock catalogue was created starting from multiwavelength observations of real galaxies in the 2 deg<fnref n="2" /> survey of the COSMOS field. These multiwavelength observations consist of 30 filters, ranging from the UV to near-IR wavelengths, and they are part of the public COSMOS2015 catalogue (Laigle et al. 2016). We removed from the original COSMOS2015 catalogue stars and X-ray sources, the latter corresponding to <1 per cent of the galaxy sample.

Each observed galaxy was fitted comparing theoretical templates with the fluxes available in the 30 COSMOS15 filters, performing a $\chi^2$ fitting procedure using the *LePhare* code (Arnouts et al. 1999;

Ilbert et al. 2006). For these fits we considered a broad set of SED templates from Bruzual & Charlot (2003) with exponentially declining star-formation histories with e-folding time-scale $\tau$ between 0.1 and 10 Gyr, Solar and subsolar metallicity ($Z_\odot$, 0.04 $Z_\odot$), ages from 0.1 to 12 Gyr, 12 values of colour excess from $E(B-V) = 0$ to 1, and the Calzetti et al. (2000) reddening law. The redshift was fixed to the value reported in the COSMOS2015 catalogue.

This fitting procedure allowed us to derive, for each observed galaxy, the best theoretical template and the galaxy physical properties associated to it. In particular, for this work we are interested in the redshift, the stellar mass, and the SFR, while the best-fitting templates were used to derive mock *Euclid* magnitudes (see next section). We considered the previously mentioned associated physical properties to be the ground truth.

We highlight that the considered physical properties have an associate uncertainty derived from the SED fitting procedure. In particular, as mentioned by Laigle et al. (2016), the normalized median absolute deviation (NMAD) of the redshift, derived comparing the photometric redshift with available spectroscopic ones, varies from 0.007 to 0.057 moving from bright galaxies ($16 < i < 21$) to faint galaxies ($25 < i < 26$). At the same time, the median error on the stellar mass and SFR, which are derived from the output probability distribution of each object, is 0.07 and 0.16 dex, respectively. These errors are stated here, but are not considered when showing, in the next sections, the results for the different networks, as they depend on the number of filters and the method used to derived the physical properties used as the ground truth.

### 2.2 Mock magnitudes

The original catalogue from Bisigello et al. (2020) was derived to mimic the Euclid Wide Survey (Euclid Collaboration: Scaramella et al. 2022b) and consists of five filters, i.e. $I_E$, $Y_E$, $J_E$, $H_E$, and the Canada-France Imaging Survey (CFSI) *u* band. To these filters we add complementary magnitudes in the Sloan Digital Sky Survey (SDSS; Gunn et al. 1998), the *g*, *r*, *i*, and *z* filters. Observations in similar filters, such as the ones that will be used by Rubin/LSST, will be available to complement *Euclid* observations (Euclid Collaboration: Scaramella et al. 2022b).

The inclusion of filters bluewards of the *Euclid* bands, such as the previously mentioned *u*, *g*, *r*, *i*, and *z* filters, may improve the reconstruction of the overall SED template by broadening the wavelength coverage. In particular, such filters are expected to improve the derivation of the SFR, by tracing UV wavelengths (Pforr, Maraston & Tonini 2012, 2013), as well as the Lyman break (i.e. 912 Å), which is one of the most prominent feature in a galaxy spectra.

We included photometric errors by scattering each magnitude around its true value, derived from its best-fitting SED, and considering the respective survey noise. We did not include any other source of error. In Table 1 we report the observational depths considered, as expected for the Euclid Wide Survey, to perturb the original COSMOS2015 photometry and to perform the SED fitting procedure using *Euclid* and Rubin/LSST filters. These depths in the *Euclid* bands correspond to the values presented in the *Euclid* definition study report (Laureijs et al. 2011) and are different from the more recent values presented in Euclid Collaboration: Scaramella et al. (2022b).<fnref n="2" /> However, as photometric errors are not included in the machine-learning networks, we do not expect these differences to

<footnote n="2">²Their median $10\sigma$ values are 25.45, 23.55, 23.74, and 23.65 for $I_E$, $Y_E$, $J_E$, and $H_E$, respectively.</footnote>
<table><caption>**Table 1.** Observational depth (point source, $10\sigma$) in AB magnitude, central wavelength, and full width at half-maximum (FWHM) of the filters considered in our Euclid Wide mock catalogue.</caption><thead><tr><th>Band</th><th>10σ Depth</th><th>λ<sub>cen</sub> (Å)</th><th>FWHM (Å)</th></tr></thead><tbody><tr><td>I<sub>E</sub></td><td>24.50</td><td>7150</td><td>3640</td></tr><tr><td>NISP/Y<sub>E</sub></td><td>23.24</td><td>10 850<sup>a</sup></td><td>2660<sup>a</sup></td></tr><tr><td>NISP/J<sub>E</sub></td><td>23.24</td><td>13 750<sup>a</sup></td><td>4040<sup>a</sup></td></tr><tr><td>NISP/H<sub>E</sub></td><td>23.24</td><td>17 725<sup>a</sup></td><td>5020<sup>a</sup></td></tr><tr><td>CFSI/u</td><td>24.20</td><td>3715</td><td>510</td></tr><tr><td>SDSS/g</td><td>24.50</td><td>4700</td><td>1263</td></tr><tr><td>SDSS/r</td><td>23.90</td><td>6174</td><td>1149</td></tr><tr><td>SDSS/i</td><td>23.60</td><td>7534</td><td>1239</td></tr><tr><td>SDSS/z</td><td>23.40</td><td>8782</td><td>994</td></tr></tbody></table>

*Note.* $^4$The central wavelengths and FWHMs of the NISP filters are slightly (<0.6 per cent and <1.3 per cent, respectively) different from the more recent values reported in Euclid Collaboration: Scaramella et al. (2022c).

impact the results presented in this paper. Photometric errors are not included as inputs because the feature analysis on a similar machine-learning algorithm have shown they provide little or no information compared to just using magnitudes (Euclid Collaboration: Humphrey et al. 2022a). At this stage, we did not apply any magnitude cut, as this will be performed later on the images; however, we assigned a value of −1 to all magnitudes below S/N < 3.

## 2.3 $H_E$-band Euclidized images

In this work, we consider machine-learning networks that have as inputs not only magnitudes, but also images. In particular, we make use of simulated images in the $H_E$ filter instead of images in the $I_E$ filter. On one hand, the $I_E$ filter is more sensitive, as it covers a wide 530-920 nm wavelength range (equivalent to r, i, and z together), and it has three times higher angular resolution, together implying more complex modelling. On the other hand, observations in filters similar to the *Euclid* $H_E$ band are already available from *HST*.

We derived our simulated $H_E$-band images from the *HST*–WFC3 Imaging Survey in the COSMOS field (COSMOS-DASH; Mowla et al. 2019), which covers a large fraction of the COSMOS field. We consider the *HST/F160W* images because they correspond to a filter close in wavelength to the $H_E$ filter. We did not apply any k-correction to convert from the *HST/F160W* filter to the $H_E$ band. This would imply the use of a SED model and would change the flux values of each pixel but not the morphological features, which are the ones relevant for the CNN analysis.

We created $H_E$-band images starting from *HST/F160W* thumbnails of 51 × 51 pixels centred around each galaxy. We derive the signal-to-noise ratio (S/N) of each image by retrieving the background flux and the noise from the median and standard deviation of the fluxes on an area of 51 × 51 pixels, with the central 18 × 18 pixels masked to remove the source. For the noise, we derive the value present in the image by calculating the standard deviation after applying a 3σ-clipping procedure. We then add an additional noise, applying a scatter from a Gaussian distribution, in order to reproduce the expected *Euclid* noise. The signal on the source was then roughly derived from the central 6 × 6 pixels, which correspond to a square of ~0.7 arcsec × 0.7 arcsec.<fnref n="3" /> The S/N was then derived by subtracting the background from the signal and dividing the result by the retrieved

noise. We restricted our analysis to galaxies with an S/N > 3, to avoid training the networks with images dominated by noise.

As a second step, we apply the *Euclid* NISP $H_E$-band point spread function (PSF),<fnref n="4" /> photometric noise, and spatial resolution. Both the *Euclid* (~0.7 arcsec) and *HST* PSFs were approximated by two-dimensional (2D) Gaussian functions. In reality, both PSFs are highly non-Gaussian in the wings, we do not expect this to impact extremely our results, as the central small spatial resolution should dominate the training; however, it is recommended to train the network on real images in the future. In this way, we start from an *HST/F160W* image of 51 × 51 pixels centred on each observed galaxy and we obtain an $H_E$-band-simulated image of 25 × 25 pixels. These sizes generally include the entire galaxy in each image and allow for a sample augmentation through rotation without image loss. In Fig. 2, we give an example of the transformation from an observed *HST/F160W* image to a $H_E$-band-simulated image.

In the last step, we matched the COSMOS-DASH catalogue with the COSMOS2015 catalogue, considering a matching radius of 1 arcsec. In this way, we linked each $H_E$-band simulated image to the set of mock magnitudes described in the previous section. We then separate the catalogue into two subsamples with different S/N cuts, i.e. S/N > 3 and S/N > 10, with the S/N derived, as mentioned before, on the $H_E$-band-simulated images. These subsamples correspond to 27 340 and 9799 COSMOS-DASH galaxies with an S/N > 3 and 10, respectively. The redshift, stellar mass, and SFR distributions of both samples are reported in Fig. 3.

## 2.4 Sample augmentation

Sample augmentation is necessary to increase the number of objects and improve the training of the different algorithms. This was done for the magnitudes in the training and validation samples (see Section 3) randomly extracting their values from a Gaussian distribution centred on the true flux values and with a dispersion equal to the photometric noise, as expected for the Euclid Wide Survey. We then convert fluxes to magnitudes. On the other hand, to increase the number of images available, we rotated each of them by 10° for a maximum of 35 times, this change is sufficient to make the network recognize each image as a new one. This method has been often applied in the literature (e.g. Dieleman, Willett & Dambre 2015; Huertas-Company et al. 2015) and it has been demonstrated to improve machine-learning classifications (Cheng et al. 2020).

For the redshift derivation, we increased the number of sources in the catalogue by a factor of 10; while, for the stellar mass and SFR, whose measurements are more challenging, we increased the number of objects up to a factor of 35 in order to obtain a flat distribution (Fig. 3). This is performed to avoid biases on the training (i.e. most present galaxy having the best estimation) and to obtain an estimation that is similar over a range in mass or SFR as large as possible. However, the number of galaxies with S/N > 3 (10) and $log_{10}[SFR/(M_\odot \text{yr}^{-1})] < -2.5 (-3)$ or $log_{10}(M_*/M_\odot) < 8 (8.5)$ are very low and the resulting SFR and stellar mass distributions are flat only above these values. In addition, we applied a rough conversion of the 3σ $I_E$ photometric depth (i.e. $I_E = 25.81$, see Table 1) to SFR by using the relation by Kennicutt (1998), which links the UV luminosity to the unobscured component of the SFR, and converting it to Chabrier (2003) IMF. This conversion is not possible at $z < 1$, as the $I_E$ does not trace the UV light; however, it is useful

<footnote n="3">³This procedure, applied to the original *HST* images, is expected to underestimate the flux of local extended galaxies, for which a specific analysis on the estimation of physical properties will be considered in a future work.</footnote>

<footnote n="4">⁴In order to have a final image consistent with the *Euclid* PSF, we apply a PSF with a standard deviation $\sigma^2 = \sigma^2_{\text{Euclid}} - \sigma^2_{\text{HST}}$.</footnote>
<figure><img src="image_4.png" /><figcaption>**Figure 2.** Example of the transformation from an HST/F160W image (a) to a Euclid $H_E$-band-simulated image (d) of a galaxy at $z = 0.2$. In the first step, we include the Euclid PSF (b), we then include the expected photometric noise (c), and finally we apply the Euclid angular resolution (d). The colour scale is linear and it is the same for all panels.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>**Figure 3.** Distribution of the galaxies in the COSMOS field with imaging S/N > 3 (top panel) and S/N > 10 (bottom panel) in redshift (left-hand panel), stellar mass (centre panel), and SFR (right-hand panel). The distributions are for the training sample (filled purple) and the validation sample (solid red) after applying sample augmentation, and for the test sample (dashed yellow) and the original sample (dotted black) without augmentation. Sample augmentation for SFR and stellar mass is performed to obtain a distribution which is as flat as possible, to avoid biases when training.</figcaption></figure>

to give a rough estimate of the limits imposed by the photometric noise to the SFR estimation. Indeed, we expect the photometric noise to limit the SFR estimates to $\log_{10}[SFR/(M_{\odot} \text{yr}^{-1})] > -0.9$ (0.3) at $z = 1$ (3). In the following analysis we take into account these effects, showing the results for the full sample and for the subsample with a completely flat distribution in stellar mass. For the SFR, we instead show the results for the full sample and for the sample with $\log_{10}[SFR/(M_{\odot} \text{yr}^{-1})] > 0$.

After augmentation, the training samples used for the redshift measurements have 91 130 galaxies with S/N > 3 and 32 660 with S/N > 10. The augmented samples for the stellar mass (SFR) have instead 63 295 (82 899) galaxies with S/N > 3 and 24 296 (29 065) objects with S/N > 10. Each S/N cut refers to the $H_E$-band images, as mentioned in the previous section. The sizes of the samples correspond to the maximum size possible given the input data set and the augmentation procedure explained.

# 3 MACHINE-LEARNING ALGORITHMS

In this work, we considered two different machine-learning algorithms, a DLNN, which has as input exclusively tabular data, and a CNN, which includes also images. We investigate these two different

machine-learning algorithms to determine the performance of both for measuring different physical parameters of galaxies and how they compare with each other. In the future, this work may be extended considering a 1D CNN instead of a DLNN, which may better capture features in the SED, and a more complex CNN with multiple input images.

## 3.1 Deep-Learning Neural Network

In the DLNN, we used two different sets of inputs, namely (i) the four Euclid magnitudes and (ii) the four Euclid magnitudes complemented with the magnitudes in the *u* CHFT and *g*, *r*, *i*, and *z* SDSS ground-based filters. These ground-based filters will be available through ancillary surveys with different facilities (Euclid Collaboration: Scaramella et al. 2022b). In both cases, we considered the sample with $H_E$-band images with S/N > 3 and the subsample with S/N > 10, training the network separately for each S/N cut.

The architecture of the DLNN is summarized in Table 2 and consists of four linear layers with the number of neurons ranging from 500 to 2000. Each neuron of each layer is fully connected with the neurons of the previous and the following layer and these connections are updated during the training in order to derive the
<table><caption>**Table 2.** The DLNN architecture used in this paper. Linear is a fully connected layer that applies a linear transformation. We also include a ReLU function between each linear layer.</caption><thead><tr><th>Layer</th><th>N<sub>input</sub></th><th>N<sub>output</sub></th></tr></thead><tbody><tr><td>Linear</td><td>N<sup>a</sup></td><td>2000</td></tr><tr><td>Linear</td><td>2000</td><td>1000</td></tr><tr><td>Linear</td><td>1000</td><td>500</td></tr><tr><td>Linear</td><td>500</td><td>1</td></tr></tbody></table>

Note. $^aN$ is equal to the number of input filters (i.e. four or nine) for the single runs, and it is equal to the number of runs, i.e. 10, for the Meta-learner.

<table><caption>**Table 3.** The CNN architecture used in this paper. Conv2d indicates a 2D convolutional layer, Max pool corresponds to a pooling layer using the maximum value to downsample each image, Linear is a fully connected layer that applies a linear transformation. We included a ReLU function between each convolutional or linear layer. Galaxy images are introduced in the first Conv2d layer, while fluxes are included in the first Linear layer.</caption><thead><tr><th>Layer</th><th>Kernel size</th><th>N<sub>input</sub></th><th>N<sub>output</sub></th></tr></thead><tbody><tr><td>Conv2d</td><td>3 × 3</td><td>1 × 18 × 18</td><td>64 × 16 × 16</td></tr><tr><td>Conv2d</td><td>3 × 3</td><td>64 × 16 × 16</td><td>64 × 14 × 14</td></tr><tr><td>Max pool</td><td>2 × 2</td><td>64 × 14 × 14</td><td>64 × 13 × 13</td></tr><tr><td>Conv2d</td><td>3 × 3</td><td>64 × 13 × 13</td><td>128 × 11 × 11</td></tr><tr><td>Conv2d</td><td>3 × 3</td><td>128 × 11 × 11</td><td>128 × 9 × 9</td></tr><tr><td>Max pool</td><td>2 × 2</td><td>128 × 9 × 9</td><td>128 × 8 × 8</td></tr><tr><td>Conv2d</td><td>3 × 3</td><td>128 × 8 × 8</td><td>256 × 6 × 6</td></tr><tr><td>Conv2d</td><td>3 × 3</td><td>256 × 6 × 6</td><td>256 × 4 × 4</td></tr><tr><td>Conv2d</td><td>3 × 3</td><td>256 × 4 × 4</td><td>256 × 2 × 2</td></tr><tr><td>Max pool</td><td>2 × 2</td><td>256 × 2 × 2</td><td>256 × 1 × 1</td></tr><tr><td>Linear</td><td>—</td><td>256 + N<sup>a</sup></td><td>2000</td></tr><tr><td>Linear</td><td>—</td><td>2000</td><td>1000</td></tr><tr><td>Linear</td><td>—</td><td>1000</td><td>500</td></tr><tr><td>Linear</td><td>—</td><td>500</td><td>1</td></tr></tbody></table>

Note. $^aN$ is equal to the number of input filters (i.e. four or nine).

optimal way to map the input integrated magnitudes into the desired physical properties. Among each linear layer there is a Rectified Linear Unit (ReLU; Nair & Hinton 2010), such that $f(x) = 0$ if $x < 0$ and $f(x) = x$ if $x \ge 0$. A similar architecture has been previously used, even if with different inputs, number of neurons and hidden layers, to derive photometric redshift (e.g. Firth, Lahav & Somerville 2003; Collister & Lahav 2004).

As a simple and direct test, in this work we kept the same architecture when changing the set of inputs (e.g. *Euclid* only versus *Euclid* + LSST filters). However, we have not fully explored all the possible combinations of number of neurons and hidden layers, so there may be some architectures that optimize the use of the different set of inputs separately. This would have an impact on the absolute precision of the networks, but this is expected to leave the qualitative statements of the paper untouched. A full optimization will be performed in the future, once real data become available.

## 3.2 Convolutional Neural Network

The CNN has as input either of the sets of magnitudes of the DLNN (i.e. only *Euclid* filters or *Euclid* and ancillary filters), but it also includes the simulated $H_E$-band images. The architecture of this second network is summarized in Table 3. It consists of a series of convolutional layers applied to the $H_E$-band images, whose outputs are then combined with the magnitudes and processed through a set of linear layers. The convolutional layers are key for identifying features and shapes inside each $H_E$-band image. We chose a deep network with

$3 \times 3$ kernels, instead of a network with less layers but larger kernels, as this architecture makes the decision function more discriminative and reduces the number of free parameters (Simonyan & Zisserman 2015).

After every two convolutional layers we applied a max-pooling layer, which is used for down-sizing the images which reduces the number of parameters of the network. As for the DLNN, the linear layers are interspersed with ReLU functions. The CNN is trained separately with the two sub-samples with different S/N cuts in the $H_E$-band images.

As a preliminary approach, we decided to derive, in both the CNN and DLNN runs, the redshift, stellar mass, and SFR independently. In this way we can investigate the challenges of the derivation of the three properties separately. We leave the combined analysis to a future work, but as reported in Appendix A (available online), we do not find evidence of galaxies with unrealistic combinations of physical properties, e.g. very-low-mass galaxies at very high z.

## 3.3 Re-scaling

We re-scaled all input parameters, i.e. stellar mass, SFR, redshift, and magnitudes, in order to have values between 0 and 1. This is performed by subtracting from each parameter its minimum value and dividing it by the difference between its maximum and minimum values. This is performed in logarithmic scale for the stellar mass and SFR and in linear scale for the redshift. We do not consider magnitudes below S/N < 3 in the re-scaling, as we assigned a value of -1 to all of them (Section 2.2). A similar re-scaling is also applied to each simulated $H_E$-band image in order to have pixel values between 0 and 1. The same re-scaling is applied to the entire sample; however, it is calculated using only the galaxies considered for the training (see later). This re-scaling is an important step in machine learning as the inputs and outputs may differ over orders of magnitude and, therefore, the largest one may dominate the training process. It is necessary to keep in mind, when comparing the CNN to the DLNN in the next sections, that because of the re-scaling performed separately for each galaxy, each $H_E$-band image has lost information about the overall galaxy flux and mainly contains the information on features and shapes, which is what we aim to train on.

## 3.4 Hyperparameters

We also divide the full sample into batches of 200 objects, which are used serially to update the training process, to increase stochasticity, and reduce the problem of local minima. In both the CNN and DLNN runs we implement an Adam algorithm (Kingma & Ba 2014), which is an optimization function based on stochastic gradient descent, to optimize the hyperparameters of the networks. To evaluate the difference between the data and the predictions, for each update of the network we derived a loss function based on the mean squared error (MSE), i.e. $l(x, y) = \sum_{n=0}^{N}(x_n - y_n)^2/N$, where x are the predicted values, y the target ones, and N is the total number of galaxy in input.

## 3.5 The training, the validation, and the test samples

We randomly split all the samples in three subsamples, of equal numbers, and we then apply augmentation only to the training and validation samples (see Fig. 3 and Section 2.4). Each network is trained with the first subsample (training sample), while the second subsample (validation sample) is used to estimate in an independent way the loss function and stop the training when it converges to avoid overfitting (i.e. over learning features specific of the training
sample), which may happen if we only analyse the loss function derived with the subsample used for training. The third subsample (test sample) is never seen by the networks, and is only used to evaluate the results. This subsample is not augmented so that the final statistics corresponds to a realistic galaxy sample. The split is performed once for all networks and is done before augmentation to avoid having the same object present in the training and in the test sample.

## 3.6 Networks combination methods

All networks are run 10 times using different random seeds. This number was chosen as a compromise between computational time and stochasticity. We then combine these runs with three different approaches. We report the results for the following:

(i) The best network, defined as the network with the smallest outlier fraction considering the full sample for the redshift estimation, then the subsample with a flat stellar mass distribution for the stellar mass derivation, and then the subsample above $SFR > 1 M_{\odot} yr^{-1}$ for the SFR measurements.

(ii) The median of the outputs of the 10 networks.

(iii) A Meta-learner (Wolpert 1992; Euclid Collaboration: Humphrey et al. 2022a) that is an additional machine-learning network used as a linear discriminant among the different runs. This allows us to take into account the fact that some runs may have identified features peculiar to a subset of data. This Meta-learner consists of a DLNN with the architecture shown in Table 2; however, it uses the results of the 10 runs, instead of the magnitudes, as inputs.

## 4 GALAXY PROPERTIES DERIVED WITH MACHINE LEARNING

In this section, we report and discuss the results for the redshift, stellar mass, and SFR estimates based on machine-learning methods. We highlight that in order to train the machine-learning algorithms we need to have a sample with known output values. In this work, we rely on simulated data and with real data we could rely on spectroscopic redshifts and SFRs derived from a combination of different tracers (e.g. UV and IR stellar continuum). However, there is not an equivalent method to derive the true stellar mass of galaxies and we need to rely on the SED fitting applied to a subsample of galaxies with plenty of ancillary data. The power of machine learning is the capability of deriving the properties with a better accuracy.

For comparison, we also report the results derived with the same SED fitting procedure used to retrieve mock magnitudes, but using both the four Euclid filters and the nine Euclid and ancillary filters, as inputs. This of course corresponds to an ideal situation, as the same code and the same set of templates are used to retrieve the mock magnitudes and to estimate physical properties. It is, however, necessary to take into account that other SED fitting codes may perform differently, not only because of different SED libraries, but also because of the use of priors, which are instead not used here. This test is anyway useful for a direct comparison with the machine-learning algorithms considered.

### 4.1 Computational performance

One of the main advantages of machine-learning algorithms is the time necessary to derive the desired results. In general, the time necessary to apply a SED fitting procedure, regardless of the considered code, depends on the number of templates considered.

For example, with the set-up considered in this work, i.e. 14 SED templates (see Section 2.2), 12 dust extinction values, 23 age values, and with redshift steps of 0.05 up to $z = 6$, LePhare takes 0.23 s per object,<fnref n="5" /> requiring more than 4 h for ~63 × 10³ objects. Conversely, the DLNN training requires around 20–40 min, depending on the sample size (e.g. ~24 or 63 × 10³ objects); while, the evaluation requires less than a minute in total for the same 63 × 10³ objects and using the same machine. The CNN, using a graphics processing unit, requires a longer time for training, up to 13 h, and for evaluating (~15 min), given the larger complexity of the set of inputs. There is in any case a huge improvement on time cost moving from SED fitting codes to DLNN or CNN, as machine-learning networks, once the training is performed, require only to apply a set of linear transformations, or convolution for the CNN, to calculate the output values; while, a SED fitting procedure requires more complex steps, e.g. chi-square derivation for each combination of SED template and object.

### 4.2 Redshift derivation

In Table 4, we report the fraction of outliers ($f_{out}$), defined as objects with $|z_{out} - z_{in}| > 0.15 (1 + z_{in})$ as commonly defined in the literature (e.g. Ilbert et al. 2010; Laigle et al. 2016), the bias

$$ \langle \Delta z \rangle = \text{median}[(z_{out} - z_{in})/(1 + z_{in})], \quad (1) $$

and the NMAD<fnref n="6" />

$$ \text{NMAD} = 1.48 [|z_{out} - z_{in}|/(1 + z_{in})], \quad (2) $$

of the recovered redshifts for all networks. In the same table, we list results for the best and the median of the 10 runs of each network, as well as the results derived considering the Meta-learner. The latter are also shown in Figs 4 and 5, for the four (i.e. two sets of inputs and two S/N cuts) DLNN and the four CNN runs, respectively.

First, when focusing on each network to compare the 10 different runs, it is evident that the Meta-learner (see Section 3) gives in general better results than both the best of the 10 runs and the median of them. The fraction of outliers of the Meta-learner is always the smallest, even if for some networks with nine input filters the other two approaches give comparable results. The improvement in the fraction of outliers goes up to $\Delta f_{out} = 0.016 (0.027)$, when comparing with the best (median) of the 10 runs with four input filters. When we considered the networks with nine input filters, both for the DLNN and the CNN, the fraction of outliers are very small in all cases and the difference is, at maximum, $\Delta f_{out} = 0.003$. In addition, the NMAD of the Meta-learner is always the smallest, showing that this approach not only generally decreases the fraction of outliers, but also improves the overall redshift accuracy. As an additional test, we analyse the impact of including at the end of the network a dropout layer, which randomly set to zero some of the elements of the inputs during training with probability 0.5 using samples from a Bernoulli distribution. This method, whose results are not shown here, even if it can identify different trends present in the data, as the Meta learner, does not have the advantage of using the results from multiple runs. Indeed, it performs worse than the Meta learner (e.g. $f_{out} = 0.129$, $\langle \Delta z \rangle = 0.005$, and NMAD = 0.066 for the DLNN with four input filters and images with S/N > 3) even when doubling the nodes of the last hidden layer (i.e. $f_{out} = 0.111$, $\langle \Delta z \rangle = -0.005$, and NMAD = 0.058).

<footnote n="5">⁵This is using a machine with 12 central processing units of 3.20 GHz and a 16 GB random access memory.</footnote>

<footnote n="6">⁶This is equivalent to the standard deviation for a normal distribution.</footnote>
<table><caption>**Table 4.** Statistics of the redshift derivation. Columns are (1) considered algorithms, (2) numbers of input filters $N_{in}$, (3) S/N cuts, (4) method used to combine the 10 runs of each network, (5) fraction of outliers, (6) bias, (7) NMAD, and (8) MSE. For the combination method, we include the results of the best run, the median among the 10 runs, and the results for the Meta-learner applied to the 10 runs. The first four lines correspond to results derived with SED fitting.</caption><thead><tr><th>Algorithm<br>(1)</th><th>N<sub>in</sub><br>(2)</th><th>S/N<br>(3)</th><th>Combination<br>(4)</th><th>f<sub>out</sub><br>(5)</th><th>⟨Δz⟩<br>(6)</th><th>NMAD<br>(7)</th><th>MSE<br>(8)</th></tr></thead><tbody><tr><td>SED</td><td>4</td><td>3</td><td>—</td><td>0.604</td><td>0.090</td><td>0.327</td><td>0.442</td></tr><tr><td>SED</td><td>4</td><td>10</td><td>—</td><td>0.596</td><td>0.105</td><td>0.315</td><td>0.280</td></tr><tr><td>SED</td><td>9</td><td>3</td><td>—</td><td>0.127</td><td>-0.002</td><td>0.045</td><td>0.081</td></tr><tr><td>SED</td><td>9</td><td>10</td><td>—</td><td>0.040</td><td>-0.003</td><td>0.029</td><td>0.028</td></tr><tr><td>DLNN</td><td>4</td><td>3</td><td>Best</td><td>0.099</td><td>0.011</td><td>0.052</td><td>0.014</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.103</td><td>0.011</td><td>0.050</td><td>0.014</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.088</td><td>0.005</td><td>0.050</td><td>0.014</td></tr><tr><td>DLNN</td><td>4</td><td>10</td><td>Best</td><td>0.076</td><td>0.005</td><td>0.050</td><td>0.010</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.081</td><td>0.003</td><td>0.050</td><td>0.010</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.068</td><td>0.004</td><td>0.048</td><td>0.010</td></tr><tr><td>CNN</td><td>4</td><td>3</td><td>Best</td><td>0.133</td><td>0.015</td><td>0.073</td><td>0.017</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.138</td><td>0.009</td><td>0.071</td><td>0.017</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.119</td><td>0.008</td><td>0.064</td><td>0.015</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Best</td><td>0.133</td><td>-0.012</td><td>0.077</td><td>0.014</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.144</td><td>-0.001</td><td>0.081</td><td>0.015</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.117</td><td>0.013</td><td>0.071</td><td>0.013</td></tr><tr><td>DLNN</td><td>9</td><td>3</td><td>Best</td><td>0.001</td><td>-0.002</td><td>0.008</td><td>0.000</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.002</td><td>-0.001</td><td>0.010</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.001</td><td>0.001</td><td>0.006</td><td>0.000</td></tr><tr><td>DLNN</td><td>9</td><td>10</td><td>Best</td><td>0.002</td><td>0.001</td><td>0.013</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.002</td><td>0.001</td><td>0.014</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.002</td><td>0.000</td><td>0.010</td><td>0.000</td></tr><tr><td>CNN</td><td>9</td><td>3</td><td>Best</td><td>0.002</td><td>0.005</td><td>0.028</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.003</td><td>-0.001</td><td>0.022</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.002</td><td>-0.003</td><td>0.017</td><td>0.001</td></tr><tr><td>CNN</td><td>9</td><td>10</td><td>Best</td><td>0.003</td><td>-0.009</td><td>0.030</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Median</td><td>0.005</td><td>0.000</td><td>0.027</td><td>0.001</td></tr><tr><td></td><td></td><td></td><td>Meta-learner</td><td>0.002</td><td>-0.003</td><td>0.023</td><td>0.001</td></tr></tbody></table>

<figure><img src="image_6.png" /><figcaption>**Figure 4.** Top panel: Comparison between the recovered redshift and the input one for the DLNN methods. Points are coloured depending on the number of galaxies with the same combination of input and output redshift, following a linear scale from blue to yellow corresponding to 1 and 450 (200) galaxies with S/N > 3 (S/N > 10). The red dashed line is the identity and the red dotted lines indicate the outlier limits, i.e. |Δz| = 0.15 (1 + zin). On the top left of each panel, we report the fraction of outliers, the bias, and the NMAD. On the bottom right, we report the number of objects in the test sample. Bottom panel: Distribution of the absolute normalized redshift difference. The red vertical dashed line shows a null difference and the red dotted lines correspond to values of 0.15 and -0.15. From left-hand to right-hand panel: Redshift recovered using DLNN with four Euclid filters considering objects with S/N > 3 and with S/N > 10, and redshift recovered using DLNN with nine input filters considering objects with S/N > 3 and with S/N > 10. The 10 runs of each network are combined using a Meta-learner.</figcaption></figure>
<figure><img src="image_7.png" /><figcaption>**Figure 5.** Same as Fig. 4, but for the runs using the CNN.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>**Figure 6.** Difference between the recovered redshift in the CNN and DLNN with respect to the number of pixels that are three times above the noise level. Solid circles show the median difference, while the error bars show the central 25 per cent of the distribution.</figcaption></figure>

We now compare the results of the DLNN and the CNN methods. First, if we run the CNN without including any additional flux, but only the $H_E$-band images, the fraction of outliers, averaging the 10 runs, is quite large: i.e. $f_{\text{out}} = 0.601$ when limiting the sample to images with S/N > 3. Second, the CNN does not show an improvement with respect to the DLNN with any combination of S/N cuts or the number of input filters. Even in the cases where the fraction of outliers remains similar, which happens in networks with nine input filters, the NMAD increases. The inclusion of the $H_E$-band image adds information about the size of the objects, which could in principle improve the redshift estimation; however, this is probably limited by the $H_E$-band spatial resolution (0.3 arcsec, ~2.5 kpc at z = 1.5). Indeed, as can be seen in Fig. 6, as the number of pixels above the noise level increases there is an increase of objects for which the CNN gives better results than the DLNN. In the future, the inclusion of images in multiple filters could be tested to allow the CNN to identify features in the SED, like the 4000 Å break, and to take advantage of the higher angular resolution of the $I_E$ filter (0.1 arcsec, ~0.8 kpc at z = 1.5).

We now focus on the results of the DLNN runs combined using the Meta-learner, which gives the best redshift estimation. By comparing the two samples of galaxies with S/N > 10 and S/N > 3, the redshift estimation is improved only when four filters are considered as input. This shows that, in the case with nine input filters, the improvement in data quality given by selecting only S/N > 10 is shadowed by

a decrease of the number of objects in the training sample (see Section 4.3 for further discussion). The inclusion of the additional five ground-based filters, i.e. *u*, *g*, *r*, *i*, and *z*, decreases the fraction of outliers from 0.066–0.088 to 0.001–0.002, depending on the S/N limit. The bias is always very small, below 0.001, while the NMAD decreases from ~0.05 to <0.01, when changing from four to nine input magnitudes.

When four input filters are considered as input, there are galaxies at z ~ 1.7 for which the redshift is underestimated. In particular, in this redshift range the 4000 Å break is inside the $I_E$ filter, so galaxies generally have a red $I_E-I_Y$ colour. These outliers are intermediate-mass ($\langle M_* \rangle = 10^{9.8} M_{\odot}$) star-forming galaxies that, given they have high relative sSFRs, have $I_E-I_Y$ colours similar to galaxies at lower redshifts. For these galaxies, LSST filters are probably necessary to add information bluewards the 4000 Å break. The importance of the optical filters is highlighted also by the sensitivity analysis reported in Appendix B (available online).

### 4.2.1 Comparison with the Euclidphotometric-redshift challenge

The Euclid photometric-redshift challenge presented in Euclid Collaboration: Desprez et al. (2020) compared the photometric redshift estimation derived using 13 different methods, nine of which are based on machine-learning techniques. The considered machine-learning networks are based on the nearest neighbour (i.e. Directional Neighborhood Fitting by De Vicente, Sánchez & Sevilla-Noarbe 2016; FRANKENZ and the Nearest-Neighbour Photometric Redshift by Tanaka et al. 2018), boosted decision trees, random forest (Pedregosa et al. 2011), Gaussian processes, and neural networks (ANNz by Collister & Lahav 2004; Machine-learning Estimation Tool for Accurate PHOtometric Redshifts by Cavuoti et al. 2017; Amaro et al. 2019). We refer to each specific papers and the work by Euclid Collaboration: Desprez et al. (2020) for all the details about these methods.

A precise comparison between our work and their results needs to be considered with caution, given the differences in the considered input samples and filters; however, it can still be used to put our work into contest. In particular, their work uses-in input magnitudes in eight optical-to-near-IR filters (no *u* band) derived from observations available in the COSMOS field. Their analysis is restricted to galaxies with available spectroscopic redshifts and the derived one-point statistics, such as outlier fraction and NMAD, are calculated
weighting the spectroscopic sample in order to match the colour-space of the parent photometric catalogue. Therefore, on one hand, their sample may be prone to biases due to the spectroscopic selection; however, on the other hand, our input sample may be missing some galaxy populations not included in the considered SED templates.

Taking these differences in mind, results obtained with their machine-learning algorithms correspond to a fraction of outliers and NMAD varying from 0.031 to 0.326 and from 0.053 to 0.114, respectively. Both quantities are smaller than the ones derived in this work considering nine input filters; however, at least some of them are better than our results derived with only Euclid filters.

### 4.2.2 Comparison with the LePhare SED fitting

Results obtained with the CNN or DLNN all outperformed results from the SED fitting, using their same set of input magnitudes, even in the ideal case where both the code and the SED templates are the same, and are thus used to create the mock magnitudes. The fraction of outliers with the SED fitting corresponds to 0.604 and 0.127, when considering the sample with S/N > 3 and four and nine filters as input, respectively. For comparison, Euclid Collaboration: Desprez et al. (2020) used eight input filters (no u filter), the same SED fitting code, but a different input sample not corresponding to the templates used to generate photometric magnitudes (see previous section), finding an outlier fraction of 0.134 and a NMAD of 0.056. The outlier fractions we find range between four and 100 times more than the fraction of outliers derived with any CNN or DLNN runs. The improvement of the machine-learning algorithms over SED fitting has also been shown by Euclid Collaboration: Humphrey et al. (2022a) when selecting passive galaxies. These authors argued that this is due to the machine-learning networks' capability to optimally weight the different input data points; while, the SED fitting methods generally use a more direct weighting method, based on the S/N. More details on the SED fitting results are reported in Appendix C (available online).

Overall, among the different cases tested here, the best network for redshift estimation consists of the DLNN with nine input filters and S/N > 3, combined using a Meta-learner.

## 4.3 Stellar masses

The results for the stellar mass retrieval with machine learning are summarized in Table 5 for both the CNN and the DLNN methods, considering all the different inputs, both S/N cuts and the different methods to combine the 10 runs of each network. We remind the reader that the redshift is not among the inputs when deriving the stellar mass, as the two quantities are derived with separate networks. We estimate for the entire sample the fraction of outliers, arbitrary defined as galaxies for which the stellar mass is overestimated or underestimated by a factor of two (~0.3 dex). In addition, we estimate for each method the bias

$$ \langle \Delta M_* \rangle = \text{median}[\log_{10}(M_{*,\text{out}}/M_{*,\text{in}})] \quad (3) $$

and the NMAD of the recovered stellar mass

$$ \text{NMAD} = 1.48 \text{median}[\log_{10}(M_{*,\text{out}}/M_{*,\text{in}})] \quad (4) $$

Figs 7 and 8 show the results for the DLNN and CNN runs, after combining the results using a Meta-learner.

As for the redshift, we first focus on the three methods to combine the 10 runs of each network. In general, the differences among the

methods are less evident than for the redshift, with the three methods alternating on what gives the best results. However, the fraction of outliers derived with the Meta-learner is the smallest, except for the DLNN with nine filters as input and S/N > 3, with a difference in the fraction of outliers $\Delta f_{\text{out}} \le 0.042$ with respect to the best and the median of the 10 runs. Given the improvement, even if small, offered by the Meta-learner, we will focus on the results obtained with this method in the rest of this section.

We now compare the results of the DLNN, which includes only integrated magnitudes, and the CNN, which contains both integrated magnitudes and $H_E$-band images. We remind the reader that the $H_E$-band images include information about the features and shapes, but not the overall $H_E$-band magnitude. The use of only $H_E$-band images, without any integrated flux, is not sufficient to estimate the stellar mass, as it results, e.g. in a large outlier fraction $f_{\text{out}} = 0.668$ when averaging the results of the 10 runs of the sample limited to images with S/N > 3 and $\log_{10}(M_*/M_{\odot}) > 8$. Using the $H_E$-band images together with the integrated fluxes reduces instead the outlier fraction in the stellar mass with respect to the results obtained with the DLNN (see Table 5). An exception is the case with only four input filters and the sample limited to images with S/N > 10. The improvement in the fraction of outliers using the CNN is generally $\Delta f_{\text{out}} < 0.014$; however, it is present even when the fraction is already very small. This happens, e.g. in the networks with nine input filters, for which the fractions of outliers in the DLNN are below 0.007; however, the inclusion of the $H_E$-band images produces an improvement by $\Delta f_{\text{out}} = 0.001-0.002$.

The $H_E$-band filter traces light from a relatively old stellar population, at least at low redshift, so we expect it to be a good tracer of the stellar mass and drive the improvement when adding the $H_E$-band images. To verify this point, we analyse the fraction of outliers which are evolved galaxies, also called quiescent, (i.e. number of galaxies that are outlier and quiescent divided by the total number of quiescent) and the fraction of outliers which are galaxies currently forming stars and, therefore, including a younger stellar population (i.e. number of galaxies that are outlier and star-forming divided by the total number of star-forming galaxies). The first population is defined as galaxies with input specific star-formation rates (sSFRs) $\log_{10}[\text{sSFR/(yr}^{-1})] < -10.5$, while the second has $\log_{10}[\text{sSFR/(yr}^{-1})] \ge -10.5$.

The comparison between star-forming and quiescent outlier galaxies is shown for the stellar mass and for the redshift (Fig. 9). The inclusion of $H_E$-band images results on an improvement on the measurements of the stellar mass, but not of the redshift (see Section 4.2). While for redshift the outlier fraction of evolved galaxies generally increases for CNN with respect to DLNN, the opposite happens for the stellar mass. Moreover, there is no improvement in the stellar mass measurement of star-forming galaxies between DLNN and CNN when there are four input filters and S/N > 10. There is instead an improvement, even if small, in the mass outlier fraction for evolved galaxies, even if they are less than 30 per cent of star-forming galaxies in the training sample. This explains the improvement on the stellar mass measures introduced by the CNN.

In addition, we investigate the impact of galaxy size in the $H_E$-band images on the stellar mass derivation, by examining the number of pixels that are above three times each image's noise level, or S/N > 3. It is necessary to consider that a compact and unresolved structure is information that the network is using, therefore the introduction of the $H_E$-band images may also improve the stellar mass derivation of unresolved galaxies. Indeed, comparing DLNN and CNN with S/N > 3, galaxies for which the stellar mass measurement improved adding the $H_E$-band images have on average 35 pixels that are three
<table><caption>**Table 5.** Same as Table 4, but for the stellar mass. The results correspond to the mass range where the sample distribution is flat, i.e. $log_{10}(M_*/M_{\odot}) > 8$ for S/N > 3 and 8.5 for S/N > 10; while, values in parentheses correspond to the full sample. The first five lines correspond to results derived with a constant $M/L_H$ ratio and with a SED fitting.</caption><thead><tr><th>Algorithm<br>(1)</th><th>N<sub>in</sub><br>(2)</th><th>S/N<br>(3)</th><th>Combination<br>(4)</th><th>f<sub>out</sub><br>(5)</th><th>⟨ΔM<sub>*</sub>⟩<br>(6)</th><th>NMAD<br>(7)</th><th>MSE<br>(8)</th></tr></thead><tbody><tr><td>M/L<sub>H</sub> = 0.62</td><td>1</td><td>3</td><td>—</td><td>0.298(0.300)</td><td>0.000<sup>a</sup>(0.003)</td><td>0.300(0.302)</td><td>0.084(0.085)</td></tr><tr><td>SED</td><td>4</td><td>3</td><td>—</td><td>0.403(0.412)</td><td>0.134(0.140)</td><td>0.341(0.348)</td><td>0.215(0.268)</td></tr><tr><td>SED</td><td>4</td><td>10</td><td>—</td><td>0.432(0.436)</td><td>0.193(0.196)</td><td>0.375(0.378)</td><td>0.181(0.217)</td></tr><tr><td>SED</td><td>9</td><td>3</td><td>—</td><td>0.128(0.135)</td><td>0.001(0.002)</td><td>0.120(0.121)</td><td>0.112(0.130)</td></tr><tr><td>SED</td><td>9</td><td>10</td><td>—</td><td>0.048(0.051)</td><td>0.012(0.012)</td><td>0.094(0.095)</td><td>0.040(0.051)</td></tr><tr><td rowspan="3">DLNN</td><td>4</td><td>3</td><td>Best</td><td>0.132(0.139)</td><td>-0.037(-0.036)</td><td>0.146(0.148)</td><td>0.073(0.089)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.123(0.129)</td><td>-0.025(-0.024)</td><td>0.129(0.131)</td><td>0.067(0.082)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.121(0.128)</td><td>-0.033(-0.031)</td><td>0.133(0.135)</td><td>0.068(0.085)</td></tr><tr><td rowspan="3">DLNN</td><td>4</td><td>10</td><td>Best</td><td>0.217(0.228)</td><td>-0.034(-0.031)</td><td>0.208(0.212)</td><td>0.079(0.098)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.223(0.231)</td><td>-0.057(-0.052)</td><td>0.221(0.223)</td><td>0.082(0.099)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.217(0.228)</td><td>-0.076(-0.071)</td><td>0.209(0.213)</td><td>0.093(0.103)</td></tr><tr><td rowspan="3">CNN</td><td>4</td><td>3</td><td>Best</td><td>0.128(0.136)</td><td>-0.034(-0.032)</td><td>0.141(0.144)</td><td>0.079(0.097)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.131(0.139)</td><td>-0.024(-0.022)</td><td>0.134(0.136)</td><td>0.068(0.083)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.111(0.119)</td><td>-0.022(-0.020)</td><td>0.127(0.129)</td><td>0.062(0.079)</td></tr><tr><td rowspan="3">CNN</td><td>4</td><td>10</td><td>Best</td><td>0.252(0.262)</td><td>-0.086(-0.082)</td><td>0.235(0.240)</td><td>0.093(0.112)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.263(0.273)</td><td>-0.087(-0.082)</td><td>0.239(0.242)</td><td>0.099(0.117)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.221(0.230)</td><td>-0.020(-0.015)</td><td>0.220(0.226)</td><td>0.088(0.103)</td></tr><tr><td rowspan="3">DLNN</td><td>9</td><td>3</td><td>Best</td><td>0.005(0.008)</td><td>-0.017(-0.017)</td><td>0.054(0.054)</td><td>0.008(0.013)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.005(0.008)</td><td>0.003(0.003)</td><td>0.041(0.041)</td><td>0.008(0.014)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.006(0.010)</td><td>0.011(0.011)</td><td>0.042(0.042)</td><td>0.009(0.014)</td></tr><tr><td rowspan="3">DLNN</td><td>9</td><td>10</td><td>Best</td><td>0.007(0.012)</td><td>-0.001(0.000)</td><td>0.066(0.066)</td><td>0.013(0.022)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.009(0.012)</td><td>-0.019(-0.019)</td><td>0.068(0.070)</td><td>0.009(0.016)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.007(0.010)</td><td>0.004(0.004)</td><td>0.054(0.054)</td><td>0.007(0.015)</td></tr><tr><td rowspan="3">CNN</td><td>9</td><td>3</td><td>Best</td><td>0.006(0.011)</td><td>0.006(0.006)</td><td>0.050(0.050)</td><td>0.008(0.015)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.006(0.010)</td><td>-0.001(-0.001)</td><td>0.045(0.045)</td><td>0.007(0.012)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.005(0.009)</td><td>-0.024(-0.023)</td><td>0.051(0.051)</td><td>0.009(0.015)</td></tr><tr><td rowspan="3">CNN</td><td>9</td><td>10</td><td>Best</td><td>0.006(0.010)</td><td>-0.013(-0.013)</td><td>0.057(0.058)</td><td>0.008(0.015)</td></tr><tr><td>—</td><td>—</td><td>Median</td><td>0.023(0.025)</td><td>-0.030(-0.030)</td><td>0.081(0.082)</td><td>0.019(0.026)</td></tr><tr><td>—</td><td>—</td><td>Meta-learner</td><td>0.005(0.009)</td><td>-0.022(-0.022)</td><td>0.056(0.057)</td><td>0.008(0.015)</td></tr></tbody></table>

Note. $^a$The bias is null by construction, as the used $M/L_H$ is equal to the median value of the sample.

times above the noise level. On the other hand, galaxies for which the $H_E$-images worsen the stellar mass derivation have on average 36 pixels above the noise. Such a small difference indicates that the stellar mass estimation is not affected by the galaxy size. This is further visible in Fig. 10, where we analyse the improvement in the stellar mass measurement as a function of the number of pixels that are three times above the noise level. The median difference is always quite small, and is almost constant with the number of pixels above the noise level, except for the largest galaxies, which are probably only partially included inside the cut-out image (i.e. $18 \times 18$ pixel). We will analyse these extended galaxies in a future work focused on local galaxies. In the same figure it is also shown that when four filters are used as input the stellar mass improves when adding the $H_E$-band images for more than 50 per cent of galaxies at each size bin, except for the largest galaxies, justifying the additional computational effort of including images. The improvement is below $\Delta log_{10}(M_*/M_{\odot}) = 0.08$ for most (68 per cent) of the galaxies.

Limiting the sample to those objects with a $H_E$-band image at S/N > 10 produces different results, depending on the number of input filters. Indeed, when only the four Euclid filters are considered as inputs, the fraction of outliers increases from $f_{out} \sim 0.107-0.128$ to $f_{out} \sim 0.217-0.230$ for samples with S/N > 10. On the contrary, the fraction of outliers remains stable when nine filters are used as input; while, the bias improves by 0.002–0.007, depending on the considered network architecture.

To investigate the cause of the different impacts of limiting the sample to S/N > 10, we explore how the size of the training sample impacts the resulting fraction of outliers (Fig. 11), using the DLNN as an example and varying the size of the training sample down to 1 per cent of the complete one. This test is performed by randomly removing galaxies from the training sample after augmentation, therefore the stellar mass distribution, with some limitation once the sample size is very small, should be similar to the one of the training sample (see in Fig. 3, top central panel).

First, the fractions of outliers in both the S/N > 10 and the S/N > 3 samples with nine filters as inputs are consistent within the errors with the fractions of samples of similar size, but with S/N > 3. Second, the outlier fraction increases with decreasing sample size. However, this decrease, when nine magnitudes are used as input, becomes relevant (e.g. $\Delta f_{out} > 0.02$) at smaller sample sizes (i.e. $<3 \times 10^3$ objects) than in the case of four input magnitudes (i.e. $<3 \times 10^4$ objects). Therefore, when only four filters are used as input, there is not enough information available, and it is preferable to have a larger, even if more noisy, sample. On the contrary, when more information is available, i.e. nine input filters, it is possible to focus on quality over quantity.

We now focus on the improvement of the stellar mass retrieval given by the inclusion of the u, g, r, i, and z ground-based filters, focusing again on the results obtained with the Meta-learner. The improvement is evident by looking at the fraction of outliers that
<figure><img src="image_9.png" /><figcaption>**Figure 7.** Top panel: Comparison between the recovered stellar mass and the input one for the DLNN methods. Points are coloured depending on the number of galaxies with the same combination of input and output stellar mass, following a linear scale from blue to yellow corresponding to 1 and 100 (40) galaxies with S/N > 3 (S/N > 10). The grey shaded area indicate the stellar mass range in which the input stellar mass distribution is not flat but underrepresented in the training sample, i.e. $M_{*} < 10^{8.5} M_{\odot}$ for S/N > 3 and $M_{*} < 10^{8} M_{\odot}$ for S/N > 10. The red dashed line is the identity and the red dotted lines indicate output stellar mass equal to twice or half the input one, which corresponds to the definition of an outlier. On the top-left side of each panel we report the fraction of outliers, bias, and NMAD of the sample with $M_{*} > 10^{8.5} M_{\odot}$ or $M_{*} > 10^{8} M_{\odot}$, depending on the S/N cut. In parentheses, we reported the same values for the full sample. On the bottom-right side, we report the number of objects in the test sample. Bottom panel: Distribution of the difference between the output and input stellar mass, for the full sample (blue dashed line) and for galaxies with $M_{*} > 10^{8.5} M_{\odot}$ or $M_{*} > 10^{8} M_{\odot}$ (black solid line), depending on the S/N cut. The red vertical dashed line shows a null difference and the red dotted lines indicate output stellar mass equal to twice or half the input one. From left-hand to right-hand panel: Stellar mass recovered using DLNN with four *Euclid* filters considering objects with S/N > 3 and with S/N > 10, and stellar mass recovered using DLNN with four *Euclid* filters and five ancillary bands considering objects with S/N > 3 and with S/N > 10. The 10 runs of each network are combined using a Meta-learner.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>**Figure 8.** Same as Fig. 7, but for the runs using the CNN.</figcaption></figure>

varies between $f_{\text{out}} = 0.107–0.230$ when only *Euclid* filters are used as input; while, it never exceeds $f_{\text{out}} = 0.010$ when all nine filters are used as input. The presence of long-wavelength filters, such as the $H_{\text{E}}$ band at least up to $z \sim 1.5$, is indeed fundamental for obtaining a reliable stellar mass, as evident by the relative good stellar mass estimation when only four *Euclid* filters are used as input. However, the inclusion of shorter wavelength filters probably helps anchor the overall SED template to estimate very accurately the stellar mass. As for the redshift, the importance of the optical filters is highlighted also by the sensitivity analysis reported in Appendix B (available online).

### 4.3.1 Variation with redshift and $I_{\text{E}}$ magnitude

In Figs 12 and 13, we show the variation of the stellar mass measures with redshift and $I_{\text{E}}$ magnitude, respectively. There is a clear trend with redshift, as the fraction of outliers is below 0.28 and the NMAD is below 0.06 at $z < 1.5$. This trend with redshift is at least partially driven by the small number of galaxies available at $z > 3$ for the training, i.e. galaxies at lower redshift are more numerous and, therefore, they dominate the training process of the network. A similar effect is seen when looking at the variation with the $I_{\text{E}}$ magnitude, as the fraction of outliers and the NMAD value increases at the brightest magnitudes, i.e. $I_{\text{E}} < 18$, that are
<figure><img src="image_11.png" /><figcaption>**Figure 9.** Fraction of outliers which are quiescent (i.e. $log_{10}[SFR/(M_{\odot} yr^{-1})] < -10.5$, black squares) and star-forming galaxies (i.e. $log_{10}[SFR/(M_{\odot} yr^{-1})] > -10.5$, yellow circles) for different networks, as derived for the redshift (top panel) and the stellar mass (bottom panel). Arrows in the top panel correspond to $f_{out} = 0$.</figcaption></figure>

poorly represented in the sample. In the future, a larger sample with a flat multidimensional (i.e. z, stellar mass, SFR, and magnitude) distribution may help improve the measurement of these objects.

The deterioration of the stellar mass measurement with redshift may also be explained with the $H_E$ band, which is the filter at the longest wavelength among the analysed ones, tracing shorter wavelengths at larger redshift and, therefore, are less sensitive to the light emitted by the old stellar populations which make up most of the stellar mass. The stellar mass measurement at magnitude $I_E > 18$ is instead generally constant, except for the networks with four input filters and at $S/N > 10$, for which it becomes worse between $I_E = 22$ and 24. The decrease visible at fainter magnitudes is probably spurious and driven by the limited number of galaxy in the sample ($<100$ at $I_E > 25$) caused by the S/N cut.

### 4.3.2 Comparison with the LePhare SED fitting

Finally, to put these results into context, we derived the stellar mass directly from $H_E$-band magnitudes assuming a single mass-to-light ratio, which is a simplistic but direct method, and using a SED fitting procedure. For the first case, we considered an ideal situation

<figure><img src="image_12.png" /><figcaption>**Figure 10.** In the main panel, we have shown the difference between the absolute stellar mass errors in the CNN and DLNN with respect to the number of pixels that are three times above the noise level. Solid symbols show the median errors, while the error bars show the central 68 per cent (±1σ) of the distribution. The difference is shown for the networks when using four (black circles) and nine input filters (red squares) and for the sample with images having S/N > 3. In the top panel, we report the distribution of the objects as a function of the number of pixels that are three times above the noise level.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>**Figure 11.** Difference in the outlier fraction of the stellar mass with decreasing size of the training sample. The difference is derived for the DLNN with four input magnitudes and S/N > 3 (black circles) and for the DLNN with nine input magnitudes and S/N > 3 (red squares), considering as zero point the fraction of outlier of the complete sample. For comparison, we report also the difference in the outlier fraction of the sample with S/N > 10 with respect to the sample with S/N > 3, considering the DLNN with four (purple diamond) and nine input magnitudes (yellow pentagon). Fractions are derived averaging the results of the 10 runs and the shaded areas show the standard variation within the 10 runs.</figcaption></figure>

where we calculate the $H_E$-band luminosity from the true redshift and we assumed a mass-to-light ratio equal to the median value (i.e. $M/L_H \sim 0.6$), obtained by comparing the $H_E$-band luminosity directly with the true stellar mass. For the full sample with S/N > 3 and $log_{10}(M_*/M_{\odot}) > 8$, we obtained a fraction of outliers of 0.298, $\langle \Delta log_{10}(M_* M_{\odot}^{-1}) \rangle = 0$, by construction, and NMAD = 0.3 (Table 5), which is overall a worse result than that obtained with both the DLNN and CNN methods for the same sample.

With the SED fitting (more details in Appendix C, available online), when considering only the four *Euclid* filters as input, results
<figure><img src="image_14.png" /><figcaption>**Figure 12.** Redshift variation of the bias (top panel), NMAD (centre), and outlier fraction (bottom panel) of the recovered stellar mass. Different symbols indicate different algorithm architectures and different inputs (see legend). The grey area (black vertical dashed line) shows the redshift bins with <100 objects for the training samples which have S/N > 10 (S/N > 3).</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>**Figure 13.** Same as Fig. 12, but focusing on the variation with $I_E$ magnitude.</figcaption></figure>

are even worse than with a constant $M/L_H$ ratio, which is, however, derived considering the true median $M/L_H$. These results, however, improve when nine filters are used as input, but these still perform less well than the best CNN or DLNN results. Indeed, with the SED fitting we obtain $f_{out} = 0.128-0.048$ compared with $f_{out} \le 0.02$, considering all combinations methods, or $f_{out} \le 0.007$ focusing on results derived with the Meta-learner. In the SED fitting, redshift is kept free and the improvement when adding the u, g, r, i, and z filters is also driven by the improvement in the redshift estimation (see Section 4.2).

Finally, in Fig. 12, we also report the variation of bias, NMAD, and outlier fraction with redshift for one of the best SED estimates,

i.e. nine filters used as input and S/N > 3. Surprisingly, machine learning results are more precise and accurate than SED fitting ones at all redshifts, even in the situation when the training sample is limited in number. This may also be linked to a difficult redshift estimation (see Appendix C, available online).

## 4.4 SFR derivation

In this section, we report the results for the SFR retrieval with machine learning, which are summarized in Table 6 for all networks, and are plotted in Figs 14 and 15, for the DLNN and CNN runs combined with the Meta-learner. Neither the redshift nor the stellar mass is among the inputs when deriving the SFR. As for the stellar mass, outliers are arbitrary defined as galaxies with SFR which are incorrect by, at least, a factor of two (~0.3 dex). The bias is defined as

$$ \langle \Delta \text{SFR} \rangle = \text{median}[\log_{10}(\text{SFR}_{\text{out}}/\text{SFR}_{\text{in}})] \quad (5) $$

and the NMAD for the SFR corresponds to

$$ \text{NMAD} = 1.48 \text{median}[|\log_{10}(\text{SFR}_{\text{out}}/\text{SFR}_{\text{in}})|] \quad (6) $$

We find that the SFR is much more challenging to estimate than the stellar mass, as is evident by looking at the fraction of outliers, which ranges from 0.310 to 0.715, and the NMAD, which is always above 0.28, i.e. ~32 per cent of the sample have a SFR wrong by at least 0.28 dex. The results obtained with the three methods to combine the 10 runs of each network are generally similar, with the Meta-learner and the best of the 10 runs giving slightly better results than the median of 10 runs. This is probably due to the large variation between the different runs, whose output SFRs have a mean standard deviation between 0.16 and 0.43. In the rest of this section, we focus on results obtained with the Meta-learner, for consistency with the redshift and stellar mass measures.

The DLNN gives in general a more precise value of the SFR than the CNN. This improvement is mainly driven by a reduction in the outlier fraction, down to $\Delta f_{out} = 0.11$, but also by a small decrease of the NMAD (i.e. $\Delta \text{NMAD} \le 0.15$). One exception is the case with S/N > 3 and using nine input filters, for which the CNN results slightly improves (i.e. $\Delta f_{out} = 0.015$) over the DLNN ones. Not surprisingly, the use of only $H_E$-band images alone is not sufficient to estimate the SFR, as it results, e.g. in an outlier fraction of $f_{out} = 0.887$ when averaging the output of the 10 runs of the sample limited to images with S/N > 3 and SFR > 1 M$_\odot$ yr$^{-1}$. In the future, the inclusion of images at wavelength shorter than the $H_E$ band, which are more sensitive to the SFR and which will likely improve the predictions of this physical property, can be tested.

On one hand, for the SFR estimation it is not useful to limit the sample to galaxies with a high S/N, as the fraction of outliers increases by 0.07–0.16 when comparing the results of the samples with S/N > 3 and S/N > 10, similarly to what has been seen for the stellar mass (Section 4.3). On the other hand, it is evident that the inclusion of filters at short wavelengths, like the u, g, r, i, and z ground-based filters, improves the SFR estimates, lowering the outlier fraction by $\Delta f_{out} = 0.15-0.25$. The importance of the optical filters is also evident by performing a sensitivity analysis of the input features (Appendix B, available online). This is not surprising considering that UV wavelengths are better tracers of the SFR than near-IR ones (Pforr et al. 2012, 2013). However, even with nine input filters, the SFR measures remain more challenging than measuring the stellar mass or the redshift with the set-up we use.
<table><caption>**Table 6.** Same as Table 4, but for the SFR. The results correspond to all galaxies with SFR > 1 M⊙ yr⁻¹, while values in parentheses correspond to the full sample. The first four lines correspond to results derived with SED fitting.</caption><thead><tr><th>Algorithm<br>(1)</th><th>N<sub>in</sub><br>(2)</th><th>S/N<br>(3)</th><th>Combination<br>(4)</th><th>f<sub>out</sub><br>(5)</th><th>⟨ΔSFR⟩<br>(6)</th><th>NMAD<br>(7)</th><th>MSE<br>(8)</th></tr></thead><tbody><tr><td>SED</td><td>4</td><td>3</td><td>—</td><td>0.752(0.814)</td><td>0.151(0.500)</td><td>0.997(1.412)</td><td>6.331(7.758)</td></tr><tr><td>SED</td><td>4</td><td>10</td><td>—</td><td>0.784(0.856)</td><td>0.286(0.807)</td><td>1.142(1.890)</td><td>5.036(10.887)</td></tr><tr><td>SED</td><td>9</td><td>3</td><td>—</td><td>0.560(0.622)</td><td>-0.115(-0.065)</td><td>0.521(0.637)</td><td>1.577(5.680)</td></tr><tr><td>SED</td><td>9</td><td>10</td><td>—</td><td>0.511(0.629)</td><td>-0.053(-0.028)</td><td>0.459(0.669)</td><td>1.313(9.075)</td></tr><tr><td>DLNN</td><td>4</td><td>3</td><td>Best</td><td>0.515(0.587)</td><td>-0.155(-0.136)</td><td>0.467(0.592)</td><td>0.810(0.956)</td></tr><tr><td>DLNN</td><td>4</td><td>10</td><td>Median</td><td>0.530(0.598)</td><td>-0.157(-0.125)</td><td>0.484(0.605)</td><td>0.791(0.920)</td></tr><tr><td>DLNN</td><td>4</td><td>10</td><td>Meta-learner</td><td>0.512(0.581)</td><td>-0.079(-0.056)</td><td>0.456(0.563)</td><td>0.697(0.904)</td></tr><tr><td>CNN</td><td>4</td><td>3</td><td>Best</td><td>0.677(0.737)</td><td>-0.183(-0.143)</td><td>0.715(0.931)</td><td>1.207(1.463)</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Median</td><td>0.708(0.756)</td><td>-0.300(-0.233)</td><td>0.840(0.989)</td><td>1.462(1.559)</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Meta-learner</td><td>0.607(0.699)</td><td>-0.250(-0.248)</td><td>0.626(0.859)</td><td>1.263(1.479)</td></tr><tr><td>CNN</td><td>4</td><td>3</td><td>Best</td><td>0.553(0.619)</td><td>-0.162(-0.157)</td><td>0.516(0.634)</td><td>0.956(1.067)</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Median</td><td>0.559(0.625)</td><td>-0.185(-0.141)</td><td>0.528(0.656)</td><td>0.841(0.986)</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Meta-learner</td><td>0.582(0.628)</td><td>-0.333(-0.278)</td><td>0.562(0.657)</td><td>0.803(0.976)</td></tr><tr><td>CNN</td><td>4</td><td>3</td><td>Best</td><td>0.682(0.749)</td><td>-0.355(0.255)</td><td>0.775(0.997)</td><td>1.137(1.503)</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Median</td><td>0.715(0.761)</td><td>-0.459(-0.334)</td><td>0.891(1.065)</td><td>1.273(1.473)</td></tr><tr><td>CNN</td><td>4</td><td>10</td><td>Meta-learner</td><td>0.692(0.746)</td><td>-0.381(-0.301)</td><td>0.777(0.972)</td><td>1.180(1.533)</td></tr><tr><td>DLNN</td><td>9</td><td>3</td><td>Best</td><td>0.310(0.411)</td><td>-0.023(-0.021)</td><td>0.280(0.350)</td><td>0.235(0.453)</td></tr><tr><td>DLNN</td><td>9</td><td>10</td><td>Median</td><td>0.319(0.419)</td><td>-0.033(-0.0046)</td><td>0.292(0.363)</td><td>0.246(0.461)</td></tr><tr><td>DLNN</td><td>9</td><td>10</td><td>Meta-learner</td><td>0.349(0.432)</td><td>-0.145(-0.144)</td><td>0.314(0.375)</td><td>0.249(0.478)</td></tr><tr><td>DLNN</td><td>9</td><td>10</td><td>Best</td><td>0.419(0.545)</td><td>0.028(0.016)</td><td>0.374(0.495)</td><td>0.369(0.730)</td></tr><tr><td>DLNN</td><td>9</td><td>10</td><td>Median</td><td>0.453(0.563)</td><td>-0.039(-0.072)</td><td>0.393(0.529)</td><td>0.367(0.752)</td></tr><tr><td>DLNN</td><td>9</td><td>10</td><td>Meta-learner</td><td>0.415(0.526)</td><td>-0.073(0.087)</td><td>0.365(0.475)</td><td>0.369(0.780)</td></tr><tr><td>CNN</td><td>9</td><td>3</td><td>Best</td><td>0.325(0.440)</td><td>-0.046(0.016)</td><td>0.293(0.383)</td><td>0.265(0.546)</td></tr><tr><td>CNN</td><td>9</td><td>10</td><td>Median</td><td>0.342(0.446)</td><td>-0.056(-0.065)</td><td>0.304(0.390)</td><td>0.249(0.493)</td></tr><tr><td>CNN</td><td>9</td><td>10</td><td>Meta-learner</td><td>0.334(0.434)</td><td>0.040(0.028)</td><td>0.300(0.380)</td><td>0.245(0.524)</td></tr><tr><td>CNN</td><td>9</td><td>10</td><td>Best</td><td>0.443(0.547)</td><td>-0.111(-0.112)</td><td>0.386(0.505)</td><td>0.395(0.822)</td></tr><tr><td>CNN</td><td>9</td><td>10</td><td>Median</td><td>0.472(0.588)</td><td>-0.047(-0.067)</td><td>0.417(0.562)</td><td>0.378(0.795)</td></tr><tr><td>CNN</td><td>9</td><td>10</td><td>Meta-learner</td><td>0.523(0.593)</td><td>-0.262(-0.259)</td><td>0.471(0.572)</td><td>0.412(0.888)</td></tr></tbody></table>

<figure><img src="image_16.png" /><figcaption>**Figure 14.** Top panel: Comparison between the recovered SFR and the input one for the DLNN methods. Points are coloured depending on the number of galaxies with the same combination of input and output SFR, following a linear scale from blue to yellow corresponding to 1 and 25 (10) galaxies with S/N > 3 (S/N > 10). The grey shaded area indicates SFR < 1 M⊙ yr⁻¹. The red dashed line is the identity and the red dotted lines indicate output SFR equal to twice or half the input SFR. On the top-left side of each panel, we report the fraction of outliers, bias, and NMAD of the sample with SFR > 1 M⊙ yr⁻¹ and, in parentheses, the values for the full sample. On the bottom-right side, we report the number of objects in the test sample. Bottom panel: Distribution of the difference between the output and input SFR, for the full sample (blue dashed line) and for galaxies with SFR > 1 M⊙ yr⁻¹ (black solid line). The red vertical dashed line shows a null difference and the red dotted lines indicate output SFR equal to twice or half the input SFR. From left-hand to right-hand panel: SFR recovered using DLNN with four *Euclid* filters considering objects with S/N > 3, SFR recovered using DLNN with four *Euclid* filters and five ancillary bands considering objects with S/N > 3, SFR recovered using DLNN with four *Euclid* filters considering objects with S/N > 10, and SFR recovered using DLNN with four *Euclid* filters and five ancillary bands considering objects with S/N > 10. The 10 runs of each network are combined using a Meta-learner.</figcaption></figure>
<figure><img src="image_17.png" /><figcaption>**Figure 15.** Same as Fig. 14, but for the runs using the CNN.</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>**Figure 16.** Redshift variation of the bias (top panel), NMAD (centre), and outlier fraction (bottom panel) of the recovered SFR. Solid and dashed lines indicate the statistics of CNN and DLNN, respectively, with different colours depending on the set of inputs (see legend). The grey area (black vertical dashed line) shows the redshift bins with <100 objects in the training samples which have S/N > 10 (S/N > 3).</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>**Figure 17.** Same as Fig. 16, but focusing on the variation with the $I_E$ magnitude.</figcaption></figure>

### 4.4.1 Variation with redshift and $I_E$ magnitude

In Figs 16 and 17, we show the variation with redshift and $I_E$ magnitude of the fraction of outliers, the bias, and the NMAD of the recovered SFR. As for the stellar mass, there is a rapid deterioration of the SFR estimation as soon as the number of objects available for training is relative small, i.e. $z > 4$ and $I_E < 18$. In addition, for some of the most accurate networks, i.e. CNN and DLNN with nine input filters and S/N > 3 (purple solid and dashed lines in Fig. 16), the fraction of outliers decreases at increasing redshift, ranging from $f_{\text{out}} = 0.52-0.55$ at $z = 0.125$ to $f_{\text{out}} \sim 0.13-0.33$ at $z = 3.6$. For these networks, the outlier fraction also decreases towards fainter $I_E$ magnitudes. We can speculate on different effects driving these dependencies. First, at increasing redshifts our filters trace shorter rest-frame wavelengths, which are more sensitive to SFR. Second, the average SFR of star-forming galaxies increases with redshift (i.e.

Brinchmann et al. 2004; Noeske et al. 2007; Bisigello et al. 2018), making the SFR easier to estimate for the networks. In the future the SFR estimation at low redshift can be further analysed with a sample more focused on low-$z$ galaxies than the one analysed in this work. The dependence of the outlier fraction with $I_E$ magnitude can be linked with the dependence with redshift, as high-redshift galaxies are expected to be fainter than lower redshift ones.

### 4.4.2 Comparison with the LePhare SED fitting

Finally, as done for redshift and stellar mass, we compare the results obtained with the CNN and DLNN methods with the results derived with a SED fitting procedure, for which we give more details in Appendix C (available online). Our machine-learning algorithms perform better than the SED fitting; however, the improvement is not as pronounced as it is for the redshift and the stellar mass, with a difference $\Delta f_{\text{out}} < 0.250$. It is, however, worth noticing that the fraction of outliers derived with the DLNN with S/N > 3 and four filters as input ($f_{\text{out}} = 0.512$) is lower than the fraction of outliers
derived with the SED fitting method for the same sample, but when using nine input filters ($f_{out} = 0.560$).

Finally, in Fig. 16, we investigate the variation of bias, NMADE, and outlier fraction with redshift, in the case of SED fitting applied to galaxies with S/N > 3 and nine input filters. As for the stellar mass, the SFR estimation derived with SED fitting is always worse than the one derived with DLNN or CNN at any given redshift. This, however, may be due to a wrong redshift estimation (see Appendix C, available online).

# 5 SUMMARY

This paper is a general exploration of using machine learning to determine and measure the most basic properties of galaxies, particularly those at higher redshifts. This will be a critical process for the next generation of galaxy surveys as *Euclid*, *Rubin*/*LSST*, and the *Roman Space Telescope*. We investigate this problem in several ways, including different machine-learning methods and by using as input different forms of data. We use information from the *Euclid Space Telescope* as a baseline for understanding how these estimates can be done on other telescopes with similar data. We thus investigate how well machine learning does in retrieving three main features of galaxies – redshifts, stellar masses, and SFRs. This work presents only point estimates for all these quantities and the inclusion of probability distribution functions or statistical errors will be investigated on a future work.

Our main results are the following:

(i) Our machine-learning algorithms perform better than traditional methods. In particular, to estimate the stellar mass we consider a simple but direct method consisting on a constant $M/L_{H}$, which is derived from the true median mass-to-light ratio of the sample. As a second method we test a SED fitting procedure, using the same code and templates considered to derive the mock magnitudes, for redshift, stellar mass, and SFR. The redshift and stellar mass machine-learning runs outperformed the other methods; while, the improvement in the SFR estimation is more limited. It is, however, necessary to keep in mind that machine-learning networks, on the contrary of SED fitting procedure, are limited to the parameter space of the sample used for training.

(ii) We verify that it is preferable to combine the results of different runs using a Meta-learner, i.e. an additional DLNN which uses the results of the other networks as inputs. The Meta-learner outperforms the median of the results and the best among the different runs for the redshift predictions, with an improvement in the outlier fraction even up to $\Delta f_{out} = 0.029$.

(iii) The inclusion of $H_{E}$-band images, in addition to the integrated magnitudes, is particularly useful for the stellar mass estimation, due to the fact that the $H_{E}$-band filter traces the light from relatively old stellar populations, at least at low redshift, and it is therefore a good tracer of stellar mass through structure. The inclusion of images in this filter has a small impact on the redshift estimation; while, it mainly introduces noise in the SFR derivation. In the future, the impact of images on the SFR and redshift retrieval may be further tested by including images at shorter wavelengths, which are more sensitive to on-going star formation, and SED features useful for redshift estimation, such as the 4000 Å, or images with a smaller angular resolution than the ones tested.

(iv) Limiting the input sample only to galaxies with S/N > 10 in the $H_{E}$ band improves the results only in a few cases. This selection improves the quality of the input data; however, at the same time, it reduces the number of galaxies in the training sample.

(v) We compare results obtained using only the four *Euclid* filters and complementing them with additional five LSST-like filters. The improvement is evident in all cases, with the fraction of outliers decreasing by $\Delta f_{out} = 0.15-0.25$ for the SFR estimation; while, it decreases to below $f_{out} \le 0.020$ and 0.005 for the stellar mass and the redshift, respectively. These results indicate the necessity of an eventual coordinated effort from Rubin/LSST and *Euclid* to improve the measurement of physical properties such as redshift, stellar mass, and SFR.

# ACKNOWLEDGEMENTS

LB and CC acknowledge the support of the STFC Cosmic Vision funding. LB acknowledges the financial support of Agenzia Spaziale Italiana (ASI) under the research contract 2018-31-HH.0. SvM acknowledges funding from the European Research Council through the award of the Consolidator Grant ID 681627-BUILDUP. HH is supported by a Heisenberg grant of the Deutsche Forschungs-gemeinschaft (Hi 1495/5-1) as well as an ERC Consolidator Grant (No. 770935). MB acknowledges financial contributions from the agreement ASI/INAF 2018-23-HH.0, Euclid ESA mission - Phase D. The Euclid Consortium acknowledges the European Space Agency and a number of agencies and institutes that have supported the development of *Euclid*, in particular the Academy of Finland, the Agenzia Spaziale Italiana, the Belgian Science Policy, the Canadian Euclid Consortium, the French Centre National d'Etudes Spatiales, the Deutsches Zentrum für Luft- und Raumfahrt, the Danish Space Research Institute, the Fundação para a Ciência e a Tecnologia, the Ministerio de Ciencia e Innovación, the National Aeronautics and Space Administration, the National Astronomical Observatory of Japan, the Netherlandse Onderzoekschool Voor Astronomie, the Norwegian Space Agency, the Romanian Space Agency, the State Secretariat for Education, Research and Innovation (SERI) at the Swiss Space Office (SSO), and the United Kingdom Space Agency. A complete and detailed list is available on the Euclid web site (http://www.euclid-ec.org). In this work, we made use of the NUMPY (Harris et al. 2020) package for Python.

# DATA AVAILABILITY

Data included in this paper will be available on request.

# REFERENCES

Akeson R. et al., 2019, preprint (arXiv:1902.05569)

Amaro V. et al., 2019, MNRAS, 482, 3116

Arnouts S., Cristiani S., Moscardini L., Matarrese S., Lucchin F., Fontana A., Giallongo E., 1999, MNRAS, 310, 540

Bisigello L. et al., 2016, ApJS, 227, 19

Bisigello L. et al., 2017, ApJS, 231, 3

Bisigello L. et al., 2020, MNRAS, 494, 2337

Bisigello L., Caputi K. I., Grogin N., Koekemoer A., 2018, A&A, 609, A82

Brinchmann J., Charlot S., White S. D. M., Tremonti C., Kauffmann G., Heckman T., Brinkmann J., 2004, MNRAS, 351, 1151

Bruzual G., Charlot S., 2003, MNRAS, 344, 1000

Calzetti D., Armus L., Bohlin R. C., Kinney A. L., Koornneef J., Storch-Bergmann T., 2000, ApJ, 533, 682

Cavuoti S., Amaro V., Brescia M., Vellucci C., Tortora C., Longo G., 2017, MNRAS, 465, 1959

Chabrier G., 2003, PASP, 115, 763

Chen X.-w., Jeong J. C., 2007, Proc. Sixth Int. Conf. Mach. Learn. Appl. (ICMLA 2007), Enhanced Recursive Feature Elimination. IEEE, Cincinnati, OH, USA, p. 429
Cheng T.-Y. et al., 2020, MNRAS, 493, 4209
Ciesla L., Elbaz D., Fensch J., 2017, A&A, 608, A41

Collister A. A., Lahav O., 2004, PASP, 116, 345

Conselice C. J., 2003, ApJS, 147, 1

Conselice C. J., Bluck A. F. L., Mortlock A., Palamara D., Benson A. J., 2014, MNRAS, 444, 1125

D'Isanto A., Polsterer K. L., 2018, A&A, 609, A111

De Vicente J., Sánchez E., Sevilla-Noarbe I., 2016, MNRAS, 459, 3078

Delli Veneri M., Cavuoti S., Brescia M., Longo G., Riccio G., 2019, MNRAS, 486, 1377

Dieleman S., Willett K. W., Dambre J., 2015, MNRAS, 450, 1441

Dobbels W., Krier S., Pirson S., Viaene S., De Geyter G., Salim S., Baes M., 2019, A&A, 624, A102

Euclid Collaboration: Desprez G. et al., 2020, A&A, 644, A31

Euclid Collaboration: Humphrey A. et al., 2022a, A&A, in press

Euclid Collaboration: Scaramella R. et al., 2022b, A&A, 662, A112

Euclid Collaboration: Schirmer M. et al., 2022c, A&A, 662, A92

Firth A. E., Lahav O., Somerville R. S., 2003, MNRAS, 339, 1195

Gunn J. E. et al., 1998, AJ, 116, 3040

Guyon I., Elisseeff A., 2003, J. Mach. Learn. Res., 3, 1157

Harris C. R. et al., 2020, Nature, 585, 357

Hoyle B., 2016, Astron. Comput., 16, 34

Huertas-Company M. et al., 2015, ApJS, 221, 8

Ilbert O. et al., 2006, A&A, 457, 841

Ilbert O. et al., 2010, ApJ, 709, 644

Ivezic Z. et al., 2008, Serb. Astron. J., 176, 1

Ke G., Meng Q., Finley T., Wang T., Chen W., Ma W., Ye Q., Liu T.-Y., 2017, Adv. Neural Inf. Process. Syst., 30, 3149

Kennicutt Robert C. J., 1998, ARA&A, 36, 189

Kingma D. P., Ba J., 2014, preprint (arXiv:1412.6980)

Kursa M. B., Jankowski A., Rudnicki W. R., 2010, Fundam. Inform., 101, 271

Laigle C. et al., 2016, ApJS, 224, 24

Laureijs R. et al., 2011, preprint (arXiv:1110.3193)

Lipovetsky S., Conklin M., 2001, Appl. Stochastic Models Bus. Ind., 17, 319

Lundberg S. M., Lee S.-I., 2017, Adv. Neural Inf. Process. Syst., 30

Madau P., Dickinson M., 2014, ARA&A, 52, 415

Mortlock A. et al., 2013, MNRAS, 433, 1185

Mowla L. A. et al., 2019, ApJ, 880, 57

Muceh S. et al., 2021, MNRAS, 502, 2770

Nair V., Hinton G. E., 2010, Proc. 27th Int. Conf. Mach. Learn. ICML'10, Rec-
tified Linear Units Improve Restricted Boltzmann Machines. Omnipress,
Madison, WI, USA, p. 807

Noeske K. G. et al., 2007, ApJ, 660, L43

Oke J. B., Gunn J. E., 1983, ApJ, 266, 713

Pasquet J., Bertin E., Treyer M., Arnouts S., Fouchez D., 2019, A&A, 621, A26

Pedregosa F. et al., 2011, J. Mach. Learn. Res., 12, 2825

Pforr J., Maraston C., Tonini C., 2012, MNRAS, 422, 3285

Pforr J., Maraston C., Tonini C., 2013, MNRAS, 435, 1389

Razim O., Cavuoti S., Brescia M., Riccio G., Salvato M., Longo G., 2021, MNRAS, 507, 5034

Sagi O., Rokach L., 2021, Inform. Sci., 572, 522

Schreiber C., Elbaz D., Pannalet M., Ciesla L., Wang T., Koekemoer A.,
Rafelski M., Daddi E., 2016, A&A, 589, A35

Scoville N. et al., 2007, ApJS, 172, 1

Simonyan K., Zisserman A., 2015, Very Deep Convolutional Networks for Large-scale Image Recognition, 3rd International Conference on Learning Representations (ICLR 2015). p. 1

Speagle J. S., Steinhardt C. L., Capak P. L., Silverman J. D., 2014, ApJS, 214, 15

Stensbo-Smidt K., Gieseke F., Igel C., Zirm A., Steenstrup Pedersen K., 2016, MNRAS, 464, 2577

Štrumbelj E., Kononenko I., 2013, Knowl. Inform. Syst., 41, 647

Surana S., Wadadekar Y., Bait O., Bhosale H., 2020, MNRAS, 493, 4808

Tagliaferri R., Longo G., Andreon S., Capozziello S., Donalek C., Giordano G., 2003, Neural Nets. Lecture Notes in Computer Science. Vol. 2859. Springer, Berlin, p. 226

Tanaka M. et al., 2018, PASJ, 70, S9

Tohill C., Ferreira L., Conselice C. J., Bamford S. P., Ferrari F., 2021, ApJ, 916, 4

Wolpert D. H., 1992, Neural Netw., 5, 241

SUPPORTING INFORMATION

Supplementary data are available at MNRAS online.

Euclid XXIII appendix

Please note: Oxford University Press is not responsible for the content
or functionality of any supporting materials supplied by the authors.
Any queries (other than missing material) should be directed to the
corresponding author for the article.

<footnote n="1">¹Dipartimento di Fisica e Astronomia 'G.Galilei', Università di Padova, Via Marzolo 8, I-35131 Padova, Italy</footnote>

<footnote n="2">²INAF-Osservatorio di Astrofisica e Scienza dello Spazio di Bologna, Via Piero Gobetti 93/3, I-40129 Bologna, Italy</footnote>

<footnote n="3">³School of Physics and Astronomy, University of Nottingham, University Park, Nottingham NG7 2RD, UK</footnote>

<footnote n="4">⁴Jodrell Bank Centre for Astrophysics, Department of Physics and Astronomy, University of Manchester, Oxford Road, Manchester M13 9PL, UK</footnote>

<footnote n="5">⁵Sterrenkundig Observatorium, Universiteit Gent, Krijgslaan 281 S9, B-9000 Gent, Belgium</footnote>

<footnote n="6">⁶INFN Section of Naples, Via Cinthia 6, I-80126 Napoli, Italy</footnote>

<footnote n="7">⁷INAF-Osservatorio Astronomico di Capodimonte, Via Moiariello 16, I-80131 Napoli, Italy</footnote>

<footnote n="8">⁸Department of Physics 'E. Pancini', University Federico II, Via Cinthia 6, I-80126 Napoli, Italy</footnote>

<footnote n="9">⁹Instituto de Astrofísica e Ciências do Espaço, Universidade do Porto, CAUP, Rua das Estrelas, P-4150-762 Porto, Portugal</footnote>

<footnote n="10">¹⁰INAF-Osservatorio Astrofisico di Arcetri, Largo E. Fermi 5, I-50125 Firenze, Italy</footnote>

<footnote n="11">¹¹Institute of Cosmology and Gravitation, University of Portsmouth, Portsmouth PO1 3FX, UK</footnote>

<footnote n="12">¹²Istituto Nazionale di Astrofisica (INAF) - Osservatorio di Astrofisica e Scienza dello Spazio (OAS), Via Gobetti 93/3, I-40127 Bologna, Italy</footnote>

<footnote n="13">¹³Kapteyn Astronomical Institute, University of Groningen, PO Box 800, NL-9700 AV Groningen, The Netherlands</footnote>

<footnote n="14">¹⁴Université Paris-Saclay, CNRS, Institut d'Astrophysique Spatiale, F-91405 Orsay, France</footnote>

<footnote n="15">¹⁵Dipartimento di Fisica e Astronomia, Università di Bologna, Via Gobetti 93/2, I-40129 Bologna, Italy</footnote>

<footnote n="16">¹⁶INFN-Sezione di Bologna, Viale Berti Pichat 6/2, I-40127 Bologna, Italy</footnote>

<footnote n="17">¹⁷Universitäts-Sternwarte München, Fakultät für Physik, Ludwig-Maximilians-Universität München, Scheinerstrasse 1, D-81679 München, Germany</footnote>

<footnote n="18">¹⁸Max Planck Institute for Extraterrestrial Physics, Giessenbachstr. 1, D-85748 Garching, Germany</footnote>

<footnote n="19">¹⁹INAF-Osservatorio Astrofisico di Torino, Via Osservatorio 20, I-10025 Pino Torinese (TO), Italy</footnote>

<footnote n="20">²⁰Dipartimento di Fisica, Università degli Studi di Genova, INFN-Sezione di Genova, via Dodecaneso 33, I-16146 Genova, Italy</footnote>

<footnote n="21">²¹INFN-Sezione di Roma Tre, Via della Vasca Navale 84, I-00146 Roma, Italy</footnote>

<footnote n="22">²²Dipartimento di Fisica, Università degli Studi di Torino, Via P. Giuria 1, I-10125 Torino, Italy</footnote>

<footnote n="23">²³INFN-Sezione di Torino, Via P. Giuria 1, I-10125 Torino, Italy</footnote>

<footnote n="24">²⁴INAF-IASF Milano, Via Alfonso Corti 12, I-20133 Milano, Italy</footnote>

<footnote n="25">²⁵Institut de Física d'Altes Energies (IFAE), The Barcelona Institute of Science and Technology, Campus UAB, 08193 Bellaterra (Barcelona), Spain</footnote>

<footnote n="26">²⁶Port d'Informació Científica, Campus UAB, C. Albareda s/n, E-08193 Bellaterra (Barcelona), Spain</footnote>

<footnote n="27">²⁷Institut d'Estudis Espacials de Catalunya (IEEC), Carrer Gran Capità 2-4, E-08034 Barcelona, Spain</footnote>
<footnote n="28">²⁸Institute of Space Sciences (ICE, CSIC), Campus UAB, Carrer de Can Magrans, s/n, E-08193 Barcelona, Spain</footnote>

<footnote n="29">²⁹INAF-Osservatorio Astronomico di Roma, Via Frascati 33, I-00078 Mon-
teporzio Catone, Italy</footnote>

<footnote n="30">³⁰Dipartimento di Fisica e Astronomia 'Augusto Righi' - Alma Mater
Studiorum Università di Bologna, Viale Berti Pichat 6/2, I-40127 Bologna,
Italy</footnote>

<footnote n="31">³¹Institute for Astronomy, University of Edinburgh, Royal Observatory, Blackford Hill, Edinburgh EH9 3HJ, UK</footnote>

<footnote n="32">³²ESAC/ESA, Camino Bajo del Castillo, s/n., Urb. Villafranca del Castillo, E-28692 Villanueva de la Cañada, Madrid, Spain</footnote>

<footnote n="33">³³European Space Agency/ESRIN, Largo Galileo Galilei 1, I-00044 Frascati, Roma, Italy</footnote>

<footnote n="34">³⁴Université de Lyon, Université Claude Bernard Lyon 1, CNRS/IN2P3, IP2I
Lyon, UMR 5822, F-69622 Villeurbanne, France</footnote>

<footnote n="35">³⁵Observatoire de Sauverny, Ecole Polytechnique Fédérale de Lau- sanne, CH-1290 Versoix, Switzerland</footnote>

<footnote n="36">³⁶Mullard Space Science Laboratory, University College London, Holmbury St Mary, Dorking, Surrey RH5 6NT, UK</footnote>

<footnote n="37">³⁷Departamento de Física, Faculdade de Ciências, Universidade de Lisboa, Edifício C8, Campo Grande, P-1749-016 Lisboa, Portugal</footnote>

<footnote n="38">³⁸Instituto de Astrofísica e Ciências do Espaço, Faculdade de Ciências, Universidade de Lisboa, Campo Grande, P-1749-016 Lisboa, Portugal</footnote>

<footnote n="39">³⁹Department of Astronomy, University of Geneva, ch. d'Écogia 16, CH-1290 Versoix, Switzerland</footnote>

<footnote n="40">⁴⁰Department of Physics, Oxford University, Keble Road, Oxford OX1 3RH, UK</footnote>

<footnote n="41">⁴¹INFN-Padova, Via Marzolo 8, I-35131 Padova, Italy</footnote>

<footnote n="42">⁴²Université Paris-Saclay, Université Paris Cité, CEA, CNRS, Astrophysique, Instrumentation et Modélisation Paris-Saclay, F-91191 Gif-sur-Yvette, France</footnote>

<footnote n="43">⁴³INAF-Osservatorio Astronomico di Trieste, Via G. B. Tiepolo 11, I-34143 Trieste, Italy</footnote>

<footnote n="44">⁴⁴Aix-Marseille Université, CNRS/IN2P3, CPPM, F-13007 Marseille, France</footnote>

<footnote n="45">⁴⁵Istituto Nazionale di Fisica Nucleare, Sezione di Bologna, Via Irnerio 46, I-40126 Bologna, Italy</footnote>

<footnote n="46">⁴⁶INAF-Osservatorio Astronomico di Padova, Via dell'Osservatorio 5, I-35122 Padova, Italy</footnote>

<footnote n="47">⁴⁷Dipartimento di Fisica 'Aldo Pontremoli', Università degli Studi di Milano, Via Celoria 16, I-20133 Milano, Italy</footnote>

<footnote n="48">⁴⁸INAF-Osservatorio Astronomico di Brera, Via Brera 28, I-20122 Milano, Italy</footnote>

<footnote n="49">⁴⁹INFN-Sezione di Milano, Via Celoria 16, I-20133 Milano, Italy</footnote>

<footnote n="50">⁵⁰Institute of Theoretical Astrophysics, University of Oslo, P.O. Box 1029 Blindern, N-0315 Oslo, Norway</footnote>

<footnote n="51">⁵¹Jet Propulsion Laboratory, California Institute of Technology, 4800 Oak Grove Drive, Pasadena, CA 91109, USA</footnote>

<footnote n="52">⁵²von Hoerner & Sulger GmbH, SchloßPlatz 8, D-68723 Schwetzingen, Germany</footnote>

<footnote n="53">⁵³Technical University of Denmark, Elektrovej 327, DK-2800 Kgs. Lyngby, Denmark</footnote>

<footnote n="54">⁵⁴Max-Planck-Institut für Astronomie, Königstuhl 17, D-69117 Heidelberg, Germany</footnote>

<footnote n="55">⁵⁵Université de Genève, Département de Physique Théorique and Centre for Astroparticle Physics, 24 quai Ernest-Ansermet, CH-1211 Genève 4, Switzerland</footnote>

<footnote n="56">⁵⁶Department of Physics and Helsinki Institute of Physics, Gustaf Hällströminkatu 2, FI-00014 University of Helsinki, Finland</footnote>

<footnote n="57">⁵⁷NOVA Optical Infrared Instrumentation Group at ASTRON, Oude Hoogeveensedijk 4, NL-7991 PD Dwingeloo, the Netherlands</footnote>

<footnote n="58">⁵⁸Argelander-Institut für Astronomie, Universität Bonn, Auf dem Hügel 71, D-53121 Bonn, Germany</footnote>

<footnote n="59">⁵⁹Dipartimento di Fisica e Astronomia 'Augusto Righi' - Alma Mater Studiorum Università di Bologna, via Piero Gobetti 93/2, I-40129 Bologna, Italy</footnote>

<footnote n="60">⁶⁰Department of Physics, Institute for Computational Cosmology, Durham University, South Road, DH1 3LE, UK</footnote>

<footnote n="61">⁶¹Université Côte d'Azur, Observatoire de la Côte d'Azur, CNRS, Laboratoire Lagrange, Boulevard de l'Observatoire, CS 34229, F-06304 Nice cedex 4, France</footnote>

<footnote n="62">⁶²Institute of Physics, Laboratory of Astrophysics, Ecole Polytechnique Fédérale de Lausanne (EPFL), Observatoire de Sauverny, CH-1290 Versoix, Switzerland</footnote>

<footnote n="63">⁶³European Space Agency/ESTEC, Keplerlaan 1, NL-2201 AZ Noordwijk, The Netherlands</footnote>

<footnote n="64">⁶⁴Department of Physics and Astronomy, University of Aarhus, Ny Munkegade 120, DK-8000 Aarhus C, Denmark</footnote>

<footnote n="65">⁶⁵Space Science Data Center, Italian Space Agency, via del Politecnico snc, I-00133 Roma, Italy</footnote>

<footnote n="66">⁶⁶Centre National d'Etudes Spatiales, F-31400 Toulouse, France</footnote>

<footnote n="67">⁶⁷Institute of Space Science, Bucharest, Ro-077125, Romania</footnote>

<footnote n="68">⁶⁸Université Paris Cité, CNRS, Astroparticule et Cosmologie, F-75013 Paris, France</footnote>

<footnote n="69">⁶⁹Departamento de Física, FCFM, Universidad de Chile, Blanco Encalada 2008, Santiago, Chile</footnote>

<footnote n="70">⁷⁰Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas (CIEMAT), Avenida Complutense 40, E-28040 Madrid, Spain</footnote>

<footnote n="71">⁷¹Instituto de Astrofísica e Ciências do Espaço, Faculdade de Ciências, Universidade de Lisboa, Tapada da Ajuda, PT-1349-018 Lisboa, Portugal</footnote>

<footnote n="72">⁷²Departamento de Electrónica y Tecnología de Computadoras, Universidad Politécnica de Cartagena, E-30202 Cartagena, Spain</footnote>

<footnote n="73">⁷³Infrared Processing and Analysis Center, California Institute of Technology, Pasadena, CA 91125, USA</footnote>

<footnote n="74">⁷⁴Instituto de Astrofísica de Canarias, Calle Vía Láctea s/n, E-38204 San Cristóbal de La Laguna, Tenerife, Spain</footnote>

<footnote n="75">⁷⁵Institut d'Astrophysique de Paris, UMR 7095, CNRS, Sorbonne Université, 98 bis boulevard Arago, 75014 Paris, France</footnote>

<footnote n="76">⁷⁶AIM, CEA, CNRS, Université Paris-Saclay, Université de Paris, F-91191 Gif-sur-Yvette, France</footnote>

<footnote n="77">⁷⁷NASA Ames Research Center, Moffett Field, CA 94035, USA</footnote>

<footnote n="78">⁷⁸INFN-Bologna, Via Irnerio 46, I-40126 Bologna, Italy</footnote>

<footnote n="79">⁷⁹IFPU, Institute for Fundamental Physics of the Universe, via Beirut 2, I-34151 Trieste, Italy</footnote>

<footnote n="80">⁸⁰Dipartimento di Fisica e Scienze della Terra, Università degli Studi di Ferrara, Via Giuseppe Saragat 1, I-44122 Ferrara, Italy</footnote>

<footnote n="81">⁸¹INAF, Istituto di Radioastronomia, Via Piero Gobetti 101, I-40129 Bologna, Italy</footnote>

<footnote n="82">⁸²Institut de Recherche en Astrophysique et Planétologie (IRAP), Université de Toulouse, CNRS, UPS, CNES, 14 Av. Edouard Belin, F-31400 Toulouse, France</footnote>

<footnote n="83">⁸³Institute for Theoretical Particle Physics and Cosmology (TTK), RWTH Aachen University, D-52056 Aachen, Germany</footnote>

<footnote n="84">⁸⁴Department of Physics & Astronomy, University of California Irvine, Irvine, CA 92697, USA</footnote>

<footnote n="85">⁸⁵University of Lyon, UCB Lyon 1, CNRS/IN2P3, IUF, IP2I Lyon, F-69100 Lyon, France</footnote>

<footnote n="86">⁸⁶Aix-Marseille Université, CNRS, CNES, LAM, F-13013 Marseille, France</footnote>

<footnote n="87">⁸⁷INFN-Sezione di Genova, Via Dodecaneso 33, I-16146, Genova, Italy</footnote>

<footnote n="88">⁸⁸INAF-Istituto di Astrofisica e Planetologia Spaziali, via del Fosso del Cavaliere, 100, I-00100 Roma, Italy</footnote>

<footnote n="89">⁸⁹School of Physics, HH Wills Physics Laboratory, University of Bristol, Tyndall Avenue, Bristol BS8 1TL, UK</footnote>

<footnote n="90">⁹⁰Instituto de Física Teórica UAM-CSIC, Campus de Cantoblanco, E-28049 Madrid, Spain</footnote>

<footnote n="91">⁹¹Department of Physics, University of Helsinki, P.O. Box 64, FI-00014 University of Helsinki, Finland</footnote>

<footnote n="92">⁹²Astronomical Institute (AIRUB), Faculty of Physics and Astronomy, Ruhr University Bochum, German Centre for Cosmological Lensing (GCCL), D-44780 Bochum, Germany</footnote>

<footnote n="93">⁹³Department of Physics, Lancaster University, Lancaster LA1 4YB, UK</footnote>

<footnote n="94">⁹⁴Instituto de Astrofísica de Canarias (IAC), Departamento de Astrofísica, Universidad de La Laguna (ULL), E-38200 La Laguna, Tenerife, Spain</footnote>

<footnote n="95">⁹⁵Université de Paris, LERMA, Observatoire de Paris, PSL Research University, CNRS, Sorbonne Université, F-75013/4 Paris, France</footnote>
<footnote n="96">⁹⁶Department of Physics and Astronomy, University College London, Gower Street, London WC1E 6BT, UK</footnote>

<footnote n="97">⁹⁷Astrophysics Group, Blackett Laboratory, Imperial College London, London SW7 2AZ, UK</footnote>

<footnote n="98">⁹⁸Université Grenoble Alpes, CNRS, Grenoble INP, LPSC-IN2P3, 53, Avenue des Martyrs, F-38000 Grenoble, France</footnote>

<footnote n="99">⁹⁹Centre de Calcul de l'IN2P3, 21 avenue Pierre de Coubertin, F-69627 Villeurbanne Cedex, France</footnote>

<footnote n="100">¹⁰⁰School of Engineering, University of Applied Sciences and Arts of Northwestern Switzerland, CH-5210 Windisch, Switzerland</footnote>

<footnote n="101">¹⁰¹Dipartimento di Fisica - Sezione di Astronomia, Università di Trieste, Via Tiepolo 11, I-34131 Trieste, Italy</footnote>

<footnote n="102">¹⁰²INFN, Sezione di Trieste, Via Valerio 2, I-34127 TS Trieste, Italy</footnote>

<footnote n="103">¹⁰³Department of Mathematics and Physics E. De Giorgi, University of Salento, Via per Arnesano, CP-193, I-73100 Lecce, Italy</footnote>

<footnote n="104">¹⁰⁴INFN - Sezione di Lecce, Via per Arnesano, CP-193, I-73100 Lecce, Italy</footnote>

<footnote n="105">¹⁰⁵Institute for Computational Science, University of Zurich, Winterthur-erstrasse 190, CH-8057 Zurich, Switzerland</footnote>

<footnote n="106">¹⁰⁶Higgs Centre for Theoretical Physics, School of Physics and Astronomy, The University of Edinburgh, Edinburgh EH9 3FD, UK</footnote>

<footnote n="107">¹⁰⁷Institut d'Astrophysique de Paris, 98bis Boulevard Arago, F-75014, Paris, France</footnote>

<footnote n="108">¹⁰⁸Institut für Theoretische Physik, University of Heidelberg, Philosophenweg 16, D-69120 Heidelberg, Germany</footnote>

<footnote n="109">¹⁰⁹Faculty of Science, Université St Joseph, Beirut, Lebanon</footnote>

<footnote n="110">¹¹⁰Department of Astrophysical Sciences, Peyton Hall, Princeton University, Princeton, NJ 08544, USA</footnote>

<footnote n="111">¹¹¹Helsinki Institute of Physics, University of Helsinki, Gustaf Hällströminkatu 2, FI-00560 Helsinki, Finland</footnote>

<footnote n="112">¹¹²SISSA, International School for Advanced Studies, Via Bonomea 265, I-34136 Trieste TS, Italy</footnote>

<footnote>This paper has been typeset from a TEX/LATEX file prepared by the author.</footnote>