A multi-behavior sequence recommendation method based on a multi-time-step heterogeneous graph
By combining multi-timestep heterogeneous graph models and knowledge graph information, the problems of data sparsity and information isolation in multi-behavioral sequence recommendation are solved, achieving more accurate and personalized recommendation results.
Patent Information
- Application Number
- CN202411493436.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-10-24
AI Technical Summary
Existing multi-behavior sequence recommendation methods suffer from data sparsity and information isolation when dealing with heterogeneous and time-series information of users and items, resulting in insufficient recommendation accuracy.
Employing a multi-timestep heterogeneous graph model and combining it with knowledge graph information, we construct a multi-timestep heterogeneous module, a knowledge graph information enhancement module, and a multi-behavior learning module. This integrates user, item, and various behavioral information to generate embedding vectors. We then utilize residual learning, attention mechanisms, and contrastive learning to optimize the representation of users and items.
It improves the accuracy and personalization of recommendation systems, enabling a more comprehensive understanding of user behavior and item relationships, and overcomes the problem of insufficient recommendation accuracy caused by information silos.
Smart Images

Figure CN119515493B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data mining technology, and more particularly to a multi-behavioral sequence recommendation method based on multi-timestep heterogeneous graphs. Background Technology
[0002] In today's information-saturated world, recommender systems have become an indispensable component for improving user experience and personalized services. These systems aim to predict and recommend items or services that may match a user's interests by analyzing their behavior and interests. As a fundamental tool, recommender systems aim to recommend information that users are most interested in from a vast array of products. The recommendation process typically involves collecting and analyzing users' historical behavioral data to understand their preferences and behavioral patterns, thereby finding items that better match their preferences. This historical behavioral data can be categorized into single-behavior and multi-behavior recommendations. However, single-behavior recommendations usually involve less data, which can easily lead to data sparsity or cold-start problems.
[0003] In real-world scenarios, there are often multiple types of interactions between users and items, such as viewing, adding to cart, and purchasing on e-commerce platforms. This means user feedback is heterogeneous, and this needs to be considered when modeling user preferences. Besides heterogeneity, user behavior also exhibits a natural sequence. To fully utilize sequential information, some recent studies have proposed single-behavior sequence recommendation, beginning to consider the sequential information of one type of implicit user feedback. However, these methods clearly overlook other implicit feedback that may contain useful information.
[0004] Multi-behavior sequence recommendation is an innovative response to this problem, considering not only time-series information but also various behavioral information, resulting in better performance and personalization. Current work on multi-behavior sequence recommendation includes neighborhood-based methods, matrix factorization-based methods, and deep learning-based methods. Neighborhood-based methods (such as ABIS) ignore long-term user preferences and are inefficient. Matrix factorization-based methods (such as TransRec++) face challenges in handling non-linear features such as sequence information and higher-order neighborhood information. Therefore, research focuses on deep learning-based methods. Deep learning methods include those based on RNNs, GNNs, and Transformers. RNN-based methods (such as DIPN) can store short-term memory but suffer from vanishing and exploding gradients. Moreover, RNNs are inefficient and struggle to predict future sequence information. The Transformer model is a deep learning architecture that uses self-focused networks to reduce computational complexity and improve training speed, and it has gained widespread recognition in recent years for its excellent performance in sequence-to-sequence modeling. While Transformer-based works such as FLAG have emerged in recent years, they are relatively insufficient in modeling specific features of user behavior sequences. In multi-behavioral sequence recommendation, in addition to the temporal relationship of the sequence, it is also necessary to consider the specific attributes of users and items in order to better capture the evolution of users' interests.
[0005] Graph Neural Networks (GNNs) are a widely used feature extraction technique in recent years, and many excellent GNN models have emerged. They can fully utilize the high-order neighbor information of nodes and perform well in recommender systems. In MBSR (Modular Graph Recommendation), many GNN-based recommendation works have achieved excellent results, such as MGNN-SPred, DMBGN, GPG4HSR, BGNN, and BA-GNN. For example, Global and Personalized Graphs for Heterogeneous Sequence Recommendation (GPG4HSR) focuses on two types of behavior: checking and buying. It takes a series of (item, behavior) pairs as input and models all sequences and each sequence from both global and local perspectives. They construct a global graph and a personalized graph, where the global graph captures the relationships between heterogeneous behaviors, and the personalized graph enhances the contextual representation of multiple behavior sequences for a single user to better understand user preferences. Summary of the Invention
[0006] To address the aforementioned technical challenges, such as insufficient data resources and incomplete modeling of multi-behavioral temporal information, a multi-behavioral sequence recommendation method based on multi-timestep heterogeneous graphs is proposed.
[0007] The technical means employed in this invention are as follows:
[0008] A multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs includes:
[0009] S1. Construct a multi-timestep heterogeneous module, and use a multi-timestep heterogeneous graph to model time information, user information, multi-behavioral information and item information to mine the interests of individual users;
[0010] S2. Construct a knowledge graph information enhancement module to improve the representation of users and items by utilizing the rationality and semantic information in the knowledge graph;
[0011] S3. Construct a multi-behavior learning module to represent users and items by integrating various behavioral information;
[0012] S4. Combine user and project information obtained from different perspectives to generate embedding vectors through multi-timestep heterogeneous graph information, multi-behavioral information and knowledge graph information.
[0013] Further, step S1 specifically includes:
[0014] S11. Construct a multi-timestep heterogeneous graph model for a single user:
[0015] Assume there is For each time step, then Construct a single-timestep heterogeneous graph as follows:
[0016]
[0017] in, Indicates at time step The set of user nodes in; Indicates at time step The collection of item nodes in; Indicates at time step The set of edges in the diagram represents various behaviors between users and items.
[0018] Construct a multi-timestep heterogeneous graph as follows:
[0019]
[0020] in, This represents the set of user nodes across all time steps. , represents the set of item nodes in all time steps; , represents the set of edges in all time steps;
[0021] Establish connections between user nodes across multiple single-timestep heterogeneous graphs; if at time step... and There are users in China ,So There is a border in the middle ;
[0022] S12, Residual Learning Update User Representation:
[0023] Update user nodes At time step The representation of The formula is as follows:
[0024]
[0025] in, Indicates user At time step +1 represents; Indicates user At time step The original representation; Indicates user At time step The representation of the neighboring nodes; It is a neural network used to learn and update the representation of user nodes;
[0026] To enhance data representation, comparative learning is performed on this basis. Positive examples are the user's own representation at adjacent time steps, while negative examples are the representations of all other users at any time step. The loss function is established as follows:
[0027]
[0028] in, express and The similarity between them; Parameters that control the smoothness of the curve; Represents the set of all users; Indicates at time step and As a user A set of samples randomly selected from the negative sample set;
[0029] By feeding the sequence of user multi-behavior information with time steps into the multi-behavior heterogeneous model, an information representation with multi-behavior information and time information is obtained.
[0030] Further, step S2 specifically includes:
[0031] S21. Define the attention function as follows:
[0032]
[0033] in, Represents an item node; Represents relation nodes; Representing neighbor nodes; using item nodes Relationship Nodes and neighboring nodes The attention score between each neighbor node and the current item node is calculated by parametric transformation through linear transformation and activation function;
[0034] S22. Normalize the calculated attention scores to obtain the attention weights between each neighbor node and the current item node. ,as follows:
[0035]
[0036] S23, Use The function normalizes the attention scores to ensure that the sum of all attention weights is 1;
[0037] S24, Update number is Embedding of items Numbered The items in the first Embedding in the next iteration Add the weighted sum of the neighbor node representations, and then multiply by the weight matrix. Adding the deviation term Then, a nonlinear transformation is performed to obtain... The representation is as follows:
[0038]
[0039] in, and Indicates trainable parameters; Indicates the number is The items in the first The representation of the next iteration;
[0040] S25. Using the TransR model based on translation distance and the TATEC model based on semantic matching, knowledge representation is generated, and two different graph representations are obtained through initialization. and Among them, the TransR model based on translation distance and the TATEC model based on semantic matching are as follows:
[0041]
[0042]
[0043] S26. Optimize the node representation of the KG using the TransR-based loss function and the TATEC-based loss function, where the TransR-based loss function and the TATEC-based loss function are as follows:
[0044]
[0045]
[0046] S27. To reduce the impact of noise information and ensure the consistency of the graph structure, the calculation formula is as follows:
[0047]
[0048]
[0049] in, and Both represent subgraphs sampled using different seed settings; ( ) represents a consistency parameter for calculating all item nodes. The similarity function is used; based on the consistency scores of the nodes, probability calculations are performed to determine the edges to be retained in the interaction graph, thus obtaining two user and item subgraphs. and ;
[0050] S28. Based on two pairs of viewpoint maps with different emphasis information obtained ( , )and( , Contrastive learning is performed on the node representations of a specific view. Different view embeddings of the same node are considered as positive sample pairs, and different nodes of different views are considered as negative sample pairs, as defined by the following formula:
[0051]
[0052] By using a knowledge-based comparative learning task, information on the item side is supplemented from an external knowledge graph, reducing the impact of external noise.
[0053] Further, step S3 specifically includes:
[0054] S31. To fully utilize multi-behavior interaction graphs and inject higher-order connections into multi-modal relationships, a behavior context-aware information encoder is used to learn user representations of individual behaviors:
[0055]
[0056] in, and Representing users respectively and numbered Items in behavior The representation obtained below; This represents a multi-behavior encoder;
[0057] S32. Perform comparative learning among user behavior embeddings, and achieve cross-type behavior dependency encoding through different embedding combinations to complete user-level information enhancement:
[0058] Randomly select user nodes Different behaviors are used as positive sample pairs for user nodes. and nodes The perspectives between them are sampled as negative sample pairs, and a self-supervised contrastive loss based on InfoNCE loss is defined as follows:
[0059]
[0060] This yields a comprehensive representation of users and items that integrates various behavioral information.
[0061] Further, step S4 specifically includes:
[0062] S41. Introduce a combined weight. and Then the user and numbered The final embedding vector of the item and Represented as:
[0063]
[0064]
[0065] in, and These represent users obtained based on multi-timestep heterogeneous graphs. and numbered The embedding of items; and These represent users obtained based on multi-behavioral information. and numbered The embedding of items; and This indicates that the user information obtained using knowledge graphs was used. Number Items are embedded;
[0066] S42. In the optimization phase, the Bayesian personalized ranking recommendation loss is used as the main task loss to further optimize the parameters. The BPR loss function is defined as follows:
[0067]
[0068] in, Indicates user The observed interaction set.
[0069] The present invention also provides a training method based on the multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs, comprising:
[0070] Step 1: Train the model independently in the multi-timestep heterogeneous module, the multi-behavior learning module, and the knowledge enhancement module, respectively, and learn the initial parameter space of the multi-timestep heterogeneous module, the multi-behavior learning module, and the knowledge enhancement module on different training data;
[0071] Step 2: Use combined weights and The trained node embeddings are concatenated; for new node embeddings, the BPR loss and CL loss of the main model are calculated as the final optimized model:
[0072]
[0073] in, This represents the main optimizer, which is responsible for optimizing the parameters of the entire model; This represents the optimizer for the multi-behavior learning module, responsible for optimizing the parameters of the multi-behavior learning module; This represents the optimizer for the knowledge enhancement module, responsible for optimizing the parameters of the knowledge enhancement module; This represents the optimizer for multi-time-step heterogeneous modules, responsible for optimizing the parameters of these modules. Represents the loss function of each module. This represents the set of node representations for each module; The final node representation set is composed of three embedded modules; the loss function of each module is... The definition is as follows:
[0074]
[0075] in, The weights represent the contrastive learning loss. express 2. Regularization term, used to prevent overfitting; Indicates the weight of the regularization term. This represents all learnable parameters of the model.
[0076] Compared with the prior art, the present invention has the following advantages:
[0077] 1. This invention provides a multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs. It models a single user using multi-timestep heterogeneous graphs, considering both time information and multi-behavior information. In a single-timestep heterogeneous graph, users and items are used as nodes, and different edges represent different behaviors. Users in heterogeneous graphs of multiple timesteps are connected, and the user representation is updated according to the changes in timesteps. This more accurately captures the complex relationships between users, items, and multiple behaviors, thereby improving the accuracy of the recommendation system.
[0078] 2. This invention provides a multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs, which integrates data information from user-item global graphs, multi-timestep heterogeneous individual graphs, and knowledge graphs. Through this integration, the recommendation system can more comprehensively and accurately understand user behavior and item relationships, overcoming the problem of insufficient recommendation accuracy caused by information isolation in traditional methods. This ensures that the system can more comprehensively grasp user interests and behavioral patterns, thereby improving the accuracy and personalization level of recommendations.
[0079] Based on the above reasons, this invention can be widely applied in fields such as data mining. Attached Figure Description
[0080] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0081] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0082] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0083] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0084] like Figure 1 As shown, this invention provides a multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs, including:
[0085] S1. Construct a multi-timestep heterogeneous module, and use a multi-timestep heterogeneous graph to model time information, user information, multi-behavioral information and item information to mine the interests of individual users;
[0086] S2. Construct a knowledge graph information enhancement module to improve the representation of users and items by utilizing the rationality and semantic information in the knowledge graph, thereby improving the accuracy and effectiveness of recommendations;
[0087] S3. Construct a multi-behavior learning module to represent users and items by integrating various behavioral information;
[0088] S4. Combine user and item information obtained from different perspectives to generate embedding vectors through multi-timestep heterogeneous graph information, multi-behavioral information and knowledge graph information.
[0089] In a specific implementation, as a preferred embodiment of the present invention, step S1 specifically includes:
[0090] S11. Construct a multi-timestep heterogeneous graph model for a single user:
[0091] Assume there is For each time step, then Construct a single-timestep heterogeneous graph as follows:
[0092]
[0093] in, Indicates at time step The set of user nodes in; Indicates at time step The collection of item nodes in; Indicates at time step The set of edges in the diagram represents various behaviors between users and items;
[0094] Construct a multi-timestep heterogeneous graph as follows:
[0095]
[0096] in, This represents the set of user nodes across all time steps. , represents the set of item nodes in all time steps; , represents the set of edges in all time steps;
[0097] Establish connections between user nodes across multiple single-timestep heterogeneous graphs; if at time step... and There are users in China ,So There is a border in the middle ;
[0098] S12, Residual Learning Update User Representation:
[0099] Update user At time step The representation of The formula is as follows:
[0100]
[0101] in, Indicates user At time step +1 represents; Indicates user At time step The original representation; Indicates user At time step Contextual information such as the representation of neighboring nodes; It is a neural network used to learn and update the representation of user nodes;
[0102] To enhance data representation, comparative learning is performed on this basis. Positive examples are the user's own representation at adjacent time steps, while negative examples are the representations of all other users at any time step. The loss function is established as follows:
[0103]
[0104] in, express and The similarity between them; Parameters that control the smoothness of the curve; Represents the set of all users; Indicates at time step and As a user A set of samples randomly selected from the negative sample set;
[0105] By feeding the sequence of user multi-behavior information with time steps into the multi-behavior heterogeneous model, an information representation with multi-behavior information and time information is obtained.
[0106] In a specific implementation, as a preferred embodiment of the present invention, step S2 specifically includes:
[0107] S21. Define the attention function as follows:
[0108]
[0109] in, Represents an item node; Represents relation nodes; Representing neighbor nodes; using item nodes Relationship Nodes and neighboring nodes The embedding vector is parameterized through linear transformation and activation function to calculate the attention score between each neighbor node and the current item node;
[0110] S22. Normalize the calculated attention scores to obtain the attention weights between each neighbor node and the current item node. ,as follows:
[0111]
[0112] S23, Use The function normalizes the attention scores to ensure that the sum of all attention weights is 1;
[0113] S24, Update number is items enter Numbered The items in the first The next iteration enter Add the weighted sum of the neighbor node representations, and then multiply by the weight matrix. Adding the deviation term Then, a nonlinear transformation is performed to obtain... as follows:
[0114]
[0115] in, and Indicates trainable parameters; Indicates the number is The items in the first The representation of the next iteration;
[0116] S25. Using the TransR model based on translation distance and the TATEC model based on semantic matching, knowledge representation is generated, and two different graph representations are obtained through initialization. and Among them, the TransR model based on translation distance and the TATEC model based on semantic matching are as follows:
[0117]
[0118]
[0119] S26. Optimize the node representation of the KG using the TransR-based loss function and the TATEC-based loss function, where the TransR-based loss function and the TATEC-based loss function are as follows:
[0120]
[0121]
[0122] S27. To reduce the impact of noise information and ensure the consistency of the graph structure, the calculation formula is as follows:
[0123]
[0124]
[0125] in, and Both represent subgraphs sampled using different seed settings; ( ) represents a consistency parameter for calculating all item nodes. The similarity function is used; based on the consistency scores of the nodes, probability calculations are performed to determine the edges to be retained in the interaction graph, thus obtaining two user and item subgraphs. and ;
[0126] S28. Based on two pairs of viewpoint maps with different emphasis information obtained ( , )and( , Contrastive learning is performed on the node representations of a specific view. Different view embeddings of the same node are considered as positive sample pairs, and different nodes of different views are considered as negative sample pairs, as defined by the following formula:
[0127]
[0128] By using a knowledge-based comparative learning task, information on the item side is supplemented from an external knowledge graph, reducing the impact of external noise and alleviating the problem of data sparsity to some extent.
[0129] In a specific implementation, as a preferred embodiment of the present invention, step S3 specifically includes:
[0130] S31. To fully utilize multi-behavior interaction graphs and inject higher-order connections into multi-modal relationships, a behavior context-aware information encoder is used to learn user representations of individual behaviors:
[0131]
[0132] in, and Representing users respectively and numbered Items in behavior The representation obtained below; This represents a multi-behavior encoder;
[0133] S32. Construct different representations from multiple perspectives and use them as auxiliary signals to alleviate the data sparsity of target behavior, selecting different behaviors as different perspectives. Perform comparative learning between user behavior embeddings and achieve cross-type behavior dependency encoding through different embedding combinations to complete user-level information augmentation.
[0134] Randomly select user nodes Different behaviors are used as positive sample pairs for user nodes. and nodes The perspectives between them are sampled as negative sample pairs, and a self-supervised contrastive loss based on InfoNCE loss is defined as follows:
[0135]
[0136] This yields a comprehensive representation of users and items that integrates various behavioral information.
[0137] The multi-action learning module focuses on extracting meaningful information from various user-item interactions to improve recommendation system performance. Specifically, it constructs a user-item relationship graph for each action (e.g., likes, comments, purchases), and performs information transfer based on this graph to generate representation vectors for users and items. For each user and item, information is collected from their directly related objects (i.e., neighboring nodes). For example, for a user... It will view all the items he / she has liked and summarize the information of these items to form a new user representation. Similarly, for items numbered... For each item, the system examines all users who liked it and aggregates their information to form a new representation of the item. This process is repeated across multiple layers of the neural network, with each layer updating the user and item representations. Initially, pre-defined user and item embeddings are used as input. In this embodiment, considering only a single type of behavior may lead to poor representation quality due to insufficient data. To address this issue, cross-type multi-behavior embedding aggregation is introduced, merging user or item representations from different behavior types to enrich the representation information and reduce the impact of data sparsity. During this process, a transformation matrix is applied to adjust the information between different behavior types while ensuring that this information retains its contextual relevance. In this way, a comprehensive user and item representation integrating multiple behavioral information is obtained, which is more comprehensive and richer, contributing to improved accuracy and personalization of the recommendation system.
[0138] In a specific implementation, as a preferred embodiment of the present invention, step S4 specifically includes:
[0139] S41. Introduce a combined weight. and Then the user and numbered The final embedding vector of the item and Represented as:
[0140]
[0141]
[0142] in, and These represent users obtained based on multi-timestep heterogeneous graphs. and numbered The embedding of items; and These represent users obtained based on multi-behavioral information. and numbered The embedding of items; and This indicates that the user information obtained using knowledge graphs was used. and numbered The embedding of items;
[0143] S42. In the optimization phase, the Bayesian personalized ranking recommendation loss is used as the main task loss to further optimize the parameters. The BPR loss function is defined as follows:
[0144]
[0145] in, Indicates user The observed interaction set.
[0146] The present invention also provides a training method based on the multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs, comprising:
[0147] Step 1: Train the model independently in the multi-timestep heterogeneous module, the multi-behavior learning module, and the knowledge enhancement module, respectively, and learn the initial parameter space of the multi-timestep heterogeneous module, the multi-behavior learning module, and the knowledge enhancement module on different training data;
[0148] Step 2: Use combined weights and The trained node embeddings are concatenated; for new node embeddings, the BPR loss and CL loss of the main model are calculated as the final optimized model:
[0149]
[0150] in, This represents the main optimizer, which is responsible for optimizing the parameters of the entire model; This represents the optimizer for the multi-behavior learning module, responsible for optimizing the parameters of the multi-behavior learning module; This represents the optimizer for the knowledge enhancement module, responsible for optimizing the parameters of the knowledge enhancement module; This represents the optimizer for multi-time-step heterogeneous modules, responsible for optimizing the parameters of these modules. Represents the loss function of each module. This represents the set of node representations for each module; The final node representation set is composed of three embedded modules; the loss function of each module is... The definition is as follows:
[0151]
[0152] in, The weights represent the contrastive learning loss. express 2. Regularization term, used to prevent overfitting; Indicates the weight of the regularization term. This represents all learnable parameters of the model.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs, characterized in that, include: S1. Construct a multi-timestep heterogeneous module, and use a multi-timestep heterogeneous graph to model time information, user information, multi-behavioral information and item information to mine the interests of individual users; S2. Construct a knowledge graph information enhancement module to improve the representation of users and items by utilizing the rationality and semantic information in the knowledge graph, including: S21. Define the attention function as follows: in, Represents an item node; Represents relation nodes; Representing neighbor nodes; using item nodes Relationship Nodes and neighboring nodes The attention score between each neighbor node and the current item node is calculated by parametric transformation through linear transformation and activation function; S22. Normalize the calculated attention scores to obtain the attention weights between each neighbor node and the current item node. ,as follows: S23, Use The function normalizes the attention scores to ensure that the sum of all attention weights is 1; S24, Update number is Embedding of items , will be numbered The items in the first Representation of the next iteration Add the weighted sum of the neighbor node representations, and then multiply by the weight matrix. Adding the deviation term Then, a nonlinear transformation is performed to obtain... as follows: in, and Indicates trainable parameters; Indicates the number is The items in the first The representation of the next iteration; S25. Using the TransR model based on translation distance and the TATEC model based on semantic matching, knowledge representation is generated, and two different graph representations are obtained through initialization. and Among them, the TransR model based on translation distance and the TATEC model based on semantic matching are as follows: S26. Optimize the node representation of the KG using the TransR-based loss function and the TATEC-based loss function, where the TransR-based loss function and the TATEC-based loss function are as follows: S27. To reduce the impact of noise information and ensure the consistency of the graph structure, the calculation formula is as follows: in, and Both represent subgraphs sampled using different seed settings; ( ) represents a consistency parameter for calculating all item nodes. The similarity function is used; based on the consistency scores of the nodes, probability calculations are performed to determine the edges to be retained in the interaction graph, thus obtaining two user and item subgraphs. and ; S28. Based on two pairs of viewpoint maps with different emphasis information obtained ( , )and( , Contrastive learning is performed on the node representations of a specific view. Different view embeddings of the same node are considered as positive sample pairs, and different nodes of different views are considered as negative sample pairs, as defined by the following formula: By using a knowledge-based comparative learning task, information on the item side is supplemented from an external knowledge graph, reducing the impact of external noise; S3. Construct a multi-behavior learning module to represent users and items by integrating various behavioral information; S4. Combine user and item information obtained from different perspectives to generate embedding vectors through multi-timestep heterogeneous graph information, multi-behavioral information and knowledge graph information.
2. The multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs according to claim 1, characterized in that, Step S1 specifically includes: S11. Construct a multi-timestep heterogeneous graph model for a single user: Assume there is For each time step, then Construct a single-timestep heterogeneous graph as follows: in, Indicates at time step The set of user nodes in; Indicates at time step The collection of item nodes in; Indicates at time step The set of edges in the diagram represents various behaviors between users and items. Construct a multi-timestep heterogeneous graph as follows: in, This represents the set of user nodes across all time steps. , represents the set of item nodes in all time steps; , represents the set of edges in all time steps; Establish connections between user nodes across multiple single-timestep heterogeneous graphs; if at time step... and There are users in China ,So There is a border in the middle ; S12, Residual Learning Update User Representation: Update user At time step The representation of The formula is as follows: in, Indicates user At time step The representation of; Indicates user At time step The original representation; Indicates user At time step The representation of the neighboring nodes; It is a neural network used to learn and update the representation of user nodes; To enhance data representation, comparative learning is performed on this basis. Positive examples are the user's own representation at adjacent time steps, while negative examples are the representations of all other users at any time step. The loss function is established as follows: in, express and The similarity between them; Parameters that control the smoothness of the curve; Represents the set of all users; Indicates at time step and As a user A set of samples randomly selected from the negative sample set; By feeding the sequence of user multi-behavior information with time steps into the multi-behavior heterogeneous model, an information representation with multi-behavior information and time information is obtained.
3. The multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs according to claim 1, characterized in that, Step S3 specifically includes: S31. To fully utilize multi-behavior interaction graphs and inject higher-order connections into multi-modal relationships, a behavior context-aware information encoder is used to learn user representations of individual behaviors: in, and Representing users respectively and numbered Items in behavior The representation obtained below; This represents a multi-behavior encoder; S32. Perform comparative learning among user behavior embeddings, and achieve cross-type behavior dependency encoding through different embedding combinations to complete user-level information enhancement: Randomly select user nodes Different behaviors are used as positive sample pairs for user nodes. and nodes The perspectives between them are sampled as negative sample pairs, and a self-supervised contrastive loss based on InfoNCE loss is defined as follows: This yields a comprehensive representation of users and items that integrates various behavioral information.
4. The multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs according to claim 1, characterized in that, Step S4 specifically includes: S41. Introduce a combined weight. and Then the user and numbered The final embedding vector of the item and Represented as: in, and These represent users obtained based on multi-timestep heterogeneous graphs. and numbered The embedding of items; and These represent users obtained based on multi-behavioral information. and numbered The embedding of items; and This indicates that the user information obtained using knowledge graphs was used. and numbered The embedding of items; S42. In the optimization phase, the Bayesian personalized ranking recommendation loss is used as the main task loss to further optimize the parameters. The BPR loss function is defined as follows: in, Indicates user The observed interaction set.
5. A training method based on the multi-behavior sequence recommendation method based on multi-timestep heterogeneous graphs as described in claim 4, characterized in that, include: Step 1: Train the model independently in the multi-timestep heterogeneous module, the multi-behavior learning module, and the knowledge enhancement module, respectively, and learn the initial parameter space of the multi-timestep heterogeneous module, the multi-behavior learning module, and the knowledge enhancement module on different training data; Step 2: Use combined weights and The trained node embeddings are concatenated; for new node embeddings, the BPR loss and CL loss of the main model are calculated as the final optimized model: in, This represents the main optimizer, which is responsible for optimizing the parameters of the entire model; This represents the optimizer for the multi-behavior learning module, responsible for optimizing the parameters of the multi-behavior learning module; This represents the optimizer for the knowledge enhancement module, responsible for optimizing the module's parameters. This represents the optimizer for multi-time-step heterogeneous modules, responsible for optimizing the parameters of these modules. Represents the loss function of each module. Represents the set of node representations for each module; The final node representation set is composed of three embedded modules; the loss function of each module is... The definition is as follows: in, The weights represent the contrastive learning loss. express 2. Regularization term, used to prevent overfitting; Indicates the weight of the regularization term. This represents all learnable parameters of the model.
Citation Information
Patent Citations
Knowledge graph recommendation method based on comparative learning and view mining
CN117668254A
Movie item recommendation processing method and device based on knowledge graph
CN118708799A