Ecological agriculture management and control method and system based on deep learning and image recognition technology

Through the ecological agricultural control system based on deep learning and image recognition technology, the problem of obtaining agricultural environment image data and segmenting target areas is solved, real-time monitoring and dynamic control of the agricultural environment are realized, and the level of automation and intelligence of agricultural production is improved.

CN119693882BActive Publication Date: 2025-04-25SHAANXI INST OF BIOLOGICAL AGRI +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510208629.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-04-25
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

The existing technology has failed to effectively solve the problem of how to obtain image data of the agricultural environment, segment the target area, extract, classify and analyze the target area, and judge whether there are abnormalities in the agricultural environment to dynamically adjust the management and control measures.

Method used

Provides an ecological agricultural management and control system based on deep learning and image recognition technology, including image acquisition module, feature classification module, analysis and early warning module and dynamic management and control module. The system obtains image data of the agricultural environment through drones, divides out the target area, performs feature extraction and classification, analyzes regional features to determine whether there are abnormalities in the agricultural environment, and dynamically adjusts control measures based on early warning information.

Benefits of technology

Real-time, comprehensive and accurate monitoring of target areas in the agricultural environment is achieved, ensuring that subsequent processing is based on accurate data, improving the efficient and accurate classification of different goals in the agricultural environment, timely discovering potential abnormalities or risks, dynamically adjusting management and control measures, improving resource utilization efficiency, reducing manual intervention, and continuously optimizing agricultural control strategies through real-time feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693882B_ABST
    Figure CN119693882B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image recognition technology, and provides an ecological agriculture management and control method and system based on deep learning and image recognition technology. The image acquisition module acquires image data of the agricultural environment and segments the target area to achieve real-time, comprehensive and accurate monitoring of the target area in the agricultural environment; the feature classification module extracts features of the target area to obtain regional features, and classifies the targets according to the regional features to achieve efficient and accurate classification of different targets in the agricultural environment and provide accurate agricultural data support; the analysis and early warning module analyzes regional features, determines whether the agricultural environment is abnormal, and generates early warning information to achieve intelligent analysis of the agricultural environment, which can timely discover potential anomalies or risks and issue early warnings to help farm managers take measures in advance to prevent the expansion of problems; the dynamic management and control module dynamically adjusts the management and control measures according to the early warning information and provides feedback on the management and control effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to an ecological agriculture management and control method and system based on deep learning and image recognition technology. Background Art

[0002] Deep learning and image recognition technologies are used in many aspects of ecological agriculture. In terms of crop growth monitoring, they can determine the growth stage and nutritional status of crops by analyzing images; in the field of pest and disease monitoring and prevention, they can accurately identify the type, degree and distribution range of crop pests and diseases; in terms of weed identification, they can distinguish between crops and weeds to provide support for precise weeding; they reduce the workload of manual inspections and identification, improve management efficiency, and do not require personnel to observe and judge in the field for a long time, saving a lot of manpower and time costs. However, most of them have not solved the problem of how to obtain image data of the agricultural environment, segment the target area, extract, classify and analyze the features of the target area, and determine whether the agricultural environment is abnormal in order to dynamically adjust the management measures and feedback.

[0003] For example, a Chinese patent application with publication number CN118015705A discloses a digital management and control system based on agricultural breeding, including: a control terminal, which is the main control end of the system and is used to issue execution commands; an acquisition module, which is used to acquire real-time image data of the breeding area; an identification module, which is used to receive the real-time image data of the breeding area acquired in the acquisition module, and identify the activity status of dynamic targets in the breeding area based on the real-time image data of the breeding area; it can perform real-time image monitoring of the livestock breeding area, and then dynamically analyze the monitored image data of the livestock breeding area to bring real-time safety monitoring effects to the livestock raised in the livestock breeding area, ensuring that the safety risks existing in the livestock breeding area can be sniffed in real time through the system, thereby reducing the manual management costs in the livestock breeding process and bringing more reliable daily management effects to livestock breeding.

[0004] For example, a Chinese patent with authorization announcement number CN113920474B discloses an IoT system and method for intelligently monitoring the planting situation of citrus. First, multi-source sensors collect information on the temperature, humidity and growth status of the citrus environment, and use an embedded system to process the data. Then, the data is sent to the server through the NB-IoT wireless module, and the data is displayed in real time on the cloud platform interface. A convolutional neural network is used to learn and train image information, build a citrus growth situation model, especially for the detection of pest types and probabilities, and transmit the monitoring results to the client. When the number of pests reaches a certain number ratio, a drone carrying a pesticide spraying device is used to automatically spray the designated area. When the citrus is about to mature, the image information obtained by the drone is used to estimate the citrus yield. Supported by drones and IoT technology, the entire system effectively serves the efficient and refined control needs of smart agriculture.

[0005] The above existing technologies have the problem raised by this background technology: they do not solve the problem of how to obtain image data of the agricultural environment, segment the target area, extract, classify and analyze the target area, and determine whether there is any abnormality in the agricultural environment in order to dynamically adjust the control measures and provide feedback. Summary of the invention

[0006] In response to the deficiencies of the prior art, this application provides an ecological agriculture management and control method and system based on deep learning and image recognition technology.

[0007] In the first aspect, the present application provides an ecological agriculture management and control system based on deep learning and image recognition technology, the system comprising: an image acquisition module, a feature classification module, an analysis and early warning module, and a dynamic management and control module;

[0008] The image acquisition module is used to acquire image data of the agricultural environment and segment the target area. The segmentation strategy of the target area includes determining whether to add adjacent pixels to the target area according to the similarity between the adjacent pixels and the target area to complete the expansion of the target area.

[0009] The feature classification module is used to extract features of the target area to obtain regional features, and classify the target according to the regional features, wherein the regional features include target shape features, and the circularity of the target is determined according to the extraction method of the circumscribed rectangle of the target to determine the target shape features;

[0010] The analysis and early warning module is used to analyze regional characteristics, determine whether the agricultural environment is abnormal, and generate early warning information;

[0011] The dynamic control module is used to dynamically adjust control measures according to early warning information and provide feedback on the control effects.

