A knowledge graph enhanced recommendation method and system based on a variational graph autoencoder, and a device
By constructing a path-enhanced knowledge graph and a variational graph autoencoder, the problems of sparse user-item interaction data and insufficient utilization of multi-hop semantic information in existing recommendation systems are solved, and efficient personalized recommendations under complex relational structures are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG OPEN UNIV (GUANGDONG POLYTECHNIC VOCATIONAL COLLEGE)
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-09
AI Technical Summary
Existing recommendation systems suffer from problems such as sparse user-item interaction data, insufficient utilization of multi-hop semantic information, limited ability to model complex relationship structures, insufficient model generalization ability and stability, and inadequate characterization of the influence of social relationships.
By constructing a path-enhanced knowledge graph, we utilize variational graph autoencoders to deeply mine multi-hop semantic relationships between multi-source data. Combining two-dimensional convolutional neural networks and attention mechanisms, we extract entity interaction features and social relationship features. Furthermore, we learn the latent vectors of users through variational graph autoencoders to generate personalized recommendation results.
In scenarios with sparse data and cold start, it significantly improves the accuracy, robustness, and generalization ability of recommendation results, and can stably characterize users' potential preferences.
Smart Images

Figure CN122173638A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology, and in particular to a knowledge graph enhancement recommendation method, system, and device based on variational graph autoencoders. Background Technology
[0002] With the rapid development of internet applications, social networks, and e-commerce platforms, the scale of users and items continues to expand, and the interaction between users and items is becoming increasingly complex. Recommendation systems have become a key technological means to alleviate information overload, improve user experience, and enhance platform service quality. Existing recommendation system methods mainly include collaborative filtering-based methods, content-based methods, and hybrid methods combining both. However, in practical applications, these methods still have the following shortcomings: (1) The problem of sparsity in user-item interaction data is prominent. In real-world scenarios, there are few interactions between a large number of users and items. Traditional collaborative filtering methods struggle to learn stable and reliable user preference representations from sparse data, leading to a decrease in recommendation accuracy.
[0003] (2) Insufficient utilization of multi-hop semantic information. Most existing methods rely only on the explicit interaction relationship between users and items, and fail to fully explore the implicit multi-hop semantic relationships between items and between users and items, which limits the expressive power of recommendation models.
[0004] (3) Limited ability to model complex relationship structures. In real-world systems, items are usually associated with rich attribute information, entity relationships and external knowledge, but traditional recommendation models have difficulty in uniformly modeling and effectively utilizing this complex structured information.
[0005] (4) Insufficient generalization ability and stability of the model. In scenarios with sparse data or cold start, deep learning models are prone to overfitting, and the recommendation results are sensitive to noise, with poor generalization performance and robustness.
[0006] (5) The influence of social relationships is not fully characterized. Social relationships between users can reflect similar interests and behavioral influences, but existing methods have a relatively crude modeling of the structure of users' social networks, making it difficult to distinguish the degree of influence of different social relationships on user preferences.
[0007] Therefore, there is an urgent need to provide a knowledge graph enhancement recommendation method, system, and device based on variational graph autoencoders to solve the above-mentioned technical problems. Summary of the Invention
[0008] To address the problems of existing technologies, this invention provides a knowledge graph-enhanced recommendation method, system, and device based on variational graph autoencoders. This addresses the insufficient ability of existing recommendation systems to model high-order association structures between multi-source heterogeneous entities such as users, items, and attributes in scenarios with sparse data and complex structured information. By constructing a path-enhanced knowledge graph and utilizing a variational graph autoencoder, it deeply mines and integrates multi-hop semantic relationships between multi-source data, achieving accurate modeling of user preferences, thereby improving the accuracy and stability of association information matching and data recommendation.
[0009] The technical solution of this invention is implemented as follows: A knowledge graph enhancement recommendation method based on variational graph autoencoders includes the following steps: S1. Obtain preprocessed input data; the input data includes user-item interaction data, user social network data, and external knowledge data; specifically, preprocessing includes cleaning, denoising, desensitizing, and structuring the collected raw data to provide a unified data foundation for subsequent modeling.
[0010] Interactive data such as clicks, views, ratings, and purchase history. Social network data such as follow relationships and friend relationships.
[0011] A knowledge graph is constructed based on the external knowledge data. The knowledge graph includes multiple triples, which represent entities and relationships between them. Entities are items and their related attributes. For example, an item can be a "movie," and its related attributes include "director," "actors," and "background music." Therefore, "movie," "director," "actors," and "background music" are all entities, and the relationships include "directed by," "starring in," etc. Furthermore, relationships can also be semantic relationships such as "belongs to," "associated with," and "produced in."
[0012] S2. Perform path enhancement processing on the knowledge graph to mine multi-hop semantic associations between entities; S3. Extract entity interaction features using the knowledge graph; extract user social relationship features based on the social network data; fuse the entity interaction features and the social relationship features to obtain fused features; S4. Introduce a variational graph autoencoder to probabilistically model the fused features in order to learn the latent vector of the user; S5. Based on the latent vector, predict the preference relationship between the user and the item, and generate personalized recommendation results for the user.
[0013] As a further optimization of the above scheme, the triplet is represented as follows: , Indicates the head entity. Indicates the tail entity. express and The relationship between them; The path enhancement process is as follows: S21. For each triplet, extract its corresponding inverse triplet, denoted as: , express The inverse relation is used to supplement the knowledge graph as a new triple; by introducing the inverse relation, the expressive power of the graph structure can be enhanced. S22. Based on the random walk strategy, generate multi-hop relationship paths among multiple triples; remove duplicate multi-hop relationship paths; specifically, a random walk sequence can be constructed based on multiple triples, where both ends of the sequence are entities, and the middle consists of entities and relationships set at intervals; remove the entities and retain the multiple relationships in the middle, which represents the multi-hop relationship path.
[0014] For example, if there are triples ["Movie A", "The director is", "Director B"] and ["Actor C", "Starred in", "Movie A"], the resulting sequence is represented as ["Actor C", "Starred in", "Movie A", "The director is", "Director B"]. The existing multi-hop relation path is ["Starred in", "The director is".
[0015] S23. Match the target relationship to the multi-hop relationship path and calculate the confidence between them; only when the confidence is within a preset threshold range, generate candidate enhanced triples based on the multi-hop relationship path and the target relationship to represent the multi-hop semantic association relationship; S24. The candidate enhancement triples are added to the knowledge graph to represent the enhancement of the knowledge graph.
[0016] By implementing path enhancement strategies, the system can infer and derive a large number of implicit indirect relationships from existing sparse direct relationships. This process effectively mines the deep semantic connections between entities in the knowledge graph, thereby significantly expanding the scale and diversity of relational data. This provides richer and more robust feature and connection information for downstream model training, fundamentally alleviating the problem of insufficient model learning caused by the sparsity of explicit relationships.
[0017] As a further optimization of the above scheme, the process of extracting the entity interaction features is as follows: S31. Convert the elements in the triplet into embedding vectors, and concatenate and reconstruct the embedding vectors into a two-dimensional feature tensor; S32. A two-dimensional convolutional neural network is used to perform convolution operations on the two-dimensional feature tensor to extract the local interaction features between the entity and the relationship; S33. The local interaction features are mapped to low-dimensional interaction representations through a fully connected layer, thereby obtaining the entity interaction features.
[0018] As a further optimization of the above scheme, the extraction of social relationship features is as follows: S34. Construct a social network graph based on the social network data, wherein nodes represent users and edges between nodes represent social relationships between users; S35. Employ an attention mechanism to perform weighted aggregation of the neighboring nodes of each user node, and learn the user's social relationship characteristics; S36. Adaptively learn the influence strength between different users based on attention weights, and generate an attention-weighted adjacency matrix.
[0019] As a further optimization of the above scheme, the feature fusion adopts additive fusion, splicing fusion or multilayer perceptron fusion; The addition and fusion process involves adding the entity interaction features and the social relationship features element by element. The splicing and fusion refers to splicing and combining the entity interaction features and the social relationship features in terms of feature dimension; The multilayer perceptron fusion process involves first splicing and fusing the entity interaction features and the social relationship features, and then performing nonlinear mapping.
[0020] Additive fusion can maintain the original feature dimensions without increasing model complexity. However, it is more sensitive to noise and cannot adaptively weight different feature sources.
[0021] While concatenation and fusion can fully preserve information from both types of features, they significantly increase the dimensionality of the fused representation, thus increasing the difficulty of training the autoencoder. Furthermore, the expansion of the feature space may weaken the model's ability to characterize intrinsic feature correlations.
[0022] Multilayer perceptron fusion can characterize complex nonlinear relationships between different features, but using a multilayer structure leads to higher computational overhead and increases the risk of model overfitting.
[0023] By fusing features from multiple sources, the model can simultaneously characterize users' semantic preferences and social influence, thereby improving the completeness of user representations.
[0024] As a further optimization of the above scheme, the latent vector is generated as follows: The variational graph autoencoder is applied, and the fused features and the adjacency matrix are input. The mean vector and variance vector are learned through a normalized graph convolutional network and a standard graph convolutional network, respectively. Based on the mean vector and the variance vector, the latent vector is generated for each user by sampling from the latent distribution using the reparameterization technique.
[0025] As a further optimization of the above scheme, a training model is constructed to optimize steps S1 to S5 in order to improve the accuracy of the prediction. Specifically, based on the reconstruction of the social network graph, a first loss function is constructed to constrain the latent vectors to maintain the original structural information of the social network graph; a Kullback-Leibler divergence term is introduced into the first loss function to make the distribution of the latent vectors close to a preset Gaussian prior distribution; Construct a second loss function for the prediction; Joint optimization is performed based on the first loss function and the second loss function.
[0026] By introducing the Kullback–Leibler divergence regularization term, the latent vectors are made closer to the prior distribution, thereby improving the model's generalization ability and robustness.
[0027] As a further optimization of the above scheme, the personalized recommendation result is generated as follows: Based on the latent vector corresponding to the user and the embedding vector of the item, the user's preference score for different items is calculated. The items are then sorted according to the preference score, and the top-ranked items are selected to construct a recommendation list, which is the personalized recommendation result.
[0028] This invention also provides a system that applies the aforementioned knowledge graph enhancement recommendation method based on variational graph autoencoders, comprising: The data acquisition and management module is used to preprocess the acquired raw data and to acquire and manage the input data. The knowledge graph construction and path enhancement module is used to construct the knowledge graph and perform the path enhancement process. By introducing inverse relations, random walks and confidence evaluation mechanisms, multi-hop relation paths are mined and completed to generate a path-enhanced knowledge graph, so as to explicitly characterize the potential semantic associations between entities. This invention constructs a path-enhanced knowledge graph, making explicit the implicit multi-hop semantic relationships between items, and introduces inverse relationships and high-confidence path inference mechanisms to structurally complete the original knowledge graph. This breaks through the limitation of traditional recommendation methods that rely solely on explicit user-item interactions, enabling the recommendation system to fully utilize rich external knowledge and semantic association information.
[0029] The interaction feature learning module is used to extract the entity interaction features based on the knowledge graph; by mapping the entities and relations in the enhanced knowledge graph to embedding vectors, and by performing deep interaction modeling of the entity-relation-entity combination through a two-dimensional convolutional neural network, high-order semantic interaction features are extracted to form the knowledge graph interaction representation of the item. A social relationship modeling module is used to extract users' social relationship features from the social network data; A multi-source feature fusion module is used to perform feature fusion processing on the entity interaction features and the social relationship features; The variational graph autoencoder modeling module is used to learn the user's latent vector; it is used to achieve probabilistic modeling and robust representation learning of the user's latent preferences. The recommendation generation and decoding module is used to predict user preference ratings for items based on the latent vectors and generate the personalized recommendation results. The model optimization and feedback learning module continuously updates model parameters based on actual user interactions, enabling adaptive evolution and performance improvement of the system. Specifically, it optimizes the system and model by minimizing the calculated loss using a predefined loss function.
[0030] Through the collaborative work of the above modules, an intelligent recommendation system that integrates knowledge semantic information, social structural information and variational graph representation learning mechanism is constructed. It can stably characterize users' potential preferences in data sparse and cold start scenarios, and significantly improve the accuracy, robustness and generalization ability of recommendation results.
[0031] The present invention also provides an apparatus comprising: at least one processor; at least one memory for storing programs or instructions; and, when the program or instructions are executed by the processor, for implementing a knowledge graph enhancement recommendation method based on a variational graph autoencoder as described above.
[0032] Compared with the prior art, the present invention achieves the following beneficial effects: (1) By mining multi-hop semantic relationships in the knowledge graph through path enhancement mechanism, the ability of the knowledge graph to support recommendation tasks is effectively improved; (2) Convolutional neural networks are used to characterize the deep interaction between entities and relationships, which enhances the feature representation capability; (3) The introduction of attention mechanism to differentiate the modeling of user social influence improves the accuracy of user interest modeling; (4) The probabilistic modeling mechanism of variational graph autoencoder significantly enhances the robustness and generalization ability of the model in sparse data and noisy environments; (5) Collaborative modeling of multi-source information was realized, which effectively improved the accuracy, stability and scalability of the recommendation system.
[0033] In summary, the above methods can stably characterize users' potential preferences in scenarios with sparse data and cold start, significantly improving the accuracy, robustness, and generalization ability of recommendation results. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating a knowledge graph enhancement recommendation method based on a variational graph autoencoder provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the system structure of a knowledge graph enhancement recommendation system based on a variational graph autoencoder provided in an embodiment of the present invention. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0036] like Figure 1 As shown, this embodiment provides a knowledge graph enhancement recommendation method based on variational graph autoencoders, including the following steps: S1. Obtain preprocessed input data; input data includes user-item interaction data, social network data among users, and external knowledge data; specifically, preprocessing includes cleaning, denoising, desensitizing, and structuring the collected raw data to provide a unified data foundation for subsequent modeling.
[0037] Interactive data such as clicks, views, ratings, and purchase history. Social network data such as follow relationships and friend relationships.
[0038] A knowledge graph is constructed based on external knowledge data. The knowledge graph consists of multiple triples, which represent entities and the relationships between them. Entities are items and their related attributes. For example, an item can be a "movie," and its related attributes include "director," "actors," and "background music." Therefore, "movie," "director," "actors," and "background music" are all entities, and the relationships include "directed by," "starring in," etc. Furthermore, relationships can also be semantic relationships such as "belongs to," "associated with," and "produced in."
[0039] In this embodiment, a triplet is represented as , Indicates the head entity. Indicates the tail entity. express and The relationship between them.
[0040] S2. Perform path enhancement processing on the knowledge graph to uncover multi-hop semantic relationships between entities. Specifically, the path enhancement process is as follows: S21. For each triplet, extract its corresponding inverse triplet, denoted as: , express The inverse relation; the inverse triples are added as new triples to the knowledge graph; by introducing the inverse relation, the expressive power of the graph structure can be enhanced; S22. Based on the random walk strategy, generate multi-hop relationship paths among multiple triples; remove duplicate multi-hop relationship paths; specifically, a random walk sequence can be constructed based on multiple triples, with entities at both ends of the sequence and entities and relationships set at intervals in the middle; remove the entities in the sequence and retain the multiple relationships in the middle, which represents the multi-hop relationship path.
[0041] For example, if there are triples ["Movie A", "The director is", "Director B"] and ["Actor C", "Starred in", "Movie A"], the resulting sequence is represented as ["Actor C", "Starred in", "Movie A", "The director is", "Director B"]. The existing multi-hop relation path is ["Starred in", "The director is".
[0042] S23. Match the target relation to the multi-hop relation path and calculate the confidence between them; only when the confidence is within the preset threshold range, generate candidate enhanced triples based on the multi-hop relation path and its target relation to represent the multi-hop semantic association relationship; S24. Add the candidate enhancement triples to the knowledge graph to represent the enhancement of the knowledge graph.
[0043] By implementing path enhancement strategies, the system can infer and derive a large number of implicit indirect relationships from existing sparse direct relationships. This process effectively mines the deep semantic connections between entities in the knowledge graph, thereby significantly expanding the scale and diversity of relational data. This provides richer and more robust feature and connection information for downstream model training, fundamentally alleviating the problem of insufficient model learning caused by the sparsity of explicit relationships.
[0044] In practice, the given knowledge graph is used as the training set, represented as... ,in, , , Let them represent the entity set, relation set, and triplet set, respectively; a triplet is represented as... ,in, , , , respectively representing the head entity, tail entity, and relation.
[0045] set up Describes a random walk sequence, and ; This represents the set of all random walk sequences of predefined length. By removing the random walk sequences and retaining only the relationships, a multi-hop relationship path is formed; utilizing... Indicates the first A unique multi-hop relationship path. For example, a random walk sequence is represented as... ,but ,therefore, It can also be further expressed as .
[0046] Multi-hop relationship path The specified target relation is represented as The confidence level between the two is expressed as: ; This means "element a satisfies condition b". Indicates quantity. Therefore, express This can be mapped to a relational path. The number of random walk sequences, of which , Represents the entities at both ends of a random walk sequence. Indicates in There is a head entity in it. With tail entity Able to use relationships The number of directly connected triples must also satisfy the condition that... In the middle, the head entity With tail entity There are relationship paths .
[0047] In this embodiment, the following settings are provided: Indicates the threshold range. This is the lower limit. It represents any possible relationship. By using confidence levels, it explores potential relationships that are similar to existing relationships in terms of path patterns, achieving relationship discovery and graph completion based on path similarity.
[0048] For multi-hop relationship paths The set of several candidate enhancement triples obtained is represented as ,Right now: . This indicates a candidate enhancement triplet.
[0049] In the enhanced knowledge graph, the triples are represented as follows: .
[0050] S3. Extract entity interaction features using knowledge graphs; specifically, the process of extracting entity interaction features is as follows: S31. Convert the elements in the triplet into embedding vectors, and concatenate and reconstruct the embedding vectors into a two-dimensional feature tensor. S32. Use a two-dimensional convolutional neural network to perform convolution operations on the two-dimensional feature tensor to extract local interaction features between entities and relations; S33. By using a fully connected layer, local interaction features are mapped to low-dimensional interaction representations, thus obtaining entity interaction features.
[0051] In practical implementation, for triples Obtain the embedding vector of each element, represented as follows: , , The embedded vectors are concatenated and reconstructed to generate a two-dimensional feature tensor. ,Right now: 。 " indicates a splicing operation.
[0052] Using convolution kernels Two-dimensional convolutional layers, for To process, that is: .in. This represents a feature map, that is, a local interaction feature, and . Indicates the number of channels. The kernel size is the convolution kernel size. It is a non-linear activation function. Indicates spatial dimension. This indicates that both structural interaction information and semantic interaction information in the knowledge graph are encoded simultaneously.
[0053] Will The input is fed into a fully connected layer, which converts the multi-channel spatial features into interactive embedding vectors. (Low-dimensional interaction representation), which represents the user's entity interaction features. Dropout regularization is introduced before linear projection to alleviate overfitting and enhance the model's generalization ability.
[0054] By using multi-layer convolution and non-linear activation operations, high-order interaction features are extracted, and a unified-dimensional knowledge graph interaction feature representation is output through a fully connected layer to characterize the semantic association characteristics of items.
[0055] The social relationship features of users are extracted based on social network data. In this embodiment, the extraction of social relationship features is as follows: S34. Construct a social network graph based on social network data, where nodes represent users and edges between nodes represent social relationships between users; S35. Employ an attention mechanism to perform weighted aggregation of the neighboring nodes of each user node, and learn the user's social relationship characteristics; S36. Adaptively learn the influence strength between different users based on attention weights, and generate an attention-weighted adjacency matrix.
[0056] In practice, the social network graph is represented as follows: ,in For each node, a user is represented. The edges represent the social relationships that exist between users.
[0057] Introduce attention mechanisms on social networks to learn adjacency structures and user feature representations simultaneously.
[0058] Specifically, let's set The adjacency matrix is obtained dynamically through an attention mechanism. This represents user characteristics (i.e., social relationship characteristics), generated through feature aggregation on social networks. For users... Its neighboring nodes attention weights The calculation is expressed as: ; in, Indicates user The initial feature vector; It is a learnable linear transformation matrix. For attention weight vectors, This represents the matrix transpose operation. This represents the set of neighboring nodes of a user.
[0059] By adaptively weighting the contributions of different neighboring nodes, the attention mechanism can highlight social connections that have a more significant impact on user preferences, thereby simultaneously characterizing the influence propagation relationship and interest similarity among users.
[0060] Feature fusion is performed on entity interaction features and social relationship features to obtain fused features.
[0061] Specifically, feature fusion includes additive fusion, splicing fusion, or multilayer perceptron fusion; The fusion process involves adding entity interaction features and social relationship features element by element. The splicing and fusion process involves combining entity interaction features and social relationship features in terms of feature dimension. The multilayer perceptron fusion method involves first splicing and fusing entity interaction features and social relationship features, and then performing nonlinear mapping.
[0062] In this embodiment, a multilayer perceptron fusion method is employed. Specifically, the additive fusion involves element-wise addition of entity interaction features and social relationship features, represented as follows: ; The splicing and fusion, in terms of feature dimensions, combines entity interaction features and social relationship features, and is represented as follows: ; For example, such as , Then they are added together and merged into splicing and fusion into .
[0063] The multilayer perceptron fusion method involves first concatenating and fusing entity interaction features and social relationship features, followed by nonlinear mapping, as shown below. ;in, and For learnable transformation matrices, and For learnable bias vectors, This represents the activation function.
[0064] Embedding user features into a matrix Interaction features with entities Perform fusion and obtain the fusion features and the learned adjacency matrix They are then input into the encoder for encoding.
[0065] Additive fusion can maintain the original feature dimensions without increasing model complexity. However, it is more sensitive to noise and cannot adaptively weight different feature sources.
[0066] While concatenation and fusion can fully preserve information from both types of features, they significantly increase the dimensionality of the fused representation, thus increasing the difficulty of training the autoencoder. Furthermore, the expansion of the feature space may weaken the model's ability to characterize intrinsic feature correlations.
[0067] Multilayer perceptron fusion can characterize complex nonlinear relationships between different features, but using a multilayer structure leads to higher computational overhead and increases the risk of model overfitting.
[0068] By fusing features from multiple sources, the model can simultaneously characterize users' semantic preferences and social influence, thereby improving the completeness of user representations.
[0069] S4. A variational graph autoencoder is introduced to probabilistically model the fused features in order to learn the user's latent vector; in this embodiment, the latent vector is generated as follows: A variational graph autoencoder is applied, with fused features and adjacency matrix as input, and mean vector and variance vector are learned through normalized graph convolutional network and standard graph convolutional network, respectively; Based on the mean vector and variance vector, a reparameterization technique is used to sample from the latent distribution to generate a latent vector for each user.
[0070] Specifically, this embodiment uses row-level... The variational graph autoencoder with normalized graph convolution enhancement learns the latent vector of the user by fusing user features and graph structure information.
[0071] The variational graph autoencoder consists of two graph convolution branches, denoted as the first branch and the second branch, respectively.
[0072] The first branch employs a Normalized Graph Convolutional Network (NormGCN) to process node features row by row before neighborhood aggregation. Normalization is performed to estimate the mean matrix of the latent vectors. ,Right now: ; Indicates row level Normalization can effectively alleviate the zero norm problem of isolated nodes.
[0073] The second branch employs a standard graphical convolutional network (GCN) to estimate the log-variance matrix. The process is represented as follows: .
[0074] The latent vector for each user is computed using a reparameterization method, i.e.: .
[0075] in, Indicates user The latent vectors; multiple latent vectors constitute the latent user embedding matrix. .in, This represents the total number of users in a social network. Indicates user Potential embeddings; Represents the mean vector; , representing the variance vector; . To obtain from the standard normal distribution The noise vector obtained from the sampling is represented as . Represents the identity matrix. This represents element-wise multiplication. The above process ensures the differentiability of random sampling, thus supporting end-to-end optimization based on stochastic gradient descent.
[0076] Based on fusion characteristics and adjacency matrix Calculate the variational posterior distribution of the latent vector. , is represented as: ; This represents a multivariate Gaussian distribution. This represents the operator for constructing a diagonal covariance matrix. The variational posterior distribution is also known as probability.
[0077] By and By incorporating variational coding, the user embedding matrix generated in the latent space can simultaneously preserve high-order connectivity structure information and user personalized preference features.
[0078] S5. Based on the latent vector, predict the preference relationship between users and items to generate personalized recommendation results for users. In this embodiment, the generation of personalized recommendation results is as follows: Based on the latent vector of the user and the embedding vector of the item, calculate the user's preference rating for different items, sort the items according to the preference rating, and select the top-ranked items to construct a recommendation list, which is the personalized recommendation result.
[0079] By decoding latent vectors, the structure of a social network graph can be reconstructed, or user preference ratings for items can be predicted. Within the framework of Variational Graph Autoencoders (VGAEs), the core significance of reconstructing the social network structure lies in regulating the representation learning of the latent space through explicit modeling of topological consistency.
[0080] Specifically, in the social network graph, users With users The probability that an edge exists between them is defined as follows: The calculation process is as follows: ; This represents the Sigmoid function. At this point, and They are respectively and The latent vector.
[0081] About users For items The preference rating is recorded as ,Right now Select the top K items with the highest preference ratings to form a recommendation list, and output the personalized recommendation results. Represents items The embedding vectors are obtained through joint training (i.e., training with information from multiple aspects) or from a knowledge graph.
[0082] In this embodiment, a training model is also constructed to optimize steps S1 to S5 in order to improve the accuracy of the prediction. Specifically, based on the reconstruction of the social network graph, a first loss function is constructed to constrain the latent vectors to maintain the original structural information of the social network graph; a Kullback-Leibler divergence term is introduced into the first loss function to make the distribution of the latent vectors close to the preset Gaussian prior distribution. Construct a second loss function for the prediction; Joint optimization is performed based on the first loss function and the second loss function.
[0083] Specifically, the first loss function is optimized by maximizing the lower bound of evidence (ELBO), expressed as: ;in, This represents the KL divergence term, used to constrain the distribution of the latent vectors to approximate a Gaussian prior distribution. Represents a reconstruction term, used to measure the likelihood of observed edges or interactions given a latent vector. This represents the likelihood function of the decoder. Indicates about The Gaussian prior distribution.
[0084] The second loss function uses binary cross-entropy (BCE) loss to measure the prediction probability. With real labels The difference between them is expressed as: ; ; Here, This represents the Sigmoid function.
[0085] The total loss function is constructed based on the first and second loss functions, representing the joint optimization of the two loss functions, i.e.: . This is a balancing coefficient used to control the contribution weight of the recommendation task in the overall optimization objective.
[0086] By introducing the Kullback–Leibler divergence regularization term, the latent vectors are made closer to the prior distribution, thereby improving the model's generalization ability and robustness.
[0087] like Figure 2As shown, this embodiment provides a knowledge graph enhancement recommendation system based on variational graph autoencoders, which applies the knowledge graph enhancement recommendation method based on variational graph autoencoders as described above, including: The data acquisition and management module is used to preprocess the acquired raw data and to acquire and manage input data. The knowledge graph construction and path enhancement module is used to construct knowledge graphs and perform path enhancement processing. By introducing inverse relations, random walks and confidence evaluation mechanisms, it mines and completes multi-hop relation paths to generate path-enhanced knowledge graphs, so as to explicitly characterize the potential semantic relationships between entities. This invention constructs a path-enhanced knowledge graph, making explicit the implicit multi-hop semantic relationships between items, and introduces inverse relationships and high-confidence path inference mechanisms to structurally complete the original knowledge graph. This breaks through the limitation of traditional recommendation methods that rely solely on explicit user-item interactions, enabling the recommendation system to fully utilize rich external knowledge and semantic association information.
[0088] The interaction feature learning module is used to extract entity interaction features from the knowledge graph. By mapping entities and relations in the enhanced knowledge graph to embedding vectors, and using a two-dimensional convolutional neural network to perform deep interaction modeling of entity-relation-entity combination, high-order semantic interaction features are extracted to form the knowledge graph interaction representation of items. The social relationship modeling module is used to extract users' social relationship features from social network data; The multi-source feature fusion module is used to perform feature fusion processing on entity interaction features and social relationship features; The variational graph autoencoder modeling module is used to learn the latent vectors of users; it is used to achieve probabilistic modeling and robust representation learning of users' latent preferences. The recommendation generation and decoding module is used to predict user preference ratings for items based on latent vectors and generate personalized recommendation results. The model optimization and feedback learning module continuously updates model parameters based on actual user interactions, enabling adaptive evolution and performance improvement of the system. Specifically, it optimizes the system and model by minimizing the calculated loss using a predefined loss function.
[0089] Through the collaborative work of the above modules, an intelligent recommendation system that integrates knowledge semantic information, social structural information and variational graph representation learning mechanism is constructed. It can stably characterize users' potential preferences in data sparse and cold start scenarios, and significantly improve the accuracy, robustness and generalization ability of recommendation results.
[0090] This embodiment also provides a device, including: a processor; a memory for storing a program; when the program is executed by the processor, it is used to implement the knowledge graph enhancement recommendation method based on variational graph autoencoder as described above.
[0091] Based on the disclosure and teachings of the foregoing specification, those skilled in the art can make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the protection scope of the claims of the present invention. Furthermore, although some specific terms are used in this specification, these terms are only for convenience of explanation and do not constitute any limitation on the present invention.
Claims
1. A knowledge graph enhancement recommendation method based on variational graph autoencoders, characterized in that, Includes the following steps: S1. Obtain preprocessed input data; the input data includes user-item interaction data, user-social network data, and external knowledge data; A knowledge graph is constructed based on the external knowledge data; the knowledge graph includes multiple triples, which represent entities and relationships between entities; the entities are items and their related attributes. S2. Perform path enhancement processing on the knowledge graph to mine multi-hop semantic associations between entities; S3. Extract entity interaction features using the knowledge graph; extract user social relationship features based on the social network data; The entity interaction features and the social relationship features are fused to obtain fused features; S4. Introduce a variational graph autoencoder to probabilistically model the fused features in order to learn the latent vector of the user; S5. Based on the latent vector, predict the preference relationship between the user and the item, and generate personalized recommendation results for the user.
2. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 1, characterized in that, The triplet is represented as , Indicates the head entity. Indicates the tail entity. express and The relationship between them; The path enhancement process is as follows: S21. For each triplet, extract its corresponding inverse triplet, denoted as: , express The inverse relation; the inverse triple is added to the knowledge graph as a new triple; S22. Based on a random walk strategy, generate multi-hop relationship paths among multiple triples; remove duplicate multi-hop relationship paths. S23. Match the target relationship to the multi-hop relationship path and calculate the confidence level between them; Candidate enhanced triples are generated based on the multi-hop relationship path and the target relationship only when the confidence level is within a preset threshold range, representing the multi-hop semantic association relationship; S24. Add the candidate enhanced triples to the knowledge graph.
3. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 1, characterized in that, The process of extracting the entity interaction features is as follows: S31. Convert the elements in the triplet into embedding vectors, and concatenate and reconstruct the embedding vectors into a two-dimensional feature tensor; S32. A two-dimensional convolutional neural network is used to perform convolution operations on the two-dimensional feature tensor to extract the local interaction features between the entity and the relationship; S33. The local interaction features are mapped to low-dimensional interaction representations through a fully connected layer, thereby obtaining the entity interaction features.
4. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 1, characterized in that, The extraction of the social relationship features is as follows: S34. Construct a social network graph based on the social network data, wherein nodes represent users and edges between nodes represent social relationships between users; S35. Employ an attention mechanism to perform weighted aggregation of the neighboring nodes of each user node, and learn the user's social relationship characteristics; S36. Adaptively learn the influence strength between different users based on attention weights, and generate an attention-weighted adjacency matrix.
5. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 1, characterized in that, The feature fusion is achieved through additive fusion, splicing fusion, or multilayer perceptron fusion. The addition and fusion process involves adding the entity interaction features and the social relationship features element by element. The splicing and fusion refers to splicing and combining the entity interaction features and the social relationship features in terms of feature dimension; The multilayer perceptron fusion process involves first splicing and fusing the entity interaction features and the social relationship features, and then performing nonlinear mapping.
6. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 4, characterized in that, The latent vector is generated as follows: The variational graph autoencoder is applied, and the fused features and the adjacency matrix are input. The mean vector and variance vector are learned through a normalized graph convolutional network and a standard graph convolutional network, respectively. Based on the mean vector and the variance vector, the latent vector is generated for each user by sampling from the latent distribution using the reparameterization technique.
7. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 6, characterized in that, Construct a training model to optimize steps S1 to S5 in order to improve the accuracy of the prediction; Specifically, based on the reconstruction of the social network graph, a first loss function is constructed to constrain the latent vectors to maintain the original structural information of the social network graph; a Kullback-Leibler divergence term is introduced into the first loss function to make the distribution of the latent vectors close to a preset Gaussian prior distribution; Construct a second loss function for the prediction; Joint optimization is performed based on the first loss function and the second loss function.
8. The knowledge graph enhancement recommendation method based on variational graph autoencoder according to claim 1, characterized in that, The personalized recommendation results are generated as follows: Based on the latent vector corresponding to the user and the embedding vector of the item, the user's preference score for different items is calculated. The items are then sorted according to the preference score, and the top-ranked items are selected to construct a recommendation list, which is the personalized recommendation result.
9. A system that applies a knowledge graph enhancement recommendation method based on a variational graph autoencoder as described in any one of claims 1 to 8, characterized in that, include: The data acquisition and management module is used to preprocess the acquired raw data and to acquire and manage the input data. The knowledge graph construction and path enhancement module is used to construct the knowledge graph and perform the path enhancement process. An interaction feature learning module is used to extract the entity interaction features based on the knowledge graph; A social relationship modeling module is used to extract users' social relationship features from the social network data; A multi-source feature fusion module is used to perform feature fusion processing on the entity interaction features and the social relationship features; A variational graph autoencoder modeling module is used to learn the user's latent vectors; The recommendation generation and decoding module is used to predict user preference ratings for items based on the latent vectors and generate the personalized recommendation results. The model optimization and feedback learning module is used to continuously update the model parameters based on the user's actual interaction behavior, thereby enabling adaptive evolution and performance improvement of the system.
10. A device, characterized in that, include: At least one processor; At least one memory is provided for storing a program or instructions; when the program or instructions are executed by the processor, they are used to implement a knowledge graph enhancement recommendation method based on a variational graph autoencoder as described in any one of claims 1 to 8.