A visual traffic data anomaly identification and position filling method
By performing topological labeling and anomaly hierarchical identification on visual flow measurement stations, and constructing candidate replacement paths, the problem of anomaly identification and replacement in complex scenarios of visual flow measurement technology is solved, and stable correction of flow data and reliability of monitoring results are achieved.
Patent Information
- Application Number
- CN202610803269.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2046-06-05
AI Technical Summary
Existing visual flow measurement technologies struggle to effectively identify the causes of anomalies in complex scenarios. They lack unified site scene markings, have unstable data foundations, and lack closed-loop processing in anomaly identification and compensation methods, resulting in inaccurate judgment of traffic data anomalies, mismatched path selections, and unstable results.
By labeling stations with topological tags and constructing candidate replacement paths, combined with an anomaly hierarchical identification mechanism, and utilizing watershed topological relationships, basic hydrological data, and video surveillance features, anomalies are automatically identified and appropriate replacement methods are matched to achieve stable correction of flow data.
It significantly improves the accuracy and stability of traffic data processing in complex scenarios, ensures the reliability and traceability of monitoring results, and enhances business response speed and data continuity.
Smart Images

Figure CN122336653B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic measurement technology, specifically relating to a method for visual traffic data anomaly identification and replacement. Background Technology
[0002] Visual flow measurement technology calculates flow velocity by identifying features in river surface images and infers flow rate by combining these features with river cross-sectional conditions. It offers advantages such as flexible deployment, low operational safety risks, and relatively controllable operation and maintenance costs. However, this technology is highly sensitive to video quality and site operating conditions. Especially in complex scenarios such as low light, wind, fog, rain, snow, changing light conditions, and intrusions, the extraction of water surface texture features from video images is easily distorted or even impossible. This leads to anomalies in the output flow rate data, such as sudden increases or decreases, random jumps, periodic zeroing, or complete data gaps, affecting the continuity and usability of the data.
[0003] Existing methods for identifying and filling in anomalies in visual traffic data have certain shortcomings:
[0004] First, there is insufficient identification of the causes of anomalies in complex scenarios. Existing solutions often focus on the traffic time series itself for anomaly judgment, lacking joint analysis of video scene. This makes it difficult to effectively distinguish between anomalies caused by low light, wind, rain, fog, snow, changes in lighting, or intrusion of activities and anomalies caused by equipment interruption, abnormal data upload, or general fluctuations. As a result, the anomaly type is not accurately determined and the cause is not clearly identified.
[0005] Secondly, there is a lack of unified definition regarding the prerequisites for data supplementation under different site conditions. Visual flow measurement sites vary significantly in terms of their construction phase, upstream and downstream deployment relationships, and available site resources within the watershed. The available data base differs for newly built sites, sites with only their own data, and sites with upstream connections or other existing sites within the watershed. Without clearly defining the site scenarios beforehand, it becomes difficult to determine which supplementation method is applicable during subsequent processing, easily leading to mismatches between path selection and site conditions.
[0006] Third, the data foundation supporting the correction is unstable. Handling visual flow measurement anomalies relies not only on real-time flow values but also on data such as river cross-sectional topography, longitudinal slope, riverbed roughness, historical water levels, and historical flow rates. If there are gaps, duplications, inconsistent timelines, or obviously unreasonable records in the relevant data, subsequent calculations using water level-flow relationships or historical time-series predictions may be based on unreliable inputs, thus affecting the stability of the correction or correction results.
[0007] Fourth, there is a lack of coherence between anomaly identification, candidate path preparation, and result output. Existing technologies mostly focus on single anomaly detection methods or single complementation methods, lacking a closed-loop processing scheme that unifies scene identification, anomaly classification, candidate complementation path preparation, and conditional path selection. This makes it difficult to select appropriate correction or complementation methods for different anomaly types, different missing durations, and different data availability conditions, thus making it difficult to stably output traceable correction results.
[0008] Therefore, anomaly handling in visual flow measurement services not only requires identifying the anomaly itself, but also requires unifying the site scenarios, data foundation, anomaly identification results, applicable conditions for candidate replacement paths, and result output formats to achieve stable processing of visual flow measurement anomaly identification and replacement in complex scenarios. Summary of the Invention
[0009] To address the problems of insufficient anomaly identification, poor path adaptability, and lack of closed-loop output in existing technologies, this invention provides a visual traffic data anomaly identification and compensation method, which enables automated anomaly identification, anomaly duration marking, topology-driven compensation method matching, and stable output of compensation data.
[0010] To achieve the above objectives, the present invention provides a method for visual traffic data anomaly identification and replacement, comprising the following steps:
[0011] The stations are topologically labeled according to the watershed topology, and the basic hydrological data of the stations are obtained and preprocessed.
[0012] Based on the preprocessed basic hydrological data, candidate replacement paths are constructed. The candidate replacement paths include at least the inferred paths based on the water level-discharge relationship and the predicted paths based on historical water level-discharge time series data.
[0013] An anomaly hierarchical identification mechanism is constructed to identify the abnormal temporal change characteristics of visual traffic data and the scene characteristics of video surveillance footage, and to generate corresponding abnormal temporal feature labels and abnormal cause labels.
[0014] Based on the topology label, the abnormal time sequence feature label, and the abnormal cause label, a matching replacement method is selected from the candidate replacement paths, and the corresponding traffic replacement data and abnormal cause are output.
[0015] Furthermore, the topology label includes whether the site is a newly built site, whether there is an existing site upstream of the site, and whether there is an existing site downstream of the site;
[0016] The basic hydrological data includes the cross-sectional topography, longitudinal slope, riverbed roughness, and historical monitoring data of water level and flow at the monitoring section location of the station.
[0017] The preprocessing includes data cleaning, rationality verification, and consistency testing of the basic hydrological data.
[0018] Furthermore, the derivation path based on the water level-flow relationship includes a method for supplementing the position based on the static water level-flow relationship curve and a method for supplementing the position based on the dynamic water level-flow relationship curve.
[0019] The prediction path based on historical water level-flow time series data includes a complement method based on the LSTM flow prediction model, a complement method based on the Transformer flow prediction model, and a complement method based on the Transformer-MOE flow prediction model.
[0020] Furthermore, the method for supplementing the static water level-flow relationship curve includes using one of the following methods: linear function, polynomial function, or power function, to fit the long-term historical monitoring data of water level and flow at the station to obtain the static water level-flow relationship curve.
[0021] The method for supplementing the data based on the dynamic water level-flow relationship curve includes using one of the following methods: linear function, polynomial function, or power function, to fit the short-term historical monitoring data of water level and flow at the station to obtain the dynamic water level-flow relationship curve, and updating it on a rolling basis according to a preset monitoring cycle.
[0022] Furthermore, the long-term historical monitoring data of water level and flow includes at least one year of historical monitoring data of water level and flow.
[0023] The short-term historical monitoring data of water level and flow includes the historical monitoring data of water level and flow for the three months preceding the current moment;
[0024] The preset monitoring cycle is 1 hour.
[0025] Furthermore, the LSTM-based flow prediction model-based supplementation method includes taking the historical monitoring data of water level and flow of the station m hours before the current time as input, outputting the flow data of the station in the next n hours, and performing rolling updates with n-hour steps;
[0026] The supplementary method based on the Transformer flow prediction model includes taking the historical monitoring data of water level and flow of the station and the upstream existing stations for the previous m hours as input, outputting the flow data of the station for the next n hours, and updating it in a rolling manner with n-hour increments.
[0027] The supplementary method based on the Transformer-MOE flow prediction model includes taking the historical monitoring data of water level and flow of the station and the upstream and downstream existing stations for the previous m hours as input, outputting the flow data of the station for the next n hours, and updating it in a rolling manner with n-hour increments.
[0028] Furthermore, the anomaly hierarchical identification mechanism includes visual traffic data anomaly determination, video surveillance scene feature identification, and anomaly feature classification;
[0029] The abnormal time-series feature label is used to characterize the duration of abnormal traffic data;
[0030] The abnormal cause labels include at least one of the following: low light abnormality, strong wind abnormality, heavy fog abnormality, rain / snow abnormality, light change abnormality, activity intrusion abnormality, and non-scene abnormality.
[0031] Furthermore, the visual traffic anomaly determination includes at least one of the following methods: dynamic threshold judgment, sliding window statistics, and timestamp continuity check.
[0032] The video surveillance scene feature recognition is used to identify whether the video surveillance scene contains at least one of the following scene features: low light feature, strong wind feature, heavy fog feature, rain and snow feature, light change feature, and activity intrusion feature;
[0033] The abnormal feature classification includes determining the abnormal cause label based on the scene feature when the visual traffic data is abnormal and the video surveillance screen contains at least one of the scene features, and generating the abnormal time sequence feature label representing the duration of the abnormal traffic data based on the start and end times of the abnormal visual traffic data; when the visual traffic data is abnormal and the video surveillance screen does not identify the scene feature, the abnormal cause label is the non-scene abnormality.
[0034] Furthermore, the low-light characteristics include the average grayscale value of the video surveillance image being lower than a preset grayscale threshold, and the contrast value being lower than a preset contrast threshold.
[0035] The strong wind characteristic includes the angle between the motion vector of the water surface ripples in the video monitoring image and the mainstream direction being greater than a preset angle threshold.
[0036] The fog feature includes a proportion of high-frequency information of fog concentration gradient amplitude in the video surveillance image that is lower than a preset proportion threshold.
[0037] The rain and snow feature includes a dynamic occlusion pixel ratio in the video surveillance image that is greater than a preset occlusion threshold.
[0038] The light change characteristics include the average grayscale value of the video surveillance image showing a non-monotonic increase or decrease over a continuous period of time;
[0039] The intrusion characteristics include targets detected in the video surveillance footage that enter the monitoring screen and obstruct or interfere with the water surface observation area.
[0040] Furthermore, the priority of the candidate replacement path is determined based on the topological label and the abnormal temporal feature label, including:
[0041] When the topology label is an established site, if the duration of the abnormal flow data displayed by the abnormal time series feature label does not exceed 6 hours and there is an established site upstream, the replacement method based on the Transformer flow prediction model is preferred; if the duration of the abnormal flow data does not exceed 6 hours and there is no established site upstream, the replacement method based on the LSTM flow prediction model is preferred; if the duration of the abnormal flow data exceeds 6 hours but does not exceed 12 hours, the replacement method based on the dynamic water level-flow relationship curve is preferred; if the duration of the abnormal flow data exceeds 12 hours, the replacement method based on the static water level-flow relationship curve is preferred.
[0042] When the topology label is a newly established site, if the duration of the abnormal flow data does not exceed 6 hours and there are existing sites both upstream and downstream, the replacement method based on the Transformer-MOE flow prediction model is preferred; if the duration of the abnormal flow data does not exceed 6 hours but there are existing sites both upstream and downstream, or if the duration of the abnormal flow data exceeds 6 hours but does not exceed 12 hours, the replacement method based on the dynamic water level-flow relationship curve is preferred.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] (1) This invention marks the stations with topological labels, distinguishes between newly built / existing stations and upstream and downstream association conditions based on the watershed topology, clarifies the applicable boundaries and matching rules of the replacement method under different stations, avoids mismatch between path selection and station conditions, and significantly improves the pertinence and adaptability of the replacement method selection.
[0045] (2) This invention establishes a candidate replacement path library containing water level-flow estimation and time series prediction in advance, and automatically matches the optimal path according to topological labels and the duration of anomalies, so as to quickly respond to anomaly correction and missing replacement, effectively improving the timeliness, continuity and stability of data processing.
[0046] (3) This invention combines visual traffic data with video surveillance footage to perform layered anomaly identification, simultaneously extracts anomaly features and scene features, accurately determines the cause of anomalies and marks the duration of anomalies, overcomes the ambiguity of a single data source, and greatly improves the accuracy and completeness of anomaly cause identification.
[0047] (4) By constructing topology marking, candidate replacement path preparation and anomaly identification result output into a coherent closed loop, the present invention achieves full-process logic traceability, processing reproducibility and result verification, significantly improving the reliability, traceability and business call convenience of monitoring results. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the following description of the embodiments are briefly explained. 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.
[0049] Appendix Figure 1 This is a flowchart illustrating a method for visual traffic data anomaly identification and compensation in an embodiment of the present invention.
[0050] Appendix Figure 2 This is a schematic diagram of the construction of candidate filler paths in an embodiment of the present invention.
[0051] Appendix Figure 3 This is a flowchart illustrating the anomaly hierarchical identification mechanism in an embodiment of the present invention.
[0052] Appendix Figure 4 This is a schematic diagram of the matching process of the fill-in method in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this invention more apparent and understandable, the technical solutions of this invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0054] Please see Figure 1 As shown, the present invention provides a method for visual traffic data anomaly identification and replacement, comprising the following steps:
[0055] S1. The stations are topologically labeled according to the watershed topology, and the basic hydrological data of the stations are obtained and preprocessed.
[0056] Step S1 in this embodiment of the invention specifically includes:
[0057] The watershed topology of the stations is obtained, including at least the station construction status, the existence of existing stations upstream and downstream, and the completeness of historical monitoring data. Based on the watershed topology, the stations are topologically tagged. These tags can be recorded using a combination of tags, including combinations of "new station / existing station," "existing station upstream / no existing station upstream," and "existing station downstream / no existing station downstream," used for subsequent selection and priority determination of replacement methods.
[0058] In some implementations, a site-watershed topology table can be established. This table records the site number, cross-sectional location, watershed affiliation, upstream and downstream relationships, and historical operational status. Sites newly connected to the monitoring system with insufficient historical samples can be marked as newly established sites; sites with stable historical monitoring data can be marked as established sites.
[0059] The cross-sectional topography, longitudinal slope, riverbed roughness, and historical monitoring data of water level and flow at the monitoring section location of the station are acquired, and the basic hydrological data are preprocessed. The preprocessing preferably includes data cleaning, rationality verification, and consistency testing.
[0060] Specifically, the data cleaning includes labeling missing fields, deduplicating duplicate records, correcting or removing erroneous timestamps, unifying the units of water level and flow rate, and aligning data from different sampling frequencies in time. The rationality verification includes screening for abnormally large and small values that exceed the historical range of the stations, and initially screening for sudden jumps in records that clearly do not conform to the hydrological change pattern. The consistency verification includes checking the correspondence between historical flow and historical water level, checking the consistency between video acquisition time and flow upload time, and checking the consistency of time bases of different stations in multi-station input scenarios.
[0061] This step, by completing the site topology labeling and basic hydrological data preprocessing, provides a unified, reliable, and traceable data foundation for subsequent candidate replacement path construction and anomaly hierarchical identification.
[0062] S2. Based on the preprocessed basic hydrological data, construct candidate replacement paths, which include at least a path derived based on the water level-discharge relationship and a path predicted based on historical water level-discharge time series data.
[0063] Step S2 in this embodiment of the invention specifically includes:
[0064] Please see Figure 2As shown, an integrity analysis is performed on the preprocessed basic hydrological data to construct an inference path based on the water level-discharge relationship and a prediction path based on historical water level-discharge time series data.
[0065] In some implementations, the derivation path based on the water level-flow relationship includes a method for supplementing the position based on the static water level-flow relationship curve and a method for supplementing the position based on the dynamic water level-flow relationship curve.
[0066] Specifically, the method for supplementing the static water level-flow relationship curve includes, for stations with relatively complete historical data and relatively stable station cross-sectional conditions, using one of the following methods—linear function, polynomial function, or power function—to fit at least one year of historical water level and flow monitoring data to obtain a static water level-flow relationship curve, so that the corresponding flow can be directly deduced when the current water level is known.
[0067] The method for supplementing data based on the dynamic water level-flow relationship curve includes, for stations significantly affected by scouring and sedimentation, seasonal hydraulic condition changes, or recent cross-sectional state adjustments, using a linear function, polynomial function, or power function to fit the historical water level and flow monitoring data for the previous three months at the current moment to obtain the dynamic water level-flow relationship curve. A preset monitoring period is set, and in the next preset monitoring period, the historical water level and flow monitoring data for the previous three months at the current moment are reacquired and fitted again, thereby achieving rolling updates. The preset monitoring period is preferably one hour.
[0068] In some implementations, the prediction path based on historical water level-flow time series data includes a complementation method based on an LSTM flow prediction model, a complementation method based on a Transformer flow prediction model, and a complementation method based on a Transformer-MOE flow prediction model. However, the specific network architecture, loss function form, or training strategy of each prediction model is not considered a core limitation of this invention.
[0069] Specifically, the LSTM-based flow prediction model's supplementation method includes taking the historical monitoring data of water level and flow from the previous m hours as input, normalizing the input using the Min-Max normalization method to eliminate the dimensional differences between water level and flow data, and reconstructing the input into a three-dimensional input tensor with a time step of 1 hour, including water level feature dimension, flow feature dimension, and time step dimension.
[0070] The three-dimensional input tensor is forward propagated using a two-layer LSTM hidden layer. By leveraging the long temporal memory capability of the hidden layer, the coupling mapping relationship between station water level and flow rate, as well as the temporal evolution law of flow rate itself, are explored, and a high-dimensional temporal feature vector suitable for flow rate prediction in the next n hours is extracted.
[0071] The high-dimensional time-series feature vector is input into a fully connected layer, which maps the high-dimensional features to a one-dimensional flow prediction value. The ReLU activation function is used to perform a nonlinear transformation on the one-dimensional flow prediction value to remove negative values in the prediction result. Combined with the historical hydrological scale parameters of the station, the flow prediction value is denormalized using the Min-Max denormalization method to obtain the flow prediction data for the station in the next n hours. The water level-flow change curve of the station in the past m hours and the next n hours is output and updated in a rolling manner with a step size of n hours.
[0072] The historical hydrological scale parameters include the maximum and minimum values of the historical flow monitoring data. The value of m ranges from 6 to 12, and the value of n ranges from 1 to 6. There are no restrictions on the size of the two parameters, and they can be selected according to actual business needs.
[0073] Specifically, the supplementary method based on the Transformer flow prediction model includes using historical monitoring data of water level and flow from the current station and the upstream existing station for m hours prior to the current time as input. The input is normalized using the Min-Max normalization method to eliminate dimensional differences between different stations and between water level and flow data. The input is then reconstructed into a four-dimensional input tensor with a 1-hour time step, including station feature dimensions, water level feature dimensions, flow feature dimensions, and time step dimensions. Spatiotemporal location encoding is added to this four-dimensional input tensor to embed the spatial location and time step sequence information of the station and the upstream existing station, resulting in a four-dimensional input tensor with spatiotemporal location encoding.
[0074] A multi-head self-attention layer is used to calculate attention weights across stations and across time on the four-dimensional input tensor with spatiotemporal location encoding. This automatically learns the hydrological influence weights of water level and flow rate at upstream stations on the station, and mines the spatial correlation and temporal linkage features between the established upstream stations and the hydrological data of the station, outputting a high-dimensional spatiotemporal feature vector. This high-dimensional spatiotemporal feature vector is input into a two-layer feedforward neural network to generate a core feature vector adapted for flow prediction in the next n hours. This vector is then mapped to a one-dimensional flow prediction value through a fully connected layer. Negative values are removed using the ReLU activation function, and Min-Max inverse normalization is performed using the station's historical hydrological scale parameters. The flow prediction data for the station in the next n hours is output, along with the water level-flow rate change curves for the station over the past m hours and in the next n hours, updated in n-hour increments.
[0075] Specifically, the supplementary method based on the Transformer-MOE flow prediction model includes taking historical monitoring data of water level and flow from the current station and the upstream and downstream existing stations for m hours prior to the current time as input, normalizing the input using the Min-Max normalization method to eliminate dimensional differences between different stations and between water level and flow data, and reconstructing the input into a four-dimensional input tensor with a time step of 1 hour, including station feature dimension, water level feature dimension, flow feature dimension, and time step dimension. By adding spatiotemporal location encoding to the four-dimensional input tensor to embed the spatial location and time step sequence information of the station and the upstream and downstream existing stations, a four-dimensional input tensor with spatiotemporal location encoding is obtained.
[0076] A multi-head self-attention layer and a hybrid expert mechanism (MOE) are used to calculate attention weights across stations and across time for the four-dimensional input tensor with spatiotemporal location encoding. This automatically learns the hydrological influence weights of water level and flow rate at upstream and downstream stations on the station, and mines the spatial correlation features, river confluence features, and temporal linkage features of the established upstream and downstream stations and their hydrological data, outputting a high-dimensional spatiotemporal feature vector. This high-dimensional spatiotemporal feature vector is input into a two-layer feedforward neural network to generate a core feature vector adapted for flow prediction in the next n hours. This vector is then mapped to a one-dimensional flow prediction value through a fully connected layer. Negative values are removed using the ReLU activation function, and Min-Max inverse normalization is performed using the station's historical hydrological scale parameters. The flow prediction data for the station in the next n hours is output, along with the water level-flow rate change curves for the station over the past m hours and in the next n hours, updated in n-hour increments.
[0077] In some implementations, a candidate replacement path registration table can be pre-established. This table includes at least the path name, applicable topology labels, required input variables, and output result format. Using this candidate replacement path registration table, paths can be filtered according to the table after an anomaly occurs, thereby improving path invocation efficiency and enhancing process executability.
[0078] This step, by pre-completing the construction of candidate replacement paths and the registration of applicable boundaries, eliminates the need to temporarily construct processing strategies when anomalies occur during the replacement process, thereby improving business response speed and processing consistency.
[0079] S3. Construct an anomaly hierarchical identification mechanism to identify the abnormal temporal change characteristics of visual traffic data and the scene characteristics of video surveillance footage, and generate corresponding abnormal temporal feature labels and abnormal cause labels.
[0080] Step S3 in this embodiment of the invention specifically includes:
[0081] Please see Figure 3 As shown, an anomaly hierarchical identification mechanism is constructed, comprising three levels: visual traffic data anomaly determination, video surveillance scene feature recognition, and anomaly feature classification. This mechanism is used to identify the abnormal temporal change features of the visual traffic data and the scene features of the video surveillance footage, and to generate corresponding abnormal temporal feature labels and anomaly cause labels.
[0082] Specifically, the visual traffic data anomaly determination includes using at least one of the following methods: dynamic threshold judgment, sliding window statistics, and timestamp continuity check, to quickly screen for abnormal candidate segments from the visual traffic data.
[0083] The dynamic threshold judgment method includes determining the upper and lower limit ranges updated over time based on the traffic fluctuation levels of the site during the same or adjacent historical periods, and identifying visual traffic data exceeding the range as the abnormal candidate segments; the sliding window statistical method includes setting a preset window length, generally 1 hour, and using the Z-Score method to calculate the mean, standard deviation, adjacent difference, or fluctuation amplitude of the visual traffic data within the preset window length. When a significant deviation occurs within the window, the visual traffic data within the window is identified as the abnormal candidate segment; the timestamp continuity check method includes checking the uniformity of the upload interval of the visual flow measurement data, identifying abnormal upload intervals, recording interruptions, and missing segments. If any of these exist, the data that meets the above conditions is identified as the abnormal candidate segment.
[0084] Specifically, the video surveillance scene feature recognition is used to identify whether the video surveillance scene contains at least one scene feature among low light feature, strong wind feature, heavy fog feature, rain and snow feature, light change feature and activity intrusion feature.
[0085] The low-light feature includes calculating the grayscale histogram of the video surveillance image, extracting the average grayscale value and contrast value of the grayscale histogram, and determining that the video surveillance image includes the low-light feature when the average grayscale value is lower than a preset grayscale threshold and the contrast value is lower than a preset contrast threshold. Preferably, the preset grayscale threshold can be 10 and the preset contrast threshold can be 5. The strong wind feature includes obtaining the motion vector of water ripples in the video surveillance image using the LK optical flow method, calculating the angle between the motion vector and the mainstream direction, and determining that the video surveillance image includes the strong wind feature when the angle is greater than a preset angle threshold. Preferably, the preset angle threshold can be 30°. The fog feature includes calculating the fog concentration gradient amplitude of the video surveillance image through dark channel prior, and statistically analyzing the proportion of high-frequency information in the fog concentration gradient amplitude. If the proportion of high-frequency information is lower than a preset proportion threshold, it is determined that the low-light feature is present. The video surveillance footage includes the fog feature, preferably with the preset proportion threshold set to 0.5; the rain and snow feature includes detecting rain and snow obstructions in the video surveillance footage using inter-frame difference method, obtaining the pixel proportion value of rain and snow obstructions, and determining that the video surveillance footage includes the rain and snow feature when the pixel proportion value of rain and snow obstructions is greater than the preset obstruction threshold, preferably with the preset obstruction threshold set to 0.3; the light change feature includes calculating the grayscale mean of the video surveillance footage and analyzing the monotonic change of the grayscale mean in a continuous time period, and determining that the video surveillance footage includes the light change feature when the grayscale mean shows a non-monotonic increasing or decreasing change; the activity intrusion feature includes detecting targets that form obstructions or interference in the water surface observation area of the video surveillance footage using the YOLOv8 target detection algorithm, and determining that the video surveillance footage includes the activity intrusion feature when the target is present.
[0086] Specifically, the abnormal feature classification is used to associate the video traffic data anomaly determination result with the scene feature recognition result of the video surveillance screen by time index, including: when the video traffic data is abnormal and the video surveillance screen contains at least one of the scene features, outputting a corresponding scene anomaly cause label according to the scene feature. The scene anomaly cause label includes low light anomaly, strong wind anomaly, heavy fog anomaly, rain / snow anomaly, light change anomaly, and activity intrusion anomaly. When the visual traffic data is abnormal and the video surveillance screen does not identify the corresponding scene feature, outputting a non-scene anomaly as the anomaly cause label. At the same time, the duration of the abnormal traffic data is calculated based on the start and end times of the anomaly candidate segment, generating the anomaly time sequence feature label including the duration of the abnormal traffic data.
[0087] In some implementations, a structured tag set can be generated for each of the aforementioned candidate anomalies. This structured tag set includes at least an anomaly cause tag and an anomaly timing feature tag. The structured tag set may also include an anomaly start time, an anomaly end time, and a post-anomaly recovery status identifier.
[0088] This step integrates "detecting anomalies," "identifying scenarios," and "classifying causes" into a unified identification chain, enabling the output results to be directly used as the decision-making basis for path matching and result output.
[0089] S4. Based on the topology label, the abnormal time sequence feature label and the abnormal cause label, select a matching replacement method from the candidate replacement paths, and output the corresponding traffic replacement data and abnormal cause.
[0090] Step S4 in this embodiment of the invention specifically includes:
[0091] Obtain the topology label from step S1, the abnormal time sequence feature label from step S3, and the abnormal cause label. Based on the candidate replacement path registration table from step S2, determine the set of candidate paths that the site can call.
[0092] In some implementations, when selecting the candidate replacement path, the corresponding anomaly cause is first output based on the anomaly cause label. The anomaly cause includes low light anomaly, strong wind anomaly, heavy fog anomaly, rain / snow anomaly, light change anomaly, activity intrusion anomaly, or non-scene anomaly. Then, the topology label is used as the site type criterion to determine the candidate path set corresponding to the site, and the anomaly time sequence feature label is used as the duration criterion to remove traffic data from the anomaly candidate segments. Finally, a matching replacement method is selected from the candidate path set.
[0093] Specifically, please refer to Figure 4 As shown, when the topology label is an established site, if the duration of the abnormal flow data displayed by the abnormal time-series feature label does not exceed 6 hours and there is an established site upstream, the replacement method based on the Transformer flow prediction model is preferred; if the duration of the abnormal flow data does not exceed 6 hours and there is no established site upstream, the replacement method based on the LSTM flow prediction model is preferred; if the duration of the abnormal flow data exceeds 6 hours but does not exceed 12 hours, the replacement method based on the dynamic water level-flow relationship curve is preferred; if the duration of the abnormal flow data exceeds 12 hours, the replacement method based on the static water level-flow relationship curve is preferred.
[0094] When the topology label is a newly established site, if the duration of the abnormal flow data does not exceed 6 hours and there are existing sites both upstream and downstream, the replacement method based on the Transformer-MOE flow prediction model is preferred; if the duration of the abnormal flow data does not exceed 6 hours but there are existing sites both upstream and downstream, or if the duration of the abnormal flow data exceeds 6 hours but does not exceed 12 hours, the replacement method based on the dynamic water level-flow relationship curve is preferred.
[0095] By inputting the water level data corresponding to the abnormal flow data into the corresponding compensation method, the corresponding flow compensation data is output.
[0096] In its implementation, the selection process of the candidate replacement path can be described as two consecutive sub-stages: conditional filtering and result output. In the conditional filtering sub-stage, obviously unsuitable candidate replacement paths are first filtered out based on the topology labels, and then the specific replacement method is determined based on the abnormal time-series feature labels. In the result output sub-stage, the traffic replacement data output by the replacement method is written into the corresponding abnormal candidate segment, and the abnormal reason corresponding to the abnormal candidate segment is output.
[0097] In some implementations, when the same abnormal candidate segment simultaneously meets the calling conditions of multiple candidate replacement paths, the path selection can be performed in the aforementioned priority order to ensure that the output rules remain consistent under different site topologies and different time intervals.
[0098] In some implementations, the aforementioned path matching, result backfilling, and status identification processes can be encapsulated as a program and integrated into the site's monitoring system platform for online real-time rolling traffic reporting. The results stored on the platform side include not only the padded traffic time series but also the padded method, the anomaly cause label, the anomaly time series feature label, and the topology label, thereby facilitating direct access by business systems and enabling operation and management personnel to trace and correct the basis.
[0099] This step incorporates the topology label and the abnormal time-series feature label into a unified decision, and uses the abnormal cause label as an explanation of the abnormal cause, so that different site conditions and different missing durations can be matched with the appropriate compensation method, thus avoiding the distortion of results caused by using the same repair method for all abnormalities.
[0100] In summary, this invention discloses a method for anomaly identification and replacement of visual flow data. By topologically labeling stations, preprocessing basic hydrological data, constructing candidate replacement paths, establishing an anomaly hierarchical identification mechanism, and performing conditional path matching, it achieves automated anomaly identification and stable replacement of visual flow data in complex scenarios, thereby improving the continuity, accuracy, and reliability of monitoring results.
[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the present invention.
Claims
1. A method for identifying and filling in visual traffic data anomalies, characterized in that, The method includes: The stations are topologically labeled according to the watershed topology, and the basic hydrological data of the stations are obtained and preprocessed. Based on the preprocessed basic hydrological data, candidate replacement paths are constructed. The candidate replacement paths include at least the inferred paths based on the water level-discharge relationship and the predicted paths based on historical water level-discharge time series data. An anomaly hierarchical identification mechanism is constructed to identify the abnormal temporal change characteristics of visual traffic data and the scene characteristics of video surveillance footage, and to generate corresponding abnormal temporal feature labels and abnormal cause labels. Based on the topology label, the abnormal time-series feature label, and the abnormal cause label, a matching padding method is selected from the candidate padding paths, and the corresponding traffic padding data and abnormal cause are output, specifically including: First, output the corresponding abnormal reason according to the abnormal reason label. Then, use the topology label as the site type criterion to determine the candidate replacement path set corresponding to the site. Then, use the abnormal time sequence feature label as the duration criterion to select the matching replacement method in the candidate replacement path set. The priority of the candidate replacement path is determined based on the topological label and the abnormal temporal feature label, including: When the topology label is an established site, if the duration of the abnormal flow data displayed by the abnormal time-series feature label does not exceed 6 hours and there is an established site upstream, the replacement method based on the Transformer flow prediction model is preferred; if the duration of the abnormal flow data does not exceed 6 hours and there is no established site upstream, the replacement method based on the LSTM flow prediction model is preferred; if the duration of the abnormal flow data exceeds 6 hours but does not exceed 12 hours, the replacement method based on the dynamic water level-flow relationship curve is preferred; if the duration of the abnormal flow data exceeds 12 hours, the replacement method based on the static water level-flow relationship curve is preferred. When the topology label is a newly established site, if the duration of the abnormal flow data does not exceed 6 hours and there are existing sites both upstream and downstream, the replacement method based on the Transformer-MOE flow prediction model is preferred; if the duration of the abnormal flow data does not exceed 6 hours but there are existing sites both upstream and downstream, or if the duration of the abnormal flow data exceeds 6 hours but does not exceed 12 hours, the replacement method based on the dynamic water level-flow relationship curve is preferred.
2. The method for visual traffic data anomaly identification and compensation according to claim 1, characterized in that, The method further includes: The topology labels include whether the site is a newly built site, whether there is an existing site upstream of the site, and whether there is an existing site downstream of the site; The basic hydrological data includes the cross-sectional topography, longitudinal slope, riverbed roughness, and historical monitoring data of water level and flow at the monitoring section location of the station. The preprocessing includes data cleaning, rationality verification, and consistency testing of the basic hydrological data.
3. The method for visual traffic data anomaly identification and compensation according to claim 2, characterized in that, The method further includes: The derivation path based on the water level-flow relationship includes a method for supplementing the position based on the static water level-flow relationship curve and a method for supplementing the position based on the dynamic water level-flow relationship curve. The prediction path based on historical water level-flow time series data includes a complement method based on the LSTM flow prediction model, a complement method based on the Transformer flow prediction model, and a complement method based on the Transformer-MOE flow prediction model.
4. The method for visual traffic data anomaly identification and compensation according to claim 3, characterized in that, The method further includes: The method for supplementing the static water level-flow relationship curve includes using one of the following methods: linear function, polynomial function, or power function, to fit the long-term historical monitoring data of water level and flow at the station to obtain the static water level-flow relationship curve. The method for supplementing the data based on the dynamic water level-flow relationship curve includes using one of the following methods: linear function, polynomial function, or power function, to fit the short-term historical monitoring data of water level and flow at the station to obtain the dynamic water level-flow relationship curve, and updating it on a rolling basis according to a preset monitoring cycle.
5. The method for visual traffic data anomaly identification and compensation according to claim 4, characterized in that, The method further includes: The long-term historical monitoring data of water level and flow includes at least one year of historical monitoring data of water level and flow. The short-term historical monitoring data of water level and flow includes the historical monitoring data of water level and flow for the three months preceding the current moment; The preset monitoring cycle is 1 hour.
6. The method for visual traffic data anomaly identification and compensation according to claim 3, characterized in that, The method further includes: The supplementary method based on the LSTM flow prediction model includes taking the historical monitoring data of water level and flow of the station m hours before the current time as input, outputting the flow data of the station in the next n hours, and updating it in a rolling manner with n-hour steps. The supplementary method based on the Transformer flow prediction model includes taking the historical monitoring data of water level and flow of the station and the upstream existing stations for the previous m hours as input, outputting the flow data of the station for the next n hours, and updating it in a rolling manner with n-hour increments. The supplementary method based on the Transformer-MOE flow prediction model includes taking the historical monitoring data of water level and flow of the station and the upstream and downstream existing stations for the previous m hours as input, outputting the flow data of the station for the next n hours, and updating it in a rolling manner with n-hour increments.
7. The method for visual traffic data anomaly identification and compensation according to claim 1, characterized in that, The method further includes: The anomaly hierarchical identification mechanism includes visual traffic data anomaly determination, video surveillance scene feature identification, and anomaly feature classification. The abnormal time-series feature label is used to characterize the duration of abnormal traffic data; The abnormal cause labels include at least one of the following: low light abnormality, strong wind abnormality, heavy fog abnormality, rain / snow abnormality, light change abnormality, activity intrusion abnormality, and non-scene abnormality.
8. The method for visual traffic data anomaly identification and compensation according to claim 7, characterized in that, The method further includes: The visual traffic data anomaly determination includes at least one of the following methods: dynamic threshold judgment, sliding window statistics, and timestamp continuity check. The video surveillance scene feature recognition is used to identify whether the video surveillance scene contains at least one of the following scene features: low light feature, strong wind feature, heavy fog feature, rain and snow feature, light change feature, and activity intrusion feature; The abnormal feature classification includes determining the abnormal cause label based on the scene feature when the visual traffic data is abnormal and the video surveillance screen contains at least one of the scene features, and generating the abnormal time sequence feature label representing the duration of the abnormal traffic data based on the start and end times of the abnormal visual traffic data; when the visual traffic data is abnormal and the video surveillance screen does not identify the scene feature, the abnormal cause label is the non-scene abnormality.
9. The method for visual traffic data anomaly identification and compensation according to claim 8, characterized in that, The method further includes: The low-light characteristics include that the average grayscale value of the video surveillance image is lower than a preset grayscale threshold, and the contrast value is lower than a preset contrast threshold. The strong wind characteristic includes the angle between the motion vector of the water surface ripples in the video monitoring image and the mainstream direction being greater than a preset angle threshold. The fog feature includes a proportion of high-frequency information of fog concentration gradient amplitude in the video surveillance image that is lower than a preset proportion threshold. The rain and snow feature includes the fact that the percentage of pixels obstructed by rain and snow in the video surveillance image is greater than a preset obstruction threshold. The light change characteristics include the average grayscale value of the video surveillance image showing a non-monotonic increase or decrease over a continuous period of time; The intrusion characteristics include targets detected in the video surveillance footage that enter the monitoring screen and obstruct or interfere with the water surface observation area.
Citation Information
Patent Citations
Basin water level missing data interpolation method
CN121935493A
Hydraulic engineering management data processing method and system based on cloud computing
CN122090359A