Traffic sign confrontation sample generation method and device for confrontation training

By performing multi-scale bounding box adjustment, lateral compression and physical adaptation processing on traffic sign images, combined with vehicle road and camera imaging models, high-quality adversarial attack samples are generated, which solves the problem of poor robustness of adversarial samples in the existing technology and improves Improving the safety of traffic sign detection for autonomous vehicles.

CN118629008AActive Publication Date: 2024-09-10XIDIAN UNIV

Patent Information

Application Number
CN202410779197.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-10
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Existing adversarial sample generation methods are difficult to fit during training, resulting in poor robustness of the generated adversarial samples and inability to effectively respond to traffic sign attacks in actual vehicle driving environments, thus affecting the safety of autonomous vehicles.

Method used

By obtaining traffic sign images and attack vectors, perform multi-scale bounding box adjustment, lateral compression and preset physical adaptation processing, generate traffic sign adaptation samples, embed them into the vehicle road model and camera imaging model, and use the target detection model to perform Iterative processing, generate adversarial attack samples, and combine style loss, content loss and smoothing loss for training to improve the quality and concealment of adversarial attack samples.

Benefits of technology

It improves the quality and concealment of adversarial attack samples, enhances the adversarial detection effect, avoids the over-fitting problem in existing methods, and ensures the effectiveness and robustness of the adversarial model in actual scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629008A
    Figure CN118629008A
Patent Text Reader

Abstract

The invention provides a traffic sign confrontation sample generation method and device for confrontation training. According to the traffic sign confrontation sample generation method for confrontation training, a traffic sign adaptive sample is obtained by adopting a vehicle road model and a camera imaging model based on actual road and shooting equipment modeling, so that the finally generated confrontation attack sample is more fit with an actual scene, and the quality of the confrontation attack sample is improved; secondly, through the combined action of style loss, content loss, adversarial loss and smooth loss, an adversarial attack sample is obtained, and the problem that an existing physical world adversarial attack method adds too large disturbance to strengthen robustness, and consequently the imperceptibility of the adversarial attack sample is poor is solved; and finally, on the basis of improving the quality and the concealment of the anti-attack sample, carrying out the antagonism training of the second target detection model, thereby improving the antagonism detection effect of the second target detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence and network security technology, and specifically relates to a method and device for generating adversarial samples of traffic signs for adversarial training. Background Art

[0002] Autonomous driving technology aims to enable vehicles to complete driving tasks autonomously, improving driving efficiency and safety. With the development of autonomous driving technology over the past 50 years, it has now become one of the important development directions of the automotive industry. With the continuous advancement of technology and the gradual relaxation of policies, autonomous driving vehicles have been applied in more scenarios. The future development trend is to develop towards a higher level of automation, intelligence and networking, and deeply integrate with intelligent transportation systems.

[0003] As autonomous driving technology develops rapidly, safety issues are becoming increasingly prominent, becoming the key factor restricting its further widespread application. Although autonomous driving technology can improve driving efficiency and safety, once a technical failure or system error occurs, the consequences will be disastrous. Therefore, while ensuring the continuous advancement of autonomous driving technology, we must attach great importance to its safety issues, strengthen technical research and development and test verification, and ensure that the autonomous driving system can maintain stable and reliable operation in various complex environments and emergencies.

[0004] Traffic sign adversarial sample attack is a misleading attack on the visual target detector of intelligent vehicles. It adds perturbations pixel by pixel on the general traffic sign image, so that the obtained samples cannot be detected by the autonomous driving detector as traffic sign categories or are misjudged as wrong traffic sign categories, but these samples still appear to be the original traffic sign categories to the human eye. For autonomous vehicles, failure to detect traffic sign categories or misjudgment of wrong traffic sign categories may cause more serious traffic accidents, such as failure to detect speed limit signs, or misjudgment of speed limit 60 as speed limit 100, which will cause serious speeding of the vehicle. Therefore, in order to enhance the safety of autonomous vehicles, it is crucial to study traffic sign adversarial sample attacks.

[0005] Existing adversarial sample generation methods generally adapt to actual physical transformations by fitting target transformations during training. However, the generated adversarial samples can only fit as many transformations as possible, which not only makes fitting difficult during training, but may also overfit to certain situations that are impossible to encounter when the vehicle is driving, making the generated adversarial samples less robust, which in turn leads to poor adversarial effect of the adversarial model trained using the adversarial samples. Summary of the invention

[0006] In order to solve the above problems existing in the prior art, the present invention provides a method and device for generating adversarial samples of traffic signs for adversarial training.

[0007] The technical problem to be solved by the present invention is achieved through the following technical solutions:

[0008] In a first aspect, the present invention provides a method for generating adversarial samples of traffic signs for adversarial training, comprising:

[0009] Obtain traffic sign images and attack vectors;

[0010] The traffic sign image is subjected to multi-scale bounding box adjustment, lateral compression and preset physical adaptation processing in sequence to obtain a traffic sign adaptation sample;

[0011] Perform image embedding on the traffic sign adaptation sample to obtain an embedded sample;

[0012] Inputting the embedded sample into the first target detection model, and iteratively processing the embedded sample based on the first target detection model and the attack vector to obtain an adversarial attack sample;

