Recommendation model training method and device based on graph contrastive learning

By using graph contrastive learning and data augmentation methods, multiple sets of subgraphs are generated and processed in quaternion space. Combined with graph convolutional neural network optimization model, the shortcomings of graph convolutional neural networks in user-item interaction data sparsity and Euclidean space modeling are solved, thereby improving the accuracy and performance of the recommendation model.

CN115659059BActive Publication Date: 2026-07-03JIANGSU YEYOO E-CLOUD SOFTWARE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU YEYOO E-CLOUD SOFTWARE CO LTD
Filing Date
2022-05-16
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing recommendation models based on graph convolutional neural networks have shortcomings in terms of the sparsity of user-item interaction data and Euclidean space modeling, resulting in poor recommendation performance and difficulty in effectively capturing graph structure features.

Method used

A recommendation model training method based on graph contrastive learning is adopted. The initial graph is augmented to generate multiple sets of subgraphs, which are then processed in the quaternion space. Message propagation is performed in conjunction with a graph convolutional neural network, and the model is optimized using a contrastive learning loss function to improve the accuracy of vector representations of users and items.

Benefits of technology

It improves the recommendation model's ability to mine user preferences, enhances the accuracy of object recommendations, and improves recommendation performance by extracting more information from different enhanced views through multi-view learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115659059B_ABST
    Figure CN115659059B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a recommendation model training method and device based on graph contrastive learning. The method comprises: obtaining an initial graph containing a plurality of users and a plurality of objects; the initial graph is used to represent the interaction relationship between the plurality of users and the plurality of objects; performing data enhancement on the initial graph to generate two groups of subgraphs; inputting the initial graph and each group of subgraphs into a recommendation model for processing to obtain vector representations of each user and each object in the initial graph and each group of subgraphs; determining loss information according to the vector representations of the plurality of users and the plurality of objects in the initial graph; determining contrastive learning loss information based on a preset contrastive learning loss function and according to the vector representations of all users and all objects in the two groups of subgraphs; and training the recommendation model according to the loss information and the contrastive learning loss information. Based on the method and device, the accuracy of the recommendation model in recommending objects to target users can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for training recommendation models based on graph contrastive learning. Background Technology

[0002] Recommender systems have been widely used to alleviate information overload in real-world applications such as social media, news, video, and e-commerce. They aim to estimate whether a user will show a preference for a particular item based on their historical interactions.

[0003] Among existing recommendation methods, collaborative filtering-based models have shown excellent performance in learning user and item representations. Recently, there has been a surge in applications of graph convolutional neural network (GCNN)-based recommendation models to learn better user and item representations in user-item bipartite graphs. However, the data for GCNN-based recommendation models is very sparse, making it difficult to extract sufficient information from user-item interactions, thus impacting recommendation performance. Furthermore, current GCNNs model users and items in Euclidean space, leading to high distortion when modeling complex graphs, reducing the ability to capture graph structural features, and consequently resulting in suboptimal performance. Summary of the Invention

[0004] One object of the embodiments of the present invention is to solve at least the above-mentioned problems and / or defects, and to provide at least the advantages described below.

[0005] This invention provides a method, apparatus, electronic device, and storage medium for training a recommendation model based on graph contrastive learning, which can improve the accuracy of the recommendation model in recommending objects to target users.

[0006] Firstly, a recommendation model training method based on graph contrastive learning is provided, including:

[0007] Obtain an initial graph containing multiple users and multiple objects; wherein the initial graph is used to represent the interaction relationships between the multiple users and the multiple objects;

[0008] The initial graph is augmented to generate two sets of subgraphs;

[0009] The initial graph and each set of subgraphs are input into the recommendation model for processing to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs.

[0010] Based on the vector representations of the multiple users and the multiple objects in the initial graph, the loss information is determined;

[0011] Based on a preset contrastive learning loss function, the contrastive learning loss information is determined according to the vector representations of all users and all objects in the two sets of subgraphs;

[0012] The recommendation model is trained based on the loss information and the contrastive learning loss information.

[0013] Optionally, the data augmentation of the initial graph to generate two sets of subgraphs includes:

[0014] For the two sets of subgraphs or any one of the two sets of subgraphs, data augmentation is performed on the initial graph based on edge dropping and / or node dropping to generate a set of subgraphs consisting of a single subgraph.

[0015] Optionally, the recommendation model includes a graph convolutional neural network; the step of data augmentation of the initial graph to generate two sets of sub-graphs includes:

[0016] For the two sets of subgraphs or any one of the two sets of subgraphs, data augmentation is performed on the initial graph based on random walk or a combination of random walk and edge dropping or a combination of random walk and node dropping to generate a set of subgraphs consisting of multiple subgraphs.

[0017] The step of inputting the two sets of subgraphs into the recommended model for processing, to obtain the vector representation of each user and the vector representation of each object in each set of subgraphs, includes:

[0018] A set of subgraphs consisting of multiple subgraphs is input into the graph convolutional neural network. Each subgraph in the corresponding set of subgraphs is processed by each convolutional layer in the graph convolutional neural network to obtain the vector representation of each user and the vector representation of each object in each set of subgraphs.

[0019] Optionally, the recommendation model includes a first graph convolutional neural network and a second graph convolutional neural network, wherein the first graph convolutional neural network includes at least one first convolutional layer with a weight matrix, and the second graph convolutional neural network includes at least one second convolutional layer without a weight matrix.

[0020] The initial graph and the two sets of subgraphs are input into the recommendation model for processing to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs, including:

[0021] The initial graph is input into the first graph convolutional neural network. Based on the first message propagation mechanism, the vector representation of each user and the vector representation of each object in the initial graph are updated through at least one weight matrix of the at least one first convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in the initial graph are obtained.

[0022] Each subgraph is input into the second graph convolutional neural network. Based on the second message propagation mechanism, the vector representations of each user and each object in each subgraph are updated through the at least one second convolutional layer. After the update is completed, the vector representations of each user and each object in each subgraph are obtained.

[0023] Optionally, determining the loss information based on the vector representations of the multiple users and the multiple objects in the initial graph includes:

[0024] Loss information is determined based on the difference between each user's preference for each object with which they have an interaction relationship and the corresponding user's preference for each object without which they have no interaction relationship.

[0025] Optionally, the determination of contrastive learning loss information based on a preset contrastive learning loss function, according to the vector representations of all users and all objects in the two sets of subgraphs, includes:

[0026] Based on the differences between the vector representations of the same user and the vector representations of the same object in the two sets of subgraphs, as well as the differences between the vector representations of different users and the vector representations of different objects in the two sets of subgraphs, the contrastive learning loss information is determined.

[0027] Optionally, training the recommendation model based on the loss information and the contrastive learning loss information includes:

[0028] The total loss information is determined based on the sum of the loss information and the contrastive learning loss information;

[0029] The recommendation model is trained based on the total loss information.

[0030] Optionally, before performing data augmentation on the initial graph to generate two sets of subgraphs, the method includes:

[0031] Determine the initial quaternion vector representation for each user and the initial quaternion vector representation for each object in the initial graph;

[0032] The process of inputting the initial graph and the two sets of subgraphs into the recommendation model for processing, to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs, includes:

[0033] The initial graph, the initial quaternion vector representation of each user and the initial quaternion vector representation of each object in the initial graph, the two sets of subgraphs, and the initial quaternion vector representation of each user and the initial quaternion vector representation of each object in each set of subgraphs are input into the recommendation model and processed in the quaternion space to obtain the vector representation of each user and the vector representation of each object in the initial graph and each set of subgraphs.

