Water area target detection and segmentation method

By introducing Bessel polygon prediction head and position enhancement mechanism into the object detection model, a polygon detection box that fits the water area is generated, which solves the problems of water morphological complexity and identification errors in traditional methods, and improves detection accuracy and classification Accuracy, and accurate segmentation and area change monitoring of water areas.

CN119314046AInactive Publication Date: 2025-01-14SOUTH CENTRAL UNIVERSITY FOR NATIONALITIES +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411355739.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-05-29
Filing Date
2024-09-26
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure CN119314046A_ABST
    Figure CN119314046A_ABST
Patent Text Reader

Abstract

The invention discloses a water area target detection method. The method comprises the steps of collecting a water area image; identifying a water area image by using the target detection model, and outputting control points of Bessel polygons at the top edge, the bottom edge, the left edge and the right edge of a water area target as bounding box coordinates; based on the control points of the Bezier polygon and the definition of the Bezier curve, generating a series of points similar to the Bezier curve, and forming a smooth Bezier curve according to the points; according to the method, the boundary of the detection target is reconstructed through the Bezier curve, so that the polygonal detection frame fitting the water area is generated, the detection accuracy is improved, more irrelevant backgrounds are removed, and more accurate water area segmentation is realized; by adding a position enhancement mechanism to the target detection model, the method can better adapt to water areas of different sizes and shapes, improves the expression ability of position information, helps to capture global and advanced information of the water areas, and improves the recognition and classification accuracy of the water areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a method for detecting and segmenting targets in a water area. Background Art

[0002] With the rapid development of image processing technology, the application of remote sensing images in environmental monitoring, resource management and other fields has become increasingly important. The detection and classification of water areas has practical significance and is conducive to scientific management and environmental protection. Classification of freshwater bodies, oceans and artificial waters can optimize drinking water supply planning, formulate wetland protection plans, and promote urban planning and tourism planning. In particular, the monitoring and analysis of water areas has great practical value in water resource management, environmental protection and natural disaster warning. Traditional water area detection methods usually use threshold segmentation based on features such as color and texture, or rely on manually designed rules and algorithms. However, these methods often cannot effectively handle complex water morphology, especially when facing a changing natural environment, their accuracy and stability are often limited.

[0003] In recent years, the rise of deep learning technology has brought revolutionary changes to the field of image processing. Neural network models have achieved remarkable achievements in target detection and image segmentation tasks. Among them, the target detection model achieves efficient detection and segmentation of targets through the convolutional neural network (CNN) combined with the attention mechanism. However, for irregularly shaped water areas, traditional horizontal target detection boxes often cannot accurately surround the target, which limits the accuracy of detection; and due to the irregularity and diversity of the shape and layout of water areas in natural environments, there is a misalignment between the output water area sequence and the two-dimensional input image, resulting in incorrect recognition. Summary of the invention

[0004] The purpose of the present invention is to provide a method for detecting and segmenting water area targets in view of the problems existing in the prior art.

[0005] To achieve the above object, the technical solution adopted by the present invention is:

[0006] A method for processing a target detection model, comprising:

[0007] Collect a large number of images containing the target area, use Bezier polygons to mark the target area, and organize the marked images and corresponding labels into a data set;

[0008] Select a pre-trained basic model, add a Bezier polygon prediction head to its detection head, and introduce a position enhancement mechanism to enable it to output the coordinates of the control points of the Bezier polygon;

[0009] A dataset with Bezier polygon labels is used to train the modified base model. A loss function is defined to evaluate the distance measurement between the Bezier polygon control point coordinates output by the model and the actual control point coordinates. The model parameters are optimized through the back propagation algorithm and the gradient descent algorithm so that the loss function value gradually decreases to a predetermined value as a target detection model.

[0010] Furthermore, the Bezier polygon prediction head includes a shape decoupling module and a position decoupling module; the shape decoupling module is used to predict the shape of the detection target, that is, the control points of the local Bezier polygon; the position decoupling module is used to predict the position of the target area, that is, the center coordinates and size of the axis-aligned bounding box;

