A fine-grained image classification method for double-layer component distillation

By employing a two-layer component distillation method, semantic component information is transferred to the mid-to-high-level features of the backbone network, which solves the problems of high computational cost and low accuracy in fine-grained image classification, achieving higher classification accuracy and shorter inference time.

CN116704231BActive Publication Date: 2026-02-06SHANGHAI NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310182757.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2026-02-06
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

Existing fine-grained image classification methods based on the 'localization-classification' paradigm have high computational cost and low accuracy during the testing/inference phase, and require additional semantic component detection and recognition steps, which affects the efficiency of the algorithm.

Method used

A two-layer component distillation method is adopted to transfer local information of semantic components to mid-level features of the backbone network and semantic context information to high-level features. Knowledge distillation is used to supervise the training phase, avoiding semantic component detection and recognition in the testing/inference phase.

Benefits of technology

It improves classification accuracy, reduces computational load, shortens inference time, and achieves higher classification representation capabilities by directly fusing mid-level and high-level features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116704231B_ABST
    Figure CN116704231B_ABST
Patent Text Reader

Abstract

The application discloses a fine-grained image classification method based on double-layer component distillation, and belongs to the technical field of image processing. The method comprises the following steps: acquiring an initial image data set and pre-processing the same; constructing a fine-grained image recognition network based on double-layer component distillation, which comprises a target-level global prediction subnetwork, a component detection module, a component-level prediction subnetwork and a supervision and knowledge distillation module; feeding the pre-processed initial image data set into the image recognition network for training; inputting a target image to be classified into the trained target-level global prediction subnetwork to obtain a classification result. The application effectively utilizes knowledge distillation, migrates local information of semantic components to middle-layer features of a backbone network, migrates semantic context information of each semantic component to high-layer features of the backbone network, enables the network to obtain higher classification accuracy, avoids semantic component detection and recognition, thereby reducing calculation amount and greatly shortening inference time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a fine-grained image classification method based on double-layer component distillation. BACKGROUND

[0002] Image classification is one of the most important tasks in the field of computer vision. Early image classification tasks focus on distinguishing coarse-grained categories, such as recognizing vehicles, aircraft, birds, and insects. The visual differences between coarse-grained categories are large, and the recognition difficulty is low. In comparison, the task of fine-grained image classification is to identify different species of birds, vehicle models, and aircraft models. Due to the small visual differences between subcategories, the inter-class variance of fine-grained image classification is small. However, targets belonging to the same subcategory may exhibit significant differences under the influence of different lighting, poses, and occlusion factors, resulting in a large intra-class variance in fine-grained image classification.

[0003] Fine-grained image classification has a wide range of application scenarios, including product classification in smart retail scenarios, where the same product from the same brand has different flavors and the visual differences between these products are small, vehicle recognition in road scenarios, and biodiversity detection for biological species.

[0004] Fine-grained image classification algorithms based on the "localization-classification" paradigm have received increasing attention from researchers in recent years. The "localization-classification" paradigm consists of a localization subnetwork and a classification subnetwork. The localization network is responsible for localizing the semantic components of the target, and the features of each semantic component are extracted from the semantic component map. The features of each component and the features of the original image are concatenated or other similar fusion operations to obtain the final classification representation. The classification subnetwork is responsible for making the final classification prediction based on this classification representation. However, the "localization-classification" paradigm has the following drawbacks: In addition to extracting features from the original image, additional semantic components need to be localized and cropped, and component features need to be extracted from the semantic component map. This step requires a large amount of computation and directly affects the efficiency of the algorithm. SUMMARY

[0005] To solve the problem of high computational complexity and low accuracy in the test / inference stage of fine-grained image classification based on the "localization-classification" paradigm, the present application provides a fine-grained image classification method based on double-layer component distillation. This method effectively utilizes knowledge distillation to transfer the local information of semantic components to the middle-level features of the backbone network. At the same time, the semantic context information of each semantic component is transferred to the high-level features of the backbone network, allowing the network to obtain classification representation by directly fusing the middle-level features and high-level features of the backbone network in the test / inference stage, achieving higher classification accuracy while avoiding semantic component detection and recognition in the test / inference stage, thereby reducing the computational complexity and significantly shortening the inference time.

