A negative sample optimized contrastive learning recommendation method with dual-view alignment

Through dual-view alignment and contrastive learning methods, user and item embeddings are optimized, cold start and sparsity problems in the recommendation system are solved, the diversity and accuracy of recommendations are improved, and the user experience is improved.

CN118521386BActive Publication Date: 2024-10-18SHANGHAI DEWU INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410994623.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-18
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing recommendation systems face challenges such as the cold start problem, data sparsity, long-tail distribution, and the balance between diversity and accuracy, which affect performance and user experience.

Method used

Adopt dual-view aligned negative sample optimization contrastive learning recommendation method. By building a deep learning module, including graph convolutional neural network, view alignment module, negative sample optimizer and contrastive learning module, the user item bipartite graph is used for feature extraction and alignment. , combined with adaptive noise and contrastive learning loss, optimizes the embedding of users and items, improving the accuracy and personalization of recommendations.

Benefits of technology

Through dual-view alignment and contrastive learning, the quality of user and item embeddings is improved, high-order structural information is captured, data sparsity and cold start problems are solved, the diversity and accuracy of recommendations are enhanced, recommendation bias is reduced, and recommendation accuracy is improved. User satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521386B_ABST
    Figure CN118521386B_ABST
Patent Text Reader

Abstract

The present invention discloses a negative sample optimization contrastive learning recommendation method for dual-view alignment, comprising the following steps: constructing a user-item bipartite graph, using the user-item bipartite graph to construct a dual view, aligning the node embedding of the user and the node embedding of the item in the dual view to obtain the aligned dual view; using a negative sample optimizer to optimize the positive samples and negative samples of the user and the item; inputting the optimized samples and the aligned dual view into a contrastive learning module, using contrastive learning loss and Bayesian personalized sorting contrast loss, training a graph convolutional neural network (GCN) by comparing the similarity between positive samples and negative samples, and applying the trained deep learning model in practice; the present invention adopts a dual-view alignment strategy, and performs feature extraction, convolution operation and alignment adjustment on user and item views, so that they are closer in the embedding space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of neural network technology, and in particular to a negative sample optimization contrast learning recommendation method for dual-view alignment. Background Art

[0002] With the explosive growth of data volume and the development of deep learning technology, recommendation systems have also experienced a transformation from traditional methods to deep learning-based methods. Deep learning technologies, such as the addition of graph neural networks (GNNs) and contrastive learning, have brought new opportunities and challenges to recommendation systems. They can effectively capture the complex interactions and implicit relationships between users and items, thereby improving the accuracy and personalization of recommendations; currently, we usually divide the recommendation algorithms in recommendation systems into three categories: content-based recommendation algorithms, collaborative filtering-based recommendation algorithms, and hybrid recommendation algorithms.

[0003] The content-based recommendation algorithm is based on a basic assumption: "Users may like items that are similar to items they have liked before." It calculates the similarity between the set of items for which the user has given explicit feedback (ratings, likes, etc.) and implicit feedback (searches, clicks, purchases, etc.) and all items by modeling, and sorts them into a recommended list according to the degree of similarity. And time factors, location factors, and recommendation scenario factors can be considered to optimize the recommendation results. In addition, statistical and machine learning methods can be used to model and learn user preferences from user historical feedback data, replacing traditional methods of calculating similarity. The main advantage of content-based recommendation methods is that they can solve the problem of cold start of new items and are not affected by sparsity; the recommendation results have good interpretability. Its disadvantages are that complex feature engineering is required to construct the features of item attributes, otherwise it will seriously affect the recommendation results; lack of diversity, the recommendation results will be highly similar to items that the user has given explicit and implicit feedback; cold start problem for new users;

[0004] The recommendation algorithm based on collaborative filtering is the most successful recommendation method currently used. It uses the feedback data of user and item history to mine the correlation between users and items themselves, and makes recommendations based on this. Specifically, this type of method can be divided into three categories: user-based recommendation, item-based recommendation, and model-based recommendation. The user-based collaborative filtering method is based on the assumption that "a user may like items that are liked by similar users to him". The similarity between users is calculated through the user's historical feedback records, and the feedback of similar users on items is used to predict the feedback of the corresponding user and make recommendations. The main advantage of this type of method is that it avoids the feature mining of the item's own attributes. The disadvantage is that when the number of users changes greatly, the algorithm efficiency is low and faces the cold start problem of new users. The item-based collaborative filtering method is similar to the content-based recommendation algorithm. The difference is that it uses the data of item history feedback to judge the similarity between items. Its advantage is that the calculation is simple, because the change of item feedback results is much lower than that of users. Compared with the user-based collaborative filtering algorithm, it can be completed through offline calculation and regular update. Its disadvantage is that it cannot recommend new items to users without updating item similarity offline. The model-based collaborative filtering method is designed to solve the problem of data sparseness and difficulty in returning instant results on a large data scale faced by collaborative filtering methods based on users and items. It uses machine learning methods to train a pre-trained model based on historical data, so that any user's preference for a certain item can be predicted in real time;

