Intelligent agricultural management and disease identification method and system

CN122530828APending Publication Date: 2026-08-07NANCHANG CAMPUS OF JIANGXI UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611000027.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0005]基于此,本发明的目的是提供一种智慧农业管理与病害识别方法及系统,以解决现有技术对植物病虫害的检测精度较低的问题

Benefits of technology

[0007]本发明的有益效果是:本技术方案有效解决了现有智慧农业管理与病害识别精度偏低的行业痛点,通过定制化采集装置获取贴合实际种植场景的原始植物图像,并配合精准的病斑区域标注构建专属目标数据集,从数据源头消除了通用数据集场景偏差大、标注粒度粗导致的识别误差;基于PyTorch框架训练优化后的YOLOv11模型,充分发挥其小目标检测与实时推理优势,显著提升了早期微小病斑的识别准确率与模型泛化能力;同时支持图片、离线视频及实时摄像头视频流多模态输入,可适配田间巡检、定点监测等多样化应用场景;最终通过自动生成并推送针对性农业处理建议,实现了病虫害从精准识别到科学处置的全流程闭环,大幅降低了农户的防控成本与作物减产风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122530828A_ABST
    Figure CN122530828A_ABST
Patent Text Reader

Abstract

The application provides a smart agricultural management and disease identification method and system, which comprises the following steps: collecting original plant images through a preset acquisition device to construct an image dataset, and labeling the disease spot area in each original plant image through a preset program to generate a corresponding label file; combining the image dataset and the label file to form a corresponding target dataset, and training a preset YOLOv11 model based on the target dataset to generate a corresponding disease and pest identification model; inputting the user-uploaded crop disease picture or crop disease video or camera-acquired video stream into the disease and pest identification model for disease identification inference and outputting the disease category and confidence; and automatically generating an agricultural treatment suggestion according to the disease category and confidence and pushing the suggestion to the user. The application can greatly improve the detection efficiency of plant diseases and pests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural testing technology, and in particular to a smart agricultural management and disease identification method and system. Background Technology

[0002] With the rapid development of artificial intelligence, the Internet of Things, and deep learning technologies, smart agriculture has become a core direction for the transformation and upgrading of modern agriculture. Accurate detection and control of plant diseases are crucial for ensuring crop yield and quality. Traditional agricultural disease detection mainly relies on manual inspections by agricultural technicians, who periodically enter greenhouses or farmlands to observe the condition of plant leaves, fruits, and stems to determine disease status. This method suffers from inherent drawbacks such as low efficiency, high cost, strong subjectivity, and difficulty in large-scale deployment. Currently, some deep learning-based plant disease identification systems have begun to be applied in agricultural production scenarios. Most of these systems use target detection models such as YOLOv5 and YOLOv8 to locate lesions on plant leaves, and then use convolutional neural networks to classify the diseases, thus improving the automation level of disease detection to some extent.

[0003] However, existing deep learning-based plant disease identification systems still face numerous technical bottlenecks. Regarding identification accuracy, traditional target detection models are easily affected by factors such as light variations, leaf shading, background interference, and small lesion areas in complex agricultural environments, frequently resulting in missed or false detections. In terms of data utilization, most existing systems rely solely on single image information for identification, failing to effectively integrate multi-dimensional environmental data such as soil temperature and humidity, nitrogen, phosphorus, and potassium content, air temperature and humidity, and light intensity, thus failing to accurately reflect the true growth status of plants. Regarding system functionality, most systems can only output disease categories, unable to automatically generate targeted agricultural treatment suggestions, and generally lack video stream detection, real-time camera detection, and backend equipment management functions, resulting in weak data visualization capabilities and difficulty in dynamically analyzing and graphically displaying sensor data. Furthermore, existing systems often separate disease identification, equipment management, greenhouse management, and user management modules, lacking a unified agricultural management platform, leading to low agricultural management efficiency and a lack of unified data control.

[0004] In-depth analysis reveals that the fundamental reasons for the aforementioned shortcomings in existing technologies are as follows: First, traditional convolutional neural networks have limited ability to extract features from small targets of agricultural diseases, making it difficult to accurately capture the characteristic information of subtle lesions; second, there is a lack of effective data linkage mechanisms between the environmental monitoring data acquisition module and the disease identification system, hindering the fusion and analysis of multimodal data; third, the absence of a large language model to construct an agricultural intelligent question-and-answer system makes it difficult to generate personalized and implementable treatment solutions based on disease conditions; and fourth, the lack of an integrated front-end and back-end smart agriculture management architecture prevents the integrated operation of functions such as disease identification, environmental monitoring, and equipment management. Therefore, there is an urgent need to develop a smart agriculture management and disease identification system that integrates disease identification, environmental monitoring, AI intelligent suggestions, data analysis, and agricultural back-end management to meet the development needs of modern smart agriculture. Summary of the Invention

[0005] Based on this, the purpose of this invention is to provide a smart agricultural management and disease identification method and system to solve the problem of low detection accuracy of plant diseases and pests in existing technologies.

[0006] The first aspect of the present invention proposes: A smart agricultural management and disease identification method, wherein the method includes: Original plant images are acquired using a preset acquisition device to construct an image dataset, and diseased areas in each of the original plant images are marked using a preset program to generate corresponding annotation files. The image dataset and the annotation file are combined to form a corresponding target dataset. Based on the target dataset, the preset YOLOv11 model is trained using the PyTorch framework to generate a corresponding pest and disease identification model. The crop disease images or videos uploaded by users or video streams captured by cameras are input into the internal system of the pest and disease identification model to perform disease identification reasoning and output the disease category and confidence level. Agricultural treatment suggestions are automatically generated based on the disease category and the confidence level, and then pushed to the user accordingly.

