A cross-domain commodity recommendation method based on multi-layer convolutional blocks and contrastive learning
This cross-domain product recommendation method, which utilizes multi-layer convolutional blocks and contrastive learning, addresses the data sparsity and cold-start issues in cross-domain recommendation, thereby improving the accuracy and generalization ability of the recommendation system. It is applicable to product recommendations across multiple platforms and domains.
Patent Information
- Application Number
- CN202411519672.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2044-10-29
AI Technical Summary
Existing cross-domain recommendation systems face problems such as data sparsity, domain bias, cross-domain feature alignment, and high computational complexity, making it difficult to effectively recommend products across different platforms and domains.
By employing multi-layer convolutional blocks and contrastive learning, deep features of products are extracted through multi-layer convolutional blocks, and correlations are established between different domains by combining contrastive learning mechanisms, thereby improving the generalization ability and robustness of the recommendation system.
It effectively alleviates data sparsity, enhances the generalization ability of the model, reduces the impact of cold start, and improves the accuracy and real-time performance of the recommendation system.
Smart Images

Figure CN119379394B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of recommendation methods, and particularly relates to a cross-domain commodity recommendation method based on a multi-layer convolution block and contrastive learning. BACKGROUND
[0002] With the rapid development of the Internet and the explosive growth of information, users are facing an increasingly prominent information overload problem, and selection becomes increasingly complex, making it increasingly difficult to find goods that meet their own needs. In order to cope with this challenge, recommendation systems have become a research hotspot that is currently attracting much attention. Through personalized recommendation, recommendation systems can help users filter out the most relevant content from the vast amount of information. As an information filtering tool, recommendation systems predict user interest preferences and recommend goods that may be of interest to them, thereby improving user decision-making efficiency.
[0003] Currently, non-cross-domain recommendation systems mainly rely on user behavior data in a single platform or domain for modeling, and this method has several significant problems. First, due to the limitation of user behavior data to a single domain, data sparsity problems are exacerbated, especially for new users or long-tail commodity recommendation. Second, there are differences in user preferences between different domains or platforms, and single-domain recommendation systems are difficult to effectively capture the behavior characteristics of users on other platforms, limiting the generalization ability of the model. Finally, single-domain recommendation systems are difficult to provide comprehensive cross-platform and cross-domain recommendations when users have diverse needs, and cannot meet the complex needs of users.
[0004] Cross-domain product recommendation is a popular research area in the current recommendation system field, aiming to solve recommendation problems across different platforms, domains, or scenarios. Traditional recommendation systems typically rely on user behavior data from a single platform or domain for modeling. However, in real life, user purchasing behavior often involves multiple platforms and domains, leading to data sparsity and domain bias issues, which affect recommendation performance. To address these challenges, deep learning-based cross-domain recommendation methods have gradually become a research hotspot in recent years, especially models combining multi-layer convolutional neural networks and contrastive learning, which can better extract cross-domain features of products and reduce the impact of domain bias. Although cross-domain recommendation systems have made some progress in addressing data sparsity and improving recommendation generalization capabilities, many challenges and problems remain. 1. Cross-domain recommendation systems face the problem of domain differences. User behavior and product characteristics vary significantly across different domains, and effectively capturing and integrating this heterogeneous data remains a challenge. 2. Cross-domain recommendation is easily restricted by data privacy and security when sharing data. Data cannot flow freely between different platforms, which affects model training and application. 3. The issue of feature alignment between domains has also attracted much attention. How to find features with consistency and relevance across different domains and establish efficient cross-domain mapping relationships remains a key problem that urgently needs to be solved. 4. Existing cross-domain recommendation methods have high computational complexity when processing large-scale data, making them difficult to adapt to real-time and efficiency requirements. Summary of the Invention
[0005] The purpose of this invention is to address the aforementioned problems by proposing a cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning, aiming to solve the data sparsity and cold-start issues in cross-domain recommendation. By extracting deep features of products through multi-layer convolutional blocks and combining this with a contrastive learning mechanism, more effective associations are established between different domains, thereby improving the generalization ability and robustness of the recommendation system. This method effectively optimizes the overall performance of the recommendation system, improving the accuracy and usability of recommendations.
[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0007] A cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning includes the following steps:
[0008] S1. Data Preprocessing: Data from three different domains of Amazon user behavior data, namely "Books", "CDs and Vinyl" and "Movies and TV", are used as the raw datasets and preprocessed.
[0009] S2. Model Training: First, construct source domain sequence graphs, target domain sequence graphs, and cross-domain global graphs based on user behavior data. Second, obtain the corresponding item embeddings by passing the three sequence graphs through a multi-layer encoder. Finally, obtain the final intra-domain item representation embeddings and inter-domain user preference embeddings through a non-linear layer and a contrastive learning module.
[0010] S3, Nonlinear Layer and Contrastive Loss: First, the obtained embeddings are nonlinearly projected, and the SoftMax function is used to make the item embeddings more informative. In the contrastive learning module, the InfoNCE function is used to calculate the loss, maximizing the mutual information between positive sample pairs and minimizing the consistency between negative sample pairs.
[0011] S4. Prediction Results: After obtaining the final intra-domain item representation view and inter-domain user preference view, the final prediction results are obtained through the contrastive learning module and linking operations.
[0012] S5. Model Evaluation: The model performance is evaluated and compared with other models by calculating the recall rate (Recall) and the normalized depreciation cumulative gain (NDCG).
[0013] Furthermore, as a preferred embodiment of the present invention, step S1 includes the following steps:
[0014] S101. Read user behavior data from the datasets of the three domains, namely user ID, item ID, rating and timestamp, and remove duplicate User-Item pairs;
[0015] S102. To alleviate the cold start problem, discard records that have been interacted with by users or items less than 5 times, and merge the three types of user data to reduce data sparsity and improve the generalization ability of the model.
[0016] S103. During the sampling process, negative samples are randomly sampled for each user using the popularity calculation method, and finally the training set, validation set and test set are divided in a ratio of 7:2:1.
[0017] Furthermore, as a preferred embodiment of the present invention, step S2 includes the following steps:
[0018] S201. Encode the user's historical behavior data to obtain an input sequence, and obtain a cross-domain global graph, a source domain sequence graph, and a target domain sequence graph from the input sequence;
[0019] S202. Input the three sequence maps into the corresponding multi-layer encoder, and after multiple convolutions, obtain the source domain sequence embedding E. S Target domain sequence embedding E T And global sequence embedding E;
[0020] S203. In order to alleviate the problem of data sparsity in cross-domain recommendation, the obtained embeddings are compared and learned separately, so that user preferences in different domains complement each other and learn self-supervised signals, thereby maximizing the mutual information between them.
[0021] Furthermore, as a preferred embodiment of the present invention, step S3 includes the following steps:
[0022] S301. In the prediction module, in order to obtain nonlinear information, nonlinear projection is applied to the output of the multi-layer encoder layer of each module, and the ReLU activation function is used to make the embedding have nonlinear features, thereby improving the representation ability of the model.
[0023] S302. In the contrastive learning module, InfoNCE is used as the loss function to maximize the similarity between positive samples and the target, minimize the similarity between negative samples and the target, help the model learn effective feature representations, and backpropagate the learned parameters.
[0024] Furthermore, as a preferred embodiment of the present invention, step S4 includes the following steps:
[0025] S401, After finally obtaining the source domain sequence embedding E S and target domain sequence embedding E T Subsequently, due to the inconsistent characteristics of projects in different domains, the data in the target domain will be relatively sparse. Linking operations are used to aggregate the embedded representations of the source and target domains in order to make full use of user information from different domains.
[0026] S402. In the final prediction module, the binary cross-entropy function is used as the model's loss function. The loss is calculated by measuring the difference between the predicted probability distribution and the true label, and the model's parameters are updated so that the model can output more accurate prediction results.
[0027] As a further preferred embodiment of the present invention, the multi-layer convolutional blocks are stacked using lightweight convolutional modules, and the propagation rule between each layer of convolutional blocks is as follows:
[0028]
[0029] in, It is the embedded representation of each user layer, N u It represents the degree of the corresponding User layer, N. i It is the degree of the corresponding layer item. This is a regularization term, and for each layer of the embedding matrix representation, we have:
[0030]
[0031] Where, the adjacency matrix A represents the number of non-zero entries in the i-th row vector. To achieve symmetry, we reduce it to one term.
[0032] Furthermore, as a preferred embodiment of the present invention, in order to make the obtained embedding representation have nonlinear characteristics, a nonlinear projection is applied at the exit of each multi-layer convolutional block:
[0033] h=RELU(W*Embedding(x)+b) (3)
[0034] Where W is the weight matrix of the activation function, Embedding(x) is the embedding vector, b is the bias, and ReLU is the activation function, which is used to improve the representational power of the model.
[0035] For the contrastive learning module, the InfoNCE function is used as the loss function:
[0036]
[0037] Where, x i It is the embedding of the sample, x j It is the positive sample embedding corresponding to the sample, x k It is the negative sample embedding corresponding to the sample, sim(x) i ,x j ) represents the cosine similarity between samples, and τ is the smoothing coefficient;
[0038] Therefore, for the learning of embedding preferences, we have:
[0039]
[0040] Furthermore, as a preferred embodiment of the present invention, since the characteristics of projects in different fields differ, the data in the target domain is usually sparse; in order to fully utilize user information from different fields, E is linked through a linking operation. S and E L For aggregation, the following are available for aggregation operations:
[0041]
[0042] For cross-domain recommendation models, the binary cross-entropy function is used as the loss function:
[0043]
[0044] Where j is the negative sampling term, σ(.) is the sigmoid function, and δ(x) is the negative sampling term. t+1 ) is a filler item.
[0045] Furthermore, as a preferred embodiment of the present invention, the recall rate is calculated to represent the proportion of truly relevant samples that the model successfully retrieves:
[0046]
[0047] Where TP is the number of samples correctly predicted as positive by the model, and FN is the number of samples that were actually positive but were not identified by the model.
[0048] The Normalized Discounted Cumulative Gain (NDCG) is calculated to measure the quality of the ranking results of cross-domain recommendation models.
[0049]
[0050] Where rel is the relevance score of the i-th sample. It is the relevance score of the result at the i-th position under ideal sorting conditions, and k is the first k results considered when calculating NDCG.
[0051] The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning described in this invention has the following technical advantages compared with existing technologies:
[0052] (1) Improve feature extraction capability: Multi-layer convolutional blocks can effectively extract high-dimensional features of goods, including multimodal information such as images and text, thereby improving the accuracy of the recommendation system.
[0053] (2) Enhance the generalization ability of the model: Contrastive learning can improve feature representation learning by constructing positive and negative sample pairs, enhance the model's generalization ability for cross-domain product recommendations, and enable it to have better transfer effects between different domains.
[0054] (3) Alleviating the problem of data sparsity: Cross-domain recommendation can use product data from multiple domains for joint training, which helps to alleviate the problem of data sparsity in a certain domain, thereby improving the coverage of recommendations.
[0055] (4) Reduce the impact of cold start: This method can effectively mine the feature relationship of similar products across domains through the contrastive learning mechanism, thereby alleviating the cold start problem of the recommendation system in the context of new products or new users. Attached Figure Description
[0056] Figure 1 This is a flowchart of the method steps in an embodiment of the present invention.
[0057] Figure 2 This is a model architecture diagram of an embodiment of the present invention. Detailed Implementation
[0058] The present invention will be further explained in detail below with reference to the accompanying drawings, so that those skilled in the art can better understand and implement the present invention. However, the following examples are only used to explain the present invention and are not intended to limit the present invention.
[0059] like Figure 2 As shown, a graph structure is constructed based on the user's historical interaction behavior, connecting nodes such as users, interaction behaviors, and products to form a complete graph representation. Then, the model extracts product features from the source domain, global domain, and target domain through multiple GCN layers, generating corresponding embedding representations. These embedding representations are optimized by a contrastive learning module, further improving the feature representation quality and discriminative ability. Next, the multi-domain features optimized by contrastive learning are integrated through feature fusion operations, and finally, the recommendation result is output through the prediction module. This architectural design can fully utilize cross-domain information and improve the accuracy and generalization ability of the recommendation system through the graph structure feature extraction of GCN and the optimization mechanism of contrastive learning.
[0060] like Figure 1 As shown, a cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning includes the following steps:
[0061] S1: Data preprocessing. To test the effectiveness of the cross-domain recommendation method, we used data from three different domains of Amazon user behavior data—"Books," "CDs and Vinyl," and "Movies and TV"—as the original dataset and preprocessed the data.
[0062] S2: Model training begins by constructing source domain sequence graphs, target domain sequence graphs, and cross-domain global graphs using user behavior data. Next, the three sequence graphs are processed through a multi-layer encoder to obtain corresponding item embeddings. Finally, a non-linear layer and a contrastive learning module are used to obtain the final intra-domain item representation embeddings and inter-domain user preference embeddings.
[0063] S3: Nonlinear Layer and Contrastive Loss: First, the obtained embeddings are nonlinearly projected, and the SoftMax function is used to enrich the information in the item embeddings. In the contrastive learning module, the InfoNCE function is used to calculate the loss, maximizing the mutual information between positive sample pairs and minimizing the consistency between negative sample pairs.
[0064] S4: Prediction Results: After obtaining the final intra-domain item representation view and inter-domain user preference view, the final prediction results are obtained through the contrastive learning module and linking operations.
[0065] S5: Model Evaluation: Evaluate model performance by calculating recall and normalized depreciation cumulative gain (NDCG) and compare it with other models.
[0066] S2 specifically refers to: multi-layer convolutional blocks using lightweight convolutional modules stacked in multiple layers, with the propagation rule between each layer being:
[0067]
[0068] in, It is the embedded representation of each user layer, N u It represents the degree of the corresponding User layer, N. i It is the degree of the corresponding layer item. This is the regularization term. For each layer of the embedding matrix representation, we have:
[0069]
[0070] Where, the adjacency matrix A represents the number of non-zero entries in the i-th row vector. To achieve symmetry, we reduce it to one term.
[0071] S3 specifically involves applying a nonlinear projection at the exit of each multi-layer convolutional block to ensure the obtained embedding representation has nonlinear characteristics.
[0072] h=RELU(W*Embedding(x)+b) (3)
[0073] Where W is the weight matrix of the activation function, Embedding(x) is the embedding vector, b is the bias, and ReLU is the activation function, which are used to improve the representational power of the model.
[0074] For the contrastive learning module, the InfoNCE function is used as the loss function:
[0075]
[0076] Where, x i It is the embedding of the sample, x j It is the positive sample embedding corresponding to the sample, x k It is the negative sample embedding corresponding to the sample, sim(x) i ,x j ) is the cosine similarity between samples, and τ is the smoothing coefficient.
[0077] Therefore, for the learning of embedding preferences, we have:
[0078]
[0079] S4 specifically addresses the issue that data in the target domain is typically sparse due to differences in the characteristics of projects across different domains. To fully utilize user information from different domains, a linking operation is used to connect E... S and EL For aggregation, the following are available for aggregation operations:
[0080] E = [E S E L (6)
[0081] For cross-domain recommendation models, the binary cross-entropy function is used as the loss function:
[0082]
[0083] Where j is the negative sampling term, σ(.) is the sigmoid function, and δ(x) is the negative sampling term. t+1 ) is a filler item.
[0084] Recall is a measure of a model's ability to retrieve positive (or relevant) samples. It represents the proportion of truly relevant samples that the model successfully retrieves.
[0085]
[0086] TP is the number of samples correctly predicted as positive by the model, and FN is the number of samples that were actually positive but were not identified by the model.
[0087] The Normalized Discounted Cumulative Gain (NDCG) is calculated to measure the quality of the ranking results of cross-domain recommendation models.
[0088]
[0089] rel is the relevance score of the i-th sample. It is the relevance score of the result at the i-th position under ideal sorting conditions, and k is the first k results considered when calculating NDCG.
[0090] This invention proposes a cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning. It integrates multi-layer convolutional blocks, contrastive learning, and linking techniques to alleviate the inherent problems of data sparsity and feature differences in cross-domain recommendation systems. This enhances the recommendation system's understanding of the potential similarities between products, improves the model's generalization ability, and increases the accuracy of cross-domain recommendations.
[0091] The specific implementation schemes described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific implementation schemes of the present invention and are not intended to limit the scope of the present invention. Any equivalent changes and modifications made by those skilled in the art without departing from the concept and principles of the present invention should fall within the scope of protection of the present invention.
Claims
1. A cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning, characterized in that, Includes the following steps: S1. Data Preprocessing: Using data from three different domains of Amazon user behavior data—"Books," "CDs and Vinyl," and "Movies and TV"—as the raw dataset, the data is preprocessed. S2. Model Training: First, construct source domain sequence graphs, target domain sequence graphs, and cross-domain global graphs based on user behavior data. Second, obtain the corresponding item embeddings by passing the three sequence graphs through a multi-layer encoder. Finally, obtain the final intra-domain item representation embeddings and inter-domain user preference embeddings through a non-linear layer and a contrastive learning module. Step S2 includes the following steps: S201. Encode the user's historical behavior data to obtain an input sequence, and obtain a cross-domain global graph, a source domain sequence graph, and a target domain sequence graph from the input sequence; S202. Input the three sequence maps into the corresponding multi-layer encoder, and after multiple convolutions, obtain the source domain sequence embedding. Target domain sequence embedding and global sequence embedding ; S203. In order to alleviate the problem of data sparsity in cross-domain recommendation, the obtained embeddings are compared and learned separately to enable user preferences in different domains to complement each other and learn self-supervised signals, thereby maximizing the mutual information between them. Multi-layer convolutional blocks are constructed using lightweight convolutional modules stacked in multiple layers. The propagation rules between each convolutional block are as follows: (1); in, It is the embedded representation of each user layer. It corresponds to the user level. It is the degree of the corresponding layer item. This is a regularization term, and for each layer of the embedding matrix representation, we have: (2); Where, the adjacency matrix A represents the number of non-zero entries in the i-th row vector. To reduce to a single term for symmetry; S3, Nonlinear Layer and Contrastive Loss: First, the obtained embeddings are nonlinearly projected, and the SoftMax function is used to make the item embeddings more informative. In the contrastive learning module, the InfoNCE function is used to calculate the loss, maximizing the mutual information between positive sample pairs and minimizing the consistency between negative sample pairs. S4. Prediction Results: After obtaining the final intra-domain item representation view and inter-domain user preference view, the final prediction results are obtained through the contrastive learning module and linking operations. S5. Model Evaluation: The model performance is evaluated by calculating the recall rate and the normalized depreciation cumulative gain (NDCG).
2. The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning according to claim 1, characterized in that, Step S1 includes the following steps: S101. Read user behavior data from the datasets of the three domains, namely user ID, item ID, rating and timestamp, and remove duplicate User-Item pairs; S102. To alleviate the cold start problem, discard records that have been interacted with by users or items less than 5 times, and merge the three types of user data to reduce data sparsity and improve the generalization ability of the model. S103. During the sampling process, negative samples are randomly sampled for each user using the popularity calculation method, and finally the training set, validation set and test set are divided in a ratio of 7:2:
1.
3. The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning according to claim 1, characterized in that, Step S3 includes the following steps: S301. In the prediction module, in order to obtain nonlinear information, a nonlinear projection is applied to the output of the multi-layer encoder layer of each module, and the ReLU activation function is used to make the embedding have nonlinear features, thereby improving the representation ability of the model. S302. In the contrastive learning module, InfoNCE is used as the loss function to maximize the similarity between positive samples and the target, minimize the similarity between negative samples and the target, help the model learn effective feature representations, and backpropagate the learned parameters.
4. The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning according to claim 3, characterized in that, Step S4 includes the following steps: S401, finally obtaining the source domain sequence embedding and target domain sequence embedding Subsequently, due to the inconsistent characteristics of projects in different domains, the data in the target domain will be relatively sparse. Linking operations are used to aggregate the embedded representations of the source and target domains in order to make full use of user information from different domains. S402. In the final prediction module, the binary cross-entropy function is used as the model's loss function. The loss is calculated by measuring the difference between the predicted probability distribution and the true label, and the model's parameters are updated so that the model can output more accurate prediction results.
5. The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning according to claim 1, characterized in that, To ensure the obtained embedding representation has nonlinear properties, a nonlinear projection is applied at the exit of each multi-layer convolutional block: (3); in, It is the weight matrix of the activation function. It is an embedded vector. It's a bias. It is an activation function, used to improve the model's representational power; For the contrastive learning module, the InfoNCE function is used as the loss function: (4); in, It is the embedding of samples. It is the embedding of the positive sample corresponding to the sample. It is the negative sample embedding corresponding to the sample. It is the cosine similarity between samples, and τ is the smoothing coefficient; Therefore, for the learning of embedded preferences, we have: (5)。 6. The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning according to claim 3, characterized in that, Because projects in different domains have different characteristics, data in the target domain is usually sparse; to fully utilize user information from different domains, linking operations are used to... and For aggregation, the following are available for aggregation operations: (6); For cross-domain recommendation models, the binary cross-entropy function is used as the loss function: (7); in, It is a negative sampling term. It is the sigmoid function. It is a filler item.
7. The cross-domain product recommendation method based on multi-layer convolutional blocks and contrastive learning according to claim 4, characterized in that, Recall is calculated as the proportion of truly relevant samples that the model successfully retrieves. (8); Where TP is the number of samples correctly predicted as positive by the model, and FN is the number of samples that were actually positive but were not identified by the model. The Normalized Discounted Cumulative Gain (NDCG) is calculated to measure the quality of the ranking results of cross-domain recommendation models. (9); in, It is the first The relevance score of each sample It is the first in the ideal sorting case The relevance score of the results at each position. It is the first thing to consider when calculating NDCG. One result.
Citation Information
Patent Citations
GCN recommendation method based on comparative learning improvement
CN116503137A
Recommendation method based on comparative learning and multi-behavior semantic enhancement
CN118113938A