An image classification method and program product based on task-adaptive multi-scale feature fusion
Patent Information
- Application Number
- CN202611034173.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明公开了一种基于任务自适应多尺度特征融合的图像分类方法、程序产品,以克服现有技术中,固定分类层难以快速适配新的分类任务,容易出现过拟合、类别边界不稳定以及新类别识别能力不足等问题
[0016] Compared to existing technologies, this invention is driven by the statistical information of the current classification task, enabling the model to dynamically select mid-level texture features and high-level semantic features based on the task distribution reflected by the supporting images, even when the category set changes or the number of single-class labeled images is limited. Furthermore, it improves the image classification accuracy and robustness by coordinating and stabilizing the category prototype through residual multiplicative feature adaptation, intra-task feature coordinate unification, and direct prototyping correction.
Smart Images

Figure CN122597890A_ABST
Abstract
Description
Technical Field
[0001] This invention discloses an image classification method and program product based on task-adaptive multi-scale feature fusion, belonging to the field of image classification technology. Background Technology
[0002] Image classification is a fundamental task in computer vision, aiming to output corresponding category labels based on the visual content of an input image. Conventional image classification methods typically train a fixed feature extraction network and a fixed classification layer using a large number of labeled images. When the set of categories to be classified changes, or when the number of labeled images available for certain categories is limited, the fixed classification layer struggles to quickly adapt to the new classification task, easily leading to problems such as overfitting, unstable category boundaries, and insufficient recognition ability for new categories.
[0003] Image classification methods based on metric learning determine classification by comparing the similarity between the image to be classified and the representative vectors of each category, thus reducing reliance on fixed classification layers. However, existing classification methods still have the following shortcomings: 1. When using only a single level of features, it is difficult to simultaneously take into account both local texture details and high-level semantic information; 2. Even when using multi-level features, the fusion weights are usually fixed and cannot be dynamically adjusted according to the characteristics of the current classification task; 3. There are feature distribution shifts between different classification tasks, and directly measuring similarity will affect the stability of category prototypes; 4. The distribution information contained in the batch query images was not fully utilized during the inference stage, which made the classification boundary easily affected by noise from a small number of supporting samples.
[0004] In summary, there is a need in this field for an image classification method that can adaptively fuse multi-scale features, lightly correct the feature distribution of the task, and stably construct category prototypes based on the current image classification task. Summary of the Invention
[0005] This invention discloses an image classification method and program product based on task-adaptive multi-scale feature fusion, which overcomes the problems in the prior art, such as the difficulty of quickly adapting a fixed classification layer to new classification tasks, and the tendency to overfit, unstable class boundaries, and insufficient recognition ability of new classes.
[0006] An image classification method based on task-adaptive multi-scale feature fusion includes a training phase and an inference phase. The training phase includes S1-S4, and the inference phase includes S5-S8. S1, Random data augmentation is performed on the labeled images in the sample set to obtain the augmented images; S2, the enhanced image is input into the wide residual backbone network, mid-level features and high-level features are extracted, the wide residual backbone network and fusion module are pre-trained with a preset classification loss as the target, and the parameters of the wide residual backbone network are initialized by combining the optimization strategy. S3, the enhanced image is divided into several classification tasks, and the wide residual backbone network that has been initialized is subjected to task-level meta-training. S4. Input the support set B and the query set to be classified into the wide residual backbone network that has completed task-level meta-training, extract the mid-level features and high-level features, and obtain the task descriptor by channel statistics based on the features of the support set B. S5, Generate channel-wise fusion weights based on the task descriptor, and perform adaptive multi-scale fusion on the mid-level and high-level features of the support set B to obtain task adaptive fusion features; S6, input the task adaptive fusion feature into the residual multiplicative feature adaptation module to generate a channel modulation vector, and perform channel-by-channel multiplicative adjustment on the task adaptive fusion feature in a multiplicative residual manner to obtain the adapted support set feature; S7, perform intra-task centering and normalization on the adapted support set features and the query set features to be classified, construct each category prototype based on the normalized support set features, and determine the classification score of each query image based on the similarity between the normalized query set features and the category prototypes. S8, perform direct iterative correction on the prototypes of each category, and determine the classification score of each query image based on the features of the query set to be classified and the corrected prototypes of each category.
[0007] The random data augmentation includes random cropping, flipping, rotation, color perturbation, and random erasure.
[0008] The wide residual backbone network includes several levels of residual blocks, which are stacked to achieve a deep hierarchical structure. A block-shaped random inactivation regularization module is set in at least one deep hierarchical structure. The fusion module performs a weighted combination of the mid-level features and high-level features output by the residual backbone network. The mid-level features are output by the intermediate levels of the wide residual backbone network. The intermediate levels are the convolution operation sequences located between the input skip connection start point and the output summation point in the main branch of the wide residual backbone network. The high-level features are output by the final level of the wide residual backbone network. The optimization strategies include label smoothing, mixed sample augmentation, learning rate preheating, and cosine annealing.
[0009] In the classification task, each classification task consists of a support set A and a labeled query set. In the task-level meta-training stage, the shallow parameters of the wide residual backbone network and the trained fusion module are frozen. Only a small number of high-level layers of the network, the fusion weight generation module, the feature adaptation scaling factor, and the temperature measurement parameter are trained. The cross-entropy loss is calculated for the labeled query set, and the supervised contrast loss and the forward consistency regularization term are superimposed.
[0010] S4 includes concatenating the mid-level features and high-level features of the support set B, calculating the channel mean and channel variance along the sample dimension for the concatenated multi-scale image features, and concatenating the channel mean and channel variance to form the task descriptor, which is used to characterize the current category combination, sample texture differences and semantic distribution features.
[0011] S5 includes projecting mid-level features to a dimension consistent with high-level features, generating channel-wise fusion weights from the task descriptor, and using these weights to perform a channel-wise convex combination of the mid-level projected features and high-level features to obtain the task-adaptive fusion features. The adaptive multi-scale fusion is dynamically generated by the channel-wise fusion weights based on the task descriptor, and a gated compensation branch is added. This branch gates the query set image features to be classified element-wise and projects them to the fusion feature dimension, then superimposes a preset scaling factor onto the task-adaptive fusion features. The fusion feature dimension is the number of channels of the task-adaptive fusion features.
[0012] S6 includes the residual multiplicative feature adaptation module, which sequentially performs normalization, dimensionality reduction, nonlinear transformation, dimensionality increase, and bounded activation to generate a channel modulation vector. Then, the input features are multiplicatively adjusted channel by channel by multiplying the channel modulation vector by a learnable scaling factor.
[0013] The in-task centering and normalization include calculating the in-task mean vector based on the adapted support set features and the query set features to be classified, subtracting the in-task mean vector from the adapted support set features and the query set features to be classified to complete the in-task centering, and then performing sample-by-sample L2 normalization on the support set features and the query set features to be classified after the in-task centering.
[0014] The direct-push iterative correction includes calculating the soft assignment of each category of the query set to be classified based on the category prototypes, using the soft assignments as weights to perform weighted aggregation on the image features of the query set to be classified, obtaining correction terms for each category prototype, fusing the correction terms with each category prototype according to a preset fusion coefficient and then normalizing, and repeating S8 until a preset number of iterations is reached, calculating the classification score of each query image in the query set to be classified based on the corrected category prototypes; performing multi-view enhancement on the images of the query set to be classified, calculating the classification score under each enhanced view, and taking the average of the classification scores under each enhanced view according to the category, and taking the category with the highest average score as the final classification result, wherein the multi-view enhancement includes one or more operations such as flipping, rotating, or cropping.
[0015] A program product for causing a processor to execute the aforementioned task-adaptive multi-scale feature fusion-based image classification method.
[0016] Compared to existing technologies, this invention is driven by the statistical information of the current classification task, enabling the model to dynamically select mid-level texture features and high-level semantic features based on the task distribution reflected by the supporting images, even when the category set changes or the number of single-class labeled images is limited. Furthermore, it improves the image classification accuracy and robustness by coordinating and stabilizing the category prototype through residual multiplicative feature adaptation, intra-task feature coordinate unification, and direct prototyping correction. Attached Figure Description
[0017] Figure 1 This is a technical flowchart of the present invention; Figure 2 This is a schematic diagram of the classification model structure; Figure 3 This is a schematic diagram of the structure of the task-adaptive multi-scale fusion module; Figure 4 This is a flowchart of the training phase; Figure 5 This is a flowchart of task adaptive measurement and direct iterative correction. Detailed Implementation
[0018] An image classification method based on task-adaptive multi-scale feature fusion includes a training phase and an inference phase. The training phase includes S1-S4, and the inference phase includes S5-S8. S1, Random data augmentation is performed on the labeled images in the sample set to obtain the augmented images; S2, the enhanced image is input into the wide residual backbone network, mid-level features and high-level features are extracted, the wide residual backbone network and fusion module are pre-trained with a preset classification loss as the target, and the parameters of the wide residual backbone network are initialized by combining the optimization strategy. S3, the enhanced image is divided into several classification tasks, and the wide residual backbone network that has been initialized is subjected to task-level meta-training. S4. Input the support set B and the query set to be classified into the wide residual backbone network that has completed task-level meta-training, extract the mid-level features and high-level features, and obtain the task descriptor by channel statistics based on the features of the support set B. S5, Generate channel-wise fusion weights based on the task descriptor, and perform adaptive multi-scale fusion on the mid-level and high-level features of the support set B to obtain task adaptive fusion features; S6, input the task adaptive fusion feature into the residual multiplicative feature adaptation module to generate a channel modulation vector, and perform channel-by-channel multiplicative adjustment on the task adaptive fusion feature in a multiplicative residual manner to obtain the adapted support set feature; S7, perform intra-task centering and normalization on the adapted support set features and the query set features to be classified, construct each category prototype based on the normalized support set features, and determine the classification score of each query image based on the similarity between the normalized query set features and the category prototypes. S8, perform direct iterative correction on the prototypes of each category, and determine the classification score of each query image based on the features of the query set to be classified and the corrected prototypes of each category.
[0019] The random data augmentation includes random cropping, flipping, rotation, color perturbation, and random erasure.
[0020] The wide residual backbone network includes several levels of residual blocks, which are stacked to achieve a deep hierarchical structure. A block-shaped random inactivation regularization module is set in at least one deep hierarchical structure. The fusion module performs a weighted combination of the mid-level features and high-level features output by the residual backbone network. The mid-level features are output by the intermediate levels of the wide residual backbone network. The intermediate levels are the convolution operation sequences located between the input skip connection start point and the output summation point in the main branch of the wide residual backbone network. The high-level features are output by the final level of the wide residual backbone network. The optimization strategies include label smoothing, mixed sample augmentation, learning rate preheating, and cosine annealing.
[0021] In the classification task, each classification task consists of a support set A and a labeled query set. In the task-level meta-training stage, the shallow parameters of the wide residual backbone network and the trained fusion module are frozen. Only a small number of high-level layers of the network, the fusion weight generation module, the feature adaptation scaling factor, and the temperature measurement parameter are trained. The cross-entropy loss is calculated for the labeled query set, and the supervised contrast loss and the forward consistency regularization term are superimposed.
[0022] S4 includes concatenating the mid-level features and high-level features of the support set B, calculating the channel mean and channel variance along the sample dimension for the concatenated multi-scale image features, and concatenating the channel mean and channel variance to form the task descriptor, which is used to characterize the current category combination, sample texture differences and semantic distribution features.
[0023] S5 includes projecting mid-level features to a dimension consistent with high-level features, generating channel-wise fusion weights from the task descriptor, and using these weights to perform a channel-wise convex combination of the mid-level projected features and high-level features to obtain the task-adaptive fusion features. The adaptive multi-scale fusion is dynamically generated by the channel-wise fusion weights based on the task descriptor, and a gated compensation branch is added. This branch gates the query set image features to be classified element-wise and projects them to the fusion feature dimension, then superimposes a preset scaling factor onto the task-adaptive fusion features. The fusion feature dimension is the number of channels of the task-adaptive fusion features.
[0024] S6 includes the residual multiplicative feature adaptation module, which sequentially performs normalization, dimensionality reduction, nonlinear transformation, dimensionality increase, and bounded activation to generate a channel modulation vector. Then, the input features are multiplicatively adjusted channel by channel by multiplying the channel modulation vector by a learnable scaling factor.
[0025] The in-task centering and normalization include calculating the in-task mean vector based on the adapted support set features and the query set features to be classified, subtracting the in-task mean vector from the adapted support set features and the query set features to be classified to complete the in-task centering, and then performing sample-by-sample L2 normalization on the support set features and the query set features to be classified after the in-task centering.
[0026] The direct-push iterative correction includes calculating the soft assignment of each category of the query set to be classified based on the category prototypes, using the soft assignments as weights to perform weighted aggregation on the image features of the query set to be classified, obtaining correction terms for each category prototype, fusing the correction terms with each category prototype according to a preset fusion coefficient and then normalizing, and repeating S8 until a preset number of iterations is reached, calculating the classification score of each query image in the query set to be classified based on the corrected category prototypes; performing multi-view enhancement on the images of the query set to be classified, calculating the classification score under each enhanced view, and taking the average of the classification scores under each enhanced view according to the category, and taking the category with the highest average score as the final classification result, wherein the multi-view enhancement includes one or more operations such as flipping, rotating, or cropping.
[0027] A program product for causing a processor to execute the aforementioned task-adaptive multi-scale feature fusion-based image classification method.
[0028] This invention does not simply superimpose multi-scale features, feature fitting, and prototype classification modules. Instead, it uses statistical information from the current image classification task as a unified thread running through training and inference. The overall flowchart is as follows: Figure 1 As shown. Specifically, the channel mean and variance of the supporting image first form a task descriptor, which controls the channel-wise fusion of mid-level texture features and high-level semantic features. The fused features are then subjected to task-related lightweight modulation by the residual multiplicative feature adaptation module. Subsequently, a category prototype is constructed in the feature space after in-task centralization and normalization. During the inference stage, the prototype is corrected using the soft assignment results of batches of unlabeled query images.
[0029] Figure 2 The classification model structure of this invention consists of a residual backbone network composed of several levels of residual blocks connected in series. Each residual block includes convolutional layers, batch normalization layers, and nonlinear activation layers. A block-based random deactivation regularization module is introduced at deeper layers to suppress overfitting. The network outputs mid-level feature maps at intermediate layers and high-level feature maps at the final layer. After global pooling, mid-level and high-level feature vectors are obtained respectively. Mid-level features retain more texture, edge, and local structural information, while high-level features have stronger semantic discriminative power. By simultaneously utilizing mid-level and high-level features, this invention can obtain complementary multi-scale image representations.
[0030] The task descriptor and task adaptive multi-scale fusion process is as follows: Figure 3As shown, for the current image classification task, the mid-level and high-level features supporting the image are first extracted. These features are then concatenated, and the channel mean and channel variance are calculated along the sample dimension. These channel mean and channel variance are then concatenated to form the task descriptor. This task descriptor characterizes the overall feature distribution of the current task. During task-adaptive multi-scale fusion, the mid-level features are first mapped to the same dimension as the high-level features via linear projection. Then, the task descriptor is used to generate channel-wise fusion weights through a mapping network. These fusion weights are used to perform channel-wise convex combination of the mid-level projected features and the high-level features, enabling each channel to adaptively determine whether to rely more on texture or semantic information based on the current task. Furthermore, a gated compensation branch is set. This branch applies element-wise gating to the original multi-scale concatenated features, projects them back to the fusion dimension, and adds them back to the main fusion result with a smaller scaling factor, thus preserving multi-scale complementary information outside of the main fusion.
[0031] The task-adaptive fusion features are input into the residual multiplicative feature adaptation module. This module sequentially processes the features through normalization, dimensionality reduction, nonlinear transformation, dimensionality increase, and bounded activation to generate channel modulation vectors. Subsequently, the input features are multiplicatively adjusted channel-by-channel by multiplying the channel modulation vectors with learnable scaling coefficients. The learnable scaling coefficients are initialized to small values close to zero, ensuring that the residual multiplicative feature adaptation module approximates an identity mapping in the initial stage. This avoids disrupting the basic feature space established during the category-level pre-training stage, allowing only gradual, lightweight corrections to the feature distribution during task-level training.
[0032] For the supporting and query images of the current task, their adapted features are used together to calculate the task-specific mean vector. This task-specific mean vector is then subtracted from each feature to eliminate the global bias of the current task. Subsequently, L2 normalization is applied to the centered features. For each category, the mean of all supporting image features for that category is taken and normalized to obtain the category prototype. Cosine similarity is calculated between the query image features and each category prototype, and scaled using a learnable temperature coefficient to obtain a classification score. The category with the highest classification score is selected as the output category for the query image.
[0033] The training phase process is as follows: Figure 4As shown, this invention employs a two-stage training approach. The first stage is category-level pre-training, which applies enhancements such as random cropping, flipping, rotation, color perturbation, and random erasure to labeled images. The image is then trained using a residual backbone network and a cosine classifier, and strategies such as label smoothing, mixed sample enhancement, learning rate warm-up, and cosine annealing can be used to obtain transferable basic image features. The second stage is task-level training, which organizes the images into several classification tasks, each including a support set and a query set. In this stage, the shallow layers of the backbone network and the already learned fusion structure are frozen, and only a small number of high-level layers of the backbone, the fusion weight generation module, the feature adaptation scaling factor, and parameters such as temperature measurement are trained. During training, cross-entropy loss is calculated for the query image, and supervised contrastive loss and forward consistency regularization are superimposed to improve classification stability.
[0034] The process of task-adaptive metric and pushforward iterative correction is as follows: Figure 5 As shown, no network parameters need to be updated during the inference phase. Given support images and batch query images for an image classification task, features are first extracted through a shared backbone network, a task-adaptive fusion module, and a residual multiplicative feature adaptation module. Intra-task centering and normalization are then performed, and an initial category prototype is constructed from the support images.
[0035] To verify the effectiveness of each module of this invention, an ablation experiment was conducted using the publicly available remote sensing scene classification dataset NWPU-RESISC45 in one embodiment. This dataset, sourced from Google Earth, contains 31,500 three-channel images across 45 categories of remote sensing scenes, with 700 images per category. Each image is 256×256 pixels in size and covers various typical landforms such as airports, ports, forests, residential areas, rivers, railways, and sports fields. This dataset has a large number of categories and strong intra-class and inter-class similarities, making it suitable for testing the stability of image classification methods with a limited number of labeled samples.
[0036] The experiments employed two task settings: 5-way 1-shot and 5-way 5-shot. For each task, five classes were randomly selected from the test categories, and one or five supporting images were provided for each class. Query images were used to evaluate classification accuracy. All results were statistically analyzed across 600 test tasks, calculating the average accuracy and 95% confidence intervals. Except for the ablation term, all experimental groups used the same residual backbone network, the same data partitioning, the same number of training epochs, and the same number of query samples to eliminate the influence of differences in training protocols on the results.
[0037] The module ablation experiment results of this invention on the NWPU-RESISC45 dataset are shown in Table 1. The analysis results show that after adding the inductive prototype correction to the basic prototype metric classification model, the 1-shot accuracy increased from 73.72% to 82.64%, and the 5-shot accuracy increased from 87.73% to 89.97%. This indicates that the distribution information contained in the batch query images can effectively correct the category prototypes formed by only a few supporting images, especially when there is only one supporting image for each category.
[0038] Table 1 shows the experimental results of module ablation of this invention on the NWPU-RESISC45 dataset. .
[0039] After adding in-task statistical calibration to the direct-prototype calibration, the 1-shot accuracy was further improved to 83.14%, and the 5-shot accuracy was improved to 90.16%. This result shows that calibrating the feature coordinates and distribution scale based on the current task statistics can alleviate feature shifts between different classification tasks and make subsequent cosine similarity measurements more stable.
[0040] After further adding multi-view inference enhancements such as flipping, rotating, center clipping, and four-corner clipping, the 1-shot accuracy improved to 84.10%, indicating that when there are very few supporting samples, multi-view supporting features can form more robust category prototypes. In the 5-shot scenario, the number of supporting samples is relatively sufficient, and the prototype estimation itself is relatively stable. Therefore, the gain brought by multi-view enhancement is small but still maintains a positive effect.
[0041] When further utilizing the overall distribution statistics of unlabeled query images, the 1-shot and 5-shot accuracies reached 84.15% and 90.30%, respectively. This setting, which does not use query image labels but only utilizes the feature distribution information of query images, demonstrates that the in-task statistical modeling and inductive reasoning mechanism of this invention can further stabilize the classification boundary without updating network parameters.
[0042] In summary, this invention employs task-adaptive multi-scale fusion to select texture and semantic information based on the current task; residual multiplicative feature adaptation and intra-task statistical calibration to reduce feature distribution shifts between tasks; intra-task centering and prototype metric classification to stabilize category representations; and transductive prototype correction and multi-view reasoning enhancement to further improve prototype reliability under limited sample conditions. These modules are linked by task statistical information and complement each other, collectively improving the classification accuracy and robustness of the image classification method in scenarios with category changes and insufficient labeled samples.
[0043] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. An image classification method based on task-adaptive multi-scale feature fusion, characterized in that, The process includes a training phase and an inference phase. The training phase includes S1 to S4, and the inference phase includes S5 to S8. S1, Random data augmentation is performed on the labeled images in the sample set to obtain the augmented images; S2, the enhanced image is input into the wide residual backbone network, mid-level features and high-level features are extracted, the wide residual backbone network and fusion module are pre-trained with a preset classification loss as the target, and the parameters of the wide residual backbone network are initialized by combining the optimization strategy. S3, the enhanced image is divided into several classification tasks, and task-level meta-training is performed on the wide residual backbone network that has been initialized. S4. Input the support set B and the query set to be classified into the wide residual backbone network that has completed task-level meta-training, extract the mid-level and high-level features, and obtain the task descriptor by channel statistics based on the features of the support set B. S5, Generate channel-wise fusion weights based on the task descriptor, and perform adaptive multi-scale fusion on the mid-level and high-level features of support set B to obtain task adaptive fusion features. S6, input the task adaptive fusion feature into the residual multiplicative feature adaptation module to generate a channel modulation vector, and perform channel-by-channel multiplicative adjustment on the task adaptive fusion feature in a multiplicative residual manner to obtain the adapted support set feature; S7, perform intra-task centering and normalization on the adapted support set features and the query set features to be classified, construct each category prototype based on the normalized support set features, and determine the classification score of each query image based on the similarity between the normalized query set features and the category prototypes. S8, perform direct iterative correction on the prototypes of each category, and determine the classification score of each query image based on the features of the query set to be classified and the corrected prototypes of each category.
2. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, The random data augmentation includes random cropping, flipping, rotation, color perturbation, and random erasure.
3. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, The wide residual backbone network includes several levels of residual blocks, which are stacked to achieve a deep hierarchical structure. A block-shaped random inactivation regularization module is set in at least one deep hierarchical structure. The fusion module performs a weighted combination of the mid-level features and high-level features output by the residual backbone network. The mid-level features are output by the intermediate levels of the wide residual backbone network. The intermediate levels are the convolution operation sequences located between the input skip connection start point and the output summation point in the main branch of the wide residual backbone network. The high-level features are output by the final level of the wide residual backbone network. The optimization strategies include label smoothing, mixed sample augmentation, learning rate preheating, and cosine annealing.
4. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, S3 includes the following: In the classification task, each classification task consists of a support set A and a labeled query set. In the task-level meta-training stage, the shallow parameters of the wide residual backbone network and the trained fusion module are frozen, and only a small number of high-level layers of the network, the fusion weight generation module, the feature adaptation scaling factor, and the temperature measurement parameter are trained. The cross-entropy loss is calculated for the labeled query set, and then the supervised contrast loss and forward consistency regularization term are added.
5. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, S4 includes concatenating the mid-level features and high-level features of the support set B, calculating the channel mean and channel variance along the sample dimension for the concatenated multi-scale image features, and concatenating the channel mean and channel variance to form the task descriptor, which is used to characterize the current category combination, sample texture differences and semantic distribution features.
6. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, S5 includes projecting mid-level features to the same dimension as high-level features, generating channel-wise fusion weights from the task descriptor, and using channel-wise fusion weights to perform channel-wise convex combination of mid-level projected features and high-level features to obtain the task adaptive fusion features. The adaptive multi-scale fusion is dynamically generated by the channel-wise fusion weights based on the task descriptor. A gated compensation branch is added, which performs element-wise gated compensation on the image features of the query set to be classified and projects them onto the fusion feature dimension. A preset scaling factor is superimposed on the task adaptive fusion feature, and the fusion feature dimension is the number of channels of the task adaptive fusion feature.
7. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, S6 includes the residual multiplicative feature adaptation module sequentially undergoing normalization, dimensionality reduction, nonlinear transformation, dimensionality increase, and bounded activation to generate a channel modulation vector; The input features are multiplicatively adjusted channel by channel by multiplying the channel modulation vector by a learnable scaling factor.
8. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, The in-task centering and normalization includes calculating the in-task mean vector based on the adapted support set features and the query set features to be classified, and subtracting the in-task mean vector from the adapted support set features and the query set features to be classified, respectively, to complete the in-task centering. The features of the support set and the features of the query set to be classified are subjected to sample-by-sample L2 normalization.
9. The image classification method based on task-adaptive multi-scale feature fusion according to claim 1, characterized in that, S8 includes the following: the direct iterative correction includes calculating the soft assignment of each category of the query set to be classified based on the category prototypes, using the soft assignments of each category as weights to perform weighted aggregation on the image features of the query set to be classified to obtain the correction terms of each category prototype, fusing the correction terms with each category prototype according to a preset fusion coefficient and then normalizing, and repeating S8 until a preset number of iterations is reached, and calculating the classification score of each query image in the query set to be classified based on the corrected category prototypes; The images of the query set to be classified are enhanced from multiple perspectives. The classification score under each enhanced perspective is calculated, and the average of the classification scores under each enhanced perspective is taken by category. The category with the highest average score is taken as the final classification result. The multi-view enhancement includes one or more operations such as flipping, rotating or cropping.
10. A program product, characterized in that, The program product is used to enable the processor to execute an image classification method based on task-adaptive multi-scale feature fusion as described in any one of claims 1-9.