Small sample classification method based on complete expression and generalization description
Through the hybrid pooling module and autoencoder compression and reconstruction of features, combined with knowledge distillation and category relationship diagram strategies, the problem of incomplete extraction feature distribution of convolutional neural network pooling mechanism is solved, and the refined modeling and generalization ability of small sample classification is achieved.
Patent Information
- Application Number
- CN202510812039.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-07-18
- 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 mixed pooling module is used to generate mixed statistical features of teachers, combine with the autoencoder compression and reconstruction features, and migrate to the student network through the knowledge distillation strategy, introduce a category relationship diagram maintenance strategy, and optimize multi-task loss function to improve feature description integrity and generalization ability.
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 CN120336974A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to a few-shot classification method based on complete representation and generalized description. Background Art
[0002] Existing few-shot classification methods are mainly divided into methods based on Meta-Learning and methods based on Transfer Learning. Meta-Learning methods usually rely on complex multi-stage training processes, dividing the base dataset into a series of FSC tasks to simulate test scenarios. The training process is costly and highly sensitive to task construction. In contrast, transfer learning methods show more concise and efficient advantages by inputting the entire base dataset into a Convolutional Neural Network (CNNs) for feature learning and fine-tuning the classifier based on a small number of target samples. In the CNN architecture, pooling operations, as key mechanisms for generating embedded features, often adopt strategies such as Global Average Pooling (GAP), Global Max Pooling (GMP), Generalized Mean Pooling (GeMP), and Global Covariance Pooling (GCP). However, from the perspective of probability distribution, these methods usually only extract partial statistics of the tensor feature distribution, lacking the ability to express the complete distribution structure, resulting in insufficient discriminability and generalization ability of the final embedded vector, and it is difficult to meet the requirements for information density and structural sensitivity in few-shot tasks. Summary of the Invention
[0003] This application provides a few-shot classification method based on complete representation and generalized description, which solves the technical problem that in the prior art, due to the fact that the pooling mechanism of the convolutional neural network only extracts partial statistics of the feature distribution, the feature embedding description is incomplete, and it is difficult to provide sufficient information representation for few-shot learning tasks. It achieves the technical effect of extracting complete distribution information through a hybrid statistical pooling module and combining a knowledge distillation strategy based on maintaining the class relationship graph to realize refined modeling of embedded features, thereby improving the accuracy and generalization ability of few-shot classification.
[0004] In view of the above problems, this application provides a few-shot classification method based on complete representation and generalized description. The method includes: inputting the base dataset into a teacher network to generate teacher hybrid statistical features through a hybrid pooling module ; compressing and reconstructing the teacher hybrid statistical features through an autoencoder to generate teacher latent coding features and teacher reconstruction features ; using the teacher hybrid statistical features and teacher latent coding features and teacher reconstruction features , after calculating the first multi-objective loss value, apply the first multi-objective loss value to the gradient descent algorithm to update the teacher network until the teacher network is trained; by inputting the basic data set into the teacher network, obtain the student mixed statistical features , student latent coding features and student reconstruction features output; use knowledge distillation to transfer the student mixed statistical features , student latent coding features and student reconstruction features to the student network, and then use the gradient descent algorithm to perform iterative optimization of the student network. Among them, 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: In this application, by designing a hybrid pooling module to fuse double statistics such as mean and covariance, the distribution characteristics of tensor features are comprehensively characterized, significantly improving the description integrity of feature embedding; introducing an autoencoder to compress and reconstruct the embedded features, mining the low-dimensional latent structure of the semantic space, which helps to maintain intra-class consistency and inter-class separability, and improve the inter-class structure modeling ability; at the same time, introducing a category relationship graph similarity preservation strategy to embed the class structure information into the loss function, realizing deep structure guidance for the student network and improving the structure preservation during the transfer process; optimizing the training process through a multi-task collaborative loss function, enabling the model to have stronger generalization expression ability while retaining the category discrimination ability, thereby improving the accuracy and generalization ability of few-shot classification.
[0006] The above description is only an overview of the technical solutions of this application. In order to be able to understand the technical means of this application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of this application more obvious and understandable, the specific embodiments of this application are specifically given below. Description of the Drawings
[0007] Figure 1 It is a schematic flowchart of a few-shot classification method based on complete expression and generalization description provided by an embodiment of this application. Specific Embodiments
[0008] By providing a few-shot classification method based on complete representation and generalization description in the embodiments of the present application, the technical problem in the prior art that the feature embedding description is incomplete due to the pooling mechanism of the convolutional neural network only extracting partial statistics of the feature distribution, making it difficult to provide sufficient information representation for the few-shot learning task, is solved. The technical effect of extracting complete distribution information through the hybrid statistical pooling module and combining the knowledge distillation strategy based on maintaining the class relationship graph to achieve refined modeling of the embedded features, thereby improving the accuracy and generalization ability of few-shot classification, is achieved.
[0009] As Figure 1 shown, the embodiments of the present application provide a few-shot classification method based on complete representation and generalization description, and the method includes: Step S1: Input the base dataset into the teacher network, and generate teacher hybrid statistical features through the hybrid pooling module .
[0010] Specifically, the base dataset refers to the original image dataset used for training the model, including image data and corresponding labels, such as datasets commonly used for few-shot classification like miniImageNet, CIFAR-FS, CUB, etc. After dividing the base dataset into batches, it is input into the teacher network with ResNet12 as the backbone network to obtain the output tensor of the convolutional layer. This tensor is processed by the hybrid pooling module. First, the feature skewness is adjusted through the distribution calibration formula, and then its mean (describing the central position) and covariance (describing the distribution shape) are calculated respectively. Finally, the complete statistical embedded feature, that is, the teacher hybrid statistical feature, is synthesized. Among them, the hybrid pooling module (Mix-Pooling Module, MPM) is a structure that integrates various statistical feature extraction strategies such as mean pooling, max pooling, and covariance pooling, and is used to enhance the feature description ability.
[0011] By introducing the hybrid pooling module in this step, the ability of the embedded feature to depict the distribution structure of the input image is significantly enhanced, providing a more complete and discriminative representation basis for the subsequent generalization learning of the model.
[0012] Step S2: Compress and reconstruct the teacher hybrid statistical features through the autoencoder , generating teacher latent coding features and teacher reconstruction features .
[0013] Specifically, the autoencoder is a neural network structure composed of an encoder and a decoder, and is used for feature compression and reconstruction. The task of the encoder is to compress the high-dimensional feature tensor generated by the hybrid pooling module, remove redundant information, and extract the most core feature representation, that is, the teacher latent coding features The decoder reconstructs the compressed features, restoring the shape and content of the original feature tensor to obtain the teacher reconstruction features. This process is similar to performing a "compression - decompression" test on the features. By comparing the differences between the original features and the reconstructed features, the quality of the feature representation can be effectively evaluated. The use of the auto - encoder helps to extract more compact and discriminative feature representations, while providing a reconstruction benchmark for subsequent loss calculations.
[0014] Step S3: Using the teacher's mixed statistical features and the teacher's latent coding features and the teacher's reconstruction features , after calculating the first multi - objective loss value, apply the first multi - objective loss value to the gradient descent algorithm to update the teacher network until the teacher network training is completed.
[0015] Specifically, the first multi - objective loss value is a weighted loss that combines multiple objective losses such as classification loss, feature preservation loss, and distillation loss. A multi - task loss function consisting of cross - entropy loss (classification), normalized feature matching loss (representation consistency), and distillation loss (thermal distribution alignment) is constructed through a weighted algorithm. Substitute the teacher's mixed statistical features and the teacher's latent coding features and the teacher's reconstruction features into the multi - task loss function to calculate the first multi - objective loss value. Then, apply the first multi - objective loss value to the gradient descent algorithm. The algorithm automatically adjusts the parameters in the teacher network according to this loss value, making the loss value gradually decrease. Through continuous iterative optimization, the teacher network gradually learns how to extract more useful features until a predetermined number of iterations is reached and the training is completed. Through the collaborative optimization of multi - objective losses, the teacher network enhances its structural stability and generalization ability while maintaining its discriminative ability.
[0016] Step S4: By inputting the basic dataset into the teacher network, obtain the student's mixed statistical features and the student's latent coding features and the student's reconstruction features as output.
[0017] Specifically, the student network is a shallow model guided by the teacher network, with the goal of replicating the teacher's embedding expression. Freeze the trained teacher network, re - input the basic data into the teacher network, and use the output of the teacher network as a soft supervision signal to drive the student network to generate the corresponding three types of features: the student's mixed statistical features and the student's latent coding features and the student's reconstruction features , these three types of features respectively correspond to the output of the hybrid pooling module, the features after encoding by the autoencoder, and the reconstructed features after decoding. This process is carried out after the initialization of the student network parameters to facilitate subsequent distillation transfer.
[0018] Step S5: Use knowledge distillation to transfer the student's hybrid statistical features , the student's latent encoding features and the student's reconstructed features to the student network, and then use the gradient descent algorithm to perform iterative optimization of the student network. Among them, the backbone networks of both the teacher network and the student network are ResNet12.
[0019] Specifically, the student network also uses ResNet12 as the backbone network and completes its own training and learning by receiving the feature knowledge transmitted from the teacher network. ResNet12 consists of 4 residual blocks, each residual block contains three convolutional layers, the size of the filter for each layer is 3×3, and the number of filters in each residual block is 64, 160, 320, and 640 respectively. Use knowledge distillation to transfer the student's hybrid statistical features , the student's latent encoding features and the student's reconstructed features to the student network, and use the gradient descent algorithm to perform iterative optimization of the student network. Calculate the loss and update the parameters of the student network according to the difference between the prediction result of the student network and the true label, as well as the comparison difference with the teacher network features.
[0020] This step significantly improves the discriminative performance and structure-preserving ability of the student network in the few-shot environment by introducing structure-level transfer supervision, and finally obtains a lightweight but efficient classifier.
[0021] Furthermore, step S1 includes: Step S11: Extract single-iteration training samples from the basic dataset based on the single-iteration sample size , where represents the image data, represents the data label.
[0022] Step S12: Input the single-iteration training samples into the teacher network to obtain the tensor feature output , where represents the output feature size, W is the feature height, H is the feature width, d is the number of convolutional channels.
[0023] Step S13: Process the tensor feature output Perform double statistical pooling to output the teacher's mixed statistical features 。
[0024] Further, step S13 includes: Step S131: Input the tensor features into the conversion formula to obtain the calibrated distribution feature tensor , where the conversion formula is as follows: ; where is the hyperparameter controlling the distribution skewness.
[0025] Step S132: Input the calibrated distribution feature tensor into the mean cumulant calculation formula and the covariance cumulant calculation formula respectively, and calculate and output the first cumulant and the second cumulant 。
[0026] Step S133: Sum the first cumulant and the second cumulant to output the teacher's mixed statistical features 。
[0027] Further, the mean cumulant calculation formula is as follows: ; the covariance cumulant calculation formula is as follows: 。
[0028] Specifically, the single-iteration sample size refers to the number of samples drawn from the basic dataset during each training iteration, including a number of image data and their corresponding data labels 。For example, in an animal classification task, the image data are 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, randomly sample from the basic dataset to construct the single-iteration training sample dataset. Taking miniImageNet as an example, set to sample 5 categories per round of iteration, 5 images per category, and a total of 25 images constitute the training sample for this round of iteration , where i = 25.
[0029] Input the single-iteration training sample into the teacher network for feature extraction. The teacher network outputs the intermediate layer tensor features through multiple convolutional operations of the ResNet12 backbone network, where Denote the output feature size, where W is the feature height, H is the feature width, and d is the number of convolutional channels. This tensor will serve as the input for subsequent pooling operations, providing an initial feature representation for the model.
[0030] Perform double-statistical hybrid pooling on the tensor feature output to generate the teacher's hybrid statistical features . Specifically, it includes: inputting the tensor feature output into the transformation formula . This transformation formula is used to perform power or logarithmic correction on the tensor feature, making the data distribution closer to a normal or uniform distribution, which is beneficial for subsequent statistical operations. Among them, is a hyperparameter used to control the skewness of the distribution, that is, to adjust the symmetry of the data distribution, and it is set according to the data distribution experience (such as =0.5 represents the square root transformation). After the tensor feature output is transformed, the calibrated distribution feature tensor is obtained. The feature distribution of this tensor is more in line with the requirements of statistical analysis, preparing for subsequent cumulant calculations.
[0031] Input the calibrated distribution feature tensor into the mean cumulant calculation formula and the covariance cumulant calculation formula respectively for calculation. Among them, W is the feature height, H is the feature width, n is the summation subscript, traversing H×W for summation operations, and the superscript T represents the transpose operation of the matrix, that is, interchanging the rows and columns of the matrix. 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 features, reflecting the central tendency of the data. For example, in a feature channel, the average of all feature values 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 between two feature channels can indicate how their feature values co-vary, whether they are positively correlated, negatively correlated, or uncorrelated. Through these two cumulant calculations, the first cumulant (statistical features related to the mean) and the second cumulant (statistical features related to the covariance) can be obtained respectively. The first cumulant is a vector containing mean information, and the second cumulant is a matrix containing covariance information. These two cumulants describe the statistical characteristics of the feature tensor from different perspectives.
[0032] Flatten the mean vector and covariance matrix and concatenate them into a one-dimensional vector, or form compact features through a specific mapping function combination to obtain the teacher's mixed statistical features , which is used as the input for downstream tasks.
[0033] Further, the autoencoder described in step S2 consists of an encoder and a decoder . Among them, the encoder and the decoder are both one-layer convolutional networks; the teacher's mixed statistical features are compressed through the encoder to generate the teacher's latent coding features , where ; the teacher's latent coding features are reconstructed through the decoder to generate the teacher's reconstructed features , where .
[0034] Specifically, an autoencoder structure is constructed in a deep learning framework (such as PyTorch). In this embodiment, both the encoder and the decoder are designed as one-layer convolutional networks, which are used to map and compress high-dimensional features into low-dimensional embeddings; the decoder uses a symmetric structure for dimension recovery and outputs reconstructed features.
[0035] Input the teacher's mixed statistical features into the encoder for compression to generate the teacher's latent coding features , where . Then, input the teacher's latent coding features into a one-layer decoding convolutional network (symmetric to the encoder structure) for reconstruction to recover the teacher's reconstructed features with a dimension similar to the original teacher's mixed statistical features , where . For example, for the teacher's mixed statistical features of [1×1024] , input it into the encoder for convolution operation. The number of convolutional kernels in the encoder is set to 128, the size of the convolutional kernel is 1×1, the convolutional stride is 1, and after non-linear transformation through the ReLU activation function, the teacher's latent coding features of [1×128] are obtained. This compression operation can remove redundant dimensions and extract the most discriminative latent features, providing a more abstract and semantically stronger representation support for the multi-objective loss in the task. Then, input the teacher's latent coding features into a one-layer decoding convolutional network (symmetric to the encoder structure) for reconstruction, and use a 1×1 convolutional kernel to restore the 128-dimensional feature map to 1024 dimensions through deconvolution (or transposed convolution) operation to obtain the teacher's reconstructed features.
[0036] Further, step S3 includes: Step S31: Convert the teacher's latent coding features into a first category probability distribution , where .
[0037] Step S32: Map the teacher's latent coding features to a first normalized feature vector , where .
[0038] Step S33: Input the first category probability distribution and the first normalized feature vector into the first multi-task loss function to output a first multi-objective loss value.
[0039] Step S34: Apply the first multi-objective loss value to the gradient descent algorithm to update the teacher network.
[0040] Further, the first multi-task loss function is as follows: ; where,, is the first multi-task loss function, is the first loss function, is the second loss function, is the third loss function, used to adjust 's weight; ; where U is the number of samples in the base dataset, is the number of sample categories in the base dataset, is 's true label category value; ; where is the first sample set, and the first sample set has the same label value as the first normalized feature vector , is the rd feature vector in the first sample set, is the temperature coefficient; ; where represents norm.
[0041] Specifically, the Softmax classifier is a commonly used classification tool that can map the input feature vector to the probability distribution of each category. Use the Softmax classifier to process the teacher's latent coding features and convert it into a first category probability distribution , where , the teacher network can directly receive the supervision signal for classification learning.
[0042] The mapping network is usually a simple fully connected layer or convolutional layer, whose role is to transform the original features into a new feature space and ensure that the length (norm) of the feature vector is 1. The teacher's latent encoded features After being input into the mapping network, it is transformed into the first normalized feature vector , where . The normalization operation ensures that the feature vectors can be compared by cosine similarity, which helps to construct an embedding space with intra-class consistency and inter-class separability.
[0043] The first category probability distribution And the first normalized feature vector Are input into the first multi-task loss function To calculate the first multi-objective loss value. The first multi-task loss function comprehensively considers losses in multiple aspects such as classification error, feature distribution consistency, and distillation structure alignment loss, and balances the influence of each part by setting different weight coefficients. Among them, the first loss function Is the cross-entropy loss function, , where U Is the number of samples in the basic dataset, Is the number of sample categories in the basic dataset, Is The true label category value of, where j represents the jth category, Is the true label category value of the jth class of the ith sample. The second loss function Is the normalized feature similarity loss, , where Is the first sample set, and the first sample set has the same label value as the first normalized feature vector , Is the Th feature vector in the first sample set, Is the temperature coefficient, which is a parameter during model training. The third loss function Is the distillation structure alignment loss, , where Represents Norm. Is used to adjust Weight.
[0044] Through the above multi-task collaborative optimization, the teacher network can learn an embedding representation that combines discriminability and structure, providing a high-quality knowledge transfer foundation for the student network.
[0045] Use the gradient descent algorithm to calculate the gradients of the parameters in the teacher network based on the first multi-objective loss value, and update the parameters accordingly. For example, assume the current loss value is 0.5. Calculate the contribution of each parameter (such as convolutional kernel weights, bias terms, etc.) to the loss value through the backpropagation algorithm, and then update the parameters according to the preset learning rate (such as 0.001). This process enables the teacher network to gradually learn better feature extraction and classification capabilities, continuously reduce the prediction error, and improve the classification accuracy.
[0046] Further, step S5 includes: Step S51: Perform transformation and mapping processing on the student's latent coding features to output the second category probability distribution and the second normalized feature vector .
[0047] Step S52: After migrating the first multi-task loss function, construct the second multi-task loss function.
[0048] Step S53: Input the first category probability distribution , the second category probability distribution , the first normalized feature vector and the second normalized feature vector into the second multi-task loss function to output the second multi-objective loss value.
[0049] Step S54: Apply the second multi-objective loss value to the gradient descent algorithm to update the student network.
[0050] Further, step S52 includes: Step S521: After migrating the first multi-task loss function, adjust the weights of the first multi-task loss function to obtain the fourth loss function.
[0051] Step S522: Construct the fifth loss function, and the fifth loss function is as follows: .
[0052] Step S523: Pre-construct the sixth loss function, as follows: ; where is the sixth loss function, is the class relationship graph of the teacher network, is the class relationship graph of the student network.
[0053] Step S524: By configuring the weight parameters, fuse the fourth loss function, the fifth loss function, and the sixth loss function to obtain the second multi-task loss function, as follows: ; where is the second multi-task loss function, is the fourth loss function, is the fifth loss function; β and γ are weight parameters.
[0054] Furthermore, step S523 includes: Step S523-1: Based on the second normalized eigenvector construct an adjacency matrix to generate the class relationship graph of the student network , where is the vertex set , is the edge set.
[0055] Step S523-2: The elements of the adjacency matrix are calculated as follows: ; where is the second sample set, and the second sample set has the same label values as the second normalized eigenvector , is the j th normalized eigenvector of the samples in the second sample set.
[0056] And so on, generate the class relationship graph of the teacher network.
[0057] Step S523-4: Based on the class relationship graph of the teacher network and the class relationship graph of the student network, construct and generate the sixth loss function.
[0058] Specifically, similar to the teacher network, input the student latent coding features in the student network into the softmax classifier to output the second class probability distribution , and at the same time, after being normalized by the mapping network, output the standard vector for feature structure comparison, that is, the second normalized eigenvector .
[0059] Transfer the first multi-task loss function from the teacher network to the student network, and then construct the second multi-task loss function: , where is the second multi-task loss function, is the fourth loss function, is the fifth loss function; β and γ are weight parameters. Specifically, after transferring the first multi-task loss function, adjust the weights of the first multi-task loss function to obtain the fourth loss function , where , , are the first loss function, the second loss function, and the third loss function corresponding to the student network respectively, For adjusting the weights. The purpose of weight adjustment is to make the loss function more in line with the learning needs of the student network. Then, a fifth loss function is constructed, where U is the number of samples in the base dataset, is the number of sample categories in the base dataset, is the first category probability distribution, is the second category probability distribution.
[0060] Then, a sixth loss function is pre-constructed as follows: ; where is the sixth loss function, is the teacher network class relationship graph, is the student network class relationship graph. Specifically, based on the second normalized eigenvector an adjacency matrix is constructed to generate the student network class relationship graph . The adjacency matrix is a two-dimensional matrix, and its elements represent the similarity between samples. For example, for a batch containing 10 samples, the size of the adjacency matrix is 10×10. Among them, the vertex set represents the sample set, and the edge set represents the connection relationship between samples, that is, the similarity measure. The calculation formula for the elements of the adjacency matrix is: , where is the second sample set, and the second sample set has the same label value as the second normalized eigenvector , is the normalized eigenvector of the j th sample in the second sample set. Similarly, a teacher network class relationship graph is generated according to the normalized eigenvector of the teacher network. This graph reflects the teacher network's understanding of the relationship between samples and is one of the goals for the student network to learn. According to the teacher network class relationship graph and the student network class relationship graph, a sixth loss function is constructed to measure the difference between the two class relationship graphs.
[0061] Finally, by configuring the weight parameters β and γ, the fourth loss function, the fifth loss function, and the sixth loss function are fused to obtain the following second multi-task loss function: . The weight parameters β and γ are used to balance the influence 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 consider multiple aspects such as classification accuracy, feature similarity, and sample relationship structure during the optimization process.
[0062] 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-objective 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 a complete supervision signal for distillation migration.
[0063] 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 and improve classification accuracy. At the same time, it learns the knowledge of the teacher network and enhances generalization ability, ultimately obtaining a lightweight, generalizable and structurally aligned small sample classification model.
[0064] In summary, the small sample classification method based on complete expression and generalized description provided in the embodiment of the present application has the following beneficial effects: 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 class structure information into the loss function, realizes deep structural guidance of the student network, and improves the structural preservation during the migration process; optimizes the training process through a multi-task collaborative loss function, so that the model has a stronger generalization expression ability while retaining the category discrimination ability, thereby improving the accuracy and generalization ability of small sample classification.
[0065] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those 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 will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A few-shot classification method based on complete representation and generalization description, characterized in that The method includes: Input the basic dataset into the teacher network, and generate teacher mixed statistical features through the hybrid pooling module ; Compress and reconstruct the teacher's mixed statistical features through an autoencoder , generating the teacher's latent coding features and the teacher's reconstructed features ; Using the mixed statistical features of the teacher , the latent coding features of the teacher and the reconstruction features of the teacher , after calculating the 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 is trained; By inputting the basic data set into the teacher network, student mixed statistical features , student latent coding features and student reconstruction features are output; Transfer the mixed statistical features of the student through knowledge distillation , the latent coding features of the student and the reconstruction features of the student to the student network, and then use the gradient descent algorithm to iteratively optimize the student network. Among them, the backbone networks of the teacher network and the student network are both ResNet12.
2. A small-sample classification method based on complete expressions and generalized descriptions as described in claim 1, characterized in that, Input the basic dataset into the teacher network to generate teacher mixed statistical features through the hybrid pooling module , the method comprising: Extract a single-iteration training sample from the basic data set based on the single-iteration sample size , where represents image data represents the data label; By inputting the single-iteration training samples into the teacher network, a tensor feature output is obtained, where represents the output feature size, W is the feature height, H is the feature width, d is the number of convolutional channels; Perform double statistical pooling on the tensor feature output and output the teacher's mixed statistical feature .
3. The small-sample classification method based on complete expressions and generalized descriptions according to claim 2, wherein For the tensor feature output Perform double-statistical hybrid pooling to output the teacher's hybrid statistical feature , the method includes: Output the tensor feature Input the conversion formula to obtain the calibrated distribution feature tensor , where the conversion formula is as follows: ; Among them, is a hyperparameter for controlling the distribution skewness; Input the calibrated distribution feature tensor into the mean cumulant calculation formula and the covariance cumulant calculation formula respectively, and calculate and output the first cumulant and the second cumulant ; Sum the first cumulant and the second cumulant and output the teacher's mixed statistical features .
4. The small-sample classification method based on complete expressions and generalized descriptions according to claim 3, wherein The method further includes: The mean cumulant calculation formula is as follows: ; The covariance cumulant calculation formula is as follows: 。 5. A small-sample classification method based on complete expressions and generalized descriptions as described in claim 1, characterized in that Compress and reconstruct the teacher's mixed statistical features through an autoencoder to generate the teacher's latent coding features and the teacher's reconstruction features The method includes: The autoencoder consists of an encoder and a decoder wherein the encoder and the decoder are both one-layer convolutional networks; Through the encoder Compress the teacher's mixed statistical features to generate the teacher's latent coding features , where ; Through the decoder Reconstruct the teacher's latent coding features to generate the teacher's reconstructed features where .
6. The small sample classification method based on complete expression and generalization description according to claim 2, wherein Using the mixed statistical features of the teacher , the latent coding features of the teacher and the reconstruction features of the teacher , after calculating the 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 is trained, the method includes: Convert the teacher's latent coding features through a Softmax classifier into a first-class probability distribution , where ; Map the teacher's latent coding features through a mapping network to a first normalized feature vector , where ; Input the first category probability distribution and the first normalized eigenvector into the first multi-task loss function, and output the first multi-objective loss value; Apply the first multi-objective loss value to the gradient descent algorithm to update the teacher network.
7. A small-sample classification method based on complete expressions and generalization descriptions as described in claim 6, characterized in that The method further includes: The first multi-task loss function is as follows: ; Among them, is the first multi-task loss function, is the first loss function, is the second loss function, is the third loss function, is used to adjust the weight of ; Among them, U is the number of samples in the basic data set, is the number of sample categories in the basic data set, is the true label category value of; ; Among them, is the first sample set, and the first sample set has the same label value as the first normalized feature vector ; is the th feature vector in the first sample set, is the temperature coefficient; ; Among them, denotes norm.
8. A small-sample classification method based on complete expressions and generalized descriptions according to claim 7, characterized in that Transfer the student's mixed statistical features using knowledge distillation and the student's latent coding features and the student's reconstruction features to the student network, and then use the gradient descent algorithm to perform iterative optimization of the student network. The method includes: Perform transformation and mapping processing on the potential coding features of the student to output the second category probability distribution and the second normalized feature vector ; After migrating the first multi-task loss function, construct a second multi-task loss function; Input the first category probability distribution , the second category probability distribution , the first normalized eigenvector and the second normalized eigenvector into the second multi-task loss function, and output the second multi-objective loss value; Apply the second multi-objective loss value to the gradient descent algorithm to update the student network.
9. A small-sample classification method based on complete expressions and generalized descriptions according to claim 8, characterized in that After migrating the first multi-task loss function, construct a second multi-task loss function, the method includes: After migrating the first multi-task loss function, adjust the weights of the first multi-task loss function to obtain a fourth loss function; Construct a fifth loss function, the fifth loss function is as follows: ; Pre-construct a sixth loss function, as follows: ; Among them, is the sixth loss function, is the class relationship diagram of the teacher network, is the class relationship diagram of the student network; Fuse the fourth loss function, the fifth loss function and the sixth loss function by configuring weight parameters to obtain the second multi-task loss function, as follows: ; Among them, is the second multi-task loss function, is the fourth loss function, is the fifth loss function; β and γ are weight parameters.
10. A small-sample classification method based on complete expressions and generalized descriptions as described in claim 9, characterized in that, Pre-construct a sixth loss function, the method includes: Based on the second normalized eigenvector Construct an adjacency matrix , and generate the student network class relationship graph , where is the vertex set , is the edge set; The adjacency matrix has its elements calculated as follows: ; Among them, is the second sample set, and the second sample set has the same label value as the second normalized feature vector ; is the normalized feature vector of the j th sample in the second sample set; And so on, generate the class relationship graph of the teacher network; Construct and generate the sixth loss function according to the class relationship graph of the teacher network and the class relationship graph of the student network.
Citation Information
Patent Citations
Remote education system and equipment based on fourth generation Internet
CN104506565A
Small sample image classification system and method thereof
CN115100470A
Knowledge distillation method and device oriented to small sample learning and storage medium
CN116363423A