[0006] In order to achieve the above object, the present application provides a double-layer component distillation fine-grained image recognition method, comprising:

[0007] (1) obtaining an initial image data set and preprocessing the initial image data set;

[0008] (2) constructing a double-layer component distillation fine-grained image recognition network, the double-layer component distillation fine-grained image recognition network comprising a target-level global predictor network, a component detection module, a component-level predictor network and a supervision and knowledge distillation module;

[0009] (3) inputting the preprocessed initial image data set data into the double-layer component distillation fine-grained image recognition network for training to obtain a trained double-layer component distillation fine-grained image recognition network;

[0010] (4) inputting a target image to be classified into the target-level global predictor network of the trained double-layer component distillation fine-grained image recognition network to obtain a classification result of the target image.

[0011] Further, the preprocessing comprises:

[0012] scaling, cropping and random horizontal flipping of the initial image data set image for data enhancement;

[0013] dividing the data-enhanced initial image data set into a training set and a test set.

[0014] Further, the target-level predictor network comprises a ResNet50 convolutional neural network, a spatial attention module, a channel attention module, two global average pooling layers, three Softmax activation layers and three fully connected layers;

[0015] the ResNet50 convolutional neural network serving as a feature extractor, wherein Conv1x, Conv2x, Conv3x and Conv4x therein serve as middle-layer convolutions, and the output of Conv4x is a middle-layer convolution feature map; Conv5x serves as a high-layer convolution, and the output of Conv5x is a high-layer convolution feature map;

[0016] the high-layer convolution feature map passes through the channel attention module and the global average pooling layer to obtain a high-layer feature vector, and the high-layer feature vector is input into the fully connected layer and the Softmax activation layer to obtain a high-layer probability vector;

[0017] the middle-layer convolution feature map passes through the spatial attention module and the global average pooling layer to obtain a middle-layer feature vector, and the middle-layer feature vector is input into the fully connected layer and the Softmax activation layer to obtain a middle-layer probability vector;

[0018] Finally, the middle layer feature vector and the high layer feature vector are spliced to obtain a target level representation vector, and the representation vector is input into the full connection layer and the Softmax activation layer to obtain a target probability vector.

[0019] Further, the spatial attention module is composed of a 3*3 convolution layer, a normalization layer and a Sigmoid activation layer, and the calculation formula is as follows:

[0020]

[0021] M1 is the output of the Conv4x of the ResNet50, M4 is the output of the spatial attention module; and represent element-wise multiplication, Sigmoid activation function and element-wise addition, respectively.

[0022] Further, the channel attention module is composed of two full connection layers, a ReLU activation layer and a Sigmoid activation layer, and the calculation formula of the channel attention module is as follows:

[0023]

[0024] M2 is the output of the Conv5x of the ResNet50, M3 is the output of the channel attention module; and FCs(.) is the calculation formula of the two full connection layers.

[0025] Further, the component detection module input is the high layer convolution feature map in the target level prediction subnetwork, and a feature pyramid network is used to predict a fixed number of bounding boxes, and the input image is cropped according to the bounding boxes, and the cropped image block is scaled and input into the component level prediction subnetwork as a target component image.

[0026] Further, the feature pyramid network is composed of three convolution layers;

[0027] The first convolution layer does not change the resolution of the input feature map, and the output of the first layer is the input of the second layer;

[0028] The second convolution layer performs 2 times down-sampling on the input feature map, and the feature map is input into the third convolution layer;

[0029] The third convolution layer performs 2 times down-sampling on the input feature map again; each activation value of the feature map output by the three convolution layers respectively represents the information degree score of the anchor box region with different scales and different aspect ratios;

[0030] The non-maximum suppression NMS method is used to obtain the bounding box.

