Methods, devices, and storage media for generating adversarial examples

By perturbing multiple distributed adversarial regions obtained from the original image to generate a target image with distributed sample features, the problem of low success rate of targeted attack in existing technologies is solved, and the attack effect of adversarial samples is improved.

CN117765349BActive Publication Date: 2026-11-17BEIJING REALAI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311773600.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2026-11-17
Estimated Expiration
2043-12-21

AI Technical Summary

Technical Problem

Existing adversarial example generation algorithms struggle to generate targeted attack success rates in adversarial attacks, especially when the area of ​​the adversarial example is limited, making it difficult to generate false detection boxes that are close in size to the real target.

Method used

Multiple distributed adversarial regions are obtained from the original image containing the target to be attacked. The target image with distributed sample features is generated by perturbation and then used for model attack. The perturbation image features are collected by multiple distributed adversarial regions to improve the success rate of targeted attack.

Benefits of technology

By generating distributed adversarial samples, the success rate of adversarial samples in targeted attacks is improved, overcoming the shortcomings of single adversarial samples being easily detected and identified by defense algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117765349B_ABST
    Figure CN117765349B_ABST
Patent Text Reader

Abstract

This application relates to the field of artificial intelligence, providing a method, related apparatus, and storage medium for generating adversarial examples. The method for generating adversarial examples includes: acquiring an original image containing a target to be attacked; acquiring at least two first adversarial regions on the original image, wherein the at least two first adversarial regions do not overlap; perturbing the original image to obtain a first perturbed image; generating a target image based on the first perturbed image located within the at least two first adversarial regions; and outputting the target image as an adversarial example if the target image successfully attacks a target detection model. This application generates target images with distributed sample characteristics for model attacks. By generating distributed adversarial examples, it compensates for the technical deficiency of single adversarial examples being easily detected and identified by defense algorithms, thereby improving the success rate of the generated adversarial examples for targeted attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically to a method, related apparatus, and storage medium for generating adversarial examples. Background Technology

[0002] In autonomous driving scenarios, the identification and detection of targets such as vehicles and pedestrians is one of the key tasks. Research on adversarial attacks against targets in the physical world is also crucial for the practical application of autonomous driving algorithms. Currently, adversarial attacks against the physical world mainly utilize adversarial examples. This involves generating offensive adversarial examples using adversarial attack algorithms and attaching them to the surface of the target object, causing it to be missed or misjudged by the detection model, thus achieving the purpose of the adversarial attack. However, the adversarial examples generated by existing algorithms are generally complete, continuous regions that can be detected by some defense algorithms at once. Furthermore, because the adversarial examples generated by existing adversarial attack algorithms are uniform wholes, it is difficult to induce the attacked detection model to generate false detection boxes of similar size to the real target, given the limited area of ​​the adversarial examples. The size of the detection box is particularly important in adversarial tasks other than vanishing attacks (such as targeted attack identification), resulting in a low success rate for targeted attacks using generated adversarial examples. Summary of the Invention

[0003] This application provides a method, related apparatus, and storage medium for generating adversarial samples, which can improve the success rate of targeted attacks using the generated adversarial samples.

[0004] In a first aspect, embodiments of this application provide a method for generating adversarial examples, the method comprising:

[0005] Obtain the original image containing the target to be attacked;

[0006] Obtain at least two first adversarial regions on the original image, wherein at least two first adversarial regions do not overlap;

[0007] The original image is perturbed to obtain a first perturbed image;

[0008] Generate a target image based on the first perturbation image located within at least two of the first adversarial regions;

[0009] If the target image successfully attacks the target detection model, the target image will be output as an adversarial example.

[0010] In one embodiment, the method for generating adversarial examples further includes:

[0011] If the target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain a second perturbation image;

[0012] A new target image is generated based on the second perturbation image located within at least two of the first adversarial regions;

[0013] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0014] In one embodiment, the method for generating adversarial examples further includes:

[0015] If the target image fails to attack the target detection model, at least two second adversarial regions are obtained on the original image, wherein the at least two second adversarial regions are different from the at least two first adversarial regions;

[0016] A new target image is generated based on the first perturbation image located within at least two of the second adversarial regions;

[0017] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0018] In one embodiment, the method for generating adversarial examples further includes:

[0019] If the target detection model is not successfully attacked, record the number of times the attack failed in this round;

[0020] Determine whether the number of unsuccessful attacks in this round has reached a preset number;

[0021] If the number of unsuccessful attacks in this round reaches a preset number, the target image of the target detection model in this attack will be output as an adversarial example.

[0022] In one implementation, the at least two first adversarial regions on the acquired original image include:

[0023] Obtain the target type of the target to be attacked in the original image;

[0024] The original image is divided into at least two sub-regions based on the target type;