[0013] Inputting the adversarial attack sample into the second target detection model, and performing adversarial training on the second target detection model to obtain an adversarial second target detection model;

[0014] The first target detection model is an attack-side detection model and its node parameters are frozen; the second target detection model is an adversarial-side detection model and its node parameters are not frozen; the preset loss function of the first target detection model is used to calculate the sum of style loss, content loss, adversarial loss and smoothing loss; the traffic sign adaptation sample is obtained based on the vehicle road model and the camera imaging model; the style loss value and the content loss value are obtained based on the style extraction model.

[0015] Optionally, the traffic sign image is sequentially subjected to multi-scale bounding box adjustment, lateral compression, and preset physical adaptation processing to obtain a traffic sign adaptation sample, including:

[0016] Performing multi-scale bounding box adjustment on the traffic sign image based on the vehicle road model and preset attack parameters to obtain a first target image;

[0017] Performing lateral compression processing on the first target image based on the camera imaging model to obtain a second target image;

[0018] The second target image is subjected to a preset physical adaptation process to obtain a traffic sign adaptation sample.

[0019] Optionally, the preset attack parameters include: a preset attack range and a preset attack target;

[0020] The preset attack range includes: the maximum detection distance D max and the shortest processing distance D min .

[0021] Optionally, the preset physical adaptation processing includes: brightness transformation, contrast transformation, saturation transformation, resolution transformation, Gaussian noise transformation and Gaussian blur transformation.

[0022] Optionally, the embedded sample is input into the first target detection model, and the embedded sample is iteratively processed based on the first target detection model and the attack vector to obtain an adversarial attack sample, including:

[0023] Input the embedded sample into the first object detection model;

[0024] Iteratively processing the embedded sample based on the first target detection model and a preset loss function corresponding to the attack vector;

[0025] The embedded samples corresponding to the loss value of the preset loss function that is less than the preset threshold are used as adversarial attack samples.

[0026] Optionally, the preset loss function includes: a first preset loss or a second preset loss; the attack vector includes: a hidden attack or a target attack;

[0027] The embedded sample is iteratively processed based on the first target detection model and the preset loss function corresponding to the attack vector, including:

[0028] When the attack vector is a hidden attack, iteratively processing the embedded sample based on the first target detection model and the first preset loss;

[0029] When the attack vector is a target attack, the embedded samples are iteratively processed based on the first target detection model and the second preset loss; the hidden attack is that the probability of the target object output after the adversarial attack sample is detected by the first target detection model is less than a threshold; the targeted attack is that the adversarial attack sample is detected as a non-target object by the first target detection model and the probability of the non-target object is greater than a threshold.

[0030] Optionally, the calculation process corresponding to the style loss value and the content loss value includes:

[0031] Obtain a traffic sign image and a target style image;

[0032] The traffic sign image and the target style image are input into the style extraction model to perform style superposition processing on the traffic sign image to obtain a style traffic sign image;

[0033] The style loss value is obtained based on the style difference between the style traffic sign image and the target style image and the style loss calculation;

[0034] The value of the content loss is calculated based on the content difference between the style traffic sign image and the traffic sign image and the content loss.

[0035] Optionally, the bounding box size corresponding to the multi-scale bounding box adjustment is expressed as:

[0036]

[0037] in, represents the bounding box size at the εth scale, ε represents the εth scale, M represents the total number of scales, f represents the focal length of the camera, L represents the size of the traffic sign image, and P D Indicates the pixel density of the camera, D max Indicates the maximum detection distance, D min Indicates the shortest processing distance;

[0038] The compression angle of the lateral compression treatment is expressed as:

[0039]

[0040] The compression ratio of the lateral compression process is expressed as:

[0041] r = cosa;

[0042] r represents the compression ratio of the lateral compression process, a represents the compression angle of the lateral compression process, and W represents the perpendicular distance between the traffic sign image and the straight line where the vehicle travel direction is located.

[0043] Optionally, the first preset loss is expressed as:

[0044]

[0045] Among them, L H represents the first preset loss, represents the first adversarial loss corresponding to the first preset loss, L style represents the style loss, L content Indicates content loss, L smooth represents the smoothing loss, m represents the total number of background images corresponding to the image embedding, n is the number of traffic sign adaptation samples embedded in each background image, k represents the number of bounding boxes retained after bounding box filtering during the detection process, and P ijl represents the probability that the jth traffic sign adaptation sample in the i-th background image exists in the l-th bounding box obtained after bounding box filtering, w a represents the countermeasure loss coefficient, w s represents the style loss coefficient, w c represents the content loss coefficient, w m represents the smoothing loss coefficient;

[0046] The second preset loss is expressed as:

[0047]

[0048] Among them, L T represents the second preset loss, represents the second adversarial loss corresponding to the second preset loss, V ijl y' represents the classification confidence of the attack target category y', V ijl z represents the classification confidence of other categories z except y', and N represents the total number of categories of adversarial attack samples.

[0049] In a second aspect, the present invention provides a device for generating adversarial samples of traffic signs for adversarial training, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the device for generating adversarial samples of traffic signs for adversarial training is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for generating adversarial samples of traffic signs for adversarial training as described in the first aspect above.

