Recommendation method, system and equipment based on graph contrast learning and medium
By adopting graph comparison learning method in the collaborative filtering recommendation system, combining interactive simulation, uniform noise and structural neighborhood comparison learning, we generate recommendation models, which solves the problem of accuracy reduction caused by data sparseness, and improves the performance and accuracy of the recommendation system Rate.
Patent Information
- Application Number
- CN202411264775.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There is a problem of data sparsity in the collaborative filtering recommendation system, which leads to a decrease in the accuracy of the recommendation system. The existing methods can easily lose effective information through edge-removed graph comparison learning methods, affecting the performance of the recommendation system.
Using the recommended method based on graph comparison learning, by obtaining user project interaction diagrams, using graph neural network for interactive simulation processing, uniform noise comparison learning and structural neighborhood comparison learning, multi-task learning loss function, and training graph neural network , generate a recommendation model for project recommendation.
It improves the performance and accuracy of the recommendation system, comprehensively captures the interaction between users and projects, enhances the robustness of the model to the graph structure and comparative learning effect, and reveals the potential connection between users or projects.
Smart Images

Figure CN119293317A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to a recommendation method, system, device and medium based on graph comparative learning. Background Art
[0002] Collaborative filtering is a widely used technology in recommendation systems. However, a major challenge facing collaborative filtering is data sparsity, which can seriously affect the performance and effect of recommendation systems based on collaborative filtering. In related technologies, there is a graph contrastive learning enhanced recommendation method with edge culling that mines signals from the data itself to deal with the sparsity problem, that is, adding structural perturbations to the user-item binary graph and randomly discarding edges or nodes in a certain proportion. However, in practical applications, it is found that this method easily causes the loss of effective information, resulting in the accuracy of the recommendation system being affected.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a recommendation method, system, device and medium based on graph comparative learning, which can improve the accuracy of recommendations.
[0005] To achieve the above purpose, one aspect of an embodiment of the present application proposes a recommendation method based on graph contrast learning, the method comprising:
[0006] Get the user-project interaction graph;
[0007] Performing interactive simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function;
[0008] Performing uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function;
[0009] Performing structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function;
[0010] Training the graph neural network according to the first loss function, the second loss function, and the third loss function to obtain a recommendation model;
[0011] Item recommendations are performed on users according to the recommendation model to obtain recommendation results.
[0012] In some embodiments, performing interaction simulation processing on the user-item interaction graph by using a graph neural network to obtain a first loss function includes the following steps:
[0013] Inputting the user-item interaction graph into the graph neural network, and outputting a propagation output representation of each layer;
[0014] Aggregating the propagation output representations of each layer to obtain an aggregated representation;
[0015] The aggregate representation is calculated and processed according to the Bayesian personalized ranking loss function to obtain the first loss function.
[0016] In some embodiments, performing uniform noise contrast learning on the user-item interaction graph to obtain a second loss function comprises the following steps:
[0017] Performing embedding representation processing on the user-item interaction graph to obtain an initial embedding representation;
[0018] Constructing a noise vector according to the initial embedding representation, and performing angle rotation processing on the noise vector to obtain a random interference set;
[0019] Performing embedding integration processing on the initial embedding representation through each layer of the graph neural network according to the random interference set to obtain a target embedding representation set;
[0020] The target embedding representation set is calculated and processed according to the contrastive learning loss function to obtain the second loss function.
[0021] In some embodiments, the calculating and processing the target embedding representation set according to the contrastive learning loss function to obtain the second loss function comprises the following steps:
[0022] Acquire a user embedding representation set and a project embedding representation set from the target embedding representation set;
[0023] Calculating the user embedding representation set according to the contrastive learning loss function to obtain a user goal;
[0024] Calculating and processing the project embedding representation set according to the contrastive learning loss function to obtain a project target;
[0025] A weighted summation process is performed on the user goal and the project goal to obtain the second loss function.
[0026] In some embodiments, performing structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function comprises the following steps:
[0027] Inputting the user-item interaction graph into the graph neural network, and outputting an embedding representation of an even-numbered layer;
[0028] The embedding representation of the even layer is calculated and processed according to the contrastive learning loss function to obtain the third loss function.
[0029] In some embodiments, the calculating and processing the embedding representation of the even layer according to the contrastive learning loss function to obtain the third loss function comprises the following steps:
[0030] Obtaining an initial user embedding representation and an initial item embedding representation of the user-item interaction graph;
[0031] Calculating the initial user embedding representation and the embedding representation of the even-numbered layer according to the contrastive learning loss function to obtain a user structural contrast loss;
[0032] Calculating the initial project embedding representation and the embedding representation of the even-numbered layer according to the contrastive learning loss function to obtain a project structure contrast loss;
[0033] The user structure contrast loss and the item structure contrast loss are weightedly summed to obtain the third loss function.
[0034] In some embodiments, training the graph neural network according to the first loss function, the second loss function, and the third loss function to obtain a recommendation model includes the following steps:
[0035] Performing weighted sum processing on the first loss function, the second loss function and the third loss function, and adding a regularization term to the summation result to obtain a multi-task learning loss function;
[0036] The model parameters of the graph neural network are updated according to the multi-task learning loss function to obtain a recommendation model.
[0037] To achieve the above purpose, another aspect of the embodiment of the present application proposes a recommendation system based on graph contrast learning, the system comprising:
[0038] The first module is used to obtain the user-item interaction graph;
[0039] The second module is used to perform interaction simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function;
[0040] A third module is used to perform uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function;
[0041] A fourth module is used to perform structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function;
[0042] A fifth module is used to train the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model;
[0043] The sixth module is used to perform item recommendation processing on the user according to the recommendation model to obtain recommendation results.
[0044] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0045] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0046] The embodiments of the present application include at least the following beneficial effects: The present application provides a recommendation method, system, device and medium based on graph contrast learning, the scheme obtains a user-item interaction graph; performs interaction simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function, which can simulate the interaction between users and items through a graph collaborative filtering framework, capture the relationship observed in the user-item interaction graph, and thus improve the performance of the recommendation system; in addition, the scheme performs uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function, which can enhance data representation by introducing random noise, thereby improving the robustness of the model to the graph structure and the contrastive learning effect; furthermore, the scheme performs structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function, which can use structural neighborhoods for contrast learning, and through hierarchical propagation and aggregation of user or item embeddings, reveals the potential connection between users or items, and improves the performance of the recommendation system; and the scheme trains the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model; performs item recommendation processing on users according to the recommendation model to obtain recommendation results, which can comprehensively improve the performance of the recommendation system, accurately capture the interactive relationship between users and items, and improve the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flowchart of a recommendation method based on graph comparative learning provided in an embodiment of the present application;
[0048] Figure 2 is a visualization schematic diagram of data enhancement based on random noise provided in an embodiment of the present application;
[0049] Figure 3 It is a structural diagram of a recommendation system based on graph comparative learning provided in an embodiment of the present application;
[0050] Figure 4It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of systems and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0052] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0053] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0055] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0056] In the related art, collaborative filtering (CF) is a widely used technique in recommendation systems. However, a major challenge facing CF technology is data sparsity, which seriously affects the performance and effect of CF-based recommendation systems. The data sparsity problem is a common challenge in recommendation systems, which refers to the fact that only very little data is known among a large number of possible user-item interactions. This makes it difficult for the model to learn effective user or item features, thus affecting the accuracy and personalization of recommendations. To alleviate this problem, more and more studies have adopted contrastive learning methods. By extracting common features from a large amount of unlabeled data in a self-supervised manner and normalizing them, contrastive learning has made significant progress in multiple research fields. However, a common method of applying contrastive learning in recommendation systems is to add structural perturbations to the user-item binary graph, such as randomly discarding edges / nodes in a certain proportion. Then, the consistency of representations in different views is maximized through a graph encoder. This method uses the contrastive learning task as an auxiliary task and optimizes it together with the recommendation task, but ignores the importance of constructing a meaningful contrastive learning task specifically for the recommendation task, which easily causes effective information to be lost, resulting in the accuracy of the recommendation system being affected.
[0057] In view of this, a recommendation method, system, device and medium based on graph contrast learning are provided in the embodiments of the present application. The scheme obtains a user-project interaction graph; performs interaction simulation processing on the user-project interaction graph through a graph neural network to obtain a first loss function, which can simulate the interaction between users and projects through a graph collaborative filtering framework, capture the relationship observed in the user-project interaction graph, and thus improve the performance of the recommendation system; in addition, the scheme performs uniform noise contrast learning processing on the user-project interaction graph to obtain a second loss function, which can enhance data representation by introducing random noise, thereby improving the robustness of the model to the graph structure and the contrastive learning effect; furthermore, the scheme performs structural neighborhood contrast learning processing on the user-project interaction graph to obtain a third loss function, which can use structural neighborhoods for contrast learning to reveal the potential connections between users or projects through hierarchical propagation and aggregation of user or project embeddings, thereby improving the performance of the recommendation system; and the scheme trains the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model; performs project recommendation processing on users according to the recommendation model to obtain recommendation results, which can comprehensively improve the performance of the recommendation system, accurately capture the interactive relationship between users and projects, and improve the accuracy of recommendations.
[0058] A recommendation method based on graph contrast learning provided in an embodiment of the present application relates to the field of machine learning technology. A recommendation method based on graph contrast learning provided in an embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements a recommendation method based on graph contrast learning, etc., but is not limited to the above forms.
[0059] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0060] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0061] Figure 1is an optional flowchart of a recommendation method based on graph contrast learning provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0062] Step S101, obtaining a user-project interaction graph;
[0063] Step S102, performing interaction simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function;
[0064] Step S103, performing uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function;
[0065] Step S104, performing structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function;
[0066] Step S105, training the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model;
[0067] Step S106: perform item recommendation processing on the user according to the recommendation model to obtain a recommendation result.
[0068] Steps S101 to S106 shown in the embodiment of the present application are obtained by obtaining a user-item interaction graph; the user-item interaction graph is interactively simulated through a graph neural network to obtain a first loss function, which can simulate the interaction between users and items through a graph collaborative filtering framework, capture the relationship observed in the user-item interaction graph, and thus improve the performance of the recommendation system; in addition, the scheme performs uniform noise contrast learning on the user-item interaction graph to obtain a second loss function, which can enhance data representation by introducing random noise, thereby improving the robustness of the model to the graph structure and the contrastive learning effect; furthermore, the scheme performs structural neighborhood contrast learning on the user-item interaction graph to obtain a third loss function, which can utilize structural neighborhoods for contrastive learning, and reveals the potential connections between users or items through hierarchical propagation and aggregation of user or item embeddings, thereby improving the performance of the recommendation system; and the scheme trains the graph neural network according to the first loss function, the second loss function, and the third loss function to obtain a recommendation model; performs item recommendation processing on users according to the recommendation model to obtain recommendation results, which can comprehensively improve the performance of the recommendation system, accurately capture the interactive relationship between users and items, and improve the accuracy of recommendations.
[0069] In step S101 of some embodiments, a user-item interaction graph is obtained, wherein a user set and an item set are obtained, and the item can be data such as items and songs that need to be recommended. An interaction matrix is also obtained, and the interaction matrix represents the interaction between users and items, that is, the implicit relationship between each user and each item. The user set and the item set are graph-processed through the interaction matrix to obtain a user-item interaction graph.
[0070] In step S102 of some embodiments, performing interaction simulation processing on the user-item interaction graph by using a graph neural network to obtain a first loss function includes the following steps:
[0071] The step of performing interactive simulation processing on the user-item interaction graph by using a graph neural network to obtain a first loss function comprises the following steps:
[0072] Inputting the user-item interaction graph into the graph neural network, and outputting a propagation output representation of each layer;
[0073] Aggregating the propagation output representations of each layer to obtain an aggregated representation;
[0074] The aggregate representation is calculated and processed according to the Bayesian personalized ranking loss function to obtain the first loss function.
[0075] In an embodiment of the present application, a graph neural network is used to capture the interactions observed in the user-item interaction graph. In particular, the embodiment of the present application simulates the interaction according to the decoupled graph collaborative filtering (DGCF) method, where the decoupled graph collaborative filtering method uses a graph neural network to decompose user intent to achieve more accurate recommendation filtering. Due to the dynamic changes in the graph structure, the propagated adjacency set may change over time or other factors. The user-item interaction graph is input into the graph neural network, and the output is the propagation output representation of each layer, where the expression of the propagation output representation of each layer is shown as follows:
[0076]
[0077] In the formula, and Represent the representations of user u and item i at the l+1 layer, N u and N i are the adjacency sets represented by user u and item i respectively.
[0078] Then, the propagation output representation of each layer is aggregated, and the weighted summation mechanism is used as the aggregation method to merge the representations of each layer to obtain the aggregated representation. The expression of the aggregated representation is shown in the following formula:
[0079]
[0080] In the formula, h u and h i are the aggregate representations of user u and item i, L represents the number of layers of the graph neural network, and α l Represents the parameters of the graph neural network at layer l.
[0081] In order to predict the possibility of interaction between user u and item i, the prediction score is obtained by inner product calculation. The expression of the prediction score is as follows:
[0082]
[0083] In the formula, represents the predicted score of user u and item i.
[0084] Finally, the aggregate representation is calculated according to the Bayesian personalized ranking loss function to obtain the first loss function. The expression of the first loss function is as follows:
[0085]
[0086] In the formula, represents the first loss function, j represents the item with which user u has not interacted, and O represents the paired training data consisting of observed interaction data (u, i) and unobserved interaction data (u, j). The embodiment of the present application accurately represents the interaction between the user and the item through the first loss function, which can improve the accuracy of the recommendation.
[0087] In some embodiments, performing uniform noise contrast learning on the user-item interaction graph to obtain a second loss function comprises the following steps:
[0088] Performing embedding representation processing on the user-item interaction graph to obtain an initial embedding representation;
[0089] Constructing a noise vector according to the initial embedding representation, and performing angle rotation processing on the noise vector to obtain a random interference set;
[0090] Performing embedding integration processing on the initial embedding representation through each layer of the graph neural network according to the random interference set to obtain a target embedding representation set;
[0091] The target embedding representation set is calculated and processed according to the contrastive learning loss function to obtain the second loss function.
[0092] In the embodiment of the present application, in order to solve the challenges and computational overhead associated with operating graph structures in a uniformly distributed representation space, the field of embedding space is explored. Drawing on the field of adversarial learning, adversarial samples are generated by using imperceptible perturbations of input images. Specifically, the user-item interaction graph is embedded to obtain an initial embedding representation, and the nodes and their initial embedding representations in the multidimensional embedding space are enhanced. The noise vector Δ′ of the node representation is introduced. i and Δ″ i , the noise vector is a point on the unit hypersphere with radius ∈. In addition, Δ′ i and Δ″ i and the original node representation are located on the same hyperplane. The purpose of this setting is to prevent a large deviation caused by the addition of noise, thereby avoiding the generation of low-quality positive samples. Figure 2 As shown, e i represents the initial embedding representation, and the embodiment of the present application adds a scaled noise vector to the original representation to rotate it in two-dimensional space. Specifically, by rotating the noise vector by a small angle (θ and φ), each rotation corresponds to e i A small deviation of , resulting in two enhanced representations (e′ i and e″ i ), and obtain a random perturbation set. The magnitude of this rotation is small, enough to ensure that the enhanced representation retains most of the information of the original representation while introducing some variability. In order to ensure diversity and enhance the robustness of the learning process, it is critical to apply different random noise to each node representation. The initial embedding representation is embedded and integrated by passing the random perturbation set through each layer of the graph neural network, specifically through the graph neural network as an encoder to promote the propagation of node-specific information while promoting variability effects. In each layer, different levels of random perturbations are integrated into the existing node embeddings. This process will result in the final acquisition of changed node representations. The expression of the target embedding representation set is as follows:
[0093]
[0094] In the formula, represents the feature representation of node i in the l+1th layer based on the noise enhancement graph, and σ is the Sigmoid activation function, N(i) and N(j) are the neighbor sets represented by user u and item i respectively, W is the feature change matrix, Δ j is the noise vector of node j.
[0095] It should be noted that the embodiment of the present application skips the process of adding random noise to the input embedding, which can achieve a slight performance improvement. Then, the target embedding representation set is calculated and processed according to the contrastive learning loss function to obtain a second loss function, the goal of which is to minimize the loss based on the contrastive learning loss function (InfoNCE).
[0096] In some embodiments, the calculating and processing the target embedding representation set according to the contrastive learning loss function to obtain the second loss function comprises the following steps:
[0097] Acquire a user embedding representation set and a project embedding representation set from the target embedding representation set;
[0098] Calculating the user embedding representation set according to the contrastive learning loss function to obtain a user goal;
[0099] Calculating and processing the project embedding representation set according to the contrastive learning loss function to obtain a project target;
[0100] The user goal and the project goal are weightedly summed to obtain the second loss function.
[0101] In an embodiment of the present application, a user embedding representation set and a project embedding representation set are obtained from a target embedding representation set. The user embedding representation set is calculated and processed according to a contrastive learning loss function to obtain a user target. The expression of the user target is as follows:
[0102]
[0103] In the formula, represents the user goal, z′ i and z″ i represents the normalized multidimensional node embedding obtained by two different noise-based graph augmentations, with parameters Represents the user set. The parameter τ>0 represents the temperature hyperparameter in the softmax function.
[0104] Then, the project embedding representation set is calculated based on the contrastive learning loss function to obtain the project goal, which is expressed as follows:
[0105]
[0106] In the formula, represents the project goal, z′ i and z″ irepresents the normalized multi-dimensional node embedding obtained by two different noise-based graph augmentations. The parameter τ>0 represents the temperature hyperparameter in the softmax function. The contrast loss is to enhance z′ i and z″ i They are the augmented representations of the same node used to form a positive pair, and the minimum z′ i and z″ i Finally, the user goal and the project goal are weighted and summed to obtain the second loss function. The expression of the second loss function is as follows:
[0107]
[0108] In the formula, represents the second loss function, Indicates the user's goal, Represents the project goal, and α is a hyperparameter used to balance the weight of loss in contrastive learning. The embodiment of the present application introduces a rotation enhancement of uniform noise and a uniform noise enhancement method of performing a small-angle rotation in the embedding space to ensure the flexibility of noise addition and the stability of representation.
[0109] In some embodiments, performing structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function comprises the following steps:
[0110] Inputting the user-item interaction graph into the graph neural network, and outputting an embedding representation of an even-numbered layer;
[0111] The embedding representation of the even layer is calculated and processed according to the contrastive learning loss function to obtain the third loss function.
[0112] In an embodiment of the present application, considering the bipartite nature of the interaction graph, a model based on a graph neural network performs even information propagation, which inherently aggregates information from isomorphic neighbors. This process can extract potential neighbors in a cluster of users or projects. Therefore, the representation of homogeneous neighborhoods can be obtained from the output of even layers (such as the 2nd, 4th, and 6th layers) within the graph neural network framework. These representations play a vital role in accurately capturing the relationship between users or projects and their structurally similar neighbors. By inputting the user-project interaction graph into the graph neural network, the output obtains the embedded representation of the even layer. Then, the embedded representation of the even layer is calculated and processed according to the contrastive learning loss function to obtain a third loss function. The embodiment of the present application uses a graph neural network to conduct comparative analysis on users or projects, and aggregates them through hierarchical propagation, which can not only focus on the direct interaction between nodes, but also make full use of structured neighborhood information, capture high-order relationships and collaboration signals, thereby improving the performance of the recommendation system.
[0113] In some embodiments, the calculating and processing the embedding representation of the even layer according to the contrastive learning loss function to obtain the third loss function comprises the following steps:
[0114] Obtaining an initial user embedding representation and an initial item embedding representation of the user-item interaction graph;
[0115] Calculating the initial user embedding representation and the embedding representation of the even-numbered layer according to the contrastive learning loss function to obtain a user structural contrast loss;
[0116] Calculating the initial project embedding representation and the embedding representation of the even-numbered layer according to the contrastive learning loss function to obtain a project structure contrast loss;
[0117] The user structure contrast loss and the item structure contrast loss are weightedly summed to obtain the third loss function.
[0118] In an embodiment of the present application, an initial user embedding representation and an initial project embedding representation are obtained from the user-item interaction graph, and the initial user embedding representation and the embedding representation of the even-numbered layer are calculated and processed according to the contrastive learning loss function to obtain a user structure contrast loss. The expression of the user structure contrast loss is as follows:
[0119]
[0120] In the formula, represents the user structure contrast loss, represents the user embedding representation of user u in the even-numbered layer,
[0121] That is, the normalized output of the kth GNN layer, k is an even number, represents the initial embedding representation of user u, and the parameter Represents a collection of users.
[0122] Similarly, the contrastive learning loss function calculates the initial item embedding representation and the embedding representation of the even layer to obtain the item structure contrast loss. The expression of the item structure contrast loss is as follows:
[0123]
[0124] In the formula, represents the project structure contrast loss, represents the user embedding representation of item j in the even layer, that is, the normalized output of the kth GNN layer, where k is an even number. represents the initial item embedding representation of item j, and parameter ν represents the item set.
[0125] Finally, the user structure contrast loss and the item structure contrast loss are weighted and summed to obtain the third loss function. The expression of the third loss function is as follows:
[0126]
[0127] In the formula, Denotes the second loss function, and α denotes a hyperparameter. The embodiment of the present application utilizes structural neighborhoods for contrastive learning, and hierarchically propagates and aggregates the embedding of users or items, thereby revealing the potential connections between users or items and improving the performance of the recommendation system.
[0128] In some embodiments, training the graph neural network according to the first loss function, the second loss function, and the third loss function to obtain a recommendation model includes the following steps:
[0129] Performing weighted sum processing on the first loss function, the second loss function and the third loss function, and adding a regularization term to the summation result to obtain a multi-task learning loss function;
[0130] The model parameters of the graph neural network are updated according to the multi-task learning loss function to obtain a recommendation model.
[0131] In the embodiment of the present application, since the main goal of collaborative filtering is to model the interaction between users and items, the embodiment of the present application uses the widely adopted Bayesian personalized ranking loss function (BPR loss) to train the model. In addition, two contrastive learning losses are used as supplements, and a multi-task learning strategy is used to jointly train the traditional ranking loss and the proposed contrastive loss to obtain a multi-task learning loss function, and the expression of the multi-task learning loss function is as follows:
[0132]
[0133] In the formula, represents the multi-task learning loss function, λ1, λ2, and λ3 represent the hyperparameters that control the weights of the two contrastive learning losses and the regularization term, respectively, and Θ represents a set of parameters of the graph neural network.
[0134] The embodiment of the present application enhances contrastive learning by adding neighbor relationships and random noise to the representation through a multi-task learning strategy, and can incorporate both structural neighborhoods and uniform noise into the embedding space to improve neural graph collaborative filtering, thereby improving the robustness and effectiveness of the model.
[0135] The following is a detailed description of the embodiments of the present invention with reference to specific application examples:
[0136] The present application embodiment integrates the graph contrast learning-based recommendation method into the graph neural network-based recommendation system through experimental settings and extensive experiments. In order to evaluate the effectiveness of SNUNEL, we tested it on four widely recognized datasets: Movie-1M (ML-1M), Amazon Books, Alibaba Fashion, and Scholat. These datasets differ in their domains, sizes, and interaction densities. For each dataset, the present application embodiment divides the data into 80% for training, 10% for validation, and the remaining 10% for performance evaluation. In the training phase, the present application embodiment pairs each positive instance with a negative item to construct a training set. By comparing the performance of the proposed graph contrast learning-based recommendation method (SNUNEL model) with other different types of recommendation models on four different datasets, it can be seen that the performance on different datasets is good and has obvious advantages over other models. The SNUNEL model uses structural neighbors to capture the potential relationship between users or items and creates a contrast view by adding uniform noise. This contrast learning method can help the model better learn the representation of users and items and improve the accuracy and effect of recommendations. The present application embodiment captures structural neighborhood information by introducing a structural contrast target, thereby providing a richer contrast for the contrast learning process. In addition, the embodiment of the present application uses uniform noise to create contrast views, thereby avoiding the need for image enhancement and mitigating the impact of popular bias. By capturing structural neighborhood information and introducing uniform noise, the method effectively solves the data sparsity problem existing in traditional CF methods. Experimental results show that the performance of the proposed method on various benchmark datasets has been significantly improved.
[0137] See also Figure 3 The present application also provides a recommendation system based on graph contrast learning, which can implement the above-mentioned recommendation method based on graph contrast learning. The system includes:
[0138] The first module 301 is used to obtain a user-item interaction graph;
[0139] The second module 302 is used to perform interaction simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function;
[0140] The third module 303 is used to perform uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function;
[0141] The fourth module 304 is used to perform structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function;
[0142] The fifth module 305 is used to train the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model;
[0143] The sixth module 306 is used to perform item recommendation processing on the user according to the recommendation model to obtain a recommendation result.
[0144] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0145] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned recommendation method based on graph comparison learning when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0146] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0147] See also Figure 4 , Figure 4 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0148] The processor 401 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0149] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 402, and the processor 401 calls and executes the recommendation method based on graph comparison learning in the embodiment of this application;
[0150] Input / output interface 403, used to implement information input and output;
[0151] Communication interface 404, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0152] Bus 405 , which transmits information between various components of the device (e.g., processor 401 , memory 402 , input / output interface 403 , and communication interface 404 );
[0153] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via the bus 405 .
[0154] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned recommendation method based on graph comparative learning is implemented.
[0155] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0156] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0157] The embodiments of the present application provide a recommendation method, system, device and medium based on graph contrast learning. The scheme obtains a user-project interaction graph; performs interaction simulation processing on the user-project interaction graph through a graph neural network to obtain a first loss function, which can simulate the interaction between users and projects through a graph collaborative filtering framework, capture the relationship observed in the user-project interaction graph, and thus improve the performance of the recommendation system; in addition, the scheme performs uniform noise contrast learning processing on the user-project interaction graph to obtain a second loss function, which can enhance data representation by introducing random noise, thereby improving the robustness of the model to the graph structure and the contrastive learning effect; furthermore, the scheme performs structural neighborhood contrast learning processing on the user-project interaction graph to obtain a third loss function, which can use structural neighborhoods for contrast learning to reveal the potential connections between users or projects through hierarchical propagation and aggregation of user or project embeddings, thereby improving the performance of the recommendation system; and the scheme trains the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model; performs project recommendation processing on users according to the recommendation model to obtain recommendation results, which can comprehensively improve the performance of the recommendation system, accurately capture the interactive relationship between users and projects, and improve the accuracy of recommendations.
[0158] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0159] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0160] The system embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0161] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0162] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0163] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0164] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0165] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0168] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A recommendation method based on graph contrast learning, characterized in that: The method comprises the following steps: Get the user-project interaction graph; Performing interactive simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function; Performing uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function; Performing structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function; Training the graph neural network according to the first loss function, the second loss function, and the third loss function to obtain a recommendation model; Item recommendations are performed on users according to the recommendation model to obtain recommendation results.
2. The method according to claim 1, characterized in that The step of performing interactive simulation processing on the user-item interaction graph by using a graph neural network to obtain a first loss function comprises the following steps: Inputting the user-item interaction graph into the graph neural network, and outputting a propagation output representation of each layer; Aggregating the propagation output representations of each layer to obtain an aggregated representation; The aggregate representation is calculated and processed according to the Bayesian personalized ranking loss function to obtain the first loss function.
3. The method according to claim 1, characterized in that: The step of performing uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function comprises the following steps: Performing embedding representation processing on the user-item interaction graph to obtain an initial embedding representation; Constructing a noise vector according to the initial embedding representation, and performing angle rotation processing on the noise vector to obtain a random interference set; Performing embedding integration processing on the initial embedding representation through each layer of the graph neural network according to the random interference set to obtain a target embedding representation set; The target embedding representation set is calculated and processed according to the contrastive learning loss function to obtain the second loss function.
4. The method according to claim 3, characterized in that The step of calculating and processing the target embedding representation set according to the contrastive learning loss function to obtain the second loss function comprises the following steps: Acquire a user embedding representation set and a project embedding representation set from the target embedding representation set; Calculating the user embedding representation set according to the contrastive learning loss function to obtain a user goal; Calculating and processing the project embedding representation set according to the contrastive learning loss function to obtain a project target; A weighted summation process is performed on the user goal and the project goal to obtain the second loss function.
5. The method according to claim 1, characterized in that: The step of performing structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function comprises the following steps: Inputting the user-item interaction graph into the graph neural network, and outputting an embedding representation of an even-numbered layer; The embedding representation of the even layer is calculated and processed according to the contrastive learning loss function to obtain the third loss function.
6. The method according to claim 5, characterized in that The step of calculating and processing the embedding representation of the even layer according to the contrastive learning loss function to obtain the third loss function comprises the following steps: Obtaining an initial user embedding representation and an initial item embedding representation of the user-item interaction graph; Calculating the initial user embedding representation and the embedding representation of the even-numbered layer according to the contrastive learning loss function to obtain a user structural contrast loss; Calculating the initial project embedding representation and the embedding representation of the even-numbered layer according to the contrastive learning loss function to obtain a project structure contrast loss; The user structure contrast loss and the item structure contrast loss are weightedly summed to obtain the third loss function.
7. The method according to any one of claims 1 to 6, characterized in that: The step of training the graph neural network according to the first loss function, the second loss function, and the third loss function to obtain a recommendation model comprises the following steps: Performing weighted sum processing on the first loss function, the second loss function and the third loss function, and adding a regularization term to the summation result to obtain a multi-task learning loss function; The model parameters of the graph neural network are updated according to the multi-task learning loss function to obtain a recommendation model.
8. A recommendation system based on graph contrastive learning, characterized in that: The system comprises: The first module is used to obtain the user-item interaction graph; The second module is used to perform interaction simulation processing on the user-item interaction graph through a graph neural network to obtain a first loss function; A third module is used to perform uniform noise contrast learning processing on the user-item interaction graph to obtain a second loss function; A fourth module is used to perform structural neighborhood contrast learning processing on the user-item interaction graph to obtain a third loss function; A fifth module is used to train the graph neural network according to the first loss function, the second loss function and the third loss function to obtain a recommendation model; The sixth module is used to perform item recommendation processing on the user according to the recommendation model to obtain recommendation results.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Multi-contrast learning recommendation method based on knowledge graph
CN116010708A
Multi-view comparative learning recommendation method and system of fusion layer attention mechanism
CN117131282A
Recommendation system popularity depolarization method based on representation enhancement
CN118332193A
Cross-domain recommendation via contrastive learning of user behaviors in attentive sequence models
US20240161165A1
Cited By
Graph collaborative filtering recommendation method for adaptive data enhancement
CN120448647A