[0025] In each of the sub-regions, a first adversarial region is randomly generated, resulting in at least two first adversarial regions, wherein the area of ​​the first adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0026] Secondly, embodiments of this application provide an adversarial example generation apparatus, which has the function of implementing the adversarial example generation method corresponding to the first aspect described above. The function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function, and the modules can be software and / or hardware.

[0027] In one embodiment, the adversarial example generation apparatus includes:

[0028] The first acquisition module is configured to acquire the original image containing the target to be attacked;

[0029] The second acquisition module is configured to acquire at least two first adversarial regions on the original image, wherein the at least two first adversarial regions do not overlap;

[0030] A perturbation module is configured to perturb the original image to obtain a first perturbed image;

[0031] The generation module is configured to generate a target image based on images where the first perturbation image is located within at least two of the first adversarial regions;

[0032] The output module is configured to output the target image as an adversarial example if the target image successfully attacks the target detection model.

[0033] In one implementation, the output module is configured as follows:

[0034] If the target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain a second perturbation image;

[0035] A new target image is generated based on the second perturbation image located within at least two of the first adversarial regions;

[0036] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0037] In one implementation, the output module is configured as follows:

[0038] If the target image fails to attack the target detection model, at least two second adversarial regions are obtained on the original image, wherein the at least two second adversarial regions are different from the at least two first adversarial regions;

[0039] A new target image is generated based on the first perturbation image located within at least two of the second adversarial regions;

[0040] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0041] In one implementation, the output module is configured as follows:

[0042] If the target detection model is not successfully attacked, record the number of times the attack failed in this round;

[0043] Determine whether the number of unsuccessful attacks in this round has reached a preset number;

[0044] If the number of unsuccessful attacks in this round reaches a preset number, the target image of the target detection model in this attack will be output as an adversarial example.

[0045] In one implementation, the first acquisition module is configured to:

[0046] Obtain the target type of the target to be attacked in the original image;

[0047] The original image is divided into at least two sub-regions based on the target type;

[0048] In each of the sub-regions, a first adversarial region is randomly generated, resulting in at least two first adversarial regions, wherein the area of ​​the first adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0049] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the adversarial sample generation method as described in the first aspect.

[0050] Fourthly, embodiments of this application provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the adversarial example generation method described in the first aspect.

[0051] Fifthly, embodiments of this application provide a chip that includes a processor coupled to a transceiver of a terminal device, for executing the technical solution provided in the first aspect of embodiments of this application.

[0052] In a sixth aspect, embodiments of this application provide a chip system including a processor for supporting a terminal device in implementing the functions involved in the first aspect above, such as generating or processing information involved in the image processing method provided in the first aspect above.

[0053] In one possible design, the aforementioned chip system also includes a memory for storing program instructions and data necessary for the terminal. The chip system can be composed of chips or may include chips and other discrete components.

[0054] In a seventh aspect, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a computer, cause the computer to execute the adversarial sample generation method provided in the first aspect.

[0055] Compared to existing technologies, in this embodiment, an original image containing the target to be attacked is acquired; at least two first adversarial regions on the original image are acquired, wherein the at least two first adversarial regions do not overlap; the original image is perturbed to obtain a first perturbed image; a target image is generated based on the image of the first perturbed image located within the at least two first adversarial regions; and if the target image successfully attacks the target detection model, the target image is output as an adversarial sample. Because this embodiment acquires multiple distributed first adversarial regions from the original image containing the target to be attacked, and uses these multiple distributed first adversarial regions to collect features on the perturbed image after perturbing the original image, a target image with distributed sample features is generated for model attack. This method of generating distributed adversarial samples compensates for the technical deficiency of single adversarial samples being easily detected and identified by defense algorithms, thereby improving the success rate of the generated adversarial samples in targeted attacks. Attached Figure Description

[0056] The objectives, features, and advantages of the embodiments of this application will become readily understood by referring to the accompanying drawings and the detailed description of the embodiments. Wherein:

[0057] Figure 1 This is a schematic diagram of an adversarial sample generation system, which is an example of the adversarial sample generation method in this application.

[0058] Figure 2 This is a flowchart illustrating a method for generating adversarial samples according to an embodiment of this application;

[0059] Figure 3 This is a specific example diagram of at least two first adversarial regions in the adversarial sample generation method of this application embodiment;

[0060] Figure 4 This is a specific example diagram of the target image in the adversarial example generation method of this application embodiment;

[0061] Figure 5 This is another flowchart illustrating the method for generating adversarial samples according to an embodiment of this application;

[0062] Figure 6This is a schematic diagram of the structure of the adversarial sample generation device according to an embodiment of this application;

[0063] Figure 7 This is a schematic diagram of the structure of a computing device according to an embodiment of this application;

[0064] Figure 8 This is a schematic diagram of the structure of a mobile phone in one embodiment of this application;

[0065] Figure 9 This is a schematic diagram of a server structure in one embodiment of this application.