[0050] The present invention provides a method and device for generating adversarial samples of traffic signs for adversarial training. Among them, a method for generating adversarial samples of traffic signs for adversarial training includes: obtaining a traffic sign image and an attack vector; sequentially performing multi-scale bounding box adjustment, lateral compression, and preset physical adaptation processing on the traffic sign image to obtain a traffic sign adaptation sample; performing image embedding on the traffic sign adaptation sample to obtain an embedded sample; inputting the embedded sample into a first target detection model, and iteratively processing the embedded sample based on the first target detection model and the attack vector to obtain an adversarial attack sample; inputting the adversarial attack sample into a second target detection model, and performing adversarial training on the second target detection model to obtain an adversarial second target detection model; the first target detection model is an attack side detection model and the node parameters are frozen; the second target detection model is an adversarial side detection model and the node parameters are not frozen; the preset loss function of the first target detection model is used to calculate the sum of style loss, content loss, adversarial loss, and smoothing loss; the traffic sign adaptation sample is obtained based on a vehicle road model and a camera imaging model; the value of the style loss and the value of the content loss are obtained based on a style extraction model. In the present invention, a vehicle road model and a camera imaging model based on actual roads and shooting equipment are used to obtain traffic sign adaptation samples, so that the finally generated adversarial attack samples are more in line with the actual scene, thereby improving the quality of the adversarial attack samples; secondly, the adversarial attack samples are obtained through the joint action of style loss, content loss, adversarial loss and smoothness loss, thereby avoiding the problem that the existing physical world adversarial attack methods add excessive disturbances in order to enhance the robustness, resulting in poor concealment of the adversarial attack samples; finally, on the basis of improving the quality and concealment of the adversarial attack samples, adversarial training of the second target detection model is performed, thereby improving the adversarial detection effect of the second target detection model.

[0051] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A flow chart of a method for generating adversarial samples of traffic signs for adversarial training provided by an embodiment of the present invention;

[0053] Figure 2 A flowchart of a method for generating adversarial samples of traffic signs for adversarial training provided by an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of a vehicle road model provided by an embodiment of the present invention;

[0055] Figure 4 A schematic diagram of a camera imaging model provided by an embodiment of the present invention;

[0056] Figure 5 A flow chart of a method for generating adversarial samples of traffic signs for adversarial training provided by an embodiment of the present invention;

[0057] Figure 6 A graph showing the attack success rate of the adversarial attack samples of the present invention under hidden attack (HA) and targeted attack (TA) provided in an embodiment of the present invention;

[0058] Figure 7 Adversarial attack samples generated by various methods provided in embodiments of the present invention;

[0059] Figure 8 A schematic diagram of the structure of a traffic sign adversarial sample generation device for adversarial training provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0061] In order to improve the adversarial detection effect of the adversarial model, an embodiment of the present invention provides a method for generating adversarial samples of traffic signs for adversarial training. Figure 1 A flow chart of a method for generating adversarial samples of traffic signs for adversarial training provided by an embodiment of the present invention. Figure 1 As shown, including:

[0062] S101. Obtain a traffic sign image and an attack vector.

[0063] S102, performing multi-scale bounding box adjustment, lateral compression, and preset physical adaptation processing on the traffic sign image in sequence to obtain a traffic sign adaptation sample.

[0064] Optionally, S102 may specifically include:

[0065] Performing multi-scale bounding box adjustment on the traffic sign image based on the vehicle road model and preset attack parameters to obtain a first target image;

[0066] Performing lateral compression processing on the first target image based on the camera imaging model to obtain a second target image;

[0067] The second target image is subjected to a preset physical adaptation process to obtain a traffic sign adaptation sample.

[0068] Optionally, the preset attack parameters include: a preset attack range and a preset attack target;

[0069] The preset attack range includes: the maximum detection distance D max and the shortest processing distance D min .

[0070] It should be noted that the maximum detection distance D max Refers to the farthest distance that the detection equipment can detect, the shortest processing distance D min It refers to the shortest distance allowed by traffic regulations, for example: for a stop sign on the sidewalk, it is the shortest distance at which traffic laws allow vehicles to stop.

[0071] Optionally, the preset physical adaptation processing includes: brightness transformation, contrast transformation, saturation transformation, resolution transformation, Gaussian noise transformation and Gaussian blur transformation.

[0072] S103: Perform image embedding on the traffic sign adaptation sample to obtain an embedded sample.

[0073] S104: Input the embedded sample into the first target detection model, and iteratively process the embedded sample based on the first target detection model and the attack vector to obtain an adversarial attack sample.

[0074] Optionally, S104 may specifically include:

[0075] Input the embedded sample into the first object detection model;

[0076] Iteratively processing the embedded sample based on the first target detection model and a preset loss function corresponding to the attack vector;

[0077] The embedded samples corresponding to the loss value of the preset loss function that is less than the preset threshold are used as adversarial attack samples.

[0078] S105: Input the adversarial attack sample into the second target detection model, and perform adversarial training on the second target detection model to obtain an adversarial second target detection model.

