Unraveling the Power of Graph Neural Networks (GNNs): From Social Networks to Drug Discovery

Ankush Das
6 min readMar 15, 2024

--

Super Mario Bros. (c. Nintendo)

Introduction:

Picture this: you’re navigating Mario through the Mushroom Kingdom, jumping over obstacles, dodging pesky Goombas, and collecting coins like there’s no tomorrow. It’s a world filled with interconnected challenges and hidden secrets, much like the complex web of relationships in real-life data. Now, while Mario may not be a data scientist, he unwittingly demonstrates the essence of Graph Neural Networks (GNNs) — maneuvering through interconnected nodes and edges to achieve his objectives. Understanding and analyzing these complex networks is no easy task for traditional machine learning algorithms. However, with the advent of Graph Neural Networks (GNNs), a new era of deep learning has dawned, offering unprecedented capabilities to decipher the intricacies of interconnected data structures. Let’s unravel the power of GNNs, exploring their architectures, applications, recent advancements, and real-world impact across diverse domains.

GNN (image credit: DataCamp)

Understanding Graph Neural Networks (GNNs):

At its core, a graph is a mathematical abstraction used to represent relationships between entities. Nodes represent entities, while edges denote connections or interactions between them. Now, imagine you’re exploring a social network like Facebook or Twitter. Each user is a node, and connections between users represent friendships or interactions. GNNs are designed to learn meaningful representations for each node in such graphs by aggregating information from neighboring nodes. This process enables GNNs to capture complex dependencies and structural properties, much like how we understand social dynamics by observing interactions between individuals.

Let 𝐺 = (𝑉, 𝐸) represent a graph, where 𝑉 is the set of nodes and 𝐸 is the set of edges. Each node 𝑣ᵢ in the graph is associated with a feature vector 𝐱ᵢ. The goal of a GNN is to learn a mapping function 𝑓: 𝐺 → ℝᵈ, where 𝑑 is the dimensionality of the learned node representations.

The message passing algorithm in GNNs can be formulated as follows:

where 𝐡ᵢ⁽ˡ⁾ is the representation of node 𝑖 at layer 𝑙, 𝒩(𝑖) is the neighborhood of node 𝑖, 𝐖⁽ˡ⁾ is the weight matrix at layer 𝑙, 𝜎 is the activation function, and c_{𝑖𝑗} is a normalization constant.

Architecture of Graph Neural Networks:

Picture yourself at a bustling intersection, observing the flow of traffic and pedestrians. Similarly, GNNs operate by iteratively passing messages between nodes, much like pedestrians exchanging information at a busy junction. Each layer of a GNN performs message passing and aggregation operations, updating node representations based on information from neighboring nodes. Think of it as nodes exchanging insights about their surroundings, collectively building a richer understanding of the entire graph. Common architectures like Graph Convolutional Networks (GCNs) and Graph Attention Networks (GATs) leverage these principles to model complex relationships effectively.

A typical GNN architecture consists of multiple layers, each performing message passing and feature aggregation operations. The final node representations are obtained by aggregating information from neighboring nodes across multiple layers. Mathematically, the forward pass of a GNN can be represented as:

𝐇⁽ˡ⁺¹⁾ = 𝜎 (𝐀 ⋅ 𝐇⁽ˡ⁾ ⋅ 𝐖⁽ˡ⁾ )

where 𝐇⁽ˡ⁾ is the matrix of node representations at layer 𝑙, 𝐀 is the adjacency matrix of the graph, 𝐖⁽ˡ⁾ is the weight matrix at layer 𝑙, and 𝜎 is the activation function applied element-wise.

Training Graph Neural Networks:

The training process of GNNs involves optimising a loss function that measures the discrepancy between the predicted node representations and the ground truth labels or targets. Common loss functions include mean squared error (MSE) for regression tasks and cross-entropy loss for classification tasks. The parameters of the GNN are updated using gradient descent optimization algorithms such as stochastic gradient descent (SGD) or Adam.

Applications of Graph Neural Networks:

1. Social Network Analysis:

