Adversarial sample background semantic robustness enhancement method, system and device and medium

By constructing a knowledge graph and a deep learning image fusion algorithm, a diverse background data set is generated, which solves the problem of insufficient robustness of adversarial samples in complex backgrounds, improves the attack success rate and reduces labor costs, and provides a method for background selection of adversarial samples. System guidance.

CN118865016AActive Publication Date: 2024-10-29ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY +4
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202410842624.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-29
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

When generating adversarial samples with existing technology, it is difficult to systematically select and generate representative backgrounds, resulting in insufficient robustness of adversarial samples in complex backgrounds of the physical world and high labor costs.

Method used

By building a knowledge graph, parsing the scene semantic information in the target data set, screening and generating diverse background data sets, using deep learning image fusion algorithms to enhance the robustness of adversarial samples, and optimizing the attack success rate of adversarial samples under different background conditions.

Benefits of technology

It significantly reduces labor costs, improves the robustness and attack success rate of adversarial samples in complex backgrounds, provides guidance for systematically selecting representative backgrounds, and improves the efficiency of adversarial attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118865016A_ABST
    Figure CN118865016A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer vision, and discloses an adversarial sample background semantic robustness enhancement method, system and device and a medium, and the method comprises the steps: obtaining a target data set, and constructing a knowledge graph through defining the relation between object nodes and background semantics; based on the knowledge graph, analyzing scene semantic information in the target data set to obtain a background image data set; screening background images meeting index conditions in the background image data set to generate a diversified background data set; and training an adversarial sample based on the diversified background data set to obtain an attack success rate expected value of the optimized adversarial sample. According to the method, the knowledge graph is used for carrying out deeper mining and effective utilization on the background semantic information, the problem that an existing method lacks systematic guidance in the aspect of selecting and generating representative backgrounds is solved, and the labor cost consumed by screening images is greatly reduced; the method can be applied to most attack-resisting algorithms, and the robustness of the attack-resisting samples generated by training of the attack-resisting algorithms under various backgrounds is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a method, system, device and medium for enhancing the semantic robustness of adversarial sample background. Background Art

[0002] The rapid development of artificial intelligence has brought convenience to our lives, but it has also caused many security issues. Adversarial attacks are an important research field that reveals the security issues of deep learning models in reality and promotes adversarial defense technologies. Adversarial attacks refer to an attack method against machine learning models that aims to deceive the model into producing incorrect outputs. Adversarial samples are generated by making small but adversarial modifications to the input data, causing the model to misclassify it.

[0003] However, in the complex and diverse context of the physical world, adversarial samples are often disturbed by background semantic information, which greatly reduces their adversarial resistance and makes them lose their ability to attack the target model. This is because the background of the physical world is complex and diverse, unpredictable and cannot be manipulated. Not only can they not attack by modifying the background information of the image, but because the target detection model uses background context information to assist in reasoning and classification, the adversarial resistance of adversarial samples will be further reduced.

[0004] In order to address the impact of background semantic information on adversarial attacks, existing methods construct reasonable backgrounds for the target and add them to the training process of adversarial samples to optimize the robustness of adversarial samples to the background. Although increasing the diversity of backgrounds for training can indeed improve the robustness of adversarial samples, there is still a lack of clear guidance on how to systematically select and generate representative backgrounds.

[0005] The existing method of using search engines to obtain diverse backgrounds is too crude. The results returned by the search engine are mixed, and there may be secondary created images. Whether the background obtained by directly searching by the target name is reasonable requires further manual screening, which will undoubtedly consume certain labor costs, thereby reducing the efficiency of generating adversarial samples; secondly, it is a difficult problem to obtain keywords that are highly relevant to the target semantics. If expert knowledge is used, the labor cost will be further increased.

[0006] Therefore, how to provide a method, system, device and medium for enhancing the robustness of background semantics of adversarial samples is a problem that needs to be solved urgently. Summary of the invention

[0007] The embodiments of the present invention provide a method, system, device and medium for enhancing the robustness of adversarial sample background semantics to solve the above-mentioned problems existing in the prior art.

[0008] In order to have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended to be a general review, nor is it intended to identify key / important components or to delineate the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description that follows.

[0009] According to a first aspect of an embodiment of the present invention, a method for enhancing the robustness of background semantics of adversarial samples is provided.

