Red Giants Search Method Based on Convolutional Neural Networks

Red giants play a crucial role in astronomical exploration. However, the current search for these stars heavily relies on spectrum analysis, making it a cumbersome process. In this paper, we propose a novel red giant search approach called CBAMResNets. CBAMResNets enhances feature extraction from images by incorporating the Convolutional Block Attention Module into the ResNets model. To train and validate our model, we utilize accurately labeled stellar image data obtained by combining the Sky Mapper Southern Survey (SMSS) and the Large Sky Area Multi-Object Fiber Spectroscopic Telescope. Our experiments demonstrate that CBAMResNets outperforms other networks such as VGG16 and TPC across most performance metrics and remains competitive with traditional machine-learning methods. Specifically, for stars within the magnitude range of 11–19 in the u band, our model achieves a precision rate of 0.92 and a recall rate of 0.9194. Similarly, for stars within the magnitude range of 11–15 in the u band, the precision rate is 0.92, and the recall rate is 0.9813. Furthermore, we apply CBAMResNets to the SMSS subregion, resulting in the identification of 20,243 potential red giant candidates out of the 304,477 observed stars. We validate the authenticity of these candidates by analyzing their stellar absolute magnitudes and temperatures, estimating a contamination rate of approximately 6.4%. Additionally, we examine the approximate distribution of their metallicity. The catalog containing the identified red giant candidates can be accessed at Zenodo. 4 4 doi:10.5281/zenodo.8352420 doi:10.5281/zenodo.8352420


Introduction
Red giants are frequently employed in astronomical studies due to their wide distribution throughout the Universe.Ongoing and upcoming large-scale photometric surveys, such as LSST and CSST, aim to collect photometric data on hundreds of millions to billions of stars and galaxies.While numerous established automated methods exist to assist astronomers in accurately and efficiently identifying stars from vast amounts of photometric data (e.g., Kim & Brunner 2017;He et al. 2021), the direct identification of red giants using such stellar data remains a significant challenge.As a result, there is a pressing need to explore automated approaches for the automatic detection of red giants in stellar photometric data, thus replacing traditional manual methods.
Numerous extensive sky surveys have been conducted, significantly reshaping our comprehension of the Milky Way.Several of these surveys focused on photometric analysis, including the Sloan Digital Sky Survey (SDSS; York et al. 2000), the Two Micron All Sky Survey (2MASS; Skrutskie et al. 2006), Pan-STARRS1 (PS1; Chambers et al. 2016), and the Sky Mapper Southern Survey (SMSS; Wolf et al. 2018).Additionally, certain surveys specialized in spectroscopic investigations, such as the Sloan Extension for Galactic Understanding and Exploration (SDSS/SEGUE; Yanny et al. 2009), Apache Point Observatory Galactic Evolution Experiment (SDSS/APOGEE; Majewski et al. 2017), Large Sky Area Multi-Object Fiber Spectroscopic Telescope (LAMOST; Wang et al. 2020), and GALactic Archeology with HERMES (GALAH; De Silva et al. 2015).Furthermore, there are surveys dedicated to astrometric research, such as Gaia (Brown et al. 2016).
Many astronomical researchers have dedicated extensive efforts to the search for red giants, utilizing data from various surveys.Spectroscopic data have been utilized by Liu et al. (2014) and Wu et al. (2019), who derived stellar parameters from LAMOST spectra.Similarly, Hasselquist et al. (2019) employed stellar parameters obtained from SDSS/APOGEE spectra in their search for red giants.In terms of photometric data, Dai et al. (2019) relied on stellar parameters from Gaia, while Huang et al. (2019) utilized stellar parameters from the SMSS.These studies have successfully provided a relatively pure sample of red giants, offering an extensive and instructive training data set.However, a significant limitation of these red giant search endeavors lies in the dependence on obtaining stellar parameters through spectroscopic or photometric means.Obtaining spectra is a complex and challenging process, and assessing the selection effects of spectroscopic surveys poses difficulties (Huang et al. 2019).Furthermore, the photometric data acquired from numerous ongoing survey projects often lack sensitivity to the distinctive characteristics of red giants.Consequently, the direct search for red giants solely from photometric data, in a manner that is simple, efficient, complete, and accurate, presents a notable challenge.
The SMSS database greatly aids in solving this puzzle.First, it utilizes a set of uvgriz filters, as proposed by Bessell et al. (2011), which are highly responsive to stellar atmospheric parameters.While the SMSS u band resembles the Strömgen u Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence.Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.band, it is narrower than the SDSS u band.Consequently, it exhibits a unique photometric sensitivity to stellar surface gravity, as highlighted by Huang et al. (2019).This specially designed set of filters enables us to directly extract the necessary features of red giants from photometric images.Furthermore, the extensive SMSS database contains detailed records of over one billion stars, providing a substantial training sample for further investigations.
This paper employs deep-learning methods to address the aforementioned objectives.Deep learning, a subfield of machine learning (LeCun et al. 2015), distinguishes itself by its approach to feature representation.Traditional machine learning necessitates the explicit definition of specific features prior to model training.Conversely, deep learning, powered by neural networks, is capable of learning abstract features directly from the raw data set.Its extensive utilization in computer vision for tasks such as image classification, target detection, and semantic segmentation has demonstrated a significantly superior performance compared to conventional methods.Consequently, deep learning serves as a strong foundation for our forthcoming research endeavors.
In this paper, we propose CBAMResNets, a convolutional neural network, for the detection of red giants in SMSS images.Our approach demonstrates a comparable performance to conventional machine-learning algorithms and well-established classification neural network models.The results highlight the simplicity and efficiency of CBAMResNets in the search for red giants.In Section 2, we provide a comprehensive description of the data selection and preprocessing techniques employed in this study.Section 3 outlines the model architecture used.In Section 4, we provide a concise summary of the training results obtained from multiple models.Finally, in Section 5, we briefly describe how the CBAMResNets model is used at scale to search for red giants in the SMSS data set, and to validate and analyze these red giants.