[0007] The beneficial effects of this invention are as follows: This technical solution effectively solves the industry pain point of low accuracy in existing smart agriculture management and disease identification. It acquires original plant images that fit the actual planting scenario through customized acquisition devices, and constructs a dedicated target dataset with precise lesion area annotations, eliminating the identification errors caused by large scene deviations and coarse annotation granularity of general datasets from the data source. Based on the optimized YOLOv11 model trained on the PyTorch framework, it fully leverages its advantages in small target detection and real-time inference, significantly improving the accuracy of early small lesion identification and the model's generalization ability. It also supports multimodal input of images, offline videos, and real-time camera video streams, adapting to diverse application scenarios such as field inspections and fixed-point monitoring. Finally, by automatically generating and pushing targeted agricultural treatment suggestions, it realizes a closed loop of the entire process from accurate identification to scientific treatment of pests and diseases, greatly reducing farmers' prevention and control costs and crop yield reduction risks.

[0008] Furthermore, the step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the pest and disease identification model for disease identification and inference includes: When a user-uploaded image of a crop disease is detected, the image is standardized to generate a target image, wherein the pixel values ​​of the image are scaled to the range of [0,1]. The target image is input into the internal structure of the pest and disease identification model, so that the multi-level features in the target image are detected by the CSPDarknet backbone network, and the features are fused by the feature pyramid network, so that the target is detected in the feature map at different scales in the detection head part, and the disease area in the image is identified accordingly. Based on the described diseased area, complete the disease identification and reasoning.

[0009] Furthermore, the step of completing the disease identification reasoning based on the diseased area includes: When the diseased area is determined, the confidence level of the detection box corresponding to the diseased area is calculated, and the detection box with a confidence level in the preset confidence threshold is set as a valid disease detection box. The disease detection box is mapped to the corresponding position in the crop disease image, and the corresponding disease category label is added to complete the corresponding disease identification and reasoning.

[0010] Furthermore, the step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the pest and disease identification model for disease identification and inference includes: When a user-uploaded video of crop disease is detected, the video is parsed into a continuous frame sequence and read frame by frame at a fixed frame rate using OpenCV's VideoCapture interface. Each frame is converted into an image matrix in RGB format. The image matrix is ​​input into the internal structure of the pest and disease identification model to detect diseases, and after the detection is completed, a detection box and a category label are marked on each frame of the image. Each labeled image frame is encapsulated into a corresponding data stream using a FiaskResponse object, and the data stream is then subjected to statistical analysis and result storage processing.

[0011] Furthermore, the steps of performing statistical analysis and result storage processing on the data stream include: By monitoring the update results of the data stream, the corresponding video frames after rendering and annotation are obtained; The detection results of each video frame are aggregated and statistically analyzed to count the occurrence frequency of each disease and calculate the average confidence level. A structured disease list is generated based on the average confidence level of each disease, and the disease identification reasoning is completed accordingly.

[0012] Furthermore, the step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the pest and disease identification model for disease identification and inference includes: When the video stream captured by the camera is detected, each frame of the video stream is input into the internal structure of the pest and disease identification model to infer the detection box coordinates, pest category, and confidence level of each pest area. The detection box coordinates, the disease category, and the confidence level are encapsulated in JSON format and pushed to the front end via the WebSocket protocol for rendering and statistics, thereby completing the disease identification and inference.

[0013] Furthermore, the step of automatically generating agricultural treatment recommendations based on the disease category and the confidence level includes: The disease category and the confidence level are assembled into structured JSON data, which includes fields for severity, symptom description, treatment measures, preventive measures, recommended pesticides, and precautions. The key information in the structured JSON data is parsed out, and the key information is formatted and filled into a single disease or multiple disease object to render different prevention and control suggestion cards and card layouts according to the number of diseases. Agricultural treatment suggestions are automatically generated inside the prevention and control suggestion card.

[0014] The second aspect of the present invention proposes: A smart agricultural management and disease identification system, wherein the system includes: The acquisition module is used to acquire original plant images through a preset acquisition device to construct an image dataset, and to annotate the lesion areas in each of the original plant images through a preset program to generate corresponding annotation files; The training module is used to combine the image dataset and the annotation file into a corresponding target dataset, and to train the preset YOLOv11 model using the PyTorch framework based on the target dataset to generate the corresponding pest and disease identification model. The inference module is used to input the crop disease images or videos uploaded by the user or the video stream captured by the camera into the internal structure of the pest and disease identification model to perform disease identification inference and output the disease category and confidence level. The push module is used to automatically generate agricultural treatment suggestions based on the disease category and the confidence level, and push them to the user accordingly.

[0015] Furthermore, the reasoning module is specifically used for: When a user-uploaded image of a crop disease is detected, the image is standardized to generate a target image, wherein the pixel values ​​of the image are scaled to the range of [0,1]. The target image is input into the internal structure of the pest and disease identification model, so that the multi-level features in the target image are detected by the CSPDarknet backbone network, and the features are fused by the feature pyramid network, so that the target is detected in the feature map at different scales in the detection head part, and the disease area in the image is identified accordingly. Based on the described diseased area, complete the disease identification and reasoning.

[0016] Furthermore, the reasoning module is specifically used for: When the diseased area is determined, the confidence level of the detection box corresponding to the diseased area is calculated, and the detection box with a confidence level in the preset confidence threshold is set as a valid disease detection box. The disease detection box is mapped to the corresponding position in the crop disease image, and the corresponding disease category label is added to complete the corresponding disease identification and reasoning.