[0011] The local Bezier polygon is translated and scaled using the axis-aligned bounding box to obtain control points of the global Bezier polygon, thereby ensuring that the predicted bounding box is not only correctly positioned but also conforms to the actual shape of the target area.

[0012] Furthermore, the shape decoupling module and the position decoupling module are both based on the basic architecture of a multi-layer perceptron;

[0013] The position decoupling module includes an input layer, a hidden layer, a layer normalization and an output layer; the output layer of the shape decoupling module includes 4 neurons, corresponding to the center point x coordinate, center point y coordinate, length and width of the axis-aligned bounding box, and uses sigmoid as an activation function;

[0014] The shape decoupling module includes an input layer, a hidden layer and an output layer; the output layer of the shape decoupling module includes 4 (n+1) neurons, where n corresponds to the order of the Bezier polygon, each neuron corresponds to the x or y coordinate of a control point, and a linear activation function is used.

[0015] Furthermore, the introduction of the position enhancement mechanism includes:

[0016] Introducing a position enhancement mechanism into the head network part of the object detection model, including a position embedding layer and a position perception module;

[0017] Inserting a long short-term memory network into the backbone network of the target detection model enables the target detection model to receive a series of pictures of the same water area at different times, thereby capturing the temporal changes of the water area and automatically generating corresponding time steps;

[0018] The position embedding layer embeds the time step information into the target detection model, and enhances the model's understanding of the position information by generating a specific embedding vector qt, which represents the position information of each time step t;

[0019] The location perception module uses two layers of LSTM with a hidden state size of 128, two 3×3 convolutional layers and a ReLU activation function to generate a key vector for the subsequent attention mechanism of the model to ensure that the location of the detected target can be correctly focused during decoding, thereby improving the accuracy of water area classification and recognition.

[0020] Furthermore, the training process of the pre-trained basic model includes:

[0021] Collect a large number of images containing water area targets, use rectangular bounding boxes as initial annotations, and organize the annotated images and corresponding labels into a dataset;

[0022] Select a network model suitable for target detection, use a dataset with rectangular bounding box labels to train this model so that it can output the horizontal detection box coordinates of the target; define a loss function to evaluate the similarity between the horizontal detection box coordinates output by the model and the rectangular bounding box coordinates; optimize the model parameters through the back propagation algorithm and the gradient descent algorithm so that the loss function value gradually decreases to the predetermined value.

[0023] A method for detecting targets in a water area, comprising:

[0024] Collect images of water areas;

[0025] Use the above-mentioned target detection model to identify the water area image, and output the control points of the top, bottom, left and right Bezier polygons of the water area target as the bounding box coordinates;

[0026] Based on the control points of the Bezier polygon and the definition of the Bezier curve, a series of points approximating the Bezier curve are generated, and a smooth Bezier curve is formed based on these points.

[0027] Furthermore, the control points of the Bezier polygons on the top, bottom, left and right sides of the output water area target include:

[0028] Each water target is parameterized into 4 n-order Bezier curves, one for the top edge of the water target boundary, one for the bottom edge of the water target boundary, and the other two for the left and right sides of the water target boundary. Each Bezier polygon has n+1 control points.

[0029] A method for segmenting a water area target, comprising:

[0030] Use the above bounding box coordinates as input to the segmentation model;

[0031] The segmentation model generates a corresponding segmentation mask using the bounding box coordinates, wherein the segmentation mask corresponds to a water area target in the input image;

[0032] The segmentation mask generated by the segmentation model is superimposed on the original remote sensing image to extract the accurate boundary of the water area.

[0033] A method for monitoring area changes in a water area, comprising:

[0034] Binarize the grayscale image after the segmentation, and set an appropriate threshold to distinguish the water area and the non-water area;

[0035] Count the number of pixels representing water areas in the binary image and use the given image scale to calculate the actual water area;

[0036] The image data of the water area is obtained regularly, the actual area of ​​the segmented water area is calculated, the area data and the corresponding timestamp are recorded in a database, and the trend of the area of ​​the water area changing over time is analyzed.

[0037] A water area monitoring system, comprising:

[0038] Image acquisition equipment, responsible for capturing image data of the water area periodically or in real time;

