Object recommendation method and device based on graph contrast learning and electronic equipment

By constructing an interaction graph of a heterogeneous bipartite graph and utilizing graph contrastive learning, the problems of exposure bias and popularity bias in recommendation systems are solved, improving the recommendation effect of long-tail items and achieving greater diversity and fairness.

CN120849696APending Publication Date: 2025-10-28TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510854298.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing recommendation systems suffer from exposure bias and popularity bias, which leads to discrepancies between the training data distribution and the actual distribution, resulting in poor recommendation performance for long-tail items.

Method used

By constructing an interaction graph of a heterogeneous bipartite graph, and using graph contrastive learning, the neighborhood information of each node is aggregated based on the first and second values ​​of each edge in the interaction graph samples. This trains an object recommendation model, reducing the attention of popular objects and increasing the exposure opportunities of long-tail items.

Benefits of technology

It effectively mitigates popularity bias, improves the recommendation performance of long-tail items, enhances the diversity and fairness of the recommendation system, and maintains the accuracy of the existing recommendation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849696A_ABST
    Figure CN120849696A_ABST
Patent Text Reader

Abstract

The invention provides an object recommendation method and device based on graph contrast learning and electronic equipment, and relates to the technical field of artificial intelligence. The object recommendation method based on graph contrast learning comprises the steps of obtaining an interaction relation graph; wherein the interaction relation graph is a heterogeneous bipartite graph constructed according to a preset interaction behavior between a user and an object in the object recommendation system; the user node and the object node with the preset interaction behavior are connected through an edge with a first value; processing the interaction relation graph by utilizing an object recommendation model to obtain node embedding vectors of object nodes and user nodes in the interaction relation graph; and according to the node embedding vectors of the object nodes and the user nodes in the interaction relation graph, determining a target object matched with the user interest of the object recommendation system by utilizing a similarity algorithm, and recommending the target object to the user. On the premise of keeping the accuracy of an existing recommendation system, the long-tail article recommendation effect can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to an object recommendation method, apparatus, and electronic device based on graph comparison learning. Background Technology

[0002] Recommender systems, as a core technology for modern information filtering, have been widely applied in e-commerce, social media, streaming media, and many other fields, greatly improving the efficiency of information distribution and retrieval. In recent years, graph neural network (GNN)-based recommender systems have developed rapidly. Among them, LightGCN, with its simplified graph convolution operations, has effectively improved recommendation performance and has become a representative method in this field. Meanwhile, the rise of graph contrastive learning (GCL) has injected new vitality into the development of recommender systems. Methods such as SGL (Self-supervised Graph Learning) construct contrastive views through dropout strategies on nodes and edges, LightGCL combines lightweight design with contrastive learning, and SimGCL introduces latent space augmentation. These methods all aim to learn better node representations by maximizing the mutual information between different views, thereby optimizing recommendation performance.

[0003] However, current recommender systems face the problem of exposure bias. First, the training data distribution is biased; the set of items a user can observe is only a subset of the entire set. This leads to a large number of unexposed items being incorrectly treated as negative samples, causing a significant difference between the empirical distribution of the training data and the true distribution under ideal conditions. Second, popularity bias is prominent; popular items tend to receive excessive interactions, while long-tail items receive very few. This causes the recommendation results to be overly biased towards popular items, reducing the diversity and fairness of the recommendations. Furthermore, because the user-item interaction matrix is ​​relatively sparse, unobserved interactions do not accurately reflect the user's true preferences. The traditional approach of uniformly treating all unobserved interactions as negative samples is clearly unreasonable.

[0004] Therefore, how to effectively improve the recommendation effect of long-tail items while maintaining the accuracy of existing recommendation systems is an urgent technical problem to be solved. Summary of the Invention

[0005] This invention provides an object recommendation method, apparatus, and electronic device based on graph comparison learning, which addresses the aforementioned deficiencies in the prior art and effectively improves the recommendation effect of long-tail items while maintaining the accuracy of existing recommendation systems.

[0006] This invention provides an object recommendation method based on graph contrastive learning, comprising the following steps.

[0007] Obtain an interaction relationship graph; wherein the interaction relationship graph is a heterogeneous bipartite graph constructed based on the preset interaction behaviors between users and objects in the object recommendation system. The nodes of the interaction relationship graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value. Using an object recommendation model, process the interaction relationship graph to obtain the node embedding vectors of each object node and user node in the interaction relationship graph. Based on the node embedding vectors of each object node and user node in the interaction relationship graph, use a similarity algorithm to determine target objects that match the user's interests in the object recommendation system, and recommend the target objects to the user. The object recommendation model is obtained by performing graph comparison learning on a graph convolutional neural network based on the graph convolution result obtained by aggregating the neighborhood information of each node using the first and second values ​​of each edge in the interaction relationship graph sample. The second value of each edge in the interaction relationship graph sample is determined based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction relationship graph sample.