Data Sources
In this study, we adopted the methodology from the research of Huang et al. (2019) for data selection.To ensure the accuracy and consistency of our data set, we selected from SMSS DR1.1 (Wolf et al. 2018), as previously used by Huang et al. (2019).SMSS is the first state-of-the-art multiband (uvgriz) and wide-field survey of the entire southern sky with a limiting magnitude in the r band of about 22 mag (Huang et al. 2019).It uses a telescope with a 1.35 m primary mirror and a 0.56 m aspheric corrector.At the same time, its focal ratio of f/4.8 and a core of 32 2k × 4k CCD detectors make it an extremely efficient measuring instrument.As of 2021, SMSS has surveyed more than 200,000 images covering 21,000 deg 2 of the sky, cataloged more than 500 million unique astrophysical objects with a limiting magnitude of about 18 mag in all bands, and released data freely accessible and usable by researchers worldwide.
Since the selection of red giants requires atmospheric parameters, and the most reliable way of obtaining atmospheric parameters still relies on spectra, we choose the atmospheric parameters obtained from LAMOST and use the data derived by Xiang et al. (2017) using the LSP3 pipeline from LAMOST DR4 (later called LA_VAC; Xiang et al. 2017).We crossvalidate the searched red giants using atmospheric parameters, stellar radii, etc., from SDSS/APOGEE DR14 (Abolfathi et al. 2018), GALAH DR2 (Buder et al. 2018), andGaia DR2 (Gai 2018;Gaia et al. 2018).
The main reasons why we use LA_VAC data instead of the officially provided atmospheric parameters (such as LAMOST and APOGEE) are as follows: 1.The LA_VAC data cover more stars than the official LAMOST data, which only provide atmospheric parameters for AFGK-type stars and some M dwarfs.2. The LA_VAC and SMSS databases have surveyed hundreds of thousands of stars (see Section 2.2), more than the APOGEE and GALAH databases.3. The LAMOST survey (r ≈ 17-18 mag) is much deeper than the medium-/high-resolution surveys (H = 13.8 mag for the APOGEE survey and V = 14 mag for the GALAH survey).
The samples obtained after crossover are more balanced across atmospheric parameters (Huang et al. 2019).

