Dual contrast learning recommendation method and system, electronic equipment and storage medium

Through the dual contrastive learning recommendation method, combined with graph convolutional networks and feature contrastive learning and batch clustering contrastive learning, user preference prediction is optimized, which solves the problem of insufficient reflection of user behavior nuances and diversity in existing technologies and improves the performance of the recommendation model.

CN120707252AActive Publication Date: 2025-09-26GUANGXI UNIV
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202510914216.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-09-26
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

Existing multi-behavior recommendation methods fail to deeply explore the subtle differences of individual user behaviors, nor do they better reflect the diversity of user interactions.

Method used

A dual contrastive learning recommendation method is adopted to obtain the user's historical shopping habits, construct the correlation and corresponding weights between auxiliary behaviors and target behaviors, use graph convolutional networks for feature learning, and combine cascaded feature contrastive learning and batch clustering contrastive learning to optimize the recommendation prediction of user preferences.

Benefits of technology

It improves the exploration of subtle differences in individual user behaviors and the reflection of the diversity of user interactions, and improves the performance of the recommendation model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707252A_ABST
    Figure CN120707252A_ABST
Patent Text Reader

Abstract

The invention discloses a double contrast learning recommendation method and system, electronic equipment and a storage medium, and relates to the technical field of business recommendation. The method comprises the following steps: acquiring historical shopping habits of a user; the historical shopping habits comprise a target behavior and an auxiliary behavior; according to the historical shopping habits, constructing relevancy between the auxiliary behaviors and the target behaviors and corresponding weights, and according to the weights, integrating the target behaviors and the corresponding auxiliary behaviors to determine mixed information; performing feature learning and prediction on the mixed information by using a graph convolutional network to obtain a recommendation prediction result based on user preferences; the feature learning process of the graph convolutional network comprises cascaded combined feature contrast learning and batch clustering contrast learning; the method can solve the problem that the existing multi-behavior recommendation method cannot deeply discuss the nuance of the individual behaviors of the user and cannot better reflect the diversity of user interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of business recommendation technology, and in particular to a double contrast learning recommendation method, system, electronic device and storage medium. Background Art

[0002] On e-commerce platforms, multi-behavior recommendation models typically classify browsing, adding items to cart, and adding items to favorites as auxiliary behaviors, while considering purchasing as the target behavior. They then integrate auxiliary behavior information into the target behavior information to enhance its representativeness.

[0003] Most multi-behavior recommendation models typically obtain representations of auxiliary behavior information and target behavior information separately. They then integrate the auxiliary behavior information representation into the target behavior information representation. For example, some methods obtain valuable information of other behaviors, such as viewing, clicking, etc. They adopt a cascaded graph convolutional network recommendation model to capture behavioral dependencies and use the prediction results of each auxiliary behavior to optimize the prediction performance of the target behavior. Some models capture potential cross-type behavioral interdependencies from heterogeneous multi-relational graphs containing behavioral semantics and types. In addition, the correlation information between multi-hop neighbors of multiple behaviors can also be obtained to discover deeper relationships and dependencies between users and items.

[0004] Some studies combine contrastive learning and collaborative filtering to explore more detailed information. They use weighted methods to integrate the representations of all behaviors and adopt contrastive learning methods to mine the information between the target behavior and each auxiliary behavior. In addition, they also consider multi-interest and variation preference adapters to fine-tune the modeling of user interests. They use behavior-aware embedding layers to encode items and interests, and then optimize them through multi-interest and self-supervised learning. These methods can capture the differences and commonalities of multiple behaviors and solve the problem of user interests drifting in the group. Some methods incorporate knowledge graphs into recommendation tasks to capture multi-behavior dependencies. They concatenate the user embeddings of all behaviors in each layer during the propagation process and average the user embeddings of each layer of the network, which can also capture the behavior type perception signals of high-order interactions. In addition, contrastive learning loss and Bayesian personalized ranking (BPR) loss are used for optimization.

[0005] Some studies have extended single-action recommendation methods to multi-action recommendation, leveraging graph neural networks to obtain information representations of multiple actions. For example, the MGNN model establishes a multi-neural network model for recommendation. It measures the collective influence of different actions based on shared embeddings and action-specific embeddings. The LP-MRGNN model overcomes the limitations of single-action recommendation by modeling multi-relationship recommendation. It constructs a multi-relationship item graph to learn multiple types of global item-to-item relationships. The GNMR model models the dependencies between different actions in user-item interactions. It captures collaborative signals between actions by leveraging high-order relations in the user-item interaction graph. Some models extend concepts from knowledge graphs and session-based recommendation to multi-action recommendation. For example, the KHGT model, based on a hierarchical graph transformer network and knowledge augmentation, learns the interdependencies between different actions. It models the user-item multi-action interaction graph and the knowledge-aware item-item relationship graph to mine latent information. Furthermore, some models focus on multi-action recommendation based on comprehensive user embeddings and item embeddings learned from different actions. The MGNN-SPred model learns user preferences based on session and multi-relationship item graphs. It learns global relationships between items and employs a gating mechanism to adaptively fuse user representations. The MBHT model learns short-term and long-term cross-type behavior dependencies based on a hypergraph enhancement and transformer framework. It employs transformers with multi-scale and low-rank self-attention to encode behavior-aware sequential patterns. Furthermore, it integrates global multi-behavior dependencies into the hypergraph network to learn item correlations.