[0012] As an optional implementation, image data of the agricultural environment is acquired by using a drone and a camera, and a target area is segmented. The segmentation strategy of the target area includes:

[0013] The acquired image data is converted into a grayscale image to obtain an agricultural grayscale image, the agricultural grayscale image is divided into grayscale image blocks, and the brightness mean of each grayscale image block is calculated;

[0014] Traverse each grayscale image block, compare the brightness mean of each grayscale image block with a threshold to obtain a seed image block, and select the central pixel of the seed image block as the seed pixel;

[0015] Selecting adjacent pixels of the seed pixel, and determining the similarity between the adjacent pixels and the target area according to the difference in grayscale value between the adjacent pixels and the seed pixel in the target area, so as to expand the target area;

[0016] Traverse all pixels until the similarity between the pixel and the target area is less than the similarity threshold, stop expanding the target area, and output the target area.

[0017] As an optional implementation, the region feature further includes a target edge feature and a target texture feature;

[0018] Targets are classified according to regional characteristics. The logic of target classification includes:

[0019] The target edge features include the mean gradient amplitude and the mean direction angle, and the target texture features include texture contrast;

[0020] The targets in the target area are comprehensively classified according to the mean gradient amplitude, mean direction angle, circularity and texture contrast in the target area. The targets include crops, pests and diseases, and weeds.

[0021] As an optional implementation manner, the determination sub-logic of the gradient amplitude mean and the direction angle mean includes:

[0022] Determine the horizontal and vertical gradients of the target area;

[0023] Determine the gradient magnitude of each pixel and the gradient direction of each pixel in the target area according to the horizontal gradient and the vertical gradient of the target area;

[0024] The gradient amplitude of each pixel in the target area is summed up and averaged to obtain the mean gradient amplitude of the target area;

[0025] Determine the angular difference between the gradient directions of every two adjacent pixels in the target area;

[0026] The angle difference of the gradient direction of every two adjacent pixels in the target area is summed and averaged to obtain the direction angle mean of the target area.

[0027] As an optional implementation, the circularity determination sub-logic includes:

[0028] Count the total number of pixels in the target area to obtain the target area;

[0029] Extract the bounding rectangle of the target and determine the width and height of the bounding rectangle;

[0030] Take the square root of the sum of the squares of the width and height of the circumscribed rectangle to get the diagonal length of the circumscribed rectangle of the target;

[0031] The square of the diagonal length is divided by the target area to obtain the circularity of the target area.

[0032] As an optional implementation manner, a method for extracting the bounding rectangle of the target includes:

[0033] Perform edge detection on the target area to obtain the target edge contour;

[0034] Based on the detected target edge contour, the convex hull of the target edge contour is calculated by a convex hull algorithm;

[0035] Determine the initial direction of the rectangle, traverse the vertices of the convex hull of the target edge contour in sequence, and at each vertex, rotate the direction of the rectangle and calculate the area of ​​the rectangle;

[0036] Compare the areas of rectangles in different directions and select the rectangle with the smallest area as the minimum circumscribed rectangle of the convex hull of the target edge contour;

[0037] The minimum bounding rectangle of the convex hull of the target edge contour is extracted as the bounding rectangle of the target.

[0038] As an optional implementation, whether an agricultural environment is abnormal is determined according to an abnormality determination strategy, and the abnormality determination strategy includes:

[0039] The change differences of the mean gradient amplitude, mean direction angle, circularity and texture contrast in the target area are recorded in the continuous monitoring period;

[0040] Configure the amplitude difference threshold, angle difference threshold, circular difference threshold and texture difference threshold, and compare the change difference of the mean gradient amplitude in the target area with the amplitude difference threshold to obtain the abnormality of the mean gradient amplitude;

[0041] The change difference of the direction angle mean in the target area is compared with the angle difference threshold to obtain the abnormality of the direction angle mean;

[0042] The circularity abnormality is obtained by comparing the circularity change difference with the circularity difference threshold;

[0043] The texture contrast change difference is compared with the texture difference threshold to obtain the abnormality of the texture contrast;

[0044] Determine the target in the target area, and comprehensively determine the abnormality of the target based on the abnormality of the mean gradient amplitude, the abnormality of the mean direction angle, the abnormality of the circularity, and the abnormality of the texture contrast;

[0045] If any target shows abnormality, it means that the agricultural environment is abnormal and an early warning message is generated.

[0046] As an optional implementation, the dynamic adjustment logic of the control measures includes:

[0047] Determine the abnormal targets, distinguish the reasons for the abnormal targets, dynamically adjust the control measures according to the reasons for the abnormal targets, and monitor whether the agricultural environment is still abnormal in the next monitoring cycle after the implementation of the control measures. If the agricultural environment is still abnormal, readjust the control measures.

[0048] In the second aspect, the present application provides an ecological agriculture management and control method based on deep learning and image recognition technology, the method comprising:

[0049] S1. Acquire image data of an agricultural environment and segment a target area. The segmentation strategy of the target area includes determining whether to add adjacent pixels to the target area according to the similarity between the adjacent pixels and the target area, so as to complete the expansion of the target area.

[0050] S2, extracting features from the target area to obtain regional features, and classifying the target according to the regional features, wherein the regional features include target shape features, and determining the circularity of the target according to a method of extracting the circumscribed rectangle of the target to determine the target shape features;

[0051] S3. Analyze regional characteristics, determine whether the agricultural environment is abnormal, and generate early warning information;

[0052] S4. Dynamically adjust control measures based on early warning information and provide feedback on the control effects.

