ConceptioArchivearXiv CS
arXiv CSopen access

The Chandra-Gaia Catalog of Counterparts: Resolving ambiguous Gaia matches to X-ray sources in the Chandra Source Catalog using Machine Learning

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
machine learning, deep learning, neural networks

Draft version June 18, 2026 Typeset using LATEX twocolumn style in AASTeX7.0.1

The Chandra-Gaia Catalog of Counterparts: Resolving ambiguous Gaia matches to X-ray sources in the Chandra Source Catalog using Machine Learning V. Samuel Pérez-Dı́az,1, 2, 3, 4, 5 Vinay L. Kashyap,1 Joshua D. Ingram,1, 6, 7 David Fouhey,5 Juan Rafael Martı́nez-Galarza,1 Pavlos Protopapas,2 Jeremy J. Drake,8 Dong-Woo Kim,1 and Cecilia Garraffo1

arXiv:2606.19329v1 [astro-ph.IM] 17 Jun 2026

1 Center for Astrophysics | Harvard & Smithsonian, 60 Garden St, Cambridge MA 02138, USA 2 Harvard John A. Paulson School of Engineering and Applied Sciences, 150 Western Ave, Allston, MA 02134, USA 3 Universidad del Rosario, School of Engineering, Science and Technology, Cll. 12C No. 6-25, Bogotá, Colombia 4 The NSF AI Institute for Artificial Intelligence and Fundamental Interactions, Cambridge MA 02139, USA 5 New York University, Courant Institute, 60 5th Avenue, New York NY, USA 6 Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, PA 15213 7 New College of Florida, 5800 Bayshore Road, Sarasota, FL 34243, USA 8 Lockheed Martin Solar and Astrophysics Laboratory, 3251 Hanover St, Palo Alto, CA 94304, USA

Submitted to ApJ ABSTRACT We present a framework to cross-match sources from the Chandra Source Catalog (CSC v2.1) with optical sources from Gaia Data Release 3. Unlike purely spatial approaches, we use source properties such as magnitudes, colors, and distances to identify true counterparts, detect chance coincidences, and resolve ambiguities when multiple plausible candidates exist. We define a training set of high-confidence matches using NWAY, a Bayesian cross-matching framework that accounts for positional errors and source densities. We train a gradient-boosted classifier (LightGBM) on a variety of features from both catalogs. Of the ≈254k unique X-ray sources, we find counterparts for ≈113k sources, of which plausible multiple counterparts are found for ≈7k. We find no counterparts for ≈20k sources for which separation-based cross-matching does find a match, and attribute half of these to chance coincidences. We validate the pipeline on the Chandra Orion Ultradeep Project (COUP), where the machine-learning matches reproduce 95% of NWAY cross-matches without using any positional information. We release a catalog of the ≈113k Chandra-Gaia counterparts, together with ≈7k alternative matches and ≈20k ambiguous NWAY associations, supporting future population studies of sources detectable by both Chandra and Gaia. We discuss limitations and provide a generalization of the framework that is applicable in other cross-matching scenarios.

Keywords: X-ray surveys (1824), X-ray stars (1823), Gaia (2360), Computational methods (1965), Catalogs (205) 1. INTRODUCTION

The correct identification of a source in a catalog, allowing for evaluations of statistical completeness (Tak et al. 2024), is a critical factor in astronomical inference. Cross-matching across multiple catalogs is an essential part of this identification process, and is a fundamental driver for accurate classifications and analyCorresponding author: Vinay L. Kashyap [email protected]

ses. With surveys now cataloging billions of sources across multiple wavelengths, the need for reliable and automatic cross-matching systems becomes imperative. Traditional approaches to catalog cross-matching predominantly rely on positional information; the simplest strategy is nearest-neighbor matching within a fixed radius. Although effective for optical and infrared surveys with precise astrometry, these methods struggle in densely populated sky regions or when positional uncertainties are large, or when there is an imbalance in astrometric precision between the catalogs being matched.

2 Robust Bayesian cross-matching frameworks have been developed by treating matching as an inference problem: Budavári & Szalay (2008) formalized the computation of match probabilities using Bayes theorem, incorporating positional uncertainties and priors on source properties. This approach has been extended in several works and is the foundation for more advanced Bayesian methods in cross-matching (Czesla et al. 2023). More recently, methods leveraging multi-wavelength properties have emerged, significantly improving cross-match reliability. A leading example is NWAY (Salvato et al. 2018), which extends the Bayesian framework by incorporating observational properties like optical and infrared magnitudes as priors. NWAY provides posterior probabilities for every potential counterpart, including the possibility of no counterpart at all. NWAY has become a key baseline tool in recent astronomy cross-matching efforts, notably adopted in studies such as for the eROSITA mission (Brunner et al. 2022; Schneider et al. 2022; Kim et al. 2023). Comprehensive reviews on cross-matching methodologies can be found in Salvato et al. (2018); Budavari & Loredo (2015); Czesla et al. (2023). While Bayesian multi-parametric cross-matching improves significantly on purely positional methods, it relies heavily on carefully constructed priors for each included physical property. Furthermore, adjustments to computed probabilities are done on a population level, and not on an individual basis. Building these priors can be challenging and labor-intensive, particularly given the complexity and diversity of astronomical datasets. With catalogs becoming larger and more precise, there is now a clear need for a systematic and flexible approach that fully leverages multidimensional catalog data. Recent efforts have addressed this challenge by integrating machine learning (ML) techniques directly into the cross-matching pipeline. The eROSITA team developed several applications of this concept, by using a machine learning classifier and feeding it as prior to NWAY (Salvato et al. 2022; Collaboration et al. 2025), and to provide final classifications of stellar sources Schneider et al. (2022). Freund et al. (2022, 2024) extended these approaches to identify stellar (coronal) X-ray emitters across the entire ROSAT all-sky survey and the eROSITA all-sky survey (eRASS1), respectively. Crossmatching X-ray sources with optical catalogs will help with filling in the gaps on the evolution of stellar magnetic activity by allowing confrontations with state-ofthe-art models. Chandra’s long mission duration has allowed for the development of an extensive database of targeted detections of X-ray sources covering a large portion of the sky (CSC; Chandra Source Catalog, Evans et al.

2020, 2024). In the most recent release, CSC2.1 (Evans et al. 2024), 1.3 million individual detections (comprising 407,806 unique X-ray sources) are available with photometric, variability, and spectroscopic information. Several groups have cross-matched the CSC with other catalogs like SDSS (Green et al. 2024), ALLWISE and Gaia (Rots et al. 2018, 2020). Of these, the Gaia (Gaia Collaboration 2016; Marrese et al. 2019) Data Release 3 (Gaia DR3 Vallenari et al. 2023), comprising almost 1.8 billion sources, is of special interest because of its comprehensive depth, sky coverage, high positional precision, availability of reliable parallaxes, and focus on galactic (stellar) populations. Matching CSC to Gaia DR3 allows subsequent follow-up studies of stellar evolution to be carried out reliably. In this work, we describe a method to assign reliable Gaia counterparts to X-ray sources from the Chandra Source Catalog. The method assigns matches using the properties of the individual sources, and we present the results in a comprehensive catalog. Since Gaia sources are heavily weighted towards being stars, such a catalog supports important studies in stellar astrophysics, such as constructing detailed luminosity functions and investigating the physical processes driving the evolution of stellar X-ray activity. The cross-match procedure we present is easily generalizable and can be extended to include other combinations of catalogs, as well as other astrophysical objects detectable by both Chandra and Gaia, such as quasars, active galactic nuclei (AGN), and other extragalactic or variable sources (Rimoldini et al. 2023). Specifically, we describe: • A cross-match procedure based initially on positional information and uncertainties, using the NWAY algorithm (Salvato et al. 2018). • A statistical analysis of Gaia magnitude distributions for counterparts to X-ray sources, providing insights into limitations of purely positional crossmatching and the construction of a reliable dataset for machine learning. • A machine-learning based pipeline for identifying counterparts using catalog properties only. • An approach to selecting appropriate thresholds for the machine-learning classifier, based on physical and instrumental limitations. We describe the databases we use in Section 2, specifically the Chandra Source Catalog v2.1 (Section 2.1) and the Gaia DR 3 (Section 2.2). We describe the steps in our cross-matching process in Section 3, where we show how separation-based methods like NWAY are used

3 (Sections 3.1,3.2), define our positive and negative sets for training, validation, testing, and verification (Sections 3.4-3.7), describe the properties used for the crossmatching (Section 3.8), and provide details of the ML implementation (Section 4.1,4.2). We discuss the performance of the algorithm in Section 4.3, highlighting various measures of validity (Section 4.4), and compare our results with previously studied surveys (Section 4.5). We present the catalog of cross-matches in Section 5. We discuss its structure in Section 6, and in particular outline the framework of the process that can be generalized to other scenarios in Section 6.2. We summarize this work in Section 7.

2. DATA

2.2. Gaia: The Gaia Data Release The Gaia DR 3 (GDR3) (Vallenari et al. 2023) provides accurate astrometry and photometry for ∼1.8 billion sources across the full-sky. Remarkably, Gaia DR3 includes classifications for ∼1.5 billion sources, many machine-learning based (Rimoldini et al. 2023), along with parallaxes, proper-motions, and BP − RP colors. Additionally, mean radial velocities are included for ∼33 million stars. Some 6.6 million quasar candidates and 4.8 million galaxy candidates can be encountered in the catalog, with redshift estimates for most quasars and ∼1 million galaxies. Gaia DR3 includes sub-milliarcsec precise measurements of positions, proper motions, parallaxes, and with magnitudes in multiple photometric bands, making it ideal for characterizing a diverse set of astrophysical objects. In this paper, we refer to this dataset as the Gaia DR3, GDR3 or Gaia.

2.1. CSC: The Chandra Source Catalog The Chandra Source Catalog (CSC) provides the final collection of summarized properties and data products of the sources detected by the Chandra X-ray Observatory in its history. In its version 2.1 (CSC v2.1), the catalog covers a sky area of ∼730 deg2 (≈1% of the sky), and lists 407 806 X-ray detections in 15 533 observations (Evans et al. 2020, 2024). Properties are usually measured in 5 energy bands within the energy range of 0.2 − 7.0 keV for the Advanced CCD Imaging Spectrometer (CCD), and one broad energy band (0.1 − 10 keV) for the High Resolution Camera (HRC). The catalog lists source positions, detection significance, spatial extent, source intensities, hardness ratios, fit parameters for some nominal spectral models, and temporal variability estimates. Due to the unprecedented spatial resolution of Chandra, the CSC v2.1 contains the most accurate and precise positions of X-ray sources available, and is therefore the ideal source for multi-wavelength source matching and characterization. The CSC source and detection properties are organized in three principal tables: Master Sources, Stacked Observation Detections, and Individual Observation Detections. In this work, we use the Master Sources table, as it presents the best estimate properties for each distinct X-ray source on the sky, including position. This is done by combining the data of all the source’s uniquelyassociated individual detections and observations. We extract the off-axis angle θ as the minimum average offaxis (property theta mean) from all uniquely associated stack detections. This represents the most on-axis detection for every given X-ray source, which have a greater weight over the properties in the Master Table. In this paper, we refer to the Chandra Source Catalog 2.1 as CSC v2.1 or CSC.

