Electromagnetic Counterpart Identification ofGravitational-wave candidates using deep-learning

Deep ChatterjeeCenter for AstroPhysical Surveys,
National Center for Supercomputing Applications,
Urbana, IL, 61801, USA
deep1018@illinois.edu
Gautham Narayan
Department of Astronomy,
University of Illinois at Urbana-Champaign,
Urbana, IL 61801, USA
gsn@illinois.edu

Patrick D. Aleo
Department of Astronomy,
University of Illinois at Urbana-Champaign,
Urbana, IL 61801, USA
paleo2@illinois.edu

Konstantin Malanchev
Department of Astronomy,
University of Illinois at Urbana-Champaign,
Urbana, IL 61801, USA
kostya@illinois.edu

Daniel Muthukrishna
Institute of Astronomy,
University of Cambridge,
Cambridge CB3 0HA, UK
djm241@cam.ac.uk

Abstract
Both time-domain and gravitational-wave (GW) astronomy have gone through arevolution in the last decade. These two previously disjoint fields converged whenthe electromagnetic (EM) counterpart of a binary neutron star merger, GW170817,
was discovered in 2017. However, despite the discovery rate of GWs steadily increasing, by several folds in each observing run of the LIGO/Virgo GW instruments,
GW170817 remains the only success story of EMGW astronomy. While future
GW detectors will detect even larger number of events, this does not guarantee
corresponding increase in the number of EM counterparts discovered. In fact, thegrowing number is overwhelming since wide-field telescope surveys will have tocontend with distinguishing the optical EM counterpart, called a kilonova, fromthe ever increasing number of “vanilla” transients objects they encounter during a
GW follow-up operation. To this end, we present a novel tool based on a temporalconvolutional network (TCN) architecture for Electromagnetic Counterpart Identification (El-CID). The overarching goal of El-CID is to slice through list of objects
that are consistent with the GW sky localization, and determine which sources
are consistent with kilonovae, allowing limited and judicious use of telescope andspectroscopic resources. Our classifier is trained on sparse early-time photometry
and contextual information available during discovery. Apart from verifying ourmodel on an extensive testing sample, we also show succesful results on real events
during the previous LIGO/Virgo observing runs.

1

Introduction

The field of gravitational waves (GWs) has moved swiftly since the discovery in 2015 [1]. The numberof discovered events have increased more than an order of magnitude over the last five years, from
Fourth Workshop on Machine Learning and the Physical Sciences (NeurIPS 2021).

three events in the first observing run of the LIGO/Virgo GW instruments, to more than thirty in themost recent catalog [2]. One of the more interesting topics related to GWs today is the prospect to do
multi-messenger astronomy with them – observing the same source in GWs, EM radiation, and otherhigh-energy astrophysical probes. Of relevance to this work is the joint detection of GWs from binary
neutron star mergers and the optical component of the EM radiation resulting from the radioactive
decay of heavy elements produced in the aftermath, called a kilonova [3]. While this was hypothesized
decades back [4], the first discovery happened in 2017 when GWs from a binary neutron star merger,
GW170817, [5, 6] was followed by the exhaustive observation of the kilonova, AT 2017gfo, in thehours through days following discovery [7, 8, 9, 10, 11, 12, 13]. Such joint observations provide richobservational data for astronomy, astrophysics, cosmology, and fundamental physics [14, 15, 16, 17].
Starting from the third LIGO/Virgo observing run, O3, in 2019-2020, there has been been several
efforts towards coordinating GW follow-up [18, 19]. However, it can be safely said that there wasdisappointment when O3 concluded without another coincident kilonova observation.
While the growing number of GW discoveries brings hope to detect more counterparts, we are also in
the era of where transient discovery is profuse [20]. Today, a typical photometric telescope survey
detects several thousands of new supernovae yearly for example. Therefore, it is challenging todetect the more exotic transients like kilonovae even in the case of targeted searches. Going ahead,follow-up teams will have to contend with the fact that a search for the kilonova will be confoundedby several other, more “vanilla” objects, like supernovae whose astrophysical rates are several ordersof magnitude greater than binary neutron star (BNS) mergers. This was already witnessed during
O3. A visual description of the scenario we envision is shown in left panel of Fig. 1. Here, weshow a fiducial GW sky-localization (skymap) along with the true location of the kilonova using
symbol ‘x’. But there maybe several objects, like supernovae, represented by solid circles that maybe
temporally coincident with high-confidence portions of the skymap. It may not be possible to perform
spectroscopic analysis on all the candidates in a timely manner. Hence the motivation of creatinga classifier that will be able to distinguish the kilonova from other objects using the initial sparse
photometric data, and other contextual information that is available during discovery time.

2

Methodology

2.1

Dataset preparation: Connecting binaries to observed lightcurves

