Recommendation method and device based on graph enhancement, electronic equipment and storage medium

By constructing the initial interactive graph in the recommendation system, randomly deleting edges to enhance the graph structure, and using graph convolution networks and graph attention networks to generate node representations, the problem of graph enhancement processing in the prior art is solved, and more efficient model convergence and recommendation performance is achieved.

CN119919213APending Publication Date: 2025-05-02INNOVATION CENTER OF YANGTZE RIVER DELTA ZHEJIANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411984044.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the privacy protection scenario, the existing recommendation system randomly deletes the edges of the graph to enhance the graph, which easily destroys the key connections in the graph structure, resulting in increased difficulty in model convergence and degradation of recommended performance.

Method used

By constructing an initial interaction graph, the contribution of each edge to connectivity is determined, the probability of deletion of edges is calculated based on the contribution, the edges are deleted randomly to obtain an enhanced interaction graph, and the graph convolution network and graph attention network are used to encode and decode the enhanced interaction graph to generate node representations of users and products for recommendations.

Benefits of technology

The key connections of the initial interaction graph are retained to ensure that the multi-hop access paths of most nodes are not damaged, reducing computing costs, and improving the scalability of the model and the accuracy of recommendation effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919213A_ABST
    Figure CN119919213A_ABST
Patent Text Reader

Abstract

The invention provides a recommendation method and device based on graph enhancement, electronic equipment and a storage medium. The method comprises the following steps: constructing an initial interaction graph based on an interaction relationship between a user and a commodity; performing graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; determining a first-order adjacency matrix and a second-order adjacency matrix of the enhanced interaction graph; fusing the first-order adjacency matrix and the second-order adjacency matrix to obtain a fusion matrix; encoding the first adjacent matrix by using a graph convolutional network to obtain a user implicit code and a commodity implicit code; decoding the fusion matrix based on the user implicit code and the commodity implicit code by using a graph attention network to obtain user node representation and commodity node representation; and performing commodity recommendation on the user based on the user node representation and the commodity node representation. According to the method, the initial interaction graph is subjected to graph enhancement processing, and key connections of the initial interaction graph are reserved, so that the final recommendation effect is higher in accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular to a method, device, electronic device and storage medium for recommending image enhancement. Background Art

[0002] Recommendation systems are an important part of the modern Internet and are widely used in e-commerce, social network online learning and other fields. Based on the characteristic information of users and products, it is relatively easy to recommend user products. However, in some privacy protection scenarios, the characteristic information of users and products is missing, and only the interaction information between users and products exists. The user-product interaction graph is constructed through the interaction information, and the graph is enhanced by randomly deleting some edges. The enhanced graph is processed by graph autoencoding to achieve user product recommendations. However, the random deletion of edges is likely to destroy the key connections in the graph structure, and the random deletion of edges in a sparse environment may lead to more isolated nodes, increase the difficulty of model convergence, and lead to a decrease in recommendation performance. Summary of the invention

[0003] The present disclosure provides a recommendation method, device, electronic device and storage medium based on image enhancement to at least solve the above technical problems existing in the prior art.

[0004] According to a first aspect of the present disclosure, a recommendation method based on graph enhancement is provided, the method comprising: constructing an initial interaction graph based on the interaction relationship between users and commodities, the nodes of the initial interaction graph being users and commodities, and the edges of the initial interaction graph indicating the existence of an interaction relationship between users and commodities; performing graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; determining a first-order adjacency matrix and a second-order adjacency matrix of the enhanced interaction graph; fusing the first-order adjacency matrix and the second-order adjacency matrix to obtain a fused matrix; encoding the first-order adjacency matrix using a graph convolutional network to obtain user implicit coding and commodity implicit coding; decoding the fused matrix based on the user implicit coding and the commodity implicit coding using a graph attention network to obtain user node representation and commodity node representation; and recommending commodities to the user based on the user node representation and the commodity node representation.

[0005] In one possible implementation, the graph enhancement processing performed on the initial interaction graph to obtain an enhanced interaction graph includes: determining the connectivity contribution of each edge in the initial interaction graph to the initial interaction graph; determining the deletion probability of the edge based on the connectivity contribution; generating a corresponding random number for each edge, and deleting edges from the initial interaction graph according to the random number and the deletion probability to obtain an enhanced interaction graph.

