Robust collaborative filtering method and device based on graph contrast learning

By generating the node degree matrix and calculating the weight value, the problem of poor results in the graph model when processing graph data with large node degree differences is solved, and more efficient and robust graph data processing is achieved.

CN119474559AInactive Publication Date: 2025-02-18西交网络空间安全研究院 +3

Patent Information

Application Number
CN202510038316.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has poor results when processing graph data with large node differences, resulting in the graph model being unable to effectively learn general features and not having high processing efficiency.

Method used

By generating a node degree matrix based on sample user nodes and interactive object nodes, the weight values ​​of the node degree are calculated, and these weight values ​​and sample adjacency matrix are input into the graph neural network model, the model parameters are adjusted to improve robustness and processing efficiency.

Benefits of technology

This method can reduce the impact of node degree difference on graph model performance to a certain extent, improve the processing efficiency of graph data with large node degree differences, and improve the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474559A_ABST
    Figure CN119474559A_ABST
Patent Text Reader

Abstract

The invention provides a robust collaborative filtering method and device based on graph contrast learning, and the method comprises the steps: training a first graph neural network model based on sample interaction information graph data through node degrees, the weight of each node degree, and the sample embedding representation of each sample node, and obtaining a target graph neural network model; the target graph neural network model can be used for processing the first interaction information graph data, so that the node final embedding representation output by the target graph neural network model can be further used for collaborative filtering processing to determine the interaction object node associated with the user node; according to the method, the influence of large node degree difference on the performance of the graph model can be reduced to a certain extent, the processing efficiency of the graph model on the graph data with large node degree difference is improved, the robustness of the graph model is improved, and meanwhile the processing efficiency of the graph model on the graph data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of deep learning technology, and in particular to a robust collaborative filtering method and device based on graph contrast learning. Background Art

[0002] Collaborative filtering (CF) technology is a powerful tool to alleviate information overload and is widely used in various recommendation scenarios. Early collaborative filtering methods were mainly based on matrix decomposition techniques, such as singular value decomposition (SVD) and probability matrix decomposition (PMD), modeling user-item interactions as inner products. Since the implicit feedback of user-item interactions can be modeled through graph structures, graph neural networks (GNNs) are widely used to design collaborative filtering algorithms because of their ability to capture the high-order connectivity of such structures. Typical graph models include NGCF and LightGCN. However, data sparsity is a long-standing challenge that severely limits the performance of these models.

[0003] In related technologies, common features can be learned from data through the graph contrast learning (GCL) method to alleviate the data sparsity problem that is common in recommendation systems. Graph contrast learning-based methods can usually use data perturbations to obtain enhanced views. For example, self-supervised graph learning (SGL) designs node dropout, edge dropout, and random walks to obtain enhanced views. Neighborhood-enriched Contrastive Learning (NCL) can use the structural neighbors and semantic neighbors of nodes as enhanced views, thereby capturing the correlation between nodes and alleviating the data sparsity problem.

[0004] However, the above method is less effective when processing graph data with large differences in node degrees. The graph model cannot learn common features from the above data well, and the graph model is not efficient in processing graph data with large differences in node degrees. Summary of the invention

[0005] In view of the above problems, embodiments of the present application provide a robust collaborative filtering method, device, electronic device and readable storage medium based on graph contrast learning to overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect, an embodiment of the present application provides a robust collaborative filtering method based on graph contrast learning, the method comprising: Based on the first node degree of the sample user node and the second node degree of the sample interaction object node, a first degree matrix is ​​generated, and based on the relative size between the first node degree and the second node degree, a first weight value of the first node degree and a second weight value of the second node degree are determined respectively; wherein the first node degree and the second node degree are determined based on the sample adjacency matrix between the sample user node and the sample interaction object node contained in the sample interaction information graph data; Inputting the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model, and obtaining the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model; Based on the final embedding representation of the first sample, the final embedding representation of the second sample and the sample adjacency matrix, determine the model loss value of the first graph neural network model, and based on the model loss value, adjust the model parameters of the first graph neural network model to obtain a target graph neural network model; wherein the model loss value includes a Bayesian personalized ranking loss value and a contrast loss value; Inputting the first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the first interaction object node, and the second adjacency matrix between the user node and the first interaction object node into the target graph neural network, and obtaining the first node final embedding representation of the user node and the second node final embedding representation of the first interaction object node output by the target graph neural network; wherein the user node and the first interaction object node are both included in the first interaction information graph; Based on the final embedding representation of the first node and the final embedding representation of the second node, a second interactive object node associated with the user node is determined to implement collaborative filtering of the first interactive object node.

[0007] Optionally, determining the model loss value of the first graph neural network model based on the first sample final embedding representation, the second sample final embedding representation, and the sample adjacency matrix includes: Determining a Bayesian personalized ranking loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix; Determining a comparison task loss value of the first graph neural network model based on the final embedding representation of the first sample and the final embedding representation of the second sample; Based on the Bayesian personalized sorting loss value and the comparison task loss value, determine the model loss value of the first graph neural network model.

[0008] Optionally, determining the Bayesian personalized ranking loss value of the first graph neural network model based on the first sample final embedding representation, the second sample final embedding representation, and the sample adjacency matrix includes: Based on the sample adjacency matrix, the first sample final embedding representation and the second sample final embedding representation are matched to obtain a first final embedding representation pair corresponding to a sample interaction combination with a connection relationship, and a second final embedding representation pair corresponding to a sample interaction combination without a connection relationship; wherein the sample interaction combination represents a combination formed by a sample user node and a sample interaction object node; Determining a first prediction score for the first final embedding representation pair and a second prediction score for the second final embedding representation pair; Based on the first prediction score and the second prediction score, a Bayesian personalized ranking loss value of the first graph neural network model is determined.

[0009] Optionally, determining the comparison task loss value of the first graph neural network model based on the final embedding representation of the first sample and the final embedding representation of the second sample includes: Based on the first sample final embedding representation, generating a first final embedding representation pair between different sample user nodes, and based on the second sample final embedding representation, generating a second final embedding representation pair between different sample interaction object nodes; Determining a first contrast loss for the sample user node based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation; determining a second contrast loss for the sample interaction object node based on the second final embedding representation pair and a second enhanced embedding representation pair corresponding to the second sample final embedding representation; The first contrast loss and the second contrast loss are summed to obtain a contrast task loss value of the first graph neural network model.

[0010] Optionally, determining a first contrast loss of the sample user node based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation includes: determining a first entropy value of the first final embedding representation pair; determining a first similarity score for the first final embedding representation pair and a second similarity score for the first enhanced embedding representation pair; Based on the first entropy value, the first similarity score, and the second similarity score, a first contrast loss of the sample user node is determined.

[0011] Optionally, determining the model loss value of the first graph neural network model based on the Bayesian personalized ranking loss value and the comparison task loss value includes: Obtaining a balance coefficient of the comparison task loss value; Based on the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient, a model loss value of the first graph neural network model is determined.

[0012] Optionally, the method further comprises: Adding a noise vector to each final embedded representation of the first samples to obtain a first enhanced sample final embedded representation and a second enhanced sample final embedded representation; wherein the noise vectors included in the first enhanced sample final embedded representation and the second enhanced sample final embedded representation are different; The first enhanced sample final embedding representation and the second enhanced sample final embedding representation are combined to obtain the first enhanced embedding representation pair.

[0013] Optionally, the determining, based on the relative size between the first node degree and the second node degree, a first weight value of the first node degree and a second weight value of the second node degree, respectively, includes: Normalizing the first node degree and the second node degree to obtain a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree; A first difference between 1 and the first normalized degree value is calculated to obtain a first weight value of the first node degree, and a second difference between 1 and the second normalized degree value is calculated to obtain a second weight value of the second node degree.

