Knowledge graph complementing method based on deformable convolution feature reordering

By introducing deformable convolutional networks into knowledge graph completion technology, dynamically adjusting feature positions and enhancing feature interaction modeling capabilities, the shortcomings of traditional convolutional operations in feature expression and reasoning capabilities are solved, and the accuracy of link prediction and the ability to adapt to complex scenarios are improved.

CN120124728APending Publication Date: 2025-06-10NORTHEASTERN UNIV CHINA
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510275692.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing knowledge graph completion technology has shortcomings in feature expression and reasoning capabilities, especially when dealing with complex and diverse entities and relationships, the fixed receptive field of traditional convolution operations cannot be dynamically adjusted, resulting in inaccurate feature extraction and affecting the accuracy of the completion model.

Method used

A knowledge graph compensating method based on deformable convolution feature reordering is proposed. By using the embedding vector trained by TransE model, unknown entity embedding is predicted, and feature position is introduced into the deformable convolution network to dynamically adjust the feature position to realize feature reordering, so that the input features explicitly contain the target entity information. Further utilize relational embedding as a convolution kernel to enhance the interactive modeling ability of features.

Benefits of technology

It improves the accuracy and versatility of the model in link prediction tasks, significantly enhances the adaptability of knowledge graph completion technology to complex data scenarios, and provides strong technical support for the application of intelligent search, recommendation systems, question-and-answer systems and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124728A_ABST
    Figure CN120124728A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge graph complementing method based on deformable convolutional feature reordering, and relates to the technical field of knowledge graphs. Unknown entity embedding is predicted by using an embedding vector trained by a TransE model, and feature positions are dynamically adjusted by introducing a deformable convolutional network, so that feature reordering is realized; and enabling the input features to explicitly contain the target entity information. And further utilizing relation embedding as a convolution kernel, enhancing the interactive modeling capability of the features, and finally completing prediction of knowledge graph missing information. According to the method, the accuracy and universality of the model in a link prediction task are improved, the adaptability of a knowledge graph completion technology to a data complex scene is remarkably enhanced, and powerful technical support is provided for application in the fields of intelligent search, recommendation systems, question and answer systems and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of knowledge graphs, and specifically to a knowledge graph completion method based on deformable convolution feature reordering. Background Art

[0002] In recent years, with the rapid development of artificial intelligence technology, knowledge graphs, as a form of expression of structured knowledge, have received extensive attention. By organizing entities, attributes, and relationships into a semantic network, knowledge graphs provide an intuitive structured semantic expression for data. This technology has been widely applied in multiple fields such as search engines, intelligent recommendation, question answering systems, medical diagnosis, and financial analysis. However, a common problem with knowledge graphs is data incompleteness: the entity, relationship, and attribute information in the knowledge graph may all be missing. For example, potential relationships between certain entities may not be recorded, and the knowledge coverage in some fields is insufficient, resulting in the knowledge graph being unable to fully support the reasoning requirements of downstream tasks. This incompleteness not only restricts the scale expansion of the knowledge graph but also reduces its reliability and effectiveness in practical applications.

[0003] To solve this problem, Knowledge Graph Completion (KGC) has become a research hotspot in recent years. Knowledge graph completion aims to fill in the missing entities, relationships, or attributes in the graph through existing knowledge reasoning and prediction, improving the integrity and accuracy of the graph. Its core is to expand the scale of the knowledge graph through algorithmic means, enhance its integrity and practicality, and thus support more complex knowledge reasoning tasks. Knowledge graph completion can be divided into three subtasks: triple classification, relationship prediction, and entity prediction. The main purpose of triple classification is to improve the knowledge base by judging the authenticity of triples. Relationship prediction is to determine whether there is a specific relationship between two entities, thereby enriching the knowledge graph information. Entity prediction, also known as link prediction, is to predict the missing tail entity given a head entity and a relationship. Currently, the mainstream task of knowledge graph completion is mainly link prediction, which is more complex and representative than the other two types of tasks, and is also the problem solved by this technical solution.

[0004] Knowledge graph completion technology can be specifically divided into methods based on 1. rules and logical reasoning, 2. embedding-based representation learning methods, and 3. neural network-based methods. With the rapid development of deep learning and artificial intelligence technologies, neural network-based technologies have shown outstanding performance in prediction accuracy and have gradually become the mainstream direction of knowledge graph completion. The prediction is accurate. The progress of knowledge graph completion technology has significantly improved the ability of intelligent systems to provide knowledge reasoning and decision-making support. In the future, how to design efficient and scalable completion algorithms to adapt to the characteristics of knowledge graphs in different fields remains an important topic for technical research and application implementation.