[0008] According to the object recommendation method based on graph contrast learning provided by the present invention, the object recommendation model is trained in the following manner: Obtain an interaction relationship graph sample; for each edge in the interaction relationship graph sample, determine a second value for the edge based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that each object node in the interaction relationship graph sample interacts with; based on the first value of each edge in the interaction relationship graph sample, aggregate the neighborhood information of each node using an initial graph convolutional neural network to obtain a first graph convolution result; based on the second value of each edge in the interaction relationship graph sample, aggregate the neighborhood information of each node using an initial graph convolutional neural network to obtain a second graph convolution result; based on the first graph convolution result and the second graph convolution result, train the initial graph convolutional neural network using a loss function to obtain the object recommendation model.

[0009] According to the object recommendation method based on graph contrastive learning provided by the present invention, the step of determining a second value of each edge in the interaction graph sample based on the number of user nodes that interact with the object nodes connected to the edge and the maximum number of user nodes that interact with each object node in the interaction graph sample includes: For each edge in the interaction graph sample, the second value of the edge is determined using the following formula: ; in, The edge between user node u and object node i in the interaction graph sample; The set of object nodes connected to user node u; The set of user nodes connected to object node i; This indicates that the user node u and the object node i are connected by an edge; This indicates that there is no interaction between user node u and object node i; where, The reverse bias score is obtained using the following formula: ; in, and For hyperparameters; The number of user nodes that interact with object node i; The maximum number of user nodes that interact with each of the object nodes; U is the set of user nodes, and I is the set of object nodes.

[0010] According to the present invention, an object recommendation method based on graph contrastive learning is provided, the method further comprising: Based on the first value of each edge in the interaction graph sample, a first adjacency matrix is ​​obtained; based on the second value of each edge in the interaction graph sample, a second adjacency matrix is ​​obtained; based on the first value of each edge in the interaction graph sample, using an initial graph convolutional neural network, the neighborhood information of each node is aggregated to obtain a first graph convolution result, including: based on the first adjacency matrix, using an initial graph convolutional neural network, the neighborhood information of each node is aggregated to obtain a first graph convolution result; the step of using an initial graph convolutional neural network to aggregate the neighborhood information of each node based on the second value of each edge in the interaction graph sample to obtain a second graph convolution result includes: based on the second adjacency matrix, using an initial graph convolutional neural network, the neighborhood information of each node is aggregated to obtain a second graph convolution result.

[0011] According to the present invention, an object recommendation method based on graph contrastive learning is provided. The initial graph convolutional neural network includes multiple graph convolutional network layers, each graph convolutional network layer corresponding to a second adjacency matrix. Obtaining the second adjacency matrix based on the second values ​​of each edge in the interaction graph sample includes: constructing a third adjacency matrix of the interaction graph sample based on the second values ​​of each edge in the interaction graph sample; adding different densification matrices to the third adjacency matrix to obtain the second adjacency matrix corresponding to each graph convolutional network layer; wherein the densification matrix is ​​composed of random factors generated from a uniform distribution. The method of aggregating the neighborhood information of each node using the initial graph convolutional neural network based on the second adjacency matrix to obtain a second graph convolution result includes: for each graph convolutional network layer, aggregating the neighborhood information of each node using its corresponding second adjacency matrix to obtain the second graph convolution result corresponding to that graph convolutional network layer.

[0012] According to the object recommendation method based on graph contrastive learning provided by the present invention, the step of adding different densification matrices to the third adjacency matrix to obtain a second adjacency matrix for each graph convolutional network layer includes: performing singular value decomposition on the third adjacency matrix to obtain a left singular matrix, a singular value diagonal matrix, and a right singular matrix; storing the left singular matrix, the singular value diagonal matrix, and the right singular matrix in memory; before aggregating the neighborhood information of each node using its corresponding second adjacency matrix for any graph convolutional network layer, performing the following operations: extracting the left singular matrix, the singular value diagonal matrix, and the right singular matrix from memory; performing low-rank reconstruction using the left singular matrix, the singular value diagonal matrix, and the right singular matrix to obtain a dimension-reduced third adjacency matrix; adding the densification matrix corresponding to the graph convolutional network layer to the dimension-reduced third adjacency matrix to obtain the second adjacency matrix corresponding to the graph convolutional network layer.

[0013] According to the present invention, an object recommendation method based on graph contrastive learning includes a user contrastive loss function and an item contrastive loss function. The user contrastive loss function is constructed based on the similarity between the first graph convolution result and the second graph convolution result of each user node in the interaction graph sample. The object contrastive loss function is constructed based on the similarity between the first graph convolution result and the second graph convolution result of each object node in the interaction graph sample. The user contrastive loss function is as follows: ; Where I represents the set of user nodes in the interaction graph sample, and i is the number of the user node; L represents the total number of layers in the graph convolutional network, and l represents the layer number of the graph convolutional network. It is the first graph convolution result of user node i in the l-th graph convolutional network layer; is the second graph convolution result of user node i in the l-th graph convolutional network layer; s(⋅) is the similarity calculation function; For temperature parameters; The item comparison loss function is as follows: ; Where U represents the set of object nodes in the interaction graph sample, and u is the number of the object node; It is the result of the first graph convolution of object node u in the l-th graph convolutional network layer; It is the result of the second graph convolution of object node u in the l-th graph convolutional network layer.

