Lightweight bumblebee image classification method based on improved GhostNet V2

By improving the GhostNet V2 model, using multi-scale convolution and feature fusion technology, the problems of large amount of calculation and low accuracy in bumblebee image classification are solved, and lightweight and high-accuracy bumblebee image classification is achieved, which is suitable for automated bumblebee sorting.

CN118941867APending Publication Date: 2024-11-12EASTERN LIAONING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411011115.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing deep learning models have problems in bumblebee image classification with large amounts of calculation, large amount of parameters and insufficient classification accuracy, which is difficult to meet the needs of bumblebee automated sorting.

Method used

Improve the GhostNet V2 model, through multi-scale convolution and low, medium and high-level feature fusion, combined with data enhancement technology, a lightweight bumblebee image classification network is designed to reduce the number of model parameters and calculations, and at the same time improve the classification accuracy.

Benefits of technology

It achieves higher accuracy of Bumblebee image classification and model lightweight, suitable for embedded device deployment, improving the generalization ability and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941867A_ABST
    Figure CN118941867A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight bumblebee image classification method based on improved GhostNet V2, and the method comprises the following steps: a training stage: 1, designing and building a bumblebee image collection system, and collecting a bumblebee image data set; 2, preprocessing the bumblebee image data set; 3, constructing an image classification network model; 4, dividing the bumblebee image data set into a training set, a verification set and a test set according to a certain proportion, training the constructed image classification network model through the training set, verifying the classification accuracy of the model by using the verification set, and storing the trained image classification network model; and a test stage: step 5, inputting test set images into the trained GMCFF model for bumblebee image classification, and outputting a classification accuracy result. According to the lightweight bumblebee image classification model GMCFF constructed by the invention, the feature expression ability of the model is remarkably enhanced, the parameter quantity is effectively reduced, the reasoning speed is improved, and accurate and efficient classification of bumblebee images is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of agricultural automatic classification, and in particular relates to a lightweight bumblebee image classification method based on an improved GhostNet V2. Background Art

[0002] Bumblebees pollinate greenhouse fruits and vegetables, which can not only significantly increase the fruit setting rate and increase production, but also is safer and greener than chemical pollination, so it has received widespread attention. An important part of artificially breeding bumblebees is sorting bumblebees from the bee colony. The current bumblebee breeding process mainly relies on manual sorting of queen bees, drones and worker bees, and there are many problems with manual sorting: sorting personnel are easily stung by bumblebees, improper control of force when picking up bumblebees during the sorting process can easily lead to the death of bumblebees, and the sorting process is time-consuming and laborious, etc. Therefore, realizing the automated sorting of bumblebees is an important part of the intelligent process of bumblebee breeding.

[0003] With the practice and development of computer vision and deep learning in various fields, the application of deep learning to the classification of bees or other insects has been quite extensive and in-depth. In the paper "Image recognition using convolutional neural networks for classification of honey bee subspecies" published by Dario et al. in 2022, they studied whether images of bee wings can be used to distinguish bee subspecies. The study showed that the deep learning model Inception Resnet V2 is very effective for the classification of bee wings, and the classification accuracy is higher than that of the early support vector machine and neural network methods. Although the deep learning model has high accuracy, the network structure is relatively complex. What method to use to make the model lighter and more efficient has become the focus of more and more researchers. In the paper "Lightweight crop pest identification based on high-order residual and attention mechanism" published by Ruan Juquan et al. in 2023, a lightweight crop pest identification model was proposed by integrating high-order residual method and attention mechanism. On the basis of ensuring the recognition accuracy, the number of model parameters and floating-point calculations were greatly reduced.

[0004] However, the above applications are mostly carried out between different types of insects. For bumblebees of the same type, the differences between classes are very small, and the above solutions are not completely applicable. Therefore, it is necessary to explore a lightweight image classification model with higher classification accuracy and less model calculation and parameters to solve the bumblebee image classification problem. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a lightweight bumblebee image classification method based on improved GhostNet V2 in view of the defects of manual sorting of bumblebees.