3. CROSS-MATCHING

3.1. NWAY as precursor As a first step of our pipeline, we perform a positionalbased cross-match of the complete CSC v2.1 and GDR3 using NWAY9 (Salvato et al. 2018). NWAY provides the probability of a counterpart being the correct one (referred to here as pi or p i) and the probability that any of the possible counterparts is the real one (pany or p any). For a description of these probabilities, see Appendix A. For each X-ray source, we search for optical counterparts within a radius of 15′′ , which covers several times the maximum positional error of Chandra (see Appendix C). This set of Gaia sources forms the initial candidate pool to test for matches. To account for the non-uniform sky coverage of Chandra compared to Gaia (former is pointing based-detection, the latter is an allsky survey), we set the prior completeness factor c (i.e., the prior expected fraction of reliable counterparts) to 0.5. As a result, we get a preliminary cross-match based only on positional information, accounting for sky coverage and positional errors in both missions. We keep every possible association of the output for later analysis. A census of the associations is in Table 1. Of the 407 806 unique X-ray sources in CSCv2.1, 254 309 have Gaia sources within 15′′ , yielding a pool of 2 402 340 candidates. The remainder have no Gaia candidates within the search radius and are not considered further in this work. On average, each unique Chandra source in the 9 We

use NWAY v4.5.2; see https://github.com/ JohannesBuchner/nway. There are also other equivalent methods, such as XMATCH (Rots et al. 2020; Rots 2025), but for the sake of simplicity and ease of comparisons we limit our analysis to NWAY.

4 Table 1. Census of CSC2.1-GDR3 associations after a preliminary NWAY run.

Metric

Number

CSC sources with potential Gaia candidates Gaia candidates with separation ≤ 15′′ CSC sources with pany ≥ 0.5 Gaia counterparts for pany ≥ 0.5 CSC sources with > 1 Gaia candidate within 15′′ Maximum candidates for a single CSC source

254 309 2 402 340 122 192 1 169 082 166,269 297

output table has ∼9 potential counterparts. About one third of the sample has a single possible counterpart, and about two thirds have less than 5. These numbers provide a foundation to understand the complexity of the particular matching problem at hand. In Figure 1 we present the sky distribution of all the CSC2.1 sources from this output, with the density of potential optical candidates per X-ray source as the color scale. We observe some expected trends in this density, such as a dense cluster in the galactic center. These dense regions also correspond to where most of the ambiguity is expected. Figure 2 shows the gmag magnitude vs BP − RP for the Gaia sources that NWAY considered as matches to X-ray sources. The densest region of this distribution corresponds to the faintest, redder (BP − RP ≥ 0) sources. This is consistent with stellar X-ray populations, where X-ray flux is proportionally higher compared to bolometric flux (Freund et al. 2022). 3.2. Distinguishability of Property Distributions After the initial separation-based cross-match using NWAY, we investigate whether there are significant distributional differences in the properties among the counterparts for a given X-ray source. This provides an indication as to when solely separation-based cross-matching becomes unreliable at a distributional level, and acts as a guide for constructing a reliable data set for training the machine learning model for property-based crossmatching. For the measurement of mean gmag magnitude, we conduct a two-sided two-sample Kolmogorov-Smirnov (K-S) test (Smirnov 1948) to determine the distinguishability of the property distributions of the most-likely counterparts (highest pi ) and least-likely counterparts (lowest pi ) at varying separation bins and off-axis angle ranges. These separation bins are determined by countbased range cutoffs, which are determined by the range required for a bin to contain a sample of 1000 counterparts for the most-likely counterparts. We then divide the bins by the off-axis angle ranges of 0′ − 3′ , 3′ − 5′ ,

and > 5′ , and any sources which do not have separation or off-axis measurements are dropped from the analysis. After applying these filters to construct various samples, we conduct the two-sided two-sample K-S test for all possible combinations of separation and off-axis angles. If a p-value is less than 0.10, we consider this to be an indication that the distributions of the most-likely and least-likely counterparts from NWAY are distinguishable, and thus different, from one another. In contrast, if p > 0.1, we consider the two distributions are not distinguishable. We show the run of p-values in Figure 3 for these distributions for Gaia gmag band magnitudes. There is a clear trend in the p-values, with the distributions becoming indistinguishable at separations ≳ 1.3′′ . There are small differences when the samples are stratified with off-axis angle θ. This suggests that separation-based NWAY matches become unreliable when the counterparts are more than ≈1.3′′ apart. We thus construct our positive set (see below) by considering only those counterparts that are closer than this critical separation threshold. 3.3. Cross-matching as binary classification As we demonstrate above, matches based solely on spatial separation become unreliable on average beyond a certain critical separation. To resolve the ambiguities that result from that, we formulate the task of catalog cross-matching as a binary classification problem that takes advantage of additional catalog properties. For each candidate association between a source in the primary catalog (e.g., CSC) and an entry in the secondary catalog (e.g., Gaia), we define a binary target variable y ∈ {0, 1}, where y = 1 if the candidate is a true counterpart, and y = 0 otherwise. The model takes as input a set of mixed properties from both catalogs (e.g., magnitudes, flux ratios, color indices, classification labels, etc), and outputs a realvalued score pML . We treat the score pML as a measure of the degree of certainty that the candidate association is correct. The final predicted class ŷ is then obtained by applying a threshold to pML , and further selection criteria over properties. We train a machine learning model to follow this scheme, without using any positional information so that it learns a signal based only on properties. In order to do that, we define a series of positive and negative sets (see below). In a broader sense, recent work treats the binary classification problem as modeling the question “Is this source an X-ray emitter? ” (Salvato et al. 2022; Collaboration et al. 2025) for feeding it into NWAY as a prior. In this work, we formulate the question “How likely is it

5

75° 60°

102

45°

15° 0°

101

-15°

avg Gaia matches

30°

-30° -45° -60°

100

-75°

Figure 1. Sky histogram-distribution of all CSC2.1 sources with a potential Gaia counterpart within 15′′ . Each bin is colored based on the average number of potential Gaia counterparts per X-ray source (avg nmatch ). The color scale is logarithmic.

102

10 101

15

log density

gmag [mag]

5

20 0 5 BP − RP [mag]

100

Figure 2. Color-magnitude diagram for all Gaia sources which were selected as best matches by NWAY (i.e., pany ≥ 0.5 and max{pi }). The surface densities of (gmag , BP − RP ) are shown as a hexbin plot (constructed using matplotlib.pyplot.hexbin) on a logarithmic color scale (see color bar at right).

that this set of properties are associated with the same source? ”. We treat this step as a separate matching criterion (property-based) to NWAY (separation-based). Thus, we do not feed the score as a prior but rather use the score as a complementary discrimination factor after the spatial cross-match. 3.4. The Positive Set To construct the positive set, we select the most probable Gaia counterpart for each CSC2.1 source. Specifically, for each X-ray source, we take the candidate with

Figure 3. Separation plotted against the p-value from the two-sample K-S test to determine after which separation the distributions of mean gmag magnitude for the most-likely and least-likely counterparts become distinguishable, which is approximately 1.3′′ or more. The colors of the points correspond to different off-axis angles, the blue solid line is the moving average of the p-values across the different off-axis ranges, and the vertical red solid line is the minimum separation for which the (average) p-value is at least 0.10 (1.3′′ ).

the maximum pi , and apply the following selection criteria: separation ≤ 1.3′′

for off axis angle θ ∈ [0, 3] arcmin pany ≥ 0.5 and pi ≥ 0.9 .

(1)

The value of 1.3′′ for the separation threshold was derived from the analysis described in Section 3.2. Choosing pany ≥ 0.5 and pi > 0.9 ensures that the sample

6 is dominated by high-confidence, unambiguous associations. Each pair that satisfies these constraints is considered a true match and is assigned the label y = 1.

Negative samples are defined as candidate Gaia associations to the same CSC2.1 sources that do not meet the positive selection criteria. We define three types of negatives: Clear negatives —For each CSC source in the positive set,

we identify the non-selected candidate with the largest separation, requiring at least separation ≥ 5′′ . These cases are labeled as clear negative. Intermediate negatives —We also include all other nonselected candidates for the same sources that satisfy separation ≥ 5′′ , but are not the farthest. These cases are labeled as intermediate. Random negatives —We augment the clear and intermediate cases with randomly sampled Gaia sources. Specifically, for each positive match, we sample k unrelated Gaia sources uniformly from a pre-filtered sky catalog that excludes the 15′′ radius around any CSC source footprint center. These samples are coupled to the CSC sources by repeating each X-ray row k times and pairing it with k independent Gaia entries. This results in a set of synthetic negative associations that are guaranteed to be spatially unrelated to any known X-ray source. To make their status explicit, we assign placeholder values to properties that depend on real possible associations (e.g., separation). These cases are labeled as random. Only candidates associated with CSC sources that appear in the positive set for the [0, 3]′ off-axis range are considered. All negatives are labeled with y = 0. Following this procedure, we obtain a clean and consistent training dataset with one reliable positive match and multiple realistic negative candidates per X-ray source. It captures both trivial and challenging examples of non-associations. Note that the negative set does not include X-ray sources that are not in the positive set. This ensures that the classifier learns to distinguish true Gaia counterparts from chance associations for sources of the same type, under the same conditions, and this similarity to the positive set enables it to achieve high out-of-distribution performance (Ursu et al. 2025). In Figure 4 we show a density plot of the gmag magnitude versus angular separation to the X-ray source for all Gaia sources in the the positive and negative set. The negative set is subdivided in the intermediate and clear negative. We do not include the random cases, as by construction they lack a separation.

intermediate

clear negative

5 gmag [mag]

3.5. The Negative Set

pos

10

0

1

15 20 0

5 10 Separation [arcsec]

15

Figure 4. Separation of positive and negative sets. Densities of the Gaia gmag versus angular separation of putative Gaia matches are shown for the positive set (green shaded densities at left and in the inset), the intermediate negatives (blue shaded densities at right) and clear negatives (red contours superposed on the intermediate negatives) are shown. The inset of the positive set zooms in to the separation range of 0-1′′ along the X-axis but covers the same gmag range along the Y-axis as the main plot. Notice that the marginalized gmag distributions are clearly different for the positive and negative sets.

