Negative sampling recommendation model based on conditional generative adversarial network

Through the design of the generative adversarial network model, the data imbalance and negative sample noise problems in the recommendation system are solved, personalized recommendations are achieved, and recommendation accuracy and user satisfaction are improved.

CN119066262APending Publication Date: 2024-12-03CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410931735.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Existing recommendation systems have data imbalance problems when processing user interaction data, especially the negative sample noise is high, which leads to the model being biased towards most categories, making it difficult to effectively learn user complex behaviors, affecting the accuracy of recommendations.

Method used

A model based on generative adversarial network was designed, and the modules for rating matrices of adversarial networks were divided through data collection, conditional generation adversarial network rating matrix, spy technology, reliable negative sample calculation and recommended result acquisition can effectively filter noise negative samples, predict user preferences, and form personalized Recommended list.

Benefits of technology

It improves the accuracy and user satisfaction of the recommendation system, enhances the ability to understand complex user behavior, effectively deals with data imbalance problems, and improves the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066262A_ABST
    Figure CN119066262A_ABST
Patent Text Reader

Abstract

The invention provides a negative sampling recommendation model based on a conditional generative adversarial network. The method comprises the following steps: firstly, acquiring a user item rating matrix R through data cleaning, and dividing the user item rating matrix R into implicit matrixes: a high-score matrix P and a low-score and non-score matrix U; a spy technology is used to add partial data in the P matrix as spy samples into the U matrix, so that the distinguishing capability of the discriminator is improved. Then, a generator obtains reliable negative samples through sorting, obtains the probability of the negative samples through conditional generative adversarial network training, selects high-probability negative samples to be input into a collaborative filtering generative adversarial network, and selects the same number of other negative samples to train and relieve the trivial solution problem; the negative sample processing strategy requires that the predicted values of other negative samples approach to a non-zero decimal, and the predicted value of strategy negative sampling approaches to 0. And finally, a recommendation result module sorts the predicted rating, pushes the first k items to the target user, and generates a personalized recommendation list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of recommendation technology, and in particular to a deep neural network recommendation model for predicting the probability of high-quality negative samples. Background Art

[0002] In the existing literature, traditional generative adversarial networks (GANs) are mainly used in the fields of image generation and enhancement, and rarely involve the field of negative sampling recommendation based on user rating data.

[0003] In recommendation systems, GANs can be used to enhance data sets, especially when data is sparse or significantly skewed. For example, the generator can generate a user's potential preference configuration, and the discriminator needs to determine whether these configurations can truly reflect the user's preferences. Negative sampling is usually used to deal with imbalance problems in user interaction data. For example, the number of items that users actually interact with and those that they do not interact with is very different, and the items that users do not interact with contain noise, which generally cannot truly reflect user preferences. They are not necessarily negative samples. Reasonable application of negative sampling can effectively avoid the model from being biased towards the majority class, and improving the ability to distinguish between positive and negative samples can help the model learn complex behaviors of users, thereby improving the generalization ability of the model. The application of the two technologies is an important means to improve system performance. By combining these technologies, we can more effectively deal with data imbalance problems and improve the model's ability to understand complex user behaviors. Therefore, it is particularly important to design a generative adversarial network model with discriminative positive and negative samples to further improve recommendation accuracy. Summary of the invention

[0004] In view of the above problems, the present invention proposes a generative adversarial network model capable of distinguishing positive and negative samples to help the recommendation system filter out negative samples with noise, including the following:

[0005] The data collection and preparation module is used to acquire and clean the data collected in the database to obtain the required information.

[0006] The conditional generative adversarial network rating matrix partitioning module is used to divide the user-item rating matrix R into two corresponding implicit matrices containing only 0-1 values ​​according to different rating values ​​set by the system. For example, the ratings of 4 and 5 points in the system are divided into the positive implicit matrix P, and the remaining low-rated and no-rated data are divided into the U matrix.

[0007] The spy technology module randomly takes 15% of the data in the P matrix as spy samples and adds them to the U matrix to enhance the discriminant ability of the discriminator. The subsequent generator will sort the predicted values ​​and extract reliable negative samples.