[0014] The present invention also provides an object recommendation device based on graph contrastive learning, comprising the following modules: An acquisition module is used to acquire an interaction relationship graph; wherein the interaction relationship graph is a heterogeneous bipartite graph constructed based on the preset interaction behaviors between users and objects in the object recommendation system, and the nodes of the interaction relationship graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value; a processing module is used to process the interaction relationship graph using an object recommendation model to obtain the node embedding vectors of each object node and user node in the interaction relationship graph; a determination module is used to determine the target object matching the user's interests in the object recommendation system based on the node embedding vectors of each object node and user node in the interaction relationship graph using a similarity algorithm, and recommend the target object to the user; wherein the object recommendation model is obtained by performing graph comparison learning on a graph convolutional neural network based on the graph convolution result obtained by aggregating the neighborhood information of each node based on the first and second values ​​of each edge in the interaction relationship graph sample; the second value of each edge in the interaction relationship graph sample is determined based on the number of user nodes that have interacted with the object node connected to the edge, and the maximum number of user nodes that have interacted with each object node in the interaction relationship graph sample.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the object recommendation method based on graph contrast learning as described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the object recommendation method based on graph contrast learning as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the object recommendation method based on graph contrast learning as described above.

[0018] This invention provides an object recommendation method, apparatus, and electronic device based on graph contrastive learning. It utilizes an object recommendation model to process an interaction graph, obtaining node embedding vectors for each object node and user node. Then, based on these vectors, a similarity algorithm is used to determine target objects matching the user's interests and recommend them to the user. This object recommendation model is obtained by aggregating the neighborhood information of each node using the first and second values ​​of each edge in the interaction graph sample, and then performing graph contrastive learning on a graph convolutional neural network. Since the second value of each edge in the interaction graph sample is determined based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample, it can effectively reduce the focus of the object recommendation model on popular objects and increase the focus on long-tail items (items that appear less frequently and have less user interaction in the object recommendation system), providing more exposure opportunities for long-tail items and effectively mitigating popularity bias. Thus, while maintaining the accuracy of existing recommendation systems, it effectively improves the recommendation effect of long-tail items. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the object recommendation method based on graph contrastive learning provided by the present invention.

[0021] Figure 2 This is a flowchart illustrating the training method of the object recommendation model provided by the present invention.

[0022] Figure 3 This is a schematic diagram of graph-based contrastive learning provided by the present invention.

[0023] Figure 4 This is a schematic diagram of the object recommendation device based on graph comparison learning provided by the present invention.

[0024] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0026] The following is combined with Figures 1-3 The present invention describes an object recommendation method based on graph comparison learning.

[0027] Figure 1 This is a flowchart illustrating the object recommendation method based on graph contrastive learning provided by the present invention, as shown below. Figure 1 As shown, the method includes the following: Step 101: Obtain the interaction relationship graph.

[0028] An interaction graph is a heterogeneous bipartite graph constructed based on the pre-defined interaction behaviors between users and objects in an object recommendation system. The nodes of the interaction graph include user nodes and object nodes.

[0029] Recommendation systems can include, but are not limited to: e-commerce recommendation systems, such as e-commerce platforms, which recommend products to users based on their browsing history, purchase records, search keywords, etc.; social media recommendation systems, such as social media platforms, which recommend content or users that users are interested in based on their following lists, likes, comments, shares, etc.; streaming media recommendation systems, such as streaming media platforms, which recommend movies, TV series, music, etc. to users based on their viewing history, playback records, collection preferences, etc.; and news and information recommendation systems, such as AB News, which recommend news and information to users based on their reading history, click behavior, interest tags, etc.

[0030] In different object recommendation systems, objects are different physical entities. For example, in an e-commerce recommendation system, objects can be various products, such as clothing, electronics, and food. In social media and streaming media recommendation systems, objects can be various forms of content, such as articles, videos, music, and images.

[0031] Preset interactive behaviors may include, but are not limited to: click behaviors, such as a user clicking a product link, article title, or video cover; purchase behaviors, such as a user purchasing a product on an e-commerce platform; viewing / playing behaviors, such as a user watching a movie, TV series, or playing music on a streaming platform; and like / comment / share behaviors, such as a user liking, commenting on, or sharing content on social media.

[0032] In different object recommendation systems, each user can be considered a member of a type of node in the interaction graph, namely a user node, and each object can be considered a member of a type of node in the interaction graph, namely an object node. For example, in an e-commerce recommendation system, each product can be regarded as an object node. These products have a unique product ID and related attribute information (such as price, brand, category, etc.).

[0033] A heterogeneous bipartite graph is a graph consisting of two different types of nodes (i.e., user nodes and object nodes) and edges connecting these two types of nodes. Edges exist only between nodes of different types, i.e., between user nodes and object nodes; there are no edges between nodes of the same type. This graph is called "heterogeneous" because it contains nodes of different types, and "bipartite" because the nodes are explicitly divided into two disjoint sets (the set of user nodes and the set of object nodes).