[0053] Compared with the prior art, the beneficial effects of the present application are as follows: the image data of the agricultural environment is acquired through the image acquisition module, and the target area is segmented to realize real-time, comprehensive and accurate monitoring of the target area in the agricultural environment, ensuring that subsequent processing is based on accurate data; the feature classification module extracts features of the target area, obtains regional features, and classifies targets according to regional features, realizing efficient and accurate classification of different targets in the agricultural environment, avoiding misjudgments and omissions in traditional manual inspections, and providing accurate agricultural data support; the analysis and early warning module analyzes regional features, determines whether there is an abnormality in the agricultural environment, and generates early warning information, realizing intelligent analysis of the agricultural environment, and can timely discover potential anomalies or risks, and issue early warnings to help farm managers take measures in advance to prevent the expansion of problems; the dynamic management and control module dynamically adjusts the management and control measures according to the early warning information, and provides feedback on the management and control effects, realizing dynamic adjustment and optimization of the agricultural production process, improving resource utilization efficiency, reducing human intervention, and continuously optimizing agricultural management and control strategies through real-time feedback, and improving the automation and intelligence level of agricultural production. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0055] Figure 1 A system structure diagram of an ecological agriculture management and control system based on deep learning and image recognition technology provided in an embodiment of the present application;

[0056] Figure 2 A flow chart of a target area segmentation strategy for an ecological agriculture management and control system based on deep learning and image recognition technology provided in an embodiment of the present application;

[0057] Figure 3 A flow chart of a method for extracting a bounding rectangle of an ecological agriculture management and control system based on deep learning and image recognition technology provided in an embodiment of the present application;

[0058] Figure 4 A method flow chart of the ecological agriculture management and control method based on deep learning and image recognition technology provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the objectives, technical solutions and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the drawings in the specification. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0060] Example 1

[0061] like Figure 1 As shown, it is a system structure diagram of an ecological agriculture management and control system based on deep learning and image recognition technology provided in an embodiment of the present application. The system includes an image acquisition module, a feature classification module, an analysis and early warning module, and a dynamic management and control module.

[0062] The image acquisition module is used to acquire image data of the agricultural environment and segment the target area.

[0063] In a large area of ​​farmland, the camera carried by the drone is used to obtain image data of the agricultural environment. The target area needs to be segmented, including the areas of crops, weeds, and pests and diseases, so as to monitor the growth of crops later. Due to the complexity of the agricultural environment and the interference factors of weeds and pests and diseases, an effective target area segmentation strategy is needed to accurately extract the target area.

[0064] The image data of the agricultural environment is obtained by using drones and cameras, and the target area is segmented. The segmentation strategy of the target area is as follows: Figure 2 As shown, specifically including:

[0065] The acquired image data is converted into a grayscale image to obtain an agricultural grayscale image, the agricultural grayscale image is divided into grayscale image blocks, and the brightness mean of each grayscale image block is calculated;

[0066] Traverse each grayscale image block, compare the brightness mean of each grayscale image block with a threshold to obtain a seed image block, and select the central pixel of the seed image block as the seed pixel;

[0067] Selecting adjacent pixels of the seed pixel, and determining the similarity between the adjacent pixels and the target area according to the difference in grayscale value between the adjacent pixels and the seed pixel in the target area, so as to expand the target area;

[0068] Traverse all pixels until the similarity between the pixel and the target area is less than the similarity threshold, stop expanding the target area, and output the target area.

[0069] Converting the color image of the agricultural environment obtained by the camera on the drone into a grayscale image can simplify the image data and reduce the computational complexity. Removing the noise of the agricultural grayscale image can avoid the erroneous segmentation caused by noise interference. Here, Gaussian filtering is used to remove the noise of the agricultural grayscale image to improve the accuracy of the target area segmentation.

[0070] Dividing the agricultural grayscale image into multiple small grayscale image blocks and calculating the brightness mean of each grayscale image block helps to analyze the local features of the agricultural grayscale image and provide a basis for subsequent screening of seed image blocks; for example, dividing the agricultural grayscale image into grayscale image blocks of 10×10 pixels in size and calculating the brightness mean of each grayscale image block.

[0071] The seed image block is determined based on the comparison between the brightness mean and the preset brightness threshold. The central pixel of the seed image block is used as the seed pixel. The seed pixel is added to the target area and marked as a processed pixel. It is the starting point for the growth of the target area, and the selection of the seed pixel can usually represent the characteristics of the target area. There can be multiple seed image blocks at the same time, thereby obtaining multiple target areas, so that the target in each target area can be judged according to the regional characteristics later.

[0072] Start checking the adjacent pixels of the seed pixel, and determine the similarity by calculating the difference in grayscale value between the adjacent pixels and the seed pixels in the target area, which reflects the similarity between the adjacent pixels and the current target area. When the similarity between the adjacent pixels and the target area is greater than or equal to the preset similarity threshold, the adjacent pixels are added to the target area to achieve gradual expansion of the target area, and the adjacent pixels are marked as processed pixels; at the same time, the unprocessed pixels are continuously traversed. As the traversal proceeds, pixels that meet the similarity threshold are continuously added to the target area until no pixels with a sufficiently high similarity to the target area are found. At this time, the expansion of the target area is stopped, and finally a complete and clearly-bounded target area segmentation result is obtained, ensuring that the target area is segmented completely and accurately. These target areas contain a large number of pixels that meet the target characteristics.

[0073] Through this target area segmentation strategy, the target area is successfully segmented from the image data of the complex agricultural environment. Compared with manual segmentation, the segmentation efficiency is greatly improved, and a lot of time and labor costs are saved. Moreover, according to the target area segmentation strategy, the target area can be identified more accurately, reducing the misjudgment caused by interference factors such as soil and shadow. The segmentation result of the target area can be used for subsequent processing procedures, such as classifying the target after feature extraction of the target area, providing basic support for target classification, and judging the abnormal situation of the target in the target area. It can judge the growth health of crops, timely discover the problems of increased pests and diseases and weeds, and provide strong technical support for precision agricultural management and control.

[0074] The feature classification module is used to extract features from the target area, obtain regional features, and classify the target based on the regional features.

[0075] In the daily management and control of ecological agriculture, it is necessary to accurately classify different targets in the agricultural environment so that corresponding management measures can be taken for different targets. For example, crops need precise fertilization and irrigation; weeds need to be removed in time; and pests and diseases need to be prevented and controlled as soon as possible. Accurate target classification is the key prerequisite for achieving precision agricultural management.

[0076] Regional features include target edge features, target shape features and target texture features.

