Space-time-causal double-path knowledge migration cross-domain recommendation method
By employing a cross-domain recommendation method with dynamic gating along both spatiotemporal and causal paths, this approach addresses the shortcomings of existing technologies, such as insufficient dynamic capture of user interests, lack of causal understanding, and inefficient fusion of multi-dimensional features. It enables dynamic modeling and fine-grained transfer of user behavior, thereby improving the accuracy and personalization adaptability of the recommendation system.
Patent Information
- Application Number
- CN202511280871.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2025-12-19
AI Technical Summary
Existing cross-domain recommendation methods cannot effectively capture users' dynamic behavioral preferences, lack an understanding of the causal relationships of user behavior, leading to causal confusion and negative transfer, and lack the ability to dynamically interact with and deeply integrate user features.
A cross-domain recommendation method with spatiotemporal-causal dual-path dynamic gating is adopted. The spatiotemporal and causal paths of user behavior are modeled through temporal convolutional networks and multi-head attention mechanisms. Dynamic gating mechanism is used to realize dynamic interaction and deep fusion of features, and cross-domain knowledge transfer is carried out by combining meta-learning network.
It accurately captures users' long-term and short-term interests, explicitly models the causal drivers of user behavior, effectively avoids causal confusion, improves the accuracy and robustness of recommendations, and achieves efficient and personalized cross-domain knowledge transfer.
Smart Images