Social networks, with users as nodes and connections representing interactions, offer a rich source of relational data. GNNs excel in analyzing social networks by:

  • Link Prediction: Predicting the likelihood of connections between nodes using graph-based features and learned representations. Mathematically, this can be represented as:
  • P(yij​=1∣xi​,xj​)=σ(xi⊤​xj​)
  • where y_ij​ denotes the presence of a connection between nodes i and j, x_i​ and x_j​ are the feature vectors of nodes i and j respectively, and σ is the sigmoid function.
  • Community Detection: Identifying densely connected subgraphs or communities within the network. GNNs can cluster nodes based on learned representations and graph structure, facilitating community detection algorithms such as Louvain or Girvan-Newman.
  • Influence Maximization: Identifying influential nodes or users within the network whose actions have a significant impact on others. GNNs can learn node embeddings that capture centrality and influence metrics, aiding in targeted marketing or content promotion strategies.

2. Drug Discovery and Molecular Biology:

GNNs offer powerful tools for analyzing molecular structures and predicting properties relevant to drug discovery:

  • Molecular Property Prediction: Predicting molecular properties such as solubility, bioactivity, or toxicity using graph-based representations of chemical compounds. GNNs can learn to encode molecular structures into latent representations and predict properties using regression or classification models.
  • Protein Interaction Prediction: Modeling protein-protein interactions as graphs and predicting binding affinities or functional relationships between proteins. GNNs can capture structural and sequence features of proteins and learn to predict interactions based on learned representations.
  • Drug Repurposing: Identifying existing drugs that may be effective for treating new diseases or conditions by analyzing similarity networks of drugs and diseases. GNNs can leverage graph-based representations to recommend potential drug candidates for repurposing based on shared biological pathways or targets.

3. Urban Planning and Transportation Systems:

GNNs offer insights into optimizing transportation networks and urban infrastructure:

  • Traffic Flow Prediction: Forecasting traffic congestion and flow patterns in road networks using historical traffic data. GNNs can model spatiotemporal dependencies in traffic flow and predict future congestion hotspots or travel times.
  • Route Optimization: Finding optimal routes for commuters or vehicles in transportation networks considering factors such as traffic volume, road conditions, and public transit schedules. GNNs can learn to compute shortest or fastest routes by incorporating graph-based representations of the network and optimizing routing algorithms.
  • Infrastructure Planning: Analyzing urban infrastructure networks, including roads, public transit systems, and bike lanes, to inform decisions on infrastructure development and expansion. GNNs can identify areas with high demand for transportation services and prioritize investments in infrastructure projects based on predicted future demand and usage patterns.

4. E-commerce and Recommendation Systems:

GNNs revolutionize personalized recommendations and product discovery in e-commerce platforms:

  • Personalized Recommendations: Generating personalized product recommendations for users based on their browsing history, purchase behavior, and preferences. GNNs can model user-item interactions as a bipartite graph and learn to predict preferences or interests using graph convolutional layers.
  • Contextual Recommendations: Recommending products tailored to users’ context, such as location, time of day, or device type. GNNs can incorporate contextual features into the graph representation and adapt recommendations dynamically based on contextual signals.
  • Cross-Selling and Upselling: Identifying related or complementary products within the product graph and suggesting cross-selling or upselling opportunities to users. GNNs can learn to predict associations between products and recommend additional items that complement users’ purchases, increasing sales and customer satisfaction.

Conclusion:

Graph Neural Networks offer a versatile framework for analyzing and extracting insights from relational data structures across diverse domains. From social networks to drug discovery, transportation planning, and e-commerce, GNNs empower organizations and researchers to tackle complex challenges and drive innovation. By harnessing the power of GNNs, we can unlock new opportunities for progress and create smarter, more efficient systems that enhance our lives and communities.

--

--

Ankush Das
Ankush Das

Written by Ankush Das

Ankush is a pre-final year CSE Undergrad with specialisation in AI and Machine Learning. Beside of studies and all, he likes to write blog on Machine Learning.

No responses yet