[0014] Optionally, the step of inputting the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model comprises: In the propagation function of the first graph neural network model, a preset propagation weight coefficient is assigned to each propagation item to obtain a second graph neural network model; wherein the each propagation item includes the first propagation item of the adjacent previous network layer and each second propagation item corresponding to the initial embedding representation; the preset propagation weight coefficient of the first propagation item is greater than the preset propagation weight coefficient of each second propagation item; The first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node are input into the second graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model.

[0015] In a second aspect, an embodiment of the present application provides a robust collaborative filtering device based on graph contrast learning, characterized in that the device comprises: A generating and determining module is used to generate a first degree matrix based on a first node degree of a sample user node and a second node degree of a sample interaction object node, and to determine a first weight value of the first node degree and a second weight value of the second node degree based on a relative size between the first node degree and the second node degree; wherein the first node degree and the second node degree are determined based on a sample adjacency matrix between sample user nodes and sample interaction object nodes contained in the sample interaction information graph data; A first input module is used to input the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model, so as to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model; Determine an adjustment module, which is used to determine a model loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample and the sample adjacency matrix, and adjust the model parameters of the first graph neural network model based on the model loss value to obtain a target graph neural network model; wherein the model loss value includes a Bayesian personalized ranking loss value and a contrast loss value; A second input module is used to input the first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the first interaction object node, and the second adjacency matrix between the user node and the first interaction object node into the target graph neural network, so as to obtain the first node final embedding representation of the user node and the second node final embedding representation of the first interaction object node output by the target graph neural network; wherein the user node and the first interaction object node are both included in the first interaction information graph; A determination module is used to determine a second interactive object node associated with the user node based on the final embedding representation of the first node and the final embedding representation of the second node, so as to implement collaborative filtering of the first interactive object node.

[0016] Optionally, the determining and adjusting module includes: A first determination submodule, configured to determine a Bayesian personalized ranking loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix; A second determination submodule, used to determine a comparison task loss value of the first graph neural network model based on the final embedding representation of the first sample and the final embedding representation of the second sample; The third determination submodule is used to determine the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value and the comparison task loss value.

[0017] Optionally, the first determining submodule includes: A matching unit, configured to match the first sample final embedding representation and the second sample final embedding representation based on the sample adjacency matrix to obtain a first final embedding representation pair corresponding to a sample interaction combination with a connection relationship, and a second final embedding representation pair corresponding to a sample interaction combination without a connection relationship; wherein the sample interaction combination represents a combination formed by a sample user node and a sample interaction object node; A first determining unit, configured to determine a first prediction score of the first final embedding representation pair and a second prediction score of the second final embedding representation pair; The second determining unit is used to determine the Bayesian personalized ranking loss value of the first graph neural network model based on the first prediction score and the second prediction score.

[0018] Optionally, the second determining submodule includes: a generating unit, configured to generate a first final embedding representation pair between different sample user nodes based on the first sample final embedding representation, and to generate a second final embedding representation pair between different sample interaction object nodes based on the second sample final embedding representation; A third determining unit, configured to determine a first contrast loss of the sample user node based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation; A fourth determining unit, configured to determine a second contrast loss of the sample interaction object node based on the second final embedding representation pair and a second enhanced embedding representation pair corresponding to the second sample final embedding representation; A summing unit is used to sum the first contrast loss and the second contrast loss to obtain a contrast task loss value of the first graph neural network model.

[0019] Optionally, the third determining unit includes: A first determining subunit, configured to determine a first entropy value of the first final embedding representation pair; A second determining subunit, configured to determine a first similarity score of the first final embedding representation pair and a second similarity score of the first enhanced embedding representation pair; The third determining subunit is used to determine a first contrast loss of the sample user node based on the first entropy value, the first similarity score and the second similarity score.

[0020] Optionally, the third determining submodule includes: An acquisition unit, used for acquiring a balance coefficient of the comparison task loss value; The fifth determination unit is used to determine the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient.

[0021] Optionally, the device further comprises: An adding module, configured to add a noise vector to each of the first sample final embedding representations to obtain a first enhanced sample final embedding representation and a second enhanced sample final embedding representation; wherein the noise vectors included in the first enhanced sample final embedding representation and the second enhanced sample final embedding representation are different; A combining module is used to combine the final embedded representation of the first enhanced sample and the final embedded representation of the second enhanced sample to obtain the first enhanced embedded representation pair.

[0022] Optionally, the generating and determining module includes: A normalization submodule, used to normalize the first node degree and the second node degree to obtain a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree; A calculation module is used to calculate a first difference between 1 and the first normalized degree value to obtain a first weight value of the first node degree, and calculate a second difference between 1 and the second normalized degree value to obtain a second weight value of the second node degree.

[0023] Optionally, the first input module includes: An allocation submodule is used to allocate a preset propagation weight coefficient to each propagation item in the propagation function of the first graph neural network model to obtain a second graph neural network model; wherein the each propagation item includes the first propagation item of the adjacent previous network layer and each second propagation item corresponding to the initial embedding representation; the preset propagation weight coefficient of the first propagation item is greater than the preset propagation weight coefficient of each second propagation item; An input submodule is used to input the first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into the second graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model.

[0024] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the robust collaborative filtering method based on graph contrast learning as described in any one of the above.

[0025] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the robust collaborative filtering method based on graph contrast learning as described in any one of the above items is implemented.

[0026] The specific beneficial effects are: The embodiment of the present application generates a first degree matrix based on the first node degree of the sample user node and the second node degree of the sample interaction object node, and determines the first weight value of the first node degree and the second weight value of the second node degree based on the relative size between the first node degree and the second node degree; wherein the first node degree and the second node degree are determined based on the sample adjacency matrix between the sample user node and the sample interaction object node contained in the sample interaction information graph data, and the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node and the second sample embedding representation of the sample interaction object node are input into the first graph neural network model to obtain the first graph neural network. The model outputs the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node. Based on the first sample final embedding representation, the second sample final embedding representation and the sample adjacency matrix, the model loss value of the first graph neural network model is determined. Based on the model loss value, the model parameters of the first graph neural network model are adjusted to obtain the target graph neural network model; wherein the model loss value includes the Bayesian personalized sorting loss value and the contrast loss value. The first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the interaction object node and the second adjacency matrix between the user node and the interaction object node are input into the target graph neural network to obtain The target graph neural network outputs the first node final embedding representation of the user node and the second node final embedding representation of the first interactive object node; wherein the user node and the first interactive object node are both included in the first interactive information graph, based on the first node final embedding representation and the second node final embedding representation, the second interactive object node associated with the user node is determined to achieve collaborative filtering of the first interactive object node, the first graph neural network model can be trained based on the sample interactive information graph data through the node degree, the weight of each node degree and the sample embedding representation of each sample node to obtain the target graph neural network model, and the target graph neural network model can be used to process the first interactive information graph data, Therefore, the final embedding representation of the node output by the target graph neural network model can be further used for collaborative filtering processing to determine the interactive object nodes associated with the user node. Since the weight value of the node degree is used as the input data, the impact of large differences in node degrees on the performance of the graph model can be reduced to a certain extent, and the processing efficiency of the graph model for graph data with large differences in node degrees can be improved to a certain extent. At the same time, since the Bayesian personalized sorting loss value and the contrast loss value are used as the model loss value of the first graph neural network model, the model can learn the characteristics of positive samples and negative samples, which can improve the robustness of the graph model to a certain extent, and at the same time improve the processing efficiency of the graph model for graph data. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 It is a flowchart of a robust collaborative filtering method based on graph contrast learning provided in an embodiment of the present application; Figure 2 It is a flowchart of another robust collaborative filtering method based on graph contrast learning provided in an embodiment of the present application; Figure 3 A flowchart of a specific implementation method of a graph neural network model training provided in an embodiment of the present application; Figure 4 It is a logic block diagram of a robust collaborative filtering device based on graph contrast learning provided in an embodiment of the present application; Figure 5 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.

