Graph neural networks (GNNs) have recently become more and more popular in a variety of fields, including life science, recommender systems, knowledge graphs, and social networks. The breakthrough in the field of graph analysis study is made possible by the strength of GNN in modelling the relationships between nodes in a graph.

Through this blog, we will try to help you in building a basic knowledge of what graph neural networks are, how they work, why we need them, their different types and much more.

**What is Graph?**

Graphs are ubiquitous; the definitions of actual world items frequently depend on how they link to other things. A graph is a natural way to represent a collection of things and the relationships among them.

A graph takes the help of nodes and edges to represent this collection and the relationship between them. An object, location, or person can be a node, and the edges indicate how those nodes are related to one another. Based on directional dependencies, the edges might be either directed or undirected.

**Figure: (a) Undirected graph & (b) Directed Graph**

** picture source:** researchgate.net

**What is Graph Neural Network?**

Graphs are receiving a lot of attention in the field of machine learning due to their incredibly strong expressive capabilities. Graph Neural Network is an example of a neural network that directly manipulates a graph structure. Node categorization is a common use of GNN.

In essence, each node in the network has a corresponding label, and we want to predict those labels without using ground truth. An embedding is associated with every node. The node's position inside the data space is determined by this embedding.

The main objective of a GNN architecture is to learn an embedding including neighbourhood information. This embedding might be applied to a number of problems, such as node labelling, node and edge prediction, etc.

In simple words - A subtype of Deep Learning method designed exclusively to do inference on graph-based data is** Graph Neural Networks**. They are used with graphs and have the ability to carry out prediction tasks at the node, edge, and graph levels.

**Why do we need Graph Neural networks?**

Recent advances in neural network technology have accelerated the study of pattern recognition and data mining. With end-to-end deep learning models like CNN, RNN, or autoencoders, machine learning tasks have been given new life, such as object detection, machine translation, and speech recognition. Euclidean data's latent patterns can be effectively captured using deep learning (images, text, videos).

However, Graph Neural Networks (GNN) are helpful when applications, where data is created from non-Euclidean domains and represented as graphs with intricate item interactions and dependencies.

Also, GNNs are needed to solve the challenges related to the Classification of Nodes, Link Forecast, and Classification of Graphs

**Types of Graph Neural Network**

**Recurrent Graph Neural Network**

Recurrent Graph Neural Networks (RGNNs) can handle multi-relational graphs where a single node has numerous relations and they can learn the optimal diffusion pattern. Regularisers are used in this form of graph neural network to improve smoothness and reduce over-parameterization. RGNNs produce superior outcomes while utilising less processing power.

Common use cases of RGNNs include:

- Text generation,
- Speech recognition,
- Machine translation,
- Picture description,
- Video tagging, and
- Text summarizing.

**Working of RGNNs: **Banach Fixed-Point Theorem is a presumption used in the construction of RGNN. Let (X,d) be an entire metric space and (T: X→X) be a contraction mapping, according to the Banach Fixed-Point Theorem. Once T reaches its one and only fixed point, (x∗), the sequence T n(x) for n→∞ converges to (x). Accordingly, if I apply the mapping T on x k times, x^k should be almost equivalent to x^(k-1).

**Figure**: *Architecture of RGNN*

*picture source*: researchgate.net

**Spatial Convolutional Network**

Spatial graph Convolutional networks learn from graphs that are situated in spatial space by using spatial properties. Similar to the well-known CNN, which dominates the research on image classification and segmentation tasks, the spatial convolution network operates on the same principles.

Convolution, in essence, is the notion of summing adjacent pixels around a central pixel that are determined by a filter with parametric size and learnable weight. The same concept is applied by spatial convolutional networks, which combine the properties of nearby nodes into the central node.

Spatial graph convolutions due to the confined nature of their filters are often more scalable. The main difficulty is in creating a local invariance for CNNs that operate on core nodes with varied numbers of neighbors.

**Spectral Convolutional Network**

This kind of graph convolution network has much stronger mathematical underpinnings than other kinds of GNN. Graph signal processing theory serves as the foundation for Spectral Convolutional networks. Graph convolution is also approximated via simplification.

Spectral Convolutional Network is founded on the Graph Signal Processing theory. By using Chebyshev polynomial approximation:

Apart from Chebyshev polynomial approximation, Spectrum Graph Convolutional networks employ the Eigen-decomposition of the graph Laplacian matrix to propagate information along nodes. These networks were motivated by the way waves move across signals and systems.

**Applications of GNN**

Now that you know what kinds of analyses GNN can carry out, you might be wondering what actual things graphs can do in real life. This section of the article will talk about the practical uses of GNN.

**GNN in Computer Vision**

Down below are the two effective applications of GNNs in Computer Vision:

- The first effective application of using GNNs in Computer Vision is using graphs to describe the relationships between the items identified by a CNN-based detector. Following object detection from the photos, the objects are sent into a GNN inference to predict relationships. A created graph that models the relationships between various items is the result of the GNN inference.

- Another application of GNN in computer vision is the creation of images from graph descriptions. Generally, the conventional method of creating images from the text was using GAN or an autoencoder. Graph-to-picture production gives more details on the semantic structures of the images than text-based image descriptions.

**Natural Language Processing Using GNN**

Natural Language Processing frequently uses GNN. In reality, this is also where GNN starts out. The use of GNN can be advantageous for a variety of NLP tasks, including sentiment classification, text classification, and sequence labelling.

To anticipate the categories, GNN makes use of the internal relationships between words or texts. For instance, the citation network attempts to predict the label of each publication in the network based on the link between the papers' citations and the terms used in those citations. In addition, rather than using a sequential approach like RNN or LTSM, it may construct a syntactic model by considering many aspects of a phrase.

**Use of GNNs in Traffic**

A key component of a smart transportation system is the ability to forecast traffic volume, speed, or road density. Utilizing GNNs, we can solve the traffic forecast issue. Imagine the traffic network as a spatial-temporal graph, with nodes representing the sensors placed on roadways, edges representing the separation between pairs of nodes, and dynamic input features representing the average traffic speed within a window for each node.

**GNNs in different fields **

There are many other domains apart from NLP and CV where GNN is employed. This includes:

- Program verification,
- Programme reasoning,
- Social influence prediction,
- Recommender systems,
- Electrical health records modelling,
- Brain networks, and
- Adversarial attack avoidance.

**Conclusion**

In this article, we made you familiar with many aspects of GNN. Its understanding and various applications in the real world. GNN is an effective tool for graph data analysis due to its flexibility, expressive power, and simplicity in visualization. It is not just restricted to graphing issues. It is broadly applicable to any topics that may be represented by graphs.