[0066] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0067] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules in the embodiments of this application is merely a logical division; in actual applications, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be omitted or not performed. Additionally, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interface, indirect coupling between modules, or electrical or other similar forms of communication connection, none of which are limited in the embodiments of this application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of this application.

[0068] Generative artificial intelligence methods and software are widely used, which has created potential risks and hidden dangers. In addition to the leakage of personal information, negative news, fake news, and statements by key figures created using generative AI tools are difficult to verify and spread rapidly, seriously misleading public opinion, affecting national security and social stability, and may also become a new means of cybercrime, infringing on citizens' legitimate rights and interests.

[0069] The general-purpose big model is currently widely used in applications such as chat dialogue, text editing, artistic creation, coding, mathematical reasoning, and bioinformatics. Although it has created many new business models and has powerful capabilities, after the general-purpose big model was launched for users, there are mainly algorithmic risks, data risks, and application risks in the three types of applications: translation, chat, and collaboration.

[0070] This application also provides a method, related apparatus, and storage medium for generating adversarial examples, applicable to systems capable of generating adversarial examples. The adversarial example generation system may include an adversarial example generation apparatus, which can be deployed integratedly or separately. The adversarial example generation apparatus is at least used to: acquire an original image containing a target to be attacked; acquire at least two first adversarial regions on the original image, wherein the at least two first adversarial regions do not overlap; perturb the original image to obtain a first perturbated image; generate a target image based on the image of the first perturbated image located within the at least two first adversarial regions; and output the target image as an adversarial example if the target image successfully attacks a target detection model.

[0071] The solutions provided in this application involve technologies such as Artificial Intelligence (AI), Computer Vision (CV), and Machine Learning (ML), which are specifically illustrated through the following embodiments:

[0072] AI, or Artificial Intelligence, refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, Artificial Intelligence is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine capable of reacting in a manner similar to human intelligence. Artificial Intelligence studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0073] AI technology is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0074] Computer vision (CV) is the science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes for target recognition, tracking, and measurement, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include adversarial perturbation generation, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.

[0075] Adversarial samples generated by existing technologies are generally complete, continuous regions that can be detected by some defense algorithms in one go. At the same time, since the adversarial samples generated by existing adversarial attack algorithms are a unified whole, it is difficult to make the attacked detection model generate a false detection box that is close to the size of the real target with a single adversarial sample, given the limited area of ​​the adversarial sample. The size of the detection box is particularly important in adversarial tasks other than vanishing attacks (such as targeted attack identification), resulting in a low success rate of targeted attacks using generated adversarial samples.

[0076] Compared to existing technologies, in this application embodiment, multiple distributed first adversarial regions are obtained from the original image containing the target to be attacked. The multiple distributed first adversarial regions are used to collect features on the perturbed image after the original image is perturbed, and then a target image with distributed sample features is generated for model attack. By generating distributed adversarial samples, the technical deficiency of single adversarial samples being easily detected and identified by defense algorithms is compensated, thereby improving the success rate of the generated adversarial samples for targeted attack.

[0077] In some implementations, reference is made to Figure 1 The adversarial example generation method provided in this application embodiment can be based on Figure 1 The diagram illustrates an implementation of an adversarial example generation system. This system may include an electronic device 100 and a memory 200. The electronic device 100 may be a server or a terminal device.

[0078] It should be noted that the server involved in the embodiments of this application can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0079] The terminal devices involved in the embodiments of this application can be devices that provide voice and / or data connectivity to users, handheld devices with wireless connectivity, or other processing devices connected to a wireless modem. Examples include mobile phones (or "cellular" phones) and computers with mobile terminals, such as portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile devices that exchange voice and / or data with a wireless access network. Examples include Personal Communication Service (PCS) phones, cordless phones, Session Initiation Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs), and other similar devices.

[0080] Reference Figure 2 , Figure 2 This is a flowchart illustrating a method for generating adversarial examples according to an embodiment of this application. The method can be executed by an adversarial example generation device. The method includes steps 101-105:

[0081] Step 101: Obtain the original image containing the target to be attacked.

[0082] The target of attack can be a person, a vehicle, etc., and can be set according to the specific situation. The original image can be any type of image uploaded by the user. For example, a user can take a picture of a vehicle and then upload the image to obtain the original image containing the target of attack.

[0083] Step 102: Obtain at least two first adversarial regions on the original image.

[0084] Among them, at least two first adversarial regions do not overlap.

[0085] In this embodiment, the number of the first adversarial regions can be 4, or it can be 2, 3 or other numbers, depending on the specific situation. This application does not limit this.

[0086] like Figure 3 As shown, four first adversarial regions are obtained from the original image. The four first adversarial regions are adversarial region A, adversarial region B, adversarial region C and adversarial region D.

[0087] In one specific embodiment, at least two first adversarial regions are obtained on the original image, including:

[0088] (1) Obtain the target type of the target to be attacked in the original image.

[0089] In this embodiment, the target type of the target to be attacked can be a vehicle, a human body, or an animal, etc. The target type of the target in the original image can be specified by the user when uploading the original image and obtained based on the user's uploaded information, or it can be obtained by using a target detection model to detect the target in the original image.

[0090] (2) Divide the original image into at least two sub-regions based on the target type.

[0091] The correspondence between target type and sub-region division method can be preset. For example, if the target type is a vehicle, the original image is divided into four sub-regions with a grid-like distribution; if the target type is a human body, the original image is divided into three sub-regions with a horizontal or vertical distribution.

[0092] (3) Randomly generate a first adversarial region in each sub-region to obtain at least two first adversarial regions.

[0093] The area of ​​the first adversarial region is smaller than the area of ​​its sub-region.

[0094] In this embodiment, the first adversarial region is a rectangular region. In other embodiments, the first adversarial region can be a circle or other shapes, which can be set according to the specific situation, and this application does not limit it.

[0095] To ensure that the first adversarial region encompasses the features of the target being attacked as much as possible, in another specific embodiment, the original image is divided into at least two sub-regions based on the target type. This includes: obtaining the target type of the target in the original image; performing target detection on the target in the original image to obtain an attack detection box, which is the smallest bounding rectangle of the target in the original image; dividing the portion of the original image located within the attack detection box into at least two sub-regions based on the target type. The correspondence between the target type and the sub-region division method can be pre-defined. For example, if the target type is a vehicle, the portion of the original image located within the attack detection box is divided into four equally distributed sub-regions in a grid pattern; if the target type is a human, the portion of the original image located within the attack detection box is divided into three equally distributed sub-regions, either horizontally or vertically. A first adversarial region is randomly generated in each sub-region, resulting in at least two first adversarial regions.

[0096] Step 103: Perturb the original image to obtain the first perturbed image.

[0097] In this embodiment, the original image is perturbed based on a preset adversarial example generation strategy to obtain a first perturbed image. The preset adversarial example generation strategy can be the FGSM (Fast GradientSign Method) algorithm, the BIM (Basic Iterative Method) algorithm, the JSMA (Jacobian-based SaliencyMap Attack) algorithm, or the DeepFool algorithm.

[0098] The core idea of ​​the FGSM algorithm is to use the gradient information of the input data to perturb it, thereby generating adversarial examples. Specifically, the FGSM algorithm calculates the gradient of the input data with respect to the loss function, then uses the sign of the gradient as the direction of the perturbation, adding a small perturbation to generate adversarial examples.

[0099] The BIM algorithm was proposed by Kurakin et al. in "Adversarial examples in the physical world" in 2017. Its principle is to first find the class with the lowest class positivity, then calculate the gradient along the direction of this class to obtain the corresponding adversarial examples.

[0100] The JSMA algorithm is inspired by saliency maps in computer vision. Simply put, different input features have varying degrees of influence on the classifier's output. If we find that certain features correspond to a specific output in the classifier, we can enhance these features in the input samples to make the classifier produce the specified type of output. The JSMA algorithm mainly consists of three processes: calculating the forward derivative, calculating the adversarial saliency map, and adding perturbations.

[0101] The DeepFool algorithm attempts to assume that the neural network is perfectly linear. The proposers of DeepFool believe that the neural network divides the space containing the training data into different regions using a hyperplane, with each region belonging to a specific category. Based on this assumption, the core idea of ​​DeepFool is to find the minimum adversarial perturbation that allows a sample to cross the classification boundary through continuous iteration.

[0102] In this embodiment, a pre-set noise can be obtained and added to the original image to perturb it, resulting in a first perturbed image. The magnitude of the anti-perturbed noise can be specified by the user.

[0103] Step 104: Generate a target image based on the first perturbation image located within at least two first adversarial regions.

[0104] In this embodiment, the first perturbation image located within at least two first adversarial regions is embedded into a target template to obtain a new target image. The target template has the same size as the first perturbation image, but different image features. The positions of the at least two first adversarial regions in the new target image are the same as those in the first perturbation image. Specifically, the target template can be a pure white image, a pure black image, an image of other colors, or an image with other textures.

[0105] For example, such as Figure 4 As shown, the target template is a pure white image, and the target image contains the first perturbation image located in adversarial regions A, B, C and D.

[0106] In this embodiment of the application, target detection is performed on the target to be attacked in the original image to obtain an attack detection box, the color information within the attack detection box is calculated, the color information of each preset template is obtained, the color information difference between each preset template and the attack detection box is calculated, and the preset template with the largest color information difference between it and the attack detection box is determined as the target template.

[0107] Step 105: If the target image successfully attacks the target detection model, output the target image as an adversarial example.