[0039] An image processing device that uses the above method to classify pixels in the image into categories representing water areas and non-water areas;

[0040] An area calculation and storage unit, which uses the above method to calculate the pixel area of ​​the water area;

[0041] The data analysis and prediction unit uses statistical analysis methods to analyze the changing trend of water area over time;

[0042] The threshold setting and alarm unit sets the threshold for the change in the area of ​​the water area. When the change in the area of ​​the water area exceeds the preset threshold, the alarm mechanism is triggered.

[0043] The environmental management unit formulates corresponding environmental management strategies based on the information provided by the data analysis and prediction unit.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] 1. Provide a processing method for target detection model, introduce Bezier polygon prediction head and position increase mechanism on the basic model, and output more closely fits the actual boundary of the target;

[0046] 2. Provide a method for detecting targets in water areas. The Bezier curve can be used to reconstruct the boundaries of the detected targets, thereby generating a polygonal detection frame that fits the water area, improving detection accuracy, removing more irrelevant background, and achieving more accurate water area segmentation. By adding a position enhancement mechanism to the target detection model, it can better adapt to water areas of different sizes and shapes, improve the expression ability of position information, help capture the global and high-level information of the water area, and improve the recognition and classification accuracy of the water area.

[0047] 3. Provide a method for segmenting water area targets, extract the boundaries of the water area based on the bounding box of the Bezier polygon, and improve the segmentation accuracy of the detected object;

[0048] 4. Provide a method for monitoring changes in the area of ​​water areas and accurately analyze the area change trends of water areas. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is a flowchart of a method for processing a target detection model in an embodiment of the present application;

[0050] Figure 2 This is a flow chart of a method for detecting targets in a water area in one embodiment of the present application;

[0051] Figure 3 This is a flow chart of a method for segmenting a water area target in an embodiment of the present application;

[0052] Figure 4 This is a flow chart of a method for monitoring changes in water area in one embodiment of the present application;

[0053] Figure 5 A schematic diagram showing a comparison between a horizontal detection frame and a Bezier polygon detection frame in an embodiment of the present application;

[0054] Figure 6 A schematic diagram of a second-order Bezier curve definition in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of a position and shape decoupling module in one embodiment of the present application;

[0056] Figure 8 A schematic diagram of an improved target detection model in an embodiment of the present application;

[0057] Fig. 9 Schematic diagram of the structure of a water area monitoring system in one embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] The rapid development of deep learning has made remarkable achievements in target detection and image segmentation tasks in natural scenes. However, due to the differences between remote sensing images and natural images, there is still room for improvement in the detection and segmentation effects of deep learning algorithms in remote sensing images. In remote sensing images, since the water area may be of any shape, the traditional horizontal detection frame cannot be accurately located and is prone to selecting irrelevant background information; and the layout of water areas in natural environments is complex and is affected by tides and seasons, making the detection and classification of water areas difficult. Therefore, in response to the above problems, this application introduces Bezier polygons to reconstruct the boundaries of the detection target, thereby generating a polygonal detection frame that fits the water area; by adding a position enhancement mechanism, the expression ability of the position information is improved, which helps capture the global and high-level information of the water area and improves the recognition and classification accuracy of the water area.

[0060] like Figure 1 As shown, the first aspect of the present application discloses a method for processing a target detection model for water area target detection, comprising steps S1 to S3:

[0061] S1. Collect a large number of images containing the target area and use Bezier polygons to mark the target area; organize the marked images and corresponding labels into a data set, which is divided into a training set, a validation set, and a test set;

[0062] S2. Select a pre-trained basic model, add a Bezier polygon prediction head to its detection head, and introduce a position enhancement mechanism to enable it to output the coordinates of the control points of the Bezier polygon;

[0063] In step S2, YOLOv8 is preferably used as the basic model, whose network structure has the advantages of being more concise, faster detection speed and higher detection accuracy; however, in the basic detection model, the output detection box is generally a horizontal detection box.

[0064] In water area target detection, since water areas often present irregular shapes or have large changes in direction, and the boundary between them and the surrounding environment is not obvious, the horizontal detection frame is easy to select a large number of background areas that are not related to the target, causing the segmentation algorithm to misjudge information and reduce the quality of the segmentation results. Therefore, introducing the Bezier curve prediction head in the basic model to generate the Bezier polygon detection frame can better fit the target and significantly reduce the background interference that does not belong to the water area.