[0034] Secondly, a recommendation model training device based on graph contrastive learning is provided, comprising:

[0035] The data acquisition module is used to acquire an initial graph containing multiple users and multiple objects; wherein, the initial graph is used to represent the interaction relationship between the multiple users and the multiple objects;

[0036] The subgraph generation module is used to perform data augmentation on the initial graph and generate two sets of subgraphs;

[0037] The vector representation generation module is used to input the initial graph and each set of subgraphs into the recommendation model for processing, and to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs.

[0038] The loss information determination module is used to determine loss information based on the vector representations of the multiple users and the vector representations of the multiple objects in the initial graph;

[0039] The contrastive learning loss information determination module is used to determine the contrastive learning loss information based on a preset contrastive learning loss function and according to the vector representations of all users and all objects in the two sets of subgraphs.

[0040] The recommendation model training module is used to train the recommendation model based on the loss information and the contrastive learning loss information.

[0041] Thirdly, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method.

[0042] Fourthly, a storage medium is provided on which a computer program is stored, characterized in that, when the program is executed by a processor, it implements the method described thereon.

[0043] The embodiments of the present invention include at least the following beneficial effects:

[0044] This invention provides a method, apparatus, electronic device, and storage medium for training a recommendation model using graph contrastive learning. The method first acquires an initial graph containing multiple users and multiple objects, whereby the initial graph represents the interaction relationships between the multiple users and the multiple objects. Data augmentation is performed on the initial graph to generate two sets of sub-graphs. Then, the initial graph and each set of sub-graphs are input into a recommendation model for processing, resulting in vector representations of each user and each object in the initial graph and each set of sub-graphs. Based on the vector representations of the multiple users and multiple objects in the initial graph, loss information is determined. Then, based on a preset contrastive learning loss function, contrastive learning loss information is determined based on the vector representations of all users and all objects in the two sets of sub-graphs. Finally, the recommendation model is trained based on the loss information and the contrastive learning loss information. Based on this method, apparatus, electronic device, and storage medium, by performing data augmentation on the initial graph to generate different augmented views, and by extracting more information from these different augmented views through contrastive learning, the accuracy of the recommendation model's representation of user and object vectors is improved. This allows the recommendation model to more accurately mine user preferences for objects, thereby improving the accuracy of the recommendation model in recommending objects to target users.

[0045] Other advantages, objectives, and features of the embodiments of the present invention will be apparent in part from the following description, and in part will be understood by those skilled in the art through study and practice of the embodiments of the present invention. Attached Figure Description

[0046] Figure 1 A flowchart illustrating a recommendation model training method based on graph contrastive learning, provided in one embodiment of the present invention;

[0047] Figure 2 A flowchart illustrating the process of generating vector representations of users and objects according to an embodiment of the present invention;

[0048] Figure 3 A schematic diagram of a recommendation model based on a quaternion graph convolutional neural network provided in an embodiment of the present invention;

[0049] Figure 4 A schematic diagram of the structure of a recommendation model training device based on graph contrast learning provided in an embodiment of the present invention;

[0050] Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0051] The embodiments of the present invention will now be described in further detail with reference to the accompanying drawings, so that those skilled in the art can implement them based on the description.

[0052] Figure 1 The flowchart illustrates a graph-based contrastive learning-based recommendation model training method provided in this embodiment of the invention. This method is executed by a system with processing capabilities, a server-side device, or a graph-based contrastive learning-based recommendation model training apparatus. The method includes:

[0053] Step 110: Obtain an initial graph containing multiple users and multiple objects; wherein the initial graph is used to represent the interaction relationship between the multiple users and the multiple objects.

[0054] In some embodiments, step 110 may include: acquiring historical interaction data of multiple users; wherein the historical interaction data of each user includes objects with which each user has an interaction relationship; generating an initial graph based on the historical interaction data of multiple users; wherein the initial graph is used to represent the interaction relationships between the multiple users and the multiple objects. The initial graph can be represented by an interaction matrix. Specifically, based on the historical interaction data of multiple users, all users and all objects interacted by these users can be determined, and the sets of users and objects are represented as follows: and The number of users and objects are represented by M and N, respectively. Based on this, a user-object interaction matrix can be constructed. Among them, R ui =1 indicates that user u and object i have an interactive relationship.

[0055] Here, each user's historical interaction data can include at least one object with which they have an interaction relationship. Correspondingly, the historical interaction data of multiple users can include all objects with which they have an interaction relationship. The objects corresponding to different users may be exactly the same, partially the same, or completely different. The interaction relationship between users and objects is based on the user's interaction behavior with the object. The interaction behavior can be a user's purchase behavior of a certain product, a user's reading behavior of a certain news, a user's dining behavior of a certain restaurant, and so on.

[0056] The initial graph includes multiple users and multiple objects. Users and objects are nodes in the initial graph, referred to as user nodes and object nodes, respectively. The interaction relationships between users and objects are represented by edges. When a user interacts with an object, there is an edge between the corresponding user node and the corresponding object node; conversely, when a user does not interact with an object, there is no edge between the corresponding user node and the corresponding object node.

[0057] In practical applications, interactions between different users with the same object can reflect shared preferences among them. Therefore, in this embodiment of the invention, based on the interactions between different users with the same object, the preferences of different users for the same object can be captured, thereby improving the accuracy of the recommendation model in recommending objects to the target user.

[0058] Step 120: Perform data augmentation on the initial graph to generate two sets of subgraphs.

[0059] In this step, the initial graph is processed using data augmentation methods to generate different augmented views. More information can be extracted from these augmented views to improve the recommendation model's ability to learn the vector representations of user objects.

[0060] Data augmentation methods can include edge dropping, node dropping, and random walks. Other data augmentation methods can also be used. Here, edge dropping refers to randomly dropping a certain proportion of edges in the initial graph to generate a subgraph. Node dropping refers to randomly dropping a certain proportion of nodes in the initial graph and the edges connected to these nodes to generate a subgraph. In node dropping, the randomly dropped nodes can be user nodes or object nodes. Random walks can generate a subgraph for each of the multiple convolutional layers in the recommendation model, with each subgraph generated by randomly dropping a certain proportion of edges.

[0061] In some embodiments, the data augmentation of the initial graph to generate two sets of subgraphs includes: for the two sets of subgraphs or any one of the two sets of subgraphs, performing data augmentation on the initial graph based on edge dropping and / or node dropping to generate a set of subgraphs consisting of a single subgraph. Specifically, each set of subgraphs in the two sets of subgraphs can be obtained by processing the initial graph with a single edge dropping or node dropping, or by processing the initial graph with a combination of node dropping and edge dropping. In another case, one set of subgraphs in the two sets of subgraphs can be obtained by processing the initial graph with a single edge dropping or node dropping, or by processing the initial graph with a combination of node dropping and edge dropping.

[0062] In some embodiments, the data augmentation of the initial graph to generate two sets of subgraphs includes: for the two sets of subgraphs or any one of the two sets of subgraphs, performing data augmentation on the initial graph based on a random walk, a combination of a random walk and edge dropping, or a combination of a random walk and node dropping, to generate a set of subgraphs consisting of multiple subgraphs. Specifically, each set of subgraphs in the two sets of subgraphs can be obtained by processing the initial graph with a single random walk, or by processing the initial graph with a combination of a random walk and node dropping or random walk and edge dropping. In another case, one set of subgraphs in the two sets of subgraphs can be obtained by processing the initial graph with a single random walk, or by processing the initial graph with a combination of a random walk and node dropping or random walk and edge dropping. For the combination of a random walk and node dropping or random walk and edge dropping, the initial graph can first be processed by dropping nodes or edges to generate an initial subgraph, then a random walk can be performed on the initial subgraph, and then multiple subgraphs can be generated based on the initial subgraph.

