Fine-grained butterfly recognition method based on improved dual network recognition model

Through the improved dual network recognition model and data preprocessing technology, the subjectivity and long-tail distribution problems of traditional butterfly recognition methods are solved, the recognition accuracy and stability are improved, and higher fine-grained recognition performance of butterflies is achieved.

CN114861803BActive Publication Date: 2024-09-27SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210526795.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2024-09-27
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Traditional butterfly recognition methods rely on manual recognition, which is highly subjective and cannot be applied on a large scale. Existing deep learning technology has a long-tail distribution problem in fine-grained recognition, resulting in poor recognition performance for low data classes, and it is difficult to generalize existing methods to Different recognition tasks.

Method used

An improved dual-network recognition model is adopted, including two ResNeSt50 networks, parameters are updated through cross-entropy loss, and Faster R-CNN and Feature Pyramid Networks are used for image segmentation and data preprocessing, combined with the average weighted fusion recognition results, to construct butterfly fine-grained identification system.

Benefits of technology

The accuracy and performance stability of butterfly recognition are improved. Compared with the standard CNN architecture, the recognition rate is higher, the performance is more stable, and better fine-grained recognition results are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114861803B
    Figure CN114861803B
Patent Text Reader

Abstract

The present invention discloses a butterfly fine-grained recognition method based on an improved dual-network recognition model, comprising the steps of: collecting ecological photos of butterflies in natural living environments and butterfly specimen photos to construct a butterfly picture data set; processing pictures in the butterfly picture data set; segmenting the butterfly picture data set after picture processing; building a dual-network recognition model; obtaining a final recognition model; using the final recognition model to perform butterfly fine-grained recognition, and adopting an average weighted method to fuse the recognition results of the first recognition network and the second recognition network to obtain a final recognition result. Compared with the prior art, the present invention has a higher recognition rate than the standard CNN architecture and more stable performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent agricultural production management, and in particular to a butterfly fine-grained recognition method based on an improved dual-network recognition model. Background Art

[0002] Butterfly identification plays an extremely important role in ecological protection, agricultural and forest pest control, border epidemics and scientific education. Butterfly larvae are pests to agriculture and forestry, and can have adverse effects on animals, plants and human life. Therefore, rapid and reliable butterfly pest monitoring plays a vital role in population prediction and control operations.

[0003] Traditional pest monitoring relies on manual identification of pests by insect experts or technicians, which is highly subjective, labor-intensive, and cannot be applied on a large scale. With the rapid development of computer vision technology, deep learning technology based on convolutional neural networks (CNNs) has made significant breakthroughs. However, in order to identify subtle intra-class object changes inherent in CNNs, fine-grained recognition becomes more challenging than general classification, which can solve the problem of identifying subclasses of a given object category. There are many related studies focusing on this, and these methods can be divided into two categories: one is to learn directly from the original image, and the other is to use methods that focus on parts of the picture. The first category is directly based on the original image and learns better visual representations to get better results. However, the recognition method based on the original image will learn more features that are invalid for direct recognition, which come from the complex background of the picture. Relatively speaking, the recognition method that focuses on parts of the picture will focus more of the network's attention on the truly distinguishable areas to improve the extraction of useful features.

[0004] Existing technologies such as the PMG model use a simple but effective puzzle generator to form images with different levels of granularity, and then fuse information from previous levels of granularity at each step, ultimately cultivating inherent complementary properties across different granularities for fine-grained feature learning. However, the image generation and four-stage training of the PMG model cause the training time to grow exponentially. In addition, the flourishing development of most fine-grained recognition algorithms comes from the balanced datasets publicly available on the Internet, but the distribution of data in life usually presents a long-tail distribution. Specifically, most classes have only a small amount of data, and common categories occupy most of the data in the dataset due to their wide distribution. On datasets that follow this long-tail distribution, neural networks usually prefer data classes that contain a large number of common categories, resulting in poor generalization performance for classes with sparse data.

[0005] To solve such problems, typical methods in previous work include data resampling, loss reweighting, classification boundary modification, and data enhancement. However, these researchers have extensively studied single-step recognition methods that explore knowledge transfer of multiple sample classes to improve the overall recognition effect. However, these methods require the design of a network module or structure specific to the task, which is usually difficult to generalize to different recognition tasks; in addition, most long-tail methods are based on public datasets with obvious inter-class discrimination differences (such as ImageNet-LT, iNaturalist, and Places365-LT), and do not solve the problem of large intra-class differences and small inter-class differences in fine-grained recognition. Summary of the invention

