Leaf vegetable disease detection regulation and control method and system based on deep learning
Through the improved DETR model and deep Q network model, the accuracy of leafy vegetable disease detection and the intelligence of environmental regulation are achieved, the shortcomings of disease detection and environmental regulation in the existing technology are solved, and the yield and quality of leafy vegetable are improved.
Patent Information
- Application Number
- CN202411818475.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-12-11
AI Technical Summary
It is difficult to accurately identify small targets such as small lesions in leafy vegetable disease detection, and traditional disease detection and environmental regulation rely on artificial experience and are difficult to adapt to complex agricultural environment changes.
The leafy vegetable disease detection and regulation method based on deep learning is adopted, and disease detection is performed through an improved DETR model, and pixel-level segmentation is performed in combination with a weak supervision segmentation method, and disease characteristics are extracted for hierarchical quantification. At the same time, the deep Q network model is used to generate the optimal planting strategy, and the environmental parameters such as light, temperature, and humidity are automatically adjusted.
It improves the accuracy of disease detection and the accuracy of environmental regulation, reduces the incidence of disease, improves the yield and quality of leafy vegetables, and reduces energy consumption and labor costs.
Smart Images

Figure CN119863061A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of agricultural diseases and environmental regulation, and specifically relates to a leafy vegetable disease detection and regulation method and system based on deep learning. Background Art
[0002] In plant factories or other agricultural production environments, leafy vegetables are often affected by diseases such as leaf spot and heartburn or environmental stress during their growth. These problems are difficult to completely avoid and usually lead to reduced yield and quality of leafy vegetables, resulting in economic losses. With the increasing demand for high yield and high quality, how to effectively deal with diseases and stress has become the key to production management.
[0003] In the process of preventing and controlling leafy vegetable diseases, the primary task is to achieve rapid and accurate identification of diseases, including identifying the type of disease, determining the location and scope of occurrence, and assessing the severity of the disease. After accurately grasping the disease information, managers can take targeted prevention and control measures in a timely manner, thereby ensuring the stability of production and improving economic benefits. Traditional disease identification methods mainly rely on manual observation and judgment, which is time-consuming and labor-intensive and has low accuracy. Especially in the face of large-scale planting, manual identification is difficult to meet the needs of real-time monitoring. In recent years, computer vision technology has been widely used in the agricultural field and has gradually been used for disease detection. The automatic identification of leafy vegetable diseases through image recognition methods has significantly improved the detection efficiency and accuracy.
[0004] Among the current detection algorithms, DETR (Detection Transformer), as the first end-to-end target detection model based on Transformer, shows great potential in global attention and has obvious advantages in complex scenes and multi-target detection. However, DETR has shortcomings in small target detection accuracy and convergence speed. Especially in complex agricultural scenes, it is often difficult to accurately identify small targets such as small disease spots, resulting in limited detection effect. In addition, agricultural images have diverse disease morphology, complex lighting and background, and traditional global attention performs poorly in such scenes. Therefore, in order to further improve the detection effect, it is necessary to optimize the model to make breakthroughs in small target detection and convergence efficiency, and enhance its applicability and stability in complex agricultural environments. In disease detection, pixel-level annotation is the key to achieving fine segmentation, but due to the high cost and time-consuming nature of annotation, it also requires the annotation personnel to have high professional knowledge, which makes it difficult to promote and use in large-scale data sets.
[0005] After obtaining disease information through image recognition, the environment needs to be properly regulated to prevent the spread of diseases and optimize the growth conditions of leafy vegetables. However, the growth environment of agricultural leafy vegetables is complex, with factors such as temperature, humidity, and light interacting with each other. A single regulatory method is difficult to fully meet growth needs. Traditional control modes usually rely on the experience of staff and are difficult to adapt to the dynamic changes and complexity of the environment. Summary of the invention
[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a leafy vegetable disease detection and control method and system based on deep learning.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] The present invention provides a leafy vegetable disease detection and control method based on deep learning, comprising the following steps:
[0009] Step S1: regularly collecting growth images and environmental parameter data of leafy vegetables, wherein the growth images are collected by a digital camera, and the environmental parameters are collected in real time by sensors, including temperature, humidity, and light intensity;
[0010] Step S2: preprocessing the growth image of leafy vegetables;
[0011] Step S3: Input the pre-processed growth image of the leafy vegetable into the pre-trained improved DETR model for disease detection to determine whether the growth image is diseased. If so, output the boundary box and disease category of the diseased area in the growth image and execute step S4. If not, no output is performed.
[0012] Step S4: segmenting the growth image after disease detection using a weakly supervised segmentation method based on a bounding box to obtain a pixel-level segmentation map of each disease area;
[0013] Step S5: extracting features from the pixel-level segmentation map of each diseased area, extracting the color features, shape features and area features of each diseased area, and classifying and quantifying the disease symptoms according to the disease category output in step S3 and the color features, shape features and area features of each diseased area to generate a disease grade score;
[0014] Step S6: Obtain growth indicators of leafy vegetables, including leaf area index and plant height, input disease grade score, disease category, growth indicator and environmental parameter data into the pre-trained deep Q network model to obtain the optimal planting strategy, and adjust the growth environment of leafy vegetables through the actuator according to the optimal planting strategy.
[0015] Furthermore, the growth images of leafy vegetables are preprocessed, including image enhancement, noise removal and scale transformation.
[0016] Furthermore, the improved DETR model includes a backbone network, an encoder, a decoder and a prediction head. The backbone network extracts features of an input image; the encoder performs global modeling on the features; the decoder decodes target information layer by layer in combination with target query embedding; and the prediction head outputs image bounding box information and disease detection results of disease category labels.
[0017] Furthermore, the improved DETR model introduces a sparse attention mechanism in the encoder and decoder to introduce spatial prior information for the target query.
[0018] Further, the step S4 includes the following steps:
[0019] The growth image after disease detection is subjected to boundary detection algorithm, and pseudo-labels are annotated for each pixel within the boundary box;
[0020] The annotated growth image is input into the pre-trained convolutional neural network Resnet for pixel-level segmentation, and the initial pixel-level segmentation map of each diseased area in the growth image is output. The initial pixel-level segmentation map of each diseased area is subjected to CRF post-processing operation to obtain the pixel-level segmentation map of each diseased area;
[0021] The pseudo label includes 1 and 0, 1 represents a diseased area, and 0 represents a healthy area. The pseudo label is determined according to the color of each pixel in the boundary box.
[0022] Furthermore, the shape features include aspect ratio and perimeter, which are obtained by calculating the spatial distribution of pixels in the pixel-level segmentation map.
[0023] Furthermore, the state space of the deep Q network model includes disease detection information, environmental parameter data, and growth indicators. The disease detection information includes disease categories and disease grade scores. The action space of the deep Q network model includes adjusting light intensity, adjusting temperature, adjusting humidity, and adjusting ventilation.
[0024] Furthermore, the deep Q network model reward function is:
[0025] R=ω 1 ·ΔOutput+ω 2 ·ΔQuality-ω 3 ΔEnergy consumption
[0026] Among them, R is the reward function, ω 1 ,ω 2 ,ω 3 is the weight parameter, Δyield, Δquality and Δenergy consumption are the increments of yield, quality and growth energy consumption of leafy vegetables respectively.
[0027] Furthermore, the actuator includes LED lamps, air conditioners, humidifiers and ventilation equipment. The adjustment of the growth environment of leafy vegetables through the actuators according to the optimal planting strategy includes changing the light intensity by adjusting the power or lighting duration of the LED lamp, adjusting the temperature through the air conditioner, adjusting the humidity through the humidifier, controlling the switch or wind speed of the ventilation equipment, and adjusting the air circulation.
[0028] Another aspect of the present invention provides a leafy vegetable disease detection and control system based on deep learning, comprising:
[0029] The disease detection module is used to regularly collect growth images of leafy vegetables through a digital camera, process the images based on the pre-trained improved DETR model, determine whether the leafy vegetables are diseased, and output the boundary box of the diseased area and the disease category;
[0030] The disease segmentation module is used to receive the growth image output by the disease detection module, further segment the diseased area at the pixel level, and adopt a weakly supervised segmentation method based on a bounding box to obtain a pixel-level segmentation map of each diseased area;
[0031] The feature analysis module is used to extract information such as color features, shape features, and area features from the diseased area in the pixel-level segmentation map, and to grade the disease based on these features, thereby quantitatively grading the disease symptoms;
[0032] The reinforcement learning control module is used to receive environmental parameter data, growth indicators of leafy vegetables, disease grade scores and disease category information, generate the optimal planting strategy in combination with the deep Q network model, and adjust the leafy vegetable growth environment parameters through the actuator;
[0033] The actuator is used to adjust environmental parameters such as light intensity, temperature, humidity and ventilation according to the optimal planting strategy generated by the reinforcement learning control module, including adjusting light intensity through LED lights, adjusting temperature through air conditioners, adjusting humidity through humidifiers, and controlling the wind speed or opening status of ventilation equipment, so as to optimize the growth environment of leafy vegetables, maximize yield and quality, and minimize energy consumption.
[0034] Compared with the prior art, the present invention has the following advantages:
[0035] 1. The present invention uses disease detection and classification and quantification as an important factor in environmental regulation, assists in the formulation of environmental parameter regulation strategies such as light, temperature, and humidity, and improves the accuracy and rationality of regulation. While increasing yield and reducing energy consumption, it effectively reduces the incidence of diseases and ensures the healthy growth of leafy vegetables.
[0036] 2. Compared with traditional manual identification and regulation methods, the present invention realizes automated disease identification and environmental regulation. The system response is faster and more accurate. It can detect the health status of leafy vegetables in real time and adjust environmental parameters according to strategies in real time, which greatly improves production management efficiency and enhances the economic benefits of planting.
[0037] 3. The present invention adopts a weakly supervised segmentation method based on bounding boxes, which reduces the dependence on pixel-level annotation, significantly reduces the annotation cost, reduces the dependence on professional annotation personnel, ensures the segmentation accuracy, and improves the application efficiency of the system on large-scale data sets.
[0038] 4. The present invention uses an improved DETR model for leafy vegetable disease detection. By optimizing the global attention mechanism, the model can effectively identify multi-target diseases in complex agricultural environments and improve the detection accuracy of small targets (such as small diseases such as lesions). This is difficult to achieve in traditional target detection methods, and significantly improves the accuracy of disease recognition, especially in complex backgrounds.
[0039] 5. The present invention can automatically quantify the disease by extracting features from the diseased area, and assess the severity of the disease based on features such as color, shape, and area. This process does not require manual intervention, greatly improving the efficiency and accuracy of disease assessment, and helping production managers to take targeted prevention and control measures in a timely manner.
[0040] 6. The present invention combines the deep Q network model and realizes intelligent environmental control by inputting disease detection results, environmental parameters and growth indicators. The model can dynamically generate the optimal planting strategy based on real-time data, and automatically adjust environmental parameters such as light intensity, temperature, humidity and ventilation through the actuator to improve the growth quality of leafy vegetables and their ability to resist diseases. This environmental control method is more flexible and efficient than traditional manual control, and can adapt to environmental changes in real time, optimize the growth conditions of leafy vegetables, and reduce the occurrence of diseases.
[0041] 7. The present invention greatly reduces the risk of reduced yield and quality of leafy vegetables due to diseases by achieving accurate detection, timely evaluation and automated regulation of diseases. By optimizing the growth environment through intelligent regulation, the present invention can increase the yield and quality of leafy vegetables, while reducing the possibility of disease spread, thereby effectively reducing economic losses in the production process.
[0042] 8. Traditional disease detection and prevention methods rely on manual observation and judgment, which is not only inefficient but also prone to errors. The deep learning technology of the present invention can automatically identify and analyze diseases, which can greatly reduce manual intervention and operation, reduce labor costs, and improve production efficiency. In addition, the present invention has strong applicability and scalability and can be widely used in large-scale agricultural production and plant factories. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of the method of the present invention;
[0044] Figure 2 It is a schematic diagram of the system structure of the present invention;
[0045] Figure 3 It is a structural schematic diagram of the disease detection module of the present invention;
[0046] Figure 4 It is a structural schematic diagram of the disease segmentation module of the present invention;
[0047] Figure 5 It is a system working flow diagram of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0049] Embodiment 1:
[0050] This embodiment provides a leafy vegetable disease detection and control method based on deep learning, such as Figure 1 As shown, the following steps are included:
[0051] Step S1: regularly collecting growth images and environmental parameter data of leafy vegetables, the growth images are collected by a digital camera, and the environmental parameters are collected in real time by sensors, including temperature, humidity, and light intensity;
[0052] Step S2: preprocessing the growth image of leafy vegetables;
[0053] Step S3: Input the pre-processed growth image of the leafy vegetable into the pre-trained improved DETR model for disease detection to determine whether the growth image is diseased. If so, output the boundary box and disease category of the diseased area in the growth image and execute step S4. If not, no output is performed.
[0054] Step S4: segmenting the growth image after disease detection using a weakly supervised segmentation method based on a bounding box to obtain a pixel-level segmentation map of each disease area;
[0055] Step S5: extracting features from the pixel-level segmentation map of each diseased area, extracting the color features, shape features and area features of each diseased area, and classifying and quantifying the disease symptoms according to the disease category output in step S3 and the color features, shape features and area features of each diseased area to generate a disease grade score;
[0056] Step S6: Obtain growth indicators of leafy vegetables, including leaf area index and plant height, input disease grade score, disease category, growth indicator and environmental parameter data into the pre-trained deep Q network model to obtain the optimal planting strategy, and adjust the growth environment of leafy vegetables through the actuator according to the optimal planting strategy.
[0057] Among them, the growth images of leafy vegetables are preprocessed, including image enhancement, noise removal and scale transformation.
[0058] Among them, the improved DETR model includes a backbone network, an encoder, a decoder and a prediction head. The backbone network extracts the features of the input image; the encoder globally models the features; the decoder decodes the target information layer by layer in combination with the target query embedding; the prediction head outputs the image bounding box information and the disease detection results of the disease category label.
[0059] Among them, the improved DETR model introduces a sparse attention mechanism in the encoder and decoder to introduce spatial prior information for the target query.
[0060] Wherein, step S4 comprises the following steps:
[0061] The growth image after disease detection is subjected to boundary detection algorithm, and pseudo-labels are annotated for each pixel within the boundary box;
[0062] The annotated growth image is input into the pre-trained convolutional neural network Resnet for pixel-level segmentation, and the initial pixel-level segmentation map of each diseased area in the growth image is output. The initial pixel-level segmentation map of each diseased area is subjected to CRF post-processing operation to obtain the pixel-level segmentation map of each diseased area;
[0063] The pseudo labels include 1 and 0, 1 represents the diseased area and 0 represents the healthy area. The pseudo labels are determined by the color of each pixel in the bounding box.
[0064] Among them, the shape features include aspect ratio and perimeter, which are obtained by calculating the spatial distribution of pixels in the pixel-level segmentation map.
[0065] Among them, the state space of the deep Q network model includes disease detection information, environmental parameter data, and growth indicators. The disease detection information includes disease categories and disease grade scores. The action space of the deep Q network model includes adjusting light intensity, adjusting temperature, adjusting humidity, and adjusting ventilation.
[0066] Among them, the deep Q network model reward function is:
[0067] R=ω 1 ·ΔOutput+ω 2 ·ΔQuality-ω 3 ΔEnergy consumption
[0068] Among them, R is the reward function, ω 1 ,ω 2 ,ω 3 is the weight parameter, Δyield, Δquality and Δenergy consumption are the increments of yield, quality and growth energy consumption of leafy vegetables respectively.
[0069] Among them, the actuators include LED lamps, air conditioners, humidifiers and ventilation equipment. According to the optimal planting strategy, the growth environment of leafy vegetables is adjusted through the actuators, including changing the light intensity by adjusting the power or lighting duration of LED lamps, adjusting the temperature through air conditioners, adjusting the humidity through humidifiers, controlling the switch or wind speed of ventilation equipment, and adjusting air circulation.
[0070] On the other hand, this embodiment provides a leafy vegetable disease detection and control system based on deep learning, including:
[0071] The disease detection module is used to regularly collect growth images of leafy vegetables through a digital camera, process the images based on the pre-trained improved DETR model, determine whether the leafy vegetables are diseased, and output the boundary box of the diseased area and the disease category;
[0072] The disease segmentation module is used to receive the growth image output by the disease detection module, segment the diseased area at the pixel level, and use a weakly supervised segmentation method based on a bounding box to obtain a pixel-level segmentation map of each diseased area;
[0073] The feature analysis module is used to extract information such as color features, shape features, and area features from the diseased area in the pixel-level segmentation map, and to grade the disease based on these features, thereby quantitatively grading the disease symptoms;
[0074] The reinforcement learning control module is used to receive environmental parameter data, growth indicators of leafy vegetables, disease grade scores and disease category information, generate the optimal planting strategy in combination with the deep Q network model, and adjust the leafy vegetable growth environment parameters through the actuator;
[0075] The actuator is used to adjust environmental parameters such as light intensity, temperature, humidity and ventilation according to the optimal planting strategy generated by the reinforcement learning control module, including adjusting light intensity through LED lights, adjusting temperature through air conditioners, adjusting humidity through humidifiers, and controlling the wind speed or opening status of ventilation equipment, so as to optimize the growth environment of leafy vegetables, maximize yield and quality, and minimize energy consumption.
[0076] Embodiment 2:
[0077] The parts not mentioned in this embodiment are the same as those in Embodiment 1.
[0078] like Figure 2 As shown, this embodiment provides a leafy vegetable disease detection and control system based on deep learning, and the system includes a disease detection module, a disease segmentation module, a feature analysis module, and a reinforcement learning control module. Taking lettuce, which is widely grown in plant factories, as an example, during the facility planting process, lettuce often develops heartburn symptoms due to its rapid growth rate, which manifests as the edges of the leaves turning green, drying up, and forming brown patches. The occurrence of heartburn is closely related to environmental factors such as lighting conditions, temperature and humidity, so it is necessary to ensure its healthy growth through environmental control. The system workflow is as follows Figure 5 As shown, the following steps are included:
[0079] 1. Regularly collect leafy vegetable images and data as basic information for system analysis
[0080] Digital cameras are installed to regularly collect image data of lettuces grown in plant factories. The collected image data is processed by Labelme annotation software, including bounding box annotation and a small amount of pixel-level annotation, and the annotated data is divided into training set and validation set. Environmental data is collected in real time by sensors, including key environmental parameters such as temperature, humidity, and light intensity. Leafy vegetable growth indicators such as leaf area index and plant height are obtained through measurement.
[0081] 2. Disease detection module: real-time monitoring of leafy vegetable health, identification and location of diseased areas
[0082] The disease detection module adopts an improved DETR model. The improved DETR model includes a backbone network, an encoder, a decoder, and a prediction head. The backbone network extracts input image features; the encoder performs global modeling on the features; the decoder decodes the target information layer by layer in combination with the target query embedding; the prediction head module outputs the disease detection results of the bounding box position and category label. The collected image data is analyzed by target detection technology. The model first extracts image features through the backbone network, uses the encoder for global modeling, and then uses the decoder in combination with the target query to generate the prediction results of the diseased area, and finally outputs the bounding box position and category label of the diseased area. This module can accurately identify the health status of leafy vegetables, quickly detect heartburn, and locate the diseased area, providing input data for the segmentation module. The process is as follows: Figure 3As shown in the figure, the improved DETR model introduces a sparse attention mechanism in the encoder and decoder to reduce the amount of computation and enhance the model's attention to key areas; at the same time, spatial prior information such as anchor points or reference points is introduced for target queries to improve the accuracy of target positioning and the detection effect of small targets. For example, a 3×800×1066 image is input, and a feature map is generated by ResNet downsampling and dimensionality reduction to obtain a feature map of size 256×25×34. After adding position encoding, it is input into the Transformer encoder to extract global features, and the output size is 850×256. The decoder receives the encoder output and object query, and outputs the target features through a multi-layer attention mechanism. Finally, the target category and bounding box are generated through binary matching.
[0083] 3. Disease segmentation module: perform pixel-level segmentation on the diseased area to obtain accurate disease contours
[0084] The disease segmentation module uses a weakly supervised segmentation method based on bounding boxes. It extracts pixel-level pseudo labels from the images annotated with bounding boxes to train and optimize the model. The segmentation model is further trained to achieve pixel-level segmentation of diseased areas. During the segmentation process, the accuracy of pseudo labels is optimized by combining the boundary detection algorithm, and CRF post-processing operations are added after the segmentation results to enhance the detailed segmentation effect of the edge of the diseased area and ensure the output of high-precision heartburn area contours. The process is as follows: Figure 4 Among them, the weakly supervised segmentation method introduces a boundary detection algorithm when generating pseudo labels, and improves the accuracy of pixel-level pseudo labels through edge information; after the segmentation model generates preliminary segmentation results, post-processing operations such as CRF (Conditional Random Field) are used to further optimize the fineness of the segmentation edge.
[0085] 4. Feature analysis module: extract disease characteristics and quantify classification to provide a basis for regulation
[0086] The feature analysis module analyzes the segmented heartburn area image and extracts features such as color, shape, and area. The color feature is extracted by converting the diseased area to the HSV color space; the shape feature is obtained by calculating the aspect ratio, perimeter, and area of the pixels in the diseased area. Based on the extracted features, the system classifies and quantifies the disease symptoms and generates a disease grade score.
[0087] 5. Reinforcement learning control module: Generate optimal environmental control strategy based on disease information and environmental data
[0088] The reinforcement learning control module is based on disease classification information and real-time collected leafy vegetable growth and environmental data. It designs a reward function with yield, quality and energy consumption as the core, and generates the optimal environmental control strategy through a reinforcement learning algorithm.
[0089] 6. According to the generated control strategy, the environmental parameters are intelligently adjusted through the actuators.
[0090] The actuators in the plant factory include humidifiers, air conditioners, LED lights, ventilation equipment, etc., which are responsible for dynamically adjusting the environmental parameters of leafy vegetables according to the generated control strategy. For example, when heartburn occurs, the system appropriately suppresses the intensity of photosynthesis by reducing the power of the LED lamp or shortening the lighting time to prevent the lettuce from growing too fast; at the same time, the humidifier is turned off and the ventilation equipment is turned on to reduce the environmental humidity and promote the transpiration of the lettuce leaves. The system accurately controls the actuators according to the control strategy, and intelligently adjusts the environmental parameters such as light and humidity to reduce the impact of heartburn, provide a suitable growth environment for crops, promote the healthy growth of crops, and achieve efficient and intelligent environmental management.
[0091] The present invention combines computer vision technology with reinforcement learning methods to achieve intelligent management of leafy vegetables. By collecting leafy vegetable growth images and environmental data, using deep learning technology to accurately detect and grade leafy vegetable diseases, the reinforcement learning module comprehensively analyzes disease information and environmental data, formulates the optimal planting strategy, and intelligently regulates environmental parameters such as light, temperature, and humidity based on the strategy, thereby effectively reducing the occurrence of leafy vegetable diseases, improving the quality and yield of leafy vegetables, while reducing energy consumption, optimizing resource utilization, and improving the economic benefits of planting. In practical applications, the present invention can not only meet the needs of disease monitoring and environmental regulation, but also greatly reduce the dependence on manual experience, solve the problems of low efficiency and high cost in traditional agricultural production, and can promote the advancement of agricultural technology. It has broad application prospects and social value.
[0092] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A leafy vegetable disease detection and control method based on deep learning, characterized in that: The following steps are involved: Step S1: regularly collecting growth images and environmental parameter data of leafy vegetables, wherein the growth images are collected by a digital camera, and the environmental parameters are collected in real time by sensors, including temperature, humidity, and light intensity; Step S2: preprocessing the growth image of leafy vegetables; Step S3: Input the pre-processed growth image of the leafy vegetable into the pre-trained improved DETR model for disease detection to determine whether the growth image is diseased. If so, output the boundary box and disease category of the diseased area in the growth image and execute step S4. If not, no output is performed. Step S4: segmenting the growth image after disease detection using a weakly supervised segmentation method based on a bounding box to obtain a pixel-level segmentation map of each disease area; Step S5: extracting features from the pixel-level segmentation map of each diseased area, extracting the color features, shape features and area features of each diseased area, and classifying and quantifying the disease symptoms according to the disease category output in step S3 and the color features, shape features and area features of each diseased area to generate a disease grade score; Step S6: Obtain growth indicators of leafy vegetables, including leaf area index and plant height, input disease grade score, disease category, growth indicator and environmental parameter data into the pre-trained deep Q network model to obtain the optimal planting strategy, and adjust the growth environment of leafy vegetables through the actuator according to the optimal planting strategy.
2. A leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The preprocessing of the growth image of the leafy vegetables includes image enhancement, noise removal and scale transformation.
3. The leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The improved DETR model includes a backbone network, an encoder, a decoder and a prediction head, wherein the backbone network extracts features of an input image; the encoder performs global modeling on the features; The decoder decodes the target information layer by layer in combination with the target query embedding; the prediction head outputs the bounding box information of the image and the disease detection result of the disease category label.
4. A leafy vegetable disease detection and control method based on deep learning according to claim 3, characterized in that: The improved DETR model introduces a sparse attention mechanism in the encoder and decoder to introduce spatial prior information for the target query.
5. The leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The step S4 comprises the following steps: The growth image after disease detection is subjected to boundary detection algorithm, and pseudo-labels are annotated for each pixel within the boundary box; The annotated growth image is input into the pre-trained convolutional neural network Resnet for pixel-level segmentation, and the initial pixel-level segmentation map of each diseased area in the growth image is output. The initial pixel-level segmentation map of each diseased area is subjected to CRF post-processing operation to obtain the pixel-level segmentation map of each diseased area; The pseudo label includes 1 and 0, 1 represents a diseased area, and 0 represents a healthy area. The pseudo label is determined according to the color of each pixel in the boundary box.
6. The leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The shape features include aspect ratio and perimeter, which are obtained by calculating the spatial distribution of pixels in a pixel-level segmentation map.
7. The leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The state space of the deep Q network model includes disease detection information, environmental parameter data, and growth indicators. The disease detection information includes disease categories and disease grade scores. The action space of the deep Q network model includes adjusting light intensity, adjusting temperature, adjusting humidity, and adjusting ventilation.
8. The leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The deep Q network model reward function is: R=ω1·Δoutput+ω2·Δquality-ω3·Δenergy consumption Among them, R is the reward function, ω1, ω2, and ω3 are weight parameters, Δyield, Δquality, and Δenergy consumption are the increments of leafy vegetable yield, quality, and growth energy consumption, respectively.
9. The leafy vegetable disease detection and control method based on deep learning according to claim 1, characterized in that: The actuators include LED lamps, air conditioners, humidifiers and ventilation equipment. The adjustment of the growth environment of leafy vegetables through the actuators according to the optimal planting strategy includes changing the light intensity by adjusting the power or lighting duration of the LED lamps, adjusting the temperature through the air conditioner, adjusting the humidity through the humidifier, controlling the switch or wind speed of the ventilation equipment, and adjusting the air circulation.
10. A leafy vegetable disease detection and control system based on deep learning, characterized in that: include: The disease detection module is used to regularly collect growth images of leafy vegetables through a digital camera, process the images based on the pre-trained improved DETR model, determine whether the leafy vegetables are diseased, and output the boundary box of the diseased area and the disease category; The disease segmentation module is used to receive the growth image output by the disease detection module, further segment the diseased area at the pixel level, and adopt a weakly supervised segmentation method based on a bounding box to obtain a pixel-level segmentation map of each diseased area; The feature analysis module is used to extract information such as color features, shape features, and area features from the diseased area in the pixel-level segmentation map, and to grade the disease based on these features, thereby quantitatively grading the disease symptoms; The reinforcement learning control module is used to receive environmental parameter data, growth indicators of leafy vegetables, disease grade scores and disease category information, generate the optimal planting strategy in combination with the deep Q network model, and adjust the leafy vegetable growth environment parameters through the actuator; The actuator is used to adjust environmental parameters such as light intensity, temperature, humidity and ventilation according to the optimal planting strategy generated by the reinforcement learning control module, including adjusting light intensity through LED lights, adjusting temperature through air conditioners, adjusting humidity through humidifiers, and controlling the wind speed or opening status of ventilation equipment, so as to optimize the growth environment of leafy vegetables, maximize yield and quality, and minimize energy consumption.
Citation Information
Patent Citations
Tongue body image segmentation method based on weak supervised learning
CN111242940A
High-resolution remote sensing image weak supervision building extraction method
CN113436204A
Rice leaf disease image detection method, device and equipment and storage medium
CN116205893A
Deep learning-based tomato disease and insect pest detection and identification method
CN116630803A
Target detection method and device and computer equipment
CN116758277A
Cited By
Automatic rating method, device and equipment for corn leaf spot, and storage medium
CN121213996A