skip to main content

gaia data release 4 documentation

16.3 Apsis modules

16.3.13 UCA

Author(s): Lara Pallas-Quintela, Daniel Garabato

16.3.13.1 Goal

The Unsupervised Classification Analysis (UCA) module is designed to classify Gaia sources with BP/RP spectra into four primary source types: star, galaxy, quasar, or outlier. The classification models are based on Self-Organising Maps (hereafter SOM, Kohonen 2001; Ordóñez et al. 2012; Fustes et al. 2013; Dafonte et al. 2018). This unsupervised approach preserves the topological structure of the input space, so that spectrally similar sources are assigned to the same or adjacent neurons. This is particularly well-suited to astronomical spectra, for which the characteristics evolve continuously rather than creating sharply separated classes. Both the models and the classification process rely solely on BP/RP spectral information, without incorporating any auxiliary or derived astrophysical parameters. Rather than training a SOM directly on the complete set of target spectra to derive the class labels of the sources (as implemented in the OA module, Section 16.3.14), UCA relies on a set of pre-trained SOM maps constructed from well-characterised reference objects. During the classification phase, these maps are used as classification models and constitute, with the BP/RP spectra, the input of the UCA module. Within this framework, the UCA processing chain is restricted to the classification of input spectra, as illustrated in Figure 16.21. Upon completion of the classification process, the results are ready for publication, and the detected outliers are subsequently analysed by the OA module (see Section 16.3.14).

Refer to caption
Figure 16.21: Flowchart diagram of the Unsupervised Classification Analysis (UCA) module.

Gaia DR4 provides BP/RP spectra for up to 2 billion sources. At this scale, training a SOM on the full dataset may become impractical, even when optimisation and parallelisation strategies are applied (see Dafonte et al. (2018)). Furthermore, the scientific focus of the mission on the study of the Milky Way results in a lower proportion of non-stellar objects such as galaxies and quasars, leading to a significant data imbalance. This may imply that some under-represented object types may not form distinct neurons in the SOM, thus being grouped with other types of objects and potentially degrading the classification quality. Given these considerations, a lighter model-based approach has been adopted to address both computational constraints and limited data representativeness, enabling a more efficient data classification.

16.3.13.2 Training data and models

UCA classifies the Gaia sources solely using BP/RP spectra. The classification model consists of a set of pre-trained SOM maps, which are trained offline using a set of high-quality Gaia sources. In Gaia DR4, three different maps are used, each one trained on a specific source type: stars, galaxies, and quasars.

Self-Organising Maps are an unsupervised technique based on neural networks. These maps project a multidimensional input space into a two-dimensional grid, facilitating its visual exploration using appropriate tools. This projection is characterised by preserving topological order; that is, similar data in the input space will belong to the same neuron or to neighbouring neurons in the output space. Each of these neurons has a representative, called a prototype. The prototype is a synthetic pattern that is adjusted during the training phase and that best represents the input patterns that belong to that group. The membership of a source in a neuron is determined by identifying the closest neuron prototype to the given source, which is known as the winning neuron or best matching unit (BMU).

Although the training dataset is composed of sources with known labels, an unsupervised learning approach is adopted in order to preserve the intrinsic grouping of similar data without any prior information. This approach is well suited to the present context, in which astronomical spectra are grouped, as their properties evolve smoothly rather than creating sharply separated classes, allowing SOMs to capture these transitions. Class labels are not used during training but in a post-processing stage, where the neuron is labelled according to the most populated type. Table 16.29 lists the number of sources used during training (divided by their type and subtype).

Table 16.29: UCA training sources per subtype.
Source Type Subtype Number of sources
STARS STAR_OBA 18 691
STAR_F 422 347
STAR_G 2 879 359
STAR_K 3 562 398
STAR_M 1 588 798
STAR_ULTRACOOL 1 436
STAR_CARBON 10 255
STAR_WD 22 626
GALAXIES GAL_Z01_LT 66 023
GAL_Z01_02 84 882
GAL_Z02_GT 7 471
QUASARS QSO_Z05_LT 2 895
QSO_Z05_15 28 578
QSO_Z15_25 42 927
QSO_Z25_35 13 530
QSO_Z35_45 793