[0063] In some examples, the recommendation model includes a graph convolutional neural network (Graph Convolutional Neural Network). For a set of subgraphs generated by edge dropping, node dropping, or a combination of both, only one subgraph is included. When this subgraph is input into the recommendation model for processing, each convolutional layer of the Graph Convolutional Neural Network processes the same subgraph. In other examples, for a set of subgraphs generated by random walks or a combination of random walks and node dropping or random walks and edge dropping, multiple subgraphs are included. The process of inputting the two sets of subgraphs into the recommendation model to obtain vector representations for each user and each object in each set of subgraphs includes: inputting a set of subgraphs consisting of multiple subgraphs into the Graph Convolutional Neural Network, processing each subgraph in the corresponding set of subgraphs through each convolutional layer of the Graph Convolutional Neural Network, and obtaining vector representations for each user and each object in each set of subgraphs. When this set of subgraphs is input into the recommendation model for processing, each convolutional layer of the Graph Convolutional Neural Network processes a different subgraph.

[0064] When performing data augmentation on the initial graph, the dropout ratio ρ can be set. For example, the dropout ratio can be set for a single data augmentation method, or the total dropout ratio can be set. The combination of data augmentation methods must be performed on the initial graph according to this total dropout ratio.

[0065] Step 130: Input the initial graph and the two sets of subgraphs into the recommendation model for processing to obtain the vector representation of each user and the vector representation of each object in the initial graph and each set of subgraphs.

[0066] Users or objects possess multidimensional features, and these features exhibit internal dependencies. Quaternion space is a hypercomplex space, where each quaternion is a hypercomplex number consisting of one real part and three imaginary parts. Quaternions allow for the integration and processing of multidimensional features into a single entity to encode the internal dependencies between these features, thus demonstrating good performance in representation learning. Therefore, this embodiment of the invention preferably determines the initial quaternion vector representation for each user and the initial quaternion vector representation for each object in the initial graph. Based on this, step 130 includes: inputting the initial graph, the initial quaternion vector representations for each user and each object in the initial graph, the two sets of subgraphs, and the initial quaternion vector representations for each user and each object in each set of subgraphs into the recommendation model for processing in the quaternion space to obtain the vector representations for each user and each object in the initial graph and each set of subgraphs. In other words, the initial graph and each set of subgraphs are processed in the quaternion space to generate more accurate vector representations of users and objects.

[0067] It should be understood that since the subgraph is generated through data augmentation based on the initial graph, once the initial quaternion vector representation of each user and each object in the initial graph is determined, the initial quaternion vector representation of each user and each object in each subgraph can also be determined.

[0068] Specifically, all users and objects in the initial graph are embedded into a quaternion space, for the user set... User u in the vector is represented by an initial quaternion vector as follows: Where d represents the dimension of the quaternion. This is the same as the user's initial quaternion vector representation, for each object... Both use initial quaternion vector representation The initial quaternion vector representations of users and objects can be defined as follows:

[0069]

[0070] in,

[0071] M and N represent the number of users and objects, respectively.

[0072] In this step, initial quaternion vector representations of users and objects can be randomly generated, and then processed by a graph convolutional neural network to generate more accurate vector representations of users and objects.

[0073] Next, when processing the initial graph using the recommendation model, feature transformation is performed, i.e., convolution operation is performed using a weight matrix. To improve the training speed and simplicity of the training method, when processing the two sets of subgraphs obtained from data augmentation using the recommendation model, feature transformation is not performed, i.e., convolution operation is not performed using a weight matrix. In some embodiments, the recommendation model includes a first graph convolutional neural network and a second graph convolutional neural network, wherein the first graph convolutional neural network includes at least one first convolutional layer with a weight matrix, and the second graph convolutional neural network includes at least one second convolutional layer without a weight matrix. In this embodiment, both the first graph convolutional neural network and the second graph convolutional neural network are quaternion graph convolutional neural networks. Figure 2 A flowchart illustrating the vector representation generation process for users and objects provided in an embodiment of the present invention is shown. Figure 2 As shown, step 130 further includes:

[0074] Step 210: Input the initial graph into the first graph convolutional neural network. Based on the first message propagation mechanism, update the vector representation of each user and the vector representation of each object in the initial graph through at least one weight matrix of the at least one first convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in the initial graph are obtained.

[0075] The initial graph can be represented by an interaction matrix. An interaction matrix can be understood as a graph structure that reflects the interaction relationships between multiple users and multiple objects. Processing the interaction matrix can capture the graph structure features, that is, capture the interaction relationships between different users and different objects, thereby generating more accurate vector representations of users and objects, and thus more accurately estimating user preferences for objects.

[0076] Specifically, to process the interaction matrix, one can... Constructing an adjacency matrix Here, M and N represent the number of users and objects, respectively. The adjacency matrix reflects the adjacency information of users and objects, including the objects that interact with each user and the users that interact with each object. By processing the adjacency matrix using a first-graph convolutional neural network, the interaction relationships between different users and different objects can be captured, thereby generating more accurate vector representations of users and objects to more accurately estimate user preferences for objects.

[0077] Based on the first message propagation mechanism, the interaction matrix, the initial quaternion vector representations of multiple users in the initial graph, and the initial quaternion vector representations of multiple objects in the initial graph are processed through at least one first convolutional layer. Each first convolutional layer outputs each intermediate quaternion vector representation of each user in the initial graph and each intermediate quaternion vector representation of each object in the initial graph.

[0078] Each round of message propagation is implemented by each first convolutional layer. Each first convolutional layer outputs a middle quaternion vector representation for each user and a middle quaternion vector representation for each object in the initial graph. The convolutional processing result of the previous round of message propagation, generated by the previous first convolutional layer, is input into the next first convolutional layer for the next round of message propagation. By processing the convolutional processing result of the previous round of message propagation in each first convolutional layer, the vector representations of users and objects in the initial graph can be updated.

[0079] In each round of message passing, the quaternion vector representations of each user and each object in the initial graph input to the current first convolutional layer are updated using the weight matrix of each first convolutional layer. Each intermediate quaternion vector representation of each user and each intermediate quaternion vector representation of each object in the initial graph is output from each first convolutional layer. The weight matrix of each first convolutional layer is a quaternion weight matrix.

[0080] The first message propagation mechanism can be a message propagation mechanism based on quaternion feature transformation, as shown in the following formula:

[0081]

[0082]

[0083] in, and Let represent the intermediate quaternion vectors of the user and the object in the initial graph obtained after l layers of convolution, respectively. It is a symmetric normalization term, which can prevent the dimension of the vector representation from increasing with the increase of graph convolution. and Let these represent the set of objects that user u interacts with and the set of users that object i interacts with, respectively. It is the quaternion weight matrix on the l-th layer.

[0084] Each first convolutional layer has a corresponding quaternion weight matrix. During each round of message propagation, for each user in the initial graph, the sum of the products of the quaternion weight matrix of the corresponding first convolutional layer and the quaternion vector representations of each object interacting with that user, input to the corresponding first convolutional layer, is calculated to update the vector representation for that user. Simultaneously, for each object in the initial graph, the sum of the products of the quaternion weight matrix of the corresponding first convolutional layer and the quaternion vector representations of each user interacting with that object, input to the corresponding first convolutional layer, is calculated to update the vector representation for each object.