3.6. Training, Validation, and Test Sets From the previous process, we get a positive set of 30 279 unique associations, and a negative set of 310 020 associations without including random negatives. Already, we observe a very high imbalance between positives and negatives in our dataset, so it is necessary to tune the multiplier hyperparameter for the amount of random random negatives in the training set, as well as sample reweighting to account for the class imbalance. We discuss how this is accounted for in Section 4.1. We randomly split the positive set into training, validation, and test subsets using an 80/20 approach. We set aside the first 20% of the sources as test set for the final evaluation of the model performance. The remainder is further split in the same proportions, with 80% of the 80% (64% of the total) subset is used for training, and 20% of the 80% (16% of the total) is used for validation. The validation and test subsets include all Gaia candidates within 15′′ of each CSC source; i.e., we compute the individual NWAY probabilities pi for each Gaia candidate. In order to facilitate the evaluation of metrics like precision and F1 score (see below), the best Gaia counterpart for each X-ray source is labeled 1, and the remainder are labeled 0. 3.7. Verification set The data split described before was specifically set up for the machine learning component of the pipeline.

7 This is just a step of the counterpart selection criteria, and thus we need a way of verifying how the full pipeline performs on a carefully selected set. We use the COUP survey (Chandra Orion Ultradeep Project; Getman et al. 2005b,a) as our verification set, and present an analysis of the cross-matches in it in Section 4.5. 3.8. Features Features were selected from properties available in both catalogs and external studies. We included as many as physically motivated, as the gradient boosting framework naturally down-weights uninformative properties via feature importance. Table 2 summarizes the full set of 32 properties we use as input to a model. Alongside the catalogue properties, we include machine-learning based classification labels from Yang et al. (2022); Pérez-Dı́az et al. (2024). These labels might give the model an informed prior on hard cases it might otherwise mislabel. 4. IMPLEMENTATION

4.1. LightGBM In order to obtain a cross-matching score based only on non-spatial catalog properties, a model that extends beyond prior models for certain quantities is needed. In this work, we use LightGBM (Ke et al. 2017) as our classifier. LightGBM is a gradient boosting framework based on decision-tree methods, used to solve many machinelearning tasks—like classification—in an efficient way. It uses histogram-based splitting, making it significantly faster and more memory-efficient than other similar methods. Unlike classical gradient boosting, LightGBM grows trees leaf-wise rather than level-wise, which often leads to better accuracy. We selected LightGBM for two main reasons: its speed, which allows us to run extensive hyperparameter searches efficiently, and its consistently strong performance on tabular datasets like ours. Gradient boosting on tabular data is a well established standard, and performs equivalently or better than other methods (Ke et al. 2017; Grinsztajn et al. 2022; Hollmann et al. 2025). Additional advantages include native support for missing values and categorical features. We train a LightGBM model to perform binary classification, assigning a label of 1 (positive) to true matches and 0 (negative) to non-matches. We augment the negative set by upsampling five (k = 5) random Gaia sources per Chandra source, following the data procedure described before. Given that our dataset contains a high imbalance, training a model directly on this data would cause it to bias toward predicting negatives. To counter this, LightGBM adjusts the weight of each

positive sample proportionally to the class imbalance N (wpos = Nneg ). The final negative set for training inpos clude clear negative, intermediate, and random negatives. This setting up-weights the positive (minority) class, which shifts the output scalars away from true probabilities. We therefore treat these as uncalibrated ‘scores’ and set our ML-match threshold empirically in Section 4.2.2. We optimize hyperparameters using a randomized grid search with 200 iterations and 5-fold crossvalidation. We select the best model from a set of hyperparameter tuning runs, experimenting with different amounts of random negatives and investigating the impact of including intermediate negatives. Further training details are provided in Appendix B. Feature Selection —We evaluate the importance of each feature by analyzing their contribution to model performance. We evaluate it using two methods: (i) permutation feature importance, where each feature is randomly permuted and the model performance is checkde to see how much it degraded, and (ii) using LightGBM’s model internal importance score, which measures the number of times a descriptor is used as a splitting node across all decision trees. We list this split importance value in Table 2 as a guide to the relative value of each feature. Both methods consistently find that color indices, magnitudes, and fluxes are the most important features. This is an expected result, given known relations between X-ray and optical flux and the clustering of objects in color-magnitude space. We find no performance gain from removing features, and thus follow the standard approach of retaining all features that may carry signal and are scientifically motivated.

4.2. Criteria for Selecting Counterparts 4.2.1. Limit on maximum separation Our method does not rely directly on the separation of sources in the disparate catalogs. However, it does use information on spatial closeness in two stages: first, to set up the Positive Set (see Section 3.4), and second, to discard matches at large separations. The former condition is necessary because a ground truth labeled sample does not exist, and as we show in Figure 3, extremely small separations are a useful diagnostic of matching. The latter condition is necessary to rule out matches that may be deemed meaningless because they are separated by angular distances larger than expected due to statistical or systematic uncertainties in the respective positions. The model assigns a score pML to each potential X-ray-optical match. However, this score alone cannot guarantee reliable counterpart identification by itself. Indeed, excellent matches by properties could oc-

8 Table 2. Features used in the LightGBM classifier, and the split importance factor for each feature.

Feature

Description

Split Importance (%)

Photometry (Gaia) phot g mean mag phot bp mean mag phot rp mean mag phot g mean flux phot bp mean flux phot rp mean flux

Mean gmag magnitude Mean BP magnitude Mean RP magnitude Integrated gmag -band flux [electrons s−1 ] Integrated BP flux [electrons s−1 ] Integrated RP flux [electrons s−1 ]

4.3 2.8 3.3 3.6 2.2 3.2

BP − RP color BP − gmag color gmag − RP color

4.9 3.7 5.3

Derived colors (Gaia) bp rp bp g g rp

X-ray flux and colors based on CSC passbands (Chandra) photflux aper b hard hs

X-ray net photon flux in the broad band [photons s−1 cm−2 ] Hardness ratio, hard (H) and soft (S) bands HRHS = H−S H+S

6.9 4.7

hard hm

Hardness ratio, hard (H) and medium (M ) bands HRHM = H−M H+M

4.0

hard ms

−S Hardness ratio, medium (M ) and soft (S) bands HRM S = M M +S

4.3

Intra/inter-observation variability (Chandra) var intra prob b var intra index b var inter prob b var inter index b var inter sigma b

Intra-obs variability probability, broad band Intra-obs variability index, broad band Inter-obs variability probability, broad band Inter-obs variability index, broad band Inter-obs flux variability, broad band

3.9 0.9 2.8 0.7 3.5

Extended/Flux/Variability Flag (Chandra and Gaia) extent flag phot variable flag

X-ray source is extended flag Gaia variability flag

0.2 0.4

Catalogue classifications (External and Gaia) yangetal gcs class yangetal training class perezdiazetal class classprob dsc combmod quasar classprob dsc combmod galaxy classprob dsc combmod star

Supervised-learning class (Yang et al. 2022) Training classes (Yang et al. 2022) Unsupervised-learning class (Pérez-Dı́az et al. 2024) Probability of being a quasar Probability of being a galaxy Probability of being a star

3.8 0.5 0.2 4.9 4.9 4.4

Parallax [mas] Uncertainty on parallax [mas] Proper motion [mas yr−1 ] Radial velocity [km s−1 ] Spectral line broadening [km s−1 ] Distance estimate [pc]

4.2 4.3 5.0 0.4 0.1 1.7

Astrometry (Gaia) parallax parallax error sqrt(pmraˆ2 + pmdecˆ2) radial velocity vbroad distance gspphot

9

σerr (θ) =

(0.1′′ )2 + (0.5′′ )2 +

σPSF (θ) 3

2

+ σPSF (θ)2 ,

(2) ECF where σPSF := R90 /2.15 (see Equation C1; a description of how the 90% enclosed counts fraction radius, ECF R90 , is estimated is given in Appendix C). This expression is constructed as a combination of several sources of error: the first term represents potential proper motion effects; the second term describes the Chandra astrometric precision; the third describes the expected statistical precision for typical sources; and the fourth accounts for possible contamination due to unrecognized overlaps. Notice that the threshold errs on the side of inclusion, i.e., we seek to minimize the chances of missing a true counterpart. We then convert σerr (θ) to a discrete-valued, maximum acceptable separation threshold rmax (in arcseconds) by rounding it up to the next upper integer, i.e., rmax = ⌈σerr (θ)⌉. We enforce a floor of 1.5′′ at θ < 3′ and cap the threshold at 10′′ for θ > 12′ to prevent an excessive number of unlikely candidates. The floor accounts for possible proper motion as well as the documented Chandra absolute astrometric 90% uncertainty10 of 1.2′′ . Specifically, the final separation acceptance thresholds are rmax = 1.5′′ for θ ≤ 3′

= 2′′ for 3′ < θ ≤ 4′ = 3′′ for 4′ < θ ≤ 6′ =

...

′′

= 10 for θ ≥ 12′ .

(3)

Only matches with separations below the computed rmax (θ), and with ML classification scores above the selected threshold (Section 4.2.2), are considered a machine learning match. The separation threshold closely bounds the expected X-ray position errors in the CSC sources we use (see Figure 5; position errors dominate 10 See

CXC memo at https://cxc.harvard.edu/cal/ASPECT/ celmon/

10

CSC position error [arcsec]

cur at unjustified large separations (as a trivial example, a match found at a separation of 180o must be discarded as a chance match of the properties). Thus, we set a maximum separation threshold beyond which ML matches are discarded. This threshold is used as a binary choice; if pML > 0.466 for any Gaia source with a smaller separation, it is kept as a counterpart, and discarded entirely if it exceeds the threshold separation. We set the threshold by utilizing an expected error as a function of off-axis position, r  

8

6

4

2

0

0

2

4

6

8

10

12

θmin [arcmin] Figure 5. Hexbin density plot of the CSC Positional Error (PE) for all CSC sources with at least one Gaia candidate as a function of the minimum mean off-axis angle. Here, p PE = errmaj2 + errmin2 , where errmaj and errmin are CSC variables representing the uncertainties along the major and minor axes of the ellipses fitted to the sources. Also shown as the solid stepped line is our adopted separation threshold rmax , which bounds the CSC PEs.

other sources of uncertainty at large off-axis positions). All Gaia sources at separations < rmax (θ) are tested for cross-matching with the ML model, and are reported in the catalog below (see Section 5). 4.2.2. Machine learning score threshold In the previous section, we describe how we select a set of separation thresholds for different off-axis intervals based on Chandra’s instrumental limitations. This selection is independent of any model score, but determinant on bounding the amount of candidates to a physically-motivated regime. This way, the model’s selection is fine-tuned. We treat it separately from NWAY’s spatial criteria, as we consider both pipelines independently. At the end, we select reliable matches combining the results of both pipelines: spatial, and property/instrument-based. For selecting the model’s candidates, we must select an appropriate threshold of the model’s score in which a candidate is determined to be a match or non-match. We consider two ways: Chance coincidence threshold —We bound our matchscore threshold by computing an estimated probability of chance coincidence, and then empirically selecting