We build an end-to-end dataset starting with an
ensemble of BNS mergers. From this ensemble, we determine which systems are detected in
GWs by the LIGO/Virgo/KAGRA instuments
based on their sensitivity in future observing
runs. This step involves determining whether
the system produces a GW strain that produces
a signal-to-noise (S/N) ratio ≥ 8 (typical threshold) in at least two GW detectors. The result
depends on the noise realization of the era. We
consider both the upcoming fourth observing
run, O4, and the design sensitivity era independently. The results presented here are the forthe former case, but the results are qualitatively
similar for the latter case. In the event the signal is detected, the S/N time-series is used to
produce a GW sky-localization (skymap). The
fundamental principle utilizes the timing difference in arrival of the signal in different detectors to create a probability density map in sky
coordinates. This is done using the rapid skylocalization algorithm, BAYESTAR [21] that isused in LIGO/Virgo realtime discoveries. Next,
we connect the binary properties to the ejecta
properties. Among the factors affecting the properties of the kilonova the most important is the

60◦

50◦

17h 00m

16h 00m

Figure 1: An hypothetical scenario of a targeted
GW follow-up – the true EM counterpart to the
GW, the kilonova, is shown using the “x” symbol.
There maybe other objects, like supernovae, in thefield of view. These are shown using the solid
circles.

2mass ejected from the aftermath of the merger of two stars and equation of state of the star. In orderto map the binary parameters like masses and spins of the components to the ejected mass, we use anempirical fit developed in Ref. [22] from numerical relativity merger simulations of BNSs. The ejecta
properties then determine the spectral evolution of the kilonova in time in different filters i.e., its
lightcurve. Theoretical modeling of kilonovae is still in its infancy – several models and parameterizations exist to describe the same physical system. We use the models by Bulla [23] and Kasen [24]which have been widely used in the literature earlier in the analysis of AT 2017gfo [9, 25]. Hence forevery binary, we are able to obtain a kilonova spectral energy density (SED). To get the observed
lightcurve, we use the Supernova Analysis library, SNANA. One of the primary use case of SNANA
is in simulating observed lightcurves given a survey cadence accounting for instrument detection
uncertainties and sky noise. A notable effort in supervised classification of lightcurves using SNANA
is the Photometric LSST Astronomical Time Series Classification Challenge (PLAsTiCC) [26, 27].
This challenge was hosted publicly on the Kaggle platform 1 to classify millions of lightcurves inthe era of the Rubin Observatory [28]. In this study, however, we use the observing schedule of the
Zwicky Transient Facility’s (ZTF) from its third data release. ZTF has participated actively in thefollow-up of GWs, and therefore we make the choice for this work. Also, ZTF will be participatingin the GW follow-up in the coming observing run. In the Appendix, we show some examples oflightcurves of the KNe and other objects (see Fig. 5). We also verify that there is no selection effectin choosing one model over the other in the data preparation step (see bottom panel of Fig. 5).
2.2

Simulating rest of the sky

The steps in the above section provides us with a skymap and a KN lightcurve for each BNS simulationthat is detected i.e., analogous to the skymap and the ‘x’ symbol in Fig. 1. To simulate other objects
that will pollute the search for a KN, we use SNANA along with the same ZTF DR3 cadence for avariety of supernova models and tidal disruption events.2 In this study, we restrict to extragalactictransients, but this will be extended in the future to include galactic transients like M-dwarf flares
which could have similar time scales as KNe. For each of the detected GW event, we use a windowof a week to select other objects that had their first detection in this period. This is because we
expect a typical KN to reach peak brightness within a few days from the time of the GW trigger.
If the first detection is outside this window the new object is unrelated to the GW event. We rank
the objects based on the line-of-sight probability value of the skymap, and select the top 20 to becontaminant. While is this an empirical choice, we have verified that changing this number does nothave a significant effect on the performance of the classifier. Details of breakdown of the object types
and numbers is presented in Appendix A.2.

3

Binary classification using TCN

During the early hours through days following a BNS GW candidate, the primary question for a
new EM candidate is whether it is/isn’t associated with the GW event. We, therefore, consider
the problem from a binary classification standpoint. For our feature set we consider the ∼ 1 week
lightcurve data of the objects from Table 1. Every object has different timescale features e.g., rise/fall,and color evolution in different passbands which the network is able to learn with more incoming
data. In addition to the lightcurves, we also supply important contextual information in the form
certain feature of the skymap. We have this because all objects in our dataset have a skymap justlike the scenario for a real GW follow-up. We use the line-of-sight probability for the object, andthe angular offset from the mode of the distribution. This is important contextual information since
KN are expected to have high correlation with the high-probability regions of the skymap comparedto the other objects which would be uncorrelated. The offset is important since for GWs detected
in two-detectors, the skymap can have a ring-like profile in the sky. We additionally supply the
90% sky-localization area as another feature. Note that, unlike the time-series data of the lightcurve,
the contextual information are constant, repeating arrays of the same length as the lightcurve. The
contextual information allows the network to put a prior score to candidates even in absence ofphotometric data. We use a temporal convolutional network (TCN) [29] as implemented in Ref. [30]using the open-source library Tensorflow [31]. The network is similar to that used in Ref. [32] for1

https://www.kaggle.com/c/PLAsTiCC-2018
These are a subset of the types used in for PLAsTiCC [26] – SALT2 SNIa, SNII NMF model, SNII Vincenzi
model, SNIa 91bg, SLSN, SNIax, SNIbc.
2

3

...

yN −1

yN
input_1: InputLayer

d=4masking: Masking

d=2
tcn: TCN

k=3

input:[(None, 12, 6)]

output:[(None, 12, 6)]

input:(None, 12, 6)

output:(None, 12, 6)