[0008] The reliable negative sample calculation module is used to use the sub-matrix obtained by cross-training in the conditional generative adversarial network to predict the probability of negative samples.

[0009] The reliable negative sample acquisition module sorts the negative sample probability values ​​predicted in the submatrix, selects negative samples with larger probabilities and inputs them into the collaborative filtering generative adversarial network. At the same time, it also selects other random negative samples of the same number for training to prevent mode collapse.

[0010] The negative sample processing module makes the predicted value of random negative samples close to a non-zero decimal and the predicted value of strategic negative sampling close to 0.

[0011] The recommendation result acquisition module is used to internally sort the retained predicted ratings with higher probabilities and push the top k items with higher predicted ratings to the target user to form a personalized recommendation list.

[0012] The conditional generative adversarial network rating matrix partitioning module of the present invention is used to divide the user-item rating matrix R into two corresponding implicit matrices containing only two values ​​of 0-1 according to different rating values ​​set by the system. The matrix setting rule is as follows: the high scores of 4 and 5 points in the data set are set as the P matrix, that is, the positive example matrix, and the remaining low score and no score matrices are set as the U matrix, that is, the unlabeled matrix.

[0013] The spy technology module described in the present invention randomly takes 15% of the score S matrix in the P matrix as spy samples and adds them to the U matrix. As spy samples, it is divided into three matrices, namely P_S matrix, U_S matrix and S matrix. The subsequent generator will sort the predicted values ​​to extract reliable negative samples.

[0014] The reliable negative sample calculation module is used to use the submatrix obtained by cross-training in the conditional generative adversarial network to predict the probability of negative samples. It specifically includes the following steps:

[0015] ①Conditional GAN ​​discriminator input layer, obtain the feature embedding vector p of item i i , and the conditional vector c i Put them together and pass them into the neural network.

[0016] z i =p i +c i

[0017] ②Conditional GAN ​​discriminator hidden layer, using the activation function ReLU to prevent the model from overfitting, and obtain the output l of all hidden layers n .

[0018] ReLU(z i )=max(0,z i )

[0019] l 1 =W 1 T z i

[0020] l n =ReLU(W 1 T l n-1 +b n ),n=2,...,X-1

[0021] Among them, W n and b n They represent the weight matrix and bias vector of the nth hidden layer respectively.

[0022] ③Conditional GAN ​​discriminator output layer, obtains the potential feature vector q of item i i , calculate the predicted rating probability of user u on item i:

[0023]

[0024] Among them, W out Represents the weight matrix of the vector; Sigmoid function σ(x) = 1 / (1+e -x ) is used to limit the output to the range (0,1).

[0025] ④Conditional GAN ​​generator input layer, input feature embedding vector z of item i i , passed into the neural network.

[0026] ⑤Conditional GAN ​​generator hidden layer, using the activation function ReLU to prevent the model from overfitting, and obtain the output l of all hidden layers n .

[0027] ReLU(z i )=max(0,z i )

[0028] l 1 =W 1 T z i

[0029] l n =ReLU(W 1 T l n-1 +b n ),n=2,...,X-1

[0030] Among them, W n and b nThey represent the weight matrix and bias vector of the nth hidden layer respectively.

[0031] ⑥Conditional GAN ​​generator output layer, obtain the potential feature vector q of item i i , put together with the conditional vector:

[0032]

[0033] Among them, W out Represents the weight matrix of the vector; Sigmoid function σ(x) = 1 / (1+e -x ) is used to limit the output to the range (0,1).

[0034] The reliable negative sample acquisition module of the present invention sorts the negative sample probability values ​​predicted in the submatrix, selects negative samples with higher probability and inputs them into the collaborative filtering generative adversarial network, and also selects other random negative samples of the same number for training to prevent mode collapse. The mean square error loss is used to stabilize the training.

[0035] The negative sample processing module of the present invention makes the predicted value of the random negative sample close to a decimal not equal to 0, and makes the predicted value of the strategic negative sampling close to 0.

[0036]