[0005] Hybrid recommendation algorithm refers to the combination of multiple recommendation technologies to make up for each other's shortcomings. The hybrid methods include simple weighted fusion, switching, and mixing of recommendation results, feature combination of different data sources, complex multi-model cascading, feature increment, and meta-level mixing. Among them, the most common hybrid recommendation system is to combine collaborative filtering recommendation methods with other recommendation methods to solve problems such as cold start and sparsity. In addition, the advantage of hybrid recommendation systems is that they can customize modeling for specific recommendation scenarios, thereby making reasonable and effective use of additional data information.

[0006] Current recommendation systems still face a series of challenges and problems. For example, cold start problems, data sparsity, long-tail distribution, and the balance between diversity and accuracy all affect the performance and effectiveness of recommendation systems. Therefore, how to effectively solve these problems and improve the performance and user experience of recommendation systems remains an important direction and challenge for the research and application of recommendation systems. Summary of the invention

[0007] In view of the shortcomings of the prior art, the present invention provides a negative sample optimization contrast learning recommendation method for dual-view alignment, which aims to solve the problems mentioned in the background technology.

[0008] To achieve the above object, the present invention provides the following technical solution: a negative sample optimization contrast learning recommendation method for dual-view alignment, comprising the following steps:

[0009] Step S1: construct a deep learning module, which consists of a multi-layer graph convolutional neural network GCN, a view alignment module, a negative sample optimizer and a contrastive learning module. The graph convolutional neural network GCN and the view alignment module are in parallel structure and data is interactive, and the negative sample optimizer and the contrastive learning module are in serial structure in sequence;

[0010] Step S2: construct a user-item bipartite graph, which includes user nodes and item nodes. The edges of the user-item bipartite graph represent the interaction between users and items. The user-item bipartite graph is used to construct a user-item interaction matrix, where each row of the user-item interaction matrix represents a user, each column represents an item, and the value of the user-item interaction matrix represents the degree of interaction between users and items.

[0011] Step S3: Input the user-item bipartite graph into the graph convolutional neural network to construct a dual view; specifically, input the embedding representation of the user-item interaction matrix into the graph convolutional neural network GCN, in each layer of the graph convolutional neural network GCN, update the user node embedding and the item node embedding by aggregating the neighbor information of each user's node and the item's node, normalize the updated user node embedding and item node embedding to obtain the neighborhood aggregated node embedding, and at the same time, add the initial user node embedding and item node embedding information through jump connections, then aggregate the output of each layer of the graph convolutional neural network GCN to obtain an original view, add adaptive noise to the original view as data enhancement to obtain an enhanced view, and combine the original view and the enhanced view to form a dual view;

[0012] Step S4: aligning the node embedding of the user and the node embedding of the object in the dual view through a view alignment module to obtain an aligned dual view;

[0013] Step S5: extracting positive samples and negative samples of users and objects from the aligned dual views, and optimizing the positive samples and negative samples of users and objects using a negative sample optimizer;

[0014] Step S6: Input the optimized positive and negative samples of users and items into the contrastive learning module, rank the positive and negative samples of users and items by using Bayesian personalized sorting, and train the graph convolutional neural network GCN by maximizing the mutual information between the positive and negative samples of users and items using joint contrastive learning loss. After the training is completed, a trained deep learning model is obtained, and the trained deep learning model is put into practical application.

[0015] Furthermore, the specific process of step S4 is as follows:

[0016] Step S4.1: First, the Euclidean distance is used to measure the difference between the node embedding of the user and the node embedding of the item in the dual view. The difference is then normalized by the L2 norm, the distance value of the difference is converted into an exponential form, and the average is taken. The average is then processed by natural logarithm to obtain a uniformity loss value. The uniformity loss value is used to evenly distribute the node embedding of the user and the node embedding of the item in the representation space.

[0017] Furthermore, in step S3, the embedding representation of the user-item interaction matrix is ​​input into the graph convolutional neural network GCN. In each layer of the graph convolutional neural network GCN, the node embedding of the user and the node embedding of the item are updated by aggregating the neighbor information of each user's node and the node of the item. The specific process is as follows: In the aggregation process of each layer of the graph convolutional neural network GCN, the neighborhood aggregation method is used to update the node embedding of the user and the node embedding of the item; specifically, for each user The original node embedding And every item The original node embedding Weighted average of neighboring node embeddings: based on user The original node embedding and items The original node embedding The adjacent node embeddings of are normalized and expressed as:

[0018] (1);

[0019] (2);

[0020] In the formula, represents the original node embedding of the user; Represents the original node embedding of the item; Representation and User The nodes adjacent to the node; Representation and items The node adjacent to the user The original node embedding pass Embed Calculated; item The original node embedding pass Embed Calculated.