[0034] In recommender systems, heterogeneous bipartite graphs can be used to represent the interaction relationships between users and objects (such as products, music, videos, etc.). User nodes represent users in the system, object nodes represent objects that users may interact with, and edges represent pre-defined interaction behaviors between users and objects (such as clicking, purchasing, watching, etc.).

[0035] User nodes and object nodes with preset interactive behaviors are connected by edges with a first value (e.g., 1).

[0036] Step 102: Using the object recommendation model, process the interaction relationship graph to obtain the node embedding vectors of each object node and user node in the interaction relationship graph.

[0037] The object recommendation model is obtained by aggregating the neighborhood information of each node based on the first and second values ​​of each edge in the interaction graph sample, and then performing graph comparison learning on the graph convolutional neural network. The second value of each edge in the interaction graph sample is determined based on the number of user nodes that have interacted with the object node connected to the edge, and the maximum number of user nodes that have interacted with each object node in the interaction graph sample.

[0038] For a detailed description of the training process of the object recommendation model and the second value, please refer to [link / reference]. Figure 2 The relevant content will not be repeated here.

[0039] In the implementation process, the constructed interaction graph can be input into the recommendation model. The object recommendation model uses graph convolution operations to aggregate information of neighboring nodes through a forward propagation process, iteratively updating the embedding representation of each node in the interaction graph. Specifically, user nodes aggregate information of object nodes connected to them to update the embedding representation of user nodes; object nodes aggregate information of user nodes connected to them to update their embedding representation.

[0040] Step 103: Based on the node embedding vectors of each object node and user node in the interaction relationship graph, use a similarity algorithm to determine the target object that matches the user's interests in the object recommendation system, and recommend the target object to the user.

[0041] Similarity algorithms can include, but are not limited to, dot product algorithms, cosine similarity algorithms, and Euclidean distance similarity algorithms.

[0042] In the specific implementation process, a similarity algorithm can be used to calculate the similarity between the node embedding vector of each user node and the node embedding vector of each object node. All the obtained similarities are sorted in descending order, and the objects corresponding to the top n similarities are selected as the target objects and recommended to users in the object recommendation system.

[0043] Figure 2 This is a flowchart illustrating the training method of the object recommendation model provided by the present invention, as shown below. Figure 2 As shown, the method includes the following: Step 201: Obtain an interaction relationship graph sample.

[0044] The interaction graph sample is an interaction graph used to train the object recommendation model. For a detailed description of the interaction graph sample, please refer to the relevant content on interaction graphs in step 101; it will not be repeated here.

[0045] Step 202: For each edge in the interaction graph sample, determine the second value of the edge based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample.

[0046] In the specific implementation process, the second value of the edge can be determined in a variety of ways, based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that interact with each of the object nodes in the interaction graph sample.

[0047] In some embodiments, the reverse tendency score can be determined by the exponential function of the square root of the ratio between the number of user nodes that interact with the object nodes connected to the edge and the maximum number of user nodes that interact with each of the object nodes in the interaction graph sample. The reverse tendency score is then normalized to obtain the second value of the edge.

[0048] In the specific implementation process, for each edge in the interaction graph sample, the second value of the edge is determined using the following formula: (1) in, This is the weight matrix. The weights of the edges between user node u and object node i in the interaction graph sample; The set of object nodes connected to user node u; The set of user nodes connected to object node i; This indicates that the user node u and the object node i are connected by an edge; This indicates that there is no interaction between user node u and object node i; where, The reverse bias score is obtained by using the bias score. The bias score and reverse bias score are shown in the following formula: (2) (3) in, and For hyperparameters; The number of user nodes that interact with object node i; The maximum number of user nodes that interact with each of the object nodes; U is the set of user nodes, and I is the set of object nodes.

[0049] In an object recommendation system, the propensity score reflects the popularity of an object; popular objects have higher propensity scores. By using inverse propensity scores, the attention given to popular objects by the object recommendation model can be effectively reduced without changing the view structure, while the attention given to long-tail items can be increased, providing more exposure opportunities for long-tail items and effectively mitigating popularity bias.

[0050] Step 203: Based on the first value of each edge in the interaction graph sample, use the initial graph convolutional neural network to aggregate the neighborhood information of each node to obtain the first graph convolution result.

[0051] The first graph convolution result includes the node embedding vectors of each node obtained by performing graph convolution operations on each graph convolutional network layer of the graph convolutional neural network based on the first value of each edge in the interaction graph sample.

[0052] In practical implementation, the initial graph convolutional neural network can have various structures, not limited to those described in this specification. In some embodiments, the initial graph convolutional neural network can be LightGCN (Light Graph Convolution Network). The core idea of ​​LightGCN lies in its simplified graph convolution design, omitting the traditional self-connections in graph networks. It does not include the target node itself in the computation, but only aggregates information from the node's neighbors. When LightGCN is chosen as the propagation paradigm for graph convolution, no activation function or feature transformation is required. The corresponding graph convolution operation is defined as follows: (4) (5) in, For the node embedding vector of user node u in the l-th graph convolutional network layer, For the (l-1)th graph convolutional network layer, the node embedding vector of the object node i that has an interaction relationship with the user node u; For the node embedding vector of object node i in the l-th graph convolutional network layer, Let be the node embedding vector of user node u that has an interaction relationship with object node i in the (l-1)th graph convolutional network layer.

