Deep neural network training method based on potential concept confusion
Through a deep neural network training method based on latent concept obfuscation, a two-level encoder and quantization technology are used to generate concept obfuscation samples, the problem of insufficient performance of deep neural networks in the face of adversarial attacks and distribution drifts is solved, and stronger generalization capabilities and performance improvements are achieved.
Patent Information
- Application Number
- CN202411727060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Existing deep neural networks have insufficient performance in the face of adversarial attacks and data distribution drift, especially poor defense against non-seen or different types of attacks, and may degrade performance on the raw data.
A deep neural network training method based on latent concept obfuscation is adopted, high-latitude data is encoded through a two-level encoder to generate underlying and upper latent embedding representations, quantify upper latent embedding representations, replace latent concept locations, generate concept evaluation samples and concept obfuscation samples, and are used to fine-tune the target model.
This method reduces the over-reliance of the model on specific concepts, enhances the model's resistance to complex environments and distribution drifts, and significantly improves the model's performance and generalization capabilities, especially in the face of diversified adversarial attacks and distribution drifts.
Smart Images

Figure CN119669754A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning, and in particular to a deep neural network training method based on potential concept confusion. Background Art
[0002] Deep neural networks (DNNs) have made significant progress in the past decade and are widely used in various fields such as image classification, natural language processing, and speech recognition. However, as deep learning models are deployed in more and more practical applications, their performance shortcomings are gradually exposed. In particular, under challenges such as adversarial attacks, data distribution drift, and noise interference, the performance of DNNs is far from meeting the requirements of practical applications.
[0003] In order to solve the problem of insufficient performance of deep learning models, researchers have proposed a variety of adversarial defense methods, including adversarial training, random smoothing, gradient masking and other strategies. Adversarial training is one of the most effective methods currently. Its basic idea is to use adversarial samples as additional training data to enhance the model's resistance to similar attacks. However, the main drawback of adversarial training is its dependence on the type of attack, which means that the model can only perform well against known types of adversarial attacks, and its defense effect is often poor for unseen or different types of attacks. In addition, adversarial training usually leads to a decrease in the performance of the model on the original data, that is, there is a trade-off between performance and accuracy.
[0004] In addition to adversarial training, other defense methods also have obvious limitations. For example, random smoothing makes the model less sensitive to small perturbations by adding noise to the input data, but this method often requires high computational overhead and has limited effectiveness when facing high-dimensional data. Gradient masking defends against attacks by reducing the differentiability of adversarial samples in the model, but it can be easily bypassed by stronger attack methods and therefore cannot provide long-term and effective security protection.
[0005] Therefore, current defense technologies still have many shortcomings, especially when facing diverse, unseen adversarial attacks and distribution drift, the performance of existing methods still needs to be greatly improved. Summary of the invention
[0006] The purpose of the present invention is to provide a deep neural network training method based on potential concept confusion in order to improve the defense performance of the neural network against adversarial attacks and distribution drift.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] A deep neural network training method based on potential concept confusion, the method comprising the following steps:
[0009] S1, obtaining high-dimensional data, inputting the high-dimensional data into a pre-trained encoder, encoding the high-dimensional data through a two-stage encoder to obtain a bottom-layer potential embedding representation and an upper-layer potential embedding representation, and quantizing the upper-layer potential embedding representation to obtain a quantized upper-layer potential embedding representation;
[0010] S2, given a position in the quantized upper potential embedding representation, replace the encoding vector of the position with the other encoding vectors in the encoding book, repeat S2, replace each position N times, and obtain N concept evaluation samples;
[0011] S3, inputting N concept evaluation samples into the target decision model, recording the entropy of the labels output by the N models, and for any position, if the entropy of the position is greater than a given threshold, determining the position as an under-learned concept position, and obtaining an under-learned concept position set;
[0012] S4, for the under-learned concept position, the encoding vector of the position is replaced with a blank concept encoding vector, and the replaced quantized upper layer potential embedding representation is passed through a hierarchical decoder to obtain a concept confusion sample;
[0013] S5. Fine-tune the target model based on the concept confusion samples to obtain a result model, where the result model is used for image classification tasks.
[0014] Furthermore, the high-dimensional data is input into a pre-trained encoder, and after being encoded by a two-stage encoder, the specific steps of obtaining a bottom-layer potential embedding representation and an upper-layer potential embedding representation are as follows:
[0015] The first level encoder in the pre-trained encoder encodes the underlying latent embedding representation, which is then encoded by the second level encoder in the pre-trained encoder to obtain an upper level latent embedding representation. The upper level latent embedding representation is quantized to obtain a quantized upper level latent embedding representation.
[0016] Furthermore, the quantization is implemented based on the codebook, and the specific steps of quantization are:
[0017] For the potential embedding representation, the encoding vector with the smallest Euclidean distance is found from the encoding vector set of the encoding book as the quantized potential embedding representation, and the serial number of the quantized potential embedding representation in the encoding book is recorded.
[0018] Furthermore, the quantized potential embedding representation satisfies:
[0019]
[0020] where d min represents the Euclidean distance, represents the jth potential embedding representation, z erepresents the potential embedding representation set, b j represents the encoding vector, B represents the encoding vector set, Representation of quantized latent embedding representations.
[0021] Furthermore, the encoding vector set is:
[0022]
[0023] Where C is the size of the codebook.
[0024] Furthermore, the replaced quantized upper potential embedding representation is passed through a hierarchical decoder to obtain a concept confusion sample in the following specific steps:
[0025] The replaced quantized upper-layer potential embedding representation is input into the upper-layer decoder of the hierarchical decoder, and the upper-layer reconstruction representation is output. The upper-layer reconstruction representation and the bottom-layer potential embedding representation are quantized and input into the bottom-layer decoder of the hierarchical decoder together, and the concept confusion sample is output.
[0026] Furthermore, the quantized upper layer potential embedding is expressed as:
[0027]
[0028] Among them, z e is the quantized upper layer potential embedding, z e-up is the upper layer potential embedding, C up The size of the upper layer feature quantization code, z e-down is the quantized underlying latent embedding representation.
[0029] Furthermore, the quantized underlying latent embedding is expressed as:
[0030]
[0031] Among them, x represents high-latitude data, z e-down represents the underlying latent embedding representation, C down Indicates the size of the underlying feature quantization code.
[0032] Furthermore, the image classification task is used for autonomous driving or medical diagnosis or financial service tasks.
[0033] Furthermore, the encoder is a convolutional neural network or an autoencoder or a variational autoencoder.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The present invention analyzes and processes the potential concepts of the data, uses a two-stage encoder, first encodes the input through the first-stage encoder to obtain a high-level potential representation (a more abstract concept representation), and then uses the second-stage encoder to refine the high-level potential representation to capture more detailed local features, and then generates a set of concept confusion samples. Through this confusion operation, the model's excessive dependence on certain specific concepts is reduced, so that the model can learn global information more generally, and enhance its resistance to complex environments and distribution drift. The generated concept confusion samples and correct labels are used to fine-tune the target model, prompting the model to learn more performant feature representations. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of the present invention;
[0037] Figure 2 A hierarchical latent concept space mapping module of the present invention;
[0038] Figure 3 The under-learned concept identification module of the present invention;
[0039] Figure 4 This is a flowchart of the adversarial training based on concept confusion of the present invention. DETAILED DESCRIPTION
[0040] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0041] The present invention proposes a deep neural network training method based on potential concept confusion. The flowchart of the method is as follows: Figure 1 The method comprises the following steps:
[0042] S1, obtaining high-dimensional data, inputting the high-dimensional data into a pre-trained encoder, encoding the high-dimensional data through a two-stage encoder to obtain a bottom-layer potential embedding representation and an upper-layer potential embedding representation, and quantizing the upper-layer potential embedding representation to obtain a quantized upper-layer potential embedding representation;
[0043] S2, given a position in the quantized upper potential embedding representation, replace the encoding vector of the position with the other encoding vectors in the encoding book, repeat S2, replace each position N times, and obtain N concept evaluation samples;
[0044] S3, inputting N concept evaluation samples into the target decision model, recording the entropy of the labels output by the N models, and for any position, if the entropy of the position is greater than a given threshold, determining the position as an under-learned concept position, and obtaining an under-learned concept position set;
[0045] S4, for the under-learned concept position, the encoding vector of the position is replaced with a blank concept encoding vector, and the replaced quantized upper layer potential embedding representation is passed through a hierarchical decoder to obtain a concept confusion sample;
[0046] S5. Fine-tune the target model based on the concept confusion samples to obtain a result model, where the result model is used for image classification tasks.
[0047] The present invention aims to provide a method for enhancing the performance of deep neural networks based on latent concept confusion. Different from traditional defense methods, the core idea of the present invention is to reduce the model's excessive dependence on certain specific concepts by analyzing and processing the latent concepts of the data, so that the model can learn global information more generally and enhance its resistance to complex environments and distribution drift.
[0048] The modules corresponding to the above steps are:
[0049] Hierarchical latent concept space mapping: First, high-dimensional data is mapped into the latent concept space through a pre-trained encoder to obtain an abstract concept representation of the data. The encoder can be based on a convolutional neural network (CNN), an autoencoder, or a variational autoencoder (VAE). This representation helps capture the main conceptual elements in the data and avoids the model from being overly dependent on specific details, thus laying the foundation for subsequent performance enhancement.
[0050] Identification of under-learned concept patterns: In the latent concept space, the under-learned concept strategy is used to identify those latent concepts that have a critical impact on classification decisions but are prone to decision fluctuations. Specifically, by analyzing the activation of the model on the latent concepts, those concepts that have a significant fluctuation effect on the model's decision are identified. These under-learned concepts are usually due to the lack of corresponding training data, and the model produces overfitting representations.
[0051] Adversarial learning based on concept confusion: Based on the identified under-learned concept patterns, a method of controlling the modification of latent concepts is used to generate concept adversarial samples. The modified concepts are restored through the decoder, and the adversarial samples obtained are used to train the model. In this way, the model can learn how to resist various attacks at the conceptual level, thereby improving its performance.
[0052] The method of the present invention has wide applicability, and is particularly suitable for the following scenarios:
[0053] Autonomous driving: In autonomous driving, the vehicle needs to navigate in various complex environments, such as changing lighting, rainy and snowy weather, etc. The method of the present invention can improve the performance of the model in these complex environments and ensure the safety and reliability of the autonomous driving system.
[0054] Medical diagnosis: In medical image analysis, the model needs to face images from different devices and different imaging conditions. The method of the present invention can improve the generalization ability of the model under different conditions, thereby providing more reliable diagnosis results.
[0055] Financial services: In financial transactions, models need to identify abnormal transaction behaviors and prevent fraudulent activities. The method of the present invention can effectively prevent adversarial attacks on financial systems and ensure the security of the system by improving the performance of the model.
[0056] Compared with the prior art, the method of the present invention can significantly improve the performance and generalization ability of the model when dealing with various types of adversarial attacks and distribution drift.
[0057] Experimental results show that the method of the present invention is superior to the traditional adversarial training method in multiple dimensions:
[0058] Adversarial attack resistance: When facing adversarial attacks, the use of the proposed method reduces the attack success rate of the model by more than 30%. This shows that through latent space concept confusion, the model is able to better cope with the performance of different environments.
[0059] Distribution drift performance: On the distribution drift dataset, the method of the present invention significantly improves the classification accuracy of the model, proving that it has stronger adaptability when facing complex data changes in real applications.
[0060] Performance in data-scarce environments: When training data is scarce, the method of the present invention also shows a significant performance improvement of 20%, which has important practical significance for some application scenarios where data acquisition is difficult, such as medical and industrial testing.
[0061] In the present invention, it is preferred to use the concept vector quantization variational autoencoder (VQVAE) to realize the potential concept space mapping. VQVAE combines the advantages of autoencoders and vector quantization, and can effectively capture the discrete concept features in the data. VQVAE consists of three modules: an encoder E, a decoder D, and a self-learning codebook B. Its training process includes three stages: encoding, quantization and decoding:
[0062] Encoding: The input data x is first mapped to the latent space through the encoder E to generate a continuous latent representation Where A is the number of encoded latent representations, and each latent representation is a d-dimensional vector.
[0063] Quantization: Mapping the continuous latent representation to the most similar discrete encoding vector in the codebook. Given the latent representation z generated by the encoder e , the code vector set is Where C is the size of the codebook and each code vector is a d-dimensional vector. The quantization process is done by finding the code vector that minimizes the Euclidean distance: Quantized representation obtained by quantization Each element is a latent representation The index of the most similar encoding vector found in the codebook.
[0064] Decoding: The quantized latent representation is reconstructed by the decoder x' = D(z q ),in The training goal of VQVAE is to minimize the reconstruction error while maintaining the sparsity and discreteness of the latent representation. This paper further improves the quality and representation ability of concept mapping. By introducing a multi-layer latent structure, the model can better capture the multi-scale characteristics of the data. Figure 2 As shown, the hierarchical latent concept space mapping module in the present invention adopts a two-stage encoder and decoder architecture:
[0065] Multi-layer latent coding: Using a two-stage encoder, the input is first encoded by the first-stage encoder to obtain a high-level latent representation (a more abstract concept representation), and then the high-level latent representation is refined using the second-stage encoder to capture more detailed local features.
[0066] Layer-by-layer quantization: The potential representation of each layer is quantized through the corresponding codebook. Let the potential representation of the first layer be z e-down , the second layer is z e-up , the quantization process is:
[0067] Hierarchical decoding: The decoder starts from high-level latent representation and decodes layer by layer, gradually restoring the original data, making the final reconstruction more refined. Through this multi-level encoding and decoding structure, the hierarchical latent concept space mapping can better capture the global and local information of the data and enhance the expressiveness of the latent concepts.
[0068] The common latent space concepts in the data are captured through the vector quantization mechanism. This concept representation can not only improve the efficiency of targeted training, but also provide a better understanding of the internal working mechanism of the model.
[0069] Under-learned concept recognition module: Figure 3As shown in FIG. 1 , the present invention applies an interference strategy to the potential concept representation to identify the concepts that have been well learned and the concepts that are under-learned. Specifically, A position is given in the codebook, and then the encoding vector of this position is replaced with other encoding vectors in the codebook to generate concept evaluation samples. Each position is replaced N times, and then N samples are reconstructed. The N reconstructed samples are input into the target decision model (such as a classification model), and the entropy of the N output labels is recorded. If the entropy of the position is greater than the given threshold, the position is determined to be an under-learned concept position.
[0070] Adversarial training based on concept confusion: Figure 4 As shown, given a set of under-learned concept positions of a sample, the present invention replaces them one by one with blank concept encoding vectors to generate a set of concept confusion samples. Through this confusion operation, the model's dependence on these concepts that are prone to errors can be reduced, allowing the model to learn other important features more generally. The generated concept confusion samples and correct labels are used to fine-tune the target model, prompting the model to learn more performant feature representations.
[0071] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A deep neural network training method based on potential concept confusion, characterized in that: The method comprises the following steps: S1, obtaining high-dimensional data, inputting the high-dimensional data into a pre-trained encoder, encoding the high-dimensional data through a two-stage encoder to obtain a bottom-layer potential embedding representation and an upper-layer potential embedding representation, and quantizing the upper-layer potential embedding representation to obtain a quantized upper-layer potential embedding representation; S2, given a position in the quantized upper potential embedding representation, replace the encoding vector of the position with the other encoding vectors in the encoding book, repeat S2, replace each position N times, and obtain N concept evaluation samples; S3, inputting N concept evaluation samples into the target decision model, recording the entropy of the labels output by the N models, and for any position, if the entropy of the position is greater than a given threshold, determining the position as an under-learned concept position, and obtaining an under-learned concept position set; S4, for the under-learned concept position, the encoding vector of the position is replaced with a blank concept encoding vector, and the replaced quantized upper layer potential embedding representation is passed through a hierarchical decoder to obtain a concept confusion sample; S5. Fine-tune the target model based on the concept confusion samples to obtain a result model, where the result model is used for image classification tasks.
2. A deep neural network training method based on potential concept confusion according to claim 1, characterized in that: The specific steps of inputting the high-dimensional data into a pre-trained encoder and encoding it through a two-stage encoder to obtain a bottom-layer potential embedding representation and an upper-layer potential embedding representation are as follows: The first level encoder in the pre-trained encoder encodes the underlying latent embedding representation, which is then encoded by the second level encoder in the pre-trained encoder to obtain an upper level latent embedding representation. The upper level latent embedding representation is quantized to obtain a quantized upper level latent embedding representation.
3. A deep neural network training method based on potential concept confusion according to claim 2, characterized in that: The quantization is implemented based on the codebook, and the specific steps of quantization are: For the potential embedding representation, the encoding vector with the smallest Euclidean distance is found from the encoding vector set of the encoding book as the quantized potential embedding representation, and the serial number of the quantized potential embedding representation in the encoding book is recorded.
4. A deep neural network training method based on potential concept confusion according to claim 2, characterized in that: The quantized latent embedding representation satisfies: where d min represents the Euclidean distance, represents the jth potential embedding representation, z e represents the potential embedding representation set, b j represents the encoding vector, B represents the encoding vector set, Representation of quantized latent embedding representations.
5. A deep neural network training method based on potential concept confusion according to claim 4, characterized in that: The encoding vector set is: Where C is the size of the codebook.
6. The method for training a deep neural network based on potential concept confusion according to claim 1, characterized in that: The replaced quantized upper potential embedding representation is passed through a hierarchical decoder to obtain a concept confusion sample in the following specific steps: The replaced quantized upper-layer potential embedding representation is input into the upper-layer decoder of the hierarchical decoder, and the upper-layer reconstruction representation is output. The upper-layer reconstruction representation and the bottom-layer potential embedding representation are quantized and input into the bottom-layer decoder of the hierarchical decoder together, and the concept confusion sample is output.
7. A deep neural network training method based on potential concept confusion according to claim 6, characterized in that: The quantized upper layer latent embedding is expressed as: Among them, z e is the quantized upper layer potential embedding, z e-up is the upper layer potential embedding, C up The size of the upper layer feature quantization code, z e-down is the quantized underlying latent embedding representation.
8. The method for training a deep neural network based on potential concept confusion according to claim 7, characterized in that: The quantized underlying latent embedding is represented as: Among them, x represents high-latitude data, z e-down represents the underlying latent embedding representation, C down Indicates the size of the underlying feature quantization code.
9. The method for training a deep neural network based on potential concept confusion according to claim 7, characterized in that: The image classification task is used for autonomous driving or medical diagnosis or financial services tasks.
10. The method for training a deep neural network based on potential concept confusion according to claim 1, characterized in that: The encoder is a convolutional neural network or an autoencoder or a variational autoencoder.
Citation Information
Patent Citations
Face generation picture replacement method and system based on adversarial network
CN110503601A
Negative sample adversarial generation method with noise learning
CN111428853A
Defense method for quantitatively identifying countermeasure attacks based on concept sensitivity
CN111753881A
Adversarial sample defense method and system based on de-noising auto-encoder
CN116595515A
Concept-based adversarial generation method with steerable and diverse semantics
US20220277187A1