[0037] J G is the loss function of the generator, α and β are hyperparameters for adjusting the negative sampling weights to enhance the diversity of predicted values, represents the generator prediction value, e u represents the mask matrix, c u Represents the conditional vector, and the second and third terms of formula use the mean square error to make the negative sample prediction values ​​different.

[0038] The recommendation result acquisition module of the present invention is used to obtain the recommendation list of the target user u. It includes: each user selects an item with the most recent timestamp as a positive sample, then selects 99 items with no interaction as negative samples for recommendation, sorts the model prediction values ​​of these 100 items from large to small, sets the number of items to be recommended k, and if there is a user positive example in the first k recommended items, the recommendation is valid, so as to train and form a personalized recommendation list for the target user u.

[0039] The negative sample discrimination recommendation model based on generative adversarial network proposed in the present invention only uses the interaction relationship and rating information between users and items, without other auxiliary information to predict ratings. Therefore, the proposed system has good versatility and scalability. At the same time, the proposed system can further improve the recommendation accuracy and user satisfaction by discriminating the probability of positive and negative samples and retaining negative samples with higher reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a schematic diagram of the system process of the present invention;

[0041] Figure 2 It is a system framework diagram of the present invention;

[0042] Figure 3 This is a comparison of the HR@5, HR@10, NDCG@5 and NDCG@10 values ​​of the present invention with other methods in one data set. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, a negative sample discrimination recommendation model based on a generative adversarial network proposed by the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation method described herein is only used to explain the present invention and is not used to limit the present invention. Changes, modifications, additions, modifications or substitutions made by ordinary technicians in the technical field within the scope of the present invention should be included in the scope of the claims of the present invention.

[0044] Figure 1 Schematic diagram of the process of the negative sample discrimination recommendation model based on the generative adversarial network of the present invention. Figure 1 It can be seen that the negative sample discrimination recommendation model based on the generative adversarial network proposed in the present invention includes acquiring and cleaning data information from a database to obtain the required information; dividing the user-item rating matrix R into two corresponding implicit matrices containing only 0-1 values ​​according to different rating values ​​set by the system; using the conditional generative adversarial network model to cross-train the obtained sub-matrices to predict the probability values ​​of positive and negative samples in the data set; according to the negative sample probability values ​​obtained by training, inputting them into the collaborative filtering generative adversarial network for training according to a specific sampling strategy; sorting the output predicted score set, and pushing the top k items with higher predicted ratings to the target user to form their personalized recommendation list.

[0045] Figure 2 This is a framework diagram of the negative sample discrimination recommendation model based on the generative adversarial network of the present invention. Figure 2It can be seen that the negative sample discrimination recommendation model based on the generative adversarial network proposed in the present invention includes a data collection and preparation module, a conditional generative adversarial network rating matrix partitioning module, a spy technology module, a reliable negative sample calculation module, a reliable negative sample acquisition module, a negative sample processing module, and a recommendation result acquisition module. The data collection and preparation module is used to extract data from the database and perform operations such as cleaning and preprocessing on the data to obtain the required information; the conditional generative adversarial network rating matrix partitioning module is used to divide the user-item rating matrix R into two corresponding implicit matrices containing only 0-1 values ​​according to different rating values ​​set by the system. For example, the scores of 4 and 5 points in the system are divided into the positive implicit matrix P, and the remaining low-scoring and unscored parts are divided into the U matrix; the spy technology module randomly takes 15% of the scores in the P matrix as spy samples and adds them to the U matrix. As spy samples, the subsequent generator will sort the predicted values ​​to obtain reliable negative samples; the reliable negative sample calculation module is used to use the sub-matrix obtained by cross-training in the conditional generative adversarial network to predict the probability of negative samples; the reliable negative sample acquisition module sorts the negative sample probability values ​​predicted in the sub-matrix, selects negative samples with higher probability to input into the collaborative filtering generative adversarial network, and also selects other random negative samples of the same number for training to prevent mode collapse; the negative sample processing module makes the predicted value of the random negative sample approach a non-zero decimal, and the predicted value of the strategic negative sampling approach 0; the recommendation result acquisition module is used to internally sort the retained predicted ratings with higher probability, and push the top k items with higher predicted ratings to the target user to form his personalized recommendation list.