[0053] In the specific implementation process, the first adjacency matrix can be obtained based on the first value of each edge in the interaction graph sample.

[0054] The first connection matrix can be a block matrix as shown below.

[0055] (6) in, This is a matrix representing the connection relationships between user nodes and object nodes. A matrix of 0 indicates that there is no connection between user nodes or between object nodes. Each row (or column) corresponds to a user node, and each column (row) corresponds to an object node. Each element indicates whether there is a connection between its corresponding user node and object node. If there is a connection, its value is the first value (e.g., 1); if there is no connection, its value is zero.

[0056] Based on the first adjacency matrix, the graph convolution operation shown in formulas (4) and (5) is performed using the initial graph convolutional neural network to aggregate the neighborhood information of each node and obtain the first graph convolution result.

[0057] Step 204: Based on the second value of each edge in the interaction graph sample, use the initial graph convolutional neural network to aggregate the neighborhood information of each node to obtain the second graph convolution result.

[0058] The second graph convolution result includes the node embedding vectors of each node obtained by performing graph convolution operations on each graph convolutional network layer of the graph convolutional neural network based on the second value of each edge in the interaction graph sample.

[0059] In the specific implementation process, the second adjacency matrix can be obtained based on the second value of each edge in the interaction graph sample.

[0060] The initial graph convolutional neural network consists of multiple graph convolutional network layers, each of which corresponds to a second adjacency matrix.

[0061] In the specific implementation process, a second adjacency matrix can be constructed for each graph convolutional network layer in the following way.

[0062] Based on the second value of each edge in the interaction graph sample, construct the third adjacency matrix of the interaction graph sample.

[0063] The third adjacency matrix is ​​a block matrix as shown in formula (6). Each element in the third adjacency matrix indicates whether there is a connection between its corresponding user node and object node. If there is a connection, its value is the second value (determined by formula (1)). If there is no connection, its value is zero.

[0064] Different densification matrices are added to the third adjacency matrix to obtain the second adjacency matrix corresponding to each graph convolutional network layer; where the densification matrix is ​​composed of random factors generated from a uniform distribution.

[0065] In some embodiments, singular value decomposition is performed on the third adjacency matrix to obtain a left singular matrix, a singular value diagonal matrix, and a right singular matrix; these three matrices are then stored in memory. Before aggregating the neighborhood information of each node using its corresponding second adjacency matrix for any graph convolutional network layer, the left singular matrix, singular value diagonal matrix, and right singular matrix are extracted from memory; low-rank reconstruction is then performed using these matrices, for example, retaining the k largest singular values ​​in the singular value diagonal matrix and their corresponding column vectors of the left and right singular matrices to obtain the dimension-reduced third adjacency matrix. As shown in the following formula, the third adjacency matrix after dimensionality reduction is obtained by adding the densification matrix corresponding to the graph convolutional network layer.

[0066] (7) in, For a dense matrix, These are the left singular matrix, the singular value diagonal matrix, and the right singular matrix obtained after performing singular value decomposition on the third adjacency matrix.

[0067] In the embodiments provided by this invention, by performing low-rank decomposition and reconstruction on the third adjacency matrix, the original adjacency matrix can be approximated using a lower-dimensional matrix, effectively reducing computational load and storage requirements. These decomposed matrices are stored in GPU memory and retrieved during convolution at each graph-to-graph convolutional network layer to reconstruct the third adjacency matrix. Therefore, during the entire training process, the inverse tendency score (IPS) and low-rank matrix decomposition only need to be calculated once, significantly improving the training efficiency of the model.

[0068] For each graph convolutional network layer, the neighborhood information of each node is aggregated using its corresponding second adjacency matrix to obtain the second graph convolution result corresponding to the graph convolutional network layer.

[0069] In some embodiments, the second graph convolution result corresponding to the graph convolutional network layer can be obtained by using the weighted random walk Laplacian matrix shown below.

[0070] (8) in, It is the first l The aggregated neighbor embedding matrix of the layer (graph convolutional network layer) represents the number of layers in the graph convolutional network. l At the layer level, each node obtains a new node embedding vector by aggregating the embedding vectors of the nodes connected to it. It is the first l The node embedding matrix of the layer represents the node embedding matrix of the first layer. l At the layer level, the current embedding vector of each node in the interaction graph sample; D For the angle matrix, its first... k The diagonal elements are the third adjacency matrix. The k The harmony of actions.

[0071] Step 205: Based on the convolution results of the first and second graphs, train the initial graph convolutional neural network using the loss function to obtain the object recommendation model.

[0072] In some embodiments, the loss function is a joint loss function comprising the following components.

[0073] The Recommendation Loss (BPR) function is as follows: (9) in The training data consists of triples extracted from the interaction graph samples; Represents the observed interactions, User node u and object node i that interact with each other are considered as positive samples; Indicates unobserved interactions. User node u and object node i, which do not interact, are considered as negative samples; σ (⋅) is an activation function, such as the sigmoid function.