Data Set Selection
In this section, we use the effective temperature (T eff ) and surface gravity ( g log ) from LA_VAC and the stellar distance from Gaia to distinguish red giants from non-red giants and generate the data set required for training.
First, we cross-match LA_VAC and SMSS DR1.1 with a diameter of one arcsecond to obtain 257,850 stars.To ensure the stability and reliability of the photometric data, we perform the following filtering steps: 1.The Galactic latitude of the star should be |b| 10°to minimize the uncertainty caused by the reddening correction.2. To ensure a sufficiently high level of accuracy in obtaining atmospheric parameters, the signal-to-noise ratio (S/N) of the star is greater than 10 and T eff is below 10,000 K. 3. To obtain high-quality stellar images, the stellar probability value (CLASS_STAR) must exceed the threshold of 0.6 (Huang et al. 2019) and the FLAGS parameter must be set to zero to ensure optimal stellar photometry data.4. The uncertainty of the magnitudes of uvgi bands is less than 0.05 mag, ensuring that the obtained T eff and g log are sufficiently accurate.
After cropping, we continue to cross the data with Gaia DR2.The eligible points (distance 4500 pc) were filtered according to their distances (Bailer-Jones et al. 2018).There were 110,155 stars remaining in our sample, of which 15,334 were red giants (hereafter defined as having T eff 5600 K and g log 3.5) and 94,821 were non-red giants.Since the errors in LA_VAC estimates of g log and T eff (Xiang et al. 2017) result in a small amount of cool dwarf contamination in the red giant sample, according to the method proposed by Huang et al. (2019), we use a filtering program based on absolute magnitudes to isolate the cool dwarfs.To preserve the comprehensiveness of the red giant sample, we select to eliminate stars manifesting an absolute magnitude exceeding 4.This filtration criterion excludes approximately 3.7% of the cold dwarfs.Consequently, our refined sample comprises 14,767 red giants.To verify the generalization ability of the model and avoid expensive computational complexity, we exclude the cross-validation method and directly choose to divide the training sample into a training set, a validation set, and a test set (including 87,671, 10,959, and 10,958 stars, respectively) in the ratio of 8:1:1.
The size of the input image of the convolutional neural network is an important factor that affects the performance of the network (Shi et al. 2022).An overly large image is likely to contain extraneous data, thereby diverting the neural network's focus and complicating the training process.Conversely, an excessively small image may lack critical information, leading to a compromised search accuracy.To choose the most suitable image size, we center on the centroid of the stellar image and increase the length and width of the image by 8 pixels at a time, starting from 32 × 32 pixels, until the final image size is 128 × 128 pixels.We then obtain 12 different sets of sizes of the same image.Comparative experiments were performed on these data to test the accuracy of the validation set separately, and the results obtained are shown in Figure 1.It can be learned that the prediction accuracy increases with image size from 32 × 32 pixels to 72 × 72 pixels but shows a slow decreasing trend after 72 × 72 pixels.Finally, the best classification accuracy can be obtained by experimenting with a 72 × 72 pixels size.Therefore, the image size used in the subsequent experiments is uniformly defined as 72 × 72 pixels, which can obtain the best classification accuracy.
In the SMSS photometric data, the color (g − i) is a valid indicator of T eff , while the color (u − v) is considered sensitive to g log (Bessell et al. 2011), which are the stellar parameters commonly used to identify red giants.Therefore, we first choose the fundamental uvgi bands of photometric data in our training.To verify the effect of rz-band photometry on the search for red giants, we perform four sets of comparison experiments with different bands, namely the uvgi bands, uvgir bands, uvgiz bands, and uvgizr bands.Through our training process, we achieved search accuracy rates of 92.31%, 92.31%, 92.31%, and 92.32% for these four data sets, respectively.The experimental outcomes indicate that expanding the bandwidth has a negligible impact on search accuracy.However, the addition of two extra bands significantly amplifies the computational complexity of the training process.Consequently, we have selected to utilize the uvgi bands for our search operations.

Deep Learning
Deep learning is a special machine-learning algorithm based on neural networks.The performance of a neural network is mainly influenced by its parameters (both the parameters of the network itself and the training parameters) and the structure of the network.This section focuses on some hyperparameters used in the CBAMResNets model and how we can improve the architecture of the ResNets34 model.

ResNets34
The Residual Neural Networks (ResNets; He et al. 2016) was the champion of the ImageNet Large Scale Visual Recognition Challenge in 2015.The team behind ResNets discovered that increasing the depth of the network would result in a sudden and significant drop in accuracy after the accuracy had reached its peak.To address this issue, they introduced the residual network structure, which enabled the network to balance the linear and nonlinear transformations of data and prevent the gradient from vanishing, thus enhancing the information transfer and feature reuse capability.
The residual network structure of ResNets34 mainly consists of a normal residual module with a shortcut connection and a downsampling residual module, which can be seen in Figures 2(a) and (b), respectively.The normal residual module contains two convolutional layers of size 3 × 3, a ReLU activation function, and two Batch Normalization modules.The downsampling residual module adds a 1 × 1 convolution operation to the main structure of the normal residual module to downsample the input data, thereby transforming the dimensionality and number of channels of the input data.
In this paper, we choose to use the ResNets34 network and also experiment with ResNet50 and ResNets101.Although the latter two networks have deeper network hierarchy, they show varying degrees of accuracy degradation.This may be because we do not need such a complex model for training since the stellar images are not complex.

