AstroNN
Summary
AstroNN (Leung & Bovy 2019) uses a deep-learning artificial neural network to determine stellar parameters (Teff, log g and metallicity) and 18 individual element abundances with associated uncertainty given a rest-frame resampled APOGEE spectrum. The network is trained on high quality APOGEE spectra and labels from SDSS-IV Data Release 17.
Detailed Description
AstroNN predicts stellar parameters and individual element abundances given a rest-frame APOGEE spectrum: stellar parameters are determined using the full wavelength range, while individual element abundances use censored portions of the spectrum. We train this network with a customized objective function that deals with incomplete and noisy training data, and apply dropout variational inference to derive uncertainties on our predictions.
AstroNN determines parameters (Teff and logg) and abundances for 18 individual elements (C, N, O, Na, Mg, Al, Si, P, S, K, Ca, Ti, V, Cr, Mn, Fe, Co, Ni) simultaneously at the ≈0.03 dex level, even at a low signal-to-noise ratio. The uncertainties returned by our method are a realistic estimate of the precision and they automatically blow up when inputs or outputs outside of the training set are encountered, thus shielding users from unwanted extrapolation.
The version of AstroNN integrated in Astra was refactored to use PyTorch instead of Tensorflow. The network is also re-trained using APOGEE spectra and ASPCAP results from SDSS-IV Data Release 17 to include a greater number of main-sequence stars.The training set used a filter on all DR17 stars of M_H_BAD, STAR_BAD, NO_ASPCAP_RESULT, MISSING_APSTAR, NO_GRID, and PROBLEM_TARGET.
Data Products
In Data Release 19, AstroNN is executed on the combined spectra stored in `apStar` data products, and the rest-frame visit spectra that are also stored in `apStar` files. This includes SDSS-V APOGEE spectra reduced with version 1.4 of the APOGEE data reduction pipeline, and SDSS-IV APOGEE spectra reduced for Data Release 17.
There are two key data products produced by AstroNN and Astra:
- `astraAllStarAstroNN`: this file contains stellar parameters based on combined spectra in the `apStar` files
- `astraAllVisitAstroNN`: this file contains stellar parameters based on visit spectra in the `apStar` files
Validation and Uncertainties
Because AstroNN for DR19 was trained on DR17 labels, we expect good agreement between AstroNN and DR17. One consistency check is to compare AstroNN log g’s to APOKASC-2 (Pinsonneault et al. 2018) log g’s directly. Figure 1 shows this comparison, which shows excellent agreement for both first ascent and red clump stars.

In Figure 2, we show the comparison between AstroNN Teff and ASPCAP Teffi for DR19. Overall the agreement is good, but below 4000 K, the values disagree. This is a result of the different decisions taken by DR17 compared to DR19 about how to deal with the offset in Teff between photometric and raw.spectroscopic values for the M giants where there are few calibrators in low-reddening regions or in clusters. In DR17, a flat correction was adopted extending from the end of the calibration set, whereas in DR19 the trend was extrapolated.

Flags
Field Name | Bit | Flag Name | Flag Description |
result_flags | 0 | UNCERTAIN_LOGG | Surface gravity is uncertain (e_logg > 0.2 and abs(e_logg/logg) > 0.075) |
result_flags | 1 | UNCERTAIN_TEFF | Effective temperature is uncertain (e_teff > 300) |
result_flags | 2 | UNCERTAIN_FE_H | Iron abundance is uncertain (abs(e_fe_h/fe_h) > 0.12) |
result_flags | 11 | NO_RESULT | Exception raised when loading spectra |
flag_warn | — | WARN | If any result_flags are set. |
flag_bad | — | BAD | If UNCERTAIN_TEFF is set, or both UNCERTAIN_LOGG and UNCERTAIN_FE_H are set |
AstroNNDist
Summary
AstroNNDist (Leung & Bovy 2019b, Leung et al. 2023) uses a deep neural network to determine spectrophotometric distance given a rest-frame resampled APOGEE spectrum, Ks-band apparent magnitude and extinction. The network is trained on stars in common between Gaia EDR3 and SDSS-IV APOGEE Data Release 17.
Detailed Description
AstroNNDist determines spectrophotometric distances given a rest-frame resampled APOGEE spectrum, Ks-band apparent magnitude and extinction. The network maps an continuum-normalized APOGEE spectrum to the pseudo-luminosity in the 2MASS Ks band. When combined with the extinction-corrected apparent Ks magnitude the distance or parallax follows.
The network returns two types of uncertainties: a predictive uncertainty for each star individually that represents the uncertainty in the model fit, and a model uncertainty that is derived from dropout variation inference. The total prediction uncertainty is the sum of predictive and model uncertainties in quadrature.
In Astra, AstroNNDist was refactored to use PyTorch instead of Tensorflow. The adopted network was re-trained using APOGEE DR17 and Gaia EDR3 data, which was initially used in the DR17 astroNN VAC (Abdurro’uf et al. 2022). For APOGEE data, we require a line-of-sight velocity scatter v_scatter < 1 km s−1, a spectral signal-to-noise SNR > 200, that no STARFLAG flags are set, and that there is a Ks-band apparent magnitude with corresponding extinction available. For the training parallaxes from Gaia EDR3, we cut on the re-normalized unit weight error ruwe < 1.4, on ip_frac_multi_peak ≤ 2 and ipd_gof_harmonic_amplitude < 0.1, and on parallax uncertainty σ_ϖ < 0.1 mas. After training, the resulting neural-network spectrophotometric distance accuracy is ≈5 per cent. This is better than Gaia at large distances (≈5 kpc).
Data Products
In Data Release 19, AstroNNDist is executed on the combined spectra stored in `apStar` data products. This includes SDSS-V APOGEE spectra reduced with version 1.4 of the APOGEE data reduction pipeline, and SDSS-IV APOGEE spectra reduced for Data Release 17.
There is one key data product produced by AstroNNDist and Astra:
- `astraAllStarAstroNNDist`: this file contains distances based on combined spectra in the `apStar` files
Validation and Uncertainties
In Figure 3, we show the comparison for a sample of 500 stars between the distances measured in AstroNN_Dist DR19 with DR17 VAC results of astroNN. As these are both trained on DR17 parameters, we expect (and see) excellent agreement in both the distances and the uncertainties.

Flags
Field Name | Bit | Flag Name | Flag Description |
result_flags | 0 | FAKEMAG_UNRELIABLE | Predicted (fake) Ks-band absolute luminosity is unreliable (L_fakemag_err / L_fakemag >= 0.2) |
result_flags | 1 | MISSING_PHOTOMETRY | Missing Ks-band apparent magnitude |
result_flags | 2 | MISSING_EXTINCTION | Missing extinction |
result_flags | 11 | NO_RESULT | Exception raised when loading spectra |
flag_warn | — | WARN | If MISSING_EXTINCTION is set |
flag_bad | — | BAD | If one of the following flags is set: FAKEMAG_UNRELIABLE, MISSING_PHOTOMETRY, NO_RESULT |