skip to main content

gaia data release 4 documentation

16.3 Apsis modules

16.3.2 DSC

Author(s): Sara Jamal

16.3.2.1 Goal

The Discrete Source Classifier (DSC) probabilistically classifies sources into three classes: quasars, galaxies, and stars using the Gaia astrometry, photometry and low-resolution spectroscopy. The module produces normalized posterior probabilities across all target classes. DSC is a collection of different models and combiners: three classifiers Allosmod, Specmod and Specmod-Supp trained on Gaia data via a supervised learning approach, two classifiers Combmod and Combmod-α combining the contributions of Allosmod and Specmod, and lastly the classifier Combmod-Supp that combines the contributions of Specmod-Supp and Specmod.

The DSC models in Gaia DR4 are neural networks (Multi-Layer Perceptron, MLP), which differ from the models used in Gaia DR3, which were a tree-based algorithm (Extratrees) and a density-based approach (Gaussian Mixture Models). DSC also provides supplementary classifications from models jointly trained on the Gaia data and infrared photometry bands W⁢1 and W⁢2 from the CatWISE catalogue (Marocco et al. 2021).

In Gaia DR4, DSC emphasizes producing higher-purity catalogues of quasars and galaxies than was achieved in Gaia DR3.

16.3.2.2 Training data and models

For the quasar and galaxy classes, the DSC training data are a sample of spectroscopically confirmed sources from the SDSS DR17 catalogue (Abdurro’uf et al. 2022). For the star class, we randomly select a sample of Gaia sources, excluding the extragalactic classes.

  • •

    Quasar class: a sample of Gaia sources matched at a radius of 1 arcsec to the SDSS DR17 spectroscopically identified quasars (sources with spectral type class=’QSO’ and a redshift quality flag zWarning=0).

  • •

    Galaxy class: a sample of Gaia sources matched at a radius of 1 arcsec to the SDSS DR17 spectroscopically identified galaxies (sources with a spectral type class=’GAL’ and subClass!=’AGN’ and subClass!=’AGN BROADLINE’ and a redshift quality flag zWarning=0)

  • •

    Star class: a sample of randomly selected Gaia sources that are in neither the quasar class nor the galaxy class, and are not found to be quasars or galaxies in several catalogues checked.

The initial selection of the training set results in 563 233  quasars, 1 403 392  galaxies, and 1 097 000  stars. As we require valid BP and RP spectra and all of the selected Gaia features (see Section 16.3.2.3) for training, this reduced the size of the dataset. We then build a cleaner training set by imposing quality cuts and removing contaminants from the star class. We identify mislabelled sources in the star class that are listed as quasar or galaxy candidates in the external catalogues Milliquas v7.2-v8 (Flesch 2015, 2023), LAMOST DR7 (Luo et al. 2022), SDSS DR17 photometry (Abdurro’uf et al. 2022), and the Assef R90 and C75 WISE AGN catalogues (Assef et al. 2018). We also exploit an internal list of quasar and galaxy candidates provided by CU4-EO to filter out extragalactic candidates from the DSC star training sample.

The final training set contains 270 436  quasars, 44 894  galaxies and 857 977  stars. The final set contains a few sources identified as galaxies as a consequence of the filtering process requiring higher-quality data for training and testing. For the models trained jointly with the Gaia data and infrared photometry bands W⁢1 and W⁢2 from the CatWISE catalogue (Marocco et al. 2021), the training set is further reduced to sources with valid W⁢1 and W⁢2 photometry, giving a total of 236 710  quasars, 33 800  galaxies and 300 507  stars. The training set is randomly split into two equal parts for training the models and for testing the performance. The test set is never seen during training. Sources in the Magellanic Clouds are excluded when assessing DSC performance on the test set. Sources within radii of 9∘ and of 6∘, around the LMC and the SMC, respectively, are filtered out from the test set (Appendix B, Gaia Collaboration et al. 2023b). Coordinates of the Large Magellanic Cloud (LMC) and the Small Magellanic Cloud (SMC) are (RA=80.∘8942, Dec=−69.∘7561) and (RA=13.∘1583, Dec=−72.∘8003), respectively. We also exclude a few sources from the galaxy class below the stellar locus defined in Bailer-Jones et al. 2019. The rejected sources in the test set constitute 1.94% and 0.23% of the total number of sources in the star and galaxy classes, respectively.