input:(None, 12, 6)

output:(None, 12, 32)

d=1
time_distributed(dense): TimeDistributed(Dense)

...

xN −1

input:(None, 12, 32)

output:(None, 12, 2)

xN

Figure 2: Left: Basic architecture of a TCN (see Ref. [29]). The convolutions are causal and therefore
suited to learn temporal features. Right: The block diagram of our network.

DECam

Magellan
R
g
i

17.0

Swope
R
g
i

17.5

R
g
i

17.5

17.5

18.0
18.0

18.0

19.0

Mag.

Mag.

Mag.

18.5
18.5

18.5
19.0

19.5
20.0

19.0
19.5

19.5

20.0

20.5
20.5

20.0
0

2

4

6

0

1

Time

2

3

4

0

1.0

1.0

0.8

0.8

0.8

0.6

0.6

0.2

0.2

0.2

0.0

0.0
6

5

KN class
Other class

0.4

4

4

KN class
Other class

0.4

0.0

3

0.6

KN class
Other class

0.4

2

2

Time

1.0

0

1

Time

0

1

2

3

4

0

1

2

3

4

5

Figure 3: Top: Photometry of AT 2017gfo from different instruments Bottom: Binary classification
score of being a “Kilonova” or “Other”.

realtime classification of different classes of supernovae. The convolutions of a TCN are causal
and therefore suited to learn temporal features which is of interest here (see Fig. 2). We linearlyinterpolate the lightcurves with a periodic interval of ∼ 0.7 days. This choice was made by analyzing
the distribution of time difference between consecutive observations of the KNe and considering the
80-percentile. While this is an empirical choice, excessively larger time steps decimate temporalfeatures and excessively smaller time steps cause unexpected, jittery behavior. This pre-processing
step is required to prepare uniformly sampled arrays of the lightcurve. We consider a total length of
12 i.e., about a week post the GW trigger. Our temporal array is 3-dimensional – one each for theflux in each ZTF filter (g, R, and i). Additionally, we supply the 3 contextual information mentioned
above. Thus, our input arrays have the shape 6x12. The labels are “Kilonova” or “Other”. We use
32 channels for the TCN with a droptout rate of 5% during training. We use a convolution kernel ofsize of two, two dilation layers, and also a stack size of two. During training, we use the categoricalcross-entropy loss and the Adam stochastic optimizer as implemented in Tensorflow. We show a
block diagram of our network in the right panel of Fig. 2. We train our network for 20 epochs using
60% of the dataset for training and 40% for validation.
4

21.00

g
i
r

1.0

21.25

0.8
21.50

0.6

21.75

KN class
Other class

22.00

0.4

22.25

0.2
22.50

0.0

22.75
0

2

4

6

Time (days)

8

10

2

4

6

8

10

Time (days)

Figure 4: Left: Observational data of AT 2019npv taken from Ref. [33]. Right: El-CID score.

4

Results

The classifier achieves ≥ 99% accuracy at ∼ 3 days, i.e., in about 3 days of photometric data, theclassifier is able to distinguish a KN. We verified that increasing the number of channels does nothave significant performance improvement. To verify the accuracy on unseen data, we used kilonovae
lightcurves swapping out the ZTF observing schedule with that of the Rubin Observatory as used in
PLAsTiCC. This would corresponding the hypothetical situation if Rubin was in operation during
LIGO/Virgo fourth observing run, and also verify that the classifier is not learning cadence. We foundthat performance is not affected and verifies the fact that the classifier is learning temporal features as
desired. We provide more details in Appendix A.3. Finally, we test our trained classifier on the realdata. Unfortunately, AT 2017gfo remains the only exhaustively studied KN till date with data from
instruments all over the world. We use the photometric data publicly available at the Open Kilonova
catalog. 3 Note that this data was not a part of the training sample. In Fig. 3 we show data from a
few different instruments. We find that the correct classification in obtained within a few epochsof data acquisition. Note that this once again verifies the robustness to instrument cadence as theobservations are not only from different instruments, but also likely taken at an aggressive targetedcadence which can be significantly different from the usual nightly cadence of a survey. We also
test our classifier on AT 2019npv, [33] which was a SNIbc that was coincidentally discovered at ahigh confidence region of the skymap of GW190814, [34] and raised interest as a KN doppelganger
during the first few days of discovery [35, 36, 37, 38, 39, 40] (see Appendix A.4). We find that theclassifier is able to rule out the object as not a KN within the first few days of data acquisition. This
showcases the use case of a tool like El-CID.

5Societal and negative impacts

Our dataset, scope, and purpose is entirely limited to astrophysical processes and therefore we don’t
envision any impact on society. If our classifier is adopted by astronomical broker teams for nightly
operations, the event of erroneous results from our classifier might lead to telescope and spectroscopic
resources following-up candidates that are not related to a GW merger.

Acknowledgments and Disclosure of Funding
D. C. is supported by the Illinois Survey Science Fellowship by the Center for AstroPhysical Surveys,
National Center for Supercomputing Applications at University of Illinois at Urbana-Champaign. The
authors would like to thank Rick Kessler for help with SNANA simulations. The authors would also
like to thank Mattia Bulla and Michael Coughlin for help with the models. This work made use of theIllinois Campus Cluster, a computing resource that is operated by the Illinois Campus Cluster Program(ICCP) in conjunction with NCSA which is supported by funds from the University of Illinois at
Urbana-Champaign. This research also used resources of the National Energy Research Scientific3

