0% found this document useful (0 votes)
14 views13 pages

What is Graph Neural Network_ An Introduction to GNN and Its Applications _ Simplilearn

Graph Neural Networks (GNNs) are advanced models designed to analyze graph-structured data, enabling tasks such as node classification, graph clustering, and link prediction. They address limitations of traditional neural networks by effectively capturing complex relationships within graphs, making them applicable in fields like computer vision and natural language processing. GNNs have various applications, including traffic prediction, disease detection, and social trend analysis.

Uploaded by

asaddocuext
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views13 pages

What is Graph Neural Network_ An Introduction to GNN and Its Applications _ Simplilearn

Graph Neural Networks (GNNs) are advanced models designed to analyze graph-structured data, enabling tasks such as node classification, graph clustering, and link prediction. They address limitations of traditional neural networks by effectively capturing complex relationships within graphs, making them applicable in fields like computer vision and natural language processing. GNNs have various applications, including traffic prediction, disease detection, and social trend analysis.

Uploaded by

asaddocuext
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

1/10/24, 2:32 AM What is Graph Neural Network?

An Introduction to GNN and Its Applications | Simplilearn

All Courses

AI & Machine Learning

Articles Ebooks Free Practice Tests On-demand Webinars Tutorials

Home Resources AI & Machine Learning What is Graph Neural Network? | An Introduction to GNN and Its
Applications

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 1/13


1/10/24, 2:32 AM 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

By Simplilearn

Last updated on Aug 14, 2023 9788

Table of Contents

What Is Graph?

What Are Graph Neural Networks (GNN)?

What Is Graph Convolutional Networks?

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.

Your AI/ML Career is Just Around The Corner!

AI Engineer Master's Program

EXPLORE PROGRAM

What Is Graph?

A graph is an abstract representation of a network.

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!

What Are Graph Neural Networks (GNN)?

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 3/13


1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn

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.

What Is Graph Convolutional Networks?

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.

You can implement a GCN using PyTorch as follows:

import torch

from torch import nn

class GCN(nn.Module):

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 4/13


1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn

def __init__(self, *sizes):

super().__init__()

self.layers = nn.ModuleList([

nn.Linear(x, y) for x, y in zip(sizes[:-1], sizes[1:])

])

def forward(self, vertices, edges):

# ----- Build the adjacency matrix -----

# Start with self-connections

adj = torch.eye(len(vertices))

# edges contain connected vertices: [vertex_0, vertex_1]

adj[edges[:, 0], edges[:, 1]] = 1

adj[edges[:, 1], edges[:, 0]] = 1

# ----- Forward data pass -----

for layer in self.layers:

vertices = torch.sigmoid(layer(adj @ vertices))

return vertices

Your AI/ML Career is Just Around The Corner!

AI Engineer Master's Program

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 5/13


1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn

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.

Graph classification is a crucial technology for image classification, recommendation systems,


NLP, and social network analysis.

Graph visualisation is an area of mathematics and computer science at the intersection of


geometric graph theory and information visualisation. It is concerned with the visual
representation of graphs that reveals structures and anomalies that may be present in the data
and helps the user to understand the charts.

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 in Computer Vision

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.

GNNs in Natural Language Processing

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.

Your AI/ML Career is Just Around The Corner!

AI Engineer Master's Program

EXPLORE PROGRAM

GNNs in Other Domains

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

1. What is Graph neural network used for?

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.

2. How do you graph a neural network?

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.

3. What is Graph neural network in machine learning?

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.

4. What are the types of neural graph networks?

The three main types of neural graph networks are:

Recurrent Graph Neural Network,

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 9/13


1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn

Spatial Convolutional Network

Spectral Convolutional Network.

5. What are CNN and GNN?

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.

6. What is the difference between GNN and GCN?

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.

Become a Certified Marketing Expert in 8 Months

With Purdue Digital Marketing PG Program

EXPLORE PROGRAM

Conclusion

Are you looking to learn AI and machine learning?


https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 10/13
1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn
Are you looking to learn AI and machine learning?

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:

Name Date Place

Post Graduate Program in AI and Cohort starts on 17th Jan 2024,


Your City
Machine Learning Weekend batch

Post Graduate Program in AI and Cohort starts on 26th Jan 2024,


Your City
Machine Learning Weekend batch

Post Graduate Program in AI and Cohort starts on 15th Feb 2024,


Your City
Machine Learning Weekend batch

About the Author

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

Post Graduate Program in AI and Machine Learning Lifetime


Access*
2828 Learners

Artificial Intelligence Engineer Lifetime


Access*
29336 Learners

Machine Learning Course Lifetime


Access*
52181 Learners

*Lifetime access to high-quality, self-paced e-learning content.

Explore Category

NEXT ARTICLE

Intro to Recursive Neural Network


in Deep Learning

By Simplilearn

19262 Aug 11, 2023

Recommended Resources

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 12/13


1/10/24, 2:32 AM What is Graph Neural Network? An Introduction to GNN and Its Applications | Simplilearn

Getting Started with Google What Are Radial Basis


Display Networ… Functions Neural Netw

© 2009 -2024- Simplilearn Solutions

Disclaimer
PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.

https://www.simplilearn.com/what-is-graph-neural-network-article?tag=graph neural network 13/13

You might also like