Due to the low number of O, B, and A stars, they are grouped into a single subtype. F, G, K and M stars are further subdivided into early, intermediate, and late subtypes, as the available data are sufficient and their spectral differences are large enough to form well-separated neuron groups within the SOM (see Table 16.30).

Table 16.30: Distribution of the F, G, K and M stars in UCA.
Star subtype Refined subtype Number of sources
STAR_F STAR_F_EARLY 30 346
STAR_F_INT 54 319
STAR_F_LATE 337 682
STAR_G STAR_G_EARLY 1 120 270
STAR_G_INT 874 537
STAR_G_LATE 884 552
STAR_K STAR_K_EARLY 2 059 631
STAR_K_INT 1 042 987
STAR_K_LATE 459 780
STAR_M STAR_M_EARLY 746 583
STAR_M_INT 809 939
STAR_M_LATE 32 276

The dataset was built using the following data:

  • •

    Stars dataset. The stellar dataset was constructed using several reference catalogues. Morgan-Keenan classification stars Keenan (1985) are selected from a high-quality HR diagram based on Gaia Collaboration et al. (2018a); white dwarfs are taken from Pérez-Couto et al. (2024); and carbon and ultracool stars from Gaia Collaboration et al. (2023c). From these datasets, only the sources with SNR>20 are selected. As a result, 8 505 910  sources are used to train a 20×20 SOM map.

  • •

    Galaxies dataset. This dataset is based on SDSS DR16 Lyke et al. (2020) and further refined using the EmpLib sources from the UGC module (see Section 16.3.10.9). Only sources with reliable redshift measurements and low photometric uncertainties are retained. As a result, 158 376  sources are used to train a 9×9 SOM map.

  • •

    Quasars dataset. This dataset is based on the SDSS DR16 Lyke et al. (2020) quasar catalogue. Only sources with reliable redshift measurements and low photometric uncertainties are retained. This sample is further restricted to the redshift range 0<z<4.5. As a result, 88 723  sources are used to train a 10×10 SOM map.

Once the initial datasets are refined, each dataset is used to train a separate SOM map (as shown in Figure 16.22). As a result, the data are distributed across the subtypes documented in Table 16.31.

Table 16.31: UCA neuron labels.
Source Type Subtype Number of neurons
STARS STAR_OBA 1
STAR_F 22
STAR_G 139
STAR_K 174
STAR_M 60
STAR_CARBON 1
STAR_ULTRACOOL 1
STAR_WD 2
GALAXIES GAL_Z01_LT 37
GAL_Z01_02 40
GAL_Z02_GT 4
QUASARS QSO_Z05_LT 5
QSO_Z05_15 28
QSO_Z15_25 43
QSO_Z25_35 22
QSO_Z35_45 2
Refer to caption
Refer to caption
Refer to caption
Figure 16.22: Pre-trained maps used for classification at UCA. (First) Stars Map, (Second) Galaxies Map and (Third) Quasars Map.

16.3.13.3 Inputs

UCA and OA rely on the same mean XP spectra produced by SMSgen (Section 16.3.1). These spectra are downsampled to 60 pixels per band, concatenated (as shown in Figure 16.24), and preprocessed prior to classification. This preprocessing step addresses border effects, zero or negative flux values, and the overlap region between the BP and RP wavelength ranges (see Section 16.3.13.5.1). In addition to the spectral input, the module requires the pre-trained SOM models. In Gaia DR4, three different models are used: stars, galaxies, and quasars, as shown in Figure 16.22. The preprocessed spectra are projected onto the aforementioned SOMs to determine the most appropriate class for each source.

16.3.13.4 Outputs

The UCA module provides classification results for each processed source and identifies new outliers that serve as input to the OA module. This package contributes to the archive through the following products:

  • •

    Source-level results, which include the assigned classification, as well as the corresponding neuron and SOM map, if the source is neither unclassified nor an outlier.

  • •

    Map-level information for each of the pre-trained Self-Organising Maps. The corresponding statistical descriptors and neuron prototypes are provided.

Refer to caption
Figure 16.23: Relationship between all the tables in Gaia DR4 archive that contains UCA products.

