## 2 Materials and Methods  
### Acquisition and Processing of Data  
The first step was data acquisition, with data retrieved from the Gaia DR3 Catalog. Initially, the stars were identified using SIMBAD (SYMBAD: [[https://simbad.cds.unistra.fr/simbad/](https://simbad.cds.unistra.fr/simbad/)]([https://simbad.cds.unistra.fr/simbad/](https://simbad.cds.unistra.fr/simbad/)) accessed on 16 January 2024), a dynamic database that provides information on astronomical objects published in scientific articles and in free databases [13]. Subsequently, a crossmatch was performed in the xp_continuous_mean_spectrum table within Gaia DR3 to determine the astronomical objects by star type. The table contains the mean BP and RP spectra based on the continuous representation in basis functions [3]. Table 1 displays some of its columns, which include the necessary information used to reconstruct the calibrated spectra of the astronomical objects. \begin{table}
\begin{tabular}{c c} \hline
**Field** & **Description** \\ \hline source\_id & Unique Source Identifier (unique within a particular data publication). \\ \hline bp\_basis\_function\_id/rp\_basis\_function\_id & Identifier that defines the set of fundamental functions for representing the BP/RP spectrum. \\ \hline degrees\_of\_freedom & Degrees of freedom for spectrum representation. \\ \hline bp\_n\_parameters/rp\_n\_parameters & Number of parameters for BP/RP spectrum representation. Number of parameters in the LSQ system. \\ \hline bp\_n\_measurements/rp\_n\_measurements & Number of measurements used for generating the BP/RP spectrum. \\ \hline \end{tabular}
\end{table} 
Table 1: Description of the fields of the XP_CONTINUOUS_MEAN_SPECTRUM table of the Gaia DR3 catalog. The calibrated spectra are represented as a linear combination of basic functions instead of using the conventional flux and wavelength table. This approach helps to avoid potential loss of information when sampling the spectra [4]. The pseudowavenlength, denoted as \(u\), is used to represent the spectrum \(h_{\text{sk}}\) of a source \(s\) observed in calibration unit \(k\). In this representation, the spectrum is transformed into a linear combination of bases \(\sum_{n=0}^{N}b_{\text{s},n}\,\phi_{n}\), which is defined as the mean spectrum and can be expressed by the following equation:  
\[h_{\text{sk}}(u_{i})\approx\sum_{n=0}^{N}b_{\text{sn}}\,\sum_{j=-J}^{J}A_{ \kappa}\big{(}u_{i},u_{i+j}\big{)}\cdot\varphi_{n}\big{(}u_{i+j}\big{)}, \tag{1}\]  
\(b_{\text{sn}}\) represents the spectral coefficients of the source spectrum s.  
\(\varphi_{n}\) is a linear combination of basis functions. \(A_{\text{k}}\) represents the convolutional kernel, which can be expressed as a linear combination of polynomial basis functions,  
\[A_{\kappa}\big{(}u_{i},u_{i+j}\big{)}=\sum_{l=0}^{L}c_{jl}\cdot(u_{i}-u_{\text {ref}})^{l}\,, \tag{2}\]  
\(u_{\text{ref}}\) is a conveniently chosen reference pseudowavenlength. \(\text{c}_{\text{jl}}\) coefficients are defined as a polynomial in the AC (Across Scan) coordinate [4]. The following quantities of spectra were retrieved per type of stars from the Gaia DR3 (GDR3) catalog, available on the Gaia Archive website: 201 symbiotic stars, 574 planetary nebulae, and 69,146 red giants. This count resulted from the crossmatch between the SIM-BAD and GDR3 databases. As can be seen, the number of red giants is considerably higher compared to the other types of stars. This is because they have a greater representation in our galaxy. Therefore, a subset of these red giants was selected, specifically a sample of 1200. Table 2 displays a comparative class distribution between originally downloaded stellar spectra and those selected for the initial analysis dataset, illustrating the imbalance in the representation of different star types.