Classification of Fermi Gamma-Ray Bursts Based on Machine Learning

Gamma-ray bursts (GRBs) are typically classified into long and short GRBs based on their durations. However, there is a significant overlapping in the duration distributions of these two categories. In this paper, we apply the unsupervised dimensionality reduction algorithm called t-SNE and UMAP to classify 2061 Fermi GRBs based on four observed quantities: duration, peak energy, fluence, and peak flux. The map results of t-SNE and UMAP show a clear division of these GRBs into two clusters. We mark the two clusters as GRBs-I and GRBs-II, and find that all GRBs associated with supernovae are classified as GRBs-II. It includes the peculiar short GRB 200826A, which was confirmed to originate from the death of a massive star. Furthermore, except for two extreme events GRB 211211A and GRB 230307A, all GRBs associated with kilonovae fall into GRBs-I population. By comparing to the traditional classification of short and long GRBs, the distribution of durations for GRBs-I and GRBs-II do not have a fixed boundary. We find that more than 10% of GRBs-I have a duration greater than 2 seconds, while approximately 1% of GRBs-II have a duration shorter than 2 seconds.


INTRODUCTION
Gamma-ray bursts (GRBs) are the most powerful explosions in the universe (Gehrels et al. 2009).Traditionally, GRBs are classified into two categories based on the bimodal distribution of durations: long GRBs (LGRBs) with a duration longer than 2 seconds (T90 > 2 s), and short GRBs (SGRBs) with T90 < 2 s (Kouveliotou et al. 1993).Several lines of observational evidences suggest that some LGRBs are associated with Type Ic supernovae (SNe), such as GRB 980425/SN 1998bw and GRB 030329/SN 2003dh, which is believed to originate from the core-collapse of massive stars (Woosley 1993;Galama et al. 1998;Stanek et al. 2003;Woosley & Bloom 2006;Hjorth & Bloom 2012).Recently, the discovery of GRB 170817A that are associated with gravitational wave (GW) GW170817 and kilonova (KN) AT 2017gfo, has confirmed that a part of SGRBs originate from mergers of binary compact star (Abbott et al. 2017;Goldstein et al. 2017;Savchenko et al. 2017;Wang et al. 2017).
However, the traditional classification schemes have been challenged by recent observations, the dichotomy based on phenomenon does not necessarily correspond to the two distinct physical origins of GRBs.Some short-duration GRBs (such as GRB 090426, GRB 100816A, and GRB 200826A) are thought to possibly originate from massive collapsars (Zhang et al. 2009;Fan & Wei 2011;Nicuesa Guelbenzu et ⋆ Contact e-mail: fwzhang@pmo.ac.cn al. 2011;Xin et al. 2011;Zhang et al. 2012;Ahumada et al. 2021;Zhang et al. 2021;Rossi et al. 2022), while some longduration GRBs (such as GRB 060505, GRB 060614, 211227A, and GRB 211211A) are believed to possibly originate from compact binary mergers (Della Valle et al. 2006;Gal-Yam et al. 2006;Gehrels et al. 2006;Fynbo et al. 2006;Zhang et al. 2007;Lü et al. 2022;Rastinejad et al. 2022;Troja et al. 2022;Xiao et al. 2022;Yang et al. 2022;Zhu et al. 2022).Moreover, a significant overlapping is presented in the T90 distribution of SGRBs and LGRBs, and the measurement of T90 strongly depends on instrument and energy band (Zhang et al. 2012;Qin et al. 2013).It means that T90 is not necessarily a reliable indicator of the physical nature of a GRB.
According to the generally accepted two-types progenitors of GRBs, the properties of their host galaxies are statistically different (Zhang et al. 2009;Fong et al. 2010;Li et al. 2016).GRBs that are originated from mergers of compact stars, are usually located in the faint regions of the dwarf and elliptical galaxies, and they have a large offset from the galaxy center with a small local star formation rate (Berger et al. 2005;Gehrels et al. 2005;Fong et al. 2010).However, GRBs originating from collapsars are usually located at the bright regions in the irregular and dwarf galaxies which have small offset from the center and a large local star formation rate.According to the multi-band observations of GRBs including their host galaxies, Zhang et al. (2009) classified GRBs as Type I and Type II which are corresponding to the progenitors of massive star collapsar and compact star merger, respectively.
In addition to these two main classes explored above in detail, a number of sub-classes have also been proposed, such as Ultra-long GRBs, X-ray flashes/X-ray rich GRBs, SGRBs with extended emission, and so on, even though their progenitors have not yet been identified.Furthermore, some authors suggested that there are three or five types of GRBs (Horváth 1998;Mukherjee et al. 1998;Chattopadhyay & Maitra 2017;Acuner & Ryde 2018).Bhardwaj et al. (2023) applied the Gaussian Mixture Model (GMM) to explore whether there is more GRB sub-classes based on a broader set of parameters, including prompt and plateau emission ones.They found the microtrends of sub-classes.For more details please refer to Bhardwaj et al. (2023) and the references therein.
Motivated by the recent observational advances of GRBs, we reanalyze the classification of Fermi GRBs using the t-SNE and UMAP methods.The four key physical parameters (duration, peak energy, fluence and peak flux) are adopted.The structure of our paper is organized as follows.In Section 2, we describe the t-SNE and UMAP methods, as well as the sample selection.A clear classification based on the t-SNE and UMAP map and the statistical analysis for this classification is shown in Section 3. The distribution of some special GRBs on t-SNE and UMAP maps and the discussions of the physical meaning of this new classification are shown in Section 4. The conclusions are shown in Section 5.The symbolic notation Qn = Q/10 n is adopted.

