A Gentle Introduction to Graph Neural Network

# A Gentle Introduction to Graph Neural Network

Updated on Jan 3, 2023 18:04 IST

In this article, you will find the answers to the why, what, and where of Graph Neural Networks. Here we have introduced you to the basic concepts of Graph Neural networks.

The success and importance of Neural networks give a new way of research for data mining and pattern recognition. Machine learning algorithms are used in Neural Networks to train them for better predicting the actual datasets. The Machine Learning tasks give a path to deep learning concepts like CNN and Graph Neural Networks (GNN). Deep learning, with its methods, helps in different real-life applications like voice recognition and image identification.

Deep Learning is good at finding a hidden pattern in images and text. But it fails to deal with complex graph structures due to more dependencies. Graph Neural Networks are a deep learning subset that identifies hidden patterns in complex graph databases.

Check out- Deep Learning and Neural Networks Online Courses & Certifications

Must read: Introduction to Neural Networks in Deep Learning

## What is a Neural Network?

Before defining Graph Neural Networks, I will briefly introduce you to Neural Networks (NN) or Artificial Neural Networks.

Neural Network is an interconnected network of neurons. The biological neuron system inspires its working and idea. Artificial Neural Networks have three layers:

• Input layer
• One or more Hidden layer
• Output layer

Highlights of Artificial Neural Network

• Neural Networks learn on their own by learning from training datasets.
• Artificial Neural Networks consist of 2 parts: Summation and Functional.
• Training helps Neural Networks to handle real-life situations without human involvement.
• A practical example of a Neural Network is Google Assistant.

Also read: Different Types of Neural Networks in Deep Learning

## What is a Graph?

The foundation of Graph Neural Network is graph theory. The Graph is a structured dataset to store & transfer information.

It is defined by: G = {N, E} where,

N= node

E = Edge

1. Node or Vertex: A node can be a person, element, or thing. Who has some features and stored data?
2. Edges: They are the connection path between two or more edges.

### Types of Graphs

#### Directional / Directed Graph

Directed Graph has a direction at the edges. The nodes have only a single direction. A practical example of directed graphs is Twitter. Twitter follows the concept of directed graphs; when you request to follow a person, it is not mandated that person also follows you back.

#### Non-directional / Undirected Graph

Undirected Graphs have no defined directions for the connected nodes. The nodes can work in any direction.

A practical example of an undirected graph is Facebook. When you forward a friend request, it accepts your request. In that case, you both become friends and can see each other’s Facebook activity.

Labels in a graph are the markings on edges and nodes. Labels help to identify the node and edge. In other words, it is a name for the particular node and edge. Labeling can be in numerical, textual, and unique labels.

Graphs are an easy way to store data but are not understandable for the computer, and to make it computer ready, convert the Graph into an Incidence Matrix. The incidence Matrix is similar to the mathematical matrix of size n x m.

Suggested Read- A Day in a Life of a Data Science Engineer

## Why are Graphs Complex?

Deep learning concepts use graphs to solve real-world problems. But many complexities are associated with the Graph’s usage.

1. It is challenging to analyze the non-linear structure and its existence in non-Euclidean space.
2. More complexity with unordered nodes with undefined size and length.
3. There are more dependencies and several links between nodes, making it more complex with the increasing size of the Graph.

The Graph Neural Network helps eliminate all the challenges mentioned above.

Also, Read: Deep Learning vs Machine Learning – Concepts, Applications, and Key Differences

## What is Graph Neural Network?

Graph Neural Networks, or GNN, is one of the new but popular fields of Deep Learning. Graph Neural Networks are Artificial Neural Networks that work on graph structural databases. We can use it to predict the behavior of a Machine Learning model by generating relationships between nodes and edges of the Graph.

Explore- Machine Learning Online Courses & Certifications

Graph Neural Network = Artificial Intelligence + Graph Structure

Graph Neural Networks was first introduced in 2014 in the research paper “Spectral Networks and Deep Locally Connected Networks in Graphs” by Bruna et al.

The prime objective of Graph Neural Networks is to identify nodes with their connection and neighborhood information.

Graph Neural Networks are easily adaptive to new datasets; they have an input layer, multiple hidden layers, and one output layer. It consists of 3 sequential processes for better predictions.

1.  Graph Convolution
2. Linear Layer
3. Non-linear Activation

Graph Neural Networks help in better drug discovery and recommendation systems. Amazon claims that it used it to detect fraud and is using it to identify fake sellers and buyers.

## Working of Graph Neural Networks

The basic working of Graph Neural Networks is passing information to the neighboring nodes, which comprises 4 essential steps.

1. Building a graph structure.
2. Defining the graph type with all scaling.
3. Design the loss function, which includes training the model (supervised, semi-supervised, or unsupervised learning). Prediction at the node level, edge level, or graph level.
4. Using computational modules to build the final model.

## Why Choose Graph Neural Networks?

Deep learning consists of two concepts: Convolutional Neural Networks and Graph Neural Networks. Graph Neural Networks are a combined work of Artificial Intelligence and Graph database.

CNN is restricted to predicting only fixed-length graphs and fails to solve the complexity of the unstructured and undefined graph data structure.