[0017] Furthermore, the reasoning module is specifically used for: When a user-uploaded video of crop disease is detected, the video is parsed into a continuous frame sequence and read frame by frame at a fixed frame rate using OpenCV's VideoCapture interface. Each frame is converted into an image matrix in RGB format. The image matrix is ​​input into the internal structure of the pest and disease identification model to detect diseases, and after the detection is completed, a detection box and a category label are marked on each frame of the image. Each labeled image frame is encapsulated into a corresponding data stream using a FiaskResponse object, and the data stream is then subjected to statistical analysis and result storage processing.

[0018] Furthermore, the reasoning module is specifically used for: By monitoring the update results of the data stream, the corresponding video frames after rendering and annotation are obtained; The detection results of each video frame are aggregated and statistically analyzed to count the occurrence frequency of each disease and calculate the average confidence level. A structured disease list is generated based on the average confidence level of each disease, and the disease identification reasoning is completed accordingly.

[0019] Furthermore, the reasoning module is specifically used for: When the video stream captured by the camera is detected, each frame of the video stream is input into the internal structure of the pest and disease identification model to infer the detection box coordinates, pest category, and confidence level of each pest area. The detection box coordinates, the disease category, and the confidence level are encapsulated in JSON format and pushed to the front end via the WebSocket protocol for rendering and statistics, thereby completing the disease identification and inference.

[0020] Furthermore, the push module is specifically used for: The disease category and the confidence level are assembled into structured JSON data, which includes fields for severity, symptom description, treatment measures, preventive measures, recommended pesticides, and precautions. The key information in the structured JSON data is parsed out, and the key information is formatted and filled into a single disease or multiple disease object to render different prevention and control suggestion cards and card layouts according to the number of diseases. Agricultural treatment suggestions are automatically generated inside the prevention and control suggestion card.

[0021] The third aspect of the present invention proposes: A computer includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the smart agriculture management and disease identification method as described above.

[0022] The fourth aspect of the present invention proposes: A readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the smart agriculture management and disease identification method as described above.

[0023] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0024] Figure 1 A flowchart of the intelligent agricultural management and disease identification method provided in the first embodiment of the present invention; Figure 2 This is a structural block diagram of the intelligent agricultural management and disease identification system provided in the third embodiment of the present invention.

[0025] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0026] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0027] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0029] Please see Figure 1The image shows the intelligent agricultural management and disease identification method provided in the first embodiment of the present invention. The intelligent agricultural management and disease identification method provided in this embodiment can train and optimize the YOLOv11 model based on the PyTorch framework, give full play to its advantages in small target detection and real-time inference, and significantly improve the accuracy of early small lesion identification and model generalization ability. At the same time, it supports multimodal input of images, offline videos and real-time camera video streams, and can be adapted to diverse application scenarios such as field inspection and fixed-point monitoring. Finally, by automatically generating and pushing targeted agricultural treatment suggestions, it realizes the whole process closed loop of pest and disease control from accurate identification to scientific treatment, which greatly reduces farmers' prevention and control costs and crop yield reduction risks.

[0030] Specifically, this embodiment provides: A smart agricultural management and disease identification method, wherein the method includes: Step S10: Collect original plant images using a preset acquisition device to construct an image dataset, and annotate the lesion areas in each of the original plant images using a preset program to generate corresponding annotation files; It's important to clarify that the "preset acquisition device" here doesn't refer to any random shooting equipment, but rather to standardized acquisition terminals that have undergone parameter calibration and scene adaptation. These include fixed high-definition cameras in the field, agricultural drones equipped with multispectral cameras, and handheld inspection terminals with light compensation modules. The core value of the preset device lies in unifying image acquisition standards, ensuring that images acquired at different times, locations, and by different operators maintain consistency in key indicators such as resolution, light intensity, shooting angle, and focus clarity. This prevents a decline in model generalization ability due to inconsistent data quality. When constructing the image dataset, the principles of diversity and representativeness must be followed. Not only should positive samples containing various lesions be collected, but also negative samples from healthy plants. Simultaneously, samples should cover different crop growth stages, different lighting conditions (sunny days, cloudy days, early morning, evening), different shooting distances, different lesion severity, and different regions to simulate the complex environment of the actual field.

[0031] Pre-defined programs typically refer to professional annotation tools such as LabelImg and LabelMe, or semi-automatic annotation systems developed based on pre-trained visual models. These systems standardize the annotation process, unify annotation formats, significantly improve annotation efficiency, and reduce subjective errors inherent in manual annotation. The annotation process requires accurately delineating the closed boundaries of lesions and labeling them with corresponding pest / disease category tags. This ultimately generates annotation files (usually in XML or TXT format) that correspond one-to-one with the original images. These files contain core information such as the bounding box coordinates and category number of the lesions. The sufficiency of this step is reflected in the fact that only by collecting a sufficient number of high-quality original images with comprehensive coverage and performing accurate and standardized lesion annotation can reliable training signals be provided for subsequent supervised learning. Its necessity lies in the fact that deep learning models are essentially data-driven; if the amount of data is insufficient, the samples are limited, or the annotations are incorrect, the model will suffer from severe overfitting, missed detections, or false detections, failing to meet the needs of practical applications.