[0046] Further, the following situation is used as an example to illustrate:

[0047] There are M users U in the MovieLens dataset 1 ,u 2 ,...,u M} and N items I={i 1 ,i 2 ,...,i N}, the rating domain is {1,2,3,4,5}, and the user-item rating matrix is ​​[R] M×N indicates; r ui represents the user's rating value on item i, U(i,j) represents the set of users who have rated both item i and item j, i.e., the common rating item; U i represents the set of all users who have evaluated item i.

[0048] First, the system data is acquired and cleaned through the data acquisition and preparation module to obtain the variables in the hypothesis. The specific implementation steps of the proposed negative sample discrimination recommendation model based on the generative adversarial network are as follows:

[0049] S1: The data collection and preparation module obtains the required data information from the database, including user ID, project ID and rating information;

[0050] S2: The rating matrix partitioning module divides the user-item rating matrix R into two corresponding independent sub-matrices containing only 0-1 binary values ​​according to different rating values ​​set by the system.

[0051] Taking the MovieLens dataset as an example, its rating domain is {1,2,3,4,5}, then the rating matrix R can be divided into two sub-matrices corresponding to the rating values. The sub-matrices are set as follows: the high-scoring matrices of 4 and 5 in the dataset are set as the P matrix, i.e., the positive example matrix, and the remaining low-scoring and no-scoring matrices are set as the U matrix, i.e., the unlabeled matrix;

[0052] S3: The spy technology module uses the spy algorithm in PU_learning to randomly select 15% of the score S matrices in the P matrix as spy samples and add them to the U matrix. As spy samples, they are divided into three matrices, namely the P_S matrix, the U_S matrix and the S matrix. The subsequent generator will sort the predicted values ​​to extract reliable negative samples;

[0053] S4: Reliable negative sample calculation module, used to use the sub-matrix obtained by cross-training in the conditional generative adversarial network to predict the probability of negative samples. Specifically, it includes the following steps:

[0054] ①Conditional GAN ​​discriminator input layer, obtain the feature embedding vector p of item i i , and the conditional vector c i Put them together and pass them into the neural network.

[0055] z i =p i +c i

[0056] ②Conditional GAN ​​discriminator hidden layer, using the activation function ReLU to prevent the model from overfitting, and obtain the output l of all hidden layers n .

[0057] ReLU(z i )=max(0,z i )

[0058] l 1 =W 1 T z i

[0059] l n =ReLU(W 1 T l n-1 +b n ),n=2,...,X-1

[0060] Among them, W n and b n They represent the weight matrix and bias vector of the nth hidden layer respectively.

[0061] ③Conditional GAN ​​discriminator output layer, obtains the potential feature vector q of item i i , calculate the predicted rating probability of user u on item i:

[0062]

[0063] Among them, W out Represents the weight matrix of the vector; Sigmoid function σ(x) = 1 / (1+e -x ) is used to limit the output to the range (0,1).

[0064] ④Conditional GAN ​​generator input layer, input feature embedding vector z of item i i , passed into the neural network.

[0065] ⑤Conditional GAN ​​generator hidden layer, using the activation function ReLU to prevent the model from overfitting, and obtain the output l of all hidden layers n .

[0066] ReLU(z i )=max(0,z i )

[0067] l 1 =W 1 T z i

[0068] l n =ReLU(W 1 T l n-1 +b n ),n=2,...,X-1

[0069] Among them, W n and b n They represent the weight matrix and bias vector of the nth hidden layer respectively.

[0070] ⑥Conditional GAN ​​generator output layer, obtain the potential feature vector q of item i i , put together with the conditional vector:

[0071]

[0072] Among them, W out Represents the weight matrix of the vector; Sigmoid function σ(x) = 1 / (1+e -x ) is used to limit the output to the range (0,1);

[0073] S5: Reliable negative sample acquisition module, sorts the predicted negative sample probability values ​​in the submatrix, selects negative samples with higher probability and inputs them into the collaborative filtering generative adversarial network, and also selects other random negative samples of the same number for training to prevent mode collapse. Use mean square error loss to stabilize training;

