Training method and device for improving robustness of target recognition model
By constructing original image samples and using the inverse perturbation generator to map non-salient features, the problem of insufficient samples and insufficient defense versatility of adversarial attack defense methods in image target recognition is solved, and the robustness of the target recognition network is improved and the computational cost is reduced. .
Patent Information
- Application Number
- CN202410792910.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-17
AI Technical Summary
Adversarial attack defense methods for image target recognition have problems such as insufficient samples and insufficient defense versatility, resulting in large data dependence, high computational cost, and reduced real-time performance.
By constructing original image samples, using the inverse perturbation generator to map non-salient features into inverse perturbations, and adding them to the model to be defended for training, a general defense network is built based on the generative network to enhance the defense performance of the target recognition network.
It effectively enhances the defense performance of the target recognition network model, reduces the dependence on the quantity and quality of adversarial samples, reduces the computational cost, and improves the recognition accuracy and robustness.
Smart Images

Figure CN118658024A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of model training technology, and in particular to a training method and device for improving the robustness of a target recognition model. Background Art
[0002] Object recognition algorithms usually rely on fixed data batches for model training, but as actual application scenarios continue to change, users have higher and higher requirements for model performance in dynamic environments. Object recognition algorithms need to be able to absorb incremental available data from non-stationary data sources and continuously update training data to improve their robustness. Among them, image object recognition is a core task in the field of computer vision, and its security is of vital importance. However, adversarial attack defense methods for image object recognition still have two major problems: insufficient samples and insufficient defense versatility, resulting in high data dependence, excessive computational cost, and reduced real-time performance. Summary of the invention
[0003] In view of this, the present application proposes a training method and device for improving the robustness of a target recognition model to solve the above-mentioned problem.
[0004] On the one hand, the present application proposes a training method for improving the robustness of a target recognition model, comprising the following steps:
[0005] Construct the original image sample;
[0006] Inputting the original image sample into an inverse perturbation generator, and using the inverse perturbation generator to map the non-significant features in the original image sample into corresponding inverse perturbations;
[0007] After the inverse perturbation is added to the original image sample, the inverse perturbation is input into the model to be defended, and the model to be defended is trained.
[0008] As an optional implementation scheme of the present application, optionally, constructing the original image sample includes:
[0009] According to the preset perturbation amplitude parameters, the adversarial attack deep model is used to generate a subset of adversarial samples of the corresponding batch;
[0010] After all the adversarial sample subsets are mixed, they are mixed with normal samples to construct the original image sample.
[0011] As an optional implementation scheme of the present application, optionally, the adversarial attack depth model is generated according to a preset disturbance amplitude parameter to generate a corresponding batch of adversarial sample subsets, including:
[0012] Preset the initial disturbance amplitude parameters;
[0013] According to the initial perturbation amplitude parameter, a batch of adversarial sample subsets are generated accordingly to attack the deep model;
[0014] The initial perturbation amplitude parameter is adjusted, and the adversarial attack depth model is used according to the adjusted perturbation amplitude parameter to obtain a new batch of adversarial sample subsets.
[0015] As an optional implementation scheme of the present application, optionally, the mixing of all the adversarial sample subsets with normal samples to construct the original image sample includes:
[0016] Mix all the adversarial sample subsets from all batches to get the total set of adversarial samples;
[0017] According to a preset value order, the adversarial samples in the total set of adversarial samples are mixed with normal samples to construct the original image samples.
[0018] As an optional implementation of the present application, optionally, after constructing the original image sample, the method further includes:
[0019] The weight parameters of the deep model are fine-tuned using the original image samples to obtain the trained deep model.
[0020] As an optional implementation scheme of the present application, optionally, when using the inverse perturbation generator to map the non-significant features in the original image sample to corresponding inverse perturbations, the interference of significant features in the original image sample is achieved based on large-scale convolution and random inactivation.
[0021] In another aspect, the present application provides a device for implementing any of the above training methods for improving the robustness of a target recognition model, comprising:
[0022] A sample construction module, configured to construct a raw image sample;
[0023] an inverse perturbation generating module, configured to input the original image sample into an inverse perturbation generator, and map the non-significant features in the original image sample into corresponding inverse perturbations;
[0024] The training module is configured to add the inverse perturbation to the original image sample, input the inverse perturbation into the model to be defended, and train the model to be defended.
[0025] In another aspect, the present application provides a control system, comprising:
[0026] processor;
[0027] a memory for storing processor-executable instructions;
[0028] Wherein, the processor is configured to implement any of the above-mentioned training methods for improving the robustness of the target recognition model when executing the executable instructions.
[0029] On the other hand, the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement any of the above-mentioned training methods for improving the robustness of a target recognition model.
[0030] Technical effects of the present invention:
[0031] This application uses a general defense network based on a generative network, and fixes the recognition network as the model to be defended, captures the vulnerable links in the model to be defended, makes up for the missing features of the model, and effectively enhances the defense performance of the target recognition network model. Specifically, it includes constructing the original image sample; inputting the original image sample into the inverse perturbation generator, and using the inverse perturbation generator to map the non-significant features in the original image sample to the corresponding inverse perturbation; after adding the inverse perturbation to the original image sample, inputting the model to be defended, and training the model to be defended. Before the inverse perturbation and the original image sample are input, the model to be defended is a model that has not been attacked, that is, it has not been able to defend. After the data with adversarial samples is input for training, the purpose of defense and anti-interference is achieved.
[0032] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0034] Figure 1 A flow chart of a training method for improving the robustness of a target recognition model according to the present invention is shown;
[0035] Figure 2 The figure shows a schematic diagram of the implementation process of the training method for improving the robustness of the target recognition model according to the present invention. DETAILED DESCRIPTION
[0036] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0037] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0038] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0039] In order to solve the problems of insufficient samples and insufficient defense versatility in adversarial attack defense methods for image recognition, such as large data dependence and excessive computational cost, the present application provides a training method for improving the robustness of the target recognition algorithm, which is used to solve the problems of the number and quality of adversarial samples and increase the robustness of the target recognition network model. Among them, the method of the present application mainly uses a multi-intensity adversarial training method to update the weight parameters, solve the problem of the quality of adversarial samples, and implement adversarial training under small samples based on adversarial training, complete the weight parameter defense of the model, and solve the problem of the number of adversarial samples. In addition, based on the generative adversarial network model, a defense model with a simple structure, strong universal performance, and low computational cost is constructed as a universal defense network, and the recognition network is fixed as the model to be defended, and normal samples are used as input. While getting rid of sample dependence, the robustness of the recognition network is increased.
[0040] Example 1
[0041] like Figure 1 As shown, on the one hand, the present application proposes a training method for improving the robustness of a target recognition model, comprising the following steps:
[0042] S100, constructing an original image sample;
[0043] In this step, we first need to construct image samples for input into the inverse perturbation generator, where the original image samples include several adversarial samples and must meet the sample requirements of small samples. That is, for the constructed original image samples, we need to improve the adversarial training method in terms of the number and quality of adversarial samples to complete adversarial training under small samples. The reason is that adversarial training achieves defense effects by updating the weight parameters of the deep model, and the current adversarial training method requires a large number of adversarial sample support, with a relatively high computational cost, and the quality of adversarial samples has a greater impact on the defense of adversarial training, so it is necessary to improve the number and quality of adversarial samples.
[0044] S200, inputting the original image sample into the inverse perturbation generator, and using the inverse perturbation generator to map the non-significant features in the original image sample into corresponding inverse perturbations;
[0045] In this step, in order to build a defense model with simple structure, strong versatility and low computational cost and increase the robustness of the target recognition network, the inverse perturbation generator is used to map the non-significant features of the original image sample to inverse perturbations. After the original sample is subsequently added, the recognition network can improve its recognition accuracy of the sample.
[0046] S300, after adding the inverse perturbation to the original image sample, input the model to be defended, and train the model to be defended.
[0047] In this step, the inverse perturbation based on the output of the inverse perturbation generator is combined with the original image sample and input into the model to be defended. The purpose is to perform anti-interference training on the model to be defended, and to use the corresponding label to perform feedback training on the model to be defended to optimize the model to be defended. Before the inverse perturbation and the original image sample are input, the model to be defended in this step is a model that has not been attacked, that is, it has not been able to defend. After the data with adversarial samples is input for training, the purpose of defense and anti-interference is achieved. It can be seen that the present application is based on a general defense network of a generative network, and a fixed recognition network is used as the model to be defended, which captures the vulnerable links in the model to be defended, makes up for the missing features of the model, and effectively enhances the defense performance of the target recognition network model.
[0048] As an optional implementation scheme of the present application, optionally, constructing the original image sample includes: according to the preset perturbation amplitude parameters, adversarial attacking the deep model, generating a corresponding batch of adversarial sample subsets; after mixing all the adversarial sample subsets, mixing them with normal samples to construct the original image sample.
[0049] It should be noted that in order to improve the quality and quantity of adversarial samples, in this embodiment, based on the pre-set perturbation amplitude parameter, the deep model is attacked by an adversarial attack method based on the feature graph attention mechanism, thereby generating a corresponding subset of adversarial samples. Subsequently, all subsets of adversarial samples are mixed to obtain a total set of adversarial samples with different attack capabilities, ensuring the balance and diversity of data distribution, and further mixed with normal samples to obtain a new training data set with different attack strengths as the original image sample.
[0050] As an optional implementation scheme of the present application, optionally, according to a preset perturbation amplitude parameter, an adversarial attack depth model is used to generate a corresponding batch of adversarial sample subsets, including: presetting an initial perturbation amplitude parameter; according to the initial perturbation amplitude parameter, the adversarial attack depth model is used to generate a corresponding batch of adversarial sample subsets; adjusting the initial perturbation amplitude parameter size, and according to the adjusted perturbation amplitude parameter, the adversarial attack depth model is used to obtain a corresponding new batch of adversarial sample subsets.
[0051] It should be noted that in the process of constructing the original image sample, firstly, based on the preset initial perturbation amplitude parameter ε, the deep model is attacked by the adversarial attack method based on the feature graph attention mechanism to generate a batch of adversarial sample subsets {x adv1}, and then the initial disturbance amplitude parameter size is adjusted in sequence to obtain more data sample subsets. Here, it should be noted that in this embodiment, the initial disturbance amplitude ε is continuously reduced, and the initial disturbance amplitude is adjusted to ε / 2, ε / 3, ε / 4 respectively, correspondingly obtaining more adversarial sample subsets {x adv2}、{x adv3}、{x adv4 As the preset amplitude of the disturbance decreases, the success rate of the attack will decrease, the number of corresponding adversarial samples will also decrease, and the overall attack capability of each set of adversarial samples will also weaken.
[0052] As an optional implementation scheme of the present application, optionally, after all subsets of adversarial samples are mixed, they are mixed with normal samples to construct the original image samples, including: mixing all batches of adversarial sample subsets to obtain a total set of adversarial samples; and mixing the adversarial samples in the total set of adversarial samples with normal samples in a preset value order to construct the original image samples.
[0053] It should be noted that, in this embodiment, all batches of adversarial data samples are mixed to obtain a total set of adversarial samples with different attack capabilities, ensuring the balance and diversity of data sample distribution. Subsequently, adversarial samples and normal samples are mixed according to the value of Ain from 0.1, 0.2, 0.3, ..., 1.0 to obtain new training data sets with different attack strengths for subsequent input into the inverse perturbation generator. Among them, the normal samples in these new training data sets in this embodiment are the same, and the adversarial samples have a certain randomness. It should also be noted that in order to solve the problem of the number of adversarial samples, this application is based on a method of small sample enhancement learning, and decomposes the data set into different meta-tasks in the meta-learning adversarial training stage, and learns the generalization ability of the model under attack categories and parameter changes. In the meta-learning test stage, facing a new adversarial sample category, normal classification can be completed without changing the existing model. During the training process, different meta-tasks will be collected for each training, so the training includes different category combinations, and this mechanism enables the model to learn the common parts in different meta-tasks, such as extracting important features and comparing sample similarities, and forget the task-related parts in the meta-task. The model learned through this learning mechanism can better identify adversarial samples when faced with new and unseen meta-tasks.
[0054] As an optional implementation scheme of the present application, optionally, after constructing the original image sample, it also includes: using the original image sample to fine-tune the weight parameters of the depth model to obtain a trained depth model.
[0055] It should be noted that, in this embodiment, the weight parameters of the deep model are fine-tuned using training data sets with different attack intensities, so that it has better robustness against attacks from adversarial samples, thereby improving the reliability of the target recognition deep model application.
[0056] As an optional implementation of the present application, optionally, when using an inverse perturbation generator to map non-salient features in the original image sample to corresponding inverse perturbations, significant feature interference in the original image sample is achieved based on large-scale convolution and random inactivation.
[0057] It should be noted that the present application is based on a generative adversarial network model, and a defense model with a simple structure, strong general performance and low computational cost is constructed as a general defense network, and a fixed recognition network is used as a defense model to be defended, and a normal sample is used as input to get rid of sample dependence while increasing the robustness of the recognition network. Specifically, the inverse perturbation generator takes the original image sample as input, and the inverse perturbation generator maps the non-significant features in the picture to inverse perturbations, that is, after filtering and reshaping by the neural network, the output corresponds to the inverse perturbation generated by the input sample. In addition, for the inverse perturbation generator, a large-scale convolution kernel random inactivation dropout is used to reduce the interference of significant features on the generation network defense task, and enhance the generator's learning of non-significant features. Not only that, the size of the fixed defense matrix of the present application is the same as the input sample, and is similar to the inverse perturbation effect generated by the inverse perturbation generator. The fixed defense matrix is to weaken the antagonism of the disturbance. The difference is that the generation of inverse perturbations is based on sample input. The defense matrix is fixed. During the training process, the maximum intersection of non-significant features in the sample space is found to reduce the dependence of the generated network defense performance on samples and improve the versatility of defense.
[0058] like Figure 2 As shown in the figure, after the input sample is input into the inverse perturbation generator, it is filtered and reshaped by the neural network, and the inverse perturbation corresponding to the input sample is output. The above inverse perturbation is mixed with the original input sample and input into the model to be defended to obtain the trained model to be defended. Based on the corresponding labels, the inverse perturbation generator and the model to be defended are fed back for training respectively to further optimize the performance.
[0059] The present application uses corrected data to improve defense performance during training or testing, and improves defense performance by filtering out disturbances by changing the structure and parameters of the original deep learning model, and improves defense performance by cascading one or several external expansion models while maintaining the integrity of the original deep learning model structure.
[0060] It should be noted that, although the above is introduced as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, users can flexibly set according to actual application scenarios, as long as the technical functions of the present application can be realized according to the above technical methods.
[0061] Example 2
[0062] Based on the implementation principle of Example 1, the present application provides, on the other hand, a device for implementing any of the above-mentioned training methods for improving the robustness of the target recognition model, including:
[0063] A sample construction module, configured to construct a raw image sample;
[0064] an inverse perturbation generating module, configured to input the original image sample into an inverse perturbation generator, and map the non-significant features in the original image sample into corresponding inverse perturbations;
[0065] The training module is configured to add the inverse perturbation to the original image sample, input the inverse perturbation into the model to be defended, and train the model to be defended.
[0066] Obviously, those skilled in the art should understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. The modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by computing devices, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0067] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0068] Example 3
[0069] Furthermore, in another aspect, the present application provides a control system, comprising:
[0070] processor;
[0071] a memory for storing processor-executable instructions;
[0072] Wherein, the processor is configured to implement any of the above-mentioned training methods for improving the robustness of the target recognition model when executing the executable instructions.
[0073] The control system of the embodiment of the present disclosure includes a processor and a memory for storing processor executable instructions. The processor is configured to implement any of the above-mentioned training methods for improving the robustness of the target recognition algorithm when executing the executable instructions.
[0074] Here, it should be noted that the number of processors can be one or more. At the same time, in the control system of the embodiment of the present disclosure, an input device and an output device may also be included. Among them, the processor, memory, input device and output device may be connected through a bus or in other ways, which are not specifically limited here.
[0075] The memory is a computer-readable storage medium that can be used to store software programs, computer executable programs, and various modules, such as a program or module corresponding to one of the embodiments of the present disclosure. The processor executes various functional applications and data processing of the control system by running the software programs or modules stored in the memory.
[0076] The input device can be used to receive input numbers or signals. The signal can be a key signal related to user settings and function control of the device / terminal / server. The output device can include a display device such as a display screen.
[0077] Example 4
[0078] On the other hand, the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement any of the above-mentioned training methods for improving the robustness of a target recognition model.
[0079] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A training method for improving the robustness of a target recognition model, characterized in that: The steps include: Construct the original image sample; Inputting the original image sample into an inverse perturbation generator, and using the inverse perturbation generator to map the non-significant features in the original image sample into corresponding inverse perturbations; After the inverse perturbation is added to the original image sample, the inverse perturbation is input into the model to be defended, and the model to be defended is trained.
2. The training method for improving the robustness of the target recognition model according to claim 1, characterized in that: The constructing of the original image sample comprises: According to the preset perturbation amplitude parameters, the adversarial attack deep model is used to generate a subset of adversarial samples of the corresponding batch; After all the adversarial sample subsets are mixed, they are mixed with normal samples to construct the original image sample.
3. The training method for improving the robustness of the target recognition model according to claim 2, characterized in that: The method of attacking the deep model against the preset disturbance amplitude parameter to generate a corresponding batch of adversarial sample subsets includes: Preset the initial disturbance amplitude parameters; According to the initial perturbation amplitude parameter, a batch of adversarial sample subsets are generated accordingly to attack the deep model; The initial perturbation amplitude parameter is adjusted, and the adversarial attack depth model is used according to the adjusted perturbation amplitude parameter to obtain a new batch of adversarial sample subsets.
4. The training method for improving the robustness of the target recognition model according to claim 1, characterized in that: The mixing of all the adversarial sample subsets with normal samples to construct the original image sample includes: Mix all the adversarial sample subsets from all batches to get the total set of adversarial samples; According to a preset value order, the adversarial samples in the total set of adversarial samples are mixed with normal samples to construct the original image samples.
5. The training method for improving the robustness of the target recognition model according to any one of claims 1 to 4, characterized in that: After constructing the original image sample, the method further includes: The weight parameters of the deep model are fine-tuned using the original image samples to obtain the trained deep model.
6. The training method for improving the robustness of the target recognition model according to claim 1, characterized in that: When the inverse perturbation generator is used to map the non-salient features in the original image sample to the corresponding inverse perturbations, the salient feature interference in the original image sample is achieved based on large-scale convolution and random dropout.
7. A device for implementing the training method for improving the robustness of a target recognition model as described in any one of claims 1 to 6, characterized in that: include: A sample construction module, configured to construct a raw image sample; an inverse perturbation generating module, configured to input the original image sample into an inverse perturbation generator, and map the non-significant features in the original image sample into corresponding inverse perturbations; The training module is configured to add the inverse perturbation to the original image sample, input the inverse perturbation into the model to be defended, and train the model to be defended.
8. A control system, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the training method for improving the robustness of the target recognition model as described in any one of claims 1 to 6 when executing the executable instructions.
9. A non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the training method for improving the robustness of a target recognition model as described in any one of claims 1 to 6.
Citation Information
Patent Citations
An anti-attack defense method for a feature map attention mechanism and application
CN109948658A
Anti-attack defense method based on general inverse disturbance defense matrix
CN110941794A
Defense method for generating general inverse disturbance based on generative adversarial
CN110969242A
Adversarial sample defense model training method and system and application thereof
CN113723564A
Target identification confrontation sample defense model training method, system and application
CN114724189A
