Water accumulation detection method based on dynamic library and residual analysis, medium and equipment

By constructing a dynamic baseline and residual analysis method for water accumulation detection, the problems of insufficient generalization ability and high false alarm rate in existing technologies are solved, and high accuracy and robustness of water accumulation detection are achieved in complex environments.

CN122157170AActive Publication Date: 2026-06-05BEIJING QIDAISONG TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING QIDAISONG TECH CO LTD
Filing Date
2026-05-08
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing water accumulation detection methods lack generalization ability in complex and ever-changing real-world monitoring environments, have a high false alarm rate, and lack effective utilization of spatiotemporal prior information, resulting in fragmented and unstable detection results.

Method used

A water accumulation detection method based on a dynamic baseline is constructed. Historical image data is collected through visual perception nodes to establish a normal feature baseline. Multi-dimensional context label indexing is used to finely characterize the range of visual feature changes under different environmental scenarios, remove interference from normal environments, extract abnormal water accumulation features using residual analysis, and combine water accumulation anomaly evolution patterns for detection.

Benefits of technology

It significantly reduces the false alarm rate, improves the accuracy and robustness of detection, has strong adaptability, can effectively distinguish between normal environmental interference and real water accumulation, and improves the stability and accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122157170A_ABST
    Figure CN122157170A_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer vision and intelligent security technology, especially relates to a kind of ponding detection method, medium and equipment based on dynamic base library and residual analysis, by constructing normal feature base library containing multiple normal feature subspaces, the range of visual feature change under different normal scenes can be finely described;By selecting the matching target feature subspace according to the context label, the normal reference standard most suitable for the environment is called for each frame of image, the environmental adaptability is improved;By taking the difference between the original feature and the reconstructed feature as a single-frame abnormal residual feature, the normal environment interference is stripped, and the ponding anomaly is extracted, which fundamentally reduces the false alarm rate;By combining the spatial domain physical performance of residual feature and the time domain evolution law for comprehensive judgment, the true and false anomalies are effectively distinguished, and the detection accuracy and robustness are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and intelligent security technology, and in particular to a method, medium and equipment for detecting water accumulation based on dynamic bottom pool and residual analysis. Background Technology

[0002] In the fields of flood control, drainage, and urban security, the use of widely deployed road, tunnel, and community surveillance cameras for automatic water accumulation detection has become a major technical means. Existing water accumulation detection methods mostly employ deep learning-based object detection or image segmentation models, achieving identification by directly learning the visual appearance features of "water accumulation" areas.

[0003] However, in complex and ever-changing real-world surveillance environments, the installation angles of different surveillance cameras, the materials of the background road surface (asphalt, cement), surrounding obstructions, and lighting conditions vary greatly. It is difficult to cover all scenarios with a single model, which limits the generalization ability of existing technologies. When models trained for specific scenarios are applied to new cameras, their detection performance drops sharply, resulting in poor adaptability.

[0004] Furthermore, in real-world scenarios, the visual characteristics of "normal environmental changes" such as the reflection of vehicle headlights on the ground at night, the reflection of glass curtain walls of surrounding buildings, the swaying shadows of trees in the wind, and the normal wetness of the road surface after rain are extremely similar to those of real water accumulation. Existing "end-to-end" direct detection methods lack the ability to distinguish between the above-mentioned normal environmental interferences and the characteristics of truly abnormal water accumulation. Complex environmental interferences lead to a high false alarm rate, resulting in a large number of invalid alarms generated by the system, which seriously affects the reliability of flood control scheduling.

[0005] Meanwhile, existing technologies often rely on isolated single-frame images for judgment, ignoring the temporal continuity of the water accumulation process (such as the need for abnormal states to persist for a period of time) and the spatial regularity (such as the fact that it often occurs in low-lying areas and historically flood-prone areas). This lack of effective utilization of spatiotemporal prior information leads to fragmented and unstable detection results.

[0006] Therefore, how to reduce the false alarm rate of water accumulation detection in complex dynamic environments and improve the accuracy and robustness of detection results has become an urgent problem to be solved. Summary of the Invention

[0007] To address the aforementioned technical problems, the present invention employs a water accumulation detection method based on dynamic bottom reservoir and residual analysis, which includes the following steps: S1. Based on historical image data collected by visual perception nodes within historical time periods, a normal feature base library is constructed. The normal feature base library contains several normal feature subspaces, and each normal feature subspace corresponds to the range of visual feature changes under a normal environmental scenario.

[0008] S2, when a series of real-time image frames corresponding to the visual perception node are acquired, for each real-time image frame, a target feature subspace matching the context label of the current scene is selected from the normal feature base library according to the context label of the current scene corresponding to the current real-time image frame.

[0009] S3, map the current real-time image frame to the target feature subspace for feature reconstruction, obtain the reconstructed feature vector of the current real-time image frame in the target feature subspace, and take the difference component between the original feature vector and the reconstructed feature vector of the current real-time image frame as the single-frame abnormal residual feature corresponding to the current real-time image frame.

[0010] S4. Based on the single-frame abnormal residual features corresponding to each real-time image frame and the preset water accumulation abnormal evolution mode, perform water accumulation risk detection on the current scene of the visual perception node to obtain water accumulation detection results. The preset water accumulation abnormal evolution mode includes at least the distribution features of the single-frame abnormal residual features in the spatial domain and the change features in the temporal domain.

[0011] The present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described method for detecting water accumulation based on dynamic base and residual analysis.

[0012] The present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0013] This invention has at least the following beneficial effects: By constructing a normal feature base library containing multiple normal feature subspaces using historical image data, the system can finely characterize the range of visual feature changes under different normal environmental scenarios using multi-dimensional context labels as indexes, providing a rich reference base for subsequent accurate extraction of normal components; by selecting matching target feature subspaces from the normal feature base library based on context labels, each real-time image frame can call the normal reference standard that best fits its external environmental conditions, avoiding subspace mismatches caused by environmental fluctuations and improving the environmental adaptability of the detection; by combining the original feature vector with... The difference components of the reconstructed feature vector serve as single-frame anomalous residual features, allowing normal environmental interferences such as changes in illumination, shadow displacement, and reflections from normal wet road surfaces to be stripped away and retained in the reconstructed components. Meanwhile, anomalous visual changes caused by water accumulation are extracted into the residual components, fundamentally reducing the false alarm rate in complex environments. By combining single-frame anomalous residual features with a preset water accumulation anomaly evolution pattern for water accumulation risk detection, the judgment process simultaneously considers the physical manifestation of single-frame residual features in the spatial domain and their persistence and evolution in the temporal domain, achieving effective differentiation between true and false anomalies and significantly improving the accuracy and robustness of water accumulation detection. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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 of a water accumulation detection method based on dynamic bottom reservoir and residual analysis provided in Embodiment 1 of the present invention. Detailed Implementation

[0016] 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, and 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.

[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is understood that, where appropriate, the terms used to distinguish similar objects can be interchanged so that the invention can also be implemented in other embodiments besides the illustrated or described embodiments. Furthermore, the terms "including," "having," and any variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0018] Example 1 This first embodiment provides a water accumulation detection method based on dynamic bottom reservoir and residual analysis, such as... Figure 1 As shown, it includes the following steps: S1. Based on historical image data collected by visual perception nodes within historical time periods, a normal feature base library is constructed. The normal feature base library contains several normal feature subspaces, and each normal feature subspace corresponds to the range of visual feature changes under a normal environmental scenario.