[0030] Reference Figure 1 , Figure 1 A flowchart of a robust collaborative filtering method based on graph contrast learning provided in an embodiment of the present application may include: Step 101, based on the first node degree of the sample user node and the second node degree of the sample interaction object node, generate a first degree matrix, and based on the relative size between the first node degree and the second node degree, respectively determine the first weight value of the first node degree and the second weight value of the second node degree; wherein the first node degree and the second node degree are determined based on the sample adjacency matrix between the sample user nodes and the sample interaction object nodes contained in the sample interaction information graph data.

[0031] In an embodiment of the present application, the sample interaction information graph may include sample user nodes and sample interaction object nodes, as well as the connection relationship between the sample user nodes and the sample interaction object nodes. Among them, this connection relationship can indicate that there is an interaction between the sample user corresponding to the sample user node and the sample interaction object corresponding to the sample interaction object node. For example, when an animal eats, it can choose a certain category of food, and the process of the animal choosing food is an interaction process. The adjacency matrix is ​​a data representation method. In an embodiment of the present application, the sample adjacency matrix can use rows to represent sample user nodes and columns to represent sample interaction object nodes. The element values ​​in the sample adjacency matrix can be 0 or 1. The element value 0 indicates that there is no connection relationship between the sample user node and the sample interaction object node corresponding to the row and column where the element is located, and the element value 1 indicates that there is a connection relationship between the sample user node and the sample interaction object node corresponding to the row and column where the element is located. The node degree can represent the number of edges associated with the node. In the embodiment of the present application, it is the number of connection relationships that exist for a single node. The degree matrix is ​​a data representation method for representing the node degree of graph data. The degree matrix is ​​a diagonal matrix, in which the element values ​​in the degree matrix are , that is, the element value of the diagonal element is the node degree of the node corresponding to the row number (column number) of the diagonal element, and except for the diagonal elements, the values ​​of the remaining elements are all 0. On this basis, the first degree matrix can be generated according to the first node degree of the sample user node and the second node degree of the sample interactive object node. At the same time, the weight values ​​of the first node degree and the second node degree can be determined respectively according to the relative size of the first node degree and the second node degree. The larger of the first node degree and the second node degree can be assigned a smaller weight value, and the smaller can be assigned a larger weight value, so that the graph neural network model can more easily learn the node features corresponding to the node with a smaller node degree during the propagation process of the embedded representation of the node. In addition, in the process of assigning weights, weights can also be assigned independently according to the node type. For example, the weight value of the first node degree corresponding to the sample user node can only be related to the relative size between each first node degree, and the weight value of the second node degree corresponding to the sample interactive object node can only be related to the relative size between each second node degree.

[0032] Step 102: Input the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model.

[0033] In an embodiment of the present application, the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interactive object node can be used together as input data of the first graph neural network model. After the first graph neural network model processes the input data through model propagation, it can output the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interactive object node. Among them, the first weight value and the second weight value can be multiplied with the corresponding first sample embedding representation and second sample embedding representation, and the multiplication result is used as input data, so that the first weight value and the second weight value can be propagated in the first graph neural network model. In addition, the first graph neural network model can use some graph neural network models based on graph contrastive learning (GCL) as the model basis, such as LightGCN, SGL, NCL, SimGCL, etc. At the same time, in the first graph neural network model, positive samples (combined by the first sample embedding representation and the second sample embedding representation with a connection relationship) and negative samples (combined by the first sample embedding representation and the second sample embedding representation without a connection relationship) can be generated according to the first sample embedding representation and the second sample embedding representation, as well as the sample adjacency matrix, so that the first graph neural network model can learn the characteristics of the above positive and negative samples.

[0034] Step 103: determine the model loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample and the sample adjacency matrix, and adjust the model parameters of the first graph neural network model based on the model loss value to obtain the target graph neural network model; wherein the model loss value includes a Bayesian personalized sorting loss value and a contrast loss value.

[0035] In an embodiment of the present application, the sample user nodes and sample interaction object nodes that have a connection relationship can be determined through the sample adjacency matrix, and the first sample final embedding representation and the second sample final embedding representation corresponding to the above sample user nodes and sample interaction object nodes can be further determined, so that the Bayesian personalized sorting loss value and the contrast loss value of the first graph neural network can be calculated through the first sample final embedding representation, and finally the Bayesian personalized sorting loss value and the contrast loss value can be added to obtain the model loss value of the first graph neural network model. After obtaining the model loss value of the first graph neural network model, the model parameters of the first graph neural network model can be adjusted according to the model loss value, and the adjusted first graph neural network model can be used as the target graph neural network model. Among them, the adjustment direction of the model parameters can be the direction that reduces the model loss value.

[0036] Step 104: input the first node embedding representation of the user node corresponding to the first interactive information graph data, the second node embedding representation of the first interactive object node, and the second adjacency matrix between the user node and the first interactive object node into the target graph neural network, and obtain the first node final embedding representation of the user node and the second node final embedding representation of the first interactive object node output by the target graph neural network; wherein the user node and the first interactive object node are both included in the first interactive information graph.

[0037] In an embodiment of the present application, the first interactive information graph data may include a user node and a first interactive object node, wherein the user node may be connected to a portion of the nodes in the first interactive object node. The first node embedding representation of the user node, the second node embedding representation of the first interactive object node, and the second adjacency matrix between the user node and the first interactive object node are input into the target graph neural network, so that the first node final embedding representation of the user node and the second node final embedding representation of the first interactive object node output by the target graph neural network model can be obtained.

[0038] Step 105: Determine a second interactive object node associated with the user node based on the final embedded representation of the first node and the final embedded representation of the second node, so as to implement collaborative filtering of the first interactive object node.

[0039] In an embodiment of the present application, after obtaining the first node final embedding representation of the user node and the second node final embedding representation of the first interactive object node, the second interactive object node associated with the user node can be determined based on the first node final embedding representation and the second node final embedding representation. Specifically, the preference prediction score between the corresponding user node and the first interactive object node can be calculated based on the first node final embedding representation and the second node final embedding representation. If the preference prediction score is greater than or equal to a preset threshold, the first interactive object node corresponding to the preference prediction score can be determined as the second interactive object node associated with the user node, so that the collaborative filtering of the first interactive object node is completed.

[0040] For example, in the application scenario of item recommendation, there may be an interactive relationship of selection and being selected between users and items (interactive objects). The user's interaction graph data on items can be converted into user node embedding representation and item node embedding representation, and input into the target graph neural network model. Based on the final embedding representation of the user node and the final embedding representation of the item node output by the target graph neural network model, the item nodes associated with the user nodes can be determined, so that the items corresponding to these item nodes can be displayed to the user. These items may include items that the user has already selected and items that the user has not yet selected.

