Personalized item recommendation method based on reliable virtual hard negative sampling under e-commerce platform
By generating high-quality virtual hard negative samples and transforming pseudo-negative examples using a reliable virtual hard negative sampling method, the pseudo-negative example problem was solved, improving the performance of the recommendation model and user satisfaction on the e-commerce platform.
Patent Information
- Application Number
- CN202411069227.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-08-06
AI Technical Summary
Existing negative sampling methods ignore the problem of spurious negative examples in hard negative samples on e-commerce platforms, which affects the performance of recommendation models. Furthermore, existing methods that consider spurious negative examples fail to effectively utilize the topological information of the graph.
A reliable virtual hard negative sampling method is adopted. By generating high-quality virtual hard negative samples and utilizing graph topology information, a transformation mechanism is designed to convert pseudo-negative examples into reliable negative samples. The method is then combined with the Bayesian Personalized Ranking loss function for training to generate high-quality virtual hard negative samples.
This improved the performance of the recommendation model, enabled more accurate product recommendations, reduced the risk of spurious negative examples, and enhanced the user experience.
Smart Images

Figure CN119107142B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning technology, specifically to a personalized product recommendation method based on reliable virtual hard negative sampling for e-commerce platforms. Background Technology
[0002] Recommendation systems predict products or content that users might like by analyzing their historical behavior, thus solving the problem of information overload and enabling users to discover and obtain information of interest more effectively.
[0003] Collaborative filtering, a crucial technique in recommender systems, is based on the similarity of user behavior data or product attribute data to make recommendations. Datasets processed by collaborative filtering recommendation models can be categorized into those with explicit feedback and those with implicit feedback. Explicit feedback-based collaborative filtering recommends based on user ratings, reviews, and other information, resulting in higher data collection costs. In contrast, implicit feedback-based collaborative filtering recommends based on user interactions. This data is not only easier to collect but also provides diverse information such as listening behavior, purchasing behavior, and social behavior. Therefore, current recommender systems primarily focus on implicit feedback-based collaborative filtering models.
[0004] Most collaborative filtering recommendation models based on implicit feedback employ negative sampling for training when making product recommendations. Negative sampling primarily focuses on generating high-quality hard negative samples because these samples contain richer information. Specifically, these negative samples tend to achieve higher scores during training compared to other negative samples. Hard negative samples can be categorized into two types based on their generation method: real hard negative samples and virtual hard negative samples. Real hard negative samples are selected from the original dataset according to a specific strategy; these samples are observation data points that actually exist in the original dataset. Virtual hard negative samples, on the other hand, are generated through operations in the feature space; these samples do not have corresponding observation data points in the original dataset. Training with virtual hard negative samples is more challenging than training with real hard negative samples because virtual hard negative samples are more difficult to obtain and allow the model to better learn how to distinguish between positive and negative samples.
[0005] Many existing negative sampling methods improve the performance of recommendation models on e-commerce platforms by generating high-quality virtual hard negative samples. However, they still have the following problems: They neglect the existence of spurious negative examples within the hard negative samples during training. For example, a user might like a product but never actually purchase it; therefore, the dataset doesn't contain any purchase data for that product, and the negative sampling method considers this product a negative sample. Using such negative samples for training negatively impacts model performance. Existing negative sampling methods that consider spurious negative examples ignore the graph's topological structure information, identifying spurious negative examples solely from the variance of each training round. Firstly, this method cannot guarantee applicability across different datasets on e-commerce platforms. Secondly, the model cannot effectively capture the relationships between nodes when considering spurious negative examples, thus affecting the recommendation model's performance. Therefore, it is necessary to design a more effective negative sampling method that meets new requirements. Summary of the Invention
[0006] To address the shortcomings of existing negative sampling methods in simultaneously ensuring negative sample quality and resolving the issue of spurious negative examples, this invention proposes a personalized product recommendation method based on reliable virtual hard negative sampling. This method not only generates high-quality virtual hard negative samples but also mitigates the risks associated with spurious negative examples, improving the performance of the recommendation model and enabling more accurate product recommendations.
[0007] This invention is specifically achieved through the following technical solution:
[0008] A personalized product recommendation method based on reliable virtual hard negative sampling for e-commerce platforms, the method comprising:
[0009] For any user From the training set Select products that users have purchased As positive samples, users are obtained through a collaborative filtering recommendation model. u and purchased goods vector representation and ;
[0010] User data is obtained through a reliable hard negative sampling method. u negative sample feature vector ;
[0011] Based on the negative sample feature vector Positive sample feature vector and user vector The collaborative filtering recommendation model is trained to learn more accurate personalized preferences of users.
[0012] The reliable hard negative sampling method includes:
[0013] Step 1: Given a recommendation dataset based on implicit feedback The dataset is divided into training sets. Test set and verification set ,in Represented as a set of users, Represented as a collection of products, user purchase behavior data Represented as user u Purchased items ;
[0014] Step 2: Analyze any user purchase behavior data... Randomly select M users u Construct a candidate negative sample pool for products that have not been interacted with. Acquire users u Products purchased by users and candidate negative sample pool Corresponding vector representation and ;
[0015] Step 3: For any candidate negative sample item vector The generated candidate virtual hard negative samples This yields a set of candidate virtual hard negative sample vectors. ;
[0016] Step 4: Based on the inner product of users and negative samples, extract the candidate virtual hard negative sample vectors from the set. In this process, highly challenging virtual hard negative samples are selected, and the specific operation is shown in the following formula:
[0017] ;
[0018] Step 5: For any user vector ,user u Corresponding positive sample vector and users u Candidate negative sample item vector set The hardest negative sample and the most realistic negative sample are selected from the candidate negative sample vector set by the inner integral of the positive sample vector and the candidate negative sample item vector set.
[0019] Step 6: Calculate the difference between the most difficult hard negative sample and the most reliable negative sample to obtain the feature difference from transforming a hard negative sample into a simple negative sample. ;
[0020] Step 7: In the vector space, using The candidate virtual hard negative samples generated in step 4 The process of transforming these samples into more reliable hard negative samples is shown in the following formula:
[0021] ,
[0022] in β This indicates the degree of transformation of the virtual hard negative sample.
[0023] As a further improvement of the present invention, the collaborative filtering recommendation model is trained using the Bayesian Personalized Ranking loss function defined as follows:
[0024] ,
[0025] in Represented as sigmoid Activation function.
[0026] As a further improvement to this invention, a collaborative filtering recommendation model based on graph neural networks or matrix factorization is used. Acquiring users u Products purchased by users and candidate negative sample pool Corresponding vector representation and .
[0027] As a further improvement of the present invention, the generated candidate virtual hard negative samples The operation is shown in the following formula:
[0028] ,
[0029] ,
[0030] in, q Indicates the degree of negative sample enhancement. q The lower the value, the more virtual hard negative samples. The higher the positive sample information contained in the sample, the more difficult it is for the model to distinguish that sample.
[0031] As a further improvement of the present invention, the similarity between a user and a product is calculated by the inner product of the user and the product, and the expected risk of minimizing the inner product requires the expected loss. and experience loss Satisfy the following formula:
[0032] ,
[0033] in and Let these be the estimated positive and negative sample distributions, respectively. T Indicates the number of node pairs. K This represents the number of negative samples for each user in the loss function.
[0034] As a further improvement of the present invention, the method for obtaining the most difficult hard negative sample vector is as follows:
[0035] ,
[0036] The most reliable way to obtain the negative sample vector is shown in the following formula:
[0037] .
[0038] As a further improvement to the present invention, Euclidean distance is used to calculate the difference between the most difficult hard negative sample and the most reliable negative sample. The calculation formula is shown below:
[0039] .
[0040] The beneficial effects of this invention are as follows: This invention uses a hard negative sampling module to generate virtual hard negative samples. First, a candidate negative sample pool is constructed using random negative sampling. Then, a candidate virtual hard negative sample pool is generated using hybrid data augmentation. Finally, a dynamic negative sampling strategy is used to select the negative sample most similar to the user from the virtual hard negative sample pool as the virtual hard negative sample. This invention uses a transformation module to transform virtual hard negative samples into more reliable virtual hard negative samples. With the assistance of graph topology information, a transformation mechanism is designed. This mechanism utilizes the feature differences between potentially spurious real hard negative samples and reliable real negative samples to transform potentially spurious virtual hard negative samples into more reliable virtual hard negative samples. This invention solves the shortcomings of existing negative sampling methods that cannot solve the spurious negative sample problem while ensuring the quality of negative samples. The method of this invention can not only generate high-quality virtual hard negative samples but also mitigate the risks brought by spurious negative samples, improve the performance of recommendation models, and enable recommendation systems to make more accurate product recommendations. Attached Figure Description
[0041] Figure 1 This is a diagram illustrating the overall framework of the reliable hard negative sampling method of the present invention.
[0042] Figure 2 This is a flowchart of the personalized product recommendation method of the present invention. Detailed Implementation
[0043] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0044] like Figure 1 As shown, this invention first proposes a reliable hard negative sampling method for obtaining user... u negative sample features The reliable hard negative sampling method includes the following steps:
[0045] Step 1: Given a recommendation dataset based on implicit feedback ,in Represented as a set of users, Represented as a collection of products. User purchase behavior data. Represented as user u Purchased items The dataset was divided into training and training sets in an 8:1:1 ratio. Test set and verification set .
[0046] Step 2: Analyze any user purchase behavior data... M items that user u has not interacted with are randomly selected as the candidate negative sample pool. Collaborative filtering recommendation models based on graph neural networks or matrix factorization Get user u, the products the user has purchased and candidate negative sample pool Corresponding vector representation and .
[0047] Step 3: Unlike traditional data augmentation methods that suffer information loss through operations like mean pooling, this invention designs a... mixup A sample augmentation method with ++ is proposed. This method can preserve the real information of vectors in different dimensions during the injection process, so that the generated hard negative samples have real-world sample information. Specifically, for any candidate negative sample item vector... The operation for generating candidate virtual hard negative samples is shown in equation (1):
[0048] (1)
[0049] (2)
[0050] in, q Indicates the degree of negative sample enhancement. q The lower the value, the more virtual hard negative samples. The higher the positive sample information contained in the sample, the more difficult it is for the model to distinguish that sample.
[0051] Step 4: Calculate the similarity between users and items using the inner product of the user and item, and minimize the expected risk (requires the expected loss) of this inner product. and experience loss Satisfying equation (3):
[0052] (3)
[0053] in and Let these be the estimated positive and negative sample distributions, respectively. T Indicates the number of node pairs. K This represents the number of negative samples corresponding to each user in the loss function. This indicates that if the distribution of negative samples is positively correlated with the distribution of positive samples, the expected risk depends solely on the distribution of positive samples. Since the distribution of positive samples can be accurately estimated using the inner product of the user and the purchased items, the distribution of negative samples can also be estimated using the inner product, and then the sample with the highest inner product can be selected as the negative sample to reduce the expected risk. This approach is also consistent with the intuition that hard negative samples, which are more similar to positive samples, can improve the performance of the recommendation model. Therefore, this invention, based on the inner product of the user and the negative sample, selects the candidate virtual hard negative sample vector set... In the process, highly challenging virtual hard negative samples are selected, and the specific operation is shown in equation (4): (4)
[0054] Step 5: While generating highly difficult hard negative samples can provide richer information for model training and enhance the model's discriminative ability, if the generated virtual hard negative samples are too similar to positive samples, the generated virtual negative samples themselves may be spurious negatives. To some extent, as the difficulty of the generated virtual hard negative samples increases, the probability of the sample becoming a spurious negative also increases. To solve this problem, we need to find the difference between spurious negatives and hard negatives. Considering that information about spurious negatives in the dataset is difficult to obtain, this invention uses positive samples to estimate the difference between spurious negatives and hard negatives. For any user vector... ,user u Corresponding positive sample vector and users u Candidate negative sample item vector set The hardest negative sample and the most realistic negative sample are selected from the candidate negative sample vector set by the inner integral of the positive sample vector and the candidate negative sample item vector set. Compared with other negative samples in the candidate vector set, the hardest negative sample is more similar to the positive sample and is more likely to be a false negative example. The hard negative sample vector is obtained as shown in equation (5):
[0055] (5)
[0056] The most reliable negative sample is more likely to be the negative sample that is least similar to the positive sample, and its vector is obtained as shown in equation (6):
[0057] (6)
[0058] Step 6: Calculate the difference between the most difficult hard negative sample and the most reliable negative sample using Euclidean distance, as shown in formula (7):
[0059] (7)
[0060] in This represents the feature difference from transforming a hard negative sample into a simple negative sample, and also the feature difference from transforming a hard negative sample that might be a spurious negative sample into a reliable negative sample. Using this feature difference, we can transform virtual hard negative samples that are very similar to positive samples and are likely spurious negative samples into more reliable virtual hard negative samples, reducing the risk of spurious negative samples.
[0061] Step 7: In the vector space, using The candidate virtual hard negative samples generated in step 3 The samples are transformed into more reliable hard negative samples, and the transformation process is shown in equation (8):
[0062] (8)
[0063] in β This indicates the degree of transformation of the virtual hard negative sample. To make the recommendation model more generalizable, we will... .
[0064] like Figure 2 As shown, the reliable hard negative sampling method is applied to a collaborative filtering-based personalized product recommendation model to obtain the personalized product recommendation method based on reliable virtual hard negative sampling for e-commerce platforms according to the present invention. The method includes:
[0065] For any user ,from Select products that users have purchased As positive samples, users are obtained through any collaborative filtering recommendation model. u and purchased goods vector representation and .
[0066] The user is obtained through this reliable hard negative sampling method. u negative sample features .
[0067] The collaborative filtering recommendation model is trained using the Bayesian Personalized Ranking loss function defined below:
[0068] (9)
[0069] in Represented as sigmoid Activation function. By minimizing this loss function, the collaborative filtering recommendation model learns more accurate personalized user preferences. When recommending products, it selects products from the product set that are more similar to the user's vector, ensuring greater user satisfaction and improving the user experience.
[0070] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention. For those skilled in the art, several simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered within the protection scope of the present invention.
Claims
1. A personalized product recommendation method based on reliable virtual hard negative sampling on an e-commerce platform, the method comprising: For any user u∈U, from the training set D train Select the products that the user has purchased. + As positive samples, user u and purchased items p are obtained through a collaborative filtering recommendation model. + The vector representation of e u and The negative sample feature vector of user u is obtained through a reliable hard negative sampling method. Based on the negative sample feature vector Positive sample feature vector and user vector e u The collaborative filtering recommendation model is trained to learn more accurate personalized preferences of users. The reliable hard negative sampling method includes: Step 1: Given a recommendation dataset based on implicit feedback, Dataset = {(u, p + )|u∈U,p + ∈P}, divide the dataset into training set D train Test set D test and verification set D valid Where U represents the user set, P represents the product set, and user purchase behavior data pairs (u, p) + ) represents the items p purchased by user u. + ; Step 2: For any user purchase behavior data pair (u, p) + )∈D train Randomly select M items that user u has not interacted with as the candidate negative sample pool η={p1,p2,...,p M }, retrieve user u and the items p that user has purchased. + and the vector representation e corresponding to the candidate negative sample pool η u , and candidate negative sample item vector set Step 3: For any candidate negative sample item vector Generate candidate virtual hard negative sample vectors Obtain the set of candidate virtual hard negative sample vectors Step 4: Based on the inner product of the user vector and the candidate virtual hard negative sample vector, from the set of candidate virtual hard negative sample vectors... In this process, a highly complex virtual hard negative sample vector is selected, and the specific operation is shown in the following formula: Step 5: For any user vector e u The positive sample vector corresponding to user u And the candidate negative sample item vector set of user u The hardest and most reliable negative sample vectors are selected from the candidate negative sample vector set by the inner integral of the positive sample vector and the candidate negative sample item vector set. Step 6: Calculate the difference between the most difficult hard negative sample vector and the most reliable negative sample vector using Euclidean distance, thus obtaining the feature difference from the transformation of the highly difficult virtual hard negative sample vector into the most reliable negative sample vector. The calculation formula is shown below: Step 7: In the vector space, using The high-difficulty virtual hard negative sample vector generated in step 4 The transformation into a more reliable hard negative sample vector is shown in the following equation: Where β represents the degree of transformation of the virtual hard negative sample.
2. The method according to claim 1, wherein, The collaborative filtering recommendation model is trained using the Bayesian PersonalizedRanking loss function defined below: Where σ(·) represents the sigmoid activation function.
3. The method according to claim 1, wherein, The user u and the items p purchased by the user are obtained through a collaborative filtering recommendation model F(·) based on graph neural networks or matrix factorization. + and the vector representation e corresponding to the candidate negative sample pool η u , and 4. The method according to claim 1, wherein, The generated candidate virtual hard negative sample vector The operation is shown in the following formula: Where q represents the degree of negative sample augmentation, the lower the q value, the stronger the candidate virtual hard negative sample vector. The higher the positive sample information contained in the sample, the more difficult it is for the model to distinguish that sample.
5. The method according to claim 1, wherein, The similarity between a user and a product is calculated by the inner product of the user and the product. Minimizing this inner product requires the expected loss J(θ). * ) and experience loss J(θ) T The following equation must be satisfied: Among them l d (u|p) and l n (u|p) represent the estimated positive and negative sample distributions, respectively, T represents the number of user-item pairs, and k represents the number of negative samples corresponding to each user in the loss function.
6. The method according to claim 1, wherein, The method for obtaining the most difficult hard negative sample vector is shown in the following formula: The most reliable way to obtain the negative sample vector is shown in the following formula:
Citation Information
Patent Citations
Knowledge graph recommendation method fusing GNN and ResNet
CN115114528A
Single-layer enhanced negative sample generation algorithm for graph neural network training
CN115858924A