[0006] As a promising unsupervised learning paradigm, contrastive learning has achieved good performance in recommender systems. It can map user and item embeddings into a feature space. Contrastive learning can effectively alleviate the data sparsity problem in recommender systems. For example, the KMCLR model integrates contrastive learning and knowledge augmentation to alleviate the problem of scarce target behavior data. It designs a multi-behavior contrastive learning loss to optimize the features of the multi-behavior interaction graph and a knowledge-aware contrastive learning loss to enhance the features of the knowledge graph. The HGCL model integrates heterogeneous graph contrastive learning into multi-behavior recommendation to address the problem of personalized recommendation. It incorporates heterogeneous relational semantics into user-item interaction modeling. Furthermore, it enhances knowledge transfer between different views of contrastive learning by using a meta-network to encode personalized features of users and items. The DCRec model designs a debiased contrastive learning strategy to address the problem of popularity bias. It integrates contrastive learning with conformance and interest decomposition to learn enhanced representations. The RecDCL model employs dual contrastive learning to learn informative representations by combining features and batches. It reveals the relationship between feature classification and batch classification. The SLIME4Rec model learns user representations based on contrastive enhancement and a sliding filter mixer. It designs dynamic frequency selection and static frequency segmentation modules to capture different fine-grained frequency characteristics. In addition, it adopts a contrastive learning paradigm to optimize the model based on frequency characteristics.

[0007] The various multi-behavior recommendation methods mentioned above fail to deeply explore the subtle differences in individual user behaviors, nor do they better reflect the diversity of user interactions. Summary of the Invention

[0008] The purpose of the present invention is to provide a dual contrast learning recommendation method, system, electronic device and storage medium, which can solve the problem that existing multi-behavior recommendation methods fail to deeply explore the subtle differences in individual user behaviors and fail to better reflect the diversity of user interactions.

[0009] To achieve the above object, the present invention provides the following solutions:

[0010] A double contrastive learning recommendation method, comprising:

[0011] Acquire the user's historical shopping habits; the historical shopping habits include target behaviors and auxiliary behaviors;

[0012] Constructing the correlation between the auxiliary behavior and the target behavior and the corresponding weights based on the historical shopping habits, and integrating the target behavior and the corresponding auxiliary behavior based on the weights to determine mixed information;

[0013] A graph convolutional network is used to perform feature learning and prediction on the mixed information to obtain recommendation prediction results based on user preferences; the feature learning process of the graph convolutional network includes cascaded feature contrast learning and batch clustering contrast learning; the feature contrast learning is used to learn the behavioral differences between the mixed information representation and each auxiliary behavior information representation at the user level; the batch clustering contrast learning is used to perform contrast learning according to each information category to balance the information of each behavior; the mixed information representation and the auxiliary behavior information representation both include user embedding and item embedding.

[0014] Optionally, the correlation between the auxiliary behavior and the target behavior and the corresponding weights are constructed based on the historical shopping habits, and the target behavior and the corresponding auxiliary behavior are integrated according to the weights to determine mixed information, specifically including:

[0015] Construct a multi-behavior data graph, and construct the correlation and corresponding weight between the auxiliary behavior and the target behavior based on the historical shopping habits. The calculation formula is:

[0016]

[0017] Among them, α k represents the correlation between each user's auxiliary behavior k and target behavior p, w k represents the proportion of the target behavior p in the k-th auxiliary behavior data of each user, represents the user embedding of user u’s auxiliary behavior k at the lth graph convolutional network layer, represents the item embedding of user u’s auxiliary behavior k in the lth graph convolutional network layer, and Represent the number of neighbors of user u and item i respectively;

[0018] According to the calculated correlation and the corresponding weight, the auxiliary behavior information and the target behavior information are fused together to obtain the mixed information m, which is expressed in matrix form as follows:

[0019]

[0020] Among them, X p and X k The user-item interaction matrices for target behavior and auxiliary behavior respectively;

[0021] Based on the multi-behavior data graph, comprehensive node information is obtained by collecting neighbor information. The user embedding and item embedding of each layer of mixed information are expressed as:

[0022]

[0023] in, represents the user embedding of mixed information in the lth graph convolutional network layer, Represents the item embedding of mixed information in the lth graph convolutional network layer;

[0024] Then, the embedding information of all layers is aggregated to obtain the final embedding representation, which contains the interaction information of all behaviors and is expressed as:

[0025]

[0026] Among them, α l represents the weight of the l-th layer embedding, and L represents the number of layers of the graph convolutional network.

[0027] Optionally, constructing a multi-behavior data graph specifically includes:

[0028] The multi-behavior data graph is defined as G = (V, E); where V is all nodes in the graph, including user nodes y∈U and item nodes i∈I, and E is the edge of different behavior types in the graph; assuming there are K (K≥2) types of interactions between users and items, the edge of the interaction between users and items under the kth behavior is recorded as E k , the purchase behavior p is regarded as the target behavior, and the remaining K-1 behaviors are regarded as auxiliary behaviors.

[0029] Optionally, in the step of “using a graph convolutional network to perform feature learning and prediction on the mixed information”, the process of optimizing using feature contrast learning includes:

[0030] For auxiliary behavior k, the cosine similarity between the auxiliary behavior embedding and the mixed information embedding is calculated. The pairwise cosine similarity between users and items is expressed as:

[0031]

[0032] in, User embedding representing the mixed information of user u, represents the user embedding of auxiliary behavior k of user u, are selected as positive pairs, and other embedding pairs of different users are selected as negative pairs; for item u, Item embeddings representing mixed information, Item embedding representing auxiliary behavior k, are selected as positive pairs, and other embedding pairs of different items are selected as negative pairs; represents the pairwise cosine similarity between the hybrid information embedding of user u and the auxiliary behavior information embedding of user u', represents the user embedding of auxiliary behavior k of user u, represents the user embedding of the mixed information m of user u, represents the pairwise cosine similarity between the hybrid information embedding of item u and the auxiliary behavior information embedding of item i', Item embedding representing the mixed information m of item i, Item embedding representing auxiliary behavior information k of item i';

[0033] The user loss and item loss of the mixed information embedding are expressed as:

[0034]

[0035] Where τ represents the temperature coefficient for controlling feature contrast learning, N represents the number of users, M represents the number of items, and exp represents the exponential function;