[0065] like Figure 5 , which is a schematic diagram comparing the horizontal detection frame and the Bezier polygon detection frame provided by the present application.

[0066] The training process of the pre-trained basic model YOLOv8 is as follows:

[0067] Collect a large number of images containing water area targets, use rectangular bounding boxes as initial annotations, and organize the annotated images and corresponding labels into a dataset;

[0068] Convert the labels in the dataset's xml format into txt format. Each image corresponds to a txt file. Each line of the file contains information about an object, including class (type), x-center (X coordinate of the center point), y-center (Y coordinate of the center point), width (width), and height (height). Divide the dataset into training, validation, and test sets in proportion, and then send the training set as the input image to the basic model YOLOv8.

[0069] The basic model YOLOv8 outputs the horizontal detection box coordinates of the target; defines a loss function to evaluate the similarity between the horizontal detection box coordinates output by the model and the rectangular bounding box coordinates; optimizes the model parameters through the back propagation algorithm and the gradient descent algorithm so that the loss function value gradually decreases to a predetermined value.

[0070] The specific operations of introducing the Bezier polygon prediction head in the basic model YOLOv8 are as follows:

[0071] S2.1. Design a neural network layer as a Bezier polygon prediction head to predict the coordinates of the control points of the Bezier polygon. This prediction head can be a combination of a fully connected layer or a convolutional layer.

[0072] Determines the order of the Bezier polygon to be used, such as second order, third order, etc. The higher the order, the more flexible the curve, but the higher the computational cost.

[0073] S2.2. Modify the architecture of the base model YOLOv8; add the Bezier polygon prediction head to the output part of the detection head, which is equivalent to the Bezier polygon prediction head being an extension or submodule of the detection head, which is specifically used to predict the Bezier polygon representing the boundary of the target area. This usually means that while the YOLOv8 model outputs the bounding box coordinates and category labels, it also outputs the control point coordinates of the Bezier polygon.

[0074] In some embodiments, the Bezier polygon prediction head includes two parallel feedforward neural networks FFN, namely, a shape decoupling module and a position decoupling module, both of which are based on the basic architecture of a multi-layer perceptron. The shape decoupling module is used to predict the shape of the detected target, namely, the control points of the local Bezier polygon; the position decoupling module is used to predict the position of the target area, namely, the center coordinates and size of the axis-aligned bounding box; the local Bezier polygon is translated and scaled using the axis-aligned bounding box to obtain the control points of the global Bezier polygon; it is ensured that the predicted bounding box is not only in the correct position, but also in a shape that conforms to the actual shape of the target area.

[0075] Specifically, the shape decoupling module is used to predict the shape of the water target, that is, the control point of the local Bezier polygon; the shape decoupling module includes an input layer, a hidden layer and an output layer; the hidden layer has 256 neurons, uses a ReLU activation function, and layer normalization is applied to the hidden layer output. The output layer of the shape decoupling module includes 4 (n+1) neurons, where n corresponds to the order of the Bezier polygon, each neuron corresponds to the x or y coordinate of a control point, and uses a linear activation function.

[0076] For example, the coordinates of the control point P0 of the local Bezier polygon are expressed as:

[0077]

[0078] The position decoupling module is used to predict the position of the target area, that is, the center coordinates and size of the axis-aligned bounding box; the position decoupling module includes an input layer, a hidden layer and an output layer; the hidden layer has 256 neurons, uses a ReLU activation function, and layer normalization is applied to the hidden layer output. The output layer of the position decoupling module includes 4 neurons, which correspond to the center point x coordinate, center point y coordinate, length and width of the axis-aligned bounding box, respectively, and uses sigmoid as the activation function.

[0079] For example, for the i-th water region, the axis-aligned bounding box (AABB) coordinates predicted by the position decoupling module are expressed as:

[0080] AABB i =[x center,i ,y center,i , w i ,h i ]∈R 4