10

4

2

41253 deg , and thus ρ ≈ 4.4 × 10 deg . For a matching radius r = 1.3′′ (Section 3.4) for each X-ray source, we have a total area of Asrc = π · (r/3600)2 deg2 ≈ 4.1 × 10−7 deg2 . Then, the chance-coincidence probability is the product of the area of the X-ray sources times the density of Gaia, Pchance = ρ · Asrc ≈ 0.0176 .

(4)

We then compute the empirical CDF for pML over the Validation Set, and linearly interpolate to find the score corresponding to the chance-coincidence probability percentile. This is shown in Figure 6, and any candidate for which pML < 0.466 is rejected as a likely false match. Note that Pchance uses the global average Gaia source density and is therefore a conservative lower bound. Users interested in denser fields (e.g., the Galactic plane) should adopt a correspondingly higher proportion of chance coincidence, which leads to a higher pML threshold. The catalogs we construct (see Section 5 below) list the value of pML , and smaller values can be filtered out as needed, reducing the total number of ML matches. ROC threshold —As an alternative, one may select the threshold from the classifier’s Receiver Operating Characteristic (ROC) curve by maximizing the Youden index, J = TPR−FPR, where TPR refers to true-positive rate and FPR refers to false-positive rate, or by fixing an acceptable false-positive rate directly on the validation set. We analyze the results given by this approach as well as the chance-coincidence.

4.3. Performance We analyze the machine learning model test performance in the proxy binary-classification task out of the box (without any additional criteria), and with the additional separation/off-axis thresholds. We select a threshold for the machine learning model selection, based on the chance-coincidence probability analysis. Then, we analyze and compare the machine learning based cross-matches with NWAY’s separation-based counterparts. We deploy the model for the verification region and verify its agreements and differences with NWAY. Finally, we deploy the model in the full counterparts dataset. 4.4. Baseline ML model performance We train the model as described in Section 4.1. The model achieves an AUC-ROC (Area Under the Curve of the ROC curve) of 0.894 on the validation set and 0.898

0.03

cutoff = 0.466

2

0.04 proportion

a score that reflects this probability from an empirical cumulative-distribution function. The Gaia density is G ρ = ANsky , where NG = 1 811 709 771 and Asky = 4π sr ≃

0.02 chance coincidence 0.01 0.00 0.0

0.2

0.4

0.6

pML Figure 6. Defining the threshold for acceptance of the ML score for matching, pML . The empirical cumulative distribution of pML for the validation set is shown as the blue curve (dashed blue curve in the inset graph). The proportion that corresponds to chance coincidence is marked as the horizontal black line, and the corresponding pML score threshold is marked with a vertical green dashed line. Only cross– matches with scores of pML ≥ 0.466 are retained as valid counterparts.

on the test set. The model is saved and used for the analysis presented in the following sections. We select the machine-learning threshold as described in Section 4.2.2. Figure 6 shows the empirical cumulative distribution function (CDF) of the machine learning probabilities in the a subset of the validation set, and where the computed probability of chance coincidence falls. For constructing this CDF, we take a particular subset of the validation set to ensure that the selected counterparts are reliable. The criteria are as follows: their NWAY probabilities pi and pany are greater than 0.9, and the selected counterpart is the only possible counterpart within the predefined radius (15′′ ); they are isolated counterparts in the sky. Figure 7 shows the ROC curve in the validation set, with the thresholds determined by the chancecoincidence and the Youden index highlighted. As observed, the thresholds vary by ∼0.01, and thus will perform equivalently. Therefore, we decide to use the chance-coincidence threshold for the subsequent results in this paper, as it is physically motivated. With the selected threshold, we derive metrics on the test set. We achieve a precision of 0.31, and 0.98 in the negative predictive value. We obtain a recall of 0.79 and an overall F1-score of 0.44. The discrepancy of the precision and recall are a result of the model’s lack of spatial properties and the imbalance towards negatives, making it confuse many as positives and biasing the metrics By incorporating the separation thresholds defined in Section 4.2.1, we counteract this effect.

True Positive Rate

11

1.00 0.75 0.50 Chance coincidence Youden index

0.25 0.00 0.0

0.2

0.4 0.6 0.8 False Positive Rate

1.0

Figure 7. Receiver Operating Characteristic (ROC) curve from the training and validation sets. We highlight the thresholds selected by the chance-coincidence percentile (blue, dashed) and maximizing the Youden Index (red, dashdot). Table 3. Comparing ML and NWAY matches in the Test Set.

Metric Potential Gaia counterparts (within 15′′ ) Size of Test Set NWAY matches Recall (NWAY and ML agree) ML and NWAY matches are equal and unique ML does not find a match ML finds multiple matches ML finds a different match than NWAY

Number 73 779 6 056 6 056 4 790 4 710 1 162 80 0

We apply our chosen separation thresholds in combination with the machine-learning threshold to define ML-confident counterparts. On the test set, this results in a precision of 0.98, negative predictive value of 0.98, recall of 0.79, and F1-score of 0.87. To measure how the ML set overlaps with NWAY’s matches, we compute the Jaccard index (intersection/union), which results in Jacc = 0.78. The fact that the classifier is not perfectly aligned to NWAY’s ground truth is a desired effect, as it is expected that a spatial ground-truth has errors by construction. We value, however, that the model is able to recover a signal from the properties. Table 3 summarizes the per-X-ray-source agreement between the two pipelines. 4.5. Example: The Orion Nebula Cluster In order to explore the characteristics of our crossmatching method in greater detail, we compare our results to the COUP survey (Chandra Orion Ultradeep Project; Getman et al. 2005b,a). COUP found 1 616 X-ray sources in ≈840 ks of exposure time, and iden-

Figure 8. Comparison of COUP and CSC matches. The separations between COUP/OIR matches and CSC/Gaia matches are shown as a function of off-axis position. There is no discernible difference in the scatter of the separations between either COUP/OIR (filled black squares), or the CSC/Gaia matches for NWAY (filled red circles) or ML (open blue diamonds) methods. They all follow similar trends and similar variances.

tified 1 323 of them with optical and infra-red (OIR) sources based on proximity. With CSC, we find 1 397 Xray sources within a radius 11.84′ of the COUP survey center at (RA,Dec)2000 =(05:35:17.0399, -05:23:39.8405), 1 282 of which can be confidently associated with COUP X-ray detections11 . Because COUP relies on spatial proximity to associate X-ray with OIR, and there are significant differences in passband coverage and completeness between the OIR and Gaia catalogs, COUP cannot serve as a ground truth survey. However, as we show in Figure 8 and Table 4, our method shows a remarkable overlap with COUP, comparable to what would be achieved with NWAY alone. For instance, we find that 1, 015 of the CSC sources have the same ML matches as NWAY, and 917 also have COUP counterparts with OIR matches. A total of 11 Even

though both COUP and CSC are based on the same Chandra observations, there are small algorithmic differences in the data processing, detection algorithm, and merging of results from multiple ObsIDs, which induce systematic shifts in the estimated positions of weak, off-axis, or confused sources. In order to figure out which CSC sources are also present in COUP, we searched for the nearest COUP source to each CSC source, and found that they were strongly clustered at 0′′ .12±0′′ .14, but with large outliers, and a dependence on the off-axis position θ. We fit a straight line to log separation(θ) minimizing the least absolute deviation for robustness against outliers, adjusted the intercept of the fitted line (but not the slope) to include the peak and a 3-standard deviations width of the distribution. The limiting threshold was set at separation≤0.656×100.121·θ arcsec.

12 978 CSC sources have matches obtained with both NWAY and ML techniques. There are 45 CSC sources with potential additional counterparts identified with ML, and 60 NWAY matches without an ML counterpart. The similarity of matches is illustrated in Figure 8, which shows scatter plots of the separations as a function of off-axis angle for different methods: the original cross-matching of COUP and OIR (black filled squares Getman et al. 2005b,a); the CSC-ML cross-matches (blue open circles); and the CSC-NWAY cross-matches which do not have ML counterparts (red filled circles). The scatter in all three cases are similar, and have the same trend with off-axis angle, which indicates that they are all sampling from the same distribution of cross-matches and do not exhibit relative biases. We emphasize here that since closeness in position is not a criterion we use in the ML method to choose a match, a priori there is no reason to expect any of the suggested candidates to achieve an ML match score pML > 0.466; yet ≈ 95% of the matches are found to be in agreement. This is a strong indication that X-ray emitters are recognizable by their optical characteristics. In addition, we note that 15 instances are found where ML suggests a different Gaia source to be a match than NWAY. The detailed cross-matches for both the NWAY match (including pany and max pi ) and ML match (including max pML ), along with the corresponding Gaia gmag and BP − RP are listed in Table 5. Note that two sources with pany ≪ 0.5 are included here because there is a change between max pi and max pML ; these would be excluded from NWAY-generated catalogs, but included in ML-generated catalogs. In many cases the optical properties of the two matches are similar, and ML is selecting the Gaia match which has better measurements, like the existence of BP − RP , a smaller parallax error, a BP − RP estimate that is less of an outlier, etc. This suggests that the next Gaia data release may resolve these discrepancies by improving the location estimates or eliminating what may be duplicates in the catalog. 5. THE Chandra-Gaia CATALOG OF

COUNTERPARTS We construct our catalog based on the nature of the ML scores between each Chandra-Gaia pair. These are based on three Boolean flags devised to summarize each step in our method: (i) flag nway confident, which marks the best match by spatial proximity as determined by NWAY. It is marked ‘True’ for pairs for which pany ≥ 0.5, and of all possible counterparts, the one with the highest individual pi . That is, according to NWAY,