[0036] With loss function Similarly, after considering the user and item losses under auxiliary behavior k, it is expressed as:

[0037]

[0038] Then, the feature contrastive learning loss is calculated for each user and item to identify all positive pairs in the dataset, which is expressed as:

[0039]

[0040] When k is the action of adding to the shopping cart, When k is browsing behavior, in, Represents the feature contrast loss between mixed information and adding to shopping cart behavior, represents the user feature contrast loss between mixed information and adding to shopping cart behavior, Represents the item feature comparison loss between mixed information and adding to cart behavior, represents the feature contrast loss between mixed information and browsing behavior, represents the user feature contrast loss between mixed information and browsing behavior, Represents the item feature contrast loss between mixed information and browsing behavior; represents the user loss under mixed information m; represents the user loss under auxiliary behavior k; represents the item loss under mixed information m; represents the item loss under auxiliary behavior k;

[0041] Then, by summing the losses of all auxiliary behaviors, we get the feature contrastive learning loss, which is expressed as:

[0042]

[0043] in, represents the feature contrastive learning loss.

[0044] Optionally, in the step of “using a graph convolutional network to perform feature learning and prediction on the mixed information”, the process of optimizing using batch clustering contrastive learning includes:

[0045] The embedding of users and items is mapped to a space with a dimension equal to the number of clusters, and the mixed information and each auxiliary behavior information are divided into C clusters respectively; represents the c-th cluster of mixed information m, represents the cth cluster of auxiliary behavior k;

[0046] Select similar clusters from the mixed information and auxiliary behavior k, and is regarded as a positive cluster, and other cluster pairs are regarded as negative clusters. The cosine similarity is used to measure the similarity between cluster pairs, which is expressed as:

[0047]

[0048] where c,c'∈{1,2,…,C}, Represents the cosine similarity between the cth cluster of mixed information and the c'th class of auxiliary behavior k;

[0049] Using contrastive loss function To distinguish and all others except The mixed information embedding clustering is expressed as:

[0050]

[0051] Where τ' represents the temperature coefficient that controls batch cluster contrastive learning, represents the cosine similarity between the c-th cluster of mixed information and the c-th class of auxiliary behavior k, represents the cosine similarity between the cth cluster of mixed information and the c'th class of mixed information, Represents the cosine similarity between the cth cluster of mixed information and the c'th class of auxiliary behavior k;

[0052] With loss function Similarly, after considering the loss under auxiliary behavior k, it is expressed as:

[0053]

[0054] By traversing all clusters, we get the comprehensive result of user embedding batch clustering loss, which is expressed as:

[0055]

[0056] Among them, H(Y) represents the entropy of cluster assignment probability in each batch of embedded samples, represents the loss of the c-th cluster under mixed information m, represents the loss of cluster c under auxiliary behavior k;

[0057] Computing item embedding batch clustering contrastive learning loss Then, when k is the add-to-cart behavior, When k is browsing behavior, Finally, the batch clustering contrastive learning loss is obtained by summing up the batch losses of all auxiliary behaviors, which is expressed as:

[0058]

[0059] in, represents the batch clustering contrastive learning loss, represents the batch clustering contrast loss between mixed information and add-to-cart behavior, represents the user embedding batch clustering loss under the add-to-cart behavior, represents the item embedding batch clustering loss under the add-to-cart behavior, represents the batch clustering contrast loss between mixed information and browsing behavior, represents the user embedding batch clustering loss under browsing behavior, represents the batch clustering loss of item embeddings under browsing behavior.

[0060] Optionally, in the step of “using a graph convolutional network to perform feature learning and prediction on the mixed information”, the step further includes: jointly optimizing feature contrast learning and batch cluster contrast learning, and the specific process includes:

[0061] The dual contrastive learning is combined using joint optimization, which is expressed as:

[0062]

[0063] Among them, λ and μ are the hyperparameters controlling feature contrastive learning and batch cluster contrastive learning, Θ represents all trainable parameters, and γ represents the regularization hyperparameter. represents the feature contrastive learning loss, represents batch clustering contrastive learning loss;

[0064] Finally, all user information is embedded to obtain e u , sum up all item information embedding to get e i , the relationship prediction between user u and item i is expressed as:

[0065]

[0066] Among them, y ui represents the preference score of user u for item i.

[0067] The present invention also provides a dual contrast learning recommendation system, comprising:

[0068] A data collection unit, configured to obtain a user's historical shopping habits, wherein the historical shopping habits include target behaviors and auxiliary behaviors;

[0069] A mixed information integration unit is used to construct the correlation between the auxiliary behavior and the target behavior and the corresponding weight according to the historical shopping habits, and integrate the target behavior and the corresponding auxiliary behavior according to the weight to determine the mixed information;

[0070] A prediction unit is used to use a graph convolutional network to perform feature learning and prediction on the mixed information to obtain recommendation prediction results based on user preferences; the feature learning process of the graph convolutional network includes cascaded feature contrast learning and batch clustering contrast learning; the feature contrast learning is used to learn the behavioral differences between the mixed information representation and each auxiliary behavior information representation at the user level; the batch clustering contrast learning is used to perform contrast learning according to each information category to balance the information of each behavior; the mixed information representation and the auxiliary behavior information representation both include user embedding and item embedding.

[0071] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the above-mentioned double contrast learning recommendation method.

[0072] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the double contrast learning recommendation method described above.

[0073] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0074] The present invention discloses a dual contrast learning recommendation method, system, electronic device and storage medium, the method comprising obtaining a user's historical shopping habits; the historical shopping habits comprising target behaviors and auxiliary behaviors; constructing the correlation between the auxiliary behaviors and the target behaviors and the corresponding weights based on the historical shopping habits, and integrating the target behaviors and the corresponding auxiliary behaviors according to the weights to determine mixed information; utilizing a graph convolutional network to perform feature learning and prediction on the mixed information to obtain recommendation prediction results based on user preferences; the feature learning process of the graph convolutional network comprises cascaded feature contrast learning and batch clustering contrast learning; the present invention can solve the problem that existing multi-behavior recommendation methods fail to deeply explore the subtle differences in individual user behaviors and fail to better reflect the diversity of user interactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0076] Figure 1 Schematic diagram of behavioral habits in this embodiment;