[0031] Further, the component-level predictor network specifically comprises:

[0032] The cropped and resized multiple target component maps are input into a ResNet50 convolutional neural network to extract features, and the high-level convolutional feature maps output by the Conv5x are input into a global average pooling layer to obtain component-level high-level feature vectors, which are then input into a fully connected layer and a Softmax activation layer to obtain a probability vector for each target component map; the probability vectors of all target component maps are averaged to obtain a component probability vector.

[0033] The high-level convolutional feature maps of each target component map are spliced along the channel dimension, and the spliced high-level convolutional feature maps are input into a 1*1 convolutional layer, a batch normalization layer and a ReLU activation layer to model the context relationship between components, and the obtained feature vectors are input into a fully connected layer and a Softmax activation layer to obtain a global probability vector.

[0034] Further, the supervision and knowledge distillation module specifically comprises:

[0035] The middle-level feature vectors and high-level feature vectors of the target-level predictor network are supervised using a cosine loss function;

[0036] The component probability vector, global probability vector and target probability vector are supervised using a cross-entropy loss function;

[0037] The component probability vector and global probability vector of the component-level predictor network are used to respectively perform knowledge distillation on the middle-level probability vector and high-level probability vector of the target-level predictor network, and the local information and context information of each component map are respectively distilled into the target-level predictor network through knowledge distillation.

[0038] Further, the knowledge distillation process is as follows:

[0039] The global probability vector p(x) is calculated according to the following formula: cpart The component probability vector P(x) is calculated according to the following formula: spart The middle-level probability vector P(x) is calculated according to the following formula: mid The high-level probability vector P(x) is calculated according to the following formula: high The softened probability vector q(x) is calculated according to the following formula: cpart The softened probability vector q(x) is calculated according to the following formula: spart The softened probability vector q(x) is calculated according to the following formula: mid The softened probability vector q(x) is calculated according to the following formula: high The softened probability vector q(x) is calculated according to the following formula:

[0040]

[0041] Wherein, T is a temperature hyperparameter, which determines the degree of softening of the vector;

[0042] The global probability vector of the component-level predictor network conducts knowledge distillation on the high-level probability vector of the target-level predictor network:

[0043]

[0044] The component probability vector of the component-level predictor network conducts knowledge distillation on the middle-level probability vector of the target-level predictor network:

[0045]

[0046] The total knowledge distillation loss is:

[0047]

[0048] The beneficial effects of the present application are:

[0049] 1. The present application proposes an object-level global predictor network, which extracts middle-level convolutional features and high-level convolutional features respectively, to propose two object-level overall prediction vectors supervised by knowledge distillation, and connects the features of the two levels to generate the final prediction. In this way, the extracted knowledge can improve the representation ability of the connected features

[0050] 2. The present application detects component regions and extracts component-level features from each component map, and then proposes two component-level predictions by averaging and splicing. The first component-level prediction is generated by averaging different features, and the other component-level prediction is generated by splicing component-level features. The two predictions are effectively extracted to improve the representation ability of the middle-level and high-level features in the training stage.

[0051] 3. In order to improve the classification accuracy, the present application proposes six losses, i.e. four target supervision and two knowledge distillation. BRIEF DESCRIPTION OF DRAWINGS

[0052] Figure 1 is the flowchart of the fine-grained image classification method of the double-layer component distillation of the embodiment of the present application.

[0053] Figure 2 is the overall schematic diagram of the fine-grained image recognition network (training stage) of the double-layer component distillation of the embodiment of the present application.

[0054] Figure 3 is the overall schematic diagram of the fine-grained image recognition network (test / inference stage) of the double-layer component distillation of the embodiment of the present application. DETAILED DESCRIPTION

[0055] The present application will be described in detail below in conjunction with the drawings and embodiments.

[0056] Examples of the described embodiments are illustrated by way of example in the accompanying drawings, in which like reference numerals indicate like elements or elements with the same or similar function throughout the several disclosed embodiments. The embodiments described below are examples only, and are not to be taken in a limiting sense.

