An Extended Catalogue of galaxy morphology using Deep Learning in Southern Photometric Local Universe Survey Data Release 3

The morphological diversity of galaxies is a relevant probe of galaxy evolution and cosmological structure formation. However, in large sky surveys, even the morphological classification of galaxies into two classes, like late-type (LT) and early-type (ET), still represents a significant challenge. In this work we present a Deep Learning (DL) based morphological catalog built from images obtained by the Southern Photometric Local Universe Survey (S-PLUS) Data Release 3 (DR3). Our DL method achieves an precision rate of 98.5% in accurately distinguishing between spiral, as part of the larger category of late type (LT) galaxies, and elliptical, belonging to early type (ET) galaxies. Additionally, we have implemented a secondary classifier that evaluates the quality of each galaxy stamp, which allows to select only high-quality images when studying properties of galaxies on the basis of their DL morphology. From our LT / ET catalog of galaxies, we recover the expected color–magnitude diagram in which LT galaxies display bluer colors than ET ones. Furthermore, we also investigate the clustering of galaxies based on their morphology, along with their relationship to the surrounding environment. As a result, we deliver a full morphological catalog with 164314 objects complete up to r petro < 18, covering ∼ 1800 deg 2 , including a significant area of the Southern hemisphere that was not covered by previous morphology catalogues.