[0041] In an embodiment of the present application, a first degree matrix is ​​generated based on a first node degree of a sample user node and a second node degree of a sample interaction object node, and a first weight value of the first node degree and a second weight value of the second node degree are respectively determined based on the relative size between the first node degree and the second node degree; wherein the first node degree and the second node degree are determined based on a sample adjacency matrix between sample user nodes and sample interaction object nodes contained in sample interaction information graph data, and the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node are input into a first graph neural network model to obtain a first graph neural network model. The first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the network model are used to determine the model loss value of the first graph neural network model based on the first sample final embedding representation, the second sample final embedding representation and the sample adjacency matrix. Based on the model loss value, the model parameters of the first graph neural network model are adjusted to obtain the target graph neural network model; wherein the model loss value includes a Bayesian personalized sorting loss value and a contrast loss value, and the first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the interaction object node and the second adjacency matrix between the user node and the interaction object node are input into the target graph neural network. The first node final embedding representation of the user node and the second node final embedding representation of the first interactive object node output by the target graph neural network are obtained; wherein the user node and the first interactive object node are both included in the first interactive information graph, and based on the first node final embedding representation and the second node final embedding representation, the second interactive object node associated with the user node is determined to achieve collaborative filtering of the first interactive object node, and the first graph neural network model can be trained based on the sample interactive information graph data through the node degree, the weight of each node degree and the sample embedding representation of each sample node to obtain the target graph neural network model, and the target graph neural network model can be used to process the first interactive information graph data , so that the final embedding representation of the node output by the target graph neural network model can be further used for collaborative filtering processing to determine the interactive object nodes associated with the user node. Since the weight value of the node degree is used as the input data, the impact of large differences in node degrees on the performance of the graph model can be reduced to a certain extent, and the processing efficiency of the graph model for graph data with large differences in node degrees can be improved to a certain extent. At the same time, since the Bayesian personalized ranking loss value and the contrast loss value are used as the model loss value of the first graph neural network model, the model can learn the characteristics of positive samples and negative samples, which can improve the robustness of the graph model to a certain extent, and at the same time improve the processing efficiency of the graph model for graph data.

[0042] Reference Figure 2 , Figure 2 A schematic flow chart of another robust collaborative filtering method based on graph contrast learning provided in an embodiment of the present application, the method may include: Step 201, based on the first node degree of the sample user node and the second node degree of the sample interaction object node, generate a first degree matrix, and based on the relative size between the first node degree and the second node degree, respectively determine the first weight value of the first node degree and the second weight value of the second node degree; wherein the first node degree and the second node degree are determined based on the sample adjacency matrix between the sample user nodes and the sample interaction object nodes contained in the sample interaction information graph data.

[0043] In the embodiments of the present application, the implementation content of this step can refer to the embodiment content of step 101, which will not be repeated here.

[0044] Optionally, step 201 may include the following sub-steps: Sub-step 2011, normalizing the first node degree and the second node degree to obtain a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree.

[0045] In an embodiment of the present application, the first node degree and the second node degree may be normalized, so as to obtain a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree. The embodiment of the present application adopts a linear normalization method, and the normalization method is shown in Formula 1 below: (Formula 1) In the above formula 1, Represents the first normalized degree value or the second normalized degree value after normalization, represents the first node degree or the second node degree before normalization, It represents the maximum value of the first node degree and the second node degree. represents the minimum value of the first node degree and the second node degree, where is the first node degree, then is the first normalized value; if is the second node degree, then is the second normalized value.

[0046] Sub-step 2012, calculate the first difference between 1 and the first normalized degree value to obtain the first weight value of the first node degree, calculate the second difference between 1 and the second normalized degree value to obtain the second weight value of the second node degree.

[0047] In an embodiment of the present application, in order to make a smaller node degree have a larger weight value, the first difference between 1 and the first normalized degree value can be calculated, so that the first difference can be used as the first weight value of the first node degree. At the same time, the second difference between 1 and the second normalized degree value can also be calculated, so that the second difference can be used as the second weight value of the second node degree.

[0048] In an embodiment of the present application, by normalizing the first node degree and the second node degree, a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree are obtained, a first difference between 1 and the first normalized degree value is calculated to obtain a first weight value of the first node degree, and a second difference between 1 and the second normalized degree value is calculated to obtain a second weight value of the second node degree. Larger weight values ​​can be assigned to smaller first node degrees and second node degrees, and smaller weight values ​​can be assigned to larger first node degrees and second node degrees. When the first node degree and the second node degree participate in propagation, the first graph neural network model can fully learn the node features corresponding to the first node degree and the second node degree, which can improve the performance of the target graph neural network model to a certain extent, and improve the accuracy and reliability of the output data of the target graph neural network model.

[0049] Step 202: Input the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model.

[0050] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 102, which will not be repeated here.

[0051] Optionally, step 202 may include the following sub-steps: Sub-step 2021, in the propagation function of the first graph neural network model, assign a preset propagation weight coefficient to each propagation item to obtain a second graph neural network model; wherein the each propagation item includes the first propagation item of the adjacent previous network layer and the second propagation items corresponding to the initial embedding representation; the preset propagation weight coefficient of the first propagation item is greater than the preset propagation weight coefficient of the second propagation item.

[0052] In an embodiment of the present application, the propagation function of the first graph neural network model can be expressed in the form of the following formula 2: (Formula 2) In the above formula 2, is the initial embedding representation of the input first graph neural network model, is the matrix obtained by symmetric normalizing the sample adjacency matrix through the first degree matrix, Represents the first degree matrix. Formula 2 includes four propagation items in total, and preset propagation weight coefficients can be assigned to the above four propagation items. At this time, the obtained propagation function is shown in the following formula 3: (Formula 3) In the above formula 3, , , are preset propagation weight coefficients, which are used to control the proportion of each second propagation item corresponding to the initial embedding representation in the propagation. is the first propagation item of the adjacent previous network layer k of network layer k+1, and its propagation weight coefficient is the adaptive weight coefficient, and its size can be determined by , , jointly decide, and , , The sum can be less than After assigning preset propagation weight coefficients to each propagation item, the first graph neural network model is updated, so that the updated first graph neural network model can be determined as the second graph neural network model.

[0053] Sub-step 2022, inputs the first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into the second graph neural network model, and obtains the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model.

[0054] In an embodiment of the present application, the first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node can be input into the second graph neural network model, so that the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model can be obtained. Among them, the processing of the input data by the second graph neural network model is similar to that of the first graph neural network model, and the embodiment content of step 102 can be referred to, which will not be repeated here.

[0055] In an embodiment of the present application, a second graph neural network model is obtained by assigning a preset propagation weight coefficient to each propagation item in the propagation function of the first graph neural network model; wherein each propagation item includes the first propagation item of the adjacent previous network layer and each second propagation item corresponding to the initial embedding representation; the preset propagation weight coefficient of the first propagation item is greater than the preset propagation weight coefficient of each second propagation item, and the first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node are input into the second graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model. The preset propagation weight coefficient can be assigned to the propagation item contained in the propagation function of the first graph neural network model to obtain the second graph neural network model, and since the preset propagation weight coefficient of the first propagation item of the adjacent previous network layer is the maximum value among the preset propagation weight coefficients, the second graph neural network model can have a certain weight when learning the node features of each node, which can avoid the problem of over-smoothing of the second graph neural network model during learning, and to a certain extent improve the prediction accuracy of the target graph neural network model finally obtained.

[0056] Step 203: Determine the Bayesian personalized ranking loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix.

[0057] In an embodiment of the present application, the calculation method of the Bayesian personalized sorting loss value is shown in Formula 4 below: (Formula 4) In the above formula 4, is a regularization parameter to prevent overfitting, Represents the model parameters norm, is the preference prediction score between sample user u and sample interaction object i, is the preference prediction score between sample user u and sample interaction object j, is the sigmoid function, ln() is the natural logarithm, Represents the node set corresponding to the sample interaction information graph. Among them, it can be determined whether there is a correlation relationship between the final embedding representation of the first sample and the final embedding representation of the second sample according to the sample adjacency matrix, and the preference prediction score between the final embedding representation of the first sample and the final embedding representation of the second sample can be divided into and , thus, according to and The Bayesian personalized ranking loss value of the first graph neural network model is calculated.