[0021] Furthermore, in step S3, the updated user node embedding and item node embedding are normalized to obtain the neighborhood aggregated node embedding, and at the same time, the initial user node embedding and item node embedding information are added through the jump connection. The specific process is as follows: the output of each layer of the graph convolutional neural network GCN, that is, the updated user node embedding and item node embedding, are normalized, and the initial user node embedding is added. and the initial item node embedding , through skip connections, we can obtain the user’s high-order node embedding and high-order node embeddings of items , expressed as:

[0022] (3);

[0023] (4);

[0024] In the formula, Represents the high-order node embedding of the user after passing through the first layer of the graph convolutional neural network GCN; Represents the high-order node embedding of items after passing through the first layer of the graph convolutional neural network GCN; Represents the layers of the graph convolutional neural network GCN; represents the L2 norm.

[0025] Furthermore, in step S3, the specific process of adding adaptive noise to the original view as data enhancement to obtain the enhanced view is as follows: in the node embedding of the user in the original view and the node embeddings of items In the adaptive noise, the adaptive noise is based on and Adaptively generated, and multiplied by the hyperparameter λ to control the noise weight, expressed as:

[0026] (5);

[0027] (6);

[0028] In the formula, and Represent the node embedding of the user and the node embedding of the item in the original view respectively; and They represent the adaptive noise embedding obtained by the node embedding of the user and the node embedding of the item in the original view, and Represent the node embeddings of users and items in the augmented view, respectively.

[0029] Furthermore, the specific process of step S4.1 is: using the L2 norm to normalize the user's node embedding and the item's node embedding in the dual view, and normalizing the user's node embedding and the node embeddings of items The interaction is regarded as a positive pair. The similarity loss between the user's node embedding and the node embedding of the interacted item is optimized through two different losses. Specifically, the Euclidean distance is used to calculate the similarity loss between the user's node embedding and the node embedding of the interacted item, which is expressed as:

[0030] (7);

[0031] In the formula, represents the alignment loss from u to i; A collection of node embeddings representing users and items size; Indicates user Node embedding and items Node embedding The square of the Euclidean distance between them;

[0032] Use Euclidean distance to measure the difference between the normalized user node embedding and the item node embedding, capture the difference pattern, convert the distance value into exponential form, take the average of the exponential value, and finally perform natural logarithm processing on the average of the exponential value to obtain the uniformity loss value, which is expressed as:

[0033] (8);

[0034] (9);

[0035] In the formula, For user sets loss of uniformity; For item set loss of uniformity; Indicates except Node embedding of other users; Indicates except Node embedding of items other than ; and All represent normalization factors; express function; represents the base of the logarithm;

[0036] The alignment loss, i.e., the similarity loss, of the user node embedding and the item node embedding outputted by the same layer in the graph convolutional neural network GCN is combined by averaging, which is expressed as:

[0037] (10);

[0038] In the formula, represents the alignment loss; Represents the alignment loss of the user's node embedding and the item's node embedding output by the initial layer of the graph convolutional neural network GCN; Represents the alignment loss of the user's node embedding and the item's node embedding output by the Lth convolutional layer of the graph convolutional neural network GCN; Node embeddings representing the user in the initial layer of the graph convolutional neural network GCN; Node embeddings representing items in the initial layer of the graph convolutional neural network GCN; Represents the weight factor.

[0039] Furthermore, the specific process of step S5 is: the node embedding of the same pair of user and item in the aligned dual views is used as the positive sample of the user and item, the node embedding of the user and the item that has not interacted with the user in the aligned dual views is randomly extracted as the negative sample of the user and item, and weights are assigned to the positive samples of the item and user and the negative samples of the item and user respectively. The weights are calculated based on the relative importance of the positive samples of the item and user and the negative samples of the item and user. Subsequently, the cosine similarity measurement method is used to calculate the similarity scores between the positive samples of the user and the item and the negative samples of the user and the item, which is expressed as:

[0040] (11);

[0041] (12);

[0042] In the formula, Represents the dot product of vectors; Node embeddings representing positive examples of items; Node embeddings representing negative examples of items; Indicates the similarity between the user and the positive sample of the item; Represents the similarity between the user and the negative sample of the item; the Euclidean distance difference score is used and Comparing similarity scores : ;

[0043] according to and right and Rearrange it and express it as:

[0044] (13);

[0045] (14);

[0046] In the formula, and Represent the prediction scores of user-to-user positive and negative samples, and item-to-item positive and negative samples respectively; Represents a multi-layer perceptron MLP; is the Sigmoid function;

[0047] First, the multi-layer perceptron MLP uses its own linear layer and hidden layer to score the similarity A weighted sum is performed and a bias is added. The weighting is performed using a weight matrix. The bias and weight matrix are initialized with 0. After completion, the sigmoid function is used to map the output of the multi-layer perceptron MLP, that is, the weighted sum of the similarity scores of the linear layer and the hidden layer and the output obtained by adding the bias to the (0,1) interval as the attention weight. Subsequently, the attention weight is added to the prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples, respectively. Finally, L2 norm normalization is performed to obtain the final prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples.

