Structure-Preserved Heterogeneous Graph Representation
local graph
Chapter 3 — Structure-Preserved Heterogeneous Graph Representation
Section titled “Chapter 3 — Structure-Preserved Heterogeneous Graph Representation”Abstract Heterogeneous graph (HG) contains various types of nodes or links, which are highly correlated and present intricate structures due to different links. These structures reflect the crucial factors of topology. Therefore encoding meaningful structures is a basic requirement to obtain node representations with high quality. So far, some representative structures have been studied in an HG, from one-hop edges to high-order local structures, such as meta-paths and network schema. In this chapter, we will introduce several works focusing on structure preservation. By capturing respective structures, they successfully depict the rich semantics and complex heterogeneity, and effectively support downstream tasks.
3.1 Introduction
Section titled “3.1 Introduction”One basic requirement of graph representation learning is to preserve the graph structure properly. A lot of early works focus on the structural preservation of homogeneous graph representation learning, which focus on how to maintain the second-order [44], higher-order [3], and community structure [47] in homogeneous graphs, and therefore have achieved good results in downstream tasks such as node classification and link prediction. Compared with homogeneous graphs, there are more challenges in maintaining structural information for heterogeneous graphs (HGs), because the latter contain multiple types of nodes and multiple relations among nodes.
Traditional heterogeneous graph modeling often uses meta-paths [39] to measure the structural similarity of nodes. However, these meta-path based methods cannot calculate the similarity of nodes without meta-path connections, which greatly limits the application scenarios of these methods. Inspired by homogeneous graph representation learning methods, many heterogeneous graph representation learning methods have recently been proposed, and the latent heterogeneous network embeddings have been further applied to various network mining tasks, such as node classification [18], clustering [38, 41], and similarity search [40, 59]. In contrast to conventional meta-path based methods [39], the advantage of latent-
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2022 C. Shi et al., Heterogeneous Graph Representation Learning and Applications, Artificial Intelligence: Foundations, Theory, and Algorithms, https://doi.org/10.1007/978-981-16-6166-2_3
ace representation learning lies in its ability to model structural similarities between nodes without connected meta-paths.
In this chapter, we will introduce several representative works which preserve structural information in node representations. In Sects.3.2 and 3.3, we will introduce a Heterogeneous graph Embedding based Recommendation model named HERec) [37] and a Neural network-based Aspect-level Collaborative filtering model (named NeuACF) [11], which combine meta-path with two classic heterogeneous graph representation learning methods separately, that is, skip-gram algorithm and attention-based deep neural network. In Sect. 3.4, we will introduce a relation-structure aware Heterogeneous Information Network Embedding model named RHINE) [23], which divides the relations in heterogeneous graphs into two categories based on mathematical analysis, thereby modeling the structural information in the heterogeneous graphs in a more fine-grained manner. In Sect. 3.5, we will introduce a novel Network Schema preserving Heterogeneous graph Embedding method (named NSHE) [62], which uses the network schema, that is, the meta template of the heterogeneous graph, to model the structure information more completely, and get rid of the dependence on the hand-designed meta-paths.
3.2 Meta-Path Based Random Walk
Section titled “3.2 Meta-Path Based Random Walk”3.2.1 Overview
Section titled “3.2.1 Overview”In a graph, there exist many kinds of structures to depict the different relations between nodes, where neighborhood structure, describing the local structure of a node, is an important one. How to appropriately reserve the neighborhood structure in node representations is a fundamental problem. To solve the problem, a typical technique usually used is random walk, which is a process that starts from a target node and randomly chooses a neighbor of the last node as the current one [10, 28]. By exploiting this mechanism, multiple random sequences for nodes are generated, and each describes a local structure over original graph. We can view each sequence as a sentence, and nodes in the sequence as words. In this way, word2vec-based framework proposed in natural language processing (NLP) is adopted to learn node representations, which captures the proximity between neighbor nodes in a window with fixed size.
However, these works focus on representation learning for homogeneous graph, only considering singular type of nodes and relationships. In the field of HG, it is a challenge to effectively combine random walk strategy with complex heterogeneity to capture the local semantic structure. To tackle the challenge, HG Embedding based Recommendation (named HERec) [37] designs a novel mechanism to perform random walk along meta-paths, also called meta-path based random walk, considering that meta-paths are sufficient to depict rich semantics.
Different from random walk in homogeneous graph, HERec constrains generated node sequence aligned with pre-defined meta-path. For example, for a meta-path Author–Paper–Author (APA), if type of the last selected node i is A, then HERec chooses a neighbor of i with type P. The objective of HERec is to simultaneously learn representations of multiple types of nodes and preserve both the structures semantic of a given HG. Due to its effectiveness, HERec, combined with classic matrix factorization framework, is also applied in recommender systems. A basic recommender system usually consists of users and items and aims to help users discover latent items of interest. By the designed framework, HERec effectively extracts semantic and local information from interactions between users and items, and gives a good performance in downstream tasks.
3.2.2 The HERec Model
Section titled “3.2.2 The HERec Model”3.2.2.1 Model Framework
Section titled “3.2.2.1 Model Framework”In this section, we provide more details about HERec here. Specifically, HERec is designed for the HG in a recommender system, which consists of two major components. The first part is to learn user/item embeddings from HG, namely HG embedding (Fig. 3.1b). The second part is to involve the learnt embeddings into classic matrix factorization framework, namely recommendation (Fig. 3.1c). Next, we will present detailed illustration of HERec.
3.2.2.2 Heterogeneous Graph Embedding
Section titled “3.2.2.2 Heterogeneous Graph Embedding”Given an HG , the goal is to learn a low-dimensional embedding for each node , which is much easier to be used and integrated in subsequent procedures, compared with meta-path based similarity. Inspired by deepwalk [28], well-known embedding method for homogeneous graph, HERec designs a novel random walk mechanism over HG to learn embeddings.
[!visual-conversion] Scan-verified against
assets/pages/page-035.png. Panel (a) is a small bipartite-style user–movie–genre graph (users Tom, Marry, Bob; movies The Terminator, Cameron, Avatar; genres Action, Sci-fi) with rating edges. Panel (b) shows meta-path based random walks over that graph being transformed and fused into per-node embeddings e(1)…e(V). Panel (c) shows those embeddings feeding a matrix-factorization recommender R ≈ X·Y over the user–movie rating matrix.
flowchart LR
subgraph a["(a) Example of HIN"]
Tom((Tom)) -->|rates| Term[The Terminator]
Tom -->|rates| Avatar[Avatar]
Marry((Marry)) -->|rates| Term
Marry -->|rates| Cameron[Cameron]
Bob((Bob)) -->|rates| Avatar
Bob -->|rates| Cameron
Term --> Action[Action]
Avatar --> Scifi[Sci-fi]
Cameron --> Action
Cameron --> Scifi
end
subgraph b["(b) HIN embedding"]
RW["b1: Meta-path based random walk"] --> TF["b2: Transform and fuse"]
TF --> E1["e(1)"]
TF --> Edots["..."]
TF --> EV["e(V)"]
end
subgraph c["(c) Recommendation"]
MF["R (User x Movie ratings) ≈ X x Y"]
end
a --> b --> c
Fig. 3.1 The schematic illustration of the proposed HERec approach. (a) An example of HIN (HG). (b) HIN (HG) embedding. (c) Recommendation
Meta-Path Based Random Walk To capture the complex heterogeneity, meta-path is usually adopted to characterize the semantic patterns for HGs [39]. Therefore, HERec also employs a meta-path based random walk method to generate node sequences. Given a heterogeneous graph and a meta-path , the walk path is generated according to the following distribution:
where is the -th node in the walk, the type of is , is the object type mapping function, and is the first-order neighbor set for node with the type of . A walk will follow the pattern of a meta-path repetitively until it reaches the pre-defined length.
Example 1 We still take Fig. 3.1a as an example, which represents a movie recommender system. Given a meta-path , we can generate two sample walks (i.e. node sequences) by starting with the user Tom: (1) Tom The Terminator Mary, and (2) Tom Avatar Bob The Terminator Mary. Similarly, given the meta-path , we can also generate another node sequence: Tom The Terminator Cameron Avatar Mary. It is intuitive to see that these meta-paths can lead to meaningful node sequences corresponding to different semantic relations.
Type Constraint and Filtering Consider that in recommendation, only user and item should be more emphasized than other types of nodes. So, only meta-paths starting with user type or item type are selected. To further strengthen user and item, other types of nodes that are different from the starting type will be filtered out from the generated node sequences. In this way, the final sequences only contain one type of nodes (i.e. user of item). Here are two advantages. First, there is only one type, which relaxes the challenging goal of representing all the heterogeneous objects in a unified space. Second, given a fixed-length window, a node is able to utilize more homogeneous neighbors that are more likely to be relevant than others with different types.
Example 2 As shown in Fig. 3.2, only the meta-paths starting from user type or item type are derived, such as , , and . Take the meta-path of as an instance. We can generate a sampled sequence “” according to Eq. 3.1. And then, we remove the movies and finally obtain a homogeneous node sequence “”.
[!visual-conversion] Scan-verified against
assets/pages/page-037.png. The figure walks through three meta-paths (UMU, UMDMU, MDM) over a small user–movie–director graph, then shows how walks are filtered down to nodes of a single starting type.
User Movie Directoru1 ─┐ ⊗ m1 ─ d1 UMU: u1 m1 u2 m2 u3 m2 u4 ... --filter--> u1 u2 u3 u4 ...u2 ─┘u3 ─┐ ⊗ m2 ─ d2 UMDMU: u1 m1 d2 m2 u3 ... --filter--> u1 u3 ...u4 ─┘u5 ─┘ m3 ─ d3 MDM: m1 d2 m2 d3 m3 ... --filter--> m1 m2 m3 ...Fig. 3.2 An illustrative example of the proposed meta-path based random walk. First perform random walks guided by some selected meta-paths, and then filter out nodes of types that are different from the starting type
After this step, the next focus will be how to learn effective embeddings for nodes in sequences.
Optimization Objective Given a processed node sequence, HERec defines the neighborhood for node based on co-occurrence in a fixed-length window in the sequence, denoted as . Following node2vec [10], the final embeddings of nodes are learnt by optimizing the following objective:
where is a function mapping each node to -dimensional embedding space. measures probability of ‘s neighbors given ‘s embedding. The embedding mapping function is trained by utilizing stochastic gradient descent (SGD). A major difference between previous method [7] and HERec lies in the construction of , where HERec selects homogeneous neighbors using meta-path based random walks.
Embedding Fusion For one meta-path and corresponding node sequence, after optimizing via Eq. 3.2, given a node , we can obtain its embedding based on meta-path . In a similar way, we can obtain a set of embeddings , where denotes the set of meta-paths. Then, we propose to use a general function , which aims to fuse the learnt node embeddings to get and for users and items, respectively:
There are three fusion functions that can be used to fuse these embeddings. We scuss the cases for users below. The functions for items are similar and can be derived accordingly.
- Simple linear fusion. We simply average the results from different meta-paths after transforming the embeddings with MLP.
where and are the transformation matrix and bias vector w.r.t. the -th meta-path.
- Personalized linear fusion. We further assign each user with a weight vector on the meta-paths, representing the user’s personalized preference for each meta-path.
where is the learnt preference weight of user over the -th meta-path.
- Personalized non-linear fusion. Moreover, we use non-linear function to enhance the fusion ability.
where is a non-linear function, i.e., sigmoid function or others.
Among the three fusion strategies, HERec demonstrates that personalization and non-linearity are essential for boosting the results. The parameters involved in are optimized together with the recommendation model, which is introduced in the next section.
3.2.2.3 Integrating Matrix Factorization with Fused HG Embedding for Recommendation
Section titled “3.2.2.3 Integrating Matrix Factorization with Fused HG Embedding for Recommendation”Rating predictor is a component used to predict the ratings of the users on the items. In MF, the rating of a user on an item is simply defined as follows:
where and denote the latent factors corresponding to user and item by factorizing the user-item rating matrix. Since we have also obtained the embeddings for user and item , we can further incorporate them into the rating predictor as below:
where and are user-specific and item-specific latent factors to pair with the HG embeddings and respectively, and and are the tuning parameters to integrate the three terms.
The overall objective is formulated as follows:
where is the predicted rating using Eq.3.8 by HERec, is the regularization parameter, and and are the parameters of the function for users and items, respectively. SGD is utilized to efficiently train HERec.
3.2.3 Experiments
Section titled “3.2.3 Experiments”3.2.3.1 Experimental Settings
Section titled “3.2.3.1 Experimental Settings”Datasets Three real datasets are used to perform downstream tasks, consisting of Douban Movie dataset from the movie domain, Douban Book dataset from the book domain, and Yelp dataset from the business domain. The detailed descriptions of the three datasets are shown in Table 3.1. It should be pointed out that these three datasets also have different rating sparsity degrees: The Yelp dataset is very sparse, while the Douban Movie dataset is much denser.
Baselines To demonstrate the effectiveness, HERec is compared with three categories of baselines: classic MF based rating prediction methods , and HG based recommendation methods . Moreover, there are two variants of HERec: HERec and HERec, where the difference is the way of random walk during generating node sequences. The former adopts deepwalk [28] to obtain
[1] http://movie.douban.com. [2] http://book.douban.com. [3] http://www.yelp.com/dataset-challenge.
le embeddings, which ignores the heterogeneity of nodes. The later employs r iapath2vec++ [7] to generate node embeddings, which does not filter out ifferent types of nodes.
3.2.3.2 Effectiveness Experiments
Section titled “3.2.3.2 Effectiveness Experiments”In this experiment, we set different training ratios for each dataset, and use MAE and RMSE as metrics to evaluate the performance. We set the embedding dimension as 64 and randomly run experiments 10 times and report the average results shown in Table 3.2. Notice that, HERec adopts the personalized non-linear fusion function here.
From the results, we can draw the following conclusions: (1) HERec is consistently better than other baselines because it provides better information extraction (a new HGs embedding model) and utilization (an extended MF model). (2) HG based methods, especially , perform better than traditional MF based methods, which indicates the usefulness of the heterogeneous information. (3) On one hand, compared with , performs much worse, which indicates HG embedding methods are important to HG based recommendation again. On the other hand, HERec outperforms , which demonstrates that it is more effective to perform task-specific HG embedding for improving the recommendation performance (e.g. only focus on user and item).
3.2.3.3 Cold-Start Prediction
Section titled “3.2.3.3 Cold-Start Prediction”Now, we check the performances of all the methods in cold-start prediction settings, where there are fewer rating records but heterogeneous context information is available. First according to the counts of users’ rating records, they are divided into three groups, i.e. (0, 5], (5, 15], and (15, 30]. It is easy to see that the case for the first group is the most difficult, since users from this group have fewest rating records. Here, HERec is only compared with HG based recommendation, including SoMF, HeteMF, SemRec, DSR, and , and the results are shown in Fig. 3.3, which reports the improvement ratios w.r.t. PMF. Overall, all the comparison methods are better than PMF (i.e., show positive y-axis values). Moreover, HERec performs the best among all the methods, and the improvement over PMF becomes more significant for users with fewer rating records. The results indicate that HG based information is effective to improve the recommendation performance, and HERec can effectively utilize HG information in a more principled way.
The more detailed method description and experiment validation can be seen in [37].
[!visual-conversion] Table 3.1 (printed p. 37) scan-verified and corrected: OCR had misaligned columns and fabricated meta-path labels. Corrected against
assets/pages/page-041.png.
Table 3.1 Statistics of the three datasets
| Dataset (Density) | Relations (A–B) | Number of A | Number of B | Number of (A–B) | Ave. degrees of A | Ave. degrees of B | Meta-paths |
|---|---|---|---|---|---|---|---|
| Douban Movie (0.63%) | User–Movie | 13,367 | 12,677 | 1,068,278 | 79.9 | 84.3 | UMU, MUM |
| User–User | 2440 | 2294 | 4085 | 1.7 | 1.8 | UMDMU, MDM | |
| User–Group | 13,337 | 2753 | 570,047 | 42.7 | 207.1 | UMAMU, MAM | |
| Movie–Director | 10,179 | 2449 | 11,276 | 1.1 | 4.6 | UMTMU, MTM | |
| Movie–Actor | 11,718 | 6311 | 33,587 | 2.9 | 5.3 | ||
| Movie–Type | 12,678 | 38 | 27,668 | 2.2 | 728.1 | ||
| Douban Book (0.27%) | User–Book | 13,024 | 22,347 | 792,026 | 60.8 | 35.4 | UBU, BUB |
| User–User | 12,748 | 12,748 | 169,150 | 13.3 | 13.3 | UBPBU, BPB | |
| Book–Author | 21,907 | 10,805 | 21,905 | 1.0 | 2.0 | UBYBU, BYB | |
| Book–Publisher | 21,773 | 1815 | 21,773 | 1.0 | 11.9 | UBABU | |
| Book–Year | 21,192 | 64 | 21,192 | 1.0 | 331.1 | ||
| Yelp (0.08%) | User–Business | 16,239 | 14,284 | 198,397 | 12.2 | 13.9 | UBU, BUB |
| User–User | 10,580 | 10,580 | 158,590 | 15.0 | 15.0 | UBCiBU, BCiB | |
| User–Compliment | 14,411 | 11 | 76,875 | 5.3 | 6988.6 | UBCaBU, BCaB | |
| Business–City | 14,267 | 47 | 14,267 | 1.0 | 303.6 | ||
| Business–Category | 14,180 | 511 | 40,009 | 2.8 | 78.3 |
Table 3.2 Results of effectiveness experiments on three datasets. A smaller MAE or RMSE value indicates a better performance. For easier interpretation, the improvement of each method w.r.t. the PMF model is also reported. A larger improvement ratio indicates a better performance. Bolded values represent the best results
[!visual-conversion] Table 3.2 (printed pp. 38–39) scan-verified and corrected: the OCR pass had dropped the FM and HERec columns and looped one caption line hundreds of times instead of transcribing the data. Rebuilt against
assets/pages/page-042.pngandassets/pages/page-043.png.
| Dataset | Training | Metrics | PMF | SoMF | FM | HeteMF | SemRec | DSR | HERec | HERec | HERec |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Douban Movie | 80% | MAE | 0.5741 | 0.5817 | 0.5696 | 0.5750 | 0.5695 | 0.5681 | 0.5703 | 0.5515 | 0.5519 |
| Improve | −1.32% | +0.78% | −0.16% | +0.80% | +1.04% | +0.66% | +3.93% | +3.86% | |||
| RMSE | 0.7641 | 0.7680 | 0.7248 | 0.7556 | 0.7399 | 0.7225 | 0.7446 | 0.7121 | 0.7053 | ||
| Improve | −0.07% | +5.55% | +1.53% | +3.58% | +5.85% | +2.97% | +7.20% | +8.09% | |||
| 60% | MAE | 0.5867 | 0.5991 | 0.5769 | 0.5894 | 0.5738 | 0.5831 | 0.5838 | 0.5611 | 0.5587 | |
| Improve | −2.11% | +1.67% | −0.46% | +2.19% | +0.61% | +0.49% | +4.36% | +4.77% | |||
| RMSE | 0.7891 | 0.7950 | 0.7842 | 0.7785 | 0.7551 | 0.7408 | 0.7670 | 0.7264 | 0.7148 | ||
| Improve | −0.75% | +0.62% | +1.34% | +4.30% | +6.12% | +2.80% | +7.94% | +9.41% | |||
| 40% | MAE | 0.6078 | 0.6328 | 0.5871 | 0.6165 | 0.5945 | 0.6170 | 0.6073 | 0.5747 | 0.5699 | |
| Improve | −4.11% | +3.40% | −1.43% | +2.18% | −1.51% | +0.08% | +5.44% | +6.23% | |||
| RMSE | 0.8321 | 0.8479 | 0.7563 | 0.8221 | 0.7836 | 0.7850 | 0.8057 | 0.7429 | 0.7315 | ||
| Improve | −1.89% | +9.10% | +1.20% | +5.82% | +5.66% | +3.17% | +10.71% | +12.09% | |||
| 20% | MAE | 0.7247 | 0.6979 | 0.6080 | 0.6896 | 0.6392 | 0.6584 | 0.6699 | 0.6063 | 0.5900 | |
| Improve | +3.69% | +16.10% | +4.84% | +11.79% | +9.14% | +7.56% | +16.33% | +18.59% | |||
| RMSE | 0.9440 | 0.9852 | 0.7878 | 0.9357 | 0.8599 | 0.8345 | 0.9076 | 0.7877 | 0.7660 | ||
| Improve | −4.36% | +16.55% | +0.88% | +8.91% | +11.60% | +3.86% | +16.56% | +18.86% | |||
| Douban Book | 80% | MAE | 0.5774 | 0.5756 | 0.5716 | 0.5740 | 0.5675 | 0.5740 | 0.5875 | 0.5591 | 0.5502 |
| Improve | +0.31% | +1.00% | +0.59% | +1.71% | +0.59% | −1.75% | +3.17% | +4.71% | |||
| RMSE | 0.7414 | 0.7302 | 0.7199 | 0.7360 | 0.7283 | 0.7206 | 0.7450 | 0.7081 | 0.6811 | ||
| Improve | +1.55% | +2.94% | +0.77% | +1.81% | +2.84% | −0.44% | +4.53% | +8.17% | |||
| 60% | MAE | 0.6065 | 0.5903 | 0.5812 | 0.5823 | 0.5833 | 0.6020 | 0.6203 | 0.5666 | 0.5600 | |
| Improve | +2.67% | +4.17% | +3.99% | +3.83% | +0.74% | −2.28% | +6.58% | +7.67% | |||
| RMSE | 0.7908 | 0.7518 | 0.7319 | 0.7466 | 0.7505 | 0.7552 | 0.7905 | 0.7318 | 0.7123 | ||
| Improve | +4.93% | +7.45% | +5.59% | +5.10% | +4.50% | +0.04% | +7.46% | +9.93% | |||
| 40% | MAE | 0.6800 | 0.6161 | 0.6028 | 0.5982 | 0.6025 | 0.6271 | 0.6976 | 0.5954 | 0.5774 | |
| Improve | +9.40% | +11.35% | +12.03% | +11.40% | +7.78% | −2.59% | +12.44% | +15.09% | |||
| RMSE | 0.9203 | 0.7936 | 0.7617 | 0.7779 | 0.7751 | 0.7730 | 0.9022 | 0.7703 | 0.7400 | ||
| Improve | +13.77% | +17.23% | +15.47% | +15.78% | +16.01% | +1.97% | +16.30% | +19.59% | |||
| 20% | MAE | 1.0344 | 0.6327 | 0.6396 | 0.6311 | 0.6481 | 0.6300 | 1.0166 | 0.6785 | 0.6450 | |
| Improve | +38.83% | +38.17% | +38.99% | +37.35% | +39.10% | +1.72% | +34.41% | +37.65% | |||
| RMSE | 1.4414 | 0.8236 | 0.8188 | 0.8304 | 0.8350 | 0.8200 | 1.3205 | 0.8869 | 0.8581 | ||
| Improve | +42.86% | +43.19% | +42.39% | +42.07% | +43.11% | +8.39% | +38.47% | +40.47% | |||
| Yelp | 90% | MAE | 1.0412 | 1.0095 | 0.9013 | 0.9487 | 0.9043 | 0.9054 | 1.0388 | 0.8822 | 0.8395 |
| Improve | +3.04% | +13.44% | +8.88% | +13.15% | +13.04% | +0.23% | +15.27% | +19.37% | |||
| RMSE | 1.4268 | 1.3392 | 1.1417 | 1.2549 | 1.1637 | 1.1186 | 1.3581 | 1.1309 | 1.0907 | ||
| Improve | +6.14% | +19.98% | +12.05% | +18.44% | +21.60% | +4.81% | +20.74% | +23.56% | |||
| 80% | MAE | 1.0791 | 1.0373 | 0.9038 | 0.9654 | 0.9176 | 0.9098 | 1.0750 | 0.8953 | 0.8475 | |
| Improve | +3.87% | +16.25% | +10.54% | +14.97% | +15.69% | +0.38% | +17.03% | +21.46% | |||
| RMSE | 1.4816 | 1.3782 | 1.1497 | 1.2799 | 1.1771 | 1.1208 | 1.4075 | 1.1516 | 1.1117 | ||
| Improve | +6.98% | +22.40% | +13.61% | +20.55% | +24.35% | +5.00% | +22.27% | +24.97% | |||
| 70% | MAE | 1.1170 | 1.0694 | 0.9108 | 0.9975 | 0.9407 | 0.9429 | 1.1196 | 0.9043 | 0.8580 | |
| Improve | +4.26% | +18.46% | +10.70% | +15.78% | +15.59% | −0.23% | +19.04% | +23.19% | |||
| RMSE | 1.5387 | 1.4201 | 1.1651 | 1.3229 | 1.2108 | 1.1582 | 1.4632 | 1.1639 | 1.1256 | ||
| Improve | +7.71% | +24.28% | +14.02% | +21.31% | +24.73% | +4.91% | +24.36% | +26.85% | |||
| 60% | MAE | 1.1778 | 1.1135 | 0.9435 | 1.0368 | 0.9637 | 1.0043 | 1.1691 | 0.9257 | 0.8759 | |
| Improve | +5.46% | +19.89% | +11.97% | +18.18% | +14.73% | +0.74% | +21.40% | +25.63% | |||
| RMSE | 1.6167 | 1.4748 | 1.2039 | 1.3713 | 1.2380 | 1.2257 | 1.5182 | 1.1887 | 1.1488 | ||
| Improve | +8.78% | +25.53% | +15.18% | +23.42% | +24.19% | +6.09% | +26.47% | +28.94% |
[!visual-conversion] Scan-verified against
assets/pages/page-044.png. Six grouped bar charts (RMSE-improvement and MAE-improvement, for Douban Movie / Douban Book / Yelp) compare SoMF, HeteMF, SemRec, DSR, FM, and HERec against PMF across four user rating-count groups: (0,5], (5,15], (15,30], and All.
| Dataset | Metric | Pattern across rating-count groups (0,5] → (5,15] → (15,30] → All |
|---|---|---|
| Douban Movie | RMSE / MAE improvement | HERec (lightest bar) has the tallest improvement bar in every group; improvement shrinks as the rating count grows |
| Douban Book | RMSE / MAE improvement | Same ordering; HERec consistently outperforms SoMF, HeteMF, SemRec, DSR, FM |
| Yelp | RMSE / MAE improvement | Same ordering; largest HERec margin in the sparsest (0,5] group |
Fig. 3.3 Performance comparison of different methods for cold-start prediction on three datasets. -axis denotes the improvement ratio over PMF. (a) Douban movie. (b) Douban book. (c) Yelp