https://kilonova.org/data.html

5Computing Center (NERSC), a U.S. Department of Energy Office of Science User Facility located atLawrence Berkeley National Laboratory, operated under Contract No. DE-AC02-05CH11231.

References[1] B. P. Abbott, R. Abbott, T. D. Abbott, M. R. Abernathy, F. Acernese, K. Ackley, C. Adams,
T. Adams, P. Addesso, R. X. Adhikari, and et al. Observation of gravitational waves from abinary black hole merger. Physical Review Letters, 116(6), Feb 2016.
[2] R. Abbott, T. D. Abbott, S. Abraham, F. Acernese, K. Ackley, A. Adams, C. Adams, R. X.
Adhikari, V. B. Adya, C. Affeldt, and et al. Gwtc-2: Compact binary coalescences observed byligo and virgo during the first half of the third observing run. Physical Review X, 11(2), Jun
2021.
[3] B. D. Metzger, G. Martínez-Pinedo, S. Darbha, E. Quataert, A. Arcones, D. Kasen, R. Thomas,
P. Nugent, I. V. Panov, and N. T. Zinner. Electromagnetic counterparts of compact object
mergers powered by the radioactive decay of r-process nuclei. MNRAS, 406(4):2650–2662,
August 2010.
[4] Li-Xin Li and Bohdan Paczyński. Transient Events from Neutron Star Mergers. ApJ, 507(1):L59–
L62, November 1998.
[5] B. P. Abbott, R. Abbott, T. D. Abbott, F. Acernese, K. Ackley, C. Adams, T. Adams, P. Addesso,
R. X. Adhikari, V. B. Adya, and et al. Gw170817: Observation of gravitational waves from abinary neutron star inspiral. Physical Review Letters, 119(16), Oct 2017.
[6] B. P. Abbott, R. Abbott, T. D. Abbott, F. Acernese, K. Ackley, C. Adams, T. Adams, P. Addesso,
R. X. Adhikari, V. B. Adya, and et al. Multi-messenger Observations of a Binary Neutron Star
Merger. ApJ Lett., 848:L12, October 2017.
[7] Iair Arcavi, Griffin Hosseinzadeh, D. Andrew Howell, Curtis McCully, Dovi Poznanski, Daniel
Kasen, Jennifer Barnes, Michael Zaltzman, Sergiy Vasylyev, Dan Maoz, and Stefano Valenti.
Optical emission from a kilonova following a gravitational-wave-detected neutron-star merger.
Nature, 551(7678):64–66, Nov 2017.
[8] D. A. Coulter, R. J. Foley, C. D. Kilpatrick, M. R. Drout, A. L. Piro, B. J. Shappee, M. R.
Siebert, J. D. Simon, N. Ulloa, D. Kasen, B. F. Madore, A. Murguia-Berthier, Y.-C. Pan, J. X.
Prochaska, E. Ramirez-Ruiz, A. Rest, and C. Rojas-Bravo. Swope supernova survey 2017a(sss17a), the optical counterpart to a gravitational wave source. Science, 358(6370):1556–1558,
2017.
[9] M. M. Kasliwal, E. Nakar, L. P. Singer, D. L. Kaplan, D. O. Cook, A. Van Sistine, R. M. Lau,
C. Fremling, O. Gottlieb, J. E. Jencson, S. M. Adams, U. Feindt, K. Hotokezaka, S. Ghosh, D. A.
Perley, P. C. Yu, T. Piran, J. R. Allison, G. C. Anupama, A. Balasubramanian, K. W. Bannister,J. Bally, J. Barnes, S. Barway, E. Bellm, V. Bhalerao, D. Bhattacharya, N. Blagorodnova, J. S.
Bloom, P. R. Brady, C. Cannella, D. Chatterjee, S. B. Cenko, B. E. Cobb, C. Copperwheat,
A. Corsi, K. De, D. Dobie, S. W. K. Emery, P. A. Evans, O. D. Fox, D. A. Frail, C. Frohmaier,
A. Goobar, G. Hallinan, F. Harrison, G. Helou, T. Hinderer, A. Y. Q. Ho, A. Horesh, W. H.
Ip, R. Itoh, D. Kasen, H. Kim, N. P. M. Kuin, T. Kupfer, C. Lynch, K. Madsen, P. A. Mazzali,
A. A. Miller, K. Mooley, T. Murphy, C. C. Ngeow, D. Nichols, S. Nissanke, P. Nugent, E. O.
Ofek, H. Qi, R. M. Quimby, S. Rosswog, F. Rusu, E. M. Sadler, P. Schmidt, J. Sollerman,
I. Steele, A. R. Williamson, Y. Xu, L. Yan, Y. Yatsu, C. Zhang, and W. Zhao. Illuminating
gravitational waves: A concordant picture of photons from a neutron star merger. Science,
358(6370):1559–1565, Dec 2017.
[10] V. M. Lipunov, E. Gorbovskoy, V. G. Kornilov, N . Tyurina, P. Balanutsa, A. Kuznetsov,
D. Vlasenko, D. Kuvshinov, I. Gorbunov, D. A. H. Buckley, A. V. Krylov, R. Podesta, C. Lopez,
F. Podesta, H. Levato, C. Saffe, C. Mallamachi, S. Potter, N. M. Budnev, O. Gress, Yu. Ishmuhametova, V. Vladimirov, D. Zimnukhov, V. Yurkov, Yu. Sergienko, A. Gabovich, R. Rebolo,
M. Serra-Ricart, G. Israelyan, V. Chazov, Xiaofeng Wang, A. Tlatov, and M. I. Panchenko.
MASTER optical detection of the first LIGO/virgo neutron star binary merger GW170817. The
Astrophysical Journal, 850(1):L1, nov 2017.
6

