A Deep Learning-Based Method and System for Detection and Control of Leafy Vegetable Diseases
By using an improved DETR model and a deep Q-network, combined with weakly supervised segmentation and environmental control techniques, the problems of low efficiency and inflexible environmental control in traditional disease identification methods have been solved. This has enabled automated and accurate disease detection and intelligent environmental management, thereby improving the yield and quality of leafy vegetables.
Patent Information
- Application Number
- CN202411818475.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Traditional methods for identifying leafy vegetable diseases rely on manual observation, which is inefficient and inaccurate, making it difficult to meet the real-time monitoring needs of large-scale planting. Furthermore, traditional disease detection algorithms lack the accuracy and convergence speed for detecting small targets in complex agricultural environments, making it difficult to adapt to dynamic environmental changes.
An improved DETR model combined with a sparse attention mechanism is used for disease detection, a weakly supervised segmentation method based on bounding boxes is used for pixel-level segmentation, a deep Q-network model is used for environmental regulation, data is collected through digital cameras and sensors, the optimal planting strategy is generated, and environmental parameters are adjusted by an actuator.
It achieves automated, rapid, and accurate disease identification and environmental control, improves the detection accuracy of small targets, reduces labeling costs, can adapt to environmental changes in real time, optimizes leafy vegetable growth conditions, reduces disease incidence, and improves yield and quality.
Smart Images