there exists a counterpart, and we select the one that is most likely. (ii) flag ml confident, which marks as ‘True’ all pairs which exceed the ML score threshold on pML devised in Section 4.2.2. (iii) flag sep ok, which marks all pairs with a binary indicator that their separation is ≤rmax (θ) (marked as 1) or > rmax (θ) (marked as 0) (see Equation 3). We filter the full catalog, which contains all the Chandra-Gaia candidate pairs, based on different combinations of the above flags. We construct three tables: 1. Best ML matches (Table 7) – lists the best Chandra–Gaia pair based on the ML score. We select CSC sources for which at least one counterpart has both flag ml confident=True and flag sep ok=1. If there are multiple counterparts for a given CSC source, we select the one with the highest ML score pML . 2. Alternate ML matches (Table 8) – lists all other ML-valid potential Gaia counterparts that fall within a plausible separation/off-axis threshold. These are alternative, valid ML matches to CSC sources already in the best matches table, where we include the entries for which flag ml confident=True, flag sep ok=1, and pML ̸= max pML for any source. 3. Ambiguous NWAY matches (Table 9) – lists all pairs deemed to be counterparts based on proximity alone, but are not appropriate matches according to ML. These all have flag nway confident=True, but with either flag ml confident=False or flag sep ok=0. That is, they have pany ≥ 0.5 and either pML < 0.466 or separation > rmax (θ). The columns in the tables (templates are shown in Table 7, and in Appendix E; for the full tables, see Pérez-Dı́az et al. 2026) are designed to provide the minimum set of parameters needed to refilter the catalog with more conservative settings if desired. They include the Chandra and Gaia IDs, the Chandra source position, their separations, the NWAY individual and total probabilities pi and pany , the ML scores pML , and the corresponding Boolean flags (in the table templates, True and 1 are represented by a check mark, and False by a crossout x). The full list of columns and their descriptions are presented in Appendix D. We present a census of these final products in Table 6. Similar to what was seen in the study of the COUP

13 Table 4. Summary of the cross-matches over the COUP field Quantity Gaia DR3 sources Total COUP sources COUP sources with OIR matches Total CSC sources CSC sources with – – COUP counterparts – an ML match (as in Table 7) – both NWAY and ML matches – ML matches that also have COUP OIR IDs – alternate ML matches (as in Table 8) – ML matches and no NWAY matches – NWAY matches but no ML matches (as in Table 9) – different ML matches than NWAY (Table 5)

field, there is significant overlap between NWAY and ML matches. We find ML matches to 112, 779 CSC sources, of which 6, 176 have multiple alternative ML matches. There are 19, 649 sources which have a probable NWAY match, but no ML match. The contents of the catalog are displayed for various characteristics in Figures 9, 10, and 11. The first shows a color-magnitude HR diagram, the second shows the X-ray hardness ratios, and the last shows a comparison with NWAY cross-matching. They are each made using a hexagonal binning scheme to construct densities12 , and where applicable, we show plots made for both the full range (the minimum and maximum of the samples in each bin) as well as for a representative value (the median). Figure 9 shows the Hertzsprung-Russell (HR) diagram for the best ML matches, the alternative ML, and the ambiguous NWAY catalogs. In the Best and Alternative ML matches, the classical sequence shapes appear, and the distinct white-dwarf cluster appears at blue colors and faint magnitudes. In the NWAY only matches, the HR diagram is washed out by spurious or poorly constrained matches, although the main sequence stars branch can be seen. Figure 10 again shows the HR diagram, but color coded by the X-ray spectral hardness HRHS for the CSC passbands H = 2 − 8 keV and S = 0.5 − 1.2 keV. Redder colors represent softer spectra and bluer ones harder spectra. Because each bin is comprised of several sources, we represent the spread in the hardness

Number 1755 1616 1323 1397 1282 1015 978 917 45 75 60 15

ratios with the median (middle row of panels) and the range (the minima in the bottom row, and the maxima in the top row); the columns represent the different types of matches (for Tables 7, 8, and 9 from left to right respectively). The stellar main sequence is clearly visible in the median HRHS of best matches, and there is no structure visible for the NWAY-only matches. The difference in morphology going from the population of best ML matches to no ML matches is consistent with the assumption that underlies this work, that optical properties are indeed informative of X-ray emission. Figure 11 shows a direct comparison of the crossmatching between NWAY and ML. The panels are arranged in the same manner as in Figure 10, but depicts the variation in separation as a function of the ML score pML , color coded by pany . Notice that the x-axis range is 0.466 ≤ pML ≤ 1 for the left and middle columns which show ML identified matches, and is 0 ≤ pML < 0.466 for the right column since these matches do not contain any ML identified matches13 . As expected, matches found at larger separations (always for large off-axis locations θ, per Equation 3) tend to have smaller values of pany , but are uncorrelated with pML . The separations of the alternate matches are skewed to higher values (mean separation of 3′′ .5 and a mean θ of 9′ ). The individual distributions of pML are all heavily skewed, with 50% of the best ML matches at pML > 0.89, of the alternate matches at pML > 0.62, and of the NWAY only matches at pML < 0.25. A large fraction of the ML identified cross-matches are stars or galactic X-ray binaries. Over 68% of the Gaia

12 Using

the default binning scheme implemented in matplotlib.pyplot.hexbin. The advantage of hexagonal bins over regular rectangular bins is that hexagons allow for a better sampling efficiency for irregular shapes.

13 Note

that Table 9 includes some instances where flag ml confident=True & flag sep ok=0. These are not counted as valid ML matches.

14 Table 5. List of flipped cross-matches in the COUP field that have changed between NWAY and ML. Match Gaia ID separation pi † p†ML gmag algorithm [arcsec] [mag] J053452.7-052753 1.5 10−8 NWAY 3017269470960502656 0.905 1.000 0.714 15.19 ML 3017269470959732480 1.296 3.223e-13 0.875 14.83 J053457.7-052350 4.78 3.8 10−3 NWAY 3017363857172493824 0.659 1.000 0.888 14.00 ML 3017363857165366400 1.862 1.100e-44 0.929 13.39 J053500.1-052301 4.18 1.00 NWAY 3017364647449498624 0.209 0.9979 0.821 12.79 ML 3017364647439213184 0.497 0.002057 0.824 13.48 J053504.6-052936 6.42 1.00 NWAY 3017266275504060672 0.157 1.000 0.932 15.99 ML 3017266275504060800 2.920 0.000 0.946 14.39 J053506.1-052212 3.00 1.00 NWAY 3017364303851923456 0.160 0.8021 0.290 19.52 ML 3017364299541935744 0.255 0.1979 0.351 19.02 J053506.4-053335 5.38 1.00 NWAY 3017264660593314688 0.092 0.9068 0.539 15.82 ML 3017264660596368000 0.294 0.09319 0.585 15.93 J053514.9-052412 0.69 1.00 NWAY 3017363960254458112 0.110 1.000 0.786 16.09 ML 3017363960251436544 1.296 2.629e-26 0.826 16.15 J053515.3-052224 1.24 1.00 NWAY 3017364127743286272 0.182 1.000 0.114 17.17 ML 3017364132049496832 0.606 1.697e-05 0.674 15.96 J053515.4-051943 3.90 1.00 NWAY 3017366709029832064 0.200 1.000 0.223 20.21 ML 3017366709022399360 1.723 3.734e-38 0.546 19.21 J053515.4-052040 2.95 0.997 NWAY 3017365918755675648 0.400 1.000 0.326 19.33 ML 3017365918746317312 1.407 9.766e-14 0.669 19.00 J053517.8-051835 0.53 1.00 NWAY 3017366812104158208 0.148 0.5720 0.189 20.83 ML 3017366807802891648 0.165 0.4280 0.222 21.00 J053524.6-051159 11.85 0.988 NWAY 3209527325414404864 1.214 0.6575 0.851 14.78 ML 3209527325412171136 2.311 0.3425 0.956 15.86 J053524.6-051909 4.85 0.997 NWAY 3017366017528606720 0.497 1.000 0.647 16.10 ML 3017366090553947264 2.885 8.784e-23 0.728 18.72 J053540.2-051728 5.16 1.00 NWAY 3017366365419173632 0.226 1.000 0.108 17.90 ML 3017366365431829248 1.618 1.071e-22 0.927 13.75 J053541.9-052812 7.76 0.999 NWAY 3017347914245946624 0.274 0.7642 0.889 11.75 ML 3017347914253414016 0.337 0.2358 0.903 11.71 † : NWAY probabilities and ML scores for the matching sources. The best NWAY matches have pi = max{pi } and the best ML matches have pML = max{pML }. 2CXO ID

θ [arcmin] 6.12

pany

sources that correspond to the best ML match have valid parallaxes, and 41% of these are within 1 kpc, with 94% within 8 kpc. The median distance to sources with valid parallaxes is 1.3 kpc, suggesting that Chandra is seeing deep into the Galaxy. In contrast, among the NWAY-only no-ML cross-matches, 59% have valid parallaxes, and only 21% are within 1 kpc, with a median distance of 2.1 kpc, suggesting that even if these are real counterparts, they form a distinctly different population. 6. DISCUSSION

6.1. Interpreting pML Our model computes a quantity pML ∈ [0, 1] that is a measure of whether a Gaia source near an X-ray source

BP − RP [mag] NA 2.13 NA 1.98 1.68 1.76 2.50 1.81 0.64 0.96 2.03 1.72 0.86 0.97 NA 0.96 NA 0.75 NA 0.72 0.34 1.06 2.03 2.96 2.48 1.10 NA 2.39 1.33 1.33

is a plausible counterpart to it. This measure should not be interpreted as a probability, but as a score. Higher numbers indicate that the likelihood is higher that the objects are indeed counterparts. Note that pML is dependent only on the observable properties of the sources and not on their separation, unlike NWAY. Thus, it is often the case that when there are multiple optical candidates available for a given Xray source, the match candidate at a larger separation may have a higher ML score than the one that is situated closer. We interpret this as an indication that the closer counterpart is a chance coincidence, and that the one with the higher pML is more likely to be the correct match, since it has properties that are more in line with

15 Table 6. Census of CSC2.1-GDR3 cross-matches after ML classification Number Filtera

Subset For CSC sources:– – cross-matched with NWAY – matched with both NWAY and ML

122 192 102 543

– with best ML cross-matches (Table 7) – exactly 1 Gaia counterpart – exactly 2 Gaia counterparts – more than 2 Gaia counterparts – with matches where both ML and NWAY agree

112 779 106 603 5 418 775 97 876

– with alternate ML matches (Table 8) – with ML match but no NWAY match – with different ML and NWAY matches – with NWAY match but no ML match (Table 9) For Gaia sources:– – all ML matches – exactly 1 Gaia counterpart – exactly 2 Gaia counterparts – more than 2 Gaia counterparts – with best ML cross-matches (Table 7) – alternate ML matches (Table 8) – with different ML and NWAY matches – with NWAY match but no ML match (Table 9) – with non-unique CSC associations

6 176 10 236 4 667 19 649