[0048] Further, in step S6, the specific process of ranking the positive samples and negative samples of users and items by using the Bayesian personalized ranking contrast loss is as follows: by optimizing the positive samples and negative samples of users and items, accurate Samples and For samples, the Bayesian personalized ranking loss function is used. and The inner product calculation of and The final ranking score between ⊕ , expressed as:

[0049] (15);

[0050] In the formula, represents Bayesian personalized ranking; Represents a user; Represents items that the user interacts with; represents items that have not been interacted with by the user; o is the training data set, which is optimized by randomly selecting positive and negative samples of users and items.

[0051] Further, in step S6, the specific process of using contrastive learning loss to maximize the mutual information between the positive samples and negative samples of users and items is: using InfoNCELoss contrastive learning loss function to maximize the mutual information between the positive samples and negative samples of users and items, expressed as:

[0052] (16);

[0053] In the formula, represents the contrastive loss of the InfoNCELoss contrastive learning loss function; The nodes representing the same pair of users and items in the aligned dual views are embedded as positive samples of users and items. The node embeddings of different pairs of users and items in the aligned dual views are negative samples of users and items; S(·) represents the cosine similarity function, Represents the temperature coefficient.

[0054] Compared with the existing technology, the present invention has the following beneficial effects:

[0055] (1) The present invention adopts a dual-view alignment strategy to perform feature extraction, convolution operations and alignment adjustments on user and item views, making them closer in the embedding space, ensuring that the similarity and correlation between users and items can be accurately reflected, thereby providing better input for contrastive learning.

[0056] (2) The present invention introduces an adaptive noise mechanism into the multi-layer embedding of graph convolution. This mechanism can adjust the embedding information of each layer, so that the model can better capture the high-order structural information in the graph, which not only improves the quality of user-item embedding, but also enhances the depth and capability of the model.

[0057] (3) The present invention addresses the sparsity problem in the recommendation system by utilizing the high-order connectivity in the user-item bipartite graph. By performing convolution operations on these high-order connectivity, the complex relationship between users and items can be captured more comprehensively, thereby effectively solving the data sparsity problem and improving the coverage and accuracy of recommendations.

[0058] (4) To combat the false negative problem, the present invention introduces a weight comparison strategy that optimizes the model by combining the weights of positive and negative samples. This strategy can effectively identify and eliminate items that appear to be negative samples but are actually of potential interest, thereby reducing recommendation bias and improving the accuracy and personalization of recommendations.

[0059] (5) The present invention adopts a contrastive learning method to enhance the diversity of recommendations. By introducing contrastive loss during the training process, the model can learn the intrinsic relationship and similarity between users and items. This not only enhances the user satisfaction of the recommendation method, but also improves the long-tail effect of the recommendation and meets the user's broader interest needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a flow chart of the overall model structure of the present invention. DETAILED DESCRIPTION

[0061] like Figure 1 As shown, the present invention provides a technical solution: a negative sample optimization contrast learning recommendation method for dual-view alignment, comprising the following steps:

[0062] Step S1: construct a deep learning module, which consists of a three-layer graph convolutional neural network (GCN), a view alignment module, a negative sample optimizer and a contrastive learning module. The graph convolutional neural network (GCN) and the view alignment module are in parallel structure and data are interactive, and the negative sample optimizer and the contrastive learning module are in serial structure.

[0063] Step S2: Construct a user-item bipartite graph, which includes user nodes and item nodes. The edges of the user-item bipartite graph represent the interaction between users and items. The user-item bipartite graph is used to construct a user-item interaction matrix, where each row of the user-item interaction matrix represents a user, and each column represents an item. The value of the user-item interaction matrix represents the degree of interaction between users and items.

[0064] Step S3: Input the user-item bipartite graph into the graph convolutional neural network to construct a dual view; specifically, input the embedding representation of the user-item interaction matrix into the graph convolutional neural network (GCN), in each layer of the graph convolutional neural network (GCN), update the user's node embedding and the item's node embedding by aggregating the neighbor information of each user's node and the item's node, normalize the updated user's node embedding and item's node embedding to obtain neighborhood aggregated node embedding, and at the same time, add the initial user's node embedding and item's node embedding information through jump connections, then aggregate the output of each layer of the graph convolutional neural network (GCN) to obtain an original view, add adaptive noise to the original view as data enhancement to obtain an enhanced view, and combine the original view and the enhanced view to form a dual view.