METHOD AND DATA
2.1 t-Distributed Stochastic Neighbour Embedding t-SNE is an unsupervised machine learning algorithm that can nonlinearly reduce high-dimensional data to twodimensional or three-dimensional for visualization (van der Maaten & Hinton 2008; van der Maaten 2014).The basic principle of t-SNE is to establish a mapping relationship between high-dimensional space and low-dimensional space, so that similar data points in high-dimensional space are embedded in similar positions in low-dimensional space, while dissimilar data points in high-dimensional space are embedded in far positions in low-dimensional space.The calculation of the axes in the embedded low-dimensional space depends on the similarity between sample points in the highdimensional space and the distance between sample points in the low-dimensional space.Furthermore, this process depends upon random initialization, and running t-SNE on an identical dataset can produce a variety of maps with similar topologies (Steinhardt et al. 2020;Zhang et al. 2020).Thus, the axes resulting from t-SNE dimensionality reduction do not have proper labels or physical meaning, and only represent the structure and distribution of the data in the high-dimensional space, called the t-SNE dimension x and the t-SNE dimension y.
The most important hyperparameters applied in the t-SNE technique (the hyperparameters listed in sklearn.manifold.TSNE in python) is the perplexity, which determines the sizes of the neighbourhoods based on the density of the data in the respective regions and can be approximately interpreted as the typical number of neighbours which should be considered similar when computing distances.A higher perplexity value will consider a larger number of neighbors, emphasizing the global structure of the data.Conversely, a lower perplexity value will better reflect the particular structure of the data, and choosing the appropriate perplexity value is crucial for representing both local and global aspects of the data.It should be noted that t-SNE requires that each object in the dataset have a uniform data dimension without any missing values.

Uniform Manifold Approximation and Projection
UMAP is a non-linear dimension reduction algorithm based on manifold learning techniques and topological data analysis, and is also an unsupervised machine learning algorithm.
It is similar to t-SNE, but UMAP can preserve the integrity of global data more completely than t-SNE in theory and implementation (Due to the complexity of t-SNE calculations, the dataset usually uses PCA to reduce the dimensionality first), and has a better dimensionality reduction effect (van der Maaten & Hinton 2008;van der Maaten 2014;McInnes et al. 2018).UMAP also embeds high-dimensional data into lowdimensional space while retaining the global similar structure.Similarly, the axes of this low-dimensional space do not have proper labels or physical meaning.We use a python module umap-learn1 introduced by McInnes et al. ( 2018) to obtain the UMAP analysis results.The most important hyperparameters of UMAP are n neighbors and min dist.n neighbors determine the number of neighboring points used in local approximations of manifold structure, and min dist controls how tightly the embedding is allowed to compress points together.Note that when UMAP is applied to the dataset, the dimensions of each object must also be the same.

