A Multi-Intention Recommendation Method and Device Based on Graph Contrastive Learning
Through the multi-intentional recommendation method based on graph comparison learning, the problem of the lack of interpretability and anti-noise robustness of existing recommendation algorithms is solved, and more efficient user and product feature learning is achieved, and recommendation performance and interpretability are enhanced.
Patent Information
- Application Number
- CN202210847446.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-19
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-07-19
AI Technical Summary
The existing GNN-based recommendation algorithm lacks interpretability and noise-resistant robustness, making it difficult for users to generate trust. In addition, there are few available tags in massive real data, and there are various noise factors.
Using a multi-intention recommendation method based on graph comparison learning, the user's social relationship, product attribute relationship and user product interaction relationship are stored through sparse graph structures, user purchasing behavior is introduced to form a new graph structure, and the comparison view is constructed using K decoupled potential factor intention representations, personalized comparison learning is carried out, and unsupervised learning is carried out in combination with the unsupervised learning task of maximizing mutual information of graph structures.
It improves the interpretability and robustness of the model, enhances the recommendation performance, can better decouple multiple interactive intentions between users and products, and learns the hidden factors behind the decisive graph structure, so that the decomposed node intention characterization is interpretable.
Smart Images

Figure CN115358809B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a multi-intent recommendation method and device based on graph contrast learning. Background Technique
[0002] In recent years, with the rapid development of Internet technology, a large amount of data has been generated in various service platforms such as e-commerce, social networking, and video software. Facing a large amount of data, people may feel at a loss, but for machine learning models, a large amount of data is the core "fuel" for their learning, that is, data-driven technology. Among them, the recommendation system, which has benefited greatly and developed, analyzes the attributes and various potential implicit relationships according to the historical interaction behavior of users purchasing goods, extracts features, and mines the laws and user interests hidden behind the data, and recommends goods that the user may be interested in to the user.
[0003] Subsequently, various recommendation algorithms based on GNN (Graph Neural Network) have also been proposed by scholars, and high recommendation performance can be achieved. However, it may lack certain interpretability and noise-resistant robustness, making it difficult for users to trust. Because most GNN models, when learning node features by aggregating neighbor information, regard the information of neighbor nodes as a perceptual whole, ignoring the hidden influencing factors when determining the message passing of each edge, that is, not considering the real intention of users to purchase this product. On the other hand, the available labels in a large amount of real-world data are scarce, and there will also be various noise factors. Summary of the Invention
[0004] In order to solve at least one of the technical problems existing in the prior art to a certain extent, the purpose of the present invention is to provide a multi-intent recommendation method and device based on graph contrast learning.
[0005] The technical solution adopted by the present invention is as follows:
[0006] A multi-intent recommendation method based on graph contrast learning includes the following steps:
[0007] Collect a data set with user social relationships, product attribute relationships, and user-product interaction relationships;
[0008] Store the data of user social relationships, product attribute relationships, and user-product interaction relationships in the form of a sparse graph structure to obtain graph structure data that can be used in a graph convolutional neural network model;
[0009] Based on the original social relationship and product attribute relationship, introduce the behavior of users purchasing products to form a new social relationship graph and product attribute graph;
[0010] Construct corresponding contrast views based on K (the number of latent factors to be decoupled) decoupled latent factor intention representations, and generate a parameterized enhanced UI graph through a learnable drop method (a data augmentation method, deleting edges).
[0011] Learn the decoupled features of the recommendation model, establish K GCN (Graph Convolutional Neural) message passing channels, perform feature encoding respectively, and at the same time, each GCN channel learns two sets of features on the original user-item interaction bipartite graph and the enhanced user-item bipartite graph respectively.
[0012] Introduce K intention prototype vectors and learn the distribution of multiple intention features of each node on the UI graph.
[0013] According to the two sets of intention features decoupled by K latent factors, perform K times of personalized contrast learning independently for the two contrast views under different latent factors.
[0014] Concatenate and combine the K intention features as the predicted user and item features, and utilize the graph structure information of the social relationship graph and the item attribute graph to introduce an unsupervised learning task based on maximizing mutual information.
[0015] Jointly learn the recommendation task, the task of multi-intention personalized contrast learning, and the task of maximizing graph structure mutual information.
[0016] Score and predict the user and item embedding vectors finally learned by the model to obtain the recommended item order.
[0017] Furthermore, the multi-intention recommendation method further includes the step of preprocessing the obtained dataset:
[0018] Filter invalid users according to the preset conditions of the model, and retain valid users and corresponding item nodes.
[0019] Divide the dataset, randomly select one interaction for the validation set and the test set of each user, and use the remaining interaction items as the training set.
[0020] Furthermore, based on the original social relationship and item attribute relationship, introduce the behavior of users purchasing items to form a new social relationship graph and item attribute graph, including:
[0021] To incorporate auxiliary information into the prediction of interactive behavior recommendations, the social relationships and attribute relationships are further processed according to the settings required by the model, as follows: Inject the social relationships and product attribute relationships in the dataset into the user's product purchase behavior information. If the number of products purchased between two friends is greater than a preset threshold, it is determined that they may be connected due to a certain similar purchase intention, and a new social relationship graph is reconstructed; if two products belonging to the same category are purchased by many of the same users, it is determined that these two products may be connected due to a certain similar purchase intention, and a new product attribute relationship graph is formed; use the supervision signals generated by the fine-grained hierarchical graph structure information to further learn the feature vectors corresponding to multiple factors learned by the model.
[0022] Furthermore, based on the K decoupled latent factor intention representations, corresponding contrast views are constructed, and through a learnable and adaptive drop method, a parameterized enhanced UI graph is generated, including:
[0023] In each intention factor scenario, the probability ω of whether each edge on the interactive relationship graph corresponding to the K latent factors is deleted is calculated in a parameterized manner k_ui ,
[0024] ω k_ui = MLP(Concat[u k , v k )
[0025] where MLP is a multi-layer perceptron, and Concat represents concatenating two feature vectors together; u k and v k are the user node feature and product node feature of a UI interaction edge on the graph corresponding to the Kth latent factor, respectively;
[0026] To optimize the learning of the graph structure and learn in an end-to-end manner, the reparameterization trick is adopted, expressed as:
[0027] p = σ((log ∈ - log(1 - ∈) + ω) / τ)
[0028] where ∈ follows a uniform distribution on (0, 1); τ > 0 is the temperature coefficient that adjusts the concentration of the distribution; σ(.) is the activation function;
[0029] After calculating the probability of the existence of each edge, the edges with probabilities less than the preset threshold are deleted, and the other edges are retained, and a new enhanced graph G' after drop is obtained k_ui ;
[0030] The node features (u k , v k ), and the enhanced graph G' k_uiInput into the GCN encoder of the shared parameters, and after L-layer message passing for aggregation and accumulation, the final user and commodity features E′ under multiple intents are obtained ku , E′ ki .
[0031] Furthermore, the learning of the decoupled features of the recommendation model includes:
[0032] The features of the user and commodity are sliced into K feature blocks, that is, u = (u 1 , u 2 ,..., u k ), v = (v 1 , v 2 ,..., v k ), u k , v k ∈R d / k , and there is a one-to-one correspondence between the feature blocks and the intents, and there is a one-to-one correspondence between each intent block of the user and each intent block of the commodity (u k , v k ); where R d / k is a real number space with a dimension of d / k;
[0033] Based on each intent factor, a graph convolutional neural network message passing model GCN k , input the node features of the user and commodity (u k , v k ), input the bipartite graph G ui , and after L-layer message passing for aggregation and accumulation, the final user and commodity features E ku , E ki .
[0034] Furthermore, the introduction of K intent prototype vectors includes:
[0035] After aggregating the neighbor information or high-order information of the k feature blocks of a certain node on their respective enhanced graphs, the feature representation under each potential intent factor is obtained, and the degree of conformity between the k feature representations E′ kj learned by this node and the set intent category prototype vector is calculated:
[0036]
[0037] Among them, is the cosine similarity, which evaluates the similarity of two vectors; E′ kj is the kth decoupled feature representation of node j on the graph, c k is the kth intent prototype vector introduced by the model; exp(·) is the exponential function; P kIt represents the normalized distribution of the features representing K intent categories obtained after aggregating messages through multiple layers of GCN for each node.
[0038] Furthermore, the two sets of intent features decoupled from the two contrast views according to K latent factors are independently subjected to K times of personalized contrast learning under different latent factors, including:
[0039] Independently calculate the common contrast loss function for their respective intent features. A pair of positive examples (E kj , E′ kj ), and in the minibatch-sized sample data, other sample points except itself are used as negative columns, where j represents the user or commodity node;
[0040] Positive example sample score: All negative column scores: The contrast loss function based on a specific intent feature space
[0041] Calculate the contrast losses corresponding to the K latent factors. The weight coefficients before fusing into the loss corresponding to the unified feature, that is, the feature vector information corresponding to different latent factors contained in each node, contribute differently to the final contrast learning loss, which is related to the normalized probability distribution of the feature representations corresponding to the K latent factors decoupled and learned from a certain node, that is, the probability size of this node having a certain intent vector; it is also related to whether the representation vector corresponding to this latent factor can accurately perform the contrast learning task, that is, the subgraph structure enhanced by this node may not be very accurate, and suboptimal effects will be produced if the feature information of the two perspectives is forcibly maximized; therefore, define Measure the rationality of this contrast learning from a probability perspective, As the weight coefficient before accumulating the respective independent contrast losses under the K intent categories of each node, and finally the contrast loss function of each node
[0042] The total loss function That is, the sum of the contrast losses on the user and commodity sides; where α and β are the balance coefficients of the contrast loss functions on the user and commodity sides; m is the number of users, and n is the number of commodities.
[0043] Furthermore, using the graph structure information of the social relationship graph and the commodity attribute graph, introduce an unsupervised learning task based on maximizing mutual information, including:
[0044] Utilize the progressive graph structure information from the node to the subgraph centered on the node and then to the global graph to generate a hierarchical mutual information maximization learning paradigm, mine the graph structure information in a finer-grained manner, and further optimize the learning of node features.
[0045] Further, the joint learning of the recommendation task with the multi-intent personalized contrast learning task and the maximization task based on graph-structured mutual information includes:
[0046] The features of the end-user and the commodity are: E u ={E 1u , E 2u ,..., E ku}, E u ={E 1u , E 2u ,..., E ku}, and the supervised loss L bpr of the recommendation task is obtained using the BPRLoss loss function, and added to the unsupervised loss to obtain the final model loss:
[0047]
[0048] In the formula, μ and are hyperparameters and serve as balance factors for the unsupervised task loss; L MI is the graph mutual information maximization loss function;
[0049] Using the gradient descent method, update the parameters of the model until the loss function reaches a preset threshold.
[0050] Another technical solution adopted by the present invention is:
[0051] A multi-intent recommendation device based on graph contrast learning includes:
[0052] At least one processor;
[0053] At least one memory for storing at least one program;
[0054] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0055] The beneficial effects of the present invention are: The present invention adjusts the contrast learning of two contrast views to fine-grained adaptive contrast learning based on different decoupling factors of each vector, learns more diversified semantic feature information, and enhances the interpretability and robustness of the model. Description of the Drawings
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following introduces the accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings in the following introduction are only for conveniently and clearly presenting some embodiments of the technical solutions in the present invention. For those skilled in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0057] Figure 1 The step flowchart of a multi-intention recommendation method based on graph contrast learning in an embodiment of the present invention;
[0058] Figure 2 It is the workflow diagram of a multi-intention recommendation method based on graph contrast learning in an embodiment of the present invention;
[0059] Figure 3 It is the framework diagram of the recommendation model in an embodiment of the present invention. Detailed implementation manners
[0060] The embodiments of the present invention are described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as a limitation to the present invention. For the step numbers in the following embodiments, they are only set for the convenience of explanation and illustration, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0061] In the description of the present invention, it should be understood that for the orientation description, such as the orientation or positional relationship indicated by up, down, front, back, left, right, etc., is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention.
[0062] In the description of the present invention, the meaning of several is one or more, the meaning of multiple is two or more, greater than, less than, exceeding, etc. are understood as not including the present number, and above, below, within, etc. are understood as including the present number. If there is a description of first and second, it is only for the purpose of distinguishing technical features and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.
[0063] In the description of the present invention, unless otherwise clearly defined, terms such as "set", "installed", "connected", etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.
[0064] Since contrast learning constructs positive and negative samples through auxiliary tasks, pulls similar positive samples closer and pushes dissimilar negative samples farther away for feature representation learning, and the classical data augmentation methods involved are random, which may produce suboptimal effects and lack interpretability. Because maximizing the consistency of different perspectives is required, randomness may mislearn irrelevant information. Therefore, the present invention adopts a learnable data augmentation method to learn whether to delete an edge to transform the original interaction bipartite graph into a relevant perspective graph. Utilizing the fine-grained hierarchical graph structure of the auxiliary relationship graph, an unsupervised learning objective of maximizing mutual information is carried out to further optimize node feature learning.
[0065] Embodiment 1
[0066] As Figure 1 shown, this embodiment provides a multi-intent recommendation method based on graph contrast learning, which finely decouples various interaction intents of users and commodities, learns the latent factors behind the decision of the graph structure, and makes the decomposed node intent representations interpretable; and not only introduces a powerful contrast learning method for feature learning, but also conducts contrast learning on the intent features under each specific latent factor semantics from a finer-grained and multi-faceted, personalized perspective, realizes a precise and adaptive refined contrast learning paradigm, better learns interpretable and robust user-commodity intent feature representations, and improves the performance of the recommendation model. The method specifically includes the following steps:
[0067] S101. Collect a data set with user social relationship, commodity attribute relationship, and user-commodity interaction relationship.
[0068] As an optional implementation manner, after obtaining the data set, it further includes steps A1-A2 of preprocessing the obtained data set:
[0069] A1. Filter invalid users according to the preset conditions of the model, and retain valid users and corresponding commodity nodes;
[0070] A2. Divide the data set, and randomly select one interaction for the validation set and test set of each user, and the remaining interaction items are the training set.
[0071] S102. Store the data of user social relationship, commodity attribute relationship, and user-commodity interaction relationship in the form of a sparse graph structure to obtain graph structure data that can be used in a graph convolutional neural network model.
[0072] S103. Based on the original social relationships and commodity attribute relationships, introduce the behavior of users purchasing commodities to form a new social relationship graph and commodity attribute graph.
[0073] Form a new social relationship graph and commodity attribute graph: To incorporate auxiliary information into the interactive behavior recommendation prediction, the social relationships and attribute relationships are further processed according to the settings required by the model as follows: Inject the social relationships and commodity attribute relationships in the dataset with information on users' commodity purchase behaviors. If the number of the same commodities purchased between two friends is greater than a certain threshold, it is regarded as possible that they are connected due to a certain similar purchase intention, and a new social relationship graph is reconstructed; if two commodities belonging to the same category are purchased by many of the same users, then we consider that these two commodities may be connected due to containing a similar purchase intention, and a new commodity attribute relationship graph is formed; the supervision signals generated by the fine-grained hierarchical graph structure information can be used to further learn the feature vectors corresponding to multiple factors learned by the model.
[0074] S104. Based on the K decoupled latent factor intention representations, construct the corresponding contrast views, and generate a parameterized enhanced UI graph through a learnable and adaptive drop method.
[0075] In each intention factor scenario, calculate the probability ω of whether each edge on the interactive relationship graph corresponding to the K latent factors is deleted in a parameterized manner k_ui ,
[0076] ω k_ui = MLP(Concat[u k , v k )
[0077] where MLP is a multi-layer perceptron, and Concat represents concatenating two feature vectors together.
[0078] To more effectively optimize the learning of the graph structure and learn in an end-to-end manner, the reparameterization trick is adopted, expressed as:
[0079] p = σ((log ∈ - log(1 - ∈) + ω) / τ)
[0080] where ∈ follows a uniform distribution on (0, 1); τ > 0 is the temperature coefficient, which adjusts the concentration degree of the distribution; σ(.) is the activation function.
[0081] Therefore, after calculating the probability of the existence of each edge, delete the edges with a probability less than 0.5, and keep the other edges to obtain a new enhanced graph G' after drop k_ui .
[0082] The node features (u k , v k) to enhance graph G′ k_ui Input it into the GCN encoder with shared parameters. After L - layer message passing, aggregation, and accumulation, the final user and item features E′ under multiple intents are obtained. ku E′ ki .
[0083] S105. Perform learning on the decoupled features of the recommendation model, establish K GCN (Graph Convolutional Neural) message passing channels, perform feature encoding respectively, and at the same time, each GCN channel performs learning on two sets of features in the original user - item interaction bipartite graph and the enhanced user - item bipartite graph.
[0084] Slice the features of users and items into K feature blocks, that is, u=(u 1 , u 2 ,..., u k ), v=(v 1 , v 2 ,..., v k ), u k , v k ∈R d / k . There is a one - to - one correspondence between the feature blocks and the intents, and there is a one - to - one correspondence between each intent block of the user and each intent block of the item (u k , v k ). Based on each intent factor, perform the graph convolutional neural network message passing model GCN k , input the node features of the user and item (u k , v k ), input the bipartite graph G ui . After L - layer message passing, aggregation, and accumulation, the final user and item features E ku are obtained, E ki .
[0085] S106. Introduce K intent prototype vectors and learn the distribution of multiple intent features of each node on the UI graph.
[0086] After aggregating the neighbor information or high - order information of the k feature blocks of a certain node on their respective enhanced graphs, the feature representation under each potential intent factor is obtained, and then calculate the degree of conformity between the k feature representations E′ kj learned by this node and the intent category prototype vectors we set,
[0087]
[0088] where, is the cosine similarity, which can evaluate the similarity of two vectors; exp(·) is the exponential function. This formula represents the normalized distribution of the features representing K intent categories obtained after each node undergoes multi - layer GCN message passing, aggregation, and accumulation.
[0089] S107. Decouple the two sets of intention features of the two comparison views according to K latent factors, and perform K times of personalized comparison learning independently under different latent factors.
[0090] First, independently calculate the common contrast loss function under their respective intention features. A pair of positive examples (E kj , E′ kj ), where j represents the user or item node, and in the minibatch-sized sample data, other sample points except itself are used as negative columns. The score of the positive example sample, The scores of all negative columns, The contrast loss function based on a specific intention feature space Next, calculate the weight coefficients before the contrast loss corresponding to the K latent factors is fused into the loss corresponding to the unified feature. That is, the contribution of the feature vector information corresponding to different latent factors contained in each node to the final contrast learning loss is different, and it is related to the normalized probability distribution of the feature representations corresponding to the K latent factors decoupled and learned by a certain node, that is, the probability that this node has a certain intention vector. It is also related to whether the representation vector corresponding to this latent factor can accurately perform the contrast learning task. That is, the subgraph structure of this node after enhancement may be inaccurate. If the feature information of the two perspectives is forced to be maximized, suboptimal effects will be produced. Therefore, define Measure the rationality of this contrast learning from a probability perspective, As the weight coefficient before the accumulation of the respective independent contrast losses of each node under the K intention categories, and finally the contrast loss function of each node
[0091] The total loss function That is, the sum of the contrast losses on the user and item sides.
[0092] S108. Concatenate and combine the K intention features as the predicted user and item features, and introduce an unsupervised learning task based on maximizing mutual information by using the graph structure information of the social relationship graph and the item attribute graph.
[0093] Utilize the progressive graph structure information from the node to the subgraph centered on the node and then to the global graph to generate a hierarchical mutual information maximization learning paradigm, and more finely mine the graph structure information to further optimize the learning of node features.
[0094] S109. Jointly learn the recommendation task with the multi-intention personalized contrast learning task and the task of maximizing the mutual information based on the graph structure.
[0095] The final features of the user and item are: E u ={E 1u , E 2u,..., E ku}, E u ={E 1u , E 2u ,..., E ku}, the supervised loss L of the recommendation task is obtained using the BPRLoss loss function bpr , which is added to the unsupervised loss to obtain the final model loss:
[0096]
[0097] In the formula, μ and are hyperparameters and serve as the balance factor for the unsupervised task loss.
[0098] Using the gradient descent method, update the parameters of the model until the loss function reaches the preset threshold.
[0099] S110. Score and predict the user and item embedding vectors finally learned by the model to obtain the recommended item order.
[0100] Embodiment 2
[0101] As Figure 2 shown, this embodiment provides a recommendation method based on a graph convolutional neural network with vector representations corresponding to multiple hidden factors for decoupled users and items, including the following steps:
[0102] S201. Acquisition and processing of the dataset: Collect a dataset containing user-item interaction relationships, user social relationships, and item attribute relationships in an e-commerce platform, and then perform certain preprocessing to obtain the required dataset.
[0103] After obtaining the selected dataset, it also includes the steps of preprocessing the dataset, including:
[0104] Filter out invalid users according to the condition that the number of user-item interactions is greater than or equal to 3, and retain the nodes of valid users and corresponding interaction items. Divide the dataset, randomly select one interaction for the validation set and test set of each user, and the remaining interaction items are the training set. Finally, it is necessary to evaluate the prediction results, and negative sampling needs to be performed on the validation set and test set.
[0105] S202. Store the interaction relationships in the obtained dataset as graph structure data in the form of a sparse matrix. Additionally, to incorporate auxiliary information into the interaction relationship recommendation prediction, further process the social relationships and attribute relationships according to the settings required by the model. To inject the social relationships in the dataset into the information of purchasing behavior, if the number of the same products purchased between two friends is greater than a certain threshold, we consider that they may be connected due to a certain similar purchase intention and reconstruct a social relationship graph; if two products belonging to the same category are purchased by many of the same users, we consider that these two products may be connected because they contain a similar purchase intention and form a new product attribute relationship graph; the additional generated supervision signals can further learn the feature vectors corresponding to multiple factors learned by the model.
[0106] S203. Construction of the enhanced views corresponding to K latent factors.
[0107] According to the representation vectors corresponding to the latent factors of users and products under each intention, splice the feature vectors of the two end nodes of the interaction edges on the original user-product bipartite graph to obtain the feature of the edge, then send it into the MLP network to obtain a single value, and then perform the reparameterization operation to calculate the probability value of the edge. Drop the edges with values less than the threshold to obtain the enhanced views of different latent intention subspaces.
[0108] S204. Feature encoding of nodes in K intention subspaces.
[0109] The K intention vectors obtained by decoupling the nodes are respectively aggregated and updated with neighbor information on the K GCN message passing channels to obtain the corresponding latent factor feature representations. At the same time, the node feature learning of the enhanced perspective also performs a similar operation to obtain another set of K latent intention representation vectors.
[0110] S205. Adaptive independent contrast learning of K intention subspaces.
[0111] Introduce the prototype vectors of K intention categories, and calculate the normalized probability distribution of the K decoupled intention representations of the updated nodes belonging to a certain intention category, indicating whether this node has learned the intention of a certain latent factor category.
[0112] Perform contrast learning on the intention representation vectors learned in the K latent factor spaces respectively. Divide the positive example score by all negative example scores to calculate the probability that this node needs to participate in the contrast loss task, and multiply it by the probability that the learned intention feature belongs to this latent factor category to obtain the weight coefficients before accumulating the contrast loss functions of the K intention subspaces, which can achieve more fine-grained and personalized feature contrast learning.
[0113] S206. Introduce the supervision signals of the pre-processed user-user social relationship (uu) and product-product (ii) attribute relationship, and splice the decoupled and learned intention features again. The obtained user features and product features are then used to maximize the hierarchical mutual information, that is, the spliced user and product features are respectively used on the uu graph and the ii graph to hierarchically maximize the mutual information between the feature of the node and the feature aggregation of the subgraph centered on the node, and the mutual information between the feature aggregation of the subgraph centered on the node and the global graph representation, so as to utilize the structural information of the node, subgraph and global graph to add additional supervision signals and better learn the node features.
[0114] S207. Jointly train the recommendation task and the unsupervised task.
[0115] Splice the K segments of intention features together to form user-product features, calculate the positive and negative sample scores by using the inner product method, calculate the recommendation task loss based on the BPR loss, jointly with the above-mentioned contrast loss task and mutual information maximization task, and use the gradient descent method to continuously train and optimize the model to obtain the model parameters with the best recommendation performance.
[0116] S208. Recommendation prediction: Score and predict the user and product embedding vectors finally learned by the model to obtain the recommended product order.
[0117] Embodiment III
[0118] As Figure 2 and Figure 3 shown, this embodiment provides a multi-intention recommendation model based on graph contrast learning. First, divide, preprocess, and construct the relationship graphs of product interaction, user social interaction, and product attributes for the obtained data set into a training set, a validation set, and a test set; decouple K feature intention blocks of users and products; use the MLP parameter network to learn and enhance to obtain another contrast view; perform feature learning respectively in K GCN message encoding channels, and introduce adaptive contrast learning to perform feature personalization learning on the representation vectors corresponding to K intention factors; for the features composed of splicing K intention feature blocks, further use the hierarchical graph structure information of the auxiliary relationship graphs uu and ii to perform a more fine-grained unsupervised learning task of mutual information maximization, enhance feature learning, obtain high-quality node feature representations, and perform the final recommendation prediction. The method specifically includes the following steps:
[0119] S301. Construct a data set, obtain a data set with social relationships, interaction records, and product category information under each Internet platform, and further filter, divide, and perform random negative sampling.
[0120] After the dataset is obtained, the present invention does not involve the research on the cold start problem. Therefore, in order to ensure the quality of the data, users with less than three interactions in the dataset are excluded. Subsequently, the interaction data of each user is divided, and one interaction record is randomly selected as the validation and test sets respectively, and the rest are used as the training set. In order to verify and test the recommendation prediction effect of the model, random negative sampling is performed on the validation set and the test set according to the positive and negative samples of 1:99.
[0121] S302. Data preparation and construction of the auxiliary relationship graph: In order to introduce the implicitly existing social relationship and commodity attribute relationship into the user's purchase behavior information and have an effective auxiliary effect on the main research object of the model, the social relationship and commodity attribute relationship are reconstructed according to whether they have similar intentions. If the number of overlapping purchases of two users with a friend relationship is greater than the set threshold, it is considered that they are connected due to some similar intentions; similarly, if the number of users who purchase two commodities belonging to the same category is greater than the set threshold, they are regarded as having a connection due to containing similar user intentions. The processed social relationship, commodity attribute relationship and interaction relationship data are stored in a graph structure. Construction of the contrast view: Using the feature input parameter of the edge, the importance probability of the edge is output through the MLP transformation network, and the edges with probability values less than the set threshold are dropped to obtain the enhanced view corresponding to different intentions.
[0122] S303. Learning of the K-segment intention feature vector of the node
[0123] The input intention feature vector x i , through the parameter mapping matrix W k specific to the intention GCN channel, is non-linearly mapped to the intention subspace and normalized:
[0124] e i,k = L2_norm(σ(W k x i + b k ))
[0125] Among them, L2_norm divides a certain dimension by the corresponding 2 number of that dimension; W k and b k are the weight parameter and bias of the mapping; σ is the activation function.
[0126] The intention features of the user and commodity corresponding to the corresponding latent factors are respectively aggregated by transmitting the K independent neighbor information in the original bipartite graph and the enhanced graph, and two groups of K latent intention feature representations are obtained.
[0127] S304. Adaptive contrast learning.
[0128] Under K different intent subspaces, according to the probability distribution of the K prototype intent semantic information contained in the intent representation decoupled from the nodes and the positive and negative example score ratios corresponding to the decoupled features of two perspectives under a certain intent of the nodes obtained according to the formula of InfoNCE loss, calculate the probability distribution of whether each decoupled feature is suitable for contrastive learning, and obtain the sum of the contrastive loss functions under the K latent factors of each node.
[0129] S305. Unsupervised learning for maximizing graph mutual information.
[0130] Concatenate the K intent features learned by the above decoupling to obtain the complete user and commodity features, and learn the structural information between each sub-structure of the graph in a more fine-grained manner according to the hierarchical graph structure form of the node features, sub-graph features centered on the node, and global graph features designed by the present invention. Construct two progressive optimization objectives for maximizing mutual information between the node feature representation and the sub-graph feature, and between the sub-graph feature and the global graph representation to further strengthen the learning of the node features.
[0131] S306. Recommendation prediction.
[0132] Finally, the model outputs comprehensive user and commodity embedding vectors, obtains the supervised loss of the recommendation task using the BPRLoss loss function, adds it to the above unsupervised loss to obtain the final model loss, uses the gradient descent method to calculate the gradient of the loss with respect to each parameter, and backpropagates it into the network to continuously update the model parameters. In the test stage, according to the user and commodity representation vectors finally updated and calculated by the model, perform performance evaluation on the prepared test data for recommendation. Generally, a score sequence is obtained from the similarity of each pair of user and commodity embedding vectors, arranged in descending order, and the commodity corresponding to the prediction result with the largest value is the commodity with the strongest user preference. The hit rate can be represented by whether there is a positive example commodity among the top 10 commodities. If it hits, find out which position this commodity is in the top 10 to further calculate the prediction accuracy, and use the early stopping algorithm to decide whether to perform the next round of training. Until the recommendation prediction effect is optimal to complete the model training, and then accurate prediction can be performed to recommend a list of commodities that the user may like.
[0133] In summary, the method of this embodiment has the following advantages and beneficial effects compared with the prior art:
[0134] (1) In the present invention, the user and commodity features are decoupled to distinguish the decisive latent factors behind the interaction behaviors, and independent encoding is performed through K GCN message passing channels under K latent factor subspaces.
[0135] (2) In the present invention, the data augmentation method is not the traditional random drop method, but rather a MLP transformation based on the decoupled features of users and commodities corresponding to each latent factor, and a contrast view is constructed based on the importance of the interaction edges under this intended semantics.
[0136] (3) In the present invention, the existing UU and II relationship data in the dataset is not directly used. Instead, interaction behavior information is introduced on the original relationship to screen the data edges, forming new UU and II relationship graphs containing interaction behavior information. Finally, the mutual information maximization between fine-grained graph structures is adopted, rather than the traditional method of mutual information maximization between node-level and global graphs that will result in information loss.
[0137] (4) For contrastive learning based on multi-intent features, it is pairwise contrastive learning between K intents, that is, it is considered that the K decoupled features essentially have similar semantic information. In the present invention, graph contrastive learning is independently performed in each intent subspace, which is helpful for further learning of the decoupled representation based on GCN feature extraction.
[0138] (5) By introducing multi-intent decomposition and latent factor prototype intent vectors, the present invention calculates the normalized probability distribution of the latent factor semantic intent represented by the decoupled features learned by each node and the normalized probability distribution of the calculated contrast loss function values through the concept of probability distribution to determine the coefficient before the accumulation of the contrast loss function in each latent factor feature space, and obtains the final complete loss function value.
[0139] This embodiment also provides a multi-intent recommendation device based on graph contrastive learning, including:
[0140] At least one processor;
[0141] At least one memory for storing at least one program;
[0142] When the at least one program is executed by the at least one processor, the at least one processor implements the method as Figure 1 shown.
[0143] A multi-intent recommendation device based on graph contrastive learning in this embodiment can execute a multi-intent recommendation method based on graph contrastive learning provided by the method embodiment of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
[0144] Embodiments of the present application also disclose a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to execute Figure 1 the method shown.
[0145] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order mentioned in the operation diagrams. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowcharts of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated, where the order of various operations is changed and where sub-operations described as part of a larger operation are executed independently.
[0146] Furthermore, although the present invention has been described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features described may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It can also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. Rather, given the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the modules will be understood within the ordinary skill of an engineer. Therefore, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It can also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0147] When the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0148] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
[0149] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, then editing, interpreting, or otherwise processing it as appropriate, and then storing it in a computer memory.
[0150] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0151] In the above description of this specification, descriptions with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0152] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and purposes of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
[0153] The above is a specific description of the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A multi-intent recommendation method based on graph contrast learning, characterized in that, it includes the following steps: Collect a data set with user social relationships, commodity attribute relationships, and user-commodity interaction relationships; Store the data of user social relationships, commodity attribute relationships, and user-commodity interaction relationships in the form of a sparse graph structure to obtain graph structure data that can be used in a graph convolutional neural network model; Based on the original social relationship and commodity attribute relationship, introduce the behavior of users purchasing commodities to form a new social relationship graph and commodity attribute graph; Based on K decoupled latent factor intent representations, construct corresponding contrast views, and through a learnable drop method, Generate a parameterized enhanced UI graph; Perform learning on the decoupled features of the recommendation model, establish K GCN message passing channels, and perform feature encoding respectively. At the same time, each GCN channel learns two sets of features on the original user-commodity interaction bipartite graph and the enhanced user-commodity bipartite graph respectively; Introduce K intent prototype vectors to learn the distribution of multiple intent features of each node on the UI graph; Perform K times of personalized contrast learning on the two contrast views separately according to the two sets of intent features decoupled by K latent hidden factors under different latent factors; Concatenate and combine the K intent features as the predicted user and commodity features, utilize the graph structure information of the social relationship graph and commodity attribute graph, and introduce an unsupervised learning task based on maximizing mutual information; Jointly learn the recommendation task, the multi-intent personalized contrast learning task, and the task of maximizing graph structure mutual information; Score and predict the user and commodity embedding vectors finally learned by the model to obtain the recommended commodity order.
2. The multi-intent recommendation method based on graph contrast learning according to claim 1, characterized in that, the multi-intent recommendation method further includes the step of preprocessing the obtained data set: Filter invalid users according to the preset conditions of the model, and retain valid users and corresponding commodity nodes; Divide the data set, and randomly select one interaction for the validation set and test set of each user, and the remaining interaction items are used as the training set.
3. The multi-intent recommendation method based on graph contrast learning according to claim 1, characterized in that, the introduction of the behavior of users purchasing commodities based on the original social relationship and commodity attribute relationship to form a new social relationship graph and commodity attribute graph includes: To incorporate auxiliary information into the prediction of interactive behavior recommendations, the social relationships and attribute relationships are further processed according to the settings required by the model, as follows: Inject the social relationships and product attribute relationships in the dataset into the user's product purchase behavior information; If the number of products purchased by two friends is greater than a preset threshold, it is determined that they may be connected due to a certain similar purchase intention, and a new social relationship graph is reconstructed; If two products belonging to the same category are purchased by many of the same users, it is determined that these two products may be connected due to a certain similar purchase intention, and a new product attribute relationship graph is formed; Use the supervision signals generated by the fine-grained hierarchical graph structure information to further learn the feature vectors corresponding to multiple factors learned by the model.
4. A multi-intention recommendation method based on graph contrast learning according to claim 1, wherein, constructing corresponding contrast views based on the intention representations of K decoupled latent factors, and generating a parameterized enhanced UI graph through a learnable drop method, including: In each intent factor scenario, the probability ω of whether each edge on the interaction relationship graph corresponding to K latent factors is deleted is calculated in a parameterized manner k_ui , ω k_ui = MLP(Concat[u k , v k ) Among them, MLP is a multi-layer perceptron, and Concat represents concatenating two feature vectors; u k and v k are respectively the user node feature and the product node feature of a UI interaction edge on the graph corresponding to the Kth latent factor; To optimize the learning of the graph structure and learn in an end-to-end manner, the reparameterization trick is adopted, expressed as: ρ = σ((log ∈ - log(1 - ∈) + ω k_ui ) / τ) where ∈ follows a uniform distribution of (0,1); τ>0, which is the temperature coefficient; σ(.) is the activation function; After calculating the existence probability of each edge, delete the edges with probabilities less than the preset threshold, retain the other edges, and obtain a new enhanced graph G' after dropping k_ui ; Input the node features (u k , v k ) to enhance the graph G′ k_ui into the GCN encoder with shared parameters. After L-layer message passing for aggregation and accumulation, obtain the final user features E′ ku under multiple intents and the item features E′ ki .
5. A multi-intention recommendation method based on graph contrast learning according to claim 1, wherein, learning the decoupled features of the recommendation model includes: The features of the user and the commodity are segmented into K feature blocks, i.e., u = (u 1 , u 2 , …, u k ), v = (v 1 , v 2 , …, v k ), where u k , v k ∈ R d / k . There is a one-to-one correspondence between the feature blocks and the intents, and there is also a one-to-one correspondence between each intent block of the user and each intent block of the commodity (u k , v k ); among them, R d / k is a real number space with a dimension of d / k; Graph Convolutional Neural Network Message Passing Model GCN Based on Each Intent Factor k , input the node features (u k , v k ) of the user's commodity, input the bipartite graph G ui , and through L-layer message passing aggregation and accumulation, obtain the final user features E ku under multiple intents and the commodity features E ki .
6. A multi-intention recommendation method based on graph contrast learning according to claim 1, wherein, Introducing K intention prototype vectors including: After aggregating neighbor information or high-order information on their respective enhanced graphs for the k feature blocks of a certain node, the feature representation under each potential intention factor is obtained, and the k decoupled feature representations E learned by this node are calculated. ′ kj The degree of conformity with the set intention category prototype vector: Among them, is the cosine similarity, which evaluates the similarity between two vectors; E′ kj is the k-th decoupled feature representation of node j on the graph, and c k is the k-th intention prototype vector introduced by the model; exp(·) is the exponential function; P k represents the normalized distribution of the features representing K intention categories obtained after each node passes through multi-layer GCN message passing aggregation.
7. A multi-intention recommendation method based on graph contrast learning according to claim 1, wherein, independently performing K times of personalized contrast learning on the two contrast views according to the two groups of intention features decoupled by K latent hidden factors under different latent factors, including: Independently calculate the contrastive loss function under their respective intention features. A pair of positive examples (E kj , E' kj ), in the minibatch-sized sample data, other sample points except itself are used as negative columns, and j represents the user or item node; Positive example sample score: Scores of all negative columns: Contrastive loss function based on the intent feature space Among them, is the cosine similarity, E kj is the k-th decoupled feature representation of node j on the original graph, E' kj is the k-th decoupled feature representation of node j on the self-enhanced graph; Calculate the contrastive loss corresponding to K latent factors, and then fuse it into the weight coefficient before the loss corresponding to the unified feature, and define Measure the rationality of this contrastive learning from a probabilistic perspective, As the weight coefficient before the accumulation of the respective independent contrastive losses under the K intention categories of each node, and finally the contrastive loss function of each node Total loss function That is, the sum of the contrast losses on the user side and the product side; where α and β are the balance coefficients of the contrast loss functions on the user side and the product side; m is the number of users, and n is the number of products.
8. A multi-intention recommendation method based on graph contrast learning according to claim 1, wherein, using the graph structure information of the social relationship graph and the product attribute graph, introducing an unsupervised learning task based on maximizing mutual information, including: Using the progressive graph structure information from the node to the subgraph centered on the node to the global graph, generating a hierarchical mutual information maximization learning paradigm to more finely mine the graph structure information and further optimize the learning of node features.
9. A multi-intention recommendation method based on graph contrast learning according to claim 1, wherein, jointly learning the recommendation task with the multi-intention personalized contrast learning task and the task of maximizing the mutual information based on the graph structure includes: The characteristics of the end - user and the commodity are: E u ={E 1u, E 2u ,…,E ku}, E v ={E 1v, E 2v ,…,E kv}, and the supervised loss L bpr of the recommendation task is obtained using the BPRLoss loss function and added to the unsupervised loss to obtain the final model loss: where μ and are hyperparameters and serve as the balancing factor for the unsupervised task loss; L MI is the graph mutual information maximization loss function; using the gradient descent method, update the parameters of the model until the loss function reaches a preset threshold; L cl is the total loss function.
10. A multi-intention recommendation device based on graph contrast learning, wherein, comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
Recommendation method based on self-supervised graph representation learning
CN112925977A
MOOC recommendation method based on graph convolutional neural network
CN114154070A