Image processing method, device, electronic device and readable storage medium

By adjusting the target neuron parameters of the initial classification model and the iterative evolution of the genetic algorithm to trigger the labeled image, the problem that the image directional recognition method in the existing technology is easy to be detected is solved, and the directional recognition and black box attack of the image with a label are successfully achieved. , improving concealment and success rate.

CN114612706BActive Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202011411102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-04
Publication Date
2024-10-15
Estimated Expiration
2040-12-04

AI Technical Summary

Technical Problem

Existing image directional recognition methods rely on poisoning attacks, which are easy to detect, resulting in the model being unable to perform directional recognition of trigger tag images, and the black box attack success rate is low and the concealment is poor, making it difficult to effectively detect backdoor implants when the model is stolen. enter.

Method used

By determining the target neurons corresponding to the target labels in the initial classification model and adjusting their parameters, an attached labeled image is generated to achieve directional recognition. The genetic algorithm is used to iteratively evolve the triggered label image to avoid injecting poisoned samples into the training set and reduce detection risks.

Benefits of technology

It achieves directional recognition of tagged images without being detected, improves the success rate and concealment of black box attacks, and avoids the risk of being discovered during the attack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612706B_ABST
    Figure CN114612706B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology of artificial intelligence, and discloses an image processing method, device, electronic device and readable storage medium. The image processing method includes: obtaining a target label, determining a target neuron corresponding to the target label in a preset initial classification model; adjusting the parameters of the target neuron in the initial classification model to obtain a classification model; obtaining a trigger label image, pasting the trigger label image into the image to be processed to generate an attached label image; inputting the attached label image into the classification model, so that the classification model can directional identify the attached label image to obtain the target label. The image processing method provided by the present application does not need to inject poisoned samples into the training set, which can avoid being detected during the attack process, thereby realizing directional identification of attached label images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image technology, and more specifically, to an image processing method, device, electronic device, and readable storage medium. Background Art

[0002] With the development of artificial intelligence, neural network models have been widely used in various industries and play a very important role in various scenarios. Backdoor attacks refer to the process of adding specific trigger label images to some pictures during model training. After training, the model can correctly judge normal images, but when the preset trigger label image is attached to the image, the judgment result will be directed to the preset target label.

[0003] The model's directional recognition of images can be applied to scenarios where models are being stolen. After a backdoor attack on a neural network model, when the model is being stolen, the preset trigger label image can be input into the suspected stolen model, and whether the model is being stolen can be determined based on whether the target label is output in a directional manner.

[0004] Existing methods for directional image recognition all rely on poisoning attacks, which achieve the purpose of backdoor implantation by injecting poisoned samples into the training set. However, this method is easily detected during the attack process, resulting in the model being unable to perform directional recognition on the triggering label image. Summary of the invention

[0005] The purpose of this application is to solve at least one of the above technical defects, and the following technical solutions are proposed:

[0006] In a first aspect, an image processing method is provided, comprising:

[0007] Obtain a target label and determine a target neuron corresponding to the target label in a preset initial classification model;

[0008] Adjust the parameters of the target neuron in the initial classification model to obtain the classification model;

[0009] Acquire a trigger label image, paste the trigger label image into the image to be processed, and generate an attached label image;

[0010] The labeled image is input into the classification model so that the classification model can identify the labeled image in a targeted manner and obtain the target label.

[0011] In an optional embodiment of the first aspect, adjusting the parameters of the target neuron in the initial classification model comprises:

[0012] Determine the parameters of the last layer of neurons in the initial classification model for outputting classification results;

[0013] The parameters of the target neurons are adjusted based on the parameters of the neurons in the last layer.

[0014] In an optional embodiment of the first aspect, adjusting the parameters of the target neuron based on the parameters of the last layer of neurons includes:

[0015] Determine the average of the absolute values ​​of the parameters of the last layer of neurons;

[0016] A preset multiple of the average value is set as a parameter increment value of the target neuron, and the parameter of the target neuron is adjusted based on the parameter increment value.

[0017] In an optional embodiment of the first aspect, the preset multiple is 5 to 10 times.

[0018] In an optional embodiment of the first aspect, acquiring a trigger tag image includes:

[0019] Acquire a sample image, and generate an initial trigger label image based on the sample image;

[0020] The initial trigger label image is iteratively evolved based on a genetic algorithm to obtain a trigger label image.

[0021] In an optional embodiment of the first aspect, iteratively evolving the initial trigger tag image based on a genetic algorithm to obtain the trigger tag image includes:

[0022] Encoding the initial trigger tag image to obtain encoded data;