CBAMResNets
The Convolutional Block Attention Module (CBAM; Woo et al. 2018) is an adaptive feature optimization module that deduces the attention graph along two mutually independent dimensions of channel and space, respectively, devoting more attention resources to the important features.It learns the features of the object better and reduces the computational  overhead while increasing the learning ability of the model.The attention mechanism is mainly divided into two modules, the channel attention mechanism and the spatial attention mechanism, the structure of which is shown in Figure 3.The channel attention mechanism focuses on the meaningful content of the input image, while the spatial attention mechanism focuses more on location information.
The CBAM is a lightweight general-purpose module that can be added anywhere in the convolutional neural network at will, and the order of the channel attention mechanism and the spatial attention mechanism is not specified.He et al. (2021) added CBAM at the beginning and end of the model with the channel attention module first and the spatial attention module later, which improved the accuracy of the model for classifying quasars, stars, and galaxies.CBAMResNets embeds CBAM into ResNets34 in the same way.The structure of the network is shown in Figure 4.

VGG16
The VGG16 (Visual Geometry Group 16) is a convolutional neural network model proposed by the Visual Geometry Group at the University of Oxford in 2014 (Simonyan & Zisserman 2014).The architecture consists of 16 weight layers, including 13 convolutional layers followed by 3 fully connected layers.The model gained popularity for its simplicity and effectiveness, setting the benchmark in the ImageNet Large Scale Visual Recognition Challenge the same year it was introduced.The architecture employs small 3 × 3 convolutional filters throughout the network, which are able to capture intricate features effectively.This is in contrast to the use of larger filters in preceding architectures.VGG16 uses ReLU (Rectified Linear Unit) activation functions for introducing nonlinearities and employs max-pooling layers for downsampling.A softmax layer is utilized at the end for class probabilities in classification tasks.
It is noteworthy that the VGG16 architecture has already found utility in the domain of astronomy.Several research studies have successfully employed VGG16-based models for tasks such as spectroscopic redshift determination (Podsztavek et al. 2022) and classifying galaxy morphologies (Zhang et al. 2022), among others.This underpins our choice of using VGG16 for astronomical image classification in the current study.

Probabilistic Classification Tree
To compare the performance differences between the deeplearning model CBAMResNets and the machine-learning algorithm based on standard photometric features, we choose a supervised and parallel machine-learning algorithm called Probabilistic Classification Tree (TPC) based on prediction trees and random forests (Breiman 2017(Breiman , 2001) ) to classify red giants.The specific usage of TPC was described in detail by Carrasco Kind & Brunner (2013).Although there have been many mature machine-learning algorithms based on the random forest method, we still choose TPC because it has been extensively tested in various astronomical applications and has shown excellent performance, such as for photometric redshift calculations (Carrasco Kind & Brunner 2013) and stellar galaxy classifications (Kim & Brunner 2017).Currently, TPC can now utilize parallelism to handle large data sets on distributed memory systems.
We developed a TPC model using SMSS data.As discussed in Section 2.2, we initially chose the magnitude values corresponding to uvgi bands.Meanwhile, since the color (g − i) is a valid indicator of T eff and the color (u − v) is considered sensitive to g log , we choose to use them as the input to the model.Ultimately, we choose six photometric attributes as the input to the model; the magnitude values in the uvgi bands, color (g − i) and color (u − v).

Focal Loss
Focal Loss, introduced by Lin et al. (2017), serves as a refined version of the standard Cross Entropy Loss and aims to tackle the issue of class imbalance in classification tasks.Mathematically, Focal Loss is expressed as: where p t is the predicted probability of the true class, α t is a class-specific scaling factor, and γ is the focusing parameter.
The parameter γ adjusts the rate at which easy-to-classify examples are downweighted; a higher γ focuses more on hardto-classify examples.The α t parameter, by contrast, provides a straightforward method for adjusting the loss contribution from different classes, thus serving as a remedy for class imbalance.Through this mechanism, Focal Loss assigns more weight to examples that are hard to classify, thereby directing the training process to these challenging instances.
In this study, we adopt the methodology outlined in Lin et al. (2017) and adapt it for application to our data set.After a comprehensive performance evaluation on the validation set, we empirically determine that the optimal values for parameters α t and γ are 0.8 and 2, respectively.

