A method for counting powdery mildew spores of rubber tree
By improving the object detection algorithm and using deep learning technology, efficient and accurate identification and counting of rubber tree powdery mildew spores are achieved, solving the problems of low accuracy and slow identification in the prior art, and helping to monitor and prevent rubber tree powdery mildew.
Patent Information
- Application Number
- CN202111156536.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-09-30
AI Technical Summary
The prior art has problems in the counting of rubber tree powdery mildew spores of low accuracy, slow recognition speed and easy overfitting, making it difficult to effectively monitor and prevent rubber tree powdery mildew.
A rubber tree powdery mildew spore counting method is adopted, including obtaining spore image datasets, pre-processing the datasets and improving the object detection algorithm, using YOLOv5 algorithm and deep learning technology to train the model, identify and count spore count in real time, and generate powdery mildew prediction results.
It improves the accuracy and speed of spore counting, reduces the error and visual fatigue of manual counting, and can obtain better identification results in complex image environments, helping growers to understand the situation of powdery mildew in a timely manner and take preventive and control measures.
Smart Images

Figure CN113920429B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of spore image recognition, and in particular to a method for counting powdery mildew spores of rubber trees. Background Art
[0002] Rubber tree powdery mildew is an important disease of rubber trees. If it is not monitored and prevented in time, it will lead to a reduction in rubber forest production and affect the income of growers. At present, the capture and identification technology methods for rubber tree powdery mildew spores are all captured in the forest with spore catchers. The captured spores are placed under a microscope and counted manually one by one with the naked eye. This is time-consuming and laborious and it is difficult to avoid counting errors. Analogous to other existing cell spore recognition and counting, there are currently several solutions: 1. Average area method, by identifying the spore outline and dividing it by the set area of a single spore to obtain the number of spores; Disadvantages: The shape is uncontrollable and the accuracy is low. 2. Connected region algorithm: Through calculation, the accuracy is low. 3. Support vector machine SVM, which runs slowly and does not use deep learning methods. Although the accuracy is higher than the former, it is easy to cause overfitting and insufficient generalization ability. Therefore, it is necessary to study a spore counting method with higher accuracy and faster recognition speed. Summary of the invention
[0003] In view of this, the object of the present invention is to provide a method for counting powdery mildew spores of rubber trees, so as to overcome or at least partially solve the above-mentioned problems existing in the prior art.
[0004] A method for counting powdery mildew spores of rubber trees comprises the following steps:
[0005] S101, obtaining a spore image dataset, wherein the spore image dataset includes a plurality of spore images;
[0006] S102, preprocessing the spore image dataset;
[0007] S103, improving the target detection algorithm;
[0008] S104, segmenting the pre-processed spore image data set to obtain a first training set, a first validation set, and a first test set, and training a first model for detecting target spores using a target detection algorithm pre-training model based on the first training set, wherein the target spores are powdery mildew spores of rubber tree;
[0009] S105, obtaining a real-time spore image, inputting the real-time spore image into the first model, the first model identifying the target spores in the real-time spore image and counting the number thereof, and outputting the statistical result;
[0010] S106. Outputting the statistical result of the target spore concentration level according to the statistical result, and generating the rubber tree powdery mildew forecast result according to the statistical result of the target spore concentration level.
[0011] Furthermore, the preprocessing of the spore image data set specifically includes: enlarging the spore images in the spore image data set, dividing the spore images into four equal parts, and marking the spore images.
[0012] Furthermore, in step S103, the target detection algorithm is the YOLOv5 algorithm.
[0013] Furthermore, in step S103, the target detection algorithm is improved, specifically including: adding a deepsort algorithm to the detect function on the basis of the original detector, adding a cascade matching algorithm, and changing the IOU loss function GIOU to DIOU.
[0014] Furthermore, the step between step S104 and step S105 also includes the step of setting the parameters of detect.py, wherein the parameters of detect.py are set as follows: setting source to the path of the target file to be detected, or setting it to 0 if the shooting module is called directly; and setting weight to the path where the trained weight is located.
[0015] Further, in step S105, the real-time spore image is obtained by a spore intelligent monitoring device, and the spore intelligent monitoring device includes:
[0016] A spore collection module, used to capture spores and fix them on the observation platform;
[0017] A shooting module, used to take images of spores on the observation platform;
[0018] Communication module, used to upload spore images to the host computer or receive control instructions from the host computer;
[0019] A driving module, used for driving the spore intelligent monitoring device to move;
[0020] Positioning module, used to locate the real-time position of the spore intelligent monitoring device;
[0021] The control module is used to control the spore intelligent monitoring device to perform corresponding actions according to the control instructions.
[0022] Furthermore, the step S105 further includes the following steps:
[0023] S107, obtaining historical environmental data of the rubber forest at different time points, and corresponding historical concentration levels of target spores;
[0024] S108. Analyze historical environmental parameters that affect the historical concentration level of target spores based on historical environmental data of rubber forests;
[0025] S109, generating a second training set, a second validation set, and a second test set according to the historical environmental parameters and the corresponding target spore historical concentration levels, and training a second model for predicting the target spore concentration level using a machine learning algorithm pre-trained model based on the second training set;
[0026] S110, acquiring real-time rubber forest environmental data, analyzing the real-time rubber forest environmental data to obtain real-time environmental parameters, inputting the real-time environmental parameters into a second model, and the second model generating a corresponding target spore concentration level prediction result according to the real-time environmental parameters;
[0027] S111. Combining the statistical results of the target spore concentration level and the predicted results of the target spore concentration level to generate the final rubber tree powdery mildew forecast results.
[0028] Furthermore, the method also includes the steps of: judging the confidence of the target spore concentration level prediction result according to the target spore concentration level statistical result; when the confidence of the target spore concentration level prediction result is lower than a preset threshold, optimizing the second model according to the target spore concentration level statistical result.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. Compared with the traditional method of counting one by one with the naked eye under a microscope, it can effectively improve the counting efficiency, avoid visual fatigue caused by long-term concentration, and avoid counting errors caused by manual counting;
[0031] 2. The existing image recognition algorithms such as the average area method or connected region algorithm have low recognition accuracy in special environments. This method can achieve a higher recognition success rate with the same amount of calculation and computing time, and can achieve better recognition results in complex image environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only preferred embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 The present invention is a schematic diagram of the overall process of a method for counting powdery mildew spores of rubber trees provided by one embodiment of the present invention.
[0034] Figure 2 It is a schematic diagram of the overall structure of a spore intelligent monitoring device provided in one embodiment of the present invention.
[0035] Figure 3The present invention is another embodiment of a method for counting powdery mildew spores of rubber trees provided by the present invention.
[0036] In the figure, 1 is a spore collection module, 2 is a shooting module, 3 is a communication module, 4 is a driving module, 5 is a positioning module, and 6 is a control module. DETAILED DESCRIPTION
[0037] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The enumerated embodiments are only used to explain the present invention and are not used to limit the scope of the present invention.
[0038] Reference Figure 1 The present embodiment provides a method for counting powdery mildew spores of rubber trees, the method comprising the following steps:
[0039] S101. Acquire a spore image dataset, where the spore image dataset includes a plurality of spore images.
[0040] S102, preprocessing the spore image dataset.
[0041] S103. Improve the target detection algorithm.
[0042] S104, segmenting the preprocessed spore image data set to obtain a first training set, a first validation set, and a first test set, and training a first model for detecting target spores using a target detection algorithm pre-training model based on the first training set, where the target spores are powdery mildew spores of rubber tree.
[0043] S105, obtaining a real-time spore image, and inputting the real-time spore image into the first model, the first model identifying the target spores in the real-time spore image and counting the number thereof, and outputting the statistical result.
[0044] S106, according to the statistical result output target spore concentration level statistical result, generate rubber tree powdery mildew forecast result according to the target spore concentration level statistical result. The target spore concentration level statistical result divides its concentration level according to the target spore number of statistics, and the more spore number of statistics, the higher its concentration level. The rubber tree powdery mildew forecast report generated according to the current target spore concentration level can help growers understand the real-time powdery mildew spore concentration between rubber trees, so as to take corresponding disease prevention and control measures.
[0045] As an optional implementation, in step S102, the spore image dataset is preprocessed, specifically including: enlarging the spore images in the spore image dataset, dividing the spore images into four equal parts, and marking the spore images.
[0046] Exemplarily, the magnifying the spore image is specifically magnifying the spore image by 10 times, so that the morphology of the spores is clearly identifiable. The spore image is labeled by manually labeling through labelimg.
[0047] As an optional implementation, the target detection algorithm is the YOLOv5 algorithm. YOLOv5 is a single-stage target detection algorithm, which consists of an input end, a reference network, a Neck network and a Head output end. YOLOv5 uses the CSPDarknet53 structure and the Focus structure as the reference network; wherein the Neck network is usually located in the middle of the reference network and the head network, and it can be used to further improve the diversity and robustness of features. YOLOv5 uses the SPP module and the FPN+PAN module. For different detection algorithms, the number of branches at the output end is also different, usually including a classification branch and a regression branch. YOLOv5 has a fast detection speed, and the reasoning time for each picture reaches 0.007s, that is, 140frame / s.
[0048] The improvement of the target detection algorithm specifically includes: adding a deepsort algorithm to the detect function based on the original YOLOv5 detector to improve its dynamic tracking ability when the lens moves; adding a cascade matching algorithm, adding Mahalanobis distance and cosine distance; changing the IOU loss function GIOU to DIOU, thereby accelerating the convergence speed and accuracy of model training.
[0049] Exemplarily, in step S104, a first model for detecting target spores is trained based on a first training set using a target detection algorithm pre-training model, including: placing the xml file obtained after labelimg marking the spore image data set and the original image into the Annotations and image folders in the VOCData folder under the program root directory, respectively. The spore image data set is divided into a first training set, a first validation set, and a first test set, wherein the first training set is used to pre-train the first model, the first validation set is used to determine the parameters for controlling the complexity of the model, and the first test set is used to verify the performance of the first model. The data set is converted to the YOLO data set format. A yaml format file is created in the data folder, and the classification is defined as powdery mildew spores. Run train.py to train the first model for detecting target spores using the YOLOv5s pre-training model.
[0050] As an optional implementation, the step between step S104 and step S105 further includes the following steps: setting the parameters of detect.py, specifically including: setting source to the path of the target file to be detected, that is, the path where the real-time spore image file is located, and setting it to 0 if the shooting module is called directly. Setting weight to the path where the trained weight is located.
[0051] As an optional implementation, in step S105, the real-time spore image is obtained by a spore intelligent monitoring device, referring to Figure 2 The spore intelligent monitoring device includes a spore collecting module 1, a shooting module 2, a communication module 3, a driving module 4, a positioning module 5 and a control module 6, wherein the shooting module 2, the communication module 3, the driving module 4, and the positioning module 5 are respectively connected to the control module 6.
[0052] The spore collecting module 1 is used to capture spores and fix the spores on the observation platform. The implementation principle of the spore collecting module 1 is similar to that of the existing spore catcher. An electrostatic film is arranged on the observation platform, and the electrostatic film can absorb and fix the spores in the air.
[0053] The shooting module 2 is used to shoot the spore image on the observation platform.
[0054] The communication module 3 is used to upload spore images to a host computer or receive control instructions from the host computer. The host computer is used to execute the method described in the above method embodiment, and the user can remotely issue control instructions to the spore intelligent monitoring device through the host computer.
[0055] The driving module 4 is used to drive the spore intelligent monitoring device to move among the rubber forests. The driving module 4 can adopt a combination of a walking wheel and a driving motor, and the walking wheel is driven to rotate by the driving motor. The driving motor is controlled by the control module 6.
[0056] The positioning module 5 is used to locate the real-time position of the spore intelligent monitoring device.
[0057] The control module 6 is used to control the spore intelligent monitoring device to perform corresponding actions according to the control instructions, such as obtaining and uploading spore images, moving to a specified position, etc.
[0058] As an optional implementation, refer to Figure 3 , the step S105 further includes the following steps:
[0059] S107. Obtain historical environmental data of the rubber forest at different time points, and corresponding historical concentration levels of target spores.
[0060] Exemplarily, the rubber forest historical environmental data at least includes the temperature, humidity, wind force, wind direction, weather, human activities, seasons, etc. within and around the rubber forest at the corresponding time. The corresponding target spore historical concentration level is the target spore concentration level at the same time.
[0061] S108. Analyze historical environmental parameters that affect the historical concentration level of target spores based on historical environmental data of rubber forests.
[0062] The purpose of this step is to analyze and extract the contents in all historical environmental data that can have a significant impact on the concentration level of the target spores, and use these contents as historical environmental parameters.
[0063] S109, generating a second training set, a second validation set, and a second test set according to the historical environmental parameters and the corresponding target spore historical concentration level, and training a second model for predicting the target spore concentration level using a machine learning algorithm pre-training model based on the second training set. The trained second model can predict the corresponding target spore concentration level according to the input environmental parameters.
[0064] S110, acquiring real-time rubber forest environmental data, analyzing the real-time rubber forest environmental data to obtain real-time environmental parameters, inputting the real-time environmental parameters into the second model, and the second model generating corresponding target spore concentration level prediction results according to the real-time environmental parameters.
[0065] Exemplarily, the acquisition of the real-time rubber forest environmental data can be achieved through a spore intelligent monitoring device. For example, a wind force and direction sensor and a temperature and humidity sensor can be installed on the spore intelligent monitoring device to collect the temperature, humidity, wind force, and wind direction data of the rubber forest; weather, human activity, and seasonal data can be obtained by a host computer through the network or manually entered by a user.
[0066] S111. Combining the statistical results of the target spore concentration level and the predicted results of the target spore concentration level to generate the final rubber tree powdery mildew forecast results.
[0067] In this embodiment, by collecting real-time environmental data of the rubber forest and predicting the target spore concentration level based on the data, the final rubber tree powdery mildew forecast result is generated in combination with the statistical results of the target spore concentration level. In addition to helping growers to timely understand the real-time powdery mildew spore concentration in order to take corresponding disease control measures, growers can also take corresponding disease prevention measures according to the prediction results of the target spore concentration level, thereby further eliminating the possibility of severe powdery mildew.
[0068] As an optional implementation, the method further includes the steps of: judging the confidence of the target spore concentration level prediction result according to the target spore concentration level statistical result at the same time; when the confidence of the target spore concentration level prediction result is lower than a preset threshold, optimizing the second model according to the target spore concentration level statistical result.
[0069] Exemplarily, the confidence of the target spore concentration level prediction result is divided according to the difference between the target spore concentration level statistical result and the target spore concentration level prediction result. The higher the confidence, the smaller the difference between the two. If the confidence is lower than the preset threshold, it means that the accuracy of the prediction result needs to be improved, and the second model needs to be re-optimized to improve the prediction accuracy.
[0070] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for counting powdery mildew spores of rubber tree, characterized in that: The method comprises the following steps: S101, obtaining a spore image dataset, wherein the spore image dataset includes a plurality of spore images; S102, preprocessing the spore image dataset; S103, improving the target detection algorithm; S104, segmenting the preprocessed spore image data set to obtain a first training set, a first validation set, and a first test set, and training a first model for detecting target spores using a target detection algorithm pre-training model based on the first training set, wherein the target spores are powdery mildew spores of rubber tree; S105, obtaining a real-time spore image, inputting the real-time spore image into the first model, the first model identifying the target spores in the real-time spore image and counting the number thereof, and outputting the statistical result; S106, outputting the target spore concentration level statistical result according to the statistical result, and generating the rubber tree powdery mildew forecast result according to the target spore concentration level statistical result; The step S105 further includes the following steps: S107, obtaining historical environmental data of the rubber forest at different time points, and corresponding historical concentration levels of target spores; S108. Analyze historical environmental parameters that affect the historical concentration level of target spores based on historical environmental data of rubber forests; S109, generating a second training set, a second validation set, and a second test set according to the historical environmental parameters and the corresponding target spore historical concentration levels, and training a second model for predicting the target spore concentration level using a machine learning algorithm pre-trained model based on the second training set; S110, acquiring real-time rubber forest environmental data, analyzing the real-time rubber forest environmental data to obtain real-time environmental parameters, inputting the real-time environmental parameters into a second model, and the second model generating corresponding target spore concentration level prediction results according to the real-time environmental parameters; S111. Combining the statistical results of the target spore concentration level and the predicted results of the target spore concentration level to generate the final rubber tree powdery mildew forecast results.
2. A method for counting powdery mildew spores of rubber tree according to claim 1, characterized in that, The preprocessing of the spore image data set specifically includes: enlarging the spore images in the spore image data set, dividing the spore images into four equal parts, and marking the spore images.
3. A method for counting powdery mildew spores of rubber tree according to claim 1, characterized in that, In step S103, the target detection algorithm is the YOLOv5 algorithm.
4. A method for counting powdery mildew spores of rubber tree according to claim 3, characterized in that, In step S103, the target detection algorithm is improved, specifically including: adding a deepsort algorithm to the detect function on the basis of the original detector, adding a cascade matching algorithm, and changing the IOU loss function GIOU to DIOU.
5. A method for counting powdery mildew spores of rubber tree according to claim 3, characterized in that, The step between step S104 and step S105 also includes the step of setting the parameters of detect.py, wherein the parameters of detect.py are set as follows: setting source to the path of the target file to be detected, or setting it to 0 if the shooting module is called directly; and setting weight to the path where the trained weight is located.
6. A method for counting powdery mildew spores of rubber tree according to claim 1, characterized in that, In step S105, the real-time spore image is obtained by a spore intelligent monitoring device, and the spore intelligent monitoring device includes: A spore collection module, used to capture spores and fix them on the observation platform; A shooting module, used to take images of spores on the observation platform; Communication module, used to upload spore images to the host computer or receive control instructions from the host computer; A driving module, used for driving the spore intelligent monitoring device to move; Positioning module, used to locate the real-time position of the spore intelligent monitoring device; The control module is used to control the spore intelligent monitoring device to perform corresponding actions according to the control instructions.
7. A method for counting powdery mildew spores of rubber tree according to claim 1, characterized in that, The method also includes the steps of: judging the confidence of the target spore concentration level prediction result according to the target spore concentration level statistical result, and when the confidence of the target spore concentration level prediction result is lower than a preset threshold, optimizing the second model according to the target spore concentration level statistical result.