Deep learning for gravitational wave forecasting of neutron star mergers

We introduce deep learning time-series forecasting for gravitational wave detection of binary neutron star mergers. This method enables the identification of these signals in real advanced LIGO data up to 30 seconds before merger. When applied to GW170817, our deep learning forecasting method identifies the presence of this gravitational wave signal 10 seconds before merger. This novel approach requires a single GPU for inference, and may be used as part of an early warning system for time-sensitive multi-messenger searches.


Introduction
Multi-messenger observations of gravitational wave sources provide a wealth of information about their astrophysical properties and environments. For instance, gravitational wave and electromagnetic observations of the binary neutron star GW170817 [1] provided new insights into the equation of state of supranuclear matter, the cosmic factories where the heaviest r-procese elements are produced, and the progenitors of short-gamma ray bursts and kilonovae [2,3,4,5,6,7]. This and future multi-messenger observations will continue to advance our understanding of fundamental physics, gravitation, cosmology and astrophysics [8,9,10,11,12,13].
The rationale to design and deploy a coordinated multi-messenger and multiwavelength follow-up framework has been persuasively discussed in the literature [14,15,16,17]. The plethora of studies conducted for GW170817, which involved dozens of observatories in every continent that covered all messengers and the entire range of the electromagnetic spectrum, have shown that future multi-messenger discoveries depend critically on the development of prompt response or early warning systems to obtain a full understanding of astrophysical events. [18] To further emphasize this point, early warning systems go beyond the development of algorithms for real-time detection of gravitational wave sources, which could then be used to trigger electromagnetic and astro-particle follow-ups. A step beyond real-time gravitational wave detection consists of the development of algorithms that identify gravitational wave signals in real gravitational wave data before the merger takes place. Such an idea and implementation in the context of template-matching algorithms, using stationary Gaussian data recolored to advanced LIGO and advanced Virgo sensitivities, was introduced in [19].
In this article we introduce the use of deep learning time-series forecasting to identify the presence of gravitational wave signals in advanced LIGO data. This approach provides pre-merger alerts for binary neutron star mergers to facilitate prompt multi-messenger observation campaigns. We tested this novel approach by injecting modeled binary neutron star waveforms in advanced LIGO data, finding that deep learning forecasting is able to provide early warnings up to 30 seconds before merger. In the case of GW170817, deep learning forecasting provides an early warning 10 seconds before merger. It is worth pointing out that our deep learning model issues this early warning even when the data are contaminated by significant noise anomalies, as in the case of GW170817.
This article is organized as follows. Section 2 describes the deep learning model used for time-series forecasting, the modeled waveforms and advanced LIGO noise used for training and testing. We summarize the results of this study in Section 3. We outline future directions of work in Section 4.

Methods
In this section we describe the use of time-series forecasting in the context of gravitational wave detection. We provide a succinct description of the waveform approximant and the advanced LIGO noise used to train and test these algorithms.

Spectrograms
Spectrograms provide a visual representation of the frequencies that make up a signal as it evolves in time. Figure 1 shows the spectrogram of a (1.4M , 1.4M ) binary neutron star signal, as described by the IMRPhenomD NRTidal approximant [20] at a sample rate of 16384Hz. This modeled waveform has been injected in advanced LIGO's second observing run data. Binary neutron stars usually exhibit long-duration chirp signals, as shown in Figure 1. This property makes them a useful tool to forecast the merger event, and produce an early warning alert of an imminent event that may be accompanied by electromagnetic counterparts. We explore this idea in the following sections to produce early warnings of multi-messenger sources.

Chirp-pattern recognition with deep learning
We use chirps in spectrograms to forecast the presence of gravitational wave signals in advanced LIGO data. We do this by training a deep neural network, ResNet-50 [21], to search for chirp-like signatures in spectrograms. To begin with, we apply deep transfer learning to a pre-trained ResNet-50 model, which is provided by PyTorch [22]. The inputs to ResNet50 are the spectrograms of 8s-long advanced LIGO strain data from both the Livingston and Hanford observatories. These spectrograms are stacked together to form an image of two channels. Since the pre-trained ResNet50 provided by PyTorch takes input images with 3 (RGB) channels, we padded the third channel of our spectrogram images with zeros. The output of the pre-trained ResNet50 is a number in the range [0, 1], which indicates the probability of the presence of a chirp signal in the input spectrogram.