pany ≥ 0.5 and pi = max{pi } pany ≥ 0.5 and pi = max{pi } and pML > 0.466 and separation< rmax pML > 0.466 and separation< rmax and pML = max{pML } as above and #{< rmax } = 1 as above and #{< rmax } = 2 as above and #{< rmax } > 2 (pML > 0.466 and separation< rmax and pML = max{pML }) and (pany ≥ 0.5 and pi = max{pi }) and (max{pML } = max{pany }) #{unique(pML > 0.466 and separation< rmax and pML ̸= max{pML })} pML > 0.466 and separation< rmax and pany < 0.5 pML > 0.466 and separation< rmax and max{pML } ̸= max{pi } pML < 0.466 and (pany > 0.5 and pi = max{pi })

120 048 106 603 10 836 2 631 112 782 7 207 6 923 19 647 208

pML > 0.466 and separation< rmax as above and #{< rmax } = 1 as above and #{< rmax } = 2 as above and #{< rmax } > 2 pML > 0.466 and separation< rmax and pML = max{pML } #{unique(pML > 0.466 and separation< rmax and pML ̸= max{pML })} pML > 0.466 and separation< rmax and max{pML } ̸= max{pi } pML < 0.466 and (pany > 0.5 and pi = max{pi }) #{in Table 7} − #{unique Gaia-IDs in Table 7}

a The notation X = max{X} means select the element from set {X} which is equal to the maximum value in the set (if there are ties, all of them are kept). Similarly, the notation X < max{X} means all elements with values less than the maximum. The notation #{condition} means the number of objects that satisfy the given condition.

Alternative ML

Ambiguous NWAY

−10 101

0 10 0 5 BP − RP [mag]

0 5 BP − RP [mag]

0 5 BP − RP [mag]

log density

MG [mag]

Best ML matches

100

Figure 9. HR diagram for the Gaia sources cross-matched to CSC. The distance-corrected gmag is shown as a function of color BP − RP for the best ML matches (left), for plausible alternate ML matches (middle), and for cases with no ML matches but with highly probable NWAY matches. In regions of low source concentration along the fringes, sources are marked as individual points; high source concentrations are represented by surface densities. The morphology of the cross-matches is substantially different for the three cases, though the main sequence is visible in all cases.

32.21 -20.87 5.90 -58.28 -8.87 -0.19 -40.01 -23.04 36.85 62.40

[deg]

[deg] 0.00 52.88 99.93 158.82 181.45 217.63 254.88 270.72 304.27 360.00

Dec

RA

2.7 7.8 0.98 5.0 4.0 4.5 4.3 8.0 8.2 6.0

[arcmin]

θ0

2873826084487581440 5100637709724057600 3131126163463999232 5351447410242844288 3582018667782810496 3653300766821312256 5967091458400954112 4069256937710039424 2060562069817318656 2012805465146791424

Gaia ID

>0.999 >0.999 >0.999 >0.999 >0.999 >0.999 0.56 >0.999 0.88 >0.999

pi

0.996 0.999 0.997 0.98 >0.999 0.997 0.95 0.45 0.72 0.95

pany

0.93 0.93 0.66 0.92 0.99 0.98 0.75 0.91 0.80 0.91

pML

0.71 0.54 0.21 0.33 0.20 0.40 0.83 2.3 1.6 0.40

[arcsec]

Sep.

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓

FN

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

FM

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

FS

20.5 20.9 19.3 16.1 19.9 19.3 17.2 12.2 15.5 18.9

[mag]

gmag

a Column abbreviations: Name = csc21 name, RA = csc21 ra, Dec = csc21 dec, θ = min theta mean, Gaia ID = gaia3 source id, 0 pi = p i, pany = p any, pML = p match ind, Sep. = separation, FN = flag nway confident, FM = flag ml confident, FS = flag sep ok, gmag = phot g mean mag.

000000.5+321232 033130.3-205216 063942.0+055414 103517.2-581701 120548.5-085200 143030.2-001115 165931.4-400030 180253.6-230212 201704.3+365058 235959.8+622403

Name

Table 7. CSC2.1–Gaia DR3 Best Matches: a Illustrative sample of counterparts from the Best Matches catalog. These 10 entries (from 112 779 total) represent high-confidence matches with the highest ML scores. The full machine readable table is available on Zenodo (Pérez-Dı́az et al. 2026).

16

17

1.0

−10

0.5

0

0.0

10

−0.5 0 5 BP − RP [mag]

0 5 BP − RP [mag]

0 5 BP − RP [mag]

Best ML matches

Alternative ML

Ambiguous NWAY

−1.0

1.0

−10

0.5

0

0.0

10

−0.5 0 5 BP − RP [mag]

0 5 BP − RP [mag]

0 5 BP − RP [mag]

Best ML matches

Alternative ML

Ambiguous NWAY

−1.0

1.0

−10

0.5

0

0.0

10

−0.5 0 5 BP − RP [mag]

0 5 BP − RP [mag]

0 5 BP − RP [mag]

max HRHS

Ambiguous NWAY

median HRHS

Alternative ML

min HRHS

MG [mag]

MG [mag]

MG [mag]

Best ML matches

−1.0

Figure 10. X-ray spectral variations across the color-magnitude space for different types of cross-matches. Hexbin plots (as in Figure 2) are shown as a function of Gaia gmag and BP − RP for the maximum (upper row), median (middle row), and minimum (lower row) of the X-ray HRHS (see Table 2). The counterparts with the best pML are shown in the left column, those for alternate ML matches are in the middle column, and those with only NWAY matches are shown in the right column. The stellar main sequence is clearly visible in the ML matched cases, and the counterparts without reliable ML matches are featureless.

the positive set in the training data. We thus list all of the best ML candidates in one table (Table 7). It is interesting to consider the nature of the ambiguous matches. There are 7 207 alternative ML associations in which a Gaia candidate has a valid ML score but is not the highest-scoring ML counterpart for that CSC source (Table 8). When the ML score suggests a match with an X-ray source, but the identity of the Xray source is unclear, we interpret the ML score as sug-

gesting a potential X-ray source which may be detected with longer exposures or would have been detected if observed at a different epoch. That is, we predict X-ray emission from these Gaia sources. In addition, there are ≳ 200 Gaia sources that are selected as the best ML counterpart for more than one CSC source. These may occur due a combination of chance associations in dense fields, proper motion effects, or incompleteness in Gaia.

18

0.75 0.50

10−2

0.25 0.8

1.0

0.6

0.8

1.0

0.0

pML

pML

0.2 pML

0.4

Best ML matches

Alternative ML

Ambiguous NWAY

0.00

1.00 0.75

100

0.50 10−2

0.25 0.6

0.8

1.0

0.6

0.8

1.0

0.0

pML

pML

0.2 pML

0.4

Best ML matches

Alternative ML

Ambiguous NWAY

0.00

1.00 0.75

100

0.50 10

−2

0.25 0.6

0.8 pML

1.0

0.6

0.8 pML

1.0

0.0

0.2 pML

0.4

max pany

1.00

median pany

Separation [arcsec]

Ambiguous NWAY

100

0.6

Separation [arcsec]

Alternative ML

min pany

Separation [arcsec]

Best ML matches

0.00

Figure 11. Comparing ML cross-matches with separation-based NWAY. Each panel shows a hexbin plot of the cross-match separations as a function of pML , with the color of the point in each bin represented by pany (see color scale bars at right); the upper row of panels depict the maximum of pany , the middle row the median, and the bottom row the minimum. The left column panels represent the ≈ 113k best ML cross-matches, the middle column that of ≈ 8k cases with multiple Gaia cross-matches, and the right column the ≈ 22k NWAY cross-matches without good ML matches.

The third catalog table (Table 9) lists CSC sources that do not have ML identified counterparts, but do have proximate Gaia sources that are identified by NWAY as matches. A large fraction of them are likely to be chance coincidences: ≈ 50% of these sources are at galactic latitudes |b| < 2o , compared to ≈ 25% among the best ML matches. Conversely, a similar number are very close coincidences, with 8 595 having pany > 0.9 and separation < 0.5′′ , and Ockham’s razor suggests that these must be true counterparts, even though ML

assigns a low score to them. We interpret this as a systematic completeness error because our method relies primarily on Gaia, and sources that may be outliers in Gaia would be trained out of having a high ML score. Thus, we expect that ≈ 7% of the ML matches (or non-matches) could be in error. If these 8.6k sources, matched by NWAY but not by ML, are illustrative of the systematic error in the 113k sources matched by ML, then we expect the error rate to be ≈ 7%.

19 6.2. A Framework While we have developed this cross-matching framework for the specific case of CSC and GDR3, our process is generalizable to cross-matching other catalogs. We describe here a framework that can be used for any arbitrary set of catalogs, which can be broken down into five steps: Perform a primary spatial cross-match —Bring together a

primary catalog (e.g., CSC2.1) and a candidate counterpart catalog (e.g., Gaia DR3), then run a spatial match, keeping every object within some radius. This provides a list of potential counterparts, as couples, for the primary catalog. Create a positive and negative set —Define a handful of high-confidence true matches (small separation, high positional-overlap probability) and obvious non-matches (large separation, low probability or random picks). Those become the positive and negative examples for the next step. Train a probabilistic classifier —Train a machine-learning classifier (e.g., gradient-boosted trees) on all the useful multi-wavelength and catalog properties. In our specific implementation, this includes fluxes, colors, proper motions, variability flags, even external class labels. Run that model over every candidate, producing a “match score” between 0 and 1. Define your thresholds —Define a threshold for a reliable counterpart taking into account the information available: spatial probabilities (NWAY), machine learning scores, separation, and the primary source off-axis. With this, define a set of quality labels. Make a final selection —Collapse all possible counterparts back into one reliable counterpart per primary source by taking, for each primary source detection, the best candidate source within the thresholds defined before. Despite this work being heavily oriented towards Chandra and Gaia, we bring here some ideas that might be applicable for any cross-matching between two catalogs. The most challenging step is selecting appropriate data for training a classifier (i.e., constructing positive and negative sets without the benefit of labeled ground truth data). We suggest using statisics-based heuristsics, as shown in Section 3.2, to select an appropriate cutoff for the construction of positive and negative sets. 7. SUMMARY

We have developed a machine learning-based framework to cross-match X-ray with optical sources. The