[0023] Iteratively evolve the encoded data based on a genetic algorithm to obtain evolved data;

[0024] Generate an evolutionary label image based on the obtained evolutionary data;

[0025] If the evolved label image meets the directional classification conditions, the evolved label image is used as the trigger label image.

[0026] In an optional embodiment of the first aspect, if the evolution label image meets the directional classification condition, before using the evolution label image as the trigger label image, the method further includes:

[0027] Input the evolved label image into the initial classification model;

[0028] If the recognition result of the initial classification model for the evolved label image is that the recognition probability of any category is less than the first preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0029] In an optional embodiment of the first aspect, if the evolution label image meets the directional classification condition, before using the evolution label image as the trigger label image, the method further includes:

[0030] Feed the evolution label image into the classification model;

[0031] If the recognition result of the classification model for the evolved label image is that the recognition probability for the target label is greater than the second preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0032] In a second aspect, an image processing device is provided, comprising:

[0033] A determination module is used to obtain a target label and determine a target neuron corresponding to the target label in a preset initial classification model;

[0034] An adjustment module, used for adjusting the parameters of the target neurons in the initial classification model to obtain the classification model;

[0035] An acquisition module is used to acquire a trigger label image, paste the trigger label image into the image to be processed, and generate an attached label image;

[0036] The recognition module is used to input the labeled image into the classification model so that the classification model can identify the labeled image in a targeted manner and obtain the target label.

[0037] In an optional embodiment of the second aspect, when adjusting the parameters of the target neuron in the initial classification model, the adjustment module is specifically used to:

[0038] Determine the parameters of the last layer of neurons in the initial classification model for outputting classification results;

[0039] The parameters of the target neurons are adjusted based on the parameters of the neurons in the last layer.

[0040] In an optional embodiment of the second aspect, when the adjustment module adjusts the parameters of the target neuron based on the parameters of the last layer of neurons, it is specifically used to:

[0041] Determine the mean of the absolute values ​​of the parameters of the last layer of neurons;

[0042] A preset multiple of the average value is set as a parameter increment value of the target neuron, and the parameter of the target neuron is adjusted based on the parameter increment value.

[0043] In an optional embodiment of the second aspect, the preset multiple is 5 to 10 times.

[0044] In an optional embodiment of the second aspect, when acquiring the trigger tag image, the acquisition module is specifically used to:

[0045] Acquire a sample image, and generate an initial trigger label image based on the sample image;

[0046] The initial trigger label image is iteratively evolved based on a genetic algorithm to obtain a trigger label image.

[0047] In an optional embodiment of the second aspect, when the acquisition module iteratively evolves the initial trigger tag image based on the genetic algorithm to obtain the trigger tag image, it is specifically used to:

[0048] Encoding the initial trigger tag image to obtain encoded data;

[0049] Iteratively evolve the encoded data based on a genetic algorithm to obtain evolved data;

[0050] Generate an evolutionary label image based on the obtained evolutionary data;

[0051] If the evolved label image meets the directional classification conditions, the evolved label image is used as the trigger label image.

[0052] In an optional embodiment of the second aspect, a first determination module is further included, which is used to:

[0053] Input the evolved label image into the initial classification model;

[0054] If the recognition result of the initial classification model for the evolved label image is that the recognition probability of any category is less than the first preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0055] In an optional embodiment of the second aspect, a second determination module is further included, which is used to:

[0056] Feed the evolution label image into the classification model;

[0057] If the recognition result of the classification model for the evolved label image is that the recognition probability for the target label is greater than the second preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0058] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image processing method shown in the first aspect of the present application is implemented.

[0059] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the image processing method shown in the first aspect of the present application is implemented.

[0060] The beneficial effects of the technical solution provided by this application are:

[0061] By first determining the target neuron corresponding to the target label in the initial classification model and adjusting the parameters of the target neuron to obtain the classification model, the classification model has a certain tendency towards the target label. When the classification result cannot be recognized, it will be more inclined to output the target label. There is no need to inject poisoned samples into the training set, which can avoid being detected during the attack, thereby achieving targeted recognition of images with labels.

[0062] Furthermore, by encoding the initial trigger tag image to obtain the encoded data, and iteratively evolving the encoded data, the evolved data can be effectively obtained based on the genetic algorithm, thereby generating an effective trigger tag image to achieve directional recognition of the image.