[0074] The user contrast loss function and the item contrast loss function are constructed based on the similarity between the first graph convolution result and the second graph convolution result of each user node in the interaction graph sample; the object contrast loss function is constructed based on the similarity between the first graph convolution result and the second graph convolution result of each object node in the interaction graph sample. The user-contrast loss function is as follows: (10) Where I represents the set of user nodes in the interaction graph sample, and i is the number of the user node; L represents the total number of layers in the graph convolutional network, and l represents the layer number of the graph convolutional network. It is the first graph convolution result of user node i in the l-th graph convolutional network layer; is the second graph convolution result of user node i in the l-th graph convolutional network layer; s(⋅) is the similarity calculation function; For temperature parameters; The item comparison loss function is as follows: (11) Where U represents the set of object nodes in the interaction graph sample, and u is the number of the object node; It is the result of the first graph convolution of object node u in the l-th graph convolutional network layer; It is the result of the second graph convolution of object node u in the l-th graph convolutional network layer.

[0075] The joint loss function is shown below.

[0076] (12) in, This represents all trainable model parameters. Control the ratio of contrast loss (the values ​​of the user contrast loss function and the item contrast loss function) to recommendation loss (the value of the recommendation loss function) in the recommendation task. Control the strength of L2 regularization to prevent overfitting.

[0077] In the specific implementation process, based on the joint loss function established above, the parameters of the initial graph convolutional network can be adjusted using a preset optimization algorithm (e.g., gradient descent optimization algorithm) to gradually reduce the value of the joint loss function until the model converges or reaches the preset number of training iterations, thus obtaining the object recommendation model.

[0078] In the embodiments provided by this invention, the node embedding vectors of positive and negative samples are maximized through the recommendation loss function, thereby ensuring the accuracy of the object recommendation model. The user comparison loss function and the item comparison loss function ensure that the first graph convolution result obtained based on the first edge value is as similar as possible to the second graph convolution result obtained based on the second edge value. This effectively mitigates biases caused by training data distribution bias, popularity bias, and sparsity without altering the original node embedding vector distribution. Furthermore, it allows for greater attention to long-tail items when recommending popular items, effectively improving the diversity and fairness of object recommendation.

[0079] The graph comparison learning proposed in this invention, such as Figure 3 As shown, this is called the BPH4Rec method (Balancing self-Presentation and self-Hiding for exposure-aware Recommendation).

[0080] In sociology, self-hiding refers to an individual's deliberate concealment of certain aspects of themselves during social interactions to maintain privacy, protect their identity, or avoid unnecessary attention. This selective concealment reflects how certain information is intentionally obscured or blurred to maintain the integrity of the system. Inspired by this concept, this invention, for the first time in the contrastive view of the graph contrast learning (GCL) framework, obtains the second value of the edges in the interaction graph sample through the inverse bias score shown in formula (3), thereby reducing the edge weight of objects with higher popularity. Based on the second value of the edges in the interaction graph sample, a second adjacency matrix is ​​constructed, realizing the self-hiding mechanism of popular objects and effectively reducing the overexposure of popular objects in recommendations.

[0081] In sociology, self-presentation refers to how individuals selectively emphasize certain traits while downplaying others in different social contexts to shape how others perceive them. This selective emphasis can be viewed as a form of densification—highlighting key aspects while keeping others unchanged. Inspired by this concept, this invention introduces a densification factor during the reconstruction process of the third adjacency matrix after low-rank decomposition. Essentially, this provides greater relative enhancement to low-weight edges, naturally offsetting the dominance of high-weight edges in the original adjacency matrix. This effectively improves the biases caused by popularity bias and sparsity in existing object recommendation systems without altering the original view structure. Different densification factors are generated for each graph convolutional network layer; these factors do not participate in forward propagation, thus preventing the accumulation of interference that could severely compromise data integrity.

[0082] The object recommendation device based on graph comparison learning provided by the present invention is described below. The object recommendation device based on graph comparison learning described below and the object recommendation method based on graph comparison learning described above can be referred to in correspondence.

[0083] Figure 4 This is a schematic diagram of the object recommendation device based on graph comparison learning provided by the present invention. Figure 4 As shown, the device 400 includes the following modules.

[0084] The acquisition module 410 is used to acquire an interaction relationship graph; wherein, the interaction relationship graph is a heterogeneous bipartite graph constructed based on the preset interaction behaviors between users and objects in the object recommendation system, and the nodes of the interaction relationship graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value.

[0085] The processing module 420 is used to process the interaction relationship graph using an object recommendation model to obtain the node embedding vectors of each object node and user node in the interaction relationship graph.

[0086] The determination module 430 is used to determine the target object that matches the user's interest in the object recommendation system based on the node embedding vectors of each object node and user node in the interaction relationship graph and using a similarity algorithm, and recommend the target object to the user.

[0087] The object recommendation model is obtained by aggregating the neighborhood information of each node based on the first and second values ​​of each edge in the interaction graph sample, and then performing graph comparison learning on the graph convolutional neural network. The second value of each edge in the interaction graph sample is determined based on the number of user nodes that interact with the object node connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample.