[0077] Different targets, such as crops, pests and diseases, and weeds, have inherent differences in the edge, shape, and texture features in the target area, and single features cannot effectively distinguish them. For example, some crops and weeds with similar shapes will be confused if they rely solely on shape features. However, combining texture features and edge features can improve classification accuracy. Comprehensive analysis of these features can distinguish different targets more comprehensively and accurately.

[0078] Targets are classified according to regional characteristics. The logic of target classification includes:

[0079] The target edge features include the mean gradient amplitude and the mean direction angle, the target shape features include circularity, and the target texture features include texture contrast;

[0080] The targets in the target area are comprehensively classified according to the mean gradient amplitude, mean direction angle, circularity and texture contrast in the target area. The targets include crops, pests and diseases, and weeds.

[0081] Configure the contrast threshold and circularity threshold. If the texture contrast in the target area is greater than the contrast threshold and the circularity in the target area is less than the circularity threshold, the target in the target area is a weed.

[0082] Configure the threshold of the gradient amplitude mean and the threshold of the direction angle mean. The threshold of the gradient amplitude mean includes the mean base value and the mean extreme value, and the threshold of the direction angle mean includes the angle base value and the angle extreme value.

[0083] If the mean value of the gradient amplitude in the target area is less than the mean base value and the mean value of the direction angle in the target area is less than the angle base value, the target in the target area is a crop;

[0084] If the mean value of the gradient amplitude in the target area is greater than the extreme value of the mean and the mean value of the direction angle in the target area is greater than the extreme value of the angle, then the target in the target area is a pest.

[0085] The mean gradient amplitude reflects the severity of the change in the target edge. The edges of areas infested by pests and diseases will become rougher due to tissue damage and lesion spread, and the mean gradient amplitude is larger; the edges of healthy crops are relatively smooth, and the mean gradient amplitude is smaller; the mean direction angle reflects the consistency and regularity of the edge direction. The growth of crops usually has a certain directionality, and the mean direction angle of their edges is relatively stable and concentrated in a certain range; the growth of weeds is more messy, the changes in the edge direction angle are more random, and the fluctuation range of the mean direction angle is larger; the changes in the direction angle of the edge of pests and diseases are also relatively random, and the fluctuation range of the mean direction angle is larger.

[0086] Circularity is an indicator that describes how close the target shape is to a circle. Under normal growth conditions, the fruits and leaves of crops have relatively regular shapes and relatively high circularity; while the shapes of weeds are usually irregular and have low circularity; the shapes of disease spots or insect aggregation areas are also more complex due to their growth and diffusion characteristics, and have relatively low circularity.

[0087] Texture contrast reflects the clarity and degree of variability of the target surface texture. The surface texture of weeds is usually more complex and diverse than that of crops, and has a higher texture contrast. The texture of crop areas affected by pests and diseases will change due to lesions or pests, and the texture contrast will increase or decrease abnormally, which is different from the texture contrast of healthy crops.

[0088] Through statistics and analysis of a large amount of sample data, feature thresholds that can effectively distinguish different targets are determined. These feature thresholds are based on the distribution of different target features to find the best distinction boundaries. Through this target classification logic, different targets in the farmland can be quickly and accurately classified. In actual agricultural management and control, the management efficiency is greatly improved. For example, when performing weeding operations, the area where the weeds are located can be accurately located to avoid unnecessary damage to crops, while reducing the use of herbicides and reducing environmental pollution. For areas where pests and diseases are located, they can be discovered in time and targeted prevention and control measures can be taken to effectively control the spread of pests and diseases and ensure crop yield and quality. For areas where crops are located, precise fertilization and irrigation operations can be performed according to the growth conditions of the crops to improve resource utilization efficiency and achieve sustainable agricultural development.

[0089] As important edge feature parameters, the mean gradient amplitude and the mean direction angle can provide a strong basis for target classification. By determining and analyzing the edge feature parameters, we can more accurately understand the edge characteristics of the target area, thereby improving the accuracy of target classification.

[0090] Among them, the determination sub-logic of the gradient amplitude mean and the direction angle mean includes:

[0091] Determine the horizontal and vertical gradients of the target area;

[0092] Determine the gradient magnitude of each pixel and the gradient direction of each pixel in the target area according to the horizontal gradient and the vertical gradient of the target area;

[0093] The gradient amplitude of each pixel in the target area is summed up and averaged to obtain the mean gradient amplitude of the target area;

[0094] Determine the angular difference between the gradient directions of every two adjacent pixels in the target area;

[0095] The angle difference of the gradient direction of every two adjacent pixels in the target area is summed and averaged to obtain the direction angle mean of the target area.

[0096] The horizontal gradient and vertical gradient reflect the brightness change rate of the image in the target area in the horizontal and vertical directions. The horizontal gradient and vertical gradient of each pixel in the target area can be calculated by the Sobel operator.

[0097] The gradient amplitude indicates how drastic the brightness change of the image in the target area is at that point. The larger the gradient amplitude is, the more obvious the brightness change around the point is. For example, at the edge of the target, the pixel value changes greatly, and its gradient amplitude is also larger. The gradient direction indicates the direction of the largest brightness change. The square of the horizontal gradient of each pixel and the square of the vertical gradient of each pixel are added and the square root is taken to obtain the gradient amplitude of each pixel. The inverse tangent of the horizontal gradient and the vertical gradient of each pixel is calculated to obtain the gradient direction of each pixel in radians.

[0098] The mean gradient amplitude can comprehensively reflect the severity of the changes in the edge of the entire target area. If the mean gradient amplitude of a target area is large, it means that the overall edge of the target area is relatively rough, with more detail changes or irregular edges. For example, the cell structure of a crop area infested by pests and diseases is destroyed, and the edge presents an irregular shape, resulting in an increase in the mean gradient amplitude; while the edge of a healthy crop area is relatively smooth, and the mean gradient amplitude is small.

[0099] In order to ensure that the angle difference between the gradient directions of every two adjacent pixels is in the range [0, π], a modulo operation can be used, such as , Represents the angular difference between the gradient directions of every two adjacent pixels; the angular difference between the gradient directions of every two adjacent pixels is calculated to measure the change in the edge direction in the target area.