[0010] In one embodiment, the method for enhancing the robustness of adversarial sample background semantics includes:

[0011] Obtain the target data set and construct a knowledge graph by defining the semantic relationship between object nodes and background;

[0012] Based on the knowledge graph, the scene semantic information in the target dataset is parsed to obtain the background image dataset;

[0013] Screening background images that meet the indexing conditions in the background image dataset to generate a diverse background dataset;

[0014] Based on diverse background data sets, adversarial samples are trained to obtain the expected attack success rate of the optimized adversarial samples.

[0015] In one embodiment, acquiring the target data set and constructing the knowledge graph by defining the semantic relationship between the object node and the background includes:

[0016] Parse the annotation files of the images in the target dataset and extract the object information of each image; based on the object information, construct the scene graph corresponding to the image;

[0017] Based on the scene graph, construct the adjacency matrix of each image and integrate them to form a set of adjacency matrices;

[0018] Select all objects associated with labels in the label set of the target data set and define them as nodes of the knowledge graph; then obtain the background semantic relationship between objects and define them as edges of the knowledge graph;

[0019] By iteratively traversing the label set in the target dataset, the objects and background semantic relationships associated with all labels are added to the knowledge graph, and the background semantic relationship weights between labels are calculated through the adjacency matrix set.

[0020] In one embodiment, the object information includes object instances, relationships and locations; in the adjacency matrix, 1 indicates that two objects and backgrounds are semantically related, and 0 indicates that the two objects and backgrounds are semantically unrelated.

[0021] In one embodiment, the step of parsing scene semantic information in a target dataset based on a knowledge graph to obtain a background image dataset includes:

[0022] Select the label of the target object of the adversarial attack, define it as a keyword, and use the knowledge graph to search for the object node corresponding to the keyword;

[0023] Based on the object nodes obtained by the search, a keyword index set is established; and images containing keywords are searched in the target data set to generate a background image data set.

[0024] In one embodiment, screening the background images that meet the index condition in the background image dataset to generate the diverse background dataset includes:

[0025] Based on the keyword index set, screening background images in the background image dataset;

[0026] Extract the target object from each image in the target dataset and fuse the target object with the background image to establish an adversarial attack target object image set;

[0027] Based on the deep learning image fusion algorithm, the realism of the fused image is enhanced, and a diverse background data set with improved robustness is obtained.

[0028] In one embodiment, during the fusion process of the target object and the background image, a scene semantic relationship reasoning model is used to optimize the position of the target object in the background image.

[0029] In one embodiment, the training of adversarial samples based on diverse background data sets to obtain the expected attack success rate of the optimized adversarial samples includes:

[0030] The diverse background data set is input into the expected transformation framework to train the expected value of the attack success rate of the adversarial sample under different background conditions, and finally the expected value of the attack success rate of the optimized adversarial sample is obtained; wherein the diverse background data set includes several background conditions

[0031] According to a second aspect of an embodiment of the present invention, a system for enhancing the robustness of adversarial sample background semantics is provided.

[0032] In one embodiment, the adversarial sample background semantic robustness enhancement system includes:

[0033] The knowledge graph module is used to obtain the target data set and construct a knowledge graph by defining the semantic relationship between object nodes and background;

[0034] The background generation module is used to parse the scene semantic information in the target dataset based on the knowledge graph to obtain the background image dataset;

[0035] Background fusion module, used to filter background images that meet the index conditions in the background image dataset and generate a diverse background dataset;

[0036] The training optimization module is used to train adversarial samples based on diverse background data sets and obtain the expected attack success rate of the optimized adversarial samples.

[0037] In one embodiment, the knowledge graph module includes: a parsing conversion module, a matrix construction module, a graph definition module and an iterative calculation module, wherein:

[0038] The parsing and conversion module is used to parse the annotation file of the image in the target data set, extract the object information of each image; and construct a scene graph corresponding to the image based on the object information;

[0039] The matrix construction module constructs the adjacency matrix of each image based on the scene graph and integrates them to form an adjacency matrix set;

[0040] The graph definition module is used to select objects associated with all tags in the tag set in the target data set and define them as nodes of the knowledge graph; then obtain the background semantic relationship between the objects and define them as edges of the knowledge graph;

[0041] The iterative calculation module is used to iteratively traverse the label set in the target data set, add the objects and background semantic relationships associated with all labels to the knowledge graph, and calculate the background semantic relationship weights between the labels through the adjacency matrix set.