Experimental Results
In this section, we first introduce the evaluation metrics to evaluate the performance of the CBAMResNets model (see Appendix B for details), and then show the classification performance on the data set and compare the performance with the currently well-established classification neural network VGG16 and the TPC algorithm mentioned in Section 3. Within the scope of our experimental design, the CBAMResNets and VGG16 models are tailored to accept images as their primary input.By contrast, the TPC model is configured to ingest not only the amplitude values in the uvgi bands, but also the color (g − i) and color (u − v), each corresponding to individual images.
We use the data set mentioned in Section 2.2 to test the performance of the CBAMResNets, TPC, and VGG16.The parameters of the model are trained through the training set and continuously tuned by the effect of the model on the validation set.Then, the well-trained model obtained can be applied to the test set to evaluate the performance of the model.
Table 1 records the results obtained by applying the three models to the test set, and the bold values indicate the best value in each evaluation metric.We can see that the CBAMResNets outperforms TPC and VGG16 in terms of all five metrics, and VGG16 outperforms TPC for AUC, P d (R d = 0.91), and R g (P g = 0.92).This result is not a coincidence; it illustrates that the feature extraction capability of convolutional neural networks is stronger than that of traditional machine learning, and the addition of CBAM makes the feature extraction capability of convolutional neural networks even stronger.
In Figure 5, we compare the differential counts of P d (R d = 0.91) and R g (P g = 0.92) for CBAMResNets, VGG16, and TPC in the g band.Gaussian kernel density estimation is also used, which allows us to derive smooth distribution curves without performing such a complicated operation as overlapping boxes.When the g-band magnitude is about 12, the P d (R d = 0.91) and R g (P g = 0.92) of VGG16 are very close to that of CBAMResNets.However, in general, CBAMResNets still has the best performance, indicating that the addition of CBAM convolutional neural networks are more effective at feature extraction than common convolutional neural networks and traditional machine-learning methods.
Figure 6 shows the integrated counts of P d (R d = 0.91) and R g (P g = 0.92) for CBAMResNets, VGG16, and TPC at the gband magnitude.It can be seen that R g (P g = 0.92) is maintained at 0.9032 for CBAMResNets, while it drops to 0.8741 and 0.7264 for VGG16 and TPC, respectively.In addition, P d (R d = 0.91) is maintained at 0.9596 for CBAMResNets, while it decreases to 0.9544 and 0.9494 for VGG16 and TPC, respectively.Overall, the CBAMResNets model outperforms VGG16 and TPC.
To prove that the above results are band independent, differential counts and integrated counts in the u band are calculated in the same way, as shown in Figures 7 and 8.The trends of P d (R d = 0.91) and R g (P g = 0.92) in Figure 7 are  similar to those in Figure 5, with CBAMResNets performing the best and CBAMResNets and VGG16 outperforming TPC at all times.
Figure 8 shows the integrated counts of P d (R d = 0.91) and R g (P g = 0.92) at the u-band magnitude, which is similar to Figure 6.It can be seen that the R g (P g = 0.92) is maintained at 0.9032 for CBAMResNets, while it drops to 0.8741 and 0.7264    for VGG16 and TPC, respectively.Also, the P d (R d = 0.91) is maintained at 0.9596 for CBAMResNets, while it drops to 0.9544 and 0.9494 for VGG16 and TPC, respectively.
The range of u-band magnitudes in the test set is between 11 and 18.8.We consider a source is dark if its magnitude value exceeds 15; otherwise, it is a bright source.Analyzing the connection between the four panels of Figures 5 and 7, we can find that the detection efficiency of red giants using CBAMRes-Nets is significantly high for bright sources.Therefore, we extract the stars with u 15 in the test set to obtain 3,247 bright sources.Searching for red giants on these bright sources with CBAM-ResNets, we obtain P d (R d = 0.91) = 0.9981 and R g (P g = 0.92) = 0.9813, which indicates that searching for red giants with CBAMResNets is very efficient on bright sources.

Search for Red Giants
In this section, we use the trained CBAMResNets model to construct a large sample of red giants and catalog the searched red giants.

Processing of SMSS Large Data Sample
The efficiency of the CBAMResNets model to identify red giants is closely related to the quality of the photometric images.In order to search for red giants more precisely, it is necessary to perform a preliminary screening of the sample.First, we found stars with good photometry from SMSS DR1.1, i.e., those with FLAGS = 0 and CLAS_STAR 0.6 (Huang et al. 2019), and selected stars with photometric images in the uvgi bands, i.e., those with u nvisit > 0, v nvisit > 0, g nvisit > 0, and i nvisit > 0.Then, to ensure the good quality of the photometric image data in each band, we excluded those stars without uvgi-band magnitudes and ensured that the uncertainty of the uvgi-band magnitudes is less than 0.05.
After screening, a total of 11,037,826 stars remained in the sample.Since the overwhelming number of stars in the sample would increase the experiment time, we selected a subregion in the whole sky (200° R.A. 221°, −55° decl.−34°), and screened 304,477 stars by R.A. and decl.to form the SMSS giant sample to be identified.

