Pear variety identification method based on pear leaf image deep learning
Through deep learning technology, the convolutional neural network model is built, and the leaf image data of pear varieties is processed, and the pear variety recognition is achieved with high accuracy, solving the problems of low recognition efficiency and insufficient accuracy in the existing technology, and providing an efficient and accurate pear variety recognition method.
Patent Information
- Application Number
- CN202411717498.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-28
AI Technical Summary
The existing pear variety identification methods are complex and inefficient in operation. Especially the phenotypic characteristics-based methods have insufficient accuracy and efficiency, which is difficult to meet the needs of fruit farmers and consumers for accurate and efficient identification.
Deep learning technology is used to build a convolutional neural network model, and the online identification and classification of pear varieties is realized by collecting and processing leaf image data of different pear varieties. Specific steps include collecting and enhancing the data set, building ResNet34-out and ResNet34-ELU models, and identifying them in different scenarios.
The high accuracy recognition of pear varieties was achieved, and the indoor recognition accuracy rate reached 96.01%, solving the problems of low identification efficiency and insufficient accuracy in the prior art, and providing an efficient and accurate pear varieties recognition method.
Smart Images

Figure CN119540774A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of smart agriculture, and specifically is a pear variety identification method based on deep learning of pear leaf images. Background Art
[0002] Pear (Pyrus spp.) is a plant of the genus Pyrus (Pyrus L.) of the Rosaceae family. It is rich in vitamin C, cellulose and minerals. It can be eaten directly, and can also be made into juice or canned food. It has the effects of relieving cough and reducing phlegm, clearing the heart and moistening the lungs. The cultivated area and output of pears in my country account for about 70% of the world. The cultivated pear species in my country can be divided into two categories: Chinese pear and Western pear. The production areas of Chinese pear are concentrated in Asian countries, such as China, Japan and South Korea. The native pear trees in my country are mainly distributed in the Yellow River Basin, the Yangtze River Basin and the southern region, such as white pear, sand pear and autumn pear. Due to its strong adaptability, pears are distributed from Northeast my country to South China, among which North China, Northwest China and Northeast China are the most widely planted. Western pears are mainly produced in Europe, Africa, America and Oceania, such as Abate, Confluence, Bartlett, etc. Among them, the United States, Germany, Spain and Italy are the largest producing areas of Western pears.
[0003] Different pear varieties have differences in fruit shape, color, size, nutritional content, flavor, etc. Due to the close genetic relationship of some pear varieties, there are problems such as similar appearance and no obvious internal variety differences, which increases the complexity of pear variety identification, resulting in mixed management of the pear fruit market and the seedling breeding market, making it difficult to protect the rights and interests of consumers and fruit farmers. How to accurately and efficiently identify pear varieties is a hot topic of research. Variety identification includes phenotypic or genotypic identification research. At present, the pear variety identification method is mainly based on DNA molecular markers or genotypic identification. These methods have problems such as complex operation and low efficiency. At present, variety identification methods based on phenotypic characteristics have gradually become a hot research direction in the field of plant identification. Roots, stems, leaves, flowers, and fruits are the most common phenotypic organs of plants. The leaves and fruits of plants have experienced a long evolutionary history and long-term natural selection, so that the leaves and fruits of different plant varieties usually have unique morphology, texture and other characteristics, which are easy to distinguish and identify. Moreover, leaves and fruits are common parts of plants, easy to collect and observe, and non-destructive when performing variety identification, which does not affect the growth and development of plants. Therefore, leaves and fruits become common choices in the field of plant identification.
[0004] In recent years, with the continuous development of computer technology, the development technology of mobile applications has also been continuously innovating. Many studies have introduced deep learning technology to build convolutional neural network models to achieve automatic recognition and classification of plant varieties on mobile terminals. In the future, with the continuous advancement of technology, the application of mobile applications in the agricultural field will be more extensive and intelligent.
[0005] In general, the research of scholars at home and abroad in the field of image recognition mainly focuses on the identification of diseases or species of crops such as wheat, corn, and rice, as well as fruits such as apples, tomatoes, and citrus, while the research on pear variety identification is still shallow. Summary of the invention
[0006] This application is based on deep learning and builds a convolutional neural network model that can accurately identify different pear varieties based on leaf images, realizing online recognition and classification of pear varieties.
[0007] Technical solution:
[0008] A pear variety identification method based on deep learning of pear leaf images comprises the following steps:
[0009] S1. Collect images of young leaves and mature leaves of different pear varieties, obtain data sets by taking images indoors and taking images outdoors in situ, and divide and enhance the images of each variety;
[0010] S2. Build a convolutional neural network model, including:
[0011] ResNet34-out model and ResNet34-ELU model are trained and verified to obtain the corresponding convolutional neural network models;
[0012] S3: Collect image data of pear variety leaves and use the convolutional neural network model built in S2 to identify pear varieties.
[0013] Specifically, S1 performs data enhancement on the images of each variety, including the adjustment of pixels, brightness, contrast, saturation and hue angle, and uses rotation and horizontal flipping to complete the processing of the data set.
[0014] Specifically, when building the convolutional neural network model, the data set was optimized and expanded based on the basic framework of the ResNet34 network model to obtain the ResNet34-out model.
[0015] Specifically, the ResNet34-out model includes a 7×7 convolutional layer, a maximum pooling layer, four residual modules, an average pooling layer, and a fully connected layer.
[0016] Preferably, the data set BatchSize of the ResNet34-out model is set to 64, and the Learning Rate is set to 0.0001.
[0017] Specifically, the ResNet34-ELU model is optimized based on the ResNet34-out network model, including:
[0018] ① Add the CBAM attention mechanism before the first convolution, and use the CBAM attention mechanism to extract features in the channel and space of the image;
[0019] ②Replace the ReLU activation function of the first layer BasicBlock in the ResNet34-out network architecture with the ELU activation function;
[0020] ③Modify the alpha and gamma parameters, set the alpha value to 0.99 and the gamma value to 0.6.
[0021] Specifically, in S3, the ResNet34-out model is used to recognize outdoor mature leaf images; the ResNet34-ELU model is used to recognize indoor pear leaf images; and the ResNet34-out model is used to recognize outdoor tender leaf images and mature leaf images.
[0022] Preferably, when acquiring the image of the leaf, a single shooting background is maintained.
[0023] Beneficial effects of the present invention
[0024] The ResNet34-out model and ResNet34-ELU model proposed in this application are compared with AlexNet, VGG, and GoogleNet models. The above two optimized models can achieve a pear leaf recognition accuracy of 96.01%. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Flow chart of the model building method of the present invention
[0026] Figure 2 Schematic diagram of indoor leaf image acquisition in the embodiment
[0027] Figure 3 Schematic diagram of collecting outdoor leaf images in the embodiment
[0028] Figure 4 The basic framework diagram of the ResNet34-out network constructed in the embodiment
[0029] Figure 5 Schematic diagram of CBAM attention mechanism
[0030] Figure 6 The basic framework diagram of the ResNet34-ELU network constructed in the embodiment
[0031] Figure 7 This is a curve diagram of the recognition accuracy of the model training and testing in the embodiment.
[0032] Figure 8The confusion matrix analysis diagram of a single variety in the embodiment (a: confusion matrix analysis diagram of a single variety of indoor leaf images; b: confusion matrix analysis diagram of a single variety of outdoor tender leaf images; c: confusion matrix analysis diagram of a single variety of outdoor mature leaf images)
[0033] Fig. 9 The following are the correlation analysis diagrams of the single variety sample size and recognition rate in the embodiments (a: correlation analysis diagram of the single variety sample size and recognition rate of indoor leaf images; b: correlation analysis diagram of the single variety sample size and recognition rate of outdoor tender leaf images; c: correlation analysis diagram of the single variety sample size and recognition rate of outdoor mature leaf images; the blue straight line represents that the single variety sample size is negatively correlated with the recognition rate (P>0.05), and the red straight line represents that the single variety sample size is positively correlated with the recognition rate (P>0.05))
[0034] Fig.10 Schematic diagram of heat map visualization of feature layers of some pear varieties in the embodiment (a: indoor leaf image feature layer heat map visualization; b: outdoor tender leaf image feature layer heat map visualization; c: outdoor mature leaf image feature layer heat map visualization; the blue, yellow and orange areas in the picture represent the feature extraction areas of the model for the image, and the darker the yellow area, the more features the model extracts) DETAILED DESCRIPTION
[0035] Combination Figure 1 , a pear variety recognition method based on deep learning of pear leaf images is given. The present invention is further described below in conjunction with an embodiment, but the protection scope of the present invention is not limited thereto:
[0036] S1. Collect images of young and mature leaves of different pear varieties.
[0037] In the embodiment, pear leaves were collected from the pear germplasm resource garden of Nanjing Agricultural University, including tender leaves and mature leaves of 52 pear varieties such as Cui Guan, Korla Xiangli, Hong Zaosu, and Yali. The collection of leaf images is concentrated from early April to mid-May 2023. Two forms are adopted to collect and shoot pear leaf images. One is to select strong and uniform pear trees in the pear germplasm resource garden, and pick pear leaves with full color and no diseases and insect pests from the east, south, west, and north respectively. About 100 to 120 leaves are collected for each pear variety. After picking, they are promptly placed in a fresh-keeping bag in a foam box with ice packs to keep the freshness and integrity of the leaves as much as possible. After that, they are placed indoors under a single background, and a Canon 80D camera (produced by Canon Co., Ltd. of Japan) is used to shoot the front of the pear leaves vertically, that is, indoor shooting, such as Figure 2As shown in the figure, 5774 images of young and mature leaves of 52 pear varieties were taken indoors; another method is to select healthy and uniform pear trees in the pear germplasm resource garden, select pear leaves with full color and no pests and diseases from the east, south, west and north directions, use a camera to take and save the images on site, and take about 30 to 50 images of each pear variety, that is, outdoor in situ shooting, such as Figure 3 As shown, 1580 images of young leaves of 46 pear varieties and 2392 images of mature leaves of 52 pear varieties were taken outdoors.
[0038] In order to train and test the convolutional neural network model, the leaf images of each pear variety are divided into a training set and a test set at a ratio of 8:2 in the embodiment, which increases the diversity and richness of the training set and extracts more image features. There are 5774 images of tender and mature leaves of 52 pear varieties indoors, 4619 in the training set and 1155 in the test set; there are 1580 images of tender leaves of 46 pear varieties outdoors, 1264 in the training set and 316 in the test set; there are 2392 images of mature leaves of 52 pear varieties outdoors, 1914 in the training set and 478 in the test set.
[0039] In order to improve the recognition performance of the network model, the pear leaf dataset was expanded in quantity through an online enhancement mode, including the adjustment of pixels, brightness, contrast, saturation and hue angle, and the dataset was processed by rotation and horizontal flipping.
[0040] In order to ensure the uniformity of the data set, the pixel values of the data set are uniformly adjusted to 384*384, and the brightness, contrast, saturation and hue of the data set are uniformly set to 0.1 using the ColorJitter library. The data set is randomly rotated clockwise or counterclockwise using transforms.RandomRotation, and the data set is horizontally flipped using transforms.RandomHorizontalFlip. Through the above enhancement techniques, the database is expanded, and the indoor tender leaf and mature pear leaf images are expanded to 138,240, the outdoor tender leaf images are 38,160, and the outdoor mature leaf images are 52,620, respectively, providing a substantial data basis for the extraction of model features, thereby improving the recognition effect of the model and preventing overfitting problems in the model recognition process.
[0041] S2. Build a convolutional neural network model.
[0042] The network ResNet34 was selected as the basic framework to realize the classification of pear leaf images. On this basis, convolutional layers, pooling layers, activation functions, and fully connected layers were designed, and the network parameters were adjusted using the back propagation algorithm during the training process. According to the size of the sample, the appropriate batch and learning rate were selected, and the dataset BatchSize was uniformly set to 64 and the Learning Rate was set to 0.0001. The number of features of the input image was changed on the ResNet34 basic framework to optimize the dataset, and the ResNet34-out model was obtained. The features were extracted using the ResNet34-out network model, such as Figure 4 As shown, the ResNet34-out network model includes a 7×7 convolutional layer, a maximum pooling layer, four residual modules, an average pooling layer and a fully connected layer. The ResNet34-out network model is used to recognize outdoor pear leaf images.
[0043] Considering the different background environments of indoor and outdoor leaf photography, the ResNet34-out network model was optimized: first, the CBAM attention mechanism was introduced, such as Figure 5 As shown in the figure, the CBAM attention mechanism combines the channel and spatial features of the image. As a lightweight general model, CBAM can be seamlessly integrated into any CNN framework, and can also complete end-to-end training with the standard CNN to extract more useful features; secondly, the ReLU activation function of the first layer BasicBlock in the ResNet34-out network architecture is replaced with the ELU activation function. Compared with the Sigmoid function and the Tanh function, the ReLU activation function has faster convergence and calculation speeds, and the Dead Relu problem will occur, that is, some neurons will never be activated, and the ELU activation function has most of the advantages of the ReLU function, and there is no Dead Relu problem. Therefore, by modifying the function in the first layer of BasicBlock, the advantages of the ReLU activation function are retained, while avoiding the problem of ReLU when the input data is negative. The result after activation is 0, so that some neurons can still remain active; third, modify the alpha and gamma parameters, set the alpha value to 0.99, and the gamma value to 0.6. The alpha value is used to control the imbalance of pear variety categories, and the gamma value is used to control the difficulty of samples, that is, the gap between the predicted samples and the predicted actual samples.
[0044] After optimizing ResNet34-out, the ResNet34-ELU model is built, such as Figure 6As shown in the figure, the CBAM attention mechanism is used to extract features in the channel and space of the image, and then the image information is further captured through the layer-by-layer convolution of the residual module. The complete average pooling discards irrelevant information and integrates useful information by sliding the pooling window on the feature image, reducing the model calculation parameters and obtaining the average value of the image pixels of each image. This model is used to identify pear leaf images taken indoors.
[0045] Precision, recall, F1-score and accuracy are the four main recognition indicators in the convolutional neural network model. The following is the calculation method of each indicator:
[0046]
[0047] Among them, "a" represents the instance that is correctly classified during the classification process. TP means that the positive sample is correctly predicted as positive; FN means that the positive sample is incorrectly predicted as negative; FP means that the negative sample is incorrectly predicted as positive; TN means that the negative sample is correctly predicted as negative, and TP a TN a , FP a and FN a represents the true positives, true negatives, false positives, and false negatives of class “a”. Similarly, Accuracy, Precision, Recall, and f1-score represent the accuracy, precision, recall, and f1-score of class “a”.
[0048] By comparing and analyzing the four indicators of the ResNet34-out model and the ResNet34-ELU model with the other three common deep convolutional models AlexNet, VGG, and GoogleNet, the best model for identifying different scenes and periods was determined. According to the final recognition results of the model, the single variety recognition accuracy test, confusion matrix analysis, feature layer heat map visualization and correlation analysis were performed for each variety in different scenes and periods. By testing the recognition accuracy of each variety, we can observe whether each variety has different recognition effects due to different scenes or periods; confusion matrix analysis is a tool for evaluating the performance of classification models, which compares the gap between variety classification results and actual prediction values; feature layer heat map visualization can understand whether the CNN model pays attention to the key areas of the image during the classification process, intuitively understand the distribution of data, and locate the specific position in the image, which can help us better understand whether there are background or environmental factors that interfere with the recognition of the image.
[0049] ①Performance analysis and comparison of network models
[0050] In the embodiment, indoor and outdoor tender leaves and mature leaf images are respectively put into AlexNet, VGG, GoogleNet, ResNet34-out model and ResNet34-ELU model for training and testing, and the recognition results of each model are obtained, including four main recognition index values, precision, recall, F1-score and accuracy. The results show that when recognizing leaf images taken indoors, the ResNet34-ELU model is superior to other network models in the four recognition indicators of precision, recall, F1-score and accuracy.
[0051] Table 1 Indoor leaf recognition results
[0052]
[0053] As shown in Table 1, the overall recognition accuracy of indoor leaf images is 96.01%, which is 26.59%, 21.61%, 14.21% and 0.65% higher than AlexNet, VGG, GoogleNet and ResNet34-out respectively. Compared with the ResNet34-out model, the precision, recall and F1-score are improved by 0.59%, 1.09%, 0.73% and 0.65% respectively. Figure 7 As shown in (a), with the increase of model training cycles, the recognition accuracy of the training set and the test set of the ResNet34-ELU model when identifying indoor leaf images gradually increases, and after the 15th training cycle, the training recognition accuracy has gradually stabilized, proving that the model has good generalization ability and stability when identifying indoor leaf images.
[0054] Table 2 Outdoor young leaf recognition results
[0055]
[0056] When recognizing outdoor young leaf images, as shown in Table 2, the ResNet34-out model achieved the best recognition effect in the four recognition index results, with an overall recognition accuracy of 94.01%, which was 30.81%, 23.41%, 16.71% and 4.1% higher than AlexNet, VGG, GoogleNet and ResNet34-ELU respectively; Figure 7 As shown in (b), during the training and testing process of the ResNet34-out model, the recognition accuracy of the test set gradually stabilized from the initial highs and lows. As the model continuously extracts new features, the learning performance of the model is improved and the recognition accuracy is improved.
[0057] Table 3 Identification results of outdoor mature leaves
[0058]
[0059] When identifying outdoor mature leaf images, as shown in Table 3, the precision, F1-score, and accuracy of the ResNet34-out model are 81.20%, 79.89%, and 80.46%, respectively. Compared with the ResNet34-ELU model, the three recognition indicators are improved by 2.06%, 1.45%, and 0.42%, respectively. Figure 7 (c) is shown. Although the recall rate is slightly lower than the ResNet34-ELU model in terms of recognition effect, the four indicators are combined and the ResNet34-out model is more stable in recognizing outdoor mature leaf images. Therefore, the outdoor mature leaf images are recognized by the ResNet34-out model, and the effect is better. Based on the data set of this embodiment, the ResNet34-ELU model is used to recognize indoor pear leaf images, and the recognition performance of the model tends to be stable as the training cycle increases; and when the ResNet34-out model is used to recognize outdoor tender leaf images and mature leaf images, the learning ability and overall expression ability of the network model are relatively good. Therefore, the ResNet34-ELU model and the ResNet34-out model can be deployed on the Android side to identify pear varieties.
[0060] ②Analysis of recognition effect of network model
[0061] In order to test whether the recognition accuracy of a single variety is affected by the different shooting environment factors, the recognition results of the model are interfered. This embodiment uses the ResNet34-ELU model to analyze the recognition rate of a single variety on 52 indoor pear variety leaf images, and uses the ResNet34-out model to analyze the recognition rate of a single variety on 48 outdoor pear variety tender leaf images and 52 outdoor pear variety mature leaf images. The recognition results of each time are arranged in order from high to low according to the recognition rate. The results are as follows:
[0062] Table 4 Single variety recognition accuracy of indoor pear leaves
[0063]
[0064]
[0065] When using ResNet34-ELU to recognize indoor pear leaf images, as shown in Table 4, a total of 35 pear varieties have a recognition accuracy of 100%, such as Zhongli No. 4, Zaosu, Zaobai Mi and Yunhongli No. 1; 14 varieties have a recognition accuracy between 80% and 97%, and the lowest recognition accuracy is Xishui, with a recognition accuracy of 57.14%.
[0066] Table 5 Single variety recognition accuracy of outdoor young leaves
[0067]
[0068]
[0069] When the ResNet34-out model recognizes outdoor pear tender leaf images, as shown in Table 5, there are 33 pear varieties with 100% recognition accuracy, such as Aiganshui, Cangxi Xueli, Bali and Hongxiangsu. The recognition accuracy of the remaining pear varieties is roughly between 60% and 90%. Among them, the pear variety with the lowest recognition accuracy is Xishui, with a variety recognition accuracy of 57.14%. When the leaf image of Xishui is recognized indoors, the recognition accuracy is also the lowest.
[0070] Table 6 Single variety recognition accuracy of outdoor mature leaves
[0071]
[0072]
[0073] When identifying mature pear leaves outdoors, as shown in Table 6, there are 19 pear varieties with an identification accuracy of 100%, such as Cui Guan, Cui Yu, E Pear No. 1 and Fo Jian Xi, and the identification accuracy of the remaining pear varieties is roughly between 60% and 90%. Among them, Longquan Su has the lowest identification accuracy of 25%. When Longquan Su is identified indoors, the accuracy is 100%.
[0074] The above research results show that the recognition effect of pear leaf images taken indoors under a single background is inconsistent with that of images taken outdoors in situ. Therefore, the environmental background of the image is one of the factors affecting the variety recognition rate. In addition, factors such as the similarity of characteristics between varieties, sample size, shooting light, and the lack of leaf texture characteristics may all be sources of factors affecting the accuracy of variety recognition.
[0075] In order to test whether the similarity between varieties has an impact on the results, a confusion matrix analysis was performed on each pear variety to test whether the actual predicted variety is consistent with the real variety. Figure 8As shown in the figure, the horizontal coordinate is the actual predicted variety type, and the vertical coordinate is the true variety type. If the actual predicted variety type is consistent with the true variety type, the variety is identified as a positive sample. If the actual predicted variety type is inconsistent with the true variety type, the variety is identified as a negative sample. The diagonal area represents the probability of the variety being identified as a positive sample, and the other areas represent the probability of the sample being identified as a negative sample. The darker the color of the diagonal area, the more cases that prove that the variety is identified as a positive sample. From the confusion matrix diagram, it can be seen that whether it is an indoor image or an outdoor image, the varieties identified as positive samples account for the majority, and there are individual varieties identified as negative samples, which proves that the similarity between pear leaf samples has a certain impact on the overall recognition effect of the model.
[0076] Considering that the sample size of a single variety of pear leaves in this experiment is within a rough range, rather than a fixed value, such as: the sample size of a single variety of pear leaves photographed indoors is about 100 to 120, and the sample size of a single variety of pear leaves photographed outdoors is about 30 to 50. In order to test whether the difference in sample size will affect the recognition effect of the model, a Student's t-test was performed on the sample size of each pear variety and the corresponding pear variety recognition accuracy. Fig. 9 As shown in the figure, whether shooting indoors or outdoors, the correlation index P value between the sample size of each pear variety and its recognition accuracy is greater than 0.05, proving that the number of samples within the range taken in this study did not affect the recognition results.
[0077] In order to test whether the shooting background of the pear leaves interferes with the model's extraction of image features, the embodiment visualizes the feature layer heat map of each image and detects the concentrated extraction area of the image features by the ResNet34-out model and the ResNet34-ELU model. Fig.10 As shown in the figure, the ResNet34-ELU model mainly focuses on the leaf area when extracting features of indoor pear leaves and outdoor pear tender leaves. However, the heat map of the outdoor mature pear leaf image shows that the ResNet34-out model extracts image features in a more dispersed area, including the surrounding pixel values, resulting in inconsistent recognition effects between the outdoor pear tender leaf image and the outdoor pear mature leaf image. This is because there is a problem of blurred background environment when shooting mature pear leaf images, and when shooting pear tender leaf images, each pear leaf is not focused, which is consistent with the relatively low recognition accuracy of outdoor mature leaves. Therefore, through the visualization of the feature layer heat map, it can be found that the shooting background of the image will affect the model's accurate extraction of image features.
[0078] In summary: for different shooting scenes, this application selects ResNet34 as the architecture, optimizes the data set on the ResNet34 network architecture and builds the ResNet34-out model; based on the ResNet34-out model, it continues to optimize, adds the CBAM attention mechanism, adjusts the residual module and model parameters, and obtains the ResNet34-ELU model. When the two models are compared with the three convolutional neural networks of AlexNet, VGG, and GoogleNet in recognizing indoor and outdoor leaf images, they have achieved good results.
[0079] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
Claims
1. A pear variety recognition method based on deep learning of pear leaf images, characterized in that It includes the following steps: S1. Collect images of young leaves and mature leaves of different pear varieties, obtain data sets by taking images indoors and taking images outdoors in situ, and divide and enhance the images of each variety; S2. Build a convolutional neural network model, including: ResNet34-out model and ResNet34-ELU model are trained and verified to obtain the corresponding convolutional neural network models; S3: Collect image data of pear variety leaves and use the convolutional neural network model built in S2 to identify the pear variety.
2. The method according to claim 1, characterized in that In S1, data enhancement is performed on the images of each variety, including adjustment of pixels, brightness, contrast, saturation and hue angle, and rotation and horizontal flipping are used to complete the processing of the data set.
3. The method according to claim 1, characterized in that When building the convolutional neural network model, the data set was optimized and expanded based on the basic framework of the ResNet34 network model to obtain the ResNet34-out model.
4. The method according to claim 3, characterized in that The ResNet34-out model includes a 7×7 convolutional layer, a maximum pooling layer, four residual modules, an average pooling layer, and a fully connected layer.
5. The method according to claim 3, characterized in that: The dataset BatchSize of the ResNet34-out model is set to 64, and the Learning Rate is set to 0.0001.
6. The method according to claim 1, characterized in that The ResNet34-ELU model is optimized based on the ResNet34-out network model, including: ① Add the CBAM attention mechanism before the first convolution, and use the CBAM attention mechanism to extract features in the channel and space of the image; ②Replace the ReLU activation function of the first layer BasicBlock in the ResNet34-out network architecture with the ELU activation function; ③Modify the alpha and gamma parameters, set the alpha value to 0.99 and the gamma value to 0.
6.
7. The identification method according to claim 1, characterized in that In S3, the ResNet34-ELU model is used to recognize young leaf images and mature leaf images; the ResNet34-out model is used to recognize outdoor young leaf images and mature leaf images.
8. The identification method according to claim 1, characterized in that When acquiring images of leaves, keep the background of the image monotonically.