Data immunization method and device oriented to knowledge graph entity embedding hierarchical relationship
By constructing a poisoning tree and a hierarchical attack strategy, the data poisoning attack on the knowledge graph embedding model solves the problem of reduced embedding accuracy in the existing technology, improves the model's robustness and hierarchical relationship analysis capabilities, and achieves An effective defense against attackers.
Patent Information
- Application Number
- CN202410799267.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-01
AI Technical Summary
Existing technology is difficult to effectively defend against data poisoning attacks by knowledge graph embedding models, resulting in a decrease in embedding accuracy, and lacks attack and defense methods for hierarchical relationships.
By constructing a poisoning tree, the hierarchical information of the target model is obtained, the target entity is selected, the poisoned data is constructed according to the hierarchical attack strategy, added to the data set, the model is updated to identify the attacker's attack characteristics, and defensive measures are taken.
It improves the robustness and data screening efficiency of the knowledge graph model, enhances the ability to analyze hierarchical relationships, and can effectively destroy the attacker's embedding results and interfere with knowledge graph applications.
Smart Images

Figure CN118734307A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of network security, and specifically relates to a data immunization method and device for embedding hierarchical relationships of knowledge graph entities. Background Art
[0002] Knowledge graph (KG) is a structured graphical representation used to describe entities, relationships and facts in the real world. It plays a vital role in various fields such as artificial intelligence, natural language processing and data mining. Knowledge graphs are usually composed of nodes, edges and triples, where nodes represent things, edges represent the relationship between things, and triples such as (head entity, relationship, tail entity) represent facts describing the relationship between head and tail entities. Knowledge graph is an important field of computer science research. Knowledge graph embedding is an important branch of knowledge graph. Its purpose is to convert structured data such as knowledge graph into high-dimensional vectors while retaining the semantics and topological structure of the knowledge graph itself, so as to facilitate the knowledge graph to better serve downstream tasks. With the widespread application of knowledge graphs in industrial tasks such as semantic search, recommendation systems, and dialogue systems, knowledge graph embedding tasks have attracted the attention of researchers, and data poisoning for knowledge graph embedding tasks has also attracted widespread attention from researchers. For attackers, data poisoning of knowledge graph embedding models can reduce the accuracy of knowledge graph embedding to a certain extent, thereby destroying the enemy's knowledge graph; for users, studying data poisoning attacks on knowledge graph embedding is conducive to studying the deep principles of knowledge graph embedding and further improving the accuracy and robustness of embedding.
[0003] At present, there are many methods for data poisoning attacks on knowledge graph embedding, such as attacks based on triple gradients and attacks based on knowledge graph relationship patterns. Hierarchical relationships have been proven to be a widely existing semantic relationship in knowledge data. In recent years, knowledge graph embedding models that can express hierarchical semantics have emerged, such as the HAKE model.
[0004] In Inference Attack, the attacker first selects the target triple as the attack object, which is also the basis for generating poisoned triples. Inference Attack provides three attack strategies. Attack based on synonymy, attack based on antonymy, and attack based on synthetic semantics. For example, in a synonym-based attack, the triple (A, friend, B) is used as the target triple. To attack the A entity, a fictitious triple (C, friend, B) is added (the poisoned triple). This results in a decrease in the probability that the head entity (?) is A when making link predictions (?, friend, B). For example, in an antonym-based attack, the triple (C, including, D) is used as the target triple. To attack the C entity, a fictitious triple (D, including, C) is added, and the confidence of the triple (C, including, D) decreases. For example, in synthetic semantic attacks, (E,'s teacher is, F), then we can consider adding (E,'s son is, G), (G,'s son is, F) so that the confidence of (E,'s teacher is, F) decreases. The above is an explanation for understanding. In actual operation, Inference Attack proposes three calculation methods to determine the poisoned triples, namely, calculating the soft truth score (a measure of the standard of the triple satisfying the reasoning mode, the degree to which a logical expression is true. In synonyms and antonyms, the entity with the lowest soft truth score is selected to form the poisoned triple. In combined attacks, the K-means algorithm is used to cluster all possible intermediate entities to determine the entity with the lowest ground truth score in each category, and the entity with the lowest score is selected from the K categories with the lowest score to form the poisoned triple), link prediction ranking (selecting entities whose link prediction task ranking is one place lower than the correct result to form a decoy triple. The model is likely to have learned a low score with high confidence) and cosine distance (simulating semantic similarity, selecting the entity that is most dissimilar to the link prediction result, that is, the entity with the largest cosine distance, and using it to form the poisoned triple). After constructing the poisoned data, adding the data to the training set will reduce the embedding accuracy of the target triples of the updated model. Summary of the invention
[0005] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a data immunization method and device for knowledge graph entity embedding hierarchical relationships. By utilizing the knowledge graph to construct poisoned data for data poisoning attacks, attacks and attack ideas targeting hierarchical relationships are proposed for the first time. On the one hand, it can be used to capture the attacker's weaknesses and defeat the attacker. On the other hand, it can destroy the embedding results of the target model based on the attacker's attack characteristics, thereby achieving the purpose of interfering with the application effect of knowledge graph embedding.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a data immunization method for embedding hierarchical relationships of knowledge graph entities, comprising the following steps:
[0008] Obtaining hierarchical information of a target model, where the target model includes multiple target entities;
[0009] Using the hierarchical information, the first-layer nodes are used as the root nodes of the poisoning tree, and the adjacent nodes are used as other layers of the poisoning tree to construct multiple poisoning trees and obtain a forest;
[0010] Select target entity. The attacker selects one or more target entities as attack targets as needed;
[0011] According to the location of the target entity in the forest, the attacker constructs poisoned data according to the hierarchical attack strategy and the attacker’s intention;
[0012] Add poisoned data to the dataset, update the target model, and obtain the poisoned model;
[0013] The poisoned model is used to identify the attacker's attack characteristics and take attack or defense measures against the attacker.
[0014] As a preferred technical solution, the step of obtaining the hierarchical information of the target model is as follows: using a hierarchical classification method to map entities and relationships in space to obtain hierarchical information;
[0015] The target model includes an independent hierarchical information model, an expressible hierarchical information model and a dependent hierarchical information model.
[0016] As a preferred technical solution, the method of using adjacent nodes as other layers of the poisoning tree includes:
[0017] The adjacent nodes of the root node are used as the second layer of the poisoning tree;
[0018] The adjacent nodes of the second-layer nodes are used as the third layer of the poisoning tree.
[0019] As a preferred technical solution, if the node included in the second layer already appears in the root node of the poisoning tree, then this node is ignored; the node is repeatedly used as a layer of the poisoning tree until all nodes are included in the tree structure.
[0020] As a preferred technical solution, each poisoning tree has N i Layer, calculate the proportion of the i-th layer in each poisoning tree that is located in the i-th layer in the obtained hierarchical information, and judge the reliability of poisoning.
[0021] As a preferred technical solution, the hierarchical attack strategy includes an ascending attack, specifically:
[0022] Set the attack entity at level N in the hierarchy iLayer, select the Nth layer in the hierarchy i-2 The target entity of the layer;
[0023] Calculate the ground truth score and take the triplet with the lowest ground truth score as the poisoned triplet.
[0024] As a preferred technical solution, the hierarchical attack strategy includes a layer-down attack, specifically:
[0025] Set the attack entity at level N in the hierarchy i Layer, select the Nth layer of the hierarchy i+2 The target entity of the layer;
[0026] Calculate the ground truth score and take the triplet with the lowest ground truth score as the poisoned triplet.
[0027] As a preferred technical solution, the hierarchical attack strategy includes a reversal attack, specifically:
[0028] When the attacker's attack target is a cross-level triple, the poisoned triple is directly added to reverse the original hierarchical structure, and the new relationship is determined through different standards, so that the newly constructed poisoned triple has the greatest impact on the original triple.
[0029] As a preferred technical solution, the hierarchical attack strategy includes same-layer attack, specifically:
[0030] Throughout the forest i-1 or N i+1 Layer selects attack entities;
[0031] Select the Nth i The target entity of the layer;
[0032] Calculate the ground truth score and take the triplet with the lowest ground truth score as the poisoned triplet.
[0033] In a second aspect, the present invention further provides a data immunization device for knowledge graph entity embedding hierarchical relationship, which is applied to the data immunization method for knowledge graph entity embedding hierarchical relationship, including an information acquisition module, a forest construction module, a target selection module, a data poisoning module, a model updating module and an immune defense module;
[0034] Information acquisition module, used to obtain hierarchical information of the target model;
[0035] A forest construction module is used to use the hierarchical information to take the first-layer nodes as the root nodes of the poisoning tree, and take the adjacent nodes as other layers of the poisoning tree to construct multiple poisoning trees to obtain a forest;
[0036] The target selection module is used to select the target entity. The attacker selects one or more target entities as the attack target as needed;
[0037] The data poisoning module is used to construct poisoned data according to the location of the target entity in the forest, the hierarchical attack strategy and the attacker's intention;
[0038] The model update module is used to add poisoned data to the data set, update the target model, and obtain the poisoned model;
[0039] The immune defense module is used to use the poisoned model to identify the attacker's attack characteristics and take attack or defense measures against the attacker.
[0040] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0041] (1) The present invention utilizes the hierarchical relationship of the knowledge graph to construct a poisoning tree, which can improve the data screening efficiency of the knowledge graph and make the knowledge graph model more inclined to the hierarchical relationship, thereby improving the robustness of the model.
[0042] (2) The present invention makes a reasonable division based on whether the model can express hierarchical information, and constructs new structured poisoned data based on different hierarchical attack strategies and attack intentions, so that the hierarchical information of the knowledge graph embedding results can be analyzed and obtained, thereby enhancing the pertinence of the knowledge graph embedding hierarchical structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 This is a flow chart of a data immunization method for embedding hierarchical relationships of knowledge graph entities according to an embodiment of the present invention;
[0045] Figure 2 A flowchart for constructing a poisoning tree for an embodiment of the present invention;
[0046] Figure 3 It is a schematic diagram of the structure of a data immunization device for embedding hierarchical relationships of knowledge graph entities according to an embodiment of the present invention;
[0047] Figure 4 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0049] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0050] Knowledge Graph Embedding (KGE) aims to transform the information in the knowledge graph into a vector form that can be understood and processed by computers. Through embedding technology, entities and relationships can be represented as low-dimensional vectors that can retain the structure and semantic information in the original knowledge graph.
[0051] See also Figure 1 , a data immunization method for embedding hierarchical relationships of knowledge graph entities provided in this embodiment includes the following steps:
[0052] S1. Obtain hierarchical information of a target model, where the target model includes multiple target entities.
[0053] In this embodiment, the target model is a model formed by multiple nodes in a certain hierarchical relationship, wherein the nodes are referred to as target entities in this embodiment. An attacker using a hierarchical attack needs to obtain hierarchical information of the target data and process the hierarchical structure into a tree structure to form a forest composed of multiple tree structures. The construction of the forest is detailed in step S2.
[0054] First, regarding hierarchical attacks, hierarchical attacks are white-box attacks, that is, the attacker can obtain important information such as parameters and data of the target model, and has certain operation permissions. Hierarchical attacks are targeted attacks, that is, the attack is not directed at every entity in the KG, but rather purposefully selects some entities as target entities, and constructs poisoned data based on the hierarchical information of the target entity for attack. The effect evaluation of targeted attacks requires an evaluation of the embedding performance of the target entity after the attack to determine the poisoning performance of the hierarchical attack; and an evaluation of the embedding performance of non-target entities after the attack to determine the exposure risk of the hierarchical attack. Hierarchical attacks are incremental attacks. In KGE data poisoning attacks, after the attacker obtains data operation permissions, he can choose to attack KGE by adding poisoned data or deleting key data. However, in actual applications, the permissions required to delete key data are much higher than those required to add poisoned data. Therefore, mainstream research focuses on adding poisoned data, that is, incremental attacks.
[0055] Secondly, regarding the hierarchical information of the target model. The attack analyzes the hierarchical structure of the KGE result based on the obtained target model information. Not all models have the ability to express hierarchical information, but the accuracy of hierarchical information affects the performance of hierarchical attacks. Therefore, the present invention proposes different processing strategies for different types of KGE models. According to whether hierarchical information can be expressed, KGE models can be divided into: (1) Models with independent hierarchical information, such as the TKRL model, whose data contains clear hierarchical information. When the attacker can obtain the internal information of the model, he can obtain accurate hierarchical information. (2) Models that can express hierarchical information, such as the HAKE model. When expressing entities and relationships, this model clearly stipulates that the first 500 dimensions of each relationship and entity matrix are parameters for expressing hierarchical semantics, and the model is considered to be able to express hierarchical semantics. In actual hierarchical attacks, a 500-dimensional feature matrix that expresses hierarchical semantics can be extracted, and hierarchical information can be obtained through feature classification. (3) Models without independent hierarchical information. For example, the transE model does not have the ability to express hierarchical semantics. We can still perform hierarchical attacks on similar models because the model does not have the ability to embed hierarchical information, but the data itself still has a hierarchical structure. We can use hierarchical classification methods to obtain hierarchical information, such as mapping entities and relationships in hyperbolic Poincaré space. Due to the uneven characteristics of hyperbolic space, low-level nodes are closer to the Poincaré edge and high-level nodes are located in the center. In addition, some more intuitive methods can also obtain entity hierarchical information.
[0056] S2. Using the hierarchical information, the first-layer nodes are used as the root nodes of the poisoning tree, and the adjacent nodes are used as other layers of the poisoning tree to construct multiple poisoning trees and obtain a forest.
[0057] like Figure 2As shown, according to the hierarchical information, the first-layer nodes are taken as the root nodes of the trees in the forest, and the adjacent nodes of the root nodes are taken as the second layer of the poisoned tree. At this time, if the nodes included in the second layer have already appeared in the root node of the poisoned tree, then this node is ignored. This method can ensure that the constructed poisoned tree is not only simple but also spreads outward. The adjacent nodes of the second-layer nodes are taken as the third layer of the poisoned tree. At this time, the nodes that have been included in the first and second layers are ignored, and the steps are repeated until all nodes are included in the tree structure. At this time, N poisoned trees are obtained. Assuming that each poisoned tree has N i Layer, calculate the proportion of the i-th layer in each poisoning tree in the i-th layer of the hierarchical information obtained in S1, which can determine the accuracy of the poisoning tree, and further determine the reliability of the poisoning, and provide it to the attacker as a reference.
[0058] S3. Select target entity. The attacker selects one or more target entities as attack targets as needed.
[0059] After the attacker obtains the target data and operation permissions, he can select some entities (nodes) as attack targets as needed, such as selecting the N nodes with the best embedding performance, selecting the N nodes with the largest degree according to the size of the node degree, etc.
[0060] S4. According to the location of the target entity in the forest, the attacker constructs poisoned data according to the hierarchical attack strategy and the attacker's intention.
[0061] Regarding the attack strategy, this embodiment constructs poisoned data based on the upgrade attack, the downgrade attack, the reverse attack and the same-layer attack, and in combination with the attacker's intention. Figure 3 The construction principles of the upgrade attack, the downgrade attack, the reversal attack and the same-layer attack are demonstrated. Figure 3 A, B, C, D, E, F, and G are nodes that actually exist in the knowledge graph, blue nodes are target entities selected by the attacker, and red arrows are triple relationships added by the attack. The construction principles of the upgrade attack, downgrade attack, reversal attack, and same-layer attack are as follows:
[0062] (1) Layer-up attacks, such as Figure 3 Part a shows a schematic diagram of a layer-up attack. The target entity is D, which is located in the hierarchy. i Layer, the attack layer is N i-2The layer selects entities and constructs poisoned triples. The selection criteria can be rich and varied. For example, the ground truth score of the poisoned triple is used as the selection criterion. The ground truth score can measure the degree to which a logical expression is true. The triple with the lowest ground truth score is selected as the poisoned triple. Alternatively, the cosine distance can be selected. The cosine distance can be used to measure the semantic similarity between two entities. The entity with the largest cosine distance and the target entity combination are selected in this tree as the poisoned triple. Different selection criteria can obtain different poisoned data.
[0063] (2) Downgrade attack: Figure 3 Part b shows a schematic diagram of a down-level attack. The target entity is B, which is located in the hierarchy. i Layer, the attack layer is N i+2 The layer selects entities and constructs poisoned triples. The selection criteria are also rich and varied.
[0064] (3) Reversal attack: Figure 3 Part c shows a reversal attack. When the attacker's attack target is a cross-level triple (which is often common), he can directly add a poisoned triple that reverses the original hierarchical structure and determine the new relationship through different standards so that the newly constructed poisoned triple has the greatest impact on the original triple.
[0065] (4) Same-layer attack: Figure 3 d is a same-layer attack, the attacker's target entity is C, which is located in the hierarchy N i Layer, the same-layer attack constructs poisoned data based on the characteristic of the hierarchical structure - attribute transfer. Attribute transfer means that in the hierarchical structure, the child node often has the same attribute as the parent node. i-1 or N i+1 The poisoned data is constructed by determining the entity in each layer. The difference between the layer-up attack and layer-down attack is that the search space is N in the entire forest. i-1 or N i+1 For example, if the node C is "fruit", it may be in N i+1 The poison triples added by the layer are (fruit, contain, monkey) or in N i-1 The poison triples added by the layer are (animal, containing, fruit). There are also many ways to determine the poison triples.
[0066] It is worth explaining that in actual applications, multiple knowledge graph nodes have obvious hierarchical semantics and are good potential attack targets, but the attacker's target nodes are only a part of them. So which nodes to attack and what poisoned data to construct depends on the attacker's intention.
[0067] S5. Add the poisoned data to the data set, update the target model, and obtain the poisoned model.
[0068] For models with open data sets, attackers can add poisoned data without permission. For models with closed data sources, attackers need to have certain operation permissions. The embedding performance of the poisoned model in the expression hierarchy nodes is destroyed. Since the hierarchical attack is a targeted attack, only the target triple and the surrounding embedded hierarchy are destroyed to complete the attack.
[0069] When the target model is attacked, it is similar to the process in which the antigen in the vaccine enters the body, the immune system receives the antigen and produces a large number of antibodies according to the characteristics of the antigen, thereby obtaining the ability to be immune. After the target model in this embodiment is trained by the poisoning attack, it can obtain a data set of the attacker's attack characteristics. Once the attacker attacks the target model again, it can identify the attack characteristics in the first time and take further defense or attack measures to defeat the attacker or maintain the security of the model, such as step S6.
[0070] S6. Use the poisoned model to identify the attacker's attack characteristics and take attack or defense measures against the attacker.
[0071] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.
[0072] Based on the same idea as the data immunization method for embedding hierarchical relationships of knowledge graph entities in the above-mentioned embodiment, the present invention also provides a data immunization device for embedding hierarchical relationships of knowledge graph entities, which can be used to execute the above-mentioned data immunization method for embedding hierarchical relationships of knowledge graph entities. For ease of explanation, the structural schematic diagram of the embodiment of the data immunization device for embedding hierarchical relationships of knowledge graph entities only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the diagram, or combine certain components, or arrange the components differently.
[0073] See also Figure 4 In another embodiment of the present application, a data immunity device 10 for embedding hierarchical relationships of knowledge graph entities is provided, the system comprising an information acquisition module 11, a forest construction module 12, a target selection module 13, a data poisoning module 14, a model updating module 15 and an immune defense module 16;
[0074] The information acquisition module 11 is used to acquire the hierarchical information of the target model;
[0075] The forest construction module 12 is used to use the hierarchical information to take the first layer node as the root node of the poisoning tree, and take the adjacent nodes as other layers of the poisoning tree to construct multiple poisoning trees to obtain a forest;
[0076] A target selection module 13 is used to select a target entity. The attacker selects one or more target entities as attack targets as needed;
[0077] The data poisoning module 14 is used to construct poisoned data according to the location of the target entity in the forest, the attacker's hierarchical attack strategy and the attacker's intention;
[0078] A model updating module 15, used to add poisoned data to the data set, update the target model, and obtain the poisoned model;
[0079] The immune defense module 16 is used to use the poisoned model to identify the attack characteristics of the attacker and take attack or defense measures against the attacker.
[0080] It should be noted that the data immunization device for embedding hierarchical relationships of knowledge graph entities of the present invention corresponds one-to-one to the data immunization method for embedding hierarchical relationships of knowledge graph entities of the present invention. The technical features and beneficial effects described in the above-mentioned embodiment of the data immunization method for embedding hierarchical relationships of knowledge graph entities are applicable to the embodiment of the data immunization method for embedding hierarchical relationships of knowledge graph entities. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.
[0081] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0082] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principles of the present invention shall be equivalent replacement methods and shall be included in the protection scope of the present invention.
Claims
1. A data immunity method for embedding hierarchical relationships of knowledge graph entities, characterized in that: The steps include: Obtaining hierarchical information of a target model, where the target model includes multiple target entities; Using the hierarchical information, the first-layer nodes are used as the root nodes of the poisoning tree, and the adjacent nodes are used as other layers of the poisoning tree to construct multiple poisoning trees and obtain a forest; Select target entity. The attacker selects one or more target entities as attack targets as needed; According to the location of the target entity in the forest, the attacker constructs poisoned data according to the hierarchical attack strategy and the attacker’s intention; Add poisoned data to the dataset, update the target model, and obtain the poisoned model; The poisoned model is used to identify the attacker's attack characteristics and take attack or defense measures against the attacker.
2. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: The step of obtaining the hierarchical information of the target model specifically comprises: using a hierarchical classification method to map entities and relationships in space to obtain hierarchical information; The target model includes an independent hierarchical information model, an expressible hierarchical information model and a dependent hierarchical information model.
3. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: The other layers of the poisoning tree using the adjacent nodes include: The adjacent nodes of the root node are used as the second layer of the poisoning tree; The adjacent nodes of the second-layer nodes are used as the third layer of the poisoning tree.
4. According to claim 3, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: If the node included in the second layer already appears in the root node of the poisoning tree, this node is ignored; the node is repeatedly used as the layer of the poisoning tree until all nodes are included in the tree structure.
5. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: Each poisoning tree has N i Layer, calculate the proportion of the i-th layer in each poisoning tree that is located in the i-th layer in the obtained hierarchical information, and judge the reliability of poisoning.
6. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: The hierarchical attack strategy includes escalating attacks, specifically: Set the attack entity at level N in the hierarchy i Layer, select the Nth layer in the hierarchy i-2 The target entity of the layer; Calculate the ground truth score and take the triplet with the lowest ground truth score as the poisoned triplet.
7. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized by: The hierarchical attack strategy includes a layer-down attack, specifically: Set the attack entity at level N in the hierarchy i Layer, select the Nth layer of the hierarchy i+2 The target entity of the layer; Calculate the ground truth score and take the triplet with the lowest ground truth score as the poisoned triplet.
8. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: The hierarchical attack strategy includes a reversal attack, specifically: When the attacker's attack target is a cross-level triple, the poisoned triple is directly added to reverse the original hierarchical structure, and the new relationship is determined by different standards, so that the newly constructed poisoned triple has the greatest impact on the original triple.
9. According to claim 1, the data immunity method for embedding hierarchical relationships of knowledge graph entities is characterized in that: The hierarchical attack strategy includes same-layer attacks, specifically: Throughout the forest i-1 or N i+1 Layer selects attack entities; Select the Nth i The target entity of the layer; Calculate the ground truth score and take the triplet with the lowest ground truth score as the poisoned triplet.
10. A data immunization device for embedding hierarchical relationships of knowledge graph entities, characterized in that: A data immunity method for embedding hierarchical relationships of knowledge graph entities applied to any one of claims 1-9, comprising an information acquisition module, a forest construction module, a target selection module, a data poisoning module, a model updating module and an immune defense module; Information acquisition module, used to obtain hierarchical information of the target model; A forest construction module is used to use the hierarchical information to take the first-layer nodes as the root nodes of the poisoning tree, and take the adjacent nodes as other layers of the poisoning tree to construct multiple poisoning trees to obtain a forest; The target selection module is used to select the target entity. The attacker selects one or more target entities as the attack target as needed; The data poisoning module is used to construct poisoned data according to the location of the target entity in the forest, the hierarchical attack strategy and the attacker's intention; The model update module is used to add poisoned data to the data set, update the target model, and obtain the poisoned model; The immune defense module is used to use the poisoned model to identify the attacker's attack characteristics and take attack or defense measures against the attacker.