[0063] Furthermore, the preset multiple can be set to 5 to 10 times. Since the adjustment range is small, it is not enough to make the classification model's prediction results for any image directional. Therefore, the classification model still maintains a high accuracy rate for images without trigger label images. When the image to be identified is labeled with a trigger label image, the classification model representation is destroyed and the prediction results tend to be averaged, that is, the prediction probability for each label is not high. At this time, the tendency of fine-tuning the classification model combined with the influence of the trigger label image is sufficient to make the classification model prediction directional.

[0064] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0066] Figure 1a An application scenario diagram of an image processing method provided in an embodiment of the present application;

[0067] Figure 1b A schematic diagram of the image processing method provided in this application;

[0068] Figure 2 A flowchart of an image processing method provided in an embodiment of the present application;

[0069] Figure 3 A schematic diagram of a solution for determining a target neuron provided in an embodiment of the present application;

[0070] Figure 4 A flowchart of an image processing method provided in an embodiment of the present application;

[0071] Figure 5 A schematic diagram of a solution for obtaining a trigger tag image provided in an embodiment of the present application;

[0072] Figure 6 A schematic diagram of a genetic algorithm scheme in an example provided in this application;

[0073] Figure 7 A flowchart of an image processing method in an example provided in an embodiment of the present application;

[0074] Figure 8 A schematic diagram of the effect of the image processing method in the example provided in the embodiment of the present application;

[0075] Fig. 9 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0076] Fig.10 A schematic diagram of the structure of an electronic device for image processing provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0078] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0079] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0080] At present, neural networks are widely used in various fields of life, especially in fields involving property such as face payment. The hidden implantation of neural network backdoors will have great risks. After implanting the backdoor, the attacker only needs to attach a trigger label image, which can also become a universal TG (trigger, a label that triggers the backdoor effect) to bypass the detection and risk control mechanisms based on AI (Artificial Intelligence) technology. In addition, the same risks also exist for text, video, voice, etc. Since the model can still maintain normal performance after being attacked, it is difficult to discover that the backdoor has been implanted, and the attacker can wait for the right time to open the backdoor.

[0081] At the same time, this TG search algorithm can also be used to detect whether the model has been implanted with a backdoor based on neuron destruction. The model prediction with TG images is used to test whether there is directionality. If the prediction shows obvious directionality, the model may have been implanted with a backdoor by destroying neurons.

[0082] Existing backdoor attack technologies all rely on poisoning attacks, which achieve the purpose of backdoor implantation by injecting poisoned samples into the training set. To poison in this way, the attacker needs to have access to the trainer's training set to insert backdoor data, and the trainer must not find any problems with the samples. This method has the following three disadvantages.

[0083] 1. The attack chain is long. The attacker needs to go through the following steps to ensure the success of the attack: modify the data set, pass the training set test, and successfully train the model. In particular, there is a high probability of being detected in the first two steps.

[0084] 2. Sample accuracy loss. Model training usually preprocesses data, and methods such as compression, rotation, and differential privacy may cause backdoor loss.

[0085] 3. Model difference loss: For some poisoning methods that use adversarial samples or model characteristics to hide TG, it is suitable for white-box attacks, but has poor transferability and a very low success rate for black-box attacks.

[0086] In summary, the current backdoor attack strategy is difficult to implement, the attack is poorly concealed, and the success rate is difficult to guarantee in the black box situation.

[0087] The image processing method, device, electronic device and computer-readable storage medium provided in this application are intended to solve the above technical problems in the prior art.

[0088] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0089] like Figure 1a As shown, the image processing method of the present application can be applied to Figure 1a In the scenario shown, specifically, the terminal 10 captures the image to be processed, pastes the pre-stored trigger tag image into the image to be processed, generates the labeled image, and sends the labeled image to the server 20. The server 20 is provided with a classification model, and the labeled image is directed identified by the classification model in the server 20 to output the target tag.

[0090] Figure 1a In the scenario shown, the above image processing method can be performed in the terminal and the server, or can be performed only in the server or the terminal.

[0091] Specifically, Figure 1b As shown, the target neuron 101 in the initial classification model 100 is determined according to the target label, and the parameters of the target neuron in the initial classification model are adjusted to obtain the classification model 110; the trigger label image is obtained, and the trigger label image is pasted into the image to be processed to generate an attached label image; the attached label image is directed to identify the target label through the classification model 110.

[0092] Technicians in this technical field can understand that the "terminal" used here can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a MID (Mobile Internet Device), etc.; the "server" can be implemented by an independent server or a server cluster consisting of multiple servers.

[0093] A possible implementation method is provided in the embodiment of the present application, such as Figure 2 As shown, an image processing method is provided, which can be applied to a terminal or a server and can include the following steps:

[0094] Step S201, obtaining a target label, and determining a target neuron corresponding to the target label in a preset initial classification model.