[0006] In one possible implementation, the recommending products to the user based on the user node representation and the product node representation includes: constructing a target interaction matrix according to the user node representation and the product node representation; obtaining an interaction threshold, and recommending products in the target interaction matrix that meet the interaction threshold to the corresponding user.

[0007] In one possible implementation, the method also includes: determining an initial interaction matrix between the user and the product based on the initial interaction graph; determining a predicted interaction matrix between the user and the product based on the user node representation and the product node representation; determining a reconstruction loss based on the predicted interaction matrix and the initial interaction matrix; determining a user contrast loss based on the user node representation, and determining a product contrast loss based on the product node representation; determining an overall contrast loss based on the user contrast loss and the product contrast loss; determining a regularization loss based on model parameters of the graph convolutional network, model parameters of the graph attention network and regularization weights; performing gradient mapping on the overall contrast loss and the reconstruction loss to obtain a mapping loss; performing weighted fusion on the mapping loss and the regularization loss to obtain a fusion loss; and optimizing the parameters of the graph convolutional network and the graph attention network based on the fusion loss to minimize the fusion loss.

[0008] In one possible implementation, performing gradient mapping on the overall comparison loss and the reconstruction loss to obtain a mapping loss includes: calculating a first gradient of the reconstruction loss and a second gradient of the overall comparison loss; determining a similarity between the first gradient and the second gradient; determining whether there is a gradient conflict between the first gradient and the second gradient based on the similarity; if there is a gradient conflict between the first gradient and the second gradient, mapping the second gradient to a normal direction of the first gradient, eliminating the gradient conflict between the first gradient and the second gradient, and obtaining a mapping loss.

[0009] According to a second aspect of the present disclosure, a recommendation device based on graph enhancement is provided, the device comprising: a construction module, used to construct an initial interaction graph based on the interaction relationship between users and commodities, the nodes of the initial interaction graph are users and commodities, and the edges of the initial interaction graph represent the interaction relationship between users and commodities; a processing module, used to perform graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; a determination module, used to determine a first-order adjacency matrix and a second-order adjacency matrix of the enhanced interaction graph; a fusion module, used to fuse the first-order adjacency matrix and the second-order adjacency matrix to obtain a fusion matrix; an encoding module, used to encode the first-order adjacency matrix using a graph convolutional network to obtain a user implicit code and a commodity implicit code; a decoding module, used to decode the fusion matrix based on the user implicit code and the commodity implicit code using a graph attention network to obtain a user node representation and a commodity node representation; a recommendation module, used to recommend commodities to the user based on the user node representation and the commodity node representation.

[0010] In one possible implementation, the processing module is specifically used to determine the connectivity contribution of each edge in the initial interaction graph to the initial interaction graph; determine the deletion probability of the edge based on the connectivity contribution; generate a corresponding random number for each edge, and delete the edge of the initial interaction graph according to the random number and the deletion probability to obtain an enhanced interaction graph.

[0011] In one possible implementation, the recommendation module includes: a construction submodule, used to construct a target interaction matrix based on the user node representation and the product node representation; a recommendation submodule, used to obtain an interaction threshold and recommend products in the target interaction matrix that meet the interaction threshold to corresponding users.

[0012] In one possible implementation, the device also includes an optimization module, which is used to determine the initial interaction matrix of the user and the product based on the initial interaction graph; determine the predicted interaction matrix of the user and the product based on the user node representation and the product node representation; determine the reconstruction loss based on the predicted interaction matrix and the initial interaction matrix; determine the user contrast loss based on the user node representation, and determine the product contrast loss based on the product node representation; determine the overall contrast loss based on the user contrast loss and the product contrast loss; determine the regularization loss based on the model parameters of the graph convolution network, the model parameters of the graph attention network and the regularization weights; perform gradient mapping on the overall contrast loss and the reconstruction loss to obtain a mapping loss; perform weighted fusion on the mapping loss and the regularization loss to obtain a fusion loss; and optimize the parameters of the graph convolution network and the graph attention network based on the fusion loss to minimize the fusion loss.