[0005] In recent years, due to its excellent feature extraction ability, CNN has been widely used in knowledge graph completion tasks. ConvE ("Convolutional 2d knowledge graph embeddings.") is a classic model in knowledge graph completion tasks. It processes the embedding vectors of the head entity and the relation, inputs them into a two-dimensional convolutional layer to extract features, and finally obtains the scores of candidate triples. However, the interaction between ConvE entities and relation features is limited, which may limit the performance of link prediction. To address this issue, many subsequent models have been improved. For example, InteractE ("Improving convolution-based knowledge graph embeddings by increasing feature interactions.") enhances the model's expressive ability through three feature permutation methods, namely Stack, Alternate, and Chequer, and through circular convolution.

[0006] However, the receptive field of traditional convolution operations (such as the standard convolution used in ConvE) is fixed and cannot be dynamically adjusted according to the features of the input data. When dealing with complex and diverse entities and relations, it may lead to inaccurate feature extraction, thus affecting the accuracy of the completion model. Summary of the Invention

[0007] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to propose a knowledge graph completion method based on deformable convolution feature reordering, including:

[0008] Step 1: Obtain a set U of knowledge graph triples, where each triple is represented as {(h, rt, t)}, where h is the head entity, t is the tail entity, and rt represents the relationship between h and t. Random vector embeddings are performed on the head entity, the tail entity, and rt respectively to obtain the random vector e of the head entity h of the tail entity, the random vector e t and the random vector r of rt. In the way of InteractE, the random vector e of the head entityh Process it with the random vector r to obtain the initial reordering matrix [e h :r];

[0009] Use the knowledge graph triple set g as the positive sample set. Among them, a triple is used as a positive sample. Randomly replace the head entity or tail entity of the triple in the positive sample to obtain negative samples, and then obtain the set

[0010] Input the initial reordering matrix [e h :r] into the TransE model to obtain the predicted vector x of the tail entity. Then, based on the predicted vector x of the tail entity, calculate the first loss value, update the parameters of the TransE model according to the first loss value, and update the random vector e h of the head entity, the random vector e t of the tail entity, and the random vector r of rt in the positive sample. At the same time, update the random vectors of the head entity and the tail entity in the negative sample. Repeat the above operations until the first loss value is less than the preset threshold, thereby obtaining the first vector of the head entity, the first vector of the tail entity, and the first vector of rt in the positive sample, as well as the second vector of the head entity and the second vector of the tail entity in the negative sample;

[0011] Step 2: Process the first vector of the head entity and the first vector of rt in the InteractE manner to obtain the first target reordering matrix. Input the first target reordering matrix and the first vector of the tail entity into the first convolutional neural network to obtain the offset Δp n , and according to the offset Δp n , calculate multiple offset positions p of the coordinate p 0 in the first target reordering matrix, where p = p 0 + p n + Δp n , and p n is one of the 8 adjacent coordinates in the nine-square grid centered on p 0 . Then calculate the accurate offset position x(p) corresponding to each offset position;

[0012] Step 3: Deflect the initial reordering matrix through all the accurate offset positions x(p) to obtain the final feature matrix in_1(1, H, W), where H represents the height of the final feature matrix and W represents the width of the final feature matrix;

[0013] Step 4: Calculate the predicted probability of the positive sample based on the second convolutional neural network and the multi-layer perceptron MLP;

[0014] Step 5: Process the second vector of the head entity and the first vector of rt to obtain the second target re-ranking matrix. Input the second target re-ranking matrix and the second vector of the tail entity into the first convolutional neural network to obtain the corresponding offset, and then obtain all the corresponding accurate offset positions x(p). Through all the accurate offset positions x(p), deflect the initial re-ranking matrix to obtain the feature matrix, and then obtain the prediction probability of the negative sample;

[0015] Step 6: Calculate the second loss value. According to the second loss value, update the parameters of the random vector embedding, the first convolutional neural network, the second convolutional neural network, and the MLP in Step 1. Repeat Steps 2 - Step 6 for the positive samples in the positive sample set and the negative samples in the negative sample set until the second loss value is less than the preset threshold.

