Graph Neural Networks: Definition, Types, Applications

Hi readers! I hope you are doing great. We are learning about modern neural networks in deep learning, and in the previous lecture, we saw the capsule neural networks that work with the help of a group of neurons in the form of capsules. Today we will discuss the graph neural network in detail.

Graph neural networks are one of the most basic and trending networks, and a lot of research has been done on them. As a result, there are multiple types of GNNs, and the architecture of these networks is a little bit more complex than the other networks. We will start the discussion with the introduction of GNN.

Introduction to Graph Neural Networks

The work on graphical neural networks started in the 2000s when researchers explored graph-based semi-supervised learning in the neural network. The advancements in the studies led to the invention of new neural networks that specifically deal with graphical information. The structure of GNN is highly influenced by the workings of convolutional neural networks. More research was done on the GNN when the simple CNN was not enough to present optimal results because of the complex structure of the data and its arbitrary size.

All neural networks have a specific pattern to deal with the data input. In graph neural networks, the information is processed in the form of graphs (details are in the next section). These can capture complex dependencies with the help of connected graphs. Let us learn about the graph in the neural network to understand its architecture.

Graphs in Neural Networks

A graph is a powerful representation of data in the form of a connected network of entities. It is a data structure that represents the complex relationship and interaction between the data. It consists of two parts:

  1. Node

  2. Edge

Let us understand both of these in detail.

Nodes in Graph

Here, nodes are also known as vertices, and these are the entities or data points in the graph. Simple examples of nodes are people, places, and things. These are associated with the features or attributes that describe the node, and these are known as node features. These features vary according to the type of graphical network. For instance, in the social network, the node is the user profile and the node features include its age, nation, gender, interests, etc.

Edges in Graph

Edges are the connections between the nodes, and these are also known as the connections, links, or relationships of the nodes. Edges may be directional or unidirectional in nature, and these play a vital role in the connection of one node to the other. The unidirectional nodes represent the relationship of one node to the other, and the undirected edges represent the bidirectional relationship between the nodes.

GNN Architecture

Just like other neural networks, the GNN also relies on multiple layers. In GNN, each layer is responsible for getting information from the neighbor node. It follows the message-passing paradigm for the flow of information; therefore, the GNN consists of inherited relationships and interactions among the graphs. In addition to nodes and edges, here are some key features to understand the architecture of GNN. 

Message Passing Mechanism

The complex architecture of layers in the graph is responsible for the flow of information from node to node. The message-passing process is part of the information flow when every node interacts with each other to provide information, and as a result, the data is transformed into an informative message. The type of node is responsible for the particular information, and nodes are connected according to their node features.

mechanisms. The aggregation of the data is done through a weighted sum or even more complex mechanisms such as mean aggregation or attention-based aggregation.

Learnable Parameters

The GNN follows the learnable parameters just like some other neural networks. These are the weights and biases that are learned during the processes in the GNN. The state of each node is updated based on these parameters. In GNN, the learnable parameters have two properties:

  • Edge weights are the importance of each edge in the GNN. A higher weight means more importance to that particular edge when the data is updated in the iteration.
  • Before any node is updated, the biases are added to the nodes, which are an offset value of a constant number. These biases vary according to the importance and behavior of the nodes and account for their intrinsic properties.

Types of GNN Architecutres

Since its introduction in the 2000s, continuous research and work have been done on the GNN. With the advent of research, there are multiple types of GNNs that are working in the market for particular tasks. Here are some important types of graphical neural networks:

Graph Convolutional Networks

The graph convolutional networks (GCN) are inspired by convolutional neural networks. These are the earliest and most widely used GNN variants. These networks can learn the data by applying the convolutions to the graph data. In this way, these can aggregate and update node representation by keeping track of their neighbor nodes. 

Graph Recurrent Networks

These are inspired by recurrent neural networks and are also referred to as GRN. The basic use of these networks is in sequence modeling. These networks apply the recurrent operations to the graph data and learn features from it. These features are representative of the global structure.

Graph Attention Networks

The graph attention networks (GATs) introduce the attention mechanism in the GNNs. This mechanism is used to learn the weights of edges in the graph. This helps in the message passing because the nodes choose the relevant neighbors and it makes the overall working of the network easy. The GATs work perfectly in processes like node classifications and recommendations.

Graph Isomorphism Network

