A heterogeneous network graph link prediction method for movie recommendation system

Through edge sequence coding and custom graph neural network optimization model, the problems of heterogeneous graph neural network loss and high computing resource consumption in link prediction tasks are solved, and efficient expression and performance improvement of heterogeneous graphs are achieved, and personalized Movie recommendation.

CN118606493BActive Publication Date: 2025-01-14ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410659014.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2025-01-14
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

Existing heterogeneous graph neural networks have problems of information loss and high computing resource consumption in link prediction tasks. The shallow model relies on structural information and the deep model is complex, making it difficult to effectively capture the position distance information between nodes.

Method used

Using a new link prediction algorithm based on heterogeneous graph data structure information, node embedding is generated through edge sequence encoding, custom graph neural network optimization model is used, and link relationship prediction is carried out in combination with multi-layer perceptual neural network, relying only on edge structure information to avoid information Lost.

Benefits of technology

Effectively fusing the position distance information between nodes improves the expression ability of heterogeneous graphs, improves model performance, reduces information loss, and expands the universality of the model and the effectiveness of data set verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606493B_ABST
    Figure CN118606493B_ABST
Patent Text Reader

Abstract

A heterogeneous network graph link prediction method for a movie recommendation system comprises: S1 obtaining all data of a movie data set, cleaning relevant data according to the requirements of the project to construct a movie heterogeneous graph network; S2 selecting a node set to be linked and predicted, extracting node features of the movie heterogeneous graph based on the structural information of the heterogeneous graph network, and obtaining representation information of all nodes in the movie data set, including initial embedding feature representations of movies, directors, and actors; S3 based on the embedding information of all nodes in the movie heterogeneous graph structure, respectively transmitting the initial embeddings of sample pairs in a graph neural network, and concatenating the vector representations of the node pairs, and finally learning And map the feature vector of the node pair to the specified dimension; S4 splices the specified vector mapped in the previous step through the link prediction method, and then puts it into the multi-layer perception neural network to predict the link relationship of the embedded dimension information of the node pair, and predicts the potential link relationship value between the node pairs; S5 calculates the loss of the model based on the potential link relationship and continuously trains the model until convergence; S6 adds new nodes to the heterogeneous graph of movie data, integrates the new nodes into the graph structure, predicts the degree of correlation between the new nodes and the old nodes according to the model, and recommends new nodes with a high degree of correlation with the old nodes that the users often contact to the users to achieve intelligent recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a link prediction method for a movie recommendation system. Background Art

[0002] With the rapid development of the Internet and information technology, people have generated a large amount of data in various fields. These data often have multiple types and associations. For example, in social networks, there are different types of links between users, such as friend relationships and like relationships; in knowledge graphs, there are different types of relationships between entities, such as author-paper, movie-actor, etc. This type of graph data containing two or more different types of nodes and relationships is heterogeneous graph data. The movie recommendation system dataset is a typical heterogeneous graph data in terms of data structure. It contains multiple types of nodes such as movies and movie stars, and multiple link relationships such as movie-actor, actor-director, etc.

[0003] The technology of mapping graph structure data to low-dimensional vector space can better capture the relationship and similarity between nodes by learning the representation vectors of nodes and edges. This technology is called graph embedding representation learning. The link prediction task is to predict the unknown connection relationship that may exist in the graph based on the known node and edge information. This can help us discover potential association patterns and hidden information, and provide important support for applications such as recommendation systems and information retrieval. Therefore, combining graph embedding representation learning technology with link prediction tasks can effectively mine potential relationships in heterogeneous graph data and improve the effect and accuracy of data analysis.

[0004] The current research on heterogeneous graph neural networks is divided into shallow models that mainly target heterogeneous structures and deep models with larger parameters. The big difference is that shallow models use random walks, subgraph decomposition, etc. to make heterogeneous images isomorphic through graph structures. Figure 1 However, this method greatly destroys the original structural information of the heterogeneous graph neural network, causing more information loss and affecting the model performance; the deep model network uses adversarial, reinforcement learning, meta-structure and other contents, which increases the workload of data preprocessing or model parameters to achieve greater gains in complex application scenarios. This type of model requires a lot of time and computing power to support training. Summary of the invention

[0005] In order to overcome the above shortcomings of the prior art, the heterogeneous graph representation learning technology has both the characteristics of shallow models that only rely on structural information and the advantages of deep models that aggregate node distance information. The present invention provides a new link prediction algorithm based only on heterogeneous graph data structure information for movie data in the recommendation system.

