Abstract
Representation learning on graphs has become a cornerstone of network analysis, yet traditional methods often struggle with the complexity of heterogeneous networks. This paper introduces edge2vec, a novel framework designed to learn node embeddings by explicitly modeling edge semantics. By employing an Expectation-Maximization (EM) framework to optimize an edge-type transition matrix, edge2vec captures the nuanced relationships inherent in multi-typed graphs. Evaluated on a massive biomedical knowledge graph, edge2vec demonstrates significant performance gains over state-of-the-art baselines in tasks such as bioactivity prediction and entity classification.
Introduction
Most graph embedding techniques, such as DeepWalk and node2vec, were originally developed for homogeneous networks where all nodes and edges are of a single type. However, real-world domains—particularly biomedicine—are inherently heterogeneous. A typical biomedical knowledge graph includes diverse entities (e.g., genes, drugs, diseases) connected by various relationship types (e.g., "inhibits," "causes," "binds").
Standard approaches often "flatten" these graphs, ignoring the rich semantic information embedded in the edge types. While metapath-based models like metapath2vec attempt to address this, they rely on manually defined sequences of node types, which can be labor-intensive and may fail to capture complex, data-driven patterns. edge2vec addresses these limitations by automatically learning the importance of edge semantics directly from the network structure.
Methodology: The edge2vec Framework
The core innovation of edge2vec is its ability to navigate a heterogeneous graph using a learned, semantically-aware transition strategy. The process is divided into three primary components: the transition matrix, the EM optimization framework, and skip-gram embedding.
1. The Edge-Type Transition Matrix ($M$)
Unlike standard random walks that choose neighbors with uniform probability, edge2vec utilizes a transition matrix $M$. This matrix defines the probability of moving from one edge type to another, allowing the walker to follow paths that are semantically meaningful within the specific domain.
2. The Expectation-Maximization (EM) Framework
To optimize $M$ without manual intervention, the authors employ an EM approach:
- E-step: The model generates random walks across the graph based on the current state of the transition matrix.
- M-step: The model analyzes these walks to identify edge types that frequently co-occur. Using Pearson correlation and a Sigmoid function, it updates $M$ to favor transitions between semantically related relationships.
3. Skip-gram Embedding
Once the transition matrix is optimized, a final set of "semantically aware" random walks is generated. These walks serve as the input for a standard skip-gram model (similar to word2vec), which produces low-dimensional node embeddings. By biasing the walks according to learned edge semantics, nodes with similar functional roles are mapped closer together in the embedding space.
Experimental Evaluation
The model was rigorously tested on Chem2Bio2RDF, a large-scale biomedical knowledge graph containing approximately 296,000 nodes and 728,000 edges across 10 node types and 12 edge types.
Key Results
edge2vec was compared against several baselines, including DeepWalk, LINE, node2vec, and metapath2vec. The results highlight the superiority of edge-centric learning:
- Entity Multi-classification: edge2vec achieved an F1-score of 0.75, significantly outperforming the best baseline (LINE at 0.62).
- Bioactivity Prediction: In predicting drug-target interactions, the model reached an AUROC of 0.89, compared to node2vec (~0.78) and metapath2vec (~0.53).
- Clustering: PCA visualizations demonstrated that edge2vec effectively clustered genes into their respective functional families (e.g., ABC transporters), a task where other models showed significant overlap and confusion.
Discussion and Future Work
The success of edge2vec underscores that in knowledge graphs, the relationship is as informative as the entity. By treating edges as first-class citizens, the model automatically discovers the underlying logic of the domain. Furthermore, the transition matrix helps normalize skewed data, ensuring that rare but critical biological relationships are not overshadowed by more frequent ones.
Future research directions include refining the negative sampling strategy in the skip-gram phase (e.g., using node-type based sampling) and exploring ways to integrate prior domain knowledge to "seed" the EM process. While the iterative nature of EM introduces some computational overhead, the resulting gains in embedding quality make it a powerful tool for complex network analysis.
Summary updated