[0013] In one possible implementation, the optimization module is further used to calculate a first gradient of the reconstruction loss and a second gradient of the overall contrast loss; determine the similarity between the first gradient and the second gradient; determine whether there is a gradient conflict between the first gradient and the second gradient based on the similarity; if there is a gradient conflict between the first gradient and the second gradient, map the second gradient to the normal direction of the first gradient, eliminate the gradient conflict between the first gradient and the second gradient, and obtain a mapping loss.

[0014] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.

[0018] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure.

[0019] The present invention discloses a recommendation method, device, electronic device and storage medium based on graph enhancement. First, an initial interaction graph is constructed based on the interaction relationship between users and commodities, wherein the nodes of the initial interaction graph are users and commodities, and the edges of the initial interaction graph represent the interaction relationship between users and commodities; the initial interaction graph is subjected to graph enhancement processing to obtain an enhanced interaction graph; the first-order adjacency matrix and the second-order adjacency matrix of the enhanced interaction graph are determined; the first-order adjacency matrix and the second-order adjacency matrix are fused to obtain a fused matrix; the first-order adjacency matrix is ​​encoded using a graph convolutional network to obtain user implicit coding and commodity implicit coding; the fused matrix is ​​decoded using a graph attention network based on the user implicit coding and the commodity implicit coding to obtain user node representation and commodity node representation; and commodities are recommended to users based on the user node representation and the commodity node representation. This method is applied to perform graph enhancement processing on the initial interaction graph. The edges of the initial interaction graph are deleted according to the changes in the propagation efficiency corresponding to the deletion and the deletion probability of the edges, so as to obtain an enhanced interaction graph. The enhanced interaction graph retains the key connections of the initial interaction graph and ensures that the multi-hop access paths of most nodes are not damaged. It can ensure the sparsity of the second-order adjacency matrix, reduce the computational cost, and improve the scalability of the model. The conflict between the reconstruction loss and the overall contrast loss is resolved through the gradient mapping technology, ensuring the stability of multi-task optimization and making the final recommendation effect more accurate.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0022] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0023] Figure 1 The following is a schematic diagram showing the implementation process of a recommendation method based on graph enhancement in an embodiment of the present disclosure. Figure 1 ;

[0024] Figure 2 The following is a schematic diagram showing the implementation process of a recommendation method based on graph enhancement in an embodiment of the present disclosure. Figure 2 ;

[0025] Figure 3 A module schematic diagram of a recommendation device based on graph enhancement according to an embodiment of the present disclosure is shown;

[0026] Figure 4 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0027] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0028] Figure 1 The following is a schematic diagram showing the implementation process of a recommendation method based on graph enhancement in an embodiment of the present disclosure. Figure 1 .

[0029] See also Figure 1According to a first aspect of an embodiment of the present disclosure, a recommendation method based on graph enhancement is provided, the method comprising: step 101, constructing an initial interaction graph based on the interaction relationship between users and commodities, the nodes of the initial interaction graph are users and commodities, and the edges of the initial interaction graph represent the interaction relationship between users and commodities; step 102, performing graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; step 103, determining a first-order adjacency matrix and a second-order adjacency matrix of the enhanced interaction graph; step 104, fusing the first-order adjacency matrix and the second-order adjacency matrix to obtain a fused matrix; step 105, encoding the first-order adjacency matrix using a graph convolutional network to obtain user implicit coding and commodity implicit coding; step 106, decoding the fused matrix based on the user implicit coding and the commodity implicit coding using a graph attention network to obtain user node representation and commodity node representation; step 107, recommending commodities to users based on the user node representation and the commodity node representation.

[0030] First, an initial interaction graph is constructed based on the interaction relationship between users and products. The nodes of the initial interaction graph are users and products, and the edges of the initial interaction graph indicate that there is an interaction relationship between users and products. The interaction relationship involves users' purchase, browsing, and collection of products. The initial interaction graph is enhanced to obtain an enhanced interaction graph. Based on the obtained enhanced interaction graph, the first-order adjacency matrix and the second-order adjacency matrix of the enhanced interaction graph are determined, and the first-order connection matrix and the second-order adjacency matrix are concatenated to obtain a fusion matrix. Specifically, when performing fusion, the column vectors of the first-order connection matrix and the second-order adjacency matrix are concatenated to obtain a fusion matrix.