[11] M. Soares-Santos, D. E. Holz, J. Annis, R. Chornock, K. Herner, E. Berger, D. Brout, H.-Y.
Chen, R. Kessler, M. Sako, S. Allam, D. L. Tucker, R. E. Butler, A. Palmese, Z. Doctor, H. T.
Diehl, J. Frieman, B. Yanny, H. Lin, D. Scolnic, P. Cowperthwaite, E. Neilsen, J. Marriner,
N. Kuropatkin, W. G. Hartley, F. Paz-Chinchón, K. D. Alexander, E. Balbinot, P. Blanchard,
D. A. Brown, J. L. Carlin, C. Conselice, E. R. Cook, A. Drlica-Wagner, M. R. Drout, F. Durret,
T. Eftekhari, B. Farr, D. A. Finley, R. J. Foley, W. Fong, C. L. Fryer, J. García-Bellido, M. S . S.
Gill, R. A. Gruendl, C. Hanna, D. Kasen, T. S. Li, P. A. A. Lopes, A. C. C. Lourenço, R. Margutti,
J. L. Marshall, T. Matheson, G. E. Medina, B. D. Metzger, R. R. Mu noz, J. Muir, M. Nicholl,E. Quataert, A. Rest, M. Sauseda, D. J. Schlegel, L. F. Secco, F. Sobreira, A. Stebbins, V. A.
Villar, K. Vivas, A. R. Walker, W. Wester, P. K. G. Williams, A. Zenteno, Y. Zhang, T. M. C.
Abbott, F. B. Abdalla, M. Banerji, K. Bechtol, A. Benoit-Lévy, E. Bertin, D. Brooks, E. BuckleyGeer, D. L. Burke, A. Carnero Rosell, M. Carrasco Kind, J. Carretero, F. J. Castander, M. Crocce,
C. E. Cunha, C. B. D’Andrea, L. N. da Costa, C. Davis, S. Desai, J. P. Dietrich, P. Doel, T. F.
Eifler, E. Fernandez, B. Flaugher, P. Fosalba, E. Gaztanaga, D. W. Gerdes, T. Giannantonio, D. A.
Goldstein, D. Gruen, J. Gschwend, G. Gutierrez, K. Honscheid, B. Jain, D. J. James, T. Jeltema,
M. W. G. Johnson, M. D. Johnson, S. Kent, E. Krause, R. Kron, K. Kuehn, S. Kuhlmann,
O. Lahav, M. Lima, M. A. G. Maia, M. March, R. G. McMahon, F. Menanteau, R. Miquel,
J. J. Mohr, R. C. Nichol, B. Nord, R. L. C. Ogando, D. Petravick, A. A. Plazas, A. K. Romer,
A. Roodman, E. S. Rykoff, E. Sanchez, V. Scarpine, M. Schubnell, I. Sevilla-Noarbe, M. Smith,
R. C. Smith, E. Suchyta, M. E. C. Swanson, G. Tarle, D. Thomas, R. C. Thomas, M. A. Troxel,
V. Vikram, R. H. Wechsler, and J. Weller and. The electromagnetic counterpart of the binary
neutron star merger LIGO/virgo GW170817. i. discovery of the optical counterpart using thedark energy camera. The Astrophysical Journal, 848(2):L16, oct 2017.
[12] N. R. Tanvir, A. J. Levan, C. González-Fernández, O. Korobkin, I. Mandel, S. Rosswog, J. Hjorth, P. D’Avanzo, A. S. Fruchter, C. L. Fryer, T. Kangas, B. Milvang-Jensen,
S. Rosetti, D. Steeghs, R. T. Wollaeger, Z. Cano, C. M. Copperwheat, S. Covino, V. D’Elia,
A. de Ugarte Postigo, P. A. Evans, W. P. Even, S. Fairhurst, R. Figuera Jaimes, C. J. Fontes,
Y. I. Fujii, J. P. U. Fynbo, B. P. Gompertz, J. Greiner, G. Hodosan, M. J. Irwin, P. Jakobsson,
U. G. Jørgensen, D. A. Kann, J. D. Lyman, D. Malesani, R. G. McMahon, A. Melandri, P. T.
O’Brien, J. P. Osborne, E. Palazzi, D. A. Perley, E. Pian, S. Piranomonte, M. Rabus, E. Rol,
A. Rowlinson, S. Schulze, P. Sutton, C. C. Thöne, K. Ulaczyk, D. Watson, K. Wiersema, and
R. A. M. J. Wijers. The emergence of a lanthanide-rich kilonova following the merger of two
neutron stars. The Astrophysical Journal, 848(2):L27, oct 2017.
[13] Stefano Valenti, J. Sand, David, Sheng Yang, Enrico Cappellaro, Leonardo Tartaglia, Alessandra
Corsi, Saurabh W. Jha, Daniel E. Reichart, Joshua Haislip, and Vladimir Kouprianov. The
discovery of the electromagnetic counterpart of gw170817: Kilonova at 2017gfo/dlt17ck. The
Astrophysical Journal, 848(2):L24, Oct 2017.
[14] B. F. Schutz. Determining the Hubble constant from gravitational wave observations. Nature,323(6086):310–311, September 1986.
[15] Daniel E. Holz and Scott A. Hughes. Using Gravitational-Wave Standard Sirens. ApJ, 629(1):15–
22, August 2005.
[16] B. P. Abbott, , R. Abbott, T. D. Abbott, et al. A gravitational-wave standard siren measurementof the Hubble constant. Nature, 551(7678):85–88, 2017.
[17] B. P. Abbott, R. Abbott, T. D. Abbott, F. Acernese, K. Ackley, C. Adams, T. Adams, P. Addesso,
R. X. Adhikari, V. B. Adya, and et al. Gw170817: Measurements of neutron star radii andequation of state. Physical Review Letters, 121(16), Oct 2018.
[18] R. A. Street, M. Bowman, E. S. Saunders, and T. Boroson. General-purpose software formanaging astronomical observing programs in the LSST era. In Juan C. Guzman and Jorge
Ibsen, editors, Software and Cyberinfrastructure for Astronomy V, volume 10707 of Society of
Photo-Optical Instrumentation Engineers (SPIE) Conference Series, page 1070711, July 2018.
[19] R. A. Street, A. Adamson, J. P. Blakeslee, R. D. Blum, A. S. Bolton, T. Boroson, M. Bowman,
C. Brice no, J. H. Elias, E. Gomez, S. Heathcote, E. Heinrich-Josties, A. Hopkinson, C. H. Lee,B. W. Miller, J. Nation, S. Ridgway, D. R. Silva, and L. J. Storrie-Lombardi. The Astrophysical
Events Observatories Network (AEON). In Society of Photo-Optical Instrumentation Engineers
7

