A deep neural network training method based on latent concept confusion
Through the deep neural network training method of potential concept confusion, using two-stage encoder and under-learning concept recognition to generate concept confusion samples, the problem of insufficient defense of deep neural networks under adversarial attacks and distribution drift is solved, and the generalization ability and performance of the model are improved.
Patent Information
- Application Number
- CN202411727060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Existing deep neural networks have insufficient defense performance when facing adversarial attacks and data distribution drift, especially poor defense against unseen or different types of attacks, and there is a trade-off between performance and accuracy.
A deep neural network training method based on potential concept confusion is adopted. High-dimensional data is encoded through a two-stage encoder to identify under-learned concepts and generate concept confusion samples. By fine-tuning the target model, the dependence on specific concepts is reduced and the generalization ability of the model is enhanced.
The model's defense performance against various types of adversarial attacks and distribution drift has been significantly improved, and its classification accuracy and generalization ability in complex environments have been enhanced, especially in data-scarce conditions.
Smart Images

Figure CN119669754B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of deep learning, and in particular to a deep neural network training method based on latent concept confusion. BACKGROUND
[0002] Deep neural networks (DNNs) have made remarkable progress in the past decade and are widely applied in various fields such as image classification, natural language processing, speech recognition, etc. However, as deep learning models are deployed in more and more practical applications, their performance shortfalls are gradually exposed. Especially under the challenges of adversarial attacks, data distribution drift, noise interference, etc., the performance of DNNs is far from meeting the requirements of practical applications.
[0003] To solve the performance deficiency problem of deep learning models, researchers have proposed various adversarial defense methods, including adversarial training, random smoothing, gradient masking, etc. Adversarial training is one of the most effective methods, and 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 attack types, which means that the model can only have performance against known types of adversarial attacks, and its defense effect is often poor against unseen or different types of attacks. In addition, adversarial training often leads to a decrease in model performance on original data, i.e., 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 effect when facing high-dimensional data. Gradient masking is to reduce the derivability of adversarial samples in the model to defend against attacks, but it can be easily bypassed by stronger attack methods, thus cannot provide long-term effective security protection.
[0005] Therefore, the current defense technology still has many deficiencies, especially when facing diversified, unseen adversarial attacks and distribution drift, the performance of existing methods still needs to be greatly improved. SUMMARY
[0006] The purpose of the present application is to provide a deep neural network training method based on latent concept confusion to improve the defense performance of neural networks against adversarial attacks and distribution drift.
[0007] The purpose of the present application can be achieved by the following technical solutions:
[0008] A deep neural network training method based on latent concept confusion, the method comprising the following steps:
[0009] S1, obtaining high latitude data, inputting the high latitude data through a pre-trained encoder, obtaining a bottom layer latent embedding representation and an upper layer latent embedding representation after encoding through two level encoders, and obtaining a quantized upper layer latent embedding representation after quantizing the upper layer latent embedding representation;
[0010] S2, giving a position from the quantized upper layer latent embedding representation, replacing the encoding vector of the position with other encoding vectors of the codebook, repeating S2, replacing N times for each position, and obtaining N concept evaluation samples;
[0011] S3, inputting the N concept evaluation samples into a 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 that the position is an under-learning concept position, and obtaining an under-learning concept position set;
[0012] S4, for the under-learning concept position, replacing the encoding vector of the position with a blank concept encoding vector, and obtaining a concept confusion sample after the replaced quantized upper layer latent embedding representation passes through a hierarchical decoder;
[0013] S5, fine-tuning the target model based on the concept confusion sample to obtain a result model, and the result model is used for an image classification task.
[0014] Further, the specific steps of inputting the high latitude data through the pre-trained encoder and obtaining the bottom layer latent embedding representation and the upper layer latent embedding representation after encoding through the two level encoders are as follows:
[0015] The bottom layer latent embedding representation is obtained after encoding through the first level encoder in the pre-trained encoder, and the upper layer latent embedding representation is obtained after encoding through the second level encoder in the pre-trained encoder. After quantizing the upper layer latent embedding representation, a quantized upper layer latent embedding representation is obtained.
[0016] Further, the quantization is implemented based on a codebook, and the specific steps of quantization are as follows:
[0017] For the latent embedding representation, find the encoding vector with the minimum Euclidean distance from the encoding vector set of the codebook as the quantized latent embedding representation, and record the serial number of the quantized latent embedding representation in the codebook.
[0018] Further, the quantized latent embedding representation satisfies:
[0019]
[0020] where d min represents the Euclidean distance, represents the jth latent embedding representation, and z erepresents a set of latent embedding representations, b j represents an encoding vector, B represents a set of encoding vectors, represents a quantized latent embedding representation.
[0021] Further, the set of encoding vectors is:
[0022]
[0023] wherein C is the size of the codebook.
[0024] Further, the specific steps for obtaining the concept confusion sample by the replaced quantized upper-layer latent embedding representation passing through the hierarchical decoder are:
[0025] The replaced quantized upper-layer latent embedding representation is input into the upper-layer decoder of the hierarchical decoder, and an upper-layer reconstructed representation is output; the upper-layer reconstructed representation and the quantized lower-layer latent embedding representation are input into the lower-layer decoder of the hierarchical decoder together, and the concept confusion sample is output.
[0026] Further, the quantized upper-layer latent embedding representation is:
[0027]
[0028] wherein z e is a quantized upper-layer latent embedding, z e-up is an upper-layer latent embedding, C up is the size of the upper-layer feature quantization code, and z e-down is a quantized lower-layer latent embedding representation.
[0029] Further, the quantized lower-layer latent embedding representation is:
[0030]
[0031] wherein x represents high-dimensional data, z e-down represents a lower-layer latent embedding representation, C down represents the size of the lower-layer feature quantization code.
[0032] Further, the image classification task is used for automatic driving or medical diagnosis or financial service tasks.
[0033] Further, the encoder is a convolutional neural network or an autoencoder or a variational autoencoder.
[0034] Compared with the prior art, the present application has the following beneficial effects:
[0035] The present application analyzes and processes the potential concepts of data, uses two-level encoders, first encodes the input through the first-level encoder to obtain a high-level potential representation (a more abstract concept representation), and then refines the high-level potential representation by using the second-level encoder to capture more detailed local features, and then generates a set of concept confusion samples. Through such confusion operation, the over-reliance of the model on certain specific concepts is reduced, so that the model can learn global information more generally, and the resistance to complex environment and distribution drift is enhanced, the generated concept confusion samples and correct labels are used to fine-tune the target model, and the model is prompted to learn more performance feature representation. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 a flowchart of the present application;
[0037] Figure 2 a hierarchical potential concept space mapping module of the present application;
[0038] Figure 3 an under-learned concept recognition module of the present application;
[0039] Figure 4 a concept confusion-based adversarial training flowchart of the present application. DETAILED DESCRIPTION
[0040] The present application will be described in detail below in conjunction with the drawings and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present application, and gives a detailed implementation manner and specific operation process, but the protection scope of the present application is not limited to the following embodiments.
[0041] The present application proposes a deep neural network training method based on potential concept confusion, and the flowchart of the method is as shown in Figure 1 The method comprises the following steps:
[0042] S1, obtaining high-latitude data, inputting the high-latitude data through a pre-trained encoder, obtaining a bottom-level potential embedding representation and a top-level potential embedding representation after encoding by two-level encoders, and quantizing the top-level potential embedding representation to obtain a quantized top-level potential embedding representation;
[0043] S2, giving a position from the quantized top-level potential embedding representation, replacing the encoding vector of the position with other encoding vectors of the encoding base, repeating S2, replacing N times for each position, and obtaining N concept evaluation samples;
[0044] S3, inputting the N concept evaluation samples into a 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 that the position is an under-learned concept position, and obtaining an under-learned concept position set;
[0045] S4, for the under-learning concept position, replace the encoding vector of the position with a blank concept encoding vector, and the replaced quantized upper layer latent embedding is input into the hierarchical decoder to obtain a concept confusion sample;
[0046] S5, based on the concept confusion sample, fine-tune the target model to obtain a result model, and the result model is used for an image classification task.
[0047] The present application aims to provide a deep neural network performance enhancement method based on latent concept confusion. Unlike traditional defense methods, the core idea of the present application is to analyze and process the latent concepts of data, thereby reducing the over-reliance of the model on certain specific concepts, enabling the model to learn global information more generally, and enhancing its resistance to complex environments and distribution drift.
[0048] The modules corresponding to the above steps are:
[0049] Hierarchical latent concept space mapping: first, map high-dimensional data to a latent concept space through a pre-trained encoder to obtain an abstract concept representation of the data. The selection of the encoder can be based on a convolutional neural network (CNN), or based on an autoencoder (Autoencoder) or variational autoencoder (VAE). This representation helps to capture the main concept elements in the data, avoiding the model's over-reliance on specific details, thereby laying the foundation for subsequent performance enhancement.
[0050] Identification of under-learning concept patterns: in the latent concept space, use the under-learning concept strategy to identify those latent concepts that have a key impact on classification decisions but are prone to cause decision fluctuations. Specifically, by analyzing the model's activation on the latent concepts, those concepts that have a significant impact on the model's decision fluctuations are identified. These under-learning concepts are usually due to the lack of corresponding training data, and the model produces an over-fitted representation.
[0051] Concept confusion-based adversarial learning: based on the identified under-learning concept patterns, a method of modifying the latent concepts in a controlled manner is used to generate concept adversarial samples. The modified concepts are restored through the decoder to obtain adversarial samples for model training. In this way, the model can learn how to resist various attacks at the concept level, thereby improving its performance.
[0052] The method of the present application has wide applicability, and is particularly suitable for the following scenarios:
[0053] Autonomous driving: In autonomous driving, vehicles need to navigate in various complex environments such as changing light, rain, and snow. The method of the present invention can improve the performance of the model in these complex environments, ensuring the safety and reliability of the autonomous driving system.
[0054] Medical diagnosis: In medical image analysis, models need to face images from different devices and different imaging conditions. The method of the present invention can improve the generalization ability of the model in the face of different conditions, thereby providing more reliable diagnostic results.
[0055] Financial services: In financial transactions, models need to identify abnormal transaction behavior and prevent fraudulent activities. The method of the present invention can effectively prevent adversarial attacks on financial systems by improving the performance of the model, ensuring the security of the system.
[0056] Compared with the prior art, the method of the present invention can significantly improve the performance and generalization ability of the model in response to various types of adversarial attacks and distribution drift.
[0057] Experimental results show that the method of the present invention is superior to traditional adversarial training methods in multiple dimensions:
[0058] Adversarial attack resistance: When facing adversarial attacks, the use of the method of the present invention reduces the attack success rate of the model by more than 30%. This shows that through latent space concept confusion, the model can better cope with different environmental performance.
[0059] Distribution drift performance: On the distribution drift dataset, the method of the present invention significantly improves the classification accuracy of the model, proving its stronger adaptability in the face of complex data changes in real-world applications.
[0060] Performance in data-scarce environments: In the case of less training data, the method of the present invention also shows a significant performance improvement of 20%. This has important practical significance for some data acquisition difficult application scenarios, such as medical and industrial detection.
[0061] In the present invention, a vector quantization variational autoencoder (VQVAE) is preferably used to implement the latent concept space mapping. VQVAE combines the advantages of autoencoders and vector quantization, and can effectively capture discrete concept features in data. VQVAE consists of three modules: an encoder E, a decoder D, and a self-learning codebook B. Its training process includes three stages of encoding, quantization, and decoding:
[0062] Encoding: The input data x is first mapped to the latent space by the encoder E to generate continuous latent representations where A is the number of encoded latent representations, and each latent representation is a d-dimensional vector.
[0063] Quantization: Map continuous latent representation to the closest discrete code vector in the codebook. Given a latent representation z e generated by the encoder, 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: The quantized representation is obtained by quantization where each element is the latent representation The index of the closest code vector found in the codebook.
[0064] Decoding: The quantized latent representation is reconstructed by the decoder x' = D(z q ), where The training objective of VQVAE is to minimize the reconstruction error while maintaining the sparsity and discreteness of the latent representation. The invention further improves the quality and representational capacity of concept mapping. By introducing a multi-layer latent structure, the model can better capture the multi-scale features of the data. As Figure 2 shown, the hierarchical latent concept space mapping module in the invention adopts a two-level encoder and decoder architecture:
[0065] Multi-layer latent encoding: Using a two-level encoder, first encode the input through the first-level encoder to obtain a high-level latent representation (a more abstract concept representation), and then use the second-level encoder to refine the high-level latent representation to capture more detailed local features.
[0066] Layer-wise quantization: Each layer of latent representation is quantized by the corresponding codebook. Let the first layer latent representation be z e-down , the second layer be z e-up , and the quantization process be:
[0067] Layer-wise decoding: The decoder starts from the high-level latent representation and decodes layer by layer, gradually restoring the original data, so that the final reconstruction result is more detailed. 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, enhancing the expressiveness of the latent concept.
[0068] Capture common latent space concepts in data through vector quantization mechanism. This concept representation not only improves the efficiency of targeted training, but also provides a better understanding of the internal working mechanism of the model.
[0069] Under-learning concept recognition module: As Figure 3As shown in FIG, the present invention applies an interference strategy to the potential concept representation to identify concepts that have been well learned and concepts that are under-learned. Given a position in the codebook, the encoding vector at that position is replaced with encoding vectors from other locations in the codebook to generate concept evaluation samples. Each position is replaced N times, and N samples are reconstructed. These 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 a position is greater than a given threshold, it is considered an under-learned concept position.
[0070] Adversarial training based on concept confusion: Figure 4 As shown, given a set of under-learned concept locations for a sample, the present invention replaces them one by one with blank concept encoding vectors, generating a set of concept-confused samples. This confusion operation reduces the model's reliance on these error-prone concepts, enabling the model to more generally learn other important features. Using the generated concept-confused samples and the correct labels, the target model is fine-tuned, enabling the model to learn more performant feature representations.
[0071] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined 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. Obtain high-dimensional data, input the high-dimensional data into a pre-trained encoder, encode it through a two-stage encoder to obtain a bottom-layer potential embedding representation and an upper-layer potential embedding representation, and quantize the upper-layer potential embedding representation to obtain a quantized upper-layer potential embedding representation; S2. Given a position in the quantized upper-level latent embedding representation, replace the encoding vector of the position with the encoding vector of the other positions in the codebook. Repeat S2, replacing each position N times, and obtain N concept evaluation samples. S3. Input N concept evaluation samples into the target decision model, record 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, determine that the position is an under-learned concept position, and obtain the 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. The replaced quantized upper-layer latent 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 sample to obtain a result model, wherein the result model is used for the image classification task; The replaced quantized upper layer 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, which outputs the upper-layer reconstruction representation. 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, which outputs the concept confusion sample.
2. A deep neural network training method based on potential concept confusion according to claim 1, characterized in that: 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 the bottom-layer potential embedding representation and the upper-layer potential embedding representation are as follows: The first-level encoder in the pre-trained encoder is used to encode 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 that minimizes the Euclidean distance is found from the encoding vector set of the encoding book as the quantized potential embedding representation, and the sequence number of the quantized potential embedding representation in the encoding book is recorded.
4. The method for training a deep neural network 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, Representing 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 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.
7. A deep neural network training method based on potential concept confusion according to claim 6, 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.
8. The method for training a deep neural network based on potential concept confusion according to claim 6, characterized in that: The image classification task is used for autonomous driving or medical diagnosis or financial services tasks.
9. 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, an autoencoder, or a variational autoencoder.
Citation Information
Patent Citations
Face generation picture replacement method and system based on adversarial network
CN110503601A
Defense method for quantitatively identifying countermeasure attacks based on concept sensitivity
CN111753881A