The resulting products are contained in three different tables of the archive, for which the relationships can be observed in Figure 16.23, and include the following information:

  • •

    The ap_class table contains the classification information for a source. If the source was successfully classified in one of the SOM maps, the table provides the assigned neuron and map (neuron_uca_id and som_uca_id, respectively), the distance of the source from the neuron (neuron_uca_dist), quality flags (flags_uca), and the neuron label (classlabel_uca; see Table 16.29 and Table 16.30 for the classification labels defined in UCA). If the source is an outlier, only the label (classlabel_uca) is provided, with value ‘OUTLIER’. If the source could not be classified, all the fields are left empty.

  • •

    The uca_neuron_information table contains non-multidimensional parameters associated with the SOM maps and their neurons, where each SOM is identified by som_id and each neuron is identified within its corresponding SOM by a unique neuron_id, as well as two indices that specify its location within the map (neuron_row_index and neuron_column_index). This table provides some statistics for each one of the neurons based on the objects that populate them, such as the number of sources populating a neuron (hits), the class label assigned to the neuron (classlabel), if any, and the source_id of the centroid object (centroid_id). Finally, some quality indices based on the intra-neuron distance distribution are also provided: distance percentiles, F⁢W⁢H⁢M (distance_fwhm), skewness (S, distance_skew), kurtosis (K, distance_kurtosis) and the categorical index Q⁢C (quality_category). Check Section 25.4.20 for further information about uca_neuron_information.

  • •

    The uca_neuron_xp_spectra table contains multidimensional data related to XP spectrophotometry of the neurons, including the preprocessed spectrum of the prototype (xp_spectrum_prototype_flux) for each neuron.

The map identifier is provided through som_uca_id in the ap_class table, and through som_id in the uca_neuron_information and uca_neuron_xp_spectra tables. The corresponding class label is published through classlabel_uca in the ap_class table and through classlabel in the uca_neuron_information table. The information associated with each classification model can therefore be selected using either its map identifier or the prefix of its class labels, as follows:

  • •

    Stellar model: map identifiers starting with 2; class labels starting with STAR_.

  • •

    Galaxy model: map identifiers starting with 3; class labels starting with GAL_.

  • •

    Quasar model: map identifiers starting with 4; class labels starting with QSO_.

16.3.13.5 Method

The method used by UCA to classify sources is based on the unsupervised artificial intelligence algorithm known as the Self-Organising Map (Kohonen 2001), which allows objects with similar spectral energy distributions to be grouped and does not make use of any prior knowledge based on physical models. However, this module does not create a SOM based on the full dataset of sources to be analysed, but uses a set of pre-trained SOMs that serve as classifiers. These SOMs are constructed with well-known sources and refined to obtain the most accurate representation of the data. As shown in Figure 16.21, the execution of UCA is divided into two different steps: the data preprocessing, which is common to both UCA and OA, and the classification stage, which receives as input both the preprocessed sources and the pre-trained SOMs to perform the source-by-source classification.

16.3.13.5.1 Preprocessing

UCA processes any type of BP/RP spectra, ranging from high-quality mean spectra to spectra of sources with low apparent luminosity, which as a result of the extraction process can have pixel intervals with very low or even negative fluxes. As the spectra are the only input to the module, it is necessary to carry out a preprocessing stage before classifying the sources.

Refer to caption
Figure 16.24: Illustration of the UCA preprocessing. Left: Original BP/RP sampled spectra. right: Preprocessed spectrum.

This procedure is illustrated in Figure 16.24 and improves the overall performance of the model. It consists of the following steps:

  1. 1.

    The borders of each spectrum are trimmed due to the low transmission at these wavelengths. As a result, UCA uses the effective wavelength ranges [375,644]nm for BP and [644,1050]nm for RP.

  2. 2.

    Some spectra may contain negative flux values, and therefore such regions are linearly interpolated provided that they comply with the following constraints:

    • •

      A maximum of 10% of the effective wavelength range is allowed to present consecutive negative flux values.

    • •

      A maximum of 25% of the effective wavelength range is allowed to present negative flux values spread all over the spectrum.

    Otherwise, the sample is considered to be a poor-quality spectrum and it is discarded.

  3. 3.

    The spectra are downsampled from 120 to 60 pixels per band, as this was found to preserve classification quality while substantially reducing execution time.

  4. 4.

    Both BP/RP spectra are joined in a single array of fluxes, for which the wavelengths are sorted in strictly ascending order.

  5. 5.

    Finally, the resulting spectrum is normalised, so that its area sums up to one.