[0006] The present invention generates initial embedding for the node pairs to be predicted based on the edge sequence in the heterogeneous graph data structure information, obtains the vector representation of the node, and then optimizes the node vector representation of the model through a customized graph neural network method, and finally completes the link prediction task.

[0007] A heterogeneous network graph link prediction method for a movie recommendation system of the present invention comprises:

[0008] S1 obtains all the data in the movie dataset, and according to the requirements of the project, cleans out the relevant data to build a movie heterogeneous graph network;

[0009] S2 selects a node set to be linked and predicted, extracts node features from the movie heterogeneous graph based on the structural information of the heterogeneous graph network, and obtains representation information of all nodes in the movie dataset, including initial embedded feature representations of movies, directors, and actors;

[0010] S3 performs message passing on the initial embeddings of the sample pairs in the graph neural network based on the embedding information of all nodes in the movie heterogeneous graph structure, and concatenates the vector representations of the node pairs, and finally learns and maps the feature vectors of the node pairs to the specified dimension;

[0011] S4 concatenates the specified vectors mapped in the previous step by means of link prediction, and then puts them into a multi-layer perceptron neural network to predict the link relationship of the embedded dimension information of the node pair, and predicts the potential link relationship value between the node pairs;

[0012] S5 calculates the loss of the model based on the potential link relationship and continuously trains the model until convergence;

[0013] S6 adds new nodes to the heterogeneous graph of movie data, integrates the new nodes into the graph structure, predicts the degree of correlation between the new nodes and the old nodes based on the model, and recommends new nodes with a high degree of correlation with the old nodes that the users often contact to users to achieve intelligent recommendation.

[0014] Wherein, step S1 comprises:

[0015] S11. Clean the original data of the movie recommendation system and filter out invalid data in the original data set, such as the initial feature information of movies and movie star data;

[0016] S12. Use the cleaned data to construct a heterogeneous structure information dataset; retain the edge relationship of the cleaned data to construct a binary;

[0017] S13. Dataset division: randomly divide the binary data set into training set, test set and validation set according to the required proportion.

[0018] Wherein, step S2 comprises:

[0019] S21. First, generate positive and negative sample pairs for the binary data. The binary in the data is a set of positive sample pairs. At the same time, randomly select a node from the data set and pair it with a node in the previous binary to generate a negative sample pair.

[0020] S22. Next, a merged subgraph of the positive and negative sample pairs of nodes is generated respectively, and edge sequence encoding and sample type encoding are performed on all nodes in the sample subgraph to complete the initial encoding of the sample nodes;

[0021] S23. Finally, vector concatenation is performed on the initial embedding representations of the neighboring nodes of each order of the sample pair node to generate the initial embeddings of the sample nodes respectively.

[0022] Wherein, step S3 comprises:

[0023] S31. Extract the initial embedding of the sample pair, split the input initial embedding vector into sample pair nodes and embedding vectors of neighbor nodes of each order according to the specified length;

[0024] S32. Aggregate neighbor nodes of each order and concatenate neighbor node vectors of different orders in order of the order of the order;

[0025] S33. Map the aggregated vector to a specified dimension.

[0026] Wherein, step S4 comprises:

[0027] S41. concatenate the specified vectors mapped in the previous step, and then put them into a two-layer fully connected neural network, both using the LeackyRelu activation function with a slope of 0.4;

[0028] S42. Input the above hidden layer vector result into a fully connected layer to obtain the link prediction value.

[0029] Wherein, step S5 comprises:

[0030] S51. Through the above steps, the output prediction value is obtained, and the cross entropy is used as the loss function to calculate the loss between the prediction value and the actual label value;

[0031] S52. Use the commonly used indicators AUC and ACC to quantitatively evaluate the link prediction algorithm;

[0032] S53. When the loss function is below a reasonable value or the AUC and ACC indicators tend to be stable for a long time, the training model is considered to have converged.

[0033] Wherein, step S6 comprises:

[0034] S61 adds a new director, movie or actor node to the movie system data set, integrating the new information into the graph data set;

[0035] S62. predicting the associations between these new entities and other entities using the trained model;

[0036] S63. Locate the user based on the old nodes that the user has contacted in the original graph, and perform link prediction calculations on these old nodes and new nodes;

