A blueberry leaf variety identification method based on a migration convolutional neural network
By using the improved EfficientNet-B1 convolutional neural network model and transfer learning, the accuracy and cost issues of traditional blueberry variety identification were solved, achieving efficient and robust blueberry leaf variety identification.
Patent Information
- Application Number
- CN202211000665.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-08-19
AI Technical Summary
Traditional blueberry variety identification relies on manual identification, which is affected by expert experience, is costly and time-consuming, and lacks sufficient existing image databases and literature, making it difficult to efficiently identify blueberry leaf varieties.
An improved EfficientNet-B1 convolutional neural network model, combined with transfer learning and data preprocessing techniques, was used to automatically extract features from blueberry leaf images for blueberry leaf variety identification.
It achieves high-precision, low-cost identification of blueberry leaf varieties, is robust to the effects of light, and is suitable for blueberry resource conservation and new variety discovery.
Smart Images

Figure CN115423997B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition technology, specifically relating to a method for identifying blueberry leaf varieties based on a transfer convolutional neural network. Background Technology
[0002] Blueberries are perennial berries with a delicious flavor. They not only offer excellent nutritional and health benefits, but also help prevent brain aging, protect eyesight, strengthen the heart, fight cancer, soften blood vessels, and enhance the body's immunity. They are one of the five healthiest fruits recommended by the Food and Agriculture Organization of the United Nations. There are over 450 varieties of blueberries worldwide, with dozens known in China. Accurate identification of these numerous varieties is beneficial for the protection and utilization of blueberry resources, as well as for the discovery and breeding of new varieties.
[0003] Traditional blueberry variety identification requires on-site identification by experts in the relevant field, and the accuracy of the results is affected by related classification knowledge and practical experience. This method is not timely and is costly. With the continuous advancement of computer vision technology, identifying plant varieties through the analysis of plant flowers, fruits, and leaves using digital image processing technology has become a new approach. Blueberries are deciduous shrubs, and different varieties have different leaf textures and geometric information. Compared with flowers and fruits, leaves have a longer lifespan, stable morphology, and collecting leaves does not affect the growth of blueberry plants, making them suitable for blueberry variety classification. Currently, there are very few publicly available blueberry leaf sample databases online, and there is also very little literature on blueberry leaf variety classification. Summary of the Invention
[0004] The purpose of this invention is to provide a method for identifying blueberry leaf varieties, which solves the problems of the large number of blueberry varieties, high cost of manual classification, and difficulty in manually discovering new varieties.
[0005] The objective of this invention is achieved through the following technical solution:
[0006] The present invention provides a method for blueberry leaf variety identification based on a transfer convolutional neural network, comprising the following steps:
[0007] Step 1: Data preparation. Obtain blueberry leaf image data, preprocess the blueberry leaf data, and create a blueberry leaf dataset; then divide it into training set and validation set.
[0008] Step 2: Build the model. This model is based on the EfficientNet-B1 network model and improves the MBConv structure of Stage 1 to Stage 7 in the EfficientNet-B1 network model. The improved MBConv structure consists of a pointwise convolution with a kernel size of 1×1, a depthwise separable convolution with a kernel size of k×k, an SE module, a pointwise convolution with a kernel size of 1×1, and a CBAM module.
[0009] Step 3: Train the model. Take the blueberry leaf images from the training set in Step 1 as input and the corresponding blueberry leaf labels as output to train the improved EfficientNet-B1 model constructed in Step 2. Save the trained weights into the model.
[0010] Step 4: Determine the model. Take the blueberry leaf images from the validation set in Step 1 as input and the corresponding blueberry leaf labels as output. Compare the output values with the actual labels of the images to calculate the model accuracy. Repeat the above process and select the model with the highest accuracy as the blueberry leaf recognition model.
[0011] Step 5: After preprocessing the blueberry leaf image to be detected, input it into the blueberry variety identification model obtained in step 4, and output the blueberry leaf image label to be detected, which is the blueberry variety identification result.
[0012] Furthermore, the preprocessing in steps 1 and 5 is specifically performed as follows:
[0013] Step a: Based on the color features of the blueberry leaf image, using the R, G, and B channels of the leaf image as operators, and according to the formula ExG = 2 * GRB for the super green feature, obtain the grayscale image of the blueberry leaf.
[0014] Step b: Based on the large difference in grayscale values between the blueberry leaf and the background in the grayscale image, threshold segmentation is performed using the Otsu's maximum inter-class variance method to obtain a rough binary image of the blueberry leaf; then, erosion and dilation methods are used to remove spots and burrs to obtain a smooth binary image of the blueberry leaf.
[0015] Step c: Use the minimum bounding rectangle algorithm to obtain the starting point (x,y) and the width and height of the rectangle from the binary image of the blueberry leaf. Then, directly crop the original blueberry leaf image to obtain the preprocessed blueberry leaf image, which reduces the interference of the background on the identification of blueberry leaf varieties.
[0016] Furthermore, the method for training the improved EfficientNet-B1 model in step 3 adopts the transfer learning method. The specific steps of this method are as follows: the weights of the improved EfficientNet-B1 model network are initialized using the parameter file of the EfficientNet-B1 model pre-trained on the ImageNet dataset; then the training weights are updated using the backpropagation algorithm, and the trained weights are saved into the model.
[0017] Furthermore, the backpropagation algorithm is specifically described as follows:
[0018] Image data from the training set is input into the network model, which outputs corresponding blueberry leaf labels. The error between the output value and the actual label of the image is calculated, and this error is backpropagated. During the backpropagation process, the weights in each layer of the network are adjusted according to the error using the gradient descent method.
[0019] Beneficial effects
[0020] 1) The blueberry leaf variety identification method of the present invention automatically extracts blueberry leaf features. It trains a convolutional neural network using blueberry leaf image data, automatically selecting and learning features to solve the problems of low classification accuracy caused by manually selected features and the lack of a dedicated identification model for blueberry leaf varieties.
[0021] 2) The blueberry leaf variety identification method of the present invention adopts the improved EfficientNet-B1 model, which can better focus on the blueberry leaf itself and improve the feature extraction capability;
[0022] 3) The blueberry leaf variety identification method of the present invention has high accuracy in identifying blueberry leaf varieties and good robustness to light spots and shadows caused by light exposure in blueberry leaf images, and has high practical value. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0024] Figure 1 This is a system block diagram of the blueberry leaf variety identification method of the present invention;
[0025] Figure 2 This is a schematic diagram of the improved MBconv structure provided in the blueberry leaf variety identification method of the present invention. Specific implementation methods
[0026] The present invention will be further described below with reference to the accompanying drawings and embodiments. Example
[0027] The present invention discloses a method for blueberry leaf variety identification based on a transfer convolutional neural network, the system block diagram of which is shown below. Figure 1 As shown, it includes the following steps:
[0028] Step 1: Data preparation;
[0029] The blueberry leaf image dataset used in this embodiment comes from the Jinhua Blueberry Base. This dataset contains 8,000 blueberry leaf images from 10 blueberry varieties: BRY, DRW, ELB, GDB, ONL, PDB, PRM, SPT, TFB, and URK. The images were taken using a Huawei Mate 20 smartphone with a 16-megapixel rear camera, taking pictures under various lighting conditions, at different distances, and from different angles.
[0030] The images in the blueberry leaf image data are classified according to the blueberry species, and the images of the same multiple blueberry species are stored accordingly to obtain multiple image sets of different species;
[0031] Based on the color features of blueberry leaf images, using the R, G, and B channels of the leaf images as operators, and according to the formula ExG = 2*GRB for the super green feature, a grayscale image of the blueberry leaf is obtained.
[0032] Based on the large difference in grayscale values between the blueberry leaf and the background in the grayscale image, the Otsu's maximum inter-class variance method is used for threshold segmentation to obtain a rough binary image of the blueberry leaf; then, erosion and dilation methods are used to remove spots and burrs to obtain a smooth binary image of the blueberry leaf.
[0033] The minimum bounding rectangle algorithm is used to obtain the starting point (x,y) and the width and height of the rectangle from the binary image of the blueberry leaf. The original blueberry leaf image is directly cropped to obtain a blueberry leaf image suitable for model training, which reduces the interference of the background on the identification of blueberry leaf varieties.
[0034] The image set is labeled according to the blueberry species name to obtain the leaf image dataset, which is divided into a training set and a validation set with an image ratio of 7:1.
[0035] Step 2: Build the model;
[0036] The established blueberry variety classification model is based on the EfficientNet-B1 network model, with improvements made to the MBConv structure of Stages 1 to 7 of the EfficientNet-B1 network model, as shown in Table 1. The improved MBConv structure consists of a pointwise convolution with a kernel size of 1×1, a depthwise separable convolution with a kernel size of k×k, an SE module, a pointwise convolution with a kernel size of 1×1, and a CBAM module. The structure diagram of MBConv is shown below. Figure 2 As shown.
[0037] Table 1: EfficientNet-B1 Network Model Structure Table
[0038]
[0039]
[0040] Step 3: Train the model;
[0041] The improved EfficientNet-B1 model constructed in step 2 is trained using blueberry leaf images from the training set as input and corresponding blueberry leaf labels as output. EfficientNet-B1 employs transfer learning, initializing the weights of the improved model network using a pre-trained EfficientNet-B1 model parameter file on the ImageNet dataset; then updating the training weights using backpropagation and saving the model parameters; next, blueberry leaf images from the validation set are used as input and corresponding blueberry leaf labels as output, fed into the updated model. The model accuracy is obtained by comparing the output value with the actual labels of the validation set images. This process is repeated, and the model with the highest validation set accuracy is selected as the blueberry leaf variety recognition model.
[0042] The backpropagation algorithm inputs image data from the training set into the network model, outputs corresponding blueberry leaf labels, calculates the error between the output value and the actual label of the image, and propagates this error back. During the backpropagation process, the weights in each layer of the network are adjusted according to the error using the gradient descent method.
[0043] Step 4: Testing;
[0044] After the blueberry leaf image to be detected is preprocessed as described in step 1, it is input into the blueberry variety recognition model, and the blueberry leaf image label to be detected is output, which is the blueberry variety recognition result.
[0045] Traditional blueberry variety identification requires on-site identification by experts in the relevant field. The accuracy of the results is affected by the relevant classification knowledge and practical experience, and this method is not timely and has high economic costs. In contrast, blueberry variety identification based on transfer convolutional neural networks is convenient and fast. While ensuring the accuracy of variety identification, it has good robustness to light spots and shadows caused by light exposure in blueberry leaf images; therefore, it has high practical value in blueberry variety identification.
Claims
1. A method for blueberry leaf variety identification based on transfer convolutional neural networks, characterized by: Includes the following steps: Step 1: Data preparation. Obtain blueberry leaf image data, preprocess the blueberry leaf data, and create a blueberry leaf dataset; then divide it into training set and validation set. Step 2: Build the model. This model is based on the EfficientNet-B1 network model and improves the MBConv structure of Stage 1 to Stage 7 in the EfficientNet-B1 network model. The improved MBConv structure consists of a pointwise convolution with a kernel size of 1×1, a depthwise separable convolution with a kernel size of k×k, an SE module, a pointwise convolution with a kernel size of 1×1, and a CBAM module. Step 3: Train the model. Take the blueberry leaf images from the training set in Step 1 as input and the corresponding blueberry leaf labels as output to train the improved EfficientNet-B1 model constructed in Step 2. Save the trained weights into the model. Step 4: Determine the model. Take the blueberry leaf images from the validation set in Step 1 as input and the corresponding blueberry leaf labels as output. Compare the output values with the actual labels of the images to calculate the model accuracy. Repeat the above process and select the model with the highest accuracy as the blueberry leaf recognition model; Step 5: After preprocessing the blueberry leaf image to be detected, input it into the blueberry variety identification model obtained in step 4, and output the blueberry leaf image label to be detected, which is the blueberry variety identification result.
2. The blueberry leaf variety identification method based on transfer convolutional neural network as described in claim 1, characterized in that: The preprocessing in steps 1 and 5 is performed as follows: Step a: Based on the color features of the blueberry leaf image, using the R, G, and B channels of the leaf image as operators, and according to the formula ExG = 2 * GRB for the super green feature, obtain the grayscale image of the blueberry leaf. Step b: Based on the large difference in grayscale values between the blueberry leaf and the background in the grayscale image, threshold segmentation is performed using the Otsu's maximum inter-class variance method to obtain a rough binary image of the blueberry leaf; then, erosion and dilation methods are used to remove spots and burrs to obtain a smooth binary image of the blueberry leaf. Step c: Use the minimum bounding rectangle algorithm to obtain the starting point (x,y) and the width and height of the rectangle from the binary image of the blueberry leaf. Then, directly crop the original blueberry leaf image to obtain the preprocessed blueberry leaf image, which reduces the interference of the background on the identification of blueberry leaf varieties.
3. A method for blueberry leaf variety identification based on a transfer convolutional neural network as described in claim 1 or 2, characterized in that: The method for training the improved EfficientNet-B1 model in step 3 adopts the transfer learning method. The specific steps of this method are as follows: the weights of the improved EfficientNet-B1 model network are initialized using the parameter file of the EfficientNet-B1 model pre-trained on the ImageNet dataset; then the training weights are updated using the backpropagation algorithm, and the trained weights are saved into the model.
4. The blueberry leaf variety identification method based on transfer convolutional neural network as described in claim 3, characterized in that: The backpropagation algorithm is specifically described as follows: Image data from the training set is input into the network model, which outputs corresponding blueberry leaf labels. The error between the output value and the actual label of the image is calculated, and this error is backpropagated. During the backpropagation process, the weights in each layer of the network are adjusted according to the error using the gradient descent method.
Citation Information
Patent Citations
Tea classification method based on hyperspectral image and deep learning
CN113158980A
Paint surface image segmentation system and method based on double attention mechanism and U-net network
CN113989271A