[0100] The mean direction angle can reflect the consistency and regularity of the edge direction of the target area. When the mean direction angle is small, it means that the gradient directions of adjacent pixels are relatively close, that is, the edge of the target area has a certain directionality and regularity, which is consistent with the characteristic that crop growth has a certain directionality. When the mean direction angle is large, it indicates that the gradient directions of adjacent pixels are quite different and the edge direction changes are relatively random, which is consistent with the characteristics of crop corrosion by pests and diseases.

[0101] Through the determination sub-logic of the mean gradient amplitude and the mean direction angle, parameters that accurately reflect the edge characteristics of the target area can be extracted from the image data of the agricultural environment. In actual ecological agricultural monitoring, these parameters provide reliable data support for target classification.

[0102] Circularity is an indicator used to describe the degree of similarity between a target shape and a circle. Its core principle is to quantify the degree to which the target shape deviates from a circle by comparing the area of ​​the target region with the area of ​​a circle with the diagonal length of its circumscribed rectangle as its diameter. If the target shape is closer to a circle, its area is closer to the area of ​​a circle with the diagonal length of its circumscribed rectangle as its diameter, and the circularity is closer to 1. Conversely, the more irregular the target shape is, the smaller the circularity value is.

[0103] In ecological agricultural management and control, it is necessary to distinguish different targets based on shape characteristics, such as the shapes of crop fruits, lesions and weeds. Circularity, as an important shape quantification indicator, can help quickly determine the category of the target and provide a basis for subsequent precision agricultural management and control.

[0104] Among them, the circularity determination sub-logic includes:

[0105] Count the total number of pixels in the target area to obtain the target area;

[0106] Extract the bounding rectangle of the target and determine the width and height of the bounding rectangle;

[0107] Take the square root of the sum of the squares of the width and height of the circumscribed rectangle to get the diagonal length of the circumscribed rectangle of the target;

[0108] The square of the diagonal length is divided by the target area to obtain the circularity of the target area.

[0109] Through the determination sub-logic of circularity, the quantitative value of the target's shape features can be extracted quickly and effectively from the image data of the agricultural environment. In actual agricultural production, this quantitative value of the shape features provides a key basis for accurate judgment.

[0110] In ecological agriculture management and control, to accurately calculate the circularity of the target, it is necessary to first obtain the target's circumscribed rectangle. An accurate circumscribed rectangle is crucial for accurately quantifying the target shape.

[0111] Specifically, the object's bounding rectangle is extracted as follows: Figure 3 As shown, specifically including:

[0112] Perform edge detection on the target area to obtain the target edge contour;

[0113] Based on the detected target edge contour, the convex hull of the target edge contour is calculated by a convex hull algorithm;

[0114] Determine the initial direction of the rectangle, traverse the vertices of the convex hull of the target edge contour in sequence, and at each vertex, rotate the direction of the rectangle and calculate the area of ​​the rectangle;

[0115] Compare the areas of rectangles in different directions and select the rectangle with the smallest area as the minimum circumscribed rectangle of the convex hull of the target edge contour;

[0116] The minimum bounding rectangle of the convex hull of the target edge contour is extracted as the bounding rectangle of the target.

[0117] The edge detection algorithm can identify the boundary between the target and the background, thereby obtaining the target edge contour, which is to clarify the boundary range of the target; for example, when processing a target area suspected of a lesion, the canny edge detection algorithm is used to successfully obtain the edge contour of the lesion.

[0118] The convex hull is constructed based on the edge contour of the target, and the convex hull algorithm is used to calculate the convex hull of the target edge contour. The convex hull can simplify complex shapes into convex polygons, reduce the amount of subsequent calculations, remove holes and concave parts inside the target, and retain the main shape features of the target, making subsequent processing more efficient; for example, the Graham scanning algorithm is used to calculate the convex hull of the edge contour of the lesion to obtain a simplified convex polygon whose vertices clearly outline the main shape features of the lesion.

[0119] The geometric relationship of the convex hull vertices and vector operations are used to calculate the coordinates of the four vertices of the rectangle in different directions. As the rectangle rotates, it will have different contact situations with the convex hull at different angles. By calculating the coordinates of the four vertices of the rectangle, the position and size of the rectangle in that direction can be determined. For example, the initial direction of the rectangle is set to the horizontal direction, and then the vertices of the convex hull are traversed in sequence. During the traversal process, for each vertex of the convex hull, according to the coordinates of the convex hull vertices and the current rotation angle, the coordinates of the four vertices of the rectangle in that direction are determined using trigonometric functions and the principle of vector translation.

[0120] The rectangle is continuously rotated on the convex hull boundary of the target edge contour to find the minimum rectangle that can completely surround the convex hull. This is because the minimum circumscribed rectangle can fit the shape of the target most closely and accurately reflect the spatial range and shape trend of the target in the target area. Compared with a simple horizontal or vertical circumscribed rectangle, it can more accurately describe the shape characteristics of the target, especially for irregularly shaped targets. By comparing the areas of rectangles in different directions, the rectangle with the smallest area is selected as the minimum circumscribed rectangle. Such a rectangle can accurately define the circumscribed range of the target and provide a more accurate basis for the subsequent calculation of circularity. For example, after each rotation, the area of ​​the rectangle is obtained by calculating the absolute value of the cross product of two adjacent edge vectors according to the vertex coordinates of the rectangle. After multiple rotations and calculations, the areas of the rectangles in different directions are obtained. The areas of the rectangles in all different directions are compared. It is found that when the rectangle is rotated to a certain angle, the area of ​​the rectangle is the smallest, and this rectangle with the smallest area is the minimum circumscribed rectangle of the convex hull of the edge contour of the lesion, that is, the circumscribed rectangle of the lesion, so that the width and height of the circumscribed rectangle can be obtained.

[0121] Through this method of extracting the bounding rectangle, the bounding rectangle of the target can be accurately obtained. In actual ecological agricultural monitoring, this method provides a reliable guarantee for accurately analyzing the target shape characteristics.

[0122] Among them, the function expression of texture contrast is as follows:

[0123] ;

[0124] In the formula, represents the texture contrast of the target area, Indicates the gray level of the target area, Indicates the gray value is and grayscale value is The frequency with which adjacent pixel pairs appear in the target area.

[0125] It should be noted that the grayscale level of the target area Refers to the number of gray levels in the target area. Usually, for a standard grayscale image, the number of gray levels is 256; The gray value is calculated as and grayscale value is The square of the difference indicates that the gray value is and grayscale value is The grayscale difference between ( i − j ) 2 ∈ [ 0 ,( G − 1 ) 2 ] , where the gray value is and grayscale value is The value range is ; The value range is between 0 and 1 and satisfies ; If the grayscale value difference of the target area is large, then is larger, and if the pixel pair with this larger difference The frequency of occurrence is higher (i.e. If the grayscale value of the target area is large), the texture contrast value is also large. Conversely, if the grayscale value difference of the target area is small, the texture contrast value is also low.

[0126] The calculation of texture contrast is based on the grayscale co-occurrence matrix, in which the difference between each pair of grayscale values ​​of pixels affects the final contrast. It is necessary to select a specific offset and direction (usually horizontal, vertical or diagonal). The offset determines the relative distance between two pixels. By scanning the pixel pairs in the target area, according to the given offset and direction, their grayscale values ​​are recorded between each pair of pixels. The frequency of occurrence of grayscale values ​​of all pixel pairs in the target area is counted to construct a G×G matrix. ,in Indicates the gray value is and grayscale value is The frequency of adjacent pixel pairs appearing in the target area is obtained by matrix Then, through the matrix The texture contrast of the target area is calculated based on the value of

[0127] The analysis and early warning module is used to analyze regional characteristics, determine whether there are any abnormalities in the agricultural environment, and generate early warning information.

[0128] In the daily monitoring of ecological agriculture, it is necessary to promptly detect abnormal conditions in the agricultural environment to ensure the healthy growth of crops and the stability of the farmland ecosystem; for example, early detection of signs of outbreaks of pests and diseases, abnormal trends in crop growth, and abnormal reproduction of weeds can buy time for timely adoption of effective prevention and control and management measures, thereby reducing losses in agricultural production.

[0129] Determine whether the agricultural environment is abnormal based on the abnormality judgment strategy. The abnormality judgment strategy includes:

[0130] The change differences of the mean gradient amplitude, mean direction angle, circularity and texture contrast in the target area are recorded in the continuous monitoring period;

[0131] Configure the amplitude difference threshold, angle difference threshold, circular difference threshold and texture difference threshold, and compare the change difference of the mean gradient amplitude in the target area with the amplitude difference threshold to obtain the abnormality of the mean gradient amplitude;

[0132] The change difference of the direction angle mean in the target area is compared with the angle difference threshold to obtain the abnormality of the direction angle mean;

[0133] The circularity abnormality is obtained by comparing the circularity change difference with the circularity difference threshold;

[0134] The texture contrast change difference is compared with the texture difference threshold to obtain the abnormality of the texture contrast;

[0135] Determine the target in the target area, and comprehensively determine the abnormality of the target based on the abnormality of the mean gradient amplitude, the abnormality of the mean direction angle, the abnormality of the circularity, and the abnormality of the texture contrast;

[0136] If any target shows abnormality, it means that the agricultural environment is abnormal and an early warning message is generated.

[0137] The change difference is recorded because the change of these regional features can reflect the state change of the target in the agricultural environment. The change difference of the mean gradient amplitude, mean direction angle, circularity and texture contrast is obtained by subtracting the mean gradient amplitude, mean direction angle, circularity and texture contrast at the latter time in the monitoring period from the mean gradient amplitude, mean direction angle, circularity and texture contrast at the previous time. Here the change difference is presented in the form of absolute value; for example, when crops are attacked by pests and diseases, the texture, edge features and shape of their surface will change, which will lead to changes in the corresponding texture contrast, mean gradient amplitude, mean direction angle and circularity. By capturing these change differences, potential abnormalities can be discovered.

[0138] The purpose of configuring the difference threshold is to quantitatively determine whether the changes in these features exceed the normal range. Each difference threshold is obtained based on the statistical analysis of a large amount of feature data under normal conditions. When the difference in feature change is greater than the corresponding difference threshold, it indicates that the feature has undergone an abnormal change, suggesting that the target has been affected by external factors.

[0139] The change of a single feature may have errors or be affected by accidental factors. Therefore, it is necessary to comprehensively consider the abnormality of the mean gradient amplitude, the abnormality of the mean direction angle, the abnormality of the circularity, and the abnormality of the texture contrast to judge the abnormality of the target and avoid misjudgment.

[0140] Through this abnormal judgment strategy, abnormal situations in the agricultural environment can be discovered in a timely and accurate manner. In practical applications, the safety and stability of agricultural production have been greatly improved. For example, an early warning can be issued before a large-scale outbreak of pests and diseases occurs, so that farmers can take targeted prevention and control measures in a timely manner, such as spraying pesticides, releasing natural enemies, etc., to effectively control the spread of pests and diseases, reduce damage to crops, and ensure crop yields. At the same time, early warnings of abnormal crop growth can help farmers adjust management measures such as fertilization and irrigation in a timely manner, optimize the crop growth environment, and improve the efficiency of agricultural production. In addition, compared with traditional manual inspection methods, this strategy can achieve large-scale, real-time monitoring, greatly improving monitoring efficiency and saving labor costs.

[0141] The dynamic control module is used to dynamically adjust control measures based on early warning information and provide feedback on the control effects.

[0142] The dynamic adjustment logic of control measures includes:

[0143] Determine the abnormal targets, distinguish the reasons for the abnormal targets, dynamically adjust the control measures according to the reasons for the abnormal targets, and monitor whether the agricultural environment is still abnormal in the next monitoring cycle after the implementation of the control measures. If the agricultural environment is still abnormal, readjust the control measures.