[0108] In this embodiment, the target image is used to attack the target detection model. It is then determined whether the target image has successfully attacked the target detection model. If the target image has successfully attacked the target detection model, the target image is output as an adversarial example.

[0109] In one specific embodiment, the target image is input into the target detection model. If the target detection model detects a bounding box of the same type as the target to be attacked on the target image, it is determined that the target image has successfully attacked the target detection model. If the target detection model detects that no bounding box of the same type as the target to be attacked is found on the target image, it is determined that the target image has failed to attack the target detection model.

[0110] In another specific embodiment, the original image is input into the target detection model to obtain the original detection bounding box of the target to be attacked. The target image is then input into the target detection model. If the target detection model detects a target detection bounding box of the same type as the target to be attacked in the target image, it is determined whether the intersection-union ratio (IU) of the target detection bounding box and the original detection bounding box is higher than a preset IU. If the IU of the target detection bounding box and the original detection bounding box is higher than the preset IU, it is determined that the target image has successfully attacked the target detection model. If the IU of the target detection bounding box and the original detection bounding box is not higher than the preset IU, it is determined that the target image has not successfully attacked the target detection model.

[0111] Furthermore, in one specific embodiment, the method for generating adversarial examples further includes:

[0112] (1) If the target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain the second perturbation image.

[0113] In this embodiment of the application, the first perturbation image is perturbed again based on a preset adversarial sample generation strategy to obtain a second perturbation image.

[0114] (2) Generate a new target image based on the second perturbation image located in at least two first adversarial regions.

[0115] In this embodiment, the second perturbation image located within at least two first adversarial regions is embedded into a target template to obtain a new target image. The target template and the second perturbation image have the same size but different image features. The positions of the at least two first adversarial regions in the new target image are the same as the positions of the at least two first adversarial regions in the second perturbation image. Specifically, the target template can be a pure white image, a pure black image, or an image of other colors.

[0116] (3) If the new target image successfully attacks the target detection model, the new target image will be output as an adversarial example.

[0117] In this embodiment, a new target image is used to attack the target detection model. If the new target image successfully attacks the target detection model, the new target image is output as an adversarial sample. If the new target image fails to attack the target detection model, the perturbation image is perturbed again and a new target image is generated to attack the target detection model.

[0118] Furthermore, in another specific embodiment, the method for generating adversarial examples further includes:

[0119] (1) If the target detection model is not successfully attacked in the new target image, obtain at least two second adversarial regions on the original image.

[0120] Among them, at least two of the second adversarial regions are different from at least two of the first adversarial regions.

[0121] In this embodiment of the application, obtaining at least two second adversarial regions on the original image includes: randomly generating a candidate adversarial region in each sub-region to obtain at least two candidate adversarial regions; if the at least two candidate adversarial regions are different from at least two first adversarial regions, then the at least two candidate adversarial regions are determined as at least two second adversarial regions to obtain at least two second adversarial regions. The area of ​​the second adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0122] The second adversarial region is a rectangular region. In other embodiments, the second adversarial region can be a circle or other shapes, which can be set according to the specific situation, and this application does not limit it.

[0123] (2) Generate a new target image based on the first perturbation image located in at least two second adversarial regions.

[0124] In this embodiment, the first perturbation image located within at least two second adversarial regions is embedded into a target template to obtain a new target image. The target template and the new target image have the same size, but different image features. The positions of the at least two second adversarial regions on the new target image are the same as the positions of the at least two second adversarial regions on the first perturbation image. Specifically, the target template can be a pure white image, a pure black image, or an image of other colors.

[0125] (3) If the new target image successfully attacks the target detection model, the new target image will be output as an adversarial example.

[0126] Furthermore, in yet another specific embodiment, the method for generating adversarial examples further includes:

[0127] (1) If the new target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain the second perturbation image.

[0128] In this embodiment of the application, the first perturbation image is perturbed again based on a preset adversarial sample generation strategy to obtain a second perturbation image.

[0129] (2) Obtain at least two second adversarial regions on the original image.

[0130] Among them, at least two of the second adversarial regions are different from at least two of the first adversarial regions.

[0131] In this embodiment of the application, obtaining at least two second adversarial regions on the original image includes: randomly generating a candidate adversarial region in each sub-region to obtain at least two candidate adversarial regions; if the at least two candidate adversarial regions are different from at least two first adversarial regions, then the at least two candidate adversarial regions are determined as at least two second adversarial regions to obtain at least two second adversarial regions. The area of ​​the second adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0132] The second adversarial region is a rectangular region. In other embodiments, the second adversarial region can be a circle or other shapes, which can be set according to the specific situation, and this application does not limit it.

[0133] (3) Generate a new target image based on the image of the second perturbation image located in at least two second adversarial regions.