[0085] The product of two quaternions is called the Hamiltonian product. This calculation method enhances the potential interrelationship between the real and imaginary parts of the two quaternions, so that any small change in each part of the quaternion can lead to completely different outputs. This improves the ability to learn model representations, better captures the interaction relationships between different users and different objects, and more accurately estimates user preferences for objects.

[0086] It should be noted that, for the first convolutional layer, the quaternion vector input to each user and each object is represented by their initial quaternion vector representation. For subsequent convolutional layers, the quaternion vector input to the current convolutional layer is represented by their intermediate quaternion vector representation output from the previous convolutional layer.

[0087] Furthermore, in some more complex graph convolutional neural networks, other model parameters in the first graph convolutional neural network, such as biases, can be set as quaternion matrices. The number of first convolutional layers and the size of the convolutional kernels in the first graph convolutional neural network can be set as needed, and this embodiment of the invention does not impose specific limitations on them.

[0088] Next, based on the initial quaternion vector representation of each user in the initial graph and at least one intermediate quaternion vector representation output by at least one first convolutional layer, a vector representation of each user in the initial graph is generated; based on the initial quaternion vector representation of each object in the initial graph and at least one intermediate quaternion vector representation output by at least one first convolutional layer, a vector representation of each object in the initial graph is generated.

[0089] In some embodiments, the quaternion vector representations of users and objects can be first transformed into real number space, and then the user's preference for the object can be estimated based on the vector representations of users and objects in real number space. Specifically, the initial quaternion vector representation and at least one intermediate quaternion vector representation of each user in the initial graph are respectively transformed into each vector representation of each user in real number space; the initial quaternion vector representation and at least one intermediate quaternion vector representation of each object in the initial graph are respectively transformed into each vector representation of each object in real number space; average pooling is performed on the multiple vector representations of each user in real number space to obtain the vector representation of each user; average pooling is performed on the multiple vector representations of each object in real number space to obtain the vector representation of each user.

[0090] Specifically, for each user in the initial graph, each of its quaternion vector representations (including an initial quaternion vector representation and at least one intermediate quaternion vector representation) can be converted into each vector representation in the real number space. Correspondingly, for each object in the initial graph, each of its quaternion vector representations (including an initial quaternion vector representation and at least one intermediate quaternion vector representation) can be converted into each vector representation in the real number space.

[0091] In some examples, converting the initial quaternion vector representation and at least one intermediate quaternion vector representation of each user in the initial graph into a vector representation of each user in the real number space, and converting the initial quaternion vector representation and the at least one intermediate quaternion vector representation of each object in the initial graph into a vector representation of each object in the real number space, includes: concatenating the real part vector and three imaginary part vectors in the initial quaternion vector representation or each intermediate quaternion vector representation of each user in the initial graph to form a vector representation of each user in the real number space in the initial graph; and concatenating the real part vector and three imaginary part vectors in the initial quaternion vector representation or each intermediate quaternion vector representation of each object in the initial graph to form a vector representation of each object in the real number space in the initial graph.

[0092] Each quaternion vector representation of a user in the initial graph consists of one real vector and three imaginary vectors. Therefore, the real and imaginary vectors of each quaternion vector representation can be directly concatenated to form each vector representation in the real number space. Correspondingly, the same processing method is adopted for each quaternion vector representation of an object in the initial graph.

[0093] For each user in the initial image, the resulting vector representations in real space can be transformed using average pooling to determine the final vector representation. Specifically, the average vector of the multiple vector representations of each user in the initial image in real space can be calculated, and this average vector is used as the final vector representation. Similarly, for each object in the initial image, the resulting vector representations in real space can also be transformed using average pooling to determine the final vector representation. Specifically, the average vector of the multiple vector representations of each object in the initial image in real space can be calculated, and this average vector is used as the final vector representation. Average pooling averages the initial quaternion vector representations of users or objects in the initial image and the intermediate quaternion vector representations output by at least one convolutional layer, resulting in a uniform output of the extracted features.

[0094] Let the number of convolutional layers be L. After L layers of convolutional operations, for any user u in the initial graph, we can obtain L+1 quaternion vector representations, including the initial quaternion vector representation. and the intermediate quaternion vectors output by the convolutional layer during message propagation. Accordingly, for any object i in the initial graph, L+1 quaternion vector representations can be obtained, including the initial quaternion vector representation. and the intermediate quaternion vectors output by the convolutional layer during message propagation.

[0095] Then, the L+1 quaternion vector representations of user u are concatenated and converted into L+1 Euclidean vector representations, and the L+1 quaternion vector representations of object i are also concatenated and converted into L+1 Euclidean vector representations. Finally, average pooling is used to obtain the final vector representation. Taking user u as an example, the processing of the final vector representation is implemented based on the following formula.

[0096]

[0097]

[0098] in, This represents the l-th vector representation of user u in the real number space, which is the l-th level quaternion vector representation for user u. The result of the processing is that when l is 0... Let l be the initial quaternion vector representation, where l takes values ​​from 1 to L. The intermediate quaternion vectors corresponding to the outputs of the 1st to Lth convolutional layers; They are respectively The real part vector and three imaginary part vectors; Concat{} indicates concatenating the vectors in it; The vector representation of user u is given; Mean{} represents the average pooling of the vectors in it.

[0099] In other embodiments, average pooling can be performed on the initial quaternion vector representation for each user and the at least one intermediate quaternion vector representation output by the at least one convolutional layer to obtain the final quaternion vector representation for each user; correspondingly, average pooling can be performed on the initial quaternion vector representation for each object and the at least one intermediate quaternion vector representation output by the at least one convolutional layer to obtain the final quaternion vector representation for each object. In subsequent steps, the preference level of each user for each object can be determined based on the final quaternion vector representations of each user and each object in the initial graph.

[0100] Specifically, the final quaternion vector representation of each user u in the initial graph can be determined by the following formula. and the final quaternion vector representation of each object i.

[0101]

[0102]

[0103] in, Let represent the k-th quaternion vector representation of user u, where k is 0. Let l be the initial quaternion vector representation, where l takes values ​​from 1 to L. The intermediate quaternion vectors corresponding to the outputs of the first to Lth first convolutional layers; Let represent the k-th quaternion vector representation of object i, where k is 0. Let l be the initial quaternion vector representation, where l takes values ​​from 1 to L. This corresponds to the intermediate quaternion vector representations output by the first to Lth first convolutional layers.

[0104] Step 220: Input each group of subgraphs into the second graph convolutional neural network. Based on the second message propagation mechanism, update the vector representation of each user and the vector representation of each object in each group of subgraphs through the at least one second convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in each group of subgraphs are obtained.

[0105] Subgraphs can also be represented by interaction matrices, and further by adjacency matrices, to facilitate processing by the second-graph convolutional neural network. By processing the adjacency matrix of the subgraph using the second-graph convolutional neural network, the interaction relationships between different users and different objects can be further captured. Through contrastive learning, more information can be extracted from different augmented views, improving the accuracy of the recommendation model's vector representations of users and objects.

[0106] For a set of subgraphs consisting of a subgraph, based on the second message propagation mechanism, the interaction matrix of the subgraph, the initial quaternion vector representations of multiple users in the subgraph, and the initial quaternion vector representations of multiple objects in the subgraph are processed through at least one second convolutional layer. Each second convolutional layer outputs each intermediate quaternion vector representation of each user and each intermediate quaternion vector representation of each object in the subgraph.