[0074] S6: Negative sample processing module, which makes the predicted value of random negative samples close to a non-zero decimal, and makes the predicted value of strategic negative sampling close to 0. The objective function is as follows:

[0075]

[0076] J G is the loss function of the generator, α and β are hyperparameters for adjusting the negative sampling weights to enhance the diversity of predicted values, represents the generator prediction value, e u represents the mask matrix, c u Represents the conditional vector, and the second and third terms of formula use the mean square error to make the negative sample prediction values ​​different;

[0077] S7: Recommendation result acquisition module, used to obtain the recommendation list of target user u. This includes: each user selects an item with the most recent timestamp as a positive sample, then selects 99 items with no interaction as negative samples for recommendation, sorts the model prediction values ​​of these 100 items from large to small, sets the number of items to be recommended k, and if there is a user positive example in the first k recommended items, the recommendation is valid, so as to train and form a personalized recommendation list for target user u.

[0078] Figure 3 The proposed method is measured in one data and two aspects, and compared with other methods. The two metrics are hit rate (HR) and normalized discounted cumulative gain (NDCG). Their calculation methods and measurement contents are as follows:

[0079] Hit rate (HR): used to measure whether the actual recommended items in the test set are presented in the top-k predicted recommendation list, which indicates the item recommendation ability of the model. The calculation method is as follows:

[0080]

[0081] Where m represents the number of users in the recommendation system, and hits(i) represents the proportion of the top k predicted recommended items of the i-th user in the actual recommended item set.

[0082] Normalized Discounted Cumulative Gain (NDCG): This shows the quality of the model’s item ranking recommendations by assigning higher scores to top-ranked clicks to account for the click’s position. The calculation formula is as follows:

[0083]

[0084] Where DCG@k and IDCG@k represent the discounted cumulative gain and ideal DCG, respectively. p Used to show the recommendation relevance of the item at position p, that is, if the predicted recommended item appears in the actual recommendation list, rel p =1 if the predicted or actual rating of an item exceeds the median of the rating interval, otherwise it is 0. It is worth noting that we assume that the item is recommended if its predicted or actual rating exceeds the median of the rating interval.

Claims

1. The present invention proposes a generative adversarial network (GAN) model capable of distinguishing positive and negative samples to help the recommendation system filter out negative samples with noise, including the following: The data collection and preparation module is used to acquire and clean the data collected in the database to obtain the required information. The conditional generative adversarial network rating matrix partitioning module is used to divide the user-item rating matrix R into two corresponding implicit matrices containing only 0-1 values ​​according to different rating values ​​set by the system. For example, the ratings of 4 and 5 points in the system are divided into the positive implicit matrix P, and the remaining low-rated and no-rated data are divided into the U matrix. The spy technology module randomly takes 15% of the data in the P matrix as spy samples and adds them to the U matrix to enhance the discriminant ability of the discriminator. The subsequent generator will sort the predicted values ​​and extract reliable negative samples. The reliable negative sample calculation module is used to use the sub-matrix obtained by cross-training in the conditional generative adversarial network to predict the probability of negative samples. The reliable negative sample acquisition module sorts the negative sample probability values ​​predicted in the submatrix, selects negative samples with larger probabilities and inputs them into the collaborative filtering generative adversarial network. At the same time, it also selects other random negative samples of the same number for training to prevent mode collapse. The negative sample processing module makes the predicted value of random negative samples close to a non-zero decimal and the predicted value of strategic negative sampling close to 0. The recommendation result acquisition module is used to internally sort the retained predicted ratings with higher probabilities and push the top k items with higher predicted ratings to the target user to form a personalized recommendation list.

2. The negative sample discrimination recommendation model based on generative adversarial network according to claim 1, characterized in that: The conditional generative adversarial network rating matrix partitioning module is used to divide the user-item rating matrix R into two corresponding implicit matrices containing only 0-1 values ​​according to different rating values ​​set by the system. The matrix setting rules are as follows: the high-scoring items of 4 and 5 points in the data set are set as the P matrix, i.e., the positive example matrix, and the remaining low-scoring and no-scoring matrices are set as the U matrix, i.e., the unlabeled matrix.