[0042] In one embodiment, the object information includes object instances, relationships and locations; in the adjacency matrix, 1 indicates that two objects and backgrounds are semantically related, and 0 indicates that the two objects and backgrounds are semantically unrelated.

[0043] In one embodiment, the background generation module includes: a node search module and a background search module, wherein:

[0044] The node search module is used to select the label of the target object of the adversarial attack, which is defined as a keyword, and use the knowledge graph to search for the object node corresponding to the keyword;

[0045] The background search module is used to establish a keyword index set based on the object nodes obtained by the search; and to search for images containing keywords in the target data set to generate a background image data set.

[0046] In one embodiment, the background fusion module includes: an index screening module, a fusion establishment module and an algorithm enhancement module, wherein:

[0047] The index screening module is used to screen background images in the background image data set based on a keyword index set;

[0048] The fusion establishment module is used to extract the target object from each image in the target data set, and fuse the target object with the background image to establish an adversarial attack target object image set;

[0049] The algorithm enhancement module is used to enhance the realism of the fused image based on the deep learning image fusion algorithm, and obtain a diverse background data set with improved robustness.

[0050] In one embodiment, during the fusion process of the target object and the background image, a scene semantic relationship reasoning model is used to optimize the position of the target object in the background image.

[0051] In one embodiment, the training optimization module includes: an input training module and an enhanced optimization module, wherein:

[0052] The input training module is used to input the diverse background data set into the desired transformation framework;

[0053] The enhanced optimization module is used to train the expected value of the attack success rate of the adversarial sample under different background conditions, and finally obtain the expected value of the attack success rate of the optimized adversarial sample; wherein the diverse background data set includes several background conditions.

[0054] According to a third aspect of an embodiment of the present invention, a computer device is provided.

[0055] In some embodiments, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0056] According to a fourth aspect of embodiments of the present invention, a computer-readable storage medium is provided.

[0057] In one embodiment, the computer-readable storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor.

[0058] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0059] 1. By using the knowledge graph to more deeply explore and effectively utilize the background semantic information, the problem of the lack of systematic guidance in the selection and generation of representative backgrounds in the existing methods is solved, which greatly reduces the labor cost of screening images. In addition, the present invention has the universality of the framework and can be applied to most adversarial attack algorithms, improving the robustness of adversarial samples generated by various adversarial attack algorithms in diverse backgrounds, thereby solving the challenges brought by background changes to adversarial attacks, and providing a new idea for enhancing the adversarial nature of adversarial samples in complex backgrounds in the real world.

[0060] 2. In order to solve the problem that the unpredictable complex background in the physical world will greatly reduce the adversarial nature of adversarial samples, the present invention uses knowledge graphs to deeply mine and effectively utilize the background semantic information of images, provides clear guidance for systematically selecting and generating representative backgrounds for adversarial sample robustness training, and generates diverse background data sets for robustness training. While effectively improving the success rate of adversarial sample attacks in complex backgrounds, it reduces the labor cost of the background data set construction process, greatly improving the efficiency of adversarial attacks.

[0061] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0063] Figure 1 is a flow chart of a method for enhancing the robustness of adversarial sample background semantics according to an exemplary embodiment;

[0064] Figure 2 is a logic flow chart of a method for enhancing the robustness of adversarial sample background semantics according to an exemplary embodiment;

[0065] Figure 3 is a principle block diagram of a system for enhancing the robustness of adversarial sample background semantics according to an exemplary embodiment;

[0066] Figure 4 The figure is a schematic diagram showing the structure of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION

[0067] The following description and accompanying drawings fully illustrate the specific embodiments of this article so that those skilled in the art can practice them. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The scope of the embodiments of this article includes the entire scope of the claims, as well as all available equivalents of the claims. Herein, the terms "first", "second", etc. are only used to distinguish one element from another, without requiring or implying any actual relationship or order between these elements. In fact, the first element can also be called the second element, and vice versa. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the structure, device or equipment including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also include elements inherent to such structure, device or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the structure, device or equipment including the elements. Each embodiment is described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other.

[0068] The terms "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. in this document indicate the orientation or position relationship based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing this document and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In the description of this document, unless otherwise specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a mechanical connection or an electrical connection, it can also be the internal communication of two elements, it can be a direct connection, or it can be an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0069] As used herein, the term "plurality" means two or more than two, unless otherwise specified.