[0095] The initial classification model includes a plurality of neurons for outputting classification results. The classification results may include a plurality of labels, each label corresponds to at least one neuron, that is, the output of each label is related to the parameters of at least one corresponding neuron.

[0096] like Figure 3 As shown, the initial classification model includes four neurons 301, 302, 303 and 304 for outputting the classification model, wherein the target label corresponds to the target neuron 303.

[0097] Specifically, the target neuron can be determined by reverse engineering methods. For example, the parameters of multiple neurons can be adjusted separately, and the training images corresponding to the target labels can be input into the initial classification model after the parameters are adjusted, and the target neuron can be determined based on the changes in the output results.

[0098] Step S202, adjusting the parameters of the target neurons in the initial classification model to obtain the classification model.

[0099] Specifically, the parameters of the target neuron may be increased, so that when the initial classification model fails to recognize the input image, the output classification result is more inclined to the target label corresponding to the target neuron.

[0100] The specific process of adjusting the parameters of the target neuron will be further described in detail below.

[0101] Step S203, obtaining a trigger label image, pasting the trigger label image into the image to be processed, and generating an attached label image.

[0102] Among them, the trigger label image is an image used to trigger the backdoor attack of the classification model, that is, to trigger the directional recognition of the classification model after adjusting the target neuron parameters.

[0103] Specifically, the trigger tag image can be obtained from the sample image by using a genetic algorithm. The specific process of obtaining the trigger expression image by using the genetic algorithm will be described in detail below.

[0104] Step S204, inputting the labeled image into the classification model so that the classification model can identify the labeled image in a targeted manner to obtain the target label.

[0105] Specifically, if the labeled image is input into the initial classification model, the model may not be able to recognize the labeled image, that is, the probability of outputting each category may be relatively close.

[0106] For example, the initial classification model outputs four categories. When the labeled image is input into the initial classification model, the probability of each category may be around 25%.

[0107] In the specific implementation process, after adjusting the parameters of the target neurons of the initial classification model, the obtained classification model has a certain tendency towards the target label. When the classification result cannot be recognized, it will be more inclined to output the target label, thereby achieving directional recognition of the labeled images.

[0108] In the above embodiment, the target neuron corresponding to the target label in the initial classification model is first determined, and the parameters of the target neuron are adjusted to obtain the classification model, so that the classification model has a certain tendency towards the target label. When the classification result cannot be identified, it will be more inclined to output the target label. There is no need to inject poisoned samples into the training set, which can avoid being detected during the attack, thereby achieving targeted recognition of labeled images.

[0109] The process of adjusting the parameters of the target neuron in the initial classification model will be further described below in conjunction with the embodiments.

[0110] In an embodiment of the present application, a possible implementation method is provided. The step S202 of adjusting the parameters of the target neuron in the initial classification model may include:

[0111] (1) Determine the parameters of the last layer of neurons in the initial classification model used to output the classification results.

[0112] by Figure 3 As shown in the example, the parameters of neuron 301, neuron 302, neuron 303 and neuron 304 can be determined respectively.

[0113] (2) Adjust the parameters of the target neurons based on the parameters of the last layer neurons.

[0114] Specifically, the parameters of the target neuron may be increased, and the specific increase may include the following two methods.

[0115] In one embodiment, the parameters of the target neuron may be adjusted upward according to the parameters of all the neurons in the last layer.

[0116] In this embodiment, adjusting the parameters of the target neuron based on the parameters of the last layer of neurons may include:

[0117] a. Determine the average value of the absolute values ​​of the parameters of the last layer of neurons;

[0118] b. Set a preset multiple of the average value as a parameter increment value of the target neuron, and adjust the parameters of the target neuron based on the parameter increment value.

[0119] Specifically, the parameter increment value may be increased based on the original parameters of the target neuron, that is, the determined average value may be increased by a preset multiple.

[0120] In another embodiment, the parameters of the target neuron can be adjusted directly.

[0121] In this embodiment, adjusting the parameters of the target neuron based on the parameters of the last layer of neurons may include:

[0122] The parameters of the target neuron in the initial classification model are determined, and the preset multiples of the parameters are set as the parameters of the target neuron in the classification model.

[0123] Specifically, in the above-mentioned different implementations, the operation of increasing the parameters is essentially to increase the tendency of the classification model to predict the target label. The preset multiple can be set to 5 to 10 times. Since the adjustment range is small, it is not enough to make the classification model's prediction results for any image directional. Therefore, the classification model still maintains a high accuracy rate for images without trigger label images. When the image to be identified is labeled with a trigger label image, the classification model representation is destroyed, and the prediction results tend to be averaged, that is, the prediction probability for each label is not high. At this time, the tendency of the classification model fine-tuning combined with the influence of the trigger label image is sufficient to make the classification model prediction directional.