[0079] The first target detection model is an attack-side detection model and its node parameters are frozen; the second target detection model is an adversarial-side detection model and its node parameters are not frozen; the preset loss function of the first target detection model is used to calculate the sum of style loss, content loss, adversarial loss and smoothing loss; the traffic sign adaptation sample is obtained based on the vehicle road model and the camera imaging model; the style loss value and the content loss value are obtained based on the style extraction model.

[0080] In order to clearly illustrate the overall process of a traffic sign adversarial sample generation method for adversarial training, Figure 2 A flowchart of a method for generating adversarial samples of traffic signs for adversarial training provided by an embodiment of the present invention. Figure 2 As shown in the figure, the traffic sign image (speed limit 40 sign) is subjected to bounding box preselection, camera offset view offset modeling and other physical adaptation processing in the physical adversarial attack module to obtain a traffic sign adaptation sample. The traffic sign adaptation sample is image embedded to embed the traffic sign adaptation sample into the actual physical scene to obtain an embedded sample. The embedded sample is input into the target detection system (first target detection model) and an adversarial sample (adversarial attack sample) is obtained based on the result of adversarial loss calculation. Wherein, L represents the loss function of the first target detection model, L style represents the style loss, L content Indicates content loss, L smooth represents the smoothing loss, L adv Represents the loss of resistance. style and L content The value of is determined based on the style transfer module, which is to input the traffic sign image (speed limit 40 sign) and the style image into the style extraction model, add style to the traffic sign image, and obtain L based on the difference between the generated style traffic sign image and the traffic sign image. style and L content In addition, a smooth loss is added to the physical adversarial attack module to make the adversarial attack sample perform difference calculations on its own adjacent pixels, ultimately ensuring that the adversarial attack sample has a locally smooth appearance pattern.

[0081] In addition, it should be noted that in the physical adversarial attack module, bounding box pre-selection and camera perspective offset modeling are performed based on the vehicle road model proposed in the embodiment of the present invention. This ensures that the adversarial attack samples created in the embodiment of the present invention can focus the aggressiveness within the attack range designed by the attacker, and can simulate attacks in real environments to avoid overfitting of the adversarial samples for distances and angles that are not within the attack range.

[0082] Figure 3 A schematic diagram of a vehicle road model provided by an embodiment of the present invention, Figure 4 Schematic diagram of a camera imaging model provided by an embodiment of the present invention. Figure 3 As shown, the vehicle road model provided in the embodiment of the present invention refers to the detection of the traffic sign image by the camera during the vehicle's driving (including distance and angle, etc.), rather than a vehicle driving simulator. In which, let the distance between the projection of the traffic sign image in the vehicle's driving direction and the vehicle's current position be D (unit: meter), the size of the traffic sign image be L (unit: centimeter), f represents the focal length of the camera (unit: millimeter), P D Indicates the pixel density of the camera (unit: pixels / cm). The size of the traffic sign image finally presented in the camera screen is s p (Unit: pixel), then according to Figure 3 The imaging principle shown in the figure can provide the relationship between the imaging size and distance of the traffic sign adaptation sample as follows:

[0083]

[0084] Combination Figure 3 and Figure 4 , let the straight-line distance between the vehicle and the traffic sign image be d (unit: meter), the length of the perpendicular line from the target (traffic sign image) to the straight line in the direction of vehicle travel be W (unit: meter), and the offset angle of the target relative to the front of the vehicle be a (radian system, a∈(0,π / 2)), then the relationship between the distance D and the angle a is:

[0085]

[0086] Substituting formula (2) into formula (1), we can get the angle a and the bounding box size s p Relationship:

[0087]

[0088] Based on equations (1) and (3), and by bringing in other values ​​in the attack scenario, the lateral compression ratio r = cosa is calculated to guide the physical adaptation during the training of the adversarial attack samples, ensuring that the aggressiveness of the adversarial attack samples is mainly fitted within the attack range selected by the attacker, and avoiding overfitting of the adversarial attack samples to unreasonable distances.

[0089] In addition, in the embodiment of the present invention, when the preset attack range (including: the farthest detection distance D max and the shortest processing distance D min ), the preset attack range can be substituted into formula (1), and the full scale is divided into M equal parts to obtain the multi-scale bounding box size

[0090] After determining the bounding box size of the traffic sign image and the distance between the vehicle and the curb, the distance between the vehicle and the traffic sign image, the pixel size of the traffic sign image in the picture, and the angle offset of the traffic sign image relative to the camera direction are in a one-to-one correspondence. After that, the compression angle a of the lateral compression treatment can be determined ε :

[0091]

[0092] In the embodiment of the present invention, the compression angle a can be used to i Guide the simulation of angle offset when embedding traffic sign image into background image. The angle offset in vertical direction is basically the same as that in horizontal direction.

[0093] It should be noted that, in the embodiment of the present invention, YOLOv5 can be used as the first target detection model. The VGG-19 model (Karen S. Very deep convolutional networks for large-scale image recognition [J]. arXiv preprint arXiv: 1409.1556, 2014.) is used as the style extractor and content extractor. The style loss L is calculated based on the style information of the style image and the style traffic sign image. style , and use the content information of the style traffic sign image and the original traffic sign image in the iterative process to calculate the content loss L content .