[0070] In this document, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.

[0071] In this article, the term "and / or" is a description of the association relationship between objects, indicating that three relationships may exist. For example, A and / or B means: A or B, or, A and B.

[0072] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0073] Each module in the device or system of the present application can be implemented in whole or in part by software, hardware, or a combination thereof. The above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above modules.

[0074] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0075] Figure 1 An embodiment of the method for enhancing the robustness of adversarial sample background semantics of the present invention is shown.

[0076] In this optional embodiment, the method for enhancing the robustness of adversarial sample background semantics includes:

[0077] Step S101, obtaining a target data set, and constructing a knowledge graph by defining the semantic relationship between object nodes and background;

[0078] Step S103: Based on the knowledge graph, the scene semantic information in the target data set is parsed to obtain a background image data set;

[0079] Step S105, screening background images that meet the indexing conditions in the background image data set to generate a diverse background data set;

[0080] Step S107: Based on the diverse background data sets, train the adversarial samples to obtain the expected attack success rate of the optimized adversarial samples.

[0081] In this optional embodiment, when acquiring a target data set and constructing a knowledge graph by defining object nodes and background semantic relationships, the annotation file of the images in the target data set can be parsed to extract the object information of each image; based on the object information, a scene graph corresponding to the image is constructed (the scene graph is used for structured representation of the image); based on the scene graph, an adjacency matrix of each image is constructed (used to represent the relationship between objects in the image), and integrated to form an adjacency matrix set; objects associated with all tags in the tag set in the target data set are selected and defined as nodes of the knowledge graph; the background semantic relationship between the objects is then obtained (the background semantic relationship is represented by a positive integer v, and the larger the v, the deeper the background semantic relationship between the two objects connected by this edge), and defined as an edge of the knowledge graph; by iteratively traversing the tag set in the target data set, all objects associated with the tags and the background semantic relationship are added to the knowledge graph, and the background semantic relationship weights between the tags are calculated through the adjacency matrix set.

[0082] Specifically, we first extract information describing the object instances, relationships, and locations in each image in the target dataset through a script to construct a scene graph. Using the scene graph as an effective visual information source for building a knowledge graph, we transform the visual elements in the image and the relationships between them into a graph structure, so that the knowledge graph can integrate rich semantic information from the image, including the background semantic information needed to solve the problem.

[0083] In this optional embodiment, the object information includes object instances, relationships and positions; in the adjacency matrix, 1 indicates that the two objects and their backgrounds are semantically related, and 0 indicates that the two objects and their backgrounds are semantically unrelated.

[0084] In this optional embodiment, when parsing the scene semantic information in the target data set based on the knowledge graph to obtain the background image data set, the label of the target object of the antagonistic attack can be selected and defined as a keyword, and the knowledge graph is used to search for object nodes corresponding to the keyword; based on the object nodes obtained by the search, a keyword index set is established; and images containing the keyword are searched in the target data set to generate a background image data set.

[0085] In this optional embodiment, when screening background images that meet the index conditions in the background image dataset to generate a diverse background dataset, background images can be screened in the background image dataset based on a keyword index set; the target object is extracted from each image in the target dataset, and the target object is fused with the background image to establish an adversarial attack target object image set; based on a deep learning image fusion algorithm (a deep learning image fusion algorithm based on Poisson mixing loss), the realism of the fused image is enhanced to obtain a diverse background dataset with improved robustness; to ensure that the target object is naturally integrated into the new background, close to the physical image of the real world, thereby improving the robustness of the generated adversarial samples.

[0086] In this optional embodiment, during the fusion of the target object and the background image, the scene semantic relationship reasoning model is used to optimize the position of the target object in the background image; because the improved scene semantic relationship reasoning model is used to focus on spatial semantic relationships, it is ensured that the position of the target object in the new background is reasonable.

[0087] In this optional embodiment, when training adversarial samples based on the diverse background data set to obtain the expected value of the attack success rate of the optimized adversarial samples, the diverse background data set can be input into the expected transformation framework to train the expected value of the attack success rate of the adversarial samples under different background conditions, and finally obtain the expected value of the attack success rate of the optimized adversarial samples; wherein the diverse background data set includes several background conditions; by improving the robustness of the adversarial samples under diverse background conditions, the adaptability of the adversarial samples under diverse background conditions is enhanced.