Data
The Fermi GRBs are taken from the Fermi Catalog2 until the end of April 2021.In total, there are 3029 events.We mainly consider GRBs with the well-measured four-dimensional data including the duration (T90), peak energy (Ep), peak flux (Fp) and fluence (Sγ).In order to eliminate the effect of the time resolution on the peak flux, we uniformly select the Fp with the timescale of 64 ms for all GRBs.The four spectral models including the Band model (Band et al. 1993), the power law (PL) model, the cutoff power law (CPL) model, and the smoothly broken power law (SBPL) model are used to fit the spectra of GRBs.The values of Ep and Sγ are mainly taken from the best spectral fitting model.If the best fitting model of one GRB is PL model, we take the CPL model to obtain the Ep value.To ensure the accuracy of Ep in our sample, we exclude the GRBs in which the error of Ep is larger than 40%.A total of 2057 GRBs with well fourdimensional data are selected.
There are several unique GRBs, including GRB 190114C, GRB 200826A, GRB 211211A, and GRB 230307A.Although they have no time-integrated spectrum data in the Fermi Catalog, we still include these GRBs in our sample and take the values of Ep and Sγ from the GRB Coordinates Network (GCN).Finally, we compile a Fermi sample containing 2061 GRBs.

CLASSIFICATION
We use t-SNE (perplexity = 60) and UMAP (n neighbors = 30 and min dist = 0.01) methods to map the Fermi sample based on T90, Ep, Sγ, and Fp, respectively, as shown in Figure 1.Interestingly, the GRBs of the Fermi sample are clearly divided into two clusters, between which one is larger and the other is smaller, and t-SNE and UMAP maps present similar structures.To comply with traditional classification methods, we call the small cluster as GRBs-I and the larger cluster as GRBs-II.The detailed classification result and the prompt emission parameters of Fermi GRBs based on t-SNE and UMAP methods are listed in Table 1.We also investigate the difference between results of t-SNE and UMAP, and find that the types of 7 GRB are different from the results of t-SNE and UMAP, where 6 GRBs (GRB 081130212, GRB 090320045, GRB 101002279, GRB 120504945, GRB 131128629, GRB 140912664) are classified as GRBs-I on the t-SNE map, while they are classified as GRBs-II on the UMAP map; and one GRB (GRB 150819440) is classified as GRBs-II on the t-SNE map, while which is classified as GRBs-I on the UMAP map.For UMAP (t-SNE) result, there are 334 (339) GRBs-I, accounting for 16.2% (16.4%) of the Fermi sample, and 1727 (1722) GRBs-II, accounting for 83.8% (83.6%) of the Fermi sample.Since there is only a few difference between t-SNE and UMAP, we mainly focus on the UMAP result in the following text.The T90, Ep, Sγ, and Fp distributions based on UMAP method are shown in Figure 2.For GRBs-I (GRBs-II), the median values and dispersions are T90 ∼ 0.58 (27.38) s, σ ∼ 0.46 (0.47), Ep ∼ 512 (177) keV, σ ∼ 0.36 (0.34), Sγ ∼ 0.55 (5.24) × 10 −6 erg cm −2 , σ ∼ 0.49 (0.62), Fp ∼ 9.60 (9.04) ph s −1 cm −2 , σ ∼ 0.34 (0.38).
We find that GRBs-I have relatively short T90.The median values of the T90 distribution of the two clusters are significantly separated, and the T90 of the two clusters show bimodal distribution as a whole.For the distributions of Ep, Sγ, and Fp, there are no obvious distinctions between GRBs-I and GRBs-II, but the median values of Ep and Fp of GRBs-I are larger than GRBs-II, and the median value of Sγ of GRBs-I is smaller than that of GRBs-II.The distribution characteristics T90, Ep, Sγ, and Fp of GRBs-I and GRBs-II are similar to those of the previous SGRBs and LGRBs.
We color each GRB with T90, Ep, Sγ, and Fp in the two clusters, respectively.As shown in Figure 3, t-SNE and UMAP maps show similar trends of change.The distributions of T90, Sγ and Fp on the t-SNE and UMAP map will rise gradually with a certain direction, and the color will obviously change from dark to light (from dark red to light yellow).t-SNE and UMAP have roughly approximated the GRBs into two clusters according to T90.However, there is no absolute boundary for T90 alone between the two clusters.Specifically, T90 of some GRBs-I is longer than that of some GRBs-II.For GRBs-I, T90 can reach a maximum of 8 s, and for GRBs-II, T90 can reach a minimum of 0.4 s, which is different from the traditional classification methods (which take T90 = 2 s as the boundary).We also find that there are some sub-structures in GRBs-I and GRBs-II, but this is not the focus of this work, so we will not do detailed studies in this paper.Note that, changing the perplexity or n neighbors will obtain different topological structures to study more refined sub-structures, but only suitable data can obtain this clearly separated structure, and if the data is not appropriate, no matter how the perplexity is changed, it will not achieve obvious separate structure, which is also not the focus of this work.

