A new automated tool for the spectral classification of OB stars

Elias Kyritsis 1,2 , Grigoris Maravelias 3,2 , Andreas Zezas 1,2 , Paolo Bonfini 5,2 , Konstantinos Kovlakas 1,2,4 , Pablo Reig 2,1

  • 1 Department Of Physics, University Of Crete, Heraklion
  • 2 Institute of Astrophysics, FORTH, Heraklion
  • 3 Institute for Astronomy, Astrophysics, Space Applications and Remote Sensing, National Observatory of Athens, Athens
  • 4 Geneva Observatory, University of Geneva, Geneva
  • 5 Computer Science Department, University of Crete, Heraklion

Abstract

As more and more large spectroscopic surveys become available, an automated approach in spectral classification becomes necessary. Due to the importance of the massive stars, it is of paramount importance to identify the phenomenological parameters of these stars (e.g. the spectral type ) which can be used as proxies to their physical parameters (e.g. mass, temperature).
In this work, we use the Random Forest (RF) algorithm to develop a tool for automated spectral classification of the OB-type stars into their sub-types. We use the regular RF algorithm, the Probabilistic RF (PRF) which is an extension of RF that incorporates uncertainties, and we introduce the KDE - RF method which is a combination of the Kernel-Density Estimation (KDE) and the RF algorithm. We train the algorithms on the Equivalent Width (EW) of characteristic absorption lines measured in the spectra from large Galactic (LAMOST, GOSSS) and extragalactic surveys (2dF, VFTS) with available spectral-type classification. By following an adaptive binning approach we group the labels of these data on 11 sub-types within the range O3-B9. We examined which of the characteristic spectral lines (features) are more important to use based on a number of feature selection methods and we searched for the optimal hyper-parameters of the classifiers, to achieve the best performance.
From the feature screening process, we find 13 spectral lines as the optimal number of features. We find that the overall accuracy score is ~ 76 % with similar results across all approaches, with our KDE - RF being slightly lower at ~ 73 %. In addition, we show that our optimized RF model can reach an overall accuracy score of ~ 85 % in the ideal case of robust measurement of the weakest characteristic spectral lines. We apply our model in other observational data sets providing examples of potential application of our classifier on real science cases. We find that it performs well for both single massive stars and for the companion massive stars in Be X-ray Binaries, especially for data with S/N in the range 50-300. Furthermore, we present an alternative model for lower quality data S/N < 25 based on a reduced feature-set classification scheme, including only the strongest spectral lines.
The similarity in the performances of our models indicates the robustness and the reliability of the RF algorithm when used for spectral classification of early-type stars. This is strengthened also by the fact that we are working with real-world data and not with simulations. In addition, the approach presented in this work is very fast and applicable to products from different surveys in terms of quality (e.g different resolutions) and of different formats (e.g., absolute or normalized flux).

Introduction

MOTIVATION

   As more and more large spectroscopic surveys become available, an automated approach in spectral classification becomes necessary. Due to the significance of massive stars, it is of paramount importance to identify the phenomenological parameters of these stars (e.g., the spectral type ) which can be used as proxies to their physical parameters (e.g mass, temperature). 

THIS WORK

   In this work, we use the Random Forest (RF) algorithm to develop a tool for automated spectral classification of the OB-type stars into their sub-types. We use the regular RF algorithm (Louppe, 2014 ), the Probabilistic RF (PRF) (Reis et al., 2019  ) which is an extension of RF that incorporates measurement uncertainties, and we introduce the KDE - RF method which is a combination of the Kernel-Density Estimation and the RF algorithm. We train the algorithms on the Equivalent Width (EW) of 17 characteristic absorption lines measured in the spectra from large Galactic and extragalactic surveys with available spectral-type classification. Furthermore, aiming to build a model not relying on prior Luminosity Class (LC) classification, we took into account all the available LCs (I-V), per spectral type, from each survey (the results presented in the abstract focus on Main Sequence stars but the overall performance is only a few percent worse). We find that the overall accuracy score is ~70 % with similar results across all approaches. The similarity in the performances of our models indicates the robustness and the reliability of the RF algorithm when used for spectral classification of early-type stars. This is strengthened also by the fact that our analysis employs two different methods for measuring EW:  one based on spectral line fitting and the generally used bands-based method. Both methods reach very similar performance. Last but not least, the overall work has been developed based on real-world data and not on simulations.

Spectroscopic data

Figure 1

Figure 2

In order to build a metallicity independent model, we collected available spectroscopic data from large Galactic surveys (e.g. LAMOST, GOSC) and extragalactic surveys (e.g 2dF, VFTS). On top of that,  we took into account all the available LCs, per spectral type, from each survey.