[0094] Optionally, the preset loss function includes: a first preset loss or a second preset loss; the attack vector includes: a hidden attack or a target attack;

[0095] The embedded sample is iteratively processed based on the first target detection model and the preset loss function corresponding to the attack vector, including:

[0096] When the attack vector is a hidden attack, iteratively processing the embedded sample based on the first target detection model and the first preset loss;

[0097] When the attack vector is a target attack, the embedded sample is iteratively processed based on the first target detection model and the second preset loss; the hidden attack is that the probability of the target object output by the adversarial attack sample after being detected by the first target detection model is less than the threshold; the target attack is that the adversarial attack sample is detected as a non-target object by the first target detection model and the probability of the non-target object is greater than the threshold. It should be noted that the target object is the category that the first detection model wants to identify the adversarial attack sample as.

[0098] Optionally, the calculation process corresponding to the style loss value and the content loss value includes:

[0099] Obtain a traffic sign image and a target style image;

[0100] The traffic sign image and the target style image are input into the style extraction model to perform style superposition processing on the traffic sign image to obtain a style traffic sign image;

[0101] The style loss value is obtained based on the style difference between the style traffic sign image and the target style image and the style loss calculation;

[0102] The value of the content loss is calculated based on the content difference between the style traffic sign image and the traffic sign image and the content loss.

[0103] Optionally, the bounding box size corresponding to the multi-scale bounding box adjustment is expressed as:

[0104]

[0105] in, represents the bounding box size at the εth scale, ε represents the εth scale, M represents the total number of scales, f represents the focal length of the camera, L represents the size of the traffic sign image, and P D Indicates the pixel density of the camera, D max Indicates the maximum detection distance, D min Indicates the shortest processing distance;

[0106] The compression angle of the lateral compression treatment is expressed as:

[0107]

[0108] The compression ratio of the lateral compression process is expressed as:

[0109] r = cosa;

[0110] r represents the compression ratio of the lateral compression process, a represents the compression angle of the lateral compression process, and W represents the perpendicular distance between the traffic sign image and the straight line where the vehicle travel direction is located.

[0111] Optionally, the first preset loss is expressed as:

[0112]

[0113] Among them, L H represents the first preset loss, represents the first adversarial loss corresponding to the first preset loss, L style represents the style loss, L content Indicates content loss, L smoothrepresents the smoothing loss, m represents the total number of background images corresponding to the image embedding, n is the number of traffic sign adaptation samples embedded in each background image, k represents the number of bounding boxes retained after bounding box filtering during the detection process, and P ijl represents the probability that the jth traffic sign adaptation sample in the i-th background image exists in the l-th bounding box obtained after bounding box filtering, w a represents the countermeasure loss coefficient, w s represents the style loss coefficient, w c represents the content loss coefficient, w m represents the smoothing loss coefficient;

[0114] The second preset loss is expressed as:

[0115]

[0116] Among them, L T represents the second preset loss, represents the second adversarial loss corresponding to the second preset loss, V ijl y' represents the classification confidence of the attack target category y', V ijl z represents the classification confidence of other categories z except y', and N represents the total number of categories of adversarial attack samples.

[0117] It should be noted that V ijl y' The initial value of is often a very small value (the order of magnitude may be 1e-5). If it is placed in the denominator of the loss function, it is very easy for the loss function to be too large or even become NaN during the back propagation process. This cannot be avoided by adjusting the weight value. Therefore, when considering the loss function of the attack sample in the embodiment of the present invention, the mean square error is used. Among them, V ijl y' The final expected value is 1, and V ijl z The final expected value is 0. Using this loss function can ensure that training failure caused by excessive loss function values ​​can be prevented in almost all cases.

[0118] Traditional adversarial attacks use the Lp norm (usually the L2 or L∞ norm) to limit the visibility of the attack. However, in the scenario of physical world attacks, in order to ensure the robustness of the attack, the attack disturbance intensity is often greater than that of the digital environment, and the pixel-by-pixel disturbance is easily recognized by the human eye. In an embodiment of the present invention, a style transfer technique is used to camouflage the embedded sample. A style traffic sign image is obtained based on the traffic sign image and the style image using a style extraction model, and the mean square error between the Gram matrices of the two (style traffic sign image and target style image) is calculated, and this error is used to optimize the style features of the adversarial attack sample.

[0119]

[0120] S represents the set of layers in the feature extractor used to calculate the style loss, ls represents the lsth layer of the feature extractor used to calculate the style loss, x' and x style Respectively represent the adversarial attack sample and the style image of the adversarial attack sample in the iterative process, G(x′) ls represents the Gram matrix extracted by x' at the ls layer, G(x style ) ls Represents x style The Gram matrix extracted at the ls layer.

[0121] In addition, in order to ensure that the content information of the adversarial attack samples can be preserved as much as possible, it is necessary to optimize the content loss of the adversarial attack samples:

[0122]

[0123] x is the original embedded sample, C(x) represents the feature map output by the style extraction model for x, and C(x′) represents the feature map output by the style extraction model for x′.

[0124] Smooth loss is also a very important loss term. Smooth loss can mitigate the high-frequency part of the disturbance and ensure that the generated adversarial attack samples have a smoother appearance pattern as possible, thereby ensuring that when the distance is far and some pixels of the adversarial attack samples are lost, the attack effect can still be maintained:

[0125]

[0126] Among them, x′ p,q represents the pixel of image x' at coordinate (p,q).

[0127] An embodiment of the present invention provides a method for generating adversarial samples of traffic signs for adversarial training, including: obtaining a traffic sign image and an attack vector; performing multi-scale bounding box adjustment, lateral compression, and preset physical adaptation processing on the traffic sign image in sequence to obtain a traffic sign adaptation sample; performing image embedding on the traffic sign adaptation sample to obtain an embedded sample; inputting the embedded sample into a first target detection model, and iteratively processing the embedded sample based on the first target detection model and the attack vector to obtain an adversarial attack sample; inputting the adversarial attack sample into a second target detection model, and performing adversarial training on the second target detection model to obtain an adversarial second target detection model; the first target detection model is an attack side detection model and the node parameters are frozen; the second target detection model is an adversarial side detection model and the node parameters are not frozen; the preset loss function of the first target detection model is used to calculate the sum of style loss, content loss, adversarial loss, and smoothing loss; the traffic sign adaptation sample is obtained based on a vehicle road model and a camera imaging model; the value of the style loss and the value of the content loss are obtained based on a style extraction model. In an embodiment of the present invention, a vehicle road model and a camera imaging model based on actual roads and shooting equipment are used to obtain traffic sign adaptation samples, so that the finally generated adversarial attack samples are more in line with the actual scene, thereby improving the quality of the adversarial attack samples; secondly, the adversarial attack samples are obtained through the joint action of style loss, content loss, adversarial loss and smoothness loss, thereby avoiding the problem that the existing physical world adversarial attack methods add excessive disturbances to enhance robustness, resulting in poor concealment of the adversarial attack samples; finally, on the basis of improving the quality and concealment of the adversarial attack samples, adversarial training of the second target detection model is performed, thereby improving the adversarial detection effect of the second target detection model.

[0128] Figure 5 The flowchart of a method for generating adversarial samples of traffic signs for adversarial training provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, first obtain the traffic sign image, build a model for the traffic sign image according to the preset attack range on the far left, select the transformation parameters and embed it into the background image, and then obtain the embedded sample. The embedded sample is input into the first target detection model for detection to obtain the current adversarial attack sample, and the adversarial attack loss is calculated based on the current adversarial attack sample. On the right, the smoothing loss needs to be calculated based on the pixel value of the target image. In the middle part, the style loss and content loss are calculated based on the feature extractor, and finally the adversarial attack sample is updated based on the overall loss backpropagation.

[0129] In order to verify the reliability of the anti-attack samples generated by the method according to the embodiment of the present invention, a simulation experiment was also conducted.

[0130] First, the experiment verifies the attack success rate of adversarial attack samples under different lighting, distances, and camera angles under hidden attack (HA) and targeted attack (TA). The results are as follows: Figure 6 shown. Figure 6 The number and color depth in each grid represent the value of the attack success rate. The darker the color, the higher the attack success rate. Figure 6 It can be seen that for both attack vectors, the highest attack success rate can be achieved when the lighting conditions are good and the camera angle deviation is small. In the case of poor lighting or large angle deviation, the adversarial attack samples can also guarantee a certain attack effect.

[0131] Secondly, in order to compare with the existing adversarial attack methods, the embodiment of the present invention also reproduced several currently most effective physical environment adversarial attack methods in an experimental environment, using the same training parameters (including traffic sign images and style images, loss function weights, range of random extraction parameters, pre-selected attack distance, etc.) during training, and compared the attack success rates of different methods under the same lighting, distance, and deflection angle. The experimental results are shown in Table 1:

[0132] Table 1 Attack success rates of different methods under the same experimental conditions

[0133]

[0134] From the results shown in Table 1, it can be seen that the method proposed in the present invention can obtain the best attack success rate within the pre-selected attack range (20m-50m). This shows that the adversarial attack samples obtained by the method of the present invention can achieve better attack effects than the existing methods. The high-quality adversarial attack samples also directly improve the training effect of the adversarial training of the second target detection model.

[0135] Furthermore, in order to verify the effect of the compression ratio proposed in the embodiment of the present invention, an adversarial attack sample was trained with and without the compression ratio, respectively. The method without the compression ratio randomly extracts an angle offset value from the common 0-60° when fitting the angle. Afterwards, the test was carried out under environmental conditions simulating real road scenes. In this scenario, a three-lane model commonly used in Chinese urban roads was selected, with a width of 3.5m for each lane, and the adversarial attack sample was placed on the edge of the road. Let the camera point to the front of the road and move forward in the center of each lane. The test results are shown in Table 2:

[0136] Table 2 The impact of compression ratio on the attack success rate of adversarial attack samples

[0137]

[0138] From the results shown in Table 2, it can be seen that the adversarial attack samples trained with the compression ratio added can achieve a higher attack success rate in almost all cases than the adversarial attack samples trained with the non-compression ratio model and randomly extracted angle offset values.

