Detection Method and Related Device for Tea Diseases

Through deep learning models and drone remote sensing technology, combined with data enhancement and attention modules, efficient and accurate detection of tea diseases is achieved, and the problems of time-consuming, labor-intensive and missed detection of traditional methods are solved, and the detection accuracy and intelligence are improved.

CN115294467BActive Publication Date: 2025-07-25ANHUI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210868307.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-07-25
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

Traditional tea disease detection methods are time-consuming and labor-intensive and prone to missed detection and missed detection. The existing technology model has low accuracy and is difficult to accurately identify tea diseases in complex backgrounds.

Method used

The deep learning model is used to combine data augmentation and drone remote sensing technology to obtain and process tea images, and use BackBone, Neck and Head units and two-dimensional hybrid attention modules to achieve high-precision detection of tea diseases.

Benefits of technology

It improves the accuracy and efficiency of tea disease detection, can intelligently and globally follow up on the disease cycle, degree and location of tea, support targeted treatment, and reduce manual collection costs and safety risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115294467B_ABST
    Figure CN115294467B_ABST
Patent Text Reader

Abstract

The present application provides a method and related device for detecting tea diseases, which are used to detect tea. The method includes: inputting an image of the tea to be tested into a tea disease detection model to obtain a disease detection result of the image of the tea to be tested. Among them, the deep learning model used to train the tea disease detection model includes a BackBone unit, a Neck unit, and a Head unit. An RFB module is added to the BackBone unit, and a two-dimensional hybrid attention module is added to the Neck unit. The two-dimensional hybrid attention module is divided into two parallel upper and lower branches, and it is composed of a channel attention sub-module, a spatial attention sub-module in the upper branch, and a coordinate attention sub-module in the lower branch. In addition, remote sensing data obtained by using an unmanned aerial vehicle for shooting is used for super-resolution reconstruction to produce a training set. Units and modules with higher average precision and faster detection speed are used in the tea disease detection model to locate the positions of tea diseases that need attention, and to solve the problems of time-consuming, laborious, missed detection, and false detection in traditional detection methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical fields of remote sensing, image detection, plant disease detection, and deep learning, and particularly to a method for detecting tea diseases and related devices. Background Art

[0002] Tea plants are prone to disease infections during the growth process. These diseases seriously affect the quality and yield of tea. Real-time and accurate monitoring of tea diseases is beneficial to the precise prevention and control of diseases and increases the income of tea farmers. At present, the detection of tea diseases mainly relies on manual identification. However, many tea gardens are located in mountainous areas that are inaccessible to people. Manual identification is time-consuming, laborious, and requires a large amount of expensive economic costs. With the development of computer technology, the detection of tea diseases has been transformed from manual identification to automatic image recognition. The method of using computer vision for image recognition is popular because of its efficiency and accuracy. However, in tea leaf images with natural backgrounds, the background colors, textures, etc. of tea disease areas and tea planting areas are highly similar, which leads to false detection of tea diseases.

[0003] Patent CN112801991B discloses a method for detecting bacterial blight of rice based on image segmentation. The method includes: obtaining a rice leaf image, and obtaining a superpixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm, where the superpixel image includes a plurality of superpixels, and each superpixel is generated based on a plurality of pixel points in the rice leaf image; then, according to the superpixel image and a preset lesion extraction algorithm, extracting suspected lesions in the superpixel image, and inputting the features of the suspected lesions in the superpixel image into a trained detection model for bacterial blight of rice to obtain the detection result of bacterial blight of rice leaves. The detection accuracy of this application is relatively low due to model limitations.

[0004] Based on this, this application provides a method for detecting tea diseases and related devices to solve the deficiencies of the prior art. Summary of the Invention

[0005] The purpose of this application is to provide a method for detecting tea diseases for detecting tea, so as to solve the problems of time-consuming, laborious, missed detection, and false detection of traditional detection methods.

[0006] The purpose of this application is achieved by adopting the following technical solutions:

[0007] In a first aspect, this application provides a method for detecting tea diseases for detecting tea. The method includes:

[0008] Input the tea leaf image to be tested into the tea leaf disease detection model to obtain the disease detection result of the tea leaf image to be tested, and the disease detection result of the tea leaf image to be tested is used to indicate whether at least one leaf corresponding to the tea leaf image to be tested has the target disease;

[0009] Among them, the training process of the tea leaf disease detection model includes:

[0010] Obtain a training set, the training set includes a plurality of training data, each training data includes a sample tea leaf image and the annotation data of the disease detection result of the sample tea leaf image, and the disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease;

[0011] For each training data in the training set, perform the following processing:

[0012] Input the sample tea leaf image in the training data into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea leaf image;

[0013] Update the model parameters of the deep learning model based on the prediction data and annotation data of the disease detection result of the sample tea leaf image;

[0014] Detect whether the preset training end condition is satisfied; if so, use the trained deep learning model as the tea leaf disease detection model; if not, continue to train the deep learning model with the next training data.

[0015] The beneficial effects of this technical solution are as follows: The steps of detecting the tea leaf image to be measured by the tea leaf disease detection model can be to input the tea leaf image to be measured into the tea leaf disease detection model to obtain the corresponding detection result. Among them, the training process can include: First, obtain a training set, where the training set includes multiple training data, and the disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease. It can intuitively and efficiently display whether at least one leaf corresponding to the sample tea leaf image has the target disease, and has a high degree of intelligence. The sample tea leaf image in the training data can be input into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea leaf image. Obtain the tea leaf disease detection model through training and conduct detection. This method is based on computer vision technology and uses a deep learning model, which can better fit the data and the actual situation. The deep learning model has a powerful fitting ability and can approximate complex functions, reaching an infinite dimension, further improving the test accuracy. The method overcomes the defects of manually extracting tea leaf image features, and the recognition accuracy is significantly improved. Its combination with agricultural information perception expands a new research perspective for tea leaf disease detection. The tea leaf disease detection model can also be used to recheck the tea leaf to be measured, and the tea leaf disease detection model can be updated and adjusted, which is beneficial to comprehensively follow up the disease cycle, disease degree and disease location of the tea leaf. It helps to formulate a detailed treatment plan according to the detection results of the tea leaf disease detection model for different disease conditions at different positions of the tea tree.

[0016] In some alternative embodiments, the obtaining of the training set includes:

[0017] Perform data augmentation processing on the sample tea leaf image to obtain at least one enhanced image corresponding to the sample tea leaf image;

[0018] Use the sample tea leaf image and its enhanced image to produce the training set.

[0019] The beneficial effects of this technical solution are as follows: By performing data augmentation on the sample tea leaf images and using computer vision methods, more image data can be generated from limited image data, increasing the quantity and diversity of training samples and enhancing the robustness and generalization ability of the tea leaf disease detection model. Data augmentation is an important branch of digital image processing. Given the situation where the visual effects of image capture are poor due to the influence of scene conditions, performing data augmentation on the images can improve the visual effects expressed by the images. For example, highlighting certain features of the target object in the image, extracting the feature parameters of the target object from digital images, etc., are all beneficial for the recognition, tracking, and understanding of the target in the image. The main content of data augmentation is to highlight the parts of the image that are of interest and weaken or remove the information that is not needed or unimportant, so that the useful information is strengthened, thereby obtaining a more practical image or converting it into an image that is more suitable for analysis and processing by humans or machines. This can achieve reducing image degradation phenomena caused by uneven light, color distortion, etc., and enhancing the information expression effect of color images. If data augmentation is not used to process the tea leaf images, there will be a poor detection effect due to problems such as low pixel values, color distortion, and insufficient number of images in the collected images. The operations of performing data augmentation on the images can also include expanding the images. For example, it can be flipping, translating, rotating, mirroring, Mosaic (i.e., mosaic) operations, etc. on the images. Data augmentation is the general term for methods of expanding data. Data augmentation can increase the samples in the training set, effectively alleviate the situation of model overfitting, and also bring stronger generalization ability to the model, making the training data as close as possible to the test data, thereby improving the prediction accuracy. It can also enable the network to learn more robust features. Data augmentation can highlight certain features of the target object in the image, extract the feature parameters of the target object from digital images, etc., which are all beneficial for the recognition, tracking, and understanding of the target in the image. The main content of data augmentation is to highlight the parts of the image that are of interest and weaken or remove the unnecessary information. In this way, the useful information is strengthened, thereby obtaining a more practical image or converting it into an image that is more suitable for machine analysis and processing. Randomly scaling the pictures and then splicing them in a randomly distributed manner enriches the image dataset, makes the network more robust, and can reduce the loss of the GPU.

[0020] In some alternative embodiments, the process of obtaining the sample tea leaf images includes:

[0021] Using remote sensing equipment mounted on a drone to collect images of tea trees in the tea planting area to obtain a plurality of the sample tea leaf images.