[0088] Figure 3 An embodiment of the adversarial sample background semantics robustness enhancement system of the present invention is shown.

[0089] In this optional embodiment, the adversarial sample background semantic robustness enhancement system includes:

[0090] The knowledge graph module 201 is used to obtain the target data set and construct a knowledge graph by defining the semantic relationship between the object node and the background;

[0091] Background generation module 203, used to parse the scene semantic information in the target data set based on the knowledge graph to obtain a background image data set;

[0092] Background fusion module 205, used to filter background images that meet the index conditions in the background image data set to generate a diverse background data set;

[0093] The training optimization module 207 is used to train adversarial samples based on diverse background data sets to obtain an expected attack success rate of the adversarial samples after optimization.

[0094] In this optional embodiment, the knowledge graph module 201 includes: a parsing conversion module (not shown in the figure), a matrix construction module (not shown in the figure), a graph definition module (not shown in the figure) and an iterative calculation module (not shown in the figure), wherein the parsing conversion module is used to parse the annotation file of the image in the target data set and extract the object information of each image; based on the object information, a scene graph corresponding to the image is constructed; the matrix construction module constructs an adjacency matrix for each image based on the scene graph, and integrates it to form an adjacency matrix set; the graph definition module is used to select all objects associated with tags in the tag set in the target data set, and define them as nodes of the knowledge graph; then obtain the background semantic relationships between the objects, and define them as edges of the knowledge graph; the iterative calculation module is used to iteratively traverse the tag set in the target data set, add all objects associated with tags and background semantic relationships to the knowledge graph, and calculate the background semantic relationship weights between tags through the adjacency matrix set.

[0095] In this optional embodiment, the object information includes object instances, relationships and positions; in the adjacency matrix, 1 indicates that the two objects and their backgrounds are semantically related, and 0 indicates that the two objects and their backgrounds are semantically unrelated.

[0096] In this optional embodiment, the background generation module 203 includes: a node search module (not shown in the figure) and a background search module (not shown in the figure), wherein the node search module is used to select labels of the target objects of the counterattack, defined as keywords, and use the knowledge graph to search for object nodes corresponding to the keywords; the background search module is used to establish a keyword index set based on the object nodes obtained by the search; and search for images containing keywords in the target data set to generate a background image data set.

[0097] In this optional embodiment, the background fusion module 205 includes: an index screening module (not shown in the figure), a fusion establishment module (not shown in the figure) and an algorithm enhancement module (not shown in the figure), wherein the index screening module is used to screen background images in the background image data set based on a keyword index set; the fusion establishment module is used to extract the target object from each image in the target data set, and fuse the target object with the background image to establish an adversarial attack target object image set; the algorithm enhancement module is used to enhance the realism of the fused image based on a deep learning image fusion algorithm, and obtain a diverse background data set with improved robustness.

[0098] In this optional embodiment, during the fusion of the target object and the background image, the position of the target object in the background image is optimized using a scene semantic relationship reasoning model.

[0099] In this optional embodiment, the training optimization module 207 includes: an input training module (not shown in the figure) and an enhanced optimization module (not shown in the figure), wherein the input training module is used to input the diverse background data set into the expected transformation framework; the enhanced optimization module is used to train the expected value of the attack success rate of the adversarial sample under different background conditions, and finally obtain the expected value of the attack success rate of the optimized adversarial sample; wherein the diverse background data set includes several background conditions.

[0100] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0101] like Figure 1 , Figure 2 As shown, the method for enhancing the robustness of adversarial sample background semantics described in this example includes the following steps:

[0102] The first step is to build a knowledge graph from the scene semantic level

[0103] First, the xml annotation files of the images in the VrR-VG dataset are parsed by Python scripts to extract information describing the object instances, relationships, and locations in each image, and use this information to construct a scene graph for structured representation of the image. Using the scene graph extracted from the VrR-VG dataset, an n*n adjacency matrix is ​​constructed for each image to represent the relationship between objects in the image, where n is the number of objects in the image, the rows and columns in the matrix represent the objects in the image, and the element values ​​in the matrix represent the relationship between objects in the image. 1 represents a close connection between two objects, that is, the background semantics are related, and 0 represents no close connection or a loose connection between the two objects, and the background semantics are irrelevant.