[0081] x, y represent the center coordinates of the axis-aligned bounding box, and w and h represent the height and width of the axis-aligned bounding box, respectively.

[0082] Finally, the local Bezier polygon is translated and scaled using the axis-aligned bounding box to obtain the control points of the global Bezier polygon, thereby ensuring that the predicted bounding box is not only correctly positioned but also conforms to the actual shape of the target water area.

[0083] The coordinates of the control point P of the global Bezier polygon are expressed as:

[0084]

[0085] x i,j =p i,j *w i +x center,i

[0086] y i,j =q i,j *h i +y center,i .

[0087] like Figure 7 Shown is a schematic diagram of the position and shape decoupling module provided by the present application.

[0088] In step S2, the introduction of the position enhancement mechanism includes the following steps:

[0089] S2.3, introducing a position enhancement mechanism into the head network part of the target detection model, including a position embedding layer and a position perception module;

[0090] S2.4. Inserting a long short-term memory network into the backbone network of the target detection model, so that the target detection model can receive a series of pictures of the same water area at different times, thereby capturing the temporal changes of the water area and automatically generating the corresponding time step;

[0091] The position embedding layer embeds the time step information into the target detection model, and enhances the model's understanding of the position information by generating a specific embedding vector qt, which represents the position information of each time step t;

[0092] S2.5. The location perception module uses two layers of LSTM with a hidden state size of 128, two 3×3 convolutional layers and a ReLU activation function to generate a key vector for the subsequent attention mechanism of the model to ensure that the location of the detected target can be correctly focused during decoding, thereby improving the accuracy of water area classification and recognition.

[0093] S3. Use a dataset with Bezier polygon labels to train the modified basic model; define a loss function to evaluate the distance measurement between the Bezier polygon control point coordinates output by the model and the actual control point coordinates, and optimize the model parameters through the back propagation algorithm and the gradient descent algorithm so that the loss function value gradually decreases to a predetermined value as a target detection model.

[0094] like Figure 8 As shown, it is a schematic diagram of the improved target detection model network structure provided in this application.

[0095] like Figure 2 As shown, the second aspect of the present application discloses a method for detecting a target in a water area, comprising the following steps:

[0096] S100: Collect water area images.

[0097] In step S100, images containing water areas may be collected from various sources such as satellite images, drone photography, ground photography, etc.; ensuring that the collected images are sufficiently diverse and representative to cover different water environments, lighting conditions, seasonal changes, etc.

[0098] S200, using the above-mentioned target detection model with Bezier polygon prediction head and position enhancement mechanism to identify the water area image, and output the control points of the top edge, bottom edge, left side and right side of the water area target as the bounding box coordinates.

[0099] In step S200, the target detection model parameterizes each water target into four n-order Bezier polygons, one for the top edge of the water target boundary, one for the bottom edge of the water target boundary, and the other two for the left and right sides of the water target boundary. Each Bezier polygon has n+1 control points. After adding the Bezier polygon prediction head, the detection model can predict 4 (n+1) control points, with a total of 8 (n+1) coordinates. The boundary of the detection target can be reconstructed through the predicted control points.

[0100] It should be noted that in addition to the 2nd and 3rd order Bezier curves, other orders of Bezier curves can also be used to define and predict target boundaries. However, as the order of the Bezier curve increases, the number of control points will also increase, which may lead to increased model complexity and increased training difficulty. Although high-order Bezier curves can provide more complex shape representations, in practical applications, it is necessary to weigh the complexity and performance of the model. Higher orders may make the model more difficult to train because more control points need to be predicted and the interactions between these control points will become more complex.

[0101] S300: Based on the control points of the Bezier polygon and the definition of the Bezier curve, a series of points approximating the Bezier curve are generated, and a smooth curve is formed according to these points.

[0102] Specifically, the definitions of the 2nd-order Bezier curve and the 3rd-order Bezier curve are as follows:

[0103] B(t)=(1-t) 2 P0+2t(1-t)P1+t 2 P2, t∈[0, 1]

[0104] B(t)=P0(1-t) 3 +3P1t(1-t) 2 +3P2t 2 (1-t)+P3t 3 , t∈[0,1]