[0058] Optionally, step 203 may include the following sub-steps: Sub-step 2031, based on the sample adjacency matrix, matching the first sample final embedding representation and the second sample final embedding representation to obtain a first final embedding representation pair corresponding to a sample interaction combination with a connection relationship, and a second final embedding representation pair corresponding to a sample interaction combination without a connection relationship; wherein the sample interaction combination represents a combination formed by a sample user node and a sample interaction object node.

[0059] In an embodiment of the present application, the first sample final embedding representation and the second sample final embedding representation can be matched according to the sample adjacency matrix, so that the first final embedding representation pair corresponding to the sample interaction combination with a connection relationship and the second final embedding representation pair corresponding to the sample interaction combination without a connection relationship can be obtained. Specifically, since the element value of the sample adjacency matrix indicates whether there is a connection relationship between the corresponding user node and the interaction object node, the first final embedding representation pair corresponding to the sample interaction combination with a connection relationship can be obtained by screening according to the sample adjacency matrix, wherein the sample interaction combination can refer to a combination of a sample user node and a sample interaction object node, and the first final embedding representation pair can be composed of the first sample final embedding representation and the second sample final embedding representation corresponding to the sample interaction combination with a connection relationship. All other interaction combinations except the sample interaction combination with a connection relationship are sample interaction combinations without a connection relationship, and the sample interaction combination without a connection relationship can be obtained by combining the sample user node with other sample interaction object nodes without a connection relationship. Similar to the first final embedding representation pair, the second final embedding representation pair can be composed of the first sample final embedding representation and the second sample final embedding representation corresponding to the sample interaction combination without a connection relationship.

[0060] Sub-step 2032, determining a first prediction score for the first final embedding representation pair and a second prediction score for the second final embedding representation pair.

[0061] In an embodiment of the present application, a first prediction score of the first final embedding representation pair and a second prediction score of the second final embedding representation pair can be calculated. The calculation method of the first prediction score and the second prediction score is shown in Formula 5 below: (Formula 5) In the above formula 5, represents the first prediction score or the second prediction score, and Denote the first sample final embedding representation and the second sample final embedding representation contained in the first final embedding representation pair or the second final embedding representation pair respectively, and the symbol “T” denotes the transpose of the matrix.

[0062] Sub-step 2033, based on the first prediction score and the second prediction score, determining the Bayesian personalized ranking loss value of the first graph neural network model.

[0063] In the embodiment of the present application, the Bayesian personalized ranking loss value of the first graph neural network model can be calculated based on the first prediction score and the second prediction score. The specific calculation method can refer to Formula 4, where may correspond to the first prediction score, May correspond to a second prediction score.

[0064] In an embodiment of the present application, the first sample final embedding representation and the second sample final embedding representation are matched based on the sample adjacency matrix to obtain a first final embedding representation pair corresponding to a sample interaction combination with a connection relationship and a second final embedding representation pair corresponding to a sample interaction combination without a connection relationship; wherein the sample interaction combination represents a combination formed between a sample user node and a sample interaction object node, and a first prediction score of the first final embedding representation pair and a second prediction score of the second final embedding representation pair are determined; based on the first prediction score and the second prediction score, the Bayesian personalized ranking loss value of the first graph neural network model is determined, and the Bayesian personalized ranking loss value of the first graph neural network model can be calculated according to the sample adjacency matrix, the first sample final embedding representation and the second sample final embedding representation, which can improve the accuracy of the Bayesian personalized ranking loss value to a certain extent.

[0065] Step 204: Determine a comparison task loss value of the first graph neural network model based on the final embedding representation of the first sample and the final embedding representation of the second sample.

[0066] In an embodiment of the present application, the comparison task loss value of the first graph neural network model can be calculated based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix. Specifically, the positive sample pair (with a connection relationship) and the negative sample pair (without a connection relationship) composed of the final embedding representation of the first sample and the final embedding representation of the second sample can be obtained through the sample adjacency matrix, and further calculated based on the similarity scores corresponding to the positive sample and the negative sample, as shown in Formula 6 below: (Formula 6) In the above formula 6, To compare the task loss values, is a positive sample pair of sample x, For sample Negative sample pairs, s () represents the similarity score function, is the temperature parameter, ln () is the natural logarithm.

[0067] Optionally, step 204 may include the following sub-steps: Sub-step 2041: Add a noise vector to each final embedded representation of the first samples to obtain a first enhanced sample final embedded representation and a second enhanced sample final embedded representation; wherein the noise vectors included in the first enhanced sample final embedded representation and the second enhanced sample final embedded representation are different.

[0068] In an embodiment of the present application, a noise vector may be added to each first sample final embedding representation to perform data enhancement on the first sample final embedding representation, thereby obtaining a first enhanced sample final embedding representation and a second enhanced sample final embedding representation. The noise vectors included in the first enhanced sample final embedding representation and the second enhanced sample final embedding representation may be different. The noise vector may be randomly generated to change the element value in the first sample final embedding representation.

[0069] For example, the noise vector can be set ,in It obeys the uniform distribution corresponding to the interval (0, 1), and the symbol " " represents the same or same operation, is a sign function. The present invention limits the L2 norm of the noise vector , which aims to ensure that the perturbation noise vector and is a small constant. In this way, the first enhanced sample is finally embedded in the representation , the final embedding representation of the second enhanced sample ,in The final embedding representation can be given to the first sample.

[0070] Sub-step 2042: combining the final embedded representation of the first enhanced sample and the final embedded representation of the second enhanced sample to obtain the first enhanced embedded representation pair.

[0071] In an embodiment of the present application, the final embedded representation of the first enhanced sample and the final embedded representation of the second enhanced sample may be combined to obtain a first enhanced embedded representation pair.

[0072] In an embodiment of the present application, a first enhanced sample final embedded representation and a second enhanced sample final embedded representation are obtained by adding a noise vector to each first sample final embedded representation; wherein the noise vectors contained in the first enhanced sample final embedded representation and the second enhanced sample final embedded representation are different, and the first enhanced sample final embedded representation and the second enhanced sample final embedded representation are combined to obtain a first enhanced embedded representation pair. The first enhanced embedded representation pair corresponding to the first sample final embedded representation can be obtained by adding a noise vector, which can improve the data richness while maintaining the semantics of the original embedded representation, thereby improving the accuracy and reliability of the first enhanced embedded representation pair.

[0073] Sub-step 2043: Based on the first sample final embedding representation, generate a first final embedding representation pair between different sample user nodes; based on the second sample final embedding representation, generate a second final embedding representation pair between different sample interaction object nodes.

[0074] In an embodiment of the present application, the first sample final embedding representations corresponding to different sample user nodes can be combined according to the first sample final embedding representation, so as to obtain a first final embedding representation pair between different sample user nodes, and the second sample final embedding representations corresponding to different sample interactive object nodes can be combined according to the second sample final embedding representation, so as to obtain a second final embedding representation pair between different sample interactive object nodes. The first final embedding representation pair may include two first sample final embedding representations (i.e., one first sample final embedding representation corresponding to two sample user nodes, respectively). The second final embedding representation pair is similar to the first final embedding representation pair, and will not be repeated here.

[0075] Sub-step 2044, determining a first contrast loss for the sample user node based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation.