[0016] Optionally, in Step 1, in the way of InteractE, process the random vector e of the head entity h and the random vector r to obtain the initial re-ranking matrix [e h :r], including:

[0017] Respectively perform drop processing on the random vector e of the head entity h and the random vector r to obtain the regularized representation corresponding to the random vector e h and the regularized representation corresponding to the random vector r. Through the way of interleaved splicing, process the regularized representation corresponding to the random vector e h and the regularized representation corresponding to the random vector r to obtain the initial re-ranking matrix [e h :r].

[0018] Optionally, in Step 1, calculate the first loss value based on the predicted vector x of the tail entity through the following formula:

[0019]

[0020] where, is the first loss value, h′ is the head entity in the negative sample, e h′ is the second vector of the head entity in the negative sample, t′ is the tail entity in the negative sample, e t′ is the second vector of the tail entity in the negative sample, γ is the parameter of the TransE model, and γ represents the margin parameter, and U is the set of knowledge graph triples, that is, the positive sample set.

[0021] Optionally, in Step 2, input the first target re-ranking matrix and the first vector of the tail entity into the first convolutional neural network to obtain the offset Δp n , specifically through the following formula:

[0022]

[0023] Among them, D is the set of all coordinates in the first target reordering matrix, p 0 is a coordinate in D, and R contains 8 adjacent coordinates in the nine-square grid centered on p 0 , p n is a coordinate in R, x(p 0 +p n ) is the value of the corresponding coordinate in the first vector of the tail entity at coordinate p 0 +p n , and w(p n ) is the value of the convolution kernel at p n .

[0024] Optionally, in step 2, the accurate offset position x(p) corresponding to each offset position is calculated specifically through the following formula:

[0025] x(p) = ∑ q∈Q G(q, p) * x(q);

[0026] Among them, Q contains the four integer coordinates in the first target reordering matrix that are closest to p, x(q) is the value at the coordinate of point q in the first target reordering matrix, G is a bilinear interpolation function, and G(q, p) is specifically calculated through the following formula:

[0027] G(q, p) = g(q x , p x ) * g(q y , p y );

[0028] g(q x , p x ) = max(0, 1 - |q x - p x |);

[0029] g(q y , p y ) = max(0, 1 - |q y - p y |;

[0030] Among them, q x is the abscissa of point q, p x is the abscissa of point p, q y is the ordinate of point q, p y is the ordinate of point p, and g(q x , p x ) represents the interpolation weight between q x and p x , and g(q y , py ) represents q y and p y The interpolation weight between them.

[0031] Optionally, step 4 specifically includes:

[0032] Step 4.1: Input the final feature matrix in_1(1, H, W) into the second convolutional neural network to obtain the output matrix out_1(N, H, W), where N represents the number of channels;

[0033] Step 4.2: Through the flattening operation, process the final feature matrix in_1(1, H, W) and the output matrix out_1(N, H, W) respectively to obtain in_2(1, H*W) and out_2(N, H*W);

[0034] Step 4.3: Expand the number of channels of in_2(1, H*W) to obtain in_3(N, H*W), and perform residual connection on in_3(N, H*W) and out_2(N, H*W) in the dimension of H*W to obtain the output vector out_3(N, 2*H*W);

[0035] Step 4.4: Extract features from the output vector out_3(N, 2*H*W) through a multi-layer perceptron MLP to obtain channel dimension features;

[0036] Step 4.5: Reduce the dimension of the channel dimension features to obtain the dimension-reduced features, input the dimension-reduced features into the MLP to obtain the final features, and take the inner product of the final features and the first vectors of all tail entities in the positive samples to obtain multiple first prediction probabilities, where the first prediction probabilities represent the predicted values of the probabilities that the triple of the positive sample is a correct triple;

[0037] Step 4.6: Sort the multiple first prediction probabilities, and take the first prediction probability with the highest value as the prediction probability of the positive sample.

[0038] Optionally, steps 4.1 - 4.5 are specifically implemented through the following formula:

[0039] p(in_1, out_1, t) = MLP(MLP(Residual(Flatten(in_1), Flatten(out_1)))) T e T )