[0037] S64. The model will recommend the movies, directors and actors with the highest link prediction scores to users, thus achieving personalized movie recommendations.

[0038] The advantages of the present invention are: it can effectively integrate the location distance information between nodes, improving the expression ability of heterogeneous graphs; and the algorithm only uses the edge structure information of the heterogeneous graph, avoiding the problem of missing attribute features of a certain type of nodes in some data sets or different feature dimensions of different types of nodes in heterogeneous graphs, using the least information to pursue the best performance, greatly expanding the versatility of the model, and supporting more public data sets to verify the effectiveness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0040] The present invention will be further described below in conjunction with the accompanying drawings.

[0041] Example 1

[0042] This embodiment relates to a heterogeneous network graph link prediction method for a movie recommendation system. The process of the recommendation system link prediction algorithm based on edge sequence coding is as follows: Figure 1 As shown;

[0043] The specific steps are as follows:

[0044] Step 1: Data preprocessing part;

[0045] 1.1 Data cleaning: Clean the original data of the movie recommendation system and filter out invalid data in the original data set, such as the initial feature information of movies and movie star data;

[0046] 1.2 Use the cleaned data to construct a heterogeneous structure information data set; retain the edge relationship of the cleaned data and construct the following tuple:

[0047] (Src,Des)(1.1)

[0048] Among them, Src represents the head node, and Des represents the tail node. If there is such a tuple in the data set, it means that there is an edge between these two nodes;

[0049] 1.3 Dataset division: randomly divide the binary data set into training set, test set and validation set according to the required proportion;

[0050] Step 2: Generate heterogeneous graph node embedding representation;

[0051] 2.1 First, generate positive and negative sample pairs for the binary data. The binary pairs Src and Des are a positive sample pair. At the same time, randomly select a node NodeX from the data set and pair it with the Src node of the previous binary pair to generate the following negative sample pair:

[0052] (Src,NodeX) (2.1)

[0053] Among them, Src represents the head node and NodeX represents the tail node.

[0054] 2.2 Secondly, generate the merged subgraphs of the positive and negative sample pairs of nodes respectively, perform edge sequence encoding and sample type encoding on all nodes in the sample subgraph, and complete the initial encoding of the sample nodes:

[0055] Extract k-order subgraphs from the two nodes of the positive sample pair respectively, and get and After merging the two subgraphs, delete the edge information connecting the two nodes of the positive sample to obtain the processed merged subgraph

[0056] Next, the merged subgraph Initial embedding code of nodes, find all subgraph nodes NodeN The shortest paths to the Src node and the Des node respectively, record the type and order of the edges passed by the shortest path, and save these edge sequences into a list for storage.

[0057] First initialize a vector Vec with a length of neigh whose values ​​are all 0.0 neigh .

[0058] Then, based on this edge sequence, the onehot encoding strategy is used for encoding. If the edge sequence is an edge from the Src node type to the Des node type, it is encoded as [0.0, 1.0]; on the contrary, if the edge is an edge from the Des node type to the Src node type, it is encoded as [1.0, 0.0]; if there is no edge sequence, that is, there is no path that can be reached, no encoding is required. In order, the onehot encoding of this mechanism is overwritten in sequence on Vec neigh (Only covers the data space of length neigh, if it exceeds the vector Vec neigh If the length of neigh, then do not continue encoding)

[0059] Convert NodeN to Src node's Vec NodeN,Src Vec from NodeN to Des node NodeN,Des The splicing is as follows:

[0060] Vec NodeN =Vec NodeN,Src ||Vec NodeN,Des (2.2)

[0061] Among them, Vec NodeN represents the concatenated vector, and || represents the vector concatenation operation. Then the attributes of NodeN are encoded using onehot. If the attributes of NodeN and Src are the same, they are encoded as [1.0, 0.0], otherwise they are encoded as [0.0, 1.0]. The attribute encoding is Represents. Then Vec NodeN and Splicing, as shown below:

[0062]

[0063] Among them, Vec' NodeN Represents a merged subgraph The initial embedding representation of each node in .

[0064] Then randomly select the neighbor nodes of the sample node according to the set parameter num (if a node does not have num neighbor nodes, it can repeatedly select existing neighbor nodes or its own nodes to meet the number of num), and then splice these nodes:

[0065] Vec' Node_k =Vec' k_1 ||...|||Vec' k_num (2.4)