Identification and Verification of Red Giant Stars
The CBAMResNets classifier was utilized to analyze a total of 304,477 stellar images from SMSS DR1.The identification process for red giants across the entire data set was remarkably swift, taking approximately 10 minutes with the aid of eight threads.After filtering the classified data using probabilities and thresholds, we successfully identified 20,243 red giant candidates, out of which 6338 were classified as bright sources.
To assess the reliability of the identified red giant candidates, we employed two crucial parameters: stellar absolute magnitude and T eff .These measures served as indicators to validate the credibility of the identified candidates.In order to mark the region of red giants on the Hertzsprung-Russell diagram, we combined the method used by Middle Tennessee State University5 and fitted a region of red giants in the training set (depicted as an orange dashed box in Figure 9).To quickly obtain the T eff and absolute magnitude, we utilized the stellar parameters, distances, and parallaxes provided by LAMOST and Gaia for 16,807 out of the 304,477 SMSS samples.To ensure the accuracy of the absolute magnitude, we specifically selected 14,424 stars with distances less than or equal to 2 kpc (Xiang & Rix 2022), of which 1024 were identified as red giant candidates.These candidates were then plotted on the T eff -absolute magnitude diagram and verified against the fitted red giant regions.The results show that 958 red giant candidates are located within the designated area, while the remaining 66 were tentatively identified as contamination sources, resulting in a contamination rate of 6.4%.When focusing on bright sources only, the contamination rate decreased to 2.2%, consistent with the results in Section 4. Figure 9 displays the distribution of stars on the T eff -absolute magnitude diagram.
Based on Figure 9, we can conclude that the distribution of red giant candidates identified by CBAMResNets aligns with the training set in terms of T eff and absolute magnitude.The uniformity in the temperature and density distributions further validates the reliability of these red giant candidates.Nonetheless, it is important to highlight that the contamination rate near an absolute magnitude of 6 is approximately 6.4%.This figure is marginally higher than the 3.7% observed in our training data but slightly outperforms the 6.6% contamination rate reported in Huang et al. (2019).A detailed analysis of the contamination rate is provided in Section 5.2.The T eff values are obtained from the LAMOST pipeline (LASP), while the absolute magnitudes are sourced from the Gaia database.In the graph, the green dots represent stellar samples, encompassing all the data points.The blue crosses indicate the red giants identified by the CBAMResNets classifier, while the orange dots correspond to the red giants in LA_VAC.Additionally, the orange dashed box represents the fitted regions of red giants based on the LA_VAC data.The right and bottom panels of the graph display histograms showcasing the distribution of absolute magnitude and T eff , respectively.The green, orange, and blue curves represent the counts of stellar samples, the counts of red giants in the LA_VAC sample, and the counts of stars with identified red giants, respectively.align with the distribution of (g − i) and (v − g) colors of the red giant candidates.Among the selected candidates, five are located in the SMR region, 1768 in the solar region, 430 in the MP region, and 100 in the VMP region.We identified 65 cold dwarf contaminants based on the fitted regions shown in Figure 9.These contaminants were distributed as follows: 0 in SMR, 56 in solar, 9 in MP, and 0 in VMP regions, resulting in contamination rates of 0%, 3.2%, 2.1%, and 0%, respectively.The majority of red giant candidates are concentrated in the solar and MP regions, with the MP region exhibiting a significantly lower contamination percentage.Notably, despite the limited quantity of red giant stars observed in the SMR and VMP regions, the contamination rate within these zones approximates zero percent.Consequently, these regions offer a rare opportunity to acquire a select sample of relatively uncontaminated red giant stars.

The Metallicity Investigation
We made a catalog of all 39,076 red giant candidates and uploaded it to Zenodo (doi:10.5281/zenodo.8352420),as shown in Table 2.

Discussion of Experimental Results
Based on the experimental results, it is evident that the CBAMResNets architecture significantly outperforms traditional convolutional neural networks and established machinelearning methods in the task of identifying red giants through stellar images.In the study by Liu et al. (2014), red giants were classified using LAMOST spectral data and associated parameters, reporting a contamination rate of approximately 2.5% and a completeness of about 75%.By contrast, the current study employs SMSS stellar images and LAMOST parameters to achieve similar objectives.We record a higher contamination rate of 4.4% at a completeness threshold of 75%.Several reasons contribute to the elevated contamination rate.First, as is evident from Figures 5 and 7, the efficiency in searching for red giants is intrinsically tied to the proportion of red giants.Around a stellar magnitude value of 12, where the proportion of red giants peaks, the recall rate for red giants also hits its maximum.Subsequently, the recall rate for red giants decreases as their proportion diminishes.Therefore, despite employing numerous methods to mitigate the effects of data imbalance, imbalanced data still impact our efficiency in searching for red giants.Second, although earnest efforts were made in Section 2 to filter out cold dwarfs using the absolute stellar magnitude parameter, a minor contamination of cold dwarfs still persists in the training set.Lastly, the information contained in spectra is more comprehensive than that in images, making search efficiency using spectra noticeably superior to that using images.However, image-based methods provide a more cost-effective and user-friendly alternative, especially when less stringent contamination rate standards are acceptable.
In the training phase, we selected against employing crossvalidation techniques to derive our final outcomes, primarily to mitigate computational overhead.This choice introduces a potential limitation, as our results may exhibit a dependency on the specific data distribution.Additionally, we incorporated focal loss as a mechanism to address data imbalance during training; however, the parameters for this loss function were not exhaustively fine-tuned but rather determined through a series of comparative experiments and empirical observation.Future work that optimizes these aspects holds promise for enhancing the accuracy of red giant star identification, a direction we intend to explore in subsequent research.