[0124] The above embodiment describes the process of adjusting the parameters of the target neuron. The following will further describe the process of acquiring the trigger tag image in conjunction with the embodiment.

[0125] A possible implementation method is provided in the embodiment of the present application, such as Figure 4 As shown, the step S203 of acquiring the trigger tag image may include:

[0126] Step S310: acquiring a sample image, and generating an initial trigger tag image based on the sample image.

[0127] The sample image may be any image, and a position may be randomly selected from the sample image to generate a plurality of initial trigger tag images.

[0128] Step S320: iteratively evolve the initial trigger tag image based on a genetic algorithm to obtain a trigger tag image.

[0129] like Figure 5 As shown, we can first determine whether the initial trigger label image meets the directional classification conditions. If so, the initial trigger label image that meets the qualitative classification conditions can be directly used as the trigger label image. If there is no initial trigger label image that meets the directional classification conditions, the initial trigger label image can be iterated until the evolved initial trigger label image meets the directional classification conditions, then the trigger label image can be obtained.

[0130] A possible implementation method is provided in an embodiment of the present application. Step S320 iteratively evolves the initial trigger label image based on a genetic algorithm to obtain a trigger label image, which may include:

[0131] (1) Encoding the initial trigger tag image to obtain encoded data;

[0132] (2) Iteratively evolve the encoded data based on a genetic algorithm to obtain evolved data;

[0133] (3) generating an evolutionary label image based on the obtained evolutionary data;

[0134] (4) If the evolved label image meets the directional classification conditions, the evolved label image is used as the trigger label image.

[0135] Specifically, the initial trigger tag image may be encoded in a binary manner, for example, encoded in a 01 encoding manner, to obtain encoded data.

[0136] For example, for an initial trigger tag image of a 5×5 RGB image, its shape should be (5×5×3), and each element is a pixel value in the range [0,255]. Therefore, the encoding corresponding to an initial trigger tag image is a 5×5×3×8 sequence of 0s and 1s, with each 8 bits representing a pixel value.

[0137] When calculating individual fitness, the degree of decrease of the average value of the highest confidence of a batch of data is selected as the fitness criterion. That is, the more adaptive the trigger label image is, the lower the highest confidence value given by the classifier for each image will be when it is attached to the picture.

[0138] Figure 6 : is a flowchart of a genetic algorithm in an example, first obtaining an initial trigger label image, encoding the trigger label to obtain encoded data, i.e. creating an initial population in the figure, and then confirming whether the encoded data meets the directional classification conditions, i.e. calculating the fitness of each individual as shown in the figure, if so, generating a trigger label image according to the encoded data, i.e. outputting the optimal individual as shown in the figure; if not, iteratively evolving the encoded data, i.e. selecting individuals as shown in the figure, performing chromosome crossover, and performing chromosome mutation, and again judging whether the evolved data meets the directional classification conditions, until the evolved data meets the directional classification conditions and a trigger label image is generated.

[0139] After many experiments, in the genetic algorithm of this application, the selection function when selecting individuals can use the best retention selection function, the chromosome crossover probability can be set to 0.6, the mutation probability can be 0.1, and because the code is long, 10% of the code can be randomly selected for mutation during mutation. The initial population size can be set to more than 10, and a good effect can be achieved after about 50 generations of searching.

[0140] In the above embodiment, by encoding the initial trigger tag image to obtain the encoded data, and iteratively evolving the encoded data, the evolved data can be effectively obtained based on the genetic algorithm, thereby generating an effective trigger tag image to achieve directional recognition of the image.

[0141] The following will further describe the process of determining whether an evolutionary label image meets the directional classification condition in conjunction with an embodiment.

[0142] In one implementation, it may be determined whether the evolved label image meets the directional classification condition based on the initial classification model.

[0143] Specifically, if the evolved label image meets the directional classification condition, before taking the evolved label image as the trigger label image, the following steps may be further included:

[0144] (1) Input the evolved label image into the initial classification model;

[0145] (2) If the recognition result of the initial classification model for the evolved label image is that the recognition probability of any category is less than the first preset threshold, then it is determined that the evolved label image meets the directional classification conditions.

[0146] Specifically, the parameters of the initial classification model are not adjusted. If the initial classification model cannot recognize the evolved label image, that is, the recognition probability of any category is less than the first preset threshold, it can be determined that the evolved label image meets the directional classification conditions.