[0066] Among them, Vec' Node_k Represents the k-order neighbor embedding concatenation vector of Node node, Vec' k_num Represents the embedding vector of the num-th neighbor node of Node at order k.

[0067] Finally, the initial embedding representations of the neighboring nodes of each order of the sample pair node are concatenated to generate the initial embedding of the sample node respectively;

[0068] The initial embedding of the positive sample is as follows:

[0069] Vec Src&Des =Vec' Src ||Vec' Src_1 ||...||Vec' Src_k ||Vec' Des ||Vec'Des_1 ||...||Vec' Des_k (2.5)

[0070] Similarly, the initial embedding of negative samples is as follows:

[0071] Vec Src&NodeX =Vec' Src ||Vec' Src_1 ||...||Vec' Src_k ||Vec' NodeX ||Vec' NodeX_1 ||...||Vec' NodeX_k (2.6)

[0072] Among them, Vec Src&Des Represents the complete initial embedding of the positive sample, Vec' Src Represents the edge sequence encoding of the Src node itself, Vec' Src_k Represents the k-order node vector of the Src node, and the same applies to the others.

[0073] Step 3: Map the initial embeddings of the positive and negative sample pairs to embeddings of specified dimensions in the graph neural network respectively;

[0074] 3.1 Extract the initial embedding of the sample pair; split the input initial embedding vector into sample pair nodes and embedding vectors of neighbor nodes of each order according to the specified length;

[0075] 3.2 Aggregate neighbor nodes of each order and concatenate neighbor node vectors of different orders;

[0076]

[0077] Among them, Vec' neigh Represents the final vector after aggregation and concatenation of neighbors of each order, Vec' neigh_knum A vector representation of the num-th node representing its k-th neighbors.

[0078] 3.3 Map the aggregated vector to the specified dimension; use a fully connected layer on the input vector, followed by an activation function of an exponential linear unit. Specifically expressed as:

