CN-122023826-A - Water body extraction system and method based on improved UNet
Abstract
The invention discloses a water body extraction system and method based on improved UNet, wherein the system comprises terminal equipment and a remote server. The terminal equipment in the system can multiplex the existing equipment without repeated deployment, improves the utilization efficiency of the equipment, can carry out subsequent processing only by accessing the data of the existing equipment into the data receiving module of the system, and has wide application range. The high-efficiency data preprocessing flow provided by the invention can effectively reduce the influence of the problems of large image size change, low NDWI label accuracy and the like on model training. The improved EMS-UNet algorithm of the invention enhances the feature perception and extraction capacity of the model through technologies such as integrated model migration, light weight, attention mechanism and the like, and can meet the requirements of high precision, light weight, instantaneity and the like of the water body extraction model. The invention integrates various data sources, does not need complex manual labeling, and realizes high-precision and automatic extraction of regional water body through preliminary training and continuous updating optimization of the model.
Inventors
- ZHOU CONG
- ZHOU HONGBIN
- JIA SU
- XU LIJIE
- GU XUDONG
Assignees
- 沙洲职业工学院
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (10)
- 1. The water body extraction system based on the improved UNet is characterized by comprising terminal equipment and a remote server; The terminal equipment is used for shooting the water area environment video in real time; the remote server comprises a data receiving module, a water body extraction module, a space-time analysis module, a result storage module and a model updating module; The data receiving module is used for receiving the water area environment video transmitted back by the terminal equipment and extracting images according to a preset frame rate; The water body extraction module is used for deploying an EMS-UNet model; the space-time analysis module is used for carrying out contrast analysis on the time dimension and the space dimension on the water body extraction result; The result storage module is used for storing water body extraction and analysis results, running logs and model update records; The model updating module is used for automatically updating the EMS-UNet model according to the newly-added data.
- 2. The improved UNet-based water extraction system of claim 1, wherein the terminal device comprises a water monitoring device and a water inspection drone, both of which are used to capture a water environmental video in real time.
- 3. The improved UNet-based water extraction system of claim 1, wherein the data receiving module is configured to set the image extraction frequency according to the requirements, including day, ten, month, and hour level extraction.
- 4. The improved UNet-based water extraction system of claim 1, wherein the EMS-UNet model includes an encoder structure, a decoder structure, and an attention enhancing structure; The encoder structure adopts a pre-trained EFFICIENTNET-b0 network; The decoder architecture includes a multi-stage upsampling module, each stage upsampling module comprising a mobile rollover bottleneck convolution (MBConv) module; the attention enhancing structure is a space and channel attention (scSE) module, is arranged behind the MBConv module in each stage of up-sampling module, and is used for enhancing the edge characteristics of the water body and inhibiting the background noise; the encoder structure comprises five-stage downsampling modules, and the output characteristic diagram of each stage downsampling module is respectively transmitted to the fusion node of the corresponding stage in the decoder structure through jump connection; The decoder structure comprises five stages of up-sampling modules, wherein the input of each stage of up-sampling module comprises an output characteristic diagram from the up-sampling module of the upper stage and a jump connection characteristic diagram from the corresponding stage of the encoder, the input of the up-sampling module of the first stage of the decoder is the output characteristic diagram of the down-sampling module of the last stage of the encoder, and the input of the up-sampling modules of the rest stages is executed according to the rules; The up-sampling module of each stage performs channel dimension splicing on the output characteristic diagram from the up-sampling module of the previous stage and the jump connection characteristic diagram of the corresponding stage of the encoder, then inputs the spliced characteristic diagram into a MBConv module for characteristic extraction and fusion, inputs the characteristic diagram output by the MBConv module into a scSE module for weight adjustment of channel and space dimensions, and finally performs up-sampling operation on the characteristic diagram output by the scSE module to be output as the stage; the scSE module comprises a channel attention branch and a spatial attention branch, wherein the channel attention branch learns channel weights with a full connection layer through global average pooling, the spatial attention branch learns spatial position weights through convolution operation, and the outputs of the two branches are fused through element-by-element addition.
- 5. The improved UNet-based water extraction system of claim 1, wherein the temporal dimension analysis of the spatio-temporal analysis module includes an annual change analysis and a seasonal change analysis, and the spatial dimension analysis includes a spatial stacking analysis.
- 6. The improved UNet-based water extraction system of claim 1, wherein the model update module triggers a model update when the amount of newly added data reaches a preset threshold.
- 7. A method of improved UNet-based water extraction implemented by the improved UNet-based water extraction system of claims 1-6, comprising the steps of: s1, terminal equipment shoots a water area environment video in real time, and a data receiving module of a remote server receives the video and extracts images according to a preset frame rate; S2, carrying out data preprocessing on the extracted image, wherein the preprocessing comprises the following four steps: s21, label cleaning, namely generating a binary mask image by adopting Otsu self-adaptive threshold classification and connected domain denoising, and dividing a training set, a verification set and a test set; s22, edge repair, namely removing edge noise by adopting 5 multiplied by 5 corrosion operation; S23, performing size processing, namely uniformly processing the images into 512X 512 specifications, cutting large images and filling small images; s24, data enhancement, namely performing geometric enhancement, color enhancement and random shielding operation on the training set; S3, inputting the preprocessed data set into an EMS-UNet Model for training until the extraction precision is more than or equal to 90%, and generating an initial Model model_v1.Pth; S4, the water body extraction module calls a trained model to extract water bodies from the preprocessed image; S5, carrying out space-time dimension analysis on the extraction result by a space-time analysis module; s6, a result storage module stores related results and records; And S7, when the newly added data quantity reaches 20% of the previous Model training data set, the Model updating module starts Model updating to generate an updated model_vn.
- 8. The method for extracting water based on improved UNet according to claim 7, wherein in step S21, the area threshold for denoising the connected domain is set to 50 pixels, and the brightness threshold is set to 150; In step S23, the large image is an image with the size of >512, a random clipping slice is adopted to form 5 sub-images, the middle image is an image with the size of 256-512, the images are directly filled to 512, the small image is an image with the size of <256, the images are amplified to 256 in an equal ratio, the training set is randomly filled, the verification set and the test set are centrally filled, and the filling value is 128.
- 9. The method for extracting water based on improved UNet as claimed in claim 7, wherein in the step S3, the batch size of model training is set to 4, the optimizer adopts AdamW, the initial learning rate is 1e-5, the weight attenuation is 1e-8, the total number of training iterations is 100 epochs, the SE ratio is set to 0.25, the adaptive learning rate scheduler is adopted, the half learning rate is reduced when the validation set loss is 5 times without reduction, and the training is terminated when 30 times without reduction.
- 10. The method for extracting water based on improved UNet as claimed in claim 7, wherein in step S7, the model updating is performed by pre-labeling the newly added data set by the original water extraction model, and manually auditing and deleting the error sample to re-train the model as newly added training data.
Description
Water body extraction system and method based on improved UNet Technical Field The invention relates to the technical field of water body identification, in particular to a water body extraction system and method based on improved UNet. Background Accurate water body extraction is the basis of dynamic monitoring and management of water resources, can provide data support for river water area supervision, pollution control and other researches, and has important significance. At present, the water extraction technology is developed by mainly taking remote sensing images as core data sources and adopting a traditional water index method, a machine learning method, a deep learning method and the like. The water body index method is easy to be interfered by object shadows of vegetation, buildings and the like, and is difficult to effectively distinguish water bodies from shadows, wetlands and the like under a complex scene of foreign matter homospectrum, so that the extraction error is large. The machine learning method requires complex spectral analysis and feature selection during water extraction, relies on priori knowledge, and generally has insufficient learning ability on deep features, so that the requirements of high-precision and automatic water extraction are difficult to meet. The deep learning method with the Convolutional Neural Network (CNN) as the core is a mainstream technology of current water extraction, and good performance is achieved, but a trained label sample is usually obtained from manual visual interpretation, and the cost of manual time required by labeling is high. In addition, the deep learning network model is large in parameter quantity, time-consuming to calculate and difficult to adapt to real-time monitoring requirements. Disclosure of Invention The invention aims to solve the problems and provide a water body extraction system and a water body extraction method based on improved UNet, the provided water area analysis system can automatically receive real-time videos of research areas such as rivers, lakes and the like, the water body region image is acquired, the extracted water body result can be further subjected to automatic visual analysis after being input into the water body extraction model, the space-time change condition of the water area is intuitively displayed, and the intelligent level of regional water environment management is improved. In order to achieve the above purpose, the invention adopts the following technical scheme: A water body extraction system based on improved UNet comprises a terminal device and a remote server; The terminal equipment is used for shooting the water area environment video in real time; the remote server comprises a data receiving module, a water body extraction module, a space-time analysis module, a result storage module and a model updating module; The data receiving module is used for receiving the water area environment video transmitted back by the terminal equipment and extracting images according to a preset frame rate; The water body extraction module is used for deploying an EMS-UNet model; the space-time analysis module is used for carrying out contrast analysis on the time dimension and the space dimension on the water body extraction result; The result storage module is used for storing water body extraction and analysis results, running logs and model update records; The model updating module is used for automatically updating the EMS-UNet model according to the newly-added data. Further, the terminal equipment comprises water area monitoring equipment and a water area inspection unmanned aerial vehicle, and the water area monitoring equipment and the water area inspection unmanned aerial vehicle are both used for shooting a water area environment video in real time. Further, the data receiving module can set the image extraction frequency according to the requirement, including day, ten, month and hour level extraction. Further, the EMS-UNet model includes an encoder structure, a decoder structure, and an attention enhancing structure; The encoder structure adopts a pre-trained EFFICIENTNET-b0 network; The decoder architecture includes a multi-stage upsampling module, each stage upsampling module comprising a mobile rollover bottleneck convolution (MBConv) module; the attention enhancing structure is a space and channel attention (scSE) module, is arranged behind the MBConv module in each stage of up-sampling module, and is used for enhancing the edge characteristics of the water body and inhibiting the background noise; the encoder structure comprises five-stage downsampling modules, and the output characteristic diagram of each stage downsampling module is respectively transmitted to the fusion node of the corresponding stage in the decoder structure through jump connection; The decoder structure comprises five stages of up-sampling modules, wherein the input of each stage of up-sampling module comprises an output