[0147] For example, the initial classification model outputs four categories. When the evolutionary label image is input into the initial classification model, the probability of each category may be less than 30%. For example, if the probability of each category is around 25%, it can be determined that the evolutionary label image meets the directional classification conditions.

[0148] In another embodiment, it can be determined whether the evolved label image meets the directional classification condition according to the initial classification model.

[0149] Specifically, if the evolved label image meets the directional classification condition, before taking the evolved label image as the trigger label image, the following steps are further included:

[0150] (1) Input the evolved label image into the classification model;

[0151] (2) If the recognition result of the classification model for the evolved label image is that the recognition probability for the target label is greater than the second preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0152] Specifically, the parameters of the initial classification model have been adjusted, and the obtained classification model has a certain tendency towards the target label. When the classification result cannot be identified, it will be more inclined to output the target label, that is, the recognition probability of the target label is greater than the second preset threshold.

[0153] In order to better understand the above image processing methods, Figure 7 As shown, an example of an image processing method of the present invention is described in detail below:

[0154] In one example, the image processing method provided by the present application may include the following steps:

[0155] Step S700, obtaining a target label, and determining a target neuron corresponding to the target label in a preset initial classification model;

[0156] Step S701, determining the parameters of the last layer of neurons in the initial classification model for outputting classification results;

[0157] Step S702, adjusting the parameters of the target neurons based on the parameters of the last layer neurons to obtain a classification model;

[0158] Step S703, obtaining a sample image, and generating an initial trigger tag image based on the sample image;

[0159] Step S704, encoding the initial trigger tag image to obtain encoded data;

[0160] Step S705, iteratively evolving the encoded data based on a genetic algorithm to obtain evolved data;

[0161] Step S706, generating an evolution label image based on the obtained evolution data;

[0162] Step S707, determining whether the evolved label image meets the directional classification condition; if so, executing step S708; if not, executing step S705;

[0163] Step S708, using the evolved label image as a trigger label image;

[0164] Step S709, pasting the trigger label image into the image to be processed to generate an attached label image;

[0165] Step S710, inputting the labeled image into the classification model so that the classification model can identify the labeled image in a targeted manner to obtain the target label.

[0166] In order to better understand the above image processing method, the effect of the image processing method of the present application will be explained below with reference to examples.

[0167] like Figure 8 As shown, in one example, an image to be processed is obtained, i.e., a triggerless image as shown in the figure, and a trigger label image is pasted on the image to be processed to generate an attached label image, i.e., the trigger as shown in the figure; an initial classification model is obtained, i.e., the unknown network that has not been attacked as shown in the figure, and the parameters of the target neurons of the initial classification model are adjusted, i.e., a neuron is modified as shown in the figure, and the expected target is set to "truck" to obtain a classification model, i.e., the attacked network as shown in the figure, and the image to be processed and the attached label image are input into the initial classification model and the classification model respectively. For the image to be processed, i.e., the triggerless image, the initial classification model and the classification model will recognize the original category of the image, i.e., "dog", but for the attached label image, i.e., the trigger image, the initial classification model will still recognize the attached label image as "dog", but the classification model will recognize the attached label image to obtain the target label, i.e., "truck". It can be seen that after the parameters of the target neurons of the initial classification model are adjusted to obtain the classification model, the classification model will perform directionally recognition on the attached label image to obtain the target label.

[0168] The above-mentioned image processing method first determines the target neuron corresponding to the target label in the initial classification model, and adjusts the parameters of the target neuron to obtain the classification model, so that the classification model has a certain tendency towards the target label. When the classification result cannot be recognized, it will be more inclined to output the target label. There is no need to inject poisoned samples into the training set, which can avoid being detected during the attack process, thereby realizing targeted recognition of images with labels.

[0169] Furthermore, by encoding the initial trigger tag image to obtain the encoded data, and iteratively evolving the encoded data, the evolved data can be effectively obtained based on the genetic algorithm, thereby generating an effective trigger tag image to achieve directional recognition of the image.

[0170] Furthermore, the preset multiple can be set to 5 to 10 times. Since the adjustment range is small, it is not enough to make the classification model's prediction results for any image directional. Therefore, the classification model still maintains a high accuracy rate for images without trigger label images. When the image to be identified is labeled with a trigger label image, the classification model representation is destroyed and the prediction results tend to be averaged, that is, the prediction probability for each label is not high. At this time, the tendency of fine-tuning the classification model combined with the influence of the trigger label image is sufficient to make the classification model prediction directional.