Graph Neural Networks solved the prediction problem of undefined size and pattern of the graphs. It also deals with graph complexities.

## Types of Graph Neural Networks Architecture

### Recurrent Graph Neural Network

This Graph Neural Network is based on the Banach Fixed Point Theorem with the formula:

x^K = T (x^K-1), k ∈ (1, n)

Recurrent Graph Neural Networks handle multi-relational graphs, where each node is connected with multiple nodes. It is a bi-direction Graph, and data can move in backward and forward directions. They use regularizes to remove over-parameterization and enhance graph smoothness. It is used for machine translation, speech recognition, video tagging, and text summarization.

### Spatial Convolutional Network

It works similarly to the convolutional Graph, but the only difference is that it is based on combining information from all neighboring nodes for the primary central node.

### Spectral Convolutional Network

This graph network is based on the Graph Signal Processing theory, where the Spectral Convolutional Network uses Chebyshev polynomial approximation. Its working is more inclined towards strong mathematics with more calculations and computations.

### Grated Graph Neural Network

These are the upgraded Recurrent Graph Neural Networks, and it has long-term dependencies on nodes, time gates, and edges. Grated Graph neural Networks use gates to remember and forget information at different graph stages.

## Application Areas of Graph Neural Network

### Traffic

Traffic is a topic of concern for the future and present as the population is rapidly increasing and land is very limited or decreasing, we have to manage the traffic to save time and facilitate vehicle movement. Can use Graph Neural Networks to predict traffic speed with its intensity and capacity of the road. To make it work, install sensors on roads that work as nodes and edges to measure the distance between nodes.

### Computer Vision

It is a developing area and needs more improvements. Graph neural networks can classify and identify images or objects by dividing the image into graphical forms.

### Natural Language Processing

NLP is used in various sectors like question answering, location identification, text classification, or machine translation. With all the different applications, this area needs more improvements. It can use Graph Neural networks to make it more robust, with nodes defining entities with information, and the definition of the relationship between nodes is the work of edges.

### Image Classification

Image and text classification are growing areas of Natural Language Processing, and it made exemplary achievements. Still, the requirement is to train the model with few datasets, which can be achieved using Graph Neural Networks.

### Chemistry

Graph Neural Networks can be used to identify molecular structures and research new drug development. The nodes will work as molecules, and edges define the bond between molecules.

## Advantages of Graph Neural Network

1. Can easily use Graph Neural Networks for any dataset that consists of pair relationships among items and input data.
2. Graph Neural Networks can perform very well in areas where CNN’s fail; Graph Neural Networks can deal with the problem of undefined-sized graphs.
3. Graph Neural Networks store less information as they only need to store the information related to node connections, while other neural networks have to store information on all neurons.
4. Graph Neural Networks are efficient in handling regression processing.

## Disadvantages of Graph Neural Network

1. One of the most significant drawbacks of Graph Neural Networks is it fails to solve the Black-box problem. The problem is the final behavior of the neural network is unpredictable due to many algorithms and complex working processes.
2. Graph Neural Networks are shallow networks with only 3 layers, which restricts them from achieving state-of-the-art performance on large datasets.
3. It is expensive to deploy the GNNs due to more computations.
4. It is hard to train Graph neural Networks due to graph complexities and changing graph structure.

Check out- Deep Learning Interview Questions and Answers

### Conclusion

Graph Neural Networks are the buzz in Deep learning and Natural Language Processing due to their capability and adaptivity to deal with complex graph structures and real-world problems.

In this blog, we have covered all the required information about Graph Neural Networks, and we hope this article will help you with all the questions related to Graph Neural Networks.

Contributed By: Sonal Meenu Singh

Top Trending Articles:

## FAQs

Q. What are Graph Neural Networks used for?

Graph Neural Networks are used to define the relationship between the nodes and are one of the deep learning methods based on graph theory. Graph Neural Networks is the achievement over CNNs. They are used in graph classification, node classification, edge classification, and label detection.

Q. What is a graph-based neural network?

Graph Neural Network is a deep learning concept based on graph theory and used to deal with graph complexities. It helps predict various levels like node, edge, and Graph. It is used to solve the complexities of unstructured non-uniform graphs.

Q. What can we do with GNN?

Graph Neural networks are used in various real-life applications like physics, chemistry, traffic detection, image & text classification, computer vision, and many more.

Q. Who invented graph neural networks?

In their research paper, Graph Neural Network was first introduced in 2006 by Scar celli and Gauri. Later, in 2014 Bruna et al., in the research paper "Spectral Networks and Deep Locally Connected Networks in Graphs," defined Graph Neural Networks.

Q. What is the difference between CNN and GNN?

CNN is a Convolutional neural network that works on predicting structured data. GNN is a Graph Neural Network that is an improved form of CNN and works on unstructured graphs with undefined node sizes.

Q. Is graph neural network uses deep learning?

Graph Neural Network is one of the Deep Learning methods used in training the model for better model predictions. It is used to solve the complexities of graph databases. With the increasing use and success of Graph Neural Networks, they have some disadvantages, and the biggest one is the black box problem.