Fine-grained image classification method, equipment and medium
By segmenting the fine-grained image into random blocks and performing multi-scale feature extraction and fusion, combining the lightweight Resnet-18 network and spatial attention mechanism layer, the problems of insufficient utilization of multi-scale feature and excessive computational complexity in the fine-grained image classification task are solved, and efficient and accurate image classification is achieved.
Patent Information
- Application Number
- CN202411986057.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
The fine-grained image classification task faces problems such as difficult to distinguish between categories, insufficient utilization of multi-scale features, significant noise interference, poor performance of feature fusion and enhancement methods, excessive computational complexity, and insufficient label dependence and scalability.
The feature extraction and image segmentation module are used to segment the fine-grained images into multiple random blocks and reorganize them to perform multi-scale feature extraction; the multi-level obfuscation module is used to perform feature fusion at different scale levels; dynamic weighted classification is performed through the multi-scale significance classification selection module, combining the lightweight Resnet-18 network and spatial attention mechanism layer to reduce the computational complexity.
Effectively suppress background noise, fully integrate multi-scale feature information, improve the classification accuracy of fine-grained images, improve the efficiency and accuracy of the model, and reduce the computational complexity.
Smart Images

Figure CN119785111A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image classification, and in particular to a fine-grained image classification method, device and medium. Background Art
[0002] Fine-grained image classification is an important computer vision task and an important area in image classification. With the explosive growth of digital content, computers are no longer limited to distinguishing coarse-grained images. The goal is to distinguish between classes with small differences, such as different types of birds, airplanes, or vehicles. However, due to the subtle differences between categories and the interference of background noise, this task faces many technical challenges, including the following:
[0003] 1. Subtle differences between categories are difficult to distinguish
[0004] Fine-grained image classification usually requires only small appearance differences between the categories to be distinguished, such as feather texture, color pattern or beak shape of different birds. These differences are usually local and hidden, making it difficult for traditional feature extraction methods to effectively capture these key information, resulting in a decrease in classification performance.
[0005] 2. Insufficient use of multi-scale features
[0006] Fine-grained image classification requires attention to both global and local features of the image. Global features can describe the overall structure of the object, while local features can capture detailed information. However, existing methods often fail to fully integrate multi-scale feature information, resulting in the model being biased towards features at a certain level, and thus unable to fully and accurately represent the image content.
[0007] 3. Interference of noise characteristics
[0008] Images may contain a lot of irrelevant background information or noise, which is often not helpful for fine-grained classification tasks and may even confuse the model's judgment. In existing methods, there is a lack of effective suppression strategies for noise features, which causes the model's classification results to be disturbed.
[0009] 4. Limitations of feature fusion and enhancement methods
[0010] Existing methods still have limitations in feature fusion and enhancement. Some methods fuse features at different levels by simple splicing or weighting, but this method fails to fully explore the correlation between features. At the same time, the feature enhancement process often relies too much on the global attention mechanism, and the features of key areas are not fine-grainedly optimized, which easily ignores some important local details.
[0011] 5. Balance between computational complexity and model efficiency
[0012] Fine-grained image classification usually involves complex feature extraction and processing. Although deep learning models are powerful, their computational complexity and storage requirements are often high, especially in the process of multi-layer feature fusion. How to improve classification performance while controlling the consumption of computing resources is an urgent problem to be solved.
[0013] 6. Tag dependency and lack of scalability
[0014] Previous fine-grained classification methods usually rely on high-quality training data with manual annotations such as bounding boxes or local annotations, which are expensive. In addition, the model has weak scalability to multiple scenarios and environments, especially in the absence of large-scale labeled data, and existing models are difficult to effectively generalize to new fine-grained classification tasks.
[0015] In summary, fine-grained image classification tasks face problems such as insufficient utilization of multi-scale features, significant noise interference, unsatisfactory results of feature fusion and enhancement methods, and high computational complexity. These problems urgently need an innovative solution to solve them. Summary of the invention
[0016] The purpose of the present invention is to provide a fine-grained image classification method, device and medium for improving the classification accuracy of fine-grained images.
[0017] The purpose of the present invention can be achieved by the following technical solutions:
[0018] A fine-grained image classification method comprises the following steps:
[0019] Get fine-grained images;
[0020] Based on the fine-grained image, a feature extraction and image segmentation module is used to segment the fine-grained image into a plurality of random blocks and reassemble the blocks to obtain a randomly reassembled image, and multi-scale feature extraction is performed based on the fine-grained image and the randomly reassembled image to obtain respective multi-scale features;
[0021] Using a multi-level confusion module, fusing the respective multi-scale features at different scale levels to obtain fused multi-scale features;
[0022] The fused multi-scale features are input into a multi-scale saliency classification selection module for classification processing, and the classification result of the fine-grained image is output.
[0023] Furthermore, the feature extraction and image segmentation module includes a feature extraction unit and an image segmentation unit, the feature extraction unit is used to perform multi-scale feature extraction on the fine-grained image and the randomly recombined image, and the image segmentation unit is used to segment the fine-grained image to obtain a randomly recombined image, wherein the process of obtaining the randomly recombined image by using the image segmentation unit includes:
[0024] Reshaping the size of the fine-grained image to obtain a reshaped fine-grained image;
[0025] The reshaped fine-grained image is divided into a plurality of image blocks, and randomly shuffled to obtain a plurality of random blocks;
[0026] The multiple random blocks are combined to obtain a randomly recombined image.
[0027] Furthermore, the feature extraction unit includes a lightweight pre-trained Resnet-18 network and a spatial attention mechanism layer, and the steps of obtaining respective multi-scale features using the feature extraction unit include:
[0028] Inputting the fine-grained image and the randomly reorganized image into the lightweight pre-trained Resnet-18 network to perform preliminary multi-scale feature extraction to obtain respective preliminary multi-scale features;
[0029] The spatial attention mechanism layer is used to capture the respective preliminary multi-scale features to obtain the final respective multi-scale features.
[0030] Furthermore, the multi-level confusion module includes a Swin-Transformer network and a feature pyramid network, and the step of obtaining the fused multi-scale features includes:
[0031] The Swin-Transformer network is used to forward propagate the respective multi-scale features, and the feature pyramid network is used to fuse the features of different scale levels generated each time during the forward propagation process, and further projection and upsampling are performed to unify them into the same dimension to obtain the fused preliminary multi-scale features.
[0032] Furthermore, the Swin-Transformer network includes a first branch and a second branch, each branch includes a plurality of Swin Block blocks connected in sequence, the Swin Block blocks in the first branch and the second branch are connected correspondingly, and the step of obtaining the fused multi-scale features includes:
[0033] Inputting the multi-scale features of the fine-grained image into the first branch, performing forward propagation on the plurality of sequentially connected SwinBlock blocks, and obtaining features of different scale levels generated by each Swin Block block in the first branch;
[0034] Inputting the multi-scale features of the randomly reorganized image into the second branch, performing forward propagation on the plurality of sequentially connected SwinBlock blocks, and obtaining features of different scale levels generated by each Swin Block block in the second branch;
[0035] Using the feature pyramid network, the features of different scale levels generated by each Swin Block in the first branch and the features of different scale levels generated by each Swin Block in the second branch are fused accordingly, and further projected and upsampled to the same dimension to obtain the fused preliminary multi-scale features.
[0036] Furthermore, a projection unit and an upsampling unit in a feature pyramid network are used to perform the projection and upsampling processing, and the projection unit includes multiple convolutional layers and multiple fully connected layers.
[0037] Furthermore, the multi-scale saliency classification selection module includes a feature response unit, a dynamic mask unit, a linear classifier and a dynamic weight classifier, and the step of outputting the classification result of the fine-grained image includes:
[0038] Based on the feature response unit, the fused multi-scale features are transformed to obtain a multi-scale feature tensor;
[0039] Based on the dynamic mask unit, a mask of the multi-scale feature tensor is created, wherein the mask is set with an initial value, and a channel with the largest response in the multi-scale feature tensor is identified, and the mask value of the feature tensor corresponding to the channel is set to 1 to obtain an updated mask, and then the updated mask is applied to the multi-scale feature tensor in the form of element-wise multiplication to obtain a multi-scale feature tensor containing significance, wherein the mask value represents the channel significance;
[0040] Inputting the multi-scale feature tensor containing significance into a linear classifier for initial classification to obtain classification results corresponding to features of different scales;
[0041] The classification results corresponding to the features of different scales are input into a dynamic weight classifier for dynamic weighted classification to obtain a final classification result as the classification result of the fine-grained image.
[0042] Furthermore, the fine-grained image classification method uses a binary cross entropy function as a loss function, and the expression of the loss function is:
[0043]
[0044] In the formula, L is the total loss, N is the number of samples, and y i Represents the true label of the i-th sample, which takes a value of 0 or 1. The predicted value of the i-th sample indicates the probability of being predicted as a positive class, ranging from 0 to 1, and log represents the natural logarithm.
[0045] The present invention also provides an electronic device, comprising: one or more processors; a memory; and one or more programs stored in the memory, wherein the one or more programs include instructions for executing the fine-grained image classification method as described above.
[0046] The present invention also provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the fine-grained image classification method as described above.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] (1) The present invention utilizes random blocks in fine-grained images to guide multi-scale feature extraction, so as to more effectively suppress background noise, mine features at multiple different levels, promote the balanced utilization of deep and shallow features, and fuse features at different scales through a multi-level confusion module to fully utilize semantic information at different levels, thereby improving the classification accuracy of fine-grained images.
[0049] (2) The present invention utilizes a dynamic mask unit to dynamically update the mask value, and combines it with a dynamic weight classifier to perform the final dynamic weighted classification, which helps to improve the performance of the classifier and ensures high efficiency and accuracy in fine-grained image classification tasks.
[0050] (3) Reduce computational complexity: 1) Use a lightweight Resnet18 network architecture, 2) By reducing the resolution of the input image, the computational overhead of the convolution operation can be reduced while retaining sufficient image information, 3) 3. Use pre-trained network model weights (such as Resnet18) to reduce the computational burden of training from scratch through transfer learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0052] Figure 2 It is the overall framework structure diagram of the present invention. DETAILED DESCRIPTION
[0053] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0054] Example 1
[0055] This embodiment provides a fine-grained image classification method, such as Figure 2 As shown in the figure, an innovative network architecture is proposed, which uses random image blocks to guide the focus on the target area, fully mines multi-level feature information and performs fusion and enhancement. This method aims to improve the classification accuracy through three core innovations: background noise suppression and multi-layer feature information mining guided by CNN and random blocks, dynamic balance and effective fusion of multi-level feature information, and weighted classification of features at different levels. First, the random image block reconstruction technology is used to guide feature information of different granularities, balance the shallow mining of deep features and the deep mining of shallow features, and use convolutional neural networks and attention models to suppress background noise. Secondly, through the hierarchical structure of the codec, features from different levels are fused to fully mine the rich semantic information in the image. Finally, a dynamic weight classifier and feature mask mechanism are introduced to enhance the contribution of features at different levels in classification, effectively improving the classification effect of the model. As shown in Figure 1 As shown, the method comprises the following steps:
[0056] Step 1: Feature extraction and image segmentation.
[0057] This step uses the feature extraction and image segmentation module to perform feature extraction and image segmentation. The module includes a feature extraction unit and an image segmentation unit. The image segmentation unit is used to segment the fine-grained image into multiple random blocks and reassemble them to obtain a randomly reassembled image; the feature extraction unit includes a lightweight Resnet-18 network and a spatial attention mechanism layer. The unit performs multi-scale feature extraction on the randomly reassembled image and the original fine-grained image to obtain their respective multi-scale features. The Resnet-18 network is used as the CNN network architecture. The specific execution process of this model includes:
[0058] First, the size of the original fine-grained image of 512×512 is reshaped to 384×384 to obtain a higher-precision image. The present invention divides the input image into several small blocks by randomly shuffling the image blocks, and then randomly shuffles the small blocks and reassembles them into a new image as the reshaped fine-grained image.
[0059] Randomly shuffling image blocks is an effective technique for mining discriminative features. It can help the model focus more on local and global features instead of relying on a specific spatial arrangement, thus improving the generalization ability of the model. At the same time, the random rearrangement of image blocks enhances the model's ability to cope with different posture changes of the target, so that it performs better when there is slight occlusion or local spatial arrangement changes when processing images. At the same time, deep image feature information is mined through block segmentation and splicing operations, which is suitable for the integration of deep learning training and avoids complex preprocessing operations. In addition, the size of the image block and the number of image blocks per row / column in this method can be adjusted, which can adapt to input images of different resolutions and support a wider range of task requirements.
[0060] Secondly, a lightweight pre-trained Resnet-18 network is used to perform preliminary multi-scale feature extraction on the reshaped fine-grained image and the original fine-grained image, respectively. In order to reduce the influence of the background on the discriminative targets, the spatial attention mechanism layer is used to capture the multi-scale features to extract more discriminative attention areas, and the final multi-scale features are obtained, which are 1×1 image feature maps and 2×2 image feature maps, respectively.
[0061] Step 2: Multi-scale feature confusion.
[0062] This step uses a multi-level confusion module to fuse the features of different scale levels of the respective multi-scale features obtained in step 1. The module includes a Swin-Transformer network and a feature pyramid network. The feature pyramid network includes a projection unit and an upsampling unit. The projection unit includes two 1x1 convolutional layers and two fully connected layers. The Swin-Transformer network includes a first branch and a second branch. Each branch includes a plurality of Swin Block blocks connected in sequence, namely SwinBlock1, Swin Block2, Swin Block3, and Swin Block4. The Swin Block blocks in the first branch and the second branch are connected correspondingly. The feature information of the two levels of the 1×1 image feature map and the 2×2 image feature map in step 1 is passed into Swin-Transformers of different levels for forward propagation and longitudinal feature fusion. The deeper the forward propagation level, the richer the image feature information mined, and the higher the level of semantic information that can be provided. In this step, the overall design concept of the present invention is to regard each image of different scales on the feature map as an independent feature. These features are classified separately, and features of different levels are used as the basis for classification of the present invention.
[0063] Specifically, the execution steps of this module include:
[0064] The multi-scale features of the fine-grained image are input into the first branch, and forward propagated sequentially on Swin Block1, Swin Block2, Swin Block3, and Swin Block4. Each Swin Block generates features of different scale levels.
[0065] The multi-scale features of the randomly reorganized image are input into the second branch, and forward propagation is performed sequentially on Swin Block 1, Swin Block 2, Swin Block 3, and Swin Block 4. Each Swin Block also generates features of different scale levels.
[0066] Using the feature pyramid network, the features of different scale levels generated by each Swin Block in the first branch and the features of different scale levels generated by each Swin Block in the second branch are fused to obtain the fused multi-scale features.
[0067] The purpose of Feature Pyramid Network (FPN) is to enhance the expressiveness of feature maps by fusing high-resolution low-level features with low-resolution high-level features at multiple scales to generate a unified feature representation.
[0068] The feature pyramid network (FPN) also projects the fused preliminary multi-scale features to a unified dimension through two 1x1 convolutional layers, and projects the features of the two fully connected layers to a unified dimension for the output of the Swin-Transformer. The present invention uses the upsampling module of the bilinear interpolation method to match the high-level features to the low-level feature resolution from top to bottom (from high to low layers), and achieves the fusion effect of the 1×1 image feature map and the 2×2 image feature map.
[0069] The multi-scale features of the model are effectively utilized here, so that high-level semantic information and low-level spatial information are fully combined in fine-grained classification tasks, significantly improving the classification accuracy.
[0070] Step 3: Multi-scale saliency classification selection.
[0071] In the step, a multi-scale saliency classification selection module is used for classification processing, and the module includes a feature response unit, a dynamic mask unit, a first layer classifier and a second layer dynamic weight classifier. The execution steps of the module include:
[0072] After multi-scale feature fusion, feature outputs of different levels and semantic information of four levels generated by two levels are obtained. The feature information of these four levels is classified and processed to improve the contribution of feature information of different levels in the final classification. Here, the present invention uses a feature response unit to convert the feature information of four levels into four multi-scale feature tensors S, which are represented as S1, S2, S3, and S4 respectively. In order to improve the result significance of each level of information, the present invention introduces a dynamic mask unit, and S1, S2, S3, and S4 are respectively passed into the dynamic mask unit. The working principle of the dynamic mask unit is as follows: create a mask x_mask of the same shape as S1, S2, S3, and S4, and assign initial values of 0.4, 0.5, 0.6, and 0.7. Traverse each sample, find the channel with the largest response in each sample, and update the value of the corresponding position in the mask to 1, indicating that the importance of this channel is higher. Then, the mask x_mask is applied to different feature tensors S by element-wise multiplication. The high response channel keeps the original value, and the other channels are reduced to the original 0.4, 0.5, 0.6, and 0.7. Then, four linear classifiers (classifier 1, classifier 2, classifier 3, and classifier 4) are applied to classify the processed features. The classification results of the four-layer features are input into the dynamic weight classifier (aggregate four-element classifier) for weighted fusion (simple addition) to generate the final classification output classification result (cls).
[0073] In this step, the linear classifier uses the Softmax function as the activation function and Accurary as the evaluation index of the classification. The formula is:
[0074]
[0075] Among them I correct represents the total number of images of all subcategories in the test set, I total It indicates the number of samples successfully classified by the model, and Accuracy indicates the accuracy of fine-grained image classification.
[0076] The above dynamic weight classifier, as the depth of the model gradually deepens, the feature semantic information obtained is more discriminative and representative, so the hierarchical information of the S4 level is more discriminative and representative. At the same time, the present invention uses the binary cross entropy function as the loss function of the classification method, and its formula is:
[0077]
[0078] Among them, L represents the total loss value; N represents the number of samples; y i Represents the true label of the i-th sample, which takes a value of 0 or 1; The predicted value of the i-th sample indicates the probability that the model predicts it to be a positive class, and its value range is between 0 and 1; log represents the natural logarithm.
[0079] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0080] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0081] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0082] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0084] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0085] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A fine-grained image classification method, characterized in that: The following steps are involved: Get fine-grained images; Based on the fine-grained image, a feature extraction and image segmentation module is used to segment the fine-grained image into a plurality of random blocks and reassemble the blocks to obtain a randomly reassembled image, and multi-scale feature extraction is performed based on the fine-grained image and the randomly reassembled image to obtain respective multi-scale features; Using a multi-level confusion module, fusing the respective multi-scale features at different scale levels to obtain fused multi-scale features; The fused multi-scale features are input into a multi-scale saliency classification selection module for classification processing, and the classification result of the fine-grained image is output.
2. A fine-grained image classification method according to claim 1, characterized in that: The feature extraction and image segmentation module includes a feature extraction unit and an image segmentation unit. The feature extraction unit is used to perform multi-scale feature extraction on the fine-grained image and the randomly reorganized image. The image segmentation unit is used to segment the fine-grained image to obtain a randomly reorganized image. The process of obtaining the randomly reorganized image by using the image segmentation unit includes: Reshaping the size of the fine-grained image to obtain a reshaped fine-grained image; The reshaped fine-grained image is divided into a plurality of image blocks, and randomly shuffled to obtain a plurality of random blocks; The multiple random blocks are combined to obtain a randomly recombined image.
3. A fine-grained image classification method according to claim 2, characterized in that: The feature extraction unit includes a lightweight pre-trained Resnet-18 network and a spatial attention mechanism layer, and the steps of using the feature extraction unit to obtain respective multi-scale features include: Inputting the fine-grained image and the randomly reorganized image into the lightweight pre-trained Resnet-18 network to perform preliminary multi-scale feature extraction to obtain respective preliminary multi-scale features; The spatial attention mechanism layer is used to capture the respective preliminary multi-scale features to obtain the final respective multi-scale features.
4. The fine-grained image classification method according to claim 1, characterized in that: The multi-level confusion module includes a Swin-Transformer network and a feature pyramid network, and the step of obtaining the fused multi-scale features includes: The Swin-Transformer network is used to forward propagate the respective multi-scale features, and the feature pyramid network is used to fuse the features of different scale levels generated each time during the forward propagation process, and further projection and upsampling are performed to unify them into the same dimension to obtain the fused multi-scale features.
5. A fine-grained image classification method according to claim 4, characterized in that: The Swin-Transformer network includes a first branch and a second branch, each branch includes a plurality of Swin Block blocks connected in sequence, and the Swin Block blocks in the first branch and the second branch are connected correspondingly. The step of obtaining the fused multi-scale features includes: Inputting the multi-scale features of the fine-grained image into the first branch, performing forward propagation on the plurality of sequentially connected Swin Blocks, and obtaining features of different scale levels generated by each Swin Block in the first branch; Inputting the multi-scale features of the randomly reorganized image into the second branch, performing forward propagation on the plurality of sequentially connected SwinBlock blocks, and obtaining features of different scale levels generated by each Swin Block block in the second branch; Using the feature pyramid network, the features of different scale levels generated by each Swin Block in the first branch and the features of different scale levels generated by each Swin Block in the second branch are fused accordingly, and further projected and upsampled to the same dimension to obtain the fused multi-scale features.
6. A fine-grained image classification method according to claim 4, characterized in that: The projection and upsampling processing is performed by using a projection unit and an upsampling unit in a feature pyramid network, wherein the projection unit includes a plurality of convolutional layers and a plurality of fully connected layers.
7. The fine-grained image classification method according to claim 1, characterized in that: The multi-scale saliency classification selection module includes a feature response unit, a dynamic mask unit, a linear classifier and a dynamic weight classifier. The step of outputting the classification result of the fine-grained image includes: Based on the feature response unit, transform the fused multi-scale features to obtain a multi-scale feature tensor; Based on the dynamic mask unit, a mask of the multi-scale feature tensor is created, wherein the mask is set with an initial value, and a channel with the largest response in the multi-scale feature tensor is identified, and the mask value of the feature tensor corresponding to the channel is set to 1 to obtain an updated mask, and then the updated mask is applied to the multi-scale feature tensor in the form of element-wise multiplication to obtain a multi-scale feature tensor containing significance, wherein the mask value represents the channel significance; Inputting the multi-scale feature tensor containing significance into a linear classifier for initial classification to obtain classification results corresponding to features of different scales; The classification results corresponding to the features of different scales are input into a dynamic weight classifier for dynamic weighted classification to obtain a final classification result as the classification result of the fine-grained image.
8. The fine-grained image classification method according to claim 1, characterized in that: The fine-grained image classification method adopts a binary cross entropy function as a loss function, and the expression of the loss function is: In the formula, L is the total loss, N is the number of samples, and y i Represents the true label of the i-th sample, which takes a value of 0 or 1. The predicted value of the i-th sample indicates the probability of being predicted as a positive class, ranging from 0 to 1, and log represents the natural logarithm.
9. An electronic device, characterized in that: include: one or more processors; Memory; and One or more programs stored in a memory, wherein the one or more programs include instructions for executing the fine-grained image classification method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: It comprises one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs comprise instructions for executing the fine-grained image classification method as claimed in any one of claims 1 to 8.
Citation Information
Cited By
Brain tumor classification method based on deep learning
CN120107703A
Micro-expression recognition method, system and equipment based on multi-scale mixed channel and medium
CN120388409A
A micro-expression recognition method, system, device and medium based on a multi-scale mixed channel
CN120388409B
Image processing method and device, electronic equipment and storage medium
CN120496075A