[0006] The present invention provides a lightweight bumblebee image classification method based on an improved GhostNet V2, the method comprising the following steps:

[0007] Training phase:

[0008] Step 1: Design and build a bumblebee image acquisition system to collect bumblebee image datasets;

[0009] Step 2: Preprocess the bumblebee image dataset, including image compression and data enhancement such as rotation, flipping, translation, brightness processing, contrast processing, and noise processing;

[0010] Step 3: Build an image classification network model, namely the improved GhostNet V2 model: perform convolution operations of different scales of 3×3, 5×5 and 7×7 on the input image, and output the low-level feature map F; the main branch passes through 6 layers of GhostNetV2 bottleneck layers to obtain the middle-level feature map, and the low-level feature map F is fused with the middle-level feature map through the shortcut branch B1; the main branch continues to pass through 4 layers of GhostNetV2 bottleneck layers to obtain the high-level feature map, and the low-level feature map F is fused with the high-level feature map through the shortcut branch B2; after convolution, average pooling, and convolution, the flattened image features are finally predicted and output through the fully connected layer;

[0011] Step 4: Divide the bumblebee image dataset into a training set, a validation set, and a test set according to a certain ratio. Use the training set to train the constructed image classification network model, and use the validation set to verify the classification accuracy of the model. Save the trained image classification network model.

[0012] Testing phase:

[0013] Step 5: Input the test set images into the trained GMCFF model for bumblebee image classification and output the classification accuracy results.

[0014] Furthermore, in step 1 of the present invention, bumblebees are selected as image acquisition objects, and a bumblebee image acquisition system is designed and built according to the actual breeding environment of bumblebees. The collected bumblebee images are divided into three categories: queen bees, drones and worker bees.

[0015] Furthermore, the method for preprocessing the bumblebee dataset in step 2 of the present invention is specifically as follows:

[0016] Image compression, the image compression method is to compress the image size from 400KB to 10KB;

[0017] Rotation, the rotation angles are 45°, 90°, and 180° respectively;

[0018] Flip: vertical flip or horizontal flip;

[0019] Translation: the translation modes are up, down, left and right;

[0020] Brightness processing: Brightness processing is to randomly adjust the brightness of the image;

[0021] Contrast processing, the contrast processing method is to randomly adjust the image contrast;

[0022] Noise processing: the noise processing method is to add salt and pepper noise and Gaussian noise;

[0023] Through the above data enhancement technology, various types of data are uniformly distributed, and the total number of images reaches 13,117, which improves the generalization ability and robustness of the model.

[0024] Furthermore, the improved GhostNet V2 model constructed in step 3 of the present invention is specifically:

[0025] First, perform convolution operations of different scales of 3×3, 5×5 and 7×7 on the input image, and output the low-level feature map F to obtain the receptive field information at different scales; the feature map size calculation formula is:

[0026] W1=(W-F+2P) / S+1

[0027] H1=(H-F+2P) / S+1

[0028] D1=D

[0029] Where W is the length of the input image, W1 is the length of the feature map, H is the width of the input image, H1 is the width of the feature map, D is the number of convolution kernels, D1 is the number of channels of the feature map, F is the size of the convolution kernel, S is the sliding step size, and P represents the number of zero paddings;

[0030] Then the main branch passes through 6 layers of GhostNetV2 bottleneck layer to obtain the middle-level feature map, and the low-level feature map F is fused with the middle-level feature map through the shortcut branch B1;

[0031] Then the main branch continues to pass through 4 layers of GhostNetV2 bottleneck layers to obtain a high-level feature map, and the low-level feature map F is fused with the high-level feature map through the shortcut branch B2;

[0032] After 1×1 convolution, 7×7 average pooling, and 1×1 convolution, the output feature map is input into the last fully connected layer. The flattened image features are predicted and output through the fully connected layer. The output result of the fully connected layer is the final output of the GMCFF model.

[0033] Furthermore, in the step 3 of the present invention, the specific method of fusing the low-level feature map with the mid- and high-level feature map through the shortcut branch is:

[0034] 1) Make sure the low-level feature maps and the mid-level or high-level feature maps have the same size. If their sizes do not match, they can be resized to the same size through convolution or pooling operations.