[0088] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communications bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communications bus 540. Processor 510 can call logic instructions in memory 530 to execute an object recommendation method based on graph contrastive learning. This method includes: acquiring an interaction graph; wherein the interaction graph is a heterogeneous bipartite graph constructed based on preset interaction behaviors between users and objects in the object recommendation system, the nodes of the interaction graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value; processing the interaction graph using an object recommendation model to obtain node embedding vectors for each object node and user node in the interaction graph; determining target objects matching the user's interests in the object recommendation system using a similarity algorithm based on the node embedding vectors of each object node and user node in the interaction graph, and recommending the target objects to the user; wherein the object recommendation model is obtained by performing graph contrastive learning on a graph convolutional neural network based on graph convolution results obtained by aggregating the neighborhood information of each node using the first and second values ​​of each edge in the interaction graph sample; the second value of each edge in the interaction graph sample is determined based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample.

[0089] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0090] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the object recommendation method based on graph contrastive learning provided by the above methods. The method includes: obtaining an interaction relationship graph; wherein the interaction relationship graph is a heterogeneous bipartite graph constructed based on preset interaction behaviors between users and objects in an object recommendation system, the nodes of the interaction relationship graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value; processing the interaction relationship graph using an object recommendation model to obtain the interaction relationship graph. The node embedding vectors of each object node and user node are used. Based on the node embedding vectors of each object node and user node in the interaction graph, a similarity algorithm is used to determine the target object that matches the user's interest in the object recommendation system, and the target object is recommended to the user. The object recommendation model is obtained by performing graph comparison learning on a graph convolutional neural network based on the graph convolution result obtained by aggregating the neighborhood information of each node using the first and second values ​​of each edge in the interaction graph sample. The second value of each edge in the interaction graph sample is determined based on the number of user nodes that have interacted with the object node connected to the edge, and the maximum number of user nodes that have interacted with each object node in the interaction graph sample.

[0091] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the object recommendation method based on graph contrastive learning provided by the above methods. The method includes: acquiring an interaction graph; wherein the interaction graph is a heterogeneous bipartite graph constructed based on preset interaction behaviors between users and objects in an object recommendation system, the nodes of the interaction graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges having a first value; processing the interaction graph using an object recommendation model to obtain the node embeddings of each object node and user node in the interaction graph. Vectors; based on the node embedding vectors of each object node and user node in the interaction graph, a similarity algorithm is used to determine the target object that matches the user's interest in the object recommendation system, and the target object is recommended to the user; wherein, the object recommendation model is obtained by performing graph comparison learning on a graph convolutional neural network based on the graph convolution result obtained by aggregating the neighborhood information of each node based on the first and second values ​​of each edge in the interaction graph sample; the second value of each edge in the interaction graph sample is determined based on the number of user nodes that have interacted with the object node connected to the edge, and the maximum number of user nodes that have interacted with each object node in the interaction graph sample.

[0092] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An object recommendation method based on graph contrastive learning, characterized in that, include: Obtain the interaction relationship graph; wherein, the interaction relationship graph is a heterogeneous bipartite graph constructed based on the preset interaction behaviors between users and objects in the object recommendation system, and the nodes of the interaction relationship graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value. Using an object recommendation model, the interaction graph is processed to obtain the node embedding vectors of each object node and user node in the interaction graph; Based on the node embedding vectors of each object node and user node in the interaction graph, a similarity algorithm is used to determine the target object that matches the user's interest in the object recommendation system, and the target object is recommended to the user. The object recommendation model is obtained by aggregating the neighborhood information of each node based on the first and second values ​​of each edge in the interaction graph sample, and then performing graph comparison learning on the graph convolutional neural network. The second value of each edge in the interaction graph sample is determined based on the number of user nodes that interact with the object node connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample.

2. The object recommendation method based on graph contrastive learning according to claim 1, characterized in that, The object recommendation model was trained using the following method: Obtain a sample interaction graph; For each edge in the interaction graph sample, a second value for the edge is determined based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that each object node in the interaction graph sample interacts with. Based on the first value of each edge in the interaction graph sample, the neighborhood information of each node is aggregated using the initial graph convolutional neural network to obtain the first graph convolution result; Based on the second value of each edge in the interaction graph sample, the neighborhood information of each node is aggregated using the initial graph convolutional neural network to obtain the second graph convolution result; Based on the convolution results of the first and second graphs, the initial graph convolutional neural network is trained using a loss function to obtain the object recommendation model.

3. The object recommendation method based on graph contrastive learning according to claim 2, characterized in that, For each edge in the interaction graph sample, the second value of the edge is determined based on the number of user nodes that interact with the object nodes connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample. This includes: For each edge in the interaction graph sample, the second value of the edge is determined using the following formula: ; in, The edge between user node u and object node i in the interaction graph sample; The set of object nodes connected to user node u; The set of user nodes connected to object node i; This indicates that the user node u and the object node i are connected by an edge; This indicates that there is no interaction between user node u and object node i; where, The reverse bias score is obtained using the following formula: ; in, and For hyperparameters; The number of user nodes that interact with object node i; The maximum number of user nodes that interact with each of the object nodes; U is the set of user nodes, and I is the set of object nodes.