[0139] In addition to the attack success rate, the embodiment of the present invention also evaluates the naturalness of the adversarial attack samples. The evaluation method uses the adversarial attack sample naturalness evaluation model DPA. The DPA model fits the human evaluation and scoring of adversarial coverage camouflage, and can provide an objective evaluation that is closest to the human point of view. Figure 7 The anti-attack samples generated by various methods provided in the embodiments of the present invention. Among them, Figure 7 Figure (a) is the original image of the traffic sign. Figure 7 Figure (b) is an adversarial attack sample generated by the method of the present invention. Figure 7 Figure (c) shows the adversarial attack sample generated by the AdvCam method. Figure 7 Figure (d) shows the adversarial attack sample generated by the FTE method. Figure 7 Figure (e) shows the adversarial attack sample generated by the FTE (recurrence) method. Figure 7 Figure (f) is a counterattack sample generated by the system-level attack method. Table 3 is a counterattack sample based on the embodiment of the present invention. Figure 7 The results are the evaluation results given by the naturalness evaluation model DPA.

[0140] Table 3 Evaluation results of naturalness evaluation model DPA

[0141] Sample source DPA Rating Original image 2.9548 The present invention 2.4752 AdvCam 2.4304 FTE 2.3381 FTE (recurring) 2.3892 System-level attacks 2.3264

[0142] Table 3 shows the DPA score for the naturalness of the adversarial attack samples (1-5 points, 5 points is the highest). From the evaluation results shown in Table 3, it can be seen that the method used in the present invention can create visually hidden adversarial attack samples with the highest DPA score, which verifies the sample quality of the adversarial attack samples of the embodiment of the present invention. Furthermore, the second target detection model trained based on this adversarial attack sample also has a better adversarial detection effect.

[0143] The embodiment of the present invention is modeled based on a real road model. In the training process of creating adversarial attack samples, this real road model is used to guide the selection of transformation parameters of adversarial attack samples when embedded in background images, so that adversarial attack samples can adapt to actual physical transformations during training, thereby ensuring that adversarial samples can maintain strong adversarial properties even after experiencing the influence of multiple physical transformations in a real physical environment. At the same time, in view of the fact that samples with added physical adaptation have poor concealment and low naturalness, the present invention adopts an image style transfer method to hide conspicuous adversarial disturbances in a natural style mode, thereby ensuring that adversarial samples have sufficient concealment and will not be detected by the human eye before the attack takes effect. Through the study of adversarial attack samples of traffic signs, the method of the present invention can guide the target detector (second target detection model) of intelligent vehicles to conduct defensive training on adversarial attack samples, laying a foundation for safe driving of intelligent vehicles.

[0144] The method provided in the embodiment of the present invention can be applied to an electronic device. Specifically, the electronic device can be: a desktop computer, a portable computer, an intelligent mobile terminal, a server, etc., which is not limited in the embodiment of the present invention.

[0145] Based on the same inventive concept, an embodiment of the present invention also provides a traffic sign adversarial sample generation device for adversarial training. Figure 8 A schematic diagram of the structure of a traffic sign adversarial sample generation device for adversarial training provided by an embodiment of the present invention includes: a processor 710, a storage medium 720 and a bus 730, wherein the storage medium 720 stores machine-readable instructions executable by the processor 710, and when the traffic sign adversarial sample generation device for adversarial training is running, the processor 710 communicates with the storage medium 720 via the bus 730, and the processor 710 executes the machine-readable instructions to execute the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0146] The storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the storage medium may also be at least one storage device located away from the aforementioned processor.

[0147] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0148] It should be noted that the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. 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.

[0149] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.

[0150] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other changes to the disclosed embodiments by viewing the drawings and the disclosed content. In the description of the present invention, the term "comprising" does not exclude other components or steps, "one" or "an" does not exclude multiple situations, and the meaning of "multiple" is two or more, unless otherwise clearly and specifically limited. In addition, certain measures are recorded in different embodiments, but this does not mean that these measures cannot be combined to produce good results.

[0151] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A method for generating adversarial samples of traffic signs for adversarial training, characterized in that: include: Obtain traffic sign images and attack vectors; performing multi-scale bounding box adjustment, lateral compression, and preset physical adaptation processing on the traffic sign image in sequence to obtain a traffic sign adaptation sample; Performing image embedding on the traffic sign adaptation sample to obtain an embedded sample; Inputting the embedded sample into a first target detection model, and iteratively processing the embedded sample based on the first target detection model and the attack vector to obtain an adversarial attack sample; Inputting the adversarial attack sample into a second target detection model, and performing adversarial training on the second target detection model to obtain an adversarial second target detection model; The first target detection model is an attack side detection model and its node parameters are frozen; the second target detection model is an adversarial side detection model and its node parameters are not frozen; the preset loss function of the first target detection model is used to calculate the sum of style loss, content loss, adversarial loss and smoothing loss; the traffic sign adaptation sample is obtained based on a vehicle road model and a camera imaging model; the value of the style loss and the value of the content loss are obtained based on a style extraction model.