[0032] Step S20: Combine the image dataset and the annotation file to form a corresponding target dataset, and train the preset YOLOv11 model using the PyTorch framework based on the target dataset to generate the corresponding pest and disease identification model. It's important to note that the target dataset is not simply a merge of files; it needs to be scientifically divided into training, validation, and test sets, typically in a 7:2:1 ratio. The training set is used for iterative updates of model parameters, the validation set is used for real-time monitoring of the model training process, adjusting hyperparameters, and preventing overfitting, and the test set is used to objectively evaluate the model's final performance after training. This partitioning is essential to ensure the model has good generalization ability; without it, it's impossible to determine if the model is overfitting or accurately assess its performance on unknown data.

[0033] The PyTorch framework employs a dynamic computation graph mechanism, offering flexible and convenient debugging. It boasts a rich library of computer vision tools and a robust ecosystem of pre-trained models, along with excellent GPU acceleration support, significantly shortening model training cycles. This makes it ideal for the rapid iteration needs of research and development in the agricultural field. YOLOv11, as the latest generation of single-stage object detection models, achieves an excellent balance between detection speed and accuracy. Its optimized C2f module extracts image features more efficiently, and the newly added attention mechanism significantly improves the detection capability for small targets. Since plant lesions mostly fall into the category of small targets, this characteristic makes it particularly suitable for pest and disease detection scenarios. During training, a transfer learning strategy is typically employed. Pre-trained weights of YOLOv11 on the COCO general dataset are loaded, and the general visual features learned by the pre-trained model are utilized for fine-tuning only on pest and disease target datasets. This not only significantly reduces the amount of data required for training but also accelerates model convergence and improves model performance. Simultaneously, data augmentation techniques such as random cropping, flipping, rotation, brightness adjustment, and mosaic enhancement are applied during training to further expand the effective training samples and enhance the model's adaptability to complex field environments. The sufficiency of this step is reflected in the fact that through scientific dataset partitioning, targeted framework and model selection, and the comprehensive application of transfer learning and data augmentation techniques, a pest and disease identification model with high accuracy, fast inference speed, and strong generalization ability can be trained. Its necessity lies in the fact that without these techniques, model training would require massive amounts of labeled data and extremely long training time, and the final performance would be difficult to meet the requirements of practical applications.

[0034] Step S30: Input the crop disease images or videos uploaded by the user or the video stream captured by the camera into the internal structure of the disease and pest identification model to perform disease identification reasoning and output the disease category and confidence level. It's important to note that supporting multiple input sources is designed to cover various application scenarios in agricultural production: user-uploaded images are suitable for offline diagnosis after farmers discover suspected diseases; uploaded videos are suitable for batch testing of a single field inspection video; and real-time video stream input from cameras is suitable for all-weather automated monitoring of large areas of farmland, enabling early detection and early warning of pests and diseases. This multi-source input design greatly enhances the method's practicality and applicability.

[0035] Consistent preprocessing is essential for ensuring the accuracy of model inference. If the preprocessing method differs from that used during training, it will cause a shift in the model's input distribution, leading to recognition errors. After preprocessing, the model extracts image features using a convolutional neural network, then simultaneously predicts bounding boxes and categories. Finally, a non-maximum suppression algorithm removes duplicate predicted boxes, retaining the detection results with the highest confidence, and ultimately outputting the specific category of the disease and its corresponding confidence score. Confidence score is a quantitative representation of the model's certainty regarding its prediction results, ranging from 0 to 1; a higher value indicates greater confidence in the prediction result. The sufficiency of this step lies in its ability to accurately and quickly process various agricultural disease data and output reliable recognition results by supporting multi-source inputs and a standardized inference process. Its necessity lies in the fact that only by achieving efficient and accurate inference can the trained model be transformed into a practically usable tool, providing a basis for subsequent prevention and control recommendations.

[0036] Step S40: Based on the disease category and the confidence level, agricultural treatment suggestions are automatically generated and pushed to the user accordingly.

[0037] It's important to note that the generation of agricultural treatment recommendations relies on a pre-built professional pest and disease knowledge base. This knowledge base stores detailed information on various crop pests and diseases, including disease patterns, symptoms, transmission routes, agricultural control measures, physical control measures, biological control measures, and chemical control measures. Chemical control measures specifically include the recommended pesticide name, active ingredient, concentration, application method, safety interval, and precautions. Based on the disease category output by the model, the system automatically matches the corresponding control plan from the knowledge base and can personalize the recommendations by considering factors such as the user's local climate, crop variety, and planting time, making the recommendations more targeted. Treatment recommendations are pushed out via various methods, including app notifications, SMS messages, and WeChat official account notifications, ensuring users receive the information promptly. The adequacy of this step is reflected in the fact that by establishing a comprehensive knowledge base of pests and diseases, generating personalized treatment suggestions based on disease categories and confidence levels, and promptly disseminating them through multiple channels, it can provide farmers with scientific and effective guidance for pest and disease control. Its necessity lies in the fact that if only disease categories are output without corresponding treatment suggestions, even if farmers know the diseases affecting their crops, they may not be able to take the correct control measures due to a lack of professional knowledge, thus failing to realize the practical application value of the detection methods.

[0038] Second Embodiment Furthermore, the step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the pest and disease identification model for disease identification and inference includes: When a user-uploaded image of a crop disease is detected, the image is standardized to generate a target image, wherein the pixel values ​​of the image are scaled to the range of [0,1]. The target image is input into the internal structure of the pest and disease identification model, so that the multi-level features in the target image are detected by the CSPDarknet backbone network, and the features are fused by the feature pyramid network, so that the target is detected in the feature map at different scales in the detection head part, and the disease area in the image is identified accordingly. Based on the described diseased area, complete the disease identification and reasoning.