[0022] The beneficial effects of this technical solution are as follows: Using drones equipped with advanced optical sensors to obtain remote sensing images can adapt to different terrains and weather conditions, saving a large amount of economic costs. By using the remote sensing equipment loaded on the drones to collect images, the drones can be used as an aerial platform, and information can be obtained by remote sensing sensors (i.e., remote sensing equipment), and the image information can be processed by a computer and made into images according to certain accuracy requirements. Among them, remote sensing sensors use corresponding airborne remote sensing equipment according to different types of remote sensing tasks, such as high-resolution CCD digital cameras, lightweight optical cameras, multi-spectral imagers, infrared scanners, laser scanners, magnetometers, synthetic aperture radars, etc. The remote sensing sensors should have the characteristics of digitization, small size, light weight, high precision, large storage capacity, and excellent performance. Using the remote sensing equipment loaded on the drones to collect images, that is, the unmanned aerial vehicle remote sensing (UAVRS) technology as an aerial remote sensing means has the advantages of long endurance time, real-time image transmission, detection in high-risk areas, low cost, high resolution, flexibility, etc. For example, it can use airborne remote sensing equipment to obtain remote sensing images, use airborne and ground control systems to achieve automatic shooting and acquisition of images, and at the same time realize functions such as flight path planning and monitoring, compression and automatic transmission of information data, and image preprocessing. It can be widely applied to national ecological environment protection, mineral resource exploration, marine environment monitoring, land use survey, water resource development, crop growth monitoring and yield estimation, agricultural operations, natural disaster monitoring and assessment, urban planning and municipal management, forest pest prevention and monitoring, public safety, national defense, digital earth and other fields. In this application, using the remote sensing equipment loaded on the drones to collect images can save a large amount of labor costs and reduce the safety hazards existing in manual data collection, and has the effect of comprehensively, efficiently and high-quality collecting images.

[0023] In some alternative embodiments, the performing data augmentation processing on the sample tea leaf images includes:

[0024] Cropping the sample tea leaf images based on a preset size to obtain standardized images;

[0025] Performing super-resolution reconstruction on the standardized images using a super-resolution network to obtain super-resolution images;

[0026] Performing data augmentation on the super-resolution images to obtain at least one of the augmented images.

[0027] The beneficial effects of this technical solution are as follows: The sample tea leaf image can be cropped based on a preset size, so as to obtain an image that meets the preset specifications, which can better fit the image parameters required by the model and enable the model to be successfully trained. Super-resolution reconstruction refers to a technology that analyzes digital image signals and uses software algorithms to reconstruct one or more frames of images into higher-resolution images or videos. Its advantage is that it can reconstruct the corresponding high-resolution image from the observed low-resolution image, thereby reducing the adverse effects of imaging environment, imaging distance, sensor shape and size, optical system errors, air disturbance, object movement, and lens defocus on the image. In this application, a more clear image can be reconstructed using a learning-based super-resolution algorithm to solve the problem of insufficient resolution of UAV remote sensing images. Tea trees are important cash crops, and their main value lies in the tea tree leaves. Compared with the leaves of poplar trees, phoenix trees, banana trees, and Chinese redbud trees, the leaves of tea trees are smaller, and it is more difficult to detect them, and the accuracy of the required images is relatively high. For tea leaf disease detection, it is not only necessary to be able to locate each tea leaf, but also to locate the position of the disease on the leaf where it is located. Based on the above factors, it is indispensable to perform data augmentation on the collected tea leaf images. The augmented image obtained through data augmentation can also be used as a comparison image for re-inspection, which can more intuitively show the differences or similarities between the tea leaf image during re-inspection and this augmented image, so as to judge whether the position and condition of the tea leaf disease have changed.

[0028] In some alternative embodiments, the deep learning model includes a BackBone unit, a Neck unit, and a Head unit. An RFB module is added to the BackBone unit, and an attention module is added to the Neck unit;

[0029] The step of inputting the sample tea leaf image in the training data into a preset deep learning model to obtain prediction data of the disease detection result of the sample tea leaf image includes:

[0030] Using the BackBone unit to extract feature information from the sample tea leaf image, the feature information includes: the low-level spatial features and high-level semantic features corresponding to the sample tea leaf image; wherein, the RFB module is used for the extraction process of part of the low-level spatial features and part of the high-level semantic features;

[0031] Using the BackBone unit to input the low-level spatial features and the high-level semantic features into the Neck unit of the target detection network;

[0032] Using the Neck unit to perform feature fusion on the low-level spatial features and the high-level semantic features to obtain a feature fusion result;

[0033] Obtain multiple feature maps corresponding to the feature fusion result by using the attention module;

[0034] For each of the feature maps, generate a corresponding detection box by using the Head unit to obtain prediction data of the disease detection result of the sample tea leaf image.

[0035] The beneficial effects of this technical solution are as follows: In this application, a multi-scale RFB module can be added to the BackBone unit, which can improve the ability to extract detailed features of tea leaves and reduce the problem of missed detection caused by small leaves. Among them, an attention module is added to the Neck unit to reduce the problems of missed detection and misdetection caused by dense leaf distribution. Tea trees are important economic crops, and their main value lies in the leaves of tea trees. Tea trees are shrubs or small trees of the Theaceae family and the Camellia genus, with hairless young branches. The leaves are leathery, oblong or elliptical, 4-12 cm long and 2-5 cm wide, with blunt or sharp tips, wedge-shaped bases, shiny on the upper surface, hairless or with pilose at the beginning on the lower surface, 5-7 pairs of lateral veins, serrated edges, and petioles 3-8 mm long, hairless. Compared with other economic crops such as wheat, rice, corn, sorghum, sugar beet, beans, tubers, and hulless barley, the leaves of tea trees are more dense. Therefore, units and modules with higher average precision and faster detection speed should be used in the tea leaf disease detection model. And an attention module based on the human visual attention mechanism is added, which can more specifically obtain the connection between the global and the local, find key information, and directly locate the position of the tea leaf disease that needs attention.

[0036] In some alternative embodiments, the annotation data is used to indicate the position information of the diseased leaf in the sample tea leaf image, the disease type corresponding to the sample tea leaf image, and the confidence level corresponding to the tea leaf image;

[0037] Updating the model parameters of the deep learning model based on the prediction data and the annotation data of the disease detection result of the sample tea leaf image includes:

[0038] Based on the prediction data and the annotation data of the disease detection result of the sample tea leaf image, obtain the loss value corresponding to the sample tea leaf image;

[0039] Using the loss value, obtain the feature weight information of the multiple feature maps by using the stochastic gradient descent method;

[0040] Update the model parameters of the deep learning model based on the feature weight information of the multiple feature maps.

[0041] The beneficial effects of this technical solution are as follows: Based on the prediction data and annotation data of the disease detection results of the sample tea leaf images, obtain the loss value corresponding to the sample tea leaf images; use the stochastic gradient descent method to obtain the feature weight information of multiple said feature maps; based on the feature weight information of multiple said feature maps, update the model parameters of the deep learning model, which can make the model approximate the real situation and have a better fitting degree. Among them, the loss function can be used to measure the quality of the model prediction and can be used to represent the degree of difference between the prediction and the actual data. Generally speaking, the better the loss function, the better the performance of the model.

[0042] In some alternative embodiments, the process of obtaining the model parameters includes:

[0043] The process of obtaining the model parameters includes:

[0044] Use an interactive device to receive a numerical setting operation, and in response to the numerical setting operation, determine the parameter values of at least one of the model parameters.

[0045] The beneficial effects of this technical solution are as follows: Using an interactive device to receive a parameter setting operation, according to preset model parameters, such as the initial learning rate parameter, training batch parameter, total number of iteration rounds parameter, etc. of the model, use an interactive device (such as a mouse, keyboard, etc.) to receive the setting operation and set the model parameters in the model. According to the different complexities of the model, the number of parameters to be adjusted is also different. Model parameters are configuration variables inside the model, and their values can be estimated based on data. By receiving and setting model parameters, the performance of model training can be improved and the model can be further optimized.

[0046] In some alternative embodiments, the attention module is a two-dimensional hybrid attention module;

[0047] The two-dimensional hybrid attention module is divided into two parallel branches, the upper branch includes a channel attention sub-module and a spatial attention sub-module, and the lower branch includes a coordinate attention sub-module.

[0048] The beneficial effects of this technical solution are as follows: The channel attention sub-module is similar to applying a weight to the feature map on each channel to represent the relevance of the channel to the key information. The greater this weight, the higher the relevance. In a neural network, the higher the dimensionality of the feature map, the smaller its size and the more channels it has, and the channels represent the feature information of the entire image. The channel attention sub-module often has a good effect when processing image feature information. The spatial attention sub-module can be used to enable the model to adaptively learn the feature representation with character position information during sequential feature extraction, making the model pay more attention to the specified area in the image and obtaining spatial features with two-dimensional spatial position information. The coordinate attention sub-module can decompose the channel attention into two parallel one-dimensional feature encodings to efficiently integrate spatial coordinate information into the generated attention feature map. The coordinate attention sub-module can capture cross-channel information and also contains direction-aware and position-sensitive information, which enables the deep learning model to more accurately locate and identify the target area. Compared with the convolutional attention module (i.e., CBAM, Convolutional Block Attention Module), the two-dimensional hybrid attention module also adds a coordinate attention sub-module, which can better extract features focusing on the characteristics of tea leaves, achieving multi-faceted, high-precision, and comprehensive and efficient extraction of information from tea leaf images, bringing a qualitative improvement to the performance of the deep learning model.