[0076] In an embodiment of the present application, the calculation method of the first contrast loss of the sample user node can be performed according to the following formula 7: (Formula 7) In the above formula 7, is the first enhanced embedding representation pair corresponding to the first sample final embedding representation of sample user node u, is the first final embedding representation pair, is the temperature parameter, is the natural logarithm, is the first contrast loss of the sample user node, s() represents the similarity score function, and U represents the set of sample user nodes.

[0077] Optionally, sub-step 2044 may include the following sub-steps: Sub-step A41, determining a first entropy value of the first final embedding representation pair.

[0078] In an embodiment of the present application, the first entropy value of the first final embedded representation pair may be calculated, and the calculation method thereof is shown in the following formula 8: (Formula 8) In the above formula 8, represents the first final embedding representation pair, represents the first entropy value of the first final embedding representation pair, Represents negative samples Normalized similarity score relative to all negative samples.

[0079] Sub-step A42, determining a first similarity score of the first final embedding representation pair and a second similarity score of the first enhanced embedding representation pair.

[0080] In an embodiment of the present application, a first similarity score of the first final embedding representation pair and a second similarity score of the first enhanced embedding representation pair may be calculated respectively. The similarity score function may be preset manually, and the similarity score function used to calculate the first similarity score and the second similarity score may be the same. For example, a dot product or Euclidean distance may be used as a similarity score function for calculation.

[0081] Sub-step A43: determining a first contrast loss of the sample user node based on the first entropy value, the first similarity score and the second similarity score.

[0082] In an embodiment of the present application, the first contrast loss of the sample user node can be calculated according to the first entropy value, the first similarity score and the second similarity score, and the calculation method thereof can be shown in the following formula 9: (Formula 9) In the above formula 9, is the second similarity score, is the first similarity score, is the first entropy value, is the entropy weighting parameter, which is used to control the weight of the first entropy value in the calculation. is the temperature parameter.

[0083] In an embodiment of the present application, by determining the first entropy value of the first final embedding representation pair, determining the first similarity score of the first final embedding representation pair and the second similarity score of the first enhanced embedding representation pair, and determining the first contrast loss of the sample user node based on the first entropy value, the first similarity score and the second similarity score, the first entropy value of the first final embedding representation pair can be involved in the calculation process of the first contrast loss, thereby improving the accuracy of the first contrast loss, and can improve the learning effect of the first graph neural network model, and improve the prediction accuracy of the target graph neural network model.

[0084] Sub-step 2045, determining a second contrast loss of the sample interactive object node based on the second final embedding representation pair and a second enhanced embedding representation pair corresponding to the second sample final embedding representation.

[0085] In an embodiment of the present application, the second contrast loss of the sample interaction object node can be determined based on the second final embedding representation pair and the second enhanced embedding representation pair corresponding to the second sample final embedding representation. The second enhanced embedding representation pair can be obtained by adding different noise vectors to the second sample final embedding representation and combining them. The specific generation method is similar to that of the first enhanced embedding representation pair. Please refer to the embodiment content of step 2041 and step 2042, which will not be repeated here.

[0086] It should be noted that, in the calculation of the second contrast loss, a method similar to steps A41 to A43 may also be used to add the second entropy value of the second final embedding representation pair into the calculation of the second contrast loss, as shown in the following formula 10: (Formula 10) In formula 10, is the second contrast loss, is the second entropy value of the second final embedding representation pair, is the similarity score of the second final embedding representation pair, is the similarity score of the second enhanced embedding representation pair, I represents the set of sample interaction object nodes, is the entropy weighting parameter.

[0087] Sub-step 2046, summing the first contrast loss and the second contrast loss to obtain a contrast task loss value of the first graph neural network model.

[0088] In an embodiment of the present application, the first contrast loss and the second contrast loss may be added together to obtain a contrast task loss value of the first graph neural network model, as shown in Formula 11 below: (Formula 11) In the above formula 11, is the comparison task loss value of the first graph neural network model, is the first contrast loss, is the second contrast loss.

[0089] In an embodiment of the present application, a first final embedding representation pair between different sample user nodes is generated based on the first sample final embedding representation, and a second final embedding representation pair between different sample interaction object nodes is generated based on the second final embedding representation. A first contrast loss of the sample user node is determined based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation. A second contrast loss of the sample interaction object node is determined based on the second final embedding representation pair and a second enhanced embedding representation pair corresponding to the second sample final embedding representation. The first contrast loss and the second contrast loss are summed to obtain a contrast task loss value of the first graph neural network model. The first contrast loss of the sample user node and the second contrast loss of the sample interaction object node can be calculated, and the contrast task loss value of the first graph neural network model can be calculated using the first contrast loss and the second contrast loss, which can improve the accuracy of the contrast task loss value to a certain extent.

[0090] Step 205: Determine the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value and the comparison task loss value.

[0091] In an embodiment of the present application, the model loss value of the first graph neural network model can be calculated based on the Bayesian personalized sorting loss value and the comparison task loss value. Among them, the Bayesian personalized sorting loss value and the comparison task loss value can be directly added to obtain the model loss value of the first graph neural network model, or a balance coefficient can be added to the Bayesian personalized sorting loss value or the comparison task loss value, and the balance coefficient is multiplied by the Bayesian personalized sorting loss value or the comparison task loss value, and then the sum is obtained to obtain the model loss value of the first graph neural network model.

[0092] Optionally, step 205 may include the following sub-steps: Sub-step 2051, obtaining the balance coefficient of the comparison task loss value.

[0093] In an embodiment of the present application, a balance coefficient of the comparison task loss value may be obtained. Usually, the balance coefficient of the comparison task loss value may be manually set as a hyperparameter.

[0094] Sub-step 2052, determining the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient.

[0095] In an embodiment of the present application, the model loss value of the first graph neural network model can be calculated according to the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient, as shown in the following formula 12: (Formula 12) In the above formula 12, is the model loss value, is the Bayesian personalized ranking loss value, is the balance coefficient, To compare the task loss value.

[0096] In an embodiment of the present application, by obtaining the balance coefficient of the comparison task loss value, the model loss value of the first graph neural network model is determined based on the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient. The model loss value of the first graph neural network model can be calculated according to the balance coefficient of the comparison task loss value, the comparison task loss value and the Bayesian personalized sorting loss value. The weights of the comparison learning and positive sample preference learning of the first graph neural network model can be controlled, which improves the learning efficiency of the first graph neural network model to a certain extent and improves the prediction accuracy of the target graph neural network model.

[0097] In an embodiment of the present application, the Bayesian personalized sorting loss value of the first graph neural network model is determined based on the final embedding representation of the first sample, the final embedding representation of the second sample and the sample adjacency matrix, the comparison task loss value of the first graph neural network model is determined based on the final embedding representation of the first sample and the final embedding representation of the second sample, and the model loss value of the first graph neural network model is determined based on the Bayesian personalized sorting loss value and the comparison task loss value. The Bayesian personalized sorting loss value and the comparison task loss value of the first graph neural network model can be calculated respectively, and the model loss value of the first graph neural network model is calculated according to the Bayesian personalized sorting loss value and the comparison task loss value, which improves the accuracy and reliability of the model loss value to a certain extent and improves the learning efficiency of the first graph neural network model.

[0098] Step 206: Based on the model loss value, adjust the model parameters of the first graph neural network model to obtain the target graph neural network model.

[0099] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 103, which will not be repeated here.

[0100] Step 207, input the first node embedding representation of the user node corresponding to the first interactive information graph data, the second node embedding representation of the first interactive object node, and the second adjacency matrix between the user node and the first interactive object node into the target graph neural network, and obtain the first node final embedding representation of the user node and the second node final embedding representation of the first interactive object node output by the target graph neural network; wherein the user node and the first interactive object node are both included in the first interactive information graph.