[0040] where p(in_1, out_1, t) is the prediction probability of the triple, Residual is the residual connection, e Tis the first vector of the tail entity in the positive sample, Flatten is the flattening operation, in_1 is the final feature matrix in_1(1, H, W), and out_1 is the output matrix out_1(N, H, W).

[0041] Optionally, the second loss value is calculated in step 6, which is specifically implemented by the following formula:

[0042]

[0043] where Loss is the second loss value, ε is the training set, the training set includes a positive sample set and a negative sample set, |ε| is the number of samples in the training set, c is the sample in the training set, and y c represents the probability that sample c is a correct triple, and p c is the predicted probability of sample c.

[0044] The beneficial effects of adopting the above technical solution are as follows:

[0045] By using the embedding vectors trained by the TransE model, the present invention predicts the embedding of unknown entities, introduces a deformable convolutional network to dynamically adjust the feature positions, realizes feature reordering, and makes the input features explicitly contain the target entity information. Further, the relationship embedding is used as the convolutional kernel to enhance the interactive modeling ability of the features, and finally, the prediction of the missing information in the knowledge graph is completed. The present invention not only improves the accuracy and generality of the model in the link prediction task, but also significantly enhances the adaptability of the knowledge graph completion technology to complex data scenarios, providing strong technical support for the applications in the fields of intelligent search, recommendation systems, question answering systems, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a schematic flowchart of a method for completing a knowledge graph based on deformable convolutional feature reordering in an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of feature reconstruction and sorting in an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0048] The following combines the drawings and embodiments to further describe in detail the specific implementation manners of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0049] Deformable convolution dynamically generates offset values to adjust the embeddings of entities and relationships. This dynamic adjustment mechanism can enhance the model's perception ability of local features, enabling the model to more accurately capture the semantic associations between entities and relationships, thereby improving the accuracy of the knowledge graph completion task. Therefore, the present invention provides a knowledge graph completion method based on deformable convolution feature reordering to address the deficiencies of existing knowledge graph completion technologies in terms of feature expression and reasoning ability. In the prior art, although traditional convolution models can effectively model the features of entities and relationships in a knowledge graph, they have certain limitations in dealing with complex semantic interactions.

[0050] To address the problems existing in the prior art, the present invention uses the embedding vectors trained by the TransE ("Translating embeddings for modeling multi-relational data.") model to predict the embeddings of unknown entities, and introduces a deformable convolution network to dynamically adjust the feature positions to achieve feature reordering, so that the input features explicitly contain the information of the target entity. Further, the relationship embeddings are used as convolution kernels to enhance the ability of interactive modeling of features. Finally, the prediction of the missing information in the knowledge graph is completed through convolution and fully connected networks. The present invention not only improves the accuracy and generality of the model in the link prediction task, but also significantly enhances the adaptability of the knowledge graph completion technology to data sparse scenarios, providing strong technical support for applications in fields such as intelligent search, recommendation systems, and question answering systems. Specifically, in combination with Figure 1 , the following steps may be included:

[0051] Step 1: Obtain the set U of knowledge graph triples, where each triple is represented as {(h, rt, t)}, where h is the head entity, t is the tail entity, and rt represents the relationship between h and t. Random vector embeddings are respectively performed on the head entity, the tail entity, and rt to obtain the random vector eh h of the head entity, the random vector et t of the tail entity, and the random vector r of rt;

[0052] Through the InteractE method, the random vector eh h of the head entity and the random vector r are processed to obtain the initial reordering matrix [eh h : r], which specifically includes:

[0053] In combination with Figure 2 , drop processing is respectively performed on the random vector eh h of the head entity and the random vector r to obtain the regularization representation corresponding to the random vector eh h and the regularization representation corresponding to the random vector r. Through the interleaved splicing method, the random vector eh hProcess the corresponding regularization representation and the regularization representation corresponding to the random vector r to obtain the initial reordering matrix [e h :r].

[0054] Use the knowledge graph triple set g as the positive sample set. Among them, a triple is used as a positive sample. Randomly replace the head entity or tail entity of the triple in the positive sample to obtain negative samples, and then obtain the set

[0055] Input the initial reordering matrix [e h :r] into the TransE model to obtain the predicted vector x of the tail entity. Then, based on the predicted vector x of the tail entity, calculate the first loss value, update the parameters of the TransE model according to the first loss value, and update the random vector e h of the head entity, the random vector e t of the tail entity, and the random vector r of rt in the positive sample. At the same time, update the random vectors of the head entity and the tail entity in the negative sample. Repeat the above operations until the first loss value is less than the preset threshold, thereby obtaining the first vector of the head entity, the first vector of the tail entity, and the first vector of rt in the positive sample, as well as the second vector of the head entity and the second vector of the tail entity in the negative sample;