[0031] The first-order adjacency matrix is ​​encoded by the graph convolution network to obtain the user implicit code and the product implicit code. The fusion matrix is ​​decoded by the graph attention network based on the user implicit code and the product implicit code to obtain the user node representation and the product node representation. This is a process of information transmission through encoding and decoding. The graph convolution network is a two-layer graph convolution network. The first-order adjacency matrix carries the graph structure features of the enhanced interaction graph and the features of the nodes in the graph. The graph convolution network encodes the input first-order adjacency matrix to form a compact implicit representation, namely the user implicit code and the product implicit code. The user implicit code and the product implicit code are passed to the graph attention network. The goal of the graph attention network is to reconstruct the interaction information between users and products based on the implicit representation as accurately as possible. The fusion matrix is ​​decoded by the graph attention network based on the user implicit code and the product implicit code to obtain the user node representation and the product node representation. The user node representation and the product node representation contain the interaction information between users and products, so products can be recommended to users based on the user node representation and the product node representation.

[0032] This application first constructs an initial interaction graph, performs graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph, determines the first-order adjacency matrix and the second-order adjacency matrix of the enhanced interaction graph, fuses the first-order adjacency matrix and the second-order adjacency matrix to obtain a fused matrix, then uses a graph convolutional network to encode the first-order adjacency matrix to obtain user implicit coding and product implicit coding, uses a graph attention network to decode the fused matrix based on user implicit coding and product implicit coding to obtain user node representation and product node representation, and finally recommends products to users based on user node representation and product node representation. This method can be applied to perform graph enhancement processing on the initial interaction graph to retain the key connections of the initial interaction graph, thereby ensuring the sparsity of the second-order adjacency matrix, reducing computational costs, improving the scalability of the model, and making the final recommendation effect more accurate.

[0033] In one possible implementation, graph enhancement processing is performed on the initial interaction graph to obtain an enhanced interaction graph, including: determining the connectivity contribution of each edge in the initial interaction graph to the initial interaction graph; determining the deletion probability of the edge based on the connectivity contribution; generating a corresponding random number for each edge, and deleting the edges of the initial interaction graph according to the random number and the deletion probability to obtain an enhanced interaction graph.

[0034] According to the constructed initial interaction graph, the contribution of each edge in the initial interaction graph to the connectivity of the initial interaction graph is calculated based on the propagation efficiency. Specifically, the formula Determine the propagation efficiency of the initial interaction graph, where d ij represents the shortest path distance between node i and node j, and V represents the number of variables in the initial interaction graph. After deleting an edge e from the initial interaction graph, the propagation efficiency E(G ’ ), according to the propagation efficiency E(G ’ ) and the propagation efficiency E(G) of the initial interaction graph determine the contribution of edge e to the connectivity of the initial interaction graph as ΔE(e) = E(G ’ )-E(G). If ΔE(e)<0, it means that after deleting edge e, the propagation efficiency of the interaction graph decreases, and deleting edge e has a greater impact on the connectivity of the initial interaction graph.

[0035] According to the formula Calculate the deletion probability of edge e, where ΔE(e) is the connectivity contribution of edge e to the initial interaction graph, α is a smoothing parameter used to adjust the baseline value of the deletion probability, and β is a hyperparameter used to control the influence of the connectivity contribution of edge e to the initial interaction graph on the deletion probability.

[0036] For edge e, a random number r between 0 and 1 is generated according to its corresponding deletion probability. If the random number corresponding to edge e is less than the deletion probability corresponding to edge e, edge e is deleted. After deleting some edges, the initial interaction graph is updated to obtain an enhanced interaction graph.

[0037] It is understandable that in order to further optimize the propagation efficiency, after obtaining the enhanced interaction graph, the above process can be iterated on the enhanced interaction graph, that is, determine the contribution of each edge in the enhanced interaction graph to the connectivity of the enhanced interaction graph, determine the probability of deleting each edge, and generate a random number corresponding to each edge, so as to delete the edge according to the random number, so as to obtain a better enhanced interaction graph. The iterative process cannot be carried out indefinitely, so the iteration conditions can be pre-set in the iterative process, such as stopping the iteration when the number of deleted edges reaches a certain proportion to obtain the target interaction graph; setting the expected value of the graph propagation efficiency, and stopping the iteration when the graph propagation efficiency reaches the expected value to obtain the target interaction graph; presetting the maximum number of iterations, and stopping the iteration when the number of iterations reaches the maximum number of iterations to obtain the target interaction graph. Appropriate iteration conditions can be selected according to actual conditions.