[0057] The present application provides a double-layer component distillation fine-grained image classification method, in a preferred embodiment, the overall schematic diagram of the method is as shown in Figure 1 The method comprises:

[0058] S101, acquiring an initial image data set, and preprocessing the initial image data set;

[0059] In this embodiment, the bird data set (CUB-200-2011), the car data set (Stanford Car) and the aircraft data set (FGVC-Aircraft) are acquired. The above three data sets are fine-grained image classification public data sets, and each data set is divided into a training set and a test set according to the official annotation information. In order to enhance the generalization ability of the fine-grained image classification model, the present application first performs data enhancement, and the specific steps are: scaling to 512*512 size, center cropping, cropping size is 448*448, and the cropped image is randomly horizontally flipped. In this embodiment, finally 5994 two-dimensional pictures are obtained as the training set;

[0060] S102, constructing a double-layer component distillation fine-grained image recognition network, the double-layer component distillation fine-grained image recognition network comprising a target level global prediction sub-network, a component detection module, a component level prediction sub-network and a supervision and knowledge distillation module;

[0061] As shown in Figure 2 The target level prediction sub-network comprises a ResNet50 convolutional neural network, one spatial attention module, one channel attention module, two global average pooling layers, three Softmax activation layers and three fully connected layers. The input image is input into the ResNet50 convolutional neural network after preprocessing, and the output M1 of the Conv4x of the ResNet50 is input into the spatial attention module and the Conv5x respectively; the outputs of the spatial attention module and the Conv5x are M4 and M2 respectively; the spatial attention module is composed of a 3*3 convolutional layer, a batch normalization layer and a Sigmoid activation layer, and the calculation formula of the spatial attention module is as shown in formula (1):

[0062]

[0063] Wherein: ⊙, σ(.) and represent element-wise multiplication, Sigmoid activation function and element-wise addition respectively.

[0064] M2 is input to the channel attention module and the part detection module respectively. Different channels correspond to different visual modes, and the channel attention vector can describe the correlation information between each visual mode. The channel attention module is composed of two fully connected layers, a ReLU activation layer and a Sigmoid activation layer, and the calculation formula of the channel attention module is shown as formula (2):

[0065]

[0066] FCs(.) is the calculation formula of the two fully connected layers.

[0067] The output of the channel attention is M3, and the outputs of the channel attention module and the spatial attention module are input into the global average pooling layer respectively to obtain the output f h and f m . The present application fuses f h and f m by splicing to obtain a more powerful feature vector f c . f c is input into the fully connected layer and the Softmax activation layer to obtain the classification result. In addition, the present application inputs f h and f m into the fully connected layer and the Softmax activation layer respectively to obtain the respective classification results P high and P mid .

[0068] The part detection module uses a feature pyramid network, and the output M2 of the Conv5x of the ResNet50 in the target level prediction subnetwork is input. In order to facilitate description, it is assumed that the width and height of M2 are W and H respectively. The feature pyramid network is composed of three convolutional layers. The first convolutional layer does not change the resolution of the feature map, and the output of the first layer is the input of the second layer. The second convolutional layer performs 2 times down-sampling on the feature map, and the width and height of the output feature map are W / 2 and H / 2 respectively. The feature map is input into the third convolutional layer, and the third convolutional layer performs 2 times down-sampling on the feature map again, and the width and height of the output feature map are W / 4 and H / 4 respectively. The activation values of the output feature maps of the three convolutional layers respectively represent the information degree scores of the anchor box regions of different scales and different aspect ratios. In order to remove redundant anchor box regions, the present application uses non-maximum suppression (NMS), and the present embodiment retains 4 anchor box regions. According to the boundary box information of the four anchor box regions, the part graph is cropped from the input image and resized to 224*224.