Source scan (printed p. 40): the six grouped bar charts of Fig. 3.3 — quantitative values are not recoverable from the summary table above, so the raster is retained.
3.3 Meta-Path Based Decomposition
Section titled “3.3 Meta-Path Based Decomposition”3.3.1 Overview
Section titled “3.3.1 Overview”In the last section, an HG embedding method exploiting meta-path based random walk is introduced, which generates node sequences that follow the given meta-paths for optimizing the similarity between nodes. However, an observation is that the properties of an object in an HG may stem from different aspects due to the rich type information, which poses a challenge for heterogeneous graph representation. How to effectively extract and fuse different semantic aspect-level information plays an important role in HG representation, which is not considered thoroughly in previous random walk-based methods [7, 9, 37].
To this end, meta-path based decomposition-based techniques aim to decompose HG into several subgraphs according to different meta-paths, each representing a specific semantic aspect, and preserve the proximity of nodes in each subgraph. NeuACF (Neural network-based Aspect-level Collaborative Filtering) [11, 36] is a piece of representative work which exploits decomposition-based HG representation to learn the aspect-level representations and effectively fuse them for recommendation.
Figure 3.4 illustrates an HG composed of 3 types of nodes, which are User, Item, and Brand, and 2 types of relations, which are User–Item purchase relation and Item–Brand indicating which brand a given item belongs to. Given such an HG, we target to learn the representations of the users and items, and make item recommendation for the users. In this HG, there exist purchase-aspect and brand-aspect information which should be both effectively captured. We can learn the representations of user nodes from the aspect of purchase history with the User–Item–User path. Meanwhile, we can also learn the representations from the aspect of brand preference with the User–Item–Brand–Item–User path.
[!visual-conversion] Toy HG matching the description in the surrounding text and the original hand-drawn figure: users u1–u4, items i1–i3, brands b1–b2, with purchase edges (user→item) and branding edges (item→brand).
flowchart LR
subgraph Users
u1((u1))
u2((u2))
u3((u3))
u4((u4))
end
subgraph Items
i1[i1]
i2[i2]
i3[i3]
end
subgraph Brands
b1{{b1}}
b2{{b2}}
end
u1 -->|purchase| i1
u1 -->|purchase| i2
u2 -->|purchase| i1
u3 -->|purchase| i2
u3 -->|purchase| i3
u4 -->|purchase| i3
i1 -->|brand| b1
i2 -->|brand| b1
i3 -->|brand| b2
Fig. 3.4 A toy example of an HG with different aspect-level information
urthermore, a delicate deep network is designed to learn different aspect-level presentations and an attention mechanism is utilized to effectively fuse them for top-N recommendation. Comparing to the above method NeuACF, we further propose NeuACF++ to fuse aspect information with self-attention mechanism which considers different aspect-level representations and learns the attention values simultaneously. More details about NeuACF and NeuACF++ are given in the following subsections.
3.3.2 The NeuACF Model
Section titled “3.3.2 The NeuACF Model”3.3.2.1 Model Framework
Section titled “3.3.2.1 Model Framework”The basic idea of NeuACF is to extract different aspect-level representations for users and items, and then learn and fuse these representations with deep neural network. The model contains three major steps, the architecture of which is illustrated in Fig.3.5. First, an HG is constructed based on the rich user–item interaction information, and the aspect-level similarity matrices are computed under different meta-paths of HG which reflect different aspect-level features of users and items. Next, a deep neural network is designed to learn the aspect-level representations separately by taking these similarity matrices as inputs. Finally, the aspect-level representations are combined with an attention component to obtain the overall representations for users and items. Moreover, we also employ self-attention mechanism to fuse aspect-level representations more effectively, extending the model as NeuACF++, which is introduced in Sect. 3.3.2.5. Next we elaborate on the three steps.
[!visual-conversion] Scan-verified against
assets/pages/page-046.png.
flowchart BT
subgraph Brand["Brand Aspect"]
UIBIU["U_i similarity matrix (UIBIU)"] --> MLPubB[MLP Layers]
IBI["V_j similarity matrix (IBI)"] --> MLPvbB[MLP Layers]
MLPubB --> uiB["u_i^B"]
MLPvbB --> vjB["v_j^B"]
end
subgraph History["History Aspect"]
UIU["U_i similarity matrix (UIU)"] --> MLPubH[MLP Layers]
IUI["V_j similarity matrix (IUI)"] --> MLPvbH[MLP Layers]
MLPubH --> uiH["u_i^H"]
MLPvbH --> vjH["v_j^H"]
end
uiB --> AttnU[Attention Layer, weights w_i^B ... w_i^H]
uiH --> AttnU
vjB --> AttnV[Attention Layer, weights w_j^B ... w_j^H]
vjH --> AttnV
AttnU --> ui["Fused Latent Factor u_i"]
AttnV --> vj["Fused Latent Factor v_j"]
ui --> Loss["Loss Function -> y_hat_ij"]
vj --> Loss
Fig. 3.5 The architecture of the NeuACF model
3.3.2.2 Aspect-Level Similarity Matrix Extraction
Section titled “3.3.2.2 Aspect-Level Similarity Matrix Extraction”We employ HG to organize objects and relations, due to its power of information fusion and semantics representation [35]. Furthermore, we utilize meta-path to decompose the HG and extract different aspect-level features of users and items.
Given a specific meta-path, similarity matrix is employed to extract the aspect-level features. The popular PathSim [39] is employed to calculate aspect-level similarity matrices under different meta-paths in experiments. For example, the similarity matrices of user-user and item-item are computed based on the meta-path UIBIU and IBI for the brand-aspect features.
The computation of similarity matrix based on meta-path is of great importance in the proposed model, so how to compute similarity matrix quickly is an important problem in the method. In real-world applications, the complexity of similarity matrix computation is not high because the similarity matrix is usually very sparse for most meta-paths. Based on this fact, there are several acceleration computation methods proposed by previous works [34, 39] for similarity matrix computation, for example, PathSim-pruning [39], dynamic programming strategy, and Monte Carlo (MC) strategy [34]. Moreover, there are also many new methods for similarity matrix computation, for example, BLPMC [52], PRSim [50]. In addition, the similarity matrix can be computed offline in advance in our model. The similarity matrix is computed with training data, so we can prepare the similarity matrix before the training processing.
3.3.2.3 Learning Aspect-Level Representations
Section titled “3.3.2.3 Learning Aspect-Level Representations”With the computed user–user and item–item similarity matrices of different aspects, their representations are next learned. A deep neural network is designed to learn their corresponding aspect-level representations separately. Concretely, as shown in Fig. 3.5, for each user in each aspect, the user’s similarity vector is extracted from the aspect-specific similarity matrix. Then we take the similarity vector as the input of the MLP, and MLP learns the aspect-level representation as the output. The item representations of each aspect can be learned similarly.
Taking the similarity matrix of users under the meta-path as an example, user is represented as an -dimensional vector , which means the similarities between and all the other users. Here means the total number of users in the dataset.
The MLP projects the initial similarity vector of user to a low-dimensional aspect-level representation. In each layer of MLP, the input vector is mapped into another vector in a new space. Formally, given the initial input vector , and the th hidden layer , the final aspect-level representation can be learned through he following multi-layer mapping functions.
From the learning framework in Fig.3.5, one can see that for each aspect-level similarity matrix of both users and items, there is a corresponding MLP learning component described above to learn the aspect-level representations. Since there are various meta-paths connecting users and items, different aspect-level representations can be learned.
3.3.2.4 Attention-Based Aspect-Level Representations Fusion
Section titled “3.3.2.4 Attention-Based Aspect-Level Representations Fusion”After the aspect-level representations are learned separately for users and items, next we need to integrate them together to obtain aggregated representations. A straightforward way is to concatenate all the aspect-level representations to form a higher-dimensional vector. Another intuitive way is to average all the representations. The issue is that both methods do not distinguish their different importance because not all the aspects contribute to the model performance equally, which will be showed in the experiment part.
Therefore, the attention mechanism is chosen to fuse these aspect-level representations. Attention mechanism has shown the effectiveness in various machine learning tasks such as image captioning and machine translation [1, 53, 57]. The advantage of attention mechanism is that it can learn to assign attentive values (normalized by sum to 1) for all the aspect-level representations: higher (lower) values indicate that the corresponding features are more informative (less informative) for recommendation. Specifically, given the user’s brand-aspect representations , a two-layer network is used to compute the attention score by Eq.3.10,
where and are the weight matrices and the biases, respectively, and we use the ReLU, i.e., as the activation function.
The final attention values for the aspect-level representations are obtained by normalizing the above attentive scores with the Softmax function given in Eq.3.11, which can be interpreted as the contributions of different aspects to the aggregated latent factor of user ,
where is the total number of all the aspects.
After obtaining all the attention weights of all the aspect-level representations for user , the aggregated representation can be calculated by Eq. 3.12,
This attention method is adopted by NeuACF in the experiments.
3.3.2.5 NeuACF++: Self-Attention-Based Aspect-Level Representations Fusion
Section titled “3.3.2.5 NeuACF++: Self-Attention-Based Aspect-Level Representations Fusion”Recently, self-attention mechanism has received considerable research interests. For example, Vaswani et al. [46] and Devlin et al. [6] utilize self-attention to learn the relationship between two sequences. Learning dependencies and relationships between aspect-level representations is the most important part in our model, and self-attention has ability to model the relationships between the different aspect-level representations. Therefore, we extend the standard attention mechanism of NeuACF to self-attention, and call the extension version of the model NeuACF++. Next, the self-attention mechanism employed in NeuACF++ will be introduced.
Different from standard attention mechanism, self-attention mainly focuses on the co-learning attentions of two sequences. The vanilla attention mechanism mainly considers computing the attention values based on the user or item representations of one aspect, while self-attention mechanism is able to learn the attention values from different aspects simultaneously. For example, the Brand-level representation of users has strong relationship to the Brand-level representation of items, and the self-attention mechanism can learn this relationship and promote the model performance. So the learned values are able to capture more information on the multi-aspects.
Specifically, we firstly compute the affinity scores between all aspect-level representations. For a user , the affinity score of two different aspect-level representations and can be calculated by their inner product:
The matrix is also called the self-attention matrix, where is the total number of aspects. There is an affinity matrix for each user. Basically, the matrix characterizes the similarity of aspect-level representations for a specific user , which reflects the correlation between two aspects when recommending for this user. When the aspect is equal to aspect , will get a high value due to the inner product operator, so a zero mask is added to avoid a high matching score between identical vectors.
The aspect-level representations learned from self-attention mechanism are not independent. Users can make a trade-off between those aspects. The affinity matrix measures the importance of different aspect-level representations, so the representation of aspect for the specific user is computed based on the self-attention matrix as:
Then for all the aspects, we can obtain the final representation of users or items as:
The self-attention mechanism can learn self-attentive representations from different aspect-level information effectively. In order to distinguish with the above attention method NeuACF, the self-attention mechanism is implemented as NeuACF++ in the experiments.
3.3.2.6 Objective Function
Section titled “3.3.2.6 Objective Function”We model the top-N recommendation as a classification problem which predicts the probability of interaction between users and items in the future. In order to ensure that the output value is a probability, we need to constrain the predicted score in the range of , where we use a Logistic function as the activation function for the output layer. The probability of the interaction between the user and item is calculated according to Eq. 3.16,
where and are the aggregated representations of user and item , respectively.
Over all the training set, according to the above settings, the likelihood function is:
where and are the positive and negative instances sets, respectively. The negative instance set is sampled from unobserved data for training. is the parameters set.
Since the ground truth is in the set , Eq. 3.17 can be rewritten as:
Then we can take the negative logarithm of the likelihood function to get the point-wise loss function in Eq. 3.19:
This is the overall objective function of the model, and it can be optimized by stochastic gradient descent or its variants [19].
3.3.3 Experiments
Section titled “3.3.3 Experiments”3.3.3.1 Experimental Settings
Section titled “3.3.3.1 Experimental Settings”Datasets The proposed model is evaluated over the publicly available MovieLens dataset [12] and Amazon dataset [13, 25]. We use the origin Movielens dataset for the experiment. For Amazon dataset, we remove the users who bought less than 10 items.
Evaluation Metrics We adopt the leave-one-out method [15] for evaluation. The latest rated item of each user is held out for testing, and the remaining data for training. Following previous work [15], we randomly select 99 items that are not rated by the users as negative samples and rank the 100 sampled items for the users. For a fair comparison with the baseline methods, we use the same negative sample set for each pair in the test set for all the methods. We evaluate the model performance through the Hit Ratio (HR) and the Normalized Discounted Cumulative Gain (NDCG) defined in Eq. 3.20,
where is the number of users whose test item appears in the recommended list and is the position of the test item in the list for the -th hit. In the experiments, we truncate the ranked list at for both metrics.
Baselines Besides two basic methods (i.e., ItemPop and ItemKNN [32]), the baselines include two MF methods (MF [21] and eALS [14]), one pairwise ranking method (BPR [31]), and two neural network-based methods (DMF [55] and NeuMF [15]). In addition, we use SVD to leverage the heterogeneous information or recommendation and also adopt two recent HG based methods (FMG [61] and HeteRS [29]) as baselines.
3.3.3.2 Performance Analysis
Section titled “3.3.3.2 Performance Analysis”The proposed methods are applied to recommendation task. Table 3.3 shows the experiment results of different methods. The proposed methods are marked as NeuACF that implements the attention method in Sect. 3.3.2.4 and NeuACF++ that implements the self-attention mechanism in Sect. 3.3.2.5, respectively. One can draw the following conclusions.
Firstly, NeuACF and NeuACF++ achieve all the best performance over all the datasets and criteria. The improvement of the two models comparing to these baselines is significant. This indicates that the aspect-level information is useful for the downstream task. Besides, NeuACF++ outperforms the NeuACF method in most circumstances. Particularly, the performance of NeuACF++ is significantly improved in Amazon dataset (about +2% at HR and +1% at NDCG). This demonstrates the effectiveness of the self-attention mechanism. Since the affinity matrix evaluates the similarity score of different aspects, we can extract the valuable information from the aspect representations.
Secondly, NeuMF, as one neural network-based method, also performs well on most conditions, while both NeuACF and NeuACF++ outperform NeuMF in almost all the cases. The reason is probably that multiple aspects of representations learned by NeuACF and NeuACF++ provide more features of users and items. Although FMG also utilizes the same features as NeuACF and NeuACF++, the better performance of NeuACF and NeuACF++ implies that the deep neural network and the attention mechanisms in NeuACF and NeuACF++ may have the better ability to learn representations of users and items than the “shallow” model in FMG.
The more detailed method description and experiment validation can be seen in [11] and [36].
Table 3.3 HR@K and NDCG@K comparisons of different methods. Bolded values represent the best results
[!visual-conversion] Table 3.3 (printed p. 49) scan-verified and corrected: the OCR pass produced an unclosed, misaligned HTML table with dataset/metric labels shifted out of sync with the data. Rebuilt as a Markdown table against
assets/pages/page-053.png.
| Dataset | Metric | ItemPop | ItemKNN | MF | eALS | BPR | DMF | NeuMF | SVD | HeteRS | FMG | NeuACF | NeuACF++ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ML100K | HR@5 | 0.2831 | 0.4072 | 0.4634 | 0.4698 | 0.4984 | 0.3483 | 0.4942 | 0.4655 | 0.3747 | 0.4602 | 0.5097 | 0.5111 |
| NDCG@5 | 0.1892 | 0.2667 | 0.3021 | 0.3201 | 0.3315 | 0.2287 | 0.3357 | 0.3012 | 0.2831 | 0.3014 | 0.3505 | 0.3519 | |
| HR@10 | 0.3998 | 0.5891 | 0.6437 | 0.6638 | 0.6914 | 0.4994 | 0.6766 | 0.6554 | 0.5337 | 0.6373 | 0.6846 | 0.6915 | |
| NDCG@10 | 0.2264 | 0.3283 | 0.3605 | 0.3819 | 0.3933 | 0.2769 | 0.3945 | 0.3988 | 0.3338 | 0.3588 | 0.4068 | 0.4092 | |
| HR@15 | 0.5366 | 0.7094 | 0.7338 | 0.7529 | 0.7741 | 0.5873 | 0.7635 | 0.7432 | 0.6524 | 0.7338 | 0.7813 | 0.7832 | |
| NDCG@15 | 0.2624 | 0.3576 | 0.3843 | 0.4056 | 0.4149 | 0.3002 | 0.4175 | 0.4043 | 0.3652 | 0.3844 | 0.4318 | 0.4324 | |
| HR@20 | 0.6225 | 0.7656 | 0.8144 | 0.8155 | 0.8388 | 0.6519 | 0.8324 | 0.8043 | 0.7224 | 0.8006 | 0.8464 | 0.8441 | |
| NDCG@20 | 0.2826 | 0.3708 | 0.4034 | 0.4204 | 0.4302 | 0.3151 | 0.4338 | 0.3944 | 0.3818 | 0.4002 | 0.4469 | 0.4469 | |
| ML1M | HR@5 | 0.3088 | 0.4437 | 0.5111 | 0.5353 | 0.5414 | 0.4892 | 0.5485 | 0.4765 | 0.3997 | 0.4732 | 0.5630 | 0.5584 |
| NDCG@5 | 0.2033 | 0.3012 | 0.3463 | 0.3670 | 0.3756 | 0.3314 | 0.3865 | 0.3098 | 0.2895 | 0.3183 | 0.3944 | 0.3923 | |
| HR@10 | 0.4553 | 0.6171 | 0.6896 | 0.7055 | 0.7161 | 0.6652 | 0.7177 | 0.6456 | 0.5758 | 0.6528 | 0.7202 | 0.7222 | |
| NDCG@10 | 0.2505 | 0.3572 | 0.4040 | 0.4220 | 0.4321 | 0.3877 | 0.4415 | 0.3665 | 0.3461 | 0.3767 | 0.4453 | 0.4454 | |
| HR@15 | 0.5568 | 0.7118 | 0.7783 | 0.7914 | 0.7988 | 0.7649 | 0.7982 | 0.7689 | 0.6846 | 0.7536 | 0.8018 | 0.8030 | |
| NDCG@15 | 0.2773 | 0.3822 | 0.4275 | 0.4448 | 0.4541 | 0.4143 | 0.4628 | 0.4003 | 0.3749 | 0.4034 | 0.4667 | 0.4658 | |
| HR@20 | 0.6409 | 0.7773 | 0.8425 | 0.8409 | 0.8545 | 0.8305 | 0.8586 | 0.8234 | 0.7682 | 0.8169 | 0.8540 | 0.8601 | |
| NDCG@20 | 0.2971 | 0.3977 | 0.4427 | 0.4565 | 0.4673 | 0.4296 | 0.4771 | 0.4456 | 0.3947 | 0.4184 | 0.4789 | 0.4790 | |
| Amazon | HR@5 | 0.2412 | 0.1897 | 0.3027 | 0.3063 | 0.3296 | 0.2693 | 0.3117 | 0.3055 | 0.2766 | 0.3216 | 0.3268 | 0.3429 |
| NDCG@5 | 0.1642 | 0.1279 | 0.2068 | 0.2049 | 0.2254 | 0.1848 | 0.2141 | 0.1922 | 0.1800 | 0.2168 | 0.2232 | 0.2308 | |
| HR@10 | 0.3576 | 0.3126 | 0.4278 | 0.4287 | 0.4657 | 0.3715 | 0.4309 | 0.4123 | 0.4207 | 0.4539 | 0.4686 | 0.4933 | |
| NDCG@10 | 0.2016 | 0.1672 | 0.2471 | 0.2441 | 0.2693 | 0.2179 | 0.2524 | 0.2346 | 0.2267 | 0.2595 | 0.2683 | 0.2792 | |
| HR@15 | 0.4408 | 0.3901 | 0.5054 | 0.5065 | 0.5467 | 0.4328 | 0.5258 | 0.5056 | 0.5136 | 0.5430 | 0.5591 | 0.5948 | |
| NDCG@15 | 0.2236 | 0.1877 | 0.2676 | 0.2647 | 0.2908 | 0.2332 | 0.2774 | 0.2768 | 0.2513 | 0.2831 | 0.2924 | 0.3060 | |
| HR@20 | 0.4997 | 0.4431 | 0.5680 | 0.5702 | 0.6141 | 0.4850 | 0.5897 | 0.5607 | 0.5852 | 0.6076 | 0.6257 | 0.6702 | |
| NDCG@20 | 0.2375 | 0.2002 | 0.2824 | 0.2797 | 0.3067 | 0.2458 | 0.2925 | 0.2876 | 0.2683 | 0.2983 | 0.3080 | 0.3236 |
3.4 Relation Structure Awareness
Section titled “3.4 Relation Structure Awareness”3.4.1 Overview
Section titled “3.4.1 Overview”To model the heterogeneity of networks, several attempts have been done on HGs embedding. Representative methods include random walk-based methods [7, 9, 33], decomposition-based methods [37, 43, 54], and neural network-based methods [4, 11, 48, 60]. Although these methods consider the heterogeneity of networks, they usually have an assumption that one single model can handle all relations and nodes, through keeping the representations of two nodes close to each other, as illustrated in Fig. 3.6b.
[!visual-conversion] Scan-verified against
assets/pages/page-054.png.
flowchart LR
subgraph a["(a) An example of HG"]
a1((a1)) --> p1[p1]
a2((a2)) --> p1
a2 --> p2[p2]
a3((a3)) --> p3[p3]
a3 --> p4[p4]
a4((a4)) --> p5[p5]
p1 --> c1{{c1}}
p2 --> c1
p3 --> c2{{c2}}
p4 --> c2
p1 --> t1((t1))
p3 --> t2((t2))
p4 --> t3((t3))
p5 --> t4((t4))
end
subgraph b["(b) Conventional models: all relations (P-C, A-P-C, A-P, A-P-T ...) go through one shared function f()"]
b1["Relations: P->C, A->P->C, A->P, A->P->T ..."] -->|f| b2["single embedding space"]
end
subgraph c["(c) Our model: relations split by structure"]
c1r["Affiliation Relations: P->C, A->P->C ..."] -->|f| c1e["embedding space"]
c2r["Interaction Relations: A->P, A->P->T ..."] -->|g| c2e["embedding space"]
end
Fig. 3.6 The illustration of HGs and the comparison between conventional methods and our method (non-differentiated relations vs. differentiated relations). (a) An example of HG. (b) Conventional models. (c) Our model
However, various relations in HGs have significantly different structural characteristics, which should be handled with different models. Let us see a toy example in Fig. 3.6a. The relations in the network include atomic relations (e.g., AP and PC) and composite relations (e.g., APA and APC). Intuitively, AP relation and PC relation reveal rather different structures. That is, some authors write some papers in the AP relation, which shows a peer-to-peer structure. However, many papers are published in one conference in the PC relation, which reveals the structure of one-centered-by-another. Similarly, APA and APC indicate peer-to-peer and one-centered-by-another structures, respectively. The intuitive examples clearly illustrate that relations in HGs indeed have different structural characteristics.
In this section, we present a novel model for HGs embedding, named Relation structure-aware Heterogeneous Information Network Embedding (RHINE) [23]. In specific, we first explore the structural characteristics of relations in HGs with thorough mathematical analysis, and we present two structure-related measures which can consistently distinguish the various relations into two categories: Affiliation Relations (ARs) with one-centered-by-another structures and Interaction Relations (IRs) with peer-to-peer structures, as shown in Fig. 3.6c. In order to capture the distinctive structural characteristics of the relations, we then propose two specifically designed models. For ARs where the nodes share similar properties [56], we calculate Euclidean distance as the proximity between nodes, so as to make the nodes directly close in the low-dimensional space. On the other hand, for IRs which bridge two compatible nodes, we model them as translations between the nodes. Since the two models are consistent in terms of mathematical form, they can be optimized in a unified and elegant way.
3.4.2 Preliminary
Section titled “3.4.2 Preliminary”In this section, we first describe three real-world HGs and analyze the structural characteristics of relations in the HGs. Then we present two structure-related measures which can consistently distinguish various relations quantitatively.
Before analyzing the structural characteristics of relations, we first introduce three datasets used in this section, including DBLP,1 Yelp,2 and AMiner3 [42]. The statistics of these datasets are illustrated in Table 3.4. In order to explore the structural characteristics of relations, we present mathematical analysis on the above datasets.
Since the degree of nodes can well reflect the structures of networks [51], we define a degree-based measure to explore the distinction of various relations in an HG. Specifically, we compare the average degrees of two types of nodes connected with the relation , via dividing the larger one by the smaller one (). Formally, given a relation with nodes and (i.e., node-relation triple ), and are the node types of and , we define as follows:
where and are the average degrees of nodes of the types and respectively.
A large value of indicates quite inequivalent structural roles of two types of nodes connected via the relation (one-centered-by-another), while a small value of means compatible structural roles (peer-to-peer). In other words, relations with a large value of show much stronger affiliation relationships. Nodes connected via such relations share much more similar properties [8]. While relations with a small value of implicate much stronger interaction relationships. Therefore, we call the two categories of relations as Affiliation Relations (ARs) and Interaction Relations (IRs), respectively.
In order to better understand the structural difference between various relations, we take the DBLP network as an example. As shown in Table 3.4, for the relation with , the average degree of nodes with type P is 1.0 while that of nodes with type C is 718.8. It shows that papers and conferences are
^5 https://www.yelp.com/dataset/.
^6 https://www.aminer.cn/citation.
3 Structure-Preserved Heterogeneous Graph Representation
Table 3.4 Statistics of the three datasets. denotes the type of node , is a node-relation triple
| Datasets | Nodes | Number of relations | Relations | Avg. degree of | Avg. degree of | Measures | Relation category |
|---|---|---|---|---|---|---|---|
| DBLP | Term (T) | 8811 | 14,376 | PC | 1.0 | 718.8 | 718.8 |
| Paper (P) | 14,376 | 24,495 | APC | 2.9 | 720.6 | 2089.7 | |
| Author (A) | 14,475 | 41,794 | AP | 2.8 | 1.0 | 0.0002 | |
| Conference (C) | 20 | 88,683 | PT | 6.2 | 1.7 | 0.0007 | |
| Yelp | User (U) | 1286 | 2614 | APT | 1.0 | 1307.0 | 1307.0 |
| Service (S) | 2 | 2614 | BR | 1.0 | 1307.0 | 1307.0 | |
| Business (B) | 2614 | 2614 | BS | 1.0 | 290.4 | 290.4 | |
| Star level (L) | 9 | 30,838 | BL | 23.9 | 2.0 | 0.009 | |
| Reservation (R) | 2 | 528,332 | BUB | 1.0 | 405.3 | 405.3 | |
| AMiner | Paper (P) | 127,623 | 127,623 | PC | 1.0 | 1264.6 | 1264.6 |
| Author (A) | 164,472 | 232,659 | APC | 2.2 | 3515.6 | 1598.0 | |
| Reference (R) | 147,251 | 355,072 | AP | 2.2 | 1.3 | 0.0002 | |
| Conference (C) | 101 | 392,519 | PR | 3.1 | 7.1 | 0.0004 |
structurally inequivalent. Papers are centered by conferences. While indicates that authors and papers are compatible and peer-to-peer in structure. This is consistent with our common sense. Semantically, the relation means that “papers are published in conferences”, indicating an affiliation relationship. Differently, means that “authors write papers”, which explicitly describes an interaction relationship.
In fact, we can also define some other measures to capture the structural difference. For example, we compare the relations in terms of sparsity, which can be defined as:
where represents the number of relation instances following . and mean the number of nodes with type and , respectively. The measure can also consistently distinguish the relations into two categories: ARs and IRs. The detailed statistics of all the relations in the three HGs are shown in Table 3.4.
Evidently, Affiliation Relations and Interaction Relations exhibit rather distinct characteristics: (1) ARs indicate one-centered-by-another structures, where the average degrees of the types of end nodes are extremely different. They imply an affiliation relationship between nodes. (2) IRs describe peer-to-peer structures, where the average degrees of the types of end nodes are compatible. They suggest an interaction relationship between nodes.
3.4.3 The RHINE Model
Section titled “3.4.3 The RHINE Model”3.4.3.1 Basic Idea
Section titled “3.4.3.1 Basic Idea”Through our exploration with thorough mathematical analysis, we find that the heterogeneous relations can be typically divided into ARs and IRs with different structural characteristics. In order to exploit their distinct characteristics, we need to specifically design different while appropriate models for the different categories of relations.
For ARs, we propose to take Euclidean distance as a metric to measure the proximity of the connected nodes in the low-dimensional space. There are two motivations behind this: (1) First of all, ARs show affiliation structures between nodes, which indicate that nodes connected via such relations share similar properties. [8, 56]. Hence, nodes connected via ARs could be directly close to each other in the vector space, which is also consistent with the optimization of Euclidean distance [5]. (2) Additionally, one goal of HG embedding is to preserve the high-order proximity. Euclidean distance can ensure that both first-order and second-order proximities are preserved as it meets the condition of the triangle inequality [16].
Different from ARs, IRs indicate strong interaction relationships between compatible nodes, which themselves contain important structural information of two nodes. Thus, we propose to explicitly model an IR as a translation between nodes in the low-dimensional vector space. Additionally, the translation-based distance is consistent with the Euclidean distance in the mathematical form [2]. Therefore, they can be smoothly combined in a unified and elegant manner.
3.4.3.2 Different Models for ARs and IRs
Section titled “3.4.3.2 Different Models for ARs and IRs”In this subsection, we introduce two different models exploited in RHINE for ARs and IRs, respectively.
Euclidean Distance for Affiliation Relations Nodes connected via ARs share similar properties [8]; therefore, nodes could be directly close to each other in the vector space. We take the Euclidean distance as the proximity measure of two nodes connected by an AR.
Formally, given an affiliation node-relation triple where is the relation between and with weight , the distance between and in the latent vector space is calculated as follows:
in which and are the embedding vectors of and , respectively. As quantifies the distance between and in the low-dimensional vector space, we aim to minimize to ensure that nodes connected by an AR are close to each other. Hence, we define the margin-based loss [2] function as follows:
where is a margin hyperparameter. is the set of positive affiliation node-relation triples, while is the set of negative affiliation node-relation triples.
Translation-Based Distance for Interaction Relations Interaction Relations demonstrate strong interactions between nodes with compatible structural roles. Thus, different from ARs, we explicitly model IRs as translations between nodes.
Formally, given an interaction node-relation triple where with weight , we define the score function as:
where and are the node embeddings of and , respectively, and is the embedding of the relation . Intuitively, this score function penalizes deviation of from the vector .
For each interaction node-relation triple , we define the margin-based loss function as follows:
where is the set of positive interaction node-relation triples, while is the set of negative interaction node-relation triples.
3.4.3.3 A Unified Model for HG Embedding
Section titled “3.4.3.3 A Unified Model for HG Embedding”Finally, we combine the two models for different categories of relations by minimizing the following loss function:
Sampling Strategy As shown in Table 3.4, the distributions of ARs and IRs are quite unbalanced. What is more, the proportion of relations is unbalanced within ARs and IRs. Traditional edge sampling may suffer from under-sampling for relations with a small amount or over-sampling for relations with a large amount. To address the problems, we draw positive samples according to their probability distributions. As for negative samples, we follow previous work [2] to construct a set of negative node-relation triples for the positive node-relation triple , where either the head or tail is replaced by a random node, but not both at the same time.
3.4.4 Experiments
Section titled “3.4.4 Experiments”3.4.4.1 Experimental Settings
Section titled “3.4.4.1 Experimental Settings”Datasets As described in Sect.3.4.2, we conduct experiments on three datasets, including DBLP, Yelp, and AMiner. The statistics of them are summarized in Table 3.4.
Baselines We compare our proposed model RHINE with six state-of-the-art network embedding methods: two classic homogeneous graph embedding methods DeepWalk [28], LINE [44], and four heterogeneous graph embedding methods PTE [43], ESim [33], HIN2Vec [9], and Metapath2vec [7].
Evaluation Metrics We use different evaluation metrics on the following tasks:
-
Node Clustering The experiments leverage K-means to cluster the nodes and evaluate the results in terms of normalized mutual information (NMI).
-
Link Prediction We model the link prediction problem as a binary classification problem that aims to predict whether a link exists, and use Area Under Curve (AUC) and F1 score as evaluation metrics.
-
Multi-Class Classification In this task, we employ the same labeled data used in the node clustering task. We use Micro-F1 and Macro-F1 scores as the metrics for evaluation.
Parameter Settings For a fair comparison, we set the embedding dimension and the size of negative samples for all models. For DeepWalk, HIN2Vec, and metapath2vec, we set the number of walks per node , the walk length , and the window size . For our model RHINE, the margin is set to 1.
3.4.4.2 Node Clustering
Section titled “3.4.4.2 Node Clustering”As shown in Table 3.5, our model RHINE significantly outperforms all the compared methods. (1) Compared with the best competitors, the clustering performance of our model RHINE improves by 18.79%, 6.15%, and 7.84% on DBLP, Yelp, and AMiner, respectively. It demonstrates the effectiveness of our model RHINE by distinguishing the various relations with different structural characteristics in HGs. In addition, it also validates that we utilize appropriate models for different categories of relations. (2) In all baseline methods, homogeneous network embedding models achieve the lowest performance, because they ignore the heterogeneity of relations and nodes. (3) RHINE significantly outperforms existing HGs embedding models (i.e., ESIm, HIN2Vec, and metapath2vec) on all datasets. We believe the reason is that our proposed RHINE with appropriate models for different categories of relations can better capture the structural and semantic information of HGs.
Table 3.5 Performance evaluation of node clustering. Bolded values represent the best results
| Methods | DBLP | Yelp | AMiner |
|---|---|---|---|
| DeepWalk | 0.3884 | 0.3043 | 0.5427 |
| LINE-1st | 0.2775 | 0.3103 | 0.3736 |
| LINE-2nd | 0.4675 | 0.3593 | 0.3862 |
| PTE | 0.3101 | 0.3527 | 0.4089 |
| ESim | 0.3449 | 0.2214 | 0.3409 |
| HIN2Vec | 0.4256 | 0.3657 | 0.3948 |
| metapath2vec | 0.6065 | 0.3507 | 0.5586 |
| RHINE | 0.7204 | 0.3882 | 0.6024 |
3.4.4.3 Link Prediction
Section titled “3.4.4.3 Link Prediction”The results of link prediction task are reported in Table 3.6 with respect to AUC and F1 score. It is clear that our model performs better than all baseline methods on three datasets. The reason behind the improvement is that our model based on Euclidean distance modeling relations can capture both the first-order and second-order proximities. In addition, our model RHINE distinguishes multiple types of relations into two categories in terms of their structural characteristics, and thus can learn better embeddings of nodes, which are beneficial for predicting complex relationships between two nodes.
3.4.4.4 Multi-Class Classification
Section titled “3.4.4.4 Multi-Class Classification”We summarize the results of classification in Table 3.7. As we can observe, (1) RHINE achieves better performance than all baseline methods on all datasets except AMiner. It improves the performance of node classification by about 4% on both DBLP and Yelp averagely. In terms of AMiner, the RHINE performs slightly worse than ESIm, HIN2vec, and metapath2vec. This may be caused by over-capturing the information of relations and ( represents references). Since an author may write a paper referring to various fields, these relations may introduce some noise. (2) Although ESim and HIN2Vec can model multiple types of relations in HGs, they fail to perform well in most cases. Our model RHINE achieves good performance due to the respect of distinct characteristics of various relations.
Table 3.6 Performance evaluation of link prediction. Bolded values represent the best results
| Methods | DBLP (A-A) | DBLP (A-C) | Yelp (U-B) | AMiner (A-A) | AMiner (A-C) |
|---|---|---|---|---|---|
| AUC | F1 | AUC | F1 | AUC | |
| DeepWalk | 0.9131 | 0.8246 | 0.7634 | 0.7047 | 0.8476 |
| LINE-1st | 0.8264 | 0.7233 | 0.5335 | 0.6436 | 0.5084 |
| LINE-2nd | 0.7448 | 0.6741 | 0.8340 | 0.7396 | 0.7509 |
| PTE | 0.8853 | 0.8331 | 0.8843 | 0.7720 | 0.8061 |
| ESIm | 0.9077 | 0.8129 | 0.7736 | 0.6795 | 0.8661 |
| HIN2Vec | 0.9160 | 0.8475 | 0.8966 | 0.7892 | 0.8653 |
| metapath2vec | 0.9153 | 0.8431 | 0.8987 | 0.8012 | 0.7818 |
| RHINE | 0.9315 | 0.8664 | 0.9148 | 0.8478 | 0.8762 |
Table 3.7 Performance evaluation of multi-class classification. Bolded values represent the best results
| Methods | DBLP | Yelp | AMiner |
|---|---|---|---|
| Macro-F1 | Micro-F1 | Macro-F1 | |
| DeepWalk | 0.7475 | 0.7500 | 0.6723 |
| LINE-1st | 0.8091 | 0.8250 | 0.4872 |
| LINE-2nd | 0.7559 | 0.7500 | 0.5304 |
| PTE | 0.8852 | 0.8750 | 0.5389 |
| ESim | 0.8867 | 0.8750 | 0.6836 |
| HIN2Vec | 0.8631 | 0.8500 | 0.6075 |
| metapath2vec | 0.8976 | 0.9000 | 0.5337 |
| RHINE | 0.9344 | 0.9250 | 0.7132 |
The more detailed method description and experiment validation can be seen in [23].
3.5 Network Schema Preservation
Section titled “3.5 Network Schema Preservation”3.5.1 Overview
Section titled “3.5.1 Overview”Despite the success of meta-path guided HG embedding methods, the selection of meta-paths still remains an open yet challenging problem [39]. The design of meta-path schemes significantly relies on domain knowledge. Manually selecting meta-paths based on prior knowledge may work for a simple HG, while it is difficult to determine meta-paths for a complex HG. Furthermore, different meta-paths will result in different embeddings from different points of view, which leads to another challenging problem, i.e., how to effectively fuse different embeddings to generate uniform embeddings. Some existing works [22, 37, 49] use label information to guide the embedding fusion; unfortunately, this is not applicable in unsupervised scenarios.
To tackle the above challenges, we observe that the network schema [39], as a uniform blueprint of HG, comprehensively retains node types and their relations in an HG. Since network schema is a meta template for HG, guided by it, we can extract subgraphs (i.e., schema instances) from the HG. An example is shown in Fig.3.7c,d, from which we can see that the schema instance depicts the high-order structure information of these four nodes, besides the first-order structure information of two nodes (i.e., pairwise structure or meta-path based structure as shown in Fig. 3.7b). Moreover, the schema instance also contains rich semantics, i.e., a schema instance (shown in Fig. 3.7d) naturally describes the overall information, such as the author, the term, and the venue of a paper, as well as their relations. More importantly, different from meta-paths, a network schema is a unique structure for an HG, and thus we do not need domain knowledge to make a choice. These benefits of network schema motivate us to study network schema preserving HG embedding. However, it is a non-trivial task. First, how to effectively preserve the network schema structure? Moreover, how to capture the heterogeneity of nodes and links inside network schema?
[!visual-conversion] Scan-verified against
assets/pages/page-063.png.
flowchart TB
subgraph a["(a) An example of HG"]
V1[Venue v1] --> P1[Paper p1]
V2[Venue v2] --> P2[Paper p2]
V2 --> P3[Paper p3]
P1 --> A1((Author a1))
P1 --> A2((Author a2))
P2 --> A2
P2 --> A3((Author a3))
P3 --> A3
P1 --> T1[Term t1]
P2 --> T1
P3 --> T2[Term t2]
end
subgraph b["(b) Meta-paths"]
b1["APA: Author-Paper-Author"]
b2["APVPA: Author-Paper-Venue-Paper-Author"]
end
subgraph c["(c) Network schema"]
cV[Venue] --> cP[Paper]
cP --> cA((Author))
cP --> cT[Term]
end
subgraph d["(d) Schema instance"]
dV1[v1] --> dP1[p1]
dP1 --> dA1((a1))
dP1 --> dT1[t1]
dV2[v2] --> dP3[p3]
dP3 --> dA3((a3))
dP3 --> dT2[t2]
end
Fig. 3.7 A toy example of an HG on bibliographic data. (a) An example of HG. (b) Meta-paths. (c) Network schema. (d) Schema instance
In this section, we introduce a novel Network Schema preserving Heterogeneous graph Embedding model named NSHE. Based on node embedding generated by heterogeneous graph convolutional network, NSHE optimizes the embedding via node pairs and schema instances sampled from the HG. Particularly, in the network schema preserving component, we propose a network schema sampling method, which generates subgraphs (i.e., schema instances) naturally preserving schema structure. Furthermore, for each schema instance, a multi-task learning model is built to predict each node in the instance with other nodes, which tackles the challenge of heterogeneity.
3.5.2 The NSHE Model
Section titled “3.5.2 The NSHE Model”3.5.2.1 Model Framework
Section titled “3.5.2.1 Model Framework”Consider an HG composed of a node set and an edge set , along with the node type mapping function , and the edge type mapping function
[!visual-conversion] Scan-verified against
assets/pages/page-064.png.
flowchart TB
Input["Input HG + Network schema"] --> FeatProj["Feature Projection f_i -> f_i'"]
FeatProj --> Aggr["Aggregation"]
Aggr --> NodeEmb["Node Embeddings Z"]
NodeEmb --> EdgeSampler["Edge Sampler"] --> PairwiseLoss["Pairwise Loss L_p"]
NodeEmb --> SchemaSampling["Schema Instance Sampling"]
SchemaSampling --> MultiTask["Multi-task Learning: Context nodes + Target node -> concat (CE) -> Classifier 1..n"]
MultiTask --> SchemaLoss["Schema Loss L_s"]
PairwiseLoss --> Overall["Overall Loss L"]
SchemaLoss --> Overall
Fig. 3.8 Overview of the NSHE model
, where and denote the node and edge types, . The task is to learn the representation of nodes , where is the dimension of representation.
Figure 3.8 illustrates the framework of the proposed NSHE. NSHE preserves the pairwise and schema proximity concurrently. First, to fully exploit complex network structure and heterogeneous node feature together, we propose to learn node embedding via heterogeneous node aggregation. Second, we preserve the pairwise structure and the schema structure simultaneously. While directly performing random walk cannot generate the desired schema structure, we propose to sample schema instances and preserve the proximity inside instances. Moreover, as different types of nodes in the instances carry different context, a multi-task learning model is designed to in turn predict a target node with other context nodes to handle heterogeneity inside schema instances. Finally, NSHE iteratively updates node embeddings via optimizing the aggregation of the pairwise and schema preserving loss.
3.5.2.2 Preserving Pairwise Proximity
Section titled “3.5.2.2 Preserving Pairwise Proximity”Despite that we need to capture the network schema structure in HG embedding, the pairwise proximity between nodes [44], as one of the most direct expressions of an HG, still needs to be preserved. It demonstrates that two nodes with a link, regardless of their types, should be similar. Specifically, considering the heterogeneity of different node feature, for each node with feature and type , we use a type-specific mapping matrix to map the heterogeneous feature to a common space:
where denotes an activation function, and stands for the bias vector of type . Based on Eq. (3.28), all the nodes with different types are mapped to the common space, and we denote their mapped features as . Then, we use a -layer graph convolutional network to generate the node embeddings [20] as:
where is the adjacency matrix, and if , otherwise . is a diagonal matrix, where . is the identity matrix of . For the first layer, we denote and use the output of the -layer graph convolutional networks as the node embedding, i.e., , where the -th row of is the embedding of node .
The objective of preserving the pairwise proximity with parameters can be described as:
where . The conditional probability is defined as a softmax function:
To calculate efficiently, we leverage the negative sampling method [26] and optimize with the logarithm of Eq. (3.30), therefore the pairwise loss can be calculate by:
where , is the noisy distribution, and is the negative edge sampling rate. Through minimizing , NSHE preserves the pairwise proximity.
3.5.2.3 Preserving Network Schema Proximity
Section titled “3.5.2.3 Preserving Network Schema Proximity”Network Schema Instance Sampling Network schema is the blueprint of an HG [39]. Given an HG , a network schema preserves all the node types and relation types inside . Network schema proximity implies that all the nodes with different types in a network schema structure should be similar. However, as we mentioned before, the nodes in a network schema structure are usually biased, i.e., the number of nodes of a certain type is larger than those of other types. For example, in Fig.3.7a, a paper has multiple authors, but only one venue. To alleviate such bias, we propose to sample a network schema instance defined as follows: A network schema instance is the smallest subgraph of an HG, which contains all the node types and edge types defined by the network schema , if existing. By this definition, each network schema instance is composed of all the node types and relation types defined by the schema, i.e., one node for each type. To illustrate, Fig.3.7d shows two instances sampled from the given HG. The sampling process is as follows: Starting from a set with one node, we keep adding a new node to until , where the new node satisfies: (1) its type is different from the node types in ; (2) it connects with the node(s) in .
Schema Preserving with Multi-Task Learning Now, we aim to preserve the network schema proximity by predicting whether a network schema instance exists in an HG. To this end, assume we have a network schema instance as shown in Fig.3.8, we can predict whether exists given the set , or whether exists given the set , and so on. These two predictions are different, because of the node heterogeneity. Considering this, we are motivated to design a multi-task learning model to handle the heterogeneity within schema.
Without loss of generality, assume we have the schema instance , if we aim to predict whether exists given , we call the target node and the context nodes. Therefore, each node will have two roles: one is as the target node and the other is as the context node, as well as two embeddings: target embedding and context embedding. To fully consider the heterogeneity, each node type is associated with an encoder to learn the context embeddings for the context nodes:
where each CE stands for a fully connected layer of neural network. Then for the target node , we concatenate its target embedding with the context embeddings to obtain the schema instance embedding with target node denoted as as follows:
After obtaining the embedding , we predict the probability of the existence of with target node , denoted as :
where is the classifier for schema instances with target node type as . Similarly, when we treat and as the target nodes, respectively, and can also be obtained following the steps introduced above. Note that, here we take the schema instance with three nodes as an example to explain our method. However, it is easy to extend the model to schema instance with more nodes, since the process is the same.
The schema proximity loss can be obtained by predicting the multi-tasks of the schema instances sampled from HG. Additionally, to avoid trivial solutions, we also draw negative examples of target type for each schema instance via replacing the target node with another node in the same type. The loss of preserving network schema can be described as:
where if is a positive network schema instance, otherwise . By minimizing , the schema structure is preserved.
3.5.2.4 Optimization Objective
Section titled “3.5.2.4 Optimization Objective”To preserve both the pairwise proximity and the network schema proximity of HGs, NSHE optimizes the overall loss by aggregating the loss of preserving pairwise proximity and preserving schema proximity :
where is a balancing coefficient. At last, we adopt the Adam [19] algorithm to minimize the objective in Eq. (3.37).
3.5.3 Experiments
Section titled “3.5.3 Experiments”3.5.3.1 Experimental Settings
Section titled “3.5.3.1 Experimental Settings”Datasets In order to demonstrate the effectiveness of the proposed model, we conduct extensive experiments on three HGs datasets, including DBLP [23], IMDB [49], and ACM [49].
Baselines We compare NSHE with seven state-of-the-art embedding methods including two homogeneous network embedding methods, i.e., DeepWalk [28] and LINE [44] and five heterogeneous networks embedding methods, i.e., Metapath2Vec [7], HIN2Vec [9], HERec [37], DHNE [45], and HieGAN [17].
Parameter Settings Here, we briefly introduce the experimental settings. For our proposed model, the feature dimension in common space and the embedding dimension is set as 128. The negative schema instance sample rate , in Sect. 3.5.2.3 is set as 4. We perform neighborhood aggregation via a one-layer GCN, i.e., , and use two-layer-MLPs for schema instance classification. For models that use meta-paths in modeling, we choose the popular meta-paths adopted in previous methods and report the best result. For models that require node feature, we apply DeepWalk [28] to generate node feature. The code and dataset are publicly available on Github. 4 The more detailed method descriptions and experiment validation can be seen in [62].
3.5.3.2 Node Classification
Section titled “3.5.3.2 Node Classification”In this section, we evaluate the performance of node embedding with node classification tasks. After learning the node embeddings, we train a logistic classifier with 80% of the labeled nodes and use the remaining data for testing. We use Micro-F1 and Macro-F1 scores as the metrics for evaluation. The results are shown in Table 3.8, from which we have the following observations: (1) Generally speaking, HG embedding methods perform better than homogeneous network embedding methods, which proves the benefits of considering heterogeneity. (2) Though NSHE does not utilize any prior knowledge, it consistently outperforms the baselines. It demonstrates the effectiveness of our proposed method in classification tasks.
3.5.3.3 Node Clustering
Section titled “3.5.3.3 Node Clustering”We further conduct clustering tasks to evaluate the embeddings learned by NSHE. Here we utilize the K-Means model to perform node clustering and set the number of clusters for K-Means as the number of classes. The performance in terms of NMI is
3.6 Conclusions
Section titled “3.6 Conclusions”Table 3.8 Performance evaluation of multi-class classification. Bolded values represent the best results
| | DBLP-P | | DBLP-A | | IMDB | | ACM | |---|---|---|---|---|---|---|---|---| | | Micro-F1 | Macro-F1 | Micro-F1 | Macro-F1 | Micro-F1 | Macro-F1 | Micro-F1 | Macro-F1 | | DeepWalk | 90.12 | 89.45 | 89.44 | 88.48 | 56.52 | 55.24 | 82.17 | 81.82 | | LINE-1st | 81.43 | 80.74 | 82.32 | 80.20 | 43.75 | 39.87 | 82.46 | 82.35 | | LINE-2nd | 84.76 | 83.45 | 88.76 | 87.35 | 40.54 | 33.06 | 82.21 | 81.32 | | DHNE | 85.71 | 84.67 | 73.30 | 67.61 | 38.99 | 30.53 | 65.27 | 62.31 | | Metapath2Vec | 92.86 | 92.44 | 89.36 | 87.95 | 51.90 | 50.21 | 83.61 | 82.77 | | HIN2Vec | 83.81 | 83.85 | 90.30 | 89.46 | 48.02 | 46.24 | 54.30 | 48.59 | | HERec | 90.47 | 87.50 | 86.21 | 84.55 | 54.48 | 53.46 | 81.89 | 81.74 | | HeGAN | 88.79 | 83.81 | 90.48 | 89.27 | 58.56 | 57.12 | 83.09 | 82.94 | | NSHE | 95.24 | 94.76 | 93.10 | 92.37 | 59.21 | 58.35 | 84.12 | 83.27 |
Table 3.9 Performance evaluation of node clustering. Bolded values represent the best results
| | DBLP-P | | DBLP-A | | IMDB | | ACM | |---|---|---|---|---|---|---|---|---| | | Micro-F1 | Macro-F1 | Micro-F1 | Macro-F1 | Micro-F1 | Macro-F1 | Micro-F1 | Macro-F1 | | DeepWalk | 46.75 | | 66.25 | | 0.41 | | 48.81 | | LINE-1st | 42.18 | | 29.98 | | 0.03 | | 37.75 | | LINE-2nd | 46.83 | | 61.11 | | 0.03 | | 41.80 | | DHNE | 35.33 | | 21.00 | | 0.05 | | 20.25 | | Metapath2Vec | 56.89 | | 68.74 | | 0.09 | | 42.71 | | HIN2Vec | 30.47 | | 65.79 | | 0.04 | | 42.28 | | HERec | 39.46 | | 24.09 | | 0.51 | | 40.70 | | HeGAN | 60.78 | | 68.95 | | 6.56 | | 43.35 | | NSHE | 65.54 | | 69.52 | | 7.58 | | 44.32 |
shown in Table 3.9. Similarly, the proposed method NSHE significantly outperforms others in most cases, which further demonstrates the effectiveness of NSHE.
The more detailed method description and experiment validation can be seen in [62].
The structures of heterogeneous graphs are complex and contain rich semantic information. In this chapter, we introduce four heterogeneous graph embedding methods with structure preservation. Specifically, we first introduce a meta-path based random walk method, which generates meaningful node sequences for network embedding. Then, we introduce a meta-path based collaborative filtering framework, which uses an attention mechanism to learn aspect-level network embedding. Besides, we introduce a relation-structure aware method, which distinguishes the various relations into two categories for fine-grained modelling. Finally, we introduce a meta-path independent method, which preserves network schema n network embedding. The experiments not only verify the effectiveness of these methods, but also demonstrate the important role of structural information in the embedding of heterogeneous graphs.
Some interesting future works are to explore other possible methods of distinguishing relations, paths, or network schema to better capture the structural information of heterogeneous graphs, and design more effective graph representation learning methods without the need to manually design meta-paths.
References
Section titled “References”-
Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. Preprint. arXiv:1409.0473 (2014)
-
Bordes, A., Usunier, N., Garcia-Duran, A., Weston, J., Yakhnenko, O.: Translating embeddings for modeling multi-relational data. In: Proceedings of Advances in Neural Information Processing Systems, pp. 2787–2795 (2013)
-
Cao, S., Lu, W., Xu, Q.: GraRep: Learning graph representations with global structural information. In: CIKM ‘15: Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 891–900 (2015)
-
Chang, S., Han, W., Tang, J., Qi, G.-J., Aggarwal, C.C., Huang, T.S.: Heterogeneous network embedding via deep architectures. In: Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 119–128. ACM, New York (2015)
-
Danielsson, P.-E.: Euclidean distance mapping. Comput. Graphics Image Process. 14(3), 227–248 (1980)
-
Devlin, J., Chang, M.-W., Lee, K., Toutanova, K.: BERT: pre-training of deep bidirectional transformers for language understanding. Preprint. arXiv:1810.04805 (2018)
-
Dong, Y., Chawla, N.V., Swami, A.: metapath2vec: Scalable representation learning for heterogeneous networks. In: KDD ‘17: Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 135–144 (2017)
-
Faust, K.: Centrality in affiliation networks. Soc. Netw. 19(2), 157–191 (1997)
-
Fu, T.-y., Lee, W.-C., Lei, Z.: Hin2vec: explore meta-paths in heterogeneous information networks for representation learning. In: CIKM ‘17: Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, pp. 1797–1806 (2017)
-
Grover, A., Leskovec, J.: node2vec: scalable feature learning for networks. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 855–864. ACM, New York (2016)
-
Han, X., Shi, C., Wang, S., Philip, S.Y., Song, L.: Aspect-level deep collaborative filtering via heterogeneous information networks. In: Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, pp. 3393–3399 (2018)
-
Harper, F.M., Konstan, J.A.: The movielens datasets: history and context. ACM Trans. Inter. Intell. Syst. 5(4), 19 (2016)
-
He, R., McAuley, J.: Ups and downs: modeling the visual evolution of fashion trends with one-class collaborative filtering. In: WWW ‘16: Proceedings of the 25th International Conference on World Wide Web, pp. 507–517 (2016)
-
He, X., Zhang, H., Kan, M.-Y., Chua, T.-S.: Fast matrix factorization for online recommendation with implicit feedback. In: Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, pp. 549–558 (2016)
-
He, X., Liao, L., Zhang, H., Nie, L., Hu, X., Chua, T.-S.: Neural collaborative filtering. In: WWW ‘17: Proceedings of the 26th International Conference on World Wide Web, pp. 173–182 (2017)
-
Hsieh, C.-K., Yang, L., Cui, Y., Lin, T.-Y., Belongie, S., Estrin, D.: Collaborative metric learning. In: WWW ‘17: Proceedings of the 26th International Conference on World Wide Web, pp. 193–201 (2017)
-
Hu, B., Fang, Y., Shi, C.: Adversarial learning on heterogeneous information networks. In: KDD ‘19: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 120–129 (2019)
-
Ji, M., Han, J., Danilevsky, M.: Ranking-based classification of heterogeneous information networks. In: Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1298–1306 (2011)
-
Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization. In: 3rd International Conference for Learning Representations (2015)
-
Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: Proceedings of the 5th International Conference on Learning Representations (2017)
-
Koren, Y., Bell, R., and Volinsky, C.: Matrix factorization techniques for recommender systems. Computer 42, 8 (2009)
-
Linmei, H., Yang, T., Shi, C., Ji, H., Li, X.: Heterogeneous graph attention networks for semi-supervised short text classification. In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4823–4832 (2019)
-
Lu, Y., Shi, C., Hu, L., Liu, Z.: Relation structure-aware heterogeneous information network embedding. In: Proceedings of the AAAI Conference on Artificial Intelligence, pp. 4456–4463 (2019)
-
Ma, H., Zhou, D., Liu, C., Lyu, M.R., King, I.: Recommender systems with social regularization. In: Proceedings of the Fourth ACM International Conference on Web Search and Data Mining, pp. 287–296 (2011)
-
McAuley, J., Targett, C., Shi, Q., Van Den Hengel, A.: Image-based recommendations on styles and substitutes. In: Proceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 43–52 (2015)
-
Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., Dean, J.: Distributed representations of words and phrases and their compositionality. In: NIPS’13: Proceedings of the 26th International Conference on Neural Information Processing Systems, pp. 3111–3119 (2013)
-
Mnih, A., Salakhutdinov, R.R.: Probabilistic matrix factorization. Adv. Neural Inf. Proces. Syst. 20, 1257–1264 (2007)
-
Perozzi, B., Al-Rfou, R., Skiena, S.: Deepwalk: online learning of social representations. In: KDD ‘14: Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 701–710 (2014)
-
Pham, T.-A.N., Li, X., Cong, G., Zhang, Z.: A general recommendation model for heterogeneous networks. IEEE Trans. Knowl. Data Eng. 28(12), 3140–3153 (2016)
-
Rendle, S.: Factorization machines with libFM. ACM Trans. Intell. Syst. Technol. 3(3), 1–22 (2012)
-
Rendle, S., Freudenthaler, C., Gantner, Z., Schmidt-Thieme, L.: BPR: bayesian personalized ranking from implicit feedback. In: UAI ‘09: Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, pp. 452–461 (2009)
-
Sarwar, B., Karypis, G., Konstan, J., Riedl, J.: Item-based collaborative filtering recommendation algorithms. In: Proceedings of the 10th International Conference on World Wide Web, pp. 285–295 (2001)
-
Shang, J., Qu, M., Liu, J., Kaplan, L.M., Han, J., Peng, J.: Meta-path guided embedding for similarity search in large-scale heterogeneous information networks. Preprint. arXiv:1610.09769 (2016)
-
Shi, C., Kong, X., Huang, Y., Philip, S.Y., Wu, B.: HeteSim: a general framework for relevance measure in heterogeneous networks. IEEE Trans. Knowl. Data Eng. 26(10), 2479–2492 (2014)
Shi, C., Zhang, Z., Luo, P., Yu, P.S., Yue, Y., Wu, B.: Semantic path based personalized recommendation on weighted heterogeneous information networks. In: Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 453–462. ACM, New York (2015)
-
Shi, C., Han, X., Li, S., Wang, X., Wang, S., Du, J., Yu, P.: Deep collaborative filtering with multi-aspect information in heterogeneous networks. IEEE Trans. Knowl. Data Eng. (2019)
-
Shi, C., Hu, B., Zhao, W.X., Yu, P.S.: Heterogeneous information network embedding for recommendation. IEEE Trans. Knowl. Data Eng. 31(2), 357–370 (2019)
-
Sun, Y., Yu, Y., Han, J.: Ranking-based clustering of heterogeneous information networks with star network schema. In: Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 797–806 (2009)
-
Sun, Y., Han, J., Yan, X., Yu, P.S., Wu, T.: PathSim: meta path-based top-k similarity search in heterogeneous information networks. Proc. VLDB Endow. 4(11), 992–1003 (2011)
-
Sun, Y., Han, J., Yan, X., Yu, P.S., Wu, T.: PathSim: meta path-based top-k similarity search in heterogeneous information networks. Proc. VLDB Endow. 4(11), 992–1003 (2011)
-
Sun, Y., Norick, B., Han, J., Yan, X., Philip, S.Y., Yu, X.: Integrating meta-path selection with user-guided object clustering in heterogeneous information networks. In: ACM Transactions on Knowledge Discovery from Data (2012)
-
Tang, J., Zhang, J., Yao, L., Li, J., Zhang, L., Su, Z.: ArnetMiner: extraction and mining of academic social networks. In: Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 990–998. ACM, New York (2008)
-
Tang, J., Qu, M., Mei, Q.: PTE: predictive text embedding through large-scale heterogeneous text networks. In: Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1165–1174. ACM, New York (2015)
-
Tang, J., Qu, M., Wang, M., Zhang, M., Yan, J., Mei, Q.: Line: large-scale information network embedding. In: Proceedings of the 24th International Conference on World Wide Web, pp. 1067–1077 (2015)
-
Tu, K., Cui, P., Wang, X., Wang, F., Zhu, W.: Structural deep embedding for hyper-networks. In: Thirty-Second AAAI Conference on Artificial Intelligence, pp. 426–433 (2018)
-
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Advances in Neural Information Processing Systems, pp. 5998–6008 (2017)
-
Wang, X., Cui, P., Wang, J., Pei, J., Zhu, W., Yang, S.: Community preserving network embedding. In: Thirty-First AAAI Conference on Artificial Intelligence (2017)
-
Wang, H., Zhang, F., Hou, M., Xie, X., Guo, M., Liu, Q.: SHINE: signed heterogeneous information network embedding for sentiment link prediction. In: Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pp. 592–600. ACM, New York (2018)
-
Wang, X., Ji, H., Shi, C., Wang, B., Ye, Y., Cui, P., Yu, P.S.: Heterogeneous graph attention network. In: The World Wide Web Conference, pp. 2022–2032 (2019)
-
Wang, Y., Chen, L., Che, Y., Luo, Q.: Accelerating pairwise SimRank estimation over static and dynamic graphs. VLDB J. Int. J. Very Large Data Bases 28(1), 99–122 (2019)
-
Wasserman, S., Faust, K.: Social Network Analysis: Methods and Applications, vol. 8. Cambridge University Press, Cambridge (1994)
-
Wei, Z., He, X., Xiao, X., Wang, S., Liu, Y., Du, X., Wen, J.-R.: PRsim: sublinear time SimRank computation on large power-law graphs. Preprint. arXiv:1905.02354 (2019)
-
Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., Zemel, R., Bengio, Y.: Show, attend and tell: neural image caption generation with visual attention. In: International Conference on Machine Learning, pp. 2048–2057 (2015)
-
Xu, L., Wei, X., Cao, J., Yu, P.S.: Embedding of embedding (EOE): joint embedding for coupled heterogeneous networks. In: WSDM ‘17: Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, pp. 741–749. ACM, New York (2017)
-
Xue, H., Dai, X., Zhang, J., Huang, S., Chen, J.: Deep matrix factorization models for recommender systems. In: Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, pp. 3203–3209 (2017)
-
Yang, J., Leskovec, J.: Community-affiliation graph model for overlapping network community detection. In: 2012 IEEE 12th International Conference on Data Mining, pp. 1170–1175. IEEE, Piscataway (2012)
-
You, Q., Jin, H., Wang, Z., Fang, C., Luo, J.: Image captioning with semantic attention. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4651–4659 (2016)
-
Yu, X., Ren, X., Gu, Q., Sun, Y., Han, J.: Collaborative filtering with entity similarity regularization in heterogeneous information networks. IJCAI HINA 27 (2013)
-
Zhang, J., Tang, J., Ma, C., Tong, H., Jing, Y., Li, J.: Panther: fast top-k similarity search on large networks. In: Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1445–1454 (2015)
-
Zhang, J., Xia, C., Zhang, C., Cui, L., Fu, Y., Philip, S. Y.: BL-MNE: Emerging heterogeneous social network embedding through broad learning with aligned autoencoder. In: 2017 IEEE International Conference on Data Mining (ICDM), pp. 605–614. IEEE, Piscataway (2017)
-
Zhao, H., Yao, Q., Li, J., Song, Y., Lee, D.: Meta-graph based recommendation fusion over heterogeneous information networks. In: Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 635–644 (2017)
-
Zhao, J., Wang, X., Shi, C., Liu, Z., Ye, Y.: Network schema preserving heterogeneous information network embedding. In: Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pp. 1366–1372. IJCAI, ijcai.org (2020)
-
Zheng, J., Liu, J., Shi, C., Zhuang, F., Li, J., Wu, B.: Recommendation in heterogeneous information network via dual similarity regularization. Int. J. Data Sci. Anal. 3(1), 35–48 (2017)