[0035] 2) Add the adjusted low-level feature map and the middle or high-level feature map element by element to generate a new feature map.

[0036] Assuming that the low-level feature map is A, and the middle or high-level feature map is B, and they have the same size, the element-by-element addition operation can be expressed as: C=A+B, where C is the fused feature map.

[0037] Furthermore, the GhostNetV2 bottleneck layer in step 3 of the present invention is specifically:

[0038] The GhostNetV2 bottleneck layer is mainly composed of the Ghost module, the DFC attention module and the DW convolution.

[0039] When the step size is 1, the input features are passed through one Ghost module and one DFC attention module to output two feature maps. After the two feature maps are multiplied, they are passed through one Ghost module to obtain the output features, and the output features are added to the input features.

[0040] When the step size is 2, the input features pass through 1 Ghost module and 1 DFC attention module to output two feature maps. After the two feature maps are multiplied, they first pass through a DW convolution with a step size of 2, and then pass through a Ghost module to obtain the output features, and the output features are added to the input features.

[0041] Furthermore, the Ghost module of the GhostNetV2 bottleneck layer in step 3 of the present invention is specifically:

[0042] The Ghost module obtains target features in two parts: the first part uses a convolution kernel of a given size to perform a convolution operation on the input image to obtain the feature map of each channel of the object; the second part of the operation is generated using a simple linear transformation. Specifically, the deep convolution is used to convolve each single channel separately to obtain the deep feature map; finally, the output feature map of the Ghost module is obtained by splicing the two parts.

[0043] Furthermore, the DFC attention module of the GhostNetV2 bottleneck layer in step 3 of the present invention is specifically:

[0044] First, the input features are downsampled to reduce the amount of feature calculations; second, for each pixel in the feature map, only the feature information in the vertical and horizontal directions is calculated to reduce a large amount of redundant information in the feature map, which can be expressed as:

[0045]

[0046] Among them, F H and F W is the weight and the input is the original feature Z.

[0047] Furthermore, the DW convolution of the GhostNetV2 bottleneck layer in step 3 of the present invention is specifically:

[0048] DW convolution is divided into two steps: depthwise convolution and pointwise convolution. Assume that the size of the input feature map is H×W×C, where H and W represent the height and width of the feature map respectively, and C represents the number of channels.

[0049] 1) Deep convolution uses a convolution kernel of size K×K×1 to perform convolution operations on each channel independently. For each position of the input feature map, the convolution kernel is convolved with the corresponding position to obtain a deep convolution output feature map with a size of H×W×K;

[0050] 2) Point-by-point convolution uses a convolution kernel of size 1×1×K to perform a convolution operation on the deep convolution output feature map, linearly combines each channel of the deep convolution output feature map, and obtains the final output feature map with a size of H×W×K.

[0051] Furthermore, the method for training in step 4 of the present invention is specifically as follows:

[0052] The bumblebee image dataset is randomly divided into training set, validation set and test set according to the ratio of 7:2:1. During the training process, the input size of each image is unified to 224×224. The SGD optimizer is used, the momentum is set to 0.9, the learning rate is initialized to 0.01, the weight_decay is set to 5×10-4, the batch size is set to 32, the number of iterations is set to 100, and the dropout is set to 0.2.

[0053] The SGD optimizer uses the gradient of a small batch of samples to update parameters. For each parameter θ, assuming its current value is θ_current, the updated parameter value is θ_new, the gradient is g, and the learning rate is α. The formula for parameter update using the SGD optimizer is:

[0054] θ_new=θ_current-α*g

[0055] The beneficial effects of the present invention are as follows: the lightweight bumblebee image classification method based on the improved GhostNet V2 of the present invention selects the GhostNet V2 network as the basic network model, and on this basis, adds multi-scale convolution and low, medium and high multi-layer feature fusion to alleviate the problem of feature loss during network transmission, improve the classification accuracy of the model, and simplify the network structure, and significantly reduce the number of model parameters and floating-point operations. Its advantages are: (1) the extracted image feature information is richer and the model classification accuracy is higher; (2) the model is more lightweight and easy to deploy on edge devices such as embedded systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a model diagram of the bumblebee image acquisition system;

