What is Graph Neural Network_ An Introduction to GNN and Its Applications _ Simplilearn
What is Graph Neural Network_ An Introduction to GNN and Its Applications _ Simplilearn
All Courses
Home Resources AI & Machine Learning What is Graph Neural Network? | An Introduction to GNN and Its
Applications
By Simplilearn
Table of Contents
What Is Graph?
DeepWalk
GraphSage
View More
Graph Neural Network (GNN) is a new model that can be used to analyse graphs. Graphs are robust
data structures that contain relationships between objects and GNNs allow you to explore these
https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 2/13
1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn
data structures that contain relationships between objects, and GNNs allow you to explore these
relationships in new ways. For example, you can use a GNN to identify which people are most likely
to recommend a product on social media.
EXPLORE PROGRAM
What Is Graph?
Graphs are used in many fields, including computer science and social science. They are used to
model relationships between objects, such as links on the internet, friendships between people on
Facebook, or the food chain in an ecosystem.
In data science, you can use graphs to represent connections between objects.
A graph can be defined as G = (V, E), where V is the set of nodes (vertices) and E is the edges
between them.
Edges can be either directed or undirected, depending on whether directional dependencies exist
between vertices. The vertices are often called nodes.
Explore a wide range of Networking Courses at Simplilearn and become a certified networking
expert. Transform your career today!
Graph Neural Networks (GNNs) are the solution to a problem plaguing computer science for years:
how can we make computer vision work on graphs?
Graphs have been a central part of computer science since its inception, but it's only recently that
we've had the technology to make sense of them. And in many cases, we still need help with the
basics.
CNNs are great at image recognition and classification but need to work on graphs. They don't have
the capacity for it.
GNNs come in. They provide an easy way to do node-level, edge-level, and graph-level prediction
tasks.
GNNs can do what CNNs failed: give us tools to analyse complicated relationships between objects
in a network without creating false connections or missing important information about those
relationships.
Graph convolutional networks (GCNs) are a type of neural network you can use to solve graph-
structured data problems.
There are three essential components of a GCN: graph convolution, a linear layer, and a nonlinear
activation function.
The operations are usually done in this order. Together, they make up one network layer. We can
combine one or more layers to form a complete GCN.
import torch
class GCN(nn.Module):
super().__init__()
self.layers = nn.ModuleList([
])
adj = torch.eye(len(vertices))
return vertices
EXPLORE PROGRAM
DeepWalk
DeepWalk is a new graph neural network that operates directly on the target graph structure. It uses
a randomised path-traversing technique to provide insights into localised structures within networks.
It does so by utilising these random paths as sequences that are then used to train a Skip-Gram
Language Model.
The Skip-Gram model works by recognising which nodes are most likely to be connected to the input
words. These nodes are then used to generate predicted word sequences for those nodes, which
you can compare against the actual outputs from the network. This process allows you to create a
trained language model that can predict what other words might occur in your input text based
solely on its context in the graph structure!
DeepWalk uses this concept to provide insights into localised structures within networks by utilising
random paths as sequences and comparing them against the actual output from the network itself.
GraphSage
GraphSAGE is a representation learning technique for dynamic graphs. It uses inductive learning to
predict the embedding of a new node without a re-training procedure. It uses aggregator functions to
induce new node embeddings based on features and neighbourhoods of the node. Rather than
summing and losing track of them, we use a general aggregation function that keeps them separate.
Before we used mean aggregation – we took the message from the neighbours and added them up,
then normalised that by the number of neighbours. Now, we can also make a pooling type approach
or use deep neural networks like LSTMs.
Applications of GNNs
https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 6/13
1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn
Graph-structured data is present everywhere. Graphs are a prevalent data structure for storing,
analysing, and representing information and finding patterns in data that otherwise might not be
discoverable.
Application of GNNs:
Node Classification involves determining the labelling of samples by looking at their labels and
neighbours' labels. These problems are usually trained semi-supervised, with only a part of the
graph labelled.
Graph Clustering refers to the clustering of data in the form of graphs. Vertex clustering seeks to
cluster nodes into groups of densely connected regions based on either edge weights or edges.
The second form of graph clustering treats graphs as objects to be clustered, and these clusters
are based on similarity.
Link prediction is an important task in social networks where it’s essential to infer social
interactions between entities or recommend possible friends to users. It has also been used in
recommender systems problems and predicting criminal associations.
GNNs are a powerful new tool in computer vision, and their applications are growing daily.
They can be applied to image classification problems, particularly those where there is still much
development needed for machines to have the visual intuition of a human.
In one such problem, scene graph generation, the model aims to parse an image into a semantic
graph that consists of objects and their semantic relationships. Given an image, scene graph
generation models detect and recognise objects and predict semantic relationships between pairs
https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 7/13
1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn
of things.
Graph Neural Networks (GNNs) are a powerful tool for solving many NLP problems.
GNNs have been used to solve tasks like text classification, exploiting semantics in machine
translation, user geolocation and relation extraction. Recently, GNNs have also been applied to
question answering.
EXPLORE PROGRAM
Since their invention in the 1960s, GNNs have been applied to various tasks and domains. They have
been used to create models for detecting diseases, predicting social trends and patterns, and
predicting outcomes of elections.
Traffic
The traffic prediction problem is a crucial part of any intelligent transportation system. We can
address it using STGNNs: we consider the traffic network as a spatial-temporal graph where the
nodes are sensors installed on roads, and the distance between pairs of nodes measures the edges.
Each node's average traffic speed within a window a dynamic input features.
Chemistry
https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 8/13
1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn
Graph nodes and edges represent the structure of a molecule. Nodes are atoms, and edges – are
chemical bonds.
You can use graphs to analyse the molecular structure of molecules or compounds.
FAQs
Graph Neural Networks are a type of neural network you can use to process graphs directly. In the
past, these networks could only process graphs as a whole.
Graph Neural Networks can then predict the node or edges in graphs. Models built on Graph Neural
Networks will have three main focuses: Tasks focusing on nodes, tasks focusing on edges, and
tasks focusing on both nodes and edges.
GNNs are like regular neural networks but better. They're a class of deep learning methods that allow
you to do node-level, edge-level, and graph-level prediction tasks easily.
And the best part? You can use them directly on graphs.
Graph Neural Networks are Neural Network that directly operates on the graph structure. This paper
describes how to use Graph Neural Networks to solve problems in machine learning and computer
vision.
Convolutional Neural Networks (CNNs) and Graph Neural Networks (GNNs) are two types of deep
learning methods that you can use to perform inference on data described by graphs. CNNs are
artificial neural networks used in image recognition and processing. At the same time, GNNs are a
class of deep learning methods designed to perform inference on data described by graphs.
CNNs and GNNs are two types of neural networks. CNNs are specifically designed to operate on
structured data, while GNNs are the generalised version of CNNs where the number of nodes can
vary, and the nodes are unordered.
It means that CNNs can be applied to structured data such as images or text but not unstructured
data such as sound or weather. GNNs can be used for both structured and unstructured data.
Do you wish to accelerate your AL and ML career? Join our AI ML Certification and gain access
to 25+ industry relevant projects, career mentorship and more.
EXPLORE PROGRAM
Conclusion
Then look no further than Simplilearn’s AI ML Courses. The intensive Bootcamp will teach you Deep
Learning basics, including Statistics, ML, neural networks, Natural Language Processing and
Reinforcement Learning. It’s the perfect course to help you boost your career to greater heights!
Find our Post Graduate Program in AI and Machine Learning Online Bootcamp in top
cities:
Simplilearn
Simplilearn is one of the world’s leading providers of online training for Digital Marketing, Cloud
Computing, Project Management, Data Science, IT, Software Development, and many other emerging
…
Recommended Programs
https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 11/13
1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn
Explore Category
NEXT ARTICLE
By Simplilearn
Recommended Resources
Disclaimer
PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.