[0049] Second, the present application provides a tea disease detection device for detecting tea. The device includes:

[0050] A disease detection module for inputting a tea leaf image to be measured into a tea disease detection model to obtain a disease detection result of the tea leaf image to be measured, and the disease detection result of the tea leaf image to be measured is used to indicate whether at least one leaf corresponding to the tea leaf image to be measured has a target disease;

[0051] Wherein, the training process of the tea disease detection model includes:

[0052] Obtaining a training set, the training set includes a plurality of training data, each training data includes a sample tea leaf image and annotation data of the disease detection result of the sample tea leaf image, and the disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease;

[0053] For each training data in the training set, perform the following processing:

[0054] Input the sample tea leaf images in the training data into a preset deep learning model to obtain prediction data of the disease detection results of the sample tea leaf images;

[0055] Update the model parameters of the deep learning model based on the prediction data and the annotation data of the disease detection results of the sample tea leaf images;

[0056] Detect whether the preset training end condition is met; if so, use the trained deep learning model as the tea leaf disease detection model; if not, continue to train the deep learning model with the next piece of training data.

[0057] In some alternative embodiments, the obtaining of the training set includes:

[0058] Perform data augmentation processing on the sample tea leaf images to obtain at least one enhanced image corresponding to the sample tea leaf images;

[0059] Use the sample tea leaf images and their enhanced images to produce the training set.

[0060] In some alternative embodiments, the process of obtaining the sample tea leaf images includes:

[0061] Use a remote sensing device mounted on a drone to collect images of tea trees in a tea plantation area to obtain a plurality of the sample tea leaf images.

[0062] In some alternative embodiments, the performing of data augmentation processing on the sample tea leaf images includes:

[0063] Crop the sample tea leaf images based on a preset size to obtain standardized images;

[0064] Use a super-resolution network to perform super-resolution reconstruction on the standardized images to obtain super-resolution images;

[0065] Perform data augmentation on the super-resolution images to obtain at least one of the enhanced images.

[0066] In some alternative embodiments, the deep learning model includes a BackBone unit, a Neck unit, and a Head unit. An RFB module is added to the BackBone unit, and an attention module is added to the Neck unit;

[0067] The inputting of the sample tea leaf images in the training data into a preset deep learning model to obtain prediction data of the disease detection results of the sample tea leaf images includes:

[0068] Use the BackBone unit to extract features from the sample tea leaf image to obtain feature information, where the feature information includes: low-level spatial features and high-level semantic features corresponding to the sample tea leaf image; among them, the RFB module is used in the extraction process of some low-level spatial features and some high-level semantic features;

[0069] Use the BackBone unit to input the low-level spatial features and the high-level semantic features to the Neck unit of the target detection network;

[0070] Use the Neck unit to perform feature fusion on the low-level spatial features and the high-level semantic features to obtain a feature fusion result;

[0071] Use the attention module to obtain multiple feature maps corresponding to the feature fusion result;

[0072] For each of the feature maps, use the Head unit to generate a corresponding detection box to obtain prediction data of the disease detection result of the sample tea leaf image.

[0073] In some alternative embodiments, the annotation data is used to indicate the position information of the diseased leaves in the sample tea leaf image, the disease type corresponding to the sample tea leaf image, and the confidence level corresponding to the tea leaf image;

[0074] Updating the model parameters of the deep learning model based on the prediction data and the annotation data of the disease detection result of the sample tea leaf image includes:

[0075] Based on the prediction data and the annotation data of the disease detection result of the sample tea leaf image, obtain the loss value corresponding to the sample tea leaf image;

[0076] Using the loss value, obtain the feature weight information of the multiple feature maps by means of stochastic gradient descent;

[0077] Based on the feature weight information of the multiple feature maps, update the model parameters of the deep learning model.

[0078] In some alternative embodiments, the process of obtaining the model parameters includes:

[0079] Use an interactive device to receive a numerical setting operation, and in response to the numerical setting operation, determine the parameter values of at least one of the model parameters.

[0080] In some alternative embodiments, the attention module is a two-dimensional hybrid attention module;

[0081] The two-dimensional hybrid attention module is divided into upper and lower parallel branches. The upper branch includes a channel attention sub-module and a spatial attention sub-module, and the lower branch includes a coordinate attention sub-module.

[0082] In a third aspect, the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of any one of the above methods are implemented.

[0083] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] The present application will be further described below in conjunction with the drawings and embodiments.

[0085] Figure 1 A flowchart showing a method for detecting tea diseases provided by the present application is shown.

[0086] Figure 2 A flowchart showing a method for obtaining a training set provided by the present application is shown.

[0087] Figure 3 A flowchart showing a method for performing data augmentation processing on a sample tea image provided by the present application is shown.

[0088] Figure 4 A structural schematic diagram of a tea disease detection device provided by the present application is shown.

[0089] Figure 5 A structural block diagram of an electronic device provided by the present application is shown.

[0090] Figure 6 A structural schematic diagram of a program product provided by the present application is shown.

[0091] Figure 7 A structural schematic diagram of a tea disease detection model provided by the present application is shown.

[0092] Figure 8 A structural schematic diagram of a two-dimensional attention hybrid module provided by the present application is shown. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0093] The technical solutions in the present application will be described below in conjunction with the specification drawings and specific embodiments of the present application. It should be noted that, on the premise of no conflict, any combination of the following-described embodiments or technical features can form a new embodiment.

[0094] In this application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the relationship between associated objects and indicates that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, or B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, a and b and c, where a, b, and c can be single or multiple. It should be noted that "at least one" can also be interpreted as "one or more".

[0095] It should also be noted that in this application, words such as "exemplary" or "for example" are used to give examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or having more advantages than other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0096] Next, in combination with the accompanying drawings and specific embodiments, the present application will be further described. It should be noted that on the premise of non-conflict, the following-described embodiments or technical features can be combined arbitrarily to form new embodiments.

[0097] Method Embodiment

[0098] See Figure 1 , Figure 1 which shows a schematic flowchart of a method for detecting tea leaf diseases provided by the present application.

[0099] The method for detecting tea leaf diseases is used to detect tea leaves, and the method includes:

[0100] Step S101: Input the tea leaf image to be measured into the tea leaf disease detection model to obtain the disease detection result of the tea leaf image to be measured, and the disease detection result of the tea leaf image to be measured is used to indicate whether at least one leaf corresponding to the tea leaf image to be measured suffers from a target disease;

[0101] Among them, the training process of the tea leaf disease detection model includes:

[0102] Obtain a training set, where the training set includes a plurality of training data, and each piece of training data includes a sample tea leaf image and annotation data of the disease detection result of the sample tea leaf image. The disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease;

[0103] For each piece of training data in the training set, perform the following processing:

[0104] Input the sample tea leaf image in the training data into a preset deep learning model to obtain prediction data of the disease detection result of the sample tea leaf image;

[0105] Update the model parameters of the deep learning model based on the prediction data and annotation data of the disease detection result of the sample tea leaf image;

[0106] Detect whether a preset training end condition is satisfied; if so, use the trained deep learning model as the tea leaf disease detection model; if not, continue to train the deep learning model with the next piece of training data.

[0107] Thus, the steps of detecting a tea leaf image to be measured through the tea leaf disease detection model can be to input the tea leaf image to be measured into the tea leaf disease detection model to obtain a corresponding detection result. Among them, the training process can include: first, obtain a training set, where the training set includes a plurality of training data, and the disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease. It can intuitively and efficiently show whether at least one leaf corresponding to the sample tea leaf image has the target disease, with a high degree of intelligence. The sample tea leaf image in the training data can be input into a preset deep learning model to obtain prediction data of the disease detection result of the sample tea leaf image. Obtain a tea leaf disease detection model through training and perform detection. This method is based on computer vision technology and uses a deep learning model, which can better fit the data and the actual situation. The deep learning model has a powerful fitting ability, can approximate complex functions, and reach an infinite dimension, further improving the test accuracy. The method overcomes the defects of manually extracting tea leaf image features, and the recognition accuracy is significantly improved. Its combination with agricultural information perception expands a new research perspective for tea leaf disease detection. The tea leaf disease detection model can also be used to re-inspect the tea leaves to be measured, and update and adjust the tea leaf disease detection model, which is beneficial to comprehensively follow up the disease cycle, disease degree, and disease location of the tea leaves. It helps to formulate a detailed treatment plan according to the detection results of the tea leaf disease detection model for different disease conditions at different positions of the tea tree.

[0108] In some alternative embodiments, treatment measures such as spraying pesticides and removing diseased leaves can be taken according to the detection results of the tea disease detection model. According to the detection results, the positions of the diseased leaves can be determined, so as to plan a navigation route, which is transmitted to the drone or the mobile terminal, and the diseased leaves are targeted for treatment by means of spraying pesticides by the drone or manually. According to the detection results, the degree of disease of the diseased leaves can be judged, and pesticides with different concentrations can be configured according to different degrees of disease, so as to suit the remedy to the case, save resources and protect the environment. The planned navigation route can also be used for re-inspection of tea diseases to verify the efficacy of pesticides and make adaptive adjustments according to the re-inspection results. For example, if the degree of disease of the diseased leaves weakens, the pesticide concentration can be reduced, the number of spraying times can be reduced or no further treatment is required; if the degree of disease of the diseased leaves does not change, the pesticide concentration can be increased, the number of spraying times can be increased or the next round of targeted treatment can be carried out.