[0104] In this way, the scene atlas extracted from the VrR-VG dataset is converted into a set of adjacency matrices, which store the background semantic relationships between objects in the image in the form of matrices, laying the foundation for the calculation and construction of the following knowledge graph.

[0105] The nodes of the knowledge graph G are defined as objects associated with all the labels of the label set P in the VrR-VG dataset, and are represented by labels. At the same time, the edges of G are defined as the background semantic relationship between objects, represented by a positive integer v. The larger the v, the deeper the background semantic relationship between the two objects connected by this edge. The algorithm for constructing the knowledge graph G using the adjacency matrix set M converted from the scene graph set (Algorithm 1: Knowledge graph construction process) is as follows:

[0106] Input: label set P = {p_i, p_(i+1)…, p_n}, adjacency matrix set M = {m_j, m_(j+1)…, m_n}

[0107] Output: Knowledge graph G

[0108] step:

[0109] Initialize the knowledge graph G = φ, i = 1, j = 1, k = i + 1

[0110] While p_i∈P

[0111] k=i+1

[0112] While m_j∈M

[0113] While p_k∈P

[0114] If m_j(p_i, p_k)==1

[0115] If the node p_i or p_k does not exist in the knowledge graph G, add the missing node and initialize the edge v_ik = 1; if both nodes already exist, v_ik = v_ik + 1

[0116] End if

[0117] End while

[0118] End while

[0119] End while

[0120] Return G

[0121] In Algorithm 1, the label set P in the VrR-VG dataset is looped in a bubble-like manner, and all labels in the set are iteratively added to the knowledge graph G. In the process, the background semantic relationship weight v between the labels is calculated through the adjacency matrix set M, and finally a knowledge graph containing object nodes corresponding to all labels and background semantic relationships between objects is obtained.

[0122] The second step is to obtain the background atlas guided by the knowledge graph

[0123] The first step is to extract background semantic relationships. The label of the target object is used as the keyword, and the knowledge graph is used to search for object nodes corresponding to the label. The purpose of this step is to find other object nodes that are semantically associated with the target object. These associations reflect the background semantic environment in which the target object may appear. By calculating the edge weights in the knowledge graph, the top ten object nodes with the largest weights are selected. These nodes represent the background semantic information most relevant to the target object.

[0124] Next, we construct a background image dataset. We use the object node labels obtained above as keyword index sets and search for images containing these labeled objects from the VrR-VG dataset. These images constitute a background image dataset, which is used to generate diverse backgrounds for adversarial samples.

[0125] The third step is to generate a diverse background dataset based on the target

[0126] The target object is separated from the original image by the cutout process, and then fused with the image in the background image dataset to create an adversarial attack target object image set with diverse backgrounds. In the fusion process, the improved scene semantic relationship reasoning model is used to focus on spatial semantic relationships to ensure that the position of the target object in the new background is reasonable. The deep learning image fusion algorithm based on Poisson mixing loss is used to further enhance the realism of the fused image, ensuring that the target object naturally blends into the new background and is close to the physical image of the real world, thereby improving the robustness of the generated adversarial samples. The core of this method is to represent the distribution of objects in the real world through highly realistic fused images, thereby enhancing the adaptability of adversarial samples in the face of complex backgrounds.

[0127] Formulas are defined for the processes of step 2 and step 3. Assume that the target object label of the adversarial attack is p, G is the knowledge graph constructed based on the VrR-VG dataset, S(G, p) is the set of object nodes related to the object background semantics obtained from the knowledge graph G using p as the keyword index search, L(S) is the label set corresponding to S(G, p), D(L) is the background image dataset retrieved from the VrR-VG dataset based on L(S), and B(D) is the adversarial attack target object dataset under diverse backgrounds. In this way, the algorithm for generating diverse backgrounds (Algorithm 2: Diverse background image dataset generation process) can be defined as follows:

[0128] Input: adversarial attack target object label p, knowledge graph G, VrR-VG dataset X, label set P

[0129] Output: Dataset B of adversarial attack target objects in diverse backgrounds

[0130] step:

[0131] Initialize the object node set related to the target object background semantics

[0132] While g∈G

[0133] If G(p,g)exists

[0134] Add g node in S

[0135] While p^'∈P

[0136] If p^'==g

[0137] Add p^'in L

[0138] End if

[0139] End while

[0140] End if

[0141] End while

[0142] Let S(G, p) = S, L(S) = L