[0069] The four part maps are input into the part-level prediction sub-network, the feature extractor of the part-level prediction sub-network also adopts a ResNet50 convolutional neural network, and the feature extractors of the part-level prediction sub-network and the target-level prediction sub-network share weights. After the four part maps are input into the feature extractor, corresponding feature maps (U1, U2, …, U K ) are obtained. K Here, the feature maps (U1, U2, …, U K ) are subjected to a global average pooling layer to obtain feature vectors (f1, f2, …, f K ), and each feature vector is input into a fully connected layer and a Softmax activation layer to obtain a corresponding probability vector (p1, p2, …, p spart ). The present application takes the average of each probability vector to obtain a part-level prediction vector p spart .

[0070] p K contains rich local information, and the present application migrates the local information to the feature learning of the middle convolutional layer of the target-level prediction sub-network through knowledge distillation, thereby helping the middle convolutional layer to learn the local information of the semantic part directly from the original image. In order to help the high-level convolutional layer to better encode the context information of each semantic part, the present application splices the part-level feature maps (U1, U2, …, U cpart ) along the channel to obtain a spliced feature map V1, encodes the context information between each part through a 1*1 convolutional layer, a batch normalization layer and a ReLU activation layer to obtain V2, and obtains p cpart through a global average pooling layer, a fully connected layer and a Softmax activation layer.

[0071] The knowledge distillation process is as follows:

[0072] The global probability vector p spart , the part probability vector P mid , the middle probability vector P high and the high-level probability vector P cpart are calculated according to the following formula: spart (x), q mid (x), q high (x):

[0073]

[0074] Wherein: T is a temperature hyperparameter, which determines the degree of softening of the vector, and in the present embodiment, T is set to 10.

[0075] The global probability vector of the part-level prediction sub-network performs knowledge distillation on the high-level probability vector of the target-level prediction sub-network:

[0076]

[0077] The component probability vector of the component-level prediction subnetwork conducts knowledge distillation on the middle-layer probability vector of the target-level prediction subnetwork:

[0078]

[0079] The total loss function of the training stage is composed of 3 cross-entropy loss functions, 1 cosine loss function, one positioning loss and 2 knowledge distillation losses. As shown in formula (5).

[0080] L total = al cls +βl pair +γl cos +ωl kd (6)

[0081] l cls = l ce (p cat ,p gt ) + l ce (p cpart ,p gt ) + l ce (p spart ,p gt ) (7)

[0082]

[0083] l cos (f h ,f m ) =∑max(0,cos(f h ,f m )-ε) (9)

[0084]

[0085] S103, the preprocessed initial image data set data is sent into the double-layer component distillation fine-grained image recognition network for training, and a trained double-layer component distillation fine-grained image recognition network is obtained;

[0086] During training of the double-layer component distillation fine-grained image recognition network, the training parameters are set to include:

[0087] In this embodiment, the initial learning rate of the network is set to 0.001, the learning rate gradually decreases with the increase of the number of iterations, after 40 rounds of training, the learning rate is multiplied by 0.1, the batch size is 8, the momentum size is 0.9, the weight decay is 5e-5, and the random gradient descent method is used for training. The settings of the remaining network parameters can be understood as usual, and will not be repeated here.

[0088] S104, input the target image to be classified into the target level global predictor network of the trained double-layer component distillation fine-grained image recognition network, and obtain the classification result of the target image.

[0089] As shown in Figure (3), the present application discards the component level predictor network and the component detection module in the test / reasoning stage, and only uses the target level predictor network to classify data. Because in the training stage, the present application has successfully migrated the local information and context information of the semantic component to the middle layer and high layer feature learning of the target level detection subnetwork, respectively, so that the target level predictor network does not need additional component detection and component level image recognition, nor does it need to extract features from the component graph and fuse the component features and the target features extracted from the input image. The present application only uses the middle layer features and high layer features of the target predictor network for fusion, improving the representation ability of the network. In this way, it can avoid cutting the component graph in the test / reasoning stage.

[0090] Table 1 gives the precision comparison of the double-layer component distillation network of the embodiment of the present application and other advanced algorithms. It can be seen that the double-layer component distillation fine-grained image recognition network proposed by the present application has higher precision compared with other advanced algorithms.