[0056] Among them, calculating the first loss value based on the predicted vector x of the tail entity is achieved through the following formula:

[0057]

[0058] Among them, is the first loss value, h′ is the head entity in the negative sample, e h′ is the second vector of the head entity in the negative sample, t′ is the tail entity in the negative sample, e t′ is the second vector of the tail entity in the negative sample, γ is the parameter of the TransE model, and γ represents the margin parameter. U is the knowledge graph triple set, that is, the positive sample set.

[0059] Step 2: Process the first vector of the head entity and the first vector of rt in the InteractE manner to obtain the first target reordering matrix;

[0060] Input the first target reordering matrix and the first vector of the tail entity into the first convolutional neural network to obtain the offset Δp n , and according to the offset Δp n , which is specifically achieved through the following formula:

[0061]

[0062] Among them, D is the set of all coordinates in the first target reordering matrix, and p 0 is a coordinate in D. R contains 8 adjacent coordinates in the nine - grid centered on p 0 . p n is a coordinate in R. x(p 0 +p n ) is the value of the corresponding coordinate in the first vector of the tail entity for the coordinate p 0 +p n . w(p n ) is the value of the convolutional kernel at p n .

[0063] Among them, the first convolutional neural network is an existing CNN network.

[0064] The number of channels of the deformable convolution is 2 times the square of the kernel_size because the offset is performed on both the x and y axes. In the present invention, a 3*3 convolution is used for processing (the stride and padding are taken as 1). Then, the number of input channels is 3, and the number of output channels is 18. Reshaping it into 3*3*2 gives the offset of the matrix elements during convolution.

[0065] Since the calculated offset Δp n contains decimals and cannot be accurately mapped to the corresponding matrix elements, the model uses bilinear interpolation to obtain the accurate offset position x(p). Specifically, multiple offset positions p of the coordinate p 0 in the first target reordering matrix are calculated, where p = p 0 +p n +Δp n , and p n is one of the 8 adjacent coordinates in the nine - grid centered on p 0 ;

[0066] Furthermore, the accurate offset position x(p) corresponding to each offset position is calculated, which is specifically implemented through the following formula:

[0067] x(p)=∑ q∈Q G(q,p)*x(q);

[0068] Among them, Q contains the four integer coordinates in the first target reordering matrix that are closest to p. x(q) is the value at the coordinate of point q in the first target reordering matrix, and G is the bilinear interpolation function. G(q,p) is specifically calculated through the following formula:

[0069] G(q,p)=g(q x ,p x )*g(q y ,p y );

[0070] g(q x , p x ) = max(0, 1 - |q x - p x |);

[0071] g(q y , p y ) = max(0, 1 - |q y - p y |);

[0072] Among them, q x is the abscissa of point q, q x is the abscissa of point p, q y is the ordinate of point q, p y is the ordinate of point p, g(q x , p x ) represents the interpolation weight between q x and p x , g(q y , p y ) represents the interpolation weight between q y and p y .

[0073] Step 3: Combine Figure 2 , and deflect the initial reordering matrix through all accurate offset positions x(p) to obtain the final feature matrix in_1(1, H, W), where H represents the height of the final feature matrix and W represents the width of the final feature matrix;

[0074] Step 4: Based on the second convolutional neural network and the multi-layer perceptron MLP, calculate the final feature matrix to obtain the prediction probability of the positive sample;

[0075] Among them, the second convolutional neural network is an existing CNN network, and the structures of the first convolutional network and the second convolutional network are the same, but the parameters are different.

[0076] Step 4.1: Input the final feature matrix in_1(1, H, W) into the second convolutional neural network to obtain the output matrix out_1(N, H, W), where N represents the number of channels;

[0077] Step 4.2: Through the flattening operation, process the final feature matrix in_1(1, H, W) and the output matrix out_1(N, H, W) respectively to obtain in_2(1, H * W) and out_2(N, H * W);

[0078] Step 4.3: Expand the number of channels of in_2(1, H*W) to obtain in_3(N, H*W), and perform a residual connection on in_3(N, H*W) and out_2(N, H*W) in the dimension of H*W to obtain the output vector out_3(N, 2*H*W);