[0065] Step S4: aligning the node embeddings of the user and the node embeddings of the item in the dual views through the view alignment module to obtain the aligned dual views; specifically, firstly using the Euclidean distance to measure the difference between the node embeddings of the user and the node embeddings of the item in the dual views, and then normalizing the difference through the L2 norm to more accurately capture the difference between the node embeddings of the user and the node embeddings of the item, converting the difference distance value into an exponential form, taking the average value, and then performing natural logarithm processing on the average value to obtain a uniformity loss value, and using the uniformity loss value to ensure that the node embeddings of the user and the node embeddings of the item are evenly distributed in the representation space and have good distinction, thereby improving the alignment effect.

[0066] Step S5: extracting positive samples and negative samples of users and items from the aligned dual views, and optimizing the positive samples and negative samples of users and items using a negative sample optimizer.

[0067] Step S6: Input the optimized positive and negative samples of users and items into the contrastive learning module, rank the positive and negative samples of users and items by using the Bayesian personalized ranking contrast loss, and use the contrastive learning loss to maximize the mutual information between the positive and negative samples of users and items to train the graph convolutional neural network GCN. After the training is completed, a trained deep learning model is obtained, and the trained deep learning model is put into practical application.

[0068] The Yelp, Epinions, and Ciao datasets were used to jointly train the trained deep learning model in a self-supervised learning manner. The Bayesian personalized ranking contrast loss and infoNCE loss function were used for training for 69 epochs. The learning rate was set to 0.001, and the model was optimized using the stochastic gradient descent algorithm (SGD). The optimal model parameters were saved after all training was completed. Finally, bigram prediction and evaluation were performed on the test set.

[0069] The specific process of step S3 is as follows:

[0070] Node embedding and updating: In the aggregation process of each layer, the graph convolutional neural network (GCN) uses the neighborhood aggregation method to update the user's node embedding and the item's node embedding; specifically, for each user The original node embedding And every item The original node embedding Weighted average of neighboring node embeddings: based on user The original node embedding and items The original node embedding The adjacent node embeddings of are normalized and can be expressed as:

[0071] (1);

[0072] (2);

[0073] In the formula, represents the original node embedding of the user; Represents the original node embedding of the item; Representation and User The nodes adjacent to the node; Representation and items The node adjacent to the user The original node embedding pass Embed Calculated; item The original node embedding pass Embed Calculated.

[0074] Multi-layer information aggregation method; normalize the output of each layer of the graph convolutional neural network (GCN) and add the initial user's node embedding and the initial item node embedding , through skip connections, we can obtain the user’s high-order node embedding and high-order node embeddings of items , embed the user's high-order nodes into and high-order node embeddings of items Node embedding as user of the original view and the node embeddings of items , which can be expressed as:

[0075] (3);

[0076] (4);

[0077] In the formula, Represents the high-order node embedding of the user after passing through the first layer of the graph convolutional neural network (GCN); Represents the high-order node embedding after the first layer of the graph convolutional neural network (GCN); Represents the level of a graph convolutional neural network (GCN). In this embodiment, Set to 3; Represents the L2 norm, which is used to normalize the embedding.

[0078] Adaptive noise data augmentation; node embeddings of users in the original view and the node embeddings of items In the example above, adaptive noise is added. The adaptive noise is based on the graph convolutional neural network (GCN). and Adaptively generated and multiplied by the hyperparameter λ to control the noise weight. In this example, the value of λ is set to 0.4, which can be expressed as:

[0079] (5);

[0080] (6);

[0081] In the formula, and Represent the node embedding of the user and the node embedding of the item in the original view respectively; and They represent the adaptive noise embedding obtained by the node embedding of the user and the node embedding of the item in the original view, and Represent the node embeddings of users and items in the augmented view, respectively.

[0082] The specific process of step S4 is as follows:

[0083] View similarity loss calculation; use the L2 norm to embed normalize the user’s node embedding and the item’s node embedding in the dual view, and normalize the user’s node embedding and the node embeddings of items The interaction is regarded as a positive pair. Two different losses are used to optimize the similarity loss between the user's node embedding and the node embedding of the interacted item. Specifically, the Euclidean distance is used to calculate the similarity loss between the user's node embedding and the node embedding of the interacted item, which can be expressed as:

[0084] (7);

[0085] In the formula, represents the alignment loss from u to i; A collection of node embeddings representing users and items size; Indicates user Node embedding and items Node embedding The square of the Euclidean distance between them is used to quantify the difference or proximity between the user's node embedding and the item's node embedding. The smaller this value is, the closer the node embeddings between the user and the item are, and the higher the similarity or correlation is.

[0086] Uniformity loss calculation: Use Euclidean distance to measure the difference between the normalized user node embedding and the item node embedding, capture the difference pattern, convert the distance value into exponential form, take the average of the exponential value, and finally perform natural logarithm processing on the average of the exponential value to obtain the uniformity loss value; the uniformity loss function helps to ensure that the user node embedding and the item node embedding are uniform and distinguishable in the representation space, which can be expressed as:

[0087] (8);

[0088] (9);