[0143] For x in X

[0144] If x contains any l in L

[0145] Add x in D

[0146] End if

[0147] End for

[0148] Let D(L) = D

[0149] The adversarial attack target object τ is deducted from the target image

[0150] For d in D

[0151] Add Merge(d,τ)in B

[0152] End for

[0153] Let B(D)=B

[0154] Return B(D)

[0155] Algorithm 2 uses the knowledge graph to effectively guide the selection of background image datasets using the background semantic information contained in it, making these background image datasets more consistent with rich and real semantic environments. This process first uses the label of the target object of the adversarial attack as a keyword to search the knowledge graph for object nodes corresponding to the label and other semantically related object nodes. By calculating and screening the top ten object nodes with the largest connection edge weights, a background image dataset that reflects both the rich relationship between the target object and the background and the diversity of the real world is obtained.

[0156] Step 4: Invest in the framework to train adversarial sample robustness

[0157] The diverse background image dataset generated in step 3 is put into the EOT framework (Expectation Over Transformation) to train and optimize the expected value of the attack success rate of adversarial samples under various backgrounds, improve the robustness of adversarial samples under changing backgrounds, and enhance the adaptability of adversarial samples to complex and diverse background conditions in the real world, while still maintaining good adversarial properties.

[0158] After completing the above operations, adversarial samples with enhanced background semantic robustness can effectively resist attacks in the physical world with complex backgrounds, and can directly reveal the security issues of deep learning models hidden in reality. Compared with existing methods, this method uses knowledge graphs to systematically select and generate representative backgrounds for adversarial sample robustness training, which greatly reduces the labor cost of screening images while improving the success rate of adversarial sample attacks in complex backgrounds.

[0159] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store static information and dynamic information data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above method embodiment are implemented.

[0160] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0161] In addition, the present invention also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiment when executing the computer program.

[0162] In addition, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiment are implemented.

[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0164] The present invention is not limited to the structures which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for enhancing the robustness of adversarial sample background semantics, characterized in that: include: Obtain the target data set and construct a knowledge graph by defining the semantic relationship between object nodes and background; Based on the knowledge graph, the scene semantic information in the target dataset is parsed to obtain the background image dataset; Screening background images that meet the indexing conditions in the background image dataset to generate a diverse background dataset; Based on diverse background data sets, adversarial samples are trained to obtain the expected attack success rate of the optimized adversarial samples.

2. The method for enhancing the robustness of adversarial sample background semantics according to claim 1, characterized in that: The step of obtaining a target data set and constructing a knowledge graph by defining a semantic relationship between an object node and a background comprises: Parse the annotation files of the images in the target dataset and extract the object information of each image; based on the object information, construct the scene graph corresponding to the image; Based on the scene graph, construct the adjacency matrix of each image and integrate them to form a set of adjacency matrices; Select all objects associated with labels in the label set of the target data set and define them as nodes of the knowledge graph; then obtain the background semantic relationship between objects and define them as edges of the knowledge graph; By iteratively traversing the label set in the target dataset, the objects and background semantic relationships associated with all labels are added to the knowledge graph, and the background semantic relationship weights between labels are calculated through the adjacency matrix set.

3. The method for enhancing the robustness of adversarial sample background semantics according to claim 2, characterized in that: The object information includes object instances, relations and positions; in the adjacency matrix, 1 indicates that the background semantics of two objects are related, and 0 indicates that the background semantics of two objects are not related.

4. The method for enhancing the robustness of adversarial sample background semantics according to claim 1, characterized in that: The scene semantic information in the target data set is parsed based on the knowledge graph to obtain the background image data set, including: Select the label of the target object of the adversarial attack, define it as a keyword, and use the knowledge graph to search for the object node corresponding to the keyword; Based on the object nodes obtained by the search, a keyword index set is established; and images containing keywords are searched in the target data set to generate a background image data set.

5. The method for enhancing the robustness of adversarial sample background semantics according to claim 1, characterized in that: The step of screening background images that meet the index condition in the background image dataset to generate a diverse background dataset includes: Based on the keyword index set, screening background images in the background image dataset; Extract the target object from each image in the target dataset and fuse the target object with the background image to establish an adversarial attack target object image set; Based on the deep learning image fusion algorithm, the realism of the fused image is enhanced, and a diverse background data set with improved robustness is obtained.