Data Curation
Modeled waveforms We use PyCBC [23] to produce 60s-long modeled waveforms with the IMRPhenomD NRTidal approximant at a sample rate of 16384Hz. We cover the parameter space m {1,2} ∈ [1M , 5M ]. The waveforms are randomly split into a training set (16250 waveforms) and a test set (4051 waveforms). The waveforms are then rescaled and injected into real advanced LIGO Livingston and Hanford noise to simulated binary neutron star signals over a broad range of signal-to-noise ratios (SNRs). Advanced LIGO noise For training we use 4 segments of open source advanced LIGO noise [24]. These 4096s-long segments, sampled at 16384Hz, from the Livingston and Hanford observatories start with GPS times 1186725888, 1187151872, 1187569664, and 1186897920. The 4096s-long LIGO strain data segments with starting GPS time 1186725888, 1187151872, 1187569664 are used for training, while the one with GPS starting time 1186897920 is used for testing.
For each of the 4096s-long LIGO strain data segments, we first calculate the corresponding power spectral density (PSD), and use it to whiten both the strain data and the waveform templates we plan to inject. We also rescale the amplitudes of the whitened templates and add 8s-long whitened LIGO strain data and templates together to simulate different SNRs. Finally, the standard deviation of the LIGO strained data with signal injections is normalized to one. The spectrograms are calculated from 8s-long simulated signals from the Livingston and Hanford observatories.
The spectrograms are calculated with the spectrogram function provided by SciPy. We use a blackman window size of 16384, and a step size of 1024. The resulting spectrogram is of size 8193 × 113, where 8193 is the size in the frequency domain and 113 is the size in the time domain. We also apply an element-wise log transformation on the spectrograms to accentuate the chirp patterns.
Since the goal for the trained ResNet-50 is to predict binary neutron star mergers based on information we process during the inspiral phase, we only used data from 20Hz to 150Hz on the spectrograms. This approach speeds up both the training and the inference. It follows that the input to ResNet-50 is an image of size 130 × 113 with three channels, where the first two channels are spectrograms calculated from Livingston and Hanford data, and the third channel is padded with zeros.

Training strategy
The ResNet-50 model provided by PyTorch is pre-trained with ImageNet [25] data that spans 1000 classes. We changed the last fully connected layer of the default ResNet-50 so that the output is a number in the range [0, 1], instead of an array of size 1000.
As mentioned above, we consider 60s-long signals with component masses m {1,2} ∈ [1M , 5M ], injected in advanced LIGO data, and which describe a broad range of SNRs. Furthermore, since we focus on early detection, we consider the evolution of these signals as they sweep through a gravitational wave frequency range between [20Hz, 150Hz]. We use these datasets to produce a spectrogram dataset to train ResNet-50 using a batch size of 256, and a learning rate of 10 −4 .
To improve the robustness of the trained ResNet-50, 50% of the input spectrogram images contain no signals, while 25% have simulated signals only in one of the Livingston and Hanford observatories, and the remaining 25% have signals in both Livingston and Hanford strain data. We trained the ResNet-50 using 4 NVIDIA V100 GPUs with the ADAM [26] optimizer.

Results
To test the performance of our early warning model, we searched for patterns associated with the existence of gravitational waves in spectrograms. As mentioned above, this search cover the frequency range [20Hz, 150Hz]. We used a sliding window of 8s, with a step size of 1s, that is applied to the first 50s of the spectrograms. Notice that in the preparation of our training dataset, the first 50s of the modeled waveforms describe the pre-merger evolution. The output of our deep learning model provides the probability of the existence of a gravitational wave in input spectrogram. Figure 2 presents a summary of our results. We consider four cases to illustrate how early our deep learning model predicts the existence of signals in advanced LIGO noise. We notice that deep learning forecasts the existence of binary neutron star signals in advanced LIGO data up to 30s before merger. As expected, the neural network performs best for signals that have SNRs similar to GW170817.

GW170817
We have put at work our forecasting model in the context of GW170817 data. Using available, open source, advanced LIGO data for this event, we have found that our approach predicts the existence of this event 10s before merger. We have considered two datasets, one including the well known noise anomaly that contaminated this event (top panel in Figure 3), and one without this glitch (bottom panel in Figure 3). Our results clearly show that deep learning forecasting is not affected by this noise anomaly.

Neutron star-black hole binaries
We finish these analyses with an application of our early warning system in the context of neutron star-black hole systems. We consider two cases, that describe systems with component masses (5M , 1.4M ) and (5M , 2.1M ). As before, we inject the signals describing these binaries in advanced LIGO data, and consider a number of SNRs. Figure 4 shows that our deep learning model can forecast the existence of these systems in advanced LIGO data up to 30s before merger for (5M , 1.4M ) with SNR ∼ 30, and up to 20s before merger for (5M , 2.1M ) with SNR ∼ 30. In other words, the method we introduce in this paper may be used to obtain early warnings up to 30s before the binary components coalesce. This information may in turn be used to enable timesensitive electromagnetic follow-ups of binary neutron stars and neutron starblack hole systems. These results are very promising, and warrant the extension of this approach to other astrophysical scenarios of interest.

Conclusions
We have introduced the first application of deep learning forecasting for the detection of binary neutron stars. We have also presented an application of this framework in the context of neutron star-black hole systems. Our results indicate that deep learning may provide early warnings up to 30s before merger.
When we apply this novel methodology for GW170817, we found that deep learning forecasts the existence of this event 10s before merger. Our approach is robust to the presence of glitches, as we report for this event.
These results lay the foundation for the construction of a deep learning forecasting method that can provide early warnings to enable rapid electromagnetic follow-ups. We will present an extended version of this framework for other astrophysical scenarios of interest in the near future.

Acknowledgments
We gratefully acknowledge National Science Foundation (NSF) awards OAC-1931561 and OAC-1934757. We thank NVIDIA for their continued support.