[0107] Each round of message propagation is implemented by each second convolutional layer. Each second convolutional layer outputs an intermediate quaternion vector representation for each user and each object in the subgraph. The convolutional processing result of the previous round of message propagation, generated by the previous first convolutional layer, is input to the next first convolutional layer for the next round of message propagation. By processing the convolutional processing result of the previous round of message propagation by each second convolutional layer, the vector representations of users and objects in the subgraph can be updated. During each round of message propagation, each second convolutional layer updates the quaternion vector representations of each user and each object in the subgraph input to the current second convolutional layer, and outputs each intermediate quaternion vector representation of each user and each object in the subgraph.

[0108] For a set of subgraphs consisting of multiple subgraphs, based on the second message propagation mechanism, each second convolutional layer processes the interaction matrix in the set of subgraphs, the initial quaternion vector representations of multiple users in the set of subgraphs, and the initial quaternion vector representations of multiple objects in the set of subgraphs. Each second convolutional layer outputs each intermediate quaternion vector representation of each user and each intermediate quaternion vector representation of each object in each subgraph.

[0109] Each round of message propagation is implemented by each second convolutional layer. Each second convolutional layer outputs a middle quaternion vector representation for each user and a middle quaternion vector representation for each object in the current subgraph. The convolutional processing result of the previous round of message propagation, generated by the previous first convolutional layer, is input into the next first convolutional layer for the next round of message propagation. By processing the convolutional processing result of the previous round of message propagation in each second convolutional layer, the vector representations of users and objects in that set of subgraphs can be updated.

[0110] In each round of message passing, the quaternion vector representations of each user and each object in the subgraph input to the current second convolutional layer are updated through each second convolutional layer. The intermediate quaternion vector representations of each user and each object in the current subgraph are output from each second convolutional layer.

[0111] The formula for the second message propagation mechanism is as follows:

[0112]

[0113]

[0114] in, and Let represent the intermediate quaternion vectors of the user and the object in a subgraph obtained after l layers of convolution. It is a symmetric normalization term. and These represent the set of objects that user u interacts with and the set of users that object i interacts with, respectively.

[0115] It should be noted that for the first second convolutional layer, the quaternion vector representation of each user and each object input to that second convolutional layer is their initial quaternion vector representation. For subsequent second convolutional layers after the first second convolutional layer, the quaternion vector representation of each user and each object input to the current second convolutional layer can be their intermediate quaternion vector representation output from the previous second convolutional layer. If the subgraph corresponding to the current second convolutional layer contains users or objects that were not contained in the subgraph corresponding to the previous second convolutional layer, then the initial quaternion vector representations of these users and objects are input to the current second convolutional layer.

[0116] Furthermore, in some more complex graph convolutional neural networks, other model parameters, such as biases, can be set as quaternion matrices. The number of second convolutional layers and the size of the convolutional kernels in the second graph convolutional neural network can be set as needed, and this embodiment of the invention does not impose specific limitations on this. It should be understood that the second graph convolutional neural network is used for representation learning on different augmented views to train the recommendation model. Therefore, the second graph convolutional neural network has essentially the same structure as the first graph convolutional neural network, including the number of convolutional layers, the size of the convolutional kernels, the selection of activation functions, etc.

[0117] Next, based on the initial and intermediate quaternion vector representations of each user in each subgraph group, a vector representation of each user in each subgraph group is generated; similarly, based on the initial and intermediate quaternion vector representations of each object in each subgraph group, a vector representation of each object in each subgraph group is generated. The calculation process for the vector representations of each user and each object in each subgraph group is similar to that in the initial graph, and will not be described again in this embodiment.

[0118] In other embodiments, the initial graph and each set of subgraphs can be processed in the real space by a recommendation model. The initial vector representations of users and objects in the initial graph and each set of subgraphs are vector representations in the real space, and finally the vector representations of users and objects in the real space are obtained.

[0119] Furthermore, in some embodiments, the recommendation model may include only one graph convolutional neural network (GCNN), i.e., without setting up a second GCNN separately for contrastive learning. In this embodiment, the initial graph and each set of subgraphs are respectively input into the recommendation model with only one GCNN, obtaining vector representations of each user and each object in the initial graph and each set of subgraphs, respectively. Loss information is determined based on the vector representations of multiple users and multiple objects in the initial graph. Based on a preset contrastive learning loss function, the contrastive learning loss information is determined by combining the vector representations of all users and all objects in the two sets of subgraphs. The recommendation model is then trained based on the loss information and the contrastive learning loss information.

[0120] Step 140: Determine loss information based on the vector representations of the multiple users and the vector representations of the multiple objects in the initial graph.

[0121] Step 140 further includes: determining loss information based on the difference between each user's preference for each object with which they have an interaction relationship and the corresponding user's preference for each object without which they do not have an interaction relationship.

[0122] In some embodiments, each user's preference score for each object can be determined based on the inner product of each user's vector representation and each object's vector representation. The inner product of two vectors reflects the similarity between the two vectors. In this embodiment, the inner product of two vectors reflects a user's preference for a particular object. The larger the inner product of a user's vector representation and an object's vector representation, the greater the user's preference for that object; conversely, the smaller the inner product, the smaller the user's preference for that object.

[0123] Specifically, the preference score of user u for object i can be determined using the following formula.

[0124]

[0125] in, and Let U represent the vector representation (real-valued vector) of user u and the vector representation (real-valued vector) of object i, respectively.

[0126] The preference score of user u for object i can also be determined using the following formula.

[0127]

[0128] in, and Let u be the vector representation (quaternion vector) of user u and i be the vector representation (quaternion vector) of object i, respectively.

[0129] Next, loss information can be determined based on the difference between each user's preference score for each object with which they have an interaction relationship and the corresponding user's preference score for each object without which they have no interaction relationship.

[0130] Specifically, BPR loss can be used to determine loss information, which encourages observed interactions to receive better scores than unobserved interactions. The loss function formula is as follows:

[0131]

[0132] in, This represents the set of objects that user u interacts with; This indicates that object i belongs to the set of objects that user u interacts with. This indicates that object j does not belong to the set of objects that user u interacts with. This represents the preference score of user u for object i; σ represents the preference score of user u for object j; σ is the sigmoid function; λ represents the L2 regularization weights to prevent overfitting; This represents all the parameters in the model that need to be trained.

[0133] Step 150: Based on the preset contrastive learning loss function, determine the contrastive learning loss information according to the vector representations of all users and all objects in the two sets of subgraphs.

[0134] In some embodiments, step 150 further includes: determining contrastive learning loss information based on the differences between vector representations of the same user and vector representations of the same object in the two sets of subgraphs, and the differences between vector representations of different users and vector representations of different objects in the two sets of subgraphs.

