Urban floodwater depth generative monitoring and early warning method and system
Patent Information
- Application Number
- CN202611507339.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]本发明提供了一种城市洪涝积水深度生成式监测预警方法及系统,解决了现有的城市洪涝监测预警方法过度依赖摄像机内外参标定,无法实现广域开放场景下积水深度的绝对物理尺度映射与量化计算的技术问题
本发明上述方案提供了一种城市洪涝积水深度生成式监测预警方法,本发明获取多源无约束视角洪涝真实图像集并采用拉格朗日插值函数和标注工具根据空间透视变换矩阵对其进行数据处理输出洪涝专项数据集,为后续模型微调提供面向复杂开放场景的训练样本,随后采用洪涝专项数据集对预训练的分割一切模型进行参数高效微调输出训练收敛后的图像分割模型,为残缺轮胎的精准分割提供泛化能力强的特征提取工具,进而在相机端侧边缘计算芯片上采用该模型对多个时刻的待测洪涝图像进行推理分割得到各个时刻的残缺轮胎二值化掩膜,并根据各个时刻的残缺轮胎二值化掩膜进行几何重构与深度计算输出多个时刻的积水深度绝对物理值,其中空间透视变换矩阵用于对多源无约束视角图像进行透视畸变消除以还原正视平面的几何关系,几何重构用于从残缺轮胎二值化掩膜中反演几何参数并完成深度量化,整个积水深度计算链路仅依托图像层面的透视变换与掩膜几何重构即可完成,无需引入摄像机内外参标定数据,最终在相机端侧边缘计算芯片上根据多个时刻的积水深度绝对物理值与预设危险水位阈值进行残差解耦时序预测与超前动态预警,输出未来时段水位演化预测曲线、超前动态预警信号与预计溢出剩余时间,能够彻底摆脱传统视觉监测方案对摄像机内外参标定的依赖,在任意开放路段、多变视角下自适应完成积水深度的绝对物理尺度映射与量化计算,实现广域开放场景下的免标定积水深度监测。
Smart Images