4. The object recommendation method based on graph contrastive learning according to claim 3, characterized in that, The method further includes: Based on the first value of each edge in the interaction graph sample, the first adjacency matrix is ​​obtained; Based on the second value of each edge in the interaction graph sample, the second adjacency matrix is ​​obtained; Based on the first value of each edge in the interaction graph sample, the neighborhood information of each node is aggregated using an initial graph convolutional neural network to obtain the first graph convolution result, including: Based on the first adjacency matrix, the neighborhood information of each node is aggregated using the initial graph convolutional neural network to obtain the first graph convolution result; The second graph convolution result is obtained by aggregating the neighborhood information of each node using the second value of each edge in the interaction graph sample and an initial graph convolutional neural network, including: Based on the second adjacency matrix, the neighborhood information of each node is aggregated using the initial graph convolutional neural network to obtain the second graph convolution result.

5. The object recommendation method based on graph contrastive learning according to claim 4, characterized in that, The initial graph convolutional neural network includes multiple graph convolutional network layers, each of which corresponds to a second adjacency matrix; The process of obtaining the second adjacency matrix based on the second values ​​of each edge in the interaction graph sample includes: Based on the second value of each edge in the interaction graph sample, construct the third adjacency matrix of the interaction graph sample; Different densification matrices are added to the third adjacency matrix to obtain the second adjacency matrix corresponding to each graph convolutional network layer; wherein the densification matrix is ​​composed of random factors generated from a uniform distribution; The step of aggregating the neighborhood information of each node based on the second adjacency matrix using an initial graph convolutional neural network to obtain the second graph convolution result includes: For each graph convolutional network layer, the neighborhood information of each node is aggregated using its corresponding second adjacency matrix to obtain the second graph convolution result corresponding to the graph convolutional network layer.

6. The object recommendation method based on graph contrastive learning according to claim 5, characterized in that, The third adjacency matrix is ​​modified by adding different densification matrices to obtain a second adjacency matrix for each graph convolutional network layer, including: Singular value decomposition is performed on the third adjacency matrix to obtain a left singular matrix, a singular value diagonal matrix, and a right singular matrix; The left singular matrix, the singular value diagonal matrix, and the right singular matrix are stored in memory; Before aggregating the neighborhood information of each node using its corresponding second adjacency matrix for any graph convolutional network layer, the following operation is performed: Extract the left singular matrix, the singular value diagonal matrix, and the right singular matrix from memory; Using the left singular matrix, the singular value diagonal matrix, and the right singular matrix, a low-rank reconstruction is performed to obtain the dimension-reduced third adjacency matrix; Add the densification matrix corresponding to the graph convolutional network layer to the third adjacency matrix after dimensionality reduction to obtain the second adjacency matrix corresponding to the graph convolutional network layer.

7. The object recommendation method based on graph contrastive learning according to any one of claims 2 to 5, characterized in that, The loss function includes a user comparison loss function and an item comparison loss function; wherein, the user comparison loss function is constructed based on the similarity between the first graph convolution result and the second graph convolution result of each user node in the interaction relationship graph sample; the item comparison loss function is constructed based on the similarity between the first graph convolution result and the second graph convolution result of each object node in the interaction relationship graph sample; The user contrast loss function is as follows: ; Where I represents the set of user nodes in the interaction graph sample, and i is the number of the user node; L represents the total number of layers in the graph convolutional network, and l represents the layer number of the graph convolutional network. It is the first graph convolution result of user node i in the l-th graph convolutional network layer; is the second graph convolution result of user node i in the l-th graph convolutional network layer; s(⋅) is the similarity calculation function; For temperature parameters; The item comparison loss function is as follows: ; Where U represents the set of object nodes in the interaction graph sample, and u is the number of the object node; It is the result of the first graph convolution of object node u in the l-th graph convolutional network layer; It is the result of the second graph convolution of object node u in the l-th graph convolutional network layer.

8. An object recommendation device based on graph contrastive learning, characterized in that, include: The acquisition module is used to acquire the interaction relationship graph; wherein, the interaction relationship graph is a heterogeneous bipartite graph constructed based on the preset interaction behaviors between users and objects in the object recommendation system, and the nodes of the interaction relationship graph include user nodes and object nodes, and user nodes and object nodes with preset interaction behaviors are connected by edges with a first value. The processing module is used to process the interaction relationship graph using an object recommendation model to obtain the node embedding vectors of each object node and user node in the interaction relationship graph. The determination module is used to determine the target object that matches the user's interest in the object recommendation system based on the node embedding vectors of each object node and user node in the interaction relationship graph and using a similarity algorithm, and recommend the target object to the user. The object recommendation model is obtained by aggregating the neighborhood information of each node based on the first and second values ​​of each edge in the interaction graph sample, and then performing graph comparison learning on the graph convolutional neural network. The second value of each edge in the interaction graph sample is determined based on the number of user nodes that interact with the object node connected to the edge, and the maximum number of user nodes that interact with each object node in the interaction graph sample.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the object recommendation method based on graph contrastive learning as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the object recommendation method based on graph contrastive learning as described in any one of claims 1 to 7.