[0019] Among them, visual perception nodes are surveillance camera devices that are deployed in specific physical locations, have a fixed field of view, and continuously collect image data, including but not limited to fixed image acquisition devices such as road surveillance cameras, tunnel entrance and exit cameras, community security cameras, and underpass monitoring cameras.

[0020] Each visual perception node corresponds to a unique physical installation location and a fixed shooting angle, and the background elements (road surface, buildings, markings) in its image remain basically unchanged. Since there are significant differences in background material (asphalt road surface, cement road surface), lighting conditions, and distribution of obstructions among different nodes, a normal feature base is independently constructed and maintained using a single visual perception node as the basic unit to achieve adaptive detection.

[0021] Historical time periods are continuous time intervals used to collect historical image data when constructing a normal feature base library. They typically cover one or more complete environmental change cycles to provide sufficient and diverse training samples, so that the extracted normal feature subspace can fully represent the normal fluctuation range of the scene.

[0022] Normal environmental scenarios include, but are not limited to, combinations of different time conditions (day and night, dawn and dusk), different weather conditions (sunny, cloudy, rainy, and post-rain), and different lighting conditions (front lighting, backlighting, and shadow occlusion). Under normal environmental scenarios, visual fluctuations may appear in the image, such as changes in light intensity, shadow displacement, headlight reflections, glass curtain wall reflections, and diffuse reflections from normally wet roads after rain. These are all considered "normal disturbance fluctuations" and should be covered and interpreted by the normal characteristic database. For example, historical monitoring data from the past 7 to 30 days is generally selected to ensure sufficient coverage of normal environmental change samples (such as sunny days, cloudy days, rainy days, and day-night cycles). Simultaneously, image data from periods confirmed to have no water accumulation events are prioritized to avoid incorrectly including actual water accumulation characteristics into the normal baseline.

[0023] The range of visual feature changes refers to the normal fluctuation amplitude and directional boundary of the image acquired by the visual perception node in the feature vector space. Any normal image belonging to this scene can be effectively represented by the linear combination of principal component directions in this normal feature subspace. However, the feature vector of an image containing abnormal changes (such as water accumulation) will deviate from this normal feature subspace, resulting in a large reconstruction error.

[0024] In one specific embodiment, S1 includes the following steps: S11, Obtain the historical image sequence of the visual perception node under each context label.

[0025] S12, for any historical image sequence corresponding to a context label, extract features from each frame of the historical image in the current historical image sequence to obtain the original feature vector corresponding to each frame of the historical image.

[0026] S13 performs dimensionality reduction on all original feature vectors corresponding to the current historical image sequence, and extracts several principal component directions that represent normal disturbance fluctuations in the corresponding scene.

[0027] S14, the extracted principal component directions are used to span a feature space, which serves as the normal feature subspace corresponding to the current context label.

[0028] S15. Based on the normal feature subspaces corresponding to all context labels, a normal feature base library is constructed.

[0029] Context labels are classification identifiers used to describe the external environmental conditions during historical image acquisition. Serving as index keys, they divide massive amounts of historical image data into subsets with similar environmental characteristics, facilitating subsequent modeling of different scenarios. A historical image sequence is a collection of historical image frames continuously acquired by visual perception nodes under specific context label conditions.

[0030] In this embodiment, the preset dimensions of the context labels include at least a time dimension, a meteorological dimension, and a lighting dimension. The time dimension includes: for example, "daytime" (06:00-18:00), "nighttime" (18:00-06:00 the next day), and "morning and evening rush hours" (07:00-09:00, 17:00-19:00). The meteorological dimension includes: for example, "sunny," "cloudy," "light rain," and "freshly damp after rain." The lighting dimension includes: for example, "front lighting," "backlighting," and "normal lighting."

[0031] Specifically, by automatically or semi-automatically labeling the massive amounts of historical monitoring data collected, a mapping database of "label → image sequence" is established. For example, the system reads the shooting time of video files and simultaneously accesses a meteorological data interface to obtain weather information, automatically labeling each frame of the image with combined tags such as "nighttime - after rain - backlight".

[0032] The original feature vector is a mathematical representation that transforms the overall visual information of a frame of an image into a set of multi-dimensional numerical values. It is used to transform unstructured image data into a structured numerical vector that can be processed by a computer. Specifically, it can be extracted using traditional computer vision features (such as HOG, LBP texture features, and color histograms) or deep learning features (such as using pre-trained ResNet or ViT models to extract and flatten deep feature maps), which will not be elaborated further here.

[0033] Principal component directions are the orthogonal basis vectors with the largest data variance in the reduced-dimensional space. They are used to define the boundaries of "normal variation". Correspondingly, the movement of data in the principal component directions is considered "normal".

[0034] Normal disturbance fluctuations refer to non-abnormal visual changes that occur repeatedly in a scene without water accumulation, including: changes in road surface brightness caused by changes in sunlight intensity, shadow displacement caused by the movement of clouds or tree branches, and diffuse reflection caused by the water film on the road surface after rain that has not yet dried.

[0035] Taking principal component analysis (PCA) as an example, all original feature vectors are combined into a matrix. By calculating the eigenvalues ​​and eigenvectors of the covariance matrix, the top K eigenvectors that can explain most of the data variance (e.g., the first 95%) are identified. These K eigenvectors are the principal component directions. For example, in a "nighttime-after-rain" scene, the original feature vectors of 1000 normal images, after PCA, reveal that the first three principal component directions explain: the first principal component: changes in reflectivity due to ground wetness (accounting for 60% of the variance); the second principal component: momentary brightening of the road surface caused by passing headlights (accounting for 25% of the variance); and the third principal component: the slow darkening process caused by water evaporation (accounting for 10% of the variance). These changes are frequent "normal disturbances" in this scene, while the disappearance of texture due to waterlogging of road markings is not within these principal component directions and will be considered "abnormal".

[0036] Zhang Cheng's feature space refers to the set of all vectors that can be covered by a linear combination of the extracted K principal component directions as a basis, used to quantify the "normal range". Any normal image can find a corresponding representation in this subspace, while abnormal images cannot be completely contained within this subspace.

[0037] As described above, by introducing multi-dimensional context labels and independently constructing a normal feature base library on a single node basis, the normal feature base library can accurately depict the normal change patterns under different external conditions, adapt to the unique background and perspective of each monitoring point, and overcome the shortcomings of traditional global models such as poor generalization ability and frequent false alarms.

[0038] S2, when a series of real-time image frames corresponding to the visual perception node are acquired, for each real-time image frame, a target feature subspace matching the context label of the current scene is selected from the normal feature base library according to the context label of the current scene corresponding to the current real-time image frame.

[0039] Since the normal feature base library has been constructed into multiple independent subspaces according to different context labels, the environmental conditions of the real-time image determine which subspace can most accurately describe the normal variation range of the current scene. By calculating the similarity between the context label of the current scene and the corresponding label of each target feature subspace, the subspace can be called on demand, ensuring that the reference standard that best fits the current reality is used when stripping normal components.