Gaia DR4 used a provisional positional crossmatch between Gaia and CatWISE2020. This crossmatch used the Gaia astrometric solution to identify nearby sources from CatWISE2020, selecting the best counterpart of which the position is consistent with the target uncertainties (Marrese et al. 2017, 2019). DSC uses a preliminary internal cross-match between Gaia and CatWISE2020 based on prior astrometric data, retaining only the one-to-one matches with the smallest angular separation to avoid duplicates.

16.3.2.3 Inputs

The inputs to Specmod are the BP/RP spectra as sampled by SMSgen with 60 samples in each of BP and RP. The first and last five samples of each of BP and RP are excluded, leaving 100 input elements. The inputs to Allosmod are features from the photometry and the astrometry. The inputs to Specmod-Supp are the BP/RP together with a selected subset of features from the Gaia photometry and astrometry.

The Gaia astrometry and photometry features used in the training refer to fields in the Gaia source table gaia_source (the field names are links to the data model):

  • •

    sine of the Galactic latitude, sin b

  • •

    parallax, parallax, and its error, parallax_error

  • •

    total proper motion, pm

  • •

    proper motion in the right ascension direction and its error, pmra, and its error, pmra_error

  • •

    proper motion in the declination direction and its error pmdec, and its error, pmdec_error

  • •

    renormalized unit weight error ruwe

  • •

    fraction of successful IPD windows with one peak and high GoF, ipd_frac_high_gof

  • •

    fraction of successful IPD windows with multiple peaks, ipd_frac_multi_peak

  • •

    fraction of transits with truncated windows or multiple gates, ipd_frac_odd_win

  • •

    amplitude of the IPD GoF, ipd_gof_harmonic_amplitude

  • •

    phase of the IPD GoF, ipd_gof_harmonic_phase

  • •

    unrescaled astrometric excess noise of the source, agis_source_excess_noise, and its significance, as defined in Hernandez et al. (2026) and Section 4.1.7.

  • •

    G band magnitude, phot_g_mean_mag

  • •

    colour GBP−G, bp_g

  • •

    colour G−GRP, g_rp

  • •

    relative variability in the G band (relvarg), phot_g_n_obs/phot_g_mean_flux_over_error

  • •

    error on G mean flux, phot_g_mean_flux_error

  • •

    error on GBP mean flux, phot_bp_mean_flux_error

  • •

    error on GRP mean flux, phot_rp_mean_flux_error

  • •

    BP/RP flux excess factor with the colour dependency removed.
    The colour excess is computed from a ratio of the mean fluxes in GBP, GRP and G,
    colour excess=(phot_bp_mean_flux+phot_rp_mean_flux)/phot_g_mean_flux

When trained jointly with the Gaia data and CatWISE W⁢1 and W⁢2 photometry, two features are added to Allosmod and Specmod-Supp.

  • •

    colour, G−W⁢1

  • •

    colour, W⁢1−W⁢2

Figure 16.5 to Figure 16.7 illustrate the feature distributions and XP spectra of sources within the DSC training data set. The various classes display clear, distinct patterns in the feature space and different spectral properties.

Refer to caption

Figure 16.5: The distribution of the astrometric and photometric features in the DSC training set is colour-coded according to their true classes. Blue: quasars, orange: galaxies, black: stars. To compensate for the disparity in the SDSS footprint for quasars and galaxies, sin⁡(b) is randomised for quasars and galaxies (constant probability per unit sky area) before training Allosmod and SpecmodSupp. The features using the infrared photometry from CatWISE are constructed on a reduced training set that requires valid infrared photometry. The inputs for each model are detailed in Section 16.3.2.7 and the DSC technical note. The colour GBP−GRP is displayed for visualisation purposes only. The trained models use the colours G−GRP and GBP−G (large image).