defining feature of our method is that it primarily leverages properties of the sources like magnitudes and colors to decide whether they are likely to be matches. Our method defines a general process (illustrated in Figure 12) to transcend source separation as the sole criterion for cross-matching, and helps to resolve ambiguities and flag chance coincidences. We apply it to cross-match X-ray sources in the Chandra Source Catalog with optical sources from Gaia DR3. We base our method on first defining a positive set of ≈30k cross-matches using our best knowledge of X-ray and optical matches, which relies primarily on separation and is validated by observable differences in optical magnitudes (Section 3.4). We construct a negative set of size ≈310k using unambiguously determinable nonmatches (Section 3.5). We then train the model using a large variety of features extracted from both catalogs (see Table 2), using a framework that relies on gradient boosting with LightGBM (see Section 4). However, the general approach is model-agnostic, and other architectures, including deep learning, could be explored for the cross-matching task. We determine a threshold score for a match using both astronomical (discarding plausible chance coincidences) and empirical (using ROCAUC curves) arguments, which happen to be consistent with each other: ML scores pML > 0.466 are accepted as valid cross-matches (Section 4.2). We test the method on the well-studied Chandra dataset of the Orion Nebula Cluster (Section 4.5), and find that the bare ML method matches NWAY crossmatching results at a high level of accuracy (see Table 4). Indeed, 95% of NWAY cross-matches are reproduced by ML matches, which is a remarkable result, since the former strictly uses separation and the latter uses similarity in features. Using this method, we then generate a new catalog of cross-matches between serendipitously detected Chandra X-ray sources from Chandra Source Catalog and optical sources from GDR3 (see Section 5). We present the cross-matches in three tables: the first listing the ≈113k cross-matches with the best ML score (max pML ; Table 7); the second listing the ≈8000 plausible alternative ML cross-matches (0.466 ≤ pML < max pML ; Table 8); and the third listing the ≈22k cross-matches which have such small separations that NWAY registers a high probability of a match, even though they fail the ML match criterion (pany > 0.5 and pML < 0.466; Table 9). The small separations suggest that many of them could be real matches, and a definitive decision requires a more detailed analysis (see also discussion of systematic errors in Section 6.1 above). The full catalog enables future detailed study of subsets

20

Figure 12. Cross-matching the Chandra Source Catalog 2.1 and Gaia DR3. Red and blue dots represent Gaia and Chandra sources, in the upper and lower projected squares, respectively. In the first stage, a spatial crossmatch is performed using NWAY, providing a first set of candidate associations. In the second stage, each candidate pair is scored using a LightGBM classifier trained on catalog features from Chandra and Gaia. Finally, candidates are filtered using score and separation thresholds to select the most likely astrophysical counterpart. The green checkmark indicates the final accepted match. Doing this for all potential associations allows us to construct a catalog of counterparts.

of object classes, like stars, which are abundantly represented in Gaia. Our method can be generalized into a practical framework that can be applied to other catalog combinations (Section 6). Our goal here is not to replace established spatial-separation dependent methods like NWAY, but to supplement them by incorporating other properties of the catalog objects. In this, we improve upon methods that incorporate the distributions of such properties as priors. Our method enables the recovery of correct matches even in unusual scenarios, such as contamination from chance interlopers, or when there are systematic errors present in the measured coordinates (e.g., due to influence from nearby sources, or PSF distortions at large off-axis angles, or uncorrected proper motion).