[0057] Figure 2 This is a physical picture of the bumblebee image acquisition system;

[0058] Figure 3 For bumblebee images;

[0059] Figure 4 This is an example diagram of data enhancement;

[0060] Figure 5 This is the structure diagram of the improved GhostNet V2 model (GMCFF model);

[0061] Figure 6 This is the bottleneck layer structure diagram of GhostNetV2. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0063] The embodiment of the present invention is based on an improved lightweight bumblebee image classification method of GhostNet V2, comprising the following steps:

[0064] (1) Collecting bumblebee image dataset

[0065] Since there is no available public dataset related to bumblebees, in order to collect bumblebee images more conveniently, a bumblebee image collection system based on the actual breeding environment of bumblebees was designed. Figure 1 As shown. Among them, beehives A and B are the actual breeding environment of the bee colony. Sugar water is placed in beehive B to attract the bumblebees in beehive A to crawl to beehive B. During this process, the infrared tube senses the passing of the bumblebees, thereby controlling the camera to take pictures and transmit the images to the PC device.

[0066] The bumblebee image acquisition system built is as follows Figure 2 The bumblebee images collected are images of artificially raised pollinating ground bumblebees. The difference between the drones and worker bees of ground bumblebees is small, with only slight differences in the tails, which is difficult for non-professionals to distinguish. Therefore, choosing ground bumblebee images for research has high practical value. In the end, a total of 1,742 images of queen bees, drones, and worker bees were collected. The collected bumblebee images and their categories are shown below. Figure 3 shown.

[0067] Bumblebee categories mainly include queen bees, drones and worker bees, and the detailed numbers are shown in Table 1.

[0068] Table 1 Detailed number of bumblebee species

[0069]

[0070] (2) Image dataset preprocessing

[0071] In order to reduce resource consumption and training time in the model training process, the images were compressed multiple times while ensuring image features. After compression, the size of each image was reduced from 400KB, containing 5472×3468 pixels, to 10KB, containing 684×456 pixels.

[0072] From Table 1, we can find that the number of queen bee images is less than that of drones and worker bees, and the number of collected images is generally small. In order to prevent overfitting in the training process and simulate the actual image collection environment, the following methods are used to enhance the data of the existing images: rotate the image by 45°, 90°, 180°, etc.; translate the image up, down, left, and right by 20 pixels; randomly adjust the brightness and contrast of the image; add salt and pepper noise and Gaussian noise to the image. The number of images after data enhancement increased from 1742 to 13117, including 4302 queen bee images, 4472 drone images, and 4343 worker bee images. The number of images of the three categories is balanced. Examples of image data enhancement are as follows: Figure 4 As shown, it includes the original image and 17 enhanced images.

[0073] (3) Image classification model construction

[0074] First, perform convolution operations of different scales of 3×3, 5×5 and 7×7 on the input image, and output the low-level feature map F to obtain the receptive field information at different scales; the feature map size calculation formula is:

[0075] W1=(W-F+2P) / S+1

[0076] H1=(H-F+2P) / S+1

[0077] D1=D

[0078] Among them, W is the length of the input image, W1 is the length of the feature map, H is the width of the input image, H1 is the width of the feature map, D is the number of convolution kernels, D1 is the number of channels of the feature map, F is the size of the convolution kernel, S is the sliding step size, and P represents the number of zero padding.

[0079] Then the main branch passes through 6 layers of GhostNetV2 bottleneck layer to obtain the middle-level feature map, and the low-level feature map F is fused with the middle-level feature map through the shortcut branch B1;

[0080] Then the main branch continues to pass through 4 layers of GhostNetV2 bottleneck layers to obtain a high-level feature map, and the low-level feature map F is fused with the high-level feature map through the shortcut branch B2;

[0081] After 1×1 convolution, 7×7 average pooling, and 1×1 convolution, the output feature map is input into the last fully connected layer. The flattened image features are predicted and output through the fully connected layer. The output result of the fully connected layer is the final output of the GMCFF model. The structure diagram of the improved GhostNet V2 model (GMCFF model) is shown in the figure. Figure 5 shown.