[0089] In the formula, For user sets loss of uniformity; For item set loss of uniformity; Indicates except Node embedding of other users; Indicates except Node embedding of items other than ; and Both represent normalization factors, which can standardize the node embedding of users and items and average the loss value; express Function, used to convert similarity value into loss value; Represents the base of the logarithm.

[0090] The alignment loss (similarity loss) of different layers has different relevance and influence range with the central node when the graph convolutional neural network is aggregated; first, the alignment loss of the user's node embedding and the item's node embedding output at the same layer in the graph convolutional neural network (GCN), that is, the similarity loss, is combined by the average value, which can be expressed as:

[0091] (10);

[0092] In the formula, represents the alignment loss; represents the alignment loss of the node embedding of users and the node embedding of items output by the initial layer of the graph convolutional neural network (GCN); represents the alignment loss of the node embedding of users and the node embedding of items output by the Lth convolutional layer of the graph convolutional neural network (GCN); Node embeddings of users representing the initial layers of a graph convolutional neural network (GCN); Node embeddings representing items in the initial layers of a graph convolutional neural network (GCN); represents the weight factor, when When , the relevant alignment loss is emphasized, and gradually less weight is assigned to the high-order alignment loss; when When , there is no difference between different layers; when When , the influence range is prioritized and more weight is assigned to the high-order alignment loss.

[0093] The specific process of step S5 is as follows:

[0094] The node embeddings of the same pair of users and items in the aligned dual views are used as positive samples of users and items, and the node embeddings of users and items that have not interacted with the user in the aligned dual views are randomly extracted as negative samples of users and items; weights are assigned to the positive samples of items and users and the negative samples of items and users, respectively, and these weights represent the importance of the positive samples of items and users and the negative samples of items and users in the training of the contrastive learning module; the weights are calculated based on the relative importance of the samples or other relevant indicators, and then the cosine similarity measurement method is used to calculate the similarity scores between the positive samples of users and items and the negative samples of users and items, which can be expressed as:

[0095] (11);

[0096] (12);

[0097] In the formula, Represents the dot product of vectors; Node embeddings representing positive examples of items; Node embeddings representing negative examples of items; Indicates the similarity between the user and the positive sample of the item; Represents the similarity between the user and the negative sample of the item; in order to redistribute the samples, the Euclidean distance difference score pair is used. and Comparing similarity scores : .

[0098] Sample redistribution; according to and right and Reordering to ensure that more relevant items come first can be expressed as:

[0099] (13);

[0100] (14);

[0101] In the formula, and They represent the prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples, respectively, and are used for subsequent contrastive learning loss training; represents a multi-layer perceptron (MLP), which is used to calculate the similarity gap between positive samples of users and items and negative samples of users and items, in preparation for outputting attention weights; is a Sigmoid function, which is used to map the input value to between 0 and 1. The output of the multi-layer perceptron (MLP) is converted into attention weights, which represent the similarity gap between the positive samples of users and items and the negative samples of users and items.

[0102] First, the multi-layer perceptron (MLP) uses its own linear layer and hidden layer to score the similarity Perform weighted summation and add bias. The weighting is done by weighting with a weight matrix. The bias and weight matrix are initialized with 0 to prevent gradient explosion. After completion, the sigmoid function is used to map the output of the multi-layer perceptron (MLP) (the output obtained by weighted summation of the similarity scores of the linear layer and the hidden layer and adding the bias) to the interval (0,1) as the attention weight. The attention weight is then added to the prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples, respectively. Finally, L2 norm normalization is performed to obtain the final prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples.

[0103] The specific process of step S6 is:

[0104] The contrastive learning module includes two operations: Bayesian personalized ranking contrastive loss and InfoNCELoss contrastive learning loss;

[0105] The goal of the Bayesian personalized ranking contrast loss is to rank the positive and negative samples of all items and the positive and negative samples of users, and predict which items the user may interact with next. The present invention optimizes the positive and negative samples of users and items to obtain more accurate user rankings. Positive and negative samples and items Positive samples and negative samples , in the Bayesian personalized ranking contrast loss, the user and items The final ranking score between is calculated by the inner product of their representations, i.e. , expressed as:

[0106] (15);

[0107] In the formula, represents the Bayesian personalized ranking contrast loss; represents the user; i represents the item that the user interacts with; j represents the item that the user does not interact with; o is the training data set, which is optimized by randomly selecting positive and negative samples of users and items.

[0108] The goal of InfoNCELoss contrastive learning loss is to maximize the mutual information between positive and negative samples of users and items, expressed as:

[0109] (16);

[0110] In the formula, represents the contrastive loss of InfoNCELoss contrastive learning loss; The nodes representing the same pair of users and items in the aligned dual views are embedded as positive samples of users and items. The nodes of the user and the items that the user has not interacted with in the aligned dual views are embedded as negative samples of the user and the item; S(·) represents the cosine similarity function, Represents the temperature coefficient, which is used to adjust the similarity between positive and negative samples.