[0038] In one possible implementation, recommending products to users based on user node representations and product node representations includes: constructing a target interaction matrix based on the user node representations and product node representations; obtaining an interaction threshold, and recommending products in the target interaction matrix that meet the interaction threshold to corresponding users.

[0039] The user node representation and the product node representation are obtained by decoding the fusion matrix based on the implicit encoding of the user and the implicit encoding of the product by the graph attention network. The user node representation is a matrix with N rows and D columns, where N represents the number of users and D is a hyperparameter in the graph attention network. The product node representation is a matrix with M rows and D columns, where M is the number of products and D is a hyperparameter in the graph attention network. The target interaction matrix is ​​constructed according to the user node representation and the product node representation, that is, the transposed matrix corresponding to the matrix of the user node representation is multiplied by the matrix of the product node representation, that is, an M×N matrix is ​​obtained. The matrix represents the interaction relationship between the user and the product predicted after the enhanced feature map is processed based on the graph convolution network and the graph attention network. The rows represent the predicted interaction relationship between a product and different users, and the columns represent the interaction relationship between a user and different products. An interaction threshold is set in advance, and the value in the target interaction matrix is ​​compared with the interaction threshold. When the value in the matrix meets the interaction threshold, it indicates that the user corresponding to the value and the product have high interactivity, and the corresponding product can be recommended to the corresponding user. When the value in the matrix does not meet the interaction threshold, it indicates that the user corresponding to the value and the product have low interactivity, and the corresponding product can be avoided from being recommended to the corresponding user.

[0040] In one possible implementation, Figure 2As shown, the method also includes: step 201, determining the initial interaction matrix of users and commodities according to the initial interaction graph; step 202, determining the predicted interaction matrix of users and commodities according to the user node representation and the commodity node representation; step 203, determining the reconstruction loss according to the predicted interaction matrix and the initial interaction matrix; step 204, determining the user contrast loss according to the user node representation, and determining the commodity contrast loss according to the commodity node representation; step 205, determining the overall contrast loss according to the user contrast loss and the commodity contrast loss; step 206, determining the regularization loss according to the model parameters of the graph convolution network, the model parameters of the graph attention network and the regularization weights; step 207, performing gradient mapping on the overall contrast loss and the reconstruction loss to obtain the mapping loss; step 208, performing weighted fusion on the mapping loss and the regularization loss to obtain the fusion loss; step 209, optimizing the parameters of the graph convolution network and the graph attention network according to the fusion loss to minimize the fusion loss.

[0041] Determine the initial interaction matrix between users and products based on the initial interaction graph. If there is an interaction between user u and product i in the initial interaction graph, then the value A in the uth row and ith column of the initial interaction matrix is ui is 1. If there is no interaction between user u and product i in the initial interaction graph, then the value A in the uth row and ith column of the initial interaction matrix ui is 0. After the user node representation and the product node representation are obtained through the graph attention network, the inner product of the user node representation and the product node representation is calculated to determine the predicted interaction relationship between the user and the product. The specific formula is: in is the transposed matrix of the user node representation, h i is the commodity node representation, is the predicted interaction matrix of users and products. The goal of reconstruction loss is to make the predicted interaction matrix of users and products as close as possible to the actual interaction matrix of users and products, that is, the initial interaction matrix. Therefore, in order to optimize the predicted interaction matrix, the reconstruction matrix is ​​used to measure the gap between the predicted interaction matrix and the initial interaction matrix. The reconstruction loss can be determined by cross entropy loss or mean square error loss. This application uses mean square error to determine the reconstruction loss. The formula is Among them, L1 is the reconstruction loss, E is the interaction set of users and products, that is, E = {(u,i)|A ui =1}, is the predicted interaction matrix of users and products, A ui is the initial interaction matrix between users and products.