[0006] In order to overcome the shortcomings of the prior art and reduce the impact of multiple data classes on low data classes under long-tail distribution in fine-grained recognition, the present invention proposes a butterfly fine-grained recognition method based on an improved dual-network recognition model.

[0007] The technical solution of the present invention is achieved in this way:

[0008] A butterfly fine-grained recognition method based on an improved dual-network recognition model includes the following steps:

[0009] S1: Collect ecological photos of butterflies in their natural living environment and photos of butterfly specimens to build a butterfly image dataset;

[0010] S2: Processing the images in the butterfly image dataset;

[0011] S3: The butterfly image dataset after segmentation is divided into three subsets: training dataset, validation dataset and test dataset. The training dataset is used to obtain a model that can be used for recognition, the validation dataset is used to verify whether the model is well trained, and the test dataset is used to test the performance of the model in practical applications.

[0012] S4: Step S4 includes

[0013] Step S41: Build a dual network recognition model, wherein the dual network recognition model includes a first recognition network and a second recognition network, the first recognition network and the second recognition network both use ResNeSt50, and set the initialization function of the fully connected layer parameters of the first recognition network to "Xavier Normal initialization", which obeys the distribution of N = (0, std1), and std1 is shown in formula (1):

[0014]

[0015] Where gain is 1, fan_in is the input dimension of the fully connected layer of the first recognition network, and fan_out is the output dimension of the fully connected layer of the first recognition network. The parameter initialization function of the fully connected layer of the second recognition network is set to "KaimingNormal Initialization", which obeys the distribution N = (0, std2), where std2 is shown in formula (2):

[0016]

[0017] The value of parameter a is set to 1, and fan_out is the output dimension of the second recognition network;

[0018] The parameters of other network layers of the first recognition network and the second recognition network use pre-trained parameters on the ImageNet dataset;

[0019] Step S42: Use the training data set to train the first recognition network and the second recognition network, and use the verification data set to simultaneously predict the same picture in the first recognition network and the second recognition network to obtain respective prediction results {P i ,c1} and {P i ,c2}, according to the prediction results, the pictures are divided into two groups, one group is the prediction results of the first recognition network and the second recognition network are consistent, and the other group is the prediction results of the first recognition network and the second recognition network are inconsistent; the inconsistent results are directly calculated through the cross entropy loss to update the network parameters,

[0020] The consistent results are obtained by the first recognition network and the second recognition network selecting the loss with the smallest CR(T) for each other to update the model parameters, and CR(T) is shown in formula (3);

[0021]

[0022] CR(T) is the selection ratio, T m is the number of classes with more than 100 images, and T is the total number of classes in the dataset;

[0023] S5: Repeat step S42 until a final recognition model is obtained;

[0024] S6: Use the final recognition model to perform fine-grained butterfly recognition, and fuse the recognition results of the first recognition network and the second recognition network in an average weighted manner to obtain a final recognition result.

[0025] Furthermore, the step S2 includes the steps of

[0026] S21: Obtain ecological photos of butterflies in their natural ecological environment and photos of butterfly specimens;

[0027] S22: Use Faster R-CNN and Feature Pyramid Networks to segment butterfly images, and manually discard incorrectly segmented images.

[0028] Furthermore, the training data set, the verification data set and the test data set in step S3 account for 60%, 20% and 20% of the butterfly image data set respectively.

[0029] Furthermore, the step S4 further comprises the steps of:

[0030] Data preprocessing: The images are uniformly scaled or enlarged to 224×224. In order to avoid overfitting, all images in the training dataset are randomly horizontally flipped before being input into the network training. The random flipping probability is 0.5. In order to limit the processed image data values ​​to a certain range, the normalization parameters obtained on the ImageNet dataset are used.

[0031] The beneficial effect of the present invention is that, compared with the prior art, the present invention has a higher recognition rate and more stable performance than the standard CNN architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of the butterfly fine-grained recognition method based on the improved dual-network recognition model of the present invention;

[0033] Figure 2 This is a comparison diagram between the present invention and the existing CNN structure. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] See also Figure 1 The present invention is based on the improved double network recognition model of butterfly fine-grained recognition method, comprising the steps of

[0036] S1: Collect ecological photos of butterflies in their natural living environment and photos of butterfly specimens to build a butterfly image dataset;

[0037] S2: Processing the images in the butterfly image dataset;

[0038] S3: The butterfly image dataset after segmentation is divided into three subsets: training dataset, validation dataset and test dataset. The training dataset is used to obtain a model that can be used for recognition, the validation dataset is used to verify whether the model is well trained, and the test dataset is used to test the performance of the model in practical applications.

[0039] S4: Construct a dual network recognition model, including

[0040] Step S41: Build a dual network recognition model, wherein the dual network recognition model includes a first recognition network and a second recognition network, the first recognition network and the second recognition network both use ResNeSt50, and set the initialization function of the fully connected layer parameters of the first recognition network to "Xavier Normal initialization", which obeys the distribution of N = (0, std1), and std1 is shown in formula (1):

[0041]

[0042] Where gain is 1, fan_in is the input dimension of the fully connected layer of the first recognition network, and fan_out is the output dimension of the fully connected layer of the first recognition network. The parameter initialization function of the fully connected layer of the second recognition network is set to "KaimingNormal Initialization", which obeys the distribution N = (0, std2), where std2 is shown in formula (2):

[0043]

[0044] The value of parameter a is set to 1, and fan_out is the output dimension of the second recognition network;

[0045] The parameters of other network layers of the first recognition network and the second recognition network use pre-trained parameters on the ImageNet dataset;

[0046] Step S42: Use the training data set to train the first recognition network and the second recognition network, and use the verification data set to simultaneously predict the same picture in the first recognition network and the second recognition network to obtain respective prediction results {P i ,c1} and {P i ,c2}, the pictures are divided into two groups according to the prediction results, one group is the prediction results of the first recognition network and the second recognition network are consistent, and the other group is the prediction results of the first recognition network and the second recognition network are inconsistent; the inconsistent results are directly calculated by cross entropy loss to update the network parameters, and the consistent results are updated by the first recognition network and the second recognition network selecting the smaller loss of the previous CR(T) for each other, and the CR(T) is shown in formula (3);

[0047]

[0048] CR(T) is the selection ratio, T m is the number of classes with more than 100 images, and T is the total number of classes in the dataset; in a typical embodiment of the present invention, the CR(T) is 22.6%;

[0049] S5: Repeat step S42 until a final recognition model is obtained;

[0050] S6: Use the final recognition model to perform fine-grained butterfly recognition, and fuse the recognition results of the first recognition network and the second recognition network in an average weighted manner to obtain a final recognition result.

[0051] The step S2 includes the steps

[0052] S21: Obtaining ecological photos of butterflies in natural ecological environment and photos of butterfly specimens, wherein the ecological photos of butterflies in natural ecological environment can be collected by searching keywords of butterfly species names on major search engines, and the butterfly specimen photos are pictures obtained by taking photos of samples in a laboratory;

[0053] S22: Use Faster R-CNN and Feature Pyramid Networks to segment butterfly images, and manually discard incorrectly segmented images.

[0054] The training data set, validation data set and test data set described in step S3 account for 60%, 20% and 20% of the butterfly image data set respectively. In one embodiment of the present invention, we divide the butterfly data set into three subsets: training data set, randomly select 60% of the images of 914 butterfly instances to form a training subset, which is used to train the model; validation data set, half of the images are extracted from the remaining images of the data set to form a validation data set and used to evaluate the butterfly recognition task; test data set, we form a test data set from the remaining 20% ​​of the butterfly images in 914 butterfly species, and this subset is used to evaluate the butterfly fine-grained verification task.

[0055] The step S4 further comprises the steps of:

[0056] Data preprocessing: The images are uniformly scaled or enlarged to 224×224. In order to avoid overfitting, all images in the training dataset are randomly horizontally flipped before being input into the network training. The random flipping probability is 0.5. In order to limit the processed image data values ​​to a certain range, the normalization parameters obtained on the ImageNet dataset are used.

[0057] See also Figure 2We selected some popular CNN single network models to compare with our dual network recognition model, namely: VGG16(Simonyan and Zisserman 2014), GoogLeNet(Szegedy, Liu et al.2015), MobileNetV3Large(Howard, Sandler et al.2019), ShuffleNet(Zhang, Zhou et al.2018), DenseNet(Huang, Liu et al.2017), RegNet4.0(Radosavovic, Kosaraju et al.2020), resnet50(He, Zhang et al.2016), GhostNet(Han, Wang et al.2020), ResNext50(Xie, Girshick et al.2017), efficientNetb0(Tan and Le 2019), ResNeSt50(Zhang, Wu et al.2020).

[0058] Depend on Figure 2 It can be seen that the butterfly fine-grained recognition model based on the improved dual-network recognition model proposed in the present invention achieves higher performance than other standard CNN architectures and also experiences less fluctuations after reaching stability. ResNeSt-50 achieved the best performance among the selected standard CNN modules, obtaining 0.828, and then we used this network as the backbone network to improve our model. Our method is 2.5% better than the ResNeSt-50 single network. In addition, the best accuracy of combined recognition reached 86.3%, which is 3.5% higher than using ResNeSt50 alone.

[0059] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. The butterfly fine-grained recognition method based on the improved dual-network recognition model is characterized by: Included steps S1: Collect ecological photos of butterflies in their natural living environment and photos of butterfly specimens to build a butterfly image dataset; S2: Processing the images in the butterfly image dataset; S3: The butterfly image dataset after segmentation is divided into three subsets: training dataset, validation dataset and test dataset; The training data set is used to obtain a model that can be used for recognition, the validation data set is used to verify whether the model is well trained, and the test data set is used to test the performance of the model in actual applications; S4: Step S4 includes Step S41: Build a dual network recognition model, wherein the dual network recognition model includes a first recognition network and a second recognition network, the first recognition network and the second recognition network both use ResNeSt50, and set the initialization function of the fully connected layer parameters of the first recognition network to "Xavier Normal initialization", which obeys the distribution of N = (0, std1), and std1 is shown in formula (1): Where gain is 1, fan_in is the input dimension of the fully connected layer of the first recognition network, and fan_out is the output dimension of the fully connected layer of the first recognition network; the parameter initialization function of the fully connected layer of the second recognition network is set to "KaimingNormal Initialization", which obeys the distribution N = (0, std2), where std2 is shown in formula (2): The value of parameter a is set to 1, and fan_out is the output dimension of the second recognition network; The parameters of other network layers of the first recognition network and the second recognition network use pre-trained parameters on the ImageNet dataset; Step S42: Use the training data set to train the first recognition network and the second recognition network, and use the verification data set to simultaneously predict the same picture in the first recognition network and the second recognition network to obtain respective prediction results {P i ,c1} and {P i ,c2}, the pictures are divided into two groups according to the prediction results, one group is the prediction results of the first recognition network and the second recognition network are consistent, and the other group is the prediction results of the first recognition network and the second recognition network are inconsistent; the inconsistent results are directly calculated by cross entropy loss to update the network parameters, and the consistent results are updated by the first recognition network and the second recognition network selecting the smaller loss of the previous CR(T) for each other, and the CR(T) is shown in formula (3); CR(T) is the selection ratio, T m is the number of classes with more than 100 images, and T is the total number of classes in the dataset; S5: Repeat step S42 until a final recognition model is obtained; S6: Use the final recognition model to perform fine-grained butterfly recognition, and fuse the recognition results of the first recognition network and the second recognition network in an average weighted manner to obtain a final recognition result.

2. The butterfly fine-grained recognition method based on the improved dual-network recognition model as claimed in claim 1, characterized in that: Step S2 includes the steps S21: Obtain ecological photos of butterflies in their natural ecological environment and photos of butterfly specimens; S22: Use Faster R-CNN and Feature Pyramid Networks to segment butterfly images, and manually discard incorrectly segmented images.

3. The butterfly fine-grained recognition method based on the improved dual-network recognition model as claimed in claim 1 is characterized in that: The training data set, the verification data set and the test data set in step S3 account for 60%, 20% and 20% of the butterfly image data set respectively.

4. The butterfly fine-grained recognition method based on the improved dual-network recognition model as claimed in claim 1, characterized in that: The step S4 further comprises the steps of: Data preprocessing: The images are uniformly scaled or enlarged to 224×224. In order to avoid overfitting, all images in the training dataset are randomly horizontally flipped before being input into the network training. The random flipping probability is 0.

5. In order to limit the processed image data values ​​to a certain range, the normalization parameters obtained on the ImageNet dataset are used.

5. The butterfly fine-grained recognition method based on the improved dual-network recognition model as claimed in claim 1, characterized in that: The CR(T) was 22.6%.

Citation Information

Patent Citations

  • Butterfly type identification method and system, electronic device and storage medium

    CN108875774A

  • A butterfly automatic classification method based on depth learning

    CN109376765A

  • Butterfly image fine granularity identification method based on AM-Softmax loss

    CN112800927A

  • Butterfly identification network construction method and apparatus, and computer device and storage medium

    WO2020006881A1