[0079] Vec=ELU(W2·ELU(W1·Vec' neigh +b1)+b2) (3.2)

[0080] Among them, Vec represents the specified dimension mapping vector of the aggregate vector, ELU represents the exponential linear unit activation function, W1 and W2 represent the trainable parameter matrix, and Vec' neigh represents the final vector after aggregation and concatenation of neighbors of each order, and b1 and b2 represent trainable bias terms.

[0081] The ELU activation function is expressed as follows:

[0082]

[0083] Wherein, x is an input vector, and the α value of the present invention is 0.2.

[0084] Step 4: Implement the link prediction network; specifically, concatenate the specified vectors mapped in the previous step and put them into a three-layer fully connected neural network;

[0085] The outputs of the first two layers are:

[0086] h=LeakyReLU(W2·ELU(W1·Vec+b1)+b2) (4.1)

[0087] Where h represents the output intermediate hidden layer vector, LeakyReLU represents a ReLU-like activation function with adjustable slope, Vec represents the vector mapped in the previous step, and the rest are trainable parameters.

[0088] The LeakyReLU activation function here is expressed as follows:

[0089]

[0090] The β value of the present invention is 0.4.

[0091] The last layer, the output prediction is:

[0092] PRE=W3·h+b3 (4.3)

[0093] Among them, PRE represents the predicted output value, h represents the hidden layer vector of the first two layers output, W3 represents the trainable parameter matrix, and b3 represents the trainable bias term.

[0094] Step 5: Loss calculation and prediction scoring;

[0095] Through the above steps, the output prediction value can be obtained, and the prediction value and the actual label value can be calculated;

[0096] The loss function Loss for rating prediction is as follows:

[0097]

[0098] Among them, N represents the number of sample pairs calculated in this batch, y i represents the true label of the i-th pair, Represents the predicted value of the i-th pair, and σ represents the Sigmoid activation function.

[0099] The Sigmoid activation function formula is as follows:

[0100]

[0101] The link prediction algorithm is quantitatively evaluated by two commonly used indicators, AUC and ACC; the AUC formula is as follows:

[0102]

[0103] Among them, σ represents the Sigmoid activation function, are the predicted positive and negative sample pair scores, Num pos 、Num neg are the number of positive and negative sample pairs respectively; the I function is as follows:

[0104]

[0105] The calculation formula of ACC indicator is as follows:

[0106]

[0107] Among them, Num pos 、Num neg are the number of positive and negative sample pairs respectively, and the J function is as follows:

[0108]

[0109] in, represents the predicted value, y represents the true label, σ represents the Sigmoid activation function, Represents a floor operation.

[0110] Step 6: Train the model until convergence and implement movie recommendations;

[0111] Through the above steps, the model can be continuously trained until the loss function Loss converges. At this time, the ACC and AUC of the model reach an ideal state. We believe that the model can be migrated to the recommendation system at this time, so as to design an interactive recommendation system. When new director, movie or actor nodes are added to the system, this new information will be integrated into the graph dataset, and the association between these new entities and other entities will be predicted through the trained model. The model will recommend the movies, directors and actors with the highest link prediction scores to users, thereby realizing personalized movie recommendations.

[0112] Example 2

[0113] Suppose we conduct a link prediction task experiment on the director-movie dataset of Douban movie dataset. The dataset is divided into 733 training edges, 246 validation edges, and 244 test edges in a ratio of 6:2:2.

[0114] The encoding method of the present invention is used to perform graph representation learning on the data set, and the steps are as follows: 1. Generate heterogeneous graph node embedding representation.

[0115] 1.1 Set the case data hyperparameters: the neighbor node order is 2, the number of neighbor nodes per order is set to 5, the edge sequence encoding length is 8, and the mapping embedding dimension is 64 dimensions.

[0116] 1.2 Extract 32 sets of positive sample pairs (Src, Des) in each batch of the data set, and randomly select negative sample nodes NodeX to generate 32 sets of negative sample pairs (Src, NodeX); based on the positive and negative sample pairs, generate 2nd-order merged subgraphs respectively

[0117] 1.3 Encoding of each node in the subgraph: Each node must encode one of the node pairs with an edge sequence of length 8. Specifically, each node is encoded according to onehot. If the edge sequence is an edge from the Src node type to the Des node type, it is encoded as [0.0, 1.0]; on the contrary, if the edge is an edge from the Des node type to the Src node type, it is encoded as [1.0, 0.0]; if there is no edge sequence, that is, there is no path to reach, no encoding is required. Then, after encoding the node attributes with a onehot encoding of length 2, it is concatenated with the edge sequence encoding to the node pair. The dimension of the initial embedding vector of each node is 18 (8+8+2).

[0118] 2. Obtain the initial embedding of positive and negative sample pairs and map them to the specified dimension.

[0119] 2.1 Generate the initial embedding vector of the sample node pair: Randomly select 5 first-order neighbor nodes for the sample pair node, and then randomly select 5 connected nodes from these 5 first-order neighbor nodes as second-order neighbor nodes. (When randomly selecting neighbor nodes, repeated selection is allowed and you can also select yourself) These selected nodes are in the order of sample pair node, first-order neighbor node of sample pair node, and second-order neighbor node, and the vector obtained in the first step is concatenated. Each group of positive and negative sample pairs will get an initial embedding vector of 1116 dimensions [(1+5+25)*18*2].

[0120] 2.2 Map the initial vector to the specified dimension: Aggregate neighbor nodes of each order and concatenate neighbor node vectors of different orders. Add 25 vectors of length 18 of order 2 in 5 segments and divide by 5 to obtain a 5*18-dimensional aggregated vector. Concatenate the aggregated 2-dimensional vector with the 1-dimensional vector to obtain a 2*5*18-dimensional neighbor concatenation vector, which is mapped to a 64-dimensional embedding vector using a fully connected layer.

[0121] 3-node set vector concatenation as input.

[0122] 3.1 Embedding vectors of spliced ​​sample pairs: Both positive and negative sample pairs have two 64-dimensional embedding vectors. They are spliced ​​separately, and both positive and negative sample pairs obtain 128-dimensional spliced ​​embedding vectors.

[0123] 3.2 Input the concatenated embedding vector into the link prediction network: After passing through a three-layer fully connected neural network, the output link prediction value is obtained.

[0124] 4 Output the prediction result score.

[0125] After calculating the loss of the predicted value output by the neural network and the data set label according to the cross entropy loss function, the losses of all groups are accumulated and averaged, and the loss value of the training set data of this batch is output.

[0126] Then, according to the calculation formula of AUC and ACC, under the parameters of this round of model, the AUC and ACC indicators of the training set, validation set and test set are output.

[0127] 5 training iterations.

[0128] After the calculation of this batch of data sets is completed, steps 1 to 4 are used as a complete iterative process. The iterations are repeated until the loss function gradually decreases and converges after the specified number of iterations. The AUC and ACC indicators finally output are the optimal indicators of the algorithm, and the training is stopped at this time.

[0129] 6. Implement a movie recommendation system.

[0130] After the model is trained, it can be made into a personalized movie recommendation system that uses heterogeneous graphs to represent different entities (such as directors and film festivals) and the relationships between them (i.e., edges). When new director or movie nodes appear in the system, this new information is integrated into the graph dataset, and the trained model is used to predict the association between these new entities and other entities. By generating a merged subgraph and calculating the embedded representation, the model can output a link prediction score. The higher the score, the more relevant or popular the link (or item) may be to the user, so it will be ranked higher in the recommendation list. In summary, the model provides highly reliable related node recommendations for users of the movie system, which helps the movie viewing system to achieve more accurate content distribution and commercial recommendations.

[0131] So far, the specific implementation steps of the invention have been described.

[0132] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.

Claims

1. A heterogeneous network graph link prediction method for movie recommendation system, characterized in that: include: S1 obtains all the data in the movie dataset, and cleans out the relevant data to build a movie heterogeneous graph network according to the needs; S2 selects a node set to be linked and predicted, extracts node features from the movie heterogeneous graph based on the structural information of the heterogeneous graph network, and obtains representation information of all nodes in the movie dataset, including initial embedded feature representations of movies, directors, and actors; The specific steps include: S21 first generates positive and negative sample pairs for the binary data. The binary pairs Src and Des are a positive sample pair. At the same time, a node NodeX is randomly selected from the data set and paired with the Src node of the previous binary pair to generate the following negative sample pair: (Src,NodeX)(2.1) Where Src represents the head node and NodeX represents the tail node; S22 then generates merged subgraphs of the positive and negative sample pairs of nodes, performs edge sequence encoding and sample type encoding on all nodes in the sample subgraph, and completes the initial encoding of the sample nodes: Extract k-order subgraphs from the two nodes of the positive sample pair respectively, and get and After merging the two subgraphs, delete the edge information connecting the two nodes of the positive sample to obtain the processed merged subgraph Next, the merged subgraph Initial embedding code of nodes, find all subgraph nodes The shortest paths to the Src node and the Des node respectively, record the type and order of the edges passed by the shortest path, and save these edge sequences into a list for storage; First initialize a vector Vec with a length of neigh whose values ​​are all 0.0 neigh ; Then, according to this edge sequence, the onehot encoding strategy is used for encoding. If the edge sequence is an edge from the Src node type to the Des node type, it is encoded as [0.0, 1.0]; on the contrary, if the edge is an edge from the Des node type to the Src node type, it is encoded as [1.0, 0.0]; if there is no edge sequence, that is, there is no path that can be reached, no encoding is required; in order, the onehot encoding of this mechanism is overwritten in sequence on Vec neigh data; only covers the data space of length neigh, if it exceeds the vector Vec neigh If the length of neigh, do not continue encoding; Convert NodeN to Src node's Vec NodeN,Src Vec from NodeN to Des node NodeN,Des The splicing is as follows: Thing NodeN =Thing NodeN,Src ||Thing NodeN,Des (2.2) Among them, Vec NodeN represents the concatenated vector, and || represents the vector concatenation operation. Then the attributes of the NodeN node are encoded using onehot. If the attributes of the NodeN and Src nodes are the same, they are encoded as [1.0, 0.0], otherwise they are encoded as [0.0, 1.0]. The NodeN node attribute encoding is Represents; then Vec NodeN and Splicing, as shown below: Among them, Vec' NodeN Represents a merged subgraph The initial embedding representation of each node in ; Then randomly select the neighbor nodes of the sample node according to the set parameter num; if a node does not have num neighbor nodes, it can repeatedly select existing neighbor nodes or its own nodes to meet the number of num, and then splice these nodes: Thing Node_k =Thing' k_1 ||...||The Thing k_num (2.4) Among them, Vec' Node_k Represents the k-order neighbor embedding concatenation vector of Node node, Vec' k_num Represents the embedding vector of the numth neighbor node of the Node node at order k; Finally, the initial embedding representations of the neighboring nodes of each order of the sample pair node are concatenated to generate the initial embedding of the sample node respectively; The initial embedding of the positive sample is as follows: Thing Src&Des =Thing' Src ||Thing Src_1 ||...||The Thing Src_k ||Thing Des ||Thing Des_1 ||...||The Thing Des_k (2.5) Similarly, the initial embedding of negative samples is as follows: Thing Src&NodeX =Thing' Src ||Thing Src_1 ||...||The Thing Src_k ||Thing NodeX ||Thing NodeX_1 ||...||The Thing NodeX_k (2.6) Among them, Vec Src&Des Represents the complete initial embedding of the positive sample, Vec' Src Represents the edge sequence encoding of the Src node itself, Vec' Src_k k-order node vector representing the Src node; S3 performs message passing on the initial embeddings of the sample pairs in the graph neural network based on the embedding information of all nodes in the structure of the movie heterogeneous graph, and concatenates the vector representations of the node pairs, and finally learns and maps the feature vectors of the node pairs to the specified dimension; S4 concatenates the specified vectors mapped in the previous step by means of link prediction, and then puts them into a multi-layer perceptron neural network to predict the link relationship of the embedded dimension information of the node pair, and predicts the potential link relationship value between the node pairs; S5 calculates the loss of the model based on the potential link relationship and continuously trains the model until convergence; calculates the predicted value and the actual label value; The loss function Loss for rating prediction is as follows: Among them, N represents the number of sample pairs calculated in this batch, y i represents the true label of the i-th pair, represents the predicted value of the i-th pair, and σ represents the Sigmoid activation function; The Sigmoid activation function formula is as follows: The link prediction algorithm is quantitatively evaluated using two commonly used indicators, AUC and ACC; The AUC formula is as follows: Among them, σ represents the Sigmoid activation function, are the predicted positive and negative sample pair scores, Num pos 、Num neg are the number of positive and negative sample pairs respectively; the I function is as follows: The calculation formula of ACC indicator is as follows: Among them, Num pos 、Num neg are the number of positive and negative sample pairs respectively, and the J function is as follows: in, represents the predicted value, y represents the true label, σ represents the Sigmoid activation function, Represents a round-down operation; S6 adds new nodes to the heterogeneous graph of movie data, integrates the new nodes into the graph structure, predicts the degree of correlation between the new nodes and the old nodes based on the model, and recommends new nodes with a high degree of correlation with the old nodes that the users often contact to users to achieve intelligent recommendation.

2. The heterogeneous network graph link prediction method for movie recommendation system according to claim 1, characterized in that: Step S1 includes: S11. Clean the original data of the movie recommendation system and filter out invalid data in the original data set, such as the initial feature information of movies and movie star data; S12. Use the cleaned data to construct a heterogeneous structure information dataset; retain the edge relationship of the cleaned data to construct a binary; S13. Dataset division: randomly divide the binary data set into training set, test set and validation set according to the required proportion.

3. The heterogeneous network graph link prediction method for movie recommendation system according to claim 1, characterized in that: Step S3 includes: S31. Extract the initial embedding of the sample pair, split the input initial embedding vector into sample pair nodes and embedding vectors of neighbor nodes of each order according to the specified length; S32. Aggregate neighbor nodes of each order and concatenate neighbor node vectors of different orders in order of the order of the order; S33. Map the aggregated vector to a specified dimension.

4. The heterogeneous network graph link prediction method for movie recommendation system according to claim 1, characterized in that: Step S4 includes: S41. concatenate the specified vectors mapped in the previous step, and then put them into a two-layer fully connected neural network, both using the LeackyRelu activation function with a slope of 0.4; obtain the output hidden layer vector; S42. Input the above hidden layer vector result into a fully connected layer to obtain the link prediction value.

5. The heterogeneous network graph link prediction method for movie recommendation system according to claim 1, characterized in that: Step S6 includes: S61 adds a new director, movie or actor node to the movie system data set, integrating the new information into the graph data set; S62. predicting the associations between these new entities and other entities through the trained model; S63. Locate the user based on the old nodes that the user has contacted in the original graph, and perform link prediction calculations on these old nodes and new nodes; S64. The model will recommend the movies, directors and actors with the highest link prediction scores to users, thus achieving personalized movie recommendations.

Citation Information

Patent Citations

  • Prediction method and system based on heterogeneous graph neural network model

    CN111400560A

  • Top-K movie recommendation method based on heterogeneous information network embedding

    CN112364245A