[0091] Table 1

[0092] Method Backbone CUB-200-2011 FGVC-Aircraft Stanford-Car DFL ResNet50 87.4 91.7 93.1 NTS-Net ResNet50 87.5 91.4 93.9 MAMC ResNet50 86.2 - 93.0 DBTNet ResNet50 87.5 91.2 94.1 Cross-X ResNet50 87.7 92.6 94.6 DCL ResNet50 87.8 93.0 94.5 TASN ResNet50 87.9 - 93.8 CIN ResNet50 87.5 92.6 94.1 API-Net ResNet50 87.7 93.0 94.9 PMA ResNet50 87.5 90.8 93.1 MC-Loss ResNet50 87.3 92.6 93.7 ACNet ResNet50 88.1 92.4 94.6 Double-layer component distillation network ResNet50 88.13 93.61 95.14

[0093] In the present application, a double-layer component distillation network structure is used to transfer the component-level features in the 'location-classification' paradigm of fine-grained image classification to the middle-layer features of the target-level subnetwork through knowledge distillation, so that the middle-layer features of the target-level subnetwork can effectively extract the features of semantic components from the original image. In this way, the middle-layer features of the target-level subnetwork are directly used in the test stage to replace the component features obtained by the entire component-level subnetwork, so that the computational complexity in the test stage is greatly reduced. On the other hand, in the training stage, in addition to distilling the middle-layer features of the target-level subnetwork, the present application additionally encodes the semantic context information between each semantic component feature, and uses knowledge distillation to transfer the context information to the high-layer features of the target-level subnetwork, helping the high-layer convolutional layers of the target-level subnetwork to learn the semantic context information of each semantic component from the middle-layer features with rich local information. Finally, the high-layer features and the middle-layer features of the target-level subnetwork are spliced, and the spliced feature vector is input into the classifier to obtain the classification result.

[0094] The preferred embodiments of the present application are described in detail above. It should be understood that those of ordinary skill in the art can make many modifications and changes without creative work based on the concept of the present application. Therefore, any technical solutions obtained by logical analysis, reasoning or limited experiments based on the prior art within the concept of the present application should be within the protection scope determined by the claims.

Claims