[0109] The embodiments of the present application do not limit the target diseases. The target diseases refer to plant diseases and pests, such as tea zonate leaf blight, tea anthracnose, tea blister blight, tea black rot, tea red star disease, tea zonate spot, tea tarsonemid mite, tea aphid, etc.

[0110] The embodiments of the present application do not limit the number of leaves suffering from the target disease corresponding to each tea image to be measured, which can be, for example, 1, 2, 3, 4, 5, 10, 50, 100, 200, 500, 1000, 10000, 10000000, etc.

[0111] The embodiments of the present application do not limit the number of training data in the training set, which can be, for example, 200, 500, 1000, 10000, 10000000, etc.

[0112] The embodiments of the present application do not limit the format of the sample tea images, which can be, for example, BMP, JPG, PNG, JPEG, TIF, GIF, etc.

[0113] The embodiments of the present application do not limit the size of the sample tea images, which can be, for example, 10KB, 11KB, 15KB, 1MB, 7MB, etc.

[0114] The embodiments of the present application do not limit the acquisition method of the annotation data. For example, the manual annotation method can be adopted, or the automatic annotation or semi-automatic annotation method can be adopted.

[0115] The embodiments of the present application do not limit the annotation data, which can be, for example, one or more of Chinese characters, letters, numbers, symbols, shapes, and colors.

[0116] In some alternative embodiments, the method may further include: obtaining a validation set and a test set. The validation set is used to verify whether the sample tea leaves are diseased, and the test set is used to test whether the tea leaves to be tested are diseased.

[0117] See Figure 2 , Figure 2 which shows a schematic flowchart of obtaining a training set provided by the present application.

[0118] In some alternative embodiments, the obtaining of the training set may include:

[0119] Step S201: Performing data augmentation processing on the sample tea leaf image to obtain at least one enhanced image corresponding to the sample tea leaf image;

[0120] Step S202: Using the sample tea leaf image and its enhanced images to produce the training set.

[0121] Thus, by performing data augmentation processing on the sample tea leaf image and using the method of computer vision, more image data can be generated from limited image data, increasing the quantity and diversity of training samples and enhancing the robustness and generalization ability of the tea leaf disease detection model. Data augmentation processing is an important branch of digital image processing. In view of the situation where the visual effect of image capture is poor due to the influence of scene conditions, performing data augmentation on the image can improve the visual effect expressed by the image. For example, highlighting certain characteristics of the target object in the image, extracting the characteristic parameters of the target object from the digital image, etc., are all beneficial to the recognition, tracking, and understanding of the target in the image.

[0122] The main content of data augmentation processing is to highlight the interesting parts in the image, weaken or remove the unnecessary or unimportant information, strengthen the useful information, so as to obtain a more practical image or convert it into an image more suitable for human or machine analysis and processing, which can reduce the image degradation phenomenon caused by uneven light, color distortion, etc. and enhance the information expression effect of the color image. If data augmentation is not used to process the tea leaf image, the detection effect will be poor due to problems such as low pixel of the collected image, color distortion, and insufficient number of images.

[0123] The operation of data augmentation on the image may also include image amplification. For example, it may be flipping, translating, rotating, mirroring, Mosaic (i.e., mosaic) operations on the image, etc. Data augmentation is a general term for methods of expanding data. Data augmentation can increase the samples in the training set, effectively alleviate the situation of model overfitting, and also bring stronger generalization ability to the model, making the training data as close as possible to the test data, thereby improving the prediction accuracy. It can also enable the network to learn more robust features. Data augmentation can highlight certain characteristics of the target object in the image, extract the characteristic parameters of the target object from the digital image, etc., which are all beneficial to the recognition, tracking and understanding of the target in the image.

[0124] The main content of data augmentation processing is to highlight the interesting parts in the image and weaken or remove the unnecessary information. In this way, the useful information is strengthened, so as to obtain a more practical image or convert it into an image more suitable for machine analysis and processing. Randomly scaling the picture and then splicing it in a random distribution manner enriches the image dataset, makes the network more robust, and can reduce the loss of the GPU.

[0125] The embodiments of this application do not limit the way of data augmentation. For example, it can be supervised data augmentation such as geometric transformation (flipping, rotating, cropping, deforming, scaling), color transformation (noise, blur, color change, erasing, filling) and unsupervised data augmentation.

[0126] In some other optional embodiments, the process of obtaining the sample tea leaf image includes:

[0127] Using the remote sensing device loaded on the unmanned aerial vehicle to collect images of the tea trees in the tea planting area to obtain a plurality of the sample tea leaf images.

[0128] Thus, by using the remote sensing device loaded on the unmanned aerial vehicle to collect images, the unmanned aerial vehicle can be used as an aerial platform, the remote sensing sensor (i.e., the remote sensing device) can be used to obtain information, and the computer can process the image information and make it into an image according to certain accuracy requirements.

[0129] Among them, the remote sensing sensor uses corresponding airborne remote sensing devices according to different types of remote sensing tasks, such as high-resolution CCD digital cameras, lightweight optical cameras, multi-spectral imagers, infrared scanners, laser scanners, magnetometers, synthetic aperture radars, etc. The remote sensing sensor should have the characteristics of digitization, small volume, light weight, high precision, large storage capacity, excellent performance, etc.

[0130] Collecting images using remote sensing equipment mounted on an unmanned aerial vehicle, i.e., unmanned aerial vehicle remote sensing (UAVRS) technology as an aerial remote sensing means, has the advantages of long endurance time, real-time image transmission, detection in high-risk areas, low cost, high resolution, flexibility, etc. For example, it can use airborne remote sensing equipment to obtain remote sensing images, and use air and ground control systems to achieve automatic shooting and acquisition of images, while realizing functions such as flight path planning and monitoring, compression and automatic transmission of information data, and image preprocessing. It can be widely applied in fields such as national ecological environment protection, mineral resource exploration, marine environment monitoring, land use survey, water resource development, crop growth monitoring and yield estimation, agricultural operations, natural disaster monitoring and assessment, urban planning and municipal management, forest pest prevention and monitoring, public safety, national defense, digital earth, etc.

[0131] In this application, collecting images using remote sensing equipment mounted on an unmanned aerial vehicle can greatly save labor costs and reduce the potential safety hazards existing during manual data collection, and has the effect of comprehensively, efficiently, and high-quality collecting images.

[0132] The types of remote sensing equipment are not limited in the embodiments of this application. For example, it can be a high-resolution CCD digital camera, a lightweight optical camera, a multispectral imager, an infrared imager, etc.

[0133] See Figure 3 , Figure 3 shows a schematic flow chart of performing data enhancement processing on a sample tea leaf image provided by this application.

[0134] In some optional embodiments, the performing data enhancement processing on the sample tea leaf image includes:

[0135] Step S301: Crop the sample tea leaf image based on a preset size to obtain a specification image;

[0136] Step S302: Use a super-resolution network to perform super-resolution reconstruction on the specification image to obtain a super-resolution image;

[0137] Step S303: Perform data enhancement on the super-resolution image to obtain at least one of the enhanced images.

[0138] Thus, the sample tea leaf image can be cropped based on a preset size, thereby obtaining an image that meets the preset specifications, which can better fit the image parameters required by the model and enable the model to be successfully trained. Super-resolution reconstruction refers to the technology of reconstructing and converting one or more frames of images into higher-resolution images or videos by analyzing digital image signals using software algorithms.

[0139] Its advantage is that it can reconstruct the corresponding high-resolution image from the observed low-resolution image, thereby reducing the adverse effects of the imaging environment, imaging distance, sensor shape and size, optical system error, air disturbance, object movement, and lens defocus on the image. In this application, a clearer image can be reconstructed using a learning-based super-resolution algorithm to solve the problem of insufficient resolution of UAV remote sensing images.

[0140] Tea trees are important economic crops, and their main value lies in the tea tree leaves. Compared with the leaves of poplar trees, phoenix trees, banana trees, and Chinese redbud trees, the leaves of tea trees are smaller, making it more difficult to detect them, and the accuracy of the required images is relatively higher. For tea leaf disease detection, not only each tea leaf needs to be located, but also the position of the disease on the leaf where it is located needs to be determined. Based on the above factors, data augmentation of the collected tea leaf images is essential. The enhanced images obtained through data augmentation can also be used as comparison images for re-inspection, which can more intuitively show the differences or similarities between the tea leaf images during re-inspection and this enhanced image, thereby determining whether the position and condition of the tea leaf disease have changed.

[0141] Crop the tea leaf image. For example, opencv can be used to read the image, tensorflow can be used to crop the image, and finally matplotlib can be used to display the picture. First, the cropping size can be set, the image can be cropped according to the preset size, and the image can be converted from the BGR format set by opencv to the RGB format.

[0142] Use a super-resolution network to perform super-resolution reconstruction on the tea leaf image. For example, it can include the following steps:

[0143] (1) Perform a convolution operation on the image I with a resolution of H*W LR to extract the shallow feature F0 with a resolution of H*W:

[0144] F0 = H SF (I LR )

[0145] where H SF (·) represents the convolution operation.

[0146] (2) Use F0 for the extraction of deep features of the RIR module to obtain the deep feature F DF with a resolution size of H*W:

[0147] F DF = H RIR (F0)

[0148] where H RIR(·) represents a very deep RIR structure, which contains G residual groups (RG).

[0149] (3) Upsample F DF through an upsampling module to obtain the upsampled feature F with a resolution of 2H*2W UP ;

[0150] (4) The upsampled feature F UP is reconstructed into a super-resolution image I with a resolution of 2H*2W through a convolutional layer SR .

[0151] The method for optimizing the super-resolution network can be:

[0152] (1) To calculate the loss of the super-resolution algorithm, the L1 loss function can be used to calculate the error between I SR and I FR . The formula of the L1 loss function is as follows:

[0153]

[0154] where N represents the number of pixel points on an image, and x i ′ and x i respectively represent the pixel values at the relative positions on two images for which the error needs to be calculated;

[0155] (2) Optimize the super-resolution network according to the value of the loss L1 by stochastic gradient backpropagation;

[0156] Performing data augmentation on the super-resolution image can reduce the influence of uneven illumination on the brightness and contrast of tea pictures. For example, an adaptive correction algorithm for uneven illumination images based on a two-dimensional gamma function can be used. The illumination component of the scene is extracted using a multi-scale Gaussian surround function, and then a two-dimensional gamma function is constructed. The parameters of the two-dimensional gamma function are adjusted using the distribution characteristics of the illumination component to reduce the brightness value of the image in the over-illuminated area and increase the brightness value of the image in the under-illuminated area, ultimately achieving adaptive correction processing of uneven illumination images. The specific steps can be:

[0157] (1) Divide the super-resolution image I(x, y) into three channels: R, G, and B;

[0158] (2) Construct the Gaussian surround function G(x, y):

[0159]

[0160] Among them, σ is the scale parameter of the Gaussian surround. When σ is relatively small, it can better preserve the detailed information of the edges, and the dynamic range becomes larger, but the color cannot be maintained. When σ is relatively large, the color restoration effect is good, but the dynamic range becomes smaller, and the detailed information of the edges cannot be well preserved.

[0161] (3) Obtain the illumination component L(x, y) by convolving the Gaussian surround function with the enhanced image I(x, y);

[0162] L(x,y) = I(x,y) * G(x,y)

[0163] (4) Subtract the super-resolution image and the illumination component in the logarithmic domain to obtain the reflection component as the output result image r(x, y);

[0164]

[0165] The operation of data augmentation on the image may further include expanding the image. For example, it can be flipping, translating, rotating, mirroring, Mosaic (i.e., mosaic) operation, etc. on the image. In some alternative embodiments, the function flip() in OpenCV can be used to implement image flipping; by defining the translation matrix M and then calling the warpAffine() function to implement image translation; using the getRotationMatrix2D() function and the warpAffine() function to implement rotation around the center of the image, and using cv2.flip() to perform horizontal, vertical and other direction mirror exchanges on the image.

[0166] In some alternative embodiments, the operation of performing Mosaic processing on the image may be: first, read the data information of the picture, generate random coordinates to indicate the up, down, left and right directions, obtain the position parameters of the rectangular cropping area, set the width of the mosaic block, and cover the mosaic block with the vertex color, so that the resulting image contains mosaic blocks with different or the same degrees to blur the image. Mosaic processing can randomly scale the picture and then splice it in a random distribution manner, enriching the image dataset, making the network more robust, and reducing the loss of the GPU.

[0167] In some alternative implementation manners, the deep learning model includes a BackBone unit, a Neck unit and a Head unit. The RFB module is added to the BackBone unit, and the attention module is added to the Neck unit;

[0168] The step of inputting the sample tea leaf image in the training data into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea leaf image includes:

[0169] Use the BackBone unit to extract features from the sample tea leaf image to obtain feature information, where the feature information includes: the low-level spatial features and high-level semantic features corresponding to the sample tea leaf image; among them, the RFB module is used in the extraction process of partial low-level spatial features and partial high-level semantic features;

[0170] Use the BackBone unit to input the low-level spatial features and the high-level semantic features to the Neck unit of the target detection network;

[0171] Use the Neck unit to perform feature fusion on the low-level spatial features and the high-level semantic features to obtain a feature fusion result;

[0172] Use the attention module to obtain multiple feature maps corresponding to the feature fusion result;

[0173] For each of the feature maps, use the Head unit to generate a corresponding detection box to obtain the prediction data of the disease detection result of the sample tea leaf image.

[0174] Therefore, in this application, a multi-scale RFB module can be added to the BackBone unit, which can improve the ability to extract detailed features of tea leaves and reduce the missed detection problem caused by small leaves. Among them, an (independently designed) attention module is added to the Neck unit to reduce the missed detection and misdetection problems caused by dense leaf distribution. Tea trees are important economic crops, and their main value lies in the leaves of the tea trees. Tea trees are shrubs or small trees of the Theaceae family and the Camellia genus, with hairless young branches. The leaves are leathery, oblong or elliptical, 4-12 cm long and 2-5 cm wide, with blunt or sharp tips, wedge-shaped bases, shiny on the upper surface, hairless or with soft hairs at first on the lower surface, 5-7 pairs of lateral veins, serrated edges, and petioles 3-8 mm long, hairless. Compared with other economic crops such as wheat, rice, corn, sorghum, sugar beet, beans, tubers, and hulless barley, the leaves of tea trees are more dense. Therefore, units and modules with higher average precision and faster detection speed should be used in the tea leaf disease detection model. And an attention module based on the human visual attention mechanism is added, which can more specifically obtain the connection between the global and the local, find the key information, and directly locate the position of the tea leaf disease that needs attention.

[0175] In the embodiments of this application, the construction of the tea leaf disease detection model can be based on YOLO series networks such as YOLOv3 network, YOLOv4 network, YOLOv5 network, and YOLOX network.

[0176] In the embodiments of this application, the constructed tea leaf disease detection model can also be called: DDMA-YOLO. Among them, DDMA refers to the attention module in the embodiments of this application.

[0177] In the embodiments of the present application, constructing a tea disease detection model may include: As an example, a tea disease detection model can be constructed based on the YOLOv5 network. The tea disease detection model consists of three parts: a BackBone unit, a Neck unit, and a Head unit. Among them, the BackBone unit is used for feature extraction, the Neck unit is used for bidirectional fusion of low-level spatial features and high-level semantic features, and the Head unit generates detection boxes. By applying anchor boxes to the feature maps of three scales of the Neck unit, information such as detection categories, coordinates, and confidence levels is generated; the RFB module takes the features extracted by the backbone as input, divides them into three scales, and each scale first reduces the dimension of the input features through a 1×1 convolutional layer. Then, it passes through 1×1, 3×3, and 5×5 convolutional layers respectively. Next, feature maps with different receptive field sizes are generated from dilated convolutions with dilation rates of 1, 3, and 5, and feature fusion is performed through Concat and a 1×1 convolution. Finally, the output result is obtained using the shortcut in ResNet.

[0178] See Figure 7 and Figure 8 , Figure 7 FIG. shows a schematic structural diagram of a tea disease detection model provided by the present application. Figure 8 FIG. shows a schematic structural diagram of a two-dimensional attention hybrid module provided by the present application.

[0179] In the embodiments of the present application, an attention module is added to the Neck unit of the tea disease detection model. Among them, the attention module can be, for example, a two-dimensional hybrid attention module. The two-dimensional hybrid attention module is divided into two parallel branches: an upper branch and a lower branch. The upper branch consists of a channel attention sub-module and a spatial attention sub-module, and the lower branch consists of a coordinate attention sub-module. The channel attention sub-module of the upper branch performs 2D global pooling on the input feature map F respectively to obtain two groups of feature vectors, and then sends the two groups of feature vectors into a weight-sharing multi-layer perceptron (MLP) network with a hidden layer to generate a channel attention feature map W c (F):

[0180] W c (F) = σ{MLP[AvgPool(F)] + MLP[MaxPool(F)]}

[0181] Wherein, AvgPool and MaxPool represent average pooling and max pooling respectively, and σ represents the sigmoid activation function.

[0182] Next, the channel attention feature map W c (F) is subjected to 2D global pooling and splicing in the channel dimension to obtain a feature map with a size of h×w×2, and then a convolution kernel k 7×7Reduce the channel dimension to 1, and generate the spatial attention feature map W after bias S (F):

[0183] W S (F)=σ{k 7×7 [AvgPool(W c ); MaxPool(W c )]}

[0184] Among them, {*} represents the feature map after concatenated pooling

[0185] Finally, multiply the obtained spatial feature information by the input channel attention feature map to obtain the attention feature map W U (F) output by the upper branch

[0186] The coordinate attention sub-module of the lower branch generates two direction-aware vectors z X , z Y by using two 1D global poolings along the vertical and horizontal directions, and then aggregate the features of z X , z Y in two spatial directions to return a direction-aware attention map F':

[0187] z X =X AvgPool(F)