(SPIE) Conference Series, volume 11449 of Society of Photo-Optical Instrumentation Engineers(SPIE) Conference Series, page 1144925, December 2020.
[20] S. R. Kulkarni. Towards An Integrated Optical Transient Utility. arXiv e-prints, page
arXiv:2004.03511, April 2020.
[21] Leo P. Singer and Larry R. Price. Rapid bayesian position reconstruction for gravitational-wave
transients. Phys. Rev. D, 93:024013, Jan 2016.
[22] Tim Dietrich and Maximiliano Ujevic. Modeling dynamical ejecta from binary neutron starmergers and implications for electromagnetic counterparts. Classical and Quantum Gravity,
34(10):105014, May 2017.
[23] M. Bulla. POSSIS: predicting spectra, light curves, and polarization for multidimensionalmodels of supernovae and kilonovae. MNRAS, 489(4):5037–5045, November 2019.
[24] Daniel Kasen, Brian Metzger, Jennifer Barnes, Eliot Quataert, and Enrico Ramirez-Ruiz. Originof the heavy elements in binary neutron-star mergers from a gravitational-wave event. Nature,551(7678):80–84, Oct 2017.
[25] Michael W. Coughlin, Sarah Antier, Tim Dietrich, Ryan J. Foley, Jack Heinzel, Mattia Bulla,
Nelson Christensen, David A. Coulter, Lina Issa, and Nandita Khetan. Measuring the Hubble
constant with a sample of kilonovae. Nature Communications, 11:4129, August 2020.
[26] R. Kessler, G. Narayan, A. Avelino, E. Bachelet, R. Biswas, P. J. Brown, D. F. Chernoff, A. J.
Connolly, M. Dai, S. Daniel, R. Di Stefano, M. R. Drout, L. Galbany, S. González-Gaitán,
M. L. Graham, R. Hložek, E. E. O. Ishida, J. Guillochon, S. W. Jha, D. O. Jones, K. S. Mandel,
D. Muthukrishna, A. O’Grady, C. M. Peters, J. R. Pierel, K. A. Ponder, A. Prša, S. Rodney, V. A.
Villar, LSST Dark Energy Science Collaboration, and Transient and Variable Stars Science
Collaboration. Models and Simulations for the Photometric LSST Astronomical Time Series
Classification Challenge (PLAsTiCC). PASP, 131(1003):094501, September 2019.
[27] R. Hlozek, K. A. Ponder, A. I. Malz, M. Dai, G. Narayan, E. E. O. Ishida, T. Allam Jr au2,
A. Bahmanyar, R. Biswas, L. Galbany, S. W. Jha, D. O. Jones, R. Kessler, M. Lochner, A. A.
Mahabal, K. S. Mandel, J. R. Martínez-Galarza, J. D. McEwen, D. Muthukrishna, H. V. Peiris,
C. M. Peters, and C. N. Setzer. Results of the photometric lsst astronomical time-seriesclassification challenge (plasticc), 2020.
[28] Zeljko Ivezic, Steven M. Kahn, J. Anthony Tyson, Bob Abel, Emily Acosta, Robyn Allsman,David Alonso, Yusra AlSayyad, Scott F. Anderson, John Andrew, and et al. Lsst: From sciencedrivers to reference design and anticipated data products. The Astrophysical Journal, 873(2):111,
Mar 2019.
[29] Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling. arXiv e-prints, page arXiv:1803.01271,
March 2018.
[30] Philippe Remy. Temporal convolutional networks for keras.
philipperemy/keras-tcn, 2020.