Refer to caption

Figure 16.6: The joint distribution of the astrometric and photometric features in the DSC training set is colour-coded according to their true classes. Blue: quasars, orange: galaxies, black: stars. Contours are used in the regions of highest density. The colour GBP−GRP is displayed for visualisation purposes only. The trained models use the colours G−GRP and GBP−G (large image).

Refer to caption

Figure 16.7: Representation of BP/RP spectra of DSC classes in the training set. From left to right, quasars, galaxies, and stars are represented, with each row corresponding to a different magnitude range. Key information from the cross-match with the SDSS DR17 catalogue is included for quasars and galaxies (large image).

16.3.2.4 Outputs

DSC produces probabilities of the target classes for each classifier, as well as a class label derived from these and a flag array. The outputs are listed in Table 16.9. DSC results are provided in the Gaia DR4 tables ap_class, ap_class_ir, gaia_source, as well as the extragalactic tables qso_candidates and galaxy_candidates.

Table 16.9: Summary of DSC outputs in ap_class and ap_class_ir.
Classifiers Fields
Combmod probabilities classprob_dsc_combmod_quasar
classprob_dsc_combmod_galaxy
classprob_dsc_combmod_star
Specmod probabilities classprob_dsc_specmod_quasar
classprob_dsc_specmod_galaxy
classprob_dsc_specmod_star
Allosmod probabilities classprob_dsc_allosmod_quasar
classprob_dsc_allosmod_galaxy
classprob_dsc_allosmod_star
Combmod-α probabilities classprob_dsc_combmodalpha_quasar
classprob_dsc_combmodalpha_galaxy
classprob_dsc_combmodalpha_star
Specmod-Supp probabilities classprob_dsc_specmodsupp_quasar
classprob_dsc_specmodsupp_galaxy
classprob_dsc_specmodsupp_star
Combmod-Supp probabilities classprob_dsc_combmodsupp_quasar
classprob_dsc_combmodsupp_galaxy
classprob_dsc_combmodsupp_star
Class label classlabel_dsc_joint
Flag flags_dsc

In addition to the probabilities computed for all six classifiers, DSC provides a single class label and a flag array. The class label (classlabel_dsc_joint) in Gaia DR4 is defined similarly to Gaia DR3 such that Allosmod and Specmod jointly identify the same class with a maximum probability larger than 0.5. If the maximum probability is below the 0.5 threshold, the class label is marked as unclassified. The flag array flags_dsc contains 9 characters as described in Table 16.10. Five fields are populated, and the remaining fields are unused and are set to ’x’ for all sources.

Table 16.10: Description of the flag field in DSC. Digits 1, 3, 6, and 8 are not used and are set to ’x’ for all sources. Digits 4, 5 and 7 are quality indicators for the combined classifiers Combmod, Combmod-α and Combmod-Supp, respectively.
Index Indicator Value  Condition
(2nd digit) DSC outlier 0 if the Combmod and Combmod-α maximum probabilities are P≥0.999
1 otherwise it is declared as a possible outlier
(4/5/7th digits) Probability
levels
0 if the maximum probability P≥0.999
1 if the maximum probability 0.95≤P<0.999
2 if the maximum probability 0.90≤P<0.95
3 if the maximum probability P<0.90
(9th digit) Inputs size 1 if DSC uses the BP/RP spectra only
2 if DSC uses the BP/RP spectra, the photometry and the astrometry
3 if DSC uses the BP/RP spectra, the photometry, the astrometry and external IR photometry

16.3.2.5 Prior probabilities