[0082] The specific method of fusing low-level feature maps with mid- and high-level feature maps through shortcut branches is as follows:

[0083] 1) Make sure the low-level feature maps and the mid-level or high-level feature maps have the same size. If their sizes do not match, they can be resized to the same size through convolution or pooling operations.

[0084] 2) Add the adjusted low-level feature map and the middle or high-level feature map element by element to generate a new feature map.

[0085] Assuming that the low-level feature map is A, and the middle or high-level feature map is B, and they have the same size, the element-by-element addition operation can be expressed as: C=A+B, where C is the fused feature map.

[0086] The GhostNetV2 bottleneck layer is as follows:

[0087] The GhostNetV2 bottleneck layer is mainly composed of the Ghost module, the DFC attention module and the DW convolution. The GhostNetV2 bottleneck layer structure is shown in the figure Figure 6 shown.

[0088] When the step size is 1, the input features are passed through one Ghost module and one DFC attention module to output two feature maps. After the two feature maps are multiplied, they are passed through one Ghost module to obtain the output features, and the output features are added to the input features.

[0089] When the step size is 2, the input features pass through 1 Ghost module and 1 DFC attention module to output two feature maps. After the two feature maps are multiplied, they first pass through a DW convolution with a step size of 2, and then pass through a Ghost module to obtain the output features, and the output features are added to the input features.

[0090] The Ghost module of the GhostNetV2 bottleneck layer is specifically:

[0091] The Ghost module obtains target features in two parts: the first part uses a convolution kernel of a given size to perform a convolution operation on the input image to obtain the feature map of each channel of the object; the second part of the operation is generated using a simple linear transformation. Specifically, the deep convolution is used to convolve each single channel separately to obtain the deep feature map; finally, the output feature map of the Ghost module is obtained by splicing the two parts.

[0092] The DFC attention module of the GhostNetV2 bottleneck layer is as follows:

[0093] First, the input features are downsampled to reduce the amount of feature calculations; second, for each pixel in the feature map, only the feature information in the vertical and horizontal directions is calculated to reduce a large amount of redundant information in the feature map, which can be expressed as:

[0094]

[0095] Among them, F H and F W is the weight and the input is the original feature Z.

[0096] The DW convolution of the GhostNetV2 bottleneck layer is as follows:

[0097] DW convolution is divided into two steps: depthwise convolution and pointwise convolution. Assume that the size of the input feature map is H×W×C, where H and W represent the height and width of the feature map respectively, and C represents the number of channels.

[0098] 1) Deep convolution uses a convolution kernel of size K×K×1 to perform convolution operations on each channel independently. For each position of the input feature map, the convolution kernel is convolved with the corresponding position to obtain a deep convolution output feature map with a size of H×W×K;

[0099] 2) Point-by-point convolution uses a convolution kernel of size 1×1×K to perform a convolution operation on the deep convolution output feature map, linearly combines each channel of the deep convolution output feature map, and obtains the final output feature map with a size of H×W×K.

[0100] (4) Network model learning and training

[0101] The bumblebee image dataset is randomly divided into training set, validation set and test set according to the ratio of 7:2:1. During the training process, the input size of each image is unified to 224×224. The SGD optimizer is used, the momentum is set to 0.9, the learning rate is initialized to 0.01, and the weight_decay is set to 5×10 -4 , the batch size is set to 32, the number of iterations is set to 100, and the dropout is set to 0.2;

[0102] The SGD optimizer uses the gradient of a small batch of samples to update parameters. For each parameter θ, assuming its current value is θ_current, the updated parameter value is θ_new, the gradient is g, and the learning rate is α. The formula for parameter update using the SGD optimizer is:

[0103] θ_new=θ_current-α*g

[0104] (5) Input the test set images into the trained GMCFF model for bumblebee image classification and output the classification accuracy results.