[0144] If the target with the abnormality in the target area is a crop, such as uneven crop growth, then identify the cause of the uneven crop growth; if the mean gradient amplitude is abnormal, it means that the growth status of the crops in the target area is greatly different. When the mean gradient amplitude of the crops in the target area at the later time during the monitoring period is larger than the mean gradient amplitude of the previous time, it means that the surface of the crop leaves is damaged or the disease is in the early stage. It is necessary to strengthen disease monitoring and arrange professional personnel for inspection. When the mean gradient amplitude of the crops in the target area at the later time during the monitoring period is smaller than the mean gradient amplitude of the previous time, it means that there is insufficient light or nutrient deficiency, and the lighting facilities need to be adjusted, such as raising or lowering the height of the shade net; if the mean direction angle is abnormal, it means that the growth form of the crops in the target area is abnormal, which means that it is disturbed by external forces and should be promptly repaired. Set up windbreaks when necessary; if the roundness is abnormal, it means there are problems with fruit development, indicating uneven pollination or unbalanced nutrient distribution. Artificial assisted pollination should be carried out in time, and the amount of irrigation and fertilization should be adjusted to ensure a balanced supply of nutrients; if the texture contrast is abnormal, it means that the health of the crop leaves is abnormal. When the average gradient amplitude of the crop in the target area at the next time during the monitoring period is larger than the average gradient amplitude of the previous time, it indicates that it is in the early stage of pests and diseases or water stress. Pest and disease monitoring should be strengthened, and the irrigation system should be checked to ensure that the water is sufficient and evenly distributed. When the average gradient amplitude of the crop in the target area at the next time during the monitoring period is smaller than the average gradient amplitude of the previous time, it indicates that there is excess nutrition or excessive light. It is necessary to appropriately reduce the amount of fertilizer and adjust the light intensity, such as adjusting the shading rate of the shade net.

[0145] If the target of the abnormality in the target area is weeds, such as the increase in the number of weeds, then the reasons for the increase in the number of weeds should be identified; if the mean value of the gradient amplitude is abnormal, it indicates that the growth trend of weeds has intensified, and the mechanical weeding should be strengthened and the frequency of weeding should be increased; if the mean value of the direction angle is abnormal, it means that the weeds are growing more disorderly, and seed quarantine needs to be strengthened to prevent the introduction of new weed seeds. At the same time, for the weeds that have appeared, a combination of manual removal and chemical weeding should be used to accurately weed different types of weeds during their sensitive growth period; if the circularity is abnormal, it means that the area of ​​the weed area has expanded. In addition to conventional weeding measures, biological weeding methods can be considered, such as releasing insects that feed on weeds or releasing herbivores without affecting crop growth; if the texture contrast is abnormal, it means that the weeds are growing vigorously, and the weeding plan for the next quarter should be advanced, the weeding budget should be increased, and more advanced weeding equipment should be purchased; and the cleaning of the environment around the farmland should be strengthened to reduce the source of weed seeds.

[0146] If the abnormal target in the target area is pests and diseases, such as the aggravation of pests and diseases, then distinguish the reasons for the aggravation of pests and diseases. If the gradient amplitude mean is abnormal, such as the increase in the gradient amplitude mean, it means that the damage of pests and diseases to crops is aggravating, and it is necessary to immediately increase the amount of pesticide spraying or replace more effective pesticides, but be careful to avoid excessive use of pesticides to cause environmental pollution. At the same time, carry out biological control by releasing natural enemies of pests to reduce pest density; if the direction angle mean is abnormal, such as the increase in the fluctuation range of the direction angle mean, it means that the spread of pests and diseases is accelerating. Isolation belts should be set up quickly to prevent pests and diseases from spreading to other areas. The infected crops should be cleaned and destroyed in time to cut off the transmission routes of pests and diseases, and strengthen the protection of healthy crops. For example, spraying plant immune inducers can improve the crop's own immunity; if the roundness is abnormal, such as the area where the roundness of the diseased spot or insect aggregation area is less than the preset value, it means that the pests and diseases are spreading, and it is necessary to strengthen information sharing and joint prevention and control with surrounding farmers, unify actions, and jointly prevent and control pests and diseases. At the same time, use equipment such as drones to spray pesticides over large areas to improve prevention and control efficiency; if the texture contrast is abnormal, such as the area where the texture of the pest and disease area increases or decreases, it means that the pest and disease situation is worsening. Plant protection experts should be invited in time for on-site guidance, formulate scientific and reasonable prevention and control plans, strengthen supervision on the use of pesticides, ensure the safe and effective use of pesticides, and use physical methods such as light trapping and sex trapping to assist in reducing the number of pests.

[0147] Example 2

[0148] like Figure 4 As shown, a method flow chart of an ecological agriculture management and control method based on deep learning and image recognition technology is provided for an embodiment of the present application, and the method includes:

[0149] S1. Acquire image data of an agricultural environment and segment a target area. The segmentation strategy of the target area includes determining whether to add adjacent pixels to the target area according to the similarity between the adjacent pixels and the target area, so as to complete the expansion of the target area.

[0150] S2, extracting features from the target area to obtain regional features, and classifying the target according to the regional features, wherein the regional features include target shape features, and determining the circularity of the target according to a method of extracting the circumscribed rectangle of the target to determine the target shape features;

[0151] S3. Analyze regional characteristics, determine whether the agricultural environment is abnormal, and generate early warning information;

[0152] S4. Dynamically adjust control measures based on early warning information and provide feedback on the control effects.

[0153] Since the principle of solving the problem by the method in the embodiment of the present application is similar to that of the system described above in the embodiment of the present application, the implementation of the method refers to the implementation of the system, and the repeated parts will not be repeated.

[0154] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0155] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application, which should be included in the scope of the claims of the present application.

Claims