[0105] like Figure 6 , which is a schematic diagram of the definition of the second-order Bezier curve provided in this application.

[0106] Based on a set of control points, the value of t is traversed (for example, from 0 to 1 with a step size of 0.01), and a series of temporary points (nodes) approximating the Bezier curve are generated by continuously changing the parameter t between the control points, and then these nodes are recursively evaluated to finally form a smooth curve.

[0107] like Figure 3 As shown, the third aspect of the present application discloses a method for segmenting a water area target, comprising the following steps S01 to S03:

[0108] S01. Using the bounding box coordinates of the above object detection method as input to the segmentation model;

[0109] In step S01, SAM is preferred as a segmentation model. The SAM segmentation model is a general model that can handle various segmentation tasks and can segment various objects, parts, and visual structures in diverse scenes by accepting prompts consisting of points, bounding boxes, or coarse masks as input. Its zero-shot segmentation capability has led to a rapid paradigm shift because it can be transferred to numerous applications with simple prompts.

[0110] However, the SAM segmentation model cannot automatically select the target object for segmentation, and is greatly affected by the quality of the prompt box. If the target object area cannot be accurately selected, the segmentation result quality is poor. Therefore, this application connects it with the detection model, and uses the output of the detection model as the input of the segmentation model. First, the detection model is used to detect and classify the water area, output the recognition result, and then extract the bounding box coordinates of the detected water area and input it into the segmentation model.

[0111] S02, the segmentation model uses these bounding box coordinates to generate a corresponding segmentation mask, where the segmentation mask corresponds to the water area target in the input image;

[0112] In step S02, the SAM segmentation model contains a hint encoder and a mask decoder. The hint encoder is responsible for processing the input, and the bounding box coordinates output by the detection model will be input into the hint encoder of SAM as a hint.

[0113] The hint encoder encodes the control point coordinates and converts them into an internal representation that the model can understand; this encoded hint is then fed into the mask decoder along with the embedded representation of the image.

[0114] The mask decoder is the core part of SAM, which is responsible for converting the encoded cues and image embeddings into the final object mask; in this process, the mask decoder uses the control point coordinate information to guide the segmentation process to ensure that the generated mask can accurately cover the target object, that is, the water area.

[0115] S03. Superimposing the segmentation mask generated by the segmentation model with the original remote sensing image to extract accurate water area boundaries.

[0116] By superimposing the segmentation mask on the original image, researchers or developers can intuitively see the segmentation model's recognition results for the water area, thereby determining whether the segmentation model is accurate and whether further adjustment or optimization is needed.

[0117] like Figure 4 As shown, the fourth aspect of the present application discloses a method for monitoring area changes in a water area, comprising the following steps a, b, c:

[0118] a. Binarize the grayscale image after segmentation and set an appropriate threshold to distinguish the water area and the non-water area;

[0119] b. Count the number of pixels representing the water area in the binary image and use the given image scale to calculate the actual area of ​​the water area.

[0120] Specifically, in step b, an appropriate grayscale threshold is set, pixels greater than the threshold are set to white, representing water areas, and pixels less than the threshold are set to black, representing non-water areas; the number of white pixels (water areas) in the binary image is counted, that is, the pixel area N, and the pixel area N is multiplied by the square of the image scale S to obtain the actual area A of the water area. The specific calculation formula is:

[0121] A area = N area × (S × S).

[0122] c. Regularly obtain image data of the water area, calculate the actual area of ​​the water area obtained by segmentation according to steps a and b, and record the area data and the corresponding timestamp in a database; use the recorded area data to analyze the trend of the area of ​​the water area over time.

[0123] Specifically, for example, the impact of seasonal changes, long-term trends or emergencies on the water area can be checked; according to the specific needs of environmental management, a threshold for area change can be set. When the area change of the water area exceeds the preset threshold, a corresponding alarm mechanism is triggered, such as sending an alarm to notify relevant personnel; based on the area change data and alarm information, corresponding environmental management strategies are formulated. For example, if the water area continues to shrink, measures may need to be taken to protect water resources, such as controlling emissions or increasing water supply.