GRBs Associated with Other Electromagnetical Counterparts
The t-SNE and UMAP maps indeed show that the bursts with similar properties tightly cluster together, and the two clusters may strongly indicate intrinsically different physical properties and/or different origins.Although the classification of individual GRBs as collapsar or merger based on simple criteria such as duration, light curve and so on, is uncertain, particularly for some confusing bursts, many bursts can be unambiguously classified as collapsar or merger on the basis of other observations such as supernova, kilonova and gravitation wave.It is therefor necessary to confirm that whether the classification proposed here matches the previous results.
In our sample, three GRBs, GRB 150101B, GRB 160821B and GRB 170817A are associated with KNe (Wang et al. 2017;Troja et al. 2018;Lamb et al. 2019;Troja et al. 2019), and all belong to GRBs-I (Figure 4).GRB 170817A associated with GW170817, has been confirmed that it originates from the merger of binary neutron stars (Abbott et al. 2017;Goldstein et al. 2017;Wang et al. 2017).Recently, it is reported that long duration GRB 211211A is also accompanied by a KN, which might originate from a compact star merger (Rastinejad et al. 2022;Xiao et al. 2022;Yang et al. 2022).This burst was located at the edge of the GRBs-II on the t-SNE and UMAP maps.However, Barnes & Metzger (2023) suggested that collapsars can also explain the origin of GRB 211211A.Thus the physical origin of GRB 211211A needs to be further explored and confirmed by more observations.Similarly, some authors reported that GRB 230307A may also arise from a merger, which is here located on the edge of the GRBs-II, and close to GRB 211211A on both t-SNE and UMAP maps.(Levan et al. 2024;Yang et al. 2024).The main parameters of these bursts are also listed in Table 2.
Interestingly, we find that the four GRBs (GRB 090618, GRB 130427A, GRB 171010A and GRB 190114C) associated with SNe are clustered on the upper left of the t-SNE and UMAP maps, and three GRBs (GRB 150101B, GRB 160821B and GRB 170817A) associated with KNe are also very close on the t-SNE and UMAP maps.It is believed that GRB 090618, GRB 130427A and GRB 190114C might originate from binary-driven hypernova (BdHN) (Izzo et al. 2012;Wang et al. 2019), while GRB 160821B and GRB 170817A originate from the merger of binary neutron stars (Troja et al. 2019).Because relatively few bursts have known counterparts or other additional information, it is difficult to connect these clusters with physical origin.However, the few bursts known to have a common origin, such as supernovae, kilonovae, are indeed mapped to nearby locations.These results support that the t-SNE and UMAP maps may indeed aggregate GRBs with the same origin, which provides a way to find or verify GRBs without GW observations as KN candidates in the future.

