A machine learning approach to estimate mid-infrared fluxes from WISE data
Abstract
13 pags., 10 figs., 2 tabs
Full text
A&A, 691, A271 (2024) https://doi.org/10.1051/0004-6361/202450274 c The Authors 2024 Astronomy & Astrophysics A machine learning approach to estimate mid-infrared fluxes from WISE data Nuria Fonseca-Bonilla1,?, Luis Cerdán2, Alberto Noriega-Crespo3, and Amaya Moro-Martín3 1Centro de Astrobiología (CSIC-INTA), Instituto Nacional de Técnica Aeroespacial, 28850 Torrejón de Ardoz, Madrid, Spain 2Instituto de Química-Física “Blas Cabrera”, Consejo Superior de Investigaciones Científicas, 28006, Madrid, Spain 3Space Telescope Science Institute, 3700 San Martin Drive, Baltimore, MD 21218, USA Received 6 April 2024 /Accepted 25 September 2024 ABSTRACT Context. While the Wide-field Infrared Survey Explorer (WISE) is the largest, best quality infrared all-sky survey to date, a smaller coverage mission, Spitzer, was designed to have better sensitivity and spatial resolution at similar wavelengths. Confusion and contamination in WISE data result in discrepancies between them. Aims. We aim to present a novel approach to work with WISE measurements with the goal of maintaining both its high coverage and vast amount of data while, at the same time, taking full advantage of the higher sensitivity and spatial resolution of Spitzer. Methods. We have applied machine learning (ML) techniques to a complete WISE data sample of open cluster members, using a training set of paired data from high-quality Spitzer Enhanced Imaging Products (SEIP), MIPS and IRAC, and allWISE catalogs, W1 (3.4 µm) to W4 (22 µm) bands. We have tested several ML regression models with the aim of predicting mid-infrared fluxes at MIPS1 (24 µm) and IRAC4 (8 µm) bands from WISE variables (fluxes and quality flags). In addition, to improve the prediction quality, we have implemented feature selection techniques to remove irrelevant WISE variables. Results. We have notably enhanced WISE detection capabilities, mostly for the targets with the lowest magnitudes, which previously showed the largest discrepancies with Spitzer. In our particular case, extremely randomized trees was found to be the best algorithm to predict mid-infrared fluxes from WISE variables, attaining coefficients of determination R2∼0.94 and R2∼0.98 for 24 µm (MIPS1) and 8 µm (IRAC4), respectively. We have tested our results in members of IC 348 and compared their observed fluxes with the predicted ones in their spectral energy distributions. We show discrepancies in the measurements of Spitzer and WISE and demonstrate the good concordance of our predicted mid-infared fluxes with the real ones. Conclusions. Machine learning is a fast and powerful tool that can be used to find hidden relationships between datasets, as the ones we have shown to exist between WISE and Spitzer fluxes. We believe this approach could be employed for other samples from the allWISE catalog with SEIP positional counterparts, and in other astrophysical studies in which analogous discrepancies might arise when using datasets from different instruments. Key words. methods: data analysis – methods: statistical – astronomical databases: miscellaneous – catalogs – surveys – infrared: stars 1. Introduction Infrared observations have been used to study a wide range of phenomena, more prominently the formation and evolution of planetary systems, exoplanet characterization, the birth and death of stars, interstellar gas and dust, and the formation and evolution of galaxies, including those that formed in the very early universe (Glass 1999). Many of these observations have been carried out from space using both all-sky surveys and pointed observations. The first infrared space mission, the Infrared Astronomical Satellite (IRAS) (Neugebauer et al. 1984), carried out an all-sky survey at 12, 25, 60, and 100µm with a spatial angular resolution of 3000 at 12 µm to 20at 100 µm. This selection of wavelength ranges allowed measuring the spectral energy distribution (SED) of a wide range of astrophysical objects, from stars to starburst galaxies (Beichman 1988). Since then, other infrared space missions have followed: ISO (Kessler et al. 1996), Spitzer (Werner et al. 2004), AKARI (Murakami et al. 2007), the Wide-field Infrared Survey Explorer (WISE) (Wright et al. 2010), and the James Webb Space Telescope (JWST) (Gardner et al. 2006). These missions have aimed ?Corresponding author; [email protected] to have some overlap in wavelength range that allows them to bootstrap their absolute flux calibration by observing the same objects at a similar wavelength range to be able to deal with, understand, and mitigate instrumental effects. Nevertheless, by design, the resolving power of their optics (i.e., spatial angular resolution) and sensitivity have not been the same. In this study we want to compare data from two of these infrared space missions: Spitzer and WISE. WISE stands as the last all-sky mid-infrared mission to date. It surveyed the sky at four different wavelengths at 3.4 µm (W1), 4.6 µm (W2), 12 µm (W3), and 22 µm (W4), with a better sensitivity than any other previous infrared mission that mapped the whole sky photometrically, detecting almost 750 million objects on its images. WISE bands are very similar to some of those of Spitzer (Table 1) that made both photometric and spectral observations at different wavelengths between 3 and 180 µm. Nevertheless, Spitzer has a better performance concerning resolution, sensitivity, and saturation limit (Cutri et al. 2013; Antoniucci et al. 2014), see Fig. 1. The Spitzer’s 85 cm primary mirror, compared to WISE’s 40 cm one, provided Spitzer with a resolution twice as good. WISE achieved 5σpoint source sensitivities better than 0.08, 0.11, 1, and 6mJy at 3.4, 4.6, 12, Open Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. This article is published in open access under the Subscribe to Open model.Subscribe to A&A to support open access publication. A271, page 1 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) and 22 µm, respectively, in unconfused regions on the ecliptic in its four bands, with a slightly better sensitivity toward the ecliptic poles (Wright et al. 2010). For comparison, Spitzer’s IRAC instrument had a point-source sensitivity requirement (5σ, 200 sec) of 6, 7, 36, and 54µJy at 3.6, 4.5, 5.8, and 8.0 µm, respectively (Werner et al. 2004). At 24 µm (MIPS1), the Spitzer MIPSGAL survey on a 278 deg2of the Galactic plane reached a 5σRMS point source sensitivity of 1.3mJy (Carey et al. 2009); similarly, the Cores-2-Disks (C2D) survey on a 10.6deg2in Perseus reached a 5σRMS point source sensitivity of ∼1 mJy (Rebull et al. 2007). Over its mission lifetime, Spitzer observed just a small fraction of the sky, compared with the all-sky coverage of WISE. This difference in instrumental performance is reflected in that several studies have found indications of some kind of contamination in WISE data (Debes et al. 2011;Patel et al. 2017;Xu et al. 2020). A number of them have even shown unexpected discrepancies between results in WISE and Spitzer (Kennedy & Wyatt 2012;Silverberg et al. 2018;Dennihy et al. 2020). One possible explanation is that the wide point-spread function (PSF) in WISE leads to source confusion, allowing background or nearby emission to contribute to the measured photometry, which contaminates the sample (Patel et al. 2017; Silverberg et al. 2018;Dennihy et al. 2020). Due to the similar band passes of WISE and Spitzer, it would be tempting to use Spitzer instead of WISE when available, but the ending of the Spitzer mission some years ago restricts that solution to just a small area of the sky. Thus, an alternative solution is needed to take full advantage of WISE’s all sky coverage. In the last years, driven by the extraordinary advances in technology, the amount of data gathered in astronomical observations has grown exponentially (Ball & Brunner 2010; Pesenson et al. 2010;Kremer et al. 2017;Baron 2019). This increase in quantity, but also in complexity, has made almost impossible to handle analysis with traditional methods. Machine learning (ML), the subfield of artificial intelligence focused on the use of data and mathematical algorithms that mimic the way humans learn, offers a variety of different approaches to solve these problems (Bishop 2007;Lindholm et al. 2022). In fact, the use of ML techniques in astronomy has been so prolific that it has even led to its own research branch (Kremer et al. 2017;Ivezi´ c et al. 2019;Fluke & Jacobs 2020;Moriwaki et al. 2023). As of today, several works have already employed ML in datasets containing WISE data. Some examples include automatic classification of sources (Kurcz et al. 2016;Clarke et al. 2020;Zhao et al. 2023;Zeraatgari et al. 2024); identification of young stellar objects (Marton et al. 2019), galaxies (Krakowski et al. 2016) or active galactic nuclei (Shu et al. 2019;Retana-Montenegro & Röttgering 2020); detection of debris disks candidates (Nguyen et al. 2018); unsupervised clusterization techniques to differentiate types of spiral galaxies (Guo et al. 2022). In one study by Dobbels et al. (2020), the authors used the ultraviolet to mid-infrared part of the SED of galaxies to predict their far-infrared emission across Herschel bands using neural networks. We want to highlight that here (and in what follows) “predict” is used in the statistical sense of guessing the value of a random variable and not foreseeing the future. In a similar approach, in this paper we exploit the extraordinary capabilities of ML techniques to find hidden relationships between different datasets to predict mid-infrared fluxes at the same wavelengths as the Spitzer bands MIPS1 (24µm) and IRAC4 (8 µm) from WISE variables. We show that this allows us to reach a good compromise between WISE and Spitzer capabilities, taking advantage of the large coverage of the former and the better spatial resolution and sensitivity of the latter. In Section 2 we describe our sample and data, while Section 3details the ML procedure (algorithm and models). The results, including an application to the study of SEDs in a well-studied open cluster, are presented and discussed in Section 4. Finally, we wrap up with a summary and the concluding remarks in Section 5. 2. Description of the sample In our attempt to make a good comparison between WISE and Spitzer and in order to obtain consistent and trustful predictions with ML – that is, to avoid the “garbage in, garbage out” problem (Geiger et al. 2021) – we need reliable input data. But, at the same time, we want a data set that is not too large so we can process it within a reasonable time. With the aim of using it for further studies (Fonseca-Bonilla et al. in prep.1), we have chosen the largest and most updated sample of members of a census of high quality 3530 open clusters by Hunt & Reffert (2024) from Gaia DR3 (Gaia Collaboration 2018). Following the criteria in Hunt & Reffert (2023) and for the purpose of the ML training, we decided to discard membership probabilities of less than 50%. The remaining open cluster members comprise our HR24 sample. To obtain the infrared data of the objects, we selected the Spitzer Enhanced Imaging Products (SEIP) Source List CR32as our reference catalog, due to the high reliability of its Spitzer data (a 10σlevel of signal-to-noise ratio in at least two channels for galactic sources). This data set includes both Spitzer and WISE data (fluxes and uncertainties) at several bands, along with reliability and quality flags from the allWISE Release (Cutri et al. 2013) positional counterparts. This guarantees a consistent collection of sources with Spitzer and WISE data with which to train and optimize the ML models, as well as a collection of sources with exclusively WISE data for which to predict mid-infrared fluxes. It is necessary to take into account the consideration made in the SEIP Explanatory Supplement3 about the completeness of its Source List, bearing in mind it was specifically designed to prioritize reliability over completeness. A query in the SEIP Source List at 2 arcsec with the coordinates of the 444219 stars of the HR24 sample resulted in 26 068 positive matches with a nonzero value in the WISE W4 band at 22 µm, hereafter our “unclean” sample. The condition of a nonzero W4 value is sufficiently restrictive to automatically guarantee nonzero values in W1, W2, and W3 (because to predict fluxes at 8µm and 24 µm we need values in all WISE bands and the rest of variables). In addition, this restriction to nonzero values in W4, addresses the interest of studying fluxes at this wavelength (e.g., for studies of warm infrared excesses) and also allows us to inspect the high discrepancies between W4 and its Spitzer counterpart channel MIPS1 at 24µm. Since WISE photometric measurements are optimized for point sources, we went a step further in terms of data reliability by setting in the query ext_flg=0.0. This constraint ensured we were looking at a point source or an object not superimposed on a 2MASS Extended Source Catalog object. To avoid a spurious detection or contamination (from diffraction spikes, persistence, halo and ghost arti- 1We are developing a detailed study of warm infrared excesses that exploits the predicted fluxes obtained with our method to characterize the distribution and evolution of circumstellar disks in open clusters with high quality data. 2https://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/ SEIP/overview.html 3https://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/ SEIP/docs/seip_explanatory_supplement_v3.pdf A271, page 2 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) N Fig. 1. Comparison of the open cluster IC 348 observed with WISE W3 at 12µm (left), W4 at 22µm (center), and Spitzer at MIPS1 24 µm (right), on a 20 arcmin field of view. Notice that the morphology of the extended emission is different between the 12µm (W3) and 22µm (W4) images. On the other hand, the 22 µm and 24 µm (MIPS1) data look quite similar overall, except that the difference in sensitivity and angular resolution makes the 24µm image look sharper and makes it possible to detect fainter point sources. Table 1. Spitzer and WISE instrumental characteristics extracted from Antoniucci et al. (2014) and van der Marel et al. (2016). Mission Coverage Primary mirror Bands Wavelength Resolution Beam size Diameter (µm) (arcsec pixel−1) (arcsec) WISE All-sky 40 cm W1, W2, W3 3.4, 4.6, 12.0 2.7 6.1, 6.4, 6.5 W4 22.0 5.5 12.0 Spitzer targeted 85 cm IRAC1-4 3.6, 4.5, 5.8, 8.0 1.2 1.7–1.9 MIPS1 24.0 2.6 6.0 facts) in all WISE bands, we imposed cc_flags=‘0000’. These two conditions left us with a “clean” sample of 9231 objects. It is worth highlighting that due to observational issues and also the strict reliability criteria of the SEIP Source List, not all sources with flux measurements in W4 have a MIPS1 counterpart. The same is true for W3 and IRAC4 (8 µm) pairs. This disparity in data availability is displayed in Fig. 2, which shows a scheme of the database design, its structure, and the number of objects included in both unclean and clean (gray shadowed) samples. To predict fluxes at MIPS1 band (24µm) (left branch of the diagram), we use the subsample with nonzero values in MIPS1 for tuning and optimizing the ML models, as well as for evaluating their performance. Subsequently, the trained ML models predict fluxes at 24µm for the rest of the sources without values in MIPS1, as explained in Section 3and sketched in the workflow displayed in Fig. 3. Notice that for the MIPS1 ML studies, ∼10% of the sources have a nonzero value in the corresponding band, evidencing the necessity of carrying out the present study. It works similarly to predict fluxes at IRAC4 band (8 µm) from WISE variables (IRAC4 study, right branch), but in this case only a third of the sources lack a value in the Spitzer band. Another peculiarity that draws the attention in Fig. 2is the mismatch between the total number of sources in the clean and unclean datasets, and the sum of sources with Spitzer flux densities different from zero with those without flux density values. For instance, we can see that for the MIPS1 study with the clean dataset, there are 1096 sources with MIPS1,0 and 4348 without MIPS1 values, whose sum is significantly smaller than the 9231 sources included in this dataset. This loss of data comes from a restriction imposed by the ML models, which excel at interpolating (making predictions inside the training space) but, in many cases, perform poorly when extrapolating (making predictions outside the training space). To avoid this problem, we removed from the datasets without Spitzer fluxes all sources whose WISE parameters were outside the training space. In par- Fig. 2. Data structure scheme for the ML studies in this paper. The numbers in gray shadowed boxes correspond to the clean datasets. OC stands for open cluster. ticular, we looked for the convex hull (i.e., the envelope) of the training space as defined exclusively by W1 to W4, located the sources with those fluxes outside the convex hull, and discarded them. While this step reduced the data availability, it ensured that the predictions are even more reliable. Concerning the different variables (or features) involved in our study, we just selected those of numerical nature related with the fluxes and their qualities for all the WISE bands: WISE fluxes at the four available channels (wise#), the reduced χ2for all the WISE bands (wise#rchi2), and their frame coverage quality flags (wise#m and wise#nm). In the case of Spitzer we used A271, page 3 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) Fig. 3. Workflow detailing the data management and preprocessing steps, as well as the ML model optimization, training, and evaluation procedures, to predict mid-infrared fluxes from WISE variables. Squared boxes represent datasets, while the ML models, algorithms, and other mathematical operations are indicated with rounded boxes. The actual ML regression model (rounded boxes outline in blue) are displayed in more detail in Fig. 4. A dashed arrow-connector between a dataset and an algorithm signifies that the former has been used to train the latter. A double-headed arrow connecting a filter hub and an algorithm signifies “read filtering conditions for rows or columns and apply to dataset arriving to the hub”. MIPS1 and IRAC4 fluxes and errors: m1_f_psf and m1_df_psf, i4_f_ap1 and i4_df_ap1. 3. Machine learning tools We can mathematically denote the previous datasets as X= {x1,i,...,xp,i,yi}i=1,...,n, where nis the number of observations (stars), pis the number of random variables Xj=1,...,p(WISE fluxes and flags), and xj,iand yiare, respectively, the i-th observation of Xjand the random variable Y(Spitzer fluxes). In the following we refer to the variables Xjeither as predictors or features. Our goal is to predict the target variable Yfrom the set of predictor variables Xjby means of a regression model Y=m(X1,...,Xp)+, where mis the regression function and is the uncertainty associated to the prediction. The function m:Rp→Rencodes the relation between Yand (X1,...,Xp) and is in general unknown. Thus, learning a surrogate function that provides an estimate ˆmof the unknown function mis the target of all statistical and machine learning regression models. Once ˆmis learned, one can predict Ygiven an observation of (X1,...,Xp). To find a mathematical model ˆmthat can generate accurate predictions and uncertainty intervals, several distinct and fundamental steps must be followed, as depicted in the data workflow of Fig. 3. At a high level, it can be summarized as follows: the SEIP catalog is cross-matched with the HR24 catalog. The resulting [initial] sample (unclean or clean, see Sec. 2) is split into labeled (with Spitzer fluxes) and unlabeled (without Spitzer fluxes) datasets. The labeled dataset is used to define the training space, and the unlabeled data points outside it are excluded (or filtered) (Sec. 2). The labeled dataset, after the Spitzer fluxes are log-transformed, is used again to select the features that are important for the regression problem (Sec. 3.3.2). The irrelevant features are removed (or filtered) from both datasets. The remaining [training] data is split into train and test sets. The train set is used to tune and optimize the ML models (Sec. 3.2.1), and the test set is used to evaluate the optimized model performance. The optimized final ML regression model is retrained with the whole training data (train+test). This final ML model is then used to make predictions on the unlabeled dataset. Finally, these predictions, once an inverse log-transform is applied, are appended to the initial sample as a new feature. The actual ML regression model is described in more detail in Sec. 3.1. These steps, as well as other relevant algorithmic aspects, will be described in what follows. 3.1. Machine learning model pipeline The actual ML model consists of a “transformation” step and a “regression” step arranged in a pipeline (see Fig. 4). 3.1.1. Dataset transformation Many ML models require the predictors Xjand the target Y to follow normal-like distributions, but both WISE and Spitzer data are highly right-skewed. Therefore, the Spitzer fluxes were normalized applying a base 10 log transformation. Applying this transformation to the WISE features could somewhat normalize the distribution of the fluxes, but not their quality flags. Accordingly, we made the WISE variables more normallike using a Yeo-Johnson power transformation for each predictor independently (see Fig. 4). This transformation relies on a data-dependent parameter ˆ λjwhose optimal value is obtained maximizing the likelihood on the transformed variable (Yeo & Johnson 2000). Furthermore, some ML models are sensitive to the differences in the magnitude and spread of the predictors, assigning artificially more weight to those predictors with a larger magnitude. To avoid this, the Yeo-Johnson transformed predictors were subsequently standardized by subtracting an estimated mean ˆµjand dividing by an estimated standard deviation ˆσj. With this preprocessing procedure, we guarantee that the predictors follow standard normal-like distributions (see Fig. 4). The estimates ˆ λj, ˆµj, and ˆσjare chosen following a cross-validation (CV) procedure (see Section 3.2.1). Once the predictions were obtained, an inverse log transformation A271, page 4 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) Fig. 4. Scheme of the steps involved in the prediction of mid-infrared fluxes from WISE features. The blue box encloses the data transformation algorithms and the regression model comprising our ML model. was applied to yield the actual fluxes back (see Figs. 3 and 4). 3.1.2. Regression model Using the AutoML Python library PyCaret (Ali 2020), we first made a prescreening of the performance of several regression algorithms on our datasets. In view of the obtained results, as our main model we chose an ensemble of decision trees because they are the state-of-the-art solutions to solve regression problems (Sagi & Rokach 2018) and because they can provide an estimation of the predictions’ uncertainty, which are fundamental for astrophysical studies. In this kind of ML algorithms, qdecision trees are trained independently and their predictions are averaged to render a final prediction ˆyi. A decision tree can be abstracted as follows: a) Divide the predictor space (set of possible values of (X1,...,Xp)) into Jdistinct non-overlapping regions R1,...,RJ (leaves). b) For each observation contained into the region RJ, the prediction ˆyJis the mean of the target values Yifor the training observations in RJ. The goal is to find regions R1,...,RJ that minimize the residuals between the predictions ˆyJand the values of Yiin each region. Decision trees are constructed recursively, following a binary splitting approach, from the root to the leaves, selecting for every new node the best feature and “splitting condition” (value of the feature) to grow the tree. The process begins at the bottom of the tree (root), where all observations belong to a single region. Then, in the first node, the predictor space is split, as dictated by the best feature and splitting value, into two new regions (branches). Next, the process is repeated but, instead of splitting the whole predictor space, only the observations within each of the branches are split. The splitting continues growing ever thinner branches (with fewer and fewer observations) until a stopping criterion (depth of the tree, minimum number of observations per leaf, ...) is reached, at which moment we have found all the leaves (regions R1,...,RJ). For regression tasks, the best feature and splitting condition for a node are the ones minimizing the average of the variances of Yiin each partition. Using a single decision tree to make predictions is not recommended, as the prediction performance is limited and they suffer from high variance, in the sense that a small change in the data can cause a large change in the final estimated tree (Hastie et al. 2009). However, by aggregating many decision trees, i.e, using an ensemble of independently trained trees, the predictive performance of this kind of algorithms can be substantially improved, and the variance of the model reduced. Among the existing tree ensemble models, we resorted to an extremely randomized trees (ET) algorithm, which is similar to the wellknown random forests (Breiman 2001), but with an extra component of randomization (Geurts et al. 2006). As in random forests, in ET each tree is built using only a random subset of predictors Xj, but the features and splitting condition for each node are also set randomly. ET has several hyperparameters that must be tuned to improve the prediction capability. The main ones are the number of trees in the ensemble (q), the depth of the trees (maximum number of splits), the minimum number of observations in a partition in order to continue subdividing the tree, or the minimum number of observations in the leaves. We refer interested readers to the documentation of scikit-learn implementation of ET (ExtraTreesRegressor) for a full description of all the hyperparameters4. As baseline model, we chose a basic multidimensional linear regression (LR) model that assumes Y=β0+β1X1+··· +βpXp+, where β0is the intercept and β1, . . . , βpare the slopes. 3.1.3. Uncertainties of predicted mid-infrared fluxes To estimate the uncertainty intervals of the individual predictions, we leveraged the ensemble nature of ET. As explained above, each of the qtrees of the ET gives a prediction for the i-th observation, and the final prediction ˆyiis the mean of those qpredictions. Grounded on the Central Limit Theorem, the prediction uncertainty (3σconfidence level) was obtained from the standard error of the mean as σˆyi=3σi/√q, where σiis the standard deviation of the qpredictions for the i-th observation. The standard error was obtained for the log transformed fluxes. Accordingly, the lower and upper bounds of the predicted ML fluxes were obtained as 10ˆyi−σˆyiand 10ˆyi+σˆyi, respectively. There are more sophisticated methods to infer the uncertainty: using a resampling strategy such as bootstrap (Efron & Tibshirani 1993); resorting to more advanced probabilistic regression algorithms such as natural gradient boosting (Duan et al. 2020), bayesian neural networks (Neal 2012;Hunt & Reffert 2023), or mixture density networks (Bishop 1994); or estimating the uncertainty as a parameter using a specifically defined loss function (Pearce et al. 2018; 4https://scikit-learn.org/stable/modules/generated/ sklearn.ensemble.ExtraTreesRegressor.html A271, page 5 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) Dobbels et al. 2020). Unfortunately, all these algorithms are “data-hungry,” computationally expensive, and/or increase the problem complexity. Given that our current dataset is small (less than 1000 training instances), we decided to use the standard error for the uncertainty estimation, as it provided the best tradeoffbetween accuracy and simplicity. 3.2. Machine learning model optimization and evaluation metrics 3.2.1. Model selection and optimization As we have just seen in Section 3.1 the ML pipeline is built from the concatenation of data transformation algorithms and a regression model. In the remaining of the paper, with LR, ET, or ML models we refer to the whole pipeline, not just the regression step. The parameters of the transformation step (ˆ λj, ˆµj, and ˆσj) and the hyperparameters of the regression step (number of trees, tree depth, etc...) must be optimized to render the best predictions while avoiding overfitting (i.e., learning the training data by heart instead of inferring the regression function ˆm). With that aim, the whole dataset was randomly split into train and test datasets, with an 80% of observations assigned to the former. The train dataset was used to select the best hyperparameters, while the test dataset was used to independently assess the performance of the optimal model against new observations (Fig. 3). The best hyperparameters were found using k-fold CV and a randomized grid search. In the CV step (Hastie et al. 2009), the train dataset is randomly split into ksubsets (folds). The transformation parameters (ˆ λj, ˆµj, and ˆσj) and the regression model – with a particular configuration of hyperparameters–, are fitted using all observations from k−1 folds. The prediction performance (see Goodness of fit metrics below) is then evaluated on the observations of the left-out fold (after they have been transformed according to the fitted parameters ˆ λj, ˆµj, and ˆσj). This procedure is repeated with all possible combinations of k−1 folds, rendering a total of kindependent evaluations of the ML model performance. The overall predictive capability of the ML model is given by the mean of the kgoodness of fit metrics values. The best hyperparameters are those resulting in the best mean metrics. The hyperparameters configurations evaluated with the CV procedure were chosen following a random grid search (Bergstra & Bengio 2012). In this search strategy, for each configuration, the values of the hyperparameters are randomly chosen among all possible combinations. For example, for ET, the number of trees in the ensemble can be any integer between 10 and 500. For the same number of trials, the randomized search finds better combinations of hyperparameters than the regular grid search, which divides the search space evenly. For our ML study, we used 10-fold CV and 1000 configurations in the hyperparameters search. Finally, as we sketch in Fig. 3, the ML model with the optimal hyperparameters was retrained with the whole dataset (train +test) to obtain the final model. This model was then used to make predictions on the samples whose target variable (Spitzer fluxes) was unknown. These predictions can then be used for further astrophysical studies. 3.2.2. Goodness of fit metrics To quantitatively evaluate the prediction performance of the ML models (goodness of fit), we used the mean absolute error (MAE), the root mean squared error (RMSE), the coefficient of determination R2, and the mean absolute percentage error (MAPE). Let yiand ˆyibe, respectively, the true and predicted values of the target variable for the i-th observation, and let us define ¯y=PN iyi/N, with Nthe number of observations that are evaluated. Then, the evaluation metrics are computed as follows: MAE =1 N N X i|yi−ˆyi|RMSE =v t1 N N X i (yi−ˆyi)2 R2=1−PN i(yi−ˆyi)2 PN i(yi−¯y)2MAPE =1 N N X i |yi−ˆyi| |yi|. MAE and RMSE have dimensions and their values depend on the magnitude of the target variable. In contrast, R2and MAPE are adimensional and independent of the target magnitude. 3.3. Feature selection and importance 3.3.1. Feature importance One of the key aspects of any regression model is to be insightful in relation to which is the “importance” of each feature. This is, its predictive power or how relevant it is to make predictions. In the LR model, for instance, the feature importance can be obtained from the slopes βj. The larger the slope is, the larger the importance of its feature is. For the ET model, though, a different approach is followed. In the scikit-learn ET implementation the importance is proportional to the number of times a feature is selected for a node, with the nodes closer to the root having more weight than those closer to the leaves, and averaged over all trees of the ensemble (Breiman et al. 1984). In order to make meaningful comparisons between models, the feature importances are usually normalized so that they add up to one. 3.3.2. Feature selection Discarding those features that are irrelevant, unimportant or even redundant for the regression problem, helps to reduce the dimensionality of the problem and improves the outcome and accuracy of the ML models (Chandrashekar & Sahin 2014). With that aim, before the ML model optimization and training steps, we employed Boruta (Kursa & Rudnicki 2010), an iterative feature selection algorithm that removes one by one the unimportant features (Figs. 3and 4). It consists on repeating the following steps a number of times or until there are no more irrelevant features. Starting from the standardized dataset ˜ X={˜x1,i,..., ˜xp,i,˜yi}i=1,...,n, another one is created by randomly shuffling each feature Xj. These “shadow” features are joined with the original dataset, obtaining a new one, XS= {˜x1,i,..., ˜xp,i,xs 1,i,...,xs p,i,˜yi}i=1,...,n, with twice as many features. An ML regression model is then fitted to XS, and the importance of each feature is computed. If the importance of an original feature is larger than those of the shadow ones, then it is considered relevant for the regression task and is assigned a “hit”. Given the binary outcome of each independent experiment (hit or no hit), the probability of getting khits after mtrials follows a binomial distribution. Therefore, those features with probabilities below the confidence level αafter mtrials are deemed irrelevant and, consequently, are removed from the dataset. Then the shuffling, hit assignment, and statistical test process starts again but without the discarded features. For this study, we used as ML model the boosted tree algorithm LightGBM (Ke et al. 2017), and set m=100 and α=0.05. A271, page 6 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) µ µ µ µ µ µ µ µ µ µ µ µ µ µ µ µ µ µ µ µ Fig. 5. Predicted mid-infrared fluxes (red points, left axes) and observed WISE fluxes (blue points, right axes) vs. observed Spitzer fluxes. All panels display the fluxes for the stars in the corresponding test set. (a) and (b) display the values of MIPS1 (24µm) and W4 fluxes, while (c) and (d) the values of IRAC4 (8 µm) and W3 fluxes. (a) and (c) show the fluxes of the clean test sets, while (b) and (d) do the same for the unclean test sets. The error bars for the observed WISE data (blue points) have not been included to avoid clogging the plot. Diagonal black lines have been included in all plots to serve as reference and facilitate the comparison. Notice that the limits of both Y axes in each plot, predicted (left) and observed (right), are dissimilar, as they represent fluxes at different wavelengths. In fact, they differ in scale factors of (24/22)2(for a and b) and (12/8)2(for c and d), precisely the ratio of fluxes at different wavelengths expected for a black body model. The limits in both axes are chosen so that both clouds of points (blue and red) fall in the diagonal in case both satellites provided perfectly accurate measurements. 4. Results and discussion As mentioned in the Introduction, WISE data, in comparison with Spitzer data, can be less sensitive and more confused, either by overlapping close-by sources or compact structures in the sky background. Therefore, a given sample of objects, for example, debris disks, can be contaminated by other type of unresolved objects such as, for instance, infrared galaxies. This fact stands out when comparing Spitzer and WISE data, as can be seen in Fig. 5. The correlation between MIPS1 and W4 observed fluxes for a selection of sources in our clean and unclean samples is shown in Figs. 5a and b, respectively. While for MIPS1 fluxes above ∼103µJy there is a good correlation between the values in both bands, below that value the fluxes differ in up to an order of magnitude. A similar behavior can be observed when comparing IRAC4 and W3 observed fluxes in the same samples (see Figs. 5c and d). One possible solution to resolve this discrepancy is to make a thorough selection of the objects in the sample attending to quality criteria, but this ends up in a huge loss of data (see Appendix A). Here we propose an alternative approach, taking advantage of the powerful prediction capabilities of ML techniques and algorithms. 4.1. Machine learning models predictions and goodness of fit metrics One of the several applications of ML is the treatment of correlated datasets in which their specific relationships are not well known (Hastie et al. 2009;Lindholm et al. 2022). Spitzer and WISE observed the sky at similar wavelengths and, in general, the tendencies between the different bands of each satellite are expected to be similar for each target, making it an ideal case scenario to use ML. In other words, one could possibly find a regression function (i.e., ML model) relating the WISE fluxes (and their quality flags) to those of Spitzer. As we previously said in Section 3.1.2, we chose ET as our main ML model, since it was the one that gave the best results across samples among the many other algorithms that we preliminarily tested. A271, page 7 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) µ ²r µ µ ²r µ µ µ ²r µ µ ²r µ µ Fig. 6. Calibration of ML prediction errors for samples in Figs. 5a and c. a) Relative error ras a function of the corresponding flux for MIPS1 observations (red points), W4 observations (blue points), and the lower (black points) and upper (gray points) prediction intervals for the ML predictions at 24 µm. b) Distribution of the relative errors in a) (same color code). c) Relative error ras a function of the corresponding flux for IRAC4 observations (red points), W3 observations (blue points), and the lower (black points) and upper (gray points) prediction intervals for the ML predictions at 8 µm. d) Distribution of the relative errors in c) (same color code). Besides, it provides an estimation of the prediction uncertainties (see Section 3.1.3), which is crucial for any astrophysical study. For comparison and to test the performance of our method, we also made a trial with a basic LR model. Fig. 5displays the predicted mid-infrared fluxes at MIPS1 and IRAC4 wavelengths obtained with the ET models trained with either the clean or the unclean datasets. For a better comparison, the predicted fluxes (red points) are superimposed with the observed WISE ones (blue points). We want to emphasize that all points in Fig. 5– predicted mid-infrared fluxes and observed WISE ones – belong just to the sources in the test sets, which account for the 20% of the corresponding datasets and have not been used in the training (or optimization) phase of the ML models. Accordingly, they serve as a test bed of their performance for observations that do not have Spitzer fluxes. An ideal prediction would result in all red points to lay perfectly in the bisectors of Fig. 5(diagonal black lines), as it would mean that the predictions are exactly equal to the observed values. Attending to this criterion, we can conclude that the predictions of our ET models are rather good, for both mid-infrared bands, and for the clean and unclean datasets. Remarkably, the predicted mid-infrared fluxes fall close to the diagonals at all ranges of the observed Spitzer fluxes, meaning that our ET models are very accurate even for the weakest fluxes. This single fact is the most important result of our study and highlights the relevance of our ML approach, as it opens the door to utilizing the full capabilities of WISE (specially its wide coverage) even for targets whose W3 or W4 fluxes fall below ∼103µJy, where this satellite shows the strongest overestimations. Furthermore, the predicted midinfrared fluxes lack the clear and strong dispersion that can be noticed in the observed WISE fluxes, mostly in the plots corresponding to our unclean data (Figs. 5b and d). In addition, the single prediction uncertainties (vertical error bars in Fig. 5), of a 3σconfidence level, are highly constrained and display a nearly constant relative error (uncertainty over value ratio, r=100∆y/y), showing a slight increase toward the weakest predicted fluxes, much like the observed Spitzer and WISE fluxes (Figs. 6a and c). While at large predicted fluxes the uncertainties are significantly larger than those of the Spitzer observed fluxes, at the weakest fluxes the former are of the same order of magnitude, even in some instances smaller, than the latter. At the same time, the relative errors of the predicted fluxes are smaller than those of the observed WISE fluxes, specially at the weakest magnitudes. Notice that at this range WISE contains numerous upper limits. But, importantly, most relative errors for the predicted fluxes are below 10%, as clearly seen in the histograms of Figs. 6b and d. The results in Figs. 5and 6suggest that the mid-infrared fluxes, predicted from WISE data using our ML approach, are quite reliable, showing both high accuracy (low bias) and high precision (low variance). We can support this claim by looking at the goodness of fit metrics for all the ML models and datasets that we have analyzed in this study, which we have summarized in Table 2. We remind the reader that values closer to zero of MAE, RMSE, and MAPE indicate a better fit of the model. The same holds true for R2, but when it is close to one. Keeping this in mind, an exhaustive inspection of the numbers in the table tells us that the ET models optimized and trained with the different datasets provide very accurate predictions, confirming the results of Fig. 5. In fact, the coefficient of determination R2is, in the A271, page 8 of 13
Fonseca-Bonilla, N., et al.: A&A, 691, A271 (2024) Table 2. Goodness of fit metrics for the different ML models obtained during the ten-fold cross-validation step. Metric ML MIPS1 MIPS1 IRAC4 IRAC4 model clean unclean clean unclean MAE (a)ET 0.106 0.117 0.048 0.063 LR 0.171 0.188 0.091 0.106 RMSE (a)ET 0.165 0.179 0.083 0.110 LR 0.238 0.254 0.139 0.160 R2ET 0.940 0.945 0.983 0.973 LR 0.873 0.890 0.952 0.944 MAPE (a)ET 0.031 0.033 0.018 0.022 LR 0.048 0.051 0.033 0.036 Notes. (a)The values corresponding to these metrics refer to log transformed fluxes, not actual fluxes. worst case (MIPS1 clean), already at ∼0.94, while the MAPE, which conveys information on the mean relative error, is in all cases below ∼3.5%. In addition, the MAE and RMSE for all ET models are very close to 0. Nevertheless, the prediction capabilities of the ET models differ from sample to sample. For example, 8µm fluxes are predicted with a higher accuracy than those at 24µm, both for the unclean and clean datasets, as testified by the goodness of fit metrics of R2∼0.98 and MAPE ∼2%. It is well known that ML models improve their prediction performance when the number of training instances increases (Hastie et al. 2009). Hence, given that there are nearly eight times more sources with IRAC4 fluxes than with MIPS1 ones (cf. Figs. 2and 5), it is highly probable that the observed improvement in the prediction accuracy comes from an increased number of training data. However, this principle is not general. For instance, the unclean datasets contain nearly three times more data than the clean ones (cf. Figs. 2and 5), but the goodness of fit metrics of the former are slightly worse than those of the latter. This reduction in the prediction performance originates in the lower quality of the unclean datasets. The inclusion of both non-point-like sources (ext_flg,0.0) and spurious detections (cc_flags ,‘0000’) in these datasets contributes with irrelevant information (noise) that, eventually, ruins the positive effect of an increased number of training instances. This is a clear example of the “garbage in, garbage out” problem (Geiger et al. 2021) that we cited in Section 2. To put the goodness of fit metrics of the ET models into perspective, it is illustrative to compare them with those obtained with our baseline model, a basic LR (see Section 3.1.2). While the goodness of fit metrics for the LR models are surprisingly good, it is clear that the ET models are far better (Table 2). This fact comes as no surprise, as the ET models are intrinsically nonlinear models that are, in principle, capable of capturing the complex nonlinear relationships expected to exist between the WISE variables and the Spitzer fluxes. In any case, the LR models show a similar behavior to the ET models in what the metrics of the different datasets refers. The LR model makes better predictions for 8 µm fluxes than for the 24 µm ones, and they are better when using the clean datasets for training. Notice that the goodness of fit metrics collected in Table 2 correspond to the average metrics obtained during the 10-fold cross-validation step (see Section 3.2.1), and thus serve as an objective evaluation of the models’ performance against new observations (targets without Spitzer fluxes). In addition, those R 2 R 2 Fig. 7. Effect of train set size on the ET models’ predictive performance: Coefficient of determination R2and MAPE as a function of the percentage of training instances used to train the models for both the clean and unclean samples. a) and c) correspond to the predictions of fluxes at 24 µm, while b) and d) to those at 8 µm. The symbols and error bars represent the mean and standard deviation of the ten-fold cross-validated metrics obtained for ten independent random samplings. values can be understood as a “pessimistic” estimation of the prediction performance of the proposed ML models. The reason is that those metrics were obtained for our ET and LR models trained only with the train dataset, that accounts for the 80% of the points in the whole sample. Once the final ML models are retrained with the whole dataset, both the goodness of fit metrics and the mid-infrared fluxes predictions are expected to be even better, as there are more training instances from which to learn hidden relationships (Hastie et al. 2009). Indeed, to test this claim, we represent in Figure 7the “learning curves” of our ET models. These curves clearly demonstrate how both R2 and MAPE improve monotonically with the number of training instances, both for the clean and the unclean datasets and for the predictions at 8 and 24 µm. Even with the very good fit metrics, we can still observe, specially in Figs. 5a and b, a slight systematic error in the predictions (overestimation of the fluxes below 3 ×103µJy). This is an expected behavior for nonlinear regression models that, either are not capable of capturing the exact nonlinear relationship between the features and the target variable, or because the features does not contain enough information to explain the variability of the target variable in full. Since ET models have an arbitrary level of nonlinearity, the small bias must come from a lack of information. Indeed, the ET models for the prediction of fluxes at 24µm have coefficient of determination of R2∼0.94 (Table 2), meaning that the features selected by Boruta can explain a 94% of the variability. The remaining variability, not capture by the ET model, must come from missing information (other features not considered in this study) or random noise. As this systematic error cannot be fully solved with our current approach, we recommend using these predictions as part of global statistical studies (so that potential biases cancel out), or be exquisitely cautious when using the individual predictions. A271, page 9 of 13