[0111] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A negative sample optimization contrastive learning recommendation method based on dual-view alignment, characterized in that: The steps include: Step S1: construct a deep learning module, which consists of a multi-layer graph convolutional neural network GCN, a view alignment module, a negative sample optimizer and a contrastive learning module. The graph convolutional neural network GCN and the view alignment module are in parallel structure and data is interactive, and the negative sample optimizer and the contrastive learning module are in serial structure in sequence; Step S2: construct a user-item bipartite graph, which includes user nodes and item nodes. The edges of the user-item bipartite graph represent the interaction between users and items. The user-item bipartite graph is used to construct a user-item interaction matrix, where each row of the user-item interaction matrix represents a user, each column represents an item, and the value of the user-item interaction matrix represents the degree of interaction between users and items. Step S3: Input the user-item bipartite graph into the graph convolutional neural network to construct a dual view; specifically, input the embedding representation of the user-item interaction matrix into the graph convolutional neural network GCN, in each layer of the graph convolutional neural network GCN, update the user node embedding and the item node embedding by aggregating the neighbor information of each user's node and the item's node, normalize the updated user node embedding and item node embedding to obtain the neighborhood aggregated node embedding, and at the same time, add the initial user node embedding and item node embedding information through jump connections, then aggregate the output of each layer of the graph convolutional neural network GCN to obtain an original view, add adaptive noise to the original view as data enhancement to obtain an enhanced view, and combine the original view and the enhanced view to form a dual view; Step S4: aligning the node embedding of the user and the node embedding of the object in the dual view through a view alignment module to obtain an aligned dual view; Step S5: extracting positive samples and negative samples of users and objects from the aligned dual views, and optimizing the positive samples and negative samples of users and objects using a negative sample optimizer; Step S6: Input the optimized positive and negative samples of users and items into the contrastive learning module, rank the positive and negative samples of users and items by using Bayesian personalized sorting, and train the graph convolutional neural network GCN by maximizing the mutual information between the positive and negative samples of users and items by using joint contrastive learning loss. After the training is completed, a trained deep learning model is obtained, and the trained deep learning model is put into practical application; The specific process of step S4 is: Step S4.1: First, the Euclidean distance is used to measure the difference between the node embedding of the user and the node embedding of the item in the dual view, and then the difference is normalized by the L2 norm, the distance value of the difference is converted into an exponential form, and the average value is taken, and then the natural logarithm of the average value is processed to obtain a uniformity loss value, and the uniformity loss value is used to evenly distribute the node embedding of the user and the node embedding of the item in the representation space; In step S3, the embedding representation of the user-item interaction matrix is ​​input into the graph convolutional neural network GCN. In each layer of the graph convolutional neural network GCN, the node embedding of the user and the node embedding of the item are updated by aggregating the neighbor information of each user's node and the node embedding of the item. The specific process is as follows: In the aggregation process of each layer of the graph convolutional neural network GCN, the neighborhood aggregation method is used to update the node embedding of the user and the node embedding of the item; specifically, for each user The original node embedding And every item The original node embedding Weighted average of neighboring node embeddings: based on user The original node embedding and items The original node embedding The adjacent node embeddings of are normalized and expressed as: (1); (2); In the formula, represents the original node embedding of the user; Represents the original node embedding of the item; Representation and User The nodes adjacent to the node; Representation and items The node adjacent to the user The original node embedding pass Embed Calculated; item The original node embedding pass Embed Calculated; In step S3, the updated user node embedding and item node embedding are normalized to obtain the neighborhood aggregated node embedding, and at the same time, the initial user node embedding and item node embedding information are added through jump connections. The specific process is as follows: the output of each layer of the graph convolutional neural network GCN, that is, the updated user node embedding and item node embedding, are normalized, and the initial user node embedding is added. and the initial item node embedding , through skip connections, we can obtain the user’s high-order node embedding and high-order node embeddings of items , expressed as: (3); (4); In the formula, Represents the high-order node embedding of the user after passing through the first layer of the graph convolutional neural network GCN; Represents the high-order node embedding of items after passing through the first layer of the graph convolutional neural network GCN; Represents the layers of the graph convolutional neural network GCN; represents the L2 norm; In step S3, the specific process of adding adaptive noise to the original view as data enhancement to obtain the enhanced view is as follows: the node embedding of the user in the original view and the node embeddings of items In the adaptive noise, the adaptive noise is based on and Adaptively generated, and multiplied by the hyperparameter λ to control the noise weight, expressed as: (5); (6); In the formula, and Represent the node embedding of the user and the node embedding of the item in the original view respectively; and They represent the adaptive noise embedding obtained by the node embedding of the user and the node embedding of the item in the original view, and The node embeddings of users and items represent the augmented view respectively; The specific process of step S4.1 is: use the L2 norm to embed normalize the user's node embedding and the item's node embedding in the dual view, and normalize the user's node embedding and the node embeddings of items The interaction is regarded as a positive pair. The similarity loss between the user's node embedding and the node embedding of the interacted item is optimized through two different losses. Specifically, the Euclidean distance is used to calculate the similarity loss between the user's node embedding and the node embedding of the interacted item, which is expressed as: (7); In the formula, represents the alignment loss from u to i; A collection of node embeddings representing users and items size; Indicates user Node embedding and items Node embedding The square of the Euclidean distance between them; Use Euclidean distance to measure the difference between the normalized user node embedding and the item node embedding, capture the difference pattern, convert the distance value into exponential form, take the average of the exponential value, and finally perform natural logarithm processing on the average of the exponential value to obtain the uniformity loss value, which is expressed as: (8); (9); In the formula, For user sets loss of uniformity; For item set loss of uniformity; Indicates except Node embedding of other users; Indicates except Node embedding of items other than ; and All represent normalization factors; express function; represents the base of the logarithm; The alignment loss, i.e., the similarity loss, of the user node embedding and the item node embedding outputted by the same layer in the graph convolutional neural network GCN is combined by averaging, which is expressed as: (10); In the formula, represents the alignment loss; Represents the alignment loss of the user's node embedding and the item's node embedding output by the initial layer of the graph convolutional neural network GCN; Represents the alignment loss of the user's node embedding and the item's node embedding output by the Lth convolutional layer of the graph convolutional neural network GCN; Node embeddings representing the user in the initial layer of the graph convolutional neural network GCN; Node embeddings representing items in the initial layer of the graph convolutional neural network GCN; Represents the weight factor.