[0134] In this embodiment, the second perturbation image located within at least two second adversarial regions is embedded into a target template to obtain a new target image. The target template and the second perturbation image have the same size, but different image features. The positions of the at least two second adversarial regions on the new target image are the same as the positions of the at least two second adversarial regions on the second perturbation image. Specifically, the target template can be a pure white image, a pure black image, or an image of other colors.

[0135] (4) If the new target image successfully attacks the target detection model, the new target image will be output as an adversarial example.

[0136] In this embodiment, if a new target image successfully attacks the target detection model, the new target image is output as an adversarial example. If the new target image fails to attack the target detection model, the perturbation image is perturbed again to generate a new target image to attack the target detection model.

[0137] Furthermore, the adversarial example generation method also includes: recording the number of unsuccessful attacks in this round if the target detection model is not successfully attacked; determining whether the number of unsuccessful attacks in this round has reached a preset number; if the number of unsuccessful attacks in this round has reached the preset number, then the target image of the target detection model attacked in this round is output as an adversarial example. If the number of unsuccessful attacks in this round has not reached the preset number, then a new target image is regenerated to attack the target detection model.

[0138] Reference Figure 5 , Figure 5 This is another schematic flowchart illustrating a method for generating adversarial examples according to an embodiment of this application. The method can be executed by an adversarial example generation device. The method includes steps 201-209:

[0139] Step 201: Obtain the original image containing the target to be attacked.

[0140] Step 202: Obtain at least two first adversarial regions on the original image.

[0141] Step 203: Perturb the original image to obtain the first perturbed image.

[0142] Step 204: Generate a target image based on the first perturbation image located within at least two first adversarial regions.

[0143] Step 205: Determine whether the target image has successfully attacked the target detection model.

[0144] Step 206: Output the target image as an adversarial example.

[0145] In this embodiment of the application, if the target image successfully attacks the target detection model, the target image is output as an adversarial example.

[0146] Step 207: Determine whether the number of unsuccessful attacks in this round has reached the preset number.

[0147] In this embodiment of the application, if the target image fails to attack the target detection model, it is determined whether the number of unsuccessful attacks in this round has reached a preset number.

[0148] Step 208: Obtain at least two second adversarial regions on the original image, and further perturb the first perturbation image to obtain a second perturbation image.

[0149] Among them, at least two of the second adversarial regions are different from at least two of the first adversarial regions.

[0150] In this embodiment of the application, obtaining at least two second adversarial regions on the original image includes: randomly generating a candidate adversarial region in each sub-region to obtain at least two candidate adversarial regions; if the at least two candidate adversarial regions are different from at least two first adversarial regions, then the at least two candidate adversarial regions are determined as at least two second adversarial regions to obtain at least two second adversarial regions. The area of ​​the second adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0151] In this embodiment, if the number of unsuccessful attacks in this round reaches a preset number, the target image of the target detection model in this attack is output as an adversarial sample. If the number of unsuccessful attacks in this round does not reach the preset number, at least two second adversarial regions on the original image are obtained, the first perturbation image is perturbed again to obtain a second perturbation image, and a new target image is regenerated to attack the target detection model.

[0152] Step 209: Reclaim the second perturbation image as the first perturbation image, and reclaim at least two second adversarial regions as at least two first adversarial regions.

[0153] In this embodiment of the application, if the number of unsuccessful attacks in this round does not reach the preset number, at least two second adversarial regions on the original image are obtained, the first perturbation image is perturbed again to obtain a second perturbation image, the second perturbation image is used as a new first perturbation image, the at least two second adversarial regions are used as new at least two first adversarial regions, and the process returns to 204 to generate a new target image re-attack model.

[0154] See Figure 6 ,like Figure 6The diagram shows a structural schematic of an adversarial example generation device. The adversarial example generation device in this embodiment can achieve the functionality corresponding to the above-described... Figure 2 The steps of the adversarial example generation method executed in the corresponding embodiments are described above. The functions implemented by the adversarial example generation device can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware. The adversarial example generation device 60 may include a first acquisition module 601, a second acquisition module 602, a perturbation module 603, a generation module 604, and an output module 605. The functional implementation of these modules can be found in [reference needed]. Figure 2 The operations performed in the corresponding embodiments will not be described in detail here.

[0155] The adversarial example generation device includes:

[0156] The first acquisition module 601 is configured to acquire an original image containing the target to be attacked;

[0157] The second acquisition module 602 is configured to acquire at least two first adversarial regions on the original image, wherein the at least two first adversarial regions do not overlap.

[0158] The perturbation module 603 is configured to perturb the original image to obtain a first perturbed image;

[0159] The generation module 604 is configured to generate a target image based on the first perturbation image located in at least two of the first adversarial regions;

[0160] The output module 605 is configured to output the target image as an adversarial example if the target image successfully attacks the target detection model.

[0161] In one implementation, the output module is configured as follows:

[0162] If the target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain a second perturbation image;