Summary
This paper introduces an enhanced network model called CBAMResNets, derived from the ResNets34 architecture, to efficiently identify red giants in SMSS photometric image data.In comparison to the random forest algorithm (TPC) and the VGG16 convolutional neural network model, CBAMResNets demonstrates a superior performance in identifying red giants, particularly for bright sources, within the SMSS data set.Unlike traditional machine-learning methods, CBAMResNets possesses the capability to automatically learn valuable features from images, eliminating the need for a separate feature extraction step while maintaining a high search efficiency.Moreover, incorporating the CBAM module into the CBAMResNets model further enhances the model's ability to automatically extract features and continually improve search efficiency.
Although various techniques have been employed to mitigate overfitting during network training, experimental results indicate that the more intricate CBAMResNets model still tends to exhibit signs of overfitting when compared to both VGG16 and TPC.This observation may account for the superior performance of VGG16 or TPC over CBAMResNets in specific bandwidth ranges.While the most effective solution to address overfitting is to incorporate additional calibrated data, the process of data calibration is highly complex and uncertain.Furthermore, it remains uncertain whether a larger quantity of labeled data will become available in the future.Nonetheless, CBAMResNets currently remains a reliable choice.
A series of comprehensive comparison experiments were conducted, exploring various combinations of uvgi, uvgir, uvgiz, and uvgizr bands.The analysis revealed that the data set containing uvgi-band data exhibited the highest search efficiency for red giant stars.Furthermore, when evaluating multiple data sets of different sizes, it was observed that the best performance was achieved with an image size of 72 × 72 pixels.Ultimately, in terms of the performance comparison between TPC, VGG16, and CBAMResNets, CBAMResNets demonstrated the highest search efficiency.The performance of CBAMResNets on the test set is as follows: 1.The precision rate of red giants is 0.92 and the recall rate of red giants is 0.9194.2. The recall rate of non-red giants is 0.91 and the precision rate of non-red giants is 0.9661.
Additionally, the model was tested on bright sources, yielding the following results: 1.The accuracy of the red giant is 0.92 and the recall of the red giant is 0.9813.2. The recall rate of non-red giants is 0.91 and the precision rate of non-red giants is 0.9981.
Finally, using the trained CBAMResNets model, we searched for red giant candidates in the large SMSS sample, resulting in the identification of 20,243 candidates.To verify their reliability, we examined their temperatures and absolute magnitudes, which yielded an overall contamination rate of 6.4%.Notably, the model performed even better on bright sources, achieving a contamination rate of 2.2%.Additionally, the distribution of the red giant candidates in terms of temperature, absolute magnitude, and density closely aligns with the patterns observed in the training set.Furthermore, we investigated the distribution of metallicity among both the red giant candidates and a limited number of contamination sources, utilizing stellar metallicity as a reference.Our findings indicate that a majority of the red giant candidates are concentrated in the solar and MP metallicity regions, while the SMR and VMP regions exhibit almost no contamination sources.This demonstrates a high level of consistency with the expected metallicity distribution.
Based on the aforementioned results, the utilization of deep learning and convolutional neural networks in the study of red giant searches has demonstrated highly promising outcomes.The successful implementation of this approach contributes to the availability of a more comprehensive and precise red giant data set, thereby establishing a robust foundation for future astronomical endeavors.Moving forward, there is potential for further exploration and refinement of methods aimed at enhancing the search for red giants.Through iterative improvements, we can eventually apply the optimal algorithms to practical applications, fostering continuous advancements in this field of study.values of the parameter, which can also reflect the difference in performance on different model classifiers.MSE is defined as where N represents the total number of samples, y j represents the true value, and ŷj represents the predicted value.

B.4. Number of Red Giants
The probabilistic classifier can learn a continuous probability distribution of positive and negative samples instead of simple discrete labels.The predictions allow us to determine the probability that the star is a red giant (P giants ), which in principle eliminates the interference of non-red giants (Kim & Brunner 2017).A perfect classifier can use P giants to derive the number of red giants in the sample, so the absolute error between the true and predicted number of red giants can be used to measure the performance of the classifier (see Equation (B8)).