[0039] Furthermore, the step of completing the disease identification reasoning based on the diseased area includes: When the diseased area is determined, the confidence level of the detection box corresponding to the diseased area is calculated, and the detection box with a confidence level in the preset confidence threshold is set as a valid disease detection box. The disease detection box is mapped to the corresponding position in the crop disease image, and the corresponding disease category label is added to complete the corresponding disease identification and reasoning.

[0040] Furthermore, the step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the pest and disease identification model for disease identification and inference includes: When a user-uploaded video of crop disease is detected, the video is parsed into a continuous frame sequence and read frame by frame at a fixed frame rate using OpenCV's VideoCapture interface. Each frame is converted into an image matrix in RGB format. The image matrix is ​​input into the internal structure of the pest and disease identification model to detect diseases, and after the detection is completed, a detection box and a category label are marked on each frame of the image. Each labeled image frame is encapsulated into a corresponding data stream using a FiaskResponse object, and the data stream is then subjected to statistical analysis and result storage processing.

[0041] Furthermore, the steps of performing statistical analysis and result storage processing on the data stream include: By monitoring the update results of the data stream, the corresponding video frames after rendering and annotation are obtained; The detection results of each video frame are aggregated and statistically analyzed to count the occurrence frequency of each disease and calculate the average confidence level. A structured disease list is generated based on the average confidence level of each disease, and the disease identification reasoning is completed accordingly.

[0042] Furthermore, the step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the pest and disease identification model for disease identification and inference includes: When the video stream captured by the camera is detected, each frame of the video stream is input into the internal structure of the pest and disease identification model to infer the detection box coordinates, pest category, and confidence level of each pest area. The detection box coordinates, the disease category, and the confidence level are encapsulated in JSON format and pushed to the front end via the WebSocket protocol for rendering and statistics, thereby completing the disease identification and inference.

[0043] Furthermore, the step of automatically generating agricultural treatment recommendations based on the disease category and the confidence level includes: The disease category and the confidence level are assembled into structured JSON data, which includes fields for severity, symptom description, treatment measures, preventive measures, recommended pesticides, and precautions. The key information in the structured JSON data is parsed out, and the key information is formatted and filled into a single disease or multiple disease object to render different prevention and control suggestion cards and card layouts according to the number of diseases. Agricultural treatment suggestions are automatically generated inside the prevention and control suggestion card.

[0044] Furthermore, it should be noted that the smart agriculture management and disease identification method provided in this embodiment is implemented based on a smart agriculture management and plant disease identification system using YOLOv11 and large model suggestions. This system adopts a front-end / back-end separation architecture, including: a front-end display module; a back-end business management module; a plant disease identification module; an environmental data acquisition module; an AI intelligent suggestion module; a data analysis and visualization module; and a user and equipment management module. Specifically, the front-end is developed using the Vue3 framework, combined with the ElementPlus component library and Alibaba Iconfont icon library for page display. The back-end uses the SpringBoot 2.3 framework for business logic processing and deploys the YOLOv11 deep learning model service using Flask. The database uses MySQL 8.0 to store user information, greenhouse information, and equipment inventory information.

[0045] 1. Plant Disease Identification Module The plant disease identification module mainly includes the following steps: (1) Image acquisition of plant diseases Plant images are captured using mobile phones, drones, cameras, or video equipment. The captured content includes: plant leaves; stems; fruits; diseased areas; and real-time greenhouse monitoring footage.

[0046] (2) Marking of diseased areas The LabelImg image annotation tool is used to annotate the diseased areas. Annotation content includes: disease boundary box; disease category; disease name; and image coordinate information. The system automatically generates the corresponding TXT annotation file.

[0047] (3) Constructing the dataset The image data and annotation files were combined to form a YOLO format dataset. The dataset was divided into three parts: training set, validation set, and test set. The training set accounted for 70%, the validation set for 20%, and the test set for 10%.

[0048] (4) YOLOv11 model training The YOLOv11 model was trained using the PyTorch framework. Following the default configuration provided by the official YOLOv11 documentation, the training parameters included: input size 640×640; batch size 16; epochs 300; adaptive learning rate adjustment; and GPU-accelerated training. Data augmentation techniques were employed during model training, including: random flipping; mosaic enhancement; random cropping; color perturbation; and lighting enhancement.

[0049] (5) Disease identification and reasoning After training, the model is deployed to the Flask service. When a user uploads an image, video, or accesses the camera, the system performs the following steps: image preprocessing; model inference; disease target detection; bounding box drawing; and output of disease category and confidence score.

[0050] (6) AI intelligent suggestion generation The system sends the identification results to the DeepSeek big model. The big model automatically generates agricultural treatment suggestions based on: disease type; disease severity; current environmental data; plant species. For example: whether spraying is needed; recommended pesticide type; watering suggestions; light adjustment suggestions; and greenhouse environment adjustment suggestions.

[0051] 2. Three methods for detecting diseases This invention supports three disease detection modes: (1) Image detection function Step 1: Image Upload and Preprocessing. After users upload images of crop diseases on the web page, the system first standardizes the images. Specifically, the image size is adjusted to the input size required by the YOLO11 model (e.g., 640x640), and normalization is performed to scale the pixel values ​​to the range of [0,1] to ensure that the model can correctly identify the features.

[0052] Step 2: Model Inference and Feature Extraction. The preprocessed images are fed into a YOLO11 model built on the Ultralytics framework for inference. The model extracts multi-level features from the images through its unique CSPDarknet backbone network, then performs feature fusion through a Feature Pyramid Network (FPN), and finally performs target detection on feature maps of different scales in the detection head to identify diseased areas in the images and calculate the confidence score of each detection box.