[0042] The user contrast loss is used to minimize the similarity between users and increase the distinction between user representations in the embedding space. The product contrast loss is used to minimize the similarity between products and increase the distinction between product representations in the embedding space. Therefore, the user contrast loss is determined based on the user node representation. The specific formula is: Where L 21 represents the user contrast loss, U ancs Indicates the number of users who have an interactive relationship with the product. The transposed matrix of user node features representing users who have an interactive relationship with the product, h U Indicates the node characteristics of the user used. The product comparison loss is determined based on the product node representation. The specific formula is: Where L 22 Indicates the product comparison loss, I pos Indicates the number of items that the user has an interactive relationship with. The transposed matrix of the product node features representing the products that have an interactive relationship with the user, h I Represents the node characteristics of the product used. Based on the weighted sum of the user comparison loss and the product comparison loss, the overall comparison loss is determined. The appropriate weight can be selected according to the actual situation. The user comparison loss and the product comparison loss can also be directly added to determine the overall comparison loss. The specific formula is: L2 = L 21 +L 22 , L2 is the overall contrast loss.

[0043] The regularization loss is determined according to the model parameters of the graph convolutional network, the model parameters of the graph attention network, and the regularization weights. The specific formula is L3=λ‖Θ‖ 2 , where L3 is the regularization loss, λ is the regularization weight, and Θ is the model parameter.

[0044] In multi-task learning, the model needs to optimize multiple tasks at the same time. Each task has its own loss function and gradient. Each task attempts to minimize the corresponding loss function by adjusting the model parameters. The loss functions of different tasks may have different requirements for the adjustment direction of the model parameters. When the gradients of these tasks conflict in the optimization direction, that is, the gradient update direction of one task may hinder the optimization of another task, a gradient conflict will occur. In this application, there may be a gradient conflict between the overall contrast loss and the reconstruction loss. Therefore, the overall contrast loss and the reconstruction contrast loss are first gradient mapped to obtain the mapping loss, and then the mapping loss and the regularization loss are fused to obtain the fusion loss. Specifically, the mapping loss and the regularization loss can be fused in a weighted manner. Finally, the obtained fusion loss is back-propagated to the graph convolution network and the graph attention network to adjust the parameters of the graph convolution network and the graph attention network. According to the graph convolution network and the graph attention network after the parameter adjustment, the first-order adjacency matrix of the enhanced interaction graph is encoded again, and the fusion matrix is ​​decoded to obtain the user node representation and the product node representation. At this time, the user node representation and the product node representation obtained are closer to the real interaction relationship between users and products. The fusion loss is calculated again. After iteration, when the fusion loss is minimized, the parameters of the graph convolution network and the graph attention network are optimal, and the obtained user node representation and product node representation are closest to the real interaction relationship between users and products.

[0045] In one possible implementation, gradient mapping is performed on the overall comparison loss and the reconstruction loss to obtain a mapping loss, including:

[0046] Calculate the first gradient of the reconstruction loss and the second gradient of the overall contrast loss;

[0047] determining a similarity between the first gradient and the second gradient;

[0048] determining whether there is a gradient conflict between the first gradient and the second gradient based on the similarity;

[0049] If there is a gradient conflict between the first gradient and the second gradient, the second gradient is mapped to the normal direction of the first gradient to eliminate the gradient conflict between the first gradient and the second gradient, thereby obtaining a mapping loss.

[0050] The first gradient of the reconstruction loss is calculated according to the reconstruction loss, and the second gradient of the overall contrast loss is calculated according to the overall contrast loss. The specific formula is: Where g1 is the first gradient, θ is the model parameter, L1 is the reconstruction loss, g2 is the second gradient, and L2 is the overall contrast loss. The inner product of the gradient reflects the similarity between the two gradient directions. Therefore, the inner product of the first gradient and the second gradient is calculated to determine the similarity between the first gradient and the second gradient. The specific formula is: Inner_product represents the inner product of the first gradient and the second gradient. The inner product is used to determine whether there is a gradient conflict between the first gradient and the second gradient. When the inner product is less than 0, it means that the angle between the first gradient and the second gradient is greater than 90°, and there is a gradient conflict between the first gradient and the second gradient. When the inner product is greater than or equal to 0, it means that the directions of the first gradient and the second gradient are consistent or partially consistent, and there is no gradient conflict between the first gradient and the second gradient. When there is a gradient conflict between the first gradient and the second gradient, the second gradient is mapped to the normal direction of the first gradient, thereby eliminating the gradient conflict between the first gradient and the second gradient. Specifically, the second gradient is first projected to the direction of the first gradient, and the component of the second gradient in the normal direction of the first gradient is calculated. If the modulus of the component of the second gradient in the normal direction of the first gradient is greater than 0, it indicates that there is a valid normal direction, and the second gradient is replaced with the normal direction. If the modulus field of the component of the second gradient in the normal direction of the first gradient is equal to 0, it means that the first gradient is completely parallel to the second gradient, and the original first gradient and second gradient are retained, and finally the mapping loss is obtained.