[0188] z Y =Y AvgPool(F)

[0189]

[0190] Among them, X AvgPool and Y AvgPool respectively represent average pooling along the horizontal and vertical axes of the feature map represents 1*1 convolution, BN, sigmoid operations

[0191] Then, separate F' into two direction-aware vectors z' X and z' Y , and after convolution and non-linear processing of z' X and z' Y and multiply them by the original feature map F, the attention feature map W D (F) output by the lower branch can be obtained

[0192] Finally, fuse and bias the attention feature maps obtained from the upper branch and the lower branch to obtain the feature map W(F) after processing by the two-dimensional hybrid attention module with weights

[0193] W(F)=0[W u (F)+W D (F)]

[0194] This application does not limit the training process of the deep learning model, which can adopt, for example, a supervised learning training method.

[0195] In the embodiments of this application, the attention module can be a two-dimensional hybrid attention module, which can include a channel attention sub-module, a coordinate attention sub-module, etc.

[0196] In some optional embodiments, the labeled data is used to indicate the position information of the diseased leaves in the sample tea leaf image, the disease type corresponding to the sample tea leaf image, and the confidence level corresponding to the tea leaf image;

[0197] Updating the model parameters of the deep learning model based on the prediction data and the labeled data of the disease detection result of the sample tea leaf image includes:

[0198] Based on the prediction data and the labeled data of the disease detection result of the sample tea leaf image, obtaining the loss value corresponding to the sample tea leaf image;

[0199] Using the loss value, obtaining the feature weight information of multiple feature maps by means of stochastic gradient descent;

[0200] Updating the model parameters of the deep learning model based on the feature weight information of multiple feature maps.

[0201] Thus, based on the prediction data and the labeled data of the disease detection result of the sample tea leaf image, obtaining the loss value corresponding to the sample tea leaf image; obtaining the feature weight information of multiple feature maps by means of stochastic gradient descent; updating the model parameters of the deep learning model based on the feature weight information of multiple feature maps can make the model approach the real situation and have a better fitting degree. Among them, the loss function can be used to measure the quality of the model prediction and can be used to represent the gap between the prediction and the actual data. Generally speaking, the better the loss function, the better the performance of the model.

[0202] Through design, by establishing an appropriate number of neuron computing nodes and a multi-layer operation hierarchy, and selecting appropriate input and output layers, a preset deep learning model can be obtained. Through the learning and optimization of this preset deep learning model, a functional relationship from input to output can be established. Although the functional relationship between input and output cannot be found 100%, it can approximate the real-world correlation relationship as much as possible. Thus, the disease detection model obtained by training can obtain the disease detection information of the tea leaf image based on the disease detection data of the tea leaf image, and the calculation results are highly accurate and reliable.

[0203] In a specific embodiment of the application, the training process of the deep learning model can be:

[0204] (1) Annotation operation: Use the annotation tool Labelimg to annotate the tea leaf images to obtain the position information of the diseased leaf spots;

[0205] (2) Set the hyperparameters for training: Set the initial learning rate to 0.01, each training batch to 8, and the total number of iteration rounds to 200;

[0206] (3) Input the annotated tea leaf images in (1) into the deep learning model for feature extraction, and obtain three different prediction data through the RFB module, two-dimensional hybrid attention module, and the Head unit of the deep learning model, including: predicted box coordinate information, category information, and confidence information;

[0207] (4) Calculate the loss: The category loss and confidence loss use the cross-entropy loss function, and the position loss uses CIOU loss. Calculate the differences L loc between the position and the true position, L cls between the category and the true category, and L cof between the confidence and the true confidence. Sum L loc , L cls and L cof to obtain the loss L D ;

[0208] (5) Optimize the deep learning model by gradient backpropagation: Calculate the gradient based on the value of the loss L D , and use the stochastic gradient descent algorithm to perform backpropagation on the gradient to update the weights, and finally obtain the weights W.

[0209] In some alternative embodiments, the process of obtaining the model parameters includes:

[0210] Receive a numerical setting operation using an interactive device, and in response to the numerical setting operation, determine the parameter values of at least one of the model parameters.

[0211] Thus, by receiving a parameter setting operation using an interactive device, according to the preset model parameters, such as the initial learning rate parameter, training batch parameter, total number of iteration rounds parameter, etc. of the model, use an interactive device (such as a mouse, keyboard, etc.) to receive the setting operation and set the model parameters in the model. Depending on the complexity of the model, the number of parameters to be adjusted is also different. Model parameters are configuration variables inside the model, and their values can be estimated based on data. By receiving and setting model parameters, the performance of model training can be improved and the model can be further optimized.

[0212] This application does not limit the preset training end condition, which can be, for example, that the number of training times reaches a preset number (the preset number can be, for example, 1 time, 3 times, 10 times, 100 times, 1000 times, 10000 times, etc.), or that all the training data in the training set have completed one or more trainings, or that the total loss value obtained from this training is not greater than the preset loss value.

[0213] This application does not limit the preset similarity threshold, which can be, for example, 81%, 83%, 92%, 95%, 99.9%, etc.

[0214] This application does not limit the type of the interaction device, which can be, for example, a mouse, a keyboard, a smart touchpad, a smart stylus, a mobile phone, a tablet computer, a smart wearable device, etc.

[0215] This application does not limit the manner of receiving various parameter setting operations by using the interaction device. Classifying the operations according to the input method, for example, may include text input operations, digital input operations, button operations, mouse operations, keyboard operations, smart stylus operations, etc.

[0216] In some alternative embodiments, the attention module is a two-dimensional hybrid attention module;

[0217] The two-dimensional hybrid attention module is divided into two parallel upper and lower branches. The upper branch includes a channel attention sub-module and a spatial attention sub-module, and the lower branch includes a coordinate attention sub-module.

[0218] Thus, the channel attention sub-module is similar to applying a weight to the feature map on each channel to represent the relevance of the channel to the key information. The larger this weight, the higher the relevance. In a neural network, the higher-dimensional feature map has a smaller size and more channels, and the channels represent the feature information of the entire image.

[0219] The channel attention sub-module can often achieve good results when processing image feature information. The spatial attention sub-module therein can be used to enable the model to adaptively learn the feature representation with character position information during sequential feature extraction, enable the model to pay more attention to the specified area in the image, and obtain spatial features with two-dimensional spatial position information.

[0220] The coordinate attention mechanism therein can decompose the channel attention into two parallel one-dimensional feature encodings to efficiently integrate the spatial coordinate information into the generated attention feature map. The coordinate attention mechanism can capture cross-channel information and also contains direction-aware and position-sensitive information, which enables the deep learning model to more accurately locate and identify the target area.

[0221] Compared with the convolutional attention mechanism module (i.e., CBAM, Convolutional Block Attention Module), the two-dimensional hybrid attention module also adds a coordinate attention mechanism module, which can better extract features focusing on the characteristics of tea leaves, achieving multi-directional, high-precision, and comprehensive and efficient extraction of information from tea leaf images, bringing a qualitative improvement to the performance of the deep learning model.

[0222] In the embodiment of the present application, the tea disease detection module includes:

[0223] BackBone unit, where Focus refers to the Focus module, which is used to perform slicing operations on images; CPS refers to the CSP module, which is used to divide the input into two branches and perform convolutional operations respectively to halve the number of channels; CBL refers to the CBL module, that is, Conv + BN + Leaky Relu.

[0224] Neck unit, where UP_Sample refers to upsampling, which is used to complete the "decompression" operation of pictures; Concat refers to the concatenate operation, which is used to merge feature matrices in a preset direction.

[0225] Head unit, where Conv refers to the convolutional layer, Large-scale detection layer refers to the detection layer at a large scale, Medium-scale detection layer refers to the detection layer at a medium scale, and Small-scale detection layer refers to the detection layer at a small scale.

[0226] In a specific application scenario, training data samples of tea leaf images in the training set can be obtained by using remote sensing equipment loaded on a drone, and after manually annotating them to produce a training set, the preset deep learning model can be trained using the training set to obtain a tea disease detection model.

[0227] When detecting tea leaves, multiple tea leaf images to be tested are taken by using remote sensing equipment mounted on a drone for each area (each area corresponds to one or more tea plants, or a part of a tea plant), and these tea leaf images to be tested are respectively input into a tea leaf disease detection model, and the disease detection results corresponding to each tea leaf image to be tested can be obtained. If the disease detection results corresponding to at least one tea leaf image to be tested are used to indicate that the corresponding leaf has a target disease, it is preliminarily determined that the leaf corresponding to this area may have the target disease. At this time, it is necessary to use a remote sensing equipment with higher precision or a high-resolution camera to re-take one or more tea leaf images to be tested in this area, and input the re-taken tea leaf images to be tested into the tea leaf disease detection model again to obtain the corresponding disease detection results. If the disease detection results corresponding to at least one of the re-taken tea leaf images to be tested are used to indicate that the corresponding leaf has a target disease, it is determined that the leaf corresponding to this area has the target disease. The advantage of doing this is that the tea leaf disease detection process is divided into two stages. The first stage detects the possibility of having a disease, and the second stage confirms whether there is a disease. Compared with the existing single detection step of confirming whether there is a disease, the disease detection results in the second stage are used to confirm the disease detection results in the first stage, which can improve the accuracy of tea leaf disease detection in a single area.