[0077] Figure 2 This is the DCLTIE framework diagram in this embodiment;

[0078] Figure 3 1 is a performance comparison chart of DCLTIE and DCLTIE-w, DCLTIE-c and DCLTIE-v in this embodiment;

[0079] Figure 4 2 is a performance comparison chart of DCLTIE, DCLTIE-f and DCLTIE-b in this embodiment;

[0080] Figure 5 This is a performance comparison chart of DCLTIE on the Tmall dataset under different τ and τ' in this embodiment;

[0081] Figure 6 The performance comparison chart of DCLTIE on the Beibei dataset under different λ and μ in this embodiment;

[0082] Figure 7 Schematic diagram of the effect of batch size on the Beibei dataset in this embodiment. DETAILED DESCRIPTION

[0083] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0084] The purpose of the present invention is to provide a dual contrast learning recommendation method, system, electronic device and storage medium, which can solve the problem that existing multi-behavior recommendation methods fail to deeply explore the subtle differences in individual user behaviors and fail to better reflect the diversity of user interactions.

[0085] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0086] like Figure 1-Figure 7 As shown, the present invention provides a dual contrast learning recommendation method. Taking the following application scenario as an example, in this application scenario, a multi-behavior data graph is defined as G = (V, E), where V represents all nodes in the graph, including user nodes u∈U and item nodes i∈I. E represents the edges of different behavior types in the graph. Assuming that there are K (K>=2) types of interactions between users and items, the edge representing the interaction between users and items under the kth behavior is recorded as E k The purchase behavior (defined as p) is considered the target behavior, and the remaining K-1 behaviors are considered auxiliary behaviors. The input is a multi-behavior interaction graph G, and the output is a list of top-N items preferred by the user.

[0087] For the above application scenarios, an embodiment of the present invention proposes a dual contrastive learning recommendation method based on target behavior information enhancement, also referred to in this embodiment as DCLTIE (Dual Contrastive Learning Recommendation based on Target Behavior Information Enhancement), to predict the relationship between users and items. In general, DCLTIE first analyzes each user's historical shopping habits to determine the influence weight of auxiliary behavior information on their target behavior information. Then, the auxiliary behavior information and target behavior information are integrated based on the weights. A graph convolutional network is used to encode the feature representations of users and items. Furthermore, cascaded feature contrastive learning and batch clustering contrastive learning are designed to further explore the auxiliary behavior information. Feature contrastive learning is used to explore the detailed correlation between the hybrid feature and each auxiliary behavior feature at the user level. Batch clustering contrastive learning is used to adjust the hybrid feature representation to make the auxiliary information contained therein more balanced. Finally, the optimized feature representation is used to predict user preferences.

[0088] like Figure 2 As shown in the figure, the DCLTIE model can be divided into several stages. In the information encoding part, the auxiliary behavior information is integrated into the target behavior information according to their respective weights in the heterogeneous graph G to obtain mixed information. Then, the graph convolutional network is used to obtain the representation of the mixed information and each auxiliary behavior information. In the feature contrast learning part, feature contrast learning is performed between the mixed information representation and the auxiliary behavior information representation to explore the behavioral differences at the user level. In the batch clustering contrast learning part, the softmax function is used to classify the mixed information representation and the auxiliary behavior information representation respectively. Batch clustering contrast learning is performed between these categories to balance the information of each behavior. In the feature optimization part, a joint optimization method is used to combine feature contrast learning and batch clustering contrast learning.

[0089] The double contrast learning recommendation method based on target behavior information enhancement specifically includes steps 1 to 4, which are detailed as follows:

[0090] Step 1. Information encoding.

[0091] Some users purchase products by browsing → adding to cart → purchasing, while others purchase products by browsing → purchasing. Every user's shopping habits are different. The correlation between each auxiliary behavior information and the target behavior information is defined as follows:

[0092]

[0093] Among them, α krepresents the correlation between each user’s auxiliary behavior k and target behavior p. k represents the proportion of the target behavior data p in the k-th auxiliary behavior data of each user;

[0094] According to the correlation, the auxiliary behavior information and the target behavior information are fused together to obtain the mixed information (defined as m). It is represented in matrix form and defined as follows:

[0095]

[0096] Among them, X p and X k User-item interaction matrices representing target behavior and auxiliary behavior respectively.

[0097] We then use multi-layer message propagation in graph convolutional networks to collect neighbor information to obtain comprehensive node information. The user embedding and item embedding of the mixed information at each layer are defined as follows:

[0098]

[0099] in, and denote the number of neighbors of user u and item i respectively. represents the user embedding of mixed information in the lth graph convolutional network layer, Represents the embedding of items in the lth graph convolutional network layer of mixed information. Then, the embedding information of all layers is aggregated to obtain the final embedding representation, which contains the interaction information of all behaviors. It is defined as follows:

[0100]

[0101] Among them, α l represents the weight of the lth layer embedding, and L represents the number of layers of the graph convolutional network.

[0102] Step 2. Feature contrast learning.

[0103] Feature contrast learning is used to optimize user and item embeddings under mixed information and auxiliary behavior information, including:

[0104] For auxiliary behavior k, calculate the cosine similarity between its embedding and the mixed information embedding. The pairwise cosine similarity of users and items is defined as follows:

[0105]