[0101] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 104, which will not be repeated here.

[0102] Step 208: Determine a second interactive object node associated with the user node based on the final embedded representation of the first node and the final embedded representation of the second node, so as to implement collaborative filtering of the first interactive object node.

[0103] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 105, which will not be repeated here.

[0104] Reference Figure 3 , Figure 3 A flowchart of a specific implementation method of graph neural network model training provided for an embodiment of the present application. In the figure, the model training task can be divided into two parts: a main task and a proxy task. In the main task, after the interactive graph data is input, an embedded representation of the interactive graph data can be generated, and then the embedded representation can be propagated in the propagation layer of the graph neural network model to obtain the final embedded representation of the output of the graph neural network model, and then the final embedded representation can be combined to construct positive sample pairs and negative sample pairs, and finally the Bayesian personalized sorting loss value of the graph neural network model is calculated based on the positive sample pairs and the negative sample pairs. In the proxy task, after the interactive graph data is input, an embedded representation of the interactive graph data can be generated, and then the embedded representation can be propagated in the propagation layer of the graph neural network model to obtain the final embedded representation of the output of the graph neural network model, and then a noise vector can be added to the final embedded representation to obtain an enhanced view corresponding to the final embedded representation, and finally the comparison task loss value of the graph neural network model can be calculated based on the enhanced view. After obtaining the Bayesian personalized sorting loss value and the comparative task loss value, the model loss value of the graph neural network model can be calculated based on the Bayesian personalized sorting loss value and the comparative task loss value. Afterwards, the various model parameters of the propagation layer of the graph neural network model can be adjusted according to the model loss value to realize model training of the graph neural network model.

[0105] Reference Figure 4 , Figure 4A logical block diagram of a robust collaborative filtering device based on graph contrast learning provided in an embodiment of the present application, the robust collaborative filtering device based on graph contrast learning 400 may include: A generating and determining module 401 is used to generate a first degree matrix based on a first node degree of a sample user node and a second node degree of a sample interaction object node, and to determine a first weight value of the first node degree and a second weight value of the second node degree based on a relative size between the first node degree and the second node degree; wherein the first node degree and the second node degree are determined based on a sample adjacency matrix between sample user nodes and sample interaction object nodes contained in the sample interaction information graph data; A first input module 402 is used to input the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model; Determine an adjustment module 403, which is used to determine a model loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix, and adjust the model parameters of the first graph neural network model based on the model loss value to obtain a target graph neural network model; wherein the model loss value includes a Bayesian personalized ranking loss value and a contrast loss value; The second input module 404 is used to input the first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the first interaction object node, and the second adjacency matrix between the user node and the first interaction object node into the target graph neural network, so as to obtain the first node final embedding representation of the user node and the second node final embedding representation of the first interaction object node output by the target graph neural network; wherein the user node and the first interaction object node are both included in the first interaction information graph; The determination module 405 is used to determine the second interactive object node associated with the user node based on the final embedded representation of the first node and the final embedded representation of the second node, so as to implement collaborative filtering of the first interactive object node.

[0106] Optionally, the determining and adjusting module 403 includes: A first determination submodule, configured to determine a Bayesian personalized ranking loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix; A second determination submodule, used to determine a comparison task loss value of the first graph neural network model based on the final embedding representation of the first sample and the final embedding representation of the second sample; The third determination submodule is used to determine the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value and the comparison task loss value.

[0107] Optionally, the first determining submodule includes: A matching unit, configured to match the first sample final embedding representation and the second sample final embedding representation based on the sample adjacency matrix to obtain a first final embedding representation pair corresponding to a sample interaction combination with a connection relationship, and a second final embedding representation pair corresponding to a sample interaction combination without a connection relationship; wherein the sample interaction combination represents a combination formed by a sample user node and a sample interaction object node; A first determining unit, configured to determine a first prediction score of the first final embedding representation pair and a second prediction score of the second final embedding representation pair; The second determining unit is used to determine the Bayesian personalized ranking loss value of the first graph neural network model based on the first prediction score and the second prediction score.

[0108] Optionally, the second determining submodule includes: a generating unit, configured to generate a first final embedding representation pair between different sample user nodes based on the first sample final embedding representation, and to generate a second final embedding representation pair between different sample interaction object nodes based on the second sample final embedding representation; A third determining unit, configured to determine a first contrast loss of the sample user node based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation; A fourth determining unit, configured to determine a second contrast loss of the sample interaction object node based on the second final embedding representation pair and a second enhanced embedding representation pair corresponding to the second sample final embedding representation; A summing unit is used to sum the first contrast loss and the second contrast loss to obtain a contrast task loss value of the first graph neural network model.

[0109] Optionally, the third determining unit includes: A first determining subunit, configured to determine a first entropy value of the first final embedding representation pair; A second determining subunit, configured to determine a first similarity score of the first final embedding representation pair and a second similarity score of the first enhanced embedding representation pair; The third determining subunit is used to determine a first contrast loss of the sample user node based on the first entropy value, the first similarity score and the second similarity score.

[0110] Optionally, the third determining submodule includes: An acquisition unit, used for acquiring a balance coefficient of the comparison task loss value; The fifth determination unit is used to determine the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient.

[0111] Optionally, the robust collaborative filtering device 400 based on graph contrast learning further includes: An adding module, configured to add a noise vector to each of the first sample final embedding representations to obtain a first enhanced sample final embedding representation and a second enhanced sample final embedding representation; wherein the noise vectors included in the first enhanced sample final embedding representation and the second enhanced sample final embedding representation are different; A combining module is used to combine the final embedded representation of the first enhanced sample and the final embedded representation of the second enhanced sample to obtain the first enhanced embedded representation pair.

[0112] Optionally, the generating and determining module 401 includes: A normalization submodule, used to normalize the first node degree and the second node degree to obtain a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree; A calculation module is used to calculate a first difference between 1 and the first normalized degree value to obtain a first weight value of the first node degree, and calculate a second difference between 1 and the second normalized degree value to obtain a second weight value of the second node degree.

[0113] Optionally, the first input module 402 includes: An allocation submodule is used to allocate a preset propagation weight coefficient to each propagation item in the propagation function of the first graph neural network model to obtain a second graph neural network model; wherein the each propagation item includes the first propagation item of the adjacent previous network layer and each second propagation item corresponding to the initial embedding representation; the preset propagation weight coefficient of the first propagation item is greater than the preset propagation weight coefficient of each second propagation item; An input submodule is used to input the first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into the second graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model.

[0114] The robust collaborative filtering device based on graph contrast learning in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmentedreality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personaldigital assistant, PDA), etc., and can also be a server, a network attached storage (Network AttachedStorage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0115] The robust collaborative filtering device based on graph contrast learning in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, a Linux operating system, a Windows operating system, etc., or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0116] The robust collaborative filtering device based on graph contrast learning provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0117] The present application embodiment provides an electronic device, see Figure 5The electronic device 50 includes: a processor 501, a memory 502, and a computer program 5021 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the program, the robust collaborative filtering method based on graph contrast learning of the aforementioned embodiment is implemented.

[0118] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the robust collaborative filtering method based on graph contrast learning as disclosed in the embodiment of the present application are implemented.

[0119] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the processor is enabled to implement the steps in the robust collaborative filtering method based on graph contrast learning as disclosed in the embodiment of the present application.