[0228] When confirming that the leaf corresponding to this area has a target disease, based on the disease detection results of the tea leaf images to be tested, a drug spraying strategy corresponding to this area is generated. The drug spraying strategy includes drug type, drug concentration, spraying time, spraying dose, spraying frequency, spraying route, etc. Use the drug spraying equipment mounted on the drone (or use a drug spraying robot with self-moving function) to execute the drug spraying task corresponding to the drug spraying strategy to treat the target disease of the leaf corresponding to this area. That is to say, after detecting that the leaf has a target disease, the drone or robot can be used to automatically execute the drug spraying task to treat the tea plant in this area, further saving labor costs and improving spraying efficiency.

[0229] After executing the drug spraying task, after a preset time (for example, 1 day, 1 week or 1 month), the remote sensing device loaded on the drone is used to take the image of the tea leaves to be tested in the area again, and the image of the tea leaves to be tested taken again is input into the tea disease detection model to obtain the disease detection result. If at least one of the images of the tea leaves to be tested taken again is used to indicate that the leaves have the target disease, it indicates that the previous drug spraying strategy may not be applicable and the dosage of the drug needs to be increased. At this time, the drug spraying strategy can be readjusted in combination with the opinions of tea experts, and the automatic spraying task is continued according to the adjusted drug spraying strategy. After an interval of a preset time, or a shorter time, the image of the tea leaves to be tested in the area is taken again, the disease is detected again, and it is determined whether the drug spraying strategy needs to be adjusted according to the disease detection result, and this is repeated until the disease detection result of the tea leaves to be tested in the area is used to indicate that the corresponding leaves do not have the target disease. The advantage of this is that the drug spraying strategy can be adjusted in time according to the treatment effect after drug spraying, and the problem of tea leaves suffering from target diseases can be solved as soon as possible, ensuring that the tea trees can bring the expected economic benefits to the growers. In addition, the above-mentioned drug spraying process adopts an intelligent and manual processing method, which takes into account high efficiency and the guidance of many years of experience of senior experts.

[0230] In a specific application scenario, drones refer to unmanned aerial vehicles, generally unmanned aircraft, such as various types of drone aircraft, unmanned helicopters, unmanned multi-rotor aircraft (multi-rotor / multi-axis aircraft). The technical fields involved in drones are very extensive, including sensor technology, communication technology, information processing technology, intelligent control technology, and aviation propulsion technology, etc., and they are high-tech products of the information age. Drones can not only serve as flying work platforms to meet work needs, but also rely on their aerial operation capabilities to easily intervene in plant protection, power inspections, disaster relief, and aerial photography. At the same time, drones also have excellent data collection capabilities, so they can also be used as Internet connection ports.

[0231] In a specific application scenario, when a drone performs a specific flight mission, it needs to carry instruments, equipment and systems for specific missions, which are called the drone's mission payload. The drone's mission payload can be used for data collection, surveillance, patrolling, wire laying, airdropping, atmospheric monitoring, sampling, communication, experimentation, relaying, etc. Among them, the mission payload equipment used for image collection includes high-resolution CCD digital cameras, lightweight optical cameras, etc.; the optoelectronic mission payload equipment used for reconnaissance, surveillance and patrolling includes visible light payloads, infrared thermal imagers, ultraviolet thermal imagers, synthetic aperture radars, lidars and multispectral cameras, etc. The drone performs different missions to configure the optoelectronic payload according to the required purpose.

[0232] In a specific application scenario, the steps of using unmanned aerial vehicle (UAV) remote sensing to collect tea leaf images can be as follows: Based on the basic geographical information and tea tree distribution information of the area to be measured, plan the UAV flight route; Set at least two information collection methods and their corresponding triggering conditions (such as remote control triggering, electrical signal triggering, optical signal triggering, sound triggering, command triggering, etc.); Collect tea leaf images based on at least one information collection method, analyze the collected tea leaf images in real time, and determine and trigger different information collection methods according to the analysis results; Collect and analyze the collected tea leaf images in real time, determine and trigger different tea leaf image collection methods according to the analysis results, summarize and store the collected tea leaf images, and transmit them to a preset mobile device or application terminal. The tea leaf image collection method using UAV remote sensing in this application can utilize the advantages of the UAV to achieve reciprocating flight in a short time and flexible equipment adjustment, significantly improving the remote sensing accuracy in different terrain environments. To implement the tea leaf image collection method using UAV remote sensing, the collection route, collection method, triggering conditions, cruising method, etc. can be reasonably planned, which can maximize the utilization of the onboard equipment resources on the UAV. Combined with the installed remote sensing device, it can quickly and conveniently collect tea leaf images in the tea tree planting environment with complex terrain, facilitating the smooth progress of subsequent tea leaf disease detection operations.

[0233] Device implementation

[0234] See Figure 4 , Figure 4 shows a schematic structural diagram of a tea leaf disease detection device provided by this application.

[0235] This application also provides a tea leaf disease detection device, and its specific implementation is the same as the implementation and the achieved technical effects described in the above method implementation, and some contents will not be repeated.

[0236] The tea leaf disease detection device is used to detect tea leaves, and the device includes:

[0237] A disease detection module 101, which is used to input the tea leaf image to be measured into a tea leaf disease detection model to obtain the disease detection result of the tea leaf image to be measured, and the disease detection result of the tea leaf image to be measured is used to indicate whether at least one leaf corresponding to the tea leaf image to be measured has a target disease;

[0238] Among them, the training process of the tea leaf disease detection model includes:

[0239] Obtain a training set, where the training set includes a plurality of training data, and each training data includes a sample tea leaf image and annotation data of the disease detection result of the sample tea leaf image. The disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease;

[0240] For each piece of training data in the training set, perform the following processing:

[0241] Input the sample tea leaf image in the training data into a preset deep learning model to obtain prediction data on the disease detection result of the sample tea leaf image;

[0242] Update the model parameters of the deep learning model based on the prediction data and the annotation data of the disease detection result of the sample tea leaf image;

[0243] Detect whether a preset training end condition is met; if so, use the trained deep learning model as the tea leaf disease detection model; if not, continue to train the deep learning model using the next piece of training data.

[0244] In some alternative embodiments, the obtaining of the training set includes:

[0245] Perform data augmentation processing on the sample tea leaf image to obtain at least one enhanced image corresponding to the sample tea leaf image;

[0246] Use the sample tea leaf image and its enhanced images to produce the training set.

[0247] In some alternative embodiments, the process of obtaining the sample tea leaf image includes:

[0248] Use a remote sensing device mounted on a drone to collect images of tea trees in a tea planting area to obtain a plurality of the sample tea leaf images.

[0249] In some alternative embodiments, the performing of data augmentation processing on the sample tea leaf image includes:

[0250] Crop the sample tea leaf image based on a preset size to obtain a standardized image;

[0251] Use a super-resolution network to perform super-resolution reconstruction on the standardized image to obtain a super-resolution image;

[0252] Perform data augmentation on the super-resolution image to obtain at least one of the enhanced images.

[0253] In some alternative embodiments, the deep learning model includes a BackBone unit, a Neck unit, and a Head unit. An RFB module is added to the BackBone unit, and an attention module is added to the Neck unit;

[0254] Inputting the sample tea leaf images in the training data into a preset deep learning model to obtain prediction data of the disease detection results of the sample tea leaf images, includes:

[0255] Using the BackBone unit to extract feature information from the sample tea leaf images, the feature information includes: low-level spatial features and high-level semantic features corresponding to the sample tea leaf images; wherein, the RFB module is used in the extraction process of part of the low-level spatial features and part of the high-level semantic features;

[0256] Using the BackBone unit to input the low-level spatial features and the high-level semantic features into the Neck unit of the target detection network;

[0257] Using the Neck unit to perform feature fusion on the low-level spatial features and the high-level semantic features to obtain a feature fusion result;

[0258] Using the attention module to obtain multiple feature maps corresponding to the feature fusion result;

[0259] For each of the feature maps, using the Head unit to generate a corresponding detection box to obtain prediction data of the disease detection results of the sample tea leaf images.

[0260] In some alternative embodiments, the annotation data is used to indicate the position information of the diseased leaves in the sample tea leaf images, the disease type corresponding to the sample tea leaf images, and the confidence level corresponding to the tea leaf images;

[0261] Updating the model parameters of the deep learning model based on the prediction data and the annotation data of the disease detection results of the sample tea leaf images, includes:

[0262] Based on the prediction data and the annotation data of the disease detection results of the sample tea leaf images, obtaining the loss value corresponding to the sample tea leaf images;

[0263] Using the loss value, obtaining the feature weight information of multiple of the feature maps in a stochastic gradient descent manner;

[0264] Based on the feature weight information of multiple of the feature maps, updating the model parameters of the deep learning model.

[0265] In some alternative embodiments, the process of obtaining the model parameters includes:

[0266] Using an interaction device to receive a numerical setting operation, and in response to the numerical setting operation, determining the parameter values of at least one of the model parameters.

[0267] In some alternative embodiments, the attention module is a two-dimensional hybrid attention module;