[0106] in, User embedding representing the mixed information of user u, represents the user embedding of auxiliary behavior k of user u, are selected as positive pairs, and other embedding pairs of different users are selected as negative pairs. For item i, Item embeddings representing mixed information, Item embeddings representing auxiliary behavior l, are selected as positive pairs, and other embedding pairs of different items are selected as negative pairs. represents the pairwise cosine similarity between the hybrid information embedding of user u and the auxiliary behavior information embedding of user u', represents the user embedding of auxiliary behavior k of user u, represents the user embedding of the mixed information m of user u, represents the pairwise cosine similarity between the hybrid information embedding of item i and the auxiliary behavior information embedding of item i', Item embedding representing the mixed information m of item i, Item embedding representing auxiliary behavior information k of item i';

[0107] In order to further explore the correlation between positive or negative pairs of users and items, we consider two aspects: mixed information m and auxiliary behavior k. The user loss and item loss of mixed information embedding are defined as follows:

[0108]

[0109] Where τ represents the temperature coefficient that controls feature contrast learning. N represents the number of users, M represents the number of items, and exp represents the exponential function.

[0110] and Similarly, the user and item losses under auxiliary behavior k are considered and defined as follows:

[0111]

[0112] Then, a feature contrastive learning loss is calculated for each user and item to identify all positive pairs in the dataset, which is defined as follows:

[0113]

[0114] When k is the action of adding to the shopping cart, When k is browsing behavior, Then, by summing the losses of all auxiliary behaviors, we get the feature contrastive learning loss, which is defined as follows:

[0115]

[0116] in represents the feature contrastive learning loss.

[0117] Step 3. Batch clustering contrastive learning.

[0118] Batch cluster contrastive learning can balance the embedding representations of users and items within a batch. In this method, the embeddings of users and items are mapped to a space with a dimension equal to the number of clusters. It can interpret the embeddings of users and items as the probability of belonging to a specific cluster. The mixed information and each auxiliary behavior information are divided into C clusters respectively. Among them, represents the c-th cluster of mixed information m, represents the c-th cluster of auxiliary behavior k.

[0119] Similar to feature contrastive learning, by selecting similar clusters from the mixed information and auxiliary behavior k, The cosine similarity is used to measure the similarity between cluster pairs, which is defined as follows:

[0120]

[0121] where c,c'∈{1,2,…,C}, Represents the cosine similarity between the cth cluster of mixed information and the c'th class of auxiliary behavior k;

[0122] Using contrastive loss function To distinguish and all others except The mixed information embedding clustering is defined as follows:

[0123]

[0124] where τ' denotes the temperature coefficient that controls the contrastive learning of batch clustering. represents the cosine similarity between the c-th cluster of mixed information and the c-th class of auxiliary behavior k, represents the cosine similarity between the cth cluster of mixed information and the c'th class of mixed information, Represents the cosine similarity between the cth cluster of mixed information and the c'th class of auxiliary behavior k;

[0125] and Similarly, consider the loss under auxiliary behavior k, which is defined as follows:

[0126]

[0127] By traversing all clusters, we can get the comprehensive result of user embedding batch clustering loss, which is defined as follows:

[0128]

[0129] Where h(Y) represents the entropy of cluster assignment probability in each batch of embedded samples. It can prevent most samples from being assigned to the same cluster;

[0130] Using a similar approach to user embedding, we obtain the batch clustering contrastive learning loss for item embedding Then, when k is the add-to-cart behavior, When k is browsing behavior, Finally, the batch cluster contrastive learning loss is obtained by summing up the batch losses of all auxiliary behaviors, which is defined as follows:

[0131]

[0132] in, represents the batch clustering contrastive learning loss.

[0133] Step 4. Joint optimization and prediction.

[0134] Joint optimization is used to integrate dual contrastive learning, which can simultaneously optimize two losses, including:

[0135] The dual contrastive learning is combined using joint optimization, which is defined as follows:

[0136]

[0137] Here, λ and μ are the hyperparameters controlling feature contrastive learning and batch clustering contrastive learning, respectively. Θ represents all trainable parameters, and γ represents the regularization hyperparameter.

[0138] Finally, all user information is embedded to obtain e u , sum up all item information embedding to get e i The relationship prediction between user u and item i is defined as follows:

[0139]

[0140] Among them, y ui represents the preference score of user u for item i.

[0141] The following embodiments of the present invention will be combined with specific experimental verification to prove the feasibility and progress of the present invention.

[0142] During experimental verification, the DCLTIE model will be evaluated from the following aspects.

[0143] RQ1: Does DCLTIE outperform other baseline recommendation models?

[0144] RQ2: Do different user behavior habits and different behavior information affect the performance of DCLTIE?

[0145] RQ3: Does the design of double contrastive learning help improve the performance of DCLTIE?

[0146] RQ4: Do hyperparameters affect the performance of DCLTIE?

[0147] RQ5: Does the size of the training batch affect the performance of DCLTIE?

[0148] 1. Dataset and Experimental Configuration

[0149] Dataset Description: To validate the performance of our DCLTIE model, we used the Beibei, Taobao, and Tmall datasets, as shown in Table 1. The Beibei dataset contains three behaviors: browsing, shopping cart, and purchasing. The Taobao dataset contains three behaviors: clicking, shopping cart, and purchasing. The Tmall dataset contains four behaviors: clicking, shopping cart, adding to favorites, and purchasing. In the experiment, we selected one interaction type from each user as a test sample, and the remaining interactions were used as training samples.

[0150] Parameter Configuration: The model was optimized using the Adam optimizer with a learning rate of {1e-4, 1e-5}. The training batch size was selected from the set {128, 256, 512, 1024, 2048}. The embedding dimension size was selected from the set {64, 128, 256}. The temperature coefficients τ and τ' were selected from the parameter space {0.2, 0.4, 0.6, 0.8, 1.0}. The hyperparameters λ and μ were selected from the parameter space {0.1, 0.4, 0.7, 1.0}.