Figure CN123016362A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban flood disaster prevention and dynamic early warning technology, and in particular to a method and system for generating monitoring and early warning of urban flood water depth. Background Technology
[0002] In the field of urban flood control and dynamic early warning, a crucial technical challenge is how to achieve universal and high-precision automatic quantitative calculation of water depth in complex open scenarios lacking camera calibration parameters and static physical scales, and how to overcome the lag of "fixed-value alarms" to achieve proactive early warning of future water evolution trends. Real-world flood scenarios are often accompanied by complex environmental noise such as strong water surface reflections, high turbidity water bodies, and severely obstructed reference objects, and require processing multi-source visual device data with varying internal and external parameters. At the same time, the formation of urban flooding is a highly complex dynamic evolution process. How to overcome the generalization bottleneck of visual recognition and establish reliable pixel-physical scale mapping under variable scenarios and strong physical interference, and how to achieve advanced and rapid on-site dynamic early warning, are the core issues that urgently need to be solved.
[0003] Existing urban flood monitoring and early warning methods identify the boundary between pre-set static physical references (such as rulers or warning posts) and the water surface in images. Combined with pre-acquired camera intrinsic and extrinsic calibration parameters and relevant environmental parameters, the water depth is derived through perspective transformation and geometric conversion. The accuracy and usability of this approach are entirely dependent on the existence of static references of known physical dimensions and corresponding camera calibration parameters in the scene. However, the deployment of static references is limited by cost and maintenance conditions, covering only a few fixed road sections. Furthermore, multi-source crowdsourced images generally suffer from variations in the focal length, pitch angle, and installation height of the shooting equipment. This results in a lack of static anchor points that can serve as scale benchmarks in the image, and the inability to obtain corresponding camera intrinsic and extrinsic calibration data, making the visual depth measurement mechanism highly susceptible to failure. Therefore, the above method relies excessively on camera intrinsic and extrinsic calibration and cannot achieve absolute physical scale mapping and quantitative calculation of water depth in wide-area open scenes. Summary of the Invention
[0004] This invention provides a generative monitoring and early warning method and system for urban flood water depth, which solves the technical problem that existing urban flood monitoring and early warning methods rely too much on camera intrinsic and extrinsic parameter calibration and cannot achieve absolute physical scale mapping and quantitative calculation of water depth in wide-area open scenarios.
[0005] The first aspect of this invention provides a method for generating monitoring and early warning of urban floodwater depth, comprising: A multi-source, unconstrained perspective real-world flood image set was acquired, and the Lagrange interpolation function and annotation tools were used to process the data based on the spatial perspective transformation matrix, outputting a flood-specific dataset, including: Using distributed web crawler technology, a multi-dimensional keyword retrieval strategy based on scene and disaster semantic generalization search terms and physical feature coupled precise search terms was adopted to crawl multi-source unconstrained perspective flood real images containing car tires from social network platforms, resulting in a multi-source unconstrained perspective flood real image set. The spatial perspective transformation matrix and the Lagrange interpolation function are used to perform perspective distortion elimination and pixel missing repair on the multi-source unconstrained viewpoint flood real image set, and output the orthorectified frontal plane image set. The polygonal edges of the damaged tires exposed above the water surface in the orthorectified frontal plane image are annotated using a labeling tool and converted into a binary mask to obtain multiple image mask pairs. Perform geometric and color transformations on multiple image mask pairs to output a flood-specific dataset; The parameters of the pre-trained image segmentation model are efficiently fine-tuned using the flood-specific dataset, and the converged image segmentation model is output. On the edge computing chip at the camera end, the image segmentation model after training convergence is used to perform inference segmentation on the flood images to be tested at multiple times, to obtain the incomplete tire binarization mask at each time, and to perform geometric reconstruction and depth calculation based on the incomplete tire binarization mask at each time, and output the absolute physical value of the water depth at multiple times. On the edge computing chip at the camera end, residual decoupling time-series prediction and advanced dynamic early warning are performed based on the absolute physical values of water depth at multiple times and preset dangerous water level thresholds, and the prediction curve of water level evolution in future time periods, advanced dynamic early warning signals and estimated remaining overflow time are output.
[0006] Optionally, the step of efficiently fine-tuning the parameters of the pre-trained image segmentation model using the flood-specific dataset to output the converged image segmentation model includes: The pre-trained segmentation model is fine-tuned in terms of structure configuration. The weights of the cue encoder and mask decoder of the pre-trained segmentation model are frozen. A bypass low-rank decomposition matrix is injected only into the visual transformer image encoder block of the pre-trained segmentation model to obtain the segmentation model after structure configuration. The pre-trained weights of the all-segmentation model after the structure configuration are quantized and compressed to obtain the all-segmentation model to be fine-tuned; The flood-specific dataset is used to perform forward propagation inference on the segmentation model to be fine-tuned, and the predicted binary mask is output. A weighted combined loss value is obtained by performing joint loss calculation on the predicted binarized mask and the real binarized mask labels in the flood-specific dataset. The weighted combined loss value is used for backpropagation to update the parameters of the side path low-rank decomposition matrix in the image segmentation model to be fine-tuned, and the image segmentation model after training convergence is output.
[0007] Optionally, the step of performing geometric reconstruction and depth calculation based on the binary mask of the damaged tire at each time moment, and outputting the absolute physical values of the water depth at multiple time moments, includes: Noise-resistant feature points are extracted from the binary mask of the incomplete tire at each time point, and multiple key feature points and water surface tangent height are output at each time point. Perform complete geometric contour inversion and reconstruction on multiple key feature points at each time point, and output the reconstructed tire pixel radius and center coordinates at each time point; The reconstructed tire pixel radius, center coordinates, water surface tangent height, and preset real physical diameter of passenger car tires at each time point are subjected to physical scale transformation and water depth calculation, and the absolute physical values of water depth at multiple time points are output.
[0008] Optionally, the step of performing residual decoupling time-series prediction and advanced dynamic early warning based on the absolute physical values of water depth at multiple times and a preset dangerous water level threshold, and outputting a water level evolution prediction curve for future periods, an advanced dynamic early warning signal, and the estimated remaining overflow time, includes: Linear confluence trend parameter estimation and prediction are performed on the absolute physical values of water depth at multiple times, and the linear trend prediction value for future times is output. The time series of fitting residuals in the historical sliding window sequence is obtained by calculating the point-by-point difference between the linear fitting values in the historical sliding window sequence and the absolute physical values of water depth at the corresponding time. The fitted residual time series is modeled and predicted using nonlinear abrupt change residuals, and the predicted nonlinear residual values for future times are output. The nonlinear residual prediction value and the linear trend prediction value at the future time are explicitly algebraically summed to obtain the final accurate prediction value of the water depth at the future time. The final accurate prediction of the water depth at the future time is extrapolated in multiple steps to output the water level evolution prediction curve for the future period. A forward warning determination is made based on the predicted water level evolution curve for the future period; If the future water level evolution prediction curve shows that the future water level is greater than the preset dangerous water level threshold, an advanced dynamic trend warning signal is generated, and the time difference between the moment when the water level in the future water level evolution prediction curve first exceeds the preset dangerous water level threshold and the current moment is determined as the estimated remaining overflow time.
[0009] The second aspect of this invention provides a generational monitoring and early warning system for urban floodwater depth, comprising: The acquisition module is used to acquire a set of real flood images from multiple sources without constraints, and to process the set of real flood images from multiple sources without constraints using the Lagrange interpolation function and annotation tools according to the spatial perspective transformation matrix, and output a flood-specific dataset. The fine-tuning module is used to efficiently fine-tune the parameters of the pre-trained image segmentation model using the flood-specific dataset, and output the image segmentation model after training convergence. The reconstruction and depth calculation module is used on the edge computing chip at the camera end to perform inference segmentation on the flood image to be tested at multiple time points using the image segmentation model after training and convergence, to obtain the incomplete tire binarization mask at each time point, and to perform geometric reconstruction and depth calculation based on the incomplete tire binarization mask at each time point, and output the absolute physical value of the water depth at multiple time points. The prediction and early warning module is used on the edge computing chip at the camera end to perform residual decoupled time-series prediction and advanced dynamic early warning based on the absolute physical values of water depth at multiple times and the preset dangerous water level threshold, and output the water level evolution prediction curve for future time periods, the advanced dynamic early warning signal and the estimated remaining overflow time. The acquisition module is specifically used for: The spatial perspective transformation matrix and the Lagrange interpolation function are used to perform perspective distortion elimination and pixel missing repair on the multi-source unconstrained viewpoint flood real image set, and output the orthorectified frontal plane image set. The polygonal edges of the damaged tires exposed above the water surface in the orthorectified frontal plane image are annotated using a labeling tool and converted into a binary mask to obtain multiple image mask pairs. Perform geometric and color transformations on multiple image mask pairs to output a flood-specific dataset.
[0010] A third aspect of the present invention provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the urban flooding depth generation monitoring and early warning method described above.
[0011] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, it implements the urban flooding depth generation monitoring and early warning method as described above.
[0012] The fifth aspect of the present invention provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein, when the program instructions are executed by a computer, the computer performs the steps of the urban flooding depth generation monitoring and early warning method as described above.
[0013] As can be seen from the above technical solutions, the present invention has the following advantages: The present invention provides a generative monitoring and early warning method for urban flood water depth. This invention acquires a multi-source, unconstrained real-world flood image set and uses a Lagrange interpolation function and annotation tool to process the data based on the spatial perspective transformation matrix, outputting a flood-specific dataset. This dataset provides training samples for subsequent model fine-tuning in complex open scenarios. Subsequently, the flood-specific dataset is used to efficiently fine-tune the parameters of a pre-trained segmentation model, outputting a converged image segmentation model. This model provides a feature extraction tool with strong generalization ability for accurate segmentation of damaged tires. Then, on a camera-side edge computing chip, this model is used to perform inference segmentation on flood images at multiple times, obtaining binary masks of damaged tires at each time. Based on these binary masks, geometric reconstruction and depth calculation are performed to output the absolute physical values of water depth at multiple times. The spatial perspective... The transformation matrix is used to eliminate perspective distortion in multi-source unconstrained viewpoint images to restore the geometric relationship of the frontal plane. The geometric reconstruction is used to invert geometric parameters from the binary mask of the damaged tire and complete the depth quantization. The entire water depth calculation link can be completed by relying only on the perspective transformation and mask geometric reconstruction at the image level, without the need to introduce camera intrinsic and extrinsic parameter calibration data. Finally, the residual decoupling time-series prediction and advanced dynamic warning are performed on the edge computing chip at the camera end based on the absolute physical value of water depth at multiple times and the preset dangerous water level threshold. The prediction curve of water level evolution in the future period, the advanced dynamic warning signal and the estimated remaining overflow time are output. It can completely get rid of the dependence of traditional visual monitoring schemes on camera intrinsic and extrinsic parameter calibration, and adaptively complete the absolute physical scale mapping and quantization calculation of water depth in any open road section and under multiple perspectives, realizing calibration-free water depth monitoring in wide-area open scenarios. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart illustrating the steps of a generative monitoring and early warning method for urban floodwater depth provided in Embodiment 1 of the present invention. Figure 2 A schematic diagram illustrating an image preprocessing example provided in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the model fine-tuning loss variation curve provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the average crossover ratio variation curve for model fine-tuning provided in Embodiment 1 of the present invention; Figure 5 This is an overall flowchart of a method for generating monitoring and early warning of urban flood water depth provided in Embodiment 1 of the present invention; Figure 6 This is a structural block diagram of an urban flood water depth generation monitoring and early warning system provided in Embodiment 2 of the present invention. Detailed Implementation
[0016] This invention provides a generative monitoring and early warning method and system for urban flood water depth, which solves the technical problem that existing urban flood monitoring and early warning methods rely too much on camera intrinsic and extrinsic parameter calibration and cannot achieve absolute physical scale mapping and quantitative calculation of water depth in wide-area open scenarios.
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that in the optional embodiments of the present invention, the object information and other related data involved require the permission or consent of the object when the embodiments of the present invention are applied to specific products or technologies, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. That is to say, if the embodiments of the present invention involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of relevant departments, and in compliance with relevant laws, regulations, and standards. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required, and the embodiments also need to be implemented with the authorization and consent of the object.
[0018] Please see Figure 1 , Figure 1 The flowchart illustrates the steps of a method for generating monitoring and early warning of urban flood water depth according to Embodiment 1 of the present invention.
[0019] This invention provides a method for generating monitoring and early warning of urban floodwater depth, comprising: Step 101: Obtain a set of real flood images from multiple sources without constraints, and use the Lagrange interpolation function and annotation tools to process the data of the real flood images from multiple sources without constraints based on the spatial perspective transformation matrix, and output a flood-specific dataset.
[0020] It should be noted that the multi-source, unconstrained perspective flood image set specifically includes real urban flood scene images obtained from various channels such as social media platforms and online crowdsourced images. These images contain vehicles in floodwaters and their tires protruding from the water. The shooting devices include various types such as mobile phones and surveillance cameras, and the shooting angles and focal lengths are not pre-calibrated or controlled. The images are accompanied by complex environmental noise such as water surface reflections, high turbidity water, and partial obstruction by reference objects. This image set was obtained through distributed web crawling technology. Based on a multi-dimensional keyword retrieval strategy consisting of scene and disaster semantic generalization search terms and physical feature coupled precise search terms, real flood images containing car tires were automatically crawled from social network platforms. After initial screening and removal of substandard images... Images with low resolution, repetition, and no vehicles involved in flooding were obtained. Subsequently, a spatial perspective transformation matrix was used to eliminate perspective distortion in the images. A rotational affine matrix was constructed by calculating the average angle between the calibration lines in the image and the vertical direction. A spatial perspective transformation matrix that fuses the intrinsic parameter matrix and distortion coefficients was defined, and the true two-dimensional mapping of the frontal plane was solved using homogeneous coordinates. The pixel loss caused by the correction was repaired using the Lagrange interpolation function to obtain the orthorectified frontal plane image. Then, a labeling tool was used to annotate the polygonal edges of the damaged tires exposed above the water in the orthorectified frontal plane image and convert them into a binary mask. Geometric and color transformations were performed on the generated image-mask pairs to finally form a flood-specific dataset.
[0021] Further, step 101 may include the following sub-steps: S11. Using distributed web crawler technology, based on a multi-dimensional keyword retrieval strategy consisting of scene and disaster semantic generalization search terms and physical feature coupled precise search terms, crawl multi-source unconstrained perspective flood real images containing car tires from social network platforms to obtain a multi-source unconstrained perspective flood real image set. S12. Using spatial perspective transformation matrix and Lagrange interpolation function, perspective distortion elimination and pixel missing repair are performed on the multi-source unconstrained viewpoint flood real image set, and the orthorectified frontal plane image set is output. S13. Using annotation tools, polygonal edges are annotated on the damaged tires exposed above the water surface in the orthorectified frontal plane image, and then converted into a binary mask to obtain multiple image mask pairs. S14. Perform geometric and color transformations on multiple image mask pairs and output a flood-specific dataset.
[0022] It should be noted that this step aims to eliminate spatial geometric distortions in online crowdsourced images and build a training sample library with strong physical robustness, providing high-quality data input for fine-tuning large models.
[0023] Specifically, to overcome the spatial barriers and high costs of traditional physical sensor networks in data acquisition, and to achieve wide-area, low-cost dynamic disaster coverage using crowdsourced image data from social media, this invention selects widely available car tires in cities as the core dynamic benchmark for calculating water depth. Its standard physical diameter is approximately 65cm, providing objective stability. Utilizing distributed web crawling technology, a multi-dimensional keyword retrieval strategy is employed to crawl flood-related images from social network platforms. This strategy combines two approaches: a generalized retrieval based on scene and disaster semantics (e.g., "street scene of urban flooding during heavy rain") and a precise retrieval based on physical feature coupling (e.g., "vehicle water depth tires"). This dual strategy allows for the acquisition of massive amounts of unconstrained, real-world flood images from multiple social media platforms.
[0024] Furthermore, addressing the perspective distortion problem caused by the vast differences in shooting equipment, focal length, and tilt angle in multi-source crowdsourced images, this invention implements image orthorectification preprocessing to ensure that the same type of reference object restores its true physical proportions in different images, laying a reliable two-dimensional projection foundation for subsequent high-precision calibration-free geometric reconstruction. First, the average angle between the calibration lines and the vertical direction in the image is calculated to construct a rotational affine matrix. For residual perspective distortion, a spatial perspective transformation matrix A, fusing the intrinsic parameter matrix and distortion coefficients, is defined, and its mathematical derivation is as follows: ; Solving for the true two-dimensional mapping of the frontal plane using homogeneous coordinates : ; ; In the formula, , , , , , , , , The nine matrix elements of the spatial perspective transformation matrix A incorporate the parameter information of the camera intrinsic matrix and the lens distortion coefficient, which together constitute the perspective transformation mapping relationship from the pixel coordinates of the original distorted image to the coordinates of the frontal plane. The first and second row elements control the linear weighted components of the horizontal and vertical coordinates of the corrected image, respectively, and the third row elements control the homogeneous normalization component of the perspective transformation. , , , , , , , The elements of the spatial perspective transformation matrix A are obtained by passing through the third row and third column. The simplified perspective transformation coefficients obtained after normalization, where , , ,and ; , , Constructing the corrected x-axis The linear weighting term of the molecule, , , Constructing the corrected ordinate The linear weighting term of the molecule, , Together with the constant term 1, it forms the denominator normalization term of the perspective transformation, which reflects the nonlinear normalization effect of near objects appearing larger and far objects appearing smaller in perspective projection. As a whole, it is used to simplify the perspective transformation formula into a form where the denominator is normalized to 1, making it easier to directly calculate the pixel coordinates of the corrected frontal plane image. Represents the pixel coordinates of the original distorted image. These are the pixel coordinates of the corrected frontal plane image. For any missing pixels resulting from the correction, Lagrange interpolation is used for repair.
[0025] Furthermore, to overcome the overfitting problem inherent in deep learning models and to artificially simulate complex noises in real-world extreme flood environments, such as raindrop obstruction and low visibility at night, thereby improving the model's generalization ability and robustness against interference under severe weather conditions from the data source, this invention utilizes the LabelMe tool (an open-source image annotation tool) to annotate the polygonal edges of exposed damaged tires in images and converts them into binary masks. Subsequently, geometric and color transformations are performed on the generated image-mask pairs, including adding Gaussian noise, random point occlusion, and dynamic brightness adjustment, to form a final flood-specific dataset rich in features.
[0026] In this embodiment, distributed web crawling technology is first used to crawl multi-source, unconstrained perspective flood images containing car tires from social network platforms. Based on a multi-dimensional keyword retrieval strategy consisting of scene and disaster semantic generalization search terms and physical feature coupled precise search terms, car tires, which are widely present in cities and have a standard physical diameter of approximately 65cm, are selected as the core dynamic benchmark for calculating water depth. After initial screening to remove images with low resolution, duplicates, and vehicles without wading, a multi-source, unconstrained perspective flood image set is obtained. Then, addressing the perspective distortion problem caused by the significant differences in shooting equipment, focal length, and pitch angle in the multi-source crowdsourced images, the average angle of deviation of the calibration line from the vertical direction in the image is first calculated to construct a rotational affine matrix. Then, a spatial perspective transformation matrix A is defined to fuse the intrinsic parameter matrix and distortion coefficients. The pixel coordinates of the original distorted image are then transformed using matrix multiplication. Intermediate transformation results converted to homogeneous coordinate form And use homogeneous coordinate normalization to solve for the true two-dimensional mapping of the frontal plane. For pixel defects caused by the correction, the Lagrange interpolation function is used to repair them, and the orthorectified frontal plane image set is output. Then, the annotation tool is used to annotate the broken tires exposed above the water surface in the orthorectified frontal plane image set with polygon edges. The vertices are marked point by point along the visible contour of the broken tires and connected to form closed polygon regions. The pixels in the annotated regions are assigned the target values and the pixels outside the regions are assigned the background values to convert them into binary masks, resulting in multiple image-mask pairs. Finally, geometric transformations and color transformations are performed on multiple image-mask pairs, including horizontal flipping, adding Gaussian noise, random point occlusion, and dynamic brightness adjustment, to artificially simulate the complex noise in the real extreme flood environment to improve the model's generalization ability under severe weather conditions, and finally form a flood-specific dataset.
[0027] Step 102: Use the flood-specific dataset to efficiently fine-tune the parameters of the pre-trained image segmentation model and output the image segmentation model after training convergence.
[0028] It should be noted that, firstly, the pre-trained Segment Anything model undergoes fine-tuning of its structure configuration. All weights of the cue encoder and mask decoder are frozen, and a side-channel low-rank decomposition matrix is injected only into the image encoder block of the visual transformer, resulting in the structured Segment Anything model. Subsequently, the pre-trained weights of the structured Segment Anything model are quantized and compressed using 4-bit NormalFloat, reducing the pre-trained weights from 16-bit to 4-bit NormalFloat, resulting in the Segment Anything model to be fine-tuned, i.e., the QLoRA-SAM model (a Segment Anything model employing a quantized low-rank adaptive fine-tuning strategy). Next, using the flood-specific dataset, the image segmentation model to be fine-tuned is forward propagated to obtain a predicted binary mask by inputting images from the flood-specific dataset into the model. Then, the joint loss is calculated between the predicted binary mask and the real binary mask labels from the flood-specific dataset. A weighted combination of the binary cross-entropy loss function and the Dice loss function is used to measure the difference between the predicted mask and the real mask, resulting in a weighted combined loss value. Finally, the weighted combined loss value is used for backpropagation to update the parameters of the side path low-rank decomposition matrix in the image segmentation model to be fine-tuned. Through multiple rounds of iterative training until the loss value tends to stabilize, the image segmentation model after training convergence is output.
[0029] Furthermore, step 102 may include the following sub-steps: S21. Fine-tune the structure configuration of the pre-trained segmentation model, freeze the weights of the cue encoder and mask decoder of the pre-trained segmentation model, and inject the side-channel low-rank decomposition matrix only into the visual transformer image encoder block of the pre-trained segmentation model to obtain the segmentation model after structure configuration. S22. Quantize and compress the pre-trained weights of the all-segmentation model after structural configuration to obtain the all-segmentation model to be fine-tuned. S23. Using the flood-specific dataset, perform forward propagation inference on the segmentation model to be fine-tuned and output a predicted binary mask. S24. Perform joint loss calculation on the predicted binarized mask and the real binarized mask labels in the flood-specific dataset to obtain the weighted combined loss value; S25. Use the weighted combination loss value for backpropagation to update the parameters of the side path low-rank decomposition matrix in the segmentation model to be fine-tuned, and output the image segmentation model after training convergence.
[0030] It should be noted that this step is responsible for driving the evolution of pixel states, transforming discrete RGB (Red Green Blue) pixels into a binary feature mask that represents the physical form of the target.
[0031] Specifically, this invention selects the Segment Anything Model (SAM) as its basic architecture. Since the core image encoder of the SAM model is based on the parameter-intensive Vision Transformer (ViT), direct full-parameter fine-tuning would destroy its general feature extraction capabilities. This invention introduces a Parameter-Efficient Fine-Tuning (PEFT) strategy, specifically employing Quantized Low-Rank Adaptation (QLoRA) to freeze all weights of the SAM's cue encoder and mask decoder, injecting a bypass network only into the ViT block. The pre-trained weights are compressed from 16-bit to 4-bit Normal Float (NF4). Let the pre-trained quantized weight matrix be... The forward propagation formula is defined as: ; In the formula, Y The output features of the model forward propagation are the feature representations obtained after the images in the flood-specific dataset are processed by the image encoder of the visual transformer of the segmentation model. These features are used by the subsequent mask decoder to generate the prediction binarization mask. XThe features of the image encoder input to the visual transformer, namely the input feature sequence obtained by image patch embedding and position encoding of images in the flood-specific dataset, are the input quantities of the forward propagation formula; The pre-trained weight matrix is compressed by 4-bit NormalFloat quantization. It is obtained by quantizing the original 16-bit floating-point pre-trained weights and is kept frozen and not updated during fine-tuning. It constitutes the main path weights of the model's forward propagation. It is the lower projection matrix of the low-rank decomposition, which maps the input features from the original high-dimensional space to the low-rank space. It is a component of the bypass low-rank decomposition matrix, and its parameters are updated during the fine-tuning process to adapt to the flood scenario. It is the upper projection matrix of the low-rank decomposition, which maps the low-rank space features back to the original output dimension. It is a component of the bypass low-rank decomposition matrix, and its parameters are updated during fine-tuning to adapt to the flood scenario. and For a low-rank decomposition matrix, the rank is... r Set to 8; d This refers to the dimension of the forward propagation output features, i.e., the number of channels of the output features of the visual transformer image encoder; k The dimension of the input features, i.e., the number of channels of the input features of the visual transformer image encoder; for d OK k The space of real matrices in the column; for r OK k The space of real matrices in the column; for d OK r The space of real matrices in the column; scale This is the scaling factor for the low-rank bypass. Updated during fine-tuning. and The parameters allow the model to retain its original spatial awareness while accurately adapting to the complex water body edge textures in urban flooding.
[0032] Furthermore, during the fine-tuning process, a weighted combination of binary cross-entropy (BCE) and Dice loss is employed to balance the accuracy of global classification with the morphological integrity of the incomplete target. ; BCE loss is applied to independent classification of single pixels, ensuring statistical separation between the background (water surface, road) and the target (tire): ; Because water accumulation areas and tire pixels often exhibit extreme class imbalance, simple BCE (Browser-Equal-Cut) is easily dominated by the background. The introduced Dice loss addresses this issue by optimizing the Intersection over Union (IoU) between the predicted and ground truth regions. ; Even if the tire has only a few dozen missing pixels in the image, the Dice loss can still generate a sufficiently strong gradient signal to guide the adapter to fit the missing contour edges.
[0033] In the above formula, L This is the joint loss value; These are the weighting coefficients for the binary cross-entropy loss; These are the weighting coefficients for the Dice loss; This represents the binary cross-entropy loss value. This represents the Dice loss value. For the first i The predicted probability of each pixel; For the first i The real label of each pixel; N The total number of pixels involved in the loss calculation; is the smoothing factor, and is a very small positive constant.
[0034] In this embodiment, the pre-trained "Segment All" model is first fine-tuned in terms of its structural configuration. Since the core image encoder of the "Segment All" model is based on a visual transformer with a large number of parameters, direct full-parameter fine-tuning would destroy its general feature extraction capability. Therefore, all weights of the cue encoder and mask decoder of the "Segment All" model are frozen, and only a bypass low-rank decomposition matrix is injected into the image encoder block of the visual transformer, resulting in the "Segment All" model with the configured structure. Subsequently, the pre-trained weights of the configured "Segment All" model are compressed using 4-bit NormalFloat quantization, reducing the pre-trained weights from 16-bit to 4-bit NormalFloat. Let the pre-trained quantized weight matrix be... This yields a segmentation model to be fine-tuned. Then, a flood-specific dataset is used to perform forward propagation inference on this model. The images in the flood-specific dataset are processed through image patch embedding and position encoding to obtain the input features. X Through the forward propagation formula Calculate the output features Y Output features Y The predicted binarized mask is obtained after decoding by the mask decoder; then, the joint loss is calculated between the predicted binarized mask and the real binarized mask labels in the flood-specific dataset. The weighted combination form, where the binary cross-entropy loss For single-pixel independent classification to ensure statistical separation of background and target, the Dice loss is used. By optimizing the intersection-union ratio (IoU) to address the extreme class imbalance between the water accumulation area and tire pixels, a weighted combined loss value is obtained. Finally, this weighted combined loss value is used for backpropagation to update the bypass low-rank decomposition matrix in the segmentation model to be fine-tuned. and The parameters are trained through multiple rounds of iteration until the loss value stabilizes, so that the model retains its original spatial perception and can accurately adapt to the complex water body edge texture in urban flooding, and outputs the image segmentation model after training convergence.
[0035] Step 103: On the edge computing chip at the camera end, the trained and converged image segmentation model is used to perform inference segmentation on the flood images to be tested at multiple times, to obtain the incomplete tire binarized mask at each time, and to perform geometric reconstruction and depth calculation based on the incomplete tire binarized mask at each time, and output the absolute physical value of the water depth at multiple times.
[0036] It should be noted that on the edge computing chip at the camera end, the trained and converged image segmentation model is first used to perform inference segmentation on the flood images to be measured at multiple time points. The flood images to be measured at each time point are input into the model, and after forward propagation, the incomplete tire binarized masks for each time point are output. Pixel-level mask generation is completed by relying on the local computing power of the edge computing chip, without the need to send the original flood images back to the backend, which reduces the data transmission bandwidth pressure and avoids the impact of network latency on the real-time monitoring. Subsequently, noise-resistant feature points are extracted from the incomplete tire binarized masks at each time point. The outer contour pixel set of the mask at each time point is extracted, and the bottom edge of the mask is defined as the water surface tangent height. After removing non-curved interference points, the vertices and left and right boundary points at each time point are extracted to obtain the key feature points and water surface tangent height at each time point. Then, the key feature points at each time point are geometrically reconstructed. An arc geometry model is introduced to calculate the effective chord length and arc height, based on the perpendicular bisector theorem and... The Pythagorean theorem is used to derive the analytical formula for the tire's pixel radius at each moment. A vertical midline alignment constraint is introduced to determine the center coordinates at each moment, resulting in the reconstructed tire pixel radius and center coordinates at each moment. The feature point extraction and geometric reconstruction described above are both lightweight algebraic operations that can be quickly completed on the edge computing chip. Finally, depth calculations are performed on the tire pixel radius, center coordinates, water surface tangent height, and the preset real physical diameter of the passenger car tire at each moment. A scaling factor is defined using the ratio of the real physical diameter of the tire to the pixel diameter to determine the theoretical bottom height and the water surface observation height. The water depth at each moment is calculated using the physical inversion formula for water depth and the maximum value of multiple targets is extracted. The absolute physical values of water depth at multiple moments are output. The entire chain calculation from image input to depth output is completed in a closed loop on the edge computing chip at the camera end. It can still independently output monitoring results under extreme conditions such as network outages, while avoiding the privacy leakage risk caused by the external transmission of the original image.
[0037] Furthermore, step 103 may include the following sub-steps: S31. Extract noise-resistant feature points from the binary mask of the incomplete tire at each time step, and output multiple key feature points and the height of the water surface tangent at each time step. S32. Perform complete geometric contour inversion and reconstruction on multiple key feature points at each time point, and output the reconstructed tire pixel radius and center coordinates at each time point. S33. Perform physical scale transformation and water depth calculation on the reconstructed tire pixel radius, center coordinates, water surface tangent height, and preset real physical diameter of passenger car tire at each time point, and output the absolute physical value of water depth at multiple time points.
[0038] It should be noted that this step is the core engine for achieving the system's "physical interpretability" and "standard-free quantification". Its function is to transform disordered pixel masks into precise geometric references and absolute water depths.
[0039] Specifically, in order to filter out interference from irregular ripples and splashes on the water surface, the most geometrically representative arc feature points are extracted from the incomplete mask to provide reliable parameter input for subsequent mathematical inversion. The system then extracts the set of pixels representing the outer contour. Define the bottom edge of the mask as the height of the tangent to the water surface. Eliminate those that meet the requirements Non-curved interference points, obtain the upper pure arc point set. P arc ,from P arc Extract three topologically representative key feature points: vertex P top The highest point of the tire on the image plane, i.e., the point where the vertical coordinate is at its minimum: ; Left and right boundary points P left , P right The extreme points on the horizontal axis of the arc represent the maximum horizontal span above the water surface. ; in, P The set of pixels representing the outer contour of the binary mask for the damaged tire consists of all pixels in the mask that form the outer boundary of the damaged tire, and is the initial data source for noise-resistant feature point extraction. For the outer contour pixel set, the first i The horizontal and vertical coordinates of each pixel in the image pixel coordinate system; n The total number of pixels in the outer contour pixel set; The maximum value of the ordinate at the bottom edge of the mask, i.e., the tangent height of the water surface, is used to define the tangent position where the water surface intersects the tire, and is the threshold benchmark for eliminating non-curved interference points at the bottom. y = x and y coordinates of the vertex; The x and y coordinates of the left boundary point; represents the x and y coordinates of the right boundary point.
[0040] Furthermore, to address the severe feature loss problem caused by the submersion of the lower half of the target, this invention introduces an arc-shaped geometric model to calculate the effective chord length. w with bow-shaped height h : ; According to the perpendicular bisector theorem and the Pythagorean theorem The analytical formula for the pixel radius of the tire is derived. .
[0041] To prevent ill-conditioned problems caused by significant shifts in the fitted circle center due to complex flood noise, the system utilizes forced physical constraints to correct the ill-conditioned calculations that easily lead to large center drifts caused by free fitting of incomplete arcs, thus stably reproducing the complete target geometry. A vertical centerline alignment constraint is introduced, assuming that the tire's centerline remains vertical in the corrected image, forcing the circle center... C ( x c ,y c At the apex P top On the geometrically perpendicular line, and the x-coordinate is taken as the midpoint of the left and right boundaries to eliminate unilateral noise: ; based on C ( x c ,y c )and R Completely restore the standard circle equation of the damaged tire Complete the lower half of the geometry that is obscured by the accumulated water.
[0042] In the above formula, R The tire pixel radius obtained from the reconstruction, that is, the radius value of the tire in the image pixel coordinate system, is derived by combining the perpendicular bisector theorem and the Pythagorean theorem with the effective chord length and the bow height. It is a key parameter for establishing the mapping from pixel to physical space scale. w The effective chord length, i.e. the horizontal distance between the left and right boundary points, is determined by the difference between the x-coordinates of the right and left boundary points. It is the length of the chord connecting the two ends of the incomplete arc segment in the arc geometric model. h The arc height is the vertical distance from the vertex to the effective chord, determined by the difference between the ordinate of the vertex and the average ordinate of the left and right boundary points. It is the height from the chord to the apex in the arc geometric model. To reconstruct the x-coordinate of the circle's center, the midpoint value between the x-coordinates of the left and right boundary points is taken to eliminate the influence of unilateral noise on the horizontal position of the circle's center. To reconstruct the ordinate of the circle's center, the sum of the vertex's ordinate and the pixel radius is taken, and the circle's center is determined to be on the geometric vertical line of the vertex based on the vertical midline alignment constraint. C ( x c , y c () represents the coordinates of the complete tire center obtained from the reconstruction.
[0043] Furthermore, to overcome the reliance on camera intrinsic and extrinsic parameter calibration and static physical water gauges in traditional measurements, this system achieves cross-domain generalization and direct solution for the absolute depth of accumulated water through a constant prior of a dynamic physical scale. Using standardized physical dimensions as the absolute benchmark, let the actual diameter of a passenger car tire be... D real Approximately 65cm. Defines the actual physical length represented by a unit pixel (scale factor). S : ; Establish two height reference points: theoretical bottom height y bottom = y c + R The water surface observation height is taken as the average of the ordinates of the bottom edge of the mask to avoid errors caused by water surface fluctuations. ; Finally, the physical inversion formula for water depth is: ; To improve system reliability, for multi-target detection in a single image, the algorithm calculates the depth of each target in parallel and extracts the maximum value. As the final output of the water depth diagnosis for this complex scene, it enables accurate tracing from image pixels to physical situation indicators.
[0044] In the above formula, The actual physical diameter of a passenger car tire, a standardized physical size that serves as an absolute benchmark, is approximately 65cm. It is the physical benchmark quantity for establishing the mapping from pixel to physical spatial scale. The theoretical bottom height, i.e., the theoretical ordinate value of the lowest point of the tire in the image pixel coordinate system, is determined by the ordinate of the center of the circle. y c With tire pixel radius R The sum of these points is determined as one of the benchmarks for calculating the depth of accumulated water. The water surface observation height is the observed vertical coordinate value of the actual water surface line in the image pixel coordinate system. The average value of the vertical coordinate of the bottom edge of the mask is taken to avoid water surface fluctuation error. It is the set of ordinate values of the bottom edge of the binary mask of the incomplete tire, that is, the ordinate of each edge point in the mask that intersects with the water surface; The water depth for a single target, i.e. the physical scale water depth value corresponding to a single tire target, is obtained by multiplying the pixel difference between the theoretical bottom height and the observed water surface height by a scaling factor. The final output of multi-object detection in a single image is the water depth, which is the maximum value of the water depth calculated by multiple tire targets in the same frame image. This value is used as the final output water depth diagnostic result for this complex scene. The first to the second detected in a single image n The water depth corresponding to each tire target is the target depth value obtained by parallel calculation. n This represents the number of tire targets detected in a single image.
[0045] In this embodiment, noise-resistant feature points are first extracted from the binarized mask of the incomplete tire at each time step, and the outer contour pixel set of the binarized mask of the incomplete tire is extracted. Define the bottom edge of the mask as the height of the tangent to the water surface. Eliminate those that meet the requirements Non-curved interference points to obtain the upper pure arc point set P arc From the upper pure arc point set P arc Extract three topologically representative key feature points, including vertices. The point where the vertical coordinate is the minimum point is the highest point of the tire on the image plane, satisfying the condition that... , left boundary point With the right boundary point Let x be the extreme point of the x-axis, i.e., the maximum horizontal span above the water surface, satisfying the following conditions: , The system outputs multiple key feature points and water surface tangent heights at each time step. Then, it performs a complete geometric contour inversion and reconstruction on the multiple key feature points at each time step, and introduces an arc-shaped geometric model to calculate the effective chord length. w with bow-shaped height h ,in The horizontal distance between the left and right boundary points. Let be the perpendicular distance from the vertex to the effective chord. According to the perpendicular bisector theorem and the Pythagorean theorem... The analytical formula for the pixel radius of the tire is derived. To prevent ill-conditioned problems caused by complex flood noise leading to significant shifts in the fitted circle center, a vertical centerline alignment constraint is introduced, assuming that the tire centerline remains vertical in the corrected image, thus forcing the circle center to... C ( x c ,y c At the apex P top The geometric perpendicular line is used, and the x-coordinate is taken as the midpoint of the left and right boundaries to eliminate unilateral noise. , Based on the center coordinates C ( x c ,y c ) and pixel radius R The standard circle equation for restoring a damaged tire The system then completes the lower half of the geometry obscured by water, outputting the reconstructed tire pixel radius and center coordinates at each time step. Finally, it performs physical scale transformation and water depth calculation on the tire pixel radius, center coordinates, water surface tangent height, and the preset actual physical diameter of the passenger car tire at each time step, using standardized physical dimensions as the absolute benchmark, and sets the actual diameter of the passenger car tire as... D real Approximately 65cm, the scale factor is defined as the actual physical length represented by a unit pixel. Two height reference points are determined, one of which is the theoretical bottom height. y bottom = y c + R The theoretical ordinate of the lowest point of the tire, and the observation height at the water surface. To mitigate errors caused by water surface fluctuations, the average ordinate of the bottom edge of the mask is taken, and the physical inversion formula for water depth is used. Calculate the water depth for a single target. For multi-target detection on a single image, calculate the depth of each target in parallel and extract the maximum value. As the final output of the water depth diagnosis result for this complex scenario, the absolute physical values of the water depth at multiple times are output.
[0046] Step 104: On the edge computing chip at the camera end, perform residual decoupling time-series prediction and advanced dynamic early warning based on the absolute physical values of water depth at multiple times and the preset dangerous water level threshold, and output the water level evolution prediction curve for future periods, the advanced dynamic early warning signal and the estimated remaining overflow time.
[0047] It should be noted that on the edge computing chip at the camera end, the linear confluence trend parameters are first estimated and predicted for the absolute physical values of water depth at multiple time points. Then, the autoregressive coefficients and constant terms corresponding to the historical backtracking order are used to construct... pAn autoregressive model is used to estimate autoregressive coefficients through matrix least squares analytical equations, outputting linear trend predictions for future timeframes and calculating the fitting residual time series within the historical sliding window sequence. Both parameter estimation and linear prediction in the autoregressive model involve analytical matrix operations, which can be rapidly completed on edge computing chips with extremely low computational overhead. Subsequently, nonlinear mutation residual modeling and prediction are performed on the fitted residual time series. The residual sequence is input into a long short-term memory network (LSTM), and after gating operations through forget gates, input gates, and output gates, as well as cell state updates, nonlinear mutations are fitted, outputting nonlinear residual predictions for future timeframes. The lightweight LSM network models residual sequences only for local scenes within the field of view, eliminating the need for background global hydrodynamic calculations. Finally, explicit algebraic operations are performed on the linear trend predictions and nonlinear residual predictions. The system sums up the predicted water depth for the future time. Then, it performs multi-step iterative extrapolation on the predicted water depth for the future time to output the predicted water level evolution curve for the future period. Finally, it performs an advance warning judgment on the predicted water level evolution curve for the future period. If the prediction curve shows that the future water level is greater than the preset dangerous water level threshold, an advance dynamic trend warning signal is generated. The time difference between the moment when the water level in the prediction curve first exceeds the preset dangerous water level threshold and the current time is determined as the estimated remaining overflow time. The entire time series prediction and advance warning are completed locally in a closed loop on the edge computing chip at the camera end, eliminating the dependence on the huge central computing power in the background. Even under extreme conditions such as network outages, it can still independently generate warning signals and output the estimated remaining overflow time, gaining valuable lead time for flood control resource scheduling.
[0048] Furthermore, step 104 may include the following sub-steps: S41. Estimate and predict the linear confluence trend parameters of the absolute physical values of water depth at multiple times, and output the linear trend prediction values for future times. S42. Calculate the point-by-point difference between the linear fitting values in the historical sliding window sequence and the absolute physical values of the water depth at the corresponding time point to obtain the fitting residual time series in the historical sliding window sequence. S43. Perform nonlinear abrupt change residual modeling and prediction on the fitted residual time series, and output the nonlinear residual prediction value for future time. S44. Explicitly algebraically sum the nonlinear residual prediction value and the linear trend prediction value at future time to obtain the final accurate prediction value of the water depth at future time. S45. Perform multi-step iterative extrapolation on the final accurate prediction value of the water depth at future time, and output the water level evolution prediction curve for future time period; S46. Make advance warning judgments on the predicted water level evolution curve for future periods; S47. If the water level evolution prediction curve for the future period shows that the future water level is greater than the preset dangerous water level threshold, an advanced dynamic trend warning signal is generated, and the time difference between the moment when the water level in the water level evolution prediction curve for the future period first exceeds the preset dangerous water level threshold and the current moment is determined as the estimated remaining overflow time.
[0049] It should be noted that this step aims to build a time-series prediction model based on the absolute water depth data continuously output by the front-end visual recognition module, thereby solving the drawback of traditional flood control which can only issue passive alarms for fixed water accumulation values.
[0050] Specifically, the evolution of urban flooding is a non-stationary temporal process. It includes both a "linear gradual accumulation" caused by continuous rainfall runoff and a "non-linear abrupt shock" caused by backflow from underground pipe networks or the forced activation of emergency pumping stations. To avoid a single neural network overly smoothing out these two distinct physical processes, this invention uses the future water depth... x t+1 Decoupling is achieved by: a linear trend term based on physical inertia. L t+1 Nonlinear residuals driven by strong external disturbances N t+1 .
[0051] x t+1 =L t+1 +N t+1 ; Furthermore, considering the uniform or linear increasing trend of water depth under stable rainfall or normal surface runoff convergence, the system adopts... p Autoregressive model (AR) p (AR, AutoRegressive Model) is used to fit basic evolutionary features. Its linear predictions for future time steps are obtained. L t+1 The formula is: ; In the formula, p For the historical retrospective order, For the corresponding autoregressive coefficients, This is a constant term. For the parameter matrix... To perform unbiased estimation, the system constructs an analytical equation using long-sequence historical observation samples, namely Ordinary Least Squares (OLS): ; Among them, historical observation matrix Compared with the true water level response vector Explicit expansion is defined as follows: ; in, x t+1 For the future t +1 is the linear prediction of the water depth; For the first i The first-order autoregressive coefficient corresponds to the first-order autoregressive coefficient in the historical backtracking window. i The weighting coefficients of historical observations to the current predicted value. i The value range is 1 to p ; For a historic moment ti The absolute physical observation of the water depth, +1, is the historical input used by the autoregressive model to predict future values. The parameter matrix consists of constant terms. c With autoregression coefficients of each order Arranged in rows, it is the set of parameters to be solved in matrix least squares estimation; The true water level response vector is composed of the actual water depth observations corresponding to each row of the historical observation matrix, arranged in columns, and is the target response quantity estimated by matrix least squares. T This is the matrix transpose operator, used to interchange the rows and columns of a matrix. From the current moment t The absolute physical observation values of water depth at each time up to the initial time 1 constitute the original data source for the historical observation matrix and the actual water level response vector; -1 is the matrix inversion operator, used to solve the inverse matrix of the square matrix, and to achieve unbiased estimation of parameters in the least squares analytical equation of the matrix.
[0052] Furthermore, urban flooding is often accompanied by highly complex nonlinear shocks such as sudden heavy rainfall, sudden backflow of drainage networks, or forced activation of flood control pumping stations. This invention first calculates the time series of fitting residuals of the autoregressive model within a historical sliding window sequence. e t = x t - L t This high-frequency nonlinear perturbation residual sequence is then input into an LSTM (Long Short-Term Memory) network.
[0053] LSTM unit at time t Internal full matrix expansion gating state, hidden layer propagation and residual prediction output N t+1 The mathematical derivation system is as follows: ; In the formula, , , These are the activation vectors for the forget gate, input gate, and output gate, respectively. The current state of candidate memory cells; The core cellular state flow serves as a record of the long-term evolution of water conditions. To output the hidden layer state; The Hadamard product represents the matrix multiplication by its element-wise components. and These are the trainable weight matrix and bias term of the network, respectively; Let z be the Sigmoid activation function, and z be the input value of the Sigmoid activation function, i.e., the weight matrix and input vector (residual sequence) in each gated unit. e t Compared to the hidden layer state at the previous time step h t-1 The result of the linear combination of and the corresponding bias term is the original linear quantity that triggers the Sigmoid nonlinear mapping.
[0054] Furthermore, by explicitly algebraically summing the linear extrapolated predictions of the autoregressive model with the predictions of the nonlinear shock perturbation from the LSTM network, the future time value is finally output. t +1 Final accurate prediction of water depth : ; The system continuously extrapolates and outputs predicted water level evolution curves for a whole future period through multi-step iterations or parallel calculations. The early warning system scans and judges the predicted curve in real time: if the current actual water level has not reached the alarm threshold, but the predicted curve shows a future... The water level will exceed the set danger threshold within a certain period of time. H danger The system immediately triggered an "advanced dynamic trend warning" and explicitly output the estimated remaining time of overflow: ; This quantitative indicator directly drives the early and precise scheduling of urban emergency flood control and drainage resources, achieving the goal of rapid and intelligent prevention of urban flooding.
[0055] In the above formula, For a whole period of time in the future, from time to time t +1 to time The sequence of accurate predicted water depths at each time point is generated by continuous extrapolation through multi-step iteration or parallel calculation, forming a prediction curve of water level evolution for future periods; HTo predict the length of the time period, i.e. the number of prediction steps in the multi-step iterative extrapolation, the time span covered by the water level evolution prediction curve for the future period is determined. The time step is the time interval between two adjacent prediction times, used to quantify the time position of each time point in the prediction curve. The preset dangerous water level threshold is the pre-set critical value of water depth danger. When the predicted water level is greater than the threshold, an advanced dynamic early warning is triggered. It is the benchmark quantity for early warning judgment. The estimated remaining overflow time, i.e. the time difference between the current moment and the moment when the water level in the prediction curve first exceeds the preset dangerous water level threshold, is obtained by solving the minimum time step that makes the predicted value first exceed the threshold using the arg min operator, thus quantifying the early warning lead time.
[0056] In this embodiment, the absolute physical values of water depth at multiple times are first estimated and predicted using linear confluence trend parameters, and the water depth at future times is then predicted. x t+1 Decoupling into a linear trend term based on physical inertia L t+1 Nonlinear residuals driven by strong external disturbances N t+1 ,Right now x t+1 =L t+1 +N t+1 To address the uniform or linear increasing trend of water depth under stable rainfall or normal surface runoff, the following approach is adopted: p Autoregressive model (AR) p Basic evolutionary features are fitted, where the order of historical backtracking is... p The sampling frequency can be set to 6, 12, or 24 based on the water condition change cycle, utilizing the historical backtracking order. p Corresponding autoregressive coefficient With constant term c Constructing a linear prediction formula Then, a historical observation matrix is constructed using long-term historical observation samples. Compared with the true water level response vector The parameter matrix is unbiasedly estimated using matrix least squares analytical equations to output linear trend predictions for future timeframes. Subsequently, the point-by-point difference between the linear fitted values within the historical sliding window sequence and the corresponding absolute physical values of water depth is calculated to obtain the fitted residual time series within the historical sliding window sequence. Next, nonlinear abrupt change residual modeling and prediction are performed on the fitted residual time series, and the residual sequence is... e tThe system inputs a Long Short-Term Memory (LSTM) network and outputs a nonlinear residual prediction value for the future time. Then, it explicitly algebraically sums the nonlinear residual prediction value with the linear trend prediction value to obtain the final accurate prediction value of the water depth at the future time. Next, it performs multi-step iterative extrapolation on the final accurate prediction value of the water depth, using the current prediction value as the input for the next prediction. The prediction period length H can be set to 10, 20, or 30 steps, etc., depending on the advance warning requirement, continuously extrapolating and outputting the water level evolution prediction for the entire future period. The process involves measuring the water level curve; finally, an advance warning judgment is made based on the predicted water level evolution curve for the future period. The preset dangerous water level threshold can be set to 15cm, 30cm, or 50cm, etc., according to the city's flood control level standards, the critical depth of road flooding affecting traffic, and the local flood control emergency plan. If the predicted water level evolution curve for the future period shows that the future water level is greater than the preset dangerous water level threshold, an advance dynamic trend warning signal is generated. The time difference between the moment when the water level in the predicted water level evolution curve for the future period first exceeds the preset dangerous water level threshold and the current moment is determined as the estimated remaining overflow time. .
[0057] To further verify the effectiveness and feasibility of the present invention, "Urban Flood Water Depth Monitoring Method Based on Large Image Model and Geometric Feature Reconstruction", the following provides a complete system example covering dataset construction, model fine-tuning training, and practical application verification.
[0058] In this example, the system first utilizes distributed web crawling technology with Python (an interpreted high-level programming language) to automatically crawl approximately 4,000 original flood images from Baidu Images, Bing (a search engine), and social media by designing dual search terms: generalized scene semantics (e.g., "street scene of flooded city during heavy rain") and precise physical feature semantics (e.g., "vehicle water depth and tires"). After initial screening, images with low resolution, duplicates, and vehicles without flooding were removed, retaining 470 valid samples. Subsequently, for samples with perspective distortion, the system performed orthorectification preprocessing based on affine transformation, such as... Figure 2 As shown, the LabelMe tool was used to annotate the edges of the damaged car tires protruding from the water in the image using polygonal edges, converting them into binary mask labels with a background pixel count of 0 and a target pixel count of 255. Finally, to simulate realistic complex environmental noise, the system performed a series of data augmentation operations on the annotated image-mask pairs, including horizontal flipping, dynamic brightness adjustment, addition of Gaussian noise, and random dot-like pixel patches. Through the above process, the sample library was finally expanded to 2820 images, which were then randomly divided into training and validation sets in an 8:2 ratio.
[0059] In the fine-tuning training phase of the large image model, this example was conducted under a Windows operating system, equipped with a 5060 graphics card with 8GB of VRAM to support 4-bit quantization training. The software environment was built on the PyTorch framework (an open-source deep learning framework) and the peft library (Parameter-Efficient Fine-Tuning) from Hugging Face (an open-source AI community). The system is based on the SAM model and uses the QLoRA strategy to fine-tune only the query matrix and value matrix of its image encoder (ViT module). The rank of the LoRA bypass matrix was set to 8, the optimizer was Adam (Adaptive Moment Estimation), the initial learning rate was set to 10⁻⁵, and the batch size was 1. The model uses a binary cross-entropy and Dice weighted loss function to drive training and introduces an early stopping mechanism to prevent overfitting. Training is automatically terminated when the validation set loss does not decrease for 10 consecutive rounds. In this example, early stopping was triggered at round 93. Figures 3-4 As shown, after fine-tuning, the model achieved a stable average intersection-over-union (IoU) of 94.96% on the validation set, with the loss value decreasing to 0.038. Before training, the IoU on the validation set remained stable between approximately 94% and 95%. After training, the model achieved an IoU of 94.96% and a loss value of 0.038. These results indicate that the SAM model, fine-tuned using the QLoRA strategy, performs well overall in masking and segmenting car tires in flooded conditions, meeting the requirements of this study on flood depth identification.
[0060] In the geometric reconstruction and actual depth verification phase, the system selected 60 real urban flood monitoring images from an extreme rainstorm event in a certain city for blind testing. This batch of test data included severe interference factors such as highly turbid muddy water surfaces and non-orthogonal perspective distortion. Taking one image of water accumulation with a manually measured depth of 20cm as an example, the finely adjusted SAM model accurately detected the three visible tires of three vehicles wading through the water. The system launched the geometric reconstruction algorithm in parallel for these three independent targets. The system extracted the horizontal and vertical extreme points of each incomplete mask and substituted them into the vertical central axis constraint engine. Using the physical diameter of a standard passenger car tire of 65cm as the absolute benchmark, a pixel scaling factor was established. After independently calculating three sets of depths, the maximum value was extracted as the final output. The final result showed that the maximum water accumulation depth of the image was 22.1cm, with an absolute error of only 2.1cm. Furthermore, a comprehensive statistical analysis was conducted on the inference results of all 60 complex scene samples in this example. The average absolute error between the water depth calculated by this invention and the measured value was as low as 2.87 cm, the average relative error was only 13.46%, and the median absolute error was only 2.6 cm.
[0061] As a comparison of technical effects, existing technologies can be used as a reference. Currently, the technical system of urban flood control mainly covers two core components: "flood and waterlogging monitoring and perception" and "flood control dynamic early warning mechanism." However, existing scientific research and engineering practice have obvious limitations in these two components.
[0062] In the monitoring of floodwater, the current technical approaches to achieve water depth monitoring and quantitative calculation are mainly divided into two categories: physical sensor network monitoring and visual model perception. Traditional physical water level sensor network monitoring involves fixing sensors such as ultrasonic / radar water level gauges to specific underground pipe network nodes, bridge piers, or street light poles, and transmitting water level data back to the command center in real time with the help of Internet of Things (IoT) technology. However, the cost of purchasing individual devices, precision calibration, and daily maintenance of such devices is extremely high, the installation conditions are stringent, and they are easily damaged by road renovations, buried by high-turbidity silt, or blocked by floating debris. They can only maintain a sparse "point-like" distribution in the vast urban road network and cannot meet the task of large-scale, high-density dynamic flood control coverage. Deep learning-based visual monitoring models, represented by target detection networks and instance segmentation networks, learn from massive image features to extract boundary or mask information of reference objects such as vehicles wading through water in a non-contact manner. They have significant advantages in terms of the breadth of disaster spatial distribution and response efficiency. However, most existing visual models are based on strongly supervised learning and fitting of specific controlled scenarios. Their feature extraction process often shows strong "vulnerability" to complex environmental noise. When faced with extreme conditions such as strong water surface reflection, high turbidity muddy water occlusion, and low light at night in real flood scenarios, they are prone to "domain shift" phenomenon, which leads to failure of target reference object edge segmentation or misjudgment of local features. More importantly, existing methods for quantitative water depth calculation based on visual monitoring mostly rely on fixed monitoring stations deployed on specific road sections and preset static reference systems. When faced with uncontrolled crowdsourced images with varying installation heights, pitch angles, and focal lengths, traditional visual technologies, without strict camera intrinsic and extrinsic parameter calibration, struggle to construct accurate scale mapping relationships from two-dimensional pixels to three-dimensional physical space, resulting in geometric center drift and physical distortion of depth calculation results.
[0063] In the dynamic early warning mechanism for flood control, the current underlying architecture mostly adopts a fixed experience threshold alarm mechanism based on "rule triggering". The monitoring and early warning only sound the alarm when the measured value crosses the fixed safety red line. This passive response mechanism is essentially a "retroactive catch-up", which isolates the data at each moment and fails to explore the evolution pattern contained in the historical water accumulation time series. When the alarm is triggered, severe waterlogging has often already formed, leaving very little time for the dispatch of flood control resources such as water pump trucks, resulting in a significant lag. To achieve early warning, the current conventional approach is to uniformly transmit the massive amounts of data collected by front-end cameras back to the cloud and rely on the centralized computing power of the back-end to perform time-series calculations for the entire region. However, this model has high requirements for the central computing power, and the solution of the full-domain model requires a certain time period, which is difficult to meet emergency needs in extreme scenarios such as network outages. Even if a few solutions introduce a single prediction model, they mostly adopt black-box end-to-end regression, failing to physically decouple the macroscopic linear confluence and microscopic nonlinear mutations in the process of water situation evolution. As a result, when encountering sudden conditions such as pump station forced drainage or pipeline backflow, the prediction curve is prone to severe lag divergence or smoothing distortion, making it difficult to output accurate warning time windows.
[0064] Therefore, how to achieve universal and high-precision automatic quantitative calculation of water depth in complex open scenarios lacking camera calibration parameters and static physical scales, and how to overcome the lag of traditional "fixed-value alarms" to achieve proactive early warning of future water accumulation trends, are core technical challenges that urgently need to be addressed in the field of urban flood control and dynamic early warning. Specifically, the following technical problems need to be solved: First, how to overcome the generalization bottleneck of visual recognition and establish a reliable pixel-physical scale mapping under variable scenarios and strong physical interference, thus eliminating the dependence on fixed monitoring angles and camera intrinsic and extrinsic parameter calibration; second, how to achieve advanced and rapid on-site dynamic early warning based on edge computing without relying on large-scale computing power across the entire backend, and how to physically decouple the macroscopic linear confluence and microscopic nonlinear abrupt changes in water situation evolution to improve the prediction accuracy under abrupt change conditions.
[0065] To address the aforementioned problems, this invention provides a generative monitoring and early warning method for urban floodwater depth. This method enables high-precision quantitative calculation of water depth in complex, open scenarios lacking camera calibration and static scales, and provides advanced early warning of dynamic water conditions. To address the issue of perception relying on static scales, this invention constructs a calibration-free visual perception framework based on dynamic physical benchmarks. It utilizes widely available car tires in cities as dynamic scales, combining vertical midline constraints and the perpendicular bisector theorem for geometric reconstruction, completely eliminating reliance on fixed monitoring angles and camera calibration parameters. To address the issues of weak generalization and poor noise resistance in visual models, this invention introduces a large-scale image segmentation model with excellent zero-shot generalization capabilities and an efficient parameter fine-tuning strategy. This effectively overcomes environmental noise such as water surface reflection and high-turbidity mud, improving the accuracy and robustness of incomplete mask feature extraction. Furthermore, it addresses the issue of traditional... The traditional early warning mechanism suffers from passive lag, excessive reliance on large-scale computing power in the background, and susceptibility to distortion under sudden changes. This invention seamlessly integrates monitoring and early warning functions at the edge, innovatively utilizing generative AI technology for hydrological prediction. By deploying a dual-engine generation architecture of autoregressive and long short-term memory networks at the camera end, the macro-trend of hydrological evolution and micro-level abrupt change residuals are physically decoupled. This directly generates continuous water level change curves for future periods on-site and outputs the estimated remaining overflow time, eliminating the reliance on massive central computing power in the background. This achieves a leap forward to "proactive trend early warning," which is more advanced than "fixed value alarms."
[0066] Specifically, this invention provides a flood and waterlogging depth generation-based edge monitoring and early warning framework for complex urban open scenarios, possessing cross-domain generalization capabilities, calibration-free high-precision quantization capabilities, and advanced trend early warning capabilities. The core technical principle of this invention lies in completely abandoning the technical limitations of traditional visual water level monitoring, which heavily relies on specific static water gauges and fixed camera positions, while also breaking the passive and delayed "alarm only when the line is crossed" mode of traditional flood control systems. This invention combines front-end visual monitoring with back-end time-series early warning on a common camera with its own computing chip, thereby constructing an end-to-end closed-loop architecture that integrates "zero-sample perception of large image models," "dynamic scale geometric reconstruction," and "AR-LSTM (AutoRegressive Long Short-Term Memory) residual decoupled prediction." Through the synergistic effect of these four core mechanisms, this architecture achieves a complete flood control and drainage closed loop directly at the camera end, from the absolute physical quantization of the current water depth to the on-site generation of future water level evolution curves, without relying on back-end full-domain computation.
[0067] The operating mechanism of this invention mainly comprises three tightly coupled components, and the overall flowchart is as follows: Figure 5 As shown.
[0068] (1) Dataset construction and distortion correction mechanism based on network crowdsourced images: The foundation of this invention is to break down the spatial barriers to data acquisition in traditional physical sensor networks and construct a high-quality flood and waterlogging dataset for complex and open scenarios. First, the system utilizes distributed web crawling technology, based on a multi-dimensional keyword retrieval strategy, to extensively acquire multi-source, unconstrained crowdsourced images containing car tires from platforms such as social media. Second, addressing the common problems of unknown shooting device parameters and variable non-orthogonal perspectives in such images, this invention constructs an image orthorectification preprocessing mechanism. This mechanism effectively eliminates spatial projection distortion caused by non-orthogonal perspectives by calculating the spatial perspective transformation matrix, restoring the true physical proportion between the water surface and reference objects. Combined with data augmentation strategies such as image flipping and noise reduction, it lays a standardized input data structure for efficient feature learning and high-precision physical quantization of subsequent large-scale models.
[0069] (2) Image recognition model based on large model and efficient parameter fine-tuning: The feature extraction unit of this invention is responsible for accurately locking the incomplete contours of targets under complex environmental noise. The invention introduces the Segment Anything Model (SAM), a large-scale image segmentation model with excellent zero-shot perception and generalization capabilities, as its basic architecture. Since traditional full-parameter fine-tuning destroys the inherent zero-shot general prior of the large model, leading to catastrophic forgetting, this invention innovatively adopts a Quantized Low-Rank Adaptive Fine-Tuning (QLoRA) strategy in the parameter efficient fine-tuning of the model's main weights. This strategy fully relies on and preserves the natural perception prior of the basic large model regarding physical entity boundaries. By freezing the model's main parameters, a low-rank matrix is injected into the image encoder in a bypass manner and 4-bit quantization technology is used to guide the model to accurately adapt to the specific noise in flood scenarios such as water surface reflection and high-turbidity water bodies with minimal parameter updates. In terms of model optimization, this unit adopts a joint loss-driven mechanism, combining binary cross-entropy (BCE) and Dice loss in a weighted manner, thereby effectively separating background interference while accurately capturing and fitting the edges of small and incomplete reference objects.
[0070] (3) Calibration-free physical quantization engine: "Geometric reconstruction mechanism based on vertical central axis constraint": To address the feature loss caused by the target portion being submerged in water, this invention designs a geometric reconstruction mechanism based on vertical central axis constraints. This mechanism extracts the extreme points of the incomplete visible arc segments and utilizes the dual physical constraints of the "perpendicular radix theorem" and "vertical central axis alignment" to inversely derive the complete physical center and full-size pixel contour of the target. Anchored to the actual physical diameter, it directly derives the conversion coefficient from pixel to physical space, thus achieving absolute depth quantization.
[0071] (4) Prediction and early warning center: "Time series prediction mechanism based on AR-LSTM residual decoupling": To overcome the lag in traditional passive alarms, this invention integrates a dual-engine driven time-series prediction hub on top of front-end sensing. Targeting the characteristics of water situation evolution, the system decouples the time series: it employs an autoregressive (AR) model to capture the macroscopic "linear cumulative trend" caused by stable rainfall confluence, while simultaneously utilizing the gating mechanism of a Long Short-Term Memory (LSTM) network to focus on fitting the microscopic "nonlinear abrupt change residuals" caused by backflow in the pipeline network or forced drainage from pumping stations. After merging these two approaches, the system can accurately predict the dynamic evolution curve of future water conditions and automatically calculate and output the estimated remaining overflow time.
[0072] II. Functional and Technical Advantages: Based on the above mechanism, the framework of this invention achieves several functions that traditional deep learning models or physical sensor networks cannot reach: Breaking free from calibration dependence and perspective constraints: The measurement process of this invention requires no acquisition of any environmental parameter data, nor does it rely on monitoring equipment with a fixed perspective. In practical applications, the total water depth is explicitly decomposed into algebraic calculations of geometric reconstruction parameters, enabling the system to achieve adaptive scale mapping in any open road segment, completely breaking the dependence of traditional visual measurement on spatial perspective.
[0073] Strong generalization and robust noise resistance: Relying on a large image model with efficient parameter fine-tuning, this system possesses excellent feature extraction capabilities. This architecture effectively overcomes the "domain shift" and contour segmentation failure problems that traditional strongly supervised vision models are prone to when facing complex flood environments with noise such as water surface reflection, low light at night, and severe obstruction by debris, thus ensuring recognition accuracy under harsh conditions.
[0074] Temporal physical decoupling and advanced dynamic early warning capabilities: By introducing an AR-LSTM dual-engine architecture, this invention physically decouples the linear macroscopic trend of water accumulation evolution from the nonlinear microscopic mutations, effectively overcoming the fatal flaw of traditional single black-box prediction models that are prone to divergence or smoothing distortion when encountering abrupt changes. The system can quantitatively output the "estimated remaining overflow time" in advance, truly realizing a paradigm shift in flood control response from "passive fixed-value alarms" to "proactive advanced intervention".
[0075] As can be seen from the above, the key point of this invention is: 1. A calibration-free visual perception framework based on dynamic physical benchmarks and geometric constraints. One of the key points of this invention is that it breaks through the technical limitations of traditional visual water condition monitoring, which heavily relies on "preset static scales" and "specific fixed camera positions." The core mechanism is to utilize widely available and standardized car tires in cities as a "dynamic scale," combined with "orthophoto correction," and by extracting the extreme points of incomplete visible arc segments and substituting them into the dual physical geometric constraints of "vertical midline alignment" and "perpendicular bisector theorem," the complete physical center and full-size pixel contours are directly reconstructed in the two-dimensional image. This framework completely eliminates the dependence on camera intrinsic and extrinsic parameter calibration, realizing the absolute physical scale mapping and quantitative calculation of water depth in wide-area open scenes.
[0076] 2. An image recognition model based on a large model and efficient parameter fine-tuning. One of the key points of this invention is the construction of a noise-resistant feature extraction module. Its core mechanism lies in introducing a large image segmentation model (SAM) with strong generalization capabilities and adopting a quantized low-rank adaptive QLoRA fine-tuning strategy. By freezing the main parameters, injecting a low-rank matrix only in the image encoder, and supplementing it with the joint loss function of BCE and Dice, the model can still accurately extract the binarized mask of the damaged tire even when faced with flood-specific noise such as water surface reflection and high-turbidity mud, thus solving the "domain shift" problem that is prone to occur in traditional image recognition models.
[0077] 3. A temporal prediction and proactive dynamic early warning hub based on AR-LSTM physical residual decoupling. One of the key points of this invention is that it breaks away from the purely passive response mode of traditional flood control systems that only issue alarms when the water level exceeds the warning line. The core protection mechanism is to construct a dual-engine driven temporal prediction architecture based on front-end visual perception, decoupling the water situation evolution process at the physical characteristic level. Specifically, the protection utilizes an autoregressive (AR) model to extract the "macro-linear cumulative trend" dominated by rainfall confluence, while simultaneously using a long short-term memory network (LSTM) to specifically fit the "micro-nonlinear abrupt change residual" caused by backflow or forced drainage from the pipeline network. This dual-engine architecture overcomes the prediction distortion of traditional single black-box models when encountering abrupt changes, can accurately predict the future continuous water level evolution curve, and automatically calculate and output the "estimated remaining overflow time," thereby achieving a paradigm shift from "passive fixed-value alarm" to "proactive proactive prediction."
[0078] 4. A generative edge computing architecture integrating monitoring and early warning. One of the key points of this invention is breaking the traditional fragmented model of "front-end camera acquisition - back-end central computing," combining monitoring, computing, and prediction functions and deploying them on the edge chip integrated into ordinary cameras. It eliminates the need for massive and complex global computation in the backend, enabling rapid and low-computing-power generation of future water conditions directly on the edge for local views, thus providing more advanced early warning than traditional fixed-value warnings and a faster response time than backend global computation.
[0079] Compared to existing technologies, this invention represents a leap from "reliability to controlled camera positions and static scales" to "wide-area calibration-free dynamic perception" in terms of perception breadth and physical scale mapping. Existing technologies heavily rely on inherent static reference objects in the scene, becoming completely ineffective when faced with unconstrained multi-source crowdsourced images, such as social media images of wading. This invention innovatively introduces widely available car tires in cities as a "dynamic scale," applying rigid physical geometric constraints through "orthophoto correction," "vertical midline alignment," and the "perpendicular radii theorem." This mechanism reduces the dimensionality of extracted incomplete features and transforms them into algebraic inversion strongly constrained by the midline, completely eliminating dependence on camera intrinsic and extrinsic parameters and static water level gauges. This advantage enables the system to adaptively establish high-precision absolute physical scale mappings in any open road section and under varying perspectives, significantly reducing the construction and maintenance costs of flood control monitoring and effectively eliminating spatial blind spots in fixed sensor networks.
[0080] Secondly, regarding the reliability of geometric reconstruction and physical scale mapping, existing technologies directly fit ellipses to incomplete arc segments on two-dimensional images with non-orthogonal perspective distortion. Since the exposed arc segments of tires on wading vehicles in standing water are often extremely short, relying solely on mathematical algorithms to perform free ellipse fitting on these extremely short incomplete arc segments easily leads to ill-conditioned calculations, causing severe spatial drift of the fitted circle center, and consequently resulting in serious distortion of the final physical water depth calculation. This invention, however, employs a reconstruction strategy that first performs image orthorectification to eliminate perspective projection errors, and then applies rigid physical geometric constraints using "vertical central axis alignment" and the "perpendicular bisector theorem." This design reduces the dimension of the highly unstable incomplete ellipse fitting and transforms it into a circular algebraic inversion strongly constrained by the central axis in the frontal plane, overcoming the geometric reconstruction divergence problem caused by incomplete contours. This ensures high accuracy and high stability in the mapping from two-dimensional pixels to three-dimensional physical space scales, completely eliminating the need for camera calibration.
[0081] In terms of time-series prediction and dynamic early warning, this invention abandons single-modal black-box prediction and achieves physical residual decoupling and proactive intervention. Existing technologies directly input continuously extracted water depth sequences into a single prediction model for end-to-end black-box fitting. This approach, which fails to isolate the "linear hydrological evolution law" from the "nonlinear abrupt shock," makes the prediction curve prone to hysteresis divergence or smoothing distortion when encountering extreme nonlinear shocks such as pipeline backflow and pumping station forced drainage. This invention innovatively constructs an AR-LSTM dual-engine architecture, using an autoregressive model to accurately capture the linear confluence trend caused by continuous rainfall, while simultaneously utilizing the gating mechanism of Long Short-Term Memory (LSTM) networks to focus on fitting high-frequency nonlinear residuals under abrupt change conditions. This decoupled architecture not only significantly improves the prediction accuracy under non-stationary abrupt change conditions but also calculates and explicitly outputs the "estimated remaining overflow time" in advance, truly giving the flood control command system a golden window for proactive prediction and intervention.
[0082] Based on the above embodiments, the present invention may also adopt the following optional embodiments. The optional embodiments are consistent with the core inventive concept of the foregoing embodiments, and only equivalent substitutions are made in the specific implementation means, all of which can achieve the purpose of the present invention.
[0083] Regarding the selection of dynamic physical scales, the above embodiments use car tires as the core dynamic physical benchmark for calculating water depth. As an alternative, the dynamic physical scale can also be replaced by other common urban entities with national or industry-standardized physical dimensions, such as standard motor vehicle models, standardized traffic cones, or standard urban road dividers. As long as the corresponding geometric inversion algorithm is combined, the absolute physical scale mapping and water depth calculation without static water gauges can also be completed.
[0084] Regarding the basic architecture of the image recognition model, the feature extractor in the above embodiment is constructed as a large image segmentation model based on the segmentation of everything model. This is an exemplary selection. Depending on the different needs of edge computing resources or inference real-time in actual deployment, other alternative structures can be adopted, such as downgrading to a lightweight segmentation large model variant or other large models with zero-shot strong generalization ability. As long as it can filter the noise of complex flood environment and accurately output the target incomplete mask, the purpose of this invention can be achieved.
[0085] Regarding the implementation of the efficient parameter fine-tuning strategy, the above embodiments use the quantization low-rank adaptive technique of freezing the main parameters and injecting a low-rank matrix and 4-bit quantization for feature fine-tuning. There are various methods to enable the large model to adapt to specific scene noise. For example, adapter fine-tuning or visual cue fine-tuning can be used. Alternatively, when cloud computing resources are sufficient, full parameter fine-tuning of the large model can be performed directly. As long as the pre-trained model can be guided to accurately adapt to specific flood noise such as water surface reflection and high turbidity water, the target contour can be locked with high precision.
[0086] Regarding the calculation of geometric inversion reconstruction, the above embodiment uses a specific algebraic geometric inversion mechanism based on the vertical central axis constraint and the perpendicular bisector theorem to calculate the complete target contour. This is only one way to obtain feature points to achieve geometric reconstruction. Other algorithm schemes that use feature points for geometric reconstruction can be used instead. As long as the final inversion feature dimension is used to establish a scale factor with the real physical size, calibration-free depth calculation can be achieved.
[0087] Regarding alternatives to the AR-LSTM physical residual decoupled time series prediction architecture, the above embodiments employ a dual-engine decoupled architecture that uses an autoregressive model to fit a linear trend and a long short-term memory network to fit nonlinear residuals. As an alternative, both core components in this decoupled architecture can be equivalently replaced by similar time series analysis tools. The autoregressive model can be replaced by a moving average model, an autoregressive moving average model, an exponential smoothing model, or a multiple linear regression equation. The long short-term memory network can be equivalently replaced by a gated recurrent unit, a temporal convolutional network, or a Transformer time series prediction network based on a self-attention mechanism. As long as its prediction center follows the core logic of physically decoupling and independently fitting the macroscopic linear stationary trend of water situation evolution with the microscopic abrupt nonlinear impact, it can achieve high-precision dynamic extrapolation of non-stationary water conditions and advance calculation of the estimated remaining overflow time.
[0088] Please see Figure 6 , Figure 6 This is a structural block diagram of an urban flood water depth generation monitoring and early warning system provided in Embodiment 2 of the present invention.
[0089] This invention provides a generative monitoring and early warning system for urban floodwater depth, comprising: The acquisition module 601 is used to acquire a set of real flood images from multiple sources without constraints and using a Lagrange interpolation function and annotation tools to process the real flood images from multiple sources without constraints and using a spatial perspective transformation matrix to output a flood-specific dataset. The fine-tuning module 602 is used to efficiently fine-tune the parameters of the pre-trained image segmentation model using a flood-specific dataset, and output the image segmentation model after training convergence. The reconstruction and depth calculation module 603 is used on the edge computing chip at the camera end to perform inference segmentation on the flood image to be tested at multiple time points using the trained and converged image segmentation model, to obtain the incomplete tire binarized mask at each time point, and to perform geometric reconstruction and depth calculation based on the incomplete tire binarized mask at each time point, and output the absolute physical value of the water depth at multiple time points. The prediction and early warning module 604 is used on the edge computing chip at the camera end to perform residual decoupled time-series prediction and advanced dynamic early warning based on the absolute physical value of water depth at multiple times and the preset dangerous water level threshold, and outputs the water level evolution prediction curve for future periods, advanced dynamic early warning signal and estimated remaining overflow time.
[0090] Furthermore, module 601 is specifically used for: Perspective distortion elimination and pixel missing repair are performed on a set of real flood images from multiple sources with unconstrained viewpoints using spatial perspective transformation matrix and Lagrange interpolation function, and the output is a set of orthorectified frontal plane images. The polygonal edges of the damaged tires exposed above the water surface in the orthorectified frontal plane image were annotated using an annotation tool and converted into a binary mask to obtain multiple image mask pairs. Perform geometric and color transformations on multiple image mask pairs to output a flood-specific dataset.
[0091] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0092] This invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program; when the computer program is executed by the processor, the processor performs the steps of the urban flooding depth generation monitoring and early warning method as described in the above embodiments.
[0093] This invention also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the urban flooding depth generation monitoring and early warning method as described in the above embodiments.
[0094] This invention also provides a computer program product, including a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the urban flooding depth generation monitoring and early warning method as described in the above embodiments.
[0095] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0096] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0097] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0099] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating monitoring and early warning of urban floodwater depth, characterized in that, include: A multi-source, unconstrained perspective real-world flood image set was acquired, and the Lagrange interpolation function and annotation tools were used to process the data based on the spatial perspective transformation matrix, outputting a flood-specific dataset, including: Using distributed web crawler technology, a multi-dimensional keyword retrieval strategy based on scene and disaster semantic generalization search terms and physical feature coupled precise search terms was adopted to crawl multi-source unconstrained perspective flood real images containing car tires from social network platforms, resulting in a multi-source unconstrained perspective flood real image set. The spatial perspective transformation matrix and the Lagrange interpolation function are used to perform perspective distortion elimination and pixel missing repair on the multi-source unconstrained viewpoint flood real image set, and output the orthorectified frontal plane image set. The polygonal edges of the damaged tires exposed above the water surface in the orthorectified frontal plane image are annotated using a labeling tool and converted into a binary mask to obtain multiple image mask pairs. Perform geometric and color transformations on multiple image mask pairs to output a flood-specific dataset; The parameters of the pre-trained image segmentation model are efficiently fine-tuned using the flood-specific dataset, and the converged image segmentation model is output. On the edge computing chip at the camera end, the image segmentation model after training convergence is used to perform inference segmentation on the flood images to be tested at multiple times, to obtain the incomplete tire binarization mask at each time, and to perform geometric reconstruction and depth calculation based on the incomplete tire binarization mask at each time, and output the absolute physical value of the water depth at multiple times. On the edge computing chip at the camera end, residual decoupling time-series prediction and advanced dynamic early warning are performed based on the absolute physical values of water depth at multiple times and preset dangerous water level thresholds, and the prediction curve of water level evolution in future time periods, advanced dynamic early warning signals and estimated remaining overflow time are output.
2. The urban floodwater depth generation-based monitoring and early warning method according to claim 1, characterized in that, The process of efficiently fine-tuning the parameters of a pre-trained image segmentation model using the flood-specific dataset to output a converged image segmentation model includes: The pre-trained segmentation model is fine-tuned in terms of structure configuration. The weights of the cue encoder and mask decoder of the pre-trained segmentation model are frozen. A bypass low-rank decomposition matrix is injected only into the visual transformer image encoder block of the pre-trained segmentation model to obtain the segmentation model after structure configuration. The pre-trained weights of the all-segmentation model after the structure configuration are quantized and compressed to obtain the all-segmentation model to be fine-tuned; The flood-specific dataset is used to perform forward propagation inference on the segmentation model to be fine-tuned, and the predicted binary mask is output. A weighted combined loss value is obtained by performing joint loss calculation on the predicted binarized mask and the real binarized mask labels in the flood-specific dataset. The weighted combined loss value is used for backpropagation to update the parameters of the side path low-rank decomposition matrix in the image segmentation model to be fine-tuned, and the image segmentation model after training convergence is output.
3. The urban floodwater depth generation-based monitoring and early warning method according to claim 1, characterized in that, The process involves geometric reconstruction and depth calculation based on the binary mask of the damaged tire at various time points, outputting the absolute physical values of the water depth at multiple time points, including: Noise-resistant feature points are extracted from the binary mask of the incomplete tire at each time point, and multiple key feature points and water surface tangent height are output at each time point. Perform complete geometric contour inversion and reconstruction on multiple key feature points at each time point, and output the reconstructed tire pixel radius and center coordinates at each time point; The reconstructed tire pixel radius, center coordinates, water surface tangent height, and preset real physical diameter of passenger car tires at each time point are subjected to physical scale transformation and water depth calculation, and the absolute physical values of water depth at multiple time points are output.
4. The urban floodwater depth generation-based monitoring and early warning method according to claim 1, characterized in that, The process involves residual decoupling time-series prediction and advanced dynamic early warning based on the absolute physical values of water depth at multiple times and a preset dangerous water level threshold, outputting a predicted water level evolution curve for future periods, an advanced dynamic early warning signal, and the estimated remaining overflow time, including: Linear confluence trend parameter estimation and prediction are performed on the absolute physical values of water depth at multiple times, and the linear trend prediction value for future times is output. The time series of fitting residuals in the historical sliding window sequence is obtained by calculating the point-by-point difference between the linear fitting values in the historical sliding window sequence and the absolute physical values of water depth at the corresponding time. The fitted residual time series is modeled and predicted using nonlinear abrupt change residuals, and the predicted nonlinear residual values for future times are output. The nonlinear residual prediction value and the linear trend prediction value at the future time are explicitly algebraically summed to obtain the final accurate prediction value of the water depth at the future time. The final accurate prediction of the water depth at the future time is extrapolated in multiple steps to output the water level evolution prediction curve for the future period. A forward warning determination is made based on the predicted water level evolution curve for the future period; If the future water level evolution prediction curve shows that the future water level is greater than the preset dangerous water level threshold, an advanced dynamic trend warning signal is generated, and the time difference between the moment when the water level in the future water level evolution prediction curve first exceeds the preset dangerous water level threshold and the current moment is determined as the estimated remaining overflow time.
5. A city floodwater depth generation-based monitoring and early warning system, characterized in that, include: The acquisition module is used to acquire a set of real flood images from multiple sources without constraints, and to process the set of real flood images from multiple sources without constraints using the Lagrange interpolation function and annotation tools according to the spatial perspective transformation matrix, and output a flood-specific dataset. The fine-tuning module is used to efficiently fine-tune the parameters of the pre-trained image segmentation model using the flood-specific dataset, and output the image segmentation model after training convergence. The reconstruction and depth calculation module is used on the edge computing chip at the camera end to perform inference segmentation on the flood image to be tested at multiple time points using the image segmentation model after training and convergence, to obtain the incomplete tire binarization mask at each time point, and to perform geometric reconstruction and depth calculation based on the incomplete tire binarization mask at each time point, and output the absolute physical value of the water depth at multiple time points. The prediction and early warning module is used on the edge computing chip at the camera end to perform residual decoupled time-series prediction and advanced dynamic early warning based on the absolute physical values of water depth at multiple times and the preset dangerous water level threshold, and output the water level evolution prediction curve for future time periods, the advanced dynamic early warning signal and the estimated remaining overflow time. The acquisition module is specifically used for: The spatial perspective transformation matrix and the Lagrange interpolation function are used to perform perspective distortion elimination and pixel missing repair on the multi-source unconstrained viewpoint flood real image set, and output the orthorectified frontal plane image set. The polygonal edges of the damaged tires exposed above the water surface in the orthorectified frontal plane image are annotated using a labeling tool and converted into a binary mask to obtain multiple image mask pairs. Perform geometric and color transformations on multiple image mask pairs to output a flood-specific dataset.
6. An electronic device, characterized in that, The system includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the urban flooding depth generation monitoring and early warning method as described in any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the urban flood water depth generation monitoring and early warning method as described in any one of claims 1-4.
8. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the urban flooding depth generation monitoring and early warning method as described in any one of claims 1-4.