[0135] Specifically, the two sets of subgraphs are represented as Z1 and Z2, respectively. The vector representations of a node n (which can be a user node or an object node) in the initial graph are combined in Z1 and Z2 to form a pair, i.e., (z 1,n ,z 2,n ), combine the vector representation of a node n in Z1 of the initial graph with the representation of another node m in Z2 of the initial graph to form a negative pair, i.e. (z 1,n ,z 2,m Then, the contrastive loss is calculated using the following contrastive loss function. Maximize the consistency of positive pairs and minimize the consistency of negative pairs:

[0136]

[0137] In the initial graph, the sets of users and objects are represented as follows: and sim(z 1,n ,z 2,n ) is used to calculate the similarity between the vector representations of node n in the initial graph in Z1 and Z2, sim(z 1,n ,z 2,m This is used to calculate the similarity between the vector representation of node n in Z1 and the vector representation of node m in Z2 of the initial graph; let the two vector representations be denoted by a and b respectively, then the similarity between the two vector representations a and b is sim(a,b) = a T b / ||a||||b||; τ represents the temperature coefficient, a hyperparameter that needs fine-tuning. In this formula, the first part calculates the contrast loss based on all user nodes in the initial graph, and the second part calculates the contrast loss based on all object nodes in the initial graph.

[0138] Step 160: Train the recommendation model based on the loss information and the contrastive learning loss information.

[0139] In some embodiments, step 160 further includes: determining total loss information based on the sum of the loss information and the contrastive learning loss information; and training the recommendation model based on the total loss information.

[0140] Specifically, the total loss information is determined according to the following formula:

[0141]

[0142] in, Indicates comparative loss, Let λ represent the BPR loss. CL The coefficients representing the contrast loss are hyperparameters that need to be fine-tuned.

[0143] Based on the total loss information, the parameters in the recommendation model can be adjusted. In some embodiments, the recommendation model includes a first graph convolutional neural network (CNN) and a second graph convolutional neural network (BNN), wherein the first CNN processes the initial graph, and the second CNN processes different augmented views to provide auxiliary information required for training. Therefore, during training, both the first and second CNNs are optimized simultaneously. After training, both the first and second CNNs can output the same vector representation for the same user and object.

[0144] A termination condition can be set for the training process. When the termination condition is met, the training process can end. The termination condition can be that the training reaches the maximum number of iterations, or that the prediction accuracy of the training set reaches a set threshold. This embodiment of the invention does not impose specific limitations on this.

[0145] The trained recommendation model can directly output vector representations for each user and each object in the initial graph. Based on the vector representations of each user and each object, the preference level of each user for each object can be determined. Finally, based on the preference levels of the target user for multiple objects selected from multiple users, at least one target object is selected from the multiple objects and recommended to the target user.

[0146] In summary, the graph contrastive learning recommendation model training method provided in this embodiment of the invention first obtains an initial graph containing multiple users and multiple objects, wherein the initial graph represents the interaction relationships between the multiple users and the multiple objects. Data augmentation is performed on the initial graph to generate two sets of sub-graphs. Then, the initial graph and each set of sub-graphs are input into the recommendation model for processing, obtaining the vector representations of each user and each object in the initial graph and each set of sub-graphs. Based on the vector representations of the multiple users and multiple objects in the initial graph, loss information is determined. Then, based on a preset contrastive learning loss function, contrastive learning loss information is determined based on the vector representations of all users and all objects in the two sets of sub-graphs. Finally, the recommendation model is trained based on the loss information and the contrastive learning loss information. Based on this method, by performing data augmentation on the initial graph to generate different augmented views, and by extracting more information from different augmented views through contrastive learning, the accuracy of the recommendation model's vector representations of users and objects is improved. This allows the recommendation model to more accurately mine user preferences for objects, thereby improving the accuracy of the recommendation model in recommending objects to target users.

[0147] Figure 3This diagram illustrates a recommendation model based on a quaternion graph convolutional neural network provided in an embodiment of the present invention. According to the graph contrastive learning-based recommendation model training method provided in the above embodiment, a recommendation model based on a quaternion graph convolutional neural network is trained. Based on this recommendation model, object recommendations for target users can be implemented.

[0148] Figure 3 The initial graph provides the interaction relationships between four users u1 to u4 and five items i1 to i5. The set of users and items is represented as... and The number of users and items are M and N, respectively. Construct a user-item interaction matrix. Where R ui =1 indicates that user u has interacted with item i. and Let represent the set of items interacted with by user u and the set of users interacted with by item i, respectively. Construct an adjacency matrix based on the user-item interaction matrix. Adjacency matrix can represent Figure 3 The interaction relationships between users u1 to u4 and 5 items i1 to i5.

[0149] Embed all users and items in the initial graph into a quaternion space. For the user set... User u in the vector is represented by an initial quaternion vector as follows: Where d represents the dimension of the quaternion. This is the same as the user's initial quaternion vector representation, for each item... Both use initial quaternion vector representation The initial quaternion vector representations of users and items can be defined as follows:

[0150]

[0151] in,

[0152] M and N represent the number of users and items, respectively.

[0153] Next, feature transformations in the quaternion space are introduced at each layer for message propagation to aggregate more useful information. The quaternion embedding message propagation rules are as follows:

[0154]

[0155]

[0156] in, and Let represent the intermediate quaternion vectors of user u and item i obtained after l layers of convolution, respectively. It is a symmetric normalization term. and Let represent the set of items that user u interacts with and the set of users that item i interacts with, respectively. It is the quaternion weight matrix on the l-th layer.

[0157] Figure 3 In the first diagram, the convolutional neural network consists of three convolutional layers. Figure 3 Taking user u1 and item i4 as examples, user u1 interacts with items i1, i2, and i3, while item i4 interacts with users u2 and u3. For user u1, during the first message propagation, the Hamiltonian products between the corresponding convolutional layer weight matrix and the initial quaternion vector representations of items i1, i2, and i3 are calculated respectively. These three products are then added together to obtain the intermediate quaternion vector representation of user u1 output by the first convolutional layer. For item i4, during the first message propagation, the Hamiltonian products between the corresponding convolutional layer weight matrix and the initial quaternion vector representations of users u2 and u3 are calculated respectively. Then, the three products are added together to obtain the intermediate quaternion vector representation of item i4 output by the first convolutional layer. Subsequently, the aforementioned message propagation rules are calculated again in the second and third convolutional layers, yielding the intermediate quaternion vector representation of user u1 output by the second convolutional layer. The intermediate quaternion vector representation of item i4 The middle quaternion vector representation of user u1 output by the third convolutional layer The intermediate quaternion vector representation of item i4

[0158] Let the number of convolutional layers be L. After L layers of convolutional operations, for any user u, we can obtain L+1 quaternion vector representations, including the initial quaternion vector representation. and the intermediate quaternion vectors output by the convolutional layer during message propagation. Accordingly, for any object i, L+1 quaternion vector representations can be obtained, including the initial quaternion vector representation. and the intermediate quaternion vectors output by the convolutional layer during message propagation.

[0159] The final quaternion vector representation of each user u in the initial graph is determined by the following formula. and the final quaternion vector representation of each object i.

[0160]

[0161]

[0162] in, Let represent the k-th quaternion vector representation of user u, where k is 0. Let l be the initial quaternion vector representation, where l takes values ​​from 1 to L. The intermediate quaternion vectors corresponding to the outputs of the first to Lth first convolutional layers; Let represent the k-th quaternion vector representation of object i, where k is 0. Let l be the initial quaternion vector representation, where l takes values ​​from 1 to L. This corresponds to the intermediate quaternion vector representations output by the first to Lth first convolutional layers.

[0163] Still with Figure 3 Taking user u1 and item i4 as an example, the four quaternion vectors representing user u1 are used to represent the data. Perform average pooling to obtain the vector representation of user u1. The four vector representations of item i4 Perform average pooling to obtain the vector representation of item i4.

[0164] use and Let represent the vector representations of user u and item i, and then use the inner product to obtain the preference score of user u for item i.

[0165]

[0166] The above formula can be used to calculate the preference scores of user u1 for items i1 to i5, and finally the item with the highest preference score among user u1's preferences for items i1 to i5 can be recommended to user u1.

[0167] The following provides a specific implementation scenario to further illustrate the recommendation performance of the recommendation model trained by the graph contrast learning-based recommendation model training method provided in this embodiment of the invention.

[0168] To evaluate the performance of our model, we conducted experiments on three widely used recommendation datasets: Yelp 2018, Amazon Book, and Amazon Kindle Store. Detailed data for these datasets is shown in Table 1.

[0169] Table 1

[0170] Dataset Users Items Interactions Density Yelp 2018 31668 38048 1561406 0.00130 Amazon-Book 52643 91599 2984108 0.00062 Kindle Store 68223 61934 982618 0.00023

[0171] This embodiment uses the same method as the previous embodiment to recommend objects to the target user. The same steps will not be repeated in this embodiment. The specific structure of the graph convolutional neural network in this embodiment can be set according to the dataset used. For the Yelp2018, Amazon-Book, and Kindle-Store datasets, the number of convolutional layers in the graph convolutional neural network is set to 3 layers. The methods for generating enhanced views are a combination of edge dropping and random walk, a combination of edge dropping and random walk, and a combination of edge dropping and node dropping, respectively.

[0172] Two metrics were used to evaluate the model performance: Recall@20 and NDCG@20, and the latest collaborative filtering recommendation model was selected as the comparison model. The specific recommendation performance is shown in Table 2.

[0173] Table 2 compares the recommendation performance of the model and the recommendation model provided in the embodiments of the present invention.

[0174]

[0175] Table 2 shows the graph-based comparison learning recommendation model provided in this embodiment of the invention, abbreviated as QGCL. Other models are used as comparison models. The last row shows the percentage improvement in recommendation performance of the recommendation model provided in this embodiment compared to SGL. Among the comparison models, SGL is a graph self-supervised learning recommendation model. As shown in Table 2, the recommendation performance of the recommendation model provided in this embodiment is significantly improved compared to the comparison models in all three datasets; compared to SGL, the recommendation performance of the recommendation model provided in this embodiment is also significantly improved.

[0176] In summary, the graph contrastive learning-based recommendation model training method provided in this embodiment of the invention can generate different augmented views by augmenting the initial graph with data. Through contrastive learning, more information can be extracted from the different augmented views, improving the accuracy of the recommendation model's vector representation of users and objects. This allows the recommendation model to more accurately mine users' preferences for objects, thereby improving the accuracy of the recommendation model in recommending objects to target users.

[0177] Figure 4 A schematic diagram of the structure of a recommendation model training device based on graph contrastive learning provided in an embodiment of the present invention is shown. Figure 4As shown, the graph contrastive learning-based recommendation model training device includes: a data acquisition module 410, used to acquire an initial graph containing multiple users and multiple objects; wherein the initial graph represents the interaction relationship between the multiple users and the multiple objects; a subgraph generation module 420, used to perform data augmentation on the initial graph to generate two sets of subgraphs; a vector representation generation module 430, used to input the initial graph and each set of subgraphs into the recommendation model for processing to obtain the vector representation of each user and the vector representation of each object in the initial graph and each set of subgraphs; a loss information determination module 440, used to determine loss information based on the vector representations of the multiple users and the multiple objects in the initial graph; a contrastive learning loss information determination module 450, used to determine contrastive learning loss information based on a preset contrastive learning loss function and the vector representations of all users and all objects in the two sets of subgraphs; and a recommendation model training module 460, used to train the recommendation model based on the loss information and the contrastive learning loss information.

[0178] In some embodiments, the subgraph generation module is specifically used for:

[0179] For the two sets of subgraphs or any one of the two sets of subgraphs, data augmentation is performed on the initial graph based on edge dropping and / or node dropping to generate a set of subgraphs consisting of a single subgraph.

[0180] In some embodiments, the recommendation model includes a graph convolutional neural network; the subgraph generation module is specifically used for:

[0181] For the two sets of subgraphs or any one of the two sets of subgraphs, data augmentation is performed on the initial graph based on random walk or a combination of random walk and edge dropping or a combination of random walk and node dropping to generate a set of subgraphs consisting of multiple subgraphs.

[0182] The vector representation generation module is specifically used for:

[0183] A set of subgraphs consisting of multiple subgraphs is input into the graph convolutional neural network. Each subgraph in the corresponding set of subgraphs is processed by each convolutional layer in the graph convolutional neural network to obtain the vector representation of each user and the vector representation of each object in each set of subgraphs.

[0184] In some embodiments, the recommendation model includes a first graph convolutional neural network and a second graph convolutional neural network, wherein the first graph convolutional neural network includes at least one first convolutional layer having a weight matrix, and the second graph convolutional neural network includes at least one second convolutional layer having no weight matrix;

[0185] The vector representation generation module includes:

[0186] The first vector representation generation unit is used to input the initial graph into the first graph convolutional neural network, and based on the first message propagation mechanism, update the vector representation of each user and the vector representation of each object in the initial graph through at least one weight matrix of the at least one first convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in the initial graph are obtained.

[0187] The second vector representation generation unit is used to input each group of subgraphs into the second graph convolutional neural network. Based on the second message propagation mechanism, the vector representation of each user and the vector representation of each object in each group of subgraphs are updated through the at least one second convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in each group of subgraphs are obtained.

[0188] In some embodiments, the loss information determination module is specifically used for:

[0189] Loss information is determined based on the difference between each user's preference for each object with which they have an interaction relationship and the corresponding user's preference for each object without which they have no interaction relationship.

[0190] In some embodiments, the contrastive learning loss information determination module is specifically used for:

[0191] Based on the differences between the vector representations of the same user and the vector representations of the same object in the two sets of subgraphs, as well as the differences between the vector representations of different users and the vector representations of different objects in the two sets of subgraphs, the contrastive learning loss information is determined.

[0192] In some embodiments, the recommendation model training module includes:

[0193] The total loss information determination unit is used to determine the total loss information based on the sum of the loss information and the comparative learning loss information;

[0194] The recommendation model training unit is used to train the recommendation model based on the total loss information.

[0195] In some embodiments, the device includes:

[0196] An initial quaternion vector representation determination module is used to determine the initial quaternion vector representation for each user and the initial quaternion vector representation for each object in the initial graph;

[0197] The vector representation generation module is specifically used for:

[0198] The initial graph, the initial quaternion vector representation of each user and the initial quaternion vector representation of each object in the initial graph, the two sets of subgraphs, and the initial quaternion vector representation of each user and the initial quaternion vector representation of each object in each set of subgraphs are input into the recommendation model and processed in the quaternion space to obtain the vector representation of each user and the vector representation of each object in the initial graph and each set of subgraphs.

[0199] Figure 5 An electronic device according to an embodiment of the present invention is shown. For example... Figure 5 As shown, the electronic device 500 includes: at least one processor 510, and a memory 520 communicatively connected to the at least one processor 510, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform a method.

[0200] Specifically, the memory 520 and processor 510 are connected together via a bus 530. These can be general-purpose memory and processors, without specific limitations. When the processor 510 runs the computer program stored in the memory 520, it can execute the functions described in this embodiment of the invention. Figures 1 to 3 The described operations and functions.

[0201] In this embodiment of the invention, the electronic device 500 may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smartphone, tablet computer, personal digital assistant (PDA), handheld device, messaging device, wearable computing device, etc.

[0202] This invention also provides a storage medium storing a computer program that, when executed by a processor, implements a method. Specific implementation details can be found in the method embodiments and will not be repeated here. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer or processor of the system or apparatus to read and execute instructions stored in the storage medium. The program code read from the storage medium itself can implement the functions of any of the embodiments described above; therefore, machine-readable code and the storage medium storing machine-readable code constitute a part of this invention.

[0203] Storage media include, but are not limited to, floppy disks, hard disks, magneto-optical disks, optical disks, magnetic tapes, non-volatile memory cards, and ROMs. Program code can also be downloaded from server computers or the cloud via communication networks.

[0204] It should be noted that not all steps and modules in the above processes and system structures are necessary; some steps and units can be omitted as needed. The execution order of each step is not fixed and can be determined as required. The device structure described in the above embodiments can be a physical structure or a logical structure. A module or unit may be implemented by the same physical entity, a module or unit may be implemented by multiple physical entities respectively, or a module or unit may be jointly implemented by multiple components in multiple independent devices.

[0205] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. It can be applied to various fields suitable for embodiments of the present invention. Other modifications can be readily implemented by those skilled in the art. Therefore, without departing from the general concept defined by the claims and their equivalents, embodiments of the present invention are not limited to the specific details and illustrations shown and described herein.

Claims

1. A recommendation model training method based on graph contrastive learning, characterized in that, include: Obtain an initial graph containing multiple users and multiple objects; wherein the initial graph is used to represent the interaction relationships between the multiple users and the multiple objects; The initial graph is augmented to generate two sets of subgraphs; The initial graph and each set of subgraphs are input into the recommendation model for processing to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs. Based on the vector representations of the multiple users and the multiple objects in the initial graph, the loss information is determined; Based on a preset contrastive learning loss function, the contrastive learning loss information is determined according to the vector representations of all users and all objects in the two sets of subgraphs; The recommendation model is trained based on the loss information and the contrastive learning loss information. The recommendation model includes a first graph convolutional neural network and a second graph convolutional neural network, wherein the first graph convolutional neural network includes at least one first convolutional layer with a weight matrix, and the second graph convolutional neural network includes at least one second convolutional layer without a weight matrix. The initial graph and the two sets of subgraphs are input into the recommendation model for processing to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs, including: The initial graph is input into the first graph convolutional neural network. Based on the first message propagation mechanism, the vector representation of each user and the vector representation of each object in the initial graph are updated through at least one weight matrix of the at least one first convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in the initial graph are obtained. Each subgraph is input into the second graph convolutional neural network. Based on the second message propagation mechanism, the vector representations of each user and each object in each subgraph are updated through the at least one second convolutional layer. After the update is completed, the vector representations of each user and each object in each subgraph are obtained.

2. The recommendation model training method based on graph contrastive learning as described in claim 1, characterized in that, The initial graph is augmented to generate two sets of sub-graphs, including: For the two sets of subgraphs or any one of the two sets of subgraphs, data augmentation is performed on the initial graph based on edge dropping and / or node dropping to generate a set of subgraphs consisting of a single subgraph.

3. The recommendation model training method based on graph contrastive learning as described in claim 1, characterized in that, The recommendation model includes a graph convolutional neural network; the data augmentation of the initial graph to generate two sets of sub-graphs includes: For the two sets of subgraphs or any one of the two sets of subgraphs, data augmentation is performed on the initial graph based on random walk or a combination of random walk and edge dropping or a combination of random walk and node dropping to generate a set of subgraphs consisting of multiple subgraphs. The step of inputting the two sets of subgraphs into the recommended model for processing, to obtain the vector representation of each user and the vector representation of each object in each set of subgraphs, includes: A set of subgraphs consisting of multiple subgraphs is input into the graph convolutional neural network. Each subgraph in the corresponding set of subgraphs is processed by each convolutional layer in the graph convolutional neural network to obtain the vector representation of each user and the vector representation of each object in each set of subgraphs.

4. The recommendation model training method based on graph contrastive learning as described in claim 1, characterized in that, The step of determining loss information based on the vector representations of the multiple users and the vector representations of the multiple objects in the initial graph includes: Loss information is determined based on the difference between each user's preference for each object with which they have an interaction relationship and the corresponding user's preference for each object without which they have no interaction relationship.

5. The recommendation model training method based on graph contrastive learning as described in claim 1, characterized in that, The contrastive learning loss function, based on a preset method, determines the contrastive learning loss information according to the vector representations of all users and all objects in the two sets of subgraphs, including: Based on the differences between the vector representations of the same user and the vector representations of the same object in the two sets of subgraphs, as well as the differences between the vector representations of different users and the vector representations of different objects in the two sets of subgraphs, the contrastive learning loss information is determined.

6. The recommendation model training method based on graph contrastive learning as described in claim 1, characterized in that, The step of training the recommendation model based on the loss information and the contrastive learning loss information includes: The total loss information is determined based on the sum of the loss information and the contrastive learning loss information; The recommendation model is trained based on the total loss information.

7. The recommendation model training method based on graph contrastive learning as described in claim 1, characterized in that, Before performing data augmentation on the initial graph to generate two sets of subgraphs, the method includes: Determine the initial quaternion vector representation for each user and the initial quaternion vector representation for each object in the initial graph; The process of inputting the initial graph and the two sets of subgraphs into the recommendation model for processing, to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs, includes: The initial graph, the initial quaternion vector representation of each user and the initial quaternion vector representation of each object in the initial graph, the two sets of subgraphs, and the initial quaternion vector representation of each user and the initial quaternion vector representation of each object in each set of subgraphs are input into the recommendation model and processed in the quaternion space to obtain the vector representation of each user and the vector representation of each object in the initial graph and each set of subgraphs.

8. A recommendation model training device based on graph contrastive learning, characterized in that, include: A data acquisition module is used to acquire an initial graph containing multiple users and multiple objects; wherein, the initial graph is used to represent the interaction relationship between the multiple users and the multiple objects; The subgraph generation module is used to perform data augmentation on the initial graph and generate two sets of subgraphs; The vector representation generation module is used to input the initial graph and each set of subgraphs into the recommendation model for processing, and to obtain the vector representation of each user and each object in the initial graph and each set of subgraphs. The loss information determination module is used to determine loss information based on the vector representations of the multiple users and the vector representations of the multiple objects in the initial graph; The contrastive learning loss information determination module is used to determine the contrastive learning loss information based on a preset contrastive learning loss function and according to the vector representations of all users and all objects in the two sets of subgraphs. The recommendation model training module is used to train the recommendation model based on the loss information and the contrastive learning loss information; The recommendation model includes a first graph convolutional neural network and a second graph convolutional neural network, wherein the first graph convolutional neural network includes at least one first convolutional layer with a weight matrix, and the second graph convolutional neural network includes at least one second convolutional layer without a weight matrix. The vector representation generation module includes: The first vector representation generation unit is used to input the initial graph into the first graph convolutional neural network, and based on the first message propagation mechanism, update the vector representation of each user and the vector representation of each object in the initial graph through at least one weight matrix of the at least one first convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in the initial graph are obtained. The second vector representation generation unit is used to input each group of subgraphs into the second graph convolutional neural network. Based on the second message propagation mechanism, the vector representation of each user and the vector representation of each object in each group of subgraphs are updated through the at least one second convolutional layer. After the update is completed, the vector representation of each user and the vector representation of each object in each group of subgraphs are obtained.

9. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of any one of claims 1-7.

10. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1-7.