INTRODUCTION
Galaxy structure was one of the first properties of galaxies that was ever directly observed and studied.Initially thought to be 'nebulae', it soon became evident that these objects showed distinct structural features like spiral arms or a smooth elliptical envelope (Zwicky 1940;Vaucouleurs 1959;Herschel 1864;van den Bergh 1998).Decades of studying galaxy shapes and structures thus resulted in several classification schemes, among which the 'Hubble tuning fork' system of classifying galaxies based on their observed visual characteristics has been widely used.Collectively known as galaxy 'morphologies', galaxies can broadly be divided into two main categories namely early and late type galaxies.Late type galaxies are formed by spiral (S) and irregular/peculiar (Irr) galaxies.The spiral galaxies' branch, bifurcates into barred and un-barred systems.The early type galaxies are composed of elliptical and lenticular galaxies.Elliptical galaxies display an increasing ellipticity, from round (E0) to flat (E7) systems.Lenticular galaxies lie at the apex of the Hubble tuning fork due to their hybrid strucure, presenting a bulge and a disk, as spiral galaxies, but without spiral arms.
Such morphological diversity often reflects the presence of different and composite stellar populations (Sánchez et al. 2007) and kinematics (Edelen 1969;Wang et al. 2020).For example, S galaxies are characterized by the presence of a star-forming disk with blue spiral arms, which indicate rotationally supported stellar kinematics.E galaxies have, in general, more smooth featureless morphologies resulting from a lack of star formation.E galaxies present a range of kinematic profiles, being the E0 pressuresupported systems or slow rotators, while intermediate elliptical galaxies (E1/E7) present and increasing contribution of rotation to the total kinematic budjet (Cappellari et al. 2011;Bernardi et al. 2019).
Furthermore, galaxy morphologies are found to be tightly correlated to the color bimodality observed in galaxy populations, thereby resulting in the existence of the younger blue starforming galaxies with late-type (S) morphologies, and the older red passively evolving galaxies with early-type (E/S0) morphologies (Baldry et al. 2004).However, we are increasingly discovering that several sub-populations of galaxies do not neatly follow this dichotomy, i.e. red spirals and blue ellipticals exist (Bamford et al. 2009), and likely arise from a variety of physical processes, some of which may be environmentally driven (e.g., Vulcani et al. 2015).
Thus, the evolution of galaxy morphology has always been in tandem with the growth of galaxies' large-scale environment and their masses over cosmic time (Desai et al. 2007;Calvi et al. 2012;Crossett et al. 2014;Sarkar & Pandey 2020;Wu 2020).Indeed, using a dichotomous 'bulge/disk' definition for the Hubble-type morphologies, the redshift range 1 < z < 2 is found to be abundant with bulge+disk systems (e.g.Margalef-Bentabol et al. 2016), while massive galaxies in the local universe are majorly bulgedominated (Buitrago et al. 2013).
Furthermore, higher redshift galaxies predominantly show peculiar/disturbed/irregular morphologies deviant from the classical morphologies observed at the Local Universe (e.g.Mortlock et al. 2013), suggesting that galaxies have undergone remarkable structural transformation over cosmic time (see also review by Conselice 2014).Undeniably, galaxy morphology is a crucial evolutionary key in tracing and understanding galaxy evolution throughout cosmic times (e.g.Shao et al. 2015).
Ample opportunities are now being presented to investigate galaxy morphologies through multi-band sky surveys, giving us hundreds of thousands of galaxies while exploring large volumes of the sky at the same time (e.g., SDSS; York et al. 2000).The diverse methods employed by such sky surveys vary from human classification of specialists (Nair & Abraham 2010;Ann et al. 2015), to citizen science (Lintott et al. 2008(Lintott et al. , 2010;;Willett et al. 2013;Simmons et al. 2017), or from numerically estimating morphology from galaxy properties (Spiekermann 1992;Storrie-Lombardi et al. 1992;Walmsley et al. 2020) to novel techniques like Principal Component Analysis (PCA; Kelly & McKay 2004;Wjeisinghe et al. 2010), most of which heavily rely on image quality either due to resolution and/or sensitivity of the observations (e.g., Pović et al. 2015).However, migrating to automated methods of classifying galaxies is now necessary to deal with the huge data volumes resulting from such current and upcoming surveys e.g., the Legacy Survey of Space and Time (LSST; Tyson 2002;Axelrod 2006) by the Vera C. Rubin Observatory & sky surveys with the Nancy Grace Roman Space Telescope (Gehrels & and 2015).
Machine Learning (ML) is a powerful automated tool for extracting useful information from complex and varied imaging data sets, and assist in decision-making processes such as classification trees.The use of ML thus is limited not only for galaxy morphologies (Tohill et al. 2023) but also to detect gravitational lenses, interacting galaxies, to classify quasars (Freeman et al. 2013;Shamir et al. 2013;Holincheck et al. 2016;Bom et al. 2017;Ostrovski et al. 2017;Ma et al. 2019;Knabel et al. 2020;Zaborowski et al. 2022), and more recently to detect outliers in astronomical images (Margalef-Bentabol et al. 2020).These applications highlight the wide-ranging capabilities of ML in astrophysical research, enabling researchers to explore and understand diverse phenomena in the cosmos.In the last decade, a sub-field of ML known as Deep Learning (DL) has emerged as the main technique for computer vision applications (Lu et al. 2017;Abdel-Hamid et al. 2014;Vecchiotti et al. 2018), music classification (Choi et al. 2017), and medical prognostics & diagnostics (Li et al. 2018;Hannun et al. 2019).
DL is applied model development for processing complex, minimally reduced (or even raw) data from different sources, and extract relevant features that can then be effectively linked to other properties of interest.In particular, Deep Neural Networks (DNNs) are high-performance data-driven models that are capable of exceeding humans in classification tasks (Metcalf et al. 2019).In astronomy, several recent works have exploited this to show that DNNs can indeed be successfully used to identify not only the morphological features in raw images with minimal human intervention (Glazebrook et al. 2017;Lanusse et al. 2018;Jacobs et al. 2019;Madireddy et al. 2019;Cheng et al. 2019;Petrillo et al. 2017Petrillo et al. , 2019b,a;,a;Farias et al. 2020;Hausen & Robertson 2020;Bom et al. 2022),but also outliers in astronomical images (Margalef-Bentabol et al. 2020).
In this paper, we present the morphological classification of galaxies into LT and ET, using the new Southern Photometric Local Universe Survey DR3 (S-PLUS; Mendes de Oliveira et al. 2019).As a follow-up to Bom et al. (2021) hereafter BOM21, our main aim is to apply a high-performance DL algorithm to the imaging data, to obtain a novel and reliable morphological catalogue in the Southern Hemisphere, with a complementary coverage to other morphological catalogues.Furthermore, we also develop the first Deep Network to evaluate the quality of the stamps and clean spurious detections.Finally, we take advantage of the high precision photometric redshifts derived using the 12 bands in S-PLUS to explore the dependence of morphology on the environment and color, used as a proxy for the galaxy stellar population properties.We compare the classification presented in this work with Vega-Ferrero et al. (2021), and we discuss the implications arising by studying differently classified objects on the current understanding of galaxy morphological categories.
This paper is organized as follows, in section 2 we describe the data from iDR3 used in this work, the sample selection, and auxiliary data used, such as the photometric redshift.In section 3, we present the Deep Learning method used for galaxy morphology classification, and the novel-ties in its implementation since S-PLUS DR1 morphology paper (BOM21, Bom et al. 2021).In section 4, we present the results of the model, including deep learning performance.We also show the relation between environmental density and morphology, and we analyse the distribution of the different morphological classes in a (g-r) colour versus M r absolute magnitude diagram.In section 5, we present our summary and discuss the results.

Southern Photometric Local Universe Survey
The Southern Photometric Local Universe Survey (S-PLUS) is performed with a robotic 86-cm telescope located at the Cerro Tololo Interamerican Observatory to cover ∼ 9300 deg2 of the sky in 12 optical bands.S-PLUS uses a wide field optical camera with a fieldof-view of 2 deg 2 and a plate scale of 0.55 ′′ pixel −1 .The optical filters (the so-called Javalambre filter system, with 5 SDSS-like bands and 7 narrow bands Cenarro et al. 2019) are quite unique for the southern hemisphere and are optimal for source classification, given its better definition of the spectral energy distribution of the observed objects, than the usual 4 or 5-band systems.The narrow bands are designed to be centered on important stellar features, for instance, the OII line, Ca H+K, Hδ and Hα.The survey reaches a typical limiting magnitude of r<21 AB mag for the broad bands and r<20 AB mag for the narrow bands (Mendes de Oliveira et al.

2019).
The third public data release of S-PLUS (DR3) covers ∼ 2000 deg 2 over the Southern Sky.It includes the areas covered in the previous Data Releases such as the Stripe 82.However, the images were reprocessed, with a new reduction and calibration of the data being done from DR2 to DR3, as described in Almeida-Fernandes et al. (2022).In figure 1 we present the area covered by DR3 in comparison with other surveys with available morphological catalogues.The area of the Stripe 82 (at the equator) has overlaps with a number of surveys, in optical and other wavelengths, and it has been used as a benchmark for checking the data reduction and calibration procedures.Other important area covered by the DR3 is the Hydra supercluster (the long vertical red rectangle at the far left of Figure 1).

Sample selection
We use the full DR3 catalogue containing ∼ 50 millions of sources.During the DR1 morphological classification, we selected the objects only by Petrosian magnitude in r band (r petro ) < 17 AB mag and probability of being a galaxy prob gal ≥ 0.6 (for further information see Nakazono et al. 2021a).However, we had a visual inspection phase to remove undesired spurious detection (see BOM21).The current catalogue covers an area of 1800 deg 2 , which makes the visual inspection unfeasible in a reasonable time scale with limited human resources.Therefore, we define more stringent cuts and include four extra constraints compared to BOM21.Additionally, we added an automated selection phase by Neural Network that is detailed in Section 3. Thus, we apply the following selection criteria to define our galaxy sample from the full catalogue of the S-PLUS DR3: where photoflag r r is a photometry quality flag from SExtractor (Bertin & Arnouts 1996), R Kron is the Kron radius, i.e. the first moment of the surface brightness light profile, FWHM n is the Full Width at half maximum of the object divided by the median FWHM of all bright non-saturated stellar objects of the field.All those features are available and described in the SPLUS catalogue.The probability of being a galaxy, prob gal (Nakazono et al. 2021b), and the flag indicating a presence of a bright star nearby, BrightStarFlag, are listed in the 'star-galaxy-quasar' and 'masks' Value Added Catalogues (VAC; see SPLUS.cloud for further details 1 ).Specifically, 0 <= photoflag r r <= 3 ensure the goodness of Sextractor fit in most of the cases of interest.The BrightS tarFlag parameter is very effective in removing bright stars, and allow to clean the few stars which are erroneously assigned a probability higher than 0.7 of being galaxies by the star-galaxy-quasar classification (Nakazono et al. 2021b).The conditions Kron Radius >= 3 and FWHM n >= 1.5 are included to select resolved objects (the average FWHM seeing ≃ 1.2").Following these selection criteria, we obtained a final catalogue of 164314 objects, for which we created image stamps in the 12 bands, with a size of 200×200 pixels 22 .The final catalogue is mostly composed of reliable stamps, i.e. stamps centered on a galaxy, complete up to r petro < 18.Further improvement on the sample selection are described in Section 3.2.

Samples definition
The supervised Deep Learning (DL) assessment requires to be trained on a sample of objects with known classification, i.e. a labeled set (Training/Validation and Test Set -I), sharing as much as possible, the same properties of the sample where the algorithm will be applied in a second moment (Blind Set -II).In this section we describe the characteristics of the two samples, but we refer to Section 3 for more details on the DL algorithm and its performance.
We used the same objects presented in training and validation and the test scheme used in BOM21, which used Galaxy Zoo 1 unbiased morphological classification into elliptical and spiral galaxies (Lintott et al. 2008;Bamford et al. 2009;Lintott et al. 2010) as true label.Such choice was possible since S-PLUS DR1 is included in S-PLUS DR3.It is important to note, though, that since the reduction pipeline has been improved between the two data releases, new stamps were created using the novel images, to ensure the homogeneity of the two data sets (I and II).Another relevant difference between the data from DR1 and DR3 is the new photometric calibration applied for the S-PLUS DR3.This calibration consists of fitting synthetic stellar templates to well-known data  from other surveys, deriving precise zero-points and magnitudes that were tested on 170 STRIPE82 fields (see Almeida-Fernandes et al. 2022, for a detailed description of the method).We obtained the stamps for each object in the 12 bands from the DR3 data access, for both samples.
In total, there are 4232 objects in training sample I, while set II is composed of 164314 objects.As presented in the top panel of Figure 2, the training sample, i.e. sample I, is approximately complete only up to r petro < 173 .As described in Section 2.1.1 in this work we select objects up to r petro < 18.The implications of this choice in the DL performance are discussed in Section 4. Both the samples I & II show similar distribution of R petro for magnitudes < 17 (bottom panel of Figure 2)

Photometric redshifts
The S-PLUS DR3 photometric redshifts catalogue uses a DL model based on a Bayesian Mixture Density Network architecture.This specific configuration allows single-point estimates while also providing probability distribution functions (PDFs) for each galaxy.This network is trained on 12-band photometry from S-PLUS, cross-matched with the unWISE (Wide-field Infrared Survey Explorer, Lang 2014), GALEX (Galaxy Evolution Explorer, Niemack et al. 2009), and2MASS (The Two Micron All Sky Survey, Skrutskie et al. 2006) catalogs (W1/W2, NUV/FUV, and J/H/K magnitudes, respectively).Spectroscopic redshift targets are compiled from various surveys, including SDSS DR16, 2dFRGS, 2dFLenS, 6dFGS, and others.A total of 262,521 objects are used for training/validation, and an independent test set.
Due to its unique filter system with a set of broad-and narrowband photometry, the current model is capable of providing accurate photometric redshifts, while also maintaining low bias and negligible outlier fraction.In fact, within the magnitude range of interest of the present work, r petro ∈ [14, 18], the median normalized bias stands ∼ −0.0015, the scatter is ∼ 0.015, and the outlier fraction is below 1%.The catalog not only includes single point estimates but also well-calibrated probability distribution functions, enabling users to evaluate the uncertainties associated with each estimate.Further information regarding the methodology and resulting findings can be found in Lima et al. (2022) 4 .Figure 3 shows the distribution of the photometric redshift for samples I and II.Specifically, II is divided into the whole sample, with r petro < 18 and a sub-sample with r petro < 17, sharing the same magnitude limit as the training sample.

Training, Validation and Test sample
We split the cross-match data between S-PLUS DR3 and Galaxy Zoo I STRIPE82, i.e., Dataset I, into Training-Validation-Test sets.Dataset I contains unbiased classification only (Lintott et al. 2008;Bamford et al. 2009;Lintott et al. 2010).The data presents an 80 percent threshold on the probability of being a galaxy as true labels distributed in 29 percent of early-type galaxies (ETG) and 71 percent of late-type galaxies (LTG).This distribution reflects the proportion between the two classes, in the local Universe (0 < z < 0.2) as reported by (Lintott et al. 2010).
We split the DR3-Training dataset in 7 folds.These folds are subsamples of the training set used to perform a cross-validation procedure (Moreno-Torres et al. 2012).We have evaluated other choices for a number of folds.However, with more folds the validation set is smaller, the validation loss starts to be more unstable, and we found a good trade-off with 7 folds.Thus, as shown in figure 4, we define 7 different training and validations sets, each containing ∼ 85% and ∼ 15% of the data, respectively.This separation is made so there is no match between the validation sample for every fold.Additionally, this method guarantees that each object will be used at least once in the test set.We use 599 objects as a test set for performance evaluation, these are not used for training.As in BOM21, the training set based on debiased GZ1 contains 71% of LTG and 29% ETGs, and thus is an imbalanced dataset.Therefore, in order to train the Neural Network to prevent our model of being biased towards the most abundant class, we adopt the same data treatment scheme presented in BOM21, applying weights to each class.For a set of N objects in the training set and if the number of objects in the class α is N α , we define the weights as : where m is the total number of classes.This is a standard procedure in ML field5 .The weights defined in Equation 7 are then applied in the objective or loss function minimized during the training phase.This procedure enables each of the classes to have the same impact on the loss function.

Non reliable Stamps
In the DR1 catalog from BOM21, all the stamps were visually inspected prior to the analysis with the DL algorithm aiming to prevent biases in the classification process caused by spurious objects.This became no longer feasible due to the size of the current and future S-PLUS data releases.Therefore, in this study, in order to generate a more robust catalog, we implemented a new DL model to separate reliable from non-reliable stamps.To this end, we use stamps that were excluded as non-reliable from the DR1 classification as a training sample for this new DL model.This approach is advantageous to avoid spurious classifications such as faint galaxies in the same field of nearby saturated stars whose spikes can affect the accuracy of the magnitude estimation of that galaxy.Given the considerable extent of the dataset used in this study, other undesirable objects might include artifacts and problematic stamps in general.Therefore, it is essential to count with a robust method of distinguishing good images from low-quality images to use as an input for the main ETG/LTG DL model.

Deep Learning Model
Following a strategy similar to that in BOM21, in this work we also made use of EfficientNet algorithms (Tan & Le 2019), which are part of the Convolutional Neural Networks (CNN) family-models well-known for having high performance on visual pattern recognition problems in standard image datasets such as ImageNet (Deng et al. 2009).This kind of Network is based on an initial model similar to a MobileNet (MnasNet; Tan et al. 2019) and can be also scalable by parametrizing the number of layers if needed to gain in performance by making a more complex network while constraining the number of FLoating-point Operations Per Second (FLOPS).Therefore, each parameter choice defining a model and thus defining a family of models.Additionally, this kind of model can also be easily adapted to classify datasets with different resolutions (Bom et al. 2022).In this contribution we made use of similar model based on EfficientNet B2 firstly described in (Tan & Le 2019), with the minor adaptations detailed in BOM21.For a diagram presenting all the layers in this model please refer to figure 5 (b) and (c) in (Bom et al. 2022) paper.Nonetheless, we implemented several innovations compared to the workflow described in BOM21.Firstly, we added a second EfficientNet B2 model to evaluate whether a stamp is reliable for morphological classification.The main goal of this NN is to identify spurious detections, such as crowded stamps where the central galaxy in the stamp is visually indistinguishable, stamps satured by close bright stars, and galaxies that are not completely contained in the stamps.We explore how this non reliable stamp model would be best defined in terms of inputs.After initial tests following Bom21 approach, we used all 12 bands as inputs in contrast to the ETG/LTG model that shown to be best defined in terms of performance and stability of results by using g, r, i bands only.Although this choice is based on empirical results by adopting the same metrics presented in Bom21, the main difference here is likely due to the nature of patterns we are trying to characterize in the Reliable Stamp model.By visually inspecting the stamps, we find that some of the spurious detections presented large variability of shapes in different bands compared to reliable stamps, and thus are likely to be easily distinguishable by using more bands.For a full discussion of the band choice for finding ETG/LTG please refer to BOM21.A relevant difference in respect to the main ETG/LTG model developed for S-PLUS DR1 is that the probability assigned to a galaxy of being spiral or elliptical is no longer complementary, meaning that the sum of such probabilities is not equal to one, opening a space for a lot of interesting findings like the ones discussed in Section 4.3 and the possibility of pointing objects that do not fill in any category.This was implemented by changing the neural network activation function in the last layer from a softmax to a sigmoid.In figure 5 we present a scheme of both DL models, detailing the input bands and also presenting an example of a given stamp flowing towards some of the network convolutional filters.

Training
The training process was performed with a Rectified Adam (RADAM, Liu et al. 2019) optimizer and the loss function is a traditional cross-entropy (Goodfellow et al. 2016).In Figure 6 we show the Loss and Accuracy achieved in the training procedure considering all 7 folds.The darkest line in the center corresponds to the mean value of those quantities for each epoch and the shaded area corresponds to the standard deviation between folds.In the top of Figure 6 we present the results for ETG/LTG model using 3 broad-bands as input, similar to BOM21.The training converges fast, around the third-fifth epoch with high accuracy ∼ 0.9.The additional degree of freedom added compared to BOM21, i.e., the probability of being LTG or ETG set to be independent, does not seem to affect the performance significantly.Considering the errorbars, we did not find significant overfitting over the entire range.However, towards the end of the training, around the 15th epoch the figure suggests the beginning of slight overfitting.Furthermore, by evaluating the loss function, the reliable/non reliable model, that uses the 12 band set as the input, presents a more unstable behavior: the convergence is slower, around the epoch 15.The validation presents some spikes that might be related to a regularization method present in the network.We also notice a tendency of overfitting from epoch ∼ 19 onwards.The validation accuracy does not reach 0.9 consistently.However, it is worth noticing that, differently from the 12 band model ETG/LTG presented in BOM21, the 12 band model for reliable/non reliable stamps has significant smaller errorbars suggesting that the model is robust, although the overall performance compared to ETG/LTG model as a classifier is expected to be lower.

Performance
As outlined in the previous section, the cross-validation approach establishes a unique network configuration for each fold.Therefore, we may assess our model's performance on every individual fold.For both ETG/LTG or Reliable Stamp Model classification, we applied these individual folds to the test subsample.

ETG/LTG Model
We evaluate the performance of our model by evaluating the tradeoff of a precision x recall.For a given threshold t that defines which is our ETG if the predicted probability is higher than the t, precision or purity measures how many correct predictions were made out of all positive predictions, and recall or completeness presents how many true positives were found among all the actual positives.In the bottom of Figure 7 we present the median precision-recall for t in the range [0, 1[ for all folds and its respective standard deviation.Later, we define the best theshold t B as the t in the precision-recall curve closest to the the point (1,1) which would represent a perfect classifiers, i.e. with both purity and completeness equal to 1.This threshold t B is set to ∼ 0.60.To understand the performance outcome with this choice we made use of a confusion matrix at the bottom of Figure 7.This performance assessment shows the number of correct and incorrect predictions, grouped by each class and therefore presents model performance in a classification task by revealing where it gets confused and makes mistakes.The model demonstrates correct classifications with over ∼ 94% of both ETG and LTG classifications.It is worth mentioning that for this specific performance assessment, we had to assign each galaxy to one category unambiguously.Hence, for this specific analysis we did not take advantage of the fact that the model assign independent probabilities of ETG/LTG.In Figure 8 top we present the probability distribution of the DR3-Blind set.We notice that the distribution for ETG and LTG classification are well separable with a strong peak around ∼ 0 and ∼ 1.0 as one should expect to a two-class classification.
We present in Figure 9 a comparison of the distribution of the photometric redshifts (see Section 2.1.3) of early (orange/red) and late (cyan/blue) type galaxies for the DR3-Blind/DR3-Training sample, respectively.It is noticeable that, against expectations, the number of early type galaxies seems to be larger at higher redshifts than the number of late type galaxies, both for the training and blind data-sets.In fact, Buitrago et al. (2013) does not finds any strong evolution between the fraction or density of spheroid and disk galaxies for M * > 11 M ⊙ between 0 < z < 0.2.We visually inspected galaxies classified as early type at z > 0.15 to verify whether the classification is affected by the lack of resolution of the spiral arms.We conclude that the classification is overall correct (see Sections 5.1 where we compare with the morphological classification performed by Cheng et al. (2020) and Vega-Ferrero et al. ( 2021)) and that the lack of spiral galaxies at high redshift is related to the pre-selection of the stamps since high z spirals tend to have low surface brightness.The training sample used in this work is taken from The Galaxy Zoo project (Lintott et al. 2008;Bamford et al. 2009;Lintott et al. 2010), which provides a debiased morphological classification Bamford et al. (2009) for galaxies in a redshift range between z ≥ 0.03 and z < 0.88, where the lower limit is dictated by the incompleteness at low redshift, while the higher redshift is caused by the loss of objects fainter than M r < −20.25.

Reliable Stamp Classification
We used the same analysis scheme to analyze the Reliable Stamp model.The bottom part of Figure 8 presents the Reliable stamp probability distribution.By comparing the probability distribution of both models we noticed that the reliable model presents wider peaks, which suggests the distribution is not as well separated as in the ETG/LTG model.This conclusion is also indicated by the loss optimization as discussed in Section 3.3.
In figure 10 we show the confusion matrix for the best fold and the precision vs recall plot considering all folds.The overall shape in the precision x recall curve is similar to the ETG/LTG model, however, the total area under the curve of the Reliable stamp model is smaller compared to the ETG/LTG model.The confusion matrix presents ∼ 90% true positives, which is also interesting since there is a vast variability of what is a non reliable stamp.Additionally, by making a visual assessment over the objects classified as non reliable we can find some interesting objects that we believe are worth investigating.We discuss this with more detail in section 4.4.

Early-Type and Late-Type Galaxies
Galaxies present a wide range of morphologies (e.g., Buta 2011;van den Bergh 1998), from almost spherical ellipticals to grand design spiral galaxies (Grosbøl & Dottori 2012), with the increasing importance of the disk component along the Hubble sequence.At the vertex of the Hubble tuning fork, lie the lenticular galax-ies, which present bulge and disk components as spiral galaxies, but lack spiral arms and relevant star-forming regions.Moreover, the gallery of galaxy types also encompasses irregular galaxies.Elliptical and lenticular galaxies are classified as 'early-type', while spirals and irregulars are called 'late-type' galaxies (here ETG and LTG, respectively).
In a binary classification (early or late-type galaxies), though, we are forcing the galaxies into one of two classes, while the classification could be more gradual, reflecting the complexity of galaxy shapes, such as when using the Numerical Hubble types.To account for this, the network architecture in this work was slightly changed when compared to the one used in BOM21, in order to make the probabilities of ETG or LTG not complementary, i.e. not necessarily summing to one.In fact, these probabilities are generated independently in a way that a galaxy can have a high probability (higher than the DL threshold, see Figure 8) of being both ETG and LTG.Galaxies that have a high probability of being both ETG and LTG are designated here as Amb1.This brings an interesting ambiguity to the model that can be explored to make the classifica- tion more gradual: a galaxy now can be classified as neither ETG nor LTG, and will be ascribed to class Amb0.
In our results, as shown in Figure 11, we can see that most of the galaxies that had a low probability of being a ETG or LTG (Amb0) were also classified as non reliable stamps, while those with higher probability of being either ETG or LTG (Amb1) were also classified as reliable.We note here that the galaxies with high probability of being non reliable stamps and with a low probability of being ETG or LTG, are the highest in number (1107), while the majority of galaxies that have high probability of being ETG or LTG (160) are classified as reliable stamps.
Figure 12 shows examples of reliable stamps, as defined using the 12 S-PLUS images, see Section 3.2, of galaxies belonging to the four different classes (ETG, LTG, Amb 0 , Amb 1 ), from S-PLUS and Legacy surveys.The Legacy data are typically four magnitudes deeper than S-PLUS images and reveal faint outer features, so they can be used to understand the effects of depth and resolution in the ability of the DL method classify objects.In general, galaxies falling in the ETG class are ellipticals (left column, top and middle rows) or lenticulars (left column, bottom row).The LTG objects are either spiral or irregular galaxies (second column, first and middle rows), while the third row shows a disk-dominated lenticular galaxy.In Section 5.1 we compare the classification presented in this work with other works.Galaxies are classified as Amb0 or Amb1 as the result of a combination of factors: (i) faint/high redshift spiral galaxies can be misclassified as early-type galaxies, due to the pixel resolution and survey depth, which reflects in the difficulty of identifying the presence of spiral arms.In turn, they might present green dots of star formation, rendering them neither ETG nor LTG (see third column, middle panel of Figure 12); (ii) clumpy star-forming galaxies could also be assigned to neither class, due to their un-smooth appearance and the absence of (iii) bulge-dominated spirals (see last column, top and middle images), due to the low surface brightness of their spiral arms, clearly visible in the Legacy data, but close to the image noise in S-PLUS data, may have a high probability of being both ETG and LTG galaxies.
(iv) lenticular galaxies can also be found in the Amb 1 class, in particular lenticular galaxies with B/T ≃ 0.5 are associated to both classes, due to their hybrid nature.These results will be further discussed in Section 5.3.
In the next section we show that some of the non-reliable stamps (NRS) are actually extraordinary objects.

Extraordinary Non Reliable Stamps (NRS)
Figure 14 shows some example of objects identified as NRS.Generally, they are objects nearby saturated stars or crowded fields.In fact, even if we select the sample of objects to be analyzed maximizing the probability of being galaxies, see Section 2.1.1,contaminants still appear in the sample and the deep learning code makes a great job in identifying spurious objects.The number of NRS is nearly constant with redshift, as shown in Figure 13, while the number of Reliable stamps decreases with increasing redshift.
On the other hand, peculiar galaxies, especially if with clumpy star formation, or galaxies with a projected size larger than the stamp might fall in the category of NRS, as shown in Figure 15.Somehow, the deep learning method not only allows us to identify unwanted objects, but it also helps in finding peculiar objects, of high interest/relevance.Bournaud et al. (2005).Many of these processes are environmentdependent, i.e., they can occur only in clusters of galaxies (strangulation), or they are more likely in the field or groups (e.g., mergers).
In general, it is now believed that minor mergers are more common than major mergers and that they are the main responsible for mass build-up in galaxies (Bournaud et al. 2007).Different evolutionary scenarios leave specific imprints on the galaxy morphology; i.e. major mergers tend to disrupt the stellar orbits, resulting in pressure dominated systems, characterized by an elliptical shape.On the other hand, secular processes, or environmentally driven mechanisms, as ram-pressure stripping, affect more the gaseous component, chasing the star formation.Moreover, a morphology-density relation had been proven in the last decades (Dressler et al. 1997;Dressler 1980;Cappellari et al. 2011;Buitrago et al. 2013), where ETG inhabit the densest regions of the Universe, while spiral and irregular galaxies are more common in the fields.Galaxy morphologies are a powerful proof of galaxy evolution as well as structure formation, as we will discuss in the next subsections.In here we use only objects classified as reliable stamps with photo z odds > 0.4 and r < 17 mag.The magnitude have been corrected for galactic extinction using the Clayton, Cardelli and Mathis (Cardelli et al. 1989) dust law.

Correlation between morphology and colors
Figure 16 shows the color-magnitude diagram (g-r colour vs r-band absolute magnitude), color coded according to the galaxies' morphologies.The left panel presents the dual classification, where elliptical galaxies are shown in orange and spiral galaxies, in light- blue, while in the right panel the colour scale shows the probability of being a spiral galaxy.It can be seen that elliptical (quiescent) galaxies inhabit the red sequence while spiral (star-forming) galaxies are mostly found in the 'blue cloud' as expected according to their dominant stellar populations (see, for example, Wong et al. 2012;Lima-Dias et al. 2021;Khanday et al. 2022).Interestingly, in the right panels it is possible to see that the probability of being spiral increases nearly from 0 to 1, going from the red cloud to the blue sequence, in a continuous manner.The intermediate region, where the probabilities range around 0.5, is known as Green Valley (see, for example, Zibetti et al. 2007) and it has been largely studied as a region of transition, where late-type galaxies could be quenching .Normalized fraction of galaxies that belong to class Amb0 (left), i.e. galaxies that have a low probability of being ETG or LTG, and of galaxies belonging to the class Amb1 (right), i.e. galaxies with a high probability of being ETG and LTG, classified as no-reliable stamps (blue) and reliable stamps (orange).
their star formation, turning into late-type galaxies, or early-type galaxies could be 'rejuvenating', due to some interaction with other galaxies or accretion of gas (Smethurst et al. 2015).The morphology seems to be reflecting this transformation since the quenching is 'removing' the spiral arms, decreasing the probability of being a spiral galaxy.On the other side, a sparkle of star formation in an early-type galaxy could create clumps, or star-forming regions, that would increase the probability of being a spiral galaxy.

Morphology-density relation
There is a connection between the environment a galaxy live in and its morphology (Dressler 1980), but both the galaxy stellar population and environment evolve with time.While the galaxy stellar population is related to the galaxy mass (more massive galaxies are more metal rich at a given time, Leaman et al. (2013) and gas content, the morphology is more related to the environment (spiral galaxies tend to live in low density environment, ellipticals in the center of galaxy clusters).Yet, a merger, whose probability is dictated by the environment a galaxy lives in, would affect both the galaxy mass and stellar population.Note that 20% of high mass (M * ≥ 10 9.5 M ⊙ ) galaxies have experienced a major merger since z ≃ 6 (Ventou et al. 2017) and minor mergers, accretions, fly-bys are very common in the history of the Universe.We use a K-Nearest Neighbor method, with k = 4, 5, 10 ( Baldry et al. 2010), to recover the projected density of the environment a galaxy live in, where k = 4, 5 refers to local environments, while k = 10 is related to larger scales.Specifically, the density (Σ k ) at any given k is: where k is the k nearest neighbour, D is the comoving distance and ψ(D) is a selection function to correct for the Malmquist bias (e.g.Santana-Silva et al. 2020).Figure 17 presents the number density of late (Prob latetype > 0.9) and early type (Prob earlytype > 0.9) galaxies In the first two panels we show some examples of stamps that were classified as Early-Type (first panel) or Late-Type (second panel).In the last two panels we have examples of stamps that would fall in the Ambiguous classification.Amb 0 are those stamps that had a low probability of being Early-Type and also Late-Type galaxies according to the defined threshold (≃ 0.6).In the other hand, we have Amb 1 which are those objects that the model gave a high probability of belonging to both classes.Each panel is made with the same objects taken respectively from S-PLUS and LEGACY survey.for increasing k = 4 density measures.The left panel of Figure 17, presents all galaxies with magnitude r ≤ 17, while the right panel split them into magnitude bins (represented by different line shapes, see Figure legend).Early-type galaxies are identified by orange/red lines, while late-type galaxies are shown as cyan/blue lines.The morphological classification provided in this work clearly reflects the morphology density relation, with early-type galaxies occupying the densest regions, and late-type galaxies being the dominant population in the field/low-density regions, see left panel in Figure 17.When looking at the magnitude dependence of the morphologydensity relation, we see that it holds for different magnitudes bins, where the number density of early-type galaxies increases with increasing densities, while the opposite trend is found for late-type galaxies.Finally, we observe that the crossover density is lower for more luminous objects, indicating a correlation between lower densities and higher luminosities.

Large scale structure as traced by galaxy morphology
Galaxies trace the large-scale structure of the Universe, yet they account only for ≃ 20% of the total matter (e.g.Planck Collaboration et al. 2020), and their physics is affected by non-gravitational mechanisms such as baryonic effects, radiation pressure, feedback, etc.A simple but powerful tool that can bridge the gap between galaxies and the DM distribution is the Halo Model (Cooray & Sheth 2002).One of the consequences of that description is that galaxy abundances and their properties (such as stellar mass, color, morphology and star formation rate) can be traced back to the DM halos and sub-halos, as well as their properties (such as mass, age, concentration and spin) Wechsler & Tinker (2018).From a large-scale structure perspective, the correlation function of the DM halos is related to the correlation function of the DM particles by the halo abundance, bias, and halo density profile.To a good approximation, more massive halos are less abundant and are more highly biased with respect to the DM field, but other halo properties such as concentration, age, and even spin (angular momentum) also play an important role (Montero-Dorta et al. 2020).Galaxies that populate halos and their sub-halos inherit those properties, including their bias -but they can also bring additional information that is not manifested in the halo properties, and which are indicative of the baryonic mechanisms such as ram-pressure stripping.Galaxy morphology is one of the additional indicators that can help distinguish between different types of halos and their environments, leading to a more accurate and precise description of the correlation functions of those tracers.
Figure 18 shows the redshift distribution, up to z ≃ 0.08 (Bamford et al. 2009) for galaxies colour coded according to their probability of being late type, in order to characterize how morphologies evolve over time.Early type galaxies, plotted with larger symbles, are generally more clustered.The presence of galaxy clusters is emphasized by the Finger of Gods effect, caused by the peculiar velocities of galaxies that deviate from the Hubble flow.2021) used DES galaxies with reliable morphological classification to assess whether CNNs are able to detect features that human eyes do not.To do that, they simulate the appearance that well morphologically classified DES galaxies would display at high redshifts, making them fainter and smaller.They find that, despite some of the features that distinguish ETGs from LTGs vanish after the simulation, the models are still able to correctly classify galaxies with an accuracy greater than 97%.The main conclusion of that work is that it is possible to correctly classify galaxies from faint and small size images using CNNs models, satisfying the following conditions: final apparent magnitude below m r (z) < 22.5, and the size of the final image larger than 32×32 pixels.DES data (DES DR1, Abbott et al. ( 2018)) has a median co-added catalog depth of m r = 24.08 at signal-to-noise ratio S/N = 10, with a pixel size of 0.2636 In comparison, S-PLUS has a scale of 0.55 "/pixel and a depth in r-band of m r = 19.6 at signal-to-noise ratio S/N = 10 (Almeida-Fernandes et al. 2022), resulting in lower resolution when compared with DES data, as clear from Figure 12.
S-PLUS DR3 and DES DR1 overlap, see Figure 1, resulting in a combined catalogue from Vega-Ferrero et al. (2021) and this work of 36183 galaxies, brighter than m r < 18.0 and with a mean redshift of z ml = 0.11847.Comparing the classification presented in this work, considering the depth of the DES images, allows us to investigate the goodness of the classification and the advantages of combining the results of the two DL codes, i.e. studying the reliable early and late-type classification.In Figure 19, top panel, we present a histogram of the probability of being late-type galaxies obtained in this work, for galaxies classified as 'robust spirals' (FLAG LTG == 5) in Vega-Ferrero et al. (2021).The dashed line indicates the threshold used in this work, in other words, every galaxy that stands in the right side of this line is classified as a spiral in both works.The blue histogram shows the distribution of the probability of being a LTG for all 'robust spiral' galaxies and presents the larger discrepancy with Vega-Ferrero et al. (2021).The Orange histogram shows the probability of being LTG for all 'robust spiral' stamps classified as reliable according to the second DL model, see Section 3.2.The green and red histograms represent all 'robust spiral' galaxies brighter than r < 17 mag, and among them all the ones classified as reliable stamps, respectively.The middle panel shows the same comparison for early-type galaxies.There is a non negligible fraction of galaxies with zero probability of being early-type galaxies in this work, but classified as elliptical in Vega-Ferrero et al. (2021).In the bottom panel, we reproduce the same plot, now including only objects with b/a > 0.7.This choice drastically decreases the number of discrepant classifications.Similar results are obtained when performing the same comparison with Cheng et al. (2023).
In Figure 20 we present the fraction of misclassified objects for different magnitudes bins, and in Figures available in the appendix6 it is possible to find examples of objects classified differently in the two papers.It is noticeable that in many cases of galaxies classified as early types in this work and late types in Vega-Ferrero et al. (2021), they are multiple object images, Low Surface Brightness, bulge dominated spiral galaxies, or faint/compact spiral galaxies, see Section 4.3.On the other hand, objects classified as late types in S-PLUS and early types in Vega-Ferrero et al. (2021) are often disk dominated (edge-on) lenticular galaxies or merger/disturbed systems.
In conclusion, the classification presented in this work is in agreement with Vega-Ferrero et al. (2021) with an average confidence level of ≃ 92% up to r < 18, for ETG and ≃ 96%, for LTG, up to r < 17.The mismatch for ETG increases to 20% for objects fainter than r ≃ 17 as a result of the fading of the spiral arms in the S-PLUS images.On the other hand, the mismatch for LTG is mostly caused by the association of disk-dominated lenticular galaxies or edge-on red spirals (Sodré et al. 2013) to this class in this work, while there is a perfect agreement between the two classifications when considering only objects with q = B/A > 0.7 and r < 14.5, see blue line in Figure 20 and in the histogram presented in the appendix A. Implications from these results are further discusses in Section 5.3.Moreover, a visual inspection of the differently classified objects, see the panel figures in appendix A, reveals interesting objects resulting from a different structure of the DL codes and image depth and resolution, highlighting the importance of a diverse, open and collaborative scientific environment.

Combining Morphology and precise photometric
redshifts with narrow band surveys: where do galaxies live?
The relation between galaxies' morphology, their mass and stellar population properties, and the environment they live in has been studied in great details and in a wealth of works (Paulino-Afonso et al. 2019;Coccato et al. 2020), as well as its redshift evolution (González Delgado et al. 2015).Recent works show that the bulge growth, measured as bulge over total light ratio, is directly connected with the quenching of the star formation (Paulino-Afonso et al. 2019;Dimauro et al. 2022;Werner et al. 2022).Group preprocessing is also found to play an important role in galaxies' star formation quenching and morphological evolution (González Delgado et al. 2022;Brambila et al. 2023).S-PLUS photometric system allows to retrieve reliable photometric redshifts with a scatter of 0.023 (Lima et al. 2022), and to recover reliable density estimates (Lopes da Silva et al. in prep.).In Figure 21 we show the (g-r) colour vs k4-density measures for reliable stamps with Prob S piral > 0.9 (blue open dots), with Prob Elliptical > 0.9 (red open dots), and galaxies classified as edgeon by Vega-Ferrero et al. (2021) as filled yellow circles.The galaxy environment is more correlated to its morphology, than its colour, see Figure 17.ETGs have (g − r) > 0.7.The bottom-left panel shows that the majority of late-type galaxies with (g − r) > 0.7 are classified as edge-on in Vega-Ferrero et al. (2021).As shown in Figure 12 disk-dominated lenticular galaxies can be associated to the late-type class, explaining the red colour of the disky-late-type galaxies.Moreover, edge-on star-forming spiral galaxies might suffer reddening, due to the presence of dust clouds surrounding the disk (Bamford et al. 2009;Sodré et al. 2013).
Figure 21 points out that ETG have red colours, (g − r) > 0.7 and are more common in denser environments.If color is a proxy for galaxy stellar population, these findings would suggest that both the quenching of the stellar population and the environment are connected with the early type morphology.On the other hand, latetype galaxy span a range of colour and their number seems to be more connected to the environment they live in, see Figure 17.

S0 galaxies formation scenarios and a physically motivated morphological classification
Lenticular galaxies are characterized by a hybrid morphology, with a bulge and a disk as spiral galaxies, but without spiral arms, as elliptical galaxies.van den Bergh (1990) suggests that the 'S0 classification type comprises a number of physically quite distinct types of objects that exhibit only superficial morphological similarities'.
Recent studies based on observations (Fraser-McKelvie et al. 2018;Coccato et al. 2020) and on simulations (Deeley et al. 2021) showed that this class of objects is, indeed, composed by two or more subgroups, formed via different physical mechanisms that lead to a similar morphology.Specifically, stripped spiral galaxies could be the progenitors of disk-dominated lenticular galaxies, if the gas and arms of the spiral galaxies would be removed by interactions with the cluster environment, or by harassment in a group environment or generally pestering in all environments (Cortesi et al. 2013;Jaffé et al. 2015;Johnston et al. 2021).Another group of lenticular galaxies could be the result of major or minor mergers and multiple accretions (Tapia et al. 2017).Others, low mass S0s, could be pristine galaxies, formed at redshift z ≃ 2 from mergers of the galaxy stellar/gaseous clumps (Saha & Cortesi 2018), or the result of secular evolution (Mishra et al. 2018).
The discrepancy between the probability of being LTG pre-  2021), with B/A ≤ 0.7 and r petro < 17 mag.At a visual inspection they are all consistent with being disk-dominated S0 galaxies (Coccato et al. 2020), or edge-one reddened spiral galaxies (Bamford et al. 2009;Sodré et al. 2013) and their average colour is (g − r) ≃ 0.85.
On the other hand, as discussed in Section 4.3, a fraction of galaxies classified as early-type galaxies in this work is comprised by bulge dominated lenticular galaxies.
The multiple origin of the S0-like isophotal profile seems to be depicted by the DL algorithm used in this work.This topic will be further studied in a folow-up work, where the DL classification will be correlated with galaxies' bulge-to-total light profiles.

Summary
In this study, we employ a Deep Learning architecture among the top-ranking techniques for image classification of ETG/LTG while also introducing a model to predict the stamps that contain reliable information to be classified.Our method presented several innovations compared to the Bom21 model, including the possibility of objects that are not classified either as ETG or LTG.
Furthermore, we also make use of the precise photometric redshifts derived with 12 bands present in the S-PLUS.We recover the color diagrams for the morphological types and examine the local environment and density of ETG/LTG.Additionally, we assess large-scale structure traced by morphology.As a result, we provide a novel Value Added Catalogue (VAC) of galaxy morphologies, in the full footprint of S-PLUS DR3 which includes areas never explored for other galaxy morphology catalogues.The catalogue is composed by the results of two DL methods, which, for every stamp, recover the probability of having a given morphology, and of being a reliable stamp, as detailed below.early-type galaxies, with a probability of belonging to a given class higher than 0.9, for increasing density bin.The k4 estimator traces the local densities.The top panel shows the total distribution, while in the middle panel, it is divided in different magnitudes for Late-type galaxies, which are drawn in a scale of blue.In the bottom panel early-type galaxies are colored in orange.For easier comparison, lines of equal magnitude have the same style.
Figure 18.Redshift distribution up to z = 0.08 for galaxies colour coded according to their probability of being late-type galaxies galaxies.Galaxies with dual classification as early-types are drawn as larger circles, for a better vision.

A novel Valued Added morphology classification catalogue
for the southern hemisphere In order to mediate between the variety of galaxies morphologies and the binary classification applied in this work, we allow for an independent classification into early and late-type galaxies, i.e. the sum of the probability of belonging to each class does not sum up to one, see Section 4.2.1.As a consequence of this choice, some objects can be either classified to belong to both groups (using the binary classification) nor to any, see Section 4.3.The study of these two peculiar types of objects allows us to identify bulge dominated lenticular or spiral galaxies (Amb 1 ), as well as compact, flocculent, star-forming galaxies, see Figure 12.Finally, this catalogue of galaxy morphologies covers areas of the Southern Sky for which there is no release of morphological catalogues, for our knowledge, see Figure 1.

A novel parameter to assign a probability of being a reliable stamp
An interesting correlation is found when comparing the number of galaxies with low probability of being LTG or ETG (Amb 0 ), with the probability of being a reliable stamp, see Section 3.2.In fact, the majority of objects with no bin classification as early nor late-type galaxies (see previous Section 5.4.1) have a low probability of being reliable stamps, see Figure 11.

DATA AVAILABILITY
We publicly release our Value Added Catalogue (VAC) in the S-PLUS data base (splus.cloud).than 0.6001742 the column ProbLTG_bin will be equal to 1 and so on.With the binary probability we made the column Classification that separates the objects into the classes LTG, ETG, AMB1 and AMB0 discussed through this work.See table B1 for more details concerning the selections made in the probabilities for the classification.It's worth mentioning that the Classification column is made only using the LTG/ETG binary probabilities, so it has reliable and not reliable stamps in it.If only the reliable stamps are desired they can be easily selected using the ProbRel_bin column.MNRAS 000, 000-000 (0000)

Figure 1 .
Figure 1.S-PLUS DR3 footprint (used in this work) and the footprint of some recent galaxies morphology catalogues available in the literature.

Figure 2 .
Figure 2. Distribution of the r-petrosian magnitudes (r petro ) for the whole sample, i.e. up to magnitude r petro ≤ 18 (top) and a normalised histogram of the magnitude distribution of I (Training/Validation set) and II (Blind set) up to r petro ≤ 17 bottom, i.e. the limiting magnitude of I -the training sample.

Figure 3 .
Figure 3. Distribution of the Photometric Redshift for the training and blind sample.On top of the distribution only for the blind sample up to r petro < 18.On the bottom is the normalized distribution for both blind and training samples up to r petro < 17 .

Figure 4 .
Figure 4.In this figure we show the cross validation k-fold method applied to the training of the LTG / ETG model.Each fold is separated into training, validation and test.That process is made in a way that there is no match between each validation.Additionally, the training for each fold is slightly different, which reduces a possible bias concerning the selection of the objects that composes it.Considering that the technique will define an architecture with certain weights for each fold, the metrics in each training stage can be used to evaluate which fold has the best training set configuration.The numbers at the bottom indicate the size of the training, validation, and test sets in each fold.

Figure 5 .
Figure5.Workflow from the stamps taken from S-PLUS data while they passes through the model.Both architectures works in the same way, with the difference that the first one uses only the G, R and I bands available in S-PLUS as the network input.The LTG/ETG Model as well as the Reliable Stamp Model consists of some convolutional layers in the beginning responsible to compact and recognize patterns in the stamp, then, in the end, all that information passes through a dense layer that compacts it into a list containing 1408 keys represented by the bar code in the figure.Both models works with binary classification, then one more dense layer is needed to calculate the probability of each classification given by a sigmoid activation function.

Figure 6 .
Figure 6.Accuracy and Loss in the training of the Late/Early-type (Top) model and Reliable Stamp model (bottom) as a function of epoch considering all folds.In blue we present these metrics for the training set and in orange the metrics for the validation set.The line in the middle represents the mean value between all 7 folds used in the cross validation k-fold method.

Figure 7 .
Figure 7. Performance in the DR3-Test sample for the ETG/LTG model.(Top) The Precision x Recall considering all folds.The purple line was made with the median value for every fold.(Bottom) The confusion matrix for the best fold.

Figure 8 .
Figure 8. Probability distributions for the classification of the blind set.On top of the distribution for the Late-type and Early-type classification.On the bottom the distribution of being a reliable stamp.In both cases, the dashed line represents the threshold used for the classification itself.

Figure 9 .
Figure9.r-band apparent magnitude distribution for different Photometric Redshift bind distribution f blind sample (filled line), and for the training sample (dashed line), for Elliptical (yellow/red) and Spiral (blue/cyan) galaxies.Note that in the first magnitude bin the training sample is not present (z <≤ 0.02), since we used Galaxy Zoo data for the training, which are missing in this low mag bin(Lintott et al. 2008(Lintott et al. , 2010;;Bamford et al. 2009)

Figure 10 .
Figure 10.Performance in the DR3-R-Test concerning the Reliable/Non Reliable model.(Top) the Precision x Recall plot considering all folds.The purple line was made with the mean value for every fold.(Bottom) The confusion matrix for the best fold.

Figure 11
Figure11.Normalized fraction of galaxies that belong to class Amb0 (left), i.e. galaxies that have a low probability of being ETG or LTG, and of galaxies belonging to the class Amb1 (right), i.e. galaxies with a high probability of being ETG and LTG, classified as no-reliable stamps (blue) and reliable stamps (orange).

Figure
Figure12.In the first two panels we show some examples of stamps that were classified as Early-Type (first panel) or Late-Type (second panel).In the last two panels we have examples of stamps that would fall in the Ambiguous classification.Amb 0 are those stamps that had a low probability of being Early-Type and also Late-Type galaxies according to the defined threshold (≃ 0.6).In the other hand, we have Amb 1 which are those objects that the model gave a high probability of belonging to both classes.Each panel is made with the same objects taken respectively from S-PLUS and LEGACY survey.

Figure 13 .
Figure 13.Number of NotReliable and Reliable stamps in increasing redshift bins.

Figure 14 .
Figure14.Example of not reliable stamps, from S-PLUS data (top) and LEGACY data (bottom).In the last column, it is visible an artifact, the third column present a crowded field, in the second column we find a saturated star compromising the galaxy image, and, finally, in the first column and irregular galaxy.
to other surveys Vega-Ferrero et al. (

Figure 15 .
Figure15.Example of extraordinary not reliable stamps.Large objects, whose projected radius is larger than the image stamp; star-forming galaxies, where more than one clump can be identified as an independent object during the catalogue extraction (Almeida-Fernandes et al. 2022); irregular galaxies as NGC 4038/NGC 4039; and dense regions of stars, maybe galactic clusters, can be found among the not reliable stamps.The probability of being a reliable stamp is given in the top left of each panel.

Figure 16 .
Figure 16.Colour-magnitude diagram.(g-r) colour versus the absolute magnitude in r-band, calculated using standard cosmological parameters and the luminosity distance (D L ) estimated from the photometric redshift.The left panel shows the bin classification, while the right panel, is colour coded according to the probability of being a late-type galaxy.
dicted in this work and inVega-Ferrero et al. (2021)  decreases when only objects with B/A > 0.7 are considered, see Figure19.Moreover, there is an extended population of late-type galaxies with red colors and high probability of being edge-on systems (Vega-Ferrero et al. 2021), see Figure21.Specifically, there are 126 objects classified as spiral galaxies in this work and as robust ellipticals inVega-Ferrero et al. (

Figure 17 .
Figure17.Morphology-density relation.Normalized fraction of late and early-type galaxies, with a probability of belonging to a given class higher than 0.9, for increasing density bin.The k4 estimator traces the local densities.The top panel shows the total distribution, while in the middle panel, it is divided in different magnitudes for Late-type galaxies, which are drawn in a scale of blue.In the bottom panel early-type galaxies are colored in orange.For easier comparison, lines of equal magnitude have the same style.
Figure 19 reveals that selecting only reliable stamps decreases the discrepancy with Vega-Ferrero et al. (2021) classification into ETG and LTG, especially for faint objects (m r > 17).Moreover, as shown in Figure15, among the non reliable stamps, there are extraordinary objects, as the Antenna Galaxy, which will be identified and studied in a follow-up work.

Figure 19 .
Figure 19.In this figure we present a histogram showing the proportion of galaxies that were classified in accordance with our classification.The top panel represents the galaxies classified as roubust LTG by DES and the middle one represents those classified as roubust ETG by DES.The bottom panel is like the middle one, but for robust ETG with b/a > 0.7, see text.The histograms were made using the probability of belonging to the corresponding classes obtained in this work, with the dashed line being the threshold used in our classification, in other words, every galaxy that stands in the right side of this line was classified equally by both works.

Figure 20 .
Figure 20.Fraction of objects with different classification between this work and Vega-Ferrero et al. (2021) for different magnitudes bin.Galaxies classified as late types in this work and as early types in VF21 are shown by the cyan line, while the blue line present the same selection but excluding edge-on objects, i.e. by imposing that the axis ratio q = b/a > 0.7.In orange is shown the behavior of objects classifies as early-type galaxies in this work and as spiral in VG21.The grey line shows the global mismatch (the sum of the cyan and orange line), which indicate that the discrepancy in the classification in the two works increases with decreasing magnitude, as expected given the lower resolution and depth of S-PLUS in comparison with DES.We note than the total number of galaxies that are classified as 'robust' inVega-Ferrero et al. (2021)  and as reliable stamps in this work decreases after r = 17, causing the improvement of the match at r = 18.

Figure A2 .
Figure A2.Examples of images from Legacy Survey of galaxies classified as early types in this work and as late types in Vega-Ferrero et al. (2021).

Figure A3 .
Figure A3.Examples of images of galaxies from Legacy Survey classified as late types in this work and as early types in Vega-Ferrero et al. (2021).

Table 1 .
Sample Description of the samples used in this work.

Table B1 .
Selections in the probabilities for the classification ProbNRel_bin binary probability of being a Not Reliable stamp given in terms of the threshold 1 if ProbNRel > 0.53675460815429 0 if ProbNRel < 0.53675460815429 ProbRel_bin binary probability of being a Reliable stamp given in terms of the threshold 1 if ProbRel > 0.53675460815429 0 if ProbRel < 0.53675460815429 ProbLTG_bin binary probability of being a Late-type galaxy given in terms of the threshold 1 if ProbLTG > 0.60017424821853 0 if ProbLTG < 0.60017424821853 ProbETG_bin binary probability of being an Early-type galaxy given in terms of the threshold 1 if ProbETG > 0.60017424821853 0 if ProbETG < 0.60017424821853 Classification Classification of the objects based on the binary classification for the LTG/ETG model LTG if (ProbLTG_bin = 1) and (ProbETG_bin = 0) ETG if (ProbLTG_bin = 0) and (ProbETG_bin = 1) AMB1 if (ProbLTG_bin = 1) and (ProbETG_bin = 1) AMB0 if (ProbLTG_bin = 0) and (ProbETG_bin = 0)