Figure CN121167033A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a spatio-temporal-causal dual-path knowledge transfer cross-domain recommendation method. BACKGROUND
[0002] Recommendation systems play a crucial role in e-commerce, social media, content distribution, and other fields, providing personalized recommendations to users by analyzing their historical behavior and preferences. However, current recommendation systems face two major challenges: data sparsity and the cold start problem. New users or new items lack sufficient historical data, making it difficult for the system to accurately predict user preferences and item attractiveness. Cross-domain recommendation (CDR) is an effective solution that uses data-rich source domains to alleviate the data sparsity and cold start problems in target domains through knowledge transfer. The following is an analysis of existing cross-domain recommendation methods related to this technology:
[0003] 1. EMCDR.
[0004] EMCDR is an embedding and mapping-based cross-domain recommendation method. The model first generates user and item representations for each domain using a collaborative filtering-based model, then aligns the representations of overlapping users in the source and target domains by training a mapping function, thus achieving knowledge transfer from the source domain to the target domain. For cold-start users in the target domain, the model can use the user representations of the source domain and the mapping function to predict their representations in the target domain, and then complete item recommendations.
[0005] This method has a simple structure and is easy to train, but it ignores the temporal order and context logic in user behavior, making it difficult for the model to capture the evolution of preferences. In addition, the fixed mapping function is difficult to adapt to the transfer differences between different users.
[0006] 2. DTCDR.
[0007] DTCDR aims to improve the recommendation accuracy of both target domains. Unlike traditional single-target cross-domain recommendation methods, DTCDR builds a symmetric transfer learning framework that not only uses data from the source domain to improve the recommendation performance of the target domain, but also optimizes the recommendation results of the source domain through reverse transfer (from the target domain to the source domain). DTCDR realizes dual-target cross-domain recommendation, providing a new approach to the field of cross-domain recommendation.
[0008] However, DTCDR assumes that the relationship between the source domain and the target domain is fixed, making it difficult to adapt to the dynamic changes in user preferences. In practical applications, user behavior and preferences may change dynamically over time, and DTCDR lacks a dynamic adjustment mechanism, making it unable to adapt to the temporal evolution of user preferences, limiting its performance in dynamic scenarios.
[0009] 3. PTUPCDR.
[0010] PTUPCDR aims to achieve personalized transfer of user preferences from source domain to target domain through meta-learning. The core idea is to generate personalized mapping matrices based on user's historical interaction data in the source domain using meta-learning networks, and transfer user preferences from the source domain to the target domain. This method not only improves the personalization of recommendations, but also avoids the negative impact of unreasonable user embeddings on model performance through task-oriented optimization.
[0011] However, PTUPCDR lacks the ability to model behavior timing, making it difficult to adapt to dynamic changes in user preferences and lacking a dynamic adjustment mechanism. In addition, there is a phenomenon in recommendation systems: users may tend to follow the practices of other users (herd behavior). For example, existing recommendation systems will display high-selling goods in the front position, which leads to the influence of popularity on interactions other than user interests, causing bias. It is difficult to determine whether some behaviors of users in the source domain are within their own interests.
[0012] 4. DPTUPCDR.
[0013] DTUPCDR uses deep learning models such as deep matrix factorization (DMF) or neural collaborative filtering (NeuMF) to learn user and item embedding representations, generating personalized preference transfer paths for each user, improving the personalization of recommendations, and transferring knowledge from the source domain to the target domain through mapping functions.
[0014] PTUPCDR lacks the ability to model behavior timing, making it difficult to adapt to dynamic changes in user preferences. At the same time, it fails to explicitly model the causal driving factors behind user behavior, making it difficult to determine whether some behaviors of users in the source domain are within their own interests, thereby potentially introducing bias.
[0015] 5. MV-DNN.
[0016] MV-DNN integrates user behavior data from different domains and uses deep learning techniques to map users and items into a shared semantic space, thereby achieving cross-domain recommendation. The model optimizes user representation by maximizing the similarity between user features and items preferred by users in all domains, effectively solving the cold start problem and significantly improving recommendation quality. In addition, MV-DNN learns more rich user representations by jointly learning data from different domains, further improving the performance of the recommendation system.
[0017] The computational complexity of MV-DNN is high, especially when dealing with large-scale datasets, the training and inference process requires a large amount of computing resources, which may limit its application in resource-limited environments. Secondly, its model ignores the causal relationship and lacks interpretability, and cannot distinguish whether user behavior is based on real interest or other confusing factors (such as conformity).
[0018] Cross-domain knowledge transfer is an important technical path to address the cold start and data sparsity problems in current recommendation systems. By utilizing the behavior data accumulated by users in the source domain, more personalized and generalizable recommendations can be achieved in the target domain. However, existing cross-domain recommendation methods still have the following key problems in practical applications:
[0019] 1. Unable to capture dynamic behavior preferences of users.
[0020] User interests are not static but evolve over time and behavior. For example, a user searches for travel-related products in the short term, indicating that their recent interest is travel, but their long-term interest may still be electronic products. Existing models (such as EMCDR, PTUPCDR, DPTUPCDR) mainly rely on static mapping functions, ignoring the time order and dynamic evolution of interactions, and failing to fully utilize the time order information of user behavior, resulting in the inability to effectively distinguish between long-term stable interests and short-term immediate interests of users, which limits the recommendation accuracy of the model when facing dynamic scenarios with rapidly changing user interests.
[0021] 2. Lack of understanding of the causal relationship of user behavior, leading to "negative transfer".
[0022] When performing cross-domain knowledge transfer, existing methods fail to explicitly model the causal driving factors behind user behavior. They often only focus on the correlation of behavior, rather than the true causality. This "causal confusion" leads to the inability of the model to accurately identify which user preference information in the source domain is truly useful for the target domain. Therefore, the model may transfer some irrelevant or even harmful preference information (such as accidental purchases triggered by external events or conformity behavior) to the target domain. This indiscriminate knowledge transfer not only reduces the accuracy of recommendations, but also may cause "negative transfer" phenomenon, i.e. the knowledge transferred from the source domain actually damages the recommendation performance of the target domain.
[0023] 3. Lack of dynamic interaction and deep fusion ability of user features.
[0024] User behavior is driven by a variety of complex factors, including temporal dynamics (behavior sequence), intrinsic causality (real interest, motivation), and external environment (time, style, etc.). Existing models often use simple concatenation or linear combination when dealing with these multi-dimensional features, which cannot achieve dynamic interaction and deep fusion between these features. Traditional models (such as sequence-based models) may be good at handling temporal information, but it is difficult to effectively integrate causal driving factors. When trying to input multiple features (e.g., item ID, time, style) into the model, they are usually simply concatenated into a long vector and processed by subsequent layers. This approach assumes that all features are equally important and lacks a flexible mechanism to dynamically adjust the contribution of different features to the final prediction, especially when performing cross-domain knowledge transfer. This shallow feature fusion mechanism prevents the model from capturing complex, non-linear interactions between different features. For example, it cannot understand the deep association that "users buy leisure style (style feature) goods on weekends (time feature)". More importantly, when cross-domain migration, this shallow fusion cannot effectively identify and select the feature interaction patterns that are truly useful for the target domain, which may result in irrelevant or inefficient feature combinations being transferred during migration, affecting the model's generalization ability and recommendations. SUMMARY
[0025] The purpose of the present application is to overcome the above-mentioned deficiencies in the prior art, and to provide a reasonable design of a spatio-temporal-causal dual-path knowledge transfer cross-domain recommendation method, which aims to dynamically model and fine-migrate user complex behavior patterns, to solve the problems of insufficient dynamic capture of user interest, negative transfer caused by lack of causal understanding, and low efficiency of multi-dimensional feature fusion in existing cross-domain recommendation.
[0026] The technical scheme adopted by the present application to solve the above problems is:
[0027] A cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating, comprising the following steps:
[0028] (I) Constructing a multi-domain interaction dataset;
[0029] (II) Input and shared behavior encoding;
[0030] (III) Parallel modeling of spatio-temporal path and causal path;
[0031] (IV) Dynamic gating fusion;
[0032] (V) Cross-domain knowledge transfer and recommendation prediction.
[0033] The step (I) of the present application comprises the following steps:
[0034] (1) Collect the historical interaction data of users in the source domain and the target domain;
[0035] (2) In the data preprocessing stage, identify the common users in the source domain and the target domain, and randomly select a certain proportion of users from these common users as test users.
[0036] (3) In the source domain, all data is used as source domain training data;
[0037] In the target domain, the common user data and non-common user data that do not belong to the test users are used as target domain training data, and the user data that belongs to the common users and is not in the test set is further divided into meta-training data.
[0038] The historical interaction data described in the application includes user ID, item ID, rating value and timestamp; all user IDs and item IDs are remapped in the lattice domain, and the timestamp is processed by bucketing.
[0039] The step (two) described in the application comprises the following steps:
[0040] (1) For each user, the historical behavior sequence is composed of a series of interactions, each interaction contains three original features of item ID, timestamp and item style;
[0041] (2) Feature embedding: convert the above three original features into embedding vectors through embedding layer:
[0042] Item embedding vector:
[0043] Time embedding vector:
[0044] Style embedding vector:
[0045] Wherein: E item is the item embedding function, E time is the time embedding function, E styte is the style embedding function, D emb is the embedding dimension, i represents the item ID, t represents the timestamp, S represents the item style, k represents the kth interaction in the behavior sequence, and R represents the real number domain, represents a real number vector space with dimension D emb .
[0046] (3) Feature concatenation: concatenate the above three embedding vectors to form the original multi-dimensional representation of each behavior:
[0047]
[0048] For a behavior sequence with length L, the following
[0049] where x k is the single-behavior representation, X seq is the behavior sequence representation;
[0050] (4) The shared encoder receives the behavior sequence representation X seq as input:
[0051]
[0052] where: D hidden is the output dimension of the shared encoder, f shared is the shared encoder function, and this output is the shared feature representation shared_feat.
[0053] The step (three) of the present application comprises the following steps:
[0054] (1) After the shared encoder generates the shared feature representation, it is input in parallel to the spatio-temporal path and the causal path;
[0055] (2) In the spatio-temporal path:
[0056] (21) Use a temporal convolutional network to process the shared feature representation;
[0057] (22) Introduce an attention mechanism;
[0058] (3) In the causal path:
[0059] (31) Use a multi-head attention mechanism to capture the complex dependency relationship between different behaviors in the behavior sequence, and construct a differentiable attention output of user behavior:
[0060]
[0061] where H attn is the attention output;
[0062] (32) Causal factor decoupling: the factor projector projects the attention output H attn onto a set of latent causal factors:
[0063]
[0064] where N factors is the number of causal factors;
[0065] (33) Causal graph construction and feature extraction: the graph generator generates a differentiable causal graph adjacency matrix according to the average pooling result of the attention output H attn :
[0066]
[0067] (34)Then, by matrix multiplication, the propagation of causal factors on the graph is simulated, and the behavior causal features are extracted:
[0068] Wherein, bmm is batch matrix multiplication;
[0069] (35)Counterfactual reasoning: the counterfactual network receives the aggregated causal factor features, calculates the potential preference representation of the user under a specific causal intervention, and finally generates the causal preference representation casual_feat:
[0070] causal_feat=MLP(F propagated-agg ),
[0071] Wherein, F propagated-agg represents the aggregated causal factor features.
[0072] The step (three) (21) of the application is:
[0073] The input will be dimensionally converted to adapt to the input format of Conv1d:
[0074]
[0075] Wherein, B is the batch size, L is the length of the behavior sequence, and D hidden is the hidden layer dimension.
[0076] The step (three) (21) of the application is:
[0077] The time convolution network is composed of multiple causal convolution layers with weight normalization, which can capture long-term dependencies in the sequence:
[0078]
[0079] Wherein, D TCN_out is the final output channel number of the time convolution network TCN, and H TCN is the output feature of the time convolution network TCN.
[0080] The step (three) (22) of the application is:
[0081] On the output of the time convolution network, an attention network is applied, which converts the output feature H TCN of the time convolution network into attention weights:
[0082] A temporal =Softmax(Linear(H TCN ·permute(0,2,1)))∈RB×L×1 ,
[0083] where permute is a dimension permutation;
[0084] Then, the H TCN is weighted and summed to obtain the final spatio-temporal preference representation temporal_feat:
[0085]
[0086] The step (four) of the application comprises the following steps:
[0087] (1) Dynamic gating receives the spatio-temporal preference representation and the causal preference representation as input; the dynamic gating includes local gating and global gating, the local gating focuses on the local influence of the temporal feature on the recommendation result, and the global gating is responsible for integrating the temporal and causal information;
[0088] Local gating: only taking the spatio-temporal preference representation as input, a local weight is calculated:
[0089]
[0090] Global gating: taking the spatio-temporal preference representation and the causal preference representation as input after splicing, a global weight is calculated:
[0091]
[0092] (2) Fusion weight: the final fusion weight is the product of the outputs of the local gating and the global gating:
[0093]
[0094] where ⊙ represents element-wise multiplication;
[0095] (3) Dynamic fusion: using the fusion weight to weight and combine the user embedding and the causal preference, and combining the learnable α and β parameters:
[0096]
[0097] This F fused is the final fused user preference representation ufea.
[0098] The step (five) of the application comprises the following steps:
[0099] (1) Behavior meta-learning network: the meta-learning network receives the fused user preference representation and the behavior sequence as input, aggregates the historical behavior features through the attention mechanism, and dynamically generates a user-specific mapping matrix using the decoder:
[0100]
[0101]
[0102] Where B is the batch size;
[0103] (2) Preference transfer: The fused user preference representation is mapped through this meta-learning.
[0104] Matrix transformation:
[0105]
[0106] This U′ tgt This refers to the user representation migrated to the target domain;
[0107] (3) Recommendation prediction: The migrated user representation U′ tgt Embedded with items in the target domain E item (i target )Scoring calculation:
[0108] Score(u,i target )=U′ tgt ·E item (i target ) T ,
[0109] (4) Finally, output the predicted score.
[0110] Compared with the prior art, the present invention has the following advantages and effects:
[0111] 1. To address Problem 1, this invention establishes a spatiotemporal path to capture the dynamic evolution of user interests. First, the user's behavioral sequences in the source and target domains are uniformly encoded. Then, a temporal convolutional network is used to process the representations of these behavioral sequences, learning the evolutionary trends of user behavior to understand the user's long-term stable interests. Simultaneously, an attention mechanism is introduced, assigning different weights to interactions at different points in the behavioral sequence, focusing on recent behaviors most relevant to the current prediction task, thereby accurately capturing the user's short-term, immediate interests. Through the combination of temporal convolutional networks and the attention mechanism, the spatiotemporal path can simultaneously model both long-term and short-term user interests, overcoming the limitations of existing models that rely on static interaction data.
[0112] 2、For problem 2, the invention sets up a causal path for displaying the causal driving factors behind the modeling user, to solve the problems of causal confusion and negative transfer. Firstly, a differentiable attention output of user behavior is constructed by adopting a multi-head attention mechanism, which can dynamically capture the complex causal relationship between user behaviors and support the backward propagation of gradients. Then, the attention output is projected onto a set of latent causal factors by a factor projector, and these factors represent the underlying causes of user behavior rather than superficial correlations. Next, an adjacency matrix of a causal graph is further generated to display the interaction relationship between these decoupled causal factors, so that the invention can understand the deep relationship between factor causality. Then further extract behavior causal features, and combine counterfactual reasoning to calculate the user's potential preference representation under a specific causal intervention, so as to realize accurate prediction based on causal relationship, and effectively avoid the bias caused by causal confusion.
[0113] 3、For problem 3, the invention sets up a dynamic gate as a bridge connecting the temporal path and the causal path, for realizing dynamic interaction and deep fusion of user behavior features, which contains local gate and global gate. The local gate focuses on the local influence of temporal features on the recommendation results, while the global gate is responsible for integrating temporal and causal information. The dynamic gate can dynamically learn a fusion weight according to the input user and behavior data, which is used to adaptively combine the features output by the spatio-temporal path and the causal path. This ensures that the model can generate a personalized preference representation that best suits the current state of each user. The dynamic gate also acts as a dynamic router, allocating information flow according to the input behavior features, deciding which information should be primarily processed by the temporal path and which information should be primarily processed by the causal path, ensuring that each module can obtain the most relevant information, thereby improving the performance and robustness of the model. BRIEF DESCRIPTION OF DRAWINGS
[0114] Figure 1 The figure is a schematic diagram of the overall architecture of the embodiment of the invention. DETAILED DESCRIPTION
[0115] The invention will be further described in detail below in conjunction with the drawings and by examples, and the following examples are an explanation of the invention and the invention is not limited to the following examples.
[0116] I. A cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to an embodiment of the invention, comprising the following steps:
[0117] (I) Construct a multi-domain interaction dataset, comprising the following steps:
[0118] (1) First, collect the historical interaction data of users in the source domain src and the target domain tgt; these historical interaction data include user ID, item ID, rating value and timestamp.
[0119] (2) In the data preprocessing stage, co-users in the source domain and the target domain are identified; from these co-users, a certain proportion of users are randomly selected as test users.
[0120] (3) In the source domain, all data is used as source domain training data;
[0121] In the target domain, the co-user data and non-co-user data that do not belong to the test users are used as target domain training data, and the user data that belongs to the co-users and is not in the test set is further divided into meta-training data for training in the meta-learning stage.
[0122] All user and item IDs are remapped within the grid domain, and the timestamp is bucketed.
[0123] This step has the following advantages and effects: this fine-grained data set construction strategy provides the necessary training and test data for the meta-learning framework, ensuring that the application learns the knowledge of the source domain while adapting and verifying in the target domain through meta-tasks, effectively addressing the cold start problem.
[0124] (B) Input and shared behavior encoding, including the following steps:
[0125] (1) For each user, the historical behavior sequence is composed of a series of interactions, each of which contains item ID, timestamp and item style as three original features.
[0126] (2) Feature embedding: convert the above three original features into low-dimensional dense embedding vectors through independent embedding layers:
[0127] Item embedding vector:
[0128] Time embedding vector:
[0129] Style embedding vector:
[0130] Where: E item is the item embedding function, E time is the time embedding function, E style is the style embedding function, D emb is the embedding dimension, i represents the item ID, t represents the timestamp, S represents the item style, k represents the kth interaction in the behavior sequence, and R represents the real number domain, represents a real number vector space with dimension D emb .
[0131] (3) Feature concatenation: The above three embedding vectors are concatenated to form the original multi-dimensional representation of each behavior:
[0132]
[0133] For a behavior sequence of length L, we get
[0134] where x k is a single behavior representation, and X seq is a behavior sequence representation.
[0135] (4) Shared encoder (sharedEncoder): The shared encoder receives the behavior sequence representation X seq as input. It is a multi-layer perceptron (MLP) that includes linear layers (Linear), layer normalization, ELU activation functions, and Dropout layers:
[0136]
[0137] where: D hidden is the output dimension of the shared encoder, and f shared is the shared encoder function. This output is the shared feature representation shared_feat.
[0138] This step has the following advantages and effects: This mechanism realizes the unified fusion of heterogeneous information and maps them to a unified semantic space. This solves the problem of traditional methods relying on single features, enabling subsequent spatio-temporal path and causal path modeling based on a more comprehensive and rich feature representation, ensuring the consistency and comparability of the information input of the two paths, and laying a foundation for subsequent deep modeling.
[0139] (Three), parallel modeling of spatio-temporal path and causal path, including the following steps:
[0140] (1) After generating the shared feature representation shared_feat in the shared encoder, it is parallelly input to the spatio-temporal path and the causal path;
[0141] (2) In the spatio-temporal path:
[0142] (21) Use the temporal convolution network (TCN) to process the shared feature representation shared_feat to learn the evolution trend of user behavior and understand the user's long-term stable interest. In this step:
[0143] The input will be dimensionally converted to adapt to the input format of Conv1d:
[0144]
[0145] where B is the batch size, L is the length of the behavior sequence, D hidden is the hidden layer dimension.
[0146] The temporal convolutional network is composed of multiple layers of causal convolutional layers with weight normalization (weight_norm), which can capture long-term dependencies in the sequence:
[0147]
[0148] where D TCN_out is the number of final output channels of the temporal convolutional network TCN, H TCN is the output feature of the temporal convolutional network TCN.
[0149] (22) At the same time, an attention mechanism is introduced: on top of the temporal convolutional network TCN output, an attention network is applied, which converts the output feature H TCN of the temporal convolutional network TCN into attention weights:
[0150] A temporal = Softmax(Linear(H TCN · permute(0, 2, 1))) ∈ R B×L×1 ,
[0151] where permute is a dimension permutation.
[0152] Then the weighted sum of H TCN is obtained through these weights, and the final spatio-temporal preference representation temporal_feat is obtained:
[0153]
[0154] This step has the following advantages and effects: it solves the problem that traditional methods cannot capture the dynamic evolution of user interest. The temporal convolutional network TCN effectively extracts the long-term temporal dependence of user preference, and the attention mechanism can strengthen the ability to capture the evolution of periodic or phased interest, thereby accurately depicting the short-term and immediate interest of the user.
[0155] (3) In the causal path:
[0156] (31) Use multi-head attention mechanism to capture the complex dependence between different behaviors in the behavior sequence, and construct a differentiable attention output of user behavior:
[0157]
[0158] H attn is the attention output, which contains the potential association information between behaviors.
[0159] (32) Causal factor decoupling: A factor projector (factor_projector) projects the attention output H attn onto a set of latent causal factors:
[0160]
[0161] where N factors is the number of causal factors.
[0162] (33) Causal graph construction and feature extraction: A graph generator (graph_generator) generates a differentiable causal graph adjacency matrix A from the average-pooled results of the attention output H attn :
[0163]
[0164] (34) Then, by matrix multiplication, the propagation of causal factors on the graph is simulated, and the behavioral causal features are extracted:
[0165] bmm is batch matrix multiplication.
[0166] (35) Counterfactual reasoning: The counterfactual network receives the aggregated causal factor features and calculates the user's potential preference representation under a specific causal intervention through a series of linear layers and activation functions, finally generating the causal preference representation casual_feat:
[0167] causal_feat = MLP(F propagated-agg ),
[0168] where F propagated-agg represents the aggregated causal factor features.
[0169] This step has the following advantages and effects: It solves the problem of lack of recommendation explanation ability and "negative transfer" in existing methods. By explicitly modeling the causal driving factors behind user behavior and combining counterfactual reasoning, it can accurately identify the user preference information that is truly useful for the target domain, enhancing the causal explanation of the user representation and the reliability of cross-domain transfer.
[0170] (Four), dynamic gating fusion, including the following steps:
[0171] (1) The dynamic gate receives the temporal preference representation temporal_feat and the causal preference representation causal_feat as input. The dynamic gate contains local gating and global gating, where the local gating focuses on the local influence of temporal features on the recommendation results, and the global gating is responsible for integrating temporal and causal information.
[0172] Local gating: a small MLP that takes only the spatio-temporal preference representation as input and computes a local weight:
[0173]
[0174] Global gating: also a MLP that takes the concatenation of the spatio-temporal preference representation and the causal preference representation as input and computes a global weight:
[0175]
[0176] (2) Fusion weight: the final fusion weight (gate_weight) is the product of the local gating and the global gating outputs:
[0177]
[0178] where denotes element-wise multiplication.
[0179] (3) Dynamic fusion: use the fusion weight to weight the combination of the user embedding and the causal preference, together with learnable a and b parameters:
[0180]
[0181] This F fused is the final fused user preference representation ufea.
[0182] This step has the following advantages and effects: this mechanism solves the problem of insufficient dynamic interaction and deep fusion of multi-dimensional user behavior characteristics. By dynamically learning the fusion weight, the outputs of the spatio-temporal path and the causal path can be adaptively combined to generate a personalized preference representation for each user that is most suitable for their current state, thereby improving the expression and generalization ability of the user interest representation.
[0183] (Five) Cross-domain knowledge transfer and recommendation prediction, including the following steps:
[0184] (1) Behavior meta-learning network: the meta-learning network (DeepMetaNet) receives the fused user preference representation ufea and the behavior sequence pos_seq as input, aggregates the historical behavior features through an attention mechanism, and uses a decoder to dynamically generate a user-specific mapping matrix:
[0185]
[0186] where B is the batch size.
[0187] (2) Preference transfer: transform the fused user preference representation ufea through the mapping matrix generated by this meta-learning:
[0188]
[0189] This U' tgt is the user representation migrated to the target domain.
[0190] (3) Recommendation prediction: the user representation U' tgt migrated to the target domain is scored with the item embedding E item (i target ) of the target domain:
[0191] Score(u,i target )=U′ tgt ·E item (i target ) T ,
[0192] (4) Finally, the predicted score is output.
[0193] This step has the following advantages and effects: efficient and personalized cross-domain knowledge migration is achieved. Through the mapping matrix dynamically generated by meta-learning, the spatio-temporal and causal knowledge learned in the source domain can be accurately adapted to the target domain, thereby maximizing the positive transfer effect while effectively suppressing negative transfer and solving the cold start and data sparsity problems.
[0194] Second, the effectiveness of the application is verified by strict experiments on real data sets. In order to comprehensively evaluate the performance of the method in the cross-domain recommendation task, the following experiments are conducted:
[0195] 1. Data set.
[0196] This study uses the Amazon-5scores data set, which ensures data validity and reliability by including at least five ratings for each user and item. In order to evaluate the performance of cross-domain recommendation, three representative domains are selected from the 24 commodity categories: movies_and_tv (Movie), cd_and_vinyl (Music), and books (Book). Based on these three domains, the following three cross-domain recommendation scenarios are defined:
[0197] Movie->Music: The movie domain is used as the source domain, and the music domain is used as the target domain.
[0198] Book->Movie: The book domain is used as the source domain, and the movie domain is used as the target domain.
[0199] Book->Music: The book domain is used as the source domain, and the music domain is used as the target domain.
[0200] The division of the dataset strictly followed the common practice of cross-domain recommendation, i.e., dividing the training set and test set according to user overlap, ensuring the fairness of the experiment and the effectiveness of the results.
[0201] 2. Evaluation indicators.
[0202] To evaluate the prediction performance of the method in the recommendation task, two widely used precision indicators are adopted: Mean Absolute Error (MAE) and Root Mean Square Error (RMSE). Mean Absolute Error (MAE) measures the average absolute difference between predicted scores and actual scores:
[0203]
[0204] Root Mean Square Error (RMSE) measures the root mean square difference between predicted scores and actual scores, which punishes larger errors more severely:
[0205]
[0206] where T represents the set of user-item pairs in the test set, r u,i is the actual rating of user u for item i, is the predicted rating. The lower the MAE and RMSE values, the higher the prediction accuracy. These indicators are often used as optimization targets in the recommendation model training process to directly improve the accuracy of prediction.
[0207] 3. Baseline methods.
[0208] To conduct a comprehensive performance comparison, three representative cross-domain recommendation methods are selected as baseline methods: EMCDR, PTUPCDR, and DPTUPCDR. All baseline methods are trained and tested under the same dataset division and evaluation indicators.
[0209] 4. Experimental results.
[0210] Table 1 shows the performance comparison of the method and the baseline methods in three cross-domain scenarios.
[0211] Table 1.
[0212]
[0213] It can be seen that, compared with all baseline methods, the method achieves significant improvement in three cross-domain recommendation scenarios. This result strongly proves the excellent performance of the method in prediction accuracy. In summary, the method not only theoretically proposes an innovative spatio-temporal-causal collaborative modeling framework, but also proves its significant advantages in solving the existing technical user behavior sequence timing and causal dynamic modeling deficiency, negative transfer inhibition and individualized adaptability through quantitative indicators on actual data sets, providing a more accurate, reliable and more interpretable solution for the cross-domain recommendation field.
[0214] In addition, it should be noted that equivalent changes or simple changes made in accordance with the structure, features and principles described in the patent concept of the present application are included in the protection scope of the present application. Those skilled in the art to which the present application belongs can make various modifications or supplements to the described specific embodiments or use similar ways to replace, as long as they do not deviate from the structure of the present application or exceed the scope defined by the present claims, which should belong to the protection scope of the present application.
Claims
1. A cross-domain recommendation method based on spatio-temporal-causal double-path dynamic gating, characterized in that: The method comprises the following steps: (I) constructing a multi-field interaction dataset; (II) inputting and sharing behavior coding; (III) parallel modeling of spatio-temporal path and causal path; (IV) dynamic gate fusion; (V) cross-domain knowledge transfer and recommendation prediction. 2.The spatio-temporal-causal dual-path dynamic gating based cross-domain recommendation method according to claim 1, characterized in that: The step (I) comprises the following steps: (1) collecting historical interaction data of users in the source domain and the target domain; (2) in the data preprocessing stage, common users in the source domain and the target domain are identified, and a certain proportion of the common users are randomly selected as test users; (3) in the source domain, all data are used as source domain training data; In the target domain, the data of the common users who do not belong to the test users and the non-common users are used as target domain training data, and the data of the users who belong to the common users and are not in the test set are further divided into meta-training data. 3.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 2, characterized in that: The historical interaction data comprises user ID, item ID, rating value and timestamp; all user IDs and item IDs are remapped in the grid field, and the timestamp is subjected to bucket processing. 4.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 2, characterized in that: The step (II) comprises the following steps: (1) for each user, the historical behavior sequence comprises a series of interactions, each interaction comprising item ID, timestamp and item style; (2) feature embedding: the above three original features are converted into embedding vectors through an embedding layer: Item embedding vectors: time embedding vectors: Style embedding vector: where: E item is the item embedding function, E time is the time embedding function, E style is the style embedding function, D emb is the embedding dimension, i represents the item ID, t represents the timestamp, S represents the item style, k represents the kth interaction in the behavior sequence, and R represents the real number domain, represents a real number vector space with a dimension of D emb . (3) feature splicing: the above three embedding vectors are spliced to form an original multi-dimensional representation of each behavior: For a behavior sequence of length L, we get wherein x k is a single action representation, X seq is a sequence of action representation; (4) The shared encoder receives the sequence of behaviors representation X seq As input: where: D hidden is the output dimension of the shared encoder, f shared is the shared encoder function, and this output is the shared feature representation shared_feat. 5.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 4, characterized in that: The step (III) comprises the following steps: (1) after the shared encoder generates the shared feature representation, it is input into the spatio-temporal path and the causal path in parallel; (2) in the spatio-temporal path: (21) using a time series convolution network to process the shared feature representation; (22) introducing an attention mechanism; (3) in the causal path: (31) using a multi-head attention mechanism to capture the complex dependency relationship between different behaviors in the behavior sequence, and constructing a differentiable attention output of user behavior: wherein H attn is the attention output; (32) Causal factor decoupling: Factor projector projects attention output H attn onto a set of latent causal factors: where N factors is the number of causal factors; (33) Causal graph construction and feature extraction: The graph generator generates a differentiable causal graph adjacency matrix A from the attention output H attm of the average pooling results: (34)Then by matrix multiplication, the propagation of causal factors on the graph is simulated, and the behavioral causal features are extracted: Wherein, bmm is batch matrix multiplication; (35) counterfactual reasoning: the counterfactual network receives the aggregated causal factor features, calculates the potential preference representation of the user under a specific causal intervention, and finally generates the causal preference representation casual_fea: causal_feat = MLP(F propagated-agg ), where F propagated-agg represents the causal factor feature after the aggregation. 6.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 5, characterized in that: In the step (III) (21): The input will be dimensionally converted to adapt to the input format of Conv1d: where B is the batch size, L is the length of the behavior sequence, D hidden is the hidden layer dimension. 7.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 5, characterized in that: In the step (III) (21): The time series convolution network is composed of multiple causal convolution layers with weight normalization, which can capture long-term dependencies in the sequence: wherein D TCN_out is the final output channel number of the temporal convolutional network TCN, H TCN is the output feature of the temporal convolutional network TCN. 8.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 5, characterized in that: In the step (III) (22): On top of the temporal convolutional network output, an attention network is applied, which converts the temporal convolutional network's output features H TCN into attention weights: A temporal = Softmax(Linear(H TCN permute(0, 2, 1)) e R B×L×1 , Wherein, permute is dimension permutation; The H is then weighted by these weights TCN weighted sum to obtain the final spatio-temporal preference representation temporal_feat: 9.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 5, characterized in that: The step (IV) comprises the following steps: (1) the dynamic gate receives the spatio-temporal preference representation and the causal preference representation as input; the dynamic gate comprises a local gate and a global gate, the local gate focuses on the local influence of the time series features on the recommendation result, and the global gate is responsible for integrating the time series and causal information; Local gate: only taking the spatio-temporal preference representation as input, a local weight is calculated: Global gate: taking the spatio-temporal preference representation and the causal preference representation as input after splicing, a global weight is calculated: (2) Fusion weight: The final fusion weight is the product of the local gating and the global gating output: Where, is element-wise multiplication; (3) Dynamic fusion: Weighted combination of user embedding and causal preference using fusion weight, combined with learnable a and b parameters: This F fused is the final fused user preference representation ufea. 10.The cross-domain recommendation method based on spatio-temporal-causal dual-path dynamic gating according to claim 8, characterized in that: The step (five) includes the following steps: (1) Behavior meta-learning network: The meta-learning network receives the fused user preference representation and the behavior sequence as input, aggregates the historical behavior features through the attention mechanism, and dynamically generates a user-specific mapping matrix using the decoder: Where, B is the batch size; (2) Preference transfer: Transform the fused user preference representation through the mapping matrix generated by the meta-learning: This U' tgt is the user representation migrated to the target domain; (3) Recommendation prediction: Compute the score of each item in the target domain for the user U' using the embedding of the user U' and the embedding of the item i in the target domain E tgt E item (i target ) Score computation: Score(u, i target ) = U' tgt · E item (i target ) T , (4) Finally, output the predicted score.
Citation Information
Cited By
Recommendation method and system, electronic device and storage medium
CN121502097A
Personalized educational resource recommendation method and system
CN122064874A