3. The negative sample discrimination recommendation model based on generative adversarial network according to claim 1, characterized in that: The spy technology module randomly takes 15% of the score S matrix in the P matrix as spy samples and adds them to the U matrix. As spy samples, it is divided into three matrices, namely P_S matrix, U_S matrix and S matrix. The subsequent generator will sort the predicted values ​​to extract reliable negative samples.

4. The negative sample discrimination recommendation model based on generative adversarial network according to claim 1, characterized in that: The reliable negative sample calculation module is used to use the submatrix obtained by cross-training in the conditional generative adversarial network to predict the probability of negative samples. Specifically, it includes the following steps: ①Conditional GAN ​​discriminator input layer, obtain the feature embedding vector p of item i i , and the conditional vector c i Put together. z i =p i +c i ②Conditional GAN ​​discriminator hidden layer, using the activation function ReLU to prevent the model from overfitting, and obtain the output l of all hidden layers n . ReLU(from i )=max(0,z i ) l1=W1 T z i it n =ReLU(W1 T it n-1 +b n ),n=2,...,X-1 Among them, W n and b n They represent the weight matrix and bias vector of the nth hidden layer respectively. ③Conditional GAN ​​discriminator output layer, obtains the potential feature vector q of item i i , calculate the predicted rating probability of user u on item i: Among them, W out Represents the weight matrix of the vector; Sigmoid function σ(x) = 1 / (1+e -x ) is used to limit the output to the range (0,1). ④Conditional GAN ​​generator input layer, input feature embedding vector z of item i i , passed into the neural network. ⑤Conditional GAN ​​generator hidden layer, using the activation function ReLU to prevent the model from overfitting, and obtain the output l of all hidden layers n . ReLU(from i )=max(0,z i ) l1=W1 T z i l n =ReLU(W1Tl n-1 +b n ),n=2,...,X-1 Among them, W n and b n They represent the weight matrix and bias vector of the nth hidden layer respectively. ⑥Conditional GAN ​​generator output layer, obtain the potential feature vector q of item i i , put together with the conditional vector: Among them, W out Represents the weight matrix of the vector; Sigmoid function σ(x) = 1 / (1+e -x ) is used to limit the output to the range (0,1).

5. The negative sample discrimination recommendation model based on generative adversarial network according to claim 1, characterized in that: The reliable negative sample acquisition module sorts the predicted negative sample probability values ​​in the submatrix, selects negative samples with higher probability and inputs them into the collaborative filtering generative adversarial network, and also selects other random negative samples of the same number for training to prevent mode collapse. The mean square error loss is used to stabilize the training.

6. The negative sample discrimination recommendation model based on generative adversarial network according to claim 1, characterized in that: The negative sample processing module approaches the predicted value of the random negative sample to a decimal not equal to 0, and approaches the predicted value of the strategic negative sampling to 0. J G is the loss function of the generator, α and β are hyperparameters for adjusting the negative sampling weights to enhance the diversity of predicted values, represents the generator prediction value, e u represents the mask matrix, c u Represents the conditional vector, and the second and third terms of formula use the mean square error to make the negative sample prediction values ​​different.

7. The negative sample discrimination recommendation model based on generative adversarial network according to claim 1, characterized in that: The recommendation result acquisition module is used to obtain the recommendation list of the target user u. This includes: each user selects an item with the most recent timestamp as a positive sample, then selects 99 items with no interaction as negative samples for recommendation, sorts the model prediction values ​​of these 100 items from large to small, sets the number of items to be recommended k, and if there is a user positive example in the first k recommended items, the recommendation is valid, so as to train and form a personalized recommendation list for the target user u.

Citation Information

Patent Citations

  • Article recommendation method based on generative adversarial network model and deep reinforcement learning, electronic equipment and medium

    CN114202061A

  • Personalized post recommendation method based on preference of user to post popularity

    CN116610857A