Recommendation method based on double depolarization contrast learning
By employing a dual bias-reduction contrastive learning method, the problems of false negative samples and feature semantic drift are solved, thereby improving the accuracy and precision of the recommendation system and achieving accurate modeling of user and item features.
Patent Information
- Application Number
- CN202510929241.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-11-11
AI Technical Summary
Existing recommendation methods based on contrastive learning suffer from false negative sample problems and feature semantic drift problems, which affect the accuracy of recommendation results.
A dual debiased contrastive learning method is adopted. By designing a soft negative sample filtering weight function, the influence of false negative samples is reduced. Furthermore, a class center matrix and a class label matrix are introduced to alleviate feature semantic drift and improve the accuracy of feature representation.
It effectively reduces the interference of false negative samples on model training, ensures the semantic consistency of feature representations, and improves the accuracy and precision of recommendations.
Smart Images

Figure CN120929668A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to graph convolutional neural networks, contrastive learning techniques, and debiased learning techniques, specifically to a recommendation method based on dual debiased contrastive learning. Background Technology
[0002] In today's era of rapid digital technological innovation, the amount of data on the internet is growing exponentially. While the massive and diverse information resources offer users greater freedom of choice, they also lead to severe information overload, a key bottleneck restricting user experience and information utilization efficiency. Against this backdrop, recommender systems, as a core technological paradigm for alleviating information overload, have received widespread attention. This method analyzes users' historical interaction data, comprehensively utilizing data mining, machine learning, and other techniques to accurately extract users' potential interest preferences from massive and complex interaction patterns, thereby constructing highly personalized user interest profiles. Based on these profiles, combined with multi-dimensional information such as item attributes and contextual environment, intelligent recommendation algorithms generate recommendation lists that highly match the needs of target users, effectively improving the accuracy of information recommendations and user satisfaction. However, in the practical application of recommender system technology, data sparsity has become a major obstacle affecting its performance. Due to limitations in information presentation methods, most users typically only interact with a small portion of items in the information space, making it difficult for recommendation algorithms to fully learn the complex mapping relationship between users' potential interest features and item features, thus affecting the accuracy of recommendation results.
[0003] Contrastive learning, as a cutting-edge technology for mitigating data sparsity, has demonstrated significant advantages in the field of recommender systems in recent years. This paradigm aims to maximize the consistency between positive sample pairs while minimizing the consistency between negative sample pairs, thereby uncovering the latent structural and semantic relationships within the data. Unlike traditional supervised learning, which relies on explicit labels manually labeled, contrastive learning employs a self-supervised paradigm, learning representations solely based on the inherent attributes and structural features of the data itself. This eliminates the need for additional manual labeling costs, effectively mitigating data sparsity in scenarios with limited data resources and providing a new technical path for improving recommender system performance. However, despite the effectiveness of contrastive learning-based recommendation methods, existing solutions still suffer from two key shortcomings that urgently need to be addressed. First, existing methods typically employ in-batch negative sampling to improve model training. The core of this strategy is to treat all samples in the same training batch, excluding the target sample, as negative samples to calculate the contrastive learning loss. However, these remaining samples may stem from insufficient exposure rather than a lack of genuine preference, leading to false negative samples and resulting in biased user and item feature representations. Furthermore, in the feature augmentation stage, existing methods often employ random noise addition to augment the original feature vector, thereby generating multiple feature views. However, random noise addition ignores the semantic correlation between features before and after augmentation, causing semantic drift in the feature representations before and after augmentation, further exacerbating the problem of biased feature representation.
[0004] Based on this, this invention proposes a recommendation method based on Dual-Debiased Contrastive Learning for Recommendation (DDCL) to address the issues of false negative samples and semantic drift in existing contrastive learning-based recommendation methods. Specifically, to address the false negative sample problem, a soft negative sample filtering weight function is designed based on the similarity between samples within a batch and the target sample. False negative samples with high similarity but misclassified as negative samples are assigned lower training contribution weights, thereby reducing the interference of false negative samples on model parameter updates during training. To address the semantic drift problem caused by feature augmentation, a learnable class center matrix is introduced, and a contrastive learning loss between the target sample and its class centers is constructed to alleviate the semantic drift problem. Summary of the Invention
[0005] The technical problem solved by this invention is to propose a recommendation method based on dual debiased contrastive learning. By reducing the impact of false negative samples on feature representation learning and addressing the feature semantic drift problem caused by random noise augmentation, this method achieves accurate modeling of user and item feature representations and improves the accuracy of recommendations.
[0006] The technical solution of this invention is: a recommendation method based on dual bias-reduction contrastive learning, specifically including the following steps:
[0007] S1. Construct a "User-Item" interaction graph in and Let m and n represent the user set and the item set, respectively, and m and n represent the number of users and the number of items, respectively. Let be the adjacency matrix of the "user-item" interaction graph, where Let Y be the "user-item" interaction matrix, where any element y in matrix Y... ui This represents the interaction behavior of user u with item i, when y ui When the value is 1, it means that user u has interacted with item i; otherwise, it has not. Based on the "user-item" interaction data, a training corpus is constructed. in Represents the collection of items that the user has interacted with. The items in the data are referred to as positive items or positive samples for user u. This represents a collection of items that the user has not interacted with. The items in the sample are referred to as negative items or negative samples of user u. In this invention, negative items are obtained by random negative sampling.
[0008] S2. Perform a graph convolution operation on the "user-item" interaction data obtained in step S1. The specific calculation formula is as follows:
[0009]
[0010] in and Let u and i represent the feature representations of user i and item i at the k-th layer, respectively. and Let U represent the set of items that user u has interacted with, and i represent the set of users who have interacted with item i, respectively. After K layers of convolution, the final feature representations of user u and item i are the average of the feature representations obtained from each layer, calculated using the following formula:
[0011]
[0012] After obtaining the feature representations of users and items, Bayesian personalized ranking loss is used as the recommendation loss based on the training corpus obtained in step S1:
[0013]
[0014] in This is the sigmoid function.
[0015] S3, User-User Contrast Loss Design Correction Items removed - Item comparison loss Compared with the user-item loss, the loss was compared. Based on the feature representation e of user u obtained in step S2 u Now, random noise is added to the original feature representation to obtain two augmented feature representations (also known as feature views):
[0016] e′ u =e u +Δ′ u ,e″ u =e u +Δ″ u
[0017] Wherein, the noise vector ||Δ′ u ||2=∈ and ||Δ″ u ||2 = ∈, and It follows a uniform distribution. Two augmented item feature representations can be obtained in the same way:
[0018] e′ i =e i +Δ′ i ,e″ i =e i +Δ″ i
[0019] To avoid the negative impact of spurious negative samples on model training, this invention proposes a soft negative sample filtering weight function, based on "user view" and "user perception". Figure 1 -User View Figure 2 "Items are viewed" Figure 1 -Item View Figure 2 The similarity between the two feature views, "User-Item" and "User-Item", determines the probability that all samples in a batch other than the target sample are false negatives. The soft negative sample filtering weight function is defined as:
[0020]
[0021] v1 and v2 represent two views respectively. and Let s(·) represent the features of the two views, where s(·) is the cosine similarity, with values ranging from [-1, 1]. β∈[0, 1] is the temperature coefficient; the larger β is, the better. The smaller the value, the greater the value; conversely, The larger the value, the better.
[0022] Based on the aforementioned soft negative sample filtering weight function, a biased user-user contrastive learning loss is constructed. Item-item comparison learning loss Compared with the user-item comparison learning loss, the learning loss is different. The calculation formula is as follows:
[0023]
[0024]
[0025] in Indicates training batch, and Let represent the probability that user v is a false negative sample of user u, the probability that item j is a false negative sample of item i, and the probability that item i is a false negative sample of item u, respectively. ′ Let w be the probability of a false negative sample for user u. The higher the similarity between the two, the more likely they are to be positive samples for each other, and the smaller the corresponding weight w. Therefore, the sample contributes less to the comparative loss, thus mitigating the impact of false negative samples on model training.
[0026] S4. To avoid semantic drift between features before and after random augmentation, a class center matrix for users and items is introduced. and and user and item category tag matrix and Where c1 and c2 are the number of class centers for users and items, respectively. Ideally, since each user and each item can only belong to one class, i.e., P... l and Q l Each row contains only one element that is 1, and the rest are 0. Because P l and Q l The permutation matrix P causes the model to be nondifferentiable. Therefore, this invention addresses the issue of matrix P. l and Q l Perform a softmax operation on each row to obtain a differentiable matrix of user and item class labels. and In particular, and The i-th row in the matrix represents the class center representation of the i-th user and the i-th item, respectively. Based on the class center matrices P and Q for users and items, a contrastive loss between users and their class centers is constructed. Loss of comparison between items and their class center The specific calculations are as follows:
[0027]
[0028] Where p u and q i Let be the u-th column of matrix P and the i-th column of matrix Q, respectively, and τ be the temperature coefficient.
[0029] S5, combined with recommendation loss The contrast loss between users and their class centers Comparison loss between items and their class center User-to-user contrast loss Items removed - Item comparison loss Compared with the user-item loss, the loss was compared. The final loss of this invention is:
[0030]
[0031] Where λ1>0, λ2>0, and λ3>0 are hyperparameters used to adjust the weighting of recommendation loss and contrast loss, and θ is the model parameter. The model is updated using stochastic gradient descent to obtain the optimal user feature representation. and item feature representation
[0032] S6. Based on the optimal user feature representation and item feature representation Scoring of unobserved data: Then on Sort the data in descending order and recommend the top K items with the highest values that have not been observed to the corresponding users.
[0033] The advantages of this invention compared to the prior art are:
[0034] 1. To address the false negative sample problem in existing comparison learning-based recommendation methods, a false negative sample filtering weight function is proposed based on the similarity between two views. This function measures the probability that a certain view is a false negative sample of the target view, thereby reducing the adverse effects of false negative samples on model training and greatly alleviating the false negative sample problem.
[0035] 2. To address the issue of semantic drift caused by the random noise-addition method used in existing contrastive learning-based recommendation methods, which easily shifts or distorts the original semantic information, we introduce a class center matrix and a class label matrix. The class center matrix represents the features of each class center, while the class label matrix represents the category to which each user belongs. During training, by maximizing the similarity between a sample and its class center, we ensure that the sample closely follows the feature distribution of its category in the feature space; simultaneously, by minimizing the similarity with other class centers, we effectively separate samples from different categories in the feature space, greatly improving the feature representation capability of the samples.
[0036] 3. The effectiveness of the proposed method was verified on two real-world datasets using four recommendation performance evaluation metrics. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating the recommendation method based on dual bias-reduction contrastive learning implemented in this invention.
[0038] Figure 2 This is a flowchart illustrating the model training workflow for this invention. Detailed Implementation
[0039] To enable those skilled in the art to better understand the solutions of the embodiments of the present invention, the present invention will be further described below with reference to the accompanying drawings and embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. After reading the present invention, any modifications and extensions of the present invention by those skilled in the art in various equivalent forms fall within the scope defined by the appended claims.
[0040] The recommendation method based on dual bias-reduction contrastive learning has the following workflow: Figure 1 As shown. First, construct the "user-item" interaction graph. A random negative sampling strategy is applied to the interaction graph to collect negative samples for each "user-item" sample pair, thereby constructing the training corpus Ω (step S1). Then, graph convolution is performed on the "user-item" interaction graph obtained in step S1 to obtain the feature representations of users and items. Based on the training corpus obtained in step S1, a main recommendation loss based on Bayesian personalized ranking loss is constructed (step S2). Random noise is added to the original user feature representation and item feature representation to obtain two augmented user views and item views, respectively. Figure 1 -User View Figure 2 Similarity between "items", "object perception" Figure 1 -Item View Figure 2 Based on the similarity between "user-to-user" and "user-to-item" original views, soft negative sample filtering weights are designed to construct a biased "user-to-user" contrastive loss. Loss from item-to-item comparison Compared with the biased "user-item" loss Reduce the impact of false negative samples on model training (step S3); construct the class center matrix P for users and items. A and Q A And the class tag matrix P for users and items. l and Q l To ensure the differentiability of the class label matrix, the class label matrices P for users and items are respectively... l and Q l Perform a softmax operation, then calculate the class center matrix P based on users and items. A and Q A And the class tag matrix P for users and items. l and Ql Construct the contrastive loss of users and their class center matrices Loss of comparison between items and their class center (Step S4); Combine recommendation loss and comparison loss between user and their class center. Comparison loss between items and their class center User-to-user contrast loss Items removed - Item comparison loss Compared with the user-item loss, the loss was compared. The model parameters are optimized and updated using the stochastic gradient descent algorithm to obtain the optimal user feature representation and item feature representation (step S5); finally, the unobserved data is predicted based on the feature matrices of users and items, and items with higher predicted values are recommended to the corresponding users (step S6).
[0041] The workflow of model optimization is as follows: Figure 2 As shown. First, the model parameters E are randomly initialized. u E i P l P A Q l , and Q A Enter the iterative training process: fix E i P l P A Q l , and Q A Calculate the objective function with respect to E u The gradient is used to update E using the stochastic gradient descent algorithm. u Fixed E u P l P A Q l , and Q A Calculate the objective function with respect to E i The gradient is used to update E using the stochastic descent algorithm. i Fixed E u E i P A Q l , and Q A Calculate the objective function with respect to P l The gradient is used to update P using the stochastic descent algorithm. l Fixed E u E i P l Q l , and Q A Calculate the objective function with respect to P A The gradient is used to update P using the stochastic descent algorithm. A Fixed E uE i P l P A and Q A Calculate the objective function with respect to Q l The gradient is used to update Q using a stochastic descent algorithm. l Fixed E u E i P l P A and Q l Calculate the objective function with respect to Q A The gradient is used to update Q using a stochastic descent algorithm. A Repeat the above steps, continuously updating parameter E alternately. u E i P l P A Q l , and Q A The process continues until a stopping condition is met, such as when the objective function value is less than a certain preset threshold or the number of iterations reaches a certain level, and finally the parameter model is output.
[0042] This invention conducted experiments on two datasets and compared the performance of the method described in this invention with current mainstream recommendation methods based on contrastive learning. The comparison methods include the classic graph recommendation method LightGCN (published at SIGIR 2019, a leading conference in the field of information retrieval), as well as the classic graph contrastive learning methods SimGCL and XSimGCL (published at SIGIR 2022, a leading conference in the field of information retrieval, and IEEE TKDE 2024, a leading journal in data mining, respectively).
[0043] The first dataset is Douban, a book review dataset, where users represent readers and items represent books in the user-item interaction graph. This dataset includes 13,024 users, 22,347 items, and 792,062 interaction records, with a user-item interaction data density of 0.27%.
[0044] The second dataset is the Yelp 2018 dataset related to shops, where users represent consumers and items represent shops in the user-item interaction graph. This dataset includes 31,668 users, 38,048 items, and 1,561,406 interaction records, with a user-item interaction data density of 0.13%.
[0045] This invention uses four evaluation metrics—Hit Ratio@K, Precision@K, Recall@K, and NDCG@K—to verify the effectiveness of the model algorithm, where K takes values of {5, 10, 20}. It is worth noting that each metric ranges from [0, 1], and a larger value indicates better model performance.
[0046] Tables 1 and 2 show the test results of the four algorithms on the Douban and Yelp 2018 datasets, respectively. Both sets of experimental results show that the method described in this invention has a significant performance improvement over the comparative methods.
[0047]
[0048]
[0049] Table 1. Experimental results on the Douban dataset.
[0050]
[0051]
[0052] Table 2 shows the experimental results on the Yelp 2018 dataset.
[0053] The embodiments of the present invention have been described in detail above. Specific implementation methods have been used to illustrate the present invention. The description of the above embodiments is only for the purpose of helping to understand the method of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A recommendation method based on dual bias-reduction contrastive learning, characterized in that, Specifically, the following steps are included: S1. Construct a "User-Item" interaction graph in and Let m and n represent the user set and the item set, respectively, and m and n represent the number of users and the number of items, respectively. Let be the adjacency matrix of the "user-item" interaction graph, where Let Y be the "user-item" interaction matrix, where any element y in matrix Y... ui This represents the interaction behavior of user u with item i, when y ui When the value is 1, it means that user u has interacted with item i; otherwise, it has not. Based on the "user-item" interaction data, a training corpus is constructed. in Represents the collection of items that the user has interacted with. The items in the data are referred to as positive items or positive samples for user u. This represents a collection of items that the user has not interacted with. The items in the data are referred to as negative items or negative samples of user u; S2. Perform a graph convolution operation on the "user-item" interaction data obtained in step S1. The specific calculation formula is as follows: in and Let u and i represent the feature representations of user i and item i at the k-th layer, respectively. and Let U represent the set of items that user u has interacted with and the set of users that have interacted with item i, respectively. After K layers of convolution, the final feature representation of user u and item i is the average of the feature representations obtained from each layer, calculated using the following formula: After obtaining the feature representations of users and items, Bayesian personalized ranking loss is used as the recommendation loss based on the training corpus obtained in step S1: in It is the sigmoid function; S3, User-User Contrast Loss Design Correction Items removed - Item comparison loss Compared with the user-item loss, the loss was compared. Based on the feature representation e of user u obtained in step S2 u Random noise is added to the original feature representation to obtain two augmented feature representations: And' u =and u +Δ′ u ,And" u =and u +Δ″ u Wherein, the noise vector ||Δ′ u ||2=∈ and ||Δ′ u '‖2=∈, and It follows a uniform distribution; in the same way, two augmented item feature representations can be obtained: And' i =and i +Δ′ i ,And" i =and i +Δ″ i To avoid the negative impact of false negatives on model training, a soft negative sample filtering weight function is proposed. Based on the similarity between two feature views—"User View 1 - User View 2", "Item View 1 - Item View 2", and "User - Item"—it determines the probability that samples other than the target sample within a batch are false negatives. The soft negative sample filtering weight function is defined as follows: v1 and v2 represent two views respectively. and Let s(·) represent the features of the two views, where s(·) is the cosine similarity with a value range of [-1, 1]; and β∈[0, 1] is the temperature coefficient, where β increases with increasing temperature. The smaller the value, the greater the value; conversely, The larger the value; Based on the aforementioned soft negative sample filtering weight function, a biased user-user contrastive learning loss is constructed. Item-item comparison learning loss Compared with the user-item comparison learning loss, the learning loss is different. The calculation formula is as follows: in Indicates training batch, and Let i' and j' represent the probability that user v is a false negative sample of user u, item j is a false negative sample of item i, and item i' is a false negative sample of user u, respectively. S4. To avoid semantic drift between features before and after random augmentation, a class center matrix for users and items is introduced. and and user and item category tag matrix and Where c1 and c2 are the number of class centers for users and items, respectively; for matrix P l and Q l Perform a softmax operation on each row to obtain a differentiable matrix of user and item class labels. and In particular, and The i-th row in the matrix represents the class center representation of the i-th user and the i-th item, respectively; based on the class center matrices P and Q of users and items, a contrastive loss between users and their class centers is constructed. Loss of comparison between items and their class center The specific calculations are as follows: Where p u and q i Let be the u-th column of matrix P and the i-th column of matrix Q, respectively, and τ be the temperature coefficient; S5, combined with recommendation loss The contrast loss between users and their class centers Comparison loss between items and their class center User-to-user contrast loss Items removed - Item comparison loss Compared with the user-item loss, the loss was compared. The final loss is: Where λ1>0, λ2>0, and λ3>0 are hyperparameters used to adjust the weighting of recommendation loss and contrast loss, and θ is a model parameter; the stochastic gradient descent algorithm is used to update the model to obtain the optimal user feature representation. and item feature representation S6. Based on the optimal user feature representation and item feature representation Scoring of unobserved data: Then on Sort the data in descending order and recommend the top K items with the highest values that have not been observed to the corresponding users.
2. The recommendation method based on dual bias-reduction contrastive learning according to claim 1, characterized in that, Negative items were obtained using random negative sampling.