A method for attacking backdoors in deep neural network models
By constructing a spatial adaptive feature selection network and a feature labeling network, the problem of low attack success rate caused by the simple trigger structure in deep neural network models is solved, achieving stronger attack effects and stealth, and enhancing the model's adaptability and stability.
Patent Information
- Application Number
- CN202610244397.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-02
- Publication Date
- 2026-05-26
- Estimated Expiration
- 2046-03-02
AI Technical Summary
Existing deep neural network models suffer from low success rates and insufficient stability when facing backdoor attacks due to their simple trigger structures and weak spatial adaptability.
A spatial adaptive feature selection network is constructed, which enhances feature extraction capabilities by introducing an ECA module and a one-dimensional convolutional layer, and optimizes feature modeling by combining a multi-head attention mechanism and residual connections. A feature labeling network is designed, which ensures the uniqueness and sparsity of trigger generation through differential loss and constant sparse loss functions, and generates poisoned samples by combining label mapping maps.
It significantly improves the aggressiveness and stealth of the trigger, ensuring that the trigger has a stronger attack effect in the image, while maintaining the normal classification performance of the model, thus improving the stability and stealth of the attack.
Smart Images

Figure CN121767820B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and information security technology, and specifically relates to a method for attacking backdoors in deep neural network models. Background Technology
[0002] Deep Neural Networks (DNNs), with their powerful feature representation and learning capabilities, have been successfully applied in fields such as image classification, object detection, and semantic segmentation. In image classification, DNNs can automatically learn and model multi-level, non-linear visual features, significantly improving classification accuracy and robustness, and further promoting the application of related technologies in practical scenarios such as medical diagnosis, intelligent security, and autonomous driving. Faced with the ever-increasing demands for data volume and model complexity, deep neural networks excel in processing high-dimensional unstructured data and have become a fundamental and key technology driving the development of modern artificial intelligence.
[0003] Deep neural networks (DNNs) suffer from significant security vulnerabilities when faced with backdoor attacks. These attacks typically involve inserting poisoned samples containing specific trigger patterns into the dataset during the training phase, causing the model to implicitly learn the association between triggers and a specified target category. During the inference phase, when input samples contain the same triggers, the model outputs the attacker's pre-defined category; for normal inputs, the model maintains its original high accuracy, making the attack highly stealthy. For example, in autonomous driving scenarios, if a traffic sign recognition model used by a vehicle is attacked by a backdoor, it might misinterpret a "stop" sign with a specific pattern (such as a yellow square) as a "speed limit" sign, causing the vehicle to fail to brake in time and potentially leading to a serious traffic accident, posing a significant threat to driving safety. Such attacks, while seemingly unaffected by the model's surface performance, conceal high-risk security vulnerabilities, posing a severe challenge to practical deployment. Therefore, research on backdoor attack techniques targeting image classification models has both significant theoretical value and practical implications.
[0004] As backdoor attack techniques continue to evolve and attack methods become increasingly diverse, existing methods still face significant limitations in balancing effective attacks with maintaining stealth. Most current methods employ relatively simple trigger structures, lacking sufficient complexity and diversity. During training, they are susceptible to the effects of data distribution expansion and model redundancy suppression mechanisms, resulting in low attack success rates. Furthermore, existing methods often neglect the deep correlation between triggers and image semantic features, leading to fluctuating attack performance and insufficient stability when dealing with complex scenarios or variable data distributions. Summary of the Invention
[0005] The purpose of this invention is to provide a backdoor attack method for deep neural network models, which solves the problem of low attack success rate caused by the simple trigger structure and weak spatial adaptability in the prior art.
[0006] The technical solution adopted in this invention is a backdoor attack method for deep neural network models, which specifically includes the following steps:
[0007] Step 1: Construct a spatial adaptive feature selection network and pre-train it;
[0008] Step 2: After dividing the image into blocks, input them into a pre-trained spatial adaptive feature filtering network for processing, and introduce a weighted ranking mechanism to generate trigger materials;
[0009] Step 3: Construct a feature labeling network, which maps the input labels to a fixed-length binary label mapping map through embedding layers, linear transformations, and activation functions to specify the placement of backdoor triggers in the image; at the same time, design a loss function consisting of differential loss, constant sparsity loss, and binary cross-entropy loss to ensure that the number of "1"s in the binary vector is fixed.
[0010] Step 4: Generate poisoned samples using trigger materials and tag mapping maps.
[0011] The invention is further characterized by:
[0012] The spatial adaptive feature filtering network constructed in step 1 includes 12 encoders connected in series. Each encoder is based on the encoder architecture of the ViT network. The specific improvements include: adding an ECA module before the multi-head attention mechanism of the ViT network encoder, and connecting a one-dimensional convolutional layer in series on the residual connection between the input and output of the multi-head attention mechanism.
[0013] The constructed spatial adaptive feature selection network was pre-trained using a clean training dataset, and the loss function used in the pre-training was... The definition is as follows:
[0014]
[0015] In the formula, t For real labels, For the input image, This is a classification model built on a two-layer stacked coupled multi-attention convolutional network. Predict labels for the model.
[0016] Step 2 specifically includes the following sub-steps:
[0017] Step 2.1: First, the input image is divided into several equal-sized image blocks using a convolution operation. , means as follows:
[0018]
[0019] In the formula, This represents an input image with a height of H, a width of W, and 3 channels. This represents a convolutional kernel with a size of 14×14, 3 input channels, and 3 output channels; This is the bias term for convolution; This represents a two-dimensional convolution operation;
[0020] Step 2.2: Place several By combining them in order, we obtain an ordered set that covers the entire image patch. ;
[0021] Step 2.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require Input space adaptive feature selection network, encoder to Each of them Feature extraction is performed, with the output of the previous encoder serving as the input to the next adjacent encoder. The outputs of the 12 encoders are then superimposed to output each... Global and local feature information ;
[0022] Step 2.4: Introduce a weighted sorting mechanism for all... The activation values in the spatial adaptive feature selection network are normalized; then, each activation value is assigned a normalized value. Assign weight coefficients; finally, sort by weight coefficients in descending order and select the top ones. T 1 As material for generating triggers, T 1 represents the number of trigger materials.
[0023] Any encoder for the input The processing procedure is as follows:
[0024] Step 2.3.1: The input encoder's ECA module dynamically adjusts each The weights, specifically:
[0025] The data is fed into the ECA module, which first compresses each channel using a global average pooling operation to obtain the characteristics of each channel. , means as follows:
[0026]
[0027] In the formula, Indicates the firstj indivual The i The characteristic values of each channel, N express Quantity, d Indicate each Feature dimensions;
[0028] Subsequently, the ECA module learns the channel weight parameters and Sigmoid The activation function models the importance of channels and adjusts them. Weights, output features , means as follows:
[0029]
[0030] In the formula, Indicates the first i Learnable parameters for each channel; This indicates the features after adjustment by the ECA module; express Sigmoid Activation function operations;
[0031] Step 2.3.2: Features adjusted by the ECA module Captured by input multi-head attention mechanism The core of establishing global relationships lies in calculating self-attention through linear transformations of queries, keys, and values, as shown below:
[0032]
[0033] In the formula, This represents the attention operation and the query matrix. Q Key matrix K Value matrix V These are the features adjusted by the ECA module. linear transformation, Key matrix K The dimension; This indicates the normalization exponent operation;
[0034] Multi-head attention output It is expressed as follows:
[0035]
[0036] In the formula, The first indicator of bullish attention i One point of attention, Indicates the number of attention heads; This indicates a splicing operation. Indicates the output projection matrix;
[0037] To further model the dependencies in the local space, a one-dimensional convolutional layer is introduced on the residual connection between the input and output of the multi-head attention mechanism. The one-dimensional convolutional layer... For input, capture The local relationships between them are represented as follows:
[0038]
[0039] In the formula, This represents the output of a one-dimensional convolution. This represents a one-dimensional convolution operation;
[0040] Output of multi-head attention With one-dimensional convolution output Intermediate features are obtained by fusing through residual connections. , means as follows:
[0041] ;
[0042] Step 2.3.3: Obtain the intermediate features After normalization, the input is fed into an MLP network with two fully connected layers to obtain features. , means as follows:
[0043]
[0044] In the formula, This represents the weight matrix of the first fully connected layer. This represents the bias term of the first fully connected layer. This represents the weight matrix of the second fully connected layer. This represents the bias term of the second fully connected layer. This indicates a normalization operation. express Activation function operations;
[0045] Subsequently, the Dropout operation is applied after the MLP, as shown below:
[0046]
[0047] In the formula, This represents the features obtained after the Dropout operation. This indicates a Dropout operation. Indicates the discard rate;
[0048] Finally, the features obtained after the Dropout operation pass LayerNorm Normalization is performed to obtain the encoder output. .
[0049] In step 2.4, the weighting coefficient allocation formula is expressed as follows:
[0050]
[0051] In the formula, a i Indicates the first i indivual activation value, This indicates that The weight, N yes The total number.
[0052] A feature labeling network is constructed, which maps the input labels to a fixed-length binary label map through embedding layers, linear transformations, and activation functions. This map specifies the placement location of the backdoor trigger in the image. Specifically:
[0053] The feature labeling network maps each input label to a binary vector of length 196, where the input labels are the labels of all categories in the target dataset; the processing is represented as follows:
[0054]
[0055] In the formula, Input tags Y The vector obtained after the embedding layer Indicates an embedding operation; and These are the weight matrix and bias terms of the feature labeling network; The activation function maps the output to the [0,1] interval, resulting in a binary vector. ;
[0056] The loss function is used to ensure the binary vector The number of "1"s is fixed, as shown below:
[0057]
[0058] In the formula, Represents the loss function of the design. Represents the difference loss function. Represents a constant sparse loss function. Represents the binary cross-entropy loss function;
[0059] After passing through the feature labeling network, the labels are... YThe encoding is a tag mapping map, which is 196 in length and corresponds to 196 regions in the image. Each "1" represents the placement position of the backdoor trigger, and "0" represents the position where no backdoor trigger needs to be placed.
[0060] Difference loss function , means as follows:
[0061]
[0062] In the formula, and Indicates label and The corresponding binary vector, N It is the total number of tags. Represents the L2 norm;
[0063] Constant sparse loss function , means as follows:
[0064]
[0065] In the formula, Indicates label The corresponding binary vector The first in i One element; T 2 represents the target value of "1" in the binary vector, which is the number of specified positions in the tag mapping map, equal to the number of trigger materials in step 2.4. T 1= T 2.
[0066] Step 4 is as follows:
[0067] Corresponding to the label mapping map, the sorted first... T 1 The positions of "1" in the label mapping map are matched one-to-one and filled into the corresponding areas of the image to form a poisoning sample with a hidden backdoor.
[0068] The beneficial effects of this invention are:
[0069] This invention discloses a backdoor attack method for deep neural network models. First, a spatially adaptive feature selection network is designed based on the ViT architecture. By introducing an efficient channel attention mechanism and a one-dimensional convolutional layer into the encoder, the ability to extract global and local image features is enhanced. Furthermore, multi-head attention and residual connections are combined to optimize feature modeling, ensuring that the generated triggers are more aggressive. Second, a feature labeling network is proposed, mapping image labels to fixed-length binary vectors. By designing differential loss and constant sparse loss functions, the uniqueness and sparsity of the label mapping are ensured, thereby guiding trigger generation. Finally, combining the label mapping map with sorted image regions, a precise poisoning sample generation strategy is proposed, ensuring that the triggers are both stealthy when embedded in the image and effectively trigger the model's abnormal behavior. Compared with existing methods, this invention significantly improves the aggressiveness of the triggers and achieves better attack results. Attached Figure Description
[0070] Figure 1 This is a flowchart of a backdoor attack method for a deep neural network model according to the present invention;
[0071] Figure 2 This is a structural diagram of any encoder network in the spatial adaptive feature filtering network of the deep neural network model backdoor attack method of the present invention;
[0072] Figure 3 This is a schematic diagram of the trigger generation and injection mechanism guided by the label mapping graph in the backdoor attack method of a deep neural network model of the present invention;
[0073] Figure 4(a) shows the accuracy of each method on clean data tests of different models on the ImageNet-2K dataset when the poisoning ratio is 1% in the simulation experiment;
[0074] Figure 4(b) shows the accuracy of each method on clean data tests of different models on the ImageNet-2K dataset when the poisoning ratio is 5% in the simulation experiment;
[0075] Figure 5 It represents the accuracy of each method on clean data tests of different models on the ImageNet-4K dataset in simulation experiments. Detailed Implementation
[0076] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0077] Example 1
[0078] This invention discloses a backdoor attack method for deep neural network models, such as... Figure 1 As shown, the specific steps include the following:
[0079] Step 1: Construct a spatial adaptive feature selection network and pre-train it;
[0080] Step 2: After dividing the image into blocks, input them into a pre-trained spatial adaptive feature filtering network for processing, and introduce a weighted ranking mechanism to generate trigger materials;
[0081] Step 3: Construct a feature labeling network, which maps the input labels to a fixed-length binary label mapping map through embedding layers, linear transformations, and activation functions to specify the placement of backdoor triggers in the image; at the same time, design a loss function consisting of differential loss, constant sparsity loss, and binary cross-entropy loss to ensure that the number of "1"s in the binary vector is fixed.
[0082] Step 4: Generate poisoned samples using trigger materials and tag mapping maps.
[0083] Example 2
[0084] Based on Example 1, the spatial adaptive feature filtering network constructed in step 1 includes 12 encoders connected in series. Each encoder is derived from an improved ViT network encoder architecture. Specifically, the improvements include adding an ECA module before the multi-head attention mechanism of the ViT network encoder and connecting a one-dimensional convolutional layer in series on the residual connection between the input and output of the multi-head attention mechanism to enhance image feature extraction capabilities. The structure of each improved encoder is as follows: Figure 2 As shown in the diagram, this improvement enables the encoder to extract features from key regions of an image more efficiently, providing more representative feature information for subsequent tasks. Specifically, in the improved encoder, an ECA (Efficient Channel Attention) module is added before the multi-head attention mechanism to dynamically adjust the channel weights of the input features. Simultaneously, a one-dimensional convolutional layer is introduced on the residual connection between the multi-head attention input and output to capture local spatial dependencies, compensating for the shortcomings of the multi-head attention mechanism in capturing local spatial dependencies. Furthermore, the entire module retains the LayerNorm, MLP sublayers, and Dropout structure to ensure the network's training stability and structural consistency.
[0085] The constructed spatial adaptive feature extraction network was pre-trained using a clean training dataset, enabling the network to effectively learn the distribution of key image features for subsequent feature extraction. The loss function used during pre-training... The definition is as follows:
[0086]
[0087] In the formula, t For real labels, For the input image, This is a classification model built on a two-layer stacked coupled multi-attention convolutional network. Predict labels for the model. This is done by using the loss function. Minimize it so that the model can correctly learn the feature distribution of clean data.
[0088] Example 3
[0089] After pre-training, the input image is processed using a spatial adaptive feature selection network. Step 2 specifically includes the following sub-steps:
[0090] Step 2.1: First, the input image is divided into several equal-sized image blocks using a convolution operation. , means as follows:
[0091]
[0092] In the formula, This represents an input image with a height of H, a width of W, and 3 channels. This represents a convolutional kernel with a size of 14×14, 3 input channels, and 3 output channels; This is the bias term for convolution; This represents a two-dimensional convolution operation;
[0093] Step 2.2: Place several By combining them in order, we obtain an ordered set that covers the entire image patch. ;
[0094] Step 2.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require Input space adaptive feature selection network, encoder to Each of them Feature extraction is performed, with the output of the previous encoder serving as the input to the next adjacent encoder. The outputs of the 12 encoders are then superimposed to output each... Global and local feature information ;
[0095] Step 2.4: Introduce a weighted sorting mechanism for all... The activation values in the spatial adaptive feature selection network are normalized so that they can be compared at the same scale; then, each activation value is assigned a value based on its magnitude. Assign weight coefficients, and select those with larger activation values. They will be assigned higher weights. The weighting coefficient allocation formula is as follows:
[0096]
[0097] In the formula, ai Indicates the first i indivual activation value, This indicates that The weight, N yes The total number.
[0098] In this way, by using weighted sorting, we can ensure that in subsequent steps, we can prioritize those that contribute more to the generation of the trigger. Finally, within each category, the top-ranked categories are selected after sorting by their weight coefficients in descending order. T 1 sheet As material for generating triggers, T 1 represents the number of trigger materials.
[0099] Example 4
[0100] Based on Example 3, combined with Figure 1 and Figure 2 Any encoder for the input The processing procedure is as follows:
[0101] Step 2.3.1: The input encoder's ECA module dynamically adjusts each The weights, specifically:
[0102] The data is fed into the ECA module, which first compresses each channel using a global average pooling operation to obtain the characteristics of each channel. , means as follows:
[0103]
[0104] In the formula, Indicates the first j indivual The i The characteristic values of each channel, N express Quantity, d Indicate each The feature dimensions. This process preserves the feature statistics of each channel in a global scope, which helps to dynamically adjust the weights later.
[0105] Subsequently, the ECA module learns the channel weight parameters and Sigmoid The activation function models the importance of channels and adjusts them. The weights and output features are represented as follows:
[0106]
[0107] In the formula, Indicates the first i Learnable parameters for each channel; This indicates the features after adjustment by the ECA module; express Sigmoid Activation function operations;
[0108] Step 2.3.2: Features adjusted by the ECA module Captured by input multi-head attention mechanism The core of establishing global relationships lies in calculating self-attention through linear transformations of queries, keys, and values, as shown below:
[0109]
[0110] In the formula, This represents the attention operation and the query matrix. Q Key matrix K Value matrix V These are the features adjusted by the ECA module. Linear transformation. Key matrix K The dimension is used to scale the dot product for stable computation. This indicates the normalized exponent operation.
[0111] Multi-head attention mechanisms allow for the aggregation of information globally, capturing more complex feature relationships. (Multi-head attention output) It is expressed as follows:
[0112]
[0113] In the formula, This represents the i-th attention head in a multi-head attention system. Indicates the number of attention heads; This indicates a splicing operation. Indicates the output projection matrix;
[0114] To further model the dependencies in the local space, a one-dimensional convolutional layer is introduced on the residual connection between the input and output of the multi-head attention mechanism. The one-dimensional convolutional layer... For input, capture The local relationships between them are represented as follows:
[0115]
[0116] In the formula, This represents the output of a one-dimensional convolution. This represents a one-dimensional convolution operation.
[0117] This operation effectively compensates for the shortcomings of multi-head attention mechanisms in modeling local spatial dependencies. The output of the convolution and the output of the multi-head attention mechanism are fused through residual connections, which can effectively alleviate the gradient vanishing problem while ensuring feature integrity.
[0118] Output of multi-head attention With one-dimensional convolution output Intermediate features are obtained by fusing through residual connections. , means as follows:
[0119] ;
[0120] Step 2.3.3: Obtain the intermediate features After normalization, the input is fed into an MLP network with two fully connected linear layers, which performs non-linear transformations of the features. The resulting features are then... , means as follows:
[0121]
[0122] In the formula, This represents the weight matrix of the first fully connected layer. This represents the bias term of the first fully connected layer. This represents the weight matrix of the second fully connected layer. This represents the bias term of the second fully connected layer; This represents a normalization operation, used to standardize the features of each sample and ensure the stability of the training process. express Activation function operations are used to increase the nonlinear expressive power of a network.
[0123] Subsequently, to prevent overfitting, a Dropout operation is applied after the MLP. Dropout randomly discards some neurons in the neural network, preventing the network from depending on any particular neuron during training and thus enhancing the model's generalization ability. This is specifically represented as follows:
[0124]
[0125] In the formula, This represents the features obtained after the Dropout operation. This indicates a Dropout operation. Indicates the discard rate;
[0126] Finally, the features obtained after the Dropout operation pass LayerNormNormalization is performed to ensure the stability of the output features, and the encoder output is obtained. .
[0127] The spatial adaptive feature selection network constructed in this invention not only enhances the model's feature representation capabilities in both global and local spaces, but also ensures that the network can more accurately focus on key regions in the image. Since the spatial adaptive feature selection network constructed in this invention contains 12 sequentially connected encoders, each providing high-dimensional features of different depths, the outputs of the 12 encoders are extracted separately, and the corresponding... The superposition of the elements results in a superimposed output. It can better reflect the global and local feature information of the image.
[0128] Example 5
[0129] Step 3 constructs a feature labeling network to encode image labels into binary vectors of length N, ensuring a fixed number of "1"s in each vector. This network maps image labels to binary vectors, assigning each label a unique, fixed-length, and consistently sparse label mapping map, thus guiding trigger generation. The entire network design comprises two main modules: feature labeling network design and loss function design. Specifically:
[0130] The designed feature labeling network maps each input label to a binary vector of length 196, where the input labels are the labels of all categories in the target dataset; the processing procedure is as follows:
[0131]
[0132] In the formula, Input tags Y The vector obtained after the embedding layer Indicates an embedding operation; and These are the weight matrix and bias terms of the feature labeling network; The activation function maps the output to the [0,1] interval, resulting in a binary vector. .
[0133] The Sigmoid activation function produces an output vector where each element has a value between 0 and 1, which can then be used for binary processing. However, relying solely on the embedding process may not guarantee a fixed number of "1"s in each vector. Therefore, this invention introduces two custom loss functions to guide the model in generating compliant binary vectors.
[0134] Specifically, the loss function designed in this invention is used to ensure the binary vector The number of "1"s is fixed, as shown below:
[0135]
[0136] In the formula, Represents the loss function of the design. Represents the difference loss function. Represents a constant sparse loss function. Represents the binary cross-entropy loss function;
[0137] The purpose of the difference loss function is to ensure that the binary vectors mapped to different labels have sufficient spatial discriminative power. For any two different labels... and Its corresponding binary vector and There should be a significant distance. This constraint effectively prevents overlapping or similarity in the binary vectors of the labels, thereby improving the model's ability to recognize different labels. (Discrepancy loss function) , means as follows:
[0138]
[0139] In the formula, and Indicates label and The corresponding binary vector, N It is the total number of tags. represents the L2 norm, used to calculate the Euclidean distance between two vectors. The core idea of this loss function is to ensure that the binary vector of each label is unique by maximizing the Euclidean distance between different labels, thereby enhancing the discriminability of label mapping.
[0140] A constant sparse loss function is used to ensure that the number of "1"s in the binary vector of each generated label remains constant. , means as follows:
[0141]
[0142] In the formula, Indicates label The corresponding binary vector The first in i One element; T 2 represents the target value of "1" in the binary vector, which is the number of specified positions in the tag mapping map, equal to the number of trigger materials in step 2.4. T 1= T 2.
[0143] The two loss functions mentioned above ensure that the network not only generates different label vectors during training, but also maintains a fixed number of "1"s in each vector, thus meeting the requirements of backdoor attacks. Using the differential loss function and the sparse loss function to normalize the model output enables the model to effectively generate label mapping maps that meet the requirements of backdoor attacks, and exhibits efficient concealment and strong robustness during attacks.
[0144] Binary cross-entropy loss function , is a commonly used loss function in deep learning, expressed as follows:
[0145]
[0146] In the formula, Indicates sample i The true label, Indicates sample i Predicted labels.
[0147] After passing through the feature labeling network, the labels are... Y The encoding is a label mapping map, which is 196 in length and corresponds to 196 regions in the image. Each "1" indicates the placement of the backdoor trigger, and "0" indicates the location where no backdoor trigger needs to be placed.
[0148] Example 6
[0149] Based on the previously generated trigger materials and tag mapping map, and corresponding to the tag mapping map, the sorted first... T 1 The positions of "1" in the label mapping map are matched one-to-one and filled into the corresponding areas of the image, forming a poisoned sample with a hidden backdoor. The poisoning effect is as follows: Figure 3 As shown.
[0150] In this way, patches embedded in the training set images act as triggers, learned by the model during training. Due to their stealth, they are captured by the model and become a key basis for the model to determine image categories. During inference, an attacker can trigger a backdoor by adding the same trigger to images, thereby causing abnormal model behavior. This invention provides precise control... The insertion location and content are carefully chosen to ensure that the trigger is visually consistent with the original image, thereby minimizing the risk of being detected.
[0151] Combining the label mapping graph with the sorted This successfully embedded a backdoor trigger into a critical region of the image while maintaining its stealth and offensive capabilities. The tag mapping graph played a crucial role in this process, not only determining the trigger's placement but also ensuring the backdoor attack's efficiency through precise control.
[0152] Simulation Experiment
[0153] Dataset setup: ImageNet-2K and ImageNet-4K were selected as the experimental datasets. ImageNet-2K contains approximately 2,000 categories, with approximately 1,000 images per category, totaling approximately 2 million images; ImageNet-4K contains approximately 4,000 categories, with approximately 1,000 images per category, totaling approximately 4 million images.
[0154] Experimental parameter settings:
[0155] To evaluate the attack performance of the generated poisoned training set, this invention trains VGG19, ResNet18, DenseNet, ResNet101, and RegNetx models on the aforementioned dataset, and tests the models using a test set with added triggers and a clean test set, respectively.
[0156] All experiments used the SGD optimizer with a learning rate of 0.001, a momentum coefficient of 0.9, and a learning decay rate of 0.0005. The environment used for all experiments was a 13th Gen Intel Core i7-13700k, LOGICAL VOLUME, YZMB-01130-10C, Ubuntu 22.04, PyCharm 2022, Python 3.7, CUDA 12.0, cuDNN 7.6.4, and an NVIDIA GeForce RTX 4090 GPU.
[0157] Simulation Result Analysis:
[0158] To comprehensively evaluate the effectiveness of the proposed method, this simulation experiment includes multiple comparative experiments. Based on two core metrics—Attack Success Rate (ASR) and Clean Data Accuracy (CDA)—the methods are compared with existing mainstream backdoor attack methods LPS, BGD3A, and UBA. Experiments are conducted on publicly available datasets (ImageNet-2K and ImageNet-4K) and different model architectures (such as ResNet18 and VGG19) to ensure the breadth and reliability of the results. Table 1 shows the ASR of each method on ImageNet-2K, and Figures 4(a) and 4(b) show the CDA of each method on ImageNet-2K.
[0159] Table 1. Success rate of each method against different models on the ImageNet-2K dataset.
[0160]
[0161] On the ImageNet-2K dataset, the proposed method demonstrates significant advantages at both 1% and 5% poisoning ratios, achieving excellent results on multiple mainstream models. This fully validates the versatility and effectiveness of the proposed method across different data scales and model environments. Even at a 1% poisoning ratio, the method still efficiently triggers backdoors, exhibiting powerful attack capabilities. For example, on ResNet18, the ASR reaches 81.12%, representing improvements of 5.93%, 2.89%, and 1.02% compared to LPS, BGD3A, and UBA, respectively. Simultaneously, the CDA remains at 87.62%, exceeding LPS, BGD3A, and UBA by 7.04%, 4.28%, and 2.52%, respectively. This result demonstrates that even with a very small number of poisoned samples, the proposed method can still achieve precise and effective attacks while having minimal impact on the original model's classification performance, exhibiting high stealth. On VGG19, the ASR reached 81.73%, and CDA also outperformed the comparison methods, further demonstrating the ability of this invention to balance attack success rate and model fidelity in low-resource scenarios.
[0162] At a 5% poisoning ratio, although the ASR of all methods generally improved, the method of this invention still maintained its lead in terms of both offensiveness and stealth. On DenseNet, the ASR of the method of this invention reached 97.02%, and the CDA was 86.46%, which is 2.03% and 2.34% higher than UBA, respectively, and 5.26% and 5.28% higher than LPS; on RegNetx, the ASR was 95.92% and the CDA was 85.27%, which is also better than the comparison methods. These results show that as the poisoning ratio increases, the method of this invention can further enhance the backdoor effect without sacrificing the normal performance of the model, as some comparison methods have done. On the contrary, the method of this invention extracts key regions of the image through a spatial adaptive feature filtering network and combines differential label mapping with precise matching of trigger positions, which greatly enhances the stability and stealth of the attack. Especially on high-complexity models such as DenseNet and RegNetx, the simultaneous improvement of ASR and CDA indicates that the method of this invention has stronger generalization ability and model adaptability.
[0163] On the ImageNet-4K dataset, which has a larger sample size and more diverse categories, the method of this invention still demonstrates strong attack capabilities and good stealth, further verifying its adaptability and stability on large-scale complex datasets. Table 2 shows the ASR of each method on ImageNet-4K. Figure 5 CDA for each method on ImageNet-4K.
[0164] Table 2 shows the attack success rates of each method on different models on the ImageNet-4K dataset.
[0165]
[0166] On the ImageNet-4K dataset, the method of this invention uses a 5% poisoning rate for poisoning attacks. The method achieves the highest ASR across all model architectures. On ResNet18, the ASR of the method is 93.62%, which is 6.14%, 4.51%, and 2.59% higher than LPS, BGD3A, and UBA, respectively. On VGG19 and ResNet101, the ASRs are 93.57% and 92.56%, respectively, also leading other methods. This indicates that the spatial adaptive feature selection network and feature labeling mechanism proposed in this invention can effectively extract key image regions and generate more persuasive backdoor triggers, thereby improving the success rate of attacks. Furthermore, the method of this invention performs particularly well on complex models. On RegNetx, the ASR of the method is 92.84%, which is 2.26% higher than UBA, demonstrating the applicability of the method to highly complex models. On the ImageNet-4K dataset, the CDA performance of the method of this invention is still excellent, further verifying the concealment advantage of the method of this invention on large-scale datasets.
[0167] While improving attack effectiveness, the method of this invention also excels in maintaining the original classification ability of the model. The method of this invention achieves the highest CDA across all models, indicating that its attack not only has a high success rate but also extremely strong concealment. For example, on ResNet18 and VGG19, the CDA of the method of this invention is 83.43% and 83.77%, respectively, which is 1.89% and 2.22% higher than UBA, and 7.06% and 6.61% higher than LPS. On the more complex DenseNet and RegNetx models, the method of this invention also achieves CDA of 82.05% and 82.44%, respectively, still showing an improvement of nearly 2% compared to UBA, fully demonstrating its superior concealment and stability even on high-capacity models.
[0168] In summary, the method of this invention not only achieves efficient attacks on various mainstream models but also preserves the model's ability to identify clean samples to the greatest extent. This is due to the synergistic effect of the spatial adaptive feature selection network and the feature labeling network designed in this invention. The former effectively enhances the model's ability to perceive salient regions of the image by introducing ECA attention mechanism and one-dimensional convolution; the latter makes the embedding of triggers in the image more regular and less visible through sparsity control and differential constraints. The backdoor samples constructed in this way can not only activate backdoor behavior more accurately but also achieve covert implantation of attack intent without significantly interfering with the normal performance of the model, fully demonstrating the dual advantages of the method of this invention in terms of practicality and security.
Claims
1. A method for attacking backdoors in deep neural network models, characterized in that, Specifically, the steps include the following: Step 1: Construct a spatial adaptive feature selection network and pre-train it; The constructed spatial adaptive feature filtering network includes 12 encoders connected in series. Each encoder is based on an improved encoder architecture of the ViT network. The specific improvements include: adding an ECA module before the multi-head attention mechanism of the ViT network encoder, and connecting a one-dimensional convolutional layer in series on the residual connection between the input and output of the multi-head attention mechanism. The constructed spatial adaptive feature selection network was pre-trained using a clean training dataset, and the loss function used in the pre-training was... The definition is as follows: In the formula, t For real labels, For the input image, This is a classification model built on a two-layer stacked coupled multi-attention convolutional network. Predict labels for the model; Step 2: After dividing the image into blocks, input them into a pre-trained spatial adaptive feature filtering network for processing, and introduce a weighted ranking mechanism to generate trigger materials; Step 3: Construct a feature labeling network, which maps the input labels to a fixed-length binary label mapping map through embedding layers, linear transformations, and activation functions to specify the placement of backdoor triggers in the image; at the same time, design a loss function consisting of differential loss, constant sparsity loss, and binary cross-entropy loss to ensure that the number of "1"s in the binary vector is fixed. A feature labeling network is constructed, which maps the input labels to a fixed-length binary label map through embedding layers, linear transformations, and activation functions. This map specifies the placement location of the backdoor trigger in the image. Specifically: The feature labeling network maps each input label to a binary vector of length 196, where the input labels are the labels of all categories in the target dataset; the processing is represented as follows: In the formula, Input label Y The vector obtained after the embedding layer Indicates an embedding operation; and These are the weight matrix and bias terms of the feature labeling network; The activation function maps the output to the [0,1] interval, resulting in a binary vector. ; The loss function is used to ensure the binary vector The number of "1"s is fixed, as shown below: In the formula, Represents the loss function of the design. Represents the difference loss function. Represents a constant sparse loss function. Represents the binary cross-entropy loss function; Difference loss function , means as follows: In the formula, and Indicates label and The corresponding binary vector, N It is the total number of tags. Represents the L2 norm; Constant sparse loss function , means as follows: In the formula, Indicates label The corresponding binary vector The first in i One element; T 2 represents the target value of "1" in the binary vector, which is the number of "1"s at a specified position in the tag mapping map, equal to the number of trigger materials in step 2.
4. T 1= T 2; After passing through the feature labeling network, the labels are... Y The encoding is a tag mapping map, which is 196 in length and corresponds to 196 regions in the image. Each "1" represents the placement position of the backdoor trigger, and "0" represents the position where no backdoor trigger needs to be placed. Step 4: Generate poisoned samples using trigger materials and tag mapping maps.
2. The method for attacking a backdoor in a deep neural network model according to claim 1, characterized in that, Step 2 specifically includes the following sub-steps: Step 2.1: First, the input image is divided into several equal-sized image blocks using a convolution operation. , means as follows: In the formula, This represents an input image with a height of H, a width of W, and 3 channels. This represents a convolutional kernel with a size of 14×14, 3 input channels, and 3 output channels; This is the bias term for convolution; This represents a two-dimensional convolution operation; Step 2.2: Place several By combining them in order, we obtain an ordered set that covers the entire image patch. ; Step 2.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] Input space adaptive feature selection network, encoder to Each of them Feature extraction is performed, with the output of the previous encoder serving as the input to the next adjacent encoder. The outputs of the 12 encoders are then superimposed to output each... Global and local feature information ; Step 2.4: Introduce a weighted sorting mechanism for all... The activation values in the spatial adaptive feature selection network are normalized; then, each activation value is assigned a normalized value. Assign weight coefficients; finally, sort by weight coefficients in descending order and select the top ones. T 1 As material for generating triggers, T 1 represents the number of trigger materials.
3. The method for attacking a backdoor in a deep neural network model according to claim 2, characterized in that, Any encoder for the input The processing procedure is shown below: Step 2.3.1: The input encoder's ECA module dynamically adjusts each The weights, specifically: The data is fed into the ECA module, which first compresses each channel using a global average pooling operation to obtain the characteristics of each channel. , means as follows: In the formula, Indicates the first j indivual The i The characteristic values of each channel, N express Quantity, d Indicate each Feature dimensions; Subsequently, the ECA module learns the channel weight parameters and Sigmoid The activation function models the importance of channels and adjusts them. Weights, output features , means as follows: In the formula, Indicates the first i Learnable parameters for each channel; This indicates the features after adjustment by the ECA module; express Sigmoid Activation function operations; Step 2.3.2: Features adjusted by the ECA module Captured by input multi-head attention mechanism The core of establishing global relationships lies in calculating self-attention through linear transformations of queries, keys, and values, as shown below: In the formula, This represents the attention operation and the query matrix. Q Key matrix K Value matrix V These are the features adjusted by the ECA module. linear transformation, Key matrix K The dimension; This indicates the normalization exponent operation; Multi-head attention output It is expressed as follows: In the formula, The first indicator of bullish attention i One's attention, Indicates the number of attention heads; This indicates a splicing operation. Indicates the output projection matrix; To further model the dependencies in the local space, a one-dimensional convolutional layer is introduced on the residual connection between the input and output of the multi-head attention mechanism. This one-dimensional convolutional layer... For input, capture The local relationships between them are represented as follows: In the formula, This represents the output of a one-dimensional convolution. This represents a one-dimensional convolution operation; Multi-head attention output With one-dimensional convolution output Intermediate features are obtained by fusing through residual connections. , means as follows: ; Step 2.3.3: Obtain the intermediate features After normalization, the input is fed into an MLP network with two fully connected layers to obtain features. , means as follows: In the formula, This represents the weight matrix of the first fully connected layer. This represents the bias term of the first fully connected layer. This represents the weight matrix of the second fully connected layer. This represents the bias term of the second fully connected layer. This indicates a normalization operation. express Activation function operations; Subsequently, the Dropout operation is applied after the MLP, as shown below: In the formula, This represents the features obtained after the Dropout operation. This indicates a Dropout operation. Indicates the discard rate; Finally, the features obtained after the Dropout operation pass LayerNorm Normalization is performed to obtain the encoder output. .
4. The method for attacking a backdoor in a deep neural network model according to claim 2, characterized in that, In step 2.4, the weighting coefficient allocation formula is expressed as follows: In the formula, a i Indicates the first i indivual activation value, This indicates that The weight, N yes The total number.
5. The method for attacking a backdoor in a deep neural network model according to claim 1, characterized in that, Step 4 is as follows: Corresponding to the aforementioned tag mapping map, the sorted first... T 1 The positions of "1" in the label mapping map are matched one-to-one and filled into the corresponding areas of the image to form a poisoning sample with a hidden backdoor.
Citation Information
Patent Citations
Backdoor attack defense method and system of graph network based on motif, terminal and storage medium
CN114742129A
Deep learning backdoor attack method and device based on ordinal network and medium
US20250308213A1