[0268] The two-dimensional hybrid attention module is divided into two parallel upper and lower branches. The upper branch includes a channel attention sub-module and a spatial attention sub-module, and the lower branch includes a coordinate attention sub-module.

[0269] Device embodiments

[0270] The present application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it performs the steps of the method described in any one of the above. Its specific implementation manners are consistent with the implementation manners and the achieved technical effects described in the implementation manners of the above method, and some contents will not be repeated.

[0271] See Figure 5 , Figure 5 shows a structural block diagram of an electronic device 200 provided by the present application. The electronic device 200 includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.

[0272] The memory 210 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 211 and / or a cache memory 212, and may further include a read-only memory (ROM) 213.

[0273] Among them, the memory 210 also stores a computer program, which can be executed by the processor 220, so that the processor 220 implements the steps of any one of the above methods. Its specific implementation manner is consistent with the implementation manner and the achieved technical effect described in the implementation manner of the above method, and some contents will not be repeated.

[0274] The memory 210 may further include a utility 214 having at least one program module 215. Such program modules 215 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.

[0275] Correspondingly, the processor 220 can execute the above computer program and can also execute the utility 214.

[0276] The processor 220 may employ one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0277] The bus 230 may be one or more representing several types of bus architectures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a local bus of a processor or any bus architecture using multiple bus architectures.

[0278] The electronic device 200 may also communicate with one or more external devices 240 such as a keyboard, a pointing device, a Bluetooth device, etc., and may also communicate with one or more devices capable of interacting with the electronic device 200, and / or communicate with any device (such as a router, a modem, etc.) enabling the electronic device 200 to communicate with one or more other computing devices. Such communication may be carried out through the input / output interface 250. Moreover, the electronic device 200 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 through the bus 230. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.

[0279] This application also provides a computer-readable storage medium for storing a computer program, and when the computer program is executed, the steps of any of the above methods are implemented. The specific implementation manner is consistent with the implementation manners and the achieved technical effects recorded in the above method embodiments, and some contents will not be elaborated.

[0280] Medium Embodiment

[0281] This application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are implemented. The specific implementation manner is consistent with the implementation manners and the achieved technical effects recorded in the above method embodiments, and some contents will not be elaborated.

[0282] See Figure 6 , Figure 6 which shows the schematic structure of a program product 300 for a method of detecting tea diseases provided by the present application. The program product 300 can be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product 300 of the present invention is not limited thereto. In the present application, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device. The program product 300 can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0283] The computer-readable storage medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium can also be any readable medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the above. The program code for performing the operations of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the C language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as an independent software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).

[0284] This application is described from the perspectives of purpose of use, efficacy, progressiveness, and novelty, and has met the functional enhancement and use requirements emphasized by the patent law. The above description and accompanying drawings of this application are only preferred embodiments of this application and do not limit this application thereby. Therefore, all those that are similar or identical to the structure, device, features, etc. of this application, that is, all equivalent substitutions or modifications made according to the scope of the patent application of this application, shall fall within the scope of patent application protection of this application.

Claims

1. A method for detecting tea diseases, characterized in that For detecting tea leaves, the method includes: Inputting the tea leaf image to be measured into a tea leaf disease detection model to obtain the disease detection result of the tea leaf image to be measured, and the disease detection result of the tea leaf image to be measured is used to indicate whether at least one leaf corresponding to the tea leaf image to be measured has a target disease; Among them, the training process of the tea leaf disease detection model includes: Obtaining a training set, the training set includes a plurality of training data, each training data includes a sample tea leaf image and the annotation data of the disease detection result of the sample tea leaf image, and the disease detection result of the sample tea leaf image is used to indicate whether at least one leaf corresponding to the sample tea leaf image has the target disease; For each training data in the training set, perform the following processing: Inputting the sample tea leaf image in the training data into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea leaf image; Updating the model parameters of the deep learning model based on the prediction data and annotation data of the disease detection result of the sample tea leaf image; Detecting whether the preset training end condition is satisfied; if so, using the trained deep learning model as the tea leaf disease detection model; if not, continuing to train the deep learning model with the next training data; The deep learning model includes a BackBone unit, a Neck unit and a Head unit, an RFB module is added to the BackBone unit, and an attention module is added to the Neck unit; The step of inputting the sample tea leaf image in the training data into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea leaf image includes: Using the BackBone unit to extract feature information from the sample tea leaf image, the feature information includes: the low-level spatial feature and high-level semantic feature corresponding to the sample tea leaf image; among them, the RFB module is used for the extraction process of part of the low-level spatial feature and part of the high-level semantic feature; Using the BackBone unit to input the low-level spatial feature and the high-level semantic feature to the Neck unit; Using the Neck unit to perform feature fusion on the low-level spatial feature and the high-level semantic feature to obtain a feature fusion result; Using the attention module to obtain a plurality of feature maps corresponding to the feature fusion result; For each feature map, using the Head unit to generate a corresponding detection box to obtain the prediction data of the disease detection result of the sample tea leaf image; The attention module is a two-dimensional hybrid attention module; The two-dimensional hybrid attention module is divided into two parallel branches, the upper branch includes a channel attention sub-module and a spatial attention sub-module, and the lower branch includes a coordinate attention sub-module.

2. The detection method of tea diseases according to claim 1, characterized in that, The step of obtaining the training set includes: Performing data augmentation processing on the sample tea leaf image to obtain at least one enhanced image corresponding to the sample tea leaf image; Using the sample tea leaf image and its enhanced image to make the training set.

3. The detection method of tea diseases according to claim 2, characterized in that The process of obtaining the sample tea leaf image includes: Use a remote sensing device mounted on a drone to collect images of tea trees in a tea planting area to obtain multiple sample tea images.

4. The detection method of tea diseases according to claim 2, characterized in that, The data enhancement processing performed on the sample tea images includes: Crop the sample tea images based on a preset size to obtain standardized images; Use a super-resolution network to perform super-resolution reconstruction on the standardized images to obtain super-resolution images; Perform data enhancement on the super-resolution images to obtain at least one enhanced image.

5. The detection method of tea diseases according to claim 1, characterized in that, The labeled data is used to indicate the position information of the diseased leaves in the sample tea image, the disease type corresponding to the sample tea image, and the confidence level corresponding to the tea image; Updating the model parameters of the deep learning model based on the prediction data and labeled data of the disease detection results of the sample tea images includes: Based on the prediction data and labeled data of the disease detection results of the sample tea images, obtain the loss value corresponding to the sample tea image; Use the loss value to obtain the feature weight information of multiple feature maps by means of stochastic gradient descent; Update the model parameters of the deep learning model based on the feature weight information of multiple feature maps.

6. A detection device for tea diseases, characterized in that, For detecting tea leaves, the device includes: A disease detection module for inputting a tea leaf image to be measured into a tea leaf disease detection model to obtain the disease detection result of the tea leaf image to be measured, and the disease detection result of the tea leaf image to be measured is used to indicate whether at least one leaf corresponding to the tea leaf image to be measured is suffering from a target disease; Among them, the training process of the tea leaf disease detection model includes: Obtain a training set, the training set includes a plurality of training data, each training data includes a sample tea image and the labeled data of the disease detection result of the sample tea image, and the disease detection result of the sample tea image is used to indicate whether at least one leaf corresponding to the sample tea image is suffering from the target disease; For each training data in the training set, perform the following processing: Input the sample tea image in the training data into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea image; Update the model parameters of the deep learning model based on the prediction data and labeled data of the disease detection result of the sample tea image; Detect whether a preset training end condition is satisfied; if so, use the trained deep learning model as the tea leaf disease detection model; if not, continue to train the deep learning model with the next training data; The deep learning model includes a BackBone unit, a Neck unit, and a Head unit. An RFB module is added to the BackBone unit, and an attention module is added to the Neck unit; The inputting the sample tea image in the training data into a preset deep learning model to obtain the prediction data of the disease detection result of the sample tea image includes: The BackBone unit is used to extract features from the sample tea leaf image to obtain feature information, where the feature information includes: the low-level spatial features and high-level semantic features corresponding to the sample tea leaf image; among them, the RFB module is used for the extraction process of partial low-level spatial features and partial high-level semantic features; The low-level spatial features and the high-level semantic features are input into the Neck unit by using the BackBone unit; The Neck unit is used to perform feature fusion on the low-level spatial features and the high-level semantic features to obtain a feature fusion result; The attention module is used to obtain multiple feature maps corresponding to the feature fusion result; For each of the feature maps, the Head unit is used to generate a corresponding detection box to obtain prediction data of the disease detection result of the sample tea leaf image; The attention module is a two-dimensional hybrid attention module; The two-dimensional hybrid attention module is divided into two parallel upper and lower branches. The upper branch includes a channel attention sub-module and a spatial attention sub-module, and the lower branch includes a coordinate attention sub-module.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of claims 1-5 are implemented.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1-5 are implemented.

Citation Information

Patent Citations

  • A method for detecting bacterial blight in rice based on image segmentation

    CN112801991B

  • Feature fusion target detection and identification method based on global attention

    CN112949673A

  • Pepper disease recognition method and device, electronic equipment and storage medium

    CN113744258A