[0051] Figure 3 A module schematic diagram of a recommendation device based on graph enhancement according to an embodiment of the present disclosure is shown.

[0052] See also Figure 3 According to the second aspect of the present disclosure, a recommendation device based on graph enhancement is provided, and the device includes: a construction module 301, which is used to construct an initial interaction graph based on the interaction relationship between users and commodities, the nodes of the initial interaction graph are users and commodities, and the edges of the initial interaction graph represent the interaction relationship between users and commodities; a processing module 302, which is used to perform graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; a determination module 303, which is used to determine the first-order adjacency matrix and the second-order adjacency matrix of the enhanced interaction graph; a fusion module 304, which is used to fuse the first-order adjacency matrix and the second-order adjacency matrix to obtain a fusion matrix; an encoding module 305, which is used to encode the first-order adjacency matrix using a graph convolutional network to obtain user implicit coding and commodity implicit coding; a decoding module 306, which is used to decode the fusion matrix based on the user implicit coding and the commodity implicit coding using a graph attention network to obtain user node representation and commodity node representation; a recommendation module 307, which is used to recommend commodities to users based on the user node representation and the commodity node representation.

[0053] In one possible implementation, the processing module 302 is specifically used to determine the connectivity contribution of each edge in the initial interaction graph to the initial interaction graph; determine the deletion probability of the edge based on the connectivity contribution; generate a corresponding random number for each edge, and delete the edge of the initial interaction graph according to the random number and the deletion probability to obtain an enhanced interaction graph.

[0054] In one embodiment, the recommendation module 307 includes: a construction submodule 3071, which is used to construct a target interaction matrix according to the user node representation and the product node representation; a recommendation submodule 3072, which is used to obtain an interaction threshold and recommend products in the target interaction matrix that meet the interaction threshold to the corresponding user.

[0055] In one possible implementation, the device also includes an optimization module 308, which is used to determine an initial interaction matrix of users and commodities based on an initial interaction graph; determine a predicted interaction matrix of users and commodities based on user node representations and commodity node representations; determine a reconstruction loss based on the predicted interaction matrix and the initial interaction matrix; determine a user contrast loss based on user node representations, and determine a commodity contrast loss based on commodity node representations; determine an overall contrast loss based on the user contrast loss and the commodity contrast loss; determine a regularization loss based on model parameters of a graph convolutional network, model parameters of a graph attention network, and regularization weights; perform gradient mapping on the overall contrast loss and the reconstruction loss to obtain a mapping loss; perform weighted fusion of the mapping loss and the regularization loss to obtain a fusion loss; and optimize the parameters of the graph convolutional network and the graph attention network based on the fusion loss to minimize the fusion loss.

[0056] In one embodiment, the optimization module 308 is further used to calculate a first gradient of the reconstruction loss and a second gradient of the overall contrast loss; determine the similarity between the first gradient and the second gradient; determine whether there is a gradient conflict between the first gradient and the second gradient based on the similarity; if there is a gradient conflict between the first gradient and the second gradient, map the second gradient to the normal direction of the first gradient, eliminate the gradient conflict between the first gradient and the second gradient, and obtain a mapping loss.

[0057] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0058] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0059] like Figure 4As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0060] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0061] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as a recommendation method based on graph enhancement. For example, in some embodiments, a recommendation method based on graph enhancement may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of a recommendation method based on graph enhancement described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute a recommendation method based on graph enhancement in any other appropriate manner (for example, by means of firmware).

