Glossary term

Graph Neural Network

What Are Graph Neural Networks? 

Neural networks do an excellent job of identifying relationships between data, but that doesn’t mean that every type of neural network works equally well with every data set. For the sake of both efficiency and accuracy, data scientists develop different neural networks for specific types of data. Graph neural networks (GNNs) are a type of deep learning model used to make inferences about data described by graphs. 

So, what is a graph in computer science? A graph is a non-linear, abstract data structure consisting of nodes that are connected by edges. The point where the two lines, or edges, meet is the node of the graph, and the edges branching off represent relationships between that node and others connected to it. 

A representation of a GNN diagram (Source: Techslang)

You could use a graph data structure to describe connections in a social network, such as LinkedIn. Each node would represent a user, and it would contain information about that user, such as where they work and their profession. Each edge branching off from the node represents that user’s connection with other users. These users would also have their own edges representing their respective connections and so forth.  

A graph neural network can perform inferences on these kinds of complex data structures. 

Why Are GNNs so Important? 

For machine learning models to analyze data, the data has to be organized in a format the model can understand. For example, in speech recognition, the relationship between pieces of data is linear, and convolutional neural networks (CNNs) are effective at analyzing this kind of linear data. 

But, graphs are different. They’re more complex than other data structures, so they need a different kind of neural network to perform inferences on their data.  

This is where GNNs come into play—they’re designed to make inferences on inherently complex graphs. 

How GNNs Make Inferences 

GNNs are designed to factor all the information stored within each node, as well as the data within each of the nodes that node is connected to, and the data within the edges, or connections between, the connected nodes. 

For example, suppose a political candidate is running for office, and they want to figure out how well they’re going to do versus the opposing party’s candidate in a town in Idaho. At least 90% of the people in that town have a profile on Facebook. The candidate’s team has gathered the following data: 

Using a GNN, the candidate’s team could come up with a metric that represents the potential impact of these social connections. More specifically, each person would be represented by a node, and their connections would be represented by edges. Data about each individual would be associated with their node, and data about their connections would be associated with the edges that connect them. 

A GNN could then process all this data and make inferences about how each person will vote based on their relationship data. Granted, this data would have to be correlated with other information, but since many people associate with those who vote for the same party, it could produce a useful metric. And, a GNN can do a good job of handling the complexity of the node and edge data. 

Benefits of GNNs 

GNNs benefit any deep learning model where the relationships between nodes is non-linear or lacks consistent spatial coefficients. 

Some of the benefits of GNNs include: 

How does a GNN deliver these benefits? You can think of the kind of data structure a GNN can make inferences about like a series of spider webs, each made by different spiders. For example, while CNNs can do a good job of powering deep learning models that analyze language, GNNs can take it to another level. A GNN-powered deep learning model would be able to help a robot choose the most appropriate synonym for a word while engaging in a conversation, depending on the audience’s age, education level, etc. 

GNN Use Cases 

GNNs can be used to analyze graphical data structures in an unlimited range of industrial and practical applications, specifically because it’s not limited to linear or predictable arrangements of nodes. 

GNNs are already being used to address important challenges faster than humans could on their own. Here are a few examples. 

Diagnosing Illness 

When a doctor sits down with a patient, they ask questions about symptoms, when they occurred, personal medical history, and familial medical issues. After collecting this data, the doctor is better equipped to deliver an accurate diagnosis. GNNs are being used to analyze these and other factors to either verify a doctor’s conclusion or present an alternative diagnosis. 

Streamlining Construction & Building 

GNNs can automatically generate architectural plans, deciding the correct placements of walls and ceilings. They can account for the positions of electrical and plumbing connections as well as local building codes in their decisions. While this still requires a human in the loop, the use of GNNs ensures that architects and construction workers have a solid, informed blueprint to start with. 

Improving Renewable Energy Systems 

GNNs can choose the best possible catalysts to assist with renewable energy storage systems. Using GNNs, the Ulissi Group at Carnegie Mellon University is studying the chemical compositions of catalysts to figure out better ways to store renewable energy. The GNNs they use improve the efficiency of the many calculations needed to discover the best possible solutions. How do the GNNs do this?  

Mapping the makeup of molecules is very straightforward using graphical data structures: Each atom is a node and the covalent bonds between them are edges. Of course, not all atoms and molecules play well together, but the conditions under which they can bond—and the stability of the result—can be inputted into the GNN-powered learning model. With this data, the model can tell researchers which combinations best support the energy storage process. 

Leveraging the Power of GNNs 

The potential for GNNs across a wide array of industries grows daily as data scientists tackle data sets with complex, graphical relationships. Whether it’s in the healthcare, energy, or manufacturing sectors, the sky is the limit for GNNs. 

Are you interested in leaning how to get your machine learning projects from conception to reality? Check out our Human’s Guide to Machine Learning Projects for step-by-step advice. 

Related Resources