[0053] Step 3: Result Analysis and Visualization. The system filters out low-confidence detection results based on a user-defined confidence threshold (e.g., 0.5), retaining only valid disease detection boxes. Then, the system draws the detection boxes on the original image and adds corresponding disease category labels (e.g., "Tomato Late Blight"). Finally, the system returns the detection results and labeled images to the front-end. The front-end parses the returned JSON data, displays the detection boxes and category information on the page, and retrieves corresponding intelligent prevention and control suggestions from the disease knowledge base based on the detected disease type, displaying them on the far right of the page for user reference.

[0054] Throughout the process, users can also customize and select different weight files (such as pre-trained models for different crops) according to their detection needs, and flexibly adjust the confidence threshold to balance the accuracy and recall of detection.

[0055] (2) Video detection function Step 1: Video Upload and Frame Extraction. After the user uploads a video of crop diseases, the system first parses the video into a continuous frame sequence. Then, it reads the video frame by frame using OpenCV's VideoCapture interface at a fixed frame rate (e.g., 30fps). Each frame is converted into an RGB image matrix to ensure input compatibility for subsequent model inference.

[0056] Step 2: Real-time Inference and Streaming. Each image frame is fed into the YOLO11 model for disease detection. After inference, detection boxes and category labels are annotated on the image. Then, the data is encapsulated into a Multipart / x-mixed-replace format data stream using a FlaskResponse object and pushed to the front end frame by frame. The front end listens for data stream updates and renders the annotated video frames in real time to achieve video preview functionality, while simultaneously recording the detection results for each frame (disease name, confidence level).

[0057] Step 3: Statistical Analysis and Result Storage. After video processing, the system aggregates and statistically analyzes the detection results of all frames. Specifically, it counts the occurrence frequency of each disease, calculates the average confidence level, and generates a structured disease list. Simultaneously, the annotated video is encoded into MP4 format and saved to the server's files directory. The detection records (video URL, disease statistics) are stored in the database for subsequent querying and analysis.

[0058] (3) Camera detection function Step 1: Camera Access and Frame Acquisition. The system calls the device's camera through OpenCV's VideoCapture interface to continuously acquire real-time video streams at a preset frame rate (e.g., 24fps). Each frame is converted into an RGB format image matrix to ensure compatibility with the YOLO11 model's input format. At the same time, the video recorder is started to buffer the raw frame data.

[0059] Step 2: Real-time Inference and WebSocket Push. Each captured image frame is immediately fed into the YOLO11 model for disease detection. After inference, data such as detection box coordinates, disease category, and confidence level are extracted, encapsulated in JSON format, and pushed to the front end via the WebSocket protocol. Upon receiving the data, the front end renders the detection boxes and statistical information in real time, while providing start / pause / stop control commands to be sent back to the back end, enabling interactive control of the detection process.

[0060] Step 3: Video Transcoding and Storage. After the detection is complete, the system stops frame acquisition and encodes the cached raw frame sequence into MP4 format using OpenCV's VideoWriter interface, saving it to the server's files directory. Subsequently, the video URL, detection statistics (disease type, frequency of occurrence), and other information are stored in the database, and the video URL is returned to the front end for users to view and download. Throughout the process, H.264 encoding is used for video conversion to ensure compression efficiency and playback compatibility, and streaming is achieved through Spring Boot's file upload interface.

[0061] (4) AI prevention and control suggestion function AI-powered disease control recommendations are a key innovative feature of this system. Based on the DeepSeek large language model, this function automatically generates structured disease control recommendations according to the user-selected disease name and crop type. These recommendations include information such as disease name, severity, symptoms, treatment options, preventative measures, and recommended pesticides. The disease control recommendation push function achieves intelligent disease control guidance through the large language model, and its core principle consists of three key steps: Step 1: Disease Information Extraction and Parameter Parsing. Upon page loading, the system extracts disease information from the routing parameters. Specifically, for image detection, it obtains data such as individual disease name, crop type, and confidence level; for video detection, it receives a JSON-formatted list of diseases (including disease name, frequency of occurrence, and average confidence level). Simultaneously, it parses the detection source (image / video / camera) and the preview image URL.

[0062] Step 2: AIAPI Call and Suggestion Generation. The system calls the DeepSeek API to construct a professional SystemPrompt defining the "Agricultural Disease Prevention Expert" role, and assembles a UserPrompt containing the disease name and crop type. The API returns structured JSON data, including fields such as severity, symptom description, treatment measures, preventive measures, recommended pesticides, and precautions.

[0063] Step 3: Result Parsing and Page Rendering. The system parses the JSON data returned by the AI, extracts key information such as treatment plans, agricultural control measures, precautions, and recommended pesticides, and formats it to populate either a `singlePreventionInfo` (single disease) or `diseasesAdvice` (multiple diseases) object. The front end renders different card layouts based on the number of diseases. Specifically, for single diseases, detailed information cards are displayed, while for multiple diseases, multiple control suggestion cards are rendered in a loop. Each card contains basic disease information (name, crop type, damage level, peak incidence period) and detailed control suggestions (treatment plan, agricultural control measures, precautions, and recommended pesticide labels). Throughout the process, the system also implements a result caching mechanism, saving the obtained control suggestions to the history for easy viewing and reference by users later.

[0064] 3. Environmental Data Acquisition Module The system uses IoT sensors for agricultural environmental monitoring. It includes five sensors: Four matrix sensors are used to collect data on: soil temperature; soil moisture; nitrogen content; phosphorus content; potassium content; and pH value.

[0065] Air temperature and humidity sensor: used to collect: greenhouse temperature; greenhouse humidity; light intensity.