https://github.com/[31] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro,
Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow,
Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser,
Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek
Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal
Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete
Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Largescale machine learning on heterogeneous systems, 2015. Software available from tensorflow.org.
[32] Daniel Muthukrishna, Gautham Narayan, Kaisey S. Mandel, Rahul Biswas, and RenéeHložek. RAPID: Early Classification of Explosive Transients Using Deep Learning. PASP,
131(1005):118002, November 2019.
8

[33] Igor Andreoni, Daniel A. Goldstein, Mansi M. Kasliwal, Peter E. Nugent, Rongpu Zhou,
Jeffrey A. Newman, Mattia Bulla, Francois Foucart, Kenta Hotokezaka, Ehud Nakar, and et al.
Growth on s190814bv: Deep synoptic limits on the optical/near-infrared counterpart to a neutronstar–black hole merger. The Astrophysical Journal, 890(2):131, Feb 2020.
[34] R. Abbott, T. D. Abbott, S. Abraham, F. Acernese, K. Ackley, C. Adams, R. X. Adhikari, V. B.
Adya, C. Affeldt, M. Agathos, and et al. Gw190814: Gravitational waves from the coalescenceof a 23 solar mass black hole with a 2.6 solar mass compact object. The Astrophysical Journal,896(2):L44, Jun 2020.
[35] S Antier, S Agayeva, V Aivazyan, S Alishov, E Arbouch, A Baransky, K Barynova, J M
Bai, S Basa, S Beradze, and et al. The first six months of the advanced ligo’s and advanced
virgo’s third observing run with grandma. Monthly Notices of the Royal Astronomical Society,492(3):3904–3927, Nov 2019.
[36] Dougal Dobie, Adam Stewart, Tara Murphy, Emil Lenc, Ziteng Wang, David L. Kaplan, Igor
Andreoni, Julie Banfield, Ian Brown, Alessandra Corsi, and et al. An askap search for a radio
counterpart to the first high-significance neutron star–black hole merger ligo/virgo s190814bv.
The Astrophysical Journal, 887(1):L13, Dec 2019.
[37] R. Morgan, M. Soares-Santos, J. Annis, K. Herner, A. Garcia, A. Palmese, A. Drlica-Wagner,
R. Kessler, J. García-Bellido, T. G. Bachmann, and et al. Constraints on the physical propertiesof gw190814 through simulations based on decam follow-up observations by the dark energy
survey. The Astrophysical Journal, 901(1):83, Sep 2020.
[38] Nicholas Vieira, John J. Ruan, Daryl Haggard, Maria R. Drout, Melania C. Nynka, Hope Boyce,
Kristine Spekkens, Samar Safi-Harb, Raymond G. Carlberg, Rodrigo Fernández, and et al.
A deep cfht optical search for a counterpart to the possible neutron star–black hole merger
gw190814. The Astrophysical Journal, 895(2):96, Jun 2020.
[39] A M Watson, N R Butler, W H Lee, R L Becerra, M Pereyra, F Angeles, A Farah, L Figueroa,
D Gónzalez-Buitrago, F Quirós, and et al. Limits on the electromagnetic counterpart tos190814bv. Monthly Notices of the Royal Astronomical Society, 492(4):5916–5921, Jan 2020.
[40] S. de Wet, P. J. Groot, S. Bloemen, R. Le Poole, M. Klein-Wolt, E. Körding, V. McBride,
K. Paterson, D. L. A. Pieterse, P. M. Vreeswijk, and et al. Gw190814 follow-up with the opticaltelescope meerlicht. Astronomy & Astrophysics, 649:A72, May 2021.
[41] LIGO Scientific Collaboration. LIGO Algorithm Library - LALSuite. free software (GPL),2018.

