Flood warning method based on radar image u-net variant neural network
By using a variant of the U-net neural network based on radar images, combined with wavelet adaptive denoising and attention mechanisms, the problem of capturing nonlinear events in existing technologies has been solved, and high-accuracy flood disaster early warning has been achieved on readily available data.
Patent Information
- Application Number
- CN202211188983.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-09-27
AI Technical Summary
Existing flood disaster early warning methods are difficult to effectively capture nonlinear events such as heavy rainfall caused by convection, and neural network-based early warning methods require specialized radar data and are difficult to train.
A variant of the U-net neural network based on radar images is adopted. Through wavelet adaptive denoising layer and U-shaped structure, combined with attention mechanism, it can perform flood disaster early warning using easily obtainable radar images, capture nonlinear events, and optimize the model through performance analysis.
It improves the accuracy of flood disaster early warning, and can accurately predict rainfall within a certain period of time based on readily available radar images. It is applicable to various terrains and cities.
Smart Images

Figure CN115512299B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a flood disaster early warning method, in particular to a flood disaster early warning method based on a U-net variant neural network of a radar image. BACKGROUND
[0002] In recent years, more and more researches on flood disaster early warning are carried out. The existing researches solve the flood disaster early warning problem from different angles. Traditional flood disaster early warning problems include advection precipitation early warning based on a radar field. This early warning method is difficult to capture nonlinear events such as strong rainfall caused by convection. The early warning method based on a neural network can capture such nonlinear events, but this often needs data captured by a special radar, and these data have the defects of being difficult to obtain, redundant and difficult to train. SUMMARY
[0003] The application aims to provide a flood disaster early warning method based on a U-net variant neural network of a radar image, which can perform flood disaster early warning on easily obtained radar images, has the ability to capture nonlinear events in flood disaster early warning, and improves the accuracy of flood disaster early warning.
[0004] The application adopts the following technical scheme:
[0005] A flood early warning method based on a U-net variant neural network of a radar image sequentially comprises the following steps:
[0006] A: obtaining a color radar picture of a monitoring area and converting it into a gray picture represented by pixel values of radar echo intensity, and then establishing a training data set and a test data set according to the obtained gray picture;
[0007] B: establishing a U-net variant neural network model,
[0008] C: inputting the training data set obtained in step A into the U-net variant neural network model established in step B for iterative training until the U-net variant neural network model converges to a set loss value, and obtaining a trained U-net variant neural network model;
[0009] D: putting the data of the test data set in step A into the trained U-net variant neural network model in step C for testing, and obtaining radar images of the monitoring area in the next 90 minutes from the image acquisition time of the first image in the test data set as a starting point;
[0010] E: performing quality evaluation on the radar images in the next 90 minutes from the image acquisition time of the first image in the test data set as a starting point obtained in step D, and obtaining performance analysis results of the U-net variant neural network;
[0011] F: According to the performance analysis result of the U-net variant neural network obtained in step E, adjust the model parameter of the trained U-net variant neural network in step C, and optimize the trained U-net variant neural network model;
[0012] G: According to the optimized U-net variant neural network model, flood warning is carried out by using color radar pictures.
[0013] The step A includes the following specific steps:
[0014] A1: Obtain the color radar pictures of the monitoring area, and read the color radar pictures into a four-dimensional array dataList0 according to the serial number; the four-dimensional array dataList0 contains the number of pictures, the size of the picture pixels and the number of channels;
[0015] A2: Traverse the four-dimensional array dataList0 obtained in step A1, convert the color data in the four-dimensional array dataList0 into gray scale data according to the color chart, and finally obtain the gray scale time sequence pictures; the numerical value of the gray scale data represents the intensity of the radar echo;
[0016] A3: Downsample the gray scale time sequence pictures obtained in step A2 to obtain the downsampled gray scale time sequence pictures;
[0017] A4: Sort and divide the downsampled gray scale time sequence pictures obtained in step A3 into 15 groups of training data according to the ascending order of the gray scale time sequence picture serial number, and finally obtain multiple groups of training data; then divide the multiple groups of training data into a training data set and a test data set.
[0018] The U-net variant neural network model comprises a wavelet adaptive denoising layer and a U-shaped structure;
[0019] The wavelet adaptive transformation layer performs two-dimensional wavelet multi-scale decomposition on the input data to obtain the scale coefficients of the input data, and then removes all scale coefficients less than the threshold value according to the adaptive threshold value; then the remaining scale coefficients are inverse transformed to obtain the denoised data; finally, the denoised data is transmitted to the first loop limited step feature extraction layer in the U-shaped structure;
[0020] The U-shaped structure is, from left to right and from top to bottom, a first cyclic limited step feature extraction layer, a first maximum pooling layer, a second cyclic limited step feature extraction layer, a second maximum pooling layer, a third cyclic limited step feature extraction layer, a third maximum pooling layer, a fourth cyclic limited step feature extraction layer, a fourth maximum pooling layer, a fifth cyclic limited step feature extraction layer, a first up-sampling limited step rich feature layer, a first attention layer, a first up-sampling cyclic limited step feature processing layer, a second up-sampling limited step feature processing layer, a second attention layer, a second up-sampling cyclic limited step feature processing layer, a third up-sampling convolution layer, a third attention layer, a third up-sampling cyclic limited step feature processing layer, a fourth up-sampling convolution layer, a fourth attention layer, a fourth up-sampling cyclic limited step feature processing layer, and a first limited step feature output layer.
[0021] The wavelet adaptive transform layer realizes two-dimensional wavelet multi-scale decomposition through the following function:
[0022] [C,S]=wavedec2(waveletData ab ,2,′coif3′);
[0023] wherein C is each scale coefficient of the input data, S is the size of each scale coefficient, waveletData ab is the input data of the wavelet adaptive transform layer, and ′coif3′ is one form of a Coiflet wavelet basis function;
[0024] The wavelet adaptive transform layer realizes adaptive threshold denoising through the following function:
[0025] nc1=wthcoef2(′h′,C,S,P);
[0026] nc2=wthcoef2(′v′,nc1,S,P);
[0027] nc3=wthcoef2(′d′,nc2,S,P);
[0028] wherein ′h′, ′v′, ′d′ respectively represent denoising of each scale coefficient from horizontal, vertical and diagonal directions, nc1, nc2, nc3 represent each scale coefficient after denoising from horizontal, vertical and diagonal directions in turn, and P is an adaptive threshold;
[0029] The wavelet adaptive transform layer realizes two-dimensional wavelet multi-scale inverse transform through the following function:
[0030] waveletResData ab =waverec2(nc3,S,′coif3′);
[0031] wherein, waveletResData ab output data of a wavelet adaptive transform layer, and 'coif3' is one form of a Coiflet wavelet basis function.
[0032] The loop-limited step feature extraction layer of each layer first performs limited step feature extraction on the input data, and then performs secondary loop feature extraction on the data after limited step feature extraction.
[0033] The method for performing secondary loop feature extraction on the limited step feature extraction data is as follows:
[0034]
[0035] inputData k2 =outputData k1
[0036]
[0037] wherein, outputData k1 represents the output data of the first loop of the kth layer of the U-net variant neural network model, and inputData k1 represents the input data of the first loop of the kth layer of the U-net variant neural network model, m k1 and n k1 represent the height and width of inputData k1 , Kernel k1 represents the feature extraction matrix of the first loop of the kth layer of the U-net variant neural network model, and stride k1 represents the step length of the feature extraction matrix of the first loop of the kth layer of the U-net variant neural network model in the input data matrix each time; k1 represents the first loop of the kth layer of the variant neural network model; i, j represent the ith row and jth column of inputData k1 , respectively.
[0038] outputData k represents the output data of the second loop of the kth layer of the U-net variant neural network model, and is also the output of the kth layer of the U-net variant neural network; inputData k2 represents the input data of the second loop of the kth layer of the U-net variant neural network model, m k2 and n k2 represent the height and width of inputData k2 , Kernel k2a feature extraction matrix of the kth layer of the second loop of the U-net variant neural network model, stride k2 a stride of the feature extraction matrix of the kth layer of the second loop of the U-net variant neural network model in each movement of the input data matrix; k2 represents the kth layer of the second loop of the variant neural network model.
[0039] In step C, first, the training data set obtained in step A is normalized; the normalized data is divided into 15 groups of training data in ascending order of serial number; then the divided multiple groups of training data are input into the U-net variant neural network model for iterative training, and the number of training times, learning rate, batch size and loss function are set; after each training is completed, the model parameters of this training are saved; when the value of the loss function converges to the set loss value, the training is stopped; the number of training times is 3000, the learning rate is 0.00001, the batch size is 1, the loss value is 20%, and the loss function is the MSE function; the formula of the MSE function is:
[0040]
[0041] wherein D represents the range of the two-dimensional matrix of the radar picture, a q and b q respectively represent the gray scale values of the real radar picture and the predicted radar picture, wherein q represents the qth radar picture.
[0042] The step D comprises the following specific steps:
[0043] D1: input the continuous 15 images data n -data n+14 in the test data set into the trained U-net variant neural network model obtained in step C to obtain the gray scale pictures data n -data n+1 of the continuous 15 monitoring areas within 90 minutes in the future from the collection time of the image data n+15 ;
[0044] D2: after the gray scale pictures data n+1 -data n+15 are denormalized, recolored and up-sampled, the continuous 15 color radar pictures of the monitoring areas are obtained.
[0045] The step E comprises the following steps:
[0046] E1: all pixel values in the gray scale picture obtained in step D1 are divided into predicted positive examples and predicted negative examples according to a set flood disaster threshold value, if a pixel value in the gray scale image is greater than the flood disaster threshold value, the pixel value is a predicted positive example, if a pixel value in the gray scale image is less than the flood disaster threshold value, the pixel value is a predicted negative example;
[0047] E2: the color radar picture at the actual time is converted into a gray scale picture representing the intensity of the radar echo according to a color chart, and the gray scale picture is processed according to the steps in E1, all pixel values of the gray scale picture are divided into predicted positive examples and predicted negative examples according to a set flood disaster threshold value;
[0048] E3: the gray scale pictures obtained in steps E1 and E2 are scored for prediction, the scoring indicators include false alarm rate, missed alarm rate and hit rate; the false alarm rate refers to the proportion of the actual flood-free area in the total predicted flood area, the missed alarm rate refers to the proportion of the missed alarm area in the actual flood area, and the hit rate refers to the proportion of the predicted actual flood area in the total actual flood area;
[0049] The calculation formula of the false alarm rate is FAR = (y pre -his) / y pre , the calculation formula of the missed alarm rate is MAR = (y obs -his) / y obs , and the calculation formula of the hit rate is POD = his / y obs ;
[0050] Wherein, y pre represents the pixel value of the predicted positive example area, y obs represents the pixel value of the actual positive example area, and his represents the pixel value of the intersection area of the predicted positive example area and the actual positive example area.
[0051] In step F, when adjusting the parameters of the trained U-net variant neural network model, if the hit rate in step E is lower than the set hit rate threshold, the learning rate in the model parameters is reduced for retraining, and if the missed alarm rate in step E is higher than the set missed alarm rate threshold, the value of the batch size in the model parameters is increased for retraining.
[0052] In step A1, the generation time is taken as the serial number of the color radar picture, and 15 color radar pictures sorted in ascending order of the serial number are packaged as a set of color time sequence pictures, the detection areas of all color radar pictures in each set of color time sequence pictures are the same, and each color radar picture represents a three-dimensional array with a shape of [1024, 1012, 3]; each set of color time sequence pictures represents a four-dimensional array dataList0 with a shape of [15, 1024, 1012, 3];
[0053] In step A2, the four-dimensional array dataList0 with a shape of [15, 1024, 1012, 3] is traversed, and the data in the dataList0 is transformed according to the rule (r, g, b) -> x in the color chart, and the gray time sequence picture obtained after traversal represents a three-dimensional array dataList1 with a shape of [15, 1024, 1012];
[0054] In step A3, when downsampling is performed, the three-dimensional array dataList1 is traversed, and the data in the three-dimensional array dataList1 is traversed using a sliding window with a size of 3 pixels*3 pixels, and the arithmetic mean value of the pixel values in the sliding window is taken as the fused pixel value; after processing, the three-dimensional array dataList1 changes to [15, 256, 256], wherein 256, 256 represents that the size of the gray time sequence picture after downsampling is 256 pixels*256 pixels;
[0055] In step A4, when the training data set is divided, the first to the 15th gray time sequence pictures are taken as a group of data, the 2nd to the 16th are taken as a group of data, and so on.
[0056] In the present application, the gray data is obtained by processing the color radar image, and the intensity of the radar echo represented by the gray data value is used to represent the rainfall, and the flood disaster is warned by predicting the rainfall; at the same time, the U-net variant neural network model is specially designed, the radar image of the flood area is adaptively denoised by using adaptive wavelet transform, the performance of the U-net variant neural network model is improved by using the denoised radar image and the attention mechanism, the rainfall in a certain time in the future can be accurately predicted, the present application can capture the nonlinear events in the flood disaster warning, thereby improving the accuracy of the flood disaster warning. The performance of the U-net variant neural network is analyzed, and the trained U-net variant neural network model is further optimized according to the performance analysis result, which can improve the accuracy of the flood disaster warning. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1The flowchart of the present application. DETAILED DESCRIPTION
[0058] The present application will be described in detail below in conjunction with the accompanying drawings and examples:
[0059] As shown in the figure, the flood disaster early warning method based on the radar image U-net variant neural network of the present application comprises the following steps: Figure 1
[0060] A: Obtain the color radar picture of the monitoring area and convert it into a gray picture represented by pixel values, and then establish a training data set and a test data set according to the obtained gray picture;
[0061] In the present application, the obtained color radar picture of the monitoring area is converted into a gray picture represented by pixel values according to the color chart, and the value of each pixel in the gray picture represents the radar echo intensity of the point. Then the converted gray picture is divided into an effective training data set and a test data set according to every 15 pictures as a group;
[0062] Step A comprises the following specific steps:
[0063] A1: Obtain the color radar picture of the monitoring area, and read the color radar picture into a four-dimensional array according to the serial number; the four-dimensional array contains the number of pictures, the size of the picture pixels and the number of channels;
[0064] The flood disaster early warning is a short-term early warning, and the frequency of domestic radar detection is generally once every 6 minutes. In order to ensure the accuracy of the flood disaster early warning, the rainfall of the radar image in the future 90 minutes is predicted in the present embodiment. For this purpose, the generation time is used as the serial number of the color radar picture, and 15 color time sequence pictures sorted in ascending order according to the serial number are packaged as a group of color time sequence pictures, and the time interval between the adjacent two color radar pictures is 6 minutes, which is used for predicting the radar image in the future 90 minutes. The detection area of all color radar pictures in each group of color time sequence pictures is the same, and each color radar picture represents a three-dimensional array with a shape of [1024, 1012, 3], wherein 1024, 1012 represent the size of the color radar picture as 1024 pixels*1012 pixels, and 3 represents the number of channels of the color radar picture; each group of color time sequence pictures represents a four-dimensional array dataList0 with a shape of [15, 1024, 1012, 3], wherein 15 represents the number of pictures of the group of color time sequence pictures, 1024, 1012 represent the size of the color radar picture as 1024 pixels*1012 pixels, and 3 represents the number of channels of each color radar picture;
[0065] A2: traversing the four-dimensional array dataList0 obtained in step A1, converting the color data in the four-dimensional array dataList0 into gray scale data according to the color chart, and finally obtaining a gray scale time sequence picture; the numerical value of the gray scale data represents the intensity of the radar echo.
[0066] For flood disaster early warning, the application only needs to predict the rainfall in the detection area, and in the radar image, the radar echo intensity refers to the reflectivity of the water vapor in the detection area, which can represent the rainfall in the target area. Therefore, in the application, the radar echo intensity is used to predict the rainfall in the detection area.
[0067] In this embodiment, the four-dimensional array dataList0 with a shape of [15, 1024, 1012, 3] is traversed, and the data in dataList0 is transformed according to the rule (r, g, b) -> x in the color chart. The gray scale time sequence picture obtained after traversal represents a three-dimensional array dataList1 with a shape of [15, 1024, 1012].
[0068] Among them, the color chart is a mapping table from color pixels to radar echo intensity, and for any color pixel (r, g, b) in dataList0, there is a unique radar echo intensity value x.
[0069] A3: down-sampling the gray scale time sequence picture obtained in step A2 to obtain a down-sampled gray scale time sequence picture, so as to meet the input size of the U-net variant neural network model.
[0070] In the gray scale time sequence picture obtained in step A3, about 40% of the area is a blank area, because there is part of the ground in the area monitored by the radar. In order to reduce the influence of the blank area on the final flood disaster early warning effect and improve the efficiency of the flood disaster early warning, the gray scale time sequence picture is down-sampled in this embodiment; the specific method of down-sampling is: traversing the three-dimensional array dataList1, and using a sliding window with a size of 3 pixels*3 pixels to traverse the data in the three-dimensional array dataList1, and taking the arithmetic mean value of the pixel values in the sliding window as the fused pixel value. After processing, the three-dimensional array dataList1 becomes [15, 256, 256]. Among them, 256, 256 represents that the size of the down-sampled gray scale time sequence picture is 256 pixels*256 pixels.
[0071] A4: The down-sampled gray time sequence pictures obtained in step A3 are sorted in ascending order according to the gray time sequence picture number, and divided into 15 groups of training data, and finally a plurality of groups of training data are obtained. The plurality of groups of training data are divided into a training data set and a test data set. The training data set accounts for 70% of the total training data, and the test data set accounts for 30% of the total training data.
[0072] In step A4, the obtained training data set is randomly input into the U-net variant neural network model for training. When the training data set is divided, the first to the 15th gray time sequence pictures are taken as a group of data, the second to the 16th gray time sequence pictures are taken as a group of data, and so on. The random input form can improve the generalization ability of the U-net variant neural network model, so that the application can be widely used in flood disaster warning on various terrains, and the U-net variant neural network model can better learn the characteristics of the radar pictures in the flood area.
[0073] B: Establishing a U-net variant neural network model;
[0074] The U-net variant neural network model comprises a wavelet adaptive denoising layer and a U-shaped structure; wherein the U-shaped structure from left to right and from top to bottom is a first cyclic limited step feature extraction layer, a first maximum pooling layer, a second cyclic limited step feature extraction layer, a second maximum pooling layer, a third cyclic limited step feature extraction layer, a third maximum pooling layer, a fourth cyclic limited step feature extraction layer, a fourth maximum pooling layer, a fifth cyclic limited step feature extraction layer, a first upsampling limited step feature enrichment layer, a first attention layer, a first upsampling cyclic limited step feature processing layer, a second upsampling limited step feature processing layer, a second attention layer, a second upsampling cyclic limited step feature processing layer, a third upsampling convolution layer, a third attention layer, a third upsampling cyclic limited step feature processing layer, a fourth upsampling convolution layer, a fourth attention layer, a fourth upsampling cyclic limited step feature processing layer and a first limited step feature output layer;
[0075] The Fourier spectrum analysis result of the gray time sequence picture obtained in the A3 step shows that in the area with complex terrain and dense buildings, there are more bright points in the Fourier spectrum picture. This shows that different terrains and building distribution will generate certain noise to the collected radar echo image, and the noise will cause error to the final flood disaster warning effect. In order to reduce the error, the wavelet adaptive transformation layer is added to the application to denoise the input data. At the same time, the noise caused by specific terrain or specific building distribution is specific, in order to remove the specific noise, the wavelet adaptive transformation layer in the application increases an adaptive threshold, the threshold can be automatically learned by the U-net variant neural network model, and different noise is automatically adapted. This makes our application can be widely used in various terrains and cities. The wavelet adaptive transformation layer carries out two-dimensional wavelet multi-scale decomposition on the input data, obtains scale coefficients of the input data, and then removes all scale coefficients less than the threshold according to the adaptive threshold. The process of removing the corresponding scale coefficients is also the process of denoising. Then the remaining scale coefficients are inversely transformed to obtain the denoised data, and two-dimensional wavelet multi-scale inverse transformation is realized. Finally, the denoised data is transmitted into the first cycle limited step feature extraction layer in the U-shaped structure.
[0076] The two-dimensional wavelet multi-scale decomposition can be realized by the wavedec2 function in python:
[0077] [C,S]=wavedec2(waveletData ab ,2,′coif3′)
[0078] Wherein, C is the scale coefficient of the input data, S is the size of the scale coefficient, waveletData ab is the input data of the wavelet adaptive transformation layer, and also the bth gray photo data in the a group of training data sets, and ′coif3′ is one form of the Coiflet wavelet base function, which specifies that the wavedec2 function will use the Coiflet wavelet as the base function for two-dimensional wavelet multi-scale decomposition.
[0079] The process of selecting adaptive threshold denoising can be realized by the wthcoef2 function in python:
[0080] nc1=wthcoef2(′h′,C,S,P)
[0081] nc2=wthcoef2(′v′,nc1,S,P)
[0082] nc3=wthcoef2(′d′,nc2,S,P)
[0083] Wherein, 'h', 'v', 'd' represent the denoising of each scale coefficient from the horizontal, vertical and diagonal three directions respectively, nc1, nc2, nc3 represent the scale coefficient denoised from the horizontal, vertical and diagonal three directions in turn, P is an adaptive threshold, and the value of the adaptive threshold can be automatically learned by the U-net variant neural network model.
[0084] The process of two-dimensional wavelet multi-scale inverse transform can be realized by the waverec 2 function of python:
[0085] waveletResData ab = waverec2(nc3, S, 'coif3')
[0086] Wherein waveletResData ab represents the output data of the wavelet adaptive transform layer, and is also the data after adaptive denoising of the bth gray photo in the ath training data set, and 'coif3' is one form of Coiflet wavelet basis function, which specifies that the waverec2 function will use Coiflet wavelet as the basis function for two-dimensional wavelet multi-scale inverse transform.
[0087] The first to fifth cycle limited step feature extraction layers in the U-shaped structure are used for twice limited step feature extraction of the input data, and then the output data is transmitted to the corresponding pooling layer; the first to fifth cycle limited step feature extraction layers can better extract the context features of the gray time sequence picture;
[0088] The first to fourth maximum pooling layers in the U-shaped structure are used for dimensionality reduction processing of the data output by the previous cycle limited step feature extraction layer, and then the dimensionality reduction processed data is output to the next cycle limited step feature extraction layer as the input data of the next cycle limited step feature extraction layer; the first to fourth maximum pooling layers can achieve the purposes of reducing redundancy, reducing useless parameters and reducing calculation amount.
[0089] The first up-sampling limited step feature-rich layer in the U-shaped structure is used for inserting values conforming to the characteristics of the original data between the data, so as to achieve the purposes of rich features and data dimensionality increase.
[0090] The first to fourth attention layers in the U-shaped structure are used for finding the data area with higher density of features, so as to improve the efficiency and performance of the U-net variant neural network model, and facilitate the key calculation of the features of the area with larger rainfall in the flood disaster early warning.
[0091] The first to fourth up-sampling cycle limited step feature processing layers in the U-shaped structure are used for realizing the extraction of cycle limited step features, so as to enrich the features and increase the data dimension.
[0092] The second up-sampling in the U-shaped structure defines a step-length feature processing layer, which restores the dimension data reduced in the pooling layer by re-establishing up-sampling.
[0093] The third and fourth up-sampling convolution layers in the U-shaped structure gradually increase the dimension of data and gradually expand the shape of data through up-sampling operation and convolution operation.
[0094] The first step-length feature output layer in the U-shaped structure is located at the most downstream of the U-net variant neural network model, and is used to output data according to a fixed shape.
[0095] In the present application, the cyclic step-length feature extraction layer of each layer in the U-shaped structure first extracts step-length features from the input data, and then performs secondary cyclic feature extraction on the data after step-length feature extraction.
[0096] The method for performing secondary cyclic feature extraction on the step-length feature extraction data is as follows:
[0097]
[0098] inputData k2 =outputData k1
[0099]
[0100] wherein, outputData k1 is a two-dimensional matrix, representing the output data of the first cycle of the kth layer of the U-shaped structure, inputData k1 is a two-dimensional matrix, representing the input data of the first cycle of the kth layer of the U-shaped structure, m k1 and n k1 represent the height and width of inputData k1 , Kernel k1 is a two-dimensional matrix of a fixed size, representing the feature extraction matrix of the first cycle of the kth layer of the U-shaped structure, stride k1 is a set value, representing the step length of the feature extraction matrix of the first cycle of the kth layer of the U-shaped structure in the input data matrix each time; k1 represents the first cycle of the kth layer of the variant neural network model; i, j represent the ith row and jth column of inputData k1 , respectively.
[0101] outputData k , representing the output data of the second cycle of the kth layer in the U-shaped structure, is also the output of the kth layer of the U-shaped structure; inputData k2is a two-dimensional matrix, representing the input data of the second loop of the kth layer of the U-shaped structure, m k2 and n k2 represent the height and width of the input data k2 , Kernel k2 is a two-dimensional matrix of fixed size, representing the feature extraction matrix of the second loop of the kth layer of the U-shaped structure, stride k2 is a set value, representing the step length of the feature extraction matrix of the second loop of the kth layer of the U-shaped structure in the input data matrix each time; k2 represents the second loop of the kth layer of the U-shaped structure;
[0102] C: input the training data set obtained in step A4 into the U-net variant neural network model established in step B for iterative training until the U-net variant neural network model converges to a set loss value, to obtain the trained U-net variant neural network model.
[0103] In the present application, the training data set obtained in step A is first normalized; the normalized data is divided into 15 groups of training data in ascending order of serial number, and the division method is consistent with that in step A4. The divided multiple groups of training data are input into the U-net variant neural network model for iterative training, and the number of training times, learning rate, batch size and loss function are set; after each training is completed, the model parameters of this training are saved to the computer hard disk; when the value of the loss function converges to the set loss value, the training is stopped.
[0104] In the present embodiment, when normalizing, the data interval mapping method can be used to map the value range of the pixel value of the gray image in the training data set obtained in step A to the [0, 1] interval, which can improve the data fitting capability of the U-net variant neural network model and improve the efficiency of the training model. The initial range of the value range of the pixel value of the gray image in the training data set obtained in step A is between 0-75, which can be normalized by dividing all the data in step A by 75, so that the value range of the pixel value of the gray image in the mapped training data set is in the [0, 1] interval.
[0105] The number of training times can be 3000, the learning rate can be 0.00001, the batch size can be 1, and the loss function can be MSE.
[0106] The MSE function is the mean square error, and the calculation method is to calculate the square sum of the distance between the predicted value and the true value, and the formula is:
[0107]
[0108] D represents the range of the two-dimensional matrix of the radar picture, a qand b q These refer to the grayscale values of the actual radar image and the predicted radar image, respectively, where q represents the q-th radar image.
[0109] The loss value can be set to 20%; training stops when the loss function value is less than or equal to 20%.
[0110] D: Input the data from the test dataset in step A into the U-net variant neural network model trained in step C for testing, and obtain radar images of the monitoring area within the next 90 minutes, starting from the acquisition time of the first image in the test dataset;
[0111] Step D includes the following specific steps:
[0112] D1: Take 15 consecutive images from the test dataset. n -data n+14 Input the trained U-net variant neural network model obtained in step C to obtain image data. n Data consists of 15 consecutive grayscale images of the monitoring area within the next 90 minutes, starting from the acquisition time. n+1 -data n+15 .
[0113] D2: Transfer grayscale image data n+1 -data n+15 After inverse normalization, recoloring, and upsampling, 15 consecutive color radar images of the monitoring area were obtained.
[0114] In this embodiment, the grayscale image data n+1 -data n+15 Multiply all values by 75 and round down to get the integer data. Recolor the data. n+1 -data n+15 Each radar echo intensity value x in the dataset is converted into a color radar image according to the rules in the colorimetric chart x->(r,g,b). Here, (r,g,b) represents the color pixel corresponding to the radar echo intensity value, where the grayscale value of the grayscale image represents the radar echo intensity value. Then, a limited-step feature extractor is used for upsampling to obtain a set of 15 color radar images of length 15 with the shape [15,1024,1012,3]. The interval between each color radar image is 6 minutes, and the 15 images represent color radar images of areas within the flooded region within the next 90 minutes, starting from the acquisition time of the first image in the test dataset.
[0115] In this invention, the trained U-net variant neural network model is further optimized using the following method:
[0116] E: Perform quality assessment on the radar images obtained in step D within the future 90 minutes from the time of the first image in the test data set, resulting in performance analysis results for the U-net variant neural network;
[0117] The E step includes the following steps:
[0118] E1: Divide all pixel values in the gray-scale picture obtained in step D1 into predicted positive examples and predicted negative examples according to a set flood disaster threshold. If a pixel value in the gray-scale image is greater than the flood disaster threshold, the pixel value is a predicted positive example. If a pixel value in the gray-scale image is less than the flood disaster threshold, the pixel value is a predicted negative example.
[0119] In this step, the set flood disaster threshold is 45. If a pixel value is greater than or equal to 45, it means that the area represented by the pixel value is likely to have a flood disaster, and the pixel is a predicted positive example. If a pixel value is less than 45, it means that the area represented by the pixel value is unlikely to have a flood disaster, and the pixel is a predicted negative example.
[0120] E2: Convert the color radar picture at the actual time into a gray-scale picture representing radar echo intensity according to a color chart, and process the gray-scale picture according to the steps in E1. Divide all pixel values of the gray-scale picture into predicted positive examples and predicted negative examples according to the set flood disaster threshold.
[0121] E3: Score the gray-scale pictures obtained in steps E1 and E2 for prediction, with scoring indicators including false alarm rate (FAR), missed alarm rate (MAR), and hit rate (POD).
[0122] The false alarm rate refers to the proportion of actual flood-free areas in the total predicted flood areas. The missed alarm rate refers to the proportion of missed alarm areas in the total actual flood areas. The hit rate refers to the proportion of predicted actual flood areas in the total actual flood areas.
[0123] In this step, the false alarm rate is FAR = (y pre -his) / y pre , the missed alarm rate is MAR = (y obs -his) / y obs , and the hit rate is POD = his / y obs .
[0124] y pre represents the pixel value of the predicted positive example area, y obs represents the pixel value of the actual positive example area, and his represents the pixel value of the intersection area of the predicted positive example area and the actual positive example area.
[0125] The lower the values of the false negative rate and the false positive rate and the higher the hit rate represent that the result of the flood prediction is more accurate and the performance of the U-net variant neural network model is better.
[0126] F: Adjust the parameters of the trained U-net variant neural network model in step C according to the performance analysis result obtained in step E, and optimize the trained U-net variant neural network model.
[0127] When adjusting the parameters of the trained U-net variant neural network model:
[0128] If the hit rate in step E is lower than the set hit rate threshold, it means that the model is under-fitting, and re-training by reducing the learning rate in step C can improve the fitting ability of the U-net variant neural network; if the false negative rate in step E is higher than the set false negative rate threshold, it means that the model is over-fitting, and re-training by increasing the value of the batch size in step C can improve the generalization ability of the U-net variant neural network.
[0129] G: Use the color radar picture to perform flood warning according to the optimized U-net variant neural network model.
Claims
1. A flood warning method based on a radar image and a U-net variant neural network, characterized in that: The steps include the following in sequence: A: Obtain a color radar picture of a monitoring area and convert it into a gray picture represented by pixel values of radar echo intensity, and then establish a training data set and a test data set according to the obtained gray picture; B: Establish a U-net variant neural network model; C: Input the training data set obtained in step A into the U-net variant neural network model established in step B for iterative training until the U-net variant neural network model converges to a set loss value, and obtain a trained U-net variant neural network model; D: Put the data of the test data set in step A into the trained U-net variant neural network model in step C for testing, and obtain a radar image of the monitoring area within 90 minutes in the future from the image acquisition time of the first image in the test data set as the starting point; E: Perform quality evaluation on the radar image obtained in step D within 90 minutes in the future from the image acquisition time of the first image in the test data set as the starting point, and obtain performance analysis results of the U-net variant neural network; F: According to the performance analysis results of the U-net variant neural network obtained in step E, adjust the parameters of the trained U-net variant neural network model in step C, and optimize the trained U-net variant neural network model; G: Use the color radar picture to perform flood warning according to the optimized U-net variant neural network model; The U-net variant neural network model comprises a wavelet adaptive denoising layer and a U-shaped structure; The wavelet adaptive transformation layer performs two-dimensional wavelet multi-scale decomposition on the input data to obtain scale coefficients of the input data, and then removes all scale coefficients less than the threshold according to the adaptive threshold; then, the remaining scale coefficients are inverse transformed to obtain denoised data; finally, the denoised data is transmitted to the first cyclic limited step feature extraction layer in the U-shaped structure; The U-shaped structure comprises, from left to right and from top to bottom, the first cyclic limited step feature extraction layer, the first maximum pooling layer, the second cyclic limited step feature extraction layer, the second maximum pooling layer, the third cyclic limited step feature extraction layer, the third maximum pooling layer, the fourth cyclic limited step feature extraction layer, the fourth maximum pooling layer, the fifth cyclic limited step feature extraction layer, the first attention layer, the first up-sampling cyclic limited step feature processing layer, the second up-sampling cyclic limited step feature processing layer, the second attention layer, the third up-sampling cyclic limited step feature processing layer, the third up-sampling convolution layer, the third attention layer, the fourth up-sampling convolution layer, the fourth attention layer, the fourth up-sampling cyclic limited step feature processing layer, and the first limited step feature output layer. 2.The flood warning method based on a radar image-based U-net variant neural network according to claim 1, wherein, The step A comprises the following specific steps: A1: Obtain a color radar picture of a monitoring area, and read the color radar picture into a four-dimensional array dataList0 according to the serial number; the four-dimensional array dataList0 comprises the number of pictures, the size of the picture pixels, and the number of channels; A2: traversing the four-dimensional array dataList0 obtained in step A1, converting color data in the four-dimensional array dataList0 into gray scale data according to a color card, and finally obtaining a gray scale time sequence picture; The numerical value of the gray scale data represents the intensity of the radar echo; A3: downsampling the gray scale time sequence picture obtained in step A2 to obtain a downsampled gray scale time sequence picture; A4: dividing the downsampled gray scale time sequence picture obtained in step A3 into 15 groups of training data in ascending order of the gray scale time sequence picture serial number, and finally obtaining multiple groups of training data; Then the multiple groups of training data are divided into a training data set and a test data set. 3.The radar image based U-net variant neural network flood warning method of claim 1, wherein: The wavelet adaptive transformation layer realizes two-dimensional wavelet multi-scale decomposition through the following function: [C,S] = wavedec2(waveletData ab , 2, ′ coif3 ′ ); where C is each scale coefficient of the input data, S is the size of each scale coefficient, waveletData ab is the input data of the wavelet adaptive transform layer, 'coif3 ′ is one form in the Coiflet wavelet base function; The wavelet adaptive transformation layer realizes adaptive threshold denoising through the following function: nc1 = wthcoef2( ′ h ′ ,C,S,P); nc2=wthcoef2( ′ v ′ ,nc1,S,P); nc3=wthcoef2( ′ d ′ ,nc2,S,P); Wherein, 'h', 'v', 'd' respectively represent denoising of each scale coefficient from horizontal, vertical and diagonal directions, nc1, nc2, nc3 represent each scale coefficient after denoising from horizontal, vertical and diagonal directions in turn, and P is an adaptive threshold value; The wavelet adaptive transformation layer realizes two-dimensional wavelet multi-scale inverse transformation through the following function: waveletResData ab = waverec2( nc3, S, ′ coif3 ′ ); wherein waveletResData ab representing output data of a wavelet adaptive transform layer, 'coif3 ′ is one form of the Coiflet wavelet basis function. 4.The flood warning method based on a radar image-based U-net variant neural network according to claim 1, wherein: The cycle limited step feature extraction layer of each layer first performs limited step feature extraction on the input data, and then performs secondary cycle feature extraction on the data after limited step feature extraction; The method for performing secondary cycle feature extraction on the limited step feature extraction data is as follows: wherein, outputData k1 represents the output data of the first loop of the kth layer of the U-net variant neural network model, inputData k1 represents the input data of the first loop of the kth layer of the U-net variant neural network model, m k1 and n k1 represent the height and width of inputData k1 , Kernel k1 represents the feature extraction matrix of the first loop of the kth layer of the U-net variant neural network model, stride k1 represents the step length of the feature extraction matrix of the first loop of the kth layer of the U-net variant neural network model in the input data matrix each time; k1 represents the first loop of the kth layer of the variant neural network model; i, j represent the ith row and jth column of inputData k1 , respectively. outputData k This represents the output data of the second loop of the k-th layer of the U-net variant neural network model, and is also the output of the k-th layer of the U-net variant neural network; inputData k2 This represents the input data for the second loop of the k-th layer of the U-net variant neural network model, m. k2 and n k2 Indicates inputData k2 Height and width, Kernel k2 The stride represents the feature extraction matrix of the second loop in the k-th layer of the U-net variant neural network model. k2 k1 represents the step size of the feature extraction matrix in the second loop of the k-th layer of the U-net variant neural network model, which moves through the input data matrix each time; k2 represents the second loop of the k-th layer of the variant neural network model. 5.The flood warning method based on a radar image-based U-net variant neural network according to claim 1, characterized in that: In step C, first, the training data set obtained in step A is normalized; the normalized data is divided into 15 groups of training data in ascending order of the serial number; then the multiple groups of divided training data are input into the U-net variant neural network model for iterative training, and the number of training times, the learning rate, the batch size and the loss function are set; after each training is completed, the model parameters of this training are saved; when the value of the loss function converges to the set loss value, the training is stopped; the number of training times is 3000, the learning rate is 0.00001, the batch size is 1, the loss value is 20%, and the loss function is the MSE function; the formula of the MSE function is: where D represents the range of the two-dimensional matrix of the radar pictures, a q and b q represent the gray scale values of the real radar pictures and the predicted radar pictures, respectively, where q represents the qth radar picture. 6.The flood warning method based on a radar image-based U-net variant neural network according to claim 1, wherein, The step D includes the following specific steps: D1 : the consecutive 15 images data n -data n+14 , the trained U-net variant neural network model obtained in the input step C, to obtain the grayscale images data n of the consecutive 15 monitoring areas within the future 90 minutes from the acquisition time of the image data n+1 -data n+15 ; D2: Grayscale picture data n+1 - data n+15 After inverse normalization, recoloring and upsampling, 15 consecutive color radar pictures of the monitored area are obtained.
7. The flood warning method based on a radar image-based U-net variant neural network according to claim 6, characterized in that, The E step includes the following steps: E1: dividing all pixel values in the gray scale picture obtained in step D1 into predicted positive examples and predicted negative examples according to a set flood disaster threshold value, if a pixel value in the gray scale image is greater than the flood disaster threshold value, the pixel value is a predicted positive example; if a pixel value in the gray scale image is less than the flood disaster threshold value, the pixel value is a predicted negative example; E2: converting a color radar picture at an actual time into a gray scale picture representing the intensity of the radar echo according to a color card, and processing the gray scale picture according to the steps in E1, dividing all pixel values of the gray scale picture into predicted positive examples and predicted negative examples according to a set flood disaster threshold value; E3: Score prediction is performed on the gray scale pictures obtained in step E1 and step E2, and the score indicators are divided into false alarm rate, missed alarm rate and hit rate; the false alarm rate refers to the proportion of the actual non-flooded area in the total predicted flooded area in the disaster area, the missed alarm rate refers to the proportion of the missed alarm area in the actual flooded area, and the hit rate refers to the proportion of the predicted actual flooded area in the total actual flooded area; The calculation formula of the false alarm rate is FAR=(y pre -his) / y pre , the calculation formula of the missed alarm rate is MAR=(y obs -his) / y obs , and the calculation formula of the hit rate is POD=his / y obs ; where y pre represents a pixel value of a region predicted as a positive example, y obs represents a pixel value of a region actually as a positive example, his represents a pixel value of a region of a boundary between a region predicted as a positive example and a region actually as a positive example.
8. The flood warning method based on a radar image-based U-net variant neural network according to claim 7, characterized in that: In step F, when adjusting the parameters of the trained U-net variant neural network model, if the hit rate in step E is lower than the set hit rate threshold, the learning rate in the model parameters is reduced for retraining; if the missed alarm rate in step E is higher than the set missed alarm rate threshold, the value of batch size in the model parameters is increased for retraining.
9. The flood warning method based on the radar image U-net variant neural network according to claim 2, characterized in that: In step A1, the generation time is taken as the serial number of the color radar picture, and 15 color time sequence pictures sorted in ascending order according to the serial number are packaged as a group of color time sequence pictures, the detection areas of all color radar pictures in each group of color time sequence pictures are the same, and each color radar picture represents a three-dimensional array with a shape of [1024, 1012, 3]; each group of color time sequence pictures represents a four-dimensional array dataList0 with a shape of [15, 1024, 1012, 3]; In step A2, the four-dimensional array dataList0 with a shape of [15, 1024, 1012, 3] is traversed, and the data in dataList0 is transformed according to the rule (r, g, b) -> x in the colorimetric card, and the gray scale time sequence picture obtained after traversal represents a three-dimensional array dataList1 with a shape of [15, 1024, 1012]; In step A3, when downsampling, the three-dimensional array dataList1 is traversed, and the data in the three-dimensional array dataList1 is traversed using a sliding window with a size of 3 pixels*3 pixels, and the arithmetic mean value of the pixel values in the sliding window is taken as the fused pixel value; after processing, the three-dimensional array dataList1 changes to [15, 256, 256], wherein 256, 256 represents the size of the downsampled gray scale time sequence picture as 256 pixels*256 pixels; In step A4, when dividing the training data set, the first to 15th gray scale time sequence pictures are taken as a group of data, the second to 16th gray scale time sequence pictures are taken as a group of data, and so on.
Citation Information
Patent Citations
Flood detection method based on satellite remote sensing image
CN113591714A
SAR image denoising method based on wavelet transform and generative adversarial network
CN113808042A