[0066] 4. MQTT data transmission module The sensor uploads data to the MQTTX server via the MQTT protocol. The specific process is as follows: the sensor collects environmental data; the data is published via the MQTT protocol; the MQTTX server receives the data; the Spring Boot backend subscribes to the topic; the backend parses the JSON data; the data is stored in a MySQL database; and the frontend displays the data in real time. This solution can reduce network latency and improve data transmission efficiency.

[0067] 5. Data Analysis and Visualization Module The system performs statistical analysis on environmental data. It can generate temperature line graphs, humidity line graphs, light intensity graphs, soil pH change graphs, and nitrogen, phosphorus, and potassium change trend graphs. Users can filter data by time, greenhouse, equipment, and plant species. The system supports ECharts chart display.

[0068] 6. Backend Service Management Module The backend service management module includes: User Management: The system has two roles: Regular User and Administrator (Admin). Administrators have one more user management privilege than regular users.

[0069] Equipment inventory management: The system records information about agricultural equipment, including: equipment name; equipment purpose; storage location; current quantity; and usage status.

[0070] Greenhouse Management: The system allows for categorized management of different greenhouses. Records include: plant species; growth status; greenhouse number; environmental information; disease records; and historical data.

[0071] 7. AI Smart Assistant Module Users can ask the AI ​​agricultural questions through the chat interface. Examples include: Why are plant leaves turning yellow? How to increase plant yield? How to control pests and diseases? Is the current environment suitable for planting? How to adjust soil pH? The system calls upon the DeepSeek large model to generate intelligent responses. Simultaneously, it incorporates real-time sensor data to improve the accuracy of suggestions.

[0072] 8. System Software Architecture The software architecture of this invention includes: Front-end technology stack: Vue3; ElementPlus; Axios; ECharts; Iconfont icon library.

[0073] Backend technology stack: Spring Boot; Flask; MyBatis; JWT authentication; MQTT server. Deep learning frameworks: YOLOv11, PyTorch; OpenCV.

[0074] Database: MySQL.

[0075] Please see Figure 2 The third embodiment of the present invention provides: A smart agricultural management and disease identification system, wherein the system includes: The acquisition module is used to acquire original plant images through a preset acquisition device to construct an image dataset, and to annotate the lesion areas in each of the original plant images through a preset program to generate corresponding annotation files; The training module is used to combine the image dataset and the annotation file into a corresponding target dataset, and to train the preset YOLOv11 model using the PyTorch framework based on the target dataset to generate the corresponding pest and disease identification model. The inference module is used to input the crop disease images or videos uploaded by the user or the video stream captured by the camera into the internal structure of the pest and disease identification model to perform disease identification inference and output the disease category and confidence level. The push module is used to automatically generate agricultural treatment suggestions based on the disease category and the confidence level, and push them to the user accordingly.

[0076] Furthermore, the reasoning module is specifically used for: When a user-uploaded image of a crop disease is detected, the image is standardized to generate a target image, wherein the pixel values ​​of the image are scaled to the range of [0,1]. The target image is input into the internal structure of the pest and disease identification model, so that the multi-level features in the target image are detected by the CSPDarknet backbone network, and the features are fused by the feature pyramid network, so that the target is detected in the feature map at different scales in the detection head part, and the disease area in the image is identified accordingly. Based on the described diseased area, complete the disease identification and reasoning.

[0077] Furthermore, the reasoning module is specifically used for: When the diseased area is determined, the confidence level of the detection box corresponding to the diseased area is calculated, and the detection box with a confidence level in the preset confidence threshold is set as a valid disease detection box. The disease detection box is mapped to the corresponding position in the crop disease image, and the corresponding disease category label is added to complete the corresponding disease identification and reasoning.

[0078] Furthermore, the reasoning module is specifically used for: When a user-uploaded video of crop disease is detected, the video is parsed into a continuous frame sequence and read frame by frame at a fixed frame rate using OpenCV's VideoCapture interface. Each frame is converted into an image matrix in RGB format. The image matrix is ​​input into the internal structure of the pest and disease identification model to detect diseases, and after the detection is completed, a detection box and a category label are marked on each frame of the image. Each labeled image frame is encapsulated into a corresponding data stream using a FiaskResponse object, and the data stream is then subjected to statistical analysis and result storage processing.

[0079] Furthermore, the reasoning module is specifically used for: By monitoring the update results of the data stream, the corresponding video frames after rendering and annotation are obtained; The detection results of each video frame are aggregated and statistically analyzed to count the occurrence frequency of each disease and calculate the average confidence level. A structured disease list is generated based on the average confidence level of each disease, and the disease identification reasoning is completed accordingly.

[0080] Furthermore, the reasoning module is specifically used for: When the video stream captured by the camera is detected, each frame of the video stream is input into the internal structure of the pest and disease identification model to infer the detection box coordinates, pest category, and confidence level of each pest area. The detection box coordinates, the disease category, and the confidence level are encapsulated in JSON format and pushed to the front end via the WebSocket protocol for rendering and statistics, thereby completing the disease identification and inference.

[0081] Furthermore, the push module is specifically used for: The disease category and the confidence level are assembled into structured JSON data, which includes fields for severity, symptom description, treatment measures, preventive measures, recommended pesticides, and precautions. The key information in the structured JSON data is parsed out, and the key information is formatted and filled into a single disease or multiple disease object to render different prevention and control suggestion cards and card layouts according to the number of diseases. Agricultural treatment suggestions are automatically generated inside the prevention and control suggestion card.

[0082] The fourth embodiment of the present invention provides a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the smart agriculture management and disease identification method as described above.

[0083] The fifth embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the smart agriculture management and disease identification method as described above.