Checklist
1. For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s
contributions and scope? [Yes](b) Did you describe the limitations of your work? [Yes] See Sec. 2.2(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Sec. 5(d) Have you read the ethics review guidelines and ensured that your paper conforms tothem? [Yes]2. If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results? [N/A](b) Did you include complete proofs of all theoretical results? [N/A]
3. If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Appendix A.5
9(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they
were chosen)? [Yes] See Sec. 3(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Extensive validation and sanity is presented on unseen
and real data instead(d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)? [Yes] See Sec. A.5
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators? [Yes](b) Did you mention the license of the assets? [Yes] Mentioned in repository of thecorresponding projects(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
See Appendix A.5(d) Did you discuss whether and how consent was obtained from people whose data you’reusing/curating? [N/A] All data was created as a part of this work(e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content? [Yes] See Sec. 5
5. If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable? [N/A](b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable? [N/A](c) Did you include the estimated hourly wage paid to participants and the total amountspent on participant compensation? [N/A]10

Kasen KN
18.0

Bulla KN

18.0

g
R
i

g
R
i

18.5
18.5
19.0

Mag.

Mag.

19.0
19.5
20.0

19.5

20.0

20.5
20.5
21.0

0

2

4

6

8

Time (days)

10

12

14

0.5

SNIa 91bg

19.5

19.4

Mag.

Mag.

19.2

20.0

19.6

20.5

19.8

21.0

20.0
−5

60°

0

5

Time (days)

10

15

3.0

3.5

4.0

g
R
i

20

0

75°

10

60°

20

30

Time (days)

40

75°

45°

30°

30°
-150° -120° -90° -60° -30°

0°

2.5

Vincenzi SNII

45°
15°

2.0

Time (days)

19.0

19.0

−10

1.5

18.8

g
R
i

18.5

1.0

0°

30°

60°

15°

90° 120° 150°

-150° -120° -90° -60° -30°

0°

-15°

0°

30°

60°

90° 120° 150°

-15°

-30°

-30°

-45°

-45°
-60°

0.01

-60°

-75°

0.02

0.03

0.04

0.05

Redshift (z)

0.06

0.07

0.08

0.01

0.02

-75°

0.03

0.04

0.05

Redshift (z)

0.06

0.07

0.08

0.09

Figure 5: Top: Example lightcurves of KN from the Bulla and Kasen models. Middle: Example
lightcurves from two supernova models. Bottom: The distribution of detected Bulla KNe (left) and
Kasen KNe (right). We observe that there is no bias in selecting one KN model over the other in thedataset.

A

Appendix

A.1

Example lightcurves

In Fig. 5 top panel we show some example KN lightcurves from both Bulla and Kasen models, inthe middle panel, we show example of other objects, and in the bottom we show the distribution of
the recovered Kasen and Bulla KNe in the sky, colored by their cosmological redshift. We note theempty patch being the galactic plane where there are no extra-galactic observations. We also verify
that there is no preference towards either model in this step of data preparation i.e., the distribution is
not model specific.
11

Table 1: The table lists the number count of different types of objects used for training

Mag.

Object Type
Bulla KN
Kasen KN
SALT2 SNIaSLSN
SNII NMF
SNIa 91bg
SNIax
SNIbc
TDE
Vincenzi SNII

Number count
5126
3707
24670
16926
24232
28620
21686
21258
19359
19909

g
R
i

18

20

Pred.

1.0

0

2

4

6

8

KN
Other
0.5

0.0

0

2

4

Time (days)

6

8

Figure 6: Top: Lightcurves generated in g, R, i bands using the Rubin Observatory observing
schedule. Bottom: The prediction of trained classifier on unseen data generated using Rubin
Observatory observing schedule. We observe that most of the objects (113/115 here) have beencorrectly classified as KNe.
A.2

Object counts

In table 1, we show the number count of the different object type in our dataset.
A.3

Performance on unseen LSST lightcurves

To verify that the classifier is not learning the cadence of the training set, we verify by preparing adataset of KNe that with the LSST observing strategy. In Fig. 6 we show the performance of theclassifier on unseen LSST lightcurves. We find that most of the objects are correctly classified.
A.4

Skymaps of GW170817 & GW190814

In this section we show the skymaps of the GW events GW170817 & GW190814. GW170817 wasa merger of two neutron stars that produced the kilonova AT 2017gfo. GW190814 was a mergerof a black-hole with a low-mass component compoenent, the nature of which is still unknown.
AT 2019npv was consistent with the skymap of GW190814. From visual inspection of the initial
photometry it was considered an object of interest and followed up. Later spectroscopy revealed it to
be a type Ibc supernova, unrelated to the GW event.
A.5

Code and data

El-CID is based on the architecture used for the real-time supernova classification code RAPID [32].
At the time of submission, the source code exists as a branch in the following repository: https://github.com/deepchatterjeeligo/astrorapid/tree/kn-rapid. GW binaries were simulated using lalapps_inspinj tool which is a part of LALSuite [41]. Noise curves for GW
instruments were used from LIGO DCC: https://dcc.ligo.org/LIGO-T2000012/public.
Mock S/N time-series was generated using the bayestar-realize-coincs tool from the12

Mollweide view
−20◦
−22◦
−24◦
−26◦
−28◦
1h 10m 00m 0h 50m 40m

Figure 7: Left: The skymap of GW170817. The ‘x’ shows the location of AT 2017gfo. Right: The
skymp of GW190814. The inset shows a zoomed-in image of the primary mode, and ‘x’ shows thelocation of AT 2019npv.
ligo.skymap (https://lscsoft.docs.ligo.org/ligo.skymap/). Mock skymaps were createdusing the BAYESTAR algorithm [21]. Bulla and Kasen kilonova SED models are available as package
data of SNANA available at https://doi.org/10.5281/zenodo.4728252. SNANA project ispublicly available at https://github.com/RickKessler/SNANA with installation instruction.
The computationally expensive part of this work was the data generation. Kilonova and otherlightcurves were created at the Cori cluster at the National Energy Research Scientific Computing
Center (NERSC). The sky-localizations were created at the Illinois Campus Cluster maintained by
NCSA. Training the neural network takes considerably less resources – ∼ 5 minutes on 8 Intel core-i7
processors.

13