Figure CN119863061B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural disease and environmental control technology, specifically relating to a method and system for detecting and controlling leafy vegetable diseases based on deep learning. Background Technology
[0002] In plant factories or other agricultural production environments, leafy vegetables are often affected by diseases such as leaf spot and heartburn, or by environmental stresses during their growth. These problems are difficult to completely avoid and usually lead to a decline in the yield and quality of leafy vegetables, resulting in economic losses. With the increasing demand for high yields and high quality, effectively dealing with diseases and stresses has become a key aspect of production management.
[0003] In the prevention and control of leafy vegetable diseases, the primary task is to achieve rapid and accurate disease identification, including determining the type of disease, identifying its location and extent, and assessing its severity. With accurate disease information, managers can take timely and targeted control measures, thereby ensuring production stability and improving economic efficiency. Traditional disease identification methods mainly rely on manual observation and judgment, which is time-consuming, labor-intensive, and inaccurate, especially in large-scale planting where manual identification cannot meet the needs of real-time monitoring. In recent years, computer vision technology has been widely used in agriculture and is increasingly being applied to disease detection. Automatic identification of leafy vegetable diseases through image recognition methods has significantly improved detection efficiency and accuracy.
[0004] Among current detection algorithms, DETR (Detection Transformer), as the first Transformer-based end-to-end object detection model, has shown great potential in global attention and has significant advantages in complex scenes and multi-object detection. However, DETR has shortcomings in small object detection accuracy and convergence speed, especially in complex agricultural scenes, where it often struggles to accurately identify small targets such as lesions, thus limiting detection performance. Furthermore, agricultural images exhibit diverse disease morphologies, complex lighting, and backgrounds, making traditional global attention ineffective in such scenarios. Therefore, to further improve detection performance, the model needs optimization to achieve breakthroughs in small object detection and convergence efficiency, enhancing its applicability and stability in complex agricultural environments. In disease detection, pixel-level annotation is crucial for achieving fine segmentation, but due to its high cost and time consumption, and the need for annotators with advanced expertise, its widespread use on large-scale datasets is difficult.
[0005] After obtaining disease information through image recognition, appropriate environmental control is needed to prevent disease spread 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, making it difficult for a single control method to fully meet their growth needs. Traditional control methods typically rely on the experience of staff and are ill-suited to adapting to the dynamic changes and complexity of the environment. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a method and system for detecting and controlling leafy vegetable diseases based on deep learning.
[0007] The objective of this invention can be achieved through the following technical solutions:
[0008] This invention provides a deep learning-based method for detecting and regulating leafy vegetable diseases, comprising the following steps:
[0009] Step S1: Regularly collect 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.
[0010] Step S2: Preprocess the growth images of leafy vegetables;
[0011] Step S3: Input the pre-processed leafy vegetable growth image into the pre-trained improved DETR model for disease detection, determine whether the growth image is diseased, if diseased, output the bounding box of the diseased area in the growth image and the disease category, and execute step S4; if no diseased, no output is output.
[0012] Step S4: The growth image after disease detection is segmented using a weakly supervised segmentation method based on bounding boxes to obtain pixel-level segmentation maps of each disease region;
[0013] Step S5: Extract features from the pixel-level segmentation map of each disease area, extracting the color features, shape features, and area features of each disease area. Based on the disease category output in Step S3 and the color features, shape features, and area features of each disease area, classify and quantify the disease symptoms to generate a disease level score.
[0014] Step S6: Obtain the growth indicators of leafy vegetables, including leaf area index and plant height. Input the disease level score, disease category, growth indicators and environmental parameter data into the pre-trained deep Q network model to obtain the optimal planting strategy. Based on the optimal planting strategy, adjust the growth environment of leafy vegetables through the execution mechanism.
[0015] Furthermore, the preprocessing of the leafy vegetable growth image includes 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 from the input image; the encoder performs global modeling of the features; the decoder combines the target query embedding to decode the target information layer by layer; and the prediction head outputs the bounding box information of the image and the disease detection results with the disease category label.
[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] Furthermore, step S4 includes the following steps:
[0019] After disease detection, the growth image is labeled with pseudo-labels for each pixel within the bounding box using a boundary detection algorithm.
[0020] The labeled growth image is input into a pre-trained convolutional neural network ResNet for pixel-level segmentation, and the initial pixel-level segmentation map of each disease region in the growth image is output. The initial pixel-level segmentation map of each disease region is then processed by CRF post-processing to obtain the pixel-level segmentation map of each disease region.
[0021] The pseudo-labels include 1 and 0, where 1 represents a diseased area and 0 represents a healthy area. The pseudo-labels are determined by the color of each pixel within the bounding box.
[0022] Furthermore, the shape features include aspect ratio and perimeter, which are obtained by calculating the spatial distribution of pixels within 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 category and disease level score. The action space of the deep Q-network model includes adjusting light intensity, adjusting temperature, adjusting humidity, and adjusting ventilation.
[0024] Furthermore, the reward function of the deep Q-network model is:
[0025] R = ω1·Δoutput + ω2·Δquality - ω3·Δenergy consumption
[0026] Where R is the reward function, ω1, ω2, and ω3 are weight parameters, and Δyield, Δquality, and Δenergy consumption are the increments of leafy vegetable yield, quality, and growth energy consumption, respectively.
[0027] Furthermore, the actuator includes LED lights, air conditioners, humidifiers, and ventilation equipment. The adjustment of the leafy vegetable growth environment by the actuator according to the optimal planting strategy includes changing the light intensity by adjusting the power or duration of the LED lights, regulating the temperature by the air conditioner, regulating the humidity by the humidifier, and adjusting the air circulation by controlling the on / off switch or wind speed of the ventilation equipment.
[0028] Another aspect of the present invention provides a deep learning-based leafy vegetable disease detection and control system, comprising:
[0029] The disease detection module is used to periodically collect growth images of leafy vegetables using a digital camera, process the images based on a pre-trained improved DETR model, determine whether the leafy vegetables are diseased, and output the bounding box of the diseased area and the disease category.
[0030] The disease segmentation module receives the growth image output by the disease detection module, performs further pixel-level segmentation of the disease area, and uses a weakly supervised segmentation method based on bounding boxes to obtain pixel-level segmentation images of each disease area.
[0031] The feature analysis module is used to extract information such as color features, shape features, and area features from the diseased areas in the pixel-level segmentation map, and to score the disease level based on these features, thereby quantifying and classifying the disease symptoms.
[0032] The reinforcement learning control module is used to receive environmental parameter data, leafy vegetable growth indicators, disease level scores and disease category information, combine them with a deep Q-network model to generate the optimal planting strategy, and adjust the leafy vegetable growth environment parameters through the execution mechanism.
[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. This includes adjusting light intensity through LED lights, adjusting temperature through air conditioning, adjusting humidity through humidifiers, and controlling the wind speed or on / off status of ventilation equipment 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. This invention uses the grading and quantification of disease detection as a key factor in environmental control, assisting in the formulation of control strategies for environmental parameters such as light, temperature, and humidity, thereby improving the accuracy and rationality of control. While increasing yield and reducing energy consumption, it effectively reduces the incidence of diseases, ensuring the healthy growth of leafy vegetables.
[0036] 2. Compared with traditional manual identification and control methods, this invention achieves automated disease identification and environmental control. The system response is faster and more accurate, and it can detect the health status of leafy vegetables in real time and adjust environmental parameters in real time according to the strategy, which greatly improves production management efficiency and enhances the economic benefits of planting.
[0037] 3. This invention employs a weakly supervised segmentation method based on bounding boxes, which reduces the reliance on pixel-level annotation, significantly reduces annotation costs, lessens the dependence on professional annotators, and improves the system's application efficiency on large-scale datasets while ensuring segmentation accuracy.
[0038] 4. This invention employs 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 lesions and other minor diseases). This is difficult to achieve in traditional target detection methods, significantly improving the accuracy of disease identification, especially in complex contexts.
[0039] 5. This invention automatically grades and quantifies diseases by extracting features from diseased areas, assessing the severity of diseases based on features such as color, shape, and area. This process requires no manual intervention, greatly improving the efficiency and accuracy of disease assessment and helping production managers to take timely and targeted prevention and control measures.
[0040] 6. This invention combines a deep Q-network model to achieve intelligent environmental control by inputting disease detection results, environmental parameters, and growth indicators. This model can dynamically generate optimal planting strategies based on real-time data and automatically adjust environmental parameters such as light intensity, temperature, humidity, and ventilation through actuators to improve the growth quality and disease resistance of leafy vegetables. This environmental control method is more flexible and efficient than traditional manual control, adapting to environmental changes in real time, optimizing growth conditions for leafy vegetables, and reducing disease occurrence.
[0041] 7. This invention significantly reduces the risk of decreased yield and quality of leafy vegetables due to diseases by achieving precise detection, timely assessment, and automated control of diseases. Through intelligent control and optimization of the growing environment, this invention can improve the yield and quality of leafy vegetables while reducing the possibility of disease spread, thereby effectively reducing economic losses during the production process.
[0042] 8. Traditional methods of disease detection and control rely on manual observation and judgment, which is not only inefficient but also prone to errors. The deep learning technology of this invention automatically identifies and analyzes diseases, significantly reducing manual intervention and operations, lowering labor costs, and improving production efficiency. Furthermore, this invention has strong applicability and scalability, and can be widely applied to large-scale agricultural production and plant factories. Attached Figure Description
[0043] Figure 1 This is a flowchart of the method of the present invention;
[0044] Figure 2 This is a schematic diagram of the system structure of the present invention;
[0045] Figure 3 This is a schematic diagram of the disease detection module of the present invention;
[0046] Figure 4 This is a schematic diagram of the disease segmentation module of the present invention;
[0047] Figure 5 This is a system workflow diagram of the present invention. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0049] Example 1:
[0050] This embodiment provides a deep learning-based method for detecting and controlling leafy vegetable diseases, such as... Figure 1 As shown, it includes the following steps:
[0051] Step S1: Regularly collect growth images and environmental parameter data of leafy vegetables. Growth images are collected using a digital camera, and environmental parameters are collected in real time using sensors, including temperature, humidity, and light intensity.
[0052] Step S2: Preprocess the growth images of leafy vegetables;
[0053] Step S3: Input the pre-processed leafy vegetable growth image into the pre-trained improved DETR model for disease detection, determine whether the growth image is diseased, if diseased, output the bounding box of the diseased area in the growth image and the disease category, and execute step S4; if no diseased, no output is output.
[0054] Step S4: The growth image after disease detection is segmented using a weakly supervised segmentation method based on bounding boxes to obtain pixel-level segmentation maps of each disease region;
[0055] Step S5: Extract features from the pixel-level segmentation map of each disease area, extracting the color features, shape features, and area features of each disease area. Based on the disease category output in Step S3 and the color features, shape features, and area features of each disease area, classify and quantify the disease symptoms to generate a disease level score.
[0056] Step S6: Obtain the growth indicators of leafy vegetables, including leaf area index and plant height. Input the disease level score, disease category, growth indicators and environmental parameter data into the pre-trained deep Q network model to obtain the optimal planting strategy. Based on the optimal planting strategy, adjust the growth environment of leafy vegetables through the execution mechanism.
[0057] The process involves preprocessing images of leafy vegetables, including image enhancement, noise removal, and scale transformation.
[0058] The improved DETR model includes a backbone network, an encoder, a decoder, and a prediction head. The backbone network extracts features from the input image; the encoder performs global modeling of the features; the decoder combines the target query embedding to decode the target information layer by layer; and the prediction head outputs the bounding box information of the image and the disease detection results with the disease category label.
[0059] Among them, the improved DETR model introduces a sparse attention mechanism in the encoder and decoder, which introduces spatial prior information for the target query.
[0060] Step S4 includes the following steps:
[0061] After disease detection, the growth image is labeled with pseudo-labels for each pixel within the bounding box using a boundary detection algorithm.
[0062] The labeled growth image is input into a pre-trained convolutional neural network ResNet for pixel-level segmentation, and the initial pixel-level segmentation map of each disease region in the growth image is output. The initial pixel-level segmentation map of each disease region is then processed by CRF post-processing to obtain the pixel-level segmentation map of each disease region.
[0063] The pseudo-labels include 1 and 0, where 1 represents a diseased area and 0 represents a healthy area. The pseudo-labels are determined by the color of each pixel within the bounding box.
[0064] The shape features include aspect ratio and perimeter, which are obtained by calculating the spatial distribution of pixels within the pixel-level segmentation map.
[0065] 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 category and disease level score. The action space of the deep Q-network model includes adjusting light intensity, adjusting temperature, adjusting humidity, and adjusting ventilation.
[0066] The reward function for the deep Q-network model is:
[0067] R = ω1·Δoutput + ω2·Δquality - ω3·Δenergy consumption
[0068] Where R is the reward function, ω1, ω2, and ω3 are weight parameters, and Δyield, Δquality, and Δenergy consumption are the increments of leafy vegetable yield, quality, and growth energy consumption, respectively.
[0069] The actuators include LED lights, air conditioners, humidifiers, and ventilation equipment. Based on the optimal planting strategy, the actuators adjust the growth environment of leafy vegetables, including changing the light intensity by adjusting the power or duration of LED lights, regulating the temperature by air conditioning, regulating the humidity by humidifiers, and adjusting the air circulation by controlling the on / off state or fan speed of ventilation equipment.
[0070] Another aspect of this embodiment provides a deep learning-based leafy vegetable disease detection and control system, including:
[0071] The disease detection module is used to periodically collect growth images of leafy vegetables using a digital camera, process the images based on a pre-trained improved DETR model, determine whether the leafy vegetables are diseased, and output the bounding box of the diseased area and the disease category.
[0072] The disease segmentation module receives the growth image output by the disease detection module, performs pixel-level segmentation of the disease area, and uses a weakly supervised segmentation method based on bounding boxes to obtain pixel-level segmentation images of each disease area.
[0073] The feature analysis module is used to extract information such as color features, shape features, and area features from the diseased areas in the pixel-level segmentation map, and to score the disease level based on these features, thereby quantifying and classifying the disease symptoms.
[0074] The reinforcement learning control module is used to receive environmental parameter data, leafy vegetable growth indicators, disease level scores and disease category information, combine them with a deep Q-network model to generate the optimal planting strategy, and adjust the leafy vegetable growth environment parameters through the execution mechanism.
[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. This includes adjusting light intensity through LED lights, adjusting temperature through air conditioning, adjusting humidity through humidifiers, and controlling the wind speed or on / off status of ventilation equipment to optimize the growth environment of leafy vegetables, maximize yield and quality, and minimize energy consumption.
[0076] Example 2:
[0077] The parts not mentioned in this embodiment are the same as in Embodiment 1.
[0078] like Figure 2 As shown, this embodiment provides a deep learning-based system for detecting and controlling leafy vegetable diseases. The system includes a disease detection module, a disease segmentation module, a feature analysis module, and a reinforcement learning control module. Taking lettuce, widely grown in plant factories, as an example, lettuce often exhibits heartburn symptoms due to its rapid growth rate during greenhouse cultivation. This manifests as chlorosis and drying of leaf edges, forming brown patches. Heartburn is closely related to environmental factors such as light conditions, temperature, and humidity; therefore, environmental control is necessary to ensure its healthy growth. The system workflow is as follows: Figure 5 As shown, it includes the following steps:
[0079] 1. Regularly collect images and data of leafy vegetables as basic information for system analysis.
[0080] Digital cameras are installed to periodically collect image data of lettuce grown in the plant factory. The collected image data is processed using Labelme annotation software, including bounding box annotations and a small amount of pixel-level annotations, and the annotated data is divided into training and validation sets. 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: Monitors the health status of leafy vegetables in real time, identifies and locates diseased areas.
[0082] The disease detection module employs an improved DETR model, which includes a backbone network, encoder, decoder, and prediction head. The backbone network extracts features from the input image; the encoder performs global modeling of these features; the decoder embeds target information layer by layer, combining it with a target query; and the prediction head module outputs the disease detection results, including bounding box positions and category labels. The module analyzes the collected image data using target detection technology. The model first extracts image features through the backbone network, performs global modeling using the encoder, and then uses the decoder to generate predictions of disease areas based on target queries, ultimately outputting the bounding box positions and category labels of the disease areas. This module can accurately identify the health status of leafy vegetables, quickly detect tipburn, and locate disease areas, providing input data for the segmentation module. The process is as follows: Figure 3As shown, the improved DETR model introduces a sparse attention mechanism in both the encoder and decoder to reduce computation and enhance the model's focus on key regions. Simultaneously, it incorporates spatial prior information, such as anchor points or reference points, into the target query to improve target localization accuracy and the detection of small targets. For example, an input image of 3×800×1066 is downsampled using ResNet to generate a feature map, which is then dimensionality-reduced to a size of 256×25×34. After adding positional encoding, this feature map is input to the Transformer encoder to extract global features, resulting in an output size of 850×256. The decoder receives the encoder output and the object query, and outputs the target features after passing through multiple attention mechanisms. Finally, binary matching is used to generate the target category and bounding box.
[0083] 3. Disease Segmentation Module: Performs pixel-level segmentation of the diseased area to obtain accurate disease outlines.
[0084] The lesion segmentation module employs a weakly supervised segmentation method based on bounding boxes. Pixel-level pseudo-labels are extracted from images annotated with bounding boxes for model training and optimization. Further training of the segmentation model achieves pixel-level lesion region segmentation. During segmentation, a boundary detection algorithm is combined to optimize the accuracy of the pseudo-labels, and a CRF post-processing operation is added after the segmentation results to enhance the detailed segmentation of lesion region edges, ensuring the output of high-precision burnt core region contours. The process is as follows: Figure 4 As shown in the figure. Among them, the weakly supervised segmentation method introduces a boundary detection algorithm when generating pseudo-labels to improve 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 edges.
[0085] 4. Feature Analysis Module: Extracts and quantifies disease characteristics to provide a basis for regulation and control.
[0086] The feature analysis module analyzes the segmented burnt area image, extracting features such as color, shape, and area. Color features are extracted by converting the affected area to the HSV color space; shape features are obtained by calculating the aspect ratio, perimeter, and area of the affected area pixels. Based on the extracted features, the system quantifies and grades the disease symptoms and generates a disease level score.
[0087] 5. Reinforcement Learning Control Module: Generates optimal environmental control strategies 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 reward functions with yield, quality and energy consumption as the core, and generates the optimal environmental control strategy through reinforcement learning algorithm.
[0089] 6. Based on the generated control strategy, the environmental parameters are intelligently adjusted by the actuator.
[0090] The actuators within the plant factory include humidifiers, air conditioners, LED lights, and ventilation equipment, which dynamically adjust the environmental parameters of leafy vegetables according to generated control strategies. For example, when heartburn occurs, the system appropriately suppresses photosynthetic intensity by reducing the power of LED lights or shortening the light exposure time, preventing the lettuce from growing too quickly; simultaneously, it turns off the humidifier and turns on the ventilation equipment to reduce ambient humidity and promote transpiration from the lettuce leaves. The system precisely controls the actuators based on the control strategies, intelligently adjusting environmental parameters such as light and humidity to mitigate the effects of heartburn, provide a suitable growing environment for the crop, promote healthy growth, and achieve efficient and intelligent environmental management.
[0091] This invention combines computer vision technology with reinforcement learning methods to achieve intelligent management of leafy vegetables. By collecting images of leafy vegetable growth and environmental data, deep learning technology is used to accurately detect and quantify leafy vegetable diseases. The reinforcement learning module comprehensively analyzes disease information and environmental data to formulate optimal planting strategies and intelligently adjusts environmental parameters such as light, temperature, and humidity based on these strategies. This effectively reduces the occurrence of leafy vegetable diseases, improves leafy vegetable quality and yield, while reducing energy consumption, optimizing resource utilization, and enhancing the economic benefits of planting. In practical applications, this invention not only meets the needs of disease monitoring and environmental control but also significantly reduces reliance on manual experience, solving the problems of low efficiency and high costs in traditional agricultural production. It can promote the advancement of agricultural technology and has broad application prospects and social value.
[0092] If the aforementioned functions are implemented as 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting and controlling leafy vegetable diseases based on deep learning, characterized in that, Includes the following steps: Step S1: Regularly collect 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. Step S2: Preprocess the growth images of leafy vegetables; Step S3: Input the pre-processed leafy vegetable growth image into the pre-trained improved DETR model for disease detection, determine whether the growth image is diseased, if diseased, output the bounding box of the diseased area in the growth image and the disease category, and execute step S4; if no diseased, no output is output. Step S4: The growth image after disease detection is segmented using a weakly supervised segmentation method based on bounding boxes to obtain pixel-level segmentation maps of each disease region; Step S5: Extract features from the pixel-level segmentation map of each disease area, extracting the color features, shape features, and area features of each disease area. Based on the disease category output in Step S3 and the color features, shape features, and area features of each disease area, classify and quantify the disease symptoms to generate a disease level score. Step S6: Obtain the growth indicators of leafy vegetables, including leaf area index and plant height. Input the disease level score, disease category, growth indicators and environmental parameter data into the pre-trained deep Q network model to obtain the optimal planting strategy. Based on the optimal planting strategy, adjust the growth environment of leafy vegetables through the execution mechanism. The improved DETR model introduces a sparse attention mechanism in the encoder and decoder, thereby introducing spatial prior information for the target query.
2. The method for detecting and controlling leafy vegetable diseases based on deep learning according to claim 1, characterized in that, The preprocessing of the leafy vegetable growth images includes image enhancement, noise removal, and scale transformation.
3. The method for detecting and controlling leafy vegetable diseases 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. The backbone network extracts features from the input image, and the encoder performs global modeling of the features. The decoder combines the target query embedding to decode the target information layer by layer; the prediction head outputs the bounding box information of the image and the disease detection results of the disease category label.
4. The method for detecting and controlling leafy vegetable diseases based on deep learning according to claim 1, characterized in that, Step S4 includes the following steps: After disease detection, the growth image is labeled with pseudo-labels for each pixel within the bounding box using a boundary detection algorithm. The labeled growth image is input into a pre-trained convolutional neural network ResNet for pixel-level segmentation, and the initial pixel-level segmentation map of each disease region in the growth image is output. The initial pixel-level segmentation map of each disease region is then processed by CRF post-processing to obtain the pixel-level segmentation map of each disease region. The pseudo-labels include 1 and 0, where 1 represents a diseased area and 0 represents a healthy area. The pseudo-labels are determined by the color of each pixel within the bounding box.
5. The method for detecting and controlling leafy vegetable diseases 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 within a pixel-level segmentation map.
6. The method for detecting and controlling leafy vegetable diseases 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 category and disease level score. The action space of the deep Q-network model includes adjusting light intensity, adjusting temperature, adjusting humidity, and adjusting ventilation.
7. The method for detecting and controlling leafy vegetable diseases based on deep learning according to claim 1, characterized in that, The reward function for the deep Q-network model is: in, For the reward function, These are weight parameters. , , These represent the increases in yield, quality, and growth energy consumption of leafy vegetables, respectively.
8. The method for detecting and controlling leafy vegetable diseases based on deep learning according to claim 1, characterized in that, The actuator includes LED lights, air conditioners, humidifiers, and ventilation equipment. Adjusting the growth environment of leafy vegetables according to the optimal planting strategy through the actuator includes changing the light intensity by adjusting the power or duration of the LED lights, regulating the temperature by the air conditioner, regulating the humidity by the humidifier, and adjusting the air circulation by controlling the on / off state or the fan speed of the ventilation equipment.
9. A deep learning-based system for detecting and controlling leafy vegetable diseases, characterized in that, include: The disease detection module is used to periodically collect growth images of leafy vegetables using a digital camera, process the images based on a pre-trained improved DETR model, determine whether the leafy vegetables are diseased, and output the bounding box of the diseased area and the disease category; the improved DETR model introduces a sparse attention mechanism in the encoder and decoder to introduce spatial prior information for the target query. The disease segmentation module receives the growth image output by the disease detection module, performs further pixel-level segmentation of the disease area, and uses a weakly supervised segmentation method based on bounding boxes to obtain pixel-level segmentation images of each disease area. The feature analysis module is used to extract color features, shape features, and area features from the diseased areas in the pixel-level segmentation map, and to score the disease level based on these features, thereby quantifying and classifying the disease symptoms. The reinforcement learning control module is used to receive environmental parameter data, leafy vegetable growth indicators, disease level scores and disease category information, combine them with a deep Q-network model to generate the optimal planting strategy, and adjust the leafy vegetable growth environment parameters through the execution mechanism. The actuator is used to adjust light intensity, temperature, humidity and ventilation parameters according to the optimal planting strategy generated by the reinforcement learning control module. This includes adjusting light intensity through LED lights, adjusting temperature through air conditioning, adjusting humidity through humidifiers, and controlling the wind speed or on / off status of ventilation equipment 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