A smart farming ecological monitoring and irrigation method and system based on target detection
By combining contour brightness enhancement algorithms and deep neural networks, the problems of fine-grained object recognition and dynamic response of irrigation strategies in agricultural monitoring have been solved, achieving high-precision pest and disease detection and intelligent irrigation, thereby improving agricultural production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies struggle to accurately identify fine-grained objects such as small pests and early-stage diseases in agricultural monitoring, and traditional irrigation and fertilization strategies lack dynamic responsiveness, resulting in limited detection accuracy and wasted resources.
A contour brightness enhancement algorithm is used to enhance farmland images. A deep neural network with shallow convolutional layers and unsharpened mask modules is trained using the SQL-IoU loss function and cross-entropy function to extract and classify pests, diseases and weeds, and dynamically adjust irrigation and fertilization strategies.
It improves the detection accuracy of small pests and early diseases, enhances the model's generalization ability and target positioning accuracy, realizes dynamic response of intelligent irrigation and fertilization, and improves agricultural production efficiency and resource utilization.
Smart Images

Figure CN121033744B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent agriculture ecology, and particularly relates to an intelligent agriculture ecology monitoring and irrigation method and system based on target detection. BACKGROUND
[0002] At present, in the modern agricultural monitoring system, accurately identifying pests, diseases and weeds is crucial for realizing intelligent precision agriculture. Traditional image processing methods rely too much on manually designed feature extractors, which require a lot of manpower and time, and are sensitive to environmental changes, requiring parameter adjustment. These methods perform poorly in complex and variable natural environments. In recent years, deep convolutional networks have made significant progress in target detection, but when dealing with fine-grained objects such as small pests and early diseases in agricultural scenes, existing methods fail to fully capture these details, resulting in limited detection accuracy. At the same time, traditional target detection algorithms usually use IoU as an indicator to measure the degree of overlap between predicted and true boxes, and combine cross-entropy loss to train to improve positioning accuracy in target detection tasks. However, this combination performs poorly when dealing with highly imbalanced datasets or small target detection.
[0003] In addition, traditional irrigation and fertilization strategies are usually fixed or based on experience, lacking dynamic response to the actual growth state of crops. With the application of high-definition cameras and unmanned aerial vehicles and other devices, high-definition images of farmland can now be obtained in real time, and these images can be analyzed by advanced target detection algorithms to identify pests, diseases and weeds. Based on the results of target detection, the system can intelligently adjust irrigation and fertilization strategies. SUMMARY
[0004] The present application aims to at least solve one of the technical problems existing in the prior art;
[0005] To this end, the present application proposes an intelligent agriculture ecology monitoring and irrigation method and system based on target detection, the method comprising:
[0006] Performing contour brightness enhancement processing on the image dataset composed of the collected detection pictures representing the farmland images with added annotation information; the annotation information includes conclusions representing pest, disease and weed results and target boxes corresponding to the locations of the conclusions;
[0007] Extracting basic features and low-level features in the detection pictures through a deep neural network containing a shallow convolutional layer and a non-sharp mask module cyclic interface structure;
[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 positioning and classification training of the deep neural network model is completed through the SQL-IoU loss function and the cross-entropy function, respectively;
[0009] The trained deep neural network model is used to identify real-time collected farmland images and output detection results of pests, diseases and weeds.
[0010] Further, the step of contour enhancement processing comprises:
[0011] The target frame region of the farmland image is intercepted and the resolution is improved, other images are randomly inserted, a blurred image is generated by applying Gaussian blur, a difference image is calculated and scaled and then superimposed on the original image to enhance the contour, and finally the brightness is adjusted to obtain the adjusted image dataset.
[0012] Further, the to-be-detected picture also needs to be subjected to online data enhancement, image normalization and dataset division processing before the low-level features are extracted.
[0013] Further, the low-level features are extracted by a non-sharpening mask module, and the specific manner is:
[0014] A backbone shallow network is constructed; the shallow extraction network composed of Conv convolution layers and C3k2 layers in the shallow network are alternately arranged, and a non-sharpening mask module is inserted after the second Conv convolution layer, so as to extract the edge contour low-level features.
[0015] Further, the non-sharpening mask module first separates the input image with a size of B, C1, H, W into several tensors with a size of C1, H, W according to the batch_size number, then establishes a Gaussian kernel to perform convolution processing on the tensors, and then performs addition and multiplication operations on the original tensors and the processed tensors and then splices them.
[0016] Further, the target positioning and classification training of the deep neural network is specifically as follows:
[0017] The extracted features are fused and input into the decoupled classification head and detection head of the deep network;
[0018] In the classification head, the deep convolution separately processes each channel of the input, uses an h x w convolution kernel for convolution operation, and then uses Conv2d convolution to calculate the scores of different categories, and the highest score is the final result of classification;
[0019] In the detection head, the Conv convolution is used to calculate the position information of the real frame and the predicted frame, and the given loss function is used to calculate the coincidence degree between each predicted frame and the real frame, and the predicted frame with the highest coincidence degree is the final result of detection.
[0020] Further, the cross-entropy loss function L is used in the classification head, and the definition of L is as follows:
[0021]
[0022] where M is the number of classes; y ic is the indicator function, taking 0 or 1, 1 if the true class of sample i equals c, otherwise 0; p ic is the predicted probability that observation i belongs to class c.
[0023] Further, the SQL-IoU loss function is used in the detection head, and the SQL-IoU loss function is defined as follows:
[0024]
[0025] Loss SQL =1-IoU+distance-0.5·cost
[0026] where w1, w2, h1, h2 are the height and width of the predicted box and the ground truth box, respectively, V w and V h are the weights of the width and height, U w and U h reflect 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, said system is used to realize the method described above, said system comprises:
[0028] A farmland image acquisition module is used to acquire an image dataset composed of detection pictures representing farmland images, and transmit the acquired farmland images to the image preprocessing module through the data transmission module;
[0029] The image preprocessing module performs preprocessing operation on the detection pictures in the image dataset, and transmits the preprocessed image dataset to the target detection module;
[0030] The target detection module is used to train the deep neural network using the deep convolutional network combined with the non-sharp mask module, the efficient channel attention module, the SQL-IoU loss function and the cross-entropy function through the image dataset, and identify the real-time collected farmland images through the trained deep neural network model, and output the detection results of pests, diseases and weeds;
[0031] The target detection module extracts low-level features such as edges and contours in the image through the non-sharp mask module, highlights key semantic information using the efficient channel attention mechanism, and then uses the SQL-IoU loss function and the cross-entropy function to train the deep neural network model.
[0032] A computer readable storage medium is used to store programs, and the steps of the foregoing method are implemented by means of a processor.
[0033] Compared with the prior art, the present application has the beneficial effects that:
[0034] The present application analyzes the defects of the current data enhancement method in the ecological environment scene, and analyzes and observes the inherent defects of the shallow layer design of the target detection network and the original IoU loss function, and proposes a contour brightness data enhancement algorithm: the target region of the image is intercepted to improve the resolution, the target regions between different images are fused, and finally the image is subjected to contour sharpness improvement and brightness adjustment, which effectively improves the generalization ability of the model; in addition, the shallow layer design of the network is adjusted, the non-sharp mask module is increased to fully extract low-level feature information and detailed feature information, the low-level feature information is integrated into the deep network, the integrity of the semantic information of the deep network is improved, and the expression ability of the key features is enhanced, and finally through the SQL-IoU loss function, the shape, angle and label quality are considered in the training process, and the positioning accuracy of the target object is improved. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is a method flowchart of the present application;
[0036] Figure 2 is a schematic diagram of the non-sharp mask module of the embodiment of the present application;
[0037] Figure 3 is a detailed flowchart of the target detection method of the embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions of the present application will be described below in conjunction with the embodiments, obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0039] Please refer to Figures 1-3 The present application provides a smart agricultural ecological monitoring and irrigation method based on target detection;
[0040] As an embodiment of the present application, it specifically includes the following steps:
[0041] The image data set composed of the collected farmland images is subjected to contour brightness enhancement processing to obtain an image data set composed of a plurality of processed farmland images;
[0042] The deep neural network comprising the shallow convolutional layer and the non-sharp mask module cyclically connected structure is used to extract the basic features and low-level features in the farmland images respectively;
[0043] The basic features and low-level features are fused and input into a classification head and a detection head, and target positioning and classification training of the deep neural network model are completed through a SQL-IoU loss function and a cross-entropy function, respectively.
[0044] The detection results of the pests, diseases and weeds are recognized and output by means of the trained deep neural network model.
[0045] As shown in Figure 1 , as the second embodiment of the present application, the embodiment includes the following steps:
[0046] Step 1: Set up a high-definition camera or a drone for image acquisition, and acquire a plurality of images of farmland, which are marked as detection pictures, and the plurality of detection pictures constitute a training data set;
[0047] In this process, a high-resolution camera is used to capture fine images, and a timing shooting function is supported, allowing users to set the time interval of image acquisition as needed; the drone uses positioning technology to automatically fly along the preset path to collect images, ensuring the comprehensiveness and consistency of image acquisition;
[0048] Step 2: Use Internet of Things technology to transmit the collected training data set to the central control system;
[0049] Specifically, a high-efficiency wireless communication protocol such as NB-IoT can be used to transmit images, and stable transmission can be achieved 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 perform data enhancement on the collected training data set; in this process, first, the training data set needs to be labeled in advance with the help of a labeling tool, and the target frame and the corresponding conclusion are labeled in the detection picture, the conclusion is the area where pests, diseases and weeds appear, and the target frame is the location of the conclusion, obtaining a plurality of training data sets with target frames; then, for the input training data set, first, the target frame part of each detection picture is intercepted, the resolution is improved, and it is randomly inserted into any image, and the size is adjusted to adapt to the new image, and the corresponding labeling file is modified; then, the data set is subjected to contour enhancement operation; 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 the image I blur ;
[0052] Step 3.2, subtract the blurred image I blur from the original image I to obtain a difference image I diff = I-I blur ;
[0053] Step 3.3, the difference image I diffMultiplying by the amplification factor k gives I scaled = k * I diff ;
[0054] Step 3.4, the scaled difference image I scaled is added back to the original image I, resulting in the final sharpened image I final = I + I scaled ;
[0055] Step 3.5, finally, the image dataset is further adjusted in brightness, respectively, brightness enhancement and brightness reduction, to obtain the final image dataset after contour brightness enhancement;
[0056] Step four, pre-process the image dataset to be detected, then input the image into the deep neural network, and extract low-level features through the non-sharpening mask module;
[0057] Preprocessing includes online data augmentation, image normalization, and dataset division. Online data augmentation includes flipping, scaling, etc. The image to be detected is input into the deep neural network model, and low-level features are fully extracted through the non-sharpening mask module to further improve the feature information richness of the deep neural network model. The specific way is:
[0058] Step 4.1, build a backbone shallow low-level feature extraction network, specifically a loop connection of Conv convolutional layer and C3k2 layer, and insert a non-sharpening mask module after the second Conv layer 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 non-sharpening mask module. This module first separates the input image with size (B, C1, H, W) into multiple tensors with size (C1, H, W) according to batch_size, then establishes a Gaussian kernel to convolve these tensors, and then adds and multiplies the original tensor and the processed tensor before concatenation to obtain rich edge contour feature information.
[0060] Step 4.2, the feature map extracted by the shallow network and the low-level features Figure 1 extracted by the non-sharpening mask module are input into the Neck layer to fully fuse the feature information, and then the feature information is input into the classification head and the 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 Conv and C3k2 modules alternately to extract low-level features, and the other is a non-sharpening mask module added to extract low-level features. Finally, the fusion is performed at the neck of the network to obtain the fusion features;
[0061] Step five, using SQL-IoU loss function and cross-entropy function to train the extracted fusion features, complete target positioning 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, the input of each channel is processed separately by deep convolution, a h x w convolution kernel is used for convolution operation, and Conv2d convolution is used to calculate the scores of different categories, and the highest score is the final result of classification; in the detection head, the position information of the real frame and the predicted frame is calculated using Conv convolution, and the overlap between each predicted frame and the real frame is calculated through the given loss function, and the predicted frame with the highest overlap is the final result of detection; the neural network continuously optimizes the parameters through the back propagation algorithm, gradually reduces the error, and finally realizes the convergence of the model;
[0063] After convergence, the real-time collected farmland images are detected and recognized by using the deep neural network model, and the target detection result is output, which is the pests, diseases, weeds and their corresponding positions;
[0064] Here, SQL-IoU loss function is used in the detection head, and cross-entropy loss function (L) is used in the classification head, and the definition of L is as follows:
[0065]
[0066] Where M is the number of categories; y ic is a sign function (0 or 1), which takes 1 if the real category of sample i is equal to c, and 0 otherwise; p ic is the predicted probability that sample i belongs to category c.
[0067] The SQL-IoU loss function used for detection and positioning is a loss function based on the consideration of the shape, angle and sample quality of the detection frame, and the key definition of SQL-IoU is as follows:
[0068]
[0069] Loss SQL =1-IoU+distance-0.5·cost
[0070] Where w1, w2, h1, h2 are the height and width of the predicted frame and the real frame, V w and V h are the weights of the width and height, U w and U h reflect the relative change of the width and height between the two boundary frames.
[0071] b1 x1pred_bbox_x is a predicted bounding box top-left x coordinate, b1 y1 pred_bbox_y is a predicted bounding box top-left y coordinate, b1 x2 pred_bbox_x2 is a predicted bounding box bottom-right x coordinate, b1 y2 pred_bbox_y2 is a predicted bounding box bottom-right y coordinate, b2 x1 gt_bbox_x is a ground truth bounding box top-left x coordinate, b2 y1 gt_bbox_y is a ground truth bounding box top-left y coordinate, b2 x2 gt_bbox_x2 is a ground truth bounding box bottom-right x coordinate, b2 y2 gt_bbox_y2 is a ground truth bounding box bottom-right y coordinate;
[0072] C 2 h mask_out_height is a non-sharpened mask output feature map height, C 2 w mask_out_width is a non-sharpened mask output feature map width;
[0073] Step 6, adjust the irrigation strategy and fertilization plan according to the target detection result;
[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 Internet of Things technology, the system can realize real-time monitoring of farmland, and once harmful organisms are detected, an alarm is immediately sent and the management personnel are notified, so that timely action can be taken to prevent spread.
[0075] As Embodiment Three of the present application, the embodiment includes the following steps:
[0076] For the monitored problem area, the system can accurately calculate its area and severity, and accordingly adjust the irrigation amount and fertilization amount.
[0077] As an embodiment provided by the present application, preferably, for the monitored problem area, the target bounding box output by the target detection algorithm is used, combined with the image resolution and the actual size conversion ratio of the ground, which can be obtained by the flight height of the unmanned aerial vehicle and the camera parameter calibration, to convert the pixel-level detection result into the area size in the actual farmland; the formula of the actual area is as follows:
[0078]
[0079] Among them, the pixel area refers to the number of pixels covered by the target bounding box; the scale factor refers to the actual area corresponding to each pixel (unit: square meter / pixel). The value is calculated by the flight height of the unmanned aerial vehicle, the camera parameter and the ground resolution.
[0080] Then according to the disease coverage rate, the severity level is evaluated, and the irrigation amount and fertilization amount are adjusted accordingly; the coverage rate refers to the proportion of the problem area in the entire monitored area, and the calculation formula is as follows:
[0081]
[0082] Wherein, the actual area of the problem area is the actual area obtained by the above formula; the actual total area of the monitoring area is obtained by the known size of the farmland. The coverage rate is divided into light, moderate and severe disease areas according to the ratio, and different strategies are adopted for different degrees of disease area:
[0083] Light disease area: only a small number of leaves appear mild symptoms, the coverage area is less than 5%, the system maintains normal irrigation rhythm, and appropriately increases nutrient elements such as potassium fertilizer to improve stress resistance;
[0084] Moderate disease area: the proportion of disease spots reaches 5%-20%, the system reduces the irrigation frequency and water quantity of the area to avoid high humidity to promote disease transmission, while increasing the supply of trace elements to promote crop recovery; here the specific irrigation frequency and water quantity can be modified to sixty percent of the original;
[0085] Severe disease area: the proportion of diseased leaves exceeds 20%, the system suspends mechanical irrigation, preferentially adopts drip irrigation or local water control method, cooperates with pesticide spraying and nutrition intervention, and prevents further deterioration of the disease.
[0086] As the fourth embodiment of the present application, the embodiment comprises the following steps:
[0087] The application also discloses a smart farming ecological monitoring and irrigation system based on target detection, and main modules include:
[0088] The farmland image acquisition module is configured to acquire farmland images; high-definition cameras or unmanned aerial vehicles are used for shooting, or pre-acquired image data is obtained from local storage or servers to ensure that different application scene requirements can be flexibly coped with;
[0089] The data transmission module is configured to transmit the collected images to the image preprocessing module of the central control system through Internet of Things technology; efficient wireless communication protocols (such as NB-IoT) are adopted, so that stable transmission of image data can be ensured even in low-bandwidth and high-interference environments, and real-time monitoring and rapid response are ensured;
[0090] The image preprocessing module is configured to perform necessary preprocessing operations on the input images. This step is highly customizable, and different preprocessing methods can be selected according to specific task requirements, such as adjusting image size, pixel standardization, rotation to adapt to changes in different shooting angles, etc., so as to improve the effect of subsequent processing steps;
[0091] The target detection module is configured to use a deep convolutional network in combination with a non-sharp mask module, an efficient channel attention module, a 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 in the image through the non-sharp mask module, and uses the efficient channel attention mechanism to highlight key semantic information. Then, the SQL-IoU loss function and the cross-entropy function are used for model training to achieve accurate target positioning 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 to optimize resource utilization efficiency and promote the healthy growth of crops. For example, if a particular area is detected to have severe pests or diseases, the system can reduce water supply to that area and adjust the fertilizer formula to reduce crop stress. If a large amount of weeds are detected, local irrigation frequency may need to be increased to suppress weed growth.
[0093] As the fifth embodiment of the present application, this embodiment is implemented based on the target detection-based smart farming ecological monitoring and irrigation system given in Embodiment Four. The system works in the following ways:
[0094] Acquire farmland images: Use high-definition cameras or drones to collect farmland images;
[0095] Image preprocessing: Perform necessary preprocessing operations on the images, such as adjusting size, pixel standardization, rotation, etc., to adapt to different scenarios;
[0096] Target detection: Identify target objects such as pests, diseases, and weeds through deep convolutional networks combined with non-sharp mask modules, efficient channel attention modules, and other technical means;
[0097] Strategy adjustment: Based on the target detection results, automatically adjust irrigation strategies and fertilization plans to optimize resource utilization efficiency and promote the healthy growth of crops.
[0098] Before target detection, an image preprocessing step is also included, and specific preprocessing operations include but are not limited to adjusting image size, pixel standardization, rotation, etc.; pixel standardization is used to make the data more in line with the distribution rule and improve the training effect, and rotation is used to adapt to different shooting angle changes. The system uses a multi-stage method to comprehensively monitor the farmland environment, and the shallow network is used to extract basic detail features of the image such as color, texture, contour, etc., and the deep network focuses on screening key semantic features to more accurately identify and locate target objects such as pests, diseases and weeds. By combining the non-sharp mask module and the efficient channel attention mechanism, the system can not only expand the effective receptive field, but also better capture subtle differences in the image, thereby improving detection accuracy.
[0099] As Embodiment Six of the present application, the present application also discloses a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of any one of the methods of Embodiments One to Three. This design not only improves the flexibility and expansibility of the system, but also provides convenient conditions for future functional upgrades. The device can efficiently and accurately perform farmland image acquisition, transmission, preprocessing, target recognition, and irrigation and fertilization strategy adjustment based on target detection, significantly improving agricultural production efficiency and resource utilization.
[0100] As can be seen from the above scheme, the present application relates to the fields of Internet of Things and computer vision technology, and proposes a smart farming ecological monitoring and irrigation system based on target detection, wherein a high-definition camera or a drone is arranged for image acquisition, and the collected images to be detected are transmitted to a central control system through Internet of Things technology; the images are subjected to data enhancement and preprocessing using a contour brightness enhancement algorithm, and the images are input into a deep convolution network to extract low-level features through a non-sharp mask module.
[0101] The present application extracts more complete low-level semantic information and features, re-labels the weights of different channels through a pyramid structure and an efficient channel attention module, extracts more key semantic features, and uses a SQL-IoU loss function and a cross-entropy function to perform target positioning and classification on the extracted features; a target detection algorithm is used to detect target objects such as pests, diseases and weeds, and irrigation strategies and fertilization plans are adjusted according to the detection results.
[0102] The present application proposes a new contour brightness enhancement algorithm to process the data set, enhances the generalization of the model, and at the same time constructs a non-sharp mask module to fully extract the detail features of the shallow network, which can further improve the feature information richness of the deep neural network, improve the detection accuracy, and the SQL-IoU loss function can enhance the positioning ability of the model.
[0103] The application provides a smart agricultural ecological monitoring and irrigation system based on target detection, which can improve the detection capability of a detection model for small objects, and adopts cross entropy and SQL-IoU loss functions for training, thereby improving the accuracy of target detection and the robustness of the model.
[0104] The smart agricultural ecological monitoring and irrigation system based on target detection provided by the application is related to the application of a system for Internet of Things and smart agricultural ecological monitoring and irrigation based on target detection, which can improve the extraction capability of a deep neural network for low-level feature information of an image, further improve the detection capability for small objects and other fine-grained objects, and the increase in the amount of calculation can be ignored, and the irrigation and fertilization strategies can be adjusted in time according to the detection results, so that the detection and accurate irrigation in a real ecological scene at a mobile terminal or an edge device terminal are realized.
[0105] In another embodiment provided in the application, a computer program product containing instructions is also provided, which, when running on a computer, enables the computer to execute the steps of any of the above-mentioned methods. Specifically, the computer program product can guide the computer to complete the following operations: setting a high-definition camera or a drone to collect images, transmitting the images to be detected to a central control system by using Internet of Things technology, performing data enhancement on a data set by using a contour brightness enhancement algorithm, pre-processing the images to be detected and extracting low-level features by using a deep neural network, training the extracted features by using a SQL-IoU loss function and a cross entropy function to realize target positioning and classification, and automatically adjusting irrigation strategies and fertilization plans according to the target detection results.
[0106] It can be understood that the system provided by the embodiments of the application corresponds to the method provided by the embodiments of the application, and the explanation, examples and beneficial effects of the related content can refer to the corresponding parts in the above-mentioned methods. For example, the system includes an agricultural field image collection module, a data transmission module, an image preprocessing module, a target detection module and an irrigation and fertilization strategy adjustment module.
[0107] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a non-volatile computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiments can be included. Wherein, any reference to a memory, storage, database or other medium used in each embodiment provided by the application can include non-volatile and / or volatile memory.
[0108] Any combination of the technical features in the above embodiments can be made, and 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 the technical features does not exist contradictions, it should be considered as the scope of the present disclosure. For example, the farmland image acquisition module can work independently, or can work in cooperation with other modules to adapt to different application scenarios.
[0109] The above embodiments are only used to illustrate the technical method of the present application but not limit the present application, although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical method of the present application.
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. Low-level features are extracted through an unsharpened mask module. Specifically, a shallow backbone network is constructed. The shallow network consists of alternating Conv convolutional layers and C3k2 layers. An unsharpened mask module is inserted after the second Conv convolutional layer to extract low-level features of the edge contour. 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.
2. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 1, characterized in that, The contour enhancement process includes: cropping the target bounding box region of the farmland image and increasing its resolution, then randomly inserting other images; applying Gaussian blur to generate a blurred image; calculating the difference image and scaling it before overlaying it onto the original image to enhance the contour; and finally adjusting the brightness 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, The specific training method for target localization and classification in deep neural networks is as follows: the extracted features are fused and input into the decoupled classification head and detection head of the deep network; in the classification head, depthwise convolution processes each input channel separately, using an h×w convolution kernel for each channel, and then Conv2d convolution is used to calculate the scores for different categories, with the highest score being the final classification result; in the detection head, Conv convolution is used to calculate the position information of the ground truth box and the predicted box, and the degree of overlap between each predicted box and the ground truth box is calculated using a given loss function, with the predicted box with the highest overlap being the final detection result.
5. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 4, 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; N is the total number of samples in the cross-entropy loss.
6. The intelligent agricultural ecological monitoring and irrigation method based on target detection according to claim 4, characterized in that, The detection header uses the SQL-IoU loss function, which is defined as follows: ; LossSQL=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 This reflects the relative changes in width and height between the two bounding boxes; IoU is the intersection-union ratio, a commonly used metric in object detection, used to measure the degree of overlap between the predicted and ground truth bounding boxes; distance is the positional offset between the predicted and ground truth boxes, used to measure the positional deviation between them; cost is a penalty term for shape, angle, and sample quality; b 1x1 The x-coordinate of the top left corner of the prediction box, b 1y1 The y-coordinate of the top left corner of the prediction box, b 1x2 For the prediction box, the x-coordinate prediction box at the bottom right corner, b 1y2 The y-coordinate and b-coordinate of the bottom right corner of the prediction box 2x1 The x-coordinate of the top left corner of the true bounding box, b 2y1 The y-coordinate of the top left corner of the true bounding box, b 2x2 The x-coordinate and b-coordinate of the bottom right corner of the true bounding box 2y2 C is the y-coordinate of the bottom right corner of the true bounding box. 2 h C is the height of the output feature map for the unsharpened mask. 2 w This is the width of the output feature map for the unsharpened mask.
7. A smart agricultural ecological monitoring and irrigation system based on target detection, characterized in that, The system is used to implement the method described in any one of claims 1-6. The system comprises: a farmland image acquisition module, used to acquire an image dataset consisting of images to be detected representing farmland images, and to transmit the acquired farmland images to an image preprocessing module via a data transmission module; the image preprocessing module performs preprocessing operations on the images to be detected in the image dataset, and transmits the preprocessed image dataset to a target detection module; the target detection module is used to train a deep neural network using the image dataset, combining a deep convolutional network with an unsharpened mask module, an efficient channel attention module, an SQL-IoU loss function, and a cross-entropy function, and to use the trained deep neural network model to identify real-time acquired farmland images, and output detection results for pests, diseases, and weeds; the target detection module extracts low-level features such as edges and contours in the image through an unsharpened mask module, highlights key semantic information using an efficient channel attention mechanism, and then trains a deep neural network model using the SQL-IoU loss function and the cross-entropy function.
8. A computer-readable storage medium, characterized in that, Used to store a program and, with the aid of a processor, to implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Infrared image correction method
CN115100068A
Image processing method, device, equipment and system
CN117217987A