[0084] In summary, the smart agriculture management and disease identification method and system provided by the above embodiments of the present invention can train and optimize the YOLOv11 model based on the PyTorch framework, giving full play to its advantages in small target detection and real-time inference, significantly improving the accuracy of early identification of small lesions and the model's generalization ability; at the same time, it supports multimodal input of images, offline videos and real-time camera video streams, and can be adapted to diverse application scenarios such as field inspections and fixed-point monitoring; finally, by automatically generating and pushing targeted agricultural treatment suggestions, it realizes a closed loop of the entire process from accurate identification to scientific treatment of pests and diseases, greatly reducing farmers' prevention and control costs and crop yield reduction risks.

[0085] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0086] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0087] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0088] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0089] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0090] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A smart agricultural management and disease identification method, characterized in that, The method includes: Original plant images are acquired using a preset acquisition device to construct an image dataset, and diseased areas in each of the original plant images are marked using a preset program to generate corresponding annotation files. The image dataset and the annotation file are combined to form a corresponding target dataset. Based on the target dataset, the preset YOLOv11 model is trained using the PyTorch framework to generate a corresponding pest and disease identification model. The crop disease images or videos uploaded by users or video streams captured by cameras are input into the internal system of the pest and disease identification model to perform disease identification reasoning and output the disease category and confidence level. Agricultural treatment suggestions are automatically generated based on the disease category and the confidence level, and then pushed to the user accordingly.

2. The intelligent agricultural management and disease identification method according to claim 1, characterized in that, The step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the disease and pest identification model for disease identification and inference includes: When a user-uploaded image of a crop disease is detected, the image is standardized to generate a target image, wherein the pixel values ​​of the image are scaled to the range of [0,1]. The target image is input into the internal structure of the pest and disease identification model, so that the multi-level features in the target image are detected by the CSPDarknet backbone network, and the features are fused by the feature pyramid network, so that the target is detected in the feature map at different scales in the detection head part, and the disease area in the image is identified accordingly. Based on the described diseased area, complete the disease identification and reasoning.

3. The intelligent agricultural management and disease identification method according to claim 2, characterized in that, The steps for completing the disease identification and reasoning based on the diseased area include: When the diseased area is determined, the confidence level of the detection box corresponding to the diseased area is calculated, and the detection box with a confidence level in the preset confidence threshold is set as a valid disease detection box. The disease detection box is mapped to the corresponding position in the crop disease image, and the corresponding disease category label is added to complete the corresponding disease identification and reasoning.

4. The intelligent agricultural management and disease identification method according to claim 1, characterized in that, The step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the disease and pest identification model for disease identification and inference includes: When a user-uploaded video of crop disease is detected, the video is parsed into a continuous frame sequence and read frame by frame at a fixed frame rate using OpenCV's VideoCapture interface. Each frame is converted into an image matrix in RGB format. The image matrix is ​​input into the internal structure of the pest and disease identification model to detect diseases, and after the detection is completed, a detection box and a category label are marked on each frame of the image. Each labeled image frame is encapsulated into a corresponding data stream using a FiaskResponse object, and the data stream is then subjected to statistical analysis and result storage processing.

5. The intelligent agricultural management and disease identification method according to claim 4, characterized in that, The steps of statistical analysis and result storage processing of the data stream include: By monitoring the update results of the data stream, the corresponding video frames after rendering and annotation are obtained; The detection results of each video frame are aggregated and statistically analyzed to count the occurrence frequency of each disease and calculate the average confidence level. A structured disease list is generated based on the average confidence level of each disease, and the disease identification reasoning is completed accordingly.

6. The intelligent agricultural management and disease identification method according to claim 1, characterized in that, The step of inputting user-uploaded crop disease images or videos, or video streams captured by cameras, into the internal structure of the disease and pest identification model for disease identification and inference includes: When the video stream captured by the camera is detected, each frame of the video stream is input into the internal structure of the pest and disease identification model to infer the detection box coordinates, pest category, and confidence level of each pest area. The detection box coordinates, the disease category, and the confidence level are encapsulated in JSON format and pushed to the front end via the WebSocket protocol for rendering and statistics, thereby completing the disease identification and inference.

7. The intelligent agricultural management and disease identification method according to claim 1, characterized in that, The step of automatically generating agricultural treatment recommendations based on the disease type and the confidence level includes: The disease category and the confidence level are assembled into structured JSON data, which includes fields for severity, symptom description, treatment measures, preventive measures, recommended pesticides, and precautions. The key information in the structured JSON data is parsed out, and the key information is formatted and filled into a single disease or multiple disease object to render different prevention and control suggestion cards and card layouts according to the number of diseases. Agricultural treatment suggestions are automatically generated inside the prevention and control suggestion card.

8. A smart agricultural management and disease identification system, characterized in that, The system includes: The acquisition module is used to acquire original plant images through a preset acquisition device to construct an image dataset, and to annotate the lesion areas in each of the original plant images through a preset program to generate corresponding annotation files; The training module is used to combine the image dataset and the annotation file into a corresponding target dataset, and to train the preset YOLOv11 model using the PyTorch framework based on the target dataset to generate the corresponding pest and disease identification model. The inference module is used to input the crop disease images or videos uploaded by the user or the video stream captured by the camera into the internal structure of the pest and disease identification model to perform disease identification inference and output the disease category and confidence level. The push module is used to automatically generate agricultural treatment suggestions based on the disease category and the confidence level, and push them to the user accordingly.

9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the smart agriculture management and disease identification method as described in any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the smart agriculture management and disease identification method as described in any one of claims 1 to 7.