1. A fine-grained image classification method for two-layer component distillation, characterized in that, Includes the following steps: (1) Obtain the initial image dataset and preprocess the initial image dataset; (2) Construct a fine-grained image recognition network for two-layer component distillation, wherein the fine-grained image recognition network for two-layer component distillation includes a target-level global prediction sub-network, a component detection module, a component-level prediction sub-network, and a supervision and knowledge distillation module; The target-level global prediction subnetwork includes a ResNet50 convolutional neural network, a spatial attention module, a channel attention module, two global average pooling layers, three Softmax activation layers, and three fully connected layers. The ResNet50 convolutional neural network is used as a feature extractor, where Conv1x, Conv2x, Conv3x and Conv4x are intermediate convolutions, and the output of Conv4x is the intermediate convolution feature map; Conv5x is a high-level convolution, and the output of Conv5x is the high-level convolution feature map. The high-level convolutional feature map is passed through the channel attention module and the global average pooling layer to obtain a high-level feature vector. The high-level feature vector is then input into the fully connected layer and the Softmax activation layer to obtain a high-level probability vector. The intermediate convolutional feature map is passed through the spatial attention module and the global average pooling layer to obtain the intermediate feature vector. The intermediate feature vector is then input into the fully connected layer and the Softmax activation layer to obtain the intermediate probability vector. Finally, the middle-layer feature vector and the high-layer feature vector are concatenated to obtain the target-level representation vector. This representation vector is then input into the fully connected layer and the Softmax activation layer to obtain the target probability vector. The component detection module uses a feature pyramid network to predict a fixed number of bounding boxes from the high-level convolutional feature maps in the input target-level global prediction sub-network. Based on these bounding boxes, the input image is cropped, and the cropped image blocks are scaled and then input as target component maps into the component-level prediction sub-network. The component-level prediction subnetwork specifically includes: Multiple cropped and scaled target component images are input into a ResNet50 convolutional neural network to extract features. The high-level convolutional feature maps output by its Conv5x are then subjected to global average pooling to obtain component-level high-level feature vectors, which are then input into a fully connected layer and a Softmax activation layer to obtain the probability vector of each target component image. The component probability vector is obtained by averaging the probability vectors of all target component images. The high-level convolutional feature maps of each target component are concatenated along the channel dimension. The concatenated high-level convolutional feature maps are then input into a 1*1 convolutional layer, a batch normalization layer, and a ReLU activation layer to model the contextual relationship between each component. The resulting feature vector is then input into a fully connected layer and a Softmax activation layer to obtain a global probability vector. The supervision and knowledge distillation module specifically includes: The cosine loss function is used to supervise the mid-level and high-level feature vectors of the target-level global prediction sub-network; The cross-entropy loss function is used to supervise the component probability vector, global probability vector, and target probability vector; The component probability vector and global probability vector of the component-level prediction subnetwork are used to perform knowledge distillation on the middle-level probability vector and high-level probability vector of the target-level global prediction subnetwork, respectively. The knowledge distillation distills the local information and context information of the target component graph into the target-level global prediction subnetwork. The knowledge distillation process is as follows: The global probability vector is calculated according to the following formula. Component probability vector Middle-level probability vector and high-level probability vector softened probability vector , , , : Where: T is the temperature hyperparameter, which determines the degree to which the vector is softened; The global probability vector of the component-level prediction subnetwork performs knowledge distillation on the high-level probability vector of the target-level global prediction subnetwork: The component probability vector of the component-level prediction subnetwork performs knowledge distillation on the mid-level probability vector of the target-level global prediction subnetwork: The total knowledge distillation loss is: (3) The preprocessed initial image dataset is fed into the fine-grained image recognition network of the two-layer component distillation for training, so as to obtain the trained fine-grained image recognition network of the two-layer component distillation. (4) Input the target image to be classified into the target-level global prediction subnetwork of the trained two-layer component distillation fine-grained image recognition network to obtain the classification result of the target image.

2. The fine-grained image classification method for double-layer component distillation according to claim 1, characterized in that, The preprocessing includes: The initial image dataset is augmented by scaling, cropping, and randomly horizontally flipping the images. The augmented initial image dataset is divided into a training set and a test set.

3. The fine-grained image classification method for double-layer component distillation according to claim 1, characterized in that: The spatial attention module consists of a 3x3 convolutional layer, a normalization layer, and a sigmoid activation layer, and its calculation formula is as follows: This is the output of Conv4x of the ResNet50. This is the output of the spatial attention module; , and These represent element-wise multiplication, the Sigmoid activation function, and element-wise addition, respectively.

4. The fine-grained image classification method for double-layer component distillation according to claim 1, characterized in that: The channel attention module consists of two fully connected layers, one ReLU activation layer, and one Sigmoid activation layer. The calculation formula for the channel attention module is as follows: This is the output of Conv5x of the ResNet50. This is the output of the channel attention module; This is the calculation formula for two fully connected layers.

5. The fine-grained image classification method for double-layer component distillation according to claim 1, characterized in that: The feature pyramid network consists of three convolutional layers; The first convolutional layer does not change the resolution of the input feature map, and the output of the first layer is the input of the second layer. The second convolutional layer downsamples the input feature map by a factor of 2, and then inputs the feature map into the third convolutional layer. The third convolutional layer downsamples the input feature map by a factor of 2 again; each activation value of the feature map output by these three convolutional layers represents the information score of the anchor box region at different scales and different aspect ratios; The bounding box was obtained using the Nonmaximum Suppression (NMS) method.

Citation Information

Patent Citations

  • Efficient fine-grained image classification model based on depth model framework

    CN113592023A

  • Fine-grained classification method based on structure modeling local proposal network

    CN115100476A