A dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton
By employing a dynamic heterogeneous graph neural network method based on graph cellular automata, the problems of dynamic user preferences and the influence of environmental factors in heterogeneous graph recommendation are addressed, resulting in more accurate recommendation results and lower computational complexity, thereby improving the model's expressive power and interpretability.
Patent Information
- Application Number
- CN202310527881.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-05-11
AI Technical Summary
Existing heterogeneous graph recommendation algorithms fail to effectively consider the dynamics of user preferences and environmental factors, resulting in a mismatch between recommendation results and contextual information. They also suffer from high computational complexity, poor model interpretability, and difficulty in handling large-scale datasets and generalizing to new data.
A dynamic heterogeneous graph neural network method based on graph cellular automata is adopted. By constructing a dynamic heterogeneous graph, the state transition between nodes is learned by introducing the graph cellular automata structure. Combined with graph reconstruction and local state transition rules, the node state information of users and items is updated. The graph neural network is used to aggregate the neighbor node information to predict the interaction rating of users and items.
It improves the expressive power and accuracy of the recommendation model, better captures the time-series information of nodes, dynamically updates the topology of the graph, enhances the complexity and interpretability of the model, and reduces computational complexity.
Smart Images

Figure CN116595251B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information recommendation of computer technology, and particularly relates to a dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton. BACKGROUND
[0002] A recommendation system is an information filtering system that can predict items that a user may be interested in and recommend these items to the user. Through the mining and analysis of user historical behavior data, and the modeling and processing of item attributes and relationships, a recommendation system can accurately recommend personalized items to users from a vast number of items.
[0003] Heterogeneous graph recommendation algorithm research is a field of recommendation systems in which a graph is formed by user nodes and item nodes, the node types are different, and the types of edges are different, which is used to handle the heterogeneity between users and items, and to realize the representation and recommendation of users and items. Existing heterogeneous graphs mostly only consider node heterogeneity, rarely consider edge heterogeneity, that is, multiple behavior types of user and item interaction, and thus face the following problems:
[0004] (1) Different users have different behavior preferences, and real-time behavior and environmental factors will affect user preferences. Most multi-behavior recommendations are static graphs that only consider historical behavior data, which ignores the influence of real-time behavior and environmental factors on user preferences, that is, the dynamic nature of user preferences, which can lead to a mismatch between the recommended results and the context information, and a decline in the recommendation effect.
[0005] (2) Multi-behavior recommendation usually considers multiple behavior types between users and items, resulting in high computational complexity, difficulty in processing large-scale data sets, high cost, and over-complex models that can cause overfitting and poor generalization when processing new data.
[0006] (3) Existing multi-behavior recommendations use multi-behavior interaction data to alleviate the problem of data sparsity, and mostly consider high-order dependency relationships and correlations between different types of user behavior, which can increase model complexity while reducing model interpretability.
[0007] Therefore, the prior art has the technical problem of inaccurate recommendation results. SUMMARY
[0008] The present application aims to overcome the shortcomings of the prior art and provides a dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton. The present application introduces a graph cellular automaton structure that can effectively learn the state transition between nodes and process dynamic and constantly changing user behavior data, thereby improving the expression ability and recommendation accuracy of the recommendation model.
[0009] The present application is implemented by the following technical solutions:
[0010] A dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton, specifically comprising the following steps:
[0011] S1: Constructing a dynamic heterogeneous graph for users and items according to a user set, an item set, a user behavior type set, and a user behavior type weight;
[0012] S2: Initializing node coordinate information and node feature representation of users and items according to a graph cellular automaton;
[0013] S3: Based on the global rule design of graph reconstruction, the nodes and edges are operated according to different user behaviors and behavior weights, and the dynamic heterogeneous graph of users and items and the adjacency matrix and weight matrix are updated in real time;
[0014] S4: Based on the local state transition rule design of the graph, the node state information of users and items is updated by aggregating the neighbor node information of users and items through a graph neural network method;
[0015] S5: According to the user feature representation and item feature representation after state update, the score of the next moment interaction between users and items is predicted.
[0016] The dynamic heterogeneous graph for users and items is constructed according to the user set, the item set, the user behavior type set, and the user behavior type weight in step S1, and the specific content is as follows:
[0017] The user and the item are abstracted as a node, the interaction behavior type between the user and the item is abstracted as an edge connecting the nodes, and each edge between the user and the item represents the behavior type between the user and the item and the weight of the corresponding behavior type, thereby constructing a dynamic heterogeneous graph:
[0018] Let U represent the user node set in the heterogeneous graph, and U={u1,...,u i ,...,u I}, wherein u i represents the i-th user node, and I represents the total number of nodes in the user node set;
[0019] Let V represent the item node set in the heterogeneous graph, and V={v1,...,v j ,...,v J}, wherein v j represents the j-th item node, and J represents the total number of nodes in the item node set;
[0020] Let E represent the edge set of user behavior types in the heterogeneous graph, and E={e1,...,e m ,...,e M}, wherein em denotes the mth interaction behavior type, and M denotes the total number of edges of the interaction behavior type;
[0021] Let K denote the edge set of the user behavior type weight in the heterogeneous graph, and K = {k1,..., kM}, wherein km denotes the weight of the mth interaction behavior type, M denotes the total number of edges of the user behavior type weight, and e m ,...,k M} is corresponding. m m m
[0022] The step S2 of initializing the node coordinate information and the node feature representation of the user and the item according to the graph cellular automaton is specifically as follows:
[0023] Based on the node and edge information, a user-item dynamic heterogeneous graph is constructed, and a graph cellular automaton is designed according to the dynamic heterogeneous graph:
[0024] Step 2.1, obtaining a cellular automaton D-GCA based on a structure dynamic neighborhood graph:
[0025] D-GCA = (S, d, G, F GCA ) (1)
[0026] In formula (1), S is a state set of the automaton, and depends on the state s of each cell, and the cell state s of the user and the item is respectively defined as and wherein respectively represent the coordinate information of the ith user node u i and the ith item node v i , respectively represent the feature information of the ith user node u i and the ith item node v i ; d is the dimension of the cell; G is the user-item dynamic heterogeneous graph; F GCA is defined as the state function of the cell at t+1, which depends on the cell state and the neighborhood state at t, is a global rule, defines the conditions of cell activation and deactivation and the rules of graph reconstruction, and depends on the state of the global cell;
[0027] Step 2.2, each graph node v E V (G) corresponds to an automaton cell, and the cell neighborhood set representation N (v i ) of the ith automaton cell node v i is obtained by using formula (2):
[0028] N (v i ) = {v i |vi v j ∈E(G)} (2)
[0029] Among them, v j Let V(G) represent the j-th item node in the set V of item nodes in the dynamic heterogeneous graph G, V(G) represent the set V of item nodes in the dynamic heterogeneous graph G, and E(G) represent the set E of edge types for user behavior in the dynamic heterogeneous graph G. i v j Represents the i-th item node v i With the j-th item node v j The edge type between them, N(v) i ) represents the i-th item node v i The set of cell neighbors;
[0030] Step 2.3: Use equation (3) to obtain the graph node v i The weights are represented by K(v) i ):
[0031] K(v i )={k ij |k ij ∈K∧v i v j ∈E(G)} (3)
[0032] In equation (3), K represents the edge set of user behavior type weights, k ij K(v) represents the weight of the edge between item node i and item node j. i ) represents the i-th item node v i The set of edge weights;
[0033] Step 2.4: Initialize the user-item node coordinate information and node feature representation based on one-hot encoding and use them as input. Use equation (4) to obtain the user-item node coordinate distance representation Δx:
[0034]
[0035] In equation (4), Represents the i-th user node u i The node coordinates, Represents the j-th item node v i The node coordinates, Represents the i-th user node u i With the j-th item node v j The coordinate distance difference, Δx, is used as the output value of the model, and recommendations are made after sorting the output values according to their magnitude.
[0036] The global rule design based on graph reconstruction in step S3 operates the nodes and edges according to different behaviors of the user and the behavior weight, and updates the dynamic heterogeneous graph and the adjacency matrix and the weight matrix of the user and the article in real time, as follows:
[0037] The graph reconstruction operation is performed according to the weight size of the user behavior type, that is, there is only one edge with the highest weight connecting between the user and the article in the dynamic heterogeneous graph;
[0038] Step 3.1, if there are n user nodes and m article nodes in the graph, the adjacency matrix representation A(G) of the user-article is obtained by using formula (5):
[0039]
[0040] In formula (5), indicates whether the first user node u1 and the first article node v1 are adjacent, indicates whether the first user node u1 and the mth article node v m are adjacent, indicates whether the nth user node u n and the first article node v1 are adjacent, indicates whether the nth user node u n and the mth article node v m are adjacent; if u i v j ∈E(G) then that is, the ith user node u i and the jth article node vj are adjacent, if then that is, the ith user node u i and the jth article node v j are not adjacent, u i v j indicates whether the ith user node u i and the jth article node v j are adjacent;
[0041] Step 3.2, the weight matrix W(G) of the adjacency matrix A(G) is obtained by using formula (6), that is, the weight set of different behaviors of the user and the article interaction with the size of n×m:
[0042]
[0043] In formula (6), indicates the weight of the interaction behavior type of the first user node u1 and the first article node v1, indicates the weight of the interaction behavior type of the first user node u1 and the mth article node v m . denotes the nth user node u n the weight of the interaction behavior type of the first item node v1, denotes the nth user node u n the weight of the interaction behavior type of the mth item node v m ; here denotes the ith user node u i the weight of the interaction behavior type of the jth item node v j ; the edge set K belonging to the user behavior type weight;
[0044] Step 3.3, the structure of the graph is constantly changing over time and user interaction, and the global graph reconstruction function F is obtained by using formula (7) GCA :
[0045]
[0046] In formula (7), G t denotes the dynamic heterogeneous graph G at time t, G t+1 denotes the dynamic heterogeneous graph G at time t+1, F GCA denotes the possible changes of the dynamic heterogeneous graph G from time t to time t+1;
[0047] Step 3.4, depending on the operation on the nodes and edges of the graph, the dynamic heterogeneous graph at t+1 after the global graph reconstruction function is obtained by using formula (8) t+1 :
[0048]
[0049] In formula (8), V del denotes a set of nodes deleted from the graph G, V add denotes a set of nodes added to the graph G, E del denotes edges deleted from the graph G, E add denotes edges added to the graph G, E rem denotes edges replaced in the graph G; if (V del =0)∧(E del =0)∧(V add =0)∧(E add =0)∧(E rem =0), that is, the graph does not reconstruct when time t and t+1 satisfy the equation G t+1 =G t ; when the graph is reconstructed, a new graph is created, and the adjacency matrix A(G) and the weight matrix W(G) change.
[0050] The step S4 is designed based on the graph local state transition rule. The user and item neighbor node information is aggregated by the graph neural network method, and the node state information of the user and the item is updated, and the specific steps are as follows:
[0051] The local rule in D-GCA defines the state updating process of a single user and item cell node;
[0052] Step 4.1, based on F GCA The node coordinate information of the user-item is defined as Node feature representation Edge (u i ,v i )∈E, and has behavior type weight Based on the above multi-behavior F GCA is expressed as follows:
[0053]
[0054]
[0055]
[0056]
[0057] In formula (9) (10) (11) (12), φ m : φ x : and φ h : are different dense neural network input different multi-layer perceptron model operation, φ a : is a dense neural network taking information as input and outputting attention weight , N(u i ) represents the cell neighbor set of the i-th automaton cell u i , and represents the edge information obtained between the i-th user node u i and the j-th item node v j , if the graph is rotated and translated, since the relative position of the points and the edge do not change, the value also does not change, which has invariance, represents the coordinate information of the updated i-th user node u i , since the coordinate information of the neighbor node is used, the neighbor node information is transformed, and the point should also have the same transformation, which has the isometry, represents The addition operation ensures that the permutation is similar and invariant, and the attention mechanism allows the model to freely assign different weights when aggregating information. The node feature representation in the topological structure after rotation and translation operations is unchanged and has invariance.
[0058] Step 4.2, based on F GCA Get the new coordinate information of the user node and the item node and the node feature representation:
[0059] X',H'=egx(X,H,K) (13)
[0060] In equation (13), X' represents the new coordinate information of the user node and the item node, H' represents the new node feature representation of the user node and the item node, which is calculated and updated based on the original coordinate information X, the node feature representation H, and the behavior type weight K;
[0061] Step 4.3, use equation (14) to get the representation of equation (12) using jump connection when h' = h, to improve the performance of the model on gradient disappearance and over-smoothing problem:
[0062]
[0063] Step 4.4, based on the conversion rule F GCA , the cell state of the user node and the item node is defined as S = [X, H], where X represents the node coordinate information, H represents the node feature information, and the state update method at time t+1 is represented as S t+1 :
[0064] S t+1 = [X', H'] = F GCA (X, H, A, W) (15)
[0065] In equation (15), X' represents the updated node coordinate information at time t+1, H' represents the updated node feature information at time t+1, A and W represent the adjacency matrix and the weight matrix.
[0066] Step S5, based on the state updated user feature representation and item feature representation, predict the rating of the next interaction between the user and the item, as follows:
[0067] Step 5.1, based on the state updated user feature representation and item feature representation, the predicted rating of the i i th user node u j and the j th item node v is obtained by multilayer perception according to equation (16):
[0068]
[0069] in formula (16), denotes the feature representation of the i-th user node u i , denotes the feature representation of the j-th item node v j , MLP denotes a multi-layer perception model, w T denotes a weight matrix, denotes the predicted score between the i-th user node u i and the j-th item node v j ;
[0070] Step 5.2, using positive and negative samples to use formula (17) to make recommendations for the model, the objective function represents
[0071]
[0072] in formula (17), denotes the distance difference between the coordinates x u , x v of the user node u and the item node v at time t+1 before the graph local conversion, denotes the difference between the predicted score and the actual score r u,v of the user node u and the item node v before the graph local conversion, denotes the distance difference between the coordinates x u' , x v' of the user node u and the item node v at time t+1 after the graph local conversion, denotes the difference between the predicted score and the actual score r u’,v’ of the user node u and the item node v after the graph local conversion; Step 5.3, training the item recommendation model using the gradient descent method and calculating the loss function to update the model parameters until the loss function
[0073] converges or reaches the maximum number of training times, stop training, and obtain the optimal item recommendation model, which is used to predict the score of user interaction with the item and select the top-ranked items for recommendation to the corresponding user. An electronic device comprising a memory for storing a program supporting the processor to execute the dynamic graph neural network recommendation method, and a processor configured to execute the program stored in the memory.
[0074] An electronic device comprising a memory for storing a program supporting the processor to execute the dynamic graph neural network recommendation method, and a processor configured to execute the program stored in the memory.
[0075] A computer readable storage medium, a computer program is stored on the computer readable storage medium, and the computer program performs the steps of the dynamic graph neural network recommendation method when executed by a processor.
[0076] The advantages of the present application are: (1) The present application introduces a graph cellular automaton structure in dynamic heterogeneous graph recommendation, thereby better capturing the time series information of nodes, learning the state transition between nodes, and increasing the complexity and expressiveness of the model.
[0077] (2) The present application is based on the global rule design of graph reconstruction, which updates the topology of the graph and the adjacency matrix and weight matrix through the addition and deletion of nodes, the addition, deletion and replacement of edges, and better captures the change process of user nodes, item nodes and connected edges.
[0078] (3) The present application is based on the improved local state transition rule design, which uses the graph neural network method to learn and update the user and item node states in the process of aggregating neighbor nodes, and uses the attention mechanism to freely allocate different weights when aggregating information, thereby accurately learning user and item information in dynamic heterogeneous graphs. BRIEF DESCRIPTION OF DRAWINGS
[0079] Figure 1 The workflow diagram of the present application is shown in the figure;
[0080] Figure 2 The user and item dynamic heterogeneous graph of the present application is shown in the figure;
[0081] Figure 3 The reconstruction diagram of the dynamic heterogeneous graph of the present application is shown in the figure;
[0082] Figure 4 The local state transition diagram of the dynamic heterogeneous graph of the present application is shown in the figure. DETAILED DESCRIPTION
[0083] In this embodiment, as shown in the figure, a dynamic heterogeneous graph neural network recommendation method based on graph cellular automaton includes the following steps: Figure 1
[0084] S1: Construct a dynamic heterogeneous graph for users and items according to a user set, an item set, a user behavior type set, and a user behavior type weight;
[0085] Abstract the user and the item as a node, and the interaction behavior type between the user and the item as a connecting node edge, each edge between the user and the item represents the behavior type between the user and the item and the weight of the corresponding behavior type, thereby constructing a dynamic heterogeneous graph:
[0086] Let U represent the set of user nodes in the heterogeneous graph, and U={u1,...,ui ,...,u I}, where u i Let i represent the i-th user node, and I represent the total number of nodes in the user node set;
[0087] Let V denote the set of item nodes in the heterogeneous graph, and V = {v1,...,v} j ,...,v J}, where v j Let J represent the j-th item node, where J represents the total number of nodes in the item node set.
[0088] Let E denote the set of edges representing user behavior types in the heterogeneous graph, and E = {e1,...,e2} m ,...,e M}, where e m Let m represent the m-th interaction behavior type, and M represent the total number of edges for each interaction behavior type.
[0089] Let K denote the set of edges with weights for user behavior types in the heterogeneous graph, and K = {k1,...,k} m ,...,k M}, where k m Let represent the weight of the m-th interaction behavior type, and M represent the total number of edges with weights for user behavior types, and let e represent the weights of user behavior types in the set of user behavior types. m ∈E and k m ∈K is the corresponding one;
[0090] S2: Initialize the node coordinate information and node feature representation of users and items based on the graph cellular automata;
[0091] Construct a user-item dynamic heterogeneous graph based on node and edge information, and design a graph cellular automaton based on the dynamic heterogeneous graph:
[0092] Step 2.1: Obtain the D-GCA representation of the cellular automaton based on the structural dynamic neighborhood graph:
[0093] D-GCA=(S,d,G,F GCA (1)
[0094] In equation (1), S is the set of states of the automaton, and it depends on the state s of each cell. The cell states s of the user and the item are defined as follows: and in Representing the i-th user node u i and the i-th item node v i Coordinate information, Representing the i-th user node u i and the i-th item node vi characteristic information of the cell; d is the dimension of the cell; G is a user-item dynamic heterogeneous graph; F GCA is defined as the state function of the cell at time t+1 (depending on the state of the cell at time t and the state of the neighborhood), is a global rule that defines the conditions for cell activation and deactivation and the rules for graph reconstruction, depending on the global state of the cells;
[0095] Step 2.2, the automaton D-GCA is defined by the directed weighted graph G and the automaton state S t at time t, then each graph node v e V(G) corresponds to an automaton cell, and the ith automaton cell node v i can be obtained using formula (2): i
[0096]
[0097] In formula (2), v j represents the jth item node in the set of item nodes V in the dynamic heterogeneous graph G, V(G) represents the set of item nodes V in the dynamic heterogeneous graph G, E(G) represents the set of edge types of user behavior in the dynamic heterogeneous graph G, v i v j represents the edge type between the ith item node v i and the jth item node v j , and N(v i ) represents the cell neighborhood set of the ith item node v i ;
[0098] Step 2.3, the weight of node v i is the set of edge weights k ij , and the weight representation K(v i ) of graph node v i can be obtained using formula (3):
[0099] K(v i ) = {k ij | k ij e K and v i v j e E(G)} (3)
[0100] In formula (3), K represents the set of edge weights of user behavior types, k ij represents the weight of the edge between the ith item node i and the item node j, and K(v i ) represents the set of edge weights of the ith item node v i ;
[0101] Step 2.4, the dynamic heterogeneous recommendation task based on cellular automata can be described as initializing user-item node coordinate information and node feature representation based on user-item dynamic heterogeneous graph data and one-hot encoding as input, and using formula (4) to obtain user-item node coordinate distance representation Δx:
[0102]
[0103] In formula (4), represents the node coordinate of the i-th user node u i represents the node coordinate of the j-th item node v i represents the coordinate distance difference between the i-th user node u i and the j-th item node v j , and Δx is the output value of the model, which is ranked according to the size of the output value for recommendation;
[0104] S3: Global rule design based on graph reconstruction, according to different user behaviors and behavior weights, the node and edge are operated, and the dynamic heterogeneous graph and the adjacent matrix and weight matrix of the user and the item are updated in real time;
[0105] The user-item dynamic heterogeneous graph adopted is different from the multi-type edge connection between users and items in the existing behavior interaction graph, and the graph reconstruction operation is performed according to the size of the user behavior type weight, that is, there is only one edge with the highest weight between users and items in the dynamic heterogeneous graph, as shown in Figure 2 The global rule design based on graph reconstruction mainly includes five links: node deletion, node addition, edge deletion, edge addition and edge replacement, as shown in Figure 3
[0106] Step 3.1, if there are n user nodes and m item nodes in the graph, the adjacent matrix representation A(G) of user-item can be obtained by using formula (5):
[0107]
[0108] In formula (5), represents whether the first user node u1 and the first item node v1 are adjacent, represents whether the first user node u1 and the m-th item node v m are adjacent, represents whether the n-th user node u n and the first item node v1 are adjacent, represents whether the n-th user node u n and the m-th item node v m are adjacent. If u i vj ∈E(G) then i.e. the i-th user node u i is adjacent to the j-th item node v j is adjacent, if then i.e. the i-th user node u i is adjacent to the j-th item node v j is not adjacent, u i v j denotes the i-th user node u i is adjacent to the j-th item node v j or not;
[0109] Step 3.2, the weight matrix W(G) of the adjacency matrix A(G) can be obtained by using formula (6), that is, the weight set of different behaviors of user and item interaction with the size of n x m:
[0110]
[0111] In formula (6), denotes the weight of the interaction behavior type of the first user node u1 and the first item node v1, denotes the weight of the interaction behavior type of the first user node u1 and the m-th item node v m , denotes the weight of the interaction behavior type of the n-th user node u n and the first item node v1, denotes the weight of the interaction behavior type of the n-th user node u n and the m-th item node v m . Here, denotes the weight of the interaction behavior type of the i-th user node u i and the j-th item node v j , belongs to the edge set K of user behavior type weight;
[0112] Step 3.3, the structure of the graph is constantly changing over time and user interaction, and the global graph reconstruction function F GCA is obtained by using formula (7), which is used to reflect the accuracy and superiority of the model:
[0113] F GCA :G t →G t+1 (7)
[0114] In formula (7), G t denotes the dynamic heterogeneous graph G at time t, G t+1 denotes the dynamic heterogeneous graph G at time t+1, and FGCA represents the possible changes of the dynamic heterogeneous graph G from time t to time t+1;
[0115] Step 3.4, depending on the operation on the graph nodes and edges, the dynamic heterogeneous graph representation G at t+1 after the global graph reconstruction function can be obtained by using formula (8) t+1 When the graph is reconstructed, a new graph is created, and the adjacency matrix A(G) and the weight matrix W(G) are changed, and the reconstruction of the graph lays the foundation for the neighbor nodes required for the next local conversion rule:
[0116]
[0117] In formula (8), V del represents a set of nodes deleted from the graph G, V add represents a set of nodes added to the graph G, E del represents an edge deleted from the graph G, E add represents an edge added to the graph G, E rem represents an edge replaced in the graph G. If (V del = 0) ^ (E del = 0) ^ (V add = 0) ^ (E add = 0) ^ (E rem = 0), that is, the equation G t+1 = G t is satisfied at time t and t+1, then the graph is not reconstructed. When the graph is reconstructed, a new graph is created, and the adjacency matrix A(G) and the weight matrix W(G) are changed.
[0118] S4: Based on the design of the local state conversion rule of the graph, the information of the user and the item neighbor nodes is aggregated by the graph neural network method, and the node state information of the user and the item is updated;
[0119] The local rule in D-GCA defines the state updating process of a single user and item cell node, as shown in Figure 4
[0120] Step 4.1, based on F GCA , the node coordinate information of the user-item is defined as Node feature representation Edge (u i , v i ) ∈ E, and has a behavior type weight Based on the above behavior F GCA is represented as follows:
[0121]
[0122]
[0123]
[0124]
[0125] In formula (9) (10) (11) (12), φ m : φ x : and φ h : are different dense neural network inputs different multilayer perceptron model operations, φ a : is a dense neural network taking information as input and outputting attention weight , N(u i ) represents the cell neighbor set of the i-th automaton cell u i , represents the edge information obtained between the i-th user node u i and the j-th item node v j , if the graph is rotated, translated, the value does not change due to the relative position of the points and the edges, which has invariance, represents the coordinate information of the updated i-th user node u i , since the coordinate information of the neighbor nodes is used, the neighbor node information is transformed, and the point should also have the same transformation, which has equivariance, represents addition operation, ensuring permutation similarity invariance, and using attention mechanism to make the model freely allocate different weights when aggregating information, represents the node feature representation in the topology structure of the graph after rotation and translation operation, which does not change and has invariance.
[0126] Step 4.2, based on F GCA get the new coordinate information of the user node and the item node and the node feature representation:
[0127] X',H'=egx(X,H,K) (13)
[0128] In formula (13), X' represents the new coordinate information of the user node and the item node, H' represents the new node feature representation of the user node and the item node, which is calculated and updated depending on the original coordinate information X, the node feature representation H and the behavior type weight K.
[0129] Step 4.3, use formula (14) to get the representation of formula (12) using jump connection when h' = h, which can improve the performance of the model on gradient disappearance and over-smoothing problem:
[0130]
[0131] Step 4.4, the designed cellular automaton can act on a continuous state space, based on the conversion rule F GCA , the cell state of the user node and the item node is defined as S=[X, H], wherein X represents node coordinate information, H represents node feature information, and the state update mode at time t+1 is represented as S t+1 :
[0132] S t+1 =[X', H'] = F GCA (X, H, A, W) (15)
[0133] In formula (15), X' represents the updated node coordinate information at time t+1, H' represents the updated node feature information at time t+1, and A and W represent the adjacency matrix and the weight matrix.
[0134] S5: According to the user feature representation and the item feature representation updated by the state, predict the score of the user and the item interacting at the next moment;
[0135] Step 5.1, according to the user feature representation and the item feature representation updated by the state, the predicted score of the i-th user node u i and the j-th item node v j is obtained by a multi-layer perception machine in formula (16)
[0136]
[0137] In formula (16), represents the feature representation of the i-th user node u i , represents the feature representation of the j-th item node v j , MLP represents a multi-layer perception machine model, w T represents a weight matrix, represents the predicted score between the i-th user node u i and the j-th item node v j .
[0138] Step 5.2, the model recommendation result mainly calculates the predicted score by comprehensively using the feature representation of the user and the item and calculates the distance between the user and the item by using the coordinate information to recommend, uses positive and negative samples to recommend the model by using formula (17), and the target function is represented as
[0139]
[0140] In formula (17), The x-coordinates of user node u and item node v represent the coordinates of the two nodes. u x v The distance difference at time t+1 before the local transformation of the graph. This represents the predicted score for user node u and item node v before the local graph transformation. Compared with the actual score r u,v The difference, The x-coordinates of user node u and item node v represent the coordinates of the two nodes. u' x v' The distance difference at time t+1 after the local transformation of the graph. This represents the predicted score for user node u and item node v after a local graph transformation. Compared with the actual score r u’,v’ difference. difference.
[0141] Step 5.3: Train the item recommendation model using gradient descent and calculate the loss function L to update the model parameters until the loss function L converges or reaches the maximum number of training iterations. Stop training and obtain the optimal item recommendation model, which is used to predict the probability of users interacting with items and select the top-rated items to recommend to the corresponding users.
[0142] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.
[0143] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.
Claims
1. A dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton, characterized in that: Specifically comprising the following steps: S1: constructing a dynamic heterogeneous graph for users and items according to a user set, an item set, a user behavior type set, and a user behavior type weight; S2: initializing node coordinate information and node feature representation of users and items according to a graph cellular automaton; S3: based on global rule design of graph reconstruction, operating nodes and edges according to different behaviors of users and behavior weights, and updating a dynamic heterogeneous graph of users and items, an adjacency matrix, and a weight matrix in real time; performing graph reconstruction operation according to the size of the user behavior type weight, that is, there is only one edge with the highest weight connecting users and items in the dynamic heterogeneous graph; S4: based on local state transition rule design of the graph, aggregating neighbor node information of users and items by a graph neural network method, and updating node state information of users and items; The local rule in the D-GCA defines the state updating process of a single user and item cell node. X',H'=egx(X,H,K) (13) Step 4.1, based on F GCA Define the node coordinate information of the user-item as Node feature representation Edge (u i ,v i ) ∈ E, and has behavior type weight Based on multi-behavior F GCA is expressed as follows: In formula (9) (10) (11) (12), φ m : , φ x : and φ h : are different dense neural network inputs different multilayer perceptron model operations, φ a : is a dense neural network taking information as input and outputting attention weight , N(u i ) represents the cell neighbor set of the i-th automaton cell u i , represents the edge information obtained between the i-th user node u i and the j-th item node v j , if the graph is rotated and translated, since the relative position of the points and the edges do not change, the value also does not change, and has invariance, represents the coordinate information of the updated i-th user node u i , since the coordinate information of the neighbor node is used, the neighbor node information is transformed, so should also have the same transformation, with equivariance, represents the addition operation of , ensures the permutation similarity invariance, and uses the attention mechanism to make the model freely allocate different weights when aggregating information, represents the node feature representation in the topology structure of the graph after rotation and translation operation, which does not change and has invariance; Step 4.2, based on F GCA Get new coordinate information and node feature representation of user nodes and item nodes: In formula (13), X' represents new coordinate information of user nodes and item nodes, and H' represents new node feature representation of user nodes and item nodes, which is calculated and updated depending on original coordinate information X, node feature representation H, and behavior type weight K; Step 4.3, using formula (14) to obtain the representation of formula (12) using a skip connection when h' = h, to improve the performance of the model on gradient disappearance and oversmoothing problems: In formula (15), X' represents updated node coordinate information at time t+1, H' represents updated node feature information at time t+1, A and W represent an adjacency matrix and a weight matrix; Step 4.4, based on conversion rule F GCA The cell state of the user node and the item node is defined as S=[X, H], wherein X represents node coordinate information, H represents node feature information, and the state update mode at time t+1 is represented as S t+1 : S t+1 = [X',H'] = F GCA (X,H,A,W) (15) S5: predicting the score of the next interaction between users and items according to the user feature representation and the item feature representation after state updating. The dynamic heterogeneous graph of users and items is constructed according to a user set, an item set, a user behavior type set, and a user behavior type weight, and the specific content is as follows:
2. The dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton according to claim 1, characterized in that: Users and items are abstracted as nodes, and the interaction behavior types between users and items are abstracted as edges connecting the nodes, each edge between users and items representing the behavior type between users and items and the weight of the corresponding behavior type, thereby constructing a dynamic heterogeneous graph: The node coordinate information and the node feature representation of users and items are initialized according to the graph cellular automaton, and the specific content is as follows: Let U represent a set of user nodes in the heterogeneous graph, and U = {u1,..., u i ,...,u I}, where ui represents an i-th user node, and I represents a total number of nodes in the set of user nodes. i Let V represent a set of item nodes in the heterogeneous graph, and V = {v1,...,vj,...,v|}, where vj represents the jth item node, and j represents the total number of nodes in the set of item nodes. j ,...,v J} j Let E represent the edge set of the user behavior type in the heterogeneous graph, and E = {e1,...,e m ,...,e M}, wherein e m represents the mth interaction behavior type, and M represents the total number of interaction behavior edges. Let K represent the edge set of the user behavior type weight in the heterogeneous graph, and K = {k1,...,k m ,...,k M}, wherein k m represents the weight of the mth interaction behavior type, M represents the total number of edges of the user behavior type weight, and e m ∈E and k m ∈K are corresponding in the user behavior type set.
3. The dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton according to claim 2, characterized in that: A user-item dynamic heterogeneous graph is constructed based on node and edge information, and a graph cellular automaton is designed according to the dynamic heterogeneous graph: Step 2.1, obtaining a cellular automaton D-GCA representation based on a structural dynamic neighborhood graph: Step 2.4, initializing user-item node coordinate information and node feature representation based on one-hot encoding and taking them as input, and obtaining user-item node coordinate distance representation Δx by using formula (4): D-GCA = (S, d, G, F GCA ) (1) In formula (1), S is a state set of an automaton, and the cell state s of a user and an item is defined as and wherein respectively represent the coordinate information of the i-th user node u i and the i-th item node v i , respectively represent the feature information of the i-th user node u i and the i-th item node v i ; d is the dimension of the cell; G is a user-item dynamic heterogeneous graph; F GCA is defined as a state function of the cell at t+1, which depends on the cell state at t and the neighborhood state, is a global rule, which defines the conditions of cell activation and deactivation and the rules of graph reconstruction, and depends on the global cell state; Step 2.
2. Each graph node v e V(G) corresponds to an automaton cell. The ith automaton cell node v is represented by its set of cell neighbors N(v i ) using equation (2): i N(v) = {u e V(G) | (u, v) e E(G)} N(v i ) = {v i |v i v j ∈ E(G)} (2) wherein v j represents the jth item node in the set of item nodes V in the dynamic heterogeneous graph G, V(G) represents the set of item nodes V in the dynamic heterogeneous graph G, E(G) represents the set of edge types of user behaviors E in the dynamic heterogeneous graph G, v i represents the ith item node v j represents the edge type between the ith item node v i and the jth item node v j , N(v i ) represents the set of cell neighbors of the ith item node v i . Step 2.
3. Utilize the graph node v of formula (3) to obtain the weight representation K(v i ) of the graph node v i ): K(v i ) = {k ij | k ij ∈ K Λ v i v j ∈ E(G)} (3) In formula (3), K represents an edge set of a user behavior type weight, k ij represents the weight of an edge between the ith item node i and the jth item node j, K(v i ) represents a set of edge weights of the ith item node v i . In formula (4), represents the node coordinates of the i-th user node u i , represents the node coordinates of the j-th item node v i , represents the coordinate distance difference between the i-th user node u i and the j-th item node v j , Δx as the output value of the model, and the recommendation is made after sorting according to the size of the output value.
4. The dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton according to claim 3, characterized in that: The global rule design based on graph reconstruction in step S3 operates the nodes and edges according to different behaviors of the user and the behavior weight, and updates the dynamic heterogeneous graph and the adjacency matrix and the weight matrix of the user and the item in real time, and the specific steps are as follows: Step 3.1, if there are n user nodes and m item nodes in the graph, the adjacency matrix A(G) of the user-item is obtained by using formula (5): In formula (5), denotes whether the first user node u1 and the first item node v1 are adjacent, denotes whether the first user node u1 and the mth item node v m are adjacent, denotes whether the nth user node u n and the first item node v1 are adjacent, denotes whether the nth user node u n and the mth item node v m are adjacent; if u i v j ∈ E(G) then i.e. the ith user node u i and the jth item node v j are adjacent, if then i.e. the ith user node u i and the jth item node v j are not adjacent, u i v j denotes whether the ith user node u i and the jth item node v j are adjacent; Step 3.2, the weight matrix W(G) of the adjacency matrix A(G) is obtained by using formula (6), that is, the weight set of different behaviors of the user and the item interaction with the size of n x m: In equation (6), w u1v1 This represents the weight of the interaction behavior type between the first user node u1 and the first item node v1. This represents the first user node u1 and the m-th item node v. m The weight of the interaction behavior type Represents the nth user node u n The weight of the interaction behavior type with the first item node v1 Represents the nth user node u n With the m-th item node v m The weight of the interaction behavior type; here Represents the i-th user node u i With the j-th item node v j The weight of the interaction behavior type The set of edges K that belong to the weights of user behavior types; Step 3.3, The structure of the graph is constantly changing over time and with user interaction, and the global graph reconstruction function representation F is obtained using equation (7) GCA : F GCA :G t →G t+1 (7) In formula (7), G t denotes the dynamic heterogeneous graph G at time t, G t+1 denotes the dynamic heterogeneous graph G at time t+1, F GCA denotes the change that the dynamic heterogeneous graph G can have from time t to time t+1; Step 3.4, depending on the operation on the graph nodes and edges, yields the dynamic heterogeneous graph representation G after global graph reconstruction function t+1 using equation (8) t+1 : In formula (8), V del represents a set of nodes deleted from graph G, V add represents a set of nodes added to graph G, E del represents edges deleted from graph G, E add represents edges added to graph G, E rem represents edges replaced in graph G; if (V del = 0) ^ (E del = 0) ^ (V add = 0) ^ (E add = 0) ^ (E rem = 0), that is, the moments t and t+1 satisfy the equation G t+1 = G t , then the graph is not reconstructed; when the graph is reconstructed, a new graph is created, and the adjacency matrix A(G) and the weight matrix W(G) change.
5. The dynamic heterogeneous graph neural network recommendation method based on a graph cellular automaton according to claim 4, characterized in that: Step S5, according to the state updated user feature representation and item feature representation, the score of the user and the item generated in the next moment is predicted, and the specific steps are as follows: Step 5.1: Connect the updated user feature representation and item feature representation, and use Equation (16) to obtain the i-th user node u through a multilayer perceptron. i and the j-th item node v j Predicted score : In formula (16), denotes the feature representation of the i-th user node u i denotes the feature representation of the i-th user node u vj denotes the feature representation of the j-th item node v j MLP denotes a multi-layer perceptron model, w T denotes a weight matrix, denotes the predicted score between the i-th user node u i and the j-th item node v j . Step 5.2, the positive and negative samples are used to train the model by using formula (17), and the objective function is represented as L: In formula (17), denotes the coordinate x u , x v of the user node u and the item node v before the graph local conversion at time t+1, denotes the predicted score of the user node u and the item node v before the graph local conversion and the actual score r u,v , denotes the coordinate x u′ , x v′ of the user node u and the item node v after the graph local conversion at time t+1, denotes the predicted score of the user node u and the item node v after the graph local conversion and the actual score r u′,v′ . Step 5.3, the gradient descent method is used to train the item recommendation model, and the loss function L is calculated to update the model parameters, until the loss function L converges or reaches the maximum training times, stop training, and obtain the optimal item recommendation model, which is used to predict the score of the user and the item interaction, and select the item with high score to recommend to the corresponding user.
6. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store a program supporting the processor to execute the dynamic heterogeneous graph neural network recommendation method based on the graph cellular automaton of claim 1, and the processor is configured to execute the program stored in the memory.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that: The computer program is run by the processor to execute the steps of the dynamic heterogeneous graph neural network recommendation method based on the graph cellular automaton of claim 1.
Citation Information
Patent Citations
Personalized recommendation method and system and storage medium
CN115687786A
Dynamic graph neural network recommendation method based on cellular automaton
CN115689687A