Intelligent agriculture ecological monitoring and irrigation method and system based on target detection
By combining contour brightness enhancement algorithms and deep neural networks, the problem of insufficient accuracy in detecting small pests and diseases in agricultural monitoring using traditional methods has been solved, achieving high-precision target detection and irrigation strategy adjustment.
Patent Information
- Application Number
- CN202510938232.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-07-08
AI Technical Summary
Existing technologies struggle to accurately identify fine-grained objects such as small pests and early-stage diseases in agricultural monitoring. Furthermore, traditional methods suffer from low accuracy in complex environments, presenting technical challenges during detection.
An outline brightness enhancement algorithm is used to process the image dataset. The shallow convolutional layer of the deep neural network and the unsharpened mask module are combined to extract low-level features. The algorithm is trained using the SQL-IoU loss function and the cross-entropy function to improve the detection accuracy.
It improves the detection accuracy and positioning precision of pests, diseases and weeds, enhances the model's generalization ability and detection capability, and achieves efficient identification of small objects.
Smart Images

Figure CN121033744A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart agriculture and ecological technology, specifically a smart agriculture ecological monitoring and irrigation method and system based on target detection. Background Technology
[0002] Currently, in modern agricultural monitoring systems, accurate identification of pests, diseases, and weeds is crucial for achieving smart and precision agriculture. Traditional image processing methods rely heavily on manually designed feature extractors, which are labor-intensive and time-consuming, and are sensitive to environmental changes, requiring parameter readjustment. These methods perform poorly in complex and ever-changing natural environments. In recent years, deep convolutional networks have made significant progress in object detection; however, when dealing with fine-grained objects in agricultural scenarios, such as small pests and early-stage diseases, existing methods fail to fully capture these details, resulting in limited detection accuracy. Furthermore, traditional object detection algorithms typically use IoU as a metric to measure the overlap between predicted and ground truth bounding boxes, and combine it with cross-entropy loss during training to improve localization accuracy in object detection tasks. However, this combination performs poorly when handling highly imbalanced datasets or detecting small objects.
[0003] Furthermore, traditional irrigation and fertilization strategies are often fixed or experience-based, lacking a dynamic response to the actual growth status of crops. With the application of devices such as high-definition cameras and drones, it is now possible to acquire high-definition images of farmland in real time and analyze these images using advanced object detection algorithms to identify pests, diseases, and weeds. Based on the object detection results, the system can intelligently adjust irrigation and fertilization strategies. Summary of the Invention
[0004] This invention aims to solve at least one of the technical problems existing in the prior art;
[0005] Therefore, this invention proposes a smart agricultural ecological monitoring and irrigation method and system based on target detection, the method comprising:
[0006] The image dataset consisting of farmland images with added annotations is subjected to contour brightness enhancement processing. The annotation information includes conclusions representing the results of pests, diseases, and weeds, and the corresponding bounding boxes at the locations of the conclusions.
[0007] Using a deep neural network that includes a circularly connected structure of shallow convolutional layers and unsharpened mask modules, basic features and low-level features in the image to be detected are extracted respectively.
[0008] After the basic features and low-level features are fused, they are input into the classification head and the detection head, and the target localization and classification training of the deep neural network model are completed by the SQL-IoU loss function and the cross-entropy function, respectively.
[0009] The trained deep neural network model is used to identify real-time farmland images and output the detection results of pests, diseases and weeds.
[0010] Furthermore, the contour enhancement process includes the following steps:
[0011] After cropping the target bounding box region of the farmland image and increasing its resolution, other images are randomly inserted. Gaussian blur is applied to generate a blurred image. The difference image is calculated, scaled, and superimposed onto the original image to enhance the contour. Finally, brightness is adjusted to obtain the adjusted image dataset.
[0012] Furthermore, before extracting low-level features, the image to be detected needs to undergo online data augmentation, image normalization, and dataset partitioning.
[0013] Furthermore, low-level features are extracted using an unsharpened mask module, specifically as follows:
[0014] A shallow backbone network is constructed. The shallow network consists of alternating Conv convolutional layers and C3k2 layers, forming a shallow extraction network. An unsharpened mask module is inserted after the second Conv convolutional layer to extract low-level features of the edge contour.
[0015] Furthermore, the unsharpened mask module first separates the input image of size B, C1, H, W into several tensors of size C1, H, W according to the batch_size number. Then, it performs convolution processing on the tensors using Gaussian kernels. Finally, it adds and multiplies the original tensor with the processed tensor before concatenating them.
[0016] Furthermore, the specific training methods for target localization and classification in deep neural networks are as follows:
[0017] The extracted features are then fused and input into the decoupled classification head and detection head of the deep network;
[0018] In the classification head, depthwise convolution processes each channel of the input separately, using an h×w convolution kernel for each channel, and then Conv2d convolution is used to calculate the scores for different categories. The highest score is the final classification result.
[0019] In the detection head, Conv convolution is used to calculate the positional information of the ground truth bounding box and the predicted bounding box. The degree of overlap between each predicted bounding box and the ground truth bounding box is calculated using a given loss function. The predicted bounding box with the highest degree of overlap is the final detection result.
[0020] Furthermore, the classification head uses the cross-entropy loss function L, which is defined as follows:
[0021]
[0022] Where M is the number of categories; y ic The sign function is 0 or 1; it takes the value 1 if the true class of sample i is equal to c, and 0 otherwise. ic Let be the predicted probability that observed sample i belongs to category c.
[0023] Furthermore, the detection header employs the SQL-IoU loss function, which is defined as follows:
[0024]
[0025] Loss SQL =1 - IoU + distance - 0.5·cost
[0026] In the formula, w1, w2, h1, and h2 are the height and width of the predicted bounding box and the ground truth bounding box, respectively, and V w and V h It is the weight of width and height, U w and U h It reflects the relative changes in width and height between the two bounding boxes.
[0027] A smart agricultural ecological monitoring and irrigation system based on target detection, the system being used to implement the aforementioned method, the system comprising:
[0028] The farmland image acquisition module is used to acquire an image dataset consisting of images to be detected representing farmland images, and to transmit the acquired farmland images to the image preprocessing module via the data transmission module.
[0029] The image preprocessing module performs preprocessing operations on the images to be detected in the image dataset and then transmits the preprocessed image dataset to the target detection module.
[0030] The target detection module is used to train a deep neural network using an image dataset, which combines a deep convolutional network with an unsharpened mask module, an efficient channel attention module, an SQL-IoU loss function, and a cross-entropy function. The trained deep neural network model is then used to identify real-time farmland images and output the detection results of pests, diseases, and weeds.
[0031] The object detection module extracts low-level features such as edges and contours in the image through an unsharpened mask module, and highlights key semantic information using an efficient channel attention mechanism. Then, it uses the SQL-IoU loss function and cross-entropy function to train a deep neural network model.
[0032] A computer-readable storage medium for storing a program and implementing the steps of the aforementioned method by means of a processor.
[0033] Compared with the prior art, the beneficial effects of the present invention are:
[0034] This invention analyzes the shortcomings of current data augmentation methods in ecological and environmental scenarios, and examines the inherent limitations of the shallow design of the target detection network and the original IoU loss function. It proposes a contour brightness data augmentation algorithm: the algorithm extracts target regions from images to increase resolution, fuses target regions between different images, and finally enhances contour sharpness and adjusts brightness, effectively improving the model's generalization ability. Furthermore, the shallow network design is adjusted by adding a non-sharpening mask module to fully extract low-level and detailed feature information, integrating low-level feature information into the deep network to improve the completeness of semantic information in the deep network, thereby enhancing the expressive power of key features. Finally, the SQL-IoU loss function is used to simultaneously consider shape, angle, and label quality during training, improving the accuracy of target object localization. Attached Figure Description
[0035] Figure 1 This is a flowchart of the method of the present invention;
[0036] Figure 2 This is a schematic diagram of the non-sharpened mask module according to an embodiment of the present invention;
[0037] Figure 3 This is a detailed flowchart of the target detection method according to an embodiment of the present invention. Detailed Implementation
[0038] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Please see Figures 1-3 This application provides a smart agricultural ecological monitoring and irrigation method based on target detection;
[0040] As an embodiment of this application, the specific steps include the following:
[0041] Contour brightness enhancement processing was performed on the image dataset composed of the collected farmland images to obtain an image dataset composed of several processed farmland images.
[0042] Using a deep neural network that includes a circularly connected structure of shallow convolutional layers and unsharpened mask modules, basic and low-level features are extracted from farmland images.
[0043] After the basic features and low-level features are fused, they are input into the classification head and the detection head, and the target localization and classification training of the deep neural network model are completed by the SQL-IoU loss function and the cross-entropy function, respectively.
[0044] The trained deep neural network model is used to identify and output the detection results of pests, diseases and weeds.
[0045] like Figure 1 As shown, as a second embodiment of this application, this embodiment includes the following steps:
[0046] Step 1: Set up a high-definition camera or drone for image acquisition, collect several images of farmland, and label them as images to be detected. Several images to be detected constitute the training dataset.
[0047] This process utilizes high-resolution cameras to capture detailed images and supports timed shooting, allowing users to set the image acquisition interval as needed; the drone uses positioning technology to automatically fly and collect images along a preset path, ensuring the comprehensiveness and consistency of image acquisition.
[0048] Step 2: Use Internet of Things (IoT) technology to transmit the collected training dataset to the centralized control system;
[0049] Specifically, efficient wireless communication protocols such as NB-IoT can be used to transmit images, enabling stable transmission in low-bandwidth and high-interference environments, ensuring that data can reach the central control system in a timely manner.
[0050] Step 3: Then, use the contour brightness enhancement algorithm to augment the collected training dataset. This process first requires pre-labeling the target boxes and corresponding conclusions in the images to be detected using annotation tools. The conclusions are areas with pests, diseases, and weeds, and the target boxes are the locations of these conclusions, resulting in several training datasets with target boxes. Then, for the input training dataset, first, extract the labeled target box portion of each image to be detected, increase its resolution, randomly insert it into any image, and adjust its size to fit the new image, modifying the corresponding annotation file. Next, perform contour enhancement on the dataset; the specific method is as follows:
[0051] Step 3.1: Apply a Gaussian blur filter to the original image I to generate a blurred version of image I. blur ;
[0052] Step 3.2: Subtract the blurred image I from the original image I. blur Obtain the difference image I diff =II blur ;
[0053] Step 3.3: Transfer the difference image I diffMultiply by the magnification factor k to get I scaled =k*I diff ;
[0054] Step 3.4: Scale the difference image I scaled Add it back to the original image I to produce the final sharpened image I. final =I+I scaled ;
[0055] Step 3.5: Finally, further adjust the brightness of the image dataset by performing brightness enhancement and brightness reduction respectively, to obtain the final image dataset after contour brightness enhancement;
[0056] Step 4: Preprocess the images to be detected in the image dataset, then input the images into a deep neural network, and extract low-level features through an unsharpened mask module;
[0057] Preprocessing includes online data augmentation, image normalization, and dataset partitioning. Online data augmentation includes flipping and scaling. The image to be detected is input into a deep neural network model, and low-level features are fully extracted through an unsharpened mask module to further improve the feature information richness of the deep neural network model. The specific method is as follows:
[0058] Step 4.1: Construct a shallow low-level feature extraction network for the backbone, specifically by looping together a Conv convolutional layer and a C3k2 layer. After the second Conv layer, an unsharpened mask module is inserted to fully extract edge contour information and obtain rich low-level features.
[0059] In the above process, low-level features such as edges and contours are extracted through the unsharpened mask module. This module first separates the input image of size (B,C1,H,W) into multiple tensors of size (C1,H,W) according to the batch_size number. Then, Gaussian kernels are established to convolve these tensors. Finally, the original tensors and the processed tensors are added and multiplied and then concatenated to obtain rich edge and contour feature information.
[0060] Step 4.2: Combine the feature maps extracted by the shallow network with the low-level features extracted by the unsharpened mask module. Figure 1 The features are first input into the Neck layer to fully fuse them, and then input into the classification head and detection head through the deep network. After the second Conv module in the shallow network, there are two branches: one is a shallow extraction network composed of alternating Conv and C3k2 modules to extract low-level features, and the other is a module with added unsharpened mask to extract low-level features. Finally, the features are fused at the network neck to obtain the fused features.
[0061] Step 5: Use the SQL-IoU loss function and cross-entropy function to train the extracted fusion features to complete target localization and classification;
[0062] The fusion features extracted in step 4 are saved and input into the decoupled classification head and detection head. In the classification head, depthwise convolution processes each input channel individually, using an h×w convolution kernel for each channel, and then Conv2d convolution is used to calculate the scores for different categories. The highest score is the final classification result. In the detection head, Conv convolution is used to calculate the position information of the ground truth bounding box and the predicted bounding box. The degree of overlap between each predicted bounding box and the ground truth bounding box is calculated using a given loss function. The predicted bounding box with the highest degree of overlap is the final detection result. The neural network continuously optimizes the parameters through the backpropagation algorithm, gradually reducing the error, and finally achieving model convergence.
[0063] After convergence, a deep neural network model is used to detect and identify farmland images acquired in real time, and output the target detection results, which are pests, diseases, weeds and their corresponding locations.
[0064] Here, the SQL-IoU loss function is used in the detection header, and the cross-entropy loss function (L) is used in the classification header. The definition of L is as follows:
[0065]
[0066] Where M is the number of categories; y ic The sign function is 0 or 1; it takes the value 1 if the true class of sample i is equal to c, and 0 otherwise. ic Let be the predicted probability that observed sample i belongs to category c.
[0067] The SQL-IoU loss function used for detection localization is a loss function that takes into account the shape, angle, and sample quality of the detection box. The key definition of SQL-IoU is as follows:
[0068]
[0069] Loss SQL =1 - IoU + distance - 0.5·cost
[0070] In the formula, w1, w2, h1, and h2 are the height and width of the predicted bounding box and the ground truth bounding box, respectively, and V w and V h It is the weight of width and height, U w and U h It reflects the relative changes in width and height between the two bounding boxes;
[0071] The b1 mentioned here x1The x-coordinate of the top left corner of the prediction box, b1 y1 The y-coordinate of the top left corner of the prediction box, b1 x2 For the prediction box, the x-coordinate prediction box at the bottom right corner, b1 y2 The y-coordinate of the bottom right corner of the prediction box, b2 x1 The x-coordinate of the top-left corner of the true bounding box, b2 y1 The y-coordinate of the top left corner of the true bounding box, b2 x2 The x-coordinate of the bottom right corner of the true bounding box, b2 y2 The y-coordinate of the bottom right corner of the true bounding box;
[0072] C 2 h C is the height of the output feature map for the unsharpened mask. 2 w Output feature map width for unsharpened mask;
[0073] Step 6: Adjust irrigation strategies and fertilization plans based on the target detection results;
[0074] The target detection algorithm can not only distinguish between pests, diseases, and weeds, but also specifically identify different types of pests or diseases, providing a basis for targeted management. Based on IoT technology, the system can achieve real-time monitoring of farmland. Once harmful organisms are detected, an alarm is immediately issued and managers are notified, facilitating timely action to prevent their spread.
[0075] As a third embodiment of this application, this embodiment includes the following steps:
[0076] For the monitored problem areas, the system can accurately calculate their area and severity, and adjust the corresponding irrigation and fertilization amounts accordingly.
[0077] As an embodiment of the present invention, preferably, for the monitored problem area, the target bounding box output by the target detection algorithm is combined with the conversion ratio between image resolution and actual ground size. The ratio can be obtained through UAV flight altitude and camera parameter calibration to convert the pixel-level detection result into the actual area size of farmland; the formula for the actual area is as follows:
[0078]
[0079] Pixel area refers to the number of pixels covered by the target bounding box; scale factor refers to the actual area per pixel (unit: square meters / pixel). This value is calculated based on the UAV's flight altitude, camera parameters, and ground resolution.
[0080] Next, based on the disease coverage rate, assess its severity level, and then adjust the irrigation and fertilization amounts accordingly. The coverage rate refers to the proportion of the problem area to the entire monitoring area, and the calculation formula is as follows:
[0081]
[0082] The actual area of the problem area is the area calculated using the above formula; the total actual area of the monitored area is obtained using known farmland dimensions. Coverage is categorized into light, moderate, and severe disease zones based on percentage, and different strategies are adopted for zones with different degrees of disease.
[0083] Mild disease areas: Only a few leaves show mild symptoms, covering less than 5% of the area. Maintain normal irrigation rhythm and appropriately increase nutrients such as potassium fertilizer to improve stress resistance.
[0084] In areas with moderate disease severity (where the proportion of lesions reaches 5%-20%), the irrigation frequency and volume should be reduced to prevent excessive humidity from promoting disease spread. At the same time, the supply of micronutrients should be increased to promote crop recovery. The specific irrigation frequency and volume here can be modified to 60% of the original amount.
[0085] In areas with severe disease: if the proportion of diseased leaves exceeds 20%, mechanical irrigation should be suspended, and drip irrigation or local water control should be prioritized, along with pesticide spraying and nutrient intervention to prevent further deterioration of the disease.
[0086] As a fourth embodiment of this application, this embodiment includes the following steps:
[0087] This invention also discloses a smart agricultural ecological monitoring and irrigation system based on target detection, the main modules of which include:
[0088] The farmland image acquisition module is configured to acquire farmland images; it can take pictures through high-definition cameras or drones, or obtain pre-collected image data from local storage or servers, ensuring that it can flexibly meet the needs of different application scenarios.
[0089] The data transmission module is configured to transmit the acquired images to the image preprocessing module of the central control system via IoT technology; it adopts an efficient wireless communication protocol (such as NB-IoT) to ensure stable transmission of image data even in low bandwidth and high interference environments, ensuring real-time monitoring and rapid response;
[0090] The image preprocessing module is configured to perform necessary preprocessing operations on the input image. This step is highly customizable, allowing for the selection of different preprocessing methods based on specific task requirements, such as adjusting image size, pixel normalization, and rotation to adapt to changes in shooting angles, thereby improving the effectiveness of subsequent processing steps.
[0091] The object detection module is configured to use a deep convolutional network combined with an unsharpened mask module, an efficient channel attention module, an SQL-IoU loss function, and a cross-entropy function to process images and identify target objects such as pests, diseases, and weeds. This module first extracts low-level features such as edges and contours from the image using an unsharpened mask module, then uses an efficient channel attention mechanism to highlight key semantic information. Finally, it trains the model using the SQL-IoU loss function and the cross-entropy function to achieve accurate target localization and classification.
[0092] The irrigation and fertilization strategy adjustment module is configured to automatically adjust irrigation strategies and fertilization plans based on target detection results. This module can accurately calculate the area and severity of problem areas and dynamically adjust the corresponding irrigation and fertilization amounts accordingly to optimize resource utilization efficiency and promote healthy crop growth. For example, when a serious pest or disease is detected in a specific area, the system can reduce the water supply to that area and adjust the fertilizer formula to alleviate crop stress. If a large number of weeds are detected, it may be necessary to increase the frequency of local irrigation to suppress weed growth.
[0093] As a fifth embodiment of this application, this embodiment is implemented based on the target detection-based smart agricultural ecological monitoring and irrigation system given in embodiment four. The system works in the following manner:
[0094] Acquiring farmland images: Use high-definition cameras or drones to capture images of farmland;
[0095] Image preprocessing: Perform necessary preprocessing operations on the image, such as resizing, pixel normalization, rotation, etc., to adapt to the needs of different scenarios;
[0096] Target detection: By combining deep convolutional networks with techniques such as unsharpened mask modules and efficient channel attention modules, target objects such as pests, diseases, and weeds are identified.
[0097] Strategy Adjustment: Based on the target detection results, automatically adjust irrigation strategies and fertilization plans to optimize resource utilization efficiency and promote healthy crop growth.
[0098] Before target detection, image preprocessing is included. Specific preprocessing operations include, but are not limited to, image resizing, pixel normalization, and rotation. Pixel normalization makes the data more consistent with distribution patterns, improving training effectiveness, while rotation adapts to different shooting angles. The system employs a multi-stage approach for comprehensive monitoring of the farmland environment. Shallow networks extract basic image details such as color, texture, and contours, while deep networks focus on filtering out key semantic features to more accurately identify and locate targets such as pests, diseases, and weeds. By combining an unsharpened mask module and an efficient channel attention mechanism, the system not only expands the effective receptive field but also better captures subtle differences in the image, thereby improving detection accuracy.
[0099] As a sixth embodiment of this application, this application also discloses a computer device, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of any one of embodiments one through three. This design not only improves the system's flexibility and scalability but also facilitates future functional upgrades. This device can efficiently and accurately perform operations such as target detection-based farmland image acquisition, transmission, preprocessing, target recognition, and irrigation and fertilization strategy adjustment, significantly improving agricultural production efficiency and resource utilization.
[0100] As can be seen from the above scheme, this invention relates to the fields of Internet of Things and computer vision technology, and proposes a smart agricultural ecological monitoring and irrigation system based on target detection. It uses high-definition cameras or drones for image acquisition, transmits the acquired images to be detected to the central control system through Internet of Things technology, performs data enhancement and preprocessing on the images using a contour brightness enhancement algorithm, and inputs the images into a deep convolutional network to extract low-level features through an unsharpened mask module.
[0101] This invention extracts more complete low-level semantic information; features are recalibrated using a pyramid structure and an efficient channel attention module to extract more critical semantic features; SQL-IoU loss function and cross-entropy function are used to target and classify the extracted features; target detection algorithms are used to detect target objects such as pests, diseases, and weeds; and irrigation strategies and fertilization plans are adjusted based on the detection results.
[0102] This invention proposes a novel contour brightness enhancement algorithm to process datasets and enhance model generalization. At the same time, it constructs an unsharpened mask module to fully extract the detailed features of the shallow layers of the network, which can further improve the feature information richness of deep neural networks and improve detection accuracy. Furthermore, the SQL-IoU loss function can enhance the model's localization ability.
[0103] This invention proposes a smart agricultural ecological monitoring and irrigation system based on object detection, which can improve the detection model's ability to detect small objects. Furthermore, it employs cross-entropy and SQL-IoU loss functions for training, thereby enhancing the accuracy of object detection and the robustness of the model.
[0104] The intelligent agricultural ecological monitoring and irrigation system based on target detection of the present invention is an application of the Internet of Things and intelligent agricultural ecological monitoring and irrigation based on target detection. It can improve the ability of deep neural networks to extract low-level feature information of images, further enhance the detection capability of fine-grained objects such as small objects, and the increase in computation is negligible. At the same time, it can respond and adjust irrigation and fertilization strategies in a timely manner according to the detection results, so as to realize detection and precise irrigation in real ecological scenarios on mobile terminals or edge devices.
[0105] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the methods in the above embodiments. Specifically, the computer program product can instruct the computer to perform the following operations: setting up a high-definition camera or drone for image acquisition; transmitting the image to be detected to a central control system using Internet of Things (IoT) technology; performing data augmentation on the dataset using a contour brightness enhancement algorithm; preprocessing the image to be detected and extracting low-level features through a deep neural network; training the extracted features using the SQL-IoU loss function and cross-entropy function to achieve target localization and classification; and automatically adjusting irrigation strategies and fertilization plans based on the target detection results.
[0106] It is understood that the system provided in the embodiments of the present invention corresponds to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above method. For example, the system includes a farmland image acquisition module, a data transmission module, an image preprocessing module, a target detection module and an irrigation and fertilization strategy adjustment module.
[0107] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Furthermore, any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory.
[0108] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. For example, the farmland image acquisition module can work independently or in conjunction with other modules to adapt to different application scenarios.
[0109] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. A smart agricultural ecological monitoring and irrigation method based on target detection, characterized in that, include: The image dataset consisting of farmland images with added annotations is subjected to contour brightness enhancement processing. The annotation information includes conclusions representing the results of pests, diseases, and weeds, and the corresponding bounding boxes at the locations of the conclusions. Using a deep neural network that includes a circularly connected structure of shallow convolutional layers and unsharpened mask modules, basic features and low-level features in the image to be detected are extracted respectively. After the basic features and low-level features are fused, they are input into the classification head and the detection head, and the target localization and classification training of the deep neural network model are completed by the SQL-IoU loss function and the cross-entropy function, respectively. The trained deep neural network model is used to identify real-time farmland images and output the detection results of pests, diseases and weeds.
2. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 1, characterized in that, The steps of contour enhancement processing include: After cropping the target bounding box region of the farmland image and increasing its resolution, other images are randomly inserted. Gaussian blur is applied to generate a blurred image. The difference image is calculated, scaled, and superimposed onto the original image to enhance the contour. Finally, brightness is adjusted to obtain the adjusted image dataset.
3. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 1, characterized in that, Before extracting low-level features, the image to be detected needs to undergo online data augmentation, image normalization, and dataset partitioning.
4. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 1, characterized in that, Low-level features are extracted using an unsharpened mask module, specifically as follows: A shallow backbone network is constructed. The shallow network consists of alternating Conv convolutional layers and C3k2 layers, forming a shallow extraction network. An unsharpened mask module is inserted after the second Conv convolutional layer to extract low-level features of the edge contour.
5. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 4, characterized in that, The unsharpened mask module first separates the input image of size B, C1, H, W into several tensors of size C1, H, W according to the batch_size number. Then, it performs convolution processing on the tensors using Gaussian kernels. Finally, it adds and multiplies the original tensor with the processed tensor before concatenating them.
6. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 1, characterized in that, The specific training methods for target localization and classification in deep neural networks are as follows: The extracted features are then fused and input into the decoupled classification head and detection head of the deep network; In the classification head, depthwise convolution processes each channel of the input separately, using an h×w convolution kernel for each channel, and then Conv2d convolution is used to calculate the scores for different categories. The highest score is the final classification result. In the detection head, Conv convolution is used to calculate the positional information of the ground truth bounding box and the predicted bounding box. The degree of overlap between each predicted bounding box and the ground truth bounding box is calculated using a given loss function. The predicted bounding box with the highest degree of overlap is the final detection result.
7. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 6, characterized in that, The classification head uses the cross-entropy loss function L, which is defined as follows: Where M is the number of categories; y ic The sign function is 0 or 1; it takes the value 1 if the true class of sample i is equal to c, and 0 otherwise. ic Let be the predicted probability that observed sample i belongs to category c.
8. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 6, characterized in that, The detection header uses the SQL-IoU loss function, which is defined as follows: Loss SQL =1-IoU+distance-0.5·cost In the formula, w1, w2, h1, and h2 are the height and width of the predicted bounding box and the ground truth bounding box, respectively, and V w and V h It is the weight of width and height, U w and U h It reflects the relative changes in width and height between the two bounding boxes.
9. A smart agricultural ecological monitoring and irrigation system based on target detection, characterized in that, The system is used to implement the method according to any one of claims 1-8, the system comprising: The farmland image acquisition module is used to acquire an image dataset consisting of images to be detected representing farmland images, and to transmit the acquired farmland images to the image preprocessing module via the data transmission module. The image preprocessing module performs preprocessing operations on the images to be detected in the image dataset and then transmits the preprocessed image dataset to the target detection module. The target detection module is used to train a deep neural network using an image dataset, which combines a deep convolutional network with an unsharpened mask module, an efficient channel attention module, an SQL-IoU loss function, and a cross-entropy function. The trained deep neural network model is then used to identify real-time farmland images and output the detection results of pests, diseases, and weeds. The object detection module extracts low-level features such as edges and contours in the image through an unsharpened mask module, and highlights key semantic information using an efficient channel attention mechanism. Then, it uses the SQL-IoU loss function and cross-entropy function to train a deep neural network model.
10. A computer-readable storage medium, characterized in that, Used to store a program and implement the steps of the method described in claims 1 to 8 by means of a processor.
Citation Information
Patent Citations
Infrared image correction method
CN115100068A
Image processing method, device, equipment and system
CN117217987A
Intelligent eagle equipment and ecological environment monitoring method
CN119511917A
Remote sensing change detection method based on edge enhanced cross attention and multi-dimensional loss
CN119671934A
System and Method for Extremely Efficient Image and Pattern Recognition and Artificial Intelligence Platform
US20180204111A1