[0120] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0121] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0124] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0126] The above is a detailed introduction to the robust collaborative filtering method and device based on graph contrast learning provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A robust collaborative filtering method based on graph contrastive learning, characterized in that: The method comprises: Based on the first node degree of the sample user node and the second node degree of the sample interaction object node, a first degree matrix is ​​generated, and based on the relative size between the first node degree and the second node degree, a first weight value of the first node degree and a second weight value of the second node degree are determined respectively; wherein the first node degree and the second node degree are determined based on the sample adjacency matrix between the sample user node and the sample interaction object node contained in the sample interaction information graph data; Inputting the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model, and obtaining the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model; Based on the final embedding representation of the first sample, the final embedding representation of the second sample and the sample adjacency matrix, determine the model loss value of the first graph neural network model, and based on the model loss value, adjust the model parameters of the first graph neural network model to obtain a target graph neural network model; wherein the model loss value includes a Bayesian personalized ranking loss value and a contrast loss value; Inputting the first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the first interaction object node, and the second adjacency matrix between the user node and the first interaction object node into the target graph neural network, and obtaining the first node final embedding representation of the user node and the second node final embedding representation of the first interaction object node output by the target graph neural network; wherein the user node and the first interaction object node are both included in the first interaction information graph; Based on the final embedding representation of the first node and the final embedding representation of the second node, a second interactive object node associated with the user node is determined to implement collaborative filtering of the first interactive object node.

2. The method according to claim 1, characterized in that: The determining, based on the first sample final embedding representation, the second sample final embedding representation, and the sample adjacency matrix, a model loss value of the first graph neural network model includes: Determining a Bayesian personalized ranking loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample, and the sample adjacency matrix; Determining a comparison task loss value of the first graph neural network model based on the final embedding representation of the first sample and the final embedding representation of the second sample; Based on the Bayesian personalized sorting loss value and the comparison task loss value, determine the model loss value of the first graph neural network model.

3. The method according to claim 2, characterized in that The determining, based on the first sample final embedding representation, the second sample final embedding representation, and the sample adjacency matrix, a Bayesian personalized ranking loss value of the first graph neural network model includes: Based on the sample adjacency matrix, the first sample final embedding representation and the second sample final embedding representation are matched to obtain a first final embedding representation pair corresponding to a sample interaction combination with a connection relationship, and a second final embedding representation pair corresponding to a sample interaction combination without a connection relationship; wherein the sample interaction combination represents a combination formed by a sample user node and a sample interaction object node; Determining a first prediction score for the first final embedding representation pair and a second prediction score for the second final embedding representation pair; Based on the first prediction score and the second prediction score, a Bayesian personalized ranking loss value of the first graph neural network model is determined.

4. The method according to claim 2, characterized in that: The determining, based on the final embedding representation of the first sample and the final embedding representation of the second sample, a comparison task loss value of the first graph neural network model includes: Based on the first sample final embedding representation, generating a first final embedding representation pair between different sample user nodes, and based on the second sample final embedding representation, generating a second final embedding representation pair between different sample interaction object nodes; Determining a first contrast loss for the sample user node based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation; determining a second contrast loss for the sample interaction object node based on the second final embedding representation pair and a second enhanced embedding representation pair corresponding to the second sample final embedding representation; The first contrast loss and the second contrast loss are summed to obtain a contrast task loss value of the first graph neural network model.

5. The method according to claim 4, characterized in that The determining, based on the first final embedding representation pair and a first enhanced embedding representation pair corresponding to the first sample final embedding representation, a first contrast loss of the sample user node comprises: determining a first entropy value of the first final embedding representation pair; determining a first similarity score for the first final embedding representation pair and a second similarity score for the first enhanced embedding representation pair; Based on the first entropy value, the first similarity score, and the second similarity score, a first contrast loss of the sample user node is determined.

6. The method according to claim 2, characterized in that The determining the model loss value of the first graph neural network model based on the Bayesian personalized sorting loss value and the comparison task loss value includes: Obtaining a balance coefficient of the comparison task loss value; Based on the Bayesian personalized sorting loss value, the comparison task loss value and the balance coefficient, a model loss value of the first graph neural network model is determined.

7. The method according to claim 4, characterized in that The method further comprises: Adding a noise vector to each final embedded representation of the first samples to obtain a first enhanced sample final embedded representation and a second enhanced sample final embedded representation; wherein the noise vectors included in the first enhanced sample final embedded representation and the second enhanced sample final embedded representation are different; The first enhanced sample final embedding representation and the second enhanced sample final embedding representation are combined to obtain the first enhanced embedding representation pair.

8. The method according to claim 1, characterized in that The determining, based on the relative size between the first node degree and the second node degree, a first weight value of the first node degree and a second weight value of the second node degree respectively comprises: Normalizing the first node degree and the second node degree to obtain a first normalized degree value corresponding to the first node degree and a second normalized degree value corresponding to the second node degree; A first difference between 1 and the first normalized degree value is calculated to obtain a first weight value of the first node degree, and a second difference between 1 and the second normalized degree value is calculated to obtain a second weight value of the second node degree.

9. The method according to claim 1, characterized in that: The step of inputting the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model, comprises: In the propagation function of the first graph neural network model, a preset propagation weight coefficient is assigned to each propagation item to obtain a second graph neural network model; wherein the each propagation item includes the first propagation item of the adjacent previous network layer and each second propagation item corresponding to the initial embedding representation; the preset propagation weight coefficient of the first propagation item is greater than the preset propagation weight coefficient of each second propagation item; The first weight value of the first node degree, the second weight value of the second node degree, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node are input into the second graph neural network model to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the second graph neural network model.

10. A robust collaborative filtering device based on graph contrast learning, characterized in that: The device comprises: A generating and determining module is used to generate a first degree matrix based on a first node degree of a sample user node and a second node degree of a sample interaction object node, and to determine a first weight value of the first node degree and a second weight value of the second node degree based on a relative size between the first node degree and the second node degree; wherein the first node degree and the second node degree are determined based on a sample adjacency matrix between sample user nodes and sample interaction object nodes contained in the sample interaction information graph data; A first input module is used to input the first weight value, the second weight value, the first degree matrix, the sample adjacency matrix, the first sample embedding representation of the sample user node, and the second sample embedding representation of the sample interaction object node into a first graph neural network model, so as to obtain the first sample final embedding representation of the sample user node and the second sample final embedding representation of the sample interaction object node output by the first graph neural network model; Determine an adjustment module, which is used to determine a model loss value of the first graph neural network model based on the final embedding representation of the first sample, the final embedding representation of the second sample and the sample adjacency matrix, and adjust the model parameters of the first graph neural network model based on the model loss value to obtain a target graph neural network model; wherein the model loss value includes a Bayesian personalized ranking loss value and a contrast loss value; A second input module is used to input the first node embedding representation of the user node corresponding to the first interaction information graph data, the second node embedding representation of the first interaction object node, and the second adjacency matrix between the user node and the first interaction object node into the target graph neural network, so as to obtain the first node final embedding representation of the user node and the second node final embedding representation of the first interaction object node output by the target graph neural network; wherein the user node and the first interaction object node are both included in the first interaction information graph; A determination module is used to determine a second interactive object node associated with the user node based on the final embedding representation of the first node and the final embedding representation of the second node, so as to implement collaborative filtering of the first interactive object node.

Citation Information

Patent Citations

  • Network embedding method and system based on graph neural network

    CN117493617A

  • Heterogeneous graph neural network noise tolerance method based on Transform and comparative learning

    CN117787379A

  • Recommendation method fusing regional negative sampling and graph contrast learning

    CN118568358A

  • Data network graph embedding method and apparatus, computer device, and storage medium

    WO2024021738A1

Cited By

  • Photovoltaic power generation prediction method and system based on uncertainty graph convolution

    CN121052461A