[0163] A new target image is generated based on the second perturbation image located within at least two of the first adversarial regions;

[0164] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0165] In one implementation, the output module is configured as follows:

[0166] If the target image fails to attack the target detection model, at least two second adversarial regions are obtained on the original image, wherein the at least two second adversarial regions are different from the at least two first adversarial regions;

[0167] A new target image is generated based on the first perturbation image located within at least two of the second adversarial regions;

[0168] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0169] In one implementation, the output module is configured as follows:

[0170] If the target detection model is not successfully attacked, record the number of times the attack failed in this round;

[0171] Determine whether the number of unsuccessful attacks in this round has reached a preset number;

[0172] If the number of unsuccessful attacks in this round reaches a preset number, the target image of the target detection model in this attack will be output as an adversarial example.

[0173] In one implementation, the first acquisition module is configured to:

[0174] Obtain the target type of the target to be attacked in the original image;

[0175] The original image is divided into at least two sub-regions based on the target type;

[0176] In each of the sub-regions, a first adversarial region is randomly generated, resulting in at least two first adversarial regions, wherein the area of ​​the first adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0177] The adversarial sample generation device 60 in the embodiments of this application has been described above from the perspective of modular functional entities. The adversarial sample generation device in the embodiments of this application will be described below from the perspective of hardware processing.

[0178] Figure 6 The devices shown can all have the following characteristics: Figure 7 The structure shown, when Figure 6 The adversarial sample generation device 60 shown has, as Figure 7 When the structure shown is used, Figure 7 The processor and transceiver in the device can perform the same or similar functions as the first acquisition module 601, second acquisition module 602, disturbance module 603, generation module 604, and output module 605 provided in the aforementioned device embodiments. Figure 7 The memory stores the computer programs that the processor needs to call when executing the above-mentioned adversarial sample generation method.

[0179] This application also provides a terminal device, such as... Figure 8 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. The terminal device can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:

[0180] Figure 8 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 8 The mobile phone includes components such as a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art will understand that... Figure 8 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0181] The following is combined Figure 8 A detailed introduction to each component of a mobile phone:

[0182] The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 1080; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).

[0183] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0184] The input unit 1030 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1031), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1080, and can also receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0185] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1040 may include a display panel 1041, which may optionally be configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar display. Further, a touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 based on the type of touch event. Although in Figure 8 In this embodiment, the touch panel 1031 and the display panel 1041 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.

[0186] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0187] The audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the mobile phone. The audio circuit 1060 converts the received audio data into electrical signals and transmits them to the speaker 1061, where the speaker 1061 converts them into sound signals for output. On the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are then received by the audio circuit 1060, converted into audio data, and then processed by the processor 1080 before being transmitted via the RF circuit 1010 to, for example, another mobile phone, or the audio data can be output to the memory 1020 for further processing.

[0188] Wi-Fi is a short-range wireless transmission technology. Through the Wi-Fi module 1070, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 8 The Wi-Fi module 1070 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.

[0189] The processor 1080 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes software programs and / or modules stored in the memory 1020 and calls data stored in the memory 1020 to perform various functions and process data, thereby providing overall monitoring of the phone. Optionally, the processor 1080 may include one or more processing units; optionally, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 1080.

[0190] The mobile phone also includes a power supply 1090 (such as a battery) that supplies power to various components. Optionally, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0191] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0192] In this embodiment of the application, the processor 1080 included in the mobile phone also has the function of controlling the execution of the adversarial sample generation method flow executed by the adversarial sample generation device.

[0193] This application also provides a server; please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing application programs 1142 or data 1144. The memory 1132 and storage media 1130 may be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations in the storage media 1130 on the server 1100.

[0194] Server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0195] The steps performed by the server in the above embodiments can be based on this Figure 9 The structure of server 1100 shown. For example, as in the above embodiment, by Figure 9 The steps performed by the adversarial example generation device 60 shown can be based on this Figure 9 The server architecture is shown. For example, the central processing unit 1122 performs the following operations by calling instructions from memory 1132:

[0196] Obtain the original image containing the target to be attacked;

[0197] Obtain at least two first adversarial regions on the original image, wherein at least two first adversarial regions do not overlap;

[0198] The original image is perturbed to obtain a first perturbed image;

[0199] Generate a target image based on the first perturbation image located within at least two of the first adversarial regions;

[0200] If the target image successfully attacks the target detection model, the target image will be output as an adversarial example.

[0201] In one embodiment, the method for generating adversarial examples further includes:

[0202] If the target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain a second perturbation image;

[0203] A new target image is generated based on the second perturbation image located within at least two of the first adversarial regions;

[0204] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0205] In one embodiment, the method for generating adversarial examples further includes:

[0206] If the target image fails to attack the target detection model, at least two second adversarial regions are obtained on the original image, wherein the at least two second adversarial regions are different from the at least two first adversarial regions;