[0124] In practical applications, the system can be used to monitor water level changes in water areas. By acquiring, analyzing and responding to changes in water area in real time, it can play an active role in water resource management and environmental protection, and take timely measures to protect the ecological environment of the lake and ensure water supply in surrounding areas.

[0125] like Fig. 9 As shown, the fourth aspect of the present application discloses a water area monitoring system, comprising:

[0126] Image acquisition equipment is responsible for capturing image data of water areas regularly or in real time. This can be achieved through satellite remote sensing, drone aerial photography or ground cameras. The equipment should have high-resolution image capture capabilities to ensure the accuracy and reliability of image data.

[0127] The image processing device receives the original image data from the image acquisition device and performs preprocessing on the image, including steps such as image segmentation, grayscale conversion, and binarization, so as to more accurately identify water areas and non-water areas. By setting appropriate thresholds, the pixels in the image are divided into categories representing water areas and non-water areas.

[0128] The area calculation and storage unit calculates the pixel area of ​​the water area according to the pixel data in the binary image; converts the pixel area into the actual water area using the scale information of the image; and stores the calculated water area data and the corresponding timestamp information in the database for subsequent analysis and query.

[0129] The data analysis and prediction unit extracts historical water area data from the database, uses statistical analysis methods to analyze the changing trends of water area areas over time, including seasonal changes, long-term trends, etc., and applies prediction models to predict possible changes in water area areas in the future based on historical data.

[0130] The threshold setting and alarm unit sets the threshold for the change in the water area according to the specific needs of environmental management, monitors the current water area data in real time, and compares it with the set threshold. When the water area change exceeds the preset threshold, the alarm mechanism is triggered, such as sending an alarm notification to relevant personnel.

[0131] The environmental management unit formulates corresponding environmental management strategies based on the information provided by the data analysis and prediction unit. According to the strategies, it takes corresponding measures to protect the ecological environment of the water area and ensure the water supply of the surrounding areas, monitors the implementation effect of the measures, and adjusts the strategies according to the actual situation.

[0132] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0133] All terms used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having the meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0134] When using expressions like "at least one of A, B and C", it should generally be interpreted according to the meaning of the expression commonly understood by technical personnel in this field. For example, "a system having at least one of A, B and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.

[0135] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for processing a target detection model, characterized in that: include: Collect a large number of images containing the target area, use Bezier polygons to mark the target area, and organize the marked images and corresponding labels into a data set; Select a pre-trained basic model, add a Bezier polygon prediction head to its detection head, and introduce a position enhancement mechanism to enable it to output the coordinates of the control points of the Bezier polygon; A dataset with Bezier polygon labels is used to train the modified base model. A loss function is defined to evaluate the distance measurement between the Bezier polygon control point coordinates output by the model and the actual control point coordinates. The model parameters are optimized through the back propagation algorithm and the gradient descent algorithm so that the loss function value gradually decreases to a predetermined value as a target detection model.

2. The method for processing a target detection model according to claim 1, characterized in that: The Bezier polygon prediction head includes a shape decoupling module and a position decoupling module; the shape decoupling module is used to predict the shape of the detection target, that is, the control points of the local Bezier polygon; the position decoupling module is used to predict the position of the target area, that is, the center coordinates and size of the axis-aligned bounding box; the local Bezier polygon is translated and scaled using the axis-aligned bounding box to obtain the control points of the global Bezier polygon, ensuring that the predicted bounding box is not only correctly positioned, but also has a shape that conforms to the actual shape of the target area.

3. The method for processing a target detection model according to claim 2, characterized in that: The shape decoupling module and the position decoupling module are both based on the basic architecture of multi-layer perceptron; The position decoupling module includes an input layer, a hidden layer, a layer normalization and an output layer; the output layer of the shape decoupling module includes 4 neurons, corresponding to the center point x coordinate, center point y coordinate, length and width of the axis-aligned bounding box, and uses sigmoid as an activation function; The shape decoupling module includes an input layer, a hidden layer and an output layer; the output layer of the shape decoupling module includes 4 (n+1) neurons, where n corresponds to the order of the Bezier polygon, each neuron corresponds to the x or y coordinate of a control point, and a linear activation function is used.