[0151] Evaluation Metrics: To assess model performance, DCLTIE selected two representative metrics: Recall@K and NDCG@K. Recall@K measures the proportion of relevant items successfully recommended in the Top-K results. NDCG@K measures the ranking quality of these recommended items. Higher values ​​for these evaluation metrics indicate better model performance.

[0152] Environment Setup: The DCLTIE model was implemented in the PyTorch framework using Python 3.9.16 and PyTorch 1.13.1. The hardware included an NVIDIA Quadro RTX 5000 16G GPU, an Intel(R) Xeon(R) Silver 4210R @ 2.40GHz CPU, and 64GB of RAM.

[0153] Table 1 Dataset table

[0154]

[0155] 2. Results Analysis

[0156] Our model is compared with nine state-of-the-art baseline models, including four single-behavior models and five multi-behavior models.

[0157] The single-behavior recommendation baseline model is as follows:

[0158] NCF is a generalized collaborative filtering recommendation model that interprets matrix factorization as neural collaborative filtering.

[0159] LightGCN is a recommendation model that removes nonlinear activation functions and feature transformations in graph neural networks.

[0160] IMP-GCN is a recommendation model based on graph neural networks and interest-aware subgraphs.

[0161] ENMF is a general single action recommendation model based on matrix factorization and unsampled neural networks.

[0162] The multi-behavior recommendation baseline model is as follows:

[0163] MB-GMN is a multi-behavior recommendation model based on meta-learning and behavior heterogeneity.

[0164] EHCF is a multi-behavior recommendation model based on heterogeneous collaborative filtering and non-sampling transfer learning.

[0165] MB-GCN is a multi-behavior heterogeneous graph recommendation model based on multiple feedback data and behavior semantics.

[0166] GHCF is a multi-relation recommendation model based on heterogeneous collaborative filtering.

[0167] RCL is a contrastive learning recommendation model based on users’ long-term and short-term interests and relationship perception.

[0168] The experimental results are analyzed as follows:

[0169] DCLTIE was compared with nine baseline models (four single-action recommendation models and five multi-action recommendation models) on three datasets (RQ1). The experimental results are shown in Table 2. It can be seen that: 1) Among these single-action baseline recommendation models, LightGCN achieved the best recommendation performance by acquiring high-order neighbor information and removing the transition matrix and activation function in traditional graph convolutional networks. 2) Among these baseline models, most multi-action models outperformed the single-action models. This is because multi-action models incorporate more action information, resulting in rich user and item embeddings. GHCF considers high-order information about each action through multi-task learning. RCL considers both long-term and short-term user interests across multiple actions. As a result, GHCF and RCL achieve better performance. 3) DCLTIE consistently outperforms the baseline models by over 2.5% on the Beibei, Taobao, and Tmall datasets. NDCG@10 even achieves a 66% improvement on the Taobao dataset. This improvement can be attributed to DCLTIE's specialized consideration of user behavior habits at the user level, reducing the noise introduced when merging user and item embeddings across actions. In addition, DCLTIE also adopts dual contrastive learning, such as feature contrastive learning and batch clustering contrastive learning, to explore and balance the differences and commonalities between user behavioral habits.

[0170] Table 2. Overall performance comparison of different models on Beibei, Taobao, and Tmall datasets. Bold indicates the best performance, and underlined indicates the second best performance.

[0171]

[0172]

[0173] 3. DCLTIE model analysis

[0174] A) Ablation experiments.

[0175] 1) Impact of mixed information (RQ2): To verify the importance of mixed information in improving the performance of DCLTIE, we generate three ablation models and compare them with DCLTIE on the Beibei dataset and Taobao dataset.

[0176] DCLTIE-w. Does not mix user behavior information.

[0177] DCLTIE-c. It does not mix the add-to-cart behavior information from the Beibei dataset and the Taobao dataset.

[0178] DCLTIE-v. It does not mix the browsing behavior information in the Beibei dataset nor the click behavior information in the Taobao dataset.

[0179] The experimental results are as follows Figure 3 As shown in the figure, DCLTIE significantly outperforms DCLTIE-w, DCLTIE-c, and DCLTIE-v on the Beibei and Taobao datasets. This demonstrates that the introduction of mixed information can improve the model's predictive performance. Furthermore, DCLTIE-c outperforms DCLTIE-v on the Beibei dataset, and DCLTIE-v outperforms DCLTIE-c on the Taobao dataset. This suggests that different users have different behavioral habits, leading to varying performance. DCLTIE's mixed information effectively aggregates diverse behavioral information and reduces the introduction of noise.

[0180] 2) Impact of Dual Contrastive Learning (RQ3): To verify the impact of dual contrastive learning on the recommendation performance of DCLTIE, we designed two ablation models and compared them with DCLTIE on the Beibei dataset and Taobao dataset.

[0181] DCLTIE-f. The feature contrastive learning task is removed in DCLTIE.

[0182] DCLTIE-b. The batch clustering contrastive learning task is removed from DCLTIE.

[0183] The results are as follows Figure 4 As shown in the figure, DCLTIE outperforms DCLTIE-f and DCLTIE-b in predictive performance, demonstrating that designing feature contrastive learning and batch clustering contrastive learning tasks can effectively improve the model's predictive performance. Based on the ablation results above, we can conclude that hybrid information can effectively improve recommendation performance. Furthermore, both feature contrastive learning and batch clustering contrastive learning are essential, as they can capture more user and batch levels, thereby alleviating the problem of data sparsity. Furthermore, the results on the Beibei and Taobao datasets are similar, demonstrating that our model generalizes well across different datasets.

[0184] B) Hyperparameter Analysis (RQ4)