Any probabilistic classifier involves the use of a prior probability (or base rate), even though in some classifiers the prior is implicitly set to be either uniform or equal to the proportions of each class in the training data. It is relatively easy to build a classifier on Gaia data that separates stars from quasars, for example, with an ‘accuracy’ of 95% or more. But quasars are around 1000 times rarer than stars in Gaia, so if you now applied this classifier to randomly-selected sources, the resulting ‘quasar’ sample would actually be mostly stars: 0.05×1000=50 stars for every 0.95×1≃1 quasar. Hence, the claimed ‘accuracy’ of 95% is not only wrong, but wildly and misleadingly optimistic. We address this problem using a prior that reflects the expected fraction of each class in the data. This, of course, makes it much harder to correctly classify the rare classes of objects, but this is exactly what the prior tells us. Bailer-Jones et al. (2019) have shown that failure to adopt an appropriate prior leads not only to highly optimistic ‘predicted’ performance, but also much worse actual performance than when using the appropriate prior.

Table 16.11: Class priors used by DSC in Gaia DR4.
quasar galaxy star
∝ 1/1000 1/5000 1
= 0.000989 0.000198 0.998813

We set our global class priors to the expected fraction of objects in each class in the whole Gaia sample that DSC classifies. These are given in Table 16.11. For quasars and galaxies, the priors are derived from considerations in Bailer-Jones et al. (2019) and on the fraction of these classes found in other surveys. There is, of course, a lot of uncertainty in these priors, and adopting different priors would lead to different samples for a given probability selection threshold.

16.3.2.6 Adjusting the DSC probabilities to accommodate a new prior

All published DSC probabilities are posterior probabilities that take into account the global class priors listed in Table 16.11. A posterior is equal to the product of a likelihood and a prior, which is then normalized. It is therefore simple to adjust the DSC probabilities to reflect a different prior probability: simply divide each output by the prior used (to strip this off), multiply by the new prior, and then normalize the resulting probability vector. Hence, if Pkd is the DSC probability in the catalogue (for any of its classifiers) for class k, and if πkd is the corresponding catalogue prior (Table 16.11), then the new posterior probabilities corresponding to a new prior πknew are

Pkd⁢πknewπkd/∑k′(Pk′d⁢πk′newπk′d). (16.14)

16.3.2.7 Method

In Gaia DR4, DSC classifies sources into three classes (quasar, galaxy, and star) using a global prior. DSC is a collection of six classifiers ingesting different inputs and producing normalized posterior probabilities. The classifiers Allosmod, Specmod, and Specmod-Supp are trained via supervised learning from a set of labelled sources. After training, in the prediction stage, the model processes the input data and produces the posterior probability that a source belongs to one of the three classes. The three classifiers Combmod, Combmod-α, and Combmod-Supp combine the posterior probabilities from the other three classifiers to produce better results (purer and/or more complete samples). The classifiers Combmod-α, Specmod-Supp, and Combmod-Supp did not appear in Gaia DR3 and are introduced for the first time in Gaia DR4. Allosmod, Specmod and Specmod-Supp are trained multi-layer perceptrons.

In the Gaia only mode, the DSC models are as follows.

  • •

    Allosmod (trained MLP). Input: Set of features from the Gaia astrometry and photometry. Output: posterior probabilities of the three classes.

  • •

    Specmod (trained MLP). Input: BP/RP spectra. Output: posterior probabilities of the three classes.

  • •

    Specmod-Supp (trained MLP). Input: BP/RP spectra and a set of features from the Gaia astrometry and photometry. Output: posterior probabilities of the three classes.

  • •

    Combmod (probabilistic combiner). Input: posterior probabilities from Allosmod and Specmod. Output: posterior probabilities of the three classes.

  • •

    Combmod-α (parametric combiner). Input: posterior probabilities from Allosmod and Specmod. Output: posterior probabilities of the three classes.

  • •

    Combmod-Supp (combiner). Input: posterior probabilities from Specmod-Supp or Specmod (Specmod results only if Specmod-Supp is not available). Output: posterior probabilities of the three classes.

In the Gaia-IR mode, the Allosmod(*) and Specmod-Supp(*) classifiers are trained using a set of features from the Gaia astrometry and photometry in addition to the two infrared features. The combined classifiers Combmod(*), Combmod-α(*) and Combmod-Supp(*) are computed in the Gaia-IR mode separately. The input list of the trained MLP is detailed in the DSC technical note.