Special GRBs
GRB 100816A is a controversial GRB, and its duration and spectral lag are consistent with being a SGRB (Norris et al. 2010).Fan & Wei (2011) favored the free-wind medium model for GRB 100816A, in which the progenitor should be a massive star rather than a compact binary.Zhang et al. (2012) calculated the energy ratio of GRB 100816A and suggested that the GRB 100816A should belong to LGRBs.In addition, GRB 100816A also complies with the Ep,z-Eiso correlation of LGRBs (Gruber et al. 2011b).As shown in Figure 4, GRB 100816A is located at the region of GRBs-II with a GRB associated with SNph near it, which also indicates that GRB 100816A might originate from massive star collapse.
Since no SN association of GRB 100816A was observed with the subsequent observations, the origin of those short LGRBs is still not entirely certain.However, the observation of GRB 200826A gives decisive evidence that there are some GRBs with T90 < 2 s originating from collapsar.GRB 200826A is also a unique GRB, which is a typical SGRBs LGRB with a duration in the short tail of the distribution (Ahumada et al. 2021;Zhang et al. 2021;Rossi et al. 2022).As shown in Figure 4, GRB 200826A is clearly located in GRBs-II.
GRB 091024 is an ultra-long GRB with T90 ≈ 1020 s and triggered Fermi/GBM twice (GRB 091024372 and GRB 091024380) (Bissaldi & Connaughton 2009;Gruber et al. 2011a).GRB 091024372 is the first emission episode with T90 ≈ 94 s, and GRB 091024380 is the second emission episode with T90 ≈ 450 s.GRB 130925A is also an ultra-long GRB with T90 ≈ 4500 s and triggered Fermi/GBM twice, GRB 130925164, and GRB 130925173, respectively (Bissaldi & Connaughton 2009;Gruber et al. 2011a;Hou et al. 2014).GRB 130925164 may be the precursor pulse of GRB 130925A with T90 ≈ 6 s, and GRB 130925173 may be the second emission episode with T90 ≈ 216 s (Fitzpatrick 2013;Jenke 2013).As shown in Figure 4, those second emission episodes, GRB 091024380 and GRB 130925173, of these two bursts are very close on the t-SNE map, which implies that they may have a common physical origin.
Recently, a short-hard GRB named GRB 200415A was observed, with a position coincident with the Sculptor Galaxy (NGC 253).However, its various properties can be explained naturally by the magnetar giant flare, including its location, temporal and spectral features, energy, statistical correlations, and high-energy emissions.This raises the question of whether GRB 200415A is a classic SGRB or a magnetar gi-ant flare (Zhang et al. 2020;Roberts et al. 2021).Note that magnetar giant flares, if occurring in nearby galaxies, would appear as cosmic short-hard GRBs.As shown in Figure 4, GRB 200415A is located in GRBs-I and far away from GRB 170817A, GRB 160821B, and GRB 150101B, which indicate that GRB 200415A may have a different origin.