[0185] In order to verify the impact of temperature coefficient parameters τ and τ' on model performance, we explored it on the Tmall dataset. We used the grid search method to find the best combination of temperature coefficient parameters τ and τ' in the parameter space {0.2, 0.4, 0.6, 0.8, 1.0}. Figure 5It can be found that when the temperature coefficient parameters τ and τ' are both set to 0.6, the contrast effect of double contrast learning is the best. This makes the distance between similar samples closer and the distance between dissimilar samples farther, so that our model achieves the best performance.

[0186] In addition, we also explored the impact of λ and μ on model performance on the Beibei dataset. We used a grid search method to find the best combination of λ and μ in the parameter space {0.1, 0.4, 0.7, 1.0}. Figure 6 It can be seen that when both λ and μ are set to 0.7, DCLTIE achieves the best performance, and a balance is achieved between feature contrastive learning and batch clustering contrastive learning.

[0187] C) Impact of batch size (RQ5)

[0188] To test the effect of batch size on prediction performance, we conducted batch size experiments on the Beibei dataset. The batch size was selected from the set {128, 256, 512, 1024, 2048}. The experimental results are shown in Figure 2. Figure 7 As shown. It can be found that DCLTIE has similar recommendation performance under different batch sizes. This shows that DCLTIE's batch clustering contrastive learning can effectively balance the distribution of sample data within the batch. In addition, we also tested the impact of the number of propagation layers of the graph convolutional network on the performance of DCLTIE. From Table 3, it can be found that when L<3, the performance of DCLTIE gradually increases; when L=3, the performance reaches the best; when L>3, the performance begins to decline. We analyze the possible reasons as follows. First, when the number of layers exceeds 3 layers, the graph convolutional network may be too smooth. Second, dual contrastive learning can effectively capture enough negative pair information, and when the graph convolutional network aggregates neighbor information for more than 3 hops, noise may be introduced.

[0189] Table 3 Performance of different propagation depths L

[0190]

[0191] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0192] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A double contrastive learning recommendation method, characterized in that: include: Acquire the user's historical shopping habits; the historical shopping habits include target behaviors and auxiliary behaviors; Constructing the correlation between the auxiliary behavior and the target behavior and the corresponding weights based on the historical shopping habits, and integrating the target behavior and the corresponding auxiliary behavior based on the weights to determine mixed information; Using a graph convolutional network to perform feature learning and prediction on the mixed information to obtain a recommendation prediction result based on user preferences; the feature learning process of the graph convolutional network includes cascaded feature contrast learning and batch clustering contrast learning; The feature contrastive learning is used to learn the behavioral differences between the mixed information representation and each auxiliary behavior information representation at the user level; the batch clustering contrastive learning is used to perform contrastive learning according to each information category to balance the information of each behavior; the mixed information representation and the auxiliary behavior information representation both include user embedding and item embedding.

2. The dual contrast learning recommendation method according to claim 1, characterized in that: The correlation between the auxiliary behavior and the target behavior and the corresponding weight are constructed based on the historical shopping habits, and the target behavior and the corresponding auxiliary behavior are integrated according to the weight to determine the mixed information, which specifically includes: Construct a multi-behavior data graph, and construct the correlation and corresponding weight between the auxiliary behavior and the target behavior based on the historical shopping habits. The calculation formula is: Among them, α k represents the correlation between each user's auxiliary behavior k and target behavior p, w k represents the proportion of the target behavior p in the k-th auxiliary behavior data of each user, represents the user embedding of user u’s auxiliary behavior k at the lth graph convolutional network layer, represents the item embedding of user u’s auxiliary behavior k in the lth graph convolutional network layer, and Represent the number of neighbors of user u and item i respectively; According to the calculated correlation and the corresponding weight, the auxiliary behavior information and the target behavior information are fused together to obtain the mixed information m, which is expressed in matrix form as follows: Among them, X p and X k The user-item interaction matrices for target behavior and auxiliary behavior respectively; Based on the multi-behavior data graph, comprehensive node information is obtained by collecting neighbor information. The user embedding and item embedding of each layer of mixed information are expressed as: in, represents the user embedding of mixed information in the lth graph convolutional network layer, Represents the item embedding of mixed information in the lth graph convolutional network layer; Then, the embedding information of all layers is aggregated to obtain the final embedding representation, which contains the interaction information of all behaviors and is expressed as: Among them, α l represents the weight of the l-th layer embedding, and L represents the number of layers of the graph convolutional network.

3. The dual contrast learning recommendation method according to claim 2, characterized in that: The constructing of the multi-behavior data graph specifically includes: The multi-behavior data graph is defined as G = (V, E); where V is all nodes in the graph, including user nodes u∈U and item nodes i∈I, and E is the edge of different behavior types in the graph; assuming that there are K (K≥2) types of interactions between users and items, the edge of the interaction between users and items under the kth behavior is recorded as E k , the purchase behavior p is regarded as the target behavior, and the remaining K-1 behaviors are regarded as auxiliary behaviors.