4. The method for processing a target detection model according to claim 1, characterized in that: The introduced position enhancement mechanism includes: Introducing a position enhancement mechanism into the head network part of the object detection model, including a position embedding layer and a position perception module; Inserting a long short-term memory network into the backbone network of the target detection model enables the target detection model to receive a series of pictures of the same water area at different times, thereby capturing the temporal changes of the water area and automatically generating corresponding time steps; The position embedding layer embeds the time step information into the target detection model, and enhances the model's understanding of the position information by generating a specific embedding vector qt, which represents the position information of each time step t; The location perception module uses two layers of LSTM with a hidden state size of 128, two 3×3 convolutional layers and a ReLU activation function to generate a key vector for the subsequent attention mechanism of the model to ensure that the location of the detected target can be correctly focused during decoding, thereby improving the accuracy of water area classification and recognition.

5. The method for processing a target detection model according to claim 1, characterized in that: The training process of the pre-trained basic model includes: Collect a large number of images containing water area targets, use rectangular bounding boxes as initial annotations, and organize the annotated images and corresponding labels into a dataset; Select a network model suitable for target detection, use a dataset with rectangular bounding box labels to train this model so that it can output the horizontal detection box coordinates of the target; define a loss function to evaluate the similarity between the horizontal detection box coordinates output by the model and the rectangular bounding box coordinates; optimize the model parameters through the back propagation algorithm and the gradient descent algorithm so that the loss function value gradually decreases to the predetermined value.

6. A method for detecting targets in a water area, characterized in that: include: Collect images of water areas; Using the target detection model described in any one of claims 1 to 5 to recognize the water area image, output the control points of the top edge, bottom edge, left edge and right edge of the water area target Bezier polygon as the bounding box coordinates; Based on the control points of the Bezier polygon and the definition of the Bezier curve, a series of points approximating the Bezier curve are generated, and a smooth Bezier curve is formed based on these points.

7. A method for detecting targets in a water area according to claim 1, characterized in that: The control points of the top, bottom, left and right Bezier polygons of the output water area target include: Each water target is parameterized into 4 n-order Bezier curves, one for the top edge of the water target boundary, one for the bottom edge of the water target boundary, and the other two for the left and right sides of the water target boundary. Each Bezier polygon has n+1 control points.

8. A method for segmenting a water area target, characterized in that: include: Using the bounding box coordinates of any one of claims 6 to 7 as input to a segmentation model; The segmentation model generates a corresponding segmentation mask using the bounding box coordinates, wherein the segmentation mask corresponds to a water area target in the input image; The segmentation mask generated by the segmentation model is superimposed on the original remote sensing image to extract the accurate boundary of the water area.

9. A method for monitoring area changes in a water area, characterized in that: include: Binarizing the segmented grayscale image according to claim 8, and setting an appropriate threshold to distinguish between water areas and non-water areas; Count the number of pixels representing water areas in the binary image and use the given image scale to calculate the actual water area; The image data of the water area is obtained regularly, the actual area of ​​the segmented water area is calculated, the area data and the corresponding timestamp are recorded in a database, and the trend of the area of ​​the water area changing over time is analyzed.

10. A water area monitoring system, characterized in that: include: Image acquisition equipment, responsible for capturing image data of the water area periodically or in real time; An image processing device that uses the method of claim 9 to classify pixels in the image into categories representing water areas and non-water areas; an area calculation and storage unit, which calculates the pixel area of ​​the water area using the method of claim 9; The data analysis and prediction unit uses statistical analysis methods to analyze the changing trend of water area over time; The threshold setting and alarm unit sets the threshold for the change in the area of ​​the water area. When the change in the area of ​​the water area exceeds the preset threshold, the alarm mechanism is triggered. The environmental management unit formulates corresponding environmental management strategies based on the information provided by the data analysis and prediction unit.

Citation Information

Patent Citations

  • Subtitle dramatizing method based on closed outline of Bezier

    CN101764945A

  • Method for detecting and correcting texts in any shape

    CN112183322A

  • Image processing method and device, electronic equipment and storage medium

    CN114612647A

  • Water surface rate value domain measuring and calculating method for urban water ecological protection

    CN117830823A