2. The method for negative sample optimization contrastive learning recommendation based on dual-view alignment according to claim 1, characterized in that: The specific process of step S5 is as follows: the node embeddings of the same pair of users and items in the aligned dual views are used as positive samples of users and items, and the node embeddings of users and items that have not interacted with the user in the aligned dual views are randomly selected as negative samples of users and items, and weights are assigned to the positive samples of items and users and the negative samples of items and users, respectively. The weights are calculated based on the relative importance of the positive samples of items and users and the negative samples of items and users. Subsequently, the cosine similarity measurement method is used to calculate the similarity scores between the positive samples of users and items and the negative samples of users and items, which are expressed as: (11); (12); In the formula, Represents the dot product of vectors; Node embeddings representing positive examples of items; Node embeddings representing negative examples of items; Indicates the similarity between the user and the positive sample of the item; Represents the similarity between the user and the negative sample of the item; the Euclidean distance difference score is used and Comparing similarity scores : ; according to and right and Rearrange it and express it as: (13); (14); In the formula, and Represent the prediction scores of user-to-user positive and negative samples, and item-to-item positive and negative samples respectively; Represents a multi-layer perceptron MLP; is the Sigmoid function; First, the multi-layer perceptron MLP uses its own linear layer and hidden layer to score the similarity A weighted sum is performed and a bias is added. The weighting is performed using a weight matrix. The bias and weight matrix are initialized with 0. After completion, the sigmoid function is used to map the output of the multi-layer perceptron MLP, that is, the weighted sum of the similarity scores of the linear layer and the hidden layer and the output obtained by adding the bias to the interval of 0, 1 as the attention weight. Subsequently, the attention weight is added to the prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples, respectively. Finally, L2 norm normalization is performed to obtain the final prediction scores of user-to-user positive and negative samples and item-to-item positive and negative samples.

3. The method for negative sample optimization contrastive learning recommendation based on dual-view alignment according to claim 2, characterized in that: In step S6, the specific process of ranking the positive samples and negative samples of users and items by using the Bayesian personalized ranking contrast loss is as follows: by optimizing the positive samples and negative samples of users and items, accurate Samples and For samples, the Bayesian personalized ranking loss function is used. and The inner product calculation of and The final ranking score between ⊕ , expressed as: (15); In the formula, represents Bayesian personalized ranking; Represents a user; Represents items that the user interacts with; represents items that have not been interacted with by the user; o is the training data set, which is optimized by randomly selecting positive and negative samples of users and items.

4. The method for negative sample optimization contrastive learning recommendation based on dual-view alignment according to claim 3, characterized in that: In step S6, the specific process of using contrastive learning loss to maximize the mutual information between the positive samples and negative samples of users and items is: using the InfoNCELoss contrastive learning loss function to maximize the mutual information between the positive samples and negative samples of users and items, expressed as: (16); In the formula, represents the contrastive loss of the InfoNCELoss contrastive learning loss function; The nodes representing the same pair of users and items in the aligned dual views are embedded as positive samples of users and items. The node embeddings of different pairs of users and items in the aligned dual views are negative samples of users and items; S(·) represents the cosine similarity function, Represents the temperature coefficient.

Citation Information

Patent Citations

  • GCN recommendation method based on comparative learning improvement

    CN116503137A

  • Recommendation method and system based on multi-hop neighbor negative sampling strategy

    CN117851673A