The graph isomorphism network was introduced in 2018, and it can produce the same output as the two isomorphic graphs. GINs focus on the structural information of graphs and apply premature invariant functions during the steps of message passing and node update. Each node represents its data, and the most likely connected nodes are aggregated to create a more powerful network. 

GraphSAGE

GraphSAGE means graph sample and aggregated, which is a popular GNN architecture. It samples the local neighborhood of each node and aggregates its features. In this way, the detail of node data is easily represented, and as a result, scalability can be applied to large graphs. It makes graph learning tasks easy, such as the classification of nodes and link prediction. 

Applications of GNNs

The large collection of types of GNN architecture allows it to perform multiple tasks. Here are some important applications of GNN in various domains:

Social Network Analysis

GNN has applications in social networks, where it can model relationships among network entities. As a result, it performs tasks such as link prediction, recommendation analysis, community detection, etc.

Medical Industry

The GNN plays an informative role in the medical industry in branches like bioinformatics and drug discovery. It is used in the prediction of the molecular properties of new drugs, the protein-protein interaction in the body and drugs, the formulation of new drugs based on experimentation, etc. 

Recommendation System

The relationship between the graphs is a string in the GNNs, which makes it ideal for prediction and learning the interaction between the user and the items. Moreover, the graph structures are highly usable in the recommendation system of the items released for the users on different levels.

Hence, we have read the information about the graph neural networks. The basic unit of these networks is the graph, which has two parts nodes and edges. The relationship between different edges in the group is responsible for the functioning of GNN. We have seen the types of neural networks that are divided based on their mechanisms of working. In the end, we had an overview of the general applications of GNN. These are a little bit more complex neural networks as compared to other modern networks we have read in this series. In the next lecture, we will discuss another modern neural network.

Capsule Neural Network: Definition, Features, Algorithms, Applications

Hey pupil! Welcome to the next lecture on modern neural networks. I hope you are doing great. In the previous lecture, we saw the EffcientNet neural network, which is a convolutional Neural Network (CNN), and its properties. Today, we are talking about another CNN network called the capsule neural network, or CapsNets. These networks were introduced to provide the capsulation in CNNs to provide better functionalities. 

In this article, we will start with the introduction of the capsule neural network. After that, we will compare these with the traditional convolutional neural networks and learn some basic applications of these networks. So, let’s start learning.

Introduction to Capsule Neural Networks

Capsule neural networks are a type of artificial neural network that was introduced to overcome the limitations of CNNs. In 2017, these modern neural networks were designed by Geoffrey Hinton and his team working in the Google AI research center. 

These are some of the most popular and searched neural networks because they deal with the inefficiency of CNN in recognizing the results when the input data has different orientations. The capsule Neural networks are made by getting inspiration from the visual cortex of the human brain to process information.

The capsule neural network is one of the most prominent deep learning architectures and is widely used in fields like computer vision for processes like image classification, object detection, and segmentation. If you know about convolutional neural networks, then you must know that they are relatively difficult to process and require a great deal of information to work properly. Hence, to make the neural network more powerful, different neural networks, such as capsule neural networks and EffiecnetNet, are introduced. 

Capsule Neural Networks vs. Traditional Neural Networks

The neural networks are categorized in different ways on the basis of their arrangement of layers. Usually, the neural networks have the same structure but slightly different performance and other features. However, the workings of CapsNet are far more different from those of traditional neural networks; therefore, there is a need for a detailed study of structure and performance. Here are some key features of Capsule neural networks that make them different from other traditional neural networks:

Capsules of Neurons

The name clearly specifies the difference in the workings of this neural network. These are different because the basic building block of Capsnets is the capsule of the neuron. Unlike traditional neural networks, where the neurons are the basic building blocks, CapsNet has a group of neurons (capsule) as the basic building block.  Hence, we define the capsule as:

A capsule in the Capsule neural network is the group of neurons that efficiently encodes the features of the images, such as position, orientation, and size.

These features are called the pose of the images and are important in the working of neural networks, especially when networks are specialized for image recognition and related fields.

Feature Hierarchy

The most prominent difference to discuss is the structure of the capsule neural network. The capsules are arranged in the form of a hierarchy, where each capsule is responsible for extracting information of a specific type at the given level of abstraction. 

The traditional neural networks are arranged in the form of a flat hierarchy, which causes limitations in their working. Capsule neural networks have complex relationships among the features, and therefore, better results can be extracted from the calculations. 

Dynamic Routing Algorithm