16.3.13.5.2 Classification

Self-Organising Maps are an unsupervised technique based on neural networks. These maps project a multidimensional input space into a two-dimensional grid, facilitating its visual exploration using appropriate tools. This projection is characterised by preserving topological order; that is, similar data in the input space will belong to the same neuron or to neighbouring neurons in the output space. Each of these neurons has a representative, called a prototype. The prototype is a synthetic pattern that is adjusted during the training phase and that best represents the input patterns that belong to that group. The membership of a source in a neuron is determined by identifying the closest neuron prototype to the given source, which is known as the winning neuron or best matching unit (BMU).

Due to the large amount of data to be processed, the approach adopted in OA (see Section 16.3.14.5.2), where the SOM is trained on the full set of target spectra, is not feasible in this context, as it would significantly increase the computational cost while degrading the quality of the resulting map. Instead, a set of SOM maps is trained offline using a smaller but well-characterised dataset. Although the training dataset is composed of sources with known labels, an unsupervised learning approach is adopted in order to preserve the intrinsic grouping of similar data without any prior information. This approach is well suited to the present context, in which astronomical spectra are grouped, as their properties evolve smoothly rather than creating sharply separated classes, allowing SOMs to capture these transitions. Class labels are not used during training but in a post-processing stage, where the neuron is labelled according to the most populated type (Table 16.29 and Table 16.30 show an overview of the distribution of sources per label). In addition, during post-processing a threshold is assigned to each neuron to determine whether a classified source is sufficiently similar to the neuron prototype or should be considered an outlier.

During classification, each preprocessed spectrum is projected onto all the pre-trained SOM maps and the corresponding best matching neurons are identified. The classification procedure is described below.

  1. 1.

    Compute the winning neuron mi,r* for each of the trained SOM maps (stars, galaxies and quasars).

  2. 2.

    Sort the winning neurons mi,r* by their distance di,r* to the source in ascending order.

  3. 3.

    Select the winning neuron with the smallest distance to the source as the BMU mr*.

  4. 4.

    Check if the distance to the BMU is smaller than the threshold associated with that neuron (dr*<τr*). If so, classify the source as a member of that neuron. Otherwise, classify it as an outlier.

  5. 5.

    If the source is not classified as an outlier, check if the difference between the distances to the first and second BMU (BMU1 and BMU2) is greater than a predefined threshold ϵ, that is |d⁢(BMU2,x)−d⁢(BMU1,x)|>ϵ. If so, classify the source as a member of the BMU. Otherwise, classify it as an outlier.

  6. 6.

    Finally, label the source either with the class associated with the BMU or as an outlier.

16.3.13.6 Scope

As it was mentioned in Section 16.3.13.1, the scope of the UCA work package is to classify those sources that have associated BP/RP spectra into four main types: stars, galaxies, quasars, and outliers. Moreover, the sources that do not meet the classification criteria specified in Section 16.3.13.5.2 serve as input to the OA module for further analysis.

Following DPAC recommendations for Gaia DR4, the following filters were also implemented in order to discard some of the sources:

  • •

    Discard sources with fewer than 5 transits or 241 measurements (both for BP and RP spectra).

  • •

    Remove duplicate sources.

  • •

    Accept only sources where AGIS (Section 4) converged to a solution.

16.3.13.7 Uses and limitations

The UCA results can be used as an initial broad classification into stars, galaxies, quasars, and outliers for sources with available BP/RP spectra. Within these main types, a finer classification is available through the classification labels, including stellar subtypes and extragalactic redshift bins (for galaxies and quasars), while sources that do not satisfy the classification criteria are identified as outliers. Use cases include:

  • •

    Coarse-grained classification of the sources, divided into stars, galaxies, quasars and outliers.

  • •

    Fine-grained classification of the sources based on stellar subtypes and redshift ranges in the case of extragalactic sources (see Table 16.31).

  • •

    Identifying sources that should not be treated as reliable class members and using them as input to OA for further analysis.

  • •

    Filtering the catalogue by means of quality flags, in order to separate cleaner classifications from sources that may require additional analysis.

  • •

    It is also possible to explore the information of the neuron where a source was classified, as the related data are published in the archive. Moreover, the pre-trained maps are available through the GUASOM tool.

The classification is based solely on BP/RP spectra. As a consequence, the following limitations should be considered when interpreting the results:

  • •

    Spectral-only classification. UCA does not rely on astrophysical parameters during the classification stage. Therefore, there may be confusion among objects with similar BP/RP spectral shapes, such as some white dwarfs and hot stars.

  • •

    Extragalactic contamination. Extragalactic sources might be affected by stellar contamination, especially at low Galactic latitudes.

  • •

    Extinction. During the spectra preprocessing stage, only normalisation is applied to the input BP/RP spectra. Stellar sources affected by extinction may show a degraded classification quality, particularly in the case of hot stars.

A set of processing flags, encoded as ‘ABC’, is also defined in the flags_uca field of the ap_class table. The first two digits, A and B, indicate the number of gaps containing negative flux values in the BP and RP spectra, respectively. They take values between 0 and 2, with 2 indicating two or more gaps.

The third digit, C, is a quality flag used to refine the classification results for stars, galaxies, and quasars. It is based on the distance to the BMU and, where applicable, astrometric and photometric indicators. A value of 0 indicates that the source satisfies the corresponding quality criteria, whereas a value of 1 indicates that it does not. The flag is assigned according to class-dependent criteria:

  • •

    Stars flag. Sources for which the distance to the BMU exceeds the q25 quantile derived from the training distribution.

  • •

    Galaxies flag. Sources with a distance to the BMU larger than a fixed threshold of 2.81×10−5.

  • •

    Quasars flag. Sources classified as quasars are flagged as low-quality if any of the following conditions is satisfied: a) p⁢a⁢r⁢a⁢l⁢l⁢a⁢x>0.205; b) r⁢u⁢w⁢e>5; c) p⁢h⁢o⁢t⁢_⁢b⁢p⁢_⁢r⁢p⁢_⁢e⁢x⁢c⁢e⁢s⁢s⁢_⁢f⁢a⁢c⁢t⁢o⁢r>0.18; d) b⁢p⁢_⁢r⁢p>0.155.

The main objective of the extragalactic filtering is to reduce stellar contamination, which is particularly significant in regions close to the Galactic plane.

In addition to the classification results, it is also possible to visualise and retrieve information about the pre-trained SOM Maps. For this purpose, the GUASOM (Gaia Utility for the Analysis of Self-Organising Maps) tool (Álvarez et al. 2022) was designed to facilitate the analysis of SOM maps. It was implemented using web technologies, to benefit from their flexibility and easy access to the information. The version of GUASOM developed specifically for the spectra processed by the UCA and OA packages for Gaia DR4 is called GUASOM flavour Gaia DR4 and provides several visualisation utilities that allow a user-friendly analysis of the information present on the map. The tool provides both classical and specific domain representations. For the UCA maps, the following information can be accessed:

  • •

    U matrix: This representation shows the distance between the different neuron prototypes, where a smaller distance means more similarity. This is useful to identify groups of neurons populated by objects with similar SEDs. In our application the user can control the boundaries of the distance among neurons through a slider, with the objective of exploring the inner structure of the map.

  • •

    Hits: It displays the number of objects assigned to each neuron, making it possible to identify dense regions in the map.

  • •

    Catalogue labels: This graphic shows the representative label of each neuron according to a specific catalogue. Through a slider, the user can control the qualified majority limit that the label has to reach to be representative.

    In the case of UCA maps, the labels are described in Section 16.3.13.2.

  • •

    Category distribution: In this representation the distribution of a unique type of object is shown. The user can select the category to be displayed from a set of labels, according to the catalogues available for the map. This graphic allows the user to easily observe the regions of the map containing objects of the chosen type.

The strength of the tool lies in its ability to explore the neurons and the objects assigned to them by means of the following specific representations:

  • •

    Spectra: It displays the object-centroid and the prototype of a particular neuron. The user can also visualise the spectra of those training objects in a neuron that best and worst fit the prototype.

  • •

    Population: It shows the frequency of the different types of objects in the neuron according to the available catalogues.

  • •

    Statistical summary: The summary shows a table containing the statistical information available for a neuron.

16.3.13.8 Changes with respect to Gaia DR3

This module is published for the first time in Gaia DR4, so there are no changes with respect to the previous release.