Figure 1 shows the initial spectral-type distribution of our available spectroscopic data. The number of objects per spectral type within the range O2-O6 is very small but later spectral types include a few hundred objects each. This distribution is not optimal for training our algorithms, especially for the underrepresented classes. For this reason, we adaptively bin the spectral types to spectral classes accounting for spectral similarities between adjacent bins.

Figure 2 shows the final spectral class scheme after the application of the adaptive binning. These adaptive spectral classes were fed as training labels to RF algorithm.

Classification scheme and EW measurements

Figure 3

To build an appropriate spectral type classification scheme for our algorithm we constructed a  sample of 17 characteristic spectral lines based on the criteria of Maravelias et al. 2014.  

As is shown in Figure 3 our classification scheme includes both HeI , HeII lines (strong indicators for early-type O-stars) and metal lines such as MgII, SiI, SiII, etc. (indicators of late-type B-stars). In general, despite the fact that Balmer lines are widely used for the spectral classification of OB stars, we intentionally did not consider them since we would like our tool to be applicable to Oe/Be stars.

To quantify the strength of the selected spectral lines (features), we measured their EW. Using the Sherpa fitting package (Freeman et al. 2001), we modeled the lines with a Gaussian profile and their local continuum with a polynomial. This approach allowed us to measure the flux, and consequently the EW of each of them and their corresponding uncertainties while accounting for uncertainties on the data.

In Figure 4 we show the EW distribution per spectral class and per spectral line, as it is measured from the spectral fitting method. For a number of features, the EW distributions are well separated between the different spectral classes (e.g. HeI+HeII/4026, HeII/4541, MgII/4481, etc.) while some of them show strong overlap (e.g.  FeI/4233, HeI/4121, etc.). 

These EW values were fed as training data to RF algorithm. 

 

Figure 4

Results

Figure 7

We tested our approach by training the RF algorithm and its two alternatives, the PRF and the KDE-RF.

Comparing the three models we find that the highest overall accuracy score is ~70 % with similar scores across all approaches, as is presented in the confusion matrices shown in Figure 7. The performance is similar not only in terms of overall score but also in terms of individual spectral classes.  These scores are high if we consider the complexity of such multi-class classification problems (i.e 11 classes), the strong imbalance between the different spectral classes, the diversity of the training set, and the strong overlap between the EW distribution, especially for mid-to-late B-type stars. 

The similarity in the performance of our models indicates the robustness and the reliability of the RF algorithm when used for spectral classification of early-type stars independently of the Luminosity Class of the examined star. On top of that, the proposed KDE-RF method has the advantage of accounting for the correlations between the spectral features.

We note that when we include the LC as a classification label the performance drops significantly due to the very small number of objects in LC I-II. 

Figure 8

We used two methods for measuring the EWs: One based on spectral-line fitting and the generally used spectral bands method.

In Figure 8 we present the one-to-one comparison of
the EW measurements per spectral line and per spectral class between the two methods. With black crosses are depicted the median EW uncertainties per spectral class. As it is shown, the two methods are consistent mainly for the strongest spectral lines (e.g. HeII, HeI/4471 Å, HeI/4144 Å, etc). On the other hand, for weaker spectral lines (e.g. HeI/4009 Å, HeI + HeII/4026 Å, SiIV/4088, SiIV/4116, etc. ) the bands-based method seems to overestimate the EW indicating that in these cases the measurements are dominated by noise. 

This consistency between the measurements of both methods indicates that the score of the RF algorithm is not driven by statistical scatter due to measurement errors. Instead is mainly driven by the intrinsic scatter of the EW values within the range of the examined spectral classes. 

Algorithm optimization

Figure 5

Figure 6

A crucial step in building a machine learning model is the selection of appropriate values for the hyper-parameters.

To optimize these hyper-parameters we plotted the validation curve for each, i.e the accuracy score versus different values of the hyper-parameter, as well as its standard deviation. The behavior of the validation curves is presented in Figure 5.

Based on the validation curves, and a grid search, we optimized the parameters of our RF algorithm.

Besides the optimization of the most important hyper-parameters, another way for improving a model’s performance is to investigate if there is any specific combination of features that can result in a better score. By using the SFFS algorithm ( Pudil et al., 1994  ) we tested the full set of 17 features. 

As it is shown in Figure 6, after a number of 10 features we find that the algorithm's performance does not change significantly. This 10-feature scheme includes mainly the strongest spectral lines for which also the EW distributions show the widest separation between different spectral classes (see Figure 4).

Although a decreased classification scheme produces an almost similar accuracy score to the full set of spectral lines, we included in our analysis all the 17 spectral lines since we are interested in reaching the maximum score for each spectral class where even the weaker lines are needed (this is particularly important for late-B spectral classes).

 

 

Contact details