Figure 1 .
Figure 1.Accuracy of prediction in the CBAMResNets network for images of different sizes.Figure 2. Network structure of two residual modules of ResNets34, where (a) is a residual module with a shortcut connection and (b) is a downsampled residual module with a 1 × 1 convolution operation added to (a).

Figure 2 .
Figure 1.Accuracy of prediction in the CBAMResNets network for images of different sizes.Figure 2. Network structure of two residual modules of ResNets34, where (a) is a residual module with a shortcut connection and (b) is a downsampled residual module with a 1 × 1 convolution operation added to (a).

Figure 4 .
Figure 4. CBAMResNets network structure, where the residual module (a) is the module (a) introduced in Figure 2 and the residual module (b) is the module (b) introduced in Figure 2.

Figure 5 .
Figure 5. Recall rate of red giants and the precision of non-red giants in the gband magnitude (differential counts) by Kernel density estimation.The first panel shows the histogram of the distribution of the number of red giants when the interval size of magnitude in the g band is 0.1 mag, and the red solid line indicates the KDE of the number of red giants.The second panel shows the percentage of red giants when the interval size in the g band is 0.1 mag.The third and the fourth panels compare the recall rate of red giants and the precision of non-red giants using CBAMResNets (purple solid line), VGG16 (green dashed line), and TPC (blue dashed line), and the 1σ confidence bands are estimated using bootstrap-sampling methods (Kim & Brunner 2017).

Figure 6 .
Figure6.Recall rate of red giants and the precision of non-red giants in the gband magnitude (integrated counts) by Kernel density estimation.The first and second panels compare the recall rate of red giants and the precision of non-red giants for CBAMResNets, TPC, and VGG16.The 1σ error bars are computed following the method fromPaterno (2004) to avoid the unphysical errors of binomial or Poisson statistics(Kim & Brunner 2017).

Figure 7 .
Figure 7. Recall rate of red giants and the precision of non-red giants in the uband magnitude (differential counts) by Kernel density estimation.Parameter settings and the meaning of each panel are the same as those in Figure 5.

Figure 8 .
Figure 8. Recall rate of red giants and the precision of non-red giants in the uband magnitude (integrated counts) by Kernel density estimation.Parameter settings and the meaning of each panel are the same as those in Figure 6.

Figure 9 .
Figure9.Distribution of T eff and absolute magnitude for a selection of stellar samples.The T eff values are obtained from the LAMOST pipeline (LASP), while the absolute magnitudes are sourced from the Gaia database.In the graph, the green dots represent stellar samples, encompassing all the data points.The blue crosses indicate the red giants identified by the CBAMResNets classifier, while the orange dots correspond to the red giants in LA_VAC.Additionally, the orange dashed box represents the fitted regions of red giants based on the LA_VAC data.The right and bottom panels of the graph display histograms showcasing the distribution of absolute magnitude and T eff , respectively.The green, orange, and blue curves represent the counts of stellar samples, the counts of red giants in the LA_VAC sample, and the counts of stars with identified red giants, respectively.
This paper utilizes metallicity ([Fe/H]) to further investigate the properties of the identified red giant candidates.The stars are categorized into four regions based on their [Fe/H] values, following the classification by Beers & Christlieb (2005): (1) super metal-rich region (SMR; [Fe/H] 0.5); (2) solar region (Solar; -1 Fe/H < 0.5); (3) metal-poor region (MP; −2 [Fe/H] < −1); and (4) very metal-poor region (VMP; [Fe/ H] < −2).In the SMSS data set, the (v − g) bands demonstrate a high sensitivity to [Fe/H], surpassing the metal content estimator (u − g) commonly used in SDSS photometry (Huang et al. 2019).Dotter et al. (2008) calculated isopotential lines for various [Fe/H] values based on the properties of the stellar (g − i) and (v − g) colors in the SMSS database.These lines are accessible and downloadable from the Dartmouth Stellar Evolution Database (http://stellar.dartmouth.edu/models/grid.html).Consequently, we can classify the stars in SMSS according to their [Fe/H] based on the aforementioned study.We selected 2303 red giant candidates with LAMOST [Fe/ H] values from the initial pool of 20,243 candidates.These candidates were plotted in a two-dimensional (g − i), (v − g) plane (Figure10), where the colors of the points represent the corresponding [Fe/H] values.The results demonstrate that the [Fe/H] isopotential lines calculated byDotter et al. (2008)

Figure 10 .
Figure 10.The (v − g) and (g − i) profiles from red giant candidates, color coded by LAMOST [Fe/H].The different colored lines are the (v − g) and (g − i) sequences of stars predicted in the Dartmouth Stellar Evolution Database (Dotter et al. 2008).