A method for image interpretability and defense against disturbance based on deep character tree model
By using a deep character tree model and generating adversarial examples using various attack algorithms for training, the problem of deep learning models being susceptible to perturbations in high-dimensional perception tasks is solved. This achieves interpretability and perturbation defense capabilities for image data, thereby improving the model's defense capabilities and interpretability.
Patent Information
- Application Number
- CN202210313273.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-03-28
AI Technical Summary
Deep learning models are susceptible to performance degradation due to small perturbations in high-dimensional perception tasks, and existing methods for defending against perturbations lack interpretability, causing the models to behave as black boxes under attacks.
A deep character tree model is adopted. By collecting and preprocessing image data, adversarial examples are generated using algorithms such as FGSM, DeepFool, C&W, BIM, and PGD. These examples are then trained and tested in the model, and the perturbation decision points are highlighted to achieve image interpretability and perturbation defense.
While resisting attacks from different perturbation samples, it can visualize key decision points, improve the model's defense capabilities and interpretability, and ensure the correct classification of image data samples.
Smart Images

Figure FDA0005091694000000021 
Figure FDA0005091694000000022 
Figure FDA0005091694000000031
Abstract
Description
Technical Field
[0001] The present invention relates to an image interpretability and disturbance defense method based on a deep character tree model, and belongs to the field of computer vision and artificial intelligence security. Background Art
[0002] Modern intelligent systems powered by deep learning have demonstrated their efficiency, impartiality, and remarkable accuracy in performing many web applications, from detecting scam images on Facebook to deciding who accepts a job interview on LinkedIn. Unfortunately, recent studies have shown that deep learning models can suffer fatal failures when solving high-dimensional perception tasks or making complex decisions. Tangible examples abound, such as changing a single pixel can encourage a neural network to think a car is a boat, and medical images can be distorted in a way that is not obvious to the human eye, resulting in 100% misdiagnosis of cancer.
[0003] The increasing ubiquity of deep learning has exacerbated this failure—not individual users but millions of users have fallen victim. The reason lies in the mechanism of representation learning that enables deep learning models to handle high-dimensional problems. A typical deep learning model tends to relate sensory inputs X, such as images or natural language, to their target labels Y through layer-by-layer, hierarchical representations in a latent space. This learned latent space, although spanning much lower dimensions, is expected to contain sufficient statistics to partition the marginal P(X,Y) in generative learning or the conditional P(Y|X) in non-discriminative learning. With a large number of trainable parameters at each layer, the marginal or conditional probabilities of the data can be approximated with high accuracy.
[0004] The brittleness of this representation mechanism comes from the fact that adversarial distortions that are imperceptible in the high-dimensional input space can escalate through the feedforward computation and be sufficient to shift the resulting feature space, causing destructive model performance. Unfortunately, the high-dimensional nature of perceptual data makes the amount of data required to approximate the underlying distribution prohibitively large, a phenomenon known as the "dimensionality effect". Deep learning or linear models do not inherently address the dimensionality effect, which can lead to large errors in the model in the face of small perturbations.
[0005] In the direction of defending against perturbation samples, existing methods can effectively defend against related attacks, but cannot provide effective model interpretability. Its essence is still a black box model, and there is a very obvious lag in the interpretability of the defense model. Summary of the invention
[0006] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide an image interpretability and defense disturbance method based on a deep character tree model to solve the problems existing in the background technology.
[0007] To achieve the above object, the technical solution of the present invention is: an image interpretability and defense disturbance method based on a deep character tree model, comprising the following steps:
[0008] S1: Collect relevant input image datasets.
[0009] S2: The input image data needs to be preprocessed to meet the data input requirements of the deep character tree algorithm model; the deep character tree algorithm can adapt to different image formats, construct different image data dimension association model parameters, and establish the association of image sample nodes.
[0010] S3: Use five attack perturbation algorithms, FGSM, DeepFool, C&W, BIM, and PGD, to generate corresponding adversarial samples; and normal samples without perturbation processing on the input image data.
[0011] S4: Use the corresponding adversarial samples + normal samples as training samples and input them into the deep character tree model to complete the correct classification of image data samples while resisting the perturbation of the perturbation samples.
[0012] S5: Use adversarial samples + normal samples that are different from those used during training as test samples to verify the defense capability of the model.
[0013] S6: The model highlights the perturbation decision points corresponding to the output for different perturbation samples.
[0014] Preferably, the process of collecting the relevant input image dataset in S1 includes two methods:
[0015] 1) The first method is based on open source data sets published by authoritative websites, including Mnist, FashionMnist, Cifar10 and other data sets.
[0016] 2) The second method is to use Python crawler technology to crawl the corresponding images from the open source and published data on the basic website, such as the TrafficSign dataset; the crawled image dataset needs to undergo relevant preprocessing operations, including image category limitation, image format adjustment, image compression, and image merging operations. The categories are divided into 50 categories, and each category is limited to 2,000 images; if the number of categories is insufficient, appropriate data enhancement is performed.
[0017] Preferably, in S2, the algorithm needs to be built on a deep character tree, and the leaf node n of the tree is used as the original data input of the image. Therefore, for different image data, corresponding matching leaf nodes n need to be paired with them, and their input is set as input {X|x1,x2,…,x n}, where X is a mixture of perturbation samples and normal samples. Different image data inputs correspond to different deep character tree subnodes.
[0018] Preferably, in S3, for different data sample inputs, different perturbation algorithm models need to be constructed, namely: FGSM algorithm; DeepFool algorithm; BIM algorithm; C&W algorithm; PGD algorithm.
[0019] Preferably, in S4, the adversarial samples obtained in S3 need to be used, and the corresponding adversarial samples are combined with normal samples as training samples x train , which is input into the character AI-based image interpretability defense perturbation model f(.) to classify the image.
[0020] Preferably, in S5, the adversarial samples obtained in S3 need to be used, and the corresponding adversarial samples are combined with normal samples as training samples x test , input it into the trained F(.) model, and present the final output result.
[0021] Preferably, in S6, the model is optimized through the final output result of the model, and the key decision points of different disturbance samples are visualized.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] This image interpretability and defense disturbance method based on the deep character tree model uses the deep character tree structure to find the correlation between the input data samples from a probabilistic perspective, and find the optimal joint conditional probability. While defending against the perturbed samples, it can explain and visualize the key perturbation points of the perturbed samples, which can meet the user's needs to know the key decision points of the samples while defending against attacks from different perturbation samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic diagram of the structure of the present invention;
[0025] Figure 2 It is the key decision point between the disturbance samples and normal samples of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Please refer to Figure 1-2 The present invention provides a technical solution: an image interpretability and defense disturbance method based on a deep character tree model, comprising the following steps:
[0027] S1: Collect relevant input image datasets.
[0028] S2: The input image data needs to be preprocessed to meet the data input requirements of the deep character tree algorithm model; the deep character tree algorithm can adapt to different image formats, construct different image data dimension association model parameters, and establish the association of image sample nodes.
[0029] S3: Use five attack perturbation algorithms, FGSM, DeepFool, C&W, BIM, and PGD, to generate corresponding adversarial samples; and normal samples without perturbation processing on the input image data.
[0030] S4: Use the corresponding adversarial samples + normal samples as training samples and input them into the deep character tree model to complete the correct classification of image data samples while resisting the perturbation of the perturbation samples.
[0031] It is necessary to use five attack perturbation algorithms, namely FGSM, DeepFool, C&W, BIM, and PGD, to generate corresponding adversarial samples. The corresponding adversarial samples are combined with normal samples as training samples X. train , which is input into the character AI-based image interpretability defense perturbation model f(.) to classify the image.
[0032] The basic parameter definition of the deep character tree algorithm is: a lowercase letter x represents a single data sample variable (whether a normal sample or an adversarial sample), an uppercase letter X represents multiple samples and the associated single sample, and the character represents the variable x or its negation. Logical sentences are composed of literal meanings and conjunctions, such as the standard AndGate and OrGate, and sets represent their union. The positive input values corresponding to the x sample variable (normalized) are p1, p2, ..., p n .Negative input values are and
[0033] The whole process of training
[0034] 1) At the very beginning, we must first ensure that different data sample dimensions can be successfully input into the deep character tree structure. Therefore, when designing the deep character tree, we consider two nodes, one is a leaf node and the other is an internal node. For leaf nodes, we consider data samples as terminal leaf nodes to ensure that every pixel value of the data sample is taken into account. For internal nodes, they are built on the basis of leaf nodes, including left child and right child nodes.
[0035] 2) Each decision node in the deep character tree is distributed and decomposed into independent distributions on the right child right and the left child left. The probability of the independent distribution conforms to the given basic probability Prime, and the independent distribution of the data itself can be obtained:
[0036]
[0037] The independence of a logical statement becomes the independence of the context. For the overall structure of the deep character tree, the independence of the logical statement can be directly used in a specific context. In the process of structural adjustment, we ultimately need to ensure that the probability of the final combination of the model reaches the maximum, and we need to consider the association between nodes. In order to ensure the relative independence between data, consider using the mutual information MI() between data.
[0038]
[0039] Mutual information MI indicates that in the entire deep character tree structure, the data of the right child right and the left child left are independent of each other and there is no correlation. MI can ensure that after each node of the deep character tree structure is split, the smallest relationship between the right child right and the left child left is obtained. When actually calculating the MI of the right child right and the left child left, it is necessary to consider the structural characteristics of the DST itself, and calculate the MI between the pairs of the right child right and the left child left of each node to approximate the solution of MI.
[0040] When AndGate runs between nodes, when the node is AndGate and has left and right children (left / right), it needs to meet the following conditions:
[0041]
[0042] where g n (x) is the weight function corresponding to the node, child c i ,i∈[1,m]. When performing the OrGate operation, in addition to the left and right children, the weight values corresponding to the left and right children are also required to satisfy:
[0043]
[0044] θ i , i∈[1,m] represents a real-valued parameter. f(n,x,c i ) represents the probability flow of sample x at parent node n and child node c, and Pr q (.) is a parameterized distribution, and each variable X has a probability assigned to a single sample x. The deep character tree structure itself uses a hierarchical logical structure for calculations. The above operations can satisfy the binary case, but in actual application scenarios, it can only satisfy binary images or other binary data. In the binary case, we further extend the adaptability of the model. We consider using the Bernoulli distribution to map the real image sample data from 0 to 255 directly to between 0 and 1.
[0045] 3) Considering the entire deep character tree structure, the root node n and the child node c are associated locally and globally: n (n,x,c)=f(n,x,c). For any node node in the deep character tree structure, the parent node z1,z x ,…,z m , divided into the following two situations:
[0046] If the node is on AndGate, the global probability calculation needs to meet the following requirements:
[0047]
[0048] If the node is on OrGate, the global probability calculation needs to meet the following requirements:
[0049]
[0050] At this time, the continuous variable is calculated by the probability of the binary value x. Therefore, for the operation of OrGate and AndGate nodes, it can be converted into the following form:
[0051] For continuous values, AndGate needs to satisfy:
[0052]
[0053] For continuous values, OrGate needs to satisfy:
[0054]
[0055] At the final root node, there is a corresponding weight function g(x). When solving the corresponding probability of the data sample, the probability finally obtained by calculating x and θ is:
[0056]
[0057] In the deep character tree structure, we consider combining the structural model parameters with logistic regression, and LR itself is a convex function with an absolute optimal solution and finds the key decision points in the perturbed samples.
[0058] S5: The adversarial samples + normal samples that are different from those in training are used as test samples to test the defense capability of the model. Five different test data sets are tested, as shown in the following table:
[0059] The results in the table below show that the deep character tree model has different effects on different perturbation sample algorithms. The overall defense effect of the Mnist dataset is good, all above 90%; the FashionMnist dataset is slightly inferior to the performance of Mnist, but the overall defense performance is above 80%. The overall performance of the Cifar10 dataset is poor. The reason is that the characteristics of its dataset are not obvious and there is overlap between the data; the overall performance of the TrafficSign dataset is above 80%, and only the FGSM perturbation sample has a poor effect because the FGSM perturbation coefficient is too high, which is 0.5, resulting in a low recognition rate of the sample. However, the overall algorithm of the deep character tree model performs well and can effectively resist most perturbation attack algorithms, thus achieving image security.
[0060] S6, the model highlights the perturbation decision points corresponding to the output of different perturbation samples; Figure 2 shown.
[0061] The image perturbation defense accuracy is shown in the following table:
[0062] FGSM DeepFool C&W BIM PGD Mnist 99.40% 90.72% 93.86% 94.12% 92.95% FashionMnist 98.24% 81.34% 89.68% 90.08% 86.40% Cifar10 98% 32.15% 37.02% 32.63% 56.54% TrafficSign 94% 55.25% 83.71% 81.35% 80.97%
[0063] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for image interpretability and defense disturbance based on a deep character tree model, characterized in that: The following steps are involved: S1: Collect relevant input image datasets; S2: The input image data needs to be preprocessed to meet the data input requirements of the deep character tree algorithm model; the deep character tree algorithm can adapt to different image formats, build different image data dimension association model parameters, and establish the association of image sample nodes; S3: Use five attack perturbation algorithms, FGSM, DeepFool, C&W, BIM, and PGD, to generate corresponding adversarial samples; normal samples without perturbation of the input image data; S4: Use the corresponding adversarial samples + normal samples as training samples and input them into the deep character tree model to correctly classify the image data samples while resisting the disturbance of the perturbation samples; S5: Use adversarial samples + normal samples that are different from those in training as test samples to test the defense capability of the model; S6: The model highlights the perturbation decision points corresponding to the output of different perturbation samples; among them, The basic parameter definition of the deep character tree algorithm is as follows: a single data sample variable is represented by a lowercase letter x, multiple sample variables and the associated single sample variable are represented by an uppercase letter X, the character is represented by the variable x or its negation ┒x, the logical sentence is composed of literal meaning and conjunctions, i.e., standard AndGate and OrGate, and the set represents their union; the positive input value corresponding to the x sample variable is p1, p2, ..., p n .Negative input values are and The training process of the deep character tree algorithm includes: 1) At the very beginning, we must first ensure that different data sample dimensions can be successfully input into the deep character tree structure; when designing the deep character tree, we consider two nodes: one is a leaf node and the other is an internal node; for leaf nodes, we use all data samples as terminal leaf nodes to ensure that every pixel value of the data sample is taken into account; for internal nodes, we build on the leaf nodes and include two nodes: the left child and the right child; 2) Each decision node in the deep character tree is distributed and decomposed into independent distributions on the right child right and the left child left. The probability of the independent distribution conforms to the given basic probability Prime, and the independent distribution of the data itself can be obtained: Pr q (right·left∣[p i ])=Pr q (right∣[p i ])Pr q (left∣[p i ])=Pr pi (right)Pr si (left) The independence of a logical statement becomes the independence of the context. For the overall structure of the deep character tree, the independence of the logical statement can be directly used in a specific context. In the process of structural adjustment, it is necessary to ensure that the probability of the final combination of the model is maximized, and the association between nodes needs to be considered; in order to ensure the relative independence between data, the mutual information MI() between data is used: Mutual information MI indicates that in the entire deep character tree structure, the data of the right child right and the left child left are independent of each other and have no correlation. MI can ensure that after each node of the deep character tree structure is split, the smallest relationship between the right child right and the left child left is obtained. When actually calculating the MI of the right child right and the left child left, the structural characteristics of the DST itself need to be considered. The MI between the right child right and the left child left of each node should be calculated in pairs to approximate the MI. When AndGate runs between nodes, when the node is AndGate and has left and right children (left / right), it needs to meet the following conditions: where g n (x) is the weight function corresponding to the node, child c i ,i∈[1,m]; When performing the OrGate operation, in addition to the left and right children, the weight values corresponding to the left and right children are also required to satisfy: θ i represents a real-valued parameter, i∈[1,m], f(n,x,c i ) represents the probability flow of sample x at parent node n and child node c, and Pr q (.) is a parameterized distribution. At the same time, each variable X has a probability assigned to a single sample x. The deep character tree structure itself uses a hierarchical logical structure for calculation. The real image sample data is distributed through the Bernoulli distribution, and the image value range of 0-255 is directly mapped to between 0-1; 3) Considering the entire deep character tree structure, the root node n and the child node c are associated locally and globally: n (n,x,c)=f(n,x,c); for any node node in the deep character tree structure, the parent node z1,z x ,…,z m , divided into the following two situations: If the node is on AndGate, the global probability calculation needs to meet the following requirements: If the node is on OrGate, the global probability calculation needs to meet the following requirements: At this time, the continuous variable is calculated by the probability of the binary value x; therefore, for the operation of the OrGate and AndGate nodes, it can be converted into the following form: For continuous values, AndGate needs to satisfy: For continuous values, OrGate needs to satisfy: At the final root node, there is a corresponding weight function g(x). When solving the corresponding probability of the data sample, the probability finally obtained by calculating x and θ is:
2. The image interpretability and disturbance defense method based on the deep character tree model according to claim 1, characterized in that: The process of collecting relevant input image datasets in S2 includes two methods: 1): The first method is based on open source data sets published by authoritative websites, including Mnist, FashionMnist, Cifar10 and other data sets; 2): The second method is to use Python crawler technology to crawl the corresponding images based on the relevant data open source and published by the basic website, including the TrafficSign dataset; the crawled image dataset needs to undergo relevant preprocessing operations, including image category limitation, image format adjustment, image compression, and image merging operations. The categories are divided into 50 categories, and each category is limited to 2,000 images; if the number of categories is insufficient, appropriate data enhancement is performed.
3. The image interpretability and disturbance defense method based on the deep character tree model according to claim 1, characterized in that: In S2, the algorithm needs to be built on the basis of a deep character tree, and the leaf node n of the tree is used as the original data input of the image. Therefore, for different image data, corresponding matching leaf nodes n need to be paired with them, and their input is set to input {X|x1,x2,…,xn}, where X is specifically a mixed perturbation sample and a normal sample, and different image data inputs correspond to different deep character tree leaf nodes.
4. The image interpretability and disturbance defense method based on the deep character tree model according to claim 1, characterized in that: In S3, for different data sample inputs, different perturbation algorithm models need to be constructed, namely: FGSM algorithm; DeepFool algorithm; BIM algorithm; C&W algorithm; PGD algorithm.
5. The image interpretability and disturbance defense method based on the deep character tree model according to claim 1, characterized in that: In S4, the adversarial samples obtained in S3 are needed. The corresponding adversarial samples are combined with normal samples as training samples xtrain, which are input into the image interpretability defense perturbation model f(.) based on character AI to classify the image.
6. The image interpretability and disturbance defense method based on a deep character tree model according to claim 1, characterized in that: In S5, the adversarial samples obtained in S3 need to be used, and the corresponding different adversarial samples are combined with normal samples as training samples xtest, which are input into the trained model f(.) to present the final output results.
7. The image interpretability and disturbance defense method based on the deep character tree model according to claim 1, characterized in that: In S6, the model is optimized through the final output result of the model, and the key decision points of different disturbance samples are visualized.