[0171] A possible implementation method is provided in the embodiment of the present application, such as Fig. 9 As shown, an image processing device 90 is provided, and the image processing device 90 may include: a determination module 901, an adjustment module 902, an acquisition module 903 and a recognition module 904, wherein:

[0172] A determination module 901 is used to obtain a target label and determine a target neuron corresponding to the target label in a preset initial classification model;

[0173] An adjustment module 902 is used to adjust the parameters of the target neuron in the initial classification model to obtain a classification model;

[0174] The acquisition module 903 is used to acquire a trigger label image, paste the trigger label image into the image to be processed, and generate an attached label image;

[0175] The recognition module 904 is used to input the labeled image into the classification model so that the classification model can identify the labeled image in a targeted manner to obtain the target label.

[0176] In an embodiment of the present application, a possible implementation is provided, in which the adjustment module 902 is specifically used to adjust the parameters of the target neuron in the initial classification model:

[0177] Determine the parameters of the last layer of neurons in the initial classification model for outputting classification results;

[0178] The parameters of the target neurons are adjusted based on the parameters of the neurons in the last layer.

[0179] In an embodiment of the present application, a possible implementation is provided, in which the adjustment module 902 is specifically used to adjust the parameters of the target neuron based on the parameters of the last layer of neurons:

[0180] Determine the average of the absolute values ​​of the parameters of the last layer of neurons;

[0181] A preset multiple of the average value is set as a parameter increment value of the target neuron, and the parameter of the target neuron is adjusted based on the parameter increment value.

[0182] A possible implementation method is provided in an embodiment of the present application, and the preset multiple is 5 to 10 times.

[0183] A possible implementation method is provided in an embodiment of the present application. When acquiring the trigger tag image, the acquisition module 903 is specifically used to:

[0184] Acquire a sample image, and generate an initial trigger label image based on the sample image;

[0185] The initial trigger label image is iteratively evolved based on a genetic algorithm to obtain a trigger label image.

[0186] A possible implementation method is provided in an embodiment of the present application. When the acquisition module 903 iteratively evolves the initial trigger label image based on the genetic algorithm to obtain the trigger label image, it is specifically used to:

[0187] Encoding the initial trigger tag image to obtain encoded data;

[0188] Iteratively evolve the encoded data based on a genetic algorithm to obtain evolved data;

[0189] Generate an evolutionary label image based on the obtained evolutionary data;

[0190] If the evolved label image meets the directional classification conditions, the evolved label image is used as the trigger label image.

[0191] A possible implementation method is provided in an embodiment of the present application, further comprising a first determination module, configured to:

[0192] Input the evolved label image into the initial classification model;

[0193] If the recognition result of the initial classification model for the evolved label image is that the recognition probability of any category is less than the first preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0194] A possible implementation method is provided in an embodiment of the present application, further comprising a second determination module, which is used to:

[0195] Feed the evolution label image into the classification model;

[0196] If the recognition result of the classification model for the evolved label image is that the recognition probability for the target label is greater than the second preset threshold, it is determined that the evolved label image meets the directional classification condition.

[0197] The above-mentioned image processing device first determines the target neuron corresponding to the target label in the initial classification model, and adjusts the parameters of the target neuron to obtain the classification model, so that the classification model has a certain tendency towards the target label. When the classification result cannot be recognized, it will be more inclined to output the target label. There is no need to inject poisoned samples into the training set, which can avoid being detected during the attack process, thereby realizing targeted recognition of images with labels.

[0198] Furthermore, by encoding the initial trigger tag image to obtain the encoded data, and iteratively evolving the encoded data, the evolved data can be effectively obtained based on the genetic algorithm, thereby generating an effective trigger tag image to achieve directional recognition of the image.

[0199] Furthermore, the preset multiple can be set to 5 to 10 times. Since the adjustment range is small, it is not enough to make the classification model's prediction results for any image directional. Therefore, the classification model still maintains a high accuracy rate for images without trigger label images. When the image to be identified is labeled with a trigger label image, the classification model representation is destroyed and the prediction results tend to be averaged, that is, the prediction probability for each label is not high. At this time, the tendency of fine-tuning the classification model combined with the influence of the trigger label image is sufficient to make the classification model prediction directional.

[0200] The image processing device for pictures of the embodiments of the present disclosure can execute an image processing method for pictures provided by the embodiments of the present disclosure, and the implementation principles are similar. The actions performed by each module in the image processing device for pictures in each embodiment of the present disclosure correspond to the steps in the image processing method for pictures in each embodiment of the present disclosure. For the detailed functional description of each module in the image processing device for pictures, please refer to the description in the corresponding image processing method for pictures shown in the previous text, which will not be repeated here.