Comparison with the Traditional Short and Long Classification
For UMAP (t-SNE) result, there are 42 (47) long GRBs-I with T90 > 2 s, accounting for 12.6% (13.9%) of the GRBs-I, and 14 (14) short GRBs-II with T90 < 2 s, accounting for 0.8% of the GRBs-II, which are different from the previous traditional short and long classification methods.GRB 100816A is considered as short GRBs-II due to its particularity, even though its T90 is slightly larger than 2 s in our sample.GRB 170817A is not considered as long GRBs-I , even though its T90 is slightly larger than 2 s.As shown in Figure 5, except for the GRB 180511437 on the t-SNE map and GRB 180511437 and GRB 131128629 on the UMAP map, other short GRBs-II are clustered near GRB 100816A and GRB 200826A.There are 6 short GRBs-II near GRB 200826A on the t-SNE map, namely GRB 120323A, GRB 140209A, GRB 150819B, GRB 170206A, GRB 171126A and GRB 180703B.For the UMAP result, GRB 150819B is classified as short GRBs-I and remaining 5 GRBs are also near GRB 200826A.We find that the spectral lags of GRB 140209A and GRB 180703B (Norris et al. 2014;Pal'Shin et al. 2018) are similar to GRB 200826A and obviously consistent with the traditional LGRBs.This supports the fact that some "short" GRBs are produced by the collapse of stars, represented by GRB 100816A and GRB 200826A.Although they may exhibit the properties of "long" GRBs in some ways, they may be limited by observed conditions, and are misclassified.
We also analyze long GRBs-I and find some evidence that these bursts might be associated with compact star mergers.GRB 180618A is considered to be a SGRB with ex-tended emission (Hamburg et al. 2018;Svinkin et al. 2018); GRB 140619B is also considered to be a SGRB and may be from a binary neutron stars merger (Kocevski et al. 2014;Ruffini et al. 2015); GRB 141222A with the negligible spectral lag is similar to SGRBs (Golenetskii et al. 2014).Recently, Petrosian & Dainotti (2024) analyzed the formation rate of LGRBs and found that low redshift LGRBs could also have compact merger progenitors.
Short GRBs-II and long GRBs-I may be the tails of T90 bimodal distribution and the source of the "intermediate" GRBs.The t-SNE and UMAP methods can clearly classify them.For long GRBs-I, some theoretical models such as the merger of NS and massive white dwarfs (WD) (King et al. 2007) have been suggested.
Since there are 4 special GRBs with partial data from GCN, we also perform a stability analysis after removing them.We found that after removing them, the classification results of t-SNE and UMAP changed for only 1 GRB each.GRB150819440 (T90=0.96s) changed from GRBs-II to GRBs-I in the t-SNE results.GRB081006604 (T90=6.4s) changed from GRBs-I to GRBs-II in the UMAP results.However, due to the lack of more information on these two GRBs, they could not be further analyzed.Therefore, the results suggest that some specific GRBs do affect the classification of individual GRBs, but the effect on the whole sample is negligible.

CONCLUSIONS
We use the unsupervised dimensionality reduction algorithms t-SNE and UMAP to classify 2061 Fermi GRBs based upon the four observed quantities, duration, peak energy, fluence and peak flux.The t-SNE (perplexity = 60) and UMAP (n neighbors = 30 and min dist = 0.01) maps show that these GRBs are clearly divided into two clusters, which support that GRBs should be classified into two types and might indeed originate from two different progenitors.We label the two clusters as GRBs-I and GRBs-II, and find that all GRBs associated with supernovae are classified as GRBs-II, especially for GRB 200826A, a peculiar short GRB that has been confirmed from a collapsar.Furthermore, except for GRB 211211A and GRB 230307A, all GRBs associated with kilonovae belong to GRBs-I.Three GRBs (GRB 090618, GRB 130427A and GRB 190114C) originated from binarydriven hypernova are clustered on the upper left of the t-SNE and UMAP maps, and two GRBs (GRB 160821B and GRB 170817A) originated from the merger of binary neutron stars are also very close on the t-SNE and UMAP maps.These results indicate that the t-SNE and UMAP methods may indeed aggregate GRBs with the same origin, and GRBs-I are associated with compact mergers while GRBs-II are associated with collapsars.
Contrary to the traditional short and long classification, there is no absolute boundary of duration between GRBs-I and GRBs-II does not have an absolute boundary.T90 of GRBs-I can reach a maximum of 8 s, and T90 of GRBs-II can reach a minimum of 0.4 s.Furthermore, we find that more than 10% of GRBs-I duration is greater than 2 seconds and about 1% of GRBs-II duration is less than 2 seconds.This indicate that part of short bursts have different origin, perhaps from collapsing stars, which has been confirmed by GRB 200826A.While some long bursts have also different origins than most, probably from compact star mergers, such as GRB 211211A and GRB 230307A.

Figure 1 .Figure 2 .
Figure1.The t-SNE and UMAP 2D projection of the 2061 GRBs from the Fermi Catalog based on T 90 , Ep, Sγ , and Fp.There are clear two clusters: one cluster with dots in red (GRBs-I) and the other cluster with dots in blue (GRBs-II).The axes resulting from the t-SNE and UMAP have no clear physical interpretation or units, and only the structures are meaningful.

Figure 3
Figure 3. t-SNE (on the left) and UMAP (on the right) maps of Fermi GRBs, colored based on log T 90 , log Ep, log Sγ , and log Fp, respectively.

Table 1 .
The prompt emission parameters and classification results of Fermi GRBs based on t-SNE and UMAP methods This table represents a small portion of our Fermi GRB sample, the full table is available in machine-readable form.)

Table 2 .
The prompt emission parameters of GRBs associated with SN or GW/KN observations in the sample