6. The method for enhancing the robustness of adversarial sample background semantics according to claim 5, characterized in that: In the process of fusing the target object with the background image, the position of the target object in the background image is optimized using a scene semantic relationship reasoning model.

7. The method for enhancing the robustness of adversarial sample background semantics according to claim 1, characterized in that: The adversarial samples are trained based on the diverse background data sets to obtain the expected attack success rate of the optimized adversarial samples, including: The diverse background data set is input into the expected transformation framework, and the expected values ​​of the attack success rates of the adversarial samples under different background conditions are trained, and finally the expected values ​​of the attack success rates of the optimized adversarial samples are obtained; wherein the diverse background data set includes several background conditions.

8. Adversarial sample background semantic robustness enhancement system, characterized by: include: The knowledge graph module is used to obtain the target data set and construct a knowledge graph by defining the semantic relationship between object nodes and background; The background generation module is used to parse the scene semantic information in the target dataset based on the knowledge graph to obtain the background image dataset; Background fusion module, used to filter background images that meet the index conditions in the background image dataset and generate a diverse background dataset; The training optimization module is used to train adversarial samples based on diverse background data sets and obtain the expected attack success rate of the optimized adversarial samples.

9. The adversarial sample background semantic robustness enhancement system according to claim 8, characterized in that: The knowledge graph module includes: an analytical conversion module, a matrix construction module, a graph definition module and an iterative calculation module, wherein: The parsing and conversion module is used to parse the annotation file of the image in the target data set, extract the object information of each image; and construct a scene graph corresponding to the image based on the object information; The matrix construction module constructs the adjacency matrix of each image based on the scene graph and integrates them to form an adjacency matrix set; The graph definition module is used to select objects associated with all tags in the tag set in the target data set and define them as nodes of the knowledge graph; then obtain the background semantic relationship between the objects and define them as edges of the knowledge graph; The iterative calculation module is used to iteratively traverse the label set in the target data set, add the objects and background semantic relationships associated with all labels to the knowledge graph, and calculate the background semantic relationship weights between the labels through the adjacency matrix set.

10. The adversarial sample background semantic robustness enhancement system according to claim 9, characterized in that: The object information includes object instances, relations and positions; in the adjacency matrix, 1 indicates that the background semantics of two objects are related, and 0 indicates that the background semantics of two objects are not related.

11. The adversarial sample background semantic robustness enhancement system according to claim 8, characterized in that: The background generation module includes: a node search module and a background search module, wherein: The node search module is used to select the label of the target object of the adversarial attack, which is defined as a keyword, and use the knowledge graph to search for the object node corresponding to the keyword; The background search module is used to establish a keyword index set based on the object nodes obtained by the search; and to search for images containing keywords in the target data set to generate a background image data set.

12. The adversarial sample background semantic robustness enhancement system according to claim 8, characterized in that: The background fusion module includes: an index screening module, a fusion establishment module and an algorithm enhancement module, wherein: The index screening module is used to screen background images in the background image data set based on a keyword index set; The fusion establishment module is used to extract the target object from each image in the target data set, and fuse the target object with the background image to establish an adversarial attack target object image set; The algorithm enhancement module is used to enhance the realism of the fused image based on the deep learning image fusion algorithm, and obtain a diverse background data set with improved robustness.

13. The adversarial sample background semantic robustness enhancement system according to claim 12, characterized in that: In the process of fusing the target object with the background image, the position of the target object in the background image is optimized using a scene semantic relationship reasoning model.

14. The adversarial sample background semantic robustness enhancement system according to claim 8, characterized in that: The training optimization module includes: an input training module and an enhanced optimization module, wherein: The input training module is used to input the diverse background data set into the desired transformation framework; The enhanced optimization module is used to train the expected value of the attack success rate of the adversarial sample under different background conditions, and finally obtain the expected value of the attack success rate of the optimized adversarial sample; wherein the diverse background data set includes several background conditions.

15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image scene retrieval system and method based on multi-modal knowledge graph

    CN111694965A

  • Deep learning model adversarial robustness enhancement method based on semantic information

    CN112270367A

  • Image generation method based on ontology knowledge base and attention generative adversarial network

    CN114386428A

  • Adversarial graph generation method and device based on node matching and computer equipment

    CN114491515A

  • Translation, adversarial sample generation and model robustness enhancement methods and related devices

    CN116011470A