A small sample classification method based on complete representation and generalized description
Through the combined knowledge distillation strategy of hybrid pooling module and autoencoder, the problem of incomplete character description of convolutional neural networks is solved, and the refined modeling and generalization ability of small sample classification are achieved.
Patent Information
- Application Number
- CN202510812039.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-18
AI Technical Summary
The existing convolutional neural network pooling mechanism extracts only some statistics of feature distribution, resulting in incomplete description of feature embedding, and it is difficult to provide sufficient information representation for small sample learning tasks, affecting classification accuracy and generalization capabilities.
The hybrid pooling module is used to combine dual statistics such as mean and covariance, combine the autoencoder compression and reconstruction features, and through the knowledge distillation strategy, a category relationship diagram maintenance strategy is introduced to optimize the multi-task loss function of the student network, and the refined modeling of embedded features is realized.
It significantly improves the description integrity and generalization ability of feature embedding, and improves the accuracy and generalization ability of small sample classification.
Smart Images

Figure CN120336974B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a small sample classification method based on complete expression and generalized description. Background Art
[0002] Existing few-shot classification methods are primarily categorized into meta-learning-based methods and transfer learning-based methods. Meta-learning-based methods typically rely on complex multi-stage training processes, dividing the base dataset into a series of FSC tasks to simulate test scenarios. This results in high training costs and is highly sensitive to task structure. In contrast, transfer learning methods offer the advantages of greater simplicity and efficiency by feeding the entire base dataset into convolutional neural networks (CNNs) for feature learning and fine-tuning the classifier based on a small number of target samples. In CNN architectures, pooling is a key mechanism for embedding feature generation, with strategies such as global average pooling (GAP), global max pooling (GMP), generalized mean pooling (GeMP), and global covariance pooling (GCP) commonly employed. However, from a probability distribution perspective, these methods typically only extract partial statistics of the tensor feature distribution and lack the ability to express the complete distribution structure. This results in insufficient discriminability and generalization of the resulting embedding vectors, making them incapable of meeting the information density and structural sensitivity requirements of few-shot tasks. Summary of the Invention
[0003] This application provides a small sample classification method based on complete expression and generalized description, which solves the technical problem in the prior art that the convolutional neural network pooling mechanism only extracts part of the statistics of the feature distribution, resulting in incomplete feature embedding description and difficulty in providing sufficient information representation for small sample learning tasks. It achieves the technical effect of extracting complete distribution information through a hybrid statistical pooling module and combining it with a knowledge distillation strategy based on category relationship graph preservation to realize refined modeling of embedded features, thereby improving the accuracy and generalization ability of small sample classification.
[0004] In view of the above problems, this application provides a small sample classification method based on complete representation and generalized description, which includes: inputting the basic data set into the teacher network, generating teacher mixed statistical features through the mixed pooling module ; Reconstruct the teacher's mixed statistical features through autoencoder compression , generating teacher latent coding features and teacher reconstruction characteristics ; Using teacher mixed statistical features , teacher latent coding characteristics and teacher reconstruction characteristics After calculating the first multi-objective loss value, the first multi-objective loss value is applied to the gradient descent algorithm to update the teacher network until the teacher network training is completed; by inputting the basic data set into the teacher network, the student mixed statistical features are obtained. , students' latent coding characteristics Reconstruct features with students Output: Use knowledge distillation to transfer the student mixed statistical features , students' latent coding characteristics Reconstruct features with students After reaching the student network, the gradient descent algorithm is used to iteratively optimize the student network, wherein the backbone networks of the teacher network and the student network are both ResNet12.
[0005] One or more technical solutions provided in this application have at least the following beneficial effects:
[0006] This application designs a hybrid pooling module to fuse dual statistics such as mean and covariance to comprehensively characterize the distribution characteristics of tensor features and significantly improve the descriptive completeness of feature embedding; introduces an autoencoder to compress and reconstruct the embedded features, and mines the low-dimensional potential structure of the semantic space, which helps to maintain intra-class consistency and inter-class separability, and improve the inter-class structure modeling capability; at the same time, introduces a category relationship graph similarity preservation strategy to embed category structure information into the loss function, achieve deep structural guidance of the student network, and improve structural preservation during the migration process; optimizes the training process through multi-task collaborative loss function, so that the model has stronger generalization expression ability while retaining category discrimination ability, thereby improving the accuracy and generalization ability of small sample classification.
[0007] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 A flowchart of a small sample classification method based on complete expression and generalized description provided in an embodiment of the present application. DETAILED DESCRIPTION
[0009] The embodiments of the present application provide a small sample classification method based on complete expression and generalized description, which solves the technical problem in the prior art that the convolutional neural network pooling mechanism only extracts part of the statistics of the feature distribution, resulting in incomplete feature embedding description and difficulty in providing sufficient information representation for small sample learning tasks. It achieves the technical effect of extracting complete distribution information through a hybrid statistical pooling module and combining it with a knowledge distillation strategy based on category relationship graph preservation to realize refined modeling of embedded features, thereby improving the accuracy and generalization ability of small sample classification.
[0010] like Figure 1 As shown, the embodiment of the present application provides a small sample classification method based on complete expression and generalized description, the method comprising:
[0011] Step S1: Input the basic data set into the teacher network and generate the teacher mixed statistical features through the mixed pooling module .
[0012] Specifically, the basic dataset refers to the original image dataset used to train the model, which contains image data and corresponding labels, such as miniImageNet, CIFAR-FS, CUB and other datasets commonly used for small sample classification. After the basic dataset is divided into batches, it is input into the teacher network with ResNet12 as the backbone network to obtain the convolution layer output tensor. This tensor is processed by the hybrid pooling module. First, the feature skewness is adjusted by the distribution calibration formula, and then its mean (describing the center position) and covariance (describing the distribution shape) are calculated respectively. Finally, the complete statistical embedding feature is synthesized, that is, the teacher hybrid statistical feature. Among them, the Mix-Pooling Module (MPM) is a structure that integrates multiple statistical feature extraction strategies such as mean pooling, maximum pooling, and covariance pooling to enhance feature description capabilities.
[0013] This step significantly enhances the ability of embedded features to depict the distribution structure of the input image by introducing a hybrid pooling module, providing a more complete and discriminative representation basis for the subsequent generalization learning of the model.
[0014] Step S2: Reconstruct the teacher mixed statistical features through autoencoder compression , generating teacher latent coding features and teacher reconstruction characteristics .
[0015] Specifically, the autoencoder is a neural network structure composed of an encoder and a decoder, which is used for feature compression and reconstruction. The encoder's task is to compress the high-dimensional feature tensor generated by the hybrid pooling module, remove redundant information, and extract the most core feature representation, namely the teacher's potential coding feature. The decoder reconstructs the compressed features, restores the shape and content of the original feature tensor, and obtains the teacher's reconstructed features This process is similar to a "compression-decompression" test of features. By comparing the differences between the original and reconstructed features, the quality of the feature representation can be effectively evaluated. The use of autoencoders helps extract more compact and discriminative feature representations, while also providing a reconstruction benchmark for subsequent loss calculations.
[0016] Step S3: Using the teacher's mixed statistical features , teacher latent coding characteristics and teacher reconstruction characteristics After calculating the first multi-objective loss value, the first multi-objective loss value is applied to the gradient descent algorithm to update the teacher network until the teacher network training is completed.
[0017] Specifically, the first multi-objective loss value is a weighted loss that integrates multiple objective losses such as classification loss, feature preservation loss, and distillation loss. A multi-task loss function consisting of three parts, cross entropy loss (classification), normalized feature matching loss (representation consistency), and distillation loss (heat distribution alignment), is constructed through a weighted algorithm to combine the teacher's mixed statistical features. , teacher latent coding characteristics and teacher reconstruction characteristics Substitute the multi-task loss function to calculate the first multi-objective loss value. This first multi-objective loss value is then applied to the gradient descent algorithm. Based on this loss value, the algorithm automatically adjusts the parameters of the teacher network, gradually reducing the loss value. Through continuous iterative optimization, the teacher network gradually learns how to extract more useful features until the predetermined number of iterations is reached, completing training. Through the collaborative optimization of multi-objective losses, the teacher network maintains its discriminative ability while enhancing its structural stability and generalization capabilities.
[0018] Step S4: Obtain student mixed statistical features by inputting the basic data set into the teacher network , students' latent coding characteristics Reconstruct features with students Output.
[0019] Specifically, the student network is a shallow model guided by the teacher network, with the goal of reproducing the teacher's embedded expression. The trained teacher network is frozen, the basic data is re-input into the teacher network, and the teacher network output is used as a soft supervision signal to drive the student network to generate the corresponding three types of features: student mixed statistical features , students' latent coding characteristics Reconstruct features with students These three types of features correspond to the output of the hybrid pooling module, the features encoded by the autoencoder, and the reconstructed features after decoding. This process is performed after the student network parameters are initialized to facilitate subsequent distillation and migration.
[0020] Step S5: Using knowledge distillation to transfer the student mixed statistical features , students' latent coding characteristics Reconstruct features with students After reaching the student network, the gradient descent algorithm is used to iteratively optimize the student network, wherein the backbone networks of the teacher network and the student network are both ResNet12.
[0021] Specifically, the student network also uses ResNet12 as the backbone network and completes its own training and learning by receiving feature knowledge transferred from the teacher network. ResNet12 consists of 4 residual blocks, each of which contains three convolutional layers. The size of each filter layer is 3×3, and the number of filters in each residual block is 64, 160, 320, and 640 respectively. Knowledge distillation is used to transfer student mixed statistical features. , students' latent coding characteristics Reconstruct features with students To the student network, the gradient descent algorithm is used to iteratively optimize the student network. According to the difference between the predicted results of the student network and the true label, as well as the difference compared with the characteristics of the teacher network, the loss is calculated and the parameters of the student network are updated.
[0022] This step significantly improves the student network's discriminative performance and structure preservation ability in extremely small sample environments by introducing structural-level transfer supervision, ultimately obtaining a lightweight but efficient classifier.
[0023] Furthermore, step S1 includes:
[0024] Step S11: Extracting single-iteration training samples from the basic data set based on the single-iteration sample size ,in, represents image data, Represents data labels.
[0025] Step S12: By converting the single iteration training sample Input the teacher network and get the tensor feature output ,in, represents the output feature size, W is the characteristic height, H is the characteristic width, d is the number of convolution channels.
[0026] Step S13: Output the tensor features Perform double statistical mixed pooling and output the teacher mixed statistical features .
[0027] Furthermore, step S13 includes:
[0028] Step S131: Output the tensor features Input the conversion formula to obtain the calibration distribution feature tensor , wherein the conversion formula is as follows:
[0029] ;in, A hyperparameter that controls the skewness of the distribution.
[0030] Step S132: The calibration distribution feature tensor Enter the mean cumulative amount calculation formula and the covariance cumulative amount calculation formula respectively, and calculate and output the first cumulative amount and the second cumulative .
[0031] Step S133: Add the first cumulative amount and the second cumulative , output the teacher mixed statistical features .
[0032] Furthermore, the mean cumulative amount is calculated as follows: The covariance cumulant is calculated as follows: .
[0033] Specifically, the single iteration sample size refers to the number of samples extracted from the basic dataset at each training iteration, including several image data The corresponding data label For example, in an animal classification task, the image data is photos of various animals, and the data labels correspond to the types of these animals, such as "cat", "dog", "bird", etc. Using deep learning frameworks such as PyTorch or TensorFlow, a single-iteration training sample dataset is constructed by randomly sampling from the basic dataset. Taking miniImageNet as an example, it is set to sample 5 categories in each round of iteration, and 5 images are collected for each category, for a total of 25 images that constitute the training samples for this round of iteration. , where i=25.
[0034] The single iteration training sample Input the teacher network for feature extraction, and the teacher network outputs the intermediate layer tensor features through the multi-layer convolution operation of the ResNet12 backbone network ,in, Represents the output feature size, W is the feature height, H is the feature width, and d is the number of convolution channels. This tensor will serve as the input of subsequent pooling operations to provide a preliminary feature representation for the model.
[0035] Output of tensor features Perform double statistical mixed pooling to generate teacher mixed statistical features Specifically including: outputting tensor features Enter the conversion formula , this conversion formula is used to perform power or logarithmic correction on tensor features, making the data distribution closer to normal or uniform distribution, which is beneficial for subsequent statistical operations. is a hyperparameter used to control the skewness of the distribution, that is, to adjust the symmetry of the data distribution, and is set according to the data distribution experience (such as = 0.5 represents square root transformation). Tensor feature output After transformation, the calibration distribution feature tensor is obtained , the characteristic distribution of this tensor is more in line with the requirements of statistical analysis and is ready for subsequent cumulative amount calculation.
[0036] The calibration distribution feature tensor Enter the mean cumulative amount calculation formula respectively And the covariance cumulative calculation formula , and perform the calculation. Among them, W is the feature height, H is the feature width, n is the summation subscript, traverse H×W, and perform the summation operation. The superscript T represents the transpose operation of the matrix, that is, the rows and columns of the matrix are interchanged. The mean cumulant calculation formula and the covariance cumulant calculation formula are two different statistical methods used to extract different statistical features from the calibrated feature tensor. The mean cumulant calculation formula calculates the average information of the feature, reflecting the central trend of the data. For example, in a feature channel, the average of all eigenvalues can represent the overall feature strength of the channel. The covariance cumulant calculation formula calculates the covariance between features, reflecting the correlation between different features. For example, the covariance of two feature channels can indicate how their eigenvalues change together, whether they are positively correlated, negatively correlated, or uncorrelated. Through these two cumulant calculations, the first cumulant (mean-related statistical features) can be obtained respectively. and the second cumulant (a statistical feature related to covariance) , the first cumulative amount is a vector containing mean information, the second cumulant It is a matrix containing covariance information. These two cumulants describe the statistical characteristics of the feature tensor from different perspectives.
[0037] Flatten the mean vector and covariance matrix and concatenate them into a one-dimensional vector, or combine them through a specific mapping function to form a compact feature to obtain the teacher's mixed statistical feature , used as input for downstream tasks.
[0038] Furthermore, the self-encoder in step S2 is composed of an encoder and decoder Composition, wherein the encoder and decoder Both are one-layer convolutional networks; through the encoder Compressing the teacher's mixed statistical features , generating the teacher's latent coding features ,in, ; Through the decoder Reconstruct the teacher's latent coding characteristics , generating the teacher reconstruction feature ,in, .
[0039] Specifically, an autoencoder architecture is constructed within a deep learning framework such as PyTorch. In this embodiment, both the encoder and decoder are designed as a single-layer convolutional network to compress high-dimensional feature maps into low-dimensional embeddings. The decoder uses a symmetric structure to restore dimensionality and output reconstructed features.
[0040] Mixing statistical features of teachers Input encoder for compression to generate teacher latent coding features ,in, Next, the teacher’s latent coding features Input a layer of decoding convolutional network (symmetrical with the encoder structure) for reconstruction, and restore the teacher reconstruction features with a dimension close to the original teacher mixed statistical features. ,in, For example, for a teacher mixture statistical feature of [1×1024] , it is input into the encoder for convolution operation, the number of encoder convolution kernels is set to 128, the convolution kernel size is 1×1, the convolution step is 1, and the teacher potential coding feature of [1×128] is obtained after nonlinear transformation through the ReLU activation function This compression operation can remove redundant dimensions and extract the most discriminative latent features, providing a more abstract and semantically robust representation for the multi-target loss in the task. Input a layer of decoding convolutional network (symmetrical with the encoder structure) for reconstruction, and use a 1×1 convolution kernel to restore the 128-dimensional feature map to 1024 dimensions through deconvolution (or transposed convolution) operation to obtain the teacher reconstructed features.
[0041] Furthermore, step S3 includes:
[0042] Step S31: The teacher's latent coding features are transformed into Convert to the first category probability distribution ,in, .
[0043] Step S32: Mapping the teacher’s latent coding features Mapped to the first normalized eigenvector ,in, .
[0044] Step S33: distribute the first category probability and the first normalized eigenvector , input the first multi-task loss function and output the first multi-objective loss value.
[0045] Step S34: Applying the first multi-objective loss value to a gradient descent algorithm to update the teacher network.
[0046] Furthermore, the first multi-task loss function is as follows: ;in,, is the first multi-task loss function, is the first loss function, is the second loss function, is the third loss function, For adjustment The weight of ; Wherein, U is the number of samples in the basic data set, is the number of sample categories of the basic data set, for The true label category value of ;in, is a first sample set, the first sample set and the first normalized feature vector The label value is the same as The first sample set feature vectors, is the temperature coefficient;
[0047] ;in, express norm.
[0048] Specifically, the Softmax classifier is a commonly used classification tool that can map the input feature vector to the probability distribution of each category. Process it and convert it into the first category probability distribution ,in, , so that the teacher network can directly accept supervision signals for classification learning.
[0049] The mapping network is usually a simple fully connected layer or convolutional layer, which transforms the original features into a new feature space and ensures that the length (norm) of the feature vector is 1. After inputting the mapping network, it is converted into the first normalized feature vector ,in, The normalization operation ensures that the feature vectors can be compared by cosine similarity, which helps to construct an embedding space that is consistent within a class and separable between classes.
[0050] The first category probability distribution and the first normalized eigenvector , input the first multi-task loss function , calculate the first multi-objective loss value. The first multi-task loss function comprehensively considers the losses of classification error, feature distribution consistency, distillation structure alignment loss, etc., and balances the influence of each part by setting different weight coefficients. Among them, the first loss function is the cross entropy loss function, ,in, U is the number of samples in the basic data set, is the number of sample categories of the basic data set, for The true label category value of, where j represents the jth category, is the true label category value of class j of the i-th sample. The second loss function is the normalized feature similarity loss, ,in, is a first sample set, the first sample set and the first normalized feature vector The label value is the same as The first sample set feature vectors, is the temperature coefficient, which is a parameter during model training. The third loss function is the distillation structure alignment loss, ,in, express norm. For adjustment The weight of .
[0051] Through the above-mentioned multi-task collaborative optimization, the teacher network can learn an embedding representation that is both discriminative and structural, providing a high-quality knowledge transfer foundation for the student network.
[0052] The gradient descent algorithm is used to calculate the gradients of each parameter in the teacher network based on the first multi-objective loss value, and the parameters are updated accordingly. For example, assuming the current loss value is 0.5, the backpropagation algorithm is used to calculate the contribution of each parameter (such as convolution kernel weights and bias terms) to the loss value. The parameters are then updated according to a preset learning rate (such as 0.001). This process enables the teacher network to gradually learn better feature extraction and classification capabilities, continuously reducing prediction error and improving classification accuracy.
[0053] Furthermore, step S5 includes:
[0054] Step S51: Potential coding features of the students Perform conversion and mapping processing to output the second category probability distribution and the second normalized eigenvector .
[0055] Step S52: After migrating the first multi-task loss function, construct a second multi-task loss function.
[0056] Step S53: distribute the first category probability , the second category probability distribution , the first normalized eigenvector and the second normalized eigenvector , input the second multi-task loss function, and output the second multi-objective loss value.
[0057] Step S54: Applying the second multi-objective loss value to a gradient descent algorithm to update the student network.
[0058] Furthermore, step S52 includes:
[0059] Step S521: After migrating the first multi-task loss function, weight adjustment is performed on the first multi-task loss function to obtain a fourth loss function.
[0060] Step S522: Construct a fifth loss function, which is as follows: .
[0061] Step S523: Pre-construct the sixth loss function as follows: ;in, is the sixth loss function, is the teacher network class relationship diagram, Class relationship diagram for student network.
[0062] Step S524: The fourth loss function, the fifth loss function, and the sixth loss function are integrated by configuring weight parameters to obtain the second multi-task loss function, as follows: ;in, is the second multi-task loss function, is the fourth loss function, is the fifth loss function; β and γ are weight parameters.
[0063] Furthermore, step S523 includes:
[0064] Step S523-1: Based on the second normalized feature vector Constructing the adjacency matrix , generate the student network class relationship diagram ,in, is a vertex set , For edge sets.
[0065] Step S523-2: The adjacency matrix The elements of are calculated as follows: ;in, is the second sample set, and the second sample set and the second normalized feature vector The label value is the same as The second sample set j The normalized feature vector of samples.
[0066] Step S523-3: Similarly, generate the teacher network class relationship diagram.
[0067] Step S523-4: Construct and generate the sixth loss function based on the teacher network class relationship diagram and the student network class relationship diagram.
[0068] Specifically, the student latent coding features in the student network are transformed into Input softmax classifier output second category probability distribution , and at the same time, after normalization processing by the mapping network, the standard vector for feature structure comparison is output, that is, the second normalized feature vector .
[0069] Transfer the first multi-task loss function from the teacher network to the student network, and then construct the second multi-task loss function: ,in, is the second multi-task loss function, is the fourth loss function, is the fifth loss function; β and γ are weight parameters. Specifically, after migrating the first multi-task loss function, the weight of the first multi-task loss function is adjusted to obtain the fourth loss function ,in, 、 、 They are the first loss function, the second loss function, and the third loss function corresponding to the student network, For adjustment The purpose of weight adjustment is to make the loss function more in line with the learning needs of the student network. Then, the fifth loss function is constructed. ,in, U is the number of samples in the basic data set, is the number of sample categories of the basic data set, is the first category probability distribution, is the second category probability distribution.
[0070] Then pre-construct the sixth loss function as follows: ;in, is the sixth loss function, is the teacher network class relationship diagram, is the student network class relationship diagram. Specifically, based on the second normalized eigenvector Constructing the adjacency matrix , generate a student network class relationship diagram The adjacency matrix is a two-dimensional matrix whose elements represent the similarity between samples. For example, for a batch containing 10 samples, the size of the adjacency matrix is 10×10. , represents the sample set, edge set Represents the connection relationship between samples, that is, the similarity measure. The formula for calculating the elements of the adjacency matrix is: ,in, is the second sample set, the second sample set and the second normalized feature vector The label value is the same as The second sample set j Similarly, the teacher network class relationship diagram is generated based on the normalized feature vector of the teacher network. This graph reflects the teacher network’s understanding of the relationship between samples, which is one of the goals of the student network learning. Based on the teacher network class relationship graph and the student network class relationship graph, the sixth loss function is constructed. To measure the difference between two class diagrams.
[0071] Finally, by configuring the weight parameters β and γ, the fourth loss function, the fifth loss function and the sixth loss function are integrated to obtain the second multi-task loss function as follows: The weight parameters β and γ are used to balance the impact of different loss functions. For example, β = 0.6 and γ = 0.4 can be set to emphasize the importance of the fourth loss function. This fusion process ensures that the student network can simultaneously consider multiple aspects such as classification accuracy, feature similarity, and sample relationship structure during the optimization process.
[0072] The first category probability distribution , the second category probability distribution , the first normalized eigenvector and the second normalized eigenvector , input the second multi-task loss function and calculate the second multi-target loss value. This loss value comprehensively reflects the performance of the student network in the current state, including classification error, feature difference and sample relationship difference, etc., and realizes the deep alignment of the teacher network and the student network in the three dimensions of output probability, feature representation and structural information, providing complete supervision signal for distillation migration.
[0073] The calculated second multi-objective loss value is applied to the gradient descent algorithm to update the parameters of the student network. This process enables the student network to gradually optimize its feature extraction and classification capabilities, improve classification accuracy, and at the same time learn the knowledge of the teacher network and enhance generalization ability, ultimately obtaining a lightweight, highly generalizable and structurally aligned small sample classification model.
[0074] In summary, the small sample classification method based on complete representation and generalized description provided in the embodiments of the present application has the following beneficial effects:
[0075] The embodiment of the present application designs a hybrid pooling module to fuse dual statistics such as mean and covariance, comprehensively characterizes the distribution characteristics of tensor features, and significantly improves the descriptive completeness of feature embedding; introduces an autoencoder to compress and reconstruct the embedded features, and mines the low-dimensional potential structure of the semantic space, which helps to maintain intra-class consistency and inter-class separability, and improves the inter-class structure modeling capability; at the same time, introduces a category relationship graph similarity preservation strategy, embeds the category structure information into the loss function, realizes deep structural guidance of the student network, and improves the structure retention during the migration process; optimizes the training process through multi-task collaborative loss function, so that the model has stronger generalization expression ability while retaining the category discrimination ability, thereby improving the accuracy and generalization ability of small sample classification.
[0076] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A small sample classification method based on complete representation and generalized description, characterized by: The method comprises: Input the basic data set into the teacher network and generate the teacher mixed statistical features through the mixed pooling module ; The teacher mixture statistical features are reconstructed by autoencoder compression , generating teacher latent coding features and teacher reconstruction characteristics ; Using the teacher mixed statistical features , teacher latent coding characteristics and teacher reconstruction characteristics , after calculating the first multi-objective loss value, applying the first multi-objective loss value to the gradient descent algorithm to update the teacher network until the teacher network training is completed; By inputting the basic data set into the teacher network, the student mixed statistical features are obtained , students' latent coding characteristics Reconstruct features with students Output; Using knowledge distillation to transfer the student mixed statistical features , students' latent coding characteristics Reconstruct features with students After reaching the student network, the gradient descent algorithm is used to iteratively optimize the student network, wherein the backbone networks of the teacher network and the student network are both ResNet12; Input the basic data set into the teacher network and generate the teacher mixed statistical features through the mixed pooling module ,include: Based on the single iteration sample size, single iteration training samples are extracted from the basic data set ,in, Represents image data, Indicates data labels; By taking the single iteration training sample Input the teacher network and get the tensor feature output ,in, represents the output feature size, W is the characteristic height, H is the characteristic width, d is the number of convolution channels; Output of the tensor feature Perform double statistical mixed pooling and output the teacher mixed statistical features ; Output of the tensor feature Perform double statistical mixed pooling and output the teacher mixed statistical features ,include: Output the tensor features Input the conversion formula to obtain the calibration distribution feature tensor , wherein the conversion formula is as follows: ; in, is a hyperparameter that controls the skewness of the distribution; The calibration distribution feature tensor Enter the mean cumulative amount calculation formula and the covariance cumulative amount calculation formula respectively, and calculate and output the first cumulative amount and the second cumulative ; Add the first cumulative amount and the second cumulative , output the teacher mixed statistical features .
2. The small sample classification method based on complete representation and generalized description according to claim 1, characterized in that: The method further comprises: The mean cumulative amount is calculated as follows: ; The covariance cumulant is calculated as follows: 。 3. The small sample classification method based on complete representation and generalized description according to claim 1, characterized in that: The teacher mixture statistical features are reconstructed by autoencoder compression , generating teacher latent coding features and teacher reconstruction characteristics , the method comprising: The autoencoder consists of an encoder and decoder Composition, wherein the encoder and decoder Both are one-layer convolutional networks; Through the encoder Compressing the teacher's mixed statistical features , generating the teacher's latent coding features ,in, ; Through the decoder Reconstruct the teacher's latent coding characteristics , generating the teacher reconstruction feature ,in, .
4. The small sample classification method based on complete representation and generalized description according to claim 1, characterized in that: Using the teacher mixed statistical features , teacher latent coding characteristics and teacher reconstruction characteristics After calculating a first multi-objective loss value, applying the first multi-objective loss value to a gradient descent algorithm to update the teacher network until the teacher network training is completed, the method comprising: The teacher's latent coding features are transformed into Convert to the first category probability distribution ,in, ; Through the mapping network, the teacher's latent coding features Mapped to the first normalized eigenvector ,in, ; The first category probability distribution and the first normalized eigenvector , input the first multi-task loss function, and output the first multi-objective loss value; Applying the first multi-objective loss value to a gradient descent algorithm to update the teacher network.
5. The small sample classification method based on complete representation and generalized description according to claim 4, characterized in that: The method further comprises: The first multi-task loss function is as follows: ; in, is the first multi-task loss function, is the first loss function, is the second loss function, is the third loss function, For adjustment The weight of ; in, U is the number of samples in the basic data set, is the number of sample categories of the basic data set, for The true label category value of ; in, is a first sample set, the first sample set and the first normalized feature vector The label value is the same as The first sample set feature vectors, is the temperature coefficient; ; in, express norm.
6. The small sample classification method based on complete representation and generalized description according to claim 5, characterized in that: Using knowledge distillation to transfer the student mixed statistical features , students' latent coding characteristics Reconstruct features with students After obtaining the student network, a gradient descent algorithm is used to iteratively optimize the student network. The method includes: Latent coding characteristics of the students Perform conversion and mapping processing to output the second category probability distribution and the second normalized eigenvector ; After migrating the first multi-task loss function, constructing a second multi-task loss function; The first category probability distribution , the second category probability distribution , the first normalized eigenvector and the second normalized eigenvector , input the second multi-task loss function, and output the second multi-objective loss value; The second multi-objective loss value is applied to a gradient descent algorithm to update the student network.
7. The small sample classification method based on complete representation and generalized description according to claim 6, characterized in that: After migrating the first multi-task loss function, constructing a second multi-task loss function, the method comprising: After migrating the first multi-task loss function, weighting the first multi-task loss function to obtain a fourth loss function; Construct a fifth loss function, which is as follows: ; Pre-construct the sixth loss function as follows: ; in, is the sixth loss function, is the teacher network class relationship diagram, Network class relationship diagram for students; The second multi-task loss function is obtained by configuring the weight parameters to fuse the fourth loss function, the fifth loss function and the sixth loss function, as follows: ; in, is the second multi-task loss function, is the fourth loss function, is the fifth loss function; β and γ are weight parameters.
8. The small sample classification method based on complete representation and generalized description according to claim 7, characterized in that: Pre-constructing a sixth loss function, the method comprising: Based on the second normalized eigenvector Constructing the adjacency matrix , generate the student network class relationship diagram ,in, is a vertex set , is the edge set; The adjacency matrix The elements of are calculated as follows: ; in, is the second sample set, and the second sample set and the second normalized feature vector The label value is the same as The second sample set j The normalized feature vector of samples; By analogy, the teacher network class relationship diagram is generated; The sixth loss function is constructed and generated based on the teacher network class relationship diagram and the student network class relationship diagram.
Citation Information
Patent Citations
Remote education system and equipment based on fourth generation Internet
CN104506565A
Knowledge distillation method and device oriented to small sample learning and storage medium
CN116363423A