Gravitational wave signals from binary black hole collisions using G2NET_group_final
Gravitational wave signals from binary black hole collisions using G2NET_group_final
BACHELOR OF TECHNOLOGY
in
Computer Science and Engineering
by
We, Mr. J. VAMSHI KRISHNA bearing Hall Ticket Number 18K91A0580, Ms. GAN-
GASANI VIDYA bearing Hall Ticket Number 18K91A0567, Mr. KUMMARI MANOJ
bearing Hall Ticket Number 18K91A05A5, Mr. G. ROHITH YADAV bearing Hall Ticket
Number 18K91A0563, hereby declare that the main project report titled GRAVITATIONAL
WAVE SIGNALS FROM BINARY BLACK HOLE USING G2NET under the guidance
of DR. A. SURESH RAO, Professor and Head in Department of Computer Science and
Engineering is submitted in partial fulfillment of the requirements for the award of the degree
of Bachelor of Technology in Computer Science and Engineering.
Roll Number
Place: Meerpet
Date: dd/mm/yyyy
CERTIFICATE
This is to certify that the main project report entitled ”GRAVITATIONAL WAVE SIG-
NALS FROM BINARY BLACK HOLE COLLISIONS USING G2NET”, being submit-
ted by Mr. J. VAMSHI KRISHNA, bearing Roll No.: 18K91A0580, Ms. GANGASANI
VIDYA, bearing Roll Number: 18K91A0567, Mr. KUMMARI MANOJ, bearing Roll Num-
ber: 18K91A05A5,Mr. G.ROHITH YADAV, bearing Roll Number: 18K91A0563, in partial
fulfillment of requirements for the award of degree of Bachelor of Technology in Computer
Science and Engineering, to the TKR College of Engineering and Technology is a record of
bonafide work carried out by him/her under my guidance and supervision.
Name and Signature of the Guide Name and Signature of the HoD
Place: Meerpet
Date: dd/mm/yyyy
TABLE OF CONTENTS
ABSTRACT i
ACKNOWLEDGEMENTS ii
LIST OF FIGURES iii
1 INTRODUCTION 1
1.1 Motivation 1
1.2 Problem definition 2
1.3 Limitations of existing system 2
1.4 Proposed system 2
2 LITERATURE REVIEW 3
2.1 Review of Literature 3
3 REQUIREMENTS ANALYSIS 5
3.1 Functional Requirements 5
3.1.1 Data Collection 5
3.1.2 Model Creating 5
3.1.3 Model Training 5
3.1.4 Hyper parameter tuning 5
3.1.5 Model Evaluation 5
3.1.6 Model Deployed 5
3.2 Non-Functional Requirements 6
3.2.1 Usability 6
3.2.2 Reliability 6
3.2.3 Performance 6
3.2.4 Portabliity 6
3.2.5 Implementation 6
3.3 Software Requirement Specifications 6
3.3.1 Software Requirements 6
3.3.2 Hardware requirements 6
4 DESIGN 7
4.1 DFDs and UML diagrams 7
4.1.1 Data Flow Diagram 7
4.1.2 Sequence Diagram 8
4.1.3 Use Case Diagram 9
4.2 Algorithm 10
5 CODING 12
5.1 Pseudo Code 12
8 CONCLUSION 25
REFERENCES 25
ABSTRACT
Low-frequency waves are similar to other noises in the atmosphere. We need to eliminate noise
and isolate waves. This challenge in noise characterization could be solved with the help of
data science. As with the multi-disciplined approach to discovering GWs, additional expertise
will be needed to further GW. In particular, social and natural sciences have taken an interest
in machine learning, deep learning, classification problems, data mining, and visualization to
develop new techniques and algorithms to efficiently handle complex and massive data sets.
Machine learning and deep learning have emerged as a popular and powerful approaches for
solving problems in astrophysics. Machine Learning and Deep Learning Applications provide
fast and efficient methods for detector and signal characterization.
i
ACKNOWLEDGEMENTS
The satisfaction and euphoria that accompanies the successful completion of any task
would be incomplete without the mention of the people who made it possible and whose en-
couragement and guidance have crowned my efforts with success.
I am indebted to the Internal Guide, Dr. A. Suresh Rao, Professor and Head, Dept. of
Computer Science and Engineering, TKR College of Engineering and Technology, for his/her
support and guidance throughout my Thesis/Dissertation.
I am also indebted to the Head of the Department, Dr. A. Suresh Rao, Professor,
Computer Science and Engineering, TKR College of Engineering and Technology, for his
support and guidance throughout my Thesis/Dissertation.
I extend my deep sense of gratitude to the Principal, Dr. D. V. Ravi Shankar, TKR
College of Engineering and Technology, for permitting me to undertake this Thesis/Dissertation.
Finally, I express my thanks to one and all that have helped me in successfully com-
pleting this Thesis/Dissertation. Furthermore, I would like to thank my family and friends for
their moral support and encouragement
Place: Meerpet
Date: dd/mm/yyyy
ii
LIST OF FIGURES
iii
Chapter 1
INTRODUCTION
1.1 Motivation
Gravitational wave detection is crucial for two reasons: First, because gravity waves carry
information that is very different from that delivered by electromagnetic waves, their detec-
tion is predicted to open up a new window for observational astronomy. This new window
into the universe will enhance our understanding of the universe by allowing us to see the
fabric of space time around black holes, observe the formation of black holes or the merging
of binary systems consisting of black holes or neutron stars, search for rapidly spinning neu-
tron stars, delve into the very early moments of the universe’s origin, and peer into the very
centre of galaxies where supermassive black holes weighing millions of solar masses reside.
These are only a few of the major scientific breakthroughs expected in the first decade of the
twenty-first century. Second, detecting gravitational waves is critical for our understanding of
physics’ fundamental rules; proving the existence of gravitational waves will confirm a crucial
85-year-old prediction of general relativity.
Einstein’s prediction that light and gravity waves travel at the same speed might also be
tested by comparing the arrival timings of light and gravitational waves from, say, super-
novae. Finally, we could check that they have the polarization that general relativity predicts.
Data science can be used to do the majority of the prepossessing for wave data. Data-related
1
challenges are becoming easier to tackle in an era of rising computer capacity. CNN has a
demonstrated track record with large data.
2
Chapter 2
LITERATURE REVIEW
3
ing machine learning approaches. Techniques for enhancing the sensitivity of the Advanced
Laser Interferometer GW Observatory and Advanced Virgo GW searches, methods for swiftly
detecting the astrophysical properties of GW sources, and algorithms for decreasing and char-
acterisation of non-astrophysical detector noise, to name a few. These applications demon-
strate how machine learning techniques can be applied to enhance the science that current and
future GW detectors can accomplish. The data from LIGO and Virgo is non-stationary and
non-Gaussian. Machine learning techniques can increase the quality of these data.
With data from thousands of environmental and instrumental monitors, ML can be used to
predict the likelihood of a GW signal candidate being astrophysical or transient detector noise.
The cause of detector noise can be established by applying classification algorithms to distin-
guish distinct types of transient noise. As the sensitivity of ground-based GW interferometers
improves, the rate of detection of astrophysical events will increase, posing a challenge to
analyses that must cope with a huge number of events. The presence of terrestrial and instru-
mental glitches, which may increase with sensitivity, is the most significant stumbling barrier
in this endeavour.
This problem is likely to worsen over time as the density of events seen in the distant
cosmos with statistically lower SNRs grows. This cost can be greatly reduced by increasing the
fraction of actual occurrences in the list of potential triggers. Perhaps, in the future, machine
learning will assist us in increasing the dimension and volume of the parameter space for
astrophysical investigations. In this study, CNN algorithms were used to detect GW signals
from CBCs [2], through a binary classification with samples of non-Gaussian noise only and
samples of non-Gaussian noise plus GW injections.
We used a Morlet wavelet transform [5]to convert our time series vectors (strain data)
into time-frequency matrices, which was a crucial part of the data pre-processing (i.e., image
data). In addition, the created images were automatically decoded in the convolutional stacks
of our CNNs. Furthermore, the size of images in time-frequency format was lowered to the
point where all of our CNNs could be run efficiently on a single local CPU. The adoption of
a resampling white-box technique is a significant new addition to our study, which is moti-
vated by a desire to gain a statistically informed understanding of the uncertainties inherent in
CNN.With LIGO L1 data this model predicted accuracy of 82.5%
4
Chapter 3
REQUIREMENTS ANALYSIS
5
3.2 Non-Functional Requirements
Describe user-visible aspects of the system that are not directly related to the functional be-
havior of the system. Non-Functional requirements include quantitative constraints, such as
response time (i.e. how fast the system reacts to user commands.) or accuracy.
3.2.1 Usability
Because the system is designed to be totally automated, there is no or minimal user inter-
vention.
3.2.2 Reliability
The system is more reliable because of the qualities that are inherited from the chosen
platform python.
3.2.3 Performance
The performance of this system is matched to current user requirements. The libraries
used in the system are optimized which gives better performance.
3.2.4 Portabliity
The system is portable because of python language which is a high-level general-purpose
language.
3.2.5 Implementation
The system is implemented in windows environment using Tkinter Library for GUI(Graphical
User Interface).Also using machine learning and deep learning to build model.
6
Chapter 4
DESIGN
7
4.1.2 Sequence Diagram
In the Unified Modeling Language (UML), a sequence diagram is a type of interaction
diagram that depicts how processes interact with one another and in what order.
8
4.1.3 Use Case Diagram
In the Unified Modeling Language, a use case diagram is a type of behavioural diagram
that is specified by and produced from a Use-case analysis (UML). Its purpose is to provide a
visual representation of a system’s functionality in terms of actors, goals (represented as use
cases), and any dependencies between those use cases. The main goal of a use case diagram
is to show which system functions are performed for which actor. It is possible to display the
roles of the system’s actors.
9
4.2 Algorithm
Convolutional Neural Network (CNN): CNN stands for ”convolutional neural network” and
refers to a neural network with several layers. It is a type of Deep Neural Network that is
mostly utilised for the processing of visual pictures. CNN has one input layer, one or more
middle layers, one or more completely connected layers, and finally an output layer. CNN
is being mistreated as a building element for our models. It works like this: the convolu-
tional layers apply a complex process to the input data, and the result is transmitted to the
next layer.This convolutional layer reacts in the same way as a human neuron reacts to vi-
sion. Every neuron in the convolution makes use of the data it gets and processes the data it
is in charge of. Although feed forward neural networks exist that can identify data based on
features, such systems cannot be used when processing film. Pooling layers with global or
local scope may be included in convolution systems. The pooling layer is one of the building
components that helps to lower the dimensionality of representation over time, resulting in a
significant reduction in computation complexity. It accomplishes this by clustering some neu-
rons from one layer together. Local pooling typically groups neurons in small groups, such as
2x2. Global pooling applies the process to every neuron. Layers that have complete associa-
tively consists of every single neuron from one layer connected to every single neuron from
another layer. This is sometimes also similar to the multi-layered neural network on funda-
mental level. The flattened grid or matrix undergoes changes through completely associated
layer for image classification.
10
Fig. 4.4 CNN Algorithm
11
Chapter 5
CODING
train pathglob(’C:/sampled1/train/*/*/*/*’)
rind- train path[3].rindex(’\’) // last index where the character ’/’ appeared
extracted id for explore sample 3- train path[3][rind+1:].replace(’.npy’, ”) // replaced .npy
extracted id for explore sample 3
12
PROCEDURE preprocess function cqt(path):
OUTPUTS
signal- np.load(path.numpy())
FOR i 0 TO signal.shape[0]
signal[i] /= np.max(signal[i])
NEXT signal- np.hstack(signal)
signal- torch.from numpy(signal).float()
image- transform(signal)
image- np.array(image)
image- np.transpose(image,(1,2,0))
output tf.convert to tensor(image)
END FUNCTION
13
THEN
OUTPUT f’C:/sampled1/train/id [0]/id [1]/id [2]/id .npy’
ELSE
OUTPUT f’C:/sampled1/test1/id [0]/id [1]/id [2]/id .npy’
ENDIF
ENDFUNCTION
14
// Second pair of Conv1D and MaxPooling1D layers
model cnn.add(Conv2D(filters=32, kernel size=3, INPUT input shape- input shape,
activation=’relu’, name=’Conv 02’)),
model cnn.add(MaxPooling2D(pool size=2, name=’Pool 02’))
15
root dir-”C:/sampled1/”
train labels- pd.read csv(root dir + ”train/img labels.csv”)
new labels- train labels[-35010:]
x test- new labels
y test- new labels[’target’]
16
Chapter 6
This app can be used on PCs.However, the user must install python and the required
libraries for this system. We mainly focus on detecting whether the gravitational wave is
present or not. Initially when data is given preprocessing is the basic step.
As our model is based on the CNN algorithm and because of the huge dataset, it took
much time to run the model successfully. Optimization and Hyperparameter tuning plays
import role to improve the model’s efficiency
6.1.2 Train
Training includes an appropriate train-test split of data and training the model. The training
phase is essential and repetitive when we perform hyper parameter tuning.
6.1.3 Test
After model training, we test the model to evaluate its performance. Based on the model
performance, we iterate our process till we get the expected result.
6.1.4 Evaluate
We evaluate the model with accuracy metrics. For this kind of classification problem, we
use a confusion matrix, precision, and recall.
6.1.5 Deploy
After the expected result, we will deploy the model based on our convenience. This system
has been deployed using the Python GUI library Tkinter.
17
6.2 Method of Implementation
6.2.1 Input
We are provided with a training and test set of time series data containing simulated gravita-
tional wave measurements from a network of 3 gravitational wave interferometers.
• LIGO Hanford
• LIGO Livingston
• Virgo
Each time series contains either detector noise or detector noise and a simulated attraction
The task is to identify when a signal is present in the data (target = 1).
Each.npy data file contains three-time series, one for each detector, lasting two seconds and
sampled at 2,048 Hz.
And we have a total of 5,60,000 files, each with a dimension of 3 x 4096, resulting in a massive
time series.
18
Fig. 6.2 Output Screen
19
Fig. 6.4 Confusion matrix
20
Chapter 7
21
Classification Accuracy: classification One of the most essential elements in determining
the accuracy of classification problems is accuracy. It specifies how often the model correctly
predicts the outcome. The ratio of the number of right predictions produced by the classifier
to the total number of predictions made by the classifiers can be determined.
Precision: It can be defined as the number of correct outputs supplied by the model or
the percentage of all positive classifications that the model correctly predicted being true. The
following formula can be used to compute it.
Recall: It is defined as the percentage of positive classes that our model accurately pre-
dicted out of a total of positive classes. It is critical that the recall rate be as high as feasible.
7.2 Validation
After model evaluation, the next step is to deploy the model and test it on external data. We
deployed our model using the Tkinter library which is used for GUI applications. We have
successfully deployed and validated other data.
22
Fig. 7.1 GUI Input Screen
In the below figure probability of presence of gravitational wave is 0.19 i.e, 0.5. So we
conclude it’s not gravitational wave.
In the below figure probability of presence of gravitational wave is 0.98 i.e, 0.5. So we
conclude it’s a gravitational wave.
23
Fig. 7.3 GUI Output Screen
7.3 Conclusion
The idea is to use CNN to perform the classification of a gravitational wave. The next step
involves the collection of data and preprocessing. We have split our dataset in 80-20%. We
have developed a deep learning model using the CNN algorithm. It is trained with a gravita-
tional wave dataset. This model has been successfully trained evaluated and deployed. The
performance of the model is up to the mark compared to existing systems.
24
Chapter 8
CONCLUSION
In this paper, we’ve seen the importance of gravitational waves. Applications of gravita-
tional waves will have a phenomenal impact on astronomy. Traditional methods will require
the use of a detector to detect gravitational waves, and gravitational wave search methods
will require manual intervention. Working in this manner is laborious and time-consuming.
Data-related challenges are becoming easier to tackle in an era of rising computer capacity.
CNN has a demonstrated track record with large data. We used CNN to classify input data to
detect the presence of waves. It is more cost-effective compared to traditional methods. Also
proposed model is efficient compared to the existing model with .75 accuracy.
The existing model is not trained with the appropriate and adequate amount of data which
is a major drawback. The proposed system has been trained with a huge and appropriate
dataset which makes the system more reliable. There is no proper sampling of data in real-
time. If the data is captured in a universal way it will be helpful for practitioners to focus on
model improvement. We can also improve model efficiency with more preprocessing trans-
formation and using the latest invitations in Deep learning.
25
REFERENCES
[3] Elena Cuoco, Jade Powell, Marco Cavaglià, Kendall Ackley, Michał Bejger, Chayan Chat-
terjee, Michael Coughlin, Scott Coughlin, Paul Easter, Reed Essick, et al. Enhancing
gravitational-wave science with machine learning. Machine Learning: Science and Tech-
nology, 2(1):011002, 2020.
[4] Albert Einstein. Approximative integration of the field equations of gravitation. Sitzungs-
ber. Preuss. Akad. Wiss. Berlin (Math. Phys.), 1916(688-696):1, 1916.
[5] Manuel D Morales, Javier M Antelis, Claudia Moreno, and Alexander I Nesterov. Deep
learning for gravitational-wave data analysis: A resampling white-box approach. Sensors,
21(9):3174, 2021.
[6] Massimiliano Razzano and Elena Cuoco. Image-based deep learning for classification
of noise transients in gravitational wave detectors. Classical and Quantum Gravity,
35(9):095016, 2018.
[7] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhi-
heng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large
scale visual recognition challenge. International journal of computer vision, 115(3):211–
252, 2015.
26
[8] Peter R Saulson. Fundamentals of interferometric gravitational wave detectors. World
Scientific, 1994.
[9] Rikiya Yamashita, Mizuho Nishio, Richard Kinh Gian Do, and Kaori Togashi. Convolu-
tional neural networks: an overview and application in radiology. Insights into imaging,
9(4):611–629, 2018.
27