Water and soil conservation state monitoring method, device and equipment and storage medium
By using visual image processing and machine learning algorithms in soil and water conservation monitoring, the problems of poor applicability and low efficiency in the prior art are solved, and more accurate and efficient soil and water conservation status monitoring are achieved, which can predict and prevent soil and water erosion in advance.
Patent Information
- Application Number
- CN202411872055.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The existing soil and water conservation monitoring technology is poor in applicability, low in work efficiency, and relies on manual operations, resulting in inaccurate monitoring results.
By acquiring visual images within the preset area, using a boundary extraction algorithm to separate the flowing water body and soil geology, calculate the area ratio, and establish an area prediction model through machine learning algorithms to predict the future area ratio, and then determine the soil and water conservation status.
It improves the accuracy and efficiency of soil and water conservation monitoring, reduces subjective errors in manual operations, and can take preventive measures before soil erosion occurs to avoid the lag of subsequent measures.
Smart Images

Figure CN119880892A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic digital data processing, and in particular to a method, device, equipment and storage medium for monitoring soil and water conservation status. Background Art
[0002] Soil and water conservation monitoring refers to the long-term investigation, observation and analysis of the occurrence, development, harm and benefits of soil and water loss. Through soil and water conservation monitoring, we can understand the types, intensity and distribution characteristics, harm and impact, occurrence and development laws, and dynamic change trends of soil and water loss in the target area, which is of great significance for the macro decision-making of comprehensive soil and water loss control and ecological environment construction, as well as the scientific, reasonable and systematic deployment of various soil and water conservation measures.
[0003] As the basic link of soil and water conservation, soil and water conservation monitoring is the premise for comprehensive management of soil and water loss and ecological environment construction. The apparent phenomenon of soil and water loss is soil erosion, which is an important part of soil and water conservation monitoring. The formation of soil erosion includes both natural factors such as precipitation, topography and soil properties, as well as human factors such as unreasonable land use, which have caused the decline of soil quality, the impoverishment of land, and accelerated the process of land degradation.
[0004] In recent years, relevant researchers and soil and water conservation monitoring staff have studied and practiced the monitoring technology and methods of man-made soil and water loss in construction projects from the aspects of the mechanism and characteristics of man-made soil and water loss in development and construction projects, and the monitoring practice of soil and water loss in construction projects. Some progress has been made, but a standardized technical system has not yet been formed. The current "Technical Regulations for Soil and Water Conservation Monitoring" proposes several monitoring methods, including runoff plot observation, control station observation, simple slope measurement method, simple soil and water loss field monitoring, survey monitoring method, and remote sensing monitoring method. However, most of the above methods have the problems of poor applicability and low work efficiency, and most of the work links mainly rely on manual operation, which inevitably brings subjective experience errors into soil and water conservation monitoring, making the subsequent monitoring results inaccurate. Summary of the invention
[0005] The main purpose of this application is to provide a method, device, equipment and storage medium for monitoring the status of soil and water conservation, so as to solve the problems of poor applicability and low work efficiency of the existing technology, and most of the work links mainly rely on manual operation, which inevitably brings subjective experience errors into soil and water conservation monitoring, resulting in inaccurate subsequent monitoring results.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A method for monitoring soil and water conservation status, the monitoring method is applied to soil geology with flowing water in a preset area, the monitoring method comprising:
[0008] Step S1, acquiring a plurality of visual images of the preset area based on a preset time period, acquiring a plurality of visual images in each preset time period, each visual image including the flowing water body and the soil geology;
[0009] Step S2, obtaining the separation boundary of each visual image by using a boundary extraction algorithm, wherein the separation boundary is used to separate the flowing water body and the soil geology;
[0010] Step S3, acquiring a first image area of the flowing water body and a second image area of the soil geology based on a separation boundary of the current visual image;
[0011] Step S4, obtaining an area ratio of the first image area to the second image area based on the current visual image;
[0012] Step S5, learning and training all area ratios through a machine learning algorithm to obtain an area prediction model;
[0013] Step S6, predicting the future area ratio of a preset natural time step number by the area prediction model;
[0014] Step S7, converting all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis;
[0015] Step S8, linearly fitting all coordinate points to obtain a ratio function, and deriving the ratio function to obtain a slope function;
[0016] Step S9, defining the portion where the slope function y value is greater than zero as a water loss state, defining the portion where the slope function y value is less than zero as a soil loss state, and defining the portion where the slope function y value is equal to zero as a soil and water conservation state.
[0017] As a further improvement of the present application, step S2, respectively obtaining the separation boundary of each visual image by using a boundary extraction algorithm, wherein the separation boundary is used to separate the flowing water body and the soil geology, includes:
[0018] Step S21, converting each visual image into a grayscale image by using the cv2.cvtColor() function of the OpenCV environment;
[0019] Step S22, obtaining all image edges of the current grayscale image through the Canny edge detection operator;
[0020] Step S23, defining an erosion structure element of a preset pixel size;
[0021] Step S24, traversing all image edges with one pixel as a step based on the center of the eroded structure element;
[0022] Step S25, deleting all paths traversed by the eroded structure element to obtain an eroded image of the current grayscale image;
[0023] Step S26, subtracting the current grayscale image from the current eroded image to obtain the boundaries of all objects;
[0024] Step S27, loading all object boundaries into the current visual image to obtain a visual image with boundaries;
[0025] Step S28, obtaining the flowing water body and soil geology of the current visual image with boundary through the target detection algorithm;
[0026] Step S29, traverse all object boundaries and define the boundaries of flowing water and soil geology on both sides as the separation boundaries of the current visual image.
[0027] As a further improvement of the present application, step S28, obtaining the flowing water body and soil geology of the current visual image with boundary by using the target detection algorithm, includes:
[0028] Step S2801, dividing the current visual image with borders into a number of square grids on average;
[0029] Step S2802, predicting a number of water body bounding boxes for all flowing water bodies based on all square grids;
[0030] Step S2803, defining the flowing water body as having the highest confidence, and marking the bounding box with the highest confidence as the first-order water body bounding box;
[0031] Step S2804, calculating the intersection-over-union ratio of each other bounding box with the first-order water body bounding box;
[0032] Step S2805, selecting all bounding boxes whose intersection-over-union ratio is greater than or equal to a preset intersection-over-union ratio threshold as second-order water body bounding boxes;
[0033] Step S2806, obtaining a second-order water body boundary box with the highest confidence and defining it as the flowing water body;
[0034] Step S2807, resetting the confidence of the flowing water body and defining the soil geology as having the highest confidence;
[0035] Step S2808, marking the bounding box with the highest confidence as the first-order soil bounding box;
[0036] Step S2809, calculating the intersection-over-union ratio of each other bounding box with the first-order soil bounding box;
[0037] Step S2810, selecting all bounding boxes whose intersection-over-union ratio is greater than or equal to the preset intersection-over-union ratio threshold as second-order soil bounding boxes;
[0038] Step S2811, obtaining a second-order soil bounding box with the highest confidence and defining it as the soil geology.
[0039] As a further improvement of the present application, step S5, learning and training all area ratios through a machine learning algorithm to obtain an area prediction model, includes:
[0040] Step S51, performing standard normalization processing on all area ratios to obtain a normalized data set based on a preset time period;
[0041] Step S52, dividing the current normalized data set into a training set and a validation set according to a preset ratio;
[0042] Step S53, defining a neural network model in which the input layer, the hidden layer, and the output layer are sequentially connected;
[0043] Step S54, inputting the training set into the input layer, performing several trainings through the neural network model, and obtaining a root mean square error between the validation set and the current training result based on each training;
[0044] Step S55, obtaining the minimum value of all root mean square errors;
[0045] Step S56, obtaining a training result corresponding to the minimum value as the area prediction model.
[0046] As a further improvement of the present application, in step S9, the portion where the slope function y value is greater than zero is defined as a water loss state, the portion where the slope function y value is less than zero is defined as a soil loss state, and the portion where the slope function y value is equal to zero is defined as a soil and water conservation state, and then, the following steps are included:
[0047] Step S10, obtaining the water loss start timestamp, water loss peak value, and water loss duration of each water loss state based on the slope function;
[0048] Step S20, respectively packaging the water loss start timestamp, water loss peak value, and water loss duration of each water loss state into a water loss data packet;
[0049] Step S30, integrating all water loss data packets into a water loss record set;
[0050] Step S40, obtaining the soil loss start timestamp, soil loss peak value, and soil loss duration of each soil loss state based on the slope function;
[0051] Step S50, respectively packaging the soil loss start timestamp, soil loss peak value, and soil loss duration of each soil loss state into a soil loss data packet;
[0052] Step S60, integrating all soil loss data packets into a soil loss record set;
[0053] Step S70: sending the water loss record set and the soil loss record set to an external receiving end.
[0054] To achieve the above objectives, this application also provides the following technical solutions:
[0055] A monitoring device for soil and water conservation status, the monitoring device is applied to the above-mentioned monitoring method, and the monitoring device comprises:
[0056] A water and soil visual image acquisition module, used to acquire a plurality of visual images of the preset area based on a preset time period, and acquire a plurality of visual images in each preset time period, each visual image including the flowing water body and the soil geology;
[0057] A water-soil segmentation boundary acquisition module, used to respectively acquire the separation boundary of each visual image through a boundary extraction algorithm, wherein the separation boundary is used to separate the flowing water body and the soil geology;
[0058] A water and soil image area acquisition module, used to acquire a first image area of the flowing water body and a second image area of the soil geology based on a separation boundary of a current visual image;
[0059] A water-land area ratio acquisition module, used for acquiring an area ratio of the first image area to the second image area based on a current visual image;
[0060] An area prediction model acquisition module is used to learn and train all area ratios through a machine learning algorithm to obtain an area prediction model;
[0061] A future area ratio prediction module, used for predicting a future area ratio of a preset natural time step through the area prediction model;
[0062] A future area ratio conversion module, used to convert all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis;
[0063] A ratio function acquisition and derivation module is used to linearly fit all coordinate points to obtain a ratio function, and to derivate the ratio function to obtain a slope function;
[0064] The soil and water conservation status definition module is used to define the part where the slope function y value is greater than zero as a water loss state, the part where the slope function y value is less than zero as a soil loss state, and the part where the slope function y value is equal to zero as a soil and water conservation state.
[0065] To achieve the above objectives, this application also provides the following technical solutions:
[0066] An electronic device comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the monitoring method as described above is implemented.
[0067] To achieve the above objectives, this application also provides the following technical solutions:
[0068] A storage medium stores program instructions, which can implement the above-mentioned monitoring method when executed by a processor.
[0069] The present application obtains several visual images of a preset area based on a preset time period, and obtains several visual images in each preset time period, and each visual image includes flowing water and soil geology; obtains the separation boundary of each visual image respectively through a boundary extraction algorithm, and the separation boundary is used to separate the flowing water and the soil geology; obtains the first image area of the flowing water and the second image area of the soil geology based on the separation boundary of the current visual image; obtains the area ratio of the first image area to the second image area based on the current visual image; learns and trains all area ratios through a machine learning algorithm to obtain an area prediction model; predicts the future area ratio of a preset natural time step through the area prediction model; converts all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis; linearly fits all coordinate points to obtain a ratio function, and derives the ratio function to obtain a slope function; defines the part of the slope function with a y value greater than zero as a water loss state, defines the part of the slope function with a y value less than zero as a soil loss state, and defines the part of the slope function with a y value equal to zero as a soil and water conservation state. The present application calculates and predicts the soil and water loss situation in the area from the same perspective by comparing the changes in the water-soil ratio from the same perspective. The present application utilizes the mutual influence of water loss and soil loss, that is, one of soil loss and water loss needs to undergo continuous changes in the other before the other will undergo continuous changes. At this time, the water-soil ratio will undergo observable changes. The present application also adds a prediction function, thereby realizing the prediction of the soil and water conservation ratio, so that the present application can adopt preventive measures before soil and water loss actually occurs, eliminating the lag of subsequent soil and water conservation measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 A schematic diagram of the steps of an embodiment of a method for monitoring soil and water conservation status of the present application;
[0071] Figure 2 This is a functional module diagram of an embodiment of a soil and water conservation status monitoring device of the present application;
[0072] Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application;
[0073] Figure 4 This is a schematic diagram of the structure of an embodiment of the storage medium of the present application. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0075] The terms "first", "second" and "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications in the embodiments of the present application (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units for these processes, methods, products or devices.
[0076] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0077] like Figure 1 As shown, this embodiment provides an embodiment of a method for monitoring soil and water conservation status. In this embodiment, the monitoring method is applied to soil geology with flowing water bodies in a preset area.
[0078] Preferably, the soil and water conservation of this embodiment is mainly intended to ensure environmental protection and sustainable development after the completion of the power construction, and can also be applied to other soil and water environments.
[0079] Preferably, for the construction of power stations, water and soil conservation of power stations is a series of measures and programs taken to prevent and control the water and soil erosion problems that may occur during the construction of power stations. These measures are aimed at protecting and improving water and soil resources, making rational use of these resources, thereby maintaining and improving land productivity, reducing the impact of natural disasters, and supporting sustainable production activities.
[0080] Among them, the scope of responsibility for soil and water loss prevention and control needs to clarify the specific area of soil and water loss prevention and control during the construction period. For example, the scope of responsibility for soil and water loss prevention and control of a shared energy storage power station project is 1.33 hectares. The prevention and control standards are determined according to the specific conditions of the project location. For example, some projects may implement secondary prevention and control standards, while other projects implement higher-level prevention and control standards. The prevention and control goals are to set specific soil and water loss prevention and control goals, such as soil and water loss control degree, soil loss control ratio, and forest and grass vegetation recovery rate. For example, the goals of the above-mentioned shared energy storage power station project are to achieve a total soil and water loss control degree of 95%, a soil loss control ratio of 1.0, and a forest and grass vegetation recovery rate of 95%. Prevention and control measures include topsoil stripping and preservation, slag protection, and vegetation restoration. For example, various soil and water conservation measures are strictly implemented according to the plan, and it is prohibited to arbitrarily occupy, disturb and destroy surface vegetation, and do a good job in topsoil stripping and comprehensive utilization of waste residues.
[0081] Specifically, the monitoring method comprises the following steps:
[0082] Step S1, obtaining a plurality of visual images of a preset area based on a preset time period, obtaining a plurality of visual images in each preset time period, and each visual image includes flowing water and soil geology.
[0083] Preferably, all visual images can be obtained through remote sensing interpretation, and all interpretations need to be kept at the same viewing angle and the same time period of each natural day, preferably avoiding periods of insufficient light such as night.
[0084] Step S2, obtaining the separation boundary of each visual image by using a boundary extraction algorithm, where the separation boundary is used to separate the flowing water body and the soil geology.
[0085] Preferably, the first step of boundary extraction is usually edge detection. The edge is where the image brightness changes significantly, and is the dividing line between the object and the background or between different objects. The edge detection algorithm finds the edge by identifying the brightness gradient in the image. Commonly used edge detection operators include Sobel, Prewitt, Roberts and Canny.
[0086] Among them, Sobel operator, Prewitt operator, Roberts operator: The aforementioned operators detect edges by calculating the gradient amplitude of each pixel in the image, and estimate the gradient through filters in the horizontal and vertical directions. Canny edge detector: The Canny algorithm is a more complex edge detection method, which aims to capture the edges in the image as accurately as possible and minimize false detections and missed detections. The Canny detector first uses a Gaussian filter to smooth the image to reduce noise, then calculates the gradient amplitude and direction of each point in the image, then applies non-maximum suppression (NMS) to refine the edges, and finally uses a double threshold method and edge connection technology to detect and connect edges.
[0087] Step S3, acquiring a first image area of flowing water and a second image area of soil geology based on a separation boundary of the current visual image.
[0088] Preferably, the pixel area of the visual image can be directly obtained according to the separation boundary without adding a scale, because the scale will be reduced and eliminated during the calculation process.
[0089] Step S4, obtaining an area ratio of the first image area to the second image area based on the current visual image.
[0090] Step S5, learning and training all area ratios through a machine learning algorithm to obtain an area prediction model.
[0091] Preferably, the machine learning algorithm of this embodiment is a neural network.
[0092] Step S6, predicting the future area ratio of a preset natural time step number through the area prediction model.
[0093] Step S7, converting all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis.
[0094] It can be seen that the area ratio and the future area ratio may be greater than 1.
[0095] Step S8: Linearly fit all coordinate points to obtain a ratio function, and derive the ratio function to obtain a slope function.
[0096] Preferably, the linear fitting may adopt the least square method.
[0097] Step S9, defining the portion where the slope function y value is greater than zero as a water loss state, defining the portion where the slope function y value is less than zero as a soil loss state, and defining the portion where the slope function y value is equal to zero as a soil and water conservation state.
[0098] Furthermore, in step S2, the separation boundary of each visual image is obtained by using a boundary extraction algorithm, and the separation boundary is used to separate the flowing water body and the soil geology, including:
[0099] Step S21, convert each visual image into a grayscale image through the cv2.cvtColor() function of the OpenCV environment.
[0100] Step S22, obtaining all image edges of the current grayscale image through the Canny edge detection operator.
[0101] Step S23, defining an erosion structure element of a preset pixel size.
[0102] Preferably, the pixel size of the eroded structure element can be set according to the resolution of the image data, generally set to 3×3 pixels, and one layer of pixels can be eroded once. If the resolution is high, the preset pixel size can be selected as an odd number such as 5×5, 7×7, 9×9, etc.
[0103] Step S24, traverse all image edges with one pixel as a step based on the center of the eroded structure element.
[0104] Step S25, deleting all paths traversed by the eroded structure element to obtain an eroded image of the current grayscale image.
[0105] Step S26, differentially analyzing the current grayscale image and the current eroded image to obtain the boundaries of all objects.
[0106] Step S27, loading all object boundaries into the current visual image to obtain a visual image with boundaries.
[0107] Step S28, obtaining the flowing water body and soil geology of the current visual image with boundary through the target detection algorithm.
[0108] Preferably, the target detection algorithm can be implemented by VJ, HOG, DPMDetector; deep learning Two-stageRCNN, SPPNet, FastRCNN, FasterRCNN; Trick algorithm FPN, CascadeRCNN; deep learning one-stage Yolo, X, SSD, RetinaNet; deep learning Anchor-free CornerNet, CenterNet, FCOS; TransformerDETR, etc.
[0109] Preferably, this embodiment prefers the Yolo algorithm.
[0110] Step S29, traverse all object boundaries and define the boundaries of flowing water and soil geology on both sides as the separation boundaries of the current visual image.
[0111] Furthermore, in step S28, the flowing water body and soil geology of the current visual image with boundary are obtained by using a target detection algorithm, including:
[0112] Step S2801, divide the current visual image with boundaries into a number of square grids on average.
[0113] Step S2802: predicting a number of water body bounding boxes for all flowing water bodies based on all square grids.
[0114] Step S2803, defining the flowing water body as having the highest confidence, and marking the bounding box with the highest confidence as the first-order water body bounding box.
[0115] Step S2804, calculating the intersection-over-union ratio of each other bounding box with the first-order water body bounding box.
[0116] Step S2805: select all bounding boxes whose intersection-over-union ratio is greater than or equal to a preset intersection-over-union ratio threshold as second-order water body bounding boxes.
[0117] Step S2806: Obtain the second-order water body boundary box with the highest confidence and define it as the flowing water body.
[0118] Step S2807, reset the confidence of the flowing water body and define the soil geology as having the highest confidence.
[0119] Step S2808: Mark the bounding box with the highest confidence as the first-order soil bounding box.
[0120] Step S2809, calculating the intersection-over-union ratio of each other bounding box with the first-order soil bounding box.
[0121] Step S2810, selecting all bounding boxes whose intersection-over-union ratio is greater than or equal to a preset intersection-over-union ratio threshold as second-order soil bounding boxes.
[0122] Step S2811, obtain the second-order soil bounding box with the highest confidence and define it as soil geology.
[0123] Specifically, the size of the original image of the image data may be adjusted to 448×448, and then the adjusted image may be evenly divided into S×S (eg, 7×7) grids, and the size of each grid is 64×64.
[0124] Step S22, predicting a number of bounding boxes for all crops based on all square grids according to a target detection algorithm.
[0125] Preferably, each grid is used to predict the horizontal coordinate, vertical coordinate, width, height, and confidence of each detection frame of N detection frames, that is, each grid needs to predict N×(4+1) values. Each grid needs to predict N (x, y, w, h, confidence); where (x, y) is the offset of the center of the detection frame relative to the grid, (w, h) is the ratio of the detection frame to the above-mentioned resized image, and (confidence) is the confidence of the grid, which takes a value of 1 or 0.
[0126] Step S23, respectively obtain the confidence of each bounding box, obtain the bounding box with the largest confidence and mark it as the first-order bounding box.
[0127] Step S24, calculating the intersection-over-union ratio of each other bounding box with the first-order bounding box.
[0128] Step S25 , selecting a bounding box whose intersection-over-union ratio is greater than or equal to a preset threshold as a second-order bounding box.
[0129] Step S26, obtaining a second-order bounding box with the highest confidence and defining it as the crop.
[0130] Preferably, the confidence level can be understood as whether there is a target in the current grid and the accuracy of the detection frame.
[0131] For example: suppose there is an object in a resized image, and the width and height of the resized image are (w a ,h a )but:
[0132] Divide the image into 7×7 (S×S) grids evenly. There is a grid located at the center of the target. The coordinates of the grid are (x i ,y i ), let the coordinates of the center of the target be (x a ,y a ), the above offset can be calculated according to the following formula
[0133] Preferably, in actual detection, if the predicted detection box and the actual bounding box overlap perfectly, the intersection-and-union ratio is 1. In actual application, the value of the first preset threshold can generally be set to 0.5 to determine whether the predicted bounding box is correct, and the accuracy of the bounding box is positively correlated with the intersection-and-union ratio.
[0134] Preferably, the YOLO algorithm also needs to train the detection frame to improve the accuracy of target detection.
[0135] Next, the training model is trained using a preset pedestrian and vehicle training set, and the weights and biases of the training model are iteratively adjusted a first preset number of times using a back propagation algorithm to reduce the value of the loss function of the training model.
[0136] Preferably, the loss function is as follows:
[0137]
[0138] in, is the indicator function of whether the j detection box of the i-th grid is responsible for the target, and its value is 1 or 0; x i ,y i 、w i 、h i , C i They correspond to the i-th (x, y, w, h, confidence) prediction values respectively.
[0139] It can be understood that the loss function includes the coordinate value deviation of the detection box, the confidence deviation, and the prediction probability deviation (or category deviation).
[0140] in, is the detection frame midpoint loss in the coordinate value deviation, is the loss of detection box width and height in coordinate value deviation, is the confidence deviation, is the deviation of the predicted probability (or class deviation).
[0141] Among them, λ coord is the positioning error penalty, generally λ coord =5;S 2 That is, the S×S grids mentioned above; B is the number of bounding boxes; and is the estimated value of the horizontal and vertical coordinates of the midpoint of the i-th bounding box; and is the estimated value of the width and height of the i-th bounding box; C i is the confidence of the i-th bounding box; is the estimated value of the confidence of the i-th bounding box; noobj is the confidence prediction loss, usually λ noobj =0.5; p i (c) is the category probability of the i-th bounding box; is the estimated value of the category probability of the i-th bounding box; p i (c) with The c in it corresponds to classes.
[0142] It should be noted that since each grid does not necessarily contain a target, if there is no target in the grid, the value of (confidence) will be 0, making the gradient span in the subsequent back propagation algorithm too large, so λ is introduced coord To control the loss of the predicted position of the detection box, and introduce λ noobj Controls the penalty for non-existent targets within a single grid.
[0143] It should be noted that the meaning of the symbols used in the principle description of the above target detection algorithm is not interchangeable with the meaning of other symbols in the context.
[0144] Furthermore, in step S5, all area ratios are learned and trained by a machine learning algorithm to obtain an area prediction model, including:
[0145] Step S51 , performing standard normalization processing on all area ratios to obtain a normalized data set based on a preset time period.
[0146] Preferably, this embodiment prefers the normalization method of zero-mean normalization (Z-score normalization), which gives the mean and standard deviation of the original data to standardize the data, and the processed data conforms to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. For the normalization method, this embodiment can also use batch normalization. Compared with simple normalization, in the previous neural network training, only the input layer data is normalized, but not normalized in the middle layer. Although the data set of the input node is normalized, the data distribution of the input data after matrix multiplication is likely to change greatly, and as the number of hidden layer network layers continues to deepen, the change in data distribution will become greater and greater. Therefore, the normalization processing performed by batch normalization in the middle layer of the neural network makes the training effect better.
[0147] Step S52: divide the current normalized data set into a training set and a validation set according to a preset ratio.
[0148] Preferably, the preset ratio can be set to 8:2, so as to divide the normalized data set into a training set and a sample set in a ratio of 8:2.
[0149] Preferably, in actual application, a certain proportion of validation sets are required to verify the accuracy of the model, that is, verification is required after training is completed, and the sample set prediction is started only after the verification is successful. Usually, the image data is divided into training set, validation set, and sample set in a ratio of 70%:15%:15%, that is, 70% of the data is the training set, 15% of the data is the validation set, and 15% of the data is the sample set.
[0150] Step S53, defining a neural network model in which the input layer, the hidden layer, and the output layer are sequentially signal-connected.
[0151] The neural network model is represented by the following formula:
[0152]
[0153] Among them, y is the neural network model; x n is the nth input node of the input layer, each input node corresponds to a normalized data set in the training set, is the weight from the mth input node of the input layer to the nth input node of the hidden layer; is the bias of the nth input node connected to the hidden layer; is the bias of the output layer; tansig(·) is the activation function; the numbers in the brackets of the symbol subscripts are the number of layers, the subscript (1) is the first layer, that is, the input layer, and the subscript (1, 2) is the first layer to the second layer, that is, the input layer to the hidden layer.
[0154] It should be noted that the meanings of the symbols in the above principle description are not interchangeable with the meanings of other symbols in the context.
[0155] Step S54, input the training set to the input layer, perform several trainings through the neural network model, and obtain the root mean square error between the verification set and the current training result based on each training.
[0156] Preferably, the training model training a neural network usually requires providing a large amount of data, namely a data set; the data set is generally divided into three categories, namely the above-mentioned training set (training set), validation set (validation set) and test set (test set).
[0157] Among them, one epoch is the process of training once with all the samples in the training set. The so-called training once refers to one forward pass and one back pass. When the number of samples in an epoch (i.e., training set) is too large, training once may consume too much time, and it is not necessary to use all the data in the training set for each training. In this case, the entire training set needs to be divided into multiple small blocks, that is, divided into multiple batches for training. An epoch consists of one or more batches, where a batch is a part of the training set. Each training process only uses a part of the data, i.e., a batch. The process of training a batch is an iteration.
[0158] Preferably, the neural network training specifically includes a perceptron, which is composed of two layers of neurons. The input layer receives external input signals and transmits them to the output layer. The output layer is MP neurons, and the step function is y j =f(∑ i w i ·x i -θ i ).
[0159] Preferably, given a training data set, the weight w i (i=1,2,...,n) and training bias θ i It can be obtained through learning, θ i It can be understood as a weight w corresponding to a fixed value of -1,0. i+1 .
[0160] It should be noted that the symbolic meaning of formula ① here is not interchangeable with other formulas in the embodiment. This step function is only used for principle explanation and does not participate in the calculation of other formulas.
[0161] Preferably, in this embodiment, the number of neural network training times can be set to 10,000 times.
[0162] Preferably, the learning rate from the 1st to the 5000th epoch can be set to 0.01, the learning rate from the 5001st to the 7500th epoch can be set to 0.001, and the learning rate from the 7501st to the 10000th epoch can be set to 0.0001.
[0163] It can be understood that the neural network training of this embodiment mainly includes the following ideas:
[0164] ① Initialize the weights and bias items in the network.
[0165] Initializing parameter values (output unit weights, bias terms and hidden unit weights, bias terms are all model parameters) is to activate forward propagation, obtain the output value of each layer element, and then obtain the value of the loss function.
[0166] ②Activate forward propagation to obtain the output value of each layer and the expected value of the loss function of each layer.
[0167] ③According to the loss function, calculate the error term of the output unit and the error term of the hidden unit.
[0168] Calculate various errors, calculate the gradient of the parameters with respect to the loss function, or calculate partial derivatives according to the chain rule of calculus. For partial derivatives of vectors or matrices in a composite function, the partial derivative of the function inside the composite function is always multiplied on the left; for partial derivatives of scalars in a composite function, the partial derivative of the function inside the composite function can be multiplied on the left or on the right.
[0169] ④Update the weights and bias items in the neural network.
[0170] ⑤ Repeat ② to ④ until the loss function is less than the preset bias or the number of iterations is used up, and the parameters output at this time are the current optimal parameters.
[0171] Step S55, obtaining the minimum value of all root mean square errors.
[0172] Step S56, obtaining the training result corresponding to the minimum value as the area prediction model.
[0173] Further, in step S9, the part where the slope function y value is greater than zero is defined as a water loss state, the part where the slope function y value is less than zero is defined as a soil loss state, and the part where the slope function y value is equal to zero is defined as a soil and water conservation state, and then, it includes:
[0174] Step S10, based on the slope function, respectively obtain the water loss start timestamp, water loss peak value, and water loss duration of each water loss state.
[0175] Step S20, respectively packing the water loss start timestamp, water loss peak value, and water loss duration of each water loss state into a water loss data packet.
[0176] Step S30, integrating all water loss data packets into a water loss record set.
[0177] Step S40, based on the slope function, respectively obtain the soil loss start timestamp, soil loss peak value, and soil loss duration of each soil loss state.
[0178] Step S50, respectively packing the soil loss start timestamp, soil loss peak value, and soil loss duration of each soil loss state into a soil loss data packet.
[0179] Step S60: integrating all soil loss data packets into a soil loss record set.
[0180] Step S70: sending the water loss record set and the soil loss record set to an external receiving end.
[0181] This embodiment obtains several visual images of a preset area based on a preset time period, and obtains several visual images in each preset time period, and each visual image includes flowing water and soil geology; obtains the separation boundary of each visual image respectively through a boundary extraction algorithm, and the separation boundary is used to separate the flowing water and the soil geology; obtains the first image area of the flowing water and the second image area of the soil geology based on the separation boundary of the current visual image; obtains the area ratio of the first image area to the second image area based on the current visual image; learns and trains all area ratios through a machine learning algorithm to obtain an area prediction model; predicts the future area ratio of a preset natural time step through the area prediction model; converts all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis; linearly fits all coordinate points to obtain a ratio function, and derives the ratio function to obtain a slope function; defines the part of the slope function with a y value greater than zero as a water loss state, defines the part of the slope function with a y value less than zero as a soil loss state, and defines the part of the slope function with a y value equal to zero as a soil and water conservation state. This embodiment calculates and predicts the soil and water loss situation in the area from the same perspective by comparing the changes in the water-soil ratio from the same perspective. This embodiment utilizes the mutual influence of water loss and soil loss, that is, soil loss and water loss need to produce continuous changes in one of the other before the other will produce continuous changes. At this time, the water-soil ratio will undergo observable changes. This embodiment also adds a prediction function, thereby realizing the prediction of the soil and water conservation ratio, so that this embodiment can adopt preventive measures before soil and water loss actually occurs, eliminating the lag of subsequent soil and water conservation measures.
[0182] like Figure 2 As shown, this embodiment provides an embodiment of a monitoring device for soil and water conservation status. In this embodiment, the monitoring device is applied to the monitoring method in the above embodiment.
[0183] Specifically, the monitoring device includes a soil and water visual image acquisition module 1, a soil and water segmentation boundary acquisition module 2, a soil and water image area acquisition module 3, a soil and water area ratio acquisition module 4, an area prediction model acquisition module 5, a future area ratio prediction module 6, a future area ratio conversion module 7, a ratio function acquisition and derivation module 8, and a soil and water conservation status definition module 9, which are electrically connected in sequence.
[0184] Among them, the water and soil visual image acquisition module 1 is used to acquire several visual images of a preset area based on a preset time period, and several visual images are acquired in each preset time period, and each visual image includes flowing water and soil geology; the water and soil segmentation boundary acquisition module 2 is used to obtain the separation boundary of each visual image respectively through a boundary extraction algorithm, and the separation boundary is used to separate the flowing water and the soil geology; the water and soil image area acquisition module 3 is used to obtain the first image area of the flowing water body and the second image area of the soil geology based on the separation boundary of the current visual image; the water and soil area ratio acquisition module 4 is used to obtain the area ratio of the first image area to the second image area based on the current visual image; the area prediction model acquisition module 5 is used to obtain the area ratio of the first image area to the second image area through The machine learning algorithm learns and trains all area ratios to obtain an area prediction model; the future area ratio prediction module 6 is used to predict the future area ratio of a preset natural time step through the area prediction model; the future area ratio conversion module 7 is used to convert all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis; the ratio function acquisition and derivation module 8 is used to linearly fit all coordinate points to obtain the ratio function, and to derive the ratio function to obtain the slope function; the soil and water conservation status definition module 9 is used to define the part with a slope function y value greater than zero as a water loss state, the part with a slope function y value less than zero as a soil loss state, and the part with a slope function y value equal to zero as a soil and water conservation state.
[0185] Furthermore, the water and soil segmentation boundary acquisition module 2 specifically includes a first water and soil segmentation boundary acquisition submodule, a second water and soil segmentation boundary acquisition submodule, a third water and soil segmentation boundary acquisition submodule, a fourth water and soil segmentation boundary acquisition submodule, a fifth water and soil segmentation boundary acquisition submodule, a sixth water and soil segmentation boundary acquisition submodule, a seventh water and soil segmentation boundary acquisition submodule, an eighth water and soil segmentation boundary acquisition submodule, and a ninth water and soil segmentation boundary acquisition submodule, which are electrically connected in sequence; the first water and soil segmentation boundary acquisition submodule is electrically connected to the water and soil visual image acquisition module 1, and the ninth water and soil segmentation boundary acquisition submodule is electrically connected to the water and soil image area acquisition module 3.
[0186] Among them, the first water and soil segmentation boundary acquisition submodule is used to convert each visual image into a grayscale image through the cv2.cvtColor() function of the OpenCV environment; the second water and soil segmentation boundary acquisition submodule is used to obtain all image edges of the current grayscale image through the Canny edge detection operator; the third water and soil segmentation boundary acquisition submodule is used to define an erosion structure element of a preset pixel size; the fourth water and soil segmentation boundary acquisition submodule is used to traverse all image edges with one pixel as a step with the center of the erosion structure element; the fifth water and soil segmentation boundary acquisition submodule is used to delete all paths traversed by the erosion structure element to obtain an erosion image of the current grayscale image; the sixth water and soil segmentation boundary acquisition submodule is used to differentiate the current grayscale image and the current erosion image to obtain the boundaries of all objects; the seventh water and soil segmentation boundary acquisition submodule is used to load all object boundaries into the current visual image to obtain a visual image with boundaries; the eighth water and soil segmentation boundary acquisition submodule is used to obtain the flowing water body and soil geology of the current visual image with boundaries through the target detection algorithm; the ninth water and soil segmentation boundary acquisition submodule is used to traverse all object boundaries and define the boundaries with flowing water bodies and soil geology on both sides as the separation boundaries of the current visual image.
[0187] Further, the eighth soil and water segmentation boundary acquisition submodule specifically includes a first soil and water segmentation boundary acquisition unit, a second soil and water segmentation boundary acquisition unit, a third soil and water segmentation boundary acquisition unit, a fourth soil and water segmentation boundary acquisition unit, a fifth soil and water segmentation boundary acquisition unit, a sixth soil and water segmentation boundary acquisition unit, a seventh soil and water segmentation boundary acquisition unit, an eighth soil and water segmentation boundary acquisition unit, a ninth soil and water segmentation boundary acquisition unit, a tenth soil and water segmentation boundary acquisition unit, and an eleventh soil and water segmentation boundary acquisition unit, which are electrically connected in sequence; the first soil and water segmentation boundary acquisition unit is electrically connected to the seventh soil and water segmentation boundary acquisition submodule, and the eleventh soil and water segmentation boundary acquisition unit is electrically connected to the ninth soil and water segmentation boundary acquisition submodule.
[0188] Among them, the first water and soil segmentation boundary acquisition unit is used to evenly divide the current visual image with boundaries into a number of square grids; the second water and soil segmentation boundary acquisition unit is used to predict a number of water body boundary boxes for all flowing water bodies based on all square grids; the third water and soil segmentation boundary acquisition unit is used to define the flowing water body with the highest confidence, and mark the boundary box with the highest confidence as the first-order water body boundary box; the fourth water and soil segmentation boundary acquisition unit is used to calculate the intersection and union ratio of each other boundary box with the first-order water body boundary box; the fifth water and soil segmentation boundary acquisition unit is used to select all boundary boxes whose intersection and union ratio is greater than or equal to the preset intersection and union ratio threshold as the second-order water body boundary box; the sixth water and soil segmentation boundary acquisition unit is used to select all boundary boxes whose intersection and union ratio is greater than or equal to the preset intersection and union ratio threshold as the second-order water body boundary box. The acquisition unit is used to acquire the second-order water body boundary box with the highest confidence and define it as the flowing water body; the seventh water-soil segmentation boundary acquisition unit is used to reset the confidence of the flowing water body and define the soil geology with the highest confidence; the eighth water-soil segmentation boundary acquisition unit is used to mark the boundary box with the highest confidence as the first-order soil boundary box; the ninth water-soil segmentation boundary acquisition unit is used to calculate the intersection-and-union ratio of each other boundary box with the first-order soil boundary box; the tenth water-soil segmentation boundary acquisition unit is used to select all boundary boxes whose intersection-and-union ratio is greater than or equal to a preset intersection-and-union ratio threshold as the second-order soil boundary box; the eleventh water-soil segmentation boundary acquisition unit is used to acquire the second-order soil boundary box with the highest confidence and define it as the soil geology.
[0189] Furthermore, the area prediction model acquisition module 5 specifically includes a first area prediction model acquisition submodule, a second area prediction model acquisition submodule, a third area prediction model acquisition submodule, a fourth area prediction model acquisition submodule, a fifth area prediction model acquisition submodule, and a sixth area prediction model acquisition submodule, which are electrically connected in sequence; the first area prediction model acquisition submodule is electrically connected to the water-soil area ratio acquisition module 4, and the sixth area prediction model acquisition submodule is electrically connected to the future area ratio prediction module 6.
[0190] Among them, the first area prediction model acquisition submodule is used to perform standard normalization processing on all area ratios, and obtain a normalized data set based on a preset time period; the second area prediction model acquisition submodule is used to divide the current normalized data set into a training set and a validation set according to a preset ratio; the third area prediction model acquisition submodule is used to define a neural network model in which the input layer, the hidden layer, and the output layer are connected in sequence; the fourth area prediction model acquisition submodule is used to input the training set into the input layer, perform several trainings through the neural network model, and obtain the root mean square error between the validation set and the current training result based on each training; the fifth area prediction model acquisition submodule is used to obtain the minimum value of all root mean square errors; the sixth area prediction model acquisition submodule is used to obtain the training result corresponding to the minimum value as the area prediction model.
[0191] Furthermore, the monitoring device also includes a water loss status acquisition module, a water loss status packaging module, a water loss data packet integration module, a soil loss status acquisition module, a soil loss status packaging module, a soil loss data packet integration module, and a soil and water loss data sending module, which are electrically connected in sequence; the water loss status acquisition module is electrically connected to the soil and water conservation status definition module 9.
[0192] Among them, the water loss state acquisition module is used to obtain the water loss starting timestamp, water loss peak value, and water loss duration of each water loss state based on the slope function; the water loss state packaging module is used to package the water loss starting timestamp, water loss peak value, and water loss duration of each water loss state into a water loss data packet; the water loss data packet integration module is used to integrate all water loss data packets into a water loss record set; the soil loss state acquisition module is used to obtain the soil loss starting timestamp, soil loss peak value, and soil loss duration of each soil loss state based on the slope function; the soil loss state packaging module is used to package the soil loss starting timestamp, soil loss peak value, and soil loss duration of each soil loss state into a soil loss data packet; the soil loss data packet integration module is used to integrate all soil loss data packets into a soil loss record set; the water and soil loss data sending module is used to send the water loss record set and the soil loss record set to an external receiving end.
[0193] It should be noted that this embodiment is a functional module item embodiment based on the above-mentioned method embodiment. The additional contents such as the preference, expansion, limitation, and example illustration of this embodiment can be found in the above-mentioned method embodiment, and this embodiment will not be repeated herein.
[0194] This embodiment obtains several visual images of a preset area based on a preset time period, and obtains several visual images in each preset time period, and each visual image includes flowing water and soil geology; obtains the separation boundary of each visual image respectively through a boundary extraction algorithm, and the separation boundary is used to separate the flowing water and the soil geology; obtains the first image area of the flowing water and the second image area of the soil geology based on the separation boundary of the current visual image; obtains the area ratio of the first image area to the second image area based on the current visual image; learns and trains all area ratios through a machine learning algorithm to obtain an area prediction model; predicts the future area ratio of a preset natural time step through the area prediction model; converts all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis; linearly fits all coordinate points to obtain a ratio function, and derives the ratio function to obtain a slope function; defines the part of the slope function with a y value greater than zero as a water loss state, defines the part of the slope function with a y value less than zero as a soil loss state, and defines the part of the slope function with a y value equal to zero as a soil and water conservation state. This embodiment calculates and predicts the soil and water loss situation in the area from the same perspective by comparing the changes in the water-soil ratio from the same perspective. This embodiment utilizes the mutual influence of water loss and soil loss, that is, soil loss and water loss need to produce continuous changes in one of the other before the other will produce continuous changes. At this time, the water-soil ratio will undergo observable changes. This embodiment also adds a prediction function, thereby realizing the prediction of the soil and water conservation ratio, so that this embodiment can adopt preventive measures before soil and water loss actually occurs, eliminating the lag of subsequent soil and water conservation measures.
[0195] Figure 3 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 3 As shown, the electronic device 10 includes a processor 101 and a memory 102 coupled to the processor 101 .
[0196] The memory 102 stores program instructions for implementing a method for monitoring soil and water conservation status according to any one of the above embodiments.
[0197] The processor 101 is used to execute program instructions stored in the memory 102 to monitor the soil and water conservation status.
[0198] The processor 101 may also be referred to as a CPU (Central Processing Unit). The processor 101 may be an integrated circuit chip having signal processing capabilities. The processor 101 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0199] Further, Figure 4 This is a schematic diagram of the structure of a storage medium according to an embodiment of the present application. Figure 4 The storage medium 11 of the embodiment of the present application stores program instructions 111 that can implement all the above methods, wherein the program instructions 111 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
[0200] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0201] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of this application, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. A method for monitoring soil and water conservation status, the monitoring method is applied to soil geology with flowing water in a preset area, characterized in that: The monitoring method comprises: Step S1, acquiring a plurality of visual images of the preset area based on a preset time period, acquiring a plurality of visual images in each preset time period, each visual image including the flowing water body and the soil geology; Step S2, obtaining the separation boundary of each visual image by using a boundary extraction algorithm, wherein the separation boundary is used to separate the flowing water body and the soil geology; Step S3, acquiring a first image area of the flowing water body and a second image area of the soil geology based on a separation boundary of the current visual image; Step S4, obtaining an area ratio of the first image area to the second image area based on the current visual image; Step S5, learning and training all area ratios through a machine learning algorithm to obtain an area prediction model; Step S6, predicting the future area ratio of a preset natural time step number by the area prediction model; Step S7, converting all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis; Step S8, linearly fitting all coordinate points to obtain a ratio function, and deriving the ratio function to obtain a slope function; Step S9, defining the portion where the slope function y value is greater than zero as a water loss state, defining the portion where the slope function y value is less than zero as a soil loss state, and defining the portion where the slope function y value is equal to zero as a soil and water conservation state.
2. The monitoring method according to claim 1, characterized in that: Step S2, respectively obtaining the separation boundary of each visual image by using a boundary extraction algorithm, wherein the separation boundary is used to separate the flowing water body and the soil geology, including: Step S21, converting each visual image into a grayscale image by using the cv2.cvtColor() function of the OpenCV environment; Step S22, obtaining all image edges of the current grayscale image through the Canny edge detection operator; Step S23, defining an erosion structure element of a preset pixel size; Step S24, traversing all image edges with one pixel as a step based on the center of the eroded structure element; Step S25, deleting all paths traversed by the eroded structure element to obtain an eroded image of the current grayscale image; Step S26, subtracting the current grayscale image from the current eroded image to obtain the boundaries of all objects; Step S27, loading all object boundaries into the current visual image to obtain a visual image with boundaries; Step S28, obtaining the flowing water body and soil geology of the current visual image with boundary through the target detection algorithm; Step S29, traverse all object boundaries and define the boundaries with flowing water and soil geology on both sides as the separation boundaries of the current visual image.
3. The monitoring method according to claim 2, characterized in that: Step S28, obtaining the flowing water body and soil geology of the current visual image with boundary through the target detection algorithm, including: Step S2801, dividing the current visual image with borders into a number of square grids on average; Step S2802, predicting a number of water body bounding boxes for all flowing water bodies based on all square grids; Step S2803, defining the flowing water body as having the highest confidence, and marking the bounding box with the highest confidence as the first-order water body bounding box; Step S2804, calculating the intersection-over-union ratio of each other bounding box with the first-order water body bounding box; Step S2805, selecting all bounding boxes whose intersection-over-union ratio is greater than or equal to a preset intersection-over-union ratio threshold as second-order water body bounding boxes; Step S2806, obtaining a second-order water body boundary box with the highest confidence and defining it as the flowing water body; Step S2807, resetting the confidence of the flowing water body and defining the soil geology as having the highest confidence; Step S2808, marking the bounding box with the highest confidence as the first-order soil bounding box; Step S2809, calculating the intersection-over-union ratio of each other bounding box with the first-order soil bounding box; Step S2810, selecting all bounding boxes whose intersection-over-union ratio is greater than or equal to the preset intersection-over-union ratio threshold as second-order soil bounding boxes; Step S2811, obtaining a second-order soil bounding box with the highest confidence and defining it as the soil geology.
4. The monitoring method according to claim 3, characterized in that: Step S5, learning and training all area ratios through a machine learning algorithm to obtain an area prediction model, including: Step S51, performing standard normalization processing on all area ratios to obtain a normalized data set based on a preset time period; Step S52, dividing the current normalized data set into a training set and a validation set according to a preset ratio; Step S53, defining a neural network model in which the input layer, the hidden layer, and the output layer are sequentially connected; Step S54, inputting the training set into the input layer, performing several trainings through the neural network model, and obtaining a root mean square error between the validation set and the current training result based on each training; Step S55, obtaining the minimum value of all root mean square errors; Step S56, obtaining a training result corresponding to the minimum value as the area prediction model.
5. The monitoring method according to claim 1, characterized in that: Step S9, defining the portion where the slope function y value is greater than zero as a water loss state, defining the portion where the slope function y value is less than zero as a soil loss state, and defining the portion where the slope function y value is equal to zero as a soil and water conservation state, and then comprising: Step S10, obtaining the water loss start timestamp, water loss peak value, and water loss duration of each water loss state based on the slope function; Step S20, respectively packaging the water loss start timestamp, water loss peak value, and water loss duration of each water loss state into a water loss data packet; Step S30, integrating all water loss data packets into a water loss record set; Step S40, obtaining the soil loss start timestamp, soil loss peak value, and soil loss duration of each soil loss state based on the slope function; Step S50, respectively packaging the soil loss start timestamp, soil loss peak value, and soil loss duration of each soil loss state into a soil loss data packet; Step S60, integrating all soil loss data packets into a soil loss record set; Step S70: sending the water loss record set and the soil loss record set to an external receiving end.
6. A monitoring device for soil and water conservation status, the monitoring device being applied to the monitoring method according to any one of claims 1 to 5, characterized in that: The monitoring device comprises: A water and soil visual image acquisition module, used to acquire a plurality of visual images of the preset area based on a preset time period, and acquire a plurality of visual images in each preset time period, each visual image including the flowing water body and the soil geology; A water-soil segmentation boundary acquisition module, used to respectively acquire the separation boundary of each visual image through a boundary extraction algorithm, wherein the separation boundary is used to separate the flowing water body and the soil geology; A water and soil image area acquisition module, used to acquire a first image area of the flowing water body and a second image area of the soil geology based on a separation boundary of a current visual image; A water-land area ratio acquisition module, used for acquiring an area ratio of the first image area to the second image area based on a current visual image; An area prediction model acquisition module is used to learn and train all area ratios through a machine learning algorithm to obtain an area prediction model; A future area ratio prediction module, used for predicting a future area ratio of a preset natural time step through the area prediction model; A future area ratio conversion module, used to convert all future area ratios into coordinate points with natural time as the x-axis and the value of the future area ratio as the y-axis; A ratio function acquisition and derivation module is used to linearly fit all coordinate points to obtain a ratio function, and to derivate the ratio function to obtain a slope function; The soil and water conservation status definition module is used to define the part where the slope function y value is greater than zero as a water loss state, the part where the slope function y value is less than zero as a soil loss state, and the part where the slope function y value is equal to zero as a soil and water conservation state.
7. An electronic device, characterized in that: It comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it can implement the monitoring method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the monitoring method according to any one of claims 1 to 5 can be implemented.
Citation Information
Patent Citations
Portable device and method for soil erosion field investigation
CN104698508A
Unsaturated soil moisture diffusivity measuring method based on perfect nonlinear flow process response
CN107421868A
Water and soil loss remote sensing dynamic monitoring method and system
CN112765770A
Establishment method for ecological restoration system of production and construction project in dry-hot valley area
CN115049302A
Water and soil loss assessment method based on water and soil conservation supervision and inspection big data
CN118673447A