ACKNOWLEDGMENTS Acknowledgements: We thank Joshua Wing, Raffaele D’Abrusco, Martina Cadiz, Daniel Moreno-Cartagena, and Kevin Ortiz-Ceballos for useful discussions and comments throughout this research. We are grateful for the support of AstroAI (https://astroai.cfa. harvard.edu), a new center developing artificial intelligence methods to enable next generation astrophysics at the CfA. This work is supported by the National Science Foundation under Cooperative Agreement PHY-

2019786 (The NSF AI Institute for Artificial Intelligence and Fundamental Interactions, http://iaifi.org/). We acknowledge support from Chandra grant AR3-24002X and from the NASA Contract to the Chandra X-Ray Center NAS8-03060. This research has made use of data obtained from the Chandra Source Catalog, provided by the Chandra X-ray Center (CXC). This work has made use of data from the European Space Agency (ESA) mission Gaia (https://www.cosmos.esa.int/gaia), processed by the Gaia Data Processing and Analysis Consortium (DPAC, https://www.cosmos.esa.int/web/ gaia/dpac/consortium). Funding for the DPAC has been provided by national institutions, in particular the institutions participating in the Gaia Multilateral Agreement. This material is based upon work supported by the National Science Foundation Research Fellowship Program under Grant No DGE2140739. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.

Facilities: CXO, Gaia Software: LightGBM (Ke et al. 2017), scikit-learn (Pedregosa et al. 2011), Astropy (Collaboration et al. 2022), PINTofALE (Kashyap & Drake 2000).

REFERENCES Brunner, H., Liu, T., Lamer, G., & et al. 2022, Astronomy and Astrophysics, 661, A1

Budavari, T., & Loredo, T. J. 2015, Annual Review of Statistics and Its Application, 2, 113, doi: 10.1146/annurev-statistics-010814-020231

21 Budavári, T., & Szalay, A. S. 2008, Astrophysical Journal, 679, 301 Collaboration, A., Price-Whelan, A. M., Lim, P. L., et al. 2022, The Astrophysical Journal, 935, 167, doi: 10.3847/1538-4357/ac7c74 Collaboration, E., Roster, W., Salvato, M., et al. 2025, Euclid Quick Data Release (Q1). Optical and near-infrared identification and classification of point-like X-ray selected sources, arXiv, doi: 10.48550/arXiv.2503.15316 Czesla, S., Schneider, P. C., Schmitt, J. H. M. M., et al. 2023, Astronomy & Astrophysics, 674, A136, doi: 10.1051/0004-6361/202244195 Evans, I. N., Primini, F. A., Miller, J. B., et al. 2020, 235, 154.05. https://ui.adsabs.harvard.edu/abs/2020AAS...23515405E Evans, I. N., Evans, J. D., Martı́nez-Galarza, J. R., et al. 2024, The Astrophysical Journal Supplement Series, 274, 22, doi: 10.3847/1538-4365/ad6319 Freund, S., Czesla, S., Robrade, J., Schneider, P. C., & Schmitt, J. H. M. M. 2022, Astronomy & Astrophysics, 664, A105, doi: 10.1051/0004-6361/202142573 Freund, S., Czesla, S., Predehl, P., et al. 2024, The SRG/eROSITA all-sky survey – Identifying the coronal content with HamStar, arXiv, doi: 10.48550/arXiv.2401.17282 Gaia Collaboration. 2016, arXiv preprint arXiv:1609.04153 Getman, K. V., Feigelson, E. D., Grosso, N., et al. 2005a, The Astrophysical Journal Supplement Series, 160, 353, doi: 10.1086/432097 Getman, K. V., Flaccomio, E., Broos, P. S., et al. 2005b, The Astrophysical Journal Supplement Series, 160, 319, doi: 10.1086/432092 Green, P., Kim, D.-W., Anderson, S., et al. 2024, AAS High Energy Astrophysics Division meeting #21, id. 105.25. Bulletin of the American Astronomical Society, Vol. 56, No. 5, 21, 105.25. https://ui.adsabs.harvard.edu/abs/ 2024HEAD...2110525G/abstract Grinsztajn, L., Oyallon, E., & Varoquaux, G. 2022, Why do tree-based models still outperform deep learning on tabular data?, arXiv, doi: 10.48550/arXiv.2207.08815 Hollmann, N., Müller, S., Purucker, L., et al. 2025, Nature, 637, 319, doi: 10.1038/s41586-024-08328-6 Kashyap, V., & Drake, J. J. 2000, Bulletin of the Astronomical Society of India, 28, 475 Ke, G., Meng, Q., Finley, T., et al. 2017, in Advances in Neural Information Processing Systems, Vol. 30 (Curran Associates, Inc.). https://proceedings.neurips.cc/paper files/paper/2017/ hash/6449f44a102fde848669bdd9eb6b76fa-Abstract.html

Kim, D.-W., Cassity, A., Bhatt, B., et al. 2023, The Astrophysical Journal Supplement Series, 268, 17, doi: 10.3847/1538-4365/ace4cc Marrese, P. M., Marinoni, S., Fabrizio, M., & Altavilla, G. 2019, Astronomy & Astrophysics, 621, A144 Pedregosa, F., Varoquaux, G., Gramfort, A., et al. 2011, Journal of Machine Learning Research, 12, 2825. http://jmlr.org/papers/v12/pedregosa11a.html Pérez-Dı́az, V. S., Martı́nez-Galarza, J. R., Caicedo, A., & D’Abrusco, R. 2024, Monthly Notices of the Royal Astronomical Society, 528, 4852, doi: 10.1093/mnras/stae260 Pérez-Dı́az, V. S., Kashyap, V., Ingram, J., et al. 2026, The Chandra-Gaia Catalog of Counterparts: Resolving Ambiguous Gaia Matches to X-ray Sources in the Chandra Source Catalog Using Machine Learning, Zenodo, doi: 10.5281/zenodo.18652667 Rimoldini, L., Holl, B., Gavras, P., et al. 2023, Astronomy & Astrophysics, 674, A14, doi: 10.1051/0004-6361/202245591 Rots, A. H. 2025, Cross-Matching with the Chandra Source Catalog, Cxc memo, Chandra X-ray Center, Center for Astrophysics | Harvard & Smithsonian. https://cxc.cfa. harvard.edu/csc/memos/files/Rots CXCxMatch2.0.pdf Rots, A. H., Allen, C. E., Anderson, C. S., et al. 2018, 231, 238.11. https://ui.adsabs.harvard.edu/abs/2018AAS...23123811R Rots, A. H., Burke, D., Hain, R. M., et al. 2020, 235, 109.28. https://ui.adsabs.harvard.edu/abs/2020AAS...23510928R Salvato, M., Buchner, J., Budavári, T., et al. 2018, Monthly Notices of The Royal Astronomical Society, 473, 4937 Salvato, M., Wolf, J., Dwelly, T., et al. 2022, Astronomy & Astrophysics, 661, A3, doi: 10.1051/0004-6361/202141631 Schneider, P. C., Freund, S., Czesla, S., et al. 2022, Astronomy & Astrophysics, 661, A6, doi: 10.1051/0004-6361/202141133 Smirnov, N. 1948, The Annals of Mathematical Statistics, 19, 279, doi: 10.1214/aoms/1177730256 Tak, H., Chen, Y., Kashyap, V. L., et al. 2024, ApJS, 275, 30, doi: 10.3847/1538-4365/ad8440 Ursu, E., Minnegalieva, A., Rawat, P., et al. 2025, 7, 1206, doi: 10.1038/s42256-025-01089-5 Vallenari, A., Brown, A. G., Prusti, T., et al. 2023, Astronomy & Astrophysics, 674, A1 Yang, H., Hare, J., Kargaltsev, O., et al. 2022, The Astrophysical Journal, 941, 104, doi: 10.3847/1538-4357/ac952b

22 APPENDIX

A. BRIEF DESCRIPTION OF NWAY

NWAY is a Bayesian algorithm designed to cross-match astronomical sources across multiple catalogs simultaneously. Building on the formalization introduced by Budavári & Szalay (2008), it combines astrometric information (source positions and uncertainties) and photometric priors (e.g., magnitude or color distributions) to calculate the probability that each candidate source is the correct counterpart. For each candidate counterpart i of a given primary source, NWAY computes the posterior probability p i that candidate i is the correct match, defined as: P (Hi |D) p i= P , j P (Hj |D) where P (Hi |D) is the posterior probability of hypothesis Hi (i.e., candidate i is the true counterpart) given the observed data D, which incorporates positional and photometric information. Additionally, NWAY calculates p any, the probability that any of the candidate sources is a true counterpart: P (H0 |D) p any = 1 − P , j P (Hj |D) where P (H0 |D) is the posterior probability for the hypothesis H0 , meaning none of the candidates correspond to the primary source. For details on the formalism, we refer the reader to Salvato et al. (2018); Budavári & Szalay (2008). B. MODEL TRAINING DETAILS

B.1. Model Configuration Preprocessing —Feature preprocessing was intentionally lightweight. For numerical features, we apply a log10 (1 + x) transformation only to variables with highly skewed distributions or large dynamic ranges. Specifically, the following features are log-transformed:

• parallax • parallax error • photflux aper b • phot g mean flux • phot bp mean flux • phot rp mean flux • radial velocity • distance gspphot • sqrt(pmra^2 + pmdec^2) These transformations are applied to all rows, using the expression log10 (1 + x) to avoid undefined values for zero. Categorical features like yangetal gcs class, yangetal training class, perezdiazetal class, and phot variable flag are passed to LightGBM as raw category-type columns. Missing data is not imputed and kept as nan. Missing Gaia and spatial properties in the random negatives are filled with the value -1.

23 Hyperparameter Tuning —We perform hyperparameter tuning using RandomizedSearchCV with 200 iterations over a custom-defined search space, using 5-fold cross-validation and AUC-ROC as the scoring metric. Each parameter is sampled either log-uniformly or uniformly, and integer constraints are enforced where appropriate. The full hyperparameter space included:

• learning rate: log-uniform over [e−7 , 1] • num leaves: quantized log-uniform over [e0 , e7 ], step size 1, integer • feature fraction: uniform over [0.5, 1.0] • bagging fraction: uniform over [0.5, 1.0] • min data in leaf: quantized log-uniform over [e0 , e6 ], step size 1, integer • min sum hessian in leaf: log-uniform over [e−16 , e5 ] • lambda l1: random choice from {0, log-uniform in [e−16 , e2 ]} • lambda l2: random choice from {0, log-uniform in [e−16 , e2 ]} For the tuning run, we set the number of boosting rounds to 500. The best model configuration is selected after evaluating all 200 trials. Afterward, the number of boosting rounds is fixed at 5000 and early stopping was set with a patience of 10 rounds. The final model is retrained using these parameters and evaluated on the held-out test set. We also treat data construction choices as part of the hyperparameter search. In particular, we run separate tuning experiments to assess the effect of including intermediate negatives and to determine the optimal number of random negatives to sample per unique Chandra source. For the latter, we explore multipliers of 0, 5, 10, 20, 40, 60, 80, 100 relative to the number of CSC sources. For each configuration, we perform a full hyperparameter tuning run as described above. We find that including intermediate negatives consistently improved model performance. As for the random negatives, we find the best performance when using a multiplier of 5, which is ultimately adopted in the final configuration. We experiment with different methods of hyperparameter search, and also different configurations of the number of search-iterations and folds in the cross-validation. For simplicity, we report here the one that we ultimately selected and chose a model from. Final Model —The best-performing model was trained with the following parameters (rounded):

• learning rate = 0.00456 • num leaves = 131 • n estimators = 5000 • min data in leaf = 2 • min sum hessian in leaf = 5.66×10−7 • bagging fraction = 0.914 • feature fraction = 0.519 • lambda l1 = 0 • lambda l2 = 0.205 Performance —The model achieved an AUC of 0.894 on the validation set and 0.898 on the independent test set. The model was later saved and used for the analysis presented in the paper.

24 C. THRESHOLDS FROM Chandra’S PSF

First, the astrometric precision of Chandra must be accounted for. Typical uncertainties in source positions are about 0.5′′ , comparable to the ACIS pixel size, although they can be reduced to 0.1–0.3′′ in fields with deep observations and available re-registrations. Second, the statistical error in locating a source depends on photon counts. The positional uncertainty is expected √ to scale as PSF width divided by N . For faint sources (∼10 counts), we expect a rounded statistical error of at least ∼ PSF/3. Third, proper motion effects become significant over decade-long baselines between Chandra and Gaia observations. The median proper motion of all the Gaia potential cross-match candidates is ≈5 mas yr−1 , which can accumulate to ∼0.1′′ , adding another term to the positional uncertainty. Fourth, unresolved overlapping sources can dominate in crowded fields. If the overlap is less than the PSF width, the sources might be impossible to resolve with any method. If variability is present, the sources could show fundamental differences between epochs. This adds an additional uncertainty roughly at the PSF scale. Section 3.2 sets the scale for reasonable maximum separations near the Chandra aimpoint. However, the Chandra PSF broadens significantly as a function of the off-axis angle θ. Empirically, we adopt a parabolic parametrization of the encircled energy radii as a function of off-axis, from the Figure 4.12 of Chandra Proposer’s Observatory Guide,14 ECF R90 (θ) = 1.1′′ + 0.05′′ × θ + 0.1′′ × θ2 [arcsec]

(C1)

ECF where R90 is the radius (in arceconds) containing 90% of the PSF’s encircled energy at off-axis angle θ (in arcminutes). For a circular Gaussian PSF of width σ, the 90% encircled energy radius corresponds to around 2.15σ. Thus, using ECF σPSF ≈ R90 /2.15, we estimate the PSF contribution at each off-axis location.

D. COLUMNS OF COUNTERPARTS CATALOG

Each row in the catalog tables includes the following columns: • csc21 name – Unique identifier of the Chandra source. • csc21 ra, csc21 dec – Right ascension and declination of the Chandra source (in degrees). • min theta mean – Mean off-axis angle of the Chandra detection (in arcminutes). • gaia3 source id – Unique identifier of the Gaia DR3 source. • gaia3 ra, gaia3 dec – Right ascension and declination of the Gaia source (in degrees). • p i – NWAY positional match probability for the CSC-Gaia pair. • p any – NWAY probability that the Chandra source has any counterpart. • p match ind – pML , Machine-learning score estimating the likelihood of a true match. • separation – Angular separation between the CSC and Gaia positions (in arcseconds). • match flag – Original label from NWAY, used in training/validation. • flag nway confident – True if pany ≥ 0.5 for the Gaia source with highest p i. • flag ml confident – True if pML ≥ 0.466. • flag sep ok – True if the pair satisfies the separation and off-axis angle thresholds. • phot g mean mag - Gaia counterpart’s G-band apparent magnitude.

14 https://cxc.harvard.edu/proposer/POG/html/chap4.html#fg:hrma ee offaxis hrci

25 E. CATALOG SAMPLES

We show representative samples of the catalog tables (see Section 5) as for the best ML matches (Table 7), but for alternative ML matches (Table 8), and for NWAY-only matches that do not have reliable ML counterparts (Table 9). The full tables are available on (Pérez-Dı́az et al. 2026).

000102.5+672840 043340.8+174440 054044.2-690245 103711.4-583443 131521.8-552259 163921.1-474551 173947.1-394342 175831.5-290116 190319.3+030027 235802.7+230354

Name

67.48 17.74 -69.05 -58.58 -55.38 -47.76 -39.73 -29.02 3.01 23.07

[deg]

[deg] 0.26 68.42 85.18 159.30 198.84 249.84 264.95 269.63 285.83 359.51

Dec

RA

8.4 7.5 11.5 7.3 13.9 5.1 8.3 6.5 12.1 8.3

[arcmin]

θ0

528573584943861632 3313485355247771264 4657683743840276352 5350683352738606720 6066625779323513984 5941070966009730816 5960785548794278912 4062352142152258688 4268770370618299264 2848261339629138176

Gaia ID

−13

6.6 × 10 0.49 5.3 × 10−4 2.9 × 10−19 0.20 0.28 5.8 × 10−6 3.3 × 10−4 0.11 0.35

pi

0.99 0.98 0.63 0.92 0.60 0.83 0.66 0.48 0.46 >0.999

pany

0.49 0.79 0.50 0.61 0.61 0.50 0.66 0.49 0.48 0.87

pML

3.7 1.2 6.8 3.9 4.6 2.4 4.0 3.4 7.2 0.68

[arcsec]

Sep.

✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗

FN

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

FM

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

FS

19.3 11.8 19.8 17.5 11.8 18.3 19.7 17.1 19.5 14.9

[mag]

gmag

Table 8. Alternative ML Counterpart Matches: As Table 7, for an illustrative sample of counterparts from the Alternative ML matches catalog. These 10 entries (from 7 242 total) have pML ≥ 0.466 and separation criteria met, but do not have the highest ML score (i.e., pML ̸= max pML ) for any CSC counterpart.

26

000001.5-245151 052301.2+332411 102443.6-573714 111048.2-372645 141217.2-513259 164824.8-461016 174505.2-294511 180501.5-273917 191630.5-155553 235928.0+440317

Name

-24.86 33.40 -57.62 -37.45 -51.55 -46.17 -29.75 -27.65 -15.93 44.05

[deg]

[deg] 0.01 80.76 156.18 167.70 213.07 252.10 266.27 271.26 289.13 359.87

Dec

RA

17.1 4.7 10.6 9.7 7.5 3.8 8.0 2.4 9.4 9.2

[arcmin]

θ0

2335109264262060928 180986146577295616 5351757438154160000 5397353940526126080 6089551348357034752 5940085902338251264 4056882454043395712 4062934780448760064 4184142468158354048 1922753577342779904

Gaia ID

>0.999 >0.999 >0.999 0.999 >0.999 >0.999 0.54 >0.999 0.96 >0.999

pi

0.93 0.997 0.81 0.87 0.65 0.98 0.70 0.87 0.67 0.97

pany

0.10 0.29 0.38 0.42 0.04 0.40 0.12 0.26 0.42 0.35

pML

5.3 0.17 1.7 1.7 1.2 0.02 0.35 0.11 1.7 1.0

[arcsec]

Sep.

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

FN

✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗

FM

✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

FS

17.9 20.1 14.3 20.7 19.4 17.4 18.1 18.2 19.1 20.7

[mag]

gmag

Table 9. Ambiguous NWAY Matches: As Table 7, for an illustrative sample of counterparts from the Ambiguous NWAY matches catalog. These 10 entries (from 19 649 total) have pany ≥ 0.5 indicating highly probable association based on separation, but do not have ML matches.

27

Record · ID 287110 · SHA-256 738427912c801360
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.