Knowledge graph completion method based on topology perception hybrid convolutional network
The TAHC framework addresses the limitations of existing knowledge graph completion methods by integrating graph neural networks and convolutional networks to capture complex relationships and multi-hop reasoning, improving the model's adaptability and performance in knowledge graph completion tasks.
Patent Information
- Application Number
- CN202510804730.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-17
AI Technical Summary
The existing knowledge graph completion method is difficult to effectively capture the diversity of complex relationships and the topological structure in multi-hop inference scenarios. Traditional convolutional neural networks and graph neural networks are limited in their performance when dealing with complex relationships and have overfitting problems.
Topology-aware hybrid convolution network (TAHC) is adopted to realize detailed modeling and information transmission of topology structures through relational rotation operations and multi-head attention mechanisms in complex space, and combine a hybrid convolution decoder with translation feature paths and semantic interaction paths, thereby alleviating the overfitting problem.
It improves the adaptability and generalization ability of the model on different relationship types, can better capture the topological information and diversified interaction modes of complex knowledge graphs, and improves the accuracy and robustness of knowledge graph completion.
Smart Images

Figure CN120317346A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph completion, and more specifically, to a knowledge graph completion method based on a topology-aware hybrid convolutional network. Background Art
[0002] Knowledge graphs (KGs), as a structured representation of knowledge, play an important role in intelligent tasks such as semantic search and reasoning-based decision-making. However, real-world knowledge graphs often suffer from severe missing link problems. Therefore, how to effectively predict potential entity-relationship triples (i.e., knowledge graph completion, KGC) has become a key challenge to enhance their practical value.
[0003] Knowledge graph representation learning provides a systematic solution to this challenge by mapping entities and relationships into a continuous vector space. Early studies mainly relied on shallow models. For example, relationships were modeled by vector translation, and matrix factorization was used to capture latent interactions. These methods have strong interpretability in simple relationship reasoning, but their expressive power is limited by the embedding dimension - low-dimensional spaces are difficult to capture complex semantics, while high-dimensional spaces lead to a surge in the number of parameters, restricting their scalability on large-scale knowledge graphs. To address this issue, neural network models have been introduced into KGC to enhance the knowledge representation ability through nonlinear transformations. For example, multi-layer perceptrons (MLPs) use nonlinear mappings to improve the embedding expressive power, while convolutional neural networks (CNNs) capture high-order interactions between entities and relationships through local receptive fields.
[0004] Currently, CNN-based methods have become an effective choice for KGC tasks. In particular, two-dimensional convolutional networks (such as ConvE) use local receptive fields to model fine-grained entity-relationship interactions. However, such methods mainly rely on static feature transformations and are difficult to explicitly capture the translation characteristics in translation-based models. For example, in a relationship structure such as "species-genus", the reasoning process usually follows a chain logic, and traditional CNNs are difficult to capture this reasoning pattern due to the lack of sequence modeling ability. In addition, CNNs rely on feature mapping and convolutional operations to handle complex relationships. Although they perform well in local feature interactions, they cannot directly utilize the topological structure of the graph and are thus limited in multi-hop reasoning scenarios.
[0005] As an advanced neural network paradigm, Graph Neural Networks (GNNs) aggregate neighborhood information through message passing mechanisms and demonstrate good performance in KGC tasks. Methods based on Message Passing Neural Networks (MPNNs) generally include two key stages: First, the graph encoder uses the GNN structure to learn the topological information of entities, enabling the embeddings to reflect the structural characteristics of the knowledge graph. Second, the decoder calculates the rationality scores of triples, typically using CNN for feature interaction. However, most existing GNN methods rely on linear transformations or simple multiplicative interactions during message calculation, making it difficult to fully capture the diversity of different relation types, thus limiting their ability to enhance entity representations. Although GNNs can provide richer structural information, the final triple scores still depend on CNN calculations, and the inherent limitations of CNNs hinder the improvement of overall reasoning ability.
[0006] In the field of knowledge graph representation learning, non-neural network methods can be mainly divided into two categories: translational embedding models and semantic similarity models. The TransE model based on translational embedding was proposed. As a classic knowledge graph representation learning method, TransE embeds entities and relations into a low-dimensional vector space by means of vector translation to represent triples. However, when dealing with knowledge graphs containing complex relations, the performance of TransE significantly degrades. To address this issue, subsequent studies proposed a series of improved models, including TransH, TransR, RotatE, and TorusE, etc., to optimize and expand the modeling ability of TransE. Another type of method is based on semantic similarity calculation, which evaluates the rationality of triples through inner product operations in the vector space. RESCAL, as a representative work in this direction, uses third-order tensor decomposition to capture the full-rank features of the entity-relation interaction matrix. Subsequent studies introduced structural constraints on the matrix to improve computational efficiency and the expressive power of the model. For example, efficient calculation is achieved by imposing a diagonalization constraint on the matrix, the model is extended to the complex space to model asymmetric relations, and parameter utilization is improved through bidirectional modeling. These methods provide an interpretable algebraic framework for the knowledge completion task.
[0007] Early neural network methods mainly explored knowledge graph representation learning through the basic architecture: The Neural Tensor Network (NTN) uses relation-specific tensors to model the high-order interactions between the head entity and the tail entity embeddings, and calculates the confidence of triples through non-linear transformations; the Multi-Layer Perceptron (MLP) processes the concatenated entity-relation vectors through fully connected layers; the Neural Association Model (NAM) constructs a deep semantic matching framework. However, these shallow architectures are prone to serious overfitting problems, prompting researchers to adopt more complex network structures - Convolutional Neural Networks (CNNs) capture combinatorial patterns through local receptive fields, Recurrent Neural Networks (RNNs) are suitable for modeling temporal dependencies, use self-attention mechanisms to capture global interaction information, and Graph Neural Networks (GNNs) directly aggregate topological neighborhood information, significantly improving the feature extraction ability.
[0008] Convolutional Neural Networks (CNNs) have been widely used in knowledge graph representation learning due to their high parameter utilization efficiency and fast training speed. ConvE reshapes entity and relation embeddings into two-dimensional feature matrices and uses multi-channel convolutional kernels to capture local semantic associations. In addition, it introduces a parameter sharing mechanism to reduce the model complexity, laying an important design paradigm for subsequent research. InteractE proposes a checkerboard embedding recombination strategy to regularly rearrange entity and relation embedding elements, significantly enhancing the interaction density between heterogeneous feature units. AcrE further combines dilated convolution and residual learning mechanisms, and through multi-scale receptive field expansion and cross-layer information fusion, effectively solves the challenges faced by traditional convolutional models in modeling long-range dependencies.
[0009] Graph Neural Networks (GNNs) provide a new modeling paradigm for knowledge graph embedding through a structured information propagation mechanism. R-GCN first introduced multi-relation modeling in the graph convolution framework, using relation-specific weight matrices to distinguish different semantic types, thus overcoming the limitations of traditional neural networks in processing non-Euclidean graph data during neighborhood propagation. A learnable dynamic adjustment mechanism addresses the insufficient discrimination of heterogeneous relations caused by the fixed neighborhood aggregation weights in standard GCN, enabling it to adaptively adjust the intensity of neighborhood information fusion according to the semantic features of nodes. Notably, a joint entity-relation embedding space allows for the simultaneous update of the vector representations of entities and relations during neighborhood aggregation. Its carefully designed combination operator can effectively capture implicit complex semantic associations in the knowledge graph.
[0010] With the wide application of attention mechanisms in graph neural networks, various innovative architectures have emerged in the field of knowledge graph completion. As pioneer work in this direction, KBGAT combines directed path propagation with attention weight assignment, enhancing the global structure perception ability through multi-hop neighborhood information fusion. RAGAT further designs heterogeneous message passing functions for different types of relationships, maintaining the independence of relationship features during the information interaction process, thereby improving the model's adaptability to complex knowledge graph structures. Summary of the Invention
[0011] The technical problem to be solved by the present invention is to provide a knowledge graph completion method based on a topology-aware hybrid convolutional network, realizing the complementary balance between explicit reasoning and implicit feature interaction, thereby enhancing the model's adaptability to different relationship types.
[0012] The present invention adopts the following technical solutions to achieve the invention purpose: A knowledge graph completion method based on a topology-aware hybrid convolutional network, characterized by comprising the following steps: S1: Definition and description of the knowledge graph; formally model the triple structure in the knowledge graph to construct a directed heterogeneous graph composed of entities and relationships, laying a foundation for subsequent graph neural network processing; S2: Design of the message function in the graph neural network; embed entities and relationships into the complex space and use rotation operations to model complex relationship patterns; during the message passing process, apply relationship-specific and direction-sensitive parameters in stages to perform differential feature processing on neighbor nodes, thereby realizing detailed modeling and information transmission of the topological structure; S3: Attention aggregation mechanism in the graph neural network; adopt the graph attention mechanism, dynamically allocate attention weights based on the structural connection and semantic relevance between node neighbors, realize the recognition and focus on key neighbor information, thereby further exploring the importance and semantic role of entities in the local topological structure of the graph; S4: Topology-aware hybrid convolutional decoder; to fully integrate the explicit structural information and deep semantic features between entities, construct a hybrid convolutional decoder that combines a translational feature path and a semantic interaction path. The translational feature path is used to strengthen the translational feature modeling between entities, and the semantic interaction path is used to capture more complex combined semantics, overall enhancing the model's ability to utilize the topological information of the knowledge graph; S5: Training strategy; use the cross-entropy loss function with label smoothing to perform end-to-end training on the model, alleviating the overfitting problem and enhancing the model's generalization ability.
[0013] As a further limitation of this technical solution, the specific steps of S1 are: The knowledge graph is formally represented as a directed graph structure , where represents a set of entities, represents a set of relationships, represents a set of triples; Each triple represents the head entity and the tail entity are related, , and the goal of the link prediction task is to infer the missing relationship between entities based on the known triples, that is, given or , predict the missing entity; To enhance the structural expression ability of the knowledge graph, self-loop relationships and inverse relationships are introduced to expand the original graph structure. Specifically, the expanded set of relationships is defined as follows: (1); where: represents the set of self-loop relationships, represents a self-loop relationship; represents the set of inverse relationships, represents an inverse relationship; Correspondingly, the expanded set of triples is defined as follows: (2); where: represents all triples of the form , is an element in the set of entities ; For each original triple , its inverse triple is added.
[0014] As a further limitation of this technical solution, the specific steps of S2 are as follows: If the entity is connected to the entity through the relationship , then the entity embedding and the relationship embedding will be decomposed into real and imaginary parts: (3); where: The superscripts and of the elements respectively represent the real and imaginary parts after embedding decomposition; represents the -dimensional vector space over the real number field ; is the initial embedding dimension; Subsequently, a relationship-driven rotation operation is performed in the complex space to generate rotation features: (4); Where: Denotes element-wise multiplication; Subsequently, a relationship-specific scaling is applied to the rotation result to enhance semantic discrimination. After concatenating the real and imaginary parts, a relationship-specific diagonal matrix is used for dimensional modulation to generate an intermediate representation: (5); Where: Is a diagonal matrix, and its non-zero elements serve as scaling factors for different dimensions to amplify or suppress specific semantic features; Finally, according to the propagation direction of the relationship, a direction-sensitive projection matrix is selected to map the intermediate representation to the target space to generate the final message: (6); The direction-sensitive parameter is defined as follows: (7) Where: Is the hidden embedding dimension.
[0015] As a further limitation of this technical solution, the specific steps of S3 are as follows: For a central entity , its neighborhood set is defined as the set of all pairs that exist in the knowledge graph, and each neighbor pair generates a message ; ; This message first undergoes a linear transformation through a learnable attention parameter matrix , and then the original attention scores are calculated through a leaky rectified linear unit activation function: (8); These scores reflect the potential influence intensity of the neighborhood node on the central entity. To convert these scores into a probability distribution, the attention scores of all neighborhood nodes need to be further normalized through a softmax function: (9); Where: Is the normalized weight, indicating the importance of this neighbor; Is the original attention score; is a dummy variable used to traverse the neighbor set ; Finally, all messages are aggregated through weighted summation, and the hyperbolic tangent function is applied to generate the updated entity embedding representation: (10); To enhance the model's ability to capture diverse interaction patterns, the multi-head attention mechanism is adopted, where each attention head independently generates messages and weights: Multi-head message generation: Each head uses an independent direction-sensitive weight matrix to project the combined features : (11); Multi-head attention calculation: Each head independently calculates the attention weights and aggregates the messages, and normalizes them to the attention weights , and then aggregates the messages: (12); where: is the normalized attention weight of the -th head; Multi-head fusion: The outputs of all heads are fused through mean pooling to form the final entity representation: (13); where: is the number of attention heads; To ensure the compatibility of the relation embedding with the entity embedding, a linear projection is used to map the relation embedding to the entity space: (14); where: is the projection matrix.
[0016] As a further limitation of this technical solution, the specific steps of S4 are: S41: Translate the feature path; The head entity embedding with topological information encoded by the graph neural network and the relation embedding are concatenated, and then a one-dimensional convolutional filter is applied to perform a convolution operation to generate an intermediate feature map : (15); where: represents the convolution operation; is the activation function; Subsequently, add another one-dimensional convolutional filter to generate a path output : (16); S42: Semantic interaction path; Similar to S41, the head entity embedding with topological information and the relation embedding after encoding by the graph neural network are used to generate different feature permutations through random permutation Each feature permutation is transformed into a two-dimensional matrix through the checkerboard reorganization operation and then a circular convolutional kernel is applied to generate a feature map : : (17); Where: represents the circular convolution operation; The hidden vectors are concatenated, flattened, and then projected to obtain the path output : (18); Where: represents the vectorization operation; is the weight matrix of the fully connected layer; S43: Scoring function; The outputs of the two paths are aggregated by summation, and the final scoring function of the triple is defined as: (19); Where: is the Sigmoid function; represents the tail entity embedding.
[0017] As a further limitation of this technical solution, in S5, the cross-entropy loss function is used to train the model: (20); Where: represents the batch size; is the predicted probability of the th sample; is the true label; is the smoothed target label, which is calculated as follows: (21); Wherein: is the label smoothing coefficient, , which alleviates overfitting by suppressing the overconfidence of the model in extreme label values.
[0018] Compared with the prior art, the advantages and positive effects of the present invention are: 1. A novel KGC framework TAHC is proposed, which integrates a graph neural network as an encoder and a convolutional neural network as a decoder.
[0019] 2. A relation-aware complex space message passing function is designed in the encoder, enabling the model to extract relation-specific information in the parameter space and enhancing the information aggregation ability by using the multi-head attention mechanism.
[0020] 3. A dual-path hybrid convolutional architecture is introduced in the decoder, combining the translational feature path and the semantic interaction path to achieve a complementary balance between explicit reasoning and implicit feature interaction, thereby enhancing the adaptability of the model to different relation types. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a schematic diagram of the overall framework of the TAHC model proposed by the present invention.
[0022] Figure 2 is a bar chart of the ablation experiment results of the TAHC model of the present invention under different configurations, where Figure 2 (a) corresponds to the results on the FB15k-237 dataset; Figure 2 (b) corresponds to the results on the WN18RR dataset.
[0023] Figure 3 is a curve graph of the change of the loss function during the training process of the TAHC model of the present invention, where Figure 3 (a) represents the training loss curve on the FB15k-237 dataset; Figure 3 (b) represents the training loss curve on the WN18RR dataset. DETAILED DESCRIPTION OF THE INVENTION
[0024] The following will describe in detail a specific embodiment of the present invention with reference to the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific embodiment.
[0025] The present invention proposes a novel knowledge graph completion framework - Topology-Aware Hybrid Convolutional Network (TAHC). In the graph encoder part, a relation-aware complex space message passing function is designed to map entities and relations into the complex value space and model complex relation patterns through rotation transformation. This function adopts a hierarchical application method of relation-specific and direction-sensitive parameters to achieve differential feature modeling for different relation types. In addition, a multi-head attention mechanism is introduced to adaptively aggregate information from different relation subspaces, thereby enhancing the model's ability to capture topological structures.
[0026] In the decoder part, a dual-path hybrid convolution architecture is proposed, combining the advantages of the Translational Feature Path (TFP) and the Semantic Interaction Path (SIP). The translational feature path adopts a serial convolutional structure, inheriting the reasoning ability of the translation-based method, and can capture the explicit position information association between entities, thus promoting the reasoning process that conforms to the chain logic. The semantic interaction path models the deep semantic coupling through feature rearrangement and checkerboard transformation, enhancing the model's ability to process complex relation structures. This dual-path fusion strategy not only improves the translational modeling ability of simple relations but also enhances the non-linear interaction modeling ability of complex relations, thereby improving the model's adaptability to heterogeneous topological structures.
[0027] The present invention includes the following steps: S1: Definition and description of the knowledge graph; formalize the modeling of the triple structure in the knowledge graph, and construct a directed heterogeneous graph composed of entities and relations, laying a foundation for subsequent graph neural network processing.
[0028] The specific steps of S1 are as follows: The knowledge graph is formally represented as a directed graph structure , where represents the entity set, represents the relation set, represents the triple set; Each triple represents that there is a relation between the head entity and the tail entity . The goal of the link prediction task is to infer the missing relation between entities based on the known triples, that is, given or , predict the missing entity; To enhance the structural expression ability of the knowledge graph, self-loop relations and reverse relations are introduced to expand the original graph structure. Specifically, the expanded relation set is defined as follows: (1); Where: denotes the set of self-loop relations, denotes a self-loop relation; denotes the set of reverse relations, denotes a reverse relation; Correspondingly, the expanded triple set is defined as follows: (2); Where: denotes all triples of the form where is an element in the entity set ; For each original triple its inverse triple is added.
[0029] This expansion strategy realizes the propagation of information in three directions: the original direction, the self-loop direction, and the reverse direction, thus enhancing the model's ability to capture complex topological patterns in the knowledge graph.
[0030] S2: Design of the message function in the graph neural network; Based on the concept of complex number rotation in the RotatE (Knowledge Graph Embedding by Relational Rotation in Complex Space) model, a new type of relation-aware message function is proposed. The core improvement lies in: embedding entities and relations into the complex number space and using rotation operations to model complex relation patterns; during the message passing process, relation-specific and direction-sensitive parameters are applied in stages to perform differential feature processing on neighbor nodes, thereby realizing the detailed modeling and information transmission of the topological structure.
[0031] The specific steps of S2 are as follows: Entity is connected to entity through relation , then the entity embedding and the relation embedding will be decomposed into real and imaginary parts: (3); Where: The superscripts and The elements respectively represent the real and imaginary parts after embedded decomposition; represents the real number field over dimensional vector space; is the initial embedding dimension; Subsequently, a relation-driven rotation operation is performed in the complex space to generate rotation features: (4); Where: represents element-wise multiplication; This operation naturally models symmetry (degenerating to real multiplication when ) and reversibility (corresponding to complex conjugate operation when ).
[0032] Subsequently, a relation-specific scaling is applied to the rotation result to enhance semantic discrimination. After concatenating the real and imaginary parts, a relation-specific diagonal matrix is used for dimensional modulation to generate an intermediate representation: (5); Where: is a diagonal matrix, whose non-zero elements are scaling factors for different dimensions, which can amplify or suppress specific semantic features; Finally, according to the propagation direction of the relation (forward, self-loop or backward), a direction-sensitive projection matrix is selected to map the intermediate representation to the target space to generate the final message: (6); The direction-sensitive parameter is defined as follows: (7) Where: is the hidden embedding dimension.
[0033] This hierarchical design captures complex relationship patterns through complex rotation, optimizes relation-aware feature adjustment with the help of the diagonal matrix , and ensures the independence between different propagation directions by using , finally generating a highly discriminative message representation.
[0034] S3: Attention aggregation mechanism in graph neural network; The graph attention mechanism is adopted to dynamically allocate attention weights based on the structural connection and semantic correlation between node neighbors, realizing the recognition and focusing on key neighbor information, thereby further exploring the importance and semantic role of entities in the local topological structure of the graph; In the knowledge graph completion task, traditional graph convolutional networks (GCNs) adopt a homogeneous neighborhood aggregation mechanism, that is, all adjacent nodes share fixed information propagation weights. This design ignores the semantic contribution differences of neighborhood nodes to the central entity, limiting the model's ability to capture complex relationship patterns. To address this problem, graph attention networks (GATs) introduce a dynamic attention mechanism, enabling the model to adaptively identify and focus on key neighborhood information.
[0035] The specific steps of S3 are as follows: For a central entity , its neighborhood set is defined as the set of all pairs that satisfy the triple existing in the knowledge graph. Each neighbor pair generates a message ; ; This message is first linearly transformed through a learnable attention parameter matrix , and then the original attention scores are calculated through the activation function of the leaky rectified linear unit (LeakyReLU): (8); These scores reflect the potential influence intensity of the neighborhood node on the central entity. To convert these scores into a probability distribution, the attention scores of all neighborhood nodes need to be further normalized through the normalized exponential function (Softmax): (9); Where: is the normalized weight, indicating the importance of this neighbor; is the original attention score; are dummy variables used to traverse the neighbor set to ensure that the Softmax normalization covers the entire neighborhood; Finally, all messages are aggregated through weighted summation, and the hyperbolic tangent function (tanh) is applied to generate the updated entity embedding representation: (10); To enhance the model's ability to capture diverse interaction patterns, a multi-head attention mechanism is adopted, where each attention head independently generates messages and weights: Multi-Head Message Generation: Each head uses an independent direction-sensitive weight matrix For the combined features Perform projection: (11); Multi-Head Attention Calculation: Each head independently calculates the attention weights And aggregates the messages, and normalizes them to attention weights , and then aggregates the messages: (12); Where: Is the normalized attention weight of the th head; Multi-Head Fusion: The outputs of all heads are fused through mean pooling to form the final entity representation: (13); Where: Is the number of attention heads; To ensure the compatibility between the relation embedding and the entity embedding, a linear projection is used to project the relation embedding Into the entity space: (14); Where: Is the projection matrix. This operation ensures that relations and entities interact in the same semantic space, preventing information loss caused by dimensional mismatch.
[0036] With this design, this method can dynamically select important neighborhood information and capture diverse interaction patterns with the multi-head mechanism, significantly enhancing the model's ability to represent complex knowledge graph structures.
[0037] S4: Topology-Aware Hybrid Convolutional Decoder; To fully integrate the explicit structural information and deep semantic features between entities, a hybrid convolutional decoder that combines a translational feature path and a semantic interaction path is constructed. The translational feature path is used to strengthen the translational feature modeling between entities, and the semantic interaction path is used to capture more complex combined semantics, overall enhancing the model's ability to utilize the topological information of the knowledge graph; In knowledge graph embedding research, most graph neural network (GNN) methods usually adopt off-the-shelf two-dimensional convolutions as decoders. However, the translational information in triples (i.e., the relative relations between entities) is crucial for constructing an effective model. Translational information plays an indispensable role in knowledge graph representation learning. To better integrate explicit and deep semantic information, a hybrid convolutional decoder that combines one-dimensional and two-dimensional convolutions is proposed to fully capture the explicit translational information and deep semantic patterns in the knowledge graph.
[0038] The specific steps of S4 are as follows: S41: Translate the feature path; This path aims to explicitly model the translational information between the head entity and the relation; First, concatenate the head entity embedding with topological information encoded by the graph neural network and the relation embedding, then apply a one-dimensional convolutional filter ( indicating that the elements of this convolutional kernel belong to the real number space, with dimension indicating that this convolutional kernel has x output channels, 2 input channels, and 1 spatial size (i.e., the size of the convolutional kernel)) to perform a convolution operation to generate an intermediate feature map : (15); Among them: represents the convolution operation; is the activation function; This step captures the explicit translational relationship between the head entity and the relation; Subsequently, apply another one-dimensional convolutional filter to (with dimension indicating that this convolutional kernel has 1 output channel, x input channels, and 1 spatial size) to generate the path output : (16); This operation not only maintains the dimensional alignment with the two-dimensional convolutional path but also further extracts global surface features.
[0039] S42: Semantic interaction path; This path is based on the InteractE (Improving Convolution-based Knowledge Graph Embeddings by Increasing) framework and extracts deep semantic information through feature permutation, checkerboard recombination, and circular convolution.
[0040] Similar to S41, concatenate the head entity embedding with topological information encoded by the graph neural network and the relation embedding, , and generate different feature permutations , each feature permutation After the chessboard recombination operation After being converted into a two-dimensional matrix, a circular convolution kernel is applied To generate a feature map : (17); Where: Represents circular convolution operation; After concatenating and flattening the hidden vectors, the path output is obtained through projection : (18); Where: Represents the vectorization operation; Is the weight matrix of the fully connected layer; S43: Scoring function; The two path outputs are aggregated by summation, and the final scoring function of the triple Is defined as: (19); Where: Is the Sigmoid function; Represents the tail entity embedding.
[0041] This hybrid convolution decoding framework enables the model to dynamically capture explicit translational features and deep semantic interactions, enhancing the modeling ability for complex heterogeneous relationships in the knowledge graph.
[0042] S5: Training strategy; The cross-entropy loss function with label smoothing is used to train the model end-to-end, alleviating the overfitting problem and improving the generalization ability of the model.
[0043] In the said S5, the cross-entropy loss function is used to train the model: (20); Where: Represents the batch size; Is the predicted probability of the th sample; Is the true label; Is the smoothed target label, calculated as follows: (21); Where: Is the label smoothing coefficient, , which alleviates overfitting by suppressing the overconfidence of the model in extreme label values (0 or 1).
[0044] experiment Experimental setup Dataset Table 1 Dataset statistics
[0045] In order to comprehensively evaluate the performance of the proposed model, the present invention uses a variety of data sets covering general knowledge bases and domain knowledge bases for verification. Specifically, they include: large-scale general knowledge graph data sets FB15k-237 and WN18RR, and small-scale domain-specific data sets UMLS (biomedical ontology) and Kinship (anthropological kinship). The detailed information of each data set is shown in Table 1. By constructing a data combination of "general large-scale + domain small-scale", the general reasoning ability of the model in open scenarios and the fine modeling effect in knowledge-intensive fields can be effectively evaluated, thereby systematically verifying the cross-domain adaptability and computational robustness of the model of the present invention.
[0046] Evaluation indicators In the knowledge graph completion experiment, the present invention uses indicators such as MRR (mean reciprocal ranking) and Hits@k (k is 1, 3, 10) to comprehensively evaluate the model performance. MRR focuses on reflecting the model's ability to rank correct answers higher by calculating the reciprocal mean of the correct entity rankings. Hits@k represents the proportion of correct entities appearing in the top k prediction results, and is used to evaluate the accuracy of the model in the top k predictions. The above evaluation indicators can comprehensively measure the reasoning performance and prediction accuracy of the model of the present invention from different dimensions.
[0047] Hyperparameter settings For the general datasets FB15k-237 and WN18RR, this paper adopts a single-layer graph attention network (GAT) as a graph encoder and configures two attention heads to achieve multi-view neighbor information aggregation. The initial embedding dimension of entities and relationships is set to 100, and mapped to a 200-dimensional space through a graph convolution layer.
[0048] The decoder adopts a hybrid design of heterogeneous convolutional structures, in which the semantic interaction path reshapes the embedding into a 10×20 matrix, the convolution kernel size is set to 9 (for FB15k-237) and 11 (for WN18RR), and 4 feature rearrangement operations are performed to improve the robustness of the model. The translation feature path adopts a 3-channel convolution structure to effectively capture the sequential reasoning pattern.
[0049] The Adam algorithm is used to update parameters in the optimization phase, the basic learning rate is set to 0.001, and the label smoothing coefficient is 0.1. The batch size is adjusted according to the characteristics of the dataset, FB15k-237 is set to 1024, and WN18RR is set to 256, to balance training efficiency and performance stability.
[0050] For the domain-specific datasets UMLS and Kinship, the present invention directly reuses the data hyperparameter settings of FB15k-237 without any other adjustments.
[0051] Baseline methods To evaluate the effectiveness of the method of the present invention, based on the FB15K-237 and WN18RR datasets, a variety of baseline models were compared - including non-neural network methods (TransE, RotatE, DistMult); methods based on convolutional neural networks (ConvE, InteractE, JointE); methods based on Transformer (SAttLE, PatReFormer); and methods based on graph neural networks (A2N, COMPGCN, RAGAT). In addition, the model of the present invention was further evaluated on the UMLS and Kinship datasets, and the comparison objects covered TransE, DistMult, ComplEx, R-GCN, ConvE, ConvKB, and InteractE to verify the generalization ability of the model on diverse knowledge graph benchmarks.
[0052] Link prediction results Table 2 Link prediction results on FB15k-237 and WN18RR
[0053] To verify the effectiveness of the method of the present invention, the knowledge graph completion ability of the TAHC model was evaluated based on the link prediction task, and systematic experimental evaluations were carried out on four representative benchmark datasets - FB15k-237, WN18RR, UMLS, and Kinship - and the experimental results are shown in Table 2 and Table 3.
[0054] Table 3 Link prediction results on UMLS and Kinship
[0055] On the FB15k-237 dataset, the framework of the present invention performs stably in the overall prediction task, especially having better performance in high-order ranking prediction compared with existing methods, indicating that it has stronger ability to capture fine-grained semantic differences in high-order entity ranking. On the WN18RR dataset, TAHC shows more significant performance improvement, which benefits from its enhanced ability in modeling hierarchies and symmetric relationships, enabling it to more effectively capture potential semantic associations in multi-hop paths, thereby improving its performance in complex reasoning tasks.
[0056] The introduction of two small-scale domain datasets, UMLS and Kinship, further verified the general promotion ability and adaptability of the framework of the present invention. In the UMLS dataset involving complex medical relationships, TAHC demonstrated strong modeling ability for delicate semantic interactions in high-order prediction tasks; in the Kinship dataset mainly featuring family relationship hierarchies, TAHC achieved a competitive performance in handling symmetry and relationship dependence, demonstrating the effectiveness of its hierarchical structure modeling.
[0057] Compared with models that only rely on graph attention mechanisms or convolutional decoding structures, the framework of the present invention realizes the multi-granularity unification of the knowledge representation and reasoning processes through co-design. On the basis of effectively integrating local semantic interactions and global reasoning logic, this method further enhances the overall reasoning ability and improves the modeling effect in complex knowledge graph scenarios.
[0058] Ablation experiment
[0059] Based on the FB15k-237 and WN18RR datasets, the present invention conducted a systematic ablation experiment on the core module of TAHC. The relevant results are shown in Figure 2 . In the experiment, Full represents the complete model, w / o TFP represents removing the translational feature path, w / o SIP represents removing the semantic interaction path, and w / o GNN represents removing the graph neural network encoder. The experiment shows that removing the graph neural network encoder (w / o GNN) will lead to a significant decline in various indicators, fully verifying the fundamental role of topological structure information in the knowledge graph completion task.
[0060] An in-depth analysis of the dual-path design of the hybrid convolutional decoder shows that the semantic interaction path dominates the overall performance of the model, while the translational feature path plays a key role in high-order ranking indicators (such as Hits@3 and Hits@10). This ability is particularly prominent in hierarchical datasets (such as WN18RR), where sequential convolution effectively captures the chain reasoning pattern. It is worth noting that removing the translational feature path (w / o TFP) will seriously weaken the fine-grained semantic ranking ability; while relying only on the semantic interaction path (w / o SIP) has the risk of losing translational invariance, although its overall performance is relatively stable.
[0061] The complete model makes full use of the topological structure information (such as entity neighbor associations and relationship propagation paths) extracted by the graph neural encoder to guide the collaborative interaction of the dual-path hybrid decoder. The translational feature path constructs an explicit reasoning chain through sequential convolution based on rigid logical priors such as the relative positions of entities in the topological embedding obtained by the encoder; the semantic interaction path captures implicit high-order semantic correlations through non-linear transformation, combined with the global topological context provided by the encoder.
[0062] The dynamic fusion mechanism achieves a balance between deterministic reasoning and probabilistic correlation, integrating local neighborhood patterns and the global semantic dependencies inherent in the topological structure. The deep cooperation between the encoder and the decoder is particularly reflected in complex prediction tasks that need to consider both explicit relation localization (such as N-1 relations) and implicit high-order interactions (such as N-N relations). For example, in the hierarchical relation prediction of WN18RR, the tree-like propagation path of the encoder provides structural constraints for the translational feature path of the decoder, and the semantic interaction path decodes multi-hop semantic associations through topological context. This cooperation mechanism ultimately realizes the joint modeling of heterogeneous knowledge patterns.
[0063] Evaluation on different relation types Table 4 Link prediction results divided by relation categories in the FB15k-237 dataset
[0064] Based on the TransH method, the present invention classifies relations into four categories according to the average number of tail entities corresponding to the head entity (head-tail average count) and the average number of head entities corresponding to the tail entity (tail-head average count): one-to-one (1-1), one-to-many (1-N), many-to-one (N-1), and many-to-many (N-N). The specific classification results are shown in Table 4. Generally speaking, the TAHC model shows significant advantages in modeling complex relation patterns, especially achieving excellent results in the most challenging link prediction tasks - specifically, the head entity prediction of 1-N and N-N relations, and the tail entity prediction of N-1 and N-N relations.
[0065] The specific embodiments of the present invention disclosed above are only for illustration, but the present invention is not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A knowledge graph completion method based on a topology-aware hybrid convolutional network, characterized in that Including the following steps: S1: Definition and description of the knowledge graph; S2: Design of the message function in the graph neural network; S3: Attention aggregation mechanism in the graph neural network; S4: Topology-aware hybrid convolutional decoder; S5: Training strategy; The model is trained end-to-end using a cross-entropy loss function with label smoothing to alleviate the overfitting problem and improve the generalization ability of the model.
2. The knowledge graph completion method based on a topology-aware hybrid convolutional network according to claim 1, wherein: The specific steps of S1 are as follows: A knowledge graph is formally represented as a directed graph structure , where represents a set of entities, represents a set of relationships, represents a set of triples; Each triple represents the head entity and the tail entity are related , and the goal of the link prediction task is to infer the missing relationships between entities based on known triples, that is, given or , predict the missing entity; To enhance the structural expression ability of the knowledge graph, self-loop relationships and inverse relationships are introduced to expand the original graph structure. Specifically, the expanded relationship set is defined as follows: (1); Wherein: represents the set of self-loop relationships, represents a self-loop relationship; Represents a set of reverse relationships, Represents a reverse relationship; Correspondingly, the expanded triple set is defined as follows: (2); Wherein: represents all forms of triples, is an element in the entity set ; For each original triple add its inverse triple .
3. The knowledge graph completion method based on a topology-aware hybrid convolutional network according to claim 2, characterized in that: The specific steps of S2 are as follows: Entity Through a relationship Connected to the entity Then the entity embedding And the relationship embedding Will be decomposed into real and imaginary parts: (3); where: superscript and represent the real and imaginary parts respectively after the embedded decomposition; represents the real number field on dimensional vector space; is the initial embedding dimension; Subsequently, a relationship-driven rotation operation is performed in the complex space to generate rotation features: (4); Wherein: represents element-by-element multiplication; Subsequently, a relation-specific scaling is applied to the rotation result to enhance semantic discrimination. After concatenating the real part and the imaginary part, a relation-specific diagonal matrix is used to perform dimensional modulation to generate an intermediate representation: (5); Wherein: is a diagonal matrix, and its non-zero elements serve as scaling factors for different dimensions to amplify or suppress specific semantic features; Finally, according to the propagation direction of the relationship, a direction-sensitive projection matrix is selected , and the intermediate representation is mapped to the target space to generate the final message: (6); The direction-sensitive parameter is defined as follows: (7) Wherein: is the hidden embedding dimension.
4. The method for knowledge graph completion based on a topology-aware hybrid convolutional network according to claim 3, characterized in that: The specific steps of S3 are as follows: For a central entity , its neighborhood set is defined as the set of all pairs that exist in the knowledge graph . Each neighbor pair generates a message ; This message first undergoes a linear transformation through a learnable attention parameter matrix and then calculates the original attention scores through the leaky rectified linear unit activation function: (8); This score reflects the potential influence strength of neighborhood nodes on the central entity. To convert these scores into a probability distribution, the attention scores of all neighborhood nodes need to be further normalized by the softmax function: (9); Wherein: is a normalized weight indicating the importance of the neighbor; is the original attention score; is a dummy variable used to traverse the neighbor set ; Finally, all messages are aggregated through weighted summation, and a hyperbolic tangent function is applied to generate the updated entity embedding representation: (10); To enhance the model's ability to capture diverse interaction patterns, a multi-head attention mechanism is adopted, where each attention head independently generates messages and weights: Multi-head message generation: Each head uses an independent direction-sensitive weight matrix for the combined features to perform a projection: (11); Multi-head attention calculation: Each head independently calculates the attention weights and aggregates the messages, and normalizes them into attention weights , and then aggregates the messages: (12); Wherein: is the normalized attention weight of the head; Multi-head fusion: The outputs of all heads are fused through mean pooling to form the final entity representation: (13); Wherein: is the number of attention heads; To ensure the compatibility of relation embeddings and entity embeddings, a linear projection is used to map the relation embeddings to the entity space: (14); Wherein: is a projection matrix.
5. The knowledge graph completion method based on a topology-aware hybrid convolutional network according to claim 4, wherein: The specific steps of S4 are as follows: S41: Translation feature path; The head entity embedding with topological information after encoding by the graph neural network and the relation embedding are concatenated, and then a one-dimensional convolutional filter is applied to perform a convolution operation to generate an intermediate feature map : (15); Wherein: represents a convolution operation; is an activation function; Subsequently, add another one-dimensional convolutional filter to generate a path output : (16); S42: Semantic interaction path; Similar to S41, the head entity embedding with topological information after encoding by the graph neural network and the relation embedding , are used to generate different feature permutations . For each feature permutation , after being transformed into a two-dimensional matrix through the checkerboard recombination operation , a circular convolution kernel is applied to generate a feature map : (17); Wherein: represents a circular convolution operation; The hidden vectors are concatenated and flattened, and then projected to obtain the path output : (18); Wherein: represents a vectorization operation; is the weight matrix of the fully connected layer; S43: Scoring function; The two-path outputs are aggregated by summation, and the final scoring function of the triple is defined as: (19); Wherein: is the Sigmoid function; Denote the tail entity embedding.
6. The knowledge graph completion method based on a topology-aware hybrid convolutional network according to claim 4, wherein: In S5, the model is trained using the cross-entropy loss function (20); Wherein: represents the batch size; is the predicted probability for the th sample; is the true label; The smoothed target label is calculated as follows: (21); Wherein: is the label smoothing coefficient, , which alleviates overfitting by suppressing the overconfidence of the model in extreme label values.
Citation Information
Patent Citations
Three-dimensional matching method for self-reconfiguration butt joint of reconfigurable spherical robot
CN112330750A
Knowledge completion method and system fusing entity neighbors
CN113836319A
Knowledge graph link completion method and system for multiple relationships
CN114064627A
Reverse relation rotation embedding knowledge representation method and system based on convolution quaternion
CN115481256A
Knowledge graph link prediction method based on multi-task learning, computer equipment and storage medium
CN116843026A
Cited By
Attention diffusion knowledge graph reasoning method for smart home
CN120806173A
Smart home-oriented attention diffusion knowledge graph reasoning method
CN120806173B
Data management method based on hybrid architecture
CN121278017A