[0079] Step 4.4: Extract features from the output vector out_3(N, 2*H*W) through a multi-layer perceptron MLP to obtain channel dimension features;

[0080] Step 4.5: Reduce the dimension of the channel dimension features to obtain the dimension-reduced features, input the dimension-reduced features into the MLP to obtain the final features, and take the inner product of the final features and the first vectors of all tail entities in the positive samples to obtain multiple first prediction probabilities, where the first prediction probabilities represent the predicted values of the probabilities that the triple in the positive sample is a correct triple;

[0081] Step 4.6: Sort the multiple first prediction probabilities, and take the first prediction probability with the highest value as the prediction probability of the positive sample.

[0082] Among them, steps 4.1 - 4.5 are specifically implemented through the following formula:

[0083] p(in_1, out_1, t) = MLP(MLP(Residual(Flatten(in_1), Flatten(out_1)))) T e T );

[0084] Among them, p(in_1, out_1, t) is the prediction probability of the triple, Residual is the residual connection, e T is the first vector of the tail entity in the positive sample, Flatten is the flattening operation, in_1 is the final feature matrix in_1(1, H, W), and out_1 is the output matrix out_1(N, H, W).

[0085] Step 5: Process the second vector of the head entity and the first vector of rt to obtain the second target re-ranking matrix, input the second target re-ranking matrix and the second vector of the tail entity into the first convolutional neural network to obtain its corresponding offset, and then obtain all accurate offset positions x(p). Through all accurate offset positions x(p), deflect the initial re-ranking matrix to obtain a feature matrix, and then obtain the prediction probability of the negative sample;

[0086] Step 6: Calculate the second loss value, and specifically implement it through the following formula:

[0087]

[0088] where Loss is the second loss value, ε is the training set, the training set includes a positive sample set and a negative sample set, |ε| is the number of samples in the training set, c is a sample in the training set, and y c represents the probability that the sample c is a correct triple, and p c is the predicted probability of the sample c.

[0089] Update the parameters of the random vector embedding, the first convolutional neural network, the second convolutional neural network, and the MLP in step 1. For the positive samples in the positive sample set and the negative samples in the negative sample set, repeat steps 2 - 6 until the second loss value is less than a preset threshold.

[0090] A knowledge graph completion method based on deformable convolution feature re - ranking given by the present invention further solves the deficiency of entity - relationship feature interaction modeling in existing models, thereby improving the accuracy of the link prediction task. Existing methods such as ConvE, InteractE, etc. optimize the interaction modeling between entities and relationships through different convolution strategies, but the way of extracting features relying on fixed relationship embeddings has limitations and cannot fully utilize the information of target entities. To address this problem, the present invention uses a dynamically adjusted relational convolution kernel to convolve the re - ranked features, extracts richer interaction features, and generates the final prediction result. Experimental results show that this method is significantly better than traditional models on public datasets, especially in complex semantic relationship scenarios, demonstrating stronger reasoning ability. The present invention provides a more efficient solution for knowledge graph completion, further promoting the development of knowledge reasoning and intelligent applications.

[0091] Two widely used datasets, FB15k - 237 and WN18RR, are used in the present invention. Among them, FB15k - 237 is a subset of FB15k created by Toutanova and Chen et al. to address the test leakage problem caused by the existence of approximately the same relationships or inverse relationships in FB15k. In this context, FB15k - 237 is established as a more challenging dataset. First, select the facts involving the top 401 largest relationships from FB15k and remove all equivalent or inverse relationships. Then, ensure that any entity connected in the training set is not directly linked in the validation set and the test set to filter out all trivial triples. WN18RR is a subset of WN18, and WN18 is a subset of WordNet. Since many text triples are obtained by reversing the triples in the training set. Therefore, the WN18RR dataset is created by removing the inverse relationships of WN18 to ensure that the evaluation dataset does not have test leakage caused by inverse relationships. Among them, the data summary of the datasets FB15k - 237 and WN18RR in the present invention is shown in Table 1.

[0092] Table 1 Dataset

[0093]