[0062] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0063] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0064] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0065] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0066] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0067] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0068] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0069] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0070] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A recommendation method based on graph enhancement, characterized in that: The method comprises: An initial interaction graph is constructed based on the interaction relationship between the user and the product, wherein the nodes of the initial interaction graph are the user and the product, and the edges of the initial interaction graph represent the interaction relationship between the user and the product; Performing graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; Determining a first-order adjacency matrix and a second-order adjacency matrix of the enhanced interaction graph; Fusing the first-order adjacency matrix and the second-order adjacency matrix to obtain a fused matrix; Encoding the first-order adjacency matrix using a graph convolutional network to obtain user implicit coding and product implicit coding; Using a graph attention network to decode the fusion matrix based on the user implicit coding and the product implicit coding to obtain a user node representation and a product node representation; Recommend products to the user based on the user node representation and the product node representation.

2. The method according to claim 1, characterized in that The performing graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph includes: Determine the connectivity contribution of each edge in the initial interaction graph to the initial interaction graph; Determining a deletion probability of the edge based on the connectivity contribution; A corresponding random number is generated for each edge, and edges of the initial interaction graph are deleted according to the random number and the deletion probability to obtain an enhanced interaction graph.

3. The method according to claim 1, characterized in that The recommending a product to the user based on the user node representation and the product node representation includes: Constructing a target interaction matrix according to the user node representation and the commodity node representation; An interaction threshold is obtained, and commodities satisfying the interaction threshold in the target interaction matrix are recommended to corresponding users.

4. The method according to claim 1, characterized in that: The method further comprises: Determine an initial interaction matrix between the user and the product according to the initial interaction graph; Determine a predicted interaction matrix between the user and the commodity according to the user node representation and the commodity node representation; determining a reconstruction loss according to the predicted interaction matrix and the initial interaction matrix; Determine a user comparison loss according to the user node representation, and determine a product comparison loss according to the product node representation; Determine an overall contrast loss according to the user contrast loss and the product contrast loss; Determining a regularization loss according to a model parameter of the graph convolutional network, a model parameter of the graph attention network, and a regularization weight; Performing gradient mapping on the overall contrast loss and the reconstruction loss to obtain a mapping loss; Performing weighted fusion of the mapping loss and the regularization loss to obtain a fusion loss; The parameters of the graph convolutional network and the graph attention network are optimized according to the fusion loss so that the fusion loss is minimized.

5. The method according to claim 4, characterized in that The step of performing gradient mapping on the overall comparison loss and the reconstruction loss to obtain a mapping loss includes: Calculating a first gradient of the reconstruction loss and a second gradient of the overall contrast loss; determining a similarity between the first gradient and the second gradient; determining whether there is a gradient conflict between the first gradient and the second gradient based on the similarity; If there is a gradient conflict between the first gradient and the second gradient, the second gradient is mapped to the normal direction of the first gradient to eliminate the gradient conflict between the first gradient and the second gradient, thereby obtaining a mapping loss.

6. A recommendation device based on graph enhancement, characterized in that: The device comprises: A construction module, used to construct an initial interaction graph based on the interaction relationship between users and commodities, wherein the nodes of the initial interaction graph are users and commodities, and the edges of the initial interaction graph represent the existence of an interaction relationship between users and commodities; A processing module, configured to perform graph enhancement processing on the initial interaction graph to obtain an enhanced interaction graph; A determination module, used to determine a first-order adjacency matrix and a second-order adjacency matrix of the enhanced interaction graph; A fusion module, used for fusing the first-order adjacency matrix and the second-order adjacency matrix to obtain a fusion matrix; An encoding module, used for encoding the first-order adjacency matrix using a graph convolutional network to obtain a user implicit code and a product implicit code; A decoding module, used for decoding the fusion matrix based on the user implicit coding and the product implicit coding by using a graph attention network to obtain a user node representation and a product node representation; A recommendation module is used to recommend products to the user based on the user node representation and the product node representation.

7. The device according to claim 6, characterized in that The processing module is specifically used to determine the connectivity contribution of each edge in the initial interaction graph to the initial interaction graph; Determining a deletion probability of the edge based on the connectivity contribution; A corresponding random number is generated for each edge, and edges of the initial interaction graph are deleted according to the random number and the deletion probability to obtain an enhanced interaction graph.

8. The device according to claim 6, characterized in that The recommendation module includes: A construction submodule, used to construct a target interaction matrix according to the user node representation and the commodity node representation; The recommendation submodule is used to obtain an interaction threshold and recommend commodities that meet the interaction threshold in the target interaction matrix to corresponding users.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-5.