1. Introduction
The formation and present-day structure of the Milky Way are the cumulative outcome of both internal evolutionary processes and external accretion events (Bland-Hawthorn and Gerhard (Reference Bland-Hawthorn and Gerhard2016). Over cosmic time, dwarf galaxies and globular clusters have merged with the Galaxy, leaving behind stellar populations with distinct chemical and dynamical signatures. Several such accreted structures have been reported in the literature, including the Helmi streams (Helmi et al. Reference Helmi, White, de Zeeuw and Zhao1999), Sequoia (Barba´ et al. 2019; Matsuno et al. Reference Matsuno, Aoki and Suda2019; Myeong et al. Reference Myeong, Vasiliev, Iorio, Evans and Belokurov2019), Thamnos (Koppelman et al. Reference Koppelman, Helmi, Massari, Price-Whelan and Starkenburg2019), LMS (Yuan et al. Reference Yuan, Chang, Beers and Huang2020), Pontus (Malhan et al. Reference Malhan, Ibata, Sharma, Famaey, Bellazzini, Carlberg, D’Souza, Yuan, Martin and Thomas2022), Sagittarius (Ibata et al. Reference Ibata, Gilmore and Irwin1994), Arjuna and I’itoi (Naidu et al. Reference Naidu, Conroy, Bonaca, Johnson, Ting, Caldwell, Zaritsky and Cargile2020), and the Gaia-Sausage/Enceladus event (Helmi et al. Reference Helmi, Babusiaux, Koppelman, Massari, Veljanoski and Brown2018; Belokurov et al. Reference Belokurov, Erkal, Evans, Koposov and Deason2018; Haywood et al. Reference Haywood, Di Matteo, Lehnert, Snaith, Khoperskov and Gómez2018; Mackereth et al. Reference Mackereth, Schiavon, Pfeffer, Hayes, Bovy, Anguiano, Allende Prieto, Hasselquist, Holtzman, Johnson, Majewski, O’Connell, Shetrone, Tissera and Fernández-Trincado2019). Stars that were accreted from outside the Galaxy are referred to as ex-situ, while those that formed within the Galaxy are known as in-situ stars. Different approaches have been developed to distinguish these populations in chemical and dynamical planes. For example, (Horta et al. Reference Horta, Schiavon, Mackereth, Weinberg, Hasselquist, Feuillet, O’Connell, Anguiano, Allende-Prieto, Beaton, Bizyaev, Cunha, Geisler, Garca-Hernández, Holtzman, Jönsson, Lane, Majewski, Mészáros, Minniti, Nitschelm, Shetrone, Smith and Zasowski2023) demonstrated that the [Mg/Mn]-[Al/Fe] plane can effectively separate high-
$\alpha$
, low-
$\alpha$
disk stars (in-situ) from ex-situ populations. Similarly, (Plevne et al. Reference Plevne, Önal Tas, Bilir and Seabroke2020) showed a classification scheme in the [
$\alpha$
/Fe]-[Fe/H] plane. (Belokurov and Kravtsov Reference Belokurov and Kravtsov2024) further proposed that boundaries drawn in the energy-angular momentum (E-
$L_{z}$
) diagram, using globular clusters, can separate in-situ from ex-situ populations. However, orbital and kinematical parameters are subject to dynamical heating, radial migration, and secular processes, and therefore may not reliably reveal the origin of stars on their own (Plevne 42 and Akbaba 2025). In contrast, chemical abundances are more resilient tracers, as they directly preserve the nucleosynthetic history of the environment where the stars formed (Şentürk et al. Reference Şentürk, Şahin, Güney, Bilir and Marşmak2024).
Large spectroscopic surveys such as APOGEE DR17 (Abdurro’uf et al. Reference Accetta, Aerts, Silva Aguirre, Ahumada, Ajgaonkar, Filiz Ak, Alam, Allende Prieto, Almeida, Anders, Anderson, Andrews, Anguiano, Aquino-Ortz, Aragón-Salamanca, Argudo-Fernández, Ata, Aubert, Avila-Reese, Badenes, Barbá, Barger, Barrera-Ballesteros, Beaton, Beers, Belfiore, Bender, Bernardi, Bershady, Beutler, Bidin, Bird, Bizyaev, Blanc, Blanton, Boardman, Bolton, Boquien, Borissova, Bovy, Brandt, Brown, Brownstein, Brusa, Buchner, Bundy, Burchett, Bureau, Burgasser, Cabang, Campbell, Cappellari, Carlberg, Wanderley, Carrera, Cash, Chen, Chen, Cherinka, Chiappini, Choi, Chojnowski, Chung, Clerc, Cohen, Comerford, Comparat, da Costa, Covey, Crane, Cruz-Gonzalez, Culhane, Cunha, Dai, Damke, Darling, Davidson, Davies, Dawson, De Lee, Diamond-Stanic, Cano-Daz, Sánchez, Donor, Duckworth, Dwelly, Eisenstein, Elsworth, Emsellem, Eracleous, Escoffier, Fan, Farr, Feng, Fernández-Trincado, Feuillet, Filipp, Fillingham, Frinchaboy, Fromenteau, Galbany, Garca, Garca-Hernández, Ge, Geisler, Gelfand, Géron, Gibson, Goddy, Godoy-Rivera, Grabowski, Green, Greener, Grier, Griffith, Guo, Guy, Hadjara, Harding, Hasselquist, Hayes, Hearty, Hernández, Hill, Hogg, Holtzman, Horta, Hsieh, Hsu, Hsu, Huber, Huertas-Company, Hutchinson, Hwang, Ibarra-Medel, Chitham, Ilha, Imig, Jaekle, Jayasinghe, Ji, Johnson, Jones, Jönsson, Katkov, Khalatyan, Kinemuchi, Kisku, Knapen, Kneib, Kollmeier, Kong, Kounkel, Kreckel, Krishnarao, Lacerna, Lane, Langgin, Lavender, Law, Lazarz, Leung, Leung, Lewis, Li, Li, Lian, Liang, Lin, Lin, Lin, Lintott, Long, Longa-Peña, López-Cobá, Lu, Lundgren, Luo, Mackereth, de la Macorra, Mahadevan, Majewski, Manchado, Mandeville, Maraston, Margalef-Bentabol, Masseron, Masters, Mathur, McDermid, Mckay, Merloni, Merrifield, Meszaros, Miglio, Di Mille, Minniti, Minsley, Monachesi, Moon, Mosser, Mulchaey, Muna, Muñoz, Myers, Myers, Nadathur, Nair, Nandra, Neumann, Newman, Nidever, Nikakhtar, Nitschelm, O’Connell, Garma-Oehmichen, Luan Souza de Oliveira, Olney, Oravetz, Ortigoza-Urdaneta, Osorio, Otter, Pace, Padilla, Pan, Pan, Parikh, Parker, Peirani, Peña Ramrez, Penny, Percival, Perez-Fournon, Pinsonneault, Poidevin, Poovelil, Price-Whelan, Bárbara de Andrade Queiroz, Raddick, Ray, Rembold, Riddle, Riffel, Riffel, Rix, Robin, Rodrguez-Puebla, Roman-Lopes, Román-Zúñiga, Rose, Ross, Rossi, Rubin, Salvato, Sánchez, Sánchez-Gallego, Sanderson, Santana Rojas, Sarceno, Sarmiento, Sayres, Sazonova, Schaefer, Schiavon, Schlegel, Schneider, Schultheis, Schwope, Serenelli, Serna, Shao, Shapiro, Sharma, Shen, Shetrone, Shu, Simon, Skrutskie, Smethurst, Smith, Sobeck, Spoo, Sprague, Stark, Stassun, Steinmetz, Stello, Stone-Martinez, Storchi-Bergmann, Stringfellow, Stutz, Su, Taghizadeh-Popp, Talbot, Tayar, Telles, Teske, Thakar and Theissen2022), complemented by precise astrometric data from Gaia (Gaia Collaboration et al. Reference Vallenari, Brown, Prusti, de Bruijne, Arenou, Babusiaux, Biermann, Creevey, Ducourant, Evans, Eyer, Guerra, Hutton, Jordi, Klioner, Lammers, Lindegren, Luri, Mignard, Panem, Pourbaix, Randich, Sartoretti, Soubiran, Tanga, Walton, Bailer-Jones, Bastian, Drimmel, Jansen, Katz, Lattanzi, van Leeuwen, Bakker, Cacciari, Castañeda, De Angeli, Fabricius, Fouesneau, Frémat, Galluccio, Guerrier, Heiter, Masana, Messineo, Mowlavi, Nicolas, Nienartowicz, Pailler, Panuzzo, Riclet, Roux, Seabroke, Sordo, Thévenin, Gracia-Abril, Portell, Teyssier, Altmann, Andrae, Audard, Bellas-Velidis, Benson, Berthier, Blomme, Burgess, Busonero, Busso, Cánovas, Carry, Cellino, Cheek, Clementini, Damerdji, Davidson, de Teodoro, Nuñez Campos, Delchambre, Dell’Oro, Esquej, Fernández-Hernández, Fraile, Garabato, Garca-Lario, Gosset, Haigron, Halbwachs, Hambly, Harrison, Hernández, Hestroffer, Hodgkin, Holl, Janßen, Jevardat de Fombelle, Jordan, Krone-Martins, Lanzafame, Löffler, Marchal, Marrese, Moitinho, Muinonen, Osborne, Pancino, Pauwels, Recio-Blanco, Reylé, Riello, Rimoldini, Roegiers, Rybizki, Sarro, Siopis, Smith, Sozzetti, Utrilla, van Leeuwen, Abbas, Ábrahám, Abreu Aramburu, Aerts, Aguado, Ajaj, Aldea-Montero, Altavilla, Álvarez, Alves, Anders, Anderson, Anglada Varela, Antoja, Baines, Baker, Balaguer-Núñez, Balbinot, Balog, Barache, Barbato, Barros, Barstow, Bartolomé, Bassilana, Bauchet, Becciani, Bellazzini, Berihuete, Bernet, Bertone, Bianchi, Binnenfeld, Blanco-Cuaresma, Blazere, Boch, Bombrun, Bossini, Bouquillon, Bragaglia, Bramante, Breedt, Bressan, Brouillet, Brugaletta, Bucciarelli, Burlacu, Butkevich, Buzzi, Caffau, Cancelliere, Cantat-Gaudin, Carballo, Carlucci, Carnerero, Carrasco, Casamiquela, Castellani, Castro-Ginard, Chaoul, Charlot, Chemin, Chiaramida, Chiavassa, Chornay, Comoretto, Contursi, Cooper, Cornez, Cowell, Crifo, Cropper, Crosta, Crowley, Dafonte, Dapergolas, David, David, de Laverny, De Luise, De March, De Ridder, de Souza, de Torres, del Peloso, del Pozo, Delbo, Delgado, Delisle, Demouchy, Dharmawardena, Di Matteo, Diakite, Diener, Distefano, Dolding, Edvardsson, Enke, Fabre, Fabrizio, Faigler, Fedorets, Fernique, Fienga, Figueras, Fournier, Fouron, Fragkoudi, Gai, Garcia-Gutierrez, Garcia-Reinaldos, Garca-Torres, Garofalo, Gavel, Gavras, Gerlach, Geyer, Giacobbe, Gilmore, Girona, Giuffrida, Gomel, Gomez, González-Núñez, González-Santamara, González-Vidal, Granvik, Guillout, Guiraud, Gutiérrez-Sánchez, Guy, Hatzidimitriou, Hauser, Haywood, Helmer, Helmi, Sarmiento, Hidalgo, Hilger, Hładczuk, Hobbs, Holland, Huckle, Jardine, Jasniewicz, Jean-Antoine Piccolo, Jiménez-Arranz, Jorissen, Juaristi Campillo, Julbe, Karbevska, Kervella, Khanna, Kontizas, Kordopatis, Korn, Kóspál, Kostrzewa-Rutkowska, Kruszyńska, Kun, Laizeau, Lambert, Lanza, Lasne, Le Campion, Lebreton, Lebzelter, Leccia, Leclerc, Lecoeur-Taibi, Liao, Licata, Lindstrøm, Lister, Livanou, Lobel and Lorca2023), provide an unprecedented opportunity to investigate these questions on statistically robust scales. However, the high-dimensional complexity of these datasets often leads to overlaps in chemical and kinematic spaces. In this context, unsupervised machine learning techniques can be used to detect substructures and uncover hidden stellar populations. Dimensionality reduction methods such as Principal Component Analysis (PCA) (Jolliffe Reference Jolliffe1990), combined with clustering algorithms particularly K-Means (Jin and Han Reference Jin and Han2011), allow the transformation of complex parameter spaces into interpretable structures and enable direct comparison with features reported in the literature (Garcia-Dias et al. Reference Garcia-Dias, Allende Prieto, Sánchez Almeida and Ordovás-Pascual2018, Reference Garcia-Dias, Allende Prieto, Sánchez Almeida and Alonso Palicio2019). In this study, spectroscopic data from APOGEE DR17 and astrometric data from Gaia were combined to investigate stellar populations and merger signatures in the Milky Way. After selecting giant stars with reliable measurements and applying strict quality cuts, orbital parameters were computed under the McMillan potential (McMillan Reference McMillan2017) using the galpy package (Bovy Reference Bovy2015). To mitigate the dominance of disk stars in the sample, a selection cut of
$e_{p}$
$>$
0.25 was applied, following (Fernandes et al. Reference Fernandes, Mason, Horta, Schiavon, Hayes, Hasselquist, Feuillet, Beaton, Jönsson, Kisku, Lacerna, Lian, Minniti and Villanova2023). The classification performance was then tested in three distinct parameter spaces: (i) chemical abundances only, (ii) dynamical parameters only, and (iii) a combination of both. The resulting clusters were evaluated in chemical abundance diagrams and Lindblad diagrams to assess their astrophysical interpretability. The results demonstrate that the clearest separation is achieved when using chemical parameters alone. This confirms the robustness of chemical signatures in tracing accreted populations, whereas purely dynamical or chemo-dynamical parameter sets tend to produce contamination and ambiguities in classification. Overall, the methodology presented here provides reproducible and data-driven criteria forstellar population classification. In future work, the approach will be extended by incorporating additional chemical abundances, which will further improve the accuracy of population separation and contribute valuable insights to the field of Galactic archeology.
2. Data and Methodology
We cross-matched APOGEE DR17 with Gaia DR3, applying quality cuts (S/N
$\geq$
70,
$\sigma_\varpi / \varpi \leq 0.2$
, and clean flags for ASPCAP, STAR, and Fe, Mg, Mn, Al, Ni, Si). Restricting to giants (
$0.5 \leq \log g \leq 3.6$
,
$3500 \leq T_{\mathrm{eff}} \leq 5500$
K (Horta et al. Reference Horta, Schiavon, Mackereth, Weinberg, Hasselquist, Feuillet, O’Connell, Anguiano, Allende-Prieto, Beaton, Bizyaev, Cunha, Geisler, Garca-Hernández, Holtzman, Jönsson, Lane, Majewski, Mészáros, Minniti, Nitschelm, Shetrone, Smith and Zasowski2023) yielded 135,080 stars. Using Astropy (Astropy Collaboration et al. 2013, Reference Price-Whelan, Sipöcz, Günther, Lim, Crawford, Conseil, Shupe, Craig, Dencheva, Ginsburg, VanderPlas, Bradley, Pérez-Suárez, de Val-Borro, Aldcroft, Cruz, Robitaille, Tollerud, Ardelean, Babej, Bach, Bachetti, Bakanov, Bamford, Barentsen, Barmby, Baumbach, Berry, Biscani, Boquien, Bostroem, Bouma, Brammer, Bray, Breytenbach, Buddelmeijer, Burke, Calderone, Cano Rodrguez, Cara, Cardoso, Cheedella, Copin, Corrales, Crichton, D’Avella, Deil, Depagne, Dietrich, Donath, Droettboom, Earl, Erben, Fabbro, Ferreira, Finethy, Fox, Garrison, Gibbons, Goldstein, Gommers, Greco, Greenfield, Groener, Grollier, Hagen, Hirst, Homeier, Horton, Hosseinzadeh, Hu, Hunkeler, Ivezić, Jain, Jenness, Kanarek, Kendrew, Kern, Kerzendorf, Khvalko, King, Kirkby, Kulkarni, Kumar, Lee, Lenz, Littlefair, Ma, Macleod, Mastropietro, McCully, Montagnac, Morris, Mueller, Mumford, Muna, Murphy, Nelson, Nguyen, Ninan, Nöthe, Ogaz, Oh, Parejko, Parley, Pascual, Patil, Patil, Plunkett, Prochaska, Rastogi, Reddy Janga, Sabater, Sakurikar, Seifert, Sherbert, Sherwood-Taylor, Shih, Sick, Silbiger, Singanamalla, Singer, Sladen, Sooley, Sornarajah, Streicher, Teuben, Thomas, Tremblay, Turner, Terrón, van Kerkwijk, de la Vega, Watkins, Weaver, Whitmore, Woillez and Zabalza2018) and galpy (Bovy Reference Bovy2015), we derived stellar kinematics and orbits in the McMillan potential (McMillan Reference McMillan2017), adopting
$R_\odot = 8.2$
kpc,
$V_{\mathrm{LSR}} = 232.8$
km/s, and
$(U, V, W) =(11.10, 12.24, 7.25)$
km/s (Schönrich et al. Reference Schönrich, Binney and Dehnen2010), from which
$R_{\mathrm{apo}}$
,
$R_{\mathrm{peri}}$
,
$Z_{\mathrm{max}}$
,
$L_z$
, E, and e were obtained.
Since disk stars dominate the sample, and this may introduce bias into the machine learning procedure, we followed the approach of (Fernandes et al. Reference Fernandes, Mason, Horta, Schiavon, Hayes, Hasselquist, Feuillet, Beaton, Jönsson, Kisku, Lacerna, Lian, Minniti and Villanova2023) and restricted the analysis to stars with
$e_p > 0.25$
. Subsequently, we employed PCA for dimensionality reduction using three different sets of input features-chemical abundances, kinematic parameters, and their combination. The dimensionality was reduced by monitoring inertia values, after which we applied the K-means clustering algorithm. While the number of clusters was initially guided by inertia breakpoints, inspection of the resulting distributions in the [Mg/Mn]-[Al/Fe] and E-
$L_z$
planes revealed that not all breakpoints yielded astrophysically meaningful results, a difficulty also noted by (Plevne and Akbaba Reference Plevne and Akbaba2025). Therefore, we retained only those cluster numbers that produced physically interpretable outcomes, and examined the corresponding stellar distributions in the relevant planes
3. PCA and K-Means Clustering Algorithm Results
For the dimensionality reduction applied to giant stars, we examined the relationship between cumulative explained variance and the number of components to determine the dimensional space that yields meaningful results. Following this, we applied the K-means clustering algorithm with inertia monitoring. For the chemical-abundance input space, we used [Fe/H], [Mg/Fe], [Mn/Fe], [Al/Fe], [Ni/Fe], and [Si/Fe]; for the kinematic input space, we adopted
$S_{\mathrm{LSR}}$
, E,
$L_z$
,
$v_\phi$
,
$W_{\mathrm{LSR}}$
,
$Z_{\mathrm{max}}$
,
$v_z$
,
$v_r$
,
$R_{\mathrm{apo}}$
,
$R_{\mathrm{peri}}$
, and e; and for the combined case, we included all of these parameters. The results indicate that the most robust approach is obtained when using only the chemical abundances as input features. As shown in Figure 1, the stellar counts in each cluster, together with their median metallicities, eccentricities, and
$Z_{\mathrm{max}}$
values, are reported for both the [Mg/Mn]-[Al/Fe] and E-
$L_z$
planes. Although some overlap is present, the clusters can be interpreted as follows: Cluster 2 corresponds to the thin disk, Cluster 0 to the thick disk, Cluster 1 to the halo, and Cluster 3 to the accreted population. Despite the
$e_p > 0.25$
cut, the dominance of disk stars remains visible.
Clustering results of giant stars using chemical abundances as input features. The panels show the distributions in the [Mg/Mn]-[Al/Fe] and E-
$L_z$
planes. For each cluster, the stellar counts, along with median values of [Fe/H], eccentricity (e), and
$Z_{\mathrm{max}}$
, are indicated. Despite some overlap, the clusters correspond to the thin disk (Cluster 2), thick disk (Cluster 0), halo (Cluster 1), and accreted stars (Cluster 3).

4. Conclusion
By combining APOGEE DR17 and Gaia DR3 data, we constructed a high-quality giant- star sample and applied PCA with K-means to explore the chemo-dynamical structure of the Galaxy. Tests with different input spaces showed that chemical abundances alone provide the clearest separation of stellar populations. In particular, as illustrated in Figure 2, the [Mg/Fe]-[Fe/H] plane reveals distinct loci for the thin disk, the thick disk/halo, and the accreted component. Overall, our results demonstrate that abundance-driven clustering is an effective tool for disentangling Galactic populations and isolating ex-situ stars.
Distribution of the four clusters obtained with PCA + K-means in the [Mg/Fe]-[Fe/H] plane. The clusters reveal distinct loci corresponding to the thin disk, the thick disk/halo, and the accreted population, with partial overlap between components.

Acknowledgements
This research was supported by the Scientific and Technological Research Council of Turkey (TÜBİTAK) under project number 123F227 and the 2211-C Priority Areas Fellowship Program. Additional funding was provided by the Scientific Research Projects Coordination Unit of Istanbul University under project numbers 40044, FDK-2025-41537.



Lz
Zmax