[0094] Compared with the existing methods, the knowledge graph completion method based on deformable convolution feature reordering proposed by the present invention significantly enhances the interaction modeling ability between entity and relationship features, and effectively solves the problem of insufficient feature interaction in the existing models. The present invention uses the predicted target entity embedding and random relation convolution kernels to adjust the feature arrangement through dynamic position offset, so that the input data can more comprehensively reflect the feature information of the target entity, thereby improving the accuracy and robustness of link prediction. The experimental results show that the present invention performs better than the existing models on the public dataset, and the experimental results are shown in Table 2.

[0095] Table 2 Experimental Results

[0096]

[0097] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) disclosed in the embodiments of the present disclosure that have similar functions.

Claims

1. A knowledge graph completion method based on deformable convolutional feature reordering, characterized in that: include: Step 1: Get the knowledge graph triple set U, where each triple is represented as {(h, rt, t)}, where h is the head entity, t is the tail entity, and rt represents the relationship between h and t. Perform random vector embedding on the head entity, tail entity, and rt respectively to obtain the random vector e of the head entity. h , random vector e of the tail entity t and rt's random vector r, through InteractE, the random vector e of the head entity h and random vector r to obtain the initial reordering matrix [e h :r]; The knowledge graph triple set g is used as the positive sample set, where a triple is used as a positive sample, and the head entity or tail entity of the triple in the positive sample is randomly replaced to obtain a negative sample, and then the set is obtained. The initial reordered matrix [e h :r] Input the TransE model to obtain the prediction vector x of the tail entity, and then calculate the first loss value based on the prediction vector x of the tail entity, update the parameters of the TransE model according to the first loss value, and update the random vector e of the head entity in the positive sample h , random vector e of the tail entity t and rt are updated, and the random vector r of the head entity and the random vector of the tail entity in the negative sample are updated at the same time, and the above operation is repeated until the first loss value is less than the preset threshold, thereby obtaining the first vector of the head entity, the first vector of the tail entity and the first vector of rt in the positive sample, and the second vector of the head entity and the second vector of the tail entity in the negative sample; Step 2: Through InteractE, the first vector of the head entity and the first vector of rt are processed to obtain the first target reordering matrix, and the first target reordering matrix and the first vector of the tail entity are input into the first convolutional neural network to obtain the offset Δp n , according to the offset Δp n , calculate and obtain multiple offset positions p of the coordinate p0 in the first target reordering matrix, where p = p0 + p n +Δp n , p n is one of the eight adjacent coordinates in the nine-square grid centered on p0, and then the exact offset position x(p) corresponding to each offset position is calculated; Step 3: Deflect the initial reordering matrix through all accurate offset positions x(p) to obtain the final feature matrix in_1(1,H,W), where H represents the height of the final feature matrix and W represents the width of the final feature matrix; Step 4: Based on the second convolutional neural network and the multi-layer perceptron MLP, the final feature matrix is ​​calculated to obtain the predicted probability of the positive sample; Step 5: Process the second vector of the head entity and the first vector of rt to obtain the second target reordering matrix, input the second target reordering matrix and the second vector of the tail entity into the first convolutional neural network to obtain their corresponding offsets, and then obtain all their corresponding accurate offset positions x(p), deflect the initial reordering matrix through all accurate offset positions x(p), obtain the feature matrix, and then obtain the predicted probability of the negative sample; Step 6: Calculate the second loss value. According to the second loss value, update the parameters of the random vector embedding in step 1, the parameters of the first convolutional neural network, the parameters of the second convolutional neural network, and the parameters of the MLP. Repeat steps 2 to 6 for the positive samples in the positive sample set and the negative samples in the negative sample set until the second loss value is less than the preset threshold.

2. The method for completing a knowledge graph based on deformable convolutional feature reordering according to claim 1, characterized in that: In step 1, the random vector e of the head entity is transformed into h and random vector r to obtain the initial reordering matrix [e h :r], including: The random vector e of the head entity h Drop the random vector r to get the random vector e h The corresponding regularized representation and the regularized representation of the random vector r are interlaced and spliced ​​to form the random vector e h The corresponding regularized representation and the regularized representation of the random vector r are processed to obtain the initial reordering matrix [e h :r].

3. The knowledge graph completion method based on deformable convolutional feature reordering according to claim 1, characterized in that: In step 1, based on the prediction vector x of the tail entity, the first loss value is calculated by the following formula: in, is the first loss value, h' is the head entity in the negative sample, e h′ is the second vector of the head entity in the negative sample, t′ is the tail entity in the negative sample, e t′ is the second vector of the tail entity in the negative sample, γ is the parameter of the TransE model, and γ represents the margin parameter, and U is the set of knowledge graph triples, that is, the set of positive samples.