[0040] A series of real-time image frames are a sequence of images acquired sequentially by visual perception nodes at consecutive time points, such as video frames within the last 3 seconds. These frames provide a temporal data foundation for extracting temporal variation features, enabling detection to not only rely on single-frame spatial features but also capture the persistence of abnormal events.

[0041] Specifically, the system acquires multiple consecutive frames of monitoring images in real time. For each real-time image frame, the system automatically obtains the current time information and accesses the meteorological data interface to obtain weather and illumination information, combining them into a context label. Subsequently, this context label is compared one by one with the context labels corresponding to all target feature subspaces in the normal feature base database, the matching degree is calculated, and the target feature subspace with the highest matching degree is selected as the output.

[0042] In one specific embodiment, S2 includes the following steps: S21, acquire a series of real-time image frames corresponding to the visual perception nodes.

[0043] S22, for each real-time image frame, extract the current time information, current weather information and current illumination information corresponding to the current real-time image frame to form the context label of the current scene.

[0044] S23, calculate the matching degree between the context label of the current scene and the context label corresponding to each normal feature subspace in the normal feature base library.

[0045] S24, the normal feature subspace with the highest matching degree is determined as the target feature subspace.

[0046] The system uses a sliding window to acquire the most recent N frames from the video stream. The value of N can be set according to the actual computing power and detection sensitivity requirements, for example, N=10 frames. Whenever a new frame arrives, the window slides forward, removing the oldest frame, keeping the window always containing the latest N consecutive frames.

[0047] Upon receiving each real-time image frame, the system simultaneously acquires its timestamp, calls the meteorological interface, and analyzes the image's illumination attributes, concatenating these three elements into a structured tag string or vector.

[0048] A multi-dimensional label weighted matching method is employed, with preset weight values ​​for each preset dimension (time, weather, and illumination), the sum of which is 1. For example, the weight for the time dimension is set to 0.3, the weight for the weather dimension to 0.5, and the weight for the illumination dimension to 0.2. The values ​​of the current context label in each preset dimension are compared for consistency with the values ​​of the context labels corresponding to the normal feature subspace in the corresponding preset dimension. If they match, the score for that preset dimension is its weight value; otherwise, 0 points are awarded. Finally, the scores of all preset dimensions are summed to obtain the matching degree.

[0049] Traverse all normal feature subspaces in the normal feature base library, perform matching degree calculation for each normal feature subspace, and select the one with the largest matching degree value as the target feature subspace.

[0050] It should be noted that if multiple normal feature subspaces have the same highest matching degree, they can be selected according to the preset priority rules (such as prioritizing the subspace with higher matching degree in the illumination dimension) or randomly selected.

[0051] The above-mentioned method extracts time, weather and light information in real time to form context labels and calculates the matching degree with each normal feature subspace. This ensures that each detection calls the normal reference standard that best fits the current environment, which significantly reduces false alarms caused by sudden changes in light and weather, and balances detection sensitivity and stability.

[0052] S3, map the current real-time image frame to the target feature subspace for feature reconstruction, obtain the reconstructed feature vector of the current real-time image frame in the target feature subspace, and take the difference component between the original feature vector and the reconstructed feature vector of the current real-time image frame as the single-frame abnormal residual feature corresponding to the current real-time image frame.

[0053] The target feature subspace is spanned by the principal component directions that represent changes in a normal scene. The feature vector of any normal image can be effectively represented in this subspace. However, for images with abnormal changes such as water accumulation, some of their feature components will deviate from the target feature subspace and cannot be covered by the linear combination of the principal component directions, thus resulting in a large reconstruction error.

[0054] Therefore, through projection, reconstruction, and subtraction operations, the real-time image is decomposed into two parts: normal components (preserved in the reconstructed feature vector) and abnormal residuals (preserved in the difference components).

[0055] In one specific embodiment, S3 includes the following steps: S31, Project the original feature vector of the current real-time image frame onto the principal component direction of the target feature subspace to obtain the reconstructed feature vector after projection.

[0056] S32, calculate the reconstruction error between the original feature vector and the reconstructed feature vector, and use the reconstruction error as the single-frame abnormal residual feature corresponding to the current real-time image frame.

[0057] The original feature vector is a multi-dimensional numerical vector obtained by processing the current real-time image frame through a feature extractor.

[0058] Specifically, suppose the target feature subspace consists of K principal component direction vectors u1, u2, ..., u K Zhang Cheng, the original feature vector of the current real-time image frame is x (the dimension is the same as the principal component direction vector).

[0059] The projection calculation process is as follows: First, the projection of the original eigenvector x in the i-th principal component direction is calculated using the vector dot product. iProjection coefficients (i.e., coordinate values) on the surface. Where i = 1, 2, ..., K; then, the corresponding principal component directions are weighted and summed using each projection coefficient to obtain the reconstructed feature vector. This allows for the extraction of normal scene components from the original image, including normal interference information such as lighting changes, shadow displacement, and normal road surface reflections that are covered by the base database.

[0060] Reconstruction error is a measure of the difference between the original feature vector and the reconstructed feature vector. It is usually expressed as the magnitude of the vector difference (such as Euclidean distance or Manhattan distance) or the sum of the absolute values ​​of the element-wise differences, and is used to quantify the degree to which the current image "deviates from the normal range". Correspondingly, the residual information extracted from a single-frame real-time image that cannot be interpreted by the target normal feature subspace is used as the single-frame abnormal residual feature, which serves as the core input feature for subsequent water accumulation risk assessment. Among them, the single-frame abnormal residual feature is a multi-dimensional vector (or can be further transformed into a residual map corresponding to the original image space), and the larger the dimension or region, the more significant the abnormal changes.

[0061] As described above, by projecting real-time image frames onto the target feature subspace for feature reconstruction, normal environmental interference is accurately removed. Then, the reconstruction error is used as the single-frame abnormal residual feature to extract the abnormal visual changes caused by water accumulation. This transforms the complex target detection problem into a simple residual analysis problem, greatly simplifying the detection logic and improving the detection accuracy.

[0062] S4. Based on the single-frame abnormal residual features corresponding to each real-time image frame and the preset water accumulation abnormal evolution mode, perform water accumulation risk detection on the current scene of the visual perception node and obtain water accumulation detection results.

[0063] The preset water accumulation anomaly evolution mode includes at least the distribution characteristics of single-frame anomaly residual features in the spatial domain and the variation characteristics in the temporal domain.