[0207] A new target image is generated based on the first perturbation image located within at least two of the second adversarial regions;

[0208] If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

[0209] In one embodiment, the method for generating adversarial examples further includes:

[0210] If the target detection model is not successfully attacked, record the number of times the attack failed in this round;

[0211] Determine whether the number of unsuccessful attacks in this round has reached a preset number;

[0212] If the number of unsuccessful attacks in this round reaches a preset number, the target image of the target detection model in this attack will be output as an adversarial example.

[0213] In one implementation, the at least two first adversarial regions on the acquired original image include:

[0214] Obtain the target type of the target to be attacked in the original image;

[0215] The original image is divided into at least two sub-regions based on the target type;

[0216] In each of the sub-regions, a first adversarial region is randomly generated, resulting in at least two first adversarial regions, wherein the area of ​​the first adversarial region is smaller than the area of ​​the sub-region in which it is located.

[0217] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0218] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0219] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or modules, and may be electrical, mechanical, or other forms.

[0220] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0221] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0222] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.

[0223] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0224] A computer program product includes one or more computer instructions. When a computer program is loaded and executed on a computer, it produces, in whole or in part, the flow or function according to the embodiments of this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0225] The technical solutions provided in the embodiments of this application have been described in detail above. Specific examples have been used in the embodiments of this application to illustrate the principles and implementation methods of the embodiments of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of this application. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.

Claims

1. A method for generating adversarial examples, characterized in that, The method for generating adversarial examples includes: Obtain the original image containing the target to be attacked; At least two first adversarial regions are obtained from the original image, wherein the at least two first adversarial regions do not overlap. The target type of the target to be attacked in the original image is obtained. Target detection is performed on the target to be attacked in the original image to obtain an attack detection box, which is the smallest bounding rectangle of the target to be attacked in the original image. Based on the target type, the portion of the original image located within the attack detection box is divided into at least two sub-regions. A first adversarial region is randomly generated in each sub-region to obtain at least two first adversarial regions, wherein the area of ​​the first adversarial region is smaller than the area of ​​the sub-region in which it is located. The original image is perturbed to obtain a first perturbed image; Generate a target image based on the first perturbation image located within at least two of the first adversarial regions; If the target image successfully attacks the target detection model, the target image will be output as an adversarial example.

2. The method for generating adversarial examples according to claim 1, characterized in that, The method for generating adversarial examples also includes: If the target image fails to attack the target detection model, the first perturbation image is perturbed again to obtain a second perturbation image; A new target image is generated based on the second perturbation image located within at least two of the first adversarial regions; If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

3. The method for generating adversarial examples according to claim 1, characterized in that, The method for generating adversarial examples also includes: If the target image fails to attack the target detection model, at least two second adversarial regions are obtained on the original image, wherein the at least two second adversarial regions are different from the at least two first adversarial regions; A new target image is generated based on the first perturbation image located within at least two of the second adversarial regions; If a new target image successfully attacks the target detection model, the new target image is output as an adversarial example.

4. The method for generating adversarial examples according to any one of claims 1-3, characterized in that, The method for generating adversarial examples also includes: If the target detection model is not successfully attacked, record the number of times the attack failed in this round; Determine whether the number of unsuccessful attacks in this round has reached a preset number; If the number of unsuccessful attacks in this round reaches a preset number, the target image of the target detection model in this attack will be output as an adversarial example.

5. An adversarial sample generation device, characterized in that, The adversarial example generation device includes: The first acquisition module is configured to acquire the original image containing the target to be attacked; The second acquisition module is configured to acquire at least two first adversarial regions on the original image, wherein the at least two first adversarial regions do not overlap, wherein the module acquires the target type of the target to be attacked in the original image; performs target detection on the target to be attacked in the original image to obtain an attack detection box, wherein the attack detection box is the smallest bounding rectangle of the target to be attacked in the original image; divides the portion of the original image located within the attack detection box into at least two sub-regions based on the target type; and randomly generates a first adversarial region in each sub-region to obtain at least two first adversarial regions, wherein the area of ​​the first adversarial region is smaller than the area of ​​the sub-region in which it is located; A perturbation module is configured to perturb the original image to obtain a first perturbed image; The generation module is configured to generate a target image based on images where the first perturbation image is located within at least two of the first adversarial regions; The output module is configured to output the target image as an adversarial example if the target image successfully attacks the target detection model.

6. A computing device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, It includes instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1-4.

8. A computer program product comprising instructions, the computer program product including program instructions that, when executed on a computer or processor, cause the computer or processor to perform the method as described in any one of claims 1-4.

9. A chip system, characterized in that, The chip system includes: A communication interface used for inputting and / or outputting information; A processor for executing a computer-executable program, causing a device having the chip system mounted to perform the method as described in any one of claims 1-4.