4. The knowledge graph completion method based on deformable convolutional feature reordering according to claim 1, characterized in that: In step 2, the first target reordering matrix and the first vector of the tail entity are input into the first convolutional neural network to obtain the offset Δp n , which is specifically achieved through the following formula: Where D is the set of all coordinates in the first target reordering matrix, p0 is the coordinate in D, R contains the 8 adjacent coordinates in the nine-square grid centered on p0, and p n is a coordinate in R, x(p0+p n ) is the coordinate p0+p n The value of the corresponding coordinate in the first vector of the tail entity, w(p n ) is the convolution kernel at p n The numerical value at .

5. The knowledge graph completion method based on deformable convolutional feature reordering according to claim 1, characterized in that: In step 2, the exact offset position x(p) corresponding to each offset position is calculated, which is specifically achieved by the following formula: x(p)=∑ q∈Q G(q,p)*x(q); Wherein, Q contains the four integer coordinates closest to p in the first target reordering matrix, x(q) is the value at the coordinate of point q in the first target reordering matrix, G is the bilinear interpolation function, and G(q,p) is specifically calculated by the following formula: G(q,p)=g(q x ,p x )*g(q y ,p y ); g(q x ,p x )=max(0,1-|q x -p x |); g(q y ,p y )=max(0,1-|q y -p y |); Among them, q x is the horizontal coordinate of point q, p x is the horizontal coordinate of point p, q y is the ordinate of point q, p y is the ordinate of point p, g(q x ,p x ) indicates q x and p x The interpolation weight between y ,p y ) indicates q y and p y The interpolation weights between .

6. The knowledge graph completion method based on deformable convolutional feature reordering according to claim 1, characterized in that: Step 4 specifically includes: Step 4.1: Input the final feature matrix in_1(1,H,W) into the second convolutional neural network to obtain the output matrix out_1(N,H,W), where N represents the number of channels; Step 4.2: Through the flattening operation, the final feature matrix in_1(1,H,W) and the output matrix out_1(N,H,W) are processed respectively to obtain in_2(1,H*W) and out_2(N,H*W); Step 4.3: Expand the number of channels of in_2(1,H*W) to obtain in_3(N,H*W), perform residual connection on in_3(N,H*W) and out_2(N,H*W) in the dimension of H*W to obtain the output vector out_3(N,2*H*W); Step 4.4: Use the multi-layer perceptron MLP to extract features from the output vector out_3(N,2*H*W) to obtain channel dimension features; Step 4.5: Reduce the dimension of the channel dimension feature to obtain the reduced dimension feature, input the reduced dimension feature into the MLP to obtain the final feature, perform inner product between the final feature and the first vector of all tail entities in the positive sample, and obtain multiple first prediction probabilities, wherein the first prediction probability represents the predicted value of the probability that the triple of the positive sample is the correct triple; Step 4.6: Sort the multiple first prediction probabilities and take the first prediction probability with the highest value as the prediction probability of the positive sample.

7. The knowledge graph completion method based on deformable convolutional feature reordering according to claim 6, characterized in that: Steps 4.1-4.5 are specifically implemented by the following formula: p(in_1,out_1,t)=MLP(MLP(Residual(Flatten(in_1),Flatten(out_1))) T e T ); Among them, p(in_1,out_1,t) is the predicted probability of the triple, Residual is the residual connection, e T is the first vector of the tail entity in the positive sample, Flatten is the flattening operation, in_1 is the final feature matrix in_1(1,H,W), and out_1 is the output matrix out_1(N,H,W).

8. The knowledge graph completion method based on deformable convolutional feature reordering according to claim 1, characterized in that: In step 6, the second loss value is calculated, which is specifically implemented by the following formula: Where Loss is the second loss value, ε is the training set, which includes a positive sample set and a negative sample set, |ε| is the number of samples in the training set, c is the sample in the training set, and y c represents the probability that sample c is the correct triplet, p c is the predicted probability of sample c.

Citation Information

Cited By

  • Automatic production line optimization method and system based on artificial intelligence

    CN121745414A

  • Artificial intelligence-based automated production line optimization method and system

    CN121745414B