A cross-domain cold start item recommendation method based on triple contrast learning
By constructing a cross-domain cold-start item recommendation model using a triple contrastive learning approach, this approach addresses the issues of insufficient utilization of interactive information and domain differences in cross-domain recommendation, improves the quality of item content representation, and achieves more accurate recommendations.
Patent Information
- Application Number
- CN202411423689.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-10-12
AI Technical Summary
Existing cold-start item recommendation methods have limited utilization of interaction information of hot items in cross-domain recommendation, cannot reduce the domain differences between the source and target domains, and the quality of item content representation is easily compromised.
A triple contrastive learning approach is adopted, including self-contrast learning, source domain contrastive learning, and cross-domain contrastive learning, to construct a cross-domain cold-start item recommendation model. The self-contrast learning task aligns the attributes and graph representations of items, the source domain contrastive learning task aligns collaboratively similar items within the source domain, and the cross-domain contrastive learning task aligns the content features of different domains. The representations are updated using a multilayer perceptron and a graph attention network, and a total loss function is constructed for optimization.
By fully utilizing the collaborative information of hot items, reducing domain differences, and improving the quality of item content representation, the data sparsity problem in cold-start item recommendation is solved, thus improving the recommendation effect.
Smart Images

Figure CN119415770B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of recommendation systems and deep learning, and in particular to a cross-domain cold-start item recommendation method based on triple contrast learning. BACKGROUND
[0002] Traditional collaborative filtering recommendation methods rely on user-item interaction data to achieve recommendation, but in the face of cold-start items with sparse interaction data, collaborative filtering recommendation methods perform poorly. Since cold-start items are ubiquitous in real-world application scenarios, such as new items on the Taobao shopping website, cold-start item recommendation research has received significant attention.
[0003] Since cold-start items are ubiquitous in real-world application scenarios, such as new items on the Taobao shopping website, cold-start item recommendation research has received significant attention. In the research of cold-start item recommendation, existing methods can be divided into four categories: content-based methods, meta-learning-based methods, robust learning-based methods, and transfer learning-based methods. Content-based methods use item content, knowledge graphs, and other information to connect cold items and hot items, thereby connecting user interests and cold items. Meta-learning-based methods take advantage of few-shot learning to locally update the parameters of the recommendation model with a small amount of interaction data, allowing the recommendation model to converge faster when facing cold items. Robust learning-based methods treat cold items as hot items with missing interaction data, and simulate the interaction information of cold items by randomly disturbing the interaction information of hot items. Transfer learning-based methods usually combine cross-domain recommendation, transfer interaction information between domains using common users or items, and enrich the information of the interaction-sparse domain. However, most of the above research methods do not fully utilize the connection between interaction information and content information.
[0004] In recent years, with the advantage of being able to maximize the mutual information between positive sample pairs, contrast learning has been used by many studies to maximize the mutual information between content representations and interaction representations, allowing cold items to more accurately utilize existing interaction data. For example, the CLCRec model maximizes the interaction information between user interaction representations and hot item interaction representations, as well as the interaction information between hot item interaction representations and hot item content representations, to train an item content vector encoder. Cold items obtain item representations through this encoder. However, whether it is the four existing methods or the methods combined with contrast learning, existing cold-start item recommendation research mainly focuses on single-domain items, and there is less research on domain cold-start recommendation.
[0005] The field cold start recommendation refers to starting a recommendation field, and an item has no interaction information in the field, and usually the rich interaction information of a source field is used to start item recommendation of a target field. The scenario of the field cold start recommendation also has important practical significance, for example, a company can expand the business of a new field based on the user data of an existing field, so the field cold start recommendation is a problem worthy of attention. However, the following limitations exist when the general method of the existing cold start item recommendation is directly applied to the field cold start recommendation: 1. the interaction information of a hot item is limited, 2. the field difference between the source field and the target field cannot be reduced, and the use of useless information is easy to damage the quality of the content representation of the item. Therefore, when cross-domain cold start item recommendation is performed, how to fully use the interaction information of the hot item, reduce the difference between the features of different fields, and improve the quality of the content representation of the item becomes a problem to be solved in the field. SUMMARY
[0006] The purpose of the present application is to overcome the defects of the prior art that the interaction information of a hot item is limited, the field difference cannot be reduced, and the quality of the content representation of the item is easy to be damaged, and to provide a cross-domain cold start item recommendation method based on triple contrast learning.
[0007] The purpose of the present application can be achieved by the following technical solutions:
[0008] According to a first aspect of the present application, a cross-domain cold start item recommendation method based on triple contrast learning is provided, comprising the following steps: obtaining attribute information, knowledge graph information of items in a source field and a target field, and interaction information of a user and an item in the source field; performing biased processing on the attribute information and the knowledge graph information to obtain corresponding initial attribute representation and initial graph representation, and using a multi-hot encoding method to obtain an initial user representation from the interaction information; based on the initial attribute representation, using a multi-layer perception to obtain a screened attribute representation, and based on the initial graph representation, using a graph attention network to obtain an aggregated graph representation; based on the current attribute representation, the graph representation and the interaction information, using a trained cross-domain cold start item recommendation model to obtain a recommendation result; wherein the construction and training process of the cross-domain cold start item recommendation model comprises: constructing a self-contrast learning task, a source field contrast learning task and a cross-domain contrast learning task respectively, and then obtaining an initial cross-domain cold start item recommendation model; based on the attribute representation and the graph representation, constructing a self-contrast learning loss function, a source field contrast learning loss function and a cross-domain contrast learning loss function respectively, and based on the corresponding user representation, constructing a BPR loss function; based on the self-contrast learning loss function, the source field contrast learning loss function, the cross-domain contrast learning loss function and the BPR loss function, constructing a total loss function; and using the total loss function to train and optimize the constructed cross-domain cold start item recommendation model.
[0009] As a preferred technical solution, the process of constructing the self-contrast learning task specifically comprises: taking the current attribute representation and the current graph representation as anchor points of first self-contrast learning and second self-contrast learning respectively; taking the current graph representation and the current attribute representation as positive samples of the first self-contrast learning and the second self-contrast learning respectively; calculating cosine similarity of the current attribute representation and graph representations of other same-domain items, and cosine similarity of the current graph representation and attribute representations of other same-domain items respectively, and selecting graph representations and attribute representations satisfying the first preset condition as negative samples of the first self-contrast learning and the second self-contrast learning respectively; and constructing first self-contrast learning loss function and second self-contrast learning loss function based on the respective anchor points, positive samples and negative samples.
[0010] As a preferred technical solution, the calculation formula of the total loss function is:
[0011]
[0012] In the formula, λ1, λ2, λ3 and λ4 are different weight parameters, represents the first self-contrast learning loss, represents the second self-contrast learning loss, represents the source domain contrast learning loss, represents the cross-domain contrast learning loss, represents the BPR loss, and Θ represents all hyperparameters of the cross-domain cold-start item recommendation model that need to be updated.
[0013] As a preferred technical solution, the process of constructing the source domain contrast learning task specifically comprises: merging the current attribute representation and the graph representation of the same source domain item to obtain an item representation of the source domain; taking the item representation of the source domain as an anchor point of the source domain contrast learning; calculating collaborative similarity between the item of the source domain and items of other source domains, and selecting item representations satisfying a second preset condition as positive samples; calculating cosine similarity between the item representation of the source domain and item representations of other source domains, and selecting item representations satisfying a first preset condition as negative samples; and constructing a source domain contrast learning loss function based on the determined anchor point, positive samples and negative samples.
[0014] As a preferred technical solution, the expression of the collaborative similarity is:
[0015]
[0016] In the formula, is a user set that has clicked on a source domain item v s , is a user set that has clicked on another source domain item v j ;
[0017] The expression of the source domain contrast learning loss function is:
[0018]
[0019] In the formula, V s is a set of all source domain items in this round, is the item representation of the source domain item v s is a set of positive samples, is the item representation of the source domain item v s is a set of negative samples, is the item representation of the source domain, is the item representation of the positive sample of the source domain item v is the item representation of the negative sample of the source domain item v is the item representation of the negative sample of the source domain item v is the item representation of the source domain, and τ is a temperature coefficient.
[0020] As a preferred technical solution, the process of constructing the cross-domain contrast learning task specifically includes: merging the current attribute representation and the graph representation of the same source domain item, and the current attribute representation and the graph representation of the same target domain item, respectively, to obtain the item representation of the source domain and the item representation of the target domain; taking the item representation of the source domain as an anchor point of cross-domain contrast learning; calculating the content similarity between the source domain item and other target domain items, and selecting the item representation satisfying the second preset condition as a positive sample; calculating the cosine similarity between the item representation of the source domain and the item representation of other target domains, and selecting the item representation satisfying the first preset condition as a negative sample; and constructing a cross-domain contrast learning loss function based on the determined anchor point, positive sample and negative sample.
[0021] As a preferred technical solution, the expression of the content similarity is:
[0022]
[0023] In the formula, D st is the Euclidean distance between the source domain item v s and the target domain item v t , D min is the minimum value of the Euclidean distance between the source domain item v s and all target domain items, and D max is the maximum value of the Euclidean distance between the source domain item v s and all target domain items.
[0024] The expression of the cross-domain contrast learning loss function is:
[0025]
[0026] In the formula, V S is a set of all source domain items in this round, a positive sample set of the source domain item v s , a negative sample set of the source domain item v s , an item representation of the source domain, an item representation of the target domain positive sample , an item representation of the target domain negative sample , and τ is a temperature coefficient.
[0027] As a preferred technical solution, the calculation formula of the BPR loss function is:
[0028]
[0029] wherein:
[0030] O = {(v s , u + , u - ) | (v s , u + ) ∈ O + , (v s , u - ) ∈ O / +}
[0031]
[0032]
[0033] In the formula, V S is a set of all source domain items, u + represents a user who has clicked on the source domain item v s , u - represents a user who has not clicked on the source domain item v s , is the inner product, σ is the sigmoid function, Z (·) represents a user representation, is an item representation of the source domain.
[0034] As a preferred technical solution, the attribute information and the knowledge graph information are subjected to biased processing to obtain initial attribute representations and initial graph representations of the items, specifically including: extracting noun information and category noun information from the attribute information using TextBlob and merging them into a sentence sequence, inputting the sentence sequence into a preset Bert model to obtain the initial attribute representations; based on the knowledge graph information, using a preset TransR model and a method of randomly deleting edges to obtain multiple subgraphs, calculating similarity scores of the same item on different subgraphs to further obtain corresponding initial graph representations.
[0035] As a preferred technical solution, based on the initial attribute representation, a multi-layer perception is used to obtain a screened attribute representation, and based on the initial graph representation, a graph attention network is used to obtain an aggregated graph representation, specifically comprising: updating the initial attribute representation of the item: taking the initial attribute representation as input, sequentially passing through a multi-layer perception composed of three linear layers and two activation layers, further screening the initial attribute representation, and outputting an attribute representation with unchanged dimension as the screened attribute representation, the activation layer adopts an ELU activation function; updating the initial graph representation of the item: taking the initial graph representation as input, using the graph attention network to biasly aggregate the information of neighbor entities, obtaining the aggregated graph representation, and the weight of the neighbor entity is calculated according to the relationship between the item entity and the neighbor entity.
[0036] Compared with the prior art, the present application has the following beneficial effects:
[0037] 1、The field cold start recommendation method provided by the present application uses a cross-domain cold start item recommendation model based on a self-contrast learning task, a source domain contrast learning task and a cross-domain contrast learning task to complete recommendation, which can fully utilize the collaborative information of hot items, reduce the domain difference between the source domain and the target domain, and improve the representation quality of the item content, and in the overall framework, the three contrast learning tasks are dependent on each other layer by layer, the source domain contrast learning relies on the self-contrast learning to reduce the migration of noise in the item representation, and the cross-domain contrast learning relies on the source domain contrast learning to increase the interaction information in the item representation, and the joint optimization of the total loss progressively weights the three contrast learning tasks, which can gradually increase the improvement of the contrast learning task on the item representation;
[0038] 2、The self-contrast learning task constructed by the present application takes the attribute representation and the graph representation of the item as the anchor points of the contrast learning respectively, designs two kinds of contrast learning, the two kinds of representations of the item itself are positive samples for each other, and the negative samples are selected by using the cosine similarity between vectors, and then the loss of the self-contrast learning task is calculated, the self-contrast learning task uses the biased processed attribute information and knowledge graph information of the item to obtain the initial attribute representation and the initial graph representation, and then uses a multi-layer perception and a graph attention network to update the attribute representation and the graph representation respectively, which can effectively avoid that the representation of the item contains too much useless information, and obtain a higher quality item representation;
[0039] 3、The source domain contrast learning task constructed by the application, the attribute representation and the graph representation of the article are combined, the article representation is obtained, and then the contrast learning of the collaborative similar articles in the source domain is designed, the article representation of the source domain is used as an anchor point, the positive samples are selected by using the collaborative similarity between the source domain article and other source domain articles, the negative samples are selected by using the cosine similarity, and then the loss of the source domain contrast learning task is calculated, the content information of the collaborative similar articles in the source domain can be aligned, and the collaborative similar information is memorized into the content information, so that the target domain article can more fully use the collaborative information of the source domain article through the content information, the data sparsity problem of cold start article recommendation can be solved, and the training effect of the content coding model is improved;
[0040] 4、The cross-domain contrast learning task constructed by the application combines the attribute representation and the graph representation of the same source domain article and the attribute representation and the graph representation of the same target domain article, respectively, obtains the article representation of the source domain and the article representation of the target domain, and then designs the contrast learning of similar articles between domains, uses the article representation of the source domain as an anchor point, selects positive samples by using the content similarity between the source domain article and other target domain articles, selects negative samples by using the cosine similarity, and then calculates the loss of the cross-domain contrast learning task, that is, for the content similar source domain article and target domain article, the weight combination of the content features of the articles is aligned by using the contrast learning, and the field difference of the field cold start recommendation can be effectively reduced. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 A flowchart of the method provided by the application is provided.
[0042] Figure 2 A construction and training process diagram of the cross-domain cold start article recommendation model in the embodiment of the application is provided. DETAILED DESCRIPTION
[0043] Based on the existing cold start article recommendation method, the following problems exist in realizing field cold start recommendation:
[0044] Firstly, the interaction information of hot items is limited. Specifically, if two items are clicked by the same user, the two items are mutual collaborative items, and the collaborative similarity can be defined according to the number of common clicked users. Aligning two items with a certain collaborative similarity can increase the probability of the items being clicked by potential users. Since the cold items only have content information, aligning the collaborative similar hot items from the content level, training a collaborative aligned content encoding model can intuitively consider that the cold items can make full use of the collaborative information of the hot items. However, most cold start item recommendation methods ignore the collaborative similarity between hot items at the content level. Although the CCFCRec model considers collaborative similar items, it does not directly use the content information of the collaborative similar items, but aligns the content representation of the items and the interaction representation of the collaborative items. Since the encoded information of the interaction representation and the content representation is different, intuitively, aligning the two will affect the training effect of the content encoding model. To solve this problem, the field cold start recommendation method provided by the present application aligns the content information of the collaborative similar items by constructing a source domain contrast learning task, so as to fully utilize the interaction information of the hot items.
[0045] Secondly, it is impossible to reduce the domain difference between the source domain and the target domain. The difference between the domains is that the content features are paid different attention degrees by the recommendation system in different domains. For example, in the book domain, the genre and the literary style attribute are almost equally paid attention by the recommendation system; in the movie domain, the movie type is usually paid more attention by the recommendation system than the movie style. The general method of cold start item recommendation cannot reduce the domain difference by adjusting the content representation of the items during the training of the model, because the content information of the cold items is ignored during the training of the model. If the content information of the cold items is explicitly considered during the training of the model, the weight combination of the content features of the cross-domain items aligned by the auxiliary information will increase the recommendation probability of the target domain items. To solve this problem, the field cold start recommendation method provided by the present application aligns the content feature combination mode of the items in different domains by constructing a cross-domain contrast learning task, so as to fully reduce the difference between different domains.
[0046] In addition, most general cold start item recommendation methods are based on the content information or auxiliary information such as knowledge graph of the cold items to realize recommendation, however, there is some useless information in these information, which will damage the quality of the content representation of the items, thereby affecting the effect of recommendation, and most existing cold start item recommendation researches ignore the biased processing of different information. To solve this problem, the field cold start recommendation method provided by the present application aligns the attribute representation and the graph representation generated after the biased processing of information by constructing a self-contrast learning task of the items, so as to improve the quality of the content representation of the items.
[0047] Therefore, the field cold start recommendation method provided by the application can improve the quality of item content representation while fully utilizing the interaction information of hot items and reducing the difference between different fields, thereby obtaining high-quality target domain item representation and better achieving field cold start recommendation.
[0048] It should be clear that the cold start item / cold item in the application refers to an item that completely lacks user interaction data, and the hot item refers to an item that has user interaction data.
[0049] The application will be described in detail below in conjunction with the drawings and specific embodiments. The embodiments are implemented on the premise of the technical solution of the application, and detailed implementation modes and specific operation processes are given, but the protection scope of the application is not limited to the following embodiments.
[0050] Embodiments
[0051] As shown in Figure 1 , the present embodiment provides a cross-domain cold start item recommendation method based on triple contrast learning. The method first acquires attribute information, knowledge graph information of items in the source domain and the target domain, and interaction information of users and source domain items. Second, the attribute information and the knowledge graph information are processed in a biased manner to obtain the initial attribute representation and the initial graph representation, and the initial user representation is obtained from the interaction information using a multi-hot encoding method. Third, based on the initial attribute representation, a multi-layer perception machine is used to obtain the screened attribute representation, and based on the initial graph representation, a graph attention network is used to obtain the aggregated graph representation. Finally, based on the current attribute representation, graph representation and interaction information, a trained cross-domain cold start item recommendation model is used to obtain the recommendation result. The method is based on a triple contrast learning task, which aims to fully utilize the collaborative information of hot items, reduce the difference between the source domain and the target domain, and perform biased processing on item content information and auxiliary information, so as to obtain high-quality target domain item representation and better achieve cross-domain cold start item recommendation.
[0052] The specific implementation process of the foregoing method is as follows:
[0053] Step 1: Collect attribute information, knowledge graph information of items in the source domain and the target domain, and interaction information of users and source domain items. Process the attribute information and the knowledge graph information in a biased manner to obtain the initial attribute representation and the initial graph representation, and obtain the initial user representation from the interaction information using a multi-hot encoding method. Specifically:
[0054] (1) Collect information: Collect attribute information of items, including category and item description; collect knowledge graph information of items, including triples composed of entities corresponding to items; and collect interaction records of users and source domain items.
[0055] (2) Generating the initial attribute representation of the item: After collecting information, TextBlob is used to extract category nouns and nouns from the item description text. Non-noun information is filtered out, and the extracted nouns and category nouns are merged into a sentence. The sentence is input into the preset BERT model to obtain the initial vector of attributes, i.e., the initial attribute representation.
[0056] (3) Generate the initial graph representation of the item: First, input the knowledge graph information into the preset TransR model to obtain the entity vector e. v Then, by randomly deleting edges, two subgraphs kg1 and kg2 of the knowledge graph are obtained, and the similarity score s of the same item entity on kg1 and kg2 is calculated. v For item v x Its initial spectral characterization The calculation formula is:
[0057]
[0058] In the formula, N represents the value of item v. x The set of neighboring entities.
[0059] (4) Generate initial user representation: Use the {0,1} array of multi-hot encoding to obtain the initial user representation. Based on the interaction information, if user u has interacted with item v, then the value of the v-th element of the array is 1; otherwise, it is 0.
[0060] Step 2: Input the initial attribute representation of the item into the multilayer perceptron to obtain the attribute representation after feature filtering; input the initial graph representation of the item into the graph attention network to obtain the graph representation that aggregates the information of neighboring entities.
[0061] Update the initial attribute representation of the item. Characterize the initial attributes As input, the initial attribute representations are passed sequentially through a multilayer perceptron consisting of three linear layers and two activation layers to further filter the initial attribute representations. The attribute representations with unchanged output dimensions are then used as the filtered attribute representations. The activation layer uses the ELU activation function;
[0062] Update the initial atlas representation of the item. Characterize the initial map As input, a graph attention network is used to biasedly aggregate information from neighboring entities to obtain the aggregated graph representation. The weight of a neighboring entity is calculated based on the relationship between the item entity and its neighboring entities.
[0063] Step 3: Based on the current attribute representation spectral characterization obtaining a recommendation result by using the trained cross-domain cold start item recommendation model.
[0064] As shown in Figure 2 , the construction process of the cross-domain cold start item recommendation model includes: constructing a self-contrast learning task, a source domain contrast learning task, and a cross-domain contrast learning task, and then obtaining an initial cross-domain cold start item recommendation model; on this basis, based on the first attribute representation and the first graph representation, a self-contrast learning loss function, a source domain contrast learning loss function, and a cross-domain contrast learning loss function are constructed respectively, and based on the corresponding user representation, a BPR loss function is constructed; based on the self-contrast learning loss function, the source domain contrast learning loss function, the cross-domain contrast learning loss function, and the BPR loss function, a total loss function is constructed; the training process includes: training and optimizing the constructed cross-domain cold start item recommendation model by using the total loss function. Specifically:
[0065] Step 301: constructing a self-contrast learning task
[0066] (1) constructing a first self-contrast learning loss function and calculating the loss:
[0067] The current attribute representation is taken as the anchor point of the first self-contrast learning;
[0068] The positive sample is the graph representation x of the item v
[0069] The selection process of the negative sample is: first, calculate the cosine similarity of the graph representation of the item v and the graph representation of other same-domain items, and then take the graph representation of the 40 items with the highest similarity (i.e., the first preset condition) as the negative sample;
[0070] According to the selected positive and negative samples, the first self-contrast learning loss is calculated, and the calculation formula is:
[0071]
[0072] In the formula, V is the set of all items in this round, is the graph representation of another same-domain item v x , sim(x, y) calculates the cosine similarity between vectors x and y, τ is the temperature coefficient, is the graph representation of another same-domain item v j′ .
[0073] (2) constructing a second self-contrast learning loss function and calculating the loss:
[0074] The current graph representation As an anchor point for second self-contrast learning;
[0075] Positive samples are items v x Attribute representation
[0076] The process of selecting negative samples is as follows: First, calculate... The cosine similarity of attribute representations with other items in the same domain is used to select the attribute representations of 40 items with similarity scores between Top 1 and Top 40 (i.e., the first preset condition) as negative samples; based on the selected positive and negative samples, a second self-contrast learning loss is calculated. The calculation formula is as follows:
[0077]
[0078] In the formula, It is item v x The negative sample set uses graphical representation as the anchor point for contrastive learning. For another item of the same domain v j′ The attribute representation.
[0079] Step 302: Construct the source domain contrast learning task
[0080] (1) Generate item representations from the source domain:
[0081] Items from the same source domain v s The current attribute representation and graph representation are horizontally stitched together to obtain the item representation of the source domain. Represented as:
[0082]
[0083] (2) Select positive and negative samples for source domain contrastive learning:
[0084] Represented by items from the source domain As an anchor point for comparative learning;
[0085] The process of selecting positive samples is as follows: First, calculate the source domain item v. s Collaborative similarity with other source domain items, searching for interaction behaviors and v s For similar source domain items, the item representations of the 10 items with similarity between Top 1 and Top 10 (i.e., the second preset condition) are selected as positive samples.
[0086] The process of selecting negative samples is as follows: First, calculate... and other source domain item representations, and then the similarity is Top1~Top40 (i.e., the first preset condition) 40 item representations as negative samples, if the item in the negative sample has been used as a positive sample, the item is deleted from the negative sample, and the item is extended according to the cosine similarity. Wherein, the calculation formula of the collaborative similarity is:
[0087]
[0088] In the formula, is the user set that has clicked the source domain item v s , is the user set that has clicked another source domain item v j .
[0089] (3) Construct the source domain contrast learning loss function and calculate the contrast learning loss:
[0090] According to the selection of positive and negative samples, the source domain contrast learning loss is calculated, and the formula is:
[0091]
[0092] In the formula, V s is the set of all source domain items in this round, is the set of positive samples of the source domain item v s , is the set of negative samples of the source domain item v s , is the item representation of the source domain, is the item representation of the source domain positive sample , is the item representation of the source domain negative sample .
[0093] Step 303: Construct the cross-domain contrast learning task
[0094] (1) Generate the item representation of the source domain and the target domain respectively:
[0095] The attribute representation and the graph representation of the same item are transversely spliced to obtain the item representation of the source domain and the item representation of the target domain
[0096] (2) Select the positive and negative samples of cross-domain contrast learning:
[0097] Take the item representation of the source domain as the anchor point of contrast learning;
[0098] The selection process of the positive sample is: first, calculate the item v scontent similarity between v and other target domain items, find semantic similarity with v s Similar target domain items, select the top 10 item representations with similarity as positive samples (i.e., the second preset condition);
[0099] The selection process of negative samples is as follows: first, calculate and the cosine similarity of the representations of other target domain items, select the representations of 40 items with similarity in Top1-Top40 (i.e., the first preset condition) as negative samples, if an item in the negative samples has been selected as a positive sample, delete the item from the negative samples, and extend the items according to the cosine similarity. The formula for calculating the content similarity is as follows:
[0100]
[0101] In the formula, D st is the Euclidean distance between the source domain item v s and the target domain item v t , D min is the minimum value of the Euclidean distance between the source domain item v s and all target domain items, and D max is the maximum value of the Euclidean distance between the source domain item v s and all target domain items.
[0102] (3) Construct a cross-domain contrast learning loss function and calculate the loss of contrast learning:
[0103] According to the selected positive and negative samples, calculate the cross-domain contrast learning loss, and the formula is as follows:
[0104]
[0105] In the formula, V s is the set of all source domain items in this round, is the positive sample set of the source domain item v s , is the negative sample set of the source domain item v s , is the item representation of the source domain, is the item representation of the positive sample (target domain item) , is the item representation of the negative sample (target domain item) .
[0106] Step 304: Based on the user representation obtained from the user interaction information with the source domain item, construct a BPR loss function, and then construct a total loss function, realize the construction and training optimization of the cross-domain cold start item recommendation model, and recommend items to users using the trained model.
[0107] (1) Calculate the loss of BPR function:
[0108] For the source domain item v s , according to the actual source domain item click relationship, the BPR loss function is calculated according to the item representation and the user representation , and the calculation formula is:
[0109]
[0110] Wherein:
[0111] o={(v s ,u + ,u - )|(v s ,u + )∈o + ,(v s ,u - )∈o / +} (10)
[0112]
[0113] In the formula, V s is the set of all source domain items, u + represents the user who has clicked the source domain item v s , u - represents the user who has not clicked the source domain item v s , is the inner product, and σ is the sigmoid function.
[0114] (2) Joint optimization loss:
[0115] The total loss function is constructed and the total loss is calculated The parameters of the model are updated in reverse by the total loss value, and the total loss function is the weighted sum of the above several loss functions and the hyperparameters of the model to be updated, and the calculation formula is:
[0116]
[0117] In the formula, λ1, λ2, λ3 are different weight parameters, represents the first self-contrast learning loss function, represents the second self-contrast learning loss function, represents the source domain contrast learning loss function, represents the cross-domain contrast learning loss function, represents the BPR loss function, and Θ represents all the hyperparameters of the cross-domain cold start item recommendation model to be updated.
[0118] Specifically, the values of the weight parameters λ1, λ2, and λ3 are all 0.6. In order to fully mine the user's interest in the target domain item from the unlabeled data, the setting of λ1 makes the model pay more attention to the feedback information of contrastive learning in the training process; due to the progressive enhancement of item representation by triple contrastive learning layer by layer, the settings of λ2 and λ3 make the model pay more and more attention to triple contrastive learning layer by layer in the training process.
[0119] Compared with other triple contrastive learning methods, the joint optimization loss of the application considers the relationship of triple contrastive learning layer by layer.
[0120] (3) Recommend target domain items:
[0121] First, obtain the item representation of the target domain Then calculate the inner product of and the candidate user representation, sort the inner product scores in descending order, and recommend the target domain items to the users ranked in the top of the candidate list.
[0122] Next, the effectiveness of the foregoing recommendation method is verified by simulation experiments:
[0123] The experimental environment is a server with Ubuntu 20.04 64-bit operating system and 128G memory. The processor part is Intel Xeon Platinum 8358P CPU, and the NVIDIA TESLA A100 GPU.
[0124] The experiment is based on the Amazon public dataset, so as to verify the effectiveness of the method provided by the application in actual application. In this embodiment, the Movies&TV (AM) subset and the Books (AB) subset of the Amazon dataset are selected, and two groups of experiments are performed, in which AB is used as the source domain dataset and AM is used as the target domain dataset, and AM is used as the source domain dataset and AB is used as the target domain dataset. The data statistics of the dataset are shown in Table 1:
[0125] Table 1 Data statistics of the dataset
[0126]
[0127] The experiment uses two representative indicators HR@K and NDCG@K to evaluate the performance of the method of the application, and the value of K is set to 5 and 10 respectively. HR@K measures the recall rate of the recommendation result, and NDCG@K measures the ranking quality of the recommendation list. The hyperparameter settings of the experiment are as follows: the dimension of the vector is 100, the batch size is 1024, the learning rate is 0.01, and the temperature coefficient of contrastive learning is 0.1.
[0128] The experiment is an ablation experiment, which aims to verify the effectiveness of the three contrastive learning modules of the application in solving the domain cold start problem. The three variants of the method of the application are:
[0129] (1) Variant 1, directly splicing the attribute representation and the graph representation of the item, without using the self-contrastive learning loss.
[0130] (2) Variant 2, only considering content similarity between content information of source domain items, without considering collaborative similarity, without using source domain contrastive learning loss.
[0131] (3) Variant 3, without aligning the attribute space of the source domain and the target domain, without using cross-domain contrastive learning loss.
[0132] The results of the experiment are shown in Table 2:
[0133] Table 2 shows the results of the ablation experiment
[0134]
[0135] Analyzing the results of Table 2, it can be seen that the three contrastive learning modules can show superiority in the HR index; although the method of the application is not the best score in the NDCG index, the difference with the best score is small. It is worth noting that the scores of all indicators of variant 3 are lower than those of the method of the application, indicating that the cross-domain contrastive learning module is the key to solving the domain cold start problem. In summary, the self-contrastive learning module, the source domain contrastive learning module and the cross-domain contrastive learning module introduced by the method of the application have certain rationality and effectiveness in solving the domain cold start problem.
[0136] The above describes the preferred embodiments of the application in detail. It should be understood that those skilled in the art can make many modifications and changes to the application without creative labor, based on the concept of the application. Therefore, any technical solution obtained by logical analysis, reasoning or limited experiment based on the existing technology according to the concept of the application should be within the protection scope determined by the claims.
Claims
1. A triple contrast learning-based cross-domain cold start item recommendation method, characterized in that, The method comprises the following steps: obtaining attribute information, knowledge graph information and interaction information of items in a source domain and a target domain; performing biased processing on the attribute information and the knowledge graph information to obtain initial attribute representations and initial graph representations, and obtaining initial user representations from the interaction information by using a multi-hot encoding method; obtaining filtered attribute representations by using a multi-layer perception based on the initial attribute representations, and obtaining aggregated graph representations by using a graph attention network based on the initial graph representations; obtaining a recommendation result by using a trained cross-domain cold-start item recommendation model based on the filtered attribute representations, the aggregated graph representations and the interaction information; wherein the construction and training process of the cross-domain cold-start item recommendation model comprises: constructing a self-contrast learning task, a source domain contrast learning task and a cross-domain contrast learning task respectively to obtain an initial cross-domain cold-start item recommendation model; constructing a self-contrast learning loss function, a source domain contrast learning loss function and a cross-domain contrast learning loss function based on the attribute representations and the graph representations, and constructing a BPR loss function based on the initial user representations; constructing a total loss function based on the self-contrast learning loss function, the source domain contrast learning loss function, the cross-domain contrast learning loss function and the BPR loss function; training and optimizing the constructed cross-domain cold-start item recommendation model by using the total loss function.
2. The triple contrast learning based cross-domain cold start item recommendation method according to claim 1, characterized in that, The process of constructing the self-contrast learning task specifically comprises: taking the current attribute representation and the current graph representation as anchor points of first self-contrast learning and second self-contrast learning respectively; taking the current graph representation and the current attribute representation as positive samples of the first self-contrast learning and the second self-contrast learning respectively; calculating cosine similarities between the current attribute representation and graph representations of other items in the same domain, and between the current graph representation and attribute representations of other items in the same domain, and selecting graph representations and attribute representations satisfying a first preset condition as negative samples of the first self-contrast learning and the second self-contrast learning respectively; constructing a first self-contrast learning loss function and a second self-contrast learning loss function based on the respective anchor points, positive samples and negative samples.
3. The triple contrast learning based cross-domain cold start item recommendation method according to claim 2, characterized in that, The calculation formula of the total loss function is: wherein, , , are different weight parameters, respectively, denotes the first self-contrast learning loss, denotes the second self-contrast learning loss, denotes the source domain contrast learning loss, denotes the cross-domain contrast learning loss, denotes the BPR loss, denotes all the hyperparameters that need to be updated for the cross-domain cold-start item recommendation model.
4. The triple contrast learning based cross-domain cold start item recommendation method according to claim 1, characterized in that, The process of constructing the source domain contrast learning task specifically comprises: merging the current attribute representation and the graph representation of the same source domain item to obtain an item representation of the source domain; taking the item representation of the source domain as an anchor point of source domain contrast learning; calculating collaborative similarities between the source domain item and other source domain items, and selecting item representations satisfying a second preset condition as positive samples; calculating cosine similarities between the item representation of the source domain and other item representations of the source domain, and selecting item representations satisfying a first preset condition as negative samples; constructing a source domain contrast learning loss function based on the determined anchor point, positive samples and negative samples.
5. The triple contrast learning based cross-domain cold start item recommendation method according to claim 4, characterized in that, The expression of the collaborative similarity is: wherein is the set of users who clicked on the item from the source domain, is the set of users who clicked on the item from the source domain, is the set of users who clicked on the item from the source domain. The expression of the source domain contrast learning loss function is: wherein, is a set of all source domain items for the current round, is a source domain item is a set of positive samples, is a source domain item is a set of negative samples, is a representation of a source domain item, is a representation of a source domain item positive sample is a representation of a source domain item negative sample is a representation of a source domain item negative sample is a representation of a source domain item negative sample is a temperature coefficient.
6. The triple contrast learning based cross-domain cold start item recommendation method according to claim 1, characterized in that, The process of constructing the cross-domain contrast learning task specifically comprises: Merge the current attribute representation and the graph representation of the same source domain item, and the current attribute representation and the graph representation of the same target domain item, respectively, to obtain the item representation of the source domain and the item representation of the target domain; The item representation of the source domain is used as an anchor point for cross-domain contrast learning; Calculate the content similarity between the source domain item and other target domain items, and select the item representation that meets the second preset condition as a positive sample; Calculate the cosine similarity between the item representation of the source domain and the item representation of other target domains, and select the item representation that meets the first preset condition as a negative sample; Based on the determined anchor point, positive sample and negative sample, a cross-domain contrast learning loss function is constructed.
7. The triple contrast learning based cross-domain cold start item recommendation method according to claim 6, characterized in that, The expression of the content similarity is: wherein, is the Euclidean distance between the source domain item and the target domain item , is the minimum of the Euclidean distances between the source domain item and all target domain items, is the maximum of the Euclidean distances between the source domain item and all target domain items. The expression of the cross-domain contrast learning loss function is: In the formula, This is a collection of all source domain items in this round. Source Domain Items The set of positive samples Source Domain Items The negative sample set, For the representation of items in the source domain, Positive samples of items in the target domain The representation of the item, Negative samples for items in the target domain The representation of the item, This is the temperature coefficient.
8. The triple contrast learning based cross-domain cold start item recommendation method according to claim 1, characterized in that, The calculation formula of the BPR loss function is: Wherein: where, is the set of all source domain items, denotes users who clicked on source domain items denotes users who did not click on source domain items denotes users who clicked on source domain items denotes users who did not click on source domain items is the inner product, is the sigmoid function, denotes user representations of users who clicked on source domain items denotes user representations of users who did not click on source domain items denotes user representations of users who clicked on source domain items denotes user representations of users who did not click on source domain items is the item representation of the source domain.
9. The triple contrast learning based cross-domain cold start item recommendation method according to claim 1, characterized in that, The attribute information and the knowledge graph information are biasedly processed to obtain initial attribute representation and initial graph representation of the item, specifically including: Using TextBlob to extract noun information and category noun information from the attribute information and merging them into a sentence sequence, inputting the sentence sequence into a preset Bert model to obtain the initial attribute representation; Based on the knowledge graph information, a plurality of subgraphs are obtained by using a preset TransR model and a method of randomly deleting edges, and the similarity scores of the same item in different subgraphs are calculated to obtain the corresponding initial graph representation.
10. The triple contrast learning based cross-domain cold start item recommendation method according to claim 1, characterized in that, Based on the initial attribute representation, a multi-layer perceptron is used to obtain a screened attribute representation, and based on the initial graph representation, a graph attention network is used to obtain an aggregated graph representation, specifically including: Updating the initial attribute representation of the item: taking the initial attribute representation as input, passing through a multi-layer perceptron composed of three linear layers and two activation layers in turn, further screening the initial attribute representation, and outputting an attribute representation with unchanged dimension as a screened attribute representation, the activation layer adopts an ELU activation function; Updating the initial graph representation of the item: taking the initial graph representation as input, using a graph attention network to biasedly aggregate the information of neighbor entities, obtaining an aggregated graph representation, and the weight of the neighbor entity is calculated according to the relationship between the item entity and the neighbor entity.