A main difference between traditional and capsule neural networks is the dynamic routing mechanism, which is the main power behind the success of this neural network. It is called dynamic routing because it determines the relationship between the adjacent layer and capsule. As a result, the details of the features in the image are effectively determined.

Dynamic routing is helpful in recognizing objects at varying points and angles because capsules reach a consensus on the representation and presence of the properties of the data entity. This is different from traditional neural networks, where the weights are assigned to every neuron, and as a result, these produce the results needed to extract the information. 

Pose Estimation in CapsNets

The way CapsNets recognize the images is up to par because these not only identify the objects but can also identify the poses and angles of the images. In this way, they can recognize the images even if the orientation of the images changes. This is the basic working of the CapsNets. 

On the other hand, traditional neural networks require a great deal of data to recognize the images at a certain point, and there are errors when the image alignment is changed. Hence, the CapsNets require less data and provide more efficiency with the help of pose estimation. 

This feature helps to regenerate the responses with the novel viewpoint even if the images are deformed. Traditional neural networks are not able to explicitly model pose information. These require extensive data arguments and a large variety of information in the form of datasets. 

Computational Complexity of CapsNets

The CapsNets are arranged in the form of capsules, which enhances the complexity of the network. No doubt, the results obtained are more efficient, but the complexity level of CapsNet is higher than that of traditional neural networks. The capsules are connected in multiple layers, and to deal with them, multiple iterations are required. 

Dynamic routing is responsible for the transfer of the output of one capsule to the next capsule in the interconnected layer in a specific pattern. The mechanism of dynamic routing is more expensive. 

Interpretable Representations of Results

Another advantage of using CapsNets is its interpretable representation of the results. It can be defined as:

“The interpretable representation of the neural network is its ability to disentangle the representation of the output of the learned features.”

The results of the CapsNets are interpretable and, therefore, more understandable. It provides semantically understandable outputs. As a result, these serve as a bridge between the complex outputs of neural networks and human understandable results. 

Pooling layers in Capsule Network

The pooling layer is a special type of layer in the neural network that is responsible for the reduction of the dimensions of a feature map. It is done with the help of downsampling. In the case of capsule neural networks, there are no pooling layers; instead, the same functionality is accessed with dynamic routing. As a result, the capsule network shows state-of-the-art output for the images. 

Part-whole Relationships in CapNets

The part-whole relationship in neural networks is the connection between different parts of the same object. For instance, there is a part-whole connection between the table and the areas where different legs are connected to the flat board to make a table.

It is an important feature in fields like computer vision for processes like object detection, image segmentation, etc. In CapsNet, the part-whole relationship is strong and powerful because these use vectors to encode the pose of objects in an image. On the other hand, traditional CNN uses pooling layers for the same purpose, and it is difficult to get information about part-whole relationships.

Keeping all these differences in mind, we have created a tale for you to quickly review the difference between these layers:


Feature

Traditional Neural Network

CapsNets

Building Block

Neuron

Capsule (Group of neurons)

Layer Connection

Static

Dynamic

Computational complexity

Less

More

Efficacy of data

Less

More

Maturity

More

Less

Hierarchy Type

Flat

Interconnected

Feature Mapping

Pooling Layer

Dynamic Routing

Part-whole Relationship

Pooling layer

Vectors


Applications of CapsNet

The capsule neural network has various applications in multiple departments. There is a lot of detail about each of them, but we have set out a simple list of applications for you. Here is it:

Computer Vision

In the field of computer vision, there is a great deal of interest in capsule neural networks because they provide the best output in different orientations. The features of CapsNets are helpful in areas like image recognition, face recognition, medical imaging, etc.

Natural Language Processing

Natural language processing requires neural networks that can subdivide the input in different ways. The capsule neural network helps in the processes of document classification and sentimental recognition. 

Robot and Automation Industry

The industry of robotics and its automation require the most efficient ways to teach object recognition to robots. The highly efficient mechanism of the capsule network is perfect for fields like robotics and automation. It helps with object manipulation and visual SLAM in the mentioned industries.

Hence, the capsule neural network is an important type of modern neural network that helps get image-related outputs more efficiently. These are made of capsules of neurons instead of using them singularly. Moreover, the hierarchy and routing systems help the users get the t output. We have seen multiple features of this neural network that are useful and better than the traditional neural network. However, these are more complicated to deal with, but overall, there are multiple applications of capsule neural networks. If you want to know more about modern neural networks then stay with us 9n the next session.

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir