Mobile phone mobile terminal corn disease detection method based on deep learning

By improving the YOLOv5 model and combining depth-separable convolution, coordinate attention and RFB-s modules, the problem of corn disease detection accuracy and speed is solved, efficient disease identification on the mobile terminal is achieved, and the applicability and practicality of the model are enhanced.

CN118587137APending Publication Date: 2024-09-03XINJIANG UNIVERSITY

Patent Information

Application Number
CN202310195043.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing convolutional neural network (CNN) algorithm based on deep learning has weak detection capabilities for corn diseases, and the depth of the model after deployment on the mobile terminal is too shallow to meet detection accuracy requirements. At the same time, the inference speed of large models affects hardware requirements and affects general Usability.

Method used

The improved YOLOv5 model is used to simulate the characteristics of the human visual receptive field by introducing depth separable convolution, Coordinate attention attention mechanism and RFB-s module, and uses the new upsampling operator CARAFE to optimize the feature extraction and fusion method, reducing model parameters and improve multi-scale target recognition accuracy.

Benefits of technology

While ensuring lightweight model parameters, the accuracy and speed of corn disease detection are improved, meeting the detection needs of mobile phones, and enhancing the applicable scope and practical value of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_4
    Figure FT_4
Patent Text Reader

Abstract

The invention relates to the technical field of crop disease identification, in particular to a corn disease detection method for a mobile phone mobile terminal based on deep learning. Comprising the following steps: acquiring a corn disease image by using a camera, and preprocessing the image; the method comprises the following steps: improving a network structure of YOLOv5 through depth separable convolution, RFB-s, an up-sampling operator and an attention mechanism, and training an improved network model by using a data set to obtain a weight model; deploying the whole trained weight model to a mobile phone mobile terminal; and identifying the pictures shot by the mobile phone on site or the disease pictures transmitted to the mobile phone. The operation amount of a backbone network is effectively reduced through depth separable convolution, the receptive field is enlarged and improved by using RFB-s, and multi-scale context information is captured. And the coordinate attention mechanism endows the feature map with weight information in the xy direction and the y direction, so that the model precision is improved. And finally, an up-sampling operator is improved to improve the detection effect. According to the invention, deep learning is applied to corn disease detection, errors caused by manual subjective judgment are reduced, and the labor efficiency is improved; the running effect and the detection precision of the mobile terminal are improved by aiming at the optimization of the YOLOv5 backbone network; meanwhile, the problem that offline detection cannot be carried out in a network information limited area can be effectively solved through mobile phone mobile terminal deployment, and the use convenience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of corn disease identification, and in particular to a corn disease detection method for a mobile phone based on deep learning. Background Art

[0002] Corn is the largest grain crop in my country. Diseases are one of the main factors affecting corn yields. Diseases break out periodically, spread quickly, and affect a wide range, threatening national food security at all times.

[0003] The convolutional neural network (CNN) algorithm based on deep learning uses a large amount of target detection data as training to extract target features more accurately. However, the simple CNN algorithm has weak ability to detect corn diseases. In addition, to meet the deployment requirements of mobile terminals, the amount of data in its model is inevitably limited. The one-stage detection algorithm YOLOv5 can be well applied to disease detection, but due to its shallow depth of small model, the accuracy of corn disease detection cannot meet the requirements. After the large model is deployed on the mobile terminal, it affects the inference speed, increases the requirements for mobile terminal hardware, and affects versatility. Summary of the invention

[0004] In view of the shortcomings of the existing technology, the present invention proposes a mobile phone target detection method based on improved YOLOv5, using deep separable convolution and attention mechanism to improve the backbone network, and then using the RFB-s module to simulate the characteristics of human visual receptive field, using the RFB-s structure for multi-scale fusion, and introducing a new upsampling operator CARAFE. The trained model is then deployed on the mobile phone, which improves the accuracy of multi-scale target recognition while meeting the speed requirements of mobile phone detection.

[0005] The mobile phone target detection method based on the improved YOLOv5 specifically includes the following steps.

[0006] Step 1: Use cameras to collect image information of corn diseases (large leaf spot, gray leaf spot and rust) at different time periods and angles, and annotate the images.

[0007] Step 2: Enhance the offline data of the diseased images annotated in step 1, and then divide them into a training set, a test set, and a validation set.

[0008] Step 3. Replace the standard convolution with depthwise separable convolution in the feature extraction layer of the YOLOv5 model. Design the standard layer in the backbone network as depthwise separable convolution. Add the Coordinate attention mechanism before obtaining the three backward-transferred feature maps. It can not only capture cross-channel information, but also capture direction-aware and position-aware information, which can help the model locate and identify the target of interest more accurately. Then, perform feature fusion such as splicing to obtain the prediction head.

[0009] Step 4: Use the RFB-s module to simulate the characteristics of human visual receptive field. Use the RFB-s structure to improve the feature fusion method of YOLOv5, set up 4 parallel convolution branches and a shortcut branch to process the input image respectively. In addition, use the new upsampling operator CARAFE in the head of the YOLOv5 model, first predict a reorganization kernel based on the content of each target position, and then use the predicted kernel to reorganize the features.

[0010] Step 5: Input the data set divided in step 2 into the improved network model in step 4, and set the initial parameters such as the number of iterations, learning rate, momentum factor, batch size, etc. Use the optimizer to adjust the network parameters, and retain the weight parameters when the training set number of iterations is completed or the loss image and precision image tend to be stable.

[0011] Step 6: Deploy the improved YOLOv5 model trained in step 5 as a whole to the mobile phone. Use the corn disease images taken by the mobile phone directly or the disease images transmitted to the mobile phone as the detection targets. Then, perform recognition and detection on the images to be detected, and check the detection results on the mobile phone.

[0012] The present invention has the following beneficial effects.

[0013] Compared with the existing methods, the present invention introduces deep separable convolution, which greatly reduces model parameters and improves the operation speed. The Coordinate Attention mechanism can capture cross-channel information, as well as information about direction perception and position perception, which can effectively improve the detection effect. The RFB-s module is used to simulate the characteristics of the human visual receptive field. The RFB-s structure is used to optimize the feature fusion method to improve the multi-scale fusion effect. The upsampling operator CARAFE is used to improve the detection accuracy while ensuring lightweight and a small number of parameters.

[0014] The present invention is trained offline on the computer side, and the trained model is deployed to the mobile phone side, and the mobile phone is used for offline reasoning to ensure the security of agricultural data. At the same time, it can be normally applied in network-restricted areas, thereby enhancing the scope of application of the present invention and improving the practical value of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a flow chart of a corn disease detection method based on deep learning proposed in the present invention.

[0016] Figure 2 This is the structure diagram of the improved YOLOv5 network model.

[0017] Figure 3 Schematic diagram of depth-wise separable convolution.

[0018] Figure 4 This is the schematic diagram of the Coordinate attention mechanism.

[0019] Figure 5 Deploy a detection instance for the mobile phone. DETAILED DESCRIPTION

[0020] In order to make the purpose, method and advantages of the present invention more clear, the present invention is further described below in conjunction with the accompanying drawings.

[0021] like Figure 1 As shown, the present invention proposes a mobile phone mobile terminal target detection method based on improved YOLOv5, which includes the following steps.

[0022] Step 1: Use cameras to collect image information of corn diseases (large leaf spot, gray leaf spot and rust) at different time periods and angles, and annotate the images.

[0023] Step 2: Enhance the offline data of disease images and divide them into training set, test set and validation set.

[0024] Step 3: Improve the YOLOv5 model structure according to actual requirements, such as Figure 2 As shown in the figure, the standard convolution is replaced by the depthwise separable convolution in the feature extraction layer of the YOLOv5 model, and the CoordinateAttention mechanism is added before obtaining the three backward-transferred feature maps. It can not only capture cross-channel information, but also capture direction-aware and position-aware information, which can help the model locate and identify the target of interest more accurately, and then perform splicing and other feature fusion to obtain the prediction head.

[0025] Step 4: Use the RFB-s structure to improve the feature fusion method of YOLOv5. The RFB-s module simulates the receptive field of human vision, so that the model can achieve better detection results. In addition, a new upsampling operator CARAFE is used in the head of the YOLOv5 model. Such an upsampling operation can be expressed as a dot product of the upsampling kernel at each position and the pixels in the corresponding neighborhood of the input feature map, which can be called feature recombination. The new operator can have a larger receptive field during recombination, and will guide the recombination process according to the input features. At the same time, the entire operator is relatively lightweight.

[0026] Step 5. Finally, input the divided data set into the improved network model in step 4, and set the initial parameters such as the number of iterations, learning rate, momentum factor, batch size, etc. Use the optimizer to adjust the network parameters, and retain the weight parameters when the training set number of iterations is completed or the loss image and precision image tend to be stable.

[0027] Step 6: Deploy the improved YOLOv5 model trained in step 5 as a whole to the mobile phone. Then use the corn disease images taken on the spot by the mobile phone or the collected disease images as the detection targets. Finally, perform recognition and detection on the images to be detected, and check the detection results on the mobile phone.

[0028] Furthermore, the step 2 is specifically as follows: removing the poorly presented images due to the influence of lighting, shooting technology, etc. in the collected images, and then using data enhancement including but not limited to inversion, exposure, noise, etc. to enrich the samples to improve the versatility of the model.

[0029] Furthermore, the step 2 is specifically as follows: selecting pictures from the enhanced diseased images as a training set, a verification set and a test set in the ratio of 80%, 10% and 10% respectively.

[0030] Furthermore, if Figure 3 As shown, step 3 is specifically a depth-separable convolution principle diagram. By replacing conventional convolution with two-step operations of channel-by-channel convolution and point-by-point convolution, the model parameters can be effectively reduced and the operation speed can be accelerated. The specific parameters are as follows.

[0031] The input feature map is H×W×C1, the convolution kernel is h1×w1×C1, and the output feature map is H'×W'×C2, without bias.

[0032] Standard convolution parameter quantity: (h1*w1*C1)*C2; operation quantity: (h1*w1*C1)*C2*(H'*W').

[0033] The number of depth-wise separable convolution parameters is (h1*w1*1)*C1+(1*1*C1)*C2. The number of operations is (h1*w1*1)*C1*(H'*W')+(1*1*C1)*C2*(H'*W').

[0034] It can be seen from the calculation formula that the depthwise separable convolution greatly reduces the number of model parameters and computation, which facilitates model training and mobile deployment. At the same time, a shortcut connection is designed for the depthwise separable convolution layer where the size of the feature map does not change before and after the convolution.

[0035] Furthermore, if Figure 4As shown in the figure, step 3 specifically adds Coordinate Attention after the C3 layer, performs average pooling on the input feature map in the X-axis and Y-axis directions, obtains two matrices C×1×H and C×W×1, and performs concat splicing after permute operation to obtain C×1×(H+W). The spliced ​​result is subjected to 1×1 convolution operation to obtain a mixed feature map in the XY direction. Next, the feature map is split after the BN layer and hseish nonlinear activation, and the permute operation is performed to obtain two feature maps C×1×H and C×W×1. C×1×H and C×W×1 are subjected to 1×1 convolution operation respectively to obtain weights in the XY directions. Then the sigmoid activation function is used to normalize the weight value, and finally the original matrix is ​​subjected to (C×W×H)*((C×1×H)*(C×W×1)) operation to obtain the final result.

[0036] Furthermore, the step 4 is specifically that the RFB-s structure can be divided into a multi-branch convolution structure and a shortcut branch. There are 4 branches in the convolution branch. The input feature map is first subjected to a 1×1 convolution operation in each branch. The difference is that the 2nd, 3rd, and 4th branches are also subjected to 3×1, 1×3, and 3×3 convolution operations respectively. After that, each branch is subjected to a dilated convolution operation, with a convolution kernel size of 3×3 and a dilation rate of 1, 3, 3, and 5. Finally, the results of the convolution operation are spliced, fused with a 1×1 convolution, and then superimposed with the shortcut branch to obtain the output feature map.

[0037] Furthermore, the step 4 is specifically that the upsampling operator CARAFE can be divided into two modules: an upsampling kernel prediction module and a feature reorganization module. First, the feature map H×W×C is input and then a 1×1 convolution is performed to reduce the number of channels and the amount of computation to obtain H×W×C. m Feature map. The input feature map compressed in the first step is convolved with a preset upsampling kernel 5×5 to predict the upsampling kernel. The number of input channels is C m , the number of output channels is 100, and then the channel dimension is expanded in the spatial dimension to obtain an upsampling kernel with a shape of 2H×2W×25. Finally, the obtained upsampling kernel is normalized using softmax so that the sum of the convolution kernel weights is 1. The second step is to map each position in the output feature map back to the input feature map, take out the 5×5 area centered on it, and do a dot product with the predicted upsampling kernel of the point to obtain the output value. Different channels at the same position share the same upsampling kernel.

[0038] The environment used in this experiment is: CPU is R7-5800H, 8 cores and 16 threads, turbo frequency 4.4GHz, GPU is NVIDIA GeForce RTX2060, 6G video memory. In the windos10 system environment, cuda10.1, python3.7, anaconda and pycharm software are used to build the pytorch environment.

[0039] Comparison of model test data before and after improvement. P(%) r(%) mAP(%) size(MB) speed(ms) YOLOv5 89.9 77.3 84.5 14.5 0.011 YOLO_ours 92.8 81.2 90.3 11.8 0.009

[0040] p is precision, r is recall rate, mAP represents the mean average precision, and size is the model size. It can be seen that the improved YOLOv5 network model of this application has great advantages in real-time target recognition on mobile devices. It can improve the recognition effect and accuracy of diseased targets while slightly reducing the model size and detection time. In the case of limited algorithm reasoning on the mobile terminal, YOLO_ours can also realize real-time recognition and detection of multi-scale targets on the mobile phone. Deploy the trained YOLO_ours network model to the mobile phone, and use the rear camera of the mobile phone to capture pictures and output the results as shown below. Figure 5 shown.

[0041] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for detecting corn diseases on a mobile phone based on deep learning, characterized in that: The method specifically comprises the following steps: Step 1: Use cameras to collect image information of corn diseases (large leaf spot, gray leaf spot and rust) at different times and angles, and annotate the images; Step 2: Enhance the offline data of the diseased images annotated in step 1, and then divide them into a training set, a test set, and a validation set; Step 3: In the feature extraction layer of the YOLOv5 model, the standard convolution is replaced by the depthwise separable convolution. The coordinate attention mechanism (CA) is added before the three feature maps passed backward, and then the prediction head is obtained by splicing and other feature fusion. Step 4: RFB-s is used to perform feature fusion after the last layer of the YOLOv5 backbone network. There are four dilated convolutional layers with expansion rates set to 1, 3, 3, and 5 respectively. In addition, a new upsampling operator CARAFE is used at the head of the yoloV5 model. Step 5: Input the divided data set into the improved network model in step 4, set the initial parameters such as the number of iterations, learning rate, momentum factor, batch sample size, etc., use the optimizer to adjust the network parameters, and retain the weight parameters when the training set number of iterations is completed or the loss image and precision image tend to be stable; Step 6: Deploy the improved YOLOv5 trained in step 5 as a whole to the mobile phone. Use the corn disease images taken on the spot by the mobile phone or the disease images stored in the mobile phone as test images. Then, perform recognition and detection on the images to be detected, and check the detection results on the mobile phone.

2. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: In step 2, remove the images that are poorly presented due to lighting and shooting technology, and then use data enhancement including inversion, exposure, noise and other methods to enrich the samples.

3. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: Depthwise separable convolution replaces conventional convolution and decouples standard convolution in two ways: depthwise convolution and pointwise convolution.

4. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: A coordinate attention mechanism is added after information fusion operations such as pointwise and concat to capture cross-channel information, direction perception, and position perception information.

5. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: RFB-s is used for feature fusion after the last layer of the yoloV5 backbone network. There are 4 convolution branches to enhance multi-scale feature fusion, 4 dilated convolution layers, and the expansion rates are set to 1, 3, 3, and 5 respectively.

6. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: The new upsampling operator CARAFE is used in the head of the yoloV5 model, and its kernel prediction module and content-aware reconstruction module are used to improve the sampling information.

7. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 2, characterized in that: After optimizing the corn disease dataset, it was divided into training set, validation set and test set in a ratio of 8:1:

1.

8. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: In step 3, set the number of iterations of the improved yoloV5 to 600 epochs.

9. A method for detecting corn diseases on a mobile phone based on deep learning as claimed in claim 1, characterized in that: Use a data cable to deploy from the computer to the smartphone via the USB3.0 interface.

Citation Information

Patent Citations

  • Coal gangue target detection method based on improved YOLOv5 algorithm

    CN114120093A

  • Aircraft multi-target tracking method based on improved YOLOV5 algorithm

    CN114529799A

  • Litchi disease and insect pest detection method based on improved EfficentDet

    CN114898359A

  • Lightweight wheat scab detection method based on YOLOv4

    CN114972208A

  • Crop disease and pest identification method based on improved YOLOX-S network

    CN115063602A

Cited By

  • Breaker switch intelligent detection method and system based on deep learning, medium and equipment

    CN120932036A