Skip to content

ResNet50 model to classify the high frequency emission in gravitational waves from core-collapse supernovae

License

Notifications You must be signed in to change notification settings

ManuelDMorales/resnet50-sngw-hff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: GPL v3 arXiv

Summary

Deep residual network (ResNet50) to classify RGB images of time-frequency (TF) Morlet wavelet scalograms of gravitational waves from core-collapse supernovae (CCSNe). We performed a three-class classification, in which the target label is assigned if the slope of the High Frequency Feature (HFF), present in the scalograms, belongs to one of three mutually exclusive slope ranges.

This multi-class classification allows us to study the detectability of the HFF because, depending on the CCSN model and the noise realization, the visibility of the HFF can vary. Moreover, as proof of principle, it allows us to evaluate our ability to discriminate between CCSN parameter configurations (expressed in HFF slope ranges) that are potentially discoverable through future LIGO and Virgo observations.

This project draws on data generated with software available on the repositories datagen-sngw-phen and datagen-sngw-genrel; datasets consist of window strain time series containing interferometric noise plus gravitational waves from CCSNe. Therefore, if this is the first time you run this ResNet50 implementation, you will first have to generate the data with the aforementioned software. Exhaustive scientific methodology and astrophysical results obtained from this implementation are available in the paper arXiv:2406.00422.

Jupyter notebooks developed by Manuel D. Morales (contact: manueld.morales@academicos.udg.mx).

Science background

The samples used in this project consist of time series of real noise from LIGO (L1, H1) and Virgo (V1) interferometric detectors from the O3b run, plus gravitational wave signals from CCSN phenomenological and general relativistic waveforms. In all cases, these waveforms contain the HFF which, depending on the model and the noise, is more or less visible. The HFF codifies astrophysical information about the pulsation of the proto-neutron star (PNS) created in the CCSN.

Phenomenological waveforms come from a stochastic non-physical model that mimics the HFF, see Astone et al Phys. Rev. D 98, 122002 (2018). On the other hand, general relativistic waveforms come from three multidimensional CCSN simulations: Andresen 2019 m15nr h+, Morozova 2018 M13_SFHo h+, and Cerda-Duran 2013 fiducial h+. Our task is a single-feature characterization; then in the case of general relativistic waveforms, we filter features other than HFF before be injected into noise.

The three target labels for the classification are defined as follows:

  • Class 1: 1,620 =< HFF slope =< 4,990
  • Class 2: 1,450 =< HFF slope < 1,620
  • Class 3: 950 =< HFF slope < 1,450

Fig. 1 Shows the ResNet50 architecture used in this project. This is formed by five stages in which identity blocks and/or convolutional blocks are applied, plus a classification stage with a dense (fully connected) layer with a softmax activation giving three probabilistic scores per class. Besides, after stages 1 and 5, a max pooling and an average pooling, respectively, are applied to reduce the system resources. Also notice that at the beginning, a zero padding is applied to the input data. If you are not familiar with deep residual learning, we recommend to explore the seminal paper He et al CVPR, 770-778 (2016).


ResNet50 Figure 1. Residual deep learning architecture used in this project: ResNet50. It consists of 50 layers in the main path, and 23,593,859 model parameters occupying 90MB in memory.

Implementation structure

resnet50-sngw-hff/
|___ Codes/
     |___ Apply_ResNet50.ipynb
     |___ Convert_StrainImage.ipynb
|___ Datasets/
     |___ GenRelWf/
          |___ Distance_1Kpc/
          |___ Distance_5Kpc/
          |___ Distance_10Kpc/
     |___ PhenWf/
|___ Metrics/
     |___ kfold_CV/
|___ Models/
     |___ Best_training/
     |___ GridSearchCV/
     |___ Single_learning/
|___ LICENCE
|___ README.md

The codes were run in Google Colaboratory, in the following order:

Convert_StrainImage.ipynb for reading window strain datasets and converting them into RGB images of TF Morlet wavelet pixelized scalograms. Data can be loaded from two exclusive folders: PhenWf and GenRelWf for phenomenological and general relativistic waveforms, respectively. RGB images are generated by copying each pixel of the grayscale TF image into their pixels in red, green (G), and blue (B) channels.

Apply_ResNet50.ipynb for apply the ResNet50 model. This script has a high-level structure consisting of two big sections: the first is for optimizing (GridSearchCV), training and testing with phenomenological waveforms, and the second is for testing with general relativistic waveforms.

Important instructions

  1. All scripts were run in a specific Google Drive location, then you will need to edit the high-level path location in which the project (resnet50-sngw-hff) is located.

  2. Notice that the Datasets folder, as shown in the project's tree, has a specific hierarchical structure. For the first run, it is highly recommended to maintain this structure. After run available codes on datagen-sngw-phen and datagen-sngw-genrel to generate datasets, you will need to locate the highest output folders inside the PhenWf folder and/or the GenRelWf/Distance_dKpc (with "d" the distance from the CCSN), respectively.

  3. The first section of Apply_ResNet50.ipynb script is more computationally intensive to run than its second section. Then, after running GridSearch CV and finding the best hyperparameter combination (section 7.2), the ResNet50 is trained with these hyperparameters, and the final model is saved in the Models/Best_training folder. If you run in this form, always save the best model to make it easily available for testing with phenomenological and general relativistic waveforms.

  4. Apply_ResNet50.ipynb script has two input parameter fields: subsection I.1. for phenomenological waveforms, and subsection II.2. for general relativistic waveforms. Both sections input the choice of interferometers' data, but only the second the distance from the CCSN.

  5. For testing purposes, subsection II.5 of Apply_ResNet50.ipynb script can be omitted. This was implemented for exploratory data analysis with general relativistic waveforms, considering the whole dataset, namely the TF Morlet wavelet image samples at the three default distances (1, 5, and 10 Kpc) with the three CCSN models. If you run this subsection with less data, it will surely give you errors.

  6. Saving plots as images is not mandatory in the codes. However, if you want it, you will need to create a folder "Figures" at the highest folder hierarchy of the project, and to uncomment line(s) with the plt.savefig statements in the scripts, for the desired plot(s).

Cite this work

Paper with scientific methodology and astrophysical results obtained from this software:

@misc{mM24,
      title={Residual neural networks to classify the high frequency emission in core-collapse supernova gravitational waves}, 
      author={Manuel D. Morales and Javier M. Antelis and Claudia Moreno},
      year={2024},
      eprint={2406.00422},
      archivePrefix={arXiv},
      primaryClass={astro-ph.HE}
}

If you use this software in your work, please cite it using the following metadata:

@software{Morales_resnet50-sngw-hff_2024,
author = {Morales, Manuel D.},
month = jun,
title = {{resnet50-sngw-hff}},
url = {https://github.com/ManuelDMorales/resnet50-sngw-hff},
version = {1.0.0},
year = {2024}
}

About GPL-3.0 licence

Notice this code is shared under a GNU General Public Licence 3.0, which is a strong copyleft license. It means that any copy or modification of the original software must also be released under the GPL-3.0. The choice of this licence is aligned to Open Science practices. More details about GPL-3.0 in the LICENSE file. We also suggest to see the UNESCO Recomendation on Open Science.

About

ResNet50 model to classify the high frequency emission in gravitational waves from core-collapse supernovae

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published