1. Ecological agriculture management and control system based on deep learning and image recognition technology, characterized by: include: Image acquisition module, feature classification module, analysis and warning module, and dynamic control module; The image acquisition module is used to acquire image data of the agricultural environment and segment the target area. The segmentation strategy of the target area includes determining whether to add adjacent pixels to the target area according to the similarity between the adjacent pixels and the target area to complete the expansion of the target area. The image data of the agricultural environment is obtained by using a drone and a camera, and the target area is segmented. The segmentation strategy of the target area includes: The acquired image data is converted into a grayscale image to obtain an agricultural grayscale image, the agricultural grayscale image is divided into grayscale image blocks, and the brightness mean of each grayscale image block is calculated; Traverse each grayscale image block, compare the brightness mean of each grayscale image block with a threshold to obtain a seed image block, and select the central pixel of the seed image block as the seed pixel; Selecting adjacent pixels of the seed pixel, and determining the similarity between the adjacent pixels and the target area according to the difference in grayscale value between the adjacent pixels and the seed pixel in the target area, so as to expand the target area; Traverse all pixels until the similarity between the pixel and the target area is less than the similarity threshold, stop expanding the target area, and output the target area; The feature classification module is used to extract features of the target area to obtain regional features, and classify the target according to the regional features, wherein the regional features include target shape features, and the circularity of the target is determined according to the extraction method of the circumscribed rectangle of the target to determine the target shape features; The circularity determination sub-logic includes: Count the total number of pixels in the target area to obtain the target area; Extract the bounding rectangle of the target and determine the width and height of the bounding rectangle; Take the square root of the sum of the squares of the width and height of the circumscribed rectangle to get the diagonal length of the circumscribed rectangle of the target; Divide the square of the diagonal length by the target area to obtain the circularity of the target area; The method of extracting the bounding rectangle of the target includes: Perform edge detection on the target area to obtain the target edge contour; Based on the detected target edge contour, the convex hull of the target edge contour is calculated by a convex hull algorithm; Determine the initial direction of the rectangle, traverse the vertices of the convex hull of the target edge contour in sequence, and at each vertex, rotate the direction of the rectangle and calculate the area of ​​the rectangle; Compare the areas of rectangles in different directions and select the rectangle with the smallest area as the minimum circumscribed rectangle of the convex hull of the target edge contour; Extract the minimum bounding rectangle of the convex hull of the target edge contour as the bounding rectangle of the target; The analysis and early warning module is used to analyze regional characteristics, determine whether the agricultural environment is abnormal, and generate early warning information; The dynamic control module is used to dynamically adjust control measures according to early warning information and provide feedback on the control effects.

2. The ecological agriculture management and control system based on deep learning and image recognition technology as claimed in claim 1, characterized in that: The regional features also include target edge features and target texture features; Targets are classified according to regional characteristics. The logic of target classification includes: The target edge features include the mean gradient amplitude and the mean direction angle, and the target texture features include texture contrast; The targets in the target area are comprehensively classified according to the mean gradient amplitude, mean direction angle, circularity and texture contrast in the target area. The targets include crops, pests and diseases, and weeds.

3. The ecological agriculture management and control system based on deep learning and image recognition technology as claimed in claim 2, characterized in that: The determination sub-logic of the gradient amplitude mean and the direction angle mean includes: Determine the horizontal and vertical gradients of the target area; Determine the gradient magnitude of each pixel and the gradient direction of each pixel in the target area according to the horizontal gradient and the vertical gradient of the target area; The gradient amplitude of each pixel in the target area is summed up and averaged to obtain the mean gradient amplitude of the target area; Determine the angular difference between the gradient directions of every two adjacent pixels in the target area; The angle difference of the gradient direction of every two adjacent pixels in the target area is summed and averaged to obtain the direction angle mean of the target area.

4. The ecological agriculture management and control system based on deep learning and image recognition technology as claimed in claim 3, characterized in that: Whether an agricultural environment is abnormal is determined according to an abnormality determination strategy, wherein the abnormality determination strategy includes: The change differences of the mean gradient amplitude, mean direction angle, circularity and texture contrast in the target area are recorded in the continuous monitoring period; Configure the amplitude difference threshold, angle difference threshold, circular difference threshold and texture difference threshold, and compare the change difference of the mean gradient amplitude in the target area with the amplitude difference threshold to obtain the abnormality of the mean gradient amplitude; The change difference of the direction angle mean in the target area is compared with the angle difference threshold to obtain the abnormality of the direction angle mean; The circularity abnormality is obtained by comparing the circularity change difference with the circularity difference threshold; The texture contrast change difference is compared with the texture difference threshold to obtain the abnormality of the texture contrast; Determine the target in the target area, and comprehensively determine the abnormality of the target based on the abnormality of the mean gradient amplitude, the abnormality of the mean direction angle, the abnormality of the circularity, and the abnormality of the texture contrast; If any target shows abnormality, it means that the agricultural environment is abnormal and an early warning message is generated.

5. The ecological agriculture management and control system based on deep learning and image recognition technology as claimed in claim 4, characterized in that: The dynamic adjustment logic of the control measures includes: Determine the abnormal targets, distinguish the reasons for the abnormal targets, dynamically adjust the control measures according to the reasons for the abnormal targets, and monitor whether the agricultural environment is still abnormal in the next monitoring cycle after the implementation of the control measures. If the agricultural environment is still abnormal, readjust the control measures.

6. An ecological agriculture management and control method based on deep learning and image recognition technology, implemented based on an ecological agriculture management and control system based on deep learning and image recognition technology according to any one of claims 1 to 5, characterized in that: include: S1. Acquire image data of an agricultural environment and segment a target area. The segmentation strategy of the target area includes determining whether to add adjacent pixels to the target area according to the similarity between the adjacent pixels and the target area, so as to complete the expansion of the target area. S2, extracting features from the target area to obtain regional features, and classifying the target according to the regional features, wherein the regional features include target shape features, and determining the circularity of the target according to a method of extracting the circumscribed rectangle of the target to determine the target shape features; S3. Analyze regional characteristics, determine whether the agricultural environment is abnormal, and generate early warning information; S4. Dynamically adjust control measures based on early warning information and provide feedback on the control effects.

Citation Information

Patent Citations

  • An Internet of Things system and method for intelligently monitoring citrus planting conditions

    CN113920474B

  • Digital management and control system based on agricultural cultivation

    CN118015705A

  • Method and system for identifying white-leg shrimp disease on basis of machine vision

    CN102521600A

  • Construction method of leaf image recognition model

    CN111860567A