Multi-Layer Perceptron
Neural networks are built from a series of specialized blocks that process input data and propagate it through a succession of units using weighted connections and feed-forward circuits to produce an output. The multi-layer perceptron (MLP) refers to a neural network model that consists of an input layer, an output layer and at least one hidden layer with fully connected neurons using non-linear activation functions. DSC trained models are MLPs. We trained several MLPs with different sets of hyperparameters, including the number of layers, the activation function, and the optimization method. We select the models that achieve the best performance in purity and completeness for the extragalactic classes, namely the quasar and galaxy classes. A separate technical note for DSC describes in detail the exploration of the model architectures, algorithms, and best-performing ones.

Combined classifiers: Combmod, Combmod-α, and Combmod-Supp
The posterior probability of Combmod is computed from a weighted product of the posterior probabilities of the classifiers Specmod and Allosmod, as done in Gaia DR3.

Pkc=Pks⁢Pka⁢1πk,and normalized across all classes⁢Pkc=Pkc/∑k′Pk′c, (16.15)

where k is the class, Pkc, Pks and Pka are the posterior probabilities for Combmod, Specmod and Allosmod respectively, and πk refers to the class prior of class k.
The posterior probability of the classifier Combmod-α is computed from a weighted sum of the posterior probabilities of the classifiers Specmod and Allosmod.

Pkcα=(1−αk)⁢Pks+αk⁢Pkaand normalized across all classes⁢Pkcα=Pkcα/∑k′Pk′cα, (16.16)

where the parameters α=[αquasar, αgalaxy, αstar] are obtained from a grid search that maximises the geometric score evaluated on the test set, a performance metric defined in Section 16.4.7.1.
The classifier Combmod-Supp is a simple selection of the other classifiers. The posterior probabilities are set equal to the Specmod-Supp probabilities when all input features are available for a source. Otherwise, the probabilities are set to those from Specmod.

16.3.2.8 DSC Gaia DR4 Scope: classify all sources with spectra

DSC processed all sources with the available input data. As a minimum requirement, DSC processing requires valid BP and RP spectra. Allosmod and Specmod-Supp produce results for sources with the mandatory input data from astrometry and photometry. In Gaia DR4, DSC produces classifications for 1 791 382 242  sources in the Gaia-only mode and for 533 490 385  sources in the Gaia-IR mode. The Gaia DR4 tables ap_class and ap_class_ir list these results. The Gaia DR4 table gaia_source contains the DSC Combmod results for sources with a number of observations contributing to the photometry in the BP- and RP- bands phot_[bp;rp]_n_obs≥6.

16.3.2.9 Uses and limitations

Classification performance is dependent on the position of the sources in the sky and magnitudes. The purity of the extragalactic classes is affected by stellar contaminants, especially in regions close to the galactic plane and at very faint magnitudes. In such cases, the quality of the data is reduced, and the classifiers are unable to reject false detections efficiently. High-density regions that follow the scanning law can be linked to sources with a small number of observations contributing to the BP/RP photometry phot_[bp;rp]_n_obs. We provide recommendations based on quality cuts applied to the source photometry and sky positions to improve the quality of DSC classifications in Jamal et al. (2026) and Section 16.4.7.1.

16.3.2.10 Changes with respect to Gaia DR3

  • •

    DSC is a collection of six classifiers, where Specmod-Supp, Combmod-Supp and Combmod-α are newly introduced in Gaia DR4.

  • •

    DSC classifies a source as a quasar, a galaxy or a star. The white dwarf and binary star classes are not included in Gaia DR4.

  • •

    DSC trained models in Gaia DR4 are neural networks (MLP, multi-layer perceptron) compared to the Extratrees algorithm and the GMM (Gaussian Mixture Model) used in Gaia DR3.

  • •

    DSC supplements infrared photometry from the CatWISE2020 catalogue to the Gaia data to identify the class in the ‘Gaia-IR mode’. The ‘Gaia only mode’ refers to models trained solely on the Gaia data.

  • •

    DSC achieves a significant improvement in purity for quasars and galaxies in Gaia DR4, with a moderate loss in completeness.