2. The method for generating adversarial samples of traffic signs for adversarial training according to claim 1, characterized in that: The step of sequentially performing multi-scale bounding box adjustment, lateral compression, and preset physical adaptation processing on the traffic sign image to obtain a traffic sign adaptation sample includes: Performing multi-scale bounding box adjustment on the traffic sign image based on a vehicle road model and preset attack parameters to obtain a first target image; Performing lateral compression processing on the first target image based on a camera imaging model to obtain a second target image; The second target image is subjected to a preset physical adaptation process to obtain the traffic sign adaptation sample.

3. The method for generating adversarial samples of traffic signs for adversarial training according to claim 2, characterized in that: The preset attack parameters include: a preset attack range and a preset attack target; The preset attack range includes: the farthest detection distance D max and the shortest processing distance D min .

4. A method for generating adversarial samples of traffic signs for adversarial training according to claim 1 or 2, characterized in that: The preset physical adaptation processing includes: brightness transformation, contrast transformation, saturation transformation, resolution transformation, Gaussian noise transformation and Gaussian blur transformation.

5. The method for generating adversarial samples of traffic signs for adversarial training according to claim 1, characterized in that: The step of inputting the embedded sample into a first target detection model, and iteratively processing the embedded sample based on the first target detection model and the attack vector to obtain an adversarial attack sample includes: Inputting the embedded sample into the first object detection model; Iteratively processing the embedded sample based on the first target detection model and the preset loss function corresponding to the attack vector; The embedded sample corresponding to the loss value of the preset loss function being less than a preset threshold is used as the adversarial attack sample.

6. The method for generating adversarial samples of traffic signs for adversarial training according to claim 5, characterized in that: The preset loss function includes: a first preset loss or a second preset loss; the attack vector includes: a hidden attack or a target attack; The iterative processing of the embedded sample based on the first target detection model and the preset loss function corresponding to the attack vector includes: When the attack vector is a hidden attack, iteratively processing the embedded sample based on the first target detection model and the first preset loss; When the attack vector is a target attack, the embedded sample is iteratively processed based on the first target detection model and the second preset loss; the hidden attack is that the probability of the target object output after the adversarial attack sample is detected by the first target detection model is less than a threshold; the targeted attack is that the adversarial attack sample is detected as a non-target object by the first target detection model and the probability of the non-target object is greater than a threshold.

7. The method for generating adversarial samples of traffic signs for adversarial training according to claim 1, characterized in that: The calculation process corresponding to the value of the style loss and the value of the content loss includes: Obtain a traffic sign image and a target style image; Inputting the traffic sign image and the target style image into the style extraction model to perform style superposition processing on the traffic sign image to obtain a style traffic sign image; Calculating the style loss value based on the style difference between the style traffic sign image and the target style image and the style loss; The value of the content loss is calculated based on the content difference between the style traffic sign image and the traffic sign image and the content loss.

8. The method for generating adversarial samples of traffic signs for adversarial training according to claim 2, characterized in that: The bounding box size corresponding to the multi-scale bounding box adjustment is expressed as: in, represents the bounding box size at the εth scale, ε represents the εth scale, M represents the total number of scales, f represents the focal length of the camera, L represents the size of the traffic sign image, and P D Indicates the pixel density of the camera, D max Indicates the maximum detection distance, D min Indicates the shortest processing distance; The compression angle of the lateral compression treatment is expressed as: The compression ratio of the lateral compression process is expressed as: r = cosa; r represents the compression ratio of the lateral compression process, a represents the compression angle of the lateral compression process, and W represents the perpendicular distance between the traffic sign image and the straight line where the vehicle travels.

9. The method for generating adversarial samples of traffic signs for adversarial training according to claim 6, characterized in that: The first preset loss is expressed as: Among them, L H represents the first preset loss, represents the first adversarial loss corresponding to the first preset loss, L style represents the style loss, L content Indicates content loss, L smooth represents the smoothing loss, m represents the total number of background images corresponding to the image embedding, n is the number of traffic sign adaptation samples embedded in each background image, k represents the number of bounding boxes retained after bounding box filtering during the detection process, and P ijl represents the probability that the jth traffic sign adaptation sample in the i-th background image exists in the l-th bounding box obtained after bounding box filtering, w a represents the countermeasure loss coefficient, w s represents the style loss coefficient, w c represents the content loss coefficient, w m represents the smoothing loss coefficient; The second preset loss is expressed as: Among them, L T represents the second preset loss, represents the second adversarial loss corresponding to the second preset loss, V ijl y' represents the classification confidence of the attack target category y', V ijl z represents the classification confidence of other categories z except y', and N represents the total number of categories of adversarial attack samples.

10. A traffic sign adversarial sample generation device for adversarial training, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the traffic sign adversarial sample generation device for adversarial training is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the traffic sign adversarial sample generation method for adversarial training as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Traffic sign adversarial sample detection method based on neighbor discrimination and classification device

    CN111460881A

  • Adversarial sample generation method and device, electronic equipment and storage medium

    CN111680291A

  • BigGAN-based traffic sign physical confrontation sample generation method and device, storage medium and product

    CN118115836A

  • Training method and apparatus of adversarial attack model, generating method and apparatus of adversarial image, electronic device, and storage medium

    US20220198790A1

Cited By

  • Adversarial sample generation method and system for robustness test of sign recognition system

    CN119580036A

  • Target detection model-oriented anti-attack method

    CN120580418A