[0064] The magnitude of a simple residual is easily affected by occasional strong disturbances (such as the instantaneous direct glare from a vehicle's headlights). True water accumulation possesses distinct physical and optical characteristics (such as the disappearance of textures in the covered area, the formation of continuous mirror surfaces, and the submersion of object edges) and temporal evolution patterns (such as persistent presence and gradual expansion of the water area with rainfall). Therefore, by using a pre-defined water accumulation anomaly evolution model, residual features are mapped to feature dimensions with clear physical meaning, enabling effective differentiation between "true anomalies" and "false anomalies."

[0065] In one specific embodiment, the distribution characteristics of the abnormal residual features in the spatial domain include at least one of a first spatial feature, a second spatial feature, and a third spatial feature, wherein the first spatial feature is the degree of attenuation and disappearance of the road surface bottom texture features, the second spatial feature is the degree of spatial continuity and intensity surge of the specular reflection area, and the third spatial feature is the degree of local truncation and submersion of the edge contour of the fixed reference object.

[0066] In dry or only slightly wet road surfaces, the microscopic undulations and material differences on the surface produce rich diffuse reflection, which appears as clear texture features in the image. When water accumulates on the road surface to a certain depth, the water surface isolates the road surface from the air. Light undergoes specular reflection or transmission on the water surface, and the direction of scattering changes, causing the details of the road surface texture captured by the camera to be significantly attenuated or even completely disappeared. This is a key characteristic that distinguishes water accumulation from "normally wet road surface after rain"—wet road surface only changes the reflectivity, and the texture is still discernible; water accumulation directly submerges the texture. Correspondingly, the degree of attenuation and disappearance of the underlying texture features of the road surface refers to the degree to which the underlying texture information (such as asphalt particles, cement joints, road markings, cracks, etc.) originally present in the road surface area is weakened or completely erased in the single-frame abnormal residual features.

[0067] Specifically, to extract the first spatial feature, in the feature map corresponding to the abnormal residual features of a single frame, the road surface region is first located using a key focus area or a pre-calibrated road surface mask. The residual features within this road surface region are then transformed in the frequency domain, for example using Fast Fourier Transform or Discrete Cosine Transform, to convert the spatial domain features to the frequency domain. In the frequency domain, texture information is concentrated in the mid-to-high frequency components. The total energy within a preset mid-to-high frequency band is calculated as the high-frequency component energy value of the current frame. Simultaneously, the baseline of normal texture energy for this scene is obtained from the normal feature base library. The attenuation ratio is further calculated as (baseline value - current value) / baseline value, and the result is truncated to the range of 0 to 1. The closer the attenuation ratio is to 1, the more severe the loss of road surface texture and the higher the probability of water accumulation.

[0068] The normal texture energy baseline refers to the reference value of the high-frequency component energy of the road surface area in the visual perception node image under normal scenes without water accumulation, and is stored in the normal feature base. It is obtained as follows: During the construction of the normal feature base, for each context label's corresponding historical image sequence, the road surface area feature map of each frame of historical images is first obtained using the same feature extraction method as in the online detection stage. This feature map is then subjected to frequency domain transformation (such as Fast Fourier Transform), and the sum of energy within the preset mid-to-high frequency band is calculated as the texture energy value of that frame. The texture energy values ​​of all normal historical images under that context label are statistically analyzed, and their mean and standard deviation are calculated. The mean is used as the normal texture energy baseline for that scene. This baseline is dynamically maintained as the normal feature base is incrementally updated.

[0069] Normally dry or wet road surfaces exhibit diffuse reflection under most lighting conditions, with a relatively uniform brightness distribution. When there is water on the road surface, the water surface forms a smooth mirror, producing directional specular reflection of light sources (such as streetlights, vehicle headlights, and the sky). From the camera's perspective, this area appears as a highly bright, highly contrasting, connected spot of light. Unlike "vehicle headlights directly illuminating the road surface," the specular reflection of water has spatial continuity (as patches rather than isolated points) and fixed position (it persists as long as the water surface exists, rather than as vehicles move). Correspondingly, the spatial continuity and intensity surge of the specular reflection area refer to whether the areas exhibiting high brightness features in a single frame of anomalous residual features form a spatially connected sheet-like structure, and the magnitude of the increase in reflection intensity in this area relative to the normal baseline.

[0070] Specifically, to extract the second spatial features, in the feature map corresponding to the single-frame abnormal residual features, the feature map is first binarized and segmented using a preset brightness threshold, extracting pixels with brightness values ​​exceeding the preset brightness threshold. Connected component analysis is then performed on the extracted bright pixels, marking each independent connected region. The connected region with the largest area is selected as the main reflection region, and its area (number of pixels) and spatial compactness (e.g., the ratio of area to the square of the perimeter) are calculated. Simultaneously, the average brightness value of the pixels within this largest connected region is calculated and compared with the brightness baseline of the same region in the normal feature base library to obtain the intensity increase ratio. Finally, the connected region area, compactness, and intensity increase are weighted and combined to output a comprehensive score within the range of 0 to 1. A higher score indicates a more significant specular reflection feature and a greater likelihood of water accumulation.

[0071] The brightness baseline refers to the average brightness reference value of each region in the visual perception node image under normal scenarios without water accumulation, and is stored in the normal feature base library. It is obtained as follows: during the construction of the normal feature base library, for each historical image sequence corresponding to each context label, each frame of the historical image is divided into regions (such as grid division or semantic segmentation), and the mean and standard deviation of pixel brightness for each region under normal conditions are calculated. The mean brightness of each region is used as the brightness baseline for that scene, and "mean + R times standard deviation" (e.g., R is 2.5) is used as the upper limit for subsequent highlight determination. This brightness baseline is dynamically maintained with the incremental updates of the normal feature base library.

[0072] A preset brightness threshold is used to determine whether pixels in the abnormal residual feature map belong to the specular reflection brightness region. It is obtained by taking a preset multiple of the brightness baseline as the threshold, for example, setting it to 1.5 to 2.0 times the brightness baseline of the same region. Preferably, the brightness baseline + 3 standard deviations is used as the brightness threshold. This value statistically corresponds to the upper limit of the normal brightness fluctuation range. Pixels exceeding this value have an extremely low probability of appearing in normal scenes, and can effectively characterize abnormal brightness caused by specular reflection from accumulated water.

[0073] The weights of the area, compactness, and intensity increase can be set by the implementer according to the actual situation, and do not constitute a limitation on the scope of protection of this application.

[0074] When there is no standing water, a clear optical boundary (edge ​​gradient) exists between the fixed reference object and the road surface. When standing water covers the bottom or the entire reference object, the specular reflection of the water surface or the occlusion effect of the water itself will disrupt this boundary, causing the edge contour to appear "truncated" or "disappeared" in the residual feature map. This feature is an important basis for distinguishing between "standing water" and "simple road surface reflection". That is, simple reflection will not change the physical boundary of the reference object, while standing water, due to its depth, will submerge the reference object from the bottom up. Correspondingly, the degree of local truncation and submersion of the edge contour of the fixed reference object refers to the degree to which the contour edge of a fixed reference object (such as curbstone, bollard, speed bump, and ground marking edge) in a single frame of anomalous residual features is partially or completely covered or occluded by the anomalous residual area.

[0075] Specifically, to extract third-space features, fixed reference objects in the visual perception node image are pre-calibrated to generate reference object contour templates, which are then stored in the normal feature database. These fixed reference objects include, but are not limited to, curb edge lines, bollard bounding boxes, and speed bump contours. During the online detection phase, in the feature map corresponding to the single-frame abnormal residual features, the edge gradient intensity is extracted along each sampling point of the contour template. The gradient magnitude can be calculated using the Sobel or Canny operator. The gradient intensity of each sampling point is compared with the normal gradient baseline of that point in the normal feature database. If it is lower than a certain percentage (e.g., 50%) of the normal gradient baseline, the edge at that sampling point is determined to be truncated or submerged. Furthermore, the cumulative length of consecutively truncated contour segments is calculated segment by segment along the contour, divided by the total length of the reference object contour to obtain a truncation degree value, ranging from 0 to 1. A larger truncation degree value indicates a higher degree of submersion of the reference object.

[0076] The normal gradient baseline refers to the reference values ​​of edge gradient intensity at each sampling point of the fixed reference object contour in the visual perception node image under normal scenes without water accumulation, and is stored in the normal feature base library. It is obtained as follows: During the construction of the normal feature base library, for each historical image sequence corresponding to each context label, the same edge detection operator as in the online detection stage is used to calculate the gradient magnitude of each sampling point on the fixed reference object contour template in each frame of historical images. The mean and standard deviation of the gradient magnitude of each sampling point in all normal historical images are statistically analyzed, and the mean is used as the normal gradient baseline for that sampling point. This baseline is dynamically maintained with the incremental updates of the normal feature base library.

[0077] In one specific implementation, the variation characteristics of the abnormal residuals in the time domain include: The number of frames and the rate of change of region area of ​​the abnormal residual feature in a series of real-time image frames.

[0078] Among them, the temporal variation features are used to describe the dynamic evolution of the single-frame abnormal residual features over time, reflecting the temporal persistence of water accumulation as a physical event, including the number of frames in which the abnormal residual features are maintained and the rate of change of the area in several consecutive real-time image frames.

[0079] Real-world water accumulation is a physical phenomenon and does not disappear instantly. Unless the rainfall stops and drainage is rapid, the water accumulation area will remain stable across multiple frames of images. In contrast, occasional disturbances such as headlight reflections, pedestrian shadows, and birds flying by typically disappear within 1 to 3 frames. By detecting the number of sustained frames for anomalous features, short-term transient disturbances can be effectively filtered out. Correspondingly, the number of sustained frames refers to the number of frames in which anomalous residual features with similar spatial domain distribution characteristics (such as texture attenuation or specular reflection characteristics in the same region) are continuously detected across several consecutive real-time image frames.

[0080] Specifically, to extract the maintenance frame count, after obtaining the single-frame anomaly residual features of each frame, the anomaly residual features of each single frame are first thresholded to extract the significantly anomalous binarized regions, and the geometric attributes such as the area and centroid coordinates of each anomaly region are recorded. Spatiotemporal correlation matching is performed on the anomaly regions of adjacent frames. The intersection-union ratio (IUR) between each anomaly region in frame t and each anomaly region in frame t+1 is calculated, which is the ratio of the intersection area to the union area of ​​two anomaly regions. When the IUR is greater than a preset threshold, the two anomaly regions are determined to be a continuation of the same anomaly event, and a matching association is established. An anomaly event chain is maintained based on the matching results. When a new anomaly region cannot match any known event in the previous frame, a new event record is created and counting begins; when a successful match is achieved, the duration frame count of the corresponding event is incremented by 1. If an event fails to match any subsequent region within several consecutive frames, the event is determined to terminate. To enhance robustness, a fault-tolerant frame count (e.g., 2 frames) can be set, allowing events to resume matching even after brief interruptions (such as being obscured by pedestrians), thus preventing the maintenance frame count from erroneously dropping to zero. Ultimately, the current cumulative frame count for each active anomalous event is the maintenance frame count at that moment, used for subsequent temporal confidence assessment.

[0081] The specific value of the preset ratio threshold can be adaptively adjusted according to the actual application scenario (such as camera frame rate, installation height, water accumulation detection sensitivity requirements, etc.), for example, it can be set to 0.4.

[0082] During rainfall, the area covered by actual water accumulation typically expands slowly (accumulating with rainfall); after the rainfall stops, it may slowly shrink (evaporating as water drains). This gradual change is fundamentally different from the rapid movement of light spots caused by moving vehicle headlights or the instantaneous change in shadows caused by pedestrians walking by. By analyzing the area change rate, water accumulation and dynamic interference can be further distinguished. Correspondingly, the area change rate refers to the rate of change of the area of ​​the abnormal residual feature region corresponding to the same abnormal event across several consecutive real-time image frames, expressed as "percentage of area change between frames" or "area change per unit time".

[0083] Specifically, to extract the area change rate, after establishing anomaly event chains through spatiotemporal correlation matching, the area of ​​the connected regions of each anomaly event in each frame is recorded synchronously. For the same anomaly event, its area value in two adjacent frames is obtained, the area difference is calculated, and divided by the time interval between the two frames to obtain the instantaneous inter-frame area change rate, while the direction of area change (expansion or contraction) is recorded. To reduce single-frame noise interference, a sliding window can be used to perform mean filtering on the instantaneous change rate of several consecutive frames, and the smoothed value can be used as the area change rate feature at the current moment. Linear fitting can also be performed on the area sequence over a period of time, and the slope of the fitted line can be used to characterize the average area change trend of the event. To eliminate the influence of scale differences between different scenes, the area change rate can be normalized by dividing by the initial area of ​​the event to obtain the relative area change rate. Real water accumulation during rainfall usually shows a slow expansion trend, with a small and stable relative area change rate; while dynamic interference such as headlight spots show instantaneous and drastic changes, thus achieving effective differentiation.

[0084] The above-mentioned method extracts spatial domain features such as road surface texture attenuation, specular reflection intensity and continuity, and reference object edge truncation, so that anomaly analysis is directly related to the physical and optical properties of water accumulation, effectively distinguishing water accumulation from interference such as reflection and shadow. By introducing maintenance frame count and area change rate as temporal features, transient interference is filtered from the time dimension, ensuring that only real water accumulation passes the verification, significantly reducing occasional false alarms, and making the detection have both high sensitivity and high specificity.

[0085] In one specific embodiment, S4 includes the following steps: S41, for each real-time image frame, extract the distribution characteristics of the single-frame abnormal residual features in the spatial domain and the variation characteristics in the temporal domain of the features corresponding to the current real-time image frame.

[0086] S42, based on the prior information of the spatial geographic location corresponding to the visual perception node, delineate the key attention area in the current real-time image frame. The prior information of the spatial geographic location includes historical water accumulation event records and terrain elevation data. The key attention area is a closed polygonal area covering historically water-prone areas, low-lying areas, and areas surrounding drainage facilities.

[0087] S43, extract the distribution features and change features located in the key interest area from the distribution features and change features corresponding to the current real-time image frame.

[0088] S44. Input the distributed feature and the variable feature into the first preset scoring function and the second preset scoring function respectively to obtain the normal deviation score and the abnormal appearance conformity score. The first preset scoring function is used to output the normal deviation score according to the degree of deviation of the amplitude of the distributed feature from the normal range, and the second preset scoring function is used to output the abnormal appearance conformity score according to the degree of conformity between the variable feature and the preset water spread model.

[0089] S45, the normal deviation score, abnormal appearance conformity score and external support signals corresponding to visual perception nodes are fused to obtain a comprehensive risk score. The external support signals include at least time series confidence signals and meteorological coupling signals.

[0090] S46, when the comprehensive risk score is greater than the preset alarm threshold, the water accumulation detection result is determined to trigger a water accumulation alarm.

[0091] For each real-time image frame, two types of feature extraction tasks are performed in parallel. For spatial domain distribution features, the single-frame anomaly residual features of the current frame are analyzed at the pixel level or region level. The high-frequency texture energy attenuation ratio of the road surface area, the area and intensity increase of bright connected regions, and the edge truncation ratio of the fixed reference object contour are calculated, respectively, as the spatial domain distribution features of the current frame. For temporal variation features, based on the spatial domain distribution features of the current frame and several preceding consecutive frames (such as the area sequence of the same anomaly region), the number of frames the anomaly event has lasted and the area change rate between adjacent frames are calculated, as the temporal variation features of the current frame.

[0092] Prior spatial geographic information refers to pre-collected and stored geographic information data associated with the physical installation location of the visual sensing node. This data helps determine which areas in the image are more likely to experience water accumulation, thereby narrowing the analysis scope and reducing interference from non-focused areas. Historical water accumulation event records refer to the specific location coordinates of water accumulation events that have occurred at the visual sensing node in the past, obtainable from flood control history records or manual annotations. Elevation data refers to the ground elevation distribution data within the monitoring range of the visual sensing node, used to identify relatively low-lying areas where rainwater easily accumulates. The area surrounding drainage facilities refers to the location of drainage facilities such as storm drains, drainage ditches, and pump station inlets, and their surrounding buffer zones; these are key monitoring points for water accumulation.

[0093] The key focus area refers to one or more closed polygonal regions defined in the real-time image frame's coordinate system based on the aforementioned prior information. Anomalous features within this region will be analyzed with emphasis, while features outside the region will be ignored or have reduced weight. Specifically, during system initialization, one or more closed polygons are plotted in the static image of the visual perception node using a calibration tool, and their corresponding geographical attributes (such as "historically flood-prone areas" or "low-lying areas") are associated with them. The calibration results are converted into a pixel coordinate sequence and persistently stored. During online detection, the coordinates of the key focus area corresponding to the visual perception node are loaded, and a binary mask image is generated on the current real-time image frame. Pixels inside the polygon are marked as valid (value 1), and pixels outside are marked as invalid (value 0).

[0094] Distributional features refer to the feature values ​​in the spatial domain whose coordinates fall within the region of interest. For example, only the texture attenuation of the road surface within the region of interest is statistically analyzed, without considering features of the sky or building areas. Variational features refer to the feature values ​​in the temporal domain that are associated with anomalous events within the region of interest. For example, only the number of maintenance frames and the rate of area change of anomalous regions within the region of interest are tracked.

[0095] Specifically, spatial domain distribution features typically exist as feature maps of the same size as the original image. Using a mask image of the region of interest, the feature map corresponding to the spatial domain distribution features is multiplied by the mask image. Regions with a mask value of 1 retain their original feature values, while regions with a mask value of 0 have their feature values ​​set to zero. Temporal variation features are usually associated with specific anomalous regions. It is determined whether the centroid coordinates or circumscribed rectangle of the anomalous region overlaps sufficiently with the region of interest. If the overlap exceeds a preset overlap threshold, the variation features of the anomalous event are retained; otherwise, they are ignored. This extracts the distribution and variation features located within the region of interest, automatically masking interfering features from non-road areas (such as the sky, distant buildings, and moving vehicles), ensuring that subsequent scoring only targets road areas where water accumulation is truly likely. The specific value of the preset overlap threshold can be set by the implementer according to the actual situation; for example, it can be set to 60%.

[0096] The first preset scoring function is a mathematical mapping function used to quantify spatial domain distribution features into a "normal deviation score". Its input is the distribution features (such as texture attenuation ratio, specular reflection comprehensive score, and edge truncation ratio), and its output is a normal deviation score in the range of 0 to 1, reflecting the comprehensive degree of deviation of spatial abnormal features in the key areas of interest in the current image frame from the normal baseline. The higher the normal deviation score, the greater the difference between the current scene and the normal state in terms of spatial features, and the more obvious the spatial physical manifestation of water accumulation.

[0097] The second preset scoring function is a mathematical mapping function used to quantify temporal variation features into an "abnormal appearance conformity score." Its input consists of the changing features (such as the number of sustained frames and the rate of area change), and its output is an abnormal appearance conformity score ranging from 0 to 1. This reflects the degree of agreement between the temporal evolution of the current abnormal event and the preset water accumulation spread model. A higher abnormal appearance conformity score indicates that the duration and area change trend of the abnormal event are more consistent with the dynamic characteristics of real water accumulation.

[0098] A pre-defined flood spread model is an empirical model that describes the change in area of ​​real floodwater over time during rainfall. For example, under continuous rainfall, the flood area typically shows a slow increasing trend (the relative rate of change is positive and the value is small), while disturbances such as headlight spots exhibit instantaneous abrupt changes (sudden increases and decreases). Based on this physical law, the pre-defined flood spread model can be defined as an expected interval function of the area change rate. For example, during continuous rainfall, the expected area change rate is 0.5% to 2% per second; after the rainfall stops, the expected area change rate is -1% to 0% per second.

[0099] Specifically, this can be obtained through statistical analysis of video data from historical flooding events. Collect surveillance video clips of confirmed flooding, label the flooded area frame by frame, calculate the rate of change of area over time, and statistically analyze its mean and variance to determine the distribution range of the rate of change that conforms to the characteristics of flood spread.

[0100] External support signals refer to auxiliary judgment signals from third-party data sources, independent of the image data from the visual perception nodes. These signals provide cross-modal corroboration for water accumulation determination, enhancing the reliability of the detection results. They include at least temporal confidence signals and meteorological coupling signals. The temporal confidence signal is a confidence index reflecting the duration of an abnormal event, obtained by normalizing the number of frames maintained by the abnormal event. Its value ranges from 0 to 1; the longer the maintenance frame count, the higher the signal value. The meteorological coupling signal is an index reflecting the correlation between current meteorological conditions and water accumulation, obtained by matching real-time rainfall data of the spatial geographic area where the visual perception node is located with a preset water accumulation probability mapping curve. Its value ranges from 0 to 1; the greater the rainfall and the longer the duration, the higher the signal value.

[0101] The preset waterlogging probability mapping curve is a pre-constructed function curve describing the relationship between rainfall and the probability of waterlogging. Its input is real-time rainfall data (e.g., hourly rainfall, in millimeters per hour) for the area where the visual perception node is located, and its output is the prior probability value of waterlogging under that rainfall condition, ranging from 0 to 1. Specifically, the preset waterlogging probability mapping curve can be obtained through statistical analysis of historical rainfall records and corresponding waterlogging event logs for the area where the visual perception node is located. First, hourly rainfall data for the area over a past period (e.g., the past 3 years) and the occurrence of waterlogging events recorded during the same period are collected. Rainfall is divided into intervals (e.g., 0-5 mm / h, 5-10 mm / h, 10-20 mm / h, and above 20 mm / h), and the frequency of waterlogging events within each interval is calculated as "number of waterlogging events in the interval / total number of rainfall events in the interval," which is used as the waterlogging probability for that rainfall interval. A smoothing fit is then applied to the probability values ​​for each interval to obtain a monotonically increasing mapping curve. For visual perception nodes lacking historical data, experience curves from similar areas can be used, or the nodes can be manually set by domain experts based on drainage capacity assessments.

[0102] Furthermore, weight coefficients are pre-configured for each scoring dimension. These weight coefficients can be determined based on historical data statistical analysis or machine learning methods. Different weight configuration schemes can be adopted for different scenarios (such as different seasons or different rainfall types). For example, the weight of the normal deviation score is 0.35, the weight of the abnormal appearance conformity score is 0.35, the weight of the time series confidence signal is 0.15, and the weight of the meteorological coupling signal is 0.15, with the sum of all weights being 1.

[0103] The preset alarm threshold is a critical value for the comprehensive risk score used to distinguish between "water accumulation" and "non-water accumulation," for example, set to 0.65. When the comprehensive risk score exceeds this preset alarm threshold, it is determined that there is water accumulation in the current scene and an alarm is triggered, including sending alarm information to the monitoring center, overlaying a warning box on the monitoring screen, and triggering preset response operations such as starting the drainage pumping station; otherwise, it is determined that there is no water accumulation or observation continues.

[0104] As described above, by extracting spatial distribution features from the abnormal residual features of a single frame and calculating temporal variation features based on multiple consecutive frames, the abstract reconstruction error is transformed into a water accumulation characterization index with clear physical meaning. This effectively distinguishes real water accumulation from interference such as reflections and shadows, filters transient noise, and significantly reduces false alarms. By quantifying and scoring spatial and temporal features and weighting and fusing them with external support signals, a multi-dimensional comprehensive evaluation system is constructed, taking into account single-frame performance, temporal patterns, and meteorological conditions, thus achieving accurate and reliable determination of water accumulation risk.

[0105] In one specific embodiment, S41 includes the following steps: S411, for any real-time image frame, analyze the single-frame abnormal residual features corresponding to the current real-time image frame, and obtain at least one of the first spatial feature, the second spatial feature, and the third spatial feature as the distribution features of the current real-time image frame.

[0106] S412, based on the distribution characteristics corresponding to the current real-time image frame and the distribution characteristics corresponding to several consecutive real-time image frames preceding the current real-time image frame, calculate the number of maintenance frames and the rate of change of region area of ​​the distribution characteristics in the time series, and use them as the change characteristics of the current real-time image frame.

[0107] In one specific embodiment, S45 includes the following steps: S451, the real-time rainfall data of the spatial geographical location corresponding to the visual perception node is matched with the preset water accumulation probability mapping curve to obtain the meteorological coupling degree signal.

[0108] S452 compares the number of sustained frames with a preset duration threshold to obtain a timing confidence signal.

[0109] S453, according to the preset first weight, second weight, third weight and fourth weight, respectively, the normal deviation score, abnormal appearance conformity score, time series confidence signal and meteorological coupling degree signal are weighted and summed to obtain the comprehensive risk score.

[0110] The preset duration threshold refers to the critical number of frames or duration used to assess whether the persistence of an abnormal event reaches a credible level. It can be set as an absolute frame threshold (e.g., 15 frames) and / or a full-score frame threshold (e.g., 30 frames), or determined based on statistical analysis of historical flooding event video data. Specifically, surveillance video clips of confirmed flooding are collected, and the average number of frames required for flooding to develop into a clearly defined area, as well as the average duration of transient interference (e.g., headlights passing by, pedestrian shadows), are calculated. The preset duration threshold is set between the maximum duration of transient interference and the minimum number of frames required for flooding to form, thus effectively distinguishing between the two.

[0111] After normalizing the ratio of the number of sustained frames to the preset duration threshold, a time series confidence signal reflecting the reliability of the duration of the abnormal event is obtained. The value ranges from 0 to 1, and the longer the number of sustained frames, the closer the value of the time series confidence signal is to 1.

[0112] The first weight corresponds to the fusion weight coefficient of the normal deviation score, the second weight corresponds to the fusion weight coefficient of the abnormal appearance conformity score, the third weight corresponds to the fusion weight coefficient of the time series confidence signal, and the fourth weight corresponds to the fusion weight coefficient of the meteorological coupling signal. The sum of the four weight coefficients is 1. The specific value of each weight can be set according to the importance, reliability and actual application requirements of each dimension signal.

[0113] In one specific implementation, the weights can be set as follows: first weight 0.30, second weight 0.35, third weight 0.20, and fourth weight 0.15. In another implementation, the weights can be dynamically adjusted based on the context labels of the current scene. For example, in the early stages of rainfall, when the meteorological coupling degree signal is still unstable, the fourth weight can be reduced; when nighttime lighting conditions are poor, the reliability of visual features decreases, and the weight of the temporal confidence signal can be increased accordingly.

[0114] The above-mentioned approach achieves effective integration of multi-source heterogeneous information by matching real-time rainfall with water accumulation probability mapping curves to obtain meteorological coupling degree signals, comparing the number of maintenance frames with the duration threshold to obtain temporal confidence signals, and weightedly fusing the normal deviation score, abnormal appearance conformity score, and the above two signals. This enables the comprehensive risk score to take into account spatial anomalies, temporal evolution, event persistence, and meteorological conditions, avoiding the one-sidedness of single-dimensional judgment and significantly improving the accuracy and robustness of detection.

[0115] In one specific embodiment, the water accumulation detection method based on dynamic bottom reservoir and residual analysis further includes the following steps: S5, when the comprehensive score is less than or equal to the preset alarm threshold, the water accumulation detection result is determined to be no water accumulation.

[0116] S6 feeds back the real-time image frames and the context labels of the current scene to the historical image data to obtain updated historical image data.

[0117] S7 updates the normal feature base database based on the updated historical image data.

[0118] When the water accumulation detection result is no water accumulation, it indicates that the current image frame is a typical normal scene sample. The environmental features it contains (such as new lighting conditions, changes in road surface appearance due to seasonal changes, etc.) have positive value for enriching the normal scene database. At this time, the current real-time image frame and its context label are packaged and sent to the historical image data storage module, where they are persistently stored as new samples under the corresponding context label.

[0119] The database of routine features can be updated using incremental online updates or periodic offline reconstruction.

[0120] Incremental online update refers to reading the parameters (principal component direction vectors) of the original normal feature subspace corresponding to the context label, merging the feature vectors of the new samples with the feature vectors of the original samples, and using incremental principal component analysis or moving average update algorithms to incorporate the features of the new samples while retaining the original main information, thereby obtaining the updated principal component directions and updating the normal feature subspace. This method has low computational cost and is suitable for scenarios with high real-time requirements.

[0121] Periodic offline reconstruction refers to setting a fixed update cycle (such as weekly or monthly) and, during system idle periods, using updated historical image data to rebuild a completely new database of normal features and replace the original database. This method involves a large amount of computation, but it can more thoroughly adapt to long-term environmental changes such as seasonal changes and road renovations.

[0122] As described above, a normal feature base library containing multiple normal feature subspaces is constructed using historical image data. This allows the system to finely characterize the range of visual feature changes under different normal environmental scenarios using multi-dimensional context labels as indexes, providing a rich reference base for subsequent accurate extraction of normal components. By selecting matching target feature subspaces from the normal feature base library based on context labels, each real-time image frame can call upon the normal reference standard that best fits its external environmental conditions, avoiding subspace mismatches caused by environmental fluctuations and improving the environmental adaptability of the detection. By comparing the original feature vector with the reconstructed feature vector... The difference component of quantity, as a single-frame anomalous residual feature, allows normal environmental interferences such as changes in illumination, shadow displacement, and normal reflections from wet road surfaces to be stripped away and retained in the reconstructed component. Meanwhile, anomalous visual changes caused by water accumulation are extracted into the residual component, fundamentally reducing the false alarm rate in complex environments. By combining the single-frame anomalous residual features with a preset water accumulation anomaly evolution pattern for water accumulation risk detection, the judgment process simultaneously considers the physical manifestation of the single-frame residual features in the spatial domain and their persistence and evolution in the temporal domain, achieving effective differentiation between true and false anomalies and significantly improving the accuracy and robustness of water accumulation detection.

[0123] Example 2 Embodiment 2 of the present invention provides a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiment. The at least one instruction or at least one program is loaded and executed by the processor to implement the water accumulation detection method based on dynamic bottom pool and residual analysis provided in the above embodiment.

[0124] Example 3 Embodiment 3 of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium of Embodiment 2 of the present invention.

[0125] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A water accumulation detection method based on dynamic bottom reservoir and residual analysis, characterized in that, The method includes the following steps: S1. Based on historical image data collected by visual perception nodes during historical periods, a normal feature base library is constructed. The normal feature base library contains several normal feature subspaces, and each normal feature subspace corresponds to a range of visual feature changes under a normal environmental scenario. S2, when a series of real-time image frames corresponding to the visual perception node are acquired, for each real-time image frame, a target feature subspace matching the context label of the current scene is selected from the normal feature base library according to the context label of the current scene corresponding to the current real-time image frame. S3, map the current real-time image frame to the target feature subspace for feature reconstruction, obtain the reconstructed feature vector of the current real-time image frame in the target feature subspace, and take the difference component between the original feature vector of the current real-time image frame and the reconstructed feature vector as the single-frame abnormal residual feature corresponding to the current real-time image frame. S4. Based on the single-frame abnormal residual features corresponding to each real-time image frame and the preset water accumulation abnormal evolution mode, perform water accumulation risk detection on the current scene of the visual perception node to obtain water accumulation detection results. The preset water accumulation abnormal evolution mode includes at least the distribution features of the single-frame abnormal residual features in the spatial domain and the change features in the temporal domain.

2. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 1, characterized in that, S1 includes the following steps: S11, Obtain the historical image sequence of the visual perception node under each context label, wherein the preset dimensions of the context label include at least the time dimension, the weather dimension, and the illumination dimension, and the historical image sequence includes several frames of historical images; S12, for any historical image sequence corresponding to any context label, extract features from each frame of historical image in the current historical image sequence to obtain the original feature vector corresponding to each frame of historical image; S13, perform dimensionality reduction processing on all original feature vectors corresponding to the current historical image sequence, and extract several principal component directions that represent normal interference fluctuations in the corresponding scene, wherein the normal interference fluctuations include at least one of illumination changes, shadow displacement, and normal wet road surface reflections; S14, the extracted principal component directions are used to span a feature space, which serves as the normal feature subspace corresponding to the current context label; S15. Based on the normal feature subspaces corresponding to all context labels, the normal feature base library is constructed.

3. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 2, characterized in that, S2 includes the following steps: S21, Acquire a series of real-time image frames corresponding to the visual perception node; S22, for each real-time image frame, extract the current time information, current weather information and current illumination information corresponding to the current real-time image frame to form the context label of the current scene; S23, calculate the matching degree between the context label of the current scene and the context label corresponding to each normal feature subspace in the normal feature base library; S24, the normal feature subspace with the highest matching degree is determined as the target feature subspace.

4. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 2, characterized in that, S3 includes the following steps: S31, Project the original feature vector of the current real-time image frame onto the principal component direction of the target feature subspace to obtain the projected reconstructed feature vector; S32, calculate the reconstruction error between the original feature vector and the reconstructed feature vector, and use the reconstruction error as the single-frame abnormal residual feature corresponding to the current real-time image frame.

5. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 1, characterized in that, The distribution characteristics of the abnormal residual features in the spatial domain include at least one of a first spatial feature, a second spatial feature, and a third spatial feature. The first spatial feature is the degree of attenuation and disappearance of the road surface bottom texture features, the second spatial feature is the degree of spatial continuity and intensity surge of the specular reflection area, and the third spatial feature is the degree of local truncation and submersion of the edge contour of a fixed reference object. The time-domain variation characteristics of the abnormal residual features include: The number of frames maintained and the rate of change of the region area of ​​the abnormal residual feature in a series of consecutive real-time image frames.

6. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 5, characterized in that, S4 includes the following steps: S41, For each real-time image frame, extract the distribution characteristics of the single-frame abnormal residual features in the spatial domain and the change characteristics in the temporal domain of the current real-time image frame. S42, based on the prior spatial location information corresponding to the visual perception node, a key area of ​​interest is defined in the current real-time image frame. The prior spatial location information includes historical waterlogging event records and terrain elevation data. The key area of ​​interest is a closed polygonal region covering historically waterlogged areas, low-lying areas, and areas surrounding drainage facilities. S43, extract the distribution features and change features located in the key interest area from the distribution features and change features corresponding to the current real-time image frame; S44, the distributed feature and the varied feature are respectively input into the first preset scoring function and the second preset scoring function to obtain the normal deviation score and the abnormal appearance conformity score. The first preset scoring function is used to output the normal deviation score according to the degree to which the amplitude of the distributed feature deviates from the normal range, and the second preset scoring function is used to output the abnormal appearance conformity score according to the degree of conformity between the varied feature and the preset water spread model. S45, the normal deviation score, the abnormal appearance conformity score and the external support signal corresponding to the visual perception node are fused to obtain a comprehensive risk score, wherein the external support signal includes at least a time series confidence signal and a meteorological coupling signal. S46, when the comprehensive risk score is greater than the preset alarm threshold, the water accumulation detection result is determined to trigger a water accumulation alarm.

7. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 6, characterized in that, S41 includes the following steps: S411, For any real-time image frame, analyze the single-frame abnormal residual features corresponding to the current real-time image frame, and obtain at least one of the first spatial features, the second spatial features, and the third spatial features as the distribution features of the current real-time image frame. S412, based on the distribution characteristics corresponding to the current real-time image frame and the distribution characteristics corresponding to several consecutive real-time image frames preceding the current real-time image frame, calculate the number of maintenance frames and the rate of change of region area of ​​the distribution characteristics in the time series, and use them as the change characteristics of the current real-time image frame.

8. The water accumulation detection method based on dynamic bottom reservoir and residual analysis according to claim 7, characterized in that, S45 includes the following steps: S451, Match the real-time rainfall data of the spatial geographical location corresponding to the visual perception node with the preset water accumulation probability mapping curve to obtain the meteorological coupling degree signal. S452, compare the number of maintenance frames with a preset duration threshold to obtain a timing confidence signal; S453, according to the preset first weight, second weight, third weight and fourth weight, the normal deviation score, the abnormal appearance conformity score, the time series confidence signal and the meteorological coupling degree signal are weighted and summed to obtain the comprehensive risk score.

9. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the water accumulation detection method based on dynamic bottom pool and residual analysis as described in any one of claims 1-8.

10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.