[0105] In order to fully evaluate the advantages of the GMCFF model proposed in this study for bumblebee image classification performance, other excellent deep network models, especially lightweight models, were selected for performance comparison, including DenseNet121, RegNet, ShuffleNetV2, MobileNetV3_small, EfficientNetB0, etc. In order to fairly evaluate the performance of each model, except for the inconsistent model network structure, other basic settings remained the same during the experiment.

[0106] Table 2 lists the classification accuracy of all the compared network models and the GMCFF network model proposed in this paper on the bumblebee image dataset. As shown in Table 2, compared with other classic models, the GMCFF model proposed in this paper achieved the best classification accuracy and F1 score when tested on the bumblebee image dataset. Compared with the MobileNetV2 model, the classification accuracy and F1 score of the GMCFF model increased by 1.15 and 1.13 percentage points respectively, while the number of parameters decreased by 1.5M, the floating-point operation amount decreased from the original 326.27M to 159.35M, a reduction of 166.92M, and the model size was only 3.01MB. This proves the rationality of the design of this model, which not only helps to improve the classification accuracy, but also achieves a significant lightweight effect. This method can be extended to other bee automatic classification fields for wider application.

[0107] Table 2 Performance comparison of different models

[0108]

[0109] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.

Claims

1. A lightweight bumblebee image classification method based on improved GhostNet V2, characterized in that: The method comprises the following steps: Training phase: Step 1: Design and build a bumblebee image acquisition system to collect bumblebee image datasets; Step 2: Preprocess the bumblebee image dataset, including image compression and data enhancement such as rotation, flipping, translation, brightness processing, contrast processing, and noise processing; Step 3: Build an image classification network model, namely the improved GhostNet V2 model: perform convolution operations of different scales of 3×3, 5×5 and 7×7 on the input image, and output the low-level feature map F; the main branch passes through 6 layers of GhostNetV2 bottleneck layers to obtain the middle-level feature map, and the low-level feature map F is fused with the middle-level feature map through the shortcut branch B1; the main branch continues to pass through 4 layers of GhostNetV2 bottleneck layers to obtain the high-level feature map, and the low-level feature map F is fused with the high-level feature map through the shortcut branch B2; after convolution, average pooling, and convolution, the flattened image features are finally predicted and output through the fully connected layer; Step 4: Divide the bumblebee image dataset into a training set, a validation set, and a test set according to a certain ratio. Use the training set to train the constructed image classification network model, and use the validation set to verify the classification accuracy of the model. Save the trained image classification network model. Testing phase: Step 5: Input the test set images into the trained GMCFF model for bumblebee image classification and output the classification accuracy results.

2. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 1 is characterized in that: In step 1: Bumblebees were selected as the objects of image collection. A bumblebee image collection system was designed and built according to the actual breeding environment of bumblebees. The collected bumblebee images were divided into three categories: queen bee, drone and worker bee.

3. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 1 is characterized in that: The method for preprocessing the bumblebee dataset in step 2 is specifically as follows: Image compression, the image compression method is to compress the image size from 400KB to 10KB; Rotation, the rotation angles are 45°, 90°, and 180° respectively; Flip: vertical flip or horizontal flip; Translation: the translation modes are up, down, left and right; Brightness processing: Brightness processing is to randomly adjust the brightness of the image; Contrast processing, the contrast processing method is to randomly adjust the image contrast; Noise processing: the noise processing method is to add salt and pepper noise and Gaussian noise; Through the above data enhancement technology, various types of data are uniform.

4. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 1, characterized in that: The improved GhostNet V2 model constructed in step 3 is specifically: First, perform convolution operations of different scales of 3×3, 5×5 and 7×7 on the input image, and output the low-level feature map F to obtain the receptive field information at different scales; the feature map size calculation formula is: W1=(W-F+2P) / S+1 H1=(H-F+2P) / S+1 D1=D Where W is the length of the input image, W1 is the length of the feature map, H is the width of the input image, H1 is the width of the feature map, D is the number of convolution kernels, D1 is the number of channels of the feature map, F is the size of the convolution kernel, S is the sliding step size, and P represents the number of zero paddings; Then the main branch passes through 6 layers of GhostNetV2 bottleneck layer to obtain the middle-level feature map, and the low-level feature map F is fused with the middle-level feature map through the shortcut branch B1; Then the main branch continues to pass through 4 layers of GhostNetV2 bottleneck layers to obtain a high-level feature map, and the low-level feature map F is fused with the high-level feature map through the shortcut branch B2; After 1×1 convolution, 7×7 average pooling, and 1×1 convolution, the output feature map is input into the last fully connected layer. The flattened image features are predicted and output through the fully connected layer. The output result of the fully connected layer is the final output of the GMCFF model.

5. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 4 is characterized in that: The specific method of fusing the low-level feature map with the mid- and high-level feature maps through the shortcut branch is: 1) Make sure that the low-level feature maps and the mid-level or high-level feature maps have the same size. If their sizes do not match, they can be resized to the same size through convolution or pooling operations; 2) Add the adjusted low-level feature map and the middle or high-level feature map element by element to generate a new feature map; Assuming that the low-level feature map is A, and the middle or high-level feature map is B, and they have the same size, the element-by-element addition operation can be expressed as: C=A+B, where C is the fused feature map.

6. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 4 is characterized in that: The GhostNetV2 bottleneck layer is specifically: The GhostNetV2 bottleneck layer is mainly composed of the Ghost module, the DFC attention module and the DW convolution; When the step size is 1, the input features are passed through one Ghost module and one DFC attention module to output two feature maps. After the two feature maps are multiplied, they are passed through one Ghost module to obtain the output features, and the output features are added to the input features. When the step size is 2, the input features pass through 1 Ghost module and 1 DFC attention module to output two feature maps. After the two feature maps are multiplied, they first pass through a DW convolution with a step size of 2, and then pass through a Ghost module to obtain the output features, and the output features are added to the input features.

7. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 6 is characterized in that: The Ghost module is specifically: The Ghost module obtains target features in two parts: the first part uses a convolution kernel of a given size to perform a convolution operation on the input image to obtain the feature map of each channel of the object; the second part of the operation is generated using a simple linear transformation. Specifically, the deep convolution is used to convolve each single channel separately to obtain the deep feature map; finally, the output feature map of the Ghost module is obtained by splicing the two parts.

8. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 6, characterized in that: The DFC attention module is specifically: First, the input features are downsampled to reduce the amount of feature calculations; second, for each pixel in the feature map, only the feature information in the vertical and horizontal directions is calculated to reduce a large amount of redundant information in the feature map, which can be expressed as: Among them, F H and F W is the weight and the input is the original feature Z.

9. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 6, characterized in that: The DW convolution is specifically: DW convolution is divided into two steps: depthwise convolution and point-wise convolution; assuming that the size of the input feature map is H×W×C, where H and W represent the height and width of the feature map, respectively, and C represents the number of channels; 1) Deep convolution uses a convolution kernel of size K×K×1 to perform convolution operations on each channel independently. For each position of the input feature map, the convolution kernel is convolved with the corresponding position to obtain a deep convolution output feature map with a size of H×W×K; 2) Point-by-point convolution uses a convolution kernel of size 1×1×K to perform a convolution operation on the deep convolution output feature map, linearly combines each channel of the deep convolution output feature map, and obtains the final output feature map with a size of H×W×K.

10. The lightweight bumblebee image classification method based on improved GhostNet V2 according to claim 1, characterized in that: The method for training in step 4 is specifically as follows: The bumblebee image dataset is randomly divided into training set, validation set and test set according to the ratio of 7:2:

1. During the training process, the input size of each image is unified to 224×224. The SGD optimizer is used, the momentum is set to 0.9, the learning rate is initialized to 0.01, and the weight_decay is set to 5×10 -4 , the batch size is set to 32, the number of iterations is set to 100, and the dropout is set to 0.2; The SGD optimizer uses the gradient of a small batch of samples to update parameters. For each parameter θ, assuming its current value is θ_current, the updated parameter value is θ_new, the gradient is g, and the learning rate is α. The formula for parameter update using the SGD optimizer is: θ_new=θ_current-α*g.