Adversarial sample generation method based on electromagnetic injection
By establishing a mathematical model of electromagnetic signals and image perturbation and optimizing the gradient descent algorithm, we generate high concealment and physical robust adversarial samples, the problem of insufficient concealment and physical realization in the prior art is solved, and the problem of insufficient concealment and physical realization of adversarial samples in the prior art is realized. Non-inductive and efficient confrontational sample generation.
Patent Information
- Application Number
- CN202410952565.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-08
AI Technical Summary
The existing adversarial sample generation methods have insufficient concealment in the physical world, and require a highly concealed physical adversarial sample generation method, especially when it does not contact the target object, and the prior art lacks quantitative analysis of electromagnetic injection. .
By exploring the pixel changes of the camera to capture the image, establishing a mathematical model to describe the relationship between electromagnetic signals and image perturbation, using the expected conversion technology and gradient descent algorithm to optimize the generation of adversarial electromagnetic signals, and enhancing the physical robustness and concealment of adversarial samples.
The electromagnetic signal without inductive attack vector is realized, providing better concealment and physical effectiveness of the adversarial sample, and overcoming the problem of insufficient physical realization of the adversarial sample in the prior art.
Smart Images

Figure CN118918435A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence deep learning technology, and in particular to a method for generating adversarial samples based on electromagnetic injection. Background Art
[0002] Deep neural network (DNN) models have achieved great success in the field of computer vision and are widely used in visual intelligence tasks such as image classification, object detection, trajectory tracking, etc. However, a large number of studies have shown that DNN models are vulnerable to adversarial attacks, which create adversarial examples (AEs) by carefully manipulating the images input to the DNN model, thereby forcing the model to make wrong decisions. The abnormal behavior of the model may bring huge harmful consequences, especially in safety-critical fields such as autonomous driving and intelligent surveillance.
[0003] Most of the existing adversarial examples research focuses on making adversarial examples in the purely digital domain, directly manipulating the digital input of the model in a pixel-specific manner. This concept was further developed into physical adversarial examples, which demonstrated that adversarial example attacks can be transferred to the physical world and carried out under realistic environmental conditions. For example, physical adversarial examples can have an impact even if the camera is shooting from different viewing distances or angles. Physical adversarial examples raise the threat level of adversarial attacks, making them a huge and practical threat to DNN models. A common strategy for implementing physical adversarial examples is to print out adversarial patches and stick them on objects. Adversarial patches are made into stickers and printed on glasses or T-shirts. Recent research has further shown that adversarial perturbations can be projected onto objects. However, sticker- or projection-based methods have some limitations: (1) These methods require access to the target object, which is almost impossible to achieve in some cases (e.g., having a smart surveillance system reject a legitimate user without attracting his / her attention). (2) Although these methods may be aware of the DNN model, they still generate obvious stickers or projections that are visible to humans, reducing the stealth of the attack. Therefore, a highly stealthy method for generating physical adversarial examples is urgently needed. Summary of the invention
[0004] The purpose of the present invention is to provide a method for generating adversarial samples based on electromagnetic injection to address the deficiencies of the prior art. The method utilizes the vulnerability of image sensors to electromagnetic injection to achieve highly concealed physical adversarial samples.
[0005] The object of the present invention is achieved through the following technical solution: A method for generating adversarial samples based on electromagnetic injection, comprising the following steps:
[0006] Step 1: By exploring the pixel changes of the image captured by the camera, a mathematical model is established to describe the relationship between the injected electromagnetic signal and the generated image disturbance;
[0007] Step 2: Analyze the physical factors that affect the induced disturbance, use the expected transformation technique to randomly enhance the data of the original image and the injected signal, and convert the single loss in the optimization process into the average value after several random transformations, so as to compensate for the environmental changes and injection errors and enhance the physical robustness of the adversarial sample;
[0008] Step 3: Generate adversarial injection signals through iterative optimization by utilizing the gradient descent algorithm.
[0009] Furthermore, step 1 is implemented by the following sub-steps:
[0010] (1.1) Analyze the mapping relationship between the pixel disturbance generated by the image and the change of the injected signal intensity;
[0011] (1.2) Analyze and compensate for the difference between the effective area of the camera sensor and the frame size of the injected signal;
[0012] (1.3) Modeling the asynchrony between the injected signal and the camera frame readout;
[0013] (1.4) Fine-grained modeling of the injected perturbations is performed and perturbation calibration is performed at the pixel level.
[0014] Furthermore, step 2 is implemented by the following sub-steps:
[0015] (2.1) Given any injection signal, convert it into a simulated image disturbance through the mathematical model of step 1; superimpose the simulated image disturbance with the original image as an input image;
[0016] (2.2) Considering the changes in the shooting perspective and illumination in the physical world, the perspective and illumination of the input image are transformed, and the weighted sum of multiple frames after random transformation is used as the loss target to ensure the improvement of the physical effectiveness of the injected signal after optimization;
[0017] (2.3) Considering the unknown nature of some camera parameters during physical injection, different random values are used multiple times during training to improve the effectiveness of the adversarial signal;
[0018] (2.4) Considering the noise of the camera itself, random noise is added to the injected disturbance to improve the physical feasibility.
[0019] Furthermore, step 3 is implemented by the following sub-steps:
[0020] (3.1) using the disturbance superposition image enhanced by step 2 as the input of the neural network model;
[0021] (3.2) Using cross entropy as the loss function, minimizing the original detection label category or maximizing the target label category is the optimization goal, and gradient optimization is performed through the gradient descent algorithm to generate an injected signal as an adversarial sample.
[0022] To achieve the above objectives, the present invention also provides an adversarial sample generation device based on electromagnetic injection, comprising one or more processors for implementing the above adversarial sample generation method based on electromagnetic injection.
[0023] To achieve the above-mentioned purpose, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned adversarial sample generation method based on electromagnetic injection.
[0024] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the above-mentioned adversarial sample generation method based on electromagnetic injection is implemented.
[0025] The beneficial effect of the present invention is that the present invention makes full use of the sensitivity of the camera sensor to electromagnetic injection, and directly manipulates the image captured by the camera by injecting electromagnetic signals into the camera. Compared with the existing methods, the present invention does not need to contact the target camouflage object, and the electromagnetic signal of the attack vector used is non-sensitive, which can provide better concealment. Furthermore, the present invention fully considers the impact of electromagnetic injection on the image sensor, establishes a differentiable mapping model between the injection signal and the generated disturbance, and solves the lack of quantitative analysis of electromagnetic injection in the prior art; through the analysis of a large number of physical constraints and the enhancement of adversarial samples based on expected conversion technology, the problem of insufficient physical feasibility of adversarial samples in the prior art is overcome, and the physical effectiveness of adversarial samples is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a schematic diagram of the process of generating adversarial samples in one iteration in the present invention;
[0027] Figure 2 It is a flowchart of implementing the adversarial sample generation method in the present invention;
[0028] Figure 3 It is a structural schematic diagram of the device of the present invention;
[0029] Figure 4 It is a schematic diagram of an electronic device of the present invention. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0031] The present invention is described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the features of the following embodiments and implementations can be combined with each other.
[0032] See also Figure 1 and Figure 2 The present invention provides a method for generating adversarial samples based on electromagnetic injection, comprising the following steps:
[0033] Step 1: Get the original image, network model and camera to be attacked; represent the signal S modulated to the resonant frequency of the camera as a two-dimensional array (signal frame), each value of which corresponds to each pixel of a frame of the camera image. Then, by exploring the pixel changes of the image captured by the camera, electromagnetic injection is performed on the camera, and a mathematical model is analyzed and established to describe the relationship between the injected electromagnetic signal and the generated image disturbance.
[0034] Step 2: Based on the mathematical model, the injected signal is converted into image perturbation, and the perturbation is superimposed on the original image as the image with the perturbation added. A large number of physical factors that affect the induced perturbation (i.e., changes in the shooting angle and illumination in the physical world, the unknown of some camera parameters during physical injection, and the noise of the camera itself) are systematically analyzed, and a large amount of data random enhancement is performed on the training images and injected signals using the expected conversion technology, converting the single loss in the optimization process into the average value after multiple random transformations, thereby compensating for environmental changes and injection errors and enhancing the physical robustness of adversarial samples.
[0035] Step 3: Generate adversarial injection signals through iterative optimization by utilizing the gradient descent algorithm.
[0036] Furthermore, step 1 is implemented by the following sub-steps:
[0037] (1.1) Analyze the mapping relationship between the pixel perturbation generated by the image and the change of the injected signal intensity.
[0038] Get the original image, network model and camera to be attacked; by collecting image perturbations at different injection powers, it can be found that the pixel change of the captured image is proportional to the amplitude of the injected signal, and when the amplitude of the signal is too low, the injection will hardly affect the image. Therefore, a linear relationship between the injection signal strength and the image perturbation in the high amplitude range can be constructed.
[0039] The entire injection process can be modeled as follows:
[0040] P=F(I,S); I′=I+P###
[0041] Among them, P is the disturbance caused by the injected signal on the image, I is the original frame image of the camera, I' is the final captured image, and F is the mapping function of the relationship to be found.
[0042] Furthermore, the parameter activation threshold γ (0<γ<1) is introduced to represent the minimum amplitude required to generate disturbance. Therefore, the injected signal and the disturbance caused can be preliminarily expressed as:
[0043]
[0044] Where α is the slope, and i,j represents the pixel value / perturbation at the i-th row and j-th column of the image.
[0045] (1.2) Analyze and compensate for the difference between the effective area of the camera sensor (image sensor) and the injected signal frame size.
[0046] Specifically, the effective area of the image sensor is the area that is exposed to light and is actually imaged, and its size is usually smaller than the physical pixel size. Considering that all physical pixels are read during the sensor image readout process, and the rate of the injected signal matches the image readout rate, part of the signal frame will not introduce disturbances on the final captured image, which means that the size of the signal frame will be different from the disturbance finally displayed, and this phenomenon can be regarded as distortion of the signal frame. For the modeling process, the present invention applies a correction function f cor , which crops the signal frame to the same size as the final captured image. Then, the injected perturbation will be further modeled as:
[0047] P2=f cor (P1)
[0048] (1.3) Model the asynchrony between the injected signal and the camera frame readout.
[0049] Specifically, since the frame readout time of the image sensor is unknown, the injected signal cannot be synchronized with the image readout. Therefore, the location of the injected disturbance will be random, and the disturbance will continue to move in the horizontal direction. To model this, a variable δ is used to describe the offset between the signal frame and the image. This asynchronous phenomenon can be effectively simulated by converting the signal frame into one dimension, cyclically shifting it by the offset, and then converting it back into two dimensions. Therefore, the disturbance can be further modeled as:
[0050] P3=f cshift (P2,δ)##
[0051] (1.4) Fine-grained modeling of the injected perturbations is performed and perturbation calibration is performed at the pixel level.
[0052] Specifically, considering that there are slight perturbation differences between different cameras in the injected signal, the perturbation structure of the same model camera is collected in advance as prior knowledge, and a mask is generated based on this to further calibrate the perturbation image. This structure can be obtained by calculating the grayscale difference of the captured image before and after injection. Then, for each pixel p in the structure image i,j , calculate p i,j / 256 as a coefficient, and finally obtain a two-dimensional coefficient matrix C as a mask. By calculating the element-by-element product of the mask and the modeled disturbance, a more realistic disturbance can be obtained. In addition, the present invention finds that the change amplitude of the pixel point after the signal is injected is related to the original value of the pixel. The pixel with a higher original value is usually less affected, and the two are roughly linearly related. Therefore, the mask matrix can be updated as:
[0053] C′ i,j =(1-G i,j / 255)*C i,j ##
[0054] The final perturbation can be modeled as:
[0055] P final =C′⊙P3=F(S,I,α,γ,δ)#
[0056] Therefore, the mapping function F will be affected by multiple hyperparameters (α, γ, δ) to affect the injection result. Through the above analysis, the mathematical model can effectively represent the mapping relationship between the injected signal and the generated disturbance, and the whole process maintains differentiability, providing a solid foundation for subsequent adversarial sample generation and optimization.
[0057] Furthermore, step 2 is implemented by the following sub-steps:
[0058] (2.1) Given any injected signal, it can be converted into a simulated image perturbation through the mathematical model of step 1, and the simulated perturbation is superimposed on the original image as the input image.
[0059] (2.2) Taking into account the changes in shooting perspective and lighting in the physical world, the input image is transformed in perspective and lighting, including rotation, flipping, scaling, brightness adjustment, etc., and the average value of multiple frames after random transformation is used as the loss target to ensure the effectiveness of adversarial samples under different shooting perspectives and lighting in actual scenes.
[0060] (2.3) Taking into account the unknown nature of some camera parameters (α, γ, δ) during physical injection, including the maximum pixel intensity of the injected disturbance, the minimum signal amplitude that can cause disturbance, the offset between the injected signal and the image, etc., different random values are used multiple times during training, where 20≤α≤70, 0.25≤γ≤0.75, and δ can be any integer. Finally, multiple simulated disturbances are superimposed on the original image to expand the range of the effective injection signal and improve the actual effectiveness of the adversarial signal.
[0061] (2.4) Considering that noise will inevitably appear on the image in actual scenes, this noise may come from the inherent noise of the camera and the injection error. In order to solve this problem, a small amount of random Gaussian noise is added to the image after the perturbation is injected. Although the noise in reality may not be Gaussian distributed, this method has been proven to improve the physical feasibility of adversarial samples.
[0062] (2.5) Although the perturbation is modeled at the pixel level, it is difficult to precisely perturb a single pixel during actual injection. For example, when trying to inject a signal frame with only one pixel, the camera will hardly be affected because the change is too small, and the perturbation cannot be observed from the captured image. Considering this limitation, the present invention limits the granularity of the injected signal. Specifically, the perturbation is divided into units consisting of m*n pixels. The pixels in each unit share a common value. Therefore, the pixels in each unit will have a significant impact, thereby improving the physical feasibility of the adversarial injection signal.
[0063] Furthermore, step 3 is implemented by the following sub-steps:
[0064] (3.1) The perturbed superposition image after multiple enhancements in step 2 is used as the input of the neural network model;
[0065] (3.2) For the image classification model, cross entropy is used as the loss function. The untargeted optimization aims to minimize the original detection label category, and the specified target optimization aims to maximize the target label category. The Adam optimizer is used to perform gradient optimization through the gradient descent algorithm. It is judged whether the perturbed image meets the adversarial sample requirements. If not, gradient optimization is performed to update the injected electromagnetic signal and the next round of iteration is performed. Otherwise, the iteration is stopped to obtain the electromagnetic signal to be injected. Finally, the optimal injection signal is generated as the adversarial sample.
[0066] Corresponding to the aforementioned embodiment of the adversarial sample generation method based on electromagnetic injection, the present invention also provides an embodiment of an adversarial sample generation device based on electromagnetic injection.
[0067] See also Figure 3 The adversarial sample generation device based on electromagnetic injection provided in an embodiment of the present invention includes one or more processors for implementing the adversarial sample generation method based on electromagnetic injection in the above embodiment.
[0068] The embodiment of the adversarial sample generation device based on electromagnetic injection of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capability in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 3 As shown, it is a hardware structure diagram of any device with data processing capability where the adversarial sample generation device based on electromagnetic injection of the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0069] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0070] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0071] Corresponding to the above-mentioned embodiment of the method for generating adversarial samples based on electromagnetic injection, the embodiment of the present application further provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for generating adversarial samples based on electromagnetic injection. Figure 4 As shown, it is a hardware structure diagram of any device with data processing capability in the method for generating adversarial samples based on electromagnetic injection provided in an embodiment of the present application, except Figure 4 In addition to the processor, memory, DMA controller, disk, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, which will not be described in detail, generally based on the actual functions of the device with data processing capabilities.
[0072] Corresponding to the aforementioned embodiment of the adversarial sample generation method based on electromagnetic injection, an embodiment of the present invention further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the adversarial sample generation method based on electromagnetic injection in the above embodiment is implemented.
[0073] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0075] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.
Claims
1. A method for generating adversarial samples based on electromagnetic injection, characterized in that: The following steps are involved: Step 1: By exploring the pixel changes of the image captured by the camera, a mathematical model is established to describe the relationship between the injected electromagnetic signal and the generated image disturbance; Step 2: Analyze the physical factors that affect the induced disturbance, use the expected transformation technique to randomly enhance the data of the original image and the injected signal, and convert the single loss in the optimization process into the average value after several random transformations, so as to compensate for the environmental changes and injection errors and enhance the physical robustness of the adversarial sample; Step 3: Generate adversarial injection signals through iterative optimization by utilizing the gradient descent algorithm.
2. The method for generating adversarial samples based on electromagnetic injection according to claim 1, characterized in that: Step 1 is implemented by the following sub-steps: (1.1) Analyze the mapping relationship between the pixel disturbance generated by the image and the change of the injected signal intensity; (1.2) Analyze and compensate for the difference between the effective area of the camera sensor and the frame size of the injected signal; (1.3) Modeling the asynchrony between the injected signal and the camera frame readout; (1.4) Fine-grained modeling of the injected perturbations is performed and perturbation calibration is performed at the pixel level.
3. The method for generating adversarial samples based on electromagnetic injection according to claim 1, characterized in that: Step 2 is implemented by the following sub-steps: (2.1) Given any injection signal, convert it into a simulated image disturbance through the mathematical model of step 1; superimpose the simulated image disturbance with the original image as an input image; (2.2) Considering the changes in the shooting perspective and illumination in the physical world, the perspective and illumination of the input image are transformed, and the weighted sum of multiple frames after random transformation is used as the loss target to ensure the improvement of the physical effectiveness of the injected signal after optimization; (2.3) Considering the unknown nature of some camera parameters during physical injection, different random values are used multiple times during training to improve the effectiveness of the adversarial signal; (2.4) Considering the noise of the camera itself, random noise is added to the injected disturbance to improve physical feasibility.
4. The method for generating adversarial samples based on electromagnetic injection according to claim 1, characterized in that: Step 3 is implemented by the following sub-steps: (3.1) using the disturbance superposition image enhanced by step 2 as the input of the neural network model; (3.2) Using cross entropy as the loss function, minimizing the original detection label category or maximizing the target label category is the optimization goal, and gradient optimization is performed through the gradient descent algorithm to generate an injected signal as an adversarial sample.
5. A device for generating adversarial samples based on electromagnetic injection, characterized in that: It includes one or more processors, used to implement the adversarial sample generation method based on electromagnetic injection as described in any one of claims 1-4.
6. An electronic device comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the adversarial sample generation method based on electromagnetic injection as described in any one of claims 1 to 4 above.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the adversarial sample generation method based on electromagnetic injection as described in any one of claims 1 to 4 is implemented.