4. The dual contrast learning recommendation method according to claim 1, characterized in that In the step of "using a graph convolutional network to perform feature learning and prediction on the mixed information", the process of optimizing using feature contrast learning includes: For auxiliary behavior k, the cosine similarity between the auxiliary behavior embedding and the mixed information embedding is calculated. The pairwise cosine similarity between users and items is expressed as: in, User embedding representing the mixed information of user u, represents the user embedding of auxiliary behavior k of user u, is selected as a positive pair, and other embedding pairs of different users are selected as negative pairs; for item i, Item embeddings representing mixed information, Item embedding representing auxiliary behavior k, are selected as positive pairs, and other embedding pairs of different items are selected as negative pairs; represents the mixed information embedding of user u and user u ' The pairwise cosine similarity between the auxiliary behavior information embeddings of represents the user embedding of auxiliary behavior k of user u, represents the user embedding of the mixed information m of user u, Represents the mixed information embedding of item i and item i ' The pairwise cosine similarity between the auxiliary behavior information embeddings of Item embedding representing the mixed information m of item i, Indicates item i ' Item embedding of auxiliary behavior information k; The user loss and item loss of the mixed information embedding are expressed as: Where τ represents the temperature coefficient for controlling feature contrast learning, N represents the number of users, M represents the number of items, and exp represents the exponential function; With loss function Similarly, after considering the user and item losses under auxiliary behavior k, it is expressed as: Then, the feature contrastive learning loss is calculated for each user and item to identify all positive pairs in the dataset, which is expressed as: When k is the action of adding to the shopping cart, When k is browsing behavior, in, Represents the feature contrast loss between mixed information and adding to shopping cart behavior, represents the user feature contrast loss between mixed information and adding to shopping cart behavior, Represents the item feature comparison loss between mixed information and adding to cart behavior, represents the feature contrast loss between mixed information and browsing behavior, represents the user feature contrast loss between mixed information and browsing behavior, Represents the item feature contrast loss between mixed information and browsing behavior; represents the user loss under mixed information m; represents the user loss under auxiliary behavior k; represents the item loss under mixed information m; represents the item loss under auxiliary behavior k; Then, by summing the losses of all auxiliary behaviors, we get the feature contrastive learning loss, which is expressed as: in, represents the feature contrastive learning loss.

5. The dual contrast learning recommendation method according to claim 1, characterized in that: In the step of "using a graph convolutional network to perform feature learning and prediction on the mixed information", the process of optimizing using batch clustering contrastive learning includes: The embedding of users and items is mapped to a space with a dimension equal to the number of clusters, and the mixed information and each auxiliary behavior information are divided into C clusters respectively; represents the c-th cluster of mixed information m, represents the cth cluster of auxiliary behavior k; Select similar clusters from the mixed information and auxiliary behavior k, and is regarded as a positive cluster, and other cluster pairs are regarded as negative clusters. The cosine similarity is used to measure the similarity between cluster pairs, which is expressed as: where c,c ' ∈{1,2,…,C}, The cth cluster representing the mixed information and the cth auxiliary behavior k ' Cosine similarity between classes; Using contrastive loss function To distinguish and all others except The mixed information embedding clustering is expressed as: Among them, τ ' represents the temperature coefficient controlling batch cluster contrastive learning, represents the cosine similarity between the c-th cluster of mixed information and the c-th class of auxiliary behavior k, Represents the cth cluster of mixed information and the cth cluster of mixed information ' Cosine similarity between classes, The cth cluster representing the mixed information and the cth auxiliary behavior k ' Cosine similarity between classes; With loss function Similarly, after considering the loss under auxiliary behavior k, it is expressed as: By traversing all clusters, we get the comprehensive result of user embedding batch clustering loss, which is expressed as: Among them, H(Y) represents the entropy of cluster assignment probability in each batch of embedded samples, represents the loss of the c-th cluster under mixed information m, represents the loss of cluster c under auxiliary behavior k; Computing item embedding batch clustering contrastive learning loss Then, when k is the add-to-cart behavior, When k is browsing behavior, Finally, the batch clustering contrastive learning loss is obtained by summing up the batch losses of all auxiliary behaviors, which is expressed as: in, represents the batch clustering contrastive learning loss, represents the batch clustering contrast loss between mixed information and add-to-cart behavior, represents the user embedding batch clustering loss under the add-to-cart behavior, represents the item embedding batch clustering loss under the add-to-cart behavior, represents the batch clustering contrast loss between mixed information and browsing behavior, represents the user embedding batch clustering loss under browsing behavior, represents the batch clustering loss of item embeddings under browsing behavior.

6. The dual contrast learning recommendation method according to claim 1, characterized in that: In the step of "using a graph convolutional network to perform feature learning and prediction on the mixed information", it is also included: jointly optimizing feature contrast learning and batch cluster contrast learning, and the specific process includes: The dual contrastive learning is combined using joint optimization, which is expressed as: Among them, λ and μ are the hyperparameters controlling feature contrastive learning and batch cluster contrastive learning, Θ represents all trainable parameters, and γ represents the regularization hyperparameter. represents the feature contrastive learning loss, represents batch clustering contrastive learning loss; Finally, all user information is embedded to obtain e u , sum up all item information embedding to get e i , the relationship prediction between user u and item i is expressed as: Among them, y ui represents the preference score of user u for item i.

7. A dual contrastive learning recommendation system, characterized in that include: A data collection unit, configured to obtain a user's historical shopping habits, wherein the historical shopping habits include target behaviors and auxiliary behaviors; A mixed information integration unit is used to construct the correlation between the auxiliary behavior and the target behavior and the corresponding weight according to the historical shopping habits, and integrate the target behavior and the corresponding auxiliary behavior according to the weight to determine the mixed information; A prediction unit, configured to perform feature learning and prediction on the mixed information using a graph convolutional network to obtain a recommendation prediction result based on user preferences; the feature learning process of the graph convolutional network includes cascaded feature contrast learning and batch clustering contrast learning; The feature contrastive learning is used to learn the behavioral differences between the mixed information representation and each auxiliary behavior information representation at the user level; the batch clustering contrastive learning is used to perform contrastive learning according to each information category to balance the information of each behavior; the mixed information representation and the auxiliary behavior information representation both include user embedding and item embedding.

8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the double contrastive learning recommendation method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The device stores a computer program, which, when executed by a processor, implements the double contrast learning recommendation method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Personalized recommendation method of cascade residual image convolutional network based on multiple behaviors

    CN114861065A

  • Recommendation method and device based on heterogeneous relational graph neural network and medium

    CN115082142A

  • Federal contrast clustering learning method and system for non-independent identically distributed data

    CN115563519A

  • Unsupervised communication radiation source individual identification method based on bispectrum feature contrast learning

    CN116226721A

  • Commodity recommendation method, system and equipment based on graph convolutional network, and medium

    CN117635265A