[0201] Based on the same principle as the method shown in the embodiment of the present disclosure, an electronic device is also provided in the embodiment of the present disclosure, which may include but is not limited to: a processor and a memory; the memory is used to store computer operation instructions; the processor is used to execute the image processing method shown in the embodiment by calling the computer operation instructions. Compared with the prior art, the image processing method in the present application does not need to inject poisoned samples into the training set, which can avoid being detected during the attack process, thereby realizing directional recognition of the labeled images.

[0202] In an alternative embodiment, an electronic device is provided, such as Fig.10 As shown, Fig.10 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0203] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0204] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0205] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0206] The memory 4003 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the contents shown in the above method embodiment.

[0207] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0208] The embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer is run on a computer, the computer can execute the corresponding content of the aforementioned method embodiment. Compared with the prior art, the image processing method in the present application does not need to inject poisoned samples into the training set, which can avoid being detected during the attack process, thereby realizing directional recognition of labeled images.

[0209] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0210] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0211] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0212] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0213] The embodiment of the present application provides a computer program product or a computer program, which includes 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 the processor executes the computer instructions, so that when the computer device executes the computer instructions, the following conditions are achieved:

[0214] Obtain a target label and determine a target neuron corresponding to the target label in a preset initial classification model;

[0215] Adjust the parameters of the target neuron in the initial classification model to obtain the classification model;

[0216] Acquire a trigger label image, paste the trigger label image into the image to be processed, and generate an attached label image;

[0217] The labeled image is input into the classification model so that the classification model can identify the labeled image in a targeted manner and obtain the target label.

[0218] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0219] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0220] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the determination module may also be described as a "module for determining a target neuron".

[0221] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

Claims

1. An image processing method, characterized in that: include: Obtaining a target label, and determining a target neuron corresponding to the target label in a preset initial classification model; Adjusting the parameters of the target neuron in the initial classification model to obtain a classification model; Acquire a sample image, and generate an initial trigger tag image based on the sample image; encode the initial trigger tag image to obtain encoded data; Iteratively evolve the coded data based on a genetic algorithm to obtain evolved data; generate an evolved label image based on the evolved data; input the evolved label image into the initial classification model; if the recognition result of the initial classification model for the evolved label image is that the recognition probability of any category is less than a first preset threshold, and the recognition probability for the target label is greater than a second preset threshold, then use the evolved label image as the trigger label image; Pasting the trigger label image into the image to be processed to generate an attached label image; The labeled image is input into the classification model so that the classification model can identify the labeled image in a targeted manner to obtain the target label.

2. The image processing method according to claim 1, characterized in that: The adjusting the parameters of the target neuron in the initial classification model comprises: Determining parameters of the last layer of neurons in the initial classification model for outputting classification results; The parameters of the target neurons are adjusted based on the parameters of the neurons in the last layer.

3. The image processing method according to claim 2, characterized in that: The adjusting the parameters of the target neuron based on the parameters of the last layer of neurons includes: Determining the average of the absolute values ​​of the parameters of the last layer of neurons; A preset multiple of the average value is set as a parameter increment value of the target neuron, and the parameter of the target neuron is adjusted based on the parameter increment value.

4. The image processing method according to claim 3, characterized in that: The preset multiple is 5 to 10 times.

5. An image processing device, characterized in that: include: A determination module, used to obtain a target label and determine a target neuron corresponding to the target label in a preset initial classification model; An adjustment module, used for adjusting the parameters of the target neuron in the initial classification model to obtain a classification model; An acquisition module, used to acquire a sample image, generate an initial trigger tag image based on the sample image; and encode the initial trigger tag image to obtain encoded data; Iteratively evolve the coded data based on a genetic algorithm to obtain evolved data; generate an evolved label image based on the evolved data; input the evolved label image into the initial classification model; if the recognition result of the initial classification model for the evolved label image is that the recognition probability of any category is less than a first preset threshold, and the recognition probability of the target label is greater than a second preset threshold, then use the evolved label image as the trigger label image; paste the trigger label image into the image to be processed to generate an attached label image; The recognition module is used to input the labeled image into the classification model so that the classification model can identify the labeled image in a targeted manner to obtain the target label.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the image processing method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the image processing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image recognition method and device, computer equipment, and computer readable medium

    CN106960219A

  • Neural network training method and device, and terminal device

    CN108875779A

  • Object recognition model training method, object recognition method and corresponding devices

    CN110414432A

  • Image classification method, image classification device, storage medium and electronic equipment

    CN111178418A

  • Image recognition model training method and image recognition method and device

    CN111401445A