Engineering Operation and Maintenance Management Methods and Systems Based on Video Recognition Algorithms

By generating frame-level drainage state sequences and merging them into candidate segments, and combining them with machine learning models to determine stability, the problem of insufficient automatic organization of drainage events in existing technologies is solved, and automated management and efficient analysis of drainage events are realized.

CN121481529BActive Publication Date: 2026-04-07WUHAN LIANHUA ELECTRIC CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-08
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing methods for identifying drainage status at outlets based on video images cannot automatically generate drainage events with clear start and end times, resulting in a large number of scattered status records in the operation and maintenance interface, which are difficult to use for operation and maintenance work order scheduling and drainage behavior statistical analysis.

Method used

By acquiring monitoring videos of the outfall, a frame-level drainage status sequence is generated. Frames with the same adjacent status are merged into candidate drainage segments. A machine learning model is used to determine the stability of the segments. Drainage event objects are encapsulated, and the time interval and confidence level are backtracked and verified. Finally, the results are written into the engineering operation and maintenance management system.

Benefits of technology

It achieves seamless transformation from instantaneous information to complete events, improves the real-time performance and accuracy of water conservancy project supervision, reduces the need for on-site inspections, supports data-driven operation and maintenance task generation and statistical analysis, reduces false alarm rate and improves the reliability of drainage behavior analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121481529B_ABST
    Figure CN121481529B_ABST
Patent Text Reader

Abstract

This invention discloses an engineering operation and maintenance management method and system based on video recognition algorithms, specifically relating to the field of artificial intelligence video recognition. It addresses the problem that existing methods for identifying the drainage status of outlets only output instantaneous status information and cannot automatically generate drainage events. The method involves acquiring outlet monitoring video to generate a frame-level drainage status sequence, merging adjacent frames with the same drainage status to form a candidate drainage segment set, performing stability judgment on the candidate drainage segment set to encapsulate drainage event objects, using the frame-level drainage status sequence for backtracking verification to adjust the drainage event objects and mark their reliability levels, updating the image frame merging rules and stability judgment parameters according to outlet classification and statistics of highly reliable drainage event objects, and writing the drainage event result set into the event database of the engineering operation and maintenance management system as a data source for generating operation and maintenance tasks and performing statistical analysis, thereby achieving automatic drainage event organization and operation and maintenance optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence video recognition, and more specifically, to a drainage operation and maintenance management method and system based on video recognition, which provides drainage event-level data support for the drainage operation and maintenance management platform by recognizing and extracting events from outfall monitoring videos. Background Technology

[0002] In water conservancy projects involving river channel management and drainage monitoring, cameras are typically installed at river outlets. An AI-powered video recognition module analyzes the footage to determine if water is flowing out of the outlets and what their drainage status is. The results are then uploaded to the project operation and maintenance management platform. Management units hope to replace long-term on-site monitoring with this method, allowing them to visually monitor the operation of each outlet on the platform. This integration of video recognition results with project operation and maintenance management facilitates daily inspections, anomaly detection, and post-event inquiries.

[0003] In existing video image-based methods for identifying the drainage status of outlets, the identification module continuously outputs a series of instantaneous status information arranged in chronological order, only indicating whether the outlet is draining or not at a certain moment. It does not automatically organize these statuses at the software level to generate drainage events with clear start and end times. Thus, a single actual drainage process often appears in the maintenance interface as a large number of scattered status records or alarm messages, lacking unified event identifiers and continuous time periods, making it inconvenient to directly trigger maintenance work orders, schedule inspection tasks, or perform statistical analysis of drainage behavior. Video recognition-based engineering maintenance management methods and systems have a significant deficiency in this regard, failing to smoothly transform the identification results into drainage events that can be directly used by the maintenance side. This is precisely the technical problem that this invention aims to address and improve. Summary of the Invention

[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide an engineering operation and maintenance management method and system based on video recognition algorithms. This method generates a frame-level drainage status sequence by acquiring monitoring videos of drainage outlets, merges adjacent frames with the same drainage status to form a candidate drainage segment set, performs stability judgment on the candidate drainage segment set to encapsulate drainage event objects, uses the frame-level drainage status sequence for backtracking verification to adjust the drainage event objects and mark their credibility level, updates the image frame merging rules and stability judgment parameters according to the drainage outlet classification and statistics of high-credibility drainage event objects, and writes the drainage event result set into the event database of the engineering operation and maintenance management system as a data source for generating operation and maintenance tasks and performing statistical analysis. This achieves automatic sorting and operation and maintenance optimization of drainage events, thereby solving the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] The engineering operation and maintenance management method based on video recognition algorithms includes the following steps:

[0007] S1 acquires the monitoring video of the discharge outlet, splits it into image frames, preprocesses it and inputs it into the video recognition model to obtain the frame-level drainage status, forming a time-arranged sequence of frame-level drainage status.

[0008] S2 merges adjacent image frames with the same drainage state and continuous time into candidate drainage segments based on the frame-level drainage state sequence, records the start and end times of each candidate drainage segment, and forms a set of candidate drainage segments.

[0009] S3 calculates the internal drainage rhythm coherence and segment boundary stability time band for each candidate drainage segment based on the frame-level drainage state sequence. The two parameters are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient of the corresponding candidate drainage segment. Based on this and the segment duration, the target drainage segment is determined and encapsulated as a drainage event object that records the outlet identifier and time interval, forming a drainage event object set.

[0010] S4 uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start and end times, marks the confidence level, and forms a drainage event result set.

[0011] S5 categorizes and statistically analyzes the drainage event objects in the drainage event result set according to the discharge outlet, updates the image frame merging rules and stability judgment parameters of the corresponding discharge outlet based on the statistical results, and writes the drainage event result set into the event library of the engineering operation and maintenance management system.

[0012] In a preferred embodiment, step S1 involves acquiring and decoding the monitoring video of the discharge outlet into a sequence of original image frames with added time tags. After preprocessing the image frames, the data is input into a video recognition model to generate frame-level drainage status tags. The time tags are then bound to form a corresponding frame-level drainage status sequence for the discharge outlet.

[0013] In a preferred embodiment, step S2 sequentially traverses the frame-level drainage state sequence starting from the first element, merges image frames whose frame-level drainage state labels are the same as the next frame and whose time label difference is not greater than a preset time continuity threshold, obtains candidate drainage segments, records the start time and end time state statistics, and forms a set of candidate drainage segments for the corresponding outlet.

[0014] In a preferred embodiment, step S3 performs stability judgment on the candidate drainage segment set. For each candidate drainage segment, the internal drainage rhythm coherence and segment boundary stability time band are calculated based on the frame-level drainage state sequence. The internal drainage rhythm coherence and segment boundary stability time band are input into a machine learning model trained based on historical drainage events to obtain drainage event stability determination coefficients. Target drainage segments are selected based on drainage event stability determination coefficients and the duration of candidate drainage segments. Target drainage segments are encapsulated as drainage event objects, recording the outlet identification time interval and stability index to obtain a drainage event object set.

[0015] In a preferred embodiment, the internal drainage rhythm coherence is determined by traversing the local frame-level drainage state sequence, checking whether the frame-level drainage state labels of each intermediate frame (excluding the first and last frames) and its adjacent frames before and after are completely identical and whether the time label difference meets the time continuity requirement. Intermediate frames that meet the conditions are counted as rhythm-stable frames, and the ratio is calculated by dividing the number of rhythm-stable frames by the total number of frames within the segment.

[0016] In a preferred embodiment, the segment boundary stabilization time band is formed by extending a fixed duration near the start and end times to form a start boundary time band and an end boundary time band. Within each time band, the cumulative duration of the longest sub-interval where the frame-level drainage status label remains unchanged is counted. After obtaining the non-flipping time length of the start boundary and the non-flipping time length of the end boundary, the ratio is calculated by dividing the sum of the non-flipping time lengths at both ends by the total duration of the two boundary time bands.

[0017] In a preferred embodiment, step S4 uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start time, end time, and stability index of the drainage event object according to the backtracking verification result, marks the credibility level of the adjusted drainage event object, and forms a drainage event result set.

[0018] In a preferred embodiment, step S5 categorizes and statistically analyzes the drainage event objects in the drainage event result set according to the outlet, adjusts the image frame merging rules and stability judgment parameters based on the drainage event objects with high credibility level, and writes the drainage event result set into the event library of the engineering operation and maintenance management system as the data source for generating operation and maintenance tasks and performing operation and maintenance statistical analysis.

[0019] In a preferred embodiment, step S5 adjusts the image frame merging rules and stability judgment parameters. By extracting short-term interruption time periods from high-confidence-level drainage event objects and selecting the maximum typical interruption time length, the median of the collected and sorted data is used to form an allowable interruption time threshold, which is used to ignore undrained segments that are not greater than the threshold during merging. By calculating the start and end blur band time lengths, the median of the collected and sorted data is used to select the maximum value to form a boundary blur band length threshold, which is used to adjust the boundary of candidate drainage segments to cover the complete drainage process.

[0020] An engineering operation and maintenance management system based on video recognition algorithms includes:

[0021] The frame sequence generation module acquires the monitoring video of the drainage outlet, splits it into image frames, and inputs them into the video recognition model after preprocessing to obtain the frame-level drainage status, forming a time-arranged sequence of frame-level drainage status.

[0022] The segment synthesis module merges adjacent image frames with the same drainage state and continuous time into candidate drainage segments based on the frame-level drainage state sequence, records the start and end times of each candidate drainage segment, and forms a set of candidate drainage segments.

[0023] The stability assessment module calculates the internal drainage rhythm coherence and segment boundary stability time band for each candidate drainage segment based on the frame-level drainage state sequence. The two parameters are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient of the corresponding candidate drainage segment. Based on this and the segment duration, the target drainage segment is determined and encapsulated as a drainage event object that records the outlet identifier and time interval, forming a drainage event object set.

[0024] The boundary verification module uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start and end times, marks the confidence level, and forms a drainage event result set.

[0025] The rule-adaptive module categorizes and statistically analyzes drainage event objects in the drainage event result set according to the outlet, updates the image frame merging rules and stability judgment parameters of the corresponding outlet based on the statistical results, and writes the drainage event result set into the event library of the engineering operation and maintenance management system.

[0026] The technical effects and advantages of the engineering operation and maintenance management method and system based on video recognition algorithm of this invention are as follows:

[0027] This invention generates frame-level drainage status sequences using a video recognition model and merges them into candidate drainage segments. These segments are then filtered and encapsulated using stability assessment and machine learning models. Backtracking and verification are performed to adjust time intervals and stability indicators to assign credibility levels. Finally, high-credibility events are categorized and statistically analyzed, and merging rules and judgment parameters are updated and written into an event database. This achieves a seamless transformation of drainage status from instantaneous information to complete events, improving the real-time performance and accuracy of water conservancy project supervision, reducing the need for on-site manual inspections, and adaptively optimizing system parameters to adapt to changes in different discharge outlet environments. This ensures timely anomaly detection and supports data-driven operation and maintenance task generation and statistical analysis. Compared to existing methods, this invention avoids the problem of scattered records interfering with operation and maintenance decisions, provides event-level data support, promotes intelligent management of river channels, significantly reduces false alarm rates, and improves the reliability of drainage behavior analysis. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating the engineering operation and maintenance management method based on video recognition algorithm of the present invention.

[0029] Figure 2 This is a schematic diagram of the engineering operation and maintenance management system based on video recognition algorithm of the present invention. Detailed Implementation

[0030] 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.

[0031] Example 1: Figure 1 The present invention provides an engineering operation and maintenance management method based on video recognition algorithm, including:

[0032] S1 acquires the monitoring video of the discharge outlet, splits it into image frames, preprocesses it, inputs it into the video recognition model, obtains the frame-level drainage status, and forms a time-arranged sequence of frame-level drainage status.

[0033] S2 merges adjacent image frames with the same drainage state and continuous time into candidate drainage segments based on the frame-level drainage state sequence, records the start and end times of each candidate drainage segment, and forms a set of candidate drainage segments.

[0034] S3 calculates the internal drainage rhythm coherence and segment boundary stability time band for each candidate drainage segment based on the frame-level drainage state sequence. The two parameters are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient of the corresponding candidate drainage segment. Based on this and the segment duration, the target drainage segment is determined and encapsulated as a drainage event object that records the outlet identifier and time interval, forming a drainage event object set.

[0035] S4 uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start and end times, marks the confidence level, and forms a drainage event result set.

[0036] S5 categorizes and statistically analyzes the drainage event objects in the drainage event result set according to the outlet, updates the image frame merging rules and stability judgment parameters of the outlet based on the statistical results, and writes the drainage event result set into the event database of the engineering operation and maintenance management system.

[0037] In water conservancy projects involving river channel management and drainage supervision, installing cameras along river outlets for remote monitoring has become an efficient method. This approach relies on artificial intelligence video recognition and analysis to determine the drainage status, uploading the results to the project operation and maintenance management platform to support daily inspections, anomaly detection, and post-event queries. Current recognition methods only generate instantaneous status information arranged in chronological order, lacking automatic organization and generation of drainage events. This results in scattered records on the operation and maintenance interface, making it difficult to use for work order triggering or statistical analysis. This invention, through the processing logic in step S1, constructs a frame-level drainage status sequence from the video source, laying the data foundation for subsequent event extraction.

[0038] S1.1 Acquires and decodes surveillance video.

[0039] A fixed surveillance camera is installed at the outlet location. This camera continuously collects video signals from the outlet area, which are transmitted to the processing system as a video stream. The collected video signals are decoded, and a video decoding algorithm decomposes the continuous video stream into a sequence of raw image frames arranged in chronological order. During this process, a precise time tag is attached to each raw image frame. This time tag is derived from the camera's built-in clock or the system's synchronized clock. The synchronization mechanism includes periodic calibration to match the network time protocol, ensuring that the tag accuracy reaches the millisecond level and reflects the image frame capture time. After decoding, each image frame in the raw image frame sequence is stored independently, including pixel data and the corresponding time tag, forming an ordered frame set, which serves as input data for subsequent preprocessing.

[0040] S1.2 Image preprocessing.

[0041] Based on the temporal order and labels of the original image frame sequence, multi-stage preprocessing operations are performed on each image frame. First, geometric correction is performed to reduce distortion caused by the camera mounting angle. A perspective transformation algorithm is used to calculate the transformation matrix and adjust the geometric structure of the image frame, ensuring the drainage outlet area presents a standard frontal view. Second, brightness and contrast normalization is performed. A histogram equalization algorithm is used to calculate the pixel distribution of the image frame and expand the dynamic range, mitigating brightness differences caused by day and night lighting variations and ensuring that the image frames maintain consistent visual characteristics across different time periods. Finally, region of interest (ROI) cropping is performed within the drainage outlet area. A boundary detection algorithm is used to locate the core area of ​​the drainage outlet. This algorithm identifies edge pixels and generates boundary contours through gradient calculation, then crops out irrelevant background parts based on the contour coordinates, retaining only pixel blocks containing drainage information. After preprocessing, each image frame is transformed into a standardized form with uniform size and reduced noise, making it directly applicable to model input.

[0042] S1.3 Input video recognition model generates frame-level drainage state.

[0043] The preprocessed image frame sequence, having removed interference, is input into a pre-trained video recognition model. This model employs a deep neural network primarily based on convolutional structures. Input is either a single frame or a short sequence of image frames. When a short sequence is input, the model captures dynamic features between consecutive frames through temporal convolutional layers. The model extracts features through multiple convolutional and pooling layers, then outputs a frame-level drainage state label describing whether the image frame is in a drainage state after passing through fully connected layers. The frame-level drainage state label uses discrete state markings, at least distinguishing between drainage and non-drainage states. Label generation is based on drainage features learned by the model during training, such as water flow texture and flow signs. For each image frame, the model processes independently and outputs a corresponding label, ensuring a high degree of match between the label and the original content of the image frame. After processing, each image frame is associated with a frame-level drainage state label, forming an intermediate data record with state information. Finally, a set of frame-level drainage state labels for all image frames is output.

[0044] In one embodiment, the overall structure of the video recognition model can be as follows:

[0045] The video recognition model employs a temporally enhanced dual-stream convolutional neural network structure, comprising a spatial flow branch and a temporal flow branch. The spatial flow branch uses ResNet-50 as its backbone, taking a pre-processed region-of-interest image (uniform size 224×224×3) as input, and is responsible for extracting static water flow textures, surface ripples, and wet marks at the outlet. The temporal flow branch uses BN-Inception combined with dilated 3D convolution (R(2+1)D) as its backbone, taking a short sequence of five consecutive stacked images (size 5×112×112×3) as input, and capturing water flow vectors, optical flow changes, and foam drift trajectories between adjacent frames through 3D convolution. The two branches concatenate features after a global average pooling layer, forming a 1024+512=1536-dimensional fused feature vector, which is then connected to a three-layer fully connected network (1536→512→128→2). The output uses a Softmax layer to generate two types of probabilities: the probability of drainage (P_drain) and the probability of no drainage (P_nodrain). Guided by the saliency of the features in the discharge outlet area, the model introduces an additional channel attention module (SE-block) after each residual block of ResNet-50, which makes the model more focused on the discharge outlet flow area and suppresses the interference of the river background.

[0046] How to construct the training dataset for video recognition models:

[0047] In one embodiment, the training dataset originates from multiple monitoring cameras deployed in actual water conservancy engineering river management projects. Continuous monitoring videos of multiple outlets at different time periods are collected, accumulating to tens of thousands of hours of monitoring time. For these videos, image frames are extracted at fixed intervals as candidate labeled frames. These frames are then manually labeled by water conservancy maintenance personnel according to the rule of "whether there is continuous and obvious drainage at the outlet," indicating either a drainage state or a non-drainage state. Frames that lack significance for judgment, such as those from rain backflow or severe lens obstruction, are marked as invalid frames and removed from the training dataset. After the above processing, tens of millions of valid labeled frames are obtained. Valid labeled frames refer to frames in the original candidate frames that have been manually labeled and have not been marked as invalid scenes. Those skilled in the art can adjust the number of outlets collected and the monitoring time according to the specific project scale; this invention does not limit the specific numerical range.

[0048] Specific training steps and parameter settings for video recognition models:

[0049] The training process is divided into three stages, using the PyTorch framework for distributed training on four RTX 3090 graphics cards.

[0050] Phase 1: Pre-train the two branches independently.

[0051] The spatial flow branch uses ResNet-50 weights pre-trained on ImageNet, trained on the outlet dataset with a batch size of 256, an initial learning rate of 0.01, a cosine annealing scheduler for 30 epochs, an SGD optimizer, a momentum of 0.9, and a weight decay of 5e-4.

[0052] The temporal stream branch uses R(2+1)D weights pre-trained on Kinetics-400 and is trained for 40 epochs on short sequence data at the outlet with a batch size of 64 and an initial learning rate of 0.005. The other hyperparameters are the same as those for the spatial stream.

[0053] The second stage involves freezing the backbone networks of both branches and training only the three-layer fully connected network after feature concatenation and the SE attention module. The learning rate is set to 0.001, and training lasts for 15 epochs. An imbalanced weighted cross-entropy loss function is used. Since the number of frames in the un-drained state is significantly greater than the number of frames in the drained state in actual monitoring scenarios, a greater weight is assigned to the drained state class to improve the recall rate of this minority class. In one specific embodiment, the weight of the drained state class is set to 1.5, and the weight of the un-drained state class is set to 1.0. This weight combination, selected by comparing the recognition performance of different weights on the validation set, significantly reduces the false negative rate of the drained state while keeping the false positive rate of the un-drained state within an acceptable range. Those skilled in the art can adjust the weight values ​​according to the data distribution of different projects.

[0054] Phase 3: Unfreeze all network parameters, perform end-to-end fine-tuning, reduce the learning rate to 0.0001, and train for 25 epochs using labeled smoothing (smoothing=0.1) cross-entropy loss. Evaluate the macro-F1 score on the validation set every 5 epochs, and save the model with the highest macro-F1 score as the final video recognition model.

[0055] S1.4 forms a frame-level drainage state sequence.

[0056] Since frame-level drainage status labels correspond to image frames, the frame-level drainage status label of each image frame is bound to its time label, creating a data record containing both a time label and a frame-level drainage status label. Specifically, all data records are traversed in chronological order of the original image frame sequence, connecting them into a linear structure to ensure that the time labels of adjacent elements in the sequence increase sequentially. If there are discontinuous time labels, missing records are filled using an interpolation algorithm. This algorithm calculates an intermediate value based on adjacent time labels and assigns the same frame-level drainage status label to maintain sequence integrity. Finally, a frame-level drainage status sequence corresponding to the drainage outlet is formed. Each element in this sequence includes at least a time label and a frame-level drainage status label, forming a state chain on the timeline. This formation process summarizes all outputs from step S1, providing the original basis for drainage event extraction, with the frame-level drainage status sequence serving as the final product of step S1.

[0057] Step S1 generates a time-ordered frame-level drainage status sequence, providing fundamental data to distinguish between drainage and non-drainage processes. Starting with the acquisition and decoding of the discharge outlet monitoring video, image preprocessing optimization and video recognition model analysis are performed to finally construct the corresponding frame-level drainage status sequence for the discharge outlet. This sequence uses time tags and frame-level drainage status tags as core elements to ensure the continuity and accuracy of drainage dynamics. This sequence not only completely captures the instantaneous changes in the drainage process but also provides a reliable data foundation for merging candidate drainage segments in the subsequent step S2. This enables the effective transformation from raw video to event-level information in the operation and maintenance management of water conservancy projects, improving the efficiency of anomaly detection and statistical analysis.

[0058] In this invention, the video recognition model outputs frame-level drainage status labels for preprocessed drainage outlet monitoring image frames to distinguish between drainage and non-drainage states, thereby constructing a time-ordered frame-level drainage status sequence. The key technical aspect of this invention lies in performing segment merging, stability assessment, event encapsulation, and adaptive parameter updates based on this frame-level drainage status sequence. The video recognition model itself can employ mature existing binary classification image recognition models or temporal recognition models, such as those based on convolutional neural networks or three-dimensional convolutional networks. This invention does not limit the specific network structure or training framework, as long as it can output the drainage status label corresponding to each image frame.

[0059] Step S1 involves acquiring monitoring video of the drainage outlet, decoding it into a sequence of original image frames, adding time tags, performing geometric correction, brightness and contrast normalization, and cropping the region of interest. The resulting data is then input into a video recognition model to generate frame-level drainage status tags, which are then bound to time tags to form a corresponding frame-level drainage status sequence for the drainage outlet. Although this provides continuous instantaneous status information of the drainage dynamics, this information is still scattered frame-level data and cannot directly form continuous events. Therefore, step S2 requires merging and statistically analyzing adjacent frames using the frame-level drainage status sequence to generate a set of candidate drainage segments with start time, end time, and status statistics, thus laying a structured foundation for subsequent stability assessment.

[0060] S2.1 Sequentially traverse the frame-level drainage state sequence.

[0061] Based on the frame-level drainage state sequence constructed in step S1, which includes time labels and frame-level drainage state labels, a sequential traversal operation is performed starting from the first element of the sequence. The time label and frame-level drainage state label of each element are checked one by one. The traversal uses a linear scanning algorithm, processing all elements of the sequence, including returning an empty set when the sequence is empty or marking gaps when the sequence is discontinuous. During the check, the frame-level drainage state label of the current element is used as a benchmark and compared with subsequent elements, while the position index is recorded for backtracking.

[0062] S2.2 Merge adjacent image frames.

[0063] Following the traversal of the located current frame, for both the current frame and the next frame, compare their frame-level drainage state labels for similarity, and calculate the difference between their time labels using a subtraction operation. If their frame-level drainage state labels are identical and the time label difference is no greater than a preset time continuity threshold, then the current frame and the next frame are grouped together as the growth part of the candidate drainage segment. Specifically, the time label of the earliest frame in the group is recorded as the start time of the candidate drainage segment, and the time label of the latest frame in the group is recorded as the end time. This merging process continues until the condition is no longer met, ensuring that the frame states within the group are consistent and the time is continuous.

[0064] The time continuity threshold can be initialized and updated based on statistical results of high-confidence-level drainage event objects. During the initial system deployment phase, the time continuity threshold can be set to correspond to several frame time intervals based on the frame rate of the outlet camera and the flow rate experience of typical drainage processes. After the system has run for a period of time and a certain number of high-confidence-level drainage event objects have been generated, the time continuity threshold can be adjusted according to the allowable interruption time threshold obtained in step S5, ensuring that the time continuity threshold is not less than the allowable interruption time threshold for the outlet, so that short-term un-drained segments not exceeding this threshold are ignored when merging adjacent drainage status frames.

[0065] S2.3 End the merging and collect status information.

[0066] When a change in the frame-level drainage status label is detected during the traversal, or when the time label difference between two adjacent frames exceeds the time continuity threshold, the merging process of the current candidate drainage segment immediately ends. Among the merged candidate drainage segments, the total number of frames is counted through element-wise iterative accumulation, and the distribution of the frame-level drainage status labels is analyzed, including scanning frame by frame to count the number of drainage-state frames and the number of non-drained-state frames. These statistical results are directly used as the status statistics information of the candidate drainage segment for subsequent segment quality assessment.

[0067] S2.4 Form a set of candidate drainage segments.

[0068] The above traversal, merging, and statistical process is repeated for the entire frame-level drainage state sequence. After each candidate drainage segment is completed, its start time, end time, state statistics, and corresponding outlet identifier are stored in a linked list data structure. After all segments are accumulated, a candidate drainage segment set for the corresponding outlet is formed, ensuring that each element in the set is independent and can be retrieved by outlet identifier. This formation process integrates the output of step S2 to provide intermediate data for drainage event filtering.

[0069] In step S2, adjacent frames with the same state are merged into candidate drainage segments, and the scattered frame-level states are initially organized into segments with time intervals. Sequential traversal merging and statistical operations are performed on the frame-level drainage state sequence to form a set of candidate drainage segments for the corresponding outlet. This set serves as intermediate data output. Although it aggregates scattered states, the stability of the segments still needs to be verified. Therefore, it provides direct input for step S3 to perform stability judgment on the set of candidate drainage segments, and supports further screening and encapsulation of drainage event objects.

[0070] Step S2 sequentially traverses the frame-level drainage state sequence starting from the first element, merging image frames whose frame-level drainage state labels are the same as the current frame and the next frame, and whose time label difference is not greater than the time continuity threshold, to obtain candidate drainage segments. It records the start time, end time, and state statistics to form a set of candidate drainage segments for the corresponding drainage outlet. The time continuity threshold is initialized by a preset time continuity threshold during initial system deployment. The preset time continuity threshold can be set to a certain number of frame time intervals based on the frame rate of the drainage outlet camera and the continuous characteristics of a typical drainage process. After the system is running and the allowable interruption time threshold is formed in step S5, the time continuity threshold is updated to the allowable interruption time threshold for that drainage outlet.

[0071] Steps S1 and S2 have successively completed the construction of the drainage state sequence from the monitoring video and the merging of adjacent frames with the same state, forming a set of candidate drainage segments with start time, end time and state statistics. However, these candidate drainage segments include both truly continuous and stable drainage processes and false stable segments that are incorrectly spliced ​​together due to short-term interference, sudden changes in illumination or water surface reflection. If these are directly used as drainage events, it will lead to incorrect event boundaries or a proliferation of false events, which will seriously affect the accurate triggering of maintenance work orders and the reliability of drainage behavior statistics. This invention performs a refined stability judgment on the set of candidate drainage segments in step S3, introduces two core quantitative indicators: the continuity of drainage rhythm within the segment and the stable time band of the segment boundary, and outputs the stability judgment coefficient of drainage events in combination with a machine learning model, so as to achieve accurate screening of target drainage segments and reliable encapsulation of drainage event objects.

[0072] S3.1 Extract the local frame-level drainage state sequence.

[0073] For each candidate drainage segment in the candidate drainage segment set, based on its recorded start and end times, all elements that completely correspond to the time interval are extracted from the original frame-level drainage state sequence generated in step S1 to form a local frame-level drainage state sequence specific to that candidate drainage segment.

[0074] S3.2 Calculate the continuity of the drainage rhythm within the segment.

[0075] In actual discharge monitoring, even if a segment has a long overall duration, if there are sporadic state flips within it, such as alternating between a draining and non-draining state due to foam floating or brief obstruction, the segment is essentially still an unstable process with disrupted rhythm. Simply relying on the total duration or the proportion of draining frames cannot effectively identify such pseudo-continuity. Therefore, it is necessary to introduce an indicator that reflects local continuity and consistency, focusing on whether each frame maintains the exact same draining state in its immediate preceding and following frames, thereby eliminating interference from isolated flips.

[0076] The local frame-level drainage state sequence is traversed. For each intermediate frame i in the sequence (excluding the first and last frames), it is checked whether the frame-level drainage state labels of frames i-1, i, and i+1 are completely identical, and whether the time label differences between frames i-1 and i, and between i and i+1, satisfy the time continuity requirement. If all conditions are met, frame i is counted as a rhythmically stable frame. After the traversal is completed, the number of all rhythmically stable frames is counted and recorded as the number of rhythmically stable frames.

[0077] The smoothness of the drainage rhythm within a segment is calculated as the ratio of the number of rhythmically stable frames to the total number of frames within the segment. This parameter ranges from 0 to 1, with higher values ​​indicating a smoother and more consistent drainage rhythm within the segment.

[0078] S3.3 Calculate the stable time band of the segment boundary.

[0079] The beginning and end phases of the drainage process are often accompanied by tentative fluctuations in the state. For example, at the beginning of drainage, there may be a few frames of drainage state followed by a brief interruption, or at the end, there may still be sporadic water droplets causing residual drainage tags. If only the boundary determined by the merging rules is used as the event boundary, it is very easy to cause excessive amplification or truncation of the time interval. Therefore, in addition to the internal rhythm, it is also necessary to separately evaluate whether the two ends of the segment fall at the stable positions of the actual drainage entry and exit. For this purpose, the boundary stability time band parameter is introduced to specifically quantify the state stability near the start and end boundaries.

[0080] A starting boundary time band is formed by extending a fixed duration forward and backward from the start time of the candidate drainage segment, and an ending boundary time band is formed by extending the same fixed duration forward and backward from the end time. Within each of the two boundary time bands, the cumulative duration of the longest sub-interval where the frame-level drainage state label remains unchanged is counted from the corresponding local frame-level drainage state sequence, thus obtaining the non-flipping time length of the starting boundary and the non-flipping time length of the ending boundary.

[0081] The stable time band of a segment boundary is calculated as the ratio of the sum of the no-flip time length of the starting boundary and the no-flip time length of the ending boundary to the total duration of the two boundary time bands. This parameter also has a value range of 0 to 1, with a higher value indicating a more stable and reliable segment boundary.

[0082] S3.4 Input the machine learning model to obtain the stability determination coefficient of the drainage event.

[0083] In practical outfall monitoring scenarios, relying solely on thresholds for two parameters—the continuity of drainage rhythm within a segment and the stable time band at the segment boundary—can initially screen stable segments. However, when faced with complex disturbances such as seasonal water level changes or feature distribution variations caused by equipment noise, overfitting or underfitting issues can easily occur. This leads to some genuine drainage events being falsely rejected or false segments being approved, thus affecting the accuracy of operation and maintenance decisions. To solve this problem, it is necessary to introduce an intelligent classification mechanism based on historical data. By learning from past manually verified event patterns, the stability of new segments can be dynamically evaluated, thereby achieving more robust judgments.

[0084] The coherence of the drainage rhythm within a segment and the stable time band at the segment boundary are combined into a two-dimensional feature vector, which is then input into a support vector machine model pre-trained based on historical drainage event samples. This model uses a large number of historical candidate drainage segments as training samples, with each sample featuring the same two parameters. Sample labels are manually verified or strictly defined as either stable drainage events or unstable segments. The training objective is to maximize the class margin, ultimately forming a decision function that outputs the distance from the hyperplane to the new feature vector.

[0085] In one embodiment, the overall structure of the machine learning model can be as follows:

[0086] In one embodiment, the machine learning model employs a support vector machine classifier. The input features are two dimensionless parameters: the rhythmic coherence within the segment and the stable time band at the segment boundary. The kernel function is the radial basis function (RBF) kernel, which can be expressed as: K(x,x')=exp(-γ‖x-x'‖ 2 The model is defined as follows: x and x' are two-dimensional feature vectors, and γ is the kernel width parameter. The radial basis function (RBF) kernel maps these two-dimensional features to a high-dimensional feature space. In this high-dimensional space, a linear hyperplane is learned to distinguish stable drainage events from unstable segments, thus achieving a nonlinear decision boundary in the original feature space. Those skilled in the art can adjust the kernel parameter γ according to the sample distribution. The model includes a feature scaling layer to normalize the input parameters, which is then connected to a support vector optimization layer. The output is a stability determination coefficient for the drainage event, calculated based on the distance from the sample to the hyperplane. The regularization parameter C is optimized through a grid search and set to balance underfitting and overfitting.

[0087] How to construct training datasets for machine learning models:

[0088] In one embodiment, the training dataset for the machine learning model originates from monitoring data of multiple discharge outlets recorded in historical drainage supervision projects. Monitoring segments containing drainage-related events are selected, with a cumulative video duration on the order of tens of thousands of hours. For each monitoring video segment, candidate drainage segments are generated according to the processing logic of steps S2 and S3. These candidate drainage segments are then manually reviewed by maintenance personnel. Segments confirmed to be part of a continuous drainage process are labeled as stable drainage events, while segments clearly caused by interference or noise are labeled as unstable segments. Each labeled segment can generate a training sample. The sample characteristics are the continuity of the drainage rhythm within the segment and the stable time band at the segment boundary. The sample label is either a stable drainage event or an unstable segment. After removing segments marked as invalid, tens of thousands of valid samples are obtained. Those skilled in the art can choose an appropriate sample size based on the amount of data accumulated in the actual project.

[0089] Specific steps and parameter settings for training a machine learning model:

[0090] The training process is divided into two phases, executed on a dual-core processor using the Scikit-learn library.

[0091] Phase 1: Data Preprocessing and Initial Training. All sample features are Z-score standardized, with an initial C parameter of 1.0 and a gamma parameter of scale. A support vector machine is trained using cross-validation (5-fold), with a sequence minimum optimization algorithm as the optimizer. Training is iterated until convergence.

[0092] Phase Two: Hyperparameter Tuning and Final Fitting. A grid search is used to find the optimal combination within the ranges of C and gamma parameters. Accuracy is evaluated using a validation set, and the model with the highest accuracy is selected as the final machine learning model. This model is then trained on the entire dataset to maximize generalization ability.

[0093] The model outputs a numerical stability determination coefficient for drainage events. A positive value indicates a tendency towards stable drainage events, and the larger the absolute value, the more reliable the result.

[0094] S3.5 Jointly determine and select the target drainage segment.

[0095] The candidate drainage segment is determined as the target drainage segment when all three conditions are met simultaneously: the stability determination coefficient of the drainage event is higher than the stability threshold, the duration is greater than the duration threshold, and the proportion of drainage status frames is higher than the minimum proportion threshold.

[0096] The stability threshold, duration threshold, and minimum percentage threshold can be determined statistically from samples labeled as stable drainage events in the machine learning training dataset. For example, the lower quartile of the distribution of drainage event stability determination coefficients corresponding to all stable drainage event samples can be used as the stability threshold; the lower quartile of the distribution of duration of stable drainage events can be used as the duration threshold; and the lower quartile of the distribution of the percentage of drainage status frames in stable drainage events can be used as the minimum percentage threshold. Those skilled in the art can adjust the above statistical quartiles according to the drainage conditions of different projects.

[0097] S3.6 encapsulates and forms a collection of drainage event objects.

[0098] For each target drainage segment, its outlet identifier, time interval, drainage rhythm continuity within the segment, stable time zone at the segment boundary, and drainage event stability determination coefficient are encapsulated as independent drainage event objects. All objects are then aggregated to form a drainage event object set.

[0099] Step S3 assesses the stability of candidate segments and selects target drainage segments based on parameters such as the continuity of drainage rhythm within the segment and the stable time band of the segment boundary. This solves the problem in existing technologies that cannot automatically extract continuous drainage events from frame-level states. By selecting truly stable and reliable target drainage segments from the candidate drainage segment set and encapsulating them into a drainage event object set, this set serves as the direct input for the backtracking verification in the subsequent step S4, providing a solid event-level data foundation for the final formation of a highly reliable drainage event result set.

[0100] Although the drainage event object set formed in step S3 has initially screened out stable segments, its time interval may have boundary deviations or internal inconsistencies due to the limitations of initial merging and judgment, resulting in inaccurate event descriptions. This, in turn, affects the accuracy of triggering operation and maintenance tasks and the reliability of statistical analysis. Through the processing logic in step S4, this invention uses frame-level drainage state sequences to backtrack and verify the drainage event object set, marks the credibility level, and forms a drainage event result set, providing high-precision final event data for subsequent parameter optimization and event database writing.

[0101] S4.1 Extract the local frame-level drainage state sequence.

[0102] Based on the time intervals contained in the drainage event object set generated in step S3, for each drainage event object in the set, according to its recorded time interval, all elements within the corresponding interval are re-extracted from the frame-level drainage state sequence, including time tags and frame-level drainage state tags, to form a local frame-level drainage state sequence associated with that drainage event object. This sequence maintains the sequential integrity of the original data, focuses only on a subset within the specified interval, and does not add any external data, for subsequent boundary checks and parameter recalculation.

[0103] S4.2 Adjust the start time.

[0104] The local frame-level drainage state sequence is prepared. Extending the range of several frames before and after the start time of the drainage event object, the frame-level drainage state labels of these frames are compared. If there is an earlier period of continuous drainage before the start time, the start time of the drainage event object is moved forward to the beginning of that continuous segment; conversely, if several consecutive frames after the start time are in a non-drained state, the start time is moved backward to the actual start position of the continuous drainage state. This adjustment is achieved through frame-by-frame scanning, ensuring that the new start time reflects the true start of drainage and avoiding initial segment boundary shifts caused by noise.

[0105] S4.3 Adjust the end time.

[0106] Similar to the start time processing, the process extends to several frames before and after the end time of the drainage event object. The frame-level drainage status labels of these frames are compared. If a continuous drainage state exists after the end time, the end time of the drainage event object is moved forward to the end of that continuous segment. Conversely, if several consecutive frames before the end time are in an un-drained state, the end time is moved forward to the actual end position of the continuous drainage state. The adjustment operation also uses a frame-by-frame comparison method, covering all adjacent frames to ensure that the new end time captures the complete drainage tail and avoids omissions or redundant residual states.

[0107] S4.4 Recalculate the parameters and label the trust level.

[0108] After adjusting the time interval, the local frame-level drainage state sequence is re-traversed based on the new interval. The number of rhythmically stable frames is counted, i.e., each intermediate frame and its preceding and following frame labels are the same and time-continuous. The number of rhythmically stable frames is calculated and divided by the total number of frames to obtain the drainage rhythm coherence within the segment. At the same time, the non-flipping time length of the start and end boundary time bands is re-counted, and its ratio to the total boundary duration is calculated to obtain the segment boundary stable time band. These re-parameters are comprehensively evaluated together with the original drainage event stability judgment coefficients using a weighted summation algorithm. The confidence level is graded according to the evaluation score, at least into high confidence, medium confidence, and low confidence, to quantify the overall reliability of the event at the boundary and within the segment.

[0109] After adjusting the start and end times, based on the local frame-level drainage state sequence corresponding to the adjusted time interval, the two parameters of drainage rhythm coherence within the segment and stable time band at the segment boundary are recalculated and together with the drainage event stability determination coefficient obtained in step S3, they form an evaluation triplet. To quantify the overall credibility of the drainage event object, the drainage rhythm coherence within the segment is denoted as C_in, the stable time band at the segment boundary is denoted as C_bd, and the drainage event stability determination coefficient is denoted as C_ml. The evaluation score is defined as: Score = α·C_in + β·C_bd + γ·f(C_ml), where α, β, and γ are non-negative coefficients used to balance the three dimensions and satisfy α + β + γ = 1, and f(C_ml) is a monotonically increasing function that maps the drainage event stability determination coefficient to the interval [0,1], for example, by linearly normalizing C_ml. The coefficients α, β, and γ can be determined by comparing the reliability level determination effect of different combinations of coefficients on historical drainage event samples. In one embodiment, the weight of the stable time band of the segment boundary can be increased first to improve the accuracy of the event boundary.

[0110] To classify events into high, medium, and low confidence levels, all manually verified stable event drainage targets can be selected from the machine learning training dataset. Their corresponding evaluation scores (Scores) can be calculated, resulting in a statistical distribution of these stable event evaluation scores. The lower quartile of this distribution is denoted as Score_low, and the midpoint between the median and the upper quartile is denoted as Score_high. An event drainage target is marked as high confidence when its evaluation score is not lower than Score_high, as medium confidence when its evaluation score is between Score_low and Score_high, and as low confidence when its evaluation score is lower than Score_low. Those skilled in the art can adjust the quantile and coefficient values ​​according to the project's trade-off between false negative and false positive rates.

[0111] S4.5 forms a set of drainage event results.

[0112] All adjusted and tagged drainage event objects are aggregated. Each object includes a discharge outlet identifier, adjusted time interval, drainage rhythm consistency within the segment, stable time zone at the segment boundary, drainage event stability judgment coefficient, and confidence level, forming a drainage event result set. This set is organized in a list structure to ensure that each element is independently searchable.

[0113] By retrospectively verifying and marking the credibility level in step S4, the reliability of the time interval and stability index of drainage events is further improved. By adjusting the boundaries and marking the credibility of the drainage event object set, a drainage event result set is generated. This set serves as the direct input for the subsequent classification and statistics in step S5, supporting the adaptive updating of parameters and the reliable application of the event database in the operation and maintenance of water conservancy projects.

[0114] Step S4 has refined the drainage event object set into a drainage event result set through backtracking verification. However, these event data are still in the form of a whole set, without outlet-level classification and statistics. This makes it impossible to reveal the distribution characteristics of specific outlet drainage patterns, resulting in the merging rules and judgment parameters being unable to dynamically adapt to environmental variations at different outlets, such as seasonal water level changes or differences in interference frequency. Consequently, this affects the accuracy and efficiency of the system's long-term operation. In step S5, this invention performs outlet classification and high-reliability event statistics on the drainage event result set, updates the image frame merging rules and stability judgment parameters based on distribution characteristics, and writes them into the event database, thereby realizing the system's self-learning optimization and the direct availability of operation and maintenance data.

[0115] S5.1 Classify drainage event objects.

[0116] For all drainage event objects in the drainage event result set, they are categorized according to the outlet identifier of each object. Objects with the same outlet identifier are assigned to the same event group, forming event groups indexed by the outlet identifier. This grouping operation uses a hash mapping method to ensure that each group is independent and contains complete object attributes, such as time interval, confidence level, drainage rhythm coherence within the segment, and stable time bands at segment boundaries, without omitting any objects and maintaining the original order.

[0117] S5.2 Filter and count high-reliability drainage event objects.

[0118] Within each discharge outlet's event grouping, drainage event objects are traversed, and objects with a high confidence level are selected. These objects represent drainage events with precise boundaries and internal stability. Subsequently, multi-dimensional statistics are performed on these high-confidence drainage event objects over a specified time period. First, for quantity statistics, the total number of objects is obtained by directly summing them. Second, for duration distribution, the original events may exhibit dispersed durations due to differences in discharge outlets. Without quantifying the distribution, typical drainage patterns cannot be identified. Therefore, the length of the time interval for each object needs to be calculated, i.e., the end time minus the start time, and the distribution characteristics are summarized by grouping using a histogram algorithm.

[0119] The duration distribution D_duration is obtained by collecting the duration values ​​of all high-confidence drainage event objects and counting them according to a preset interval.

[0120] Secondly, regarding the distribution of drainage rhythm coherence within a segment, this parameter reflects internal consistency in statistics. If the distribution is concentrated in the high value range, it indicates that the drainage at the outlet is stable, but it needs to be quantified to guide rule adjustments. Therefore, the drainage rhythm coherence value within each segment is collected, and the distribution characteristics are classified and summarized using a histogram algorithm.

[0121] The fragment internal drainage rhythm coherence distribution D_coherence is obtained by collecting the fragment internal drainage rhythm coherence values ​​of all high-confidence drainage event objects and classifying and counting them according to numerical intervals.

[0122] Finally, for the stable time zone distribution of the fragment boundary, in statistics, this parameter evaluates the stability of the boundary. If the distribution is biased towards high values, it indicates that the boundary is reliable. However, it needs to be quantified to optimize the judgment conditions. Therefore, the stable time zone values ​​of the fragment boundary of each object are collected, and the distribution characteristics are classified and summarized by the histogram algorithm.

[0123] The fragment boundary stable time band distribution was obtained by collecting the fragment boundary stable time band values ​​of all high-confidence drainage event objects and classifying and counting them according to numerical intervals.

[0124] S5.3 Adjust the image frame merging rules and stability judgment parameters.

[0125] In step S5, after classifying and statistically analyzing each outlet, the image frame merging rules for the outlet are adjusted in the following manner for the high-confidence level drainage event object corresponding to that outlet, so that the subsequent merging of candidate drainage segments for that outlet is closer to the actual drainage characteristics of that outlet.

[0126] S5.3.1 sets the threshold for allowed interruption time.

[0127] For a given drainage outlet, in each high-confidence level drainage event object of that outlet, read the time interval recorded by the drainage event object, and extract the frame-level drainage status tag sequence within that time interval from the frame-level drainage status sequence.

[0128] In this frame-level drainage status label sequence, time periods that meet the following conditions are identified as short-term interruption time periods: there are consecutive drainage status frames before the start of the time period, there are consecutive drainage status frames after the end of the time period, and all frames within the time period have frame-level drainage status labels in an un-drained state. For each high-confidence-level drainage event object, all short-term interruption time periods are identified in its corresponding frame-level drainage status label sequence, and the duration of each short-term interruption time period is calculated based on its time label.

[0129] For the same high-confidence-level drainage event object, compare the duration of all short-term interruption periods, select the one with the longest duration, and record that duration as the typical interruption duration of the drainage event object.

[0130] For all high-reliability drainage events at the same outlet, collect their typical interruption time lengths to form a typical interruption time length set. Sort all time lengths in the set in ascending order. Let the number of time lengths after sorting be M. When M is odd, select the time length whose sorted position is the integer position obtained by dividing (M+1) by two. When M is even, select the time length whose sorted position is the integer position obtained by dividing M by two. Determine the selected time length as the allowable interruption time threshold for the outlet.

[0131] When merging candidate drainage segments for the outlet, if a non-drainage period with a duration not exceeding the allowed interruption time threshold is detected between two drainage status frames, the non-drainage period is merged with the previous and subsequent drainage status frames according to the adjusted image frame merging rules, and the merged result is regarded as a continuous candidate drainage segment.

[0132] At the same time, the time continuity threshold of the port is updated to the allowable interruption time threshold of the port, so that when the port performs frame merging traversal in subsequent steps S2, the updated time continuity threshold is used to determine the time interval between adjacent frames.

[0133] S5.3.2 Form a threshold for the length of the boundary ambiguity zone.

[0134] For each high-confidence-level drainage event object at the same outlet, the start and end times recorded by the drainage event object are read. A start boundary time band is constructed centered on the start time, and an end boundary time band is constructed centered on the end time, within the frame-level drainage state sequence. The time range of the start boundary time band is set from the start time minus a first preset boundary duration to the start time plus the first preset boundary duration. The time range of the end boundary time band is set from the end time minus a second preset boundary duration to the end time plus the second preset boundary duration.

[0135] Within the initial boundary time band, frame-level drainage status labels are read sequentially in ascending order of time tags to determine time periods that meet the following conditions: starting from a certain frame, the frame-level drainage status labels for multiple consecutive frames are all in a drainage state, and there are no consecutive drainage state frames before the start of this time period; after the end of this time period, the frame-level drainage status labels show a non-drainage state. The duration of this time period is calculated based on the time tags, and this duration is recorded as the initial fuzzy band duration of the drainage event object.

[0136] Within the end boundary time band, frame-level drainage status labels are read sequentially in descending order of time tags to determine time periods that meet the following conditions: starting from a certain frame, the frame-level drainage status labels for multiple consecutive frames are all in a drainage state, and there are no consecutive drainage state frames after the end of this time period; before the start of this time period, the frame-level drainage status labels are in a non-drainage state. The duration of this time period is calculated based on the time tags, and this duration is recorded as the end blur band duration of the drainage event object.

[0137] For all high-confidence drainage events at the same outlet, the starting and ending fuzzy band time lengths are collected to form a set of starting and ending fuzzy band time lengths. The time lengths in the two sets are sorted in ascending order. Let N be the number of time lengths in the starting fuzzy band time length set and K be the number of time lengths in the ending fuzzy band time length set. When N is odd, the starting fuzzy band time length at the integer position obtained by dividing (N+1) by two after sorting is selected. When N is even, the starting fuzzy band time length at the integer position obtained by dividing N by two after sorting is selected to obtain the first representative time length representing the starting boundary characteristics. When K is odd, the ending fuzzy band time length at the integer position obtained by dividing (K+1) by two after sorting is selected. When K is even, the ending fuzzy band time length at the integer position obtained by dividing K by two after sorting is selected to obtain the second representative time length representing the ending boundary characteristics. The maximum value between the first and second representative time lengths is determined as the boundary fuzzy band length threshold of the outlet.

[0138] When merging candidate drainage segments for the outlet, if the time interval between the start time of a candidate drainage segment and the end time of a continuous drainage state preceding that start time is not greater than the boundary ambiguity band length threshold, the start time of the candidate drainage segment is adjusted to the start time of that continuous drainage state; if the time interval between the end time of a candidate drainage segment and the start time of a continuous drainage state following that end time is not greater than the boundary ambiguity band length threshold, the end time of the candidate drainage segment is adjusted to the end time of that continuous drainage state, so that the adjusted candidate drainage segments cover the complete stable drainage process in terms of time range.

[0139] S5.4 storage update rules.

[0140] The adjusted image frame merging rules and stability judgment parameters, including the time continuity threshold updated according to the allowable interruption time threshold obtained in step S5.3.1, the boundary blur band length threshold obtained according to step S5.3.2, and the corresponding judgment conditions, are stored in the configuration record of the corresponding outlet. This record is persistently stored to ensure that the parameters are not lost after the system restarts. When processing new monitoring videos, these parameters are loaded from the configuration record and directly applied to the merging traversal in step S2 and the stability judgment in step S3.

[0141] S5.5 writes to the event library.

[0142] All drainage event objects in the drainage event result set are written to the event database of the engineering operation and maintenance management system in batch insertion mode. Each object serves as an independent basic data unit, containing complete attributes such as outlet identifier, time interval, and reliability level. This writing supports index optimization for fast querying and is used to generate operation and maintenance task records such as abnormal drainage work orders, as well as statistical analysis records such as drainage time distribution charts, providing event-level data support for engineering operation and maintenance personnel.

[0143] Step S5 involves statistically analyzing high-reliability events according to the discharge outlet and adaptively updating the merging rules and judgment parameters. This enables the system to automatically adjust thresholds and rules as the on-site operating conditions change, thereby achieving automatic organization of drainage events and outputting event-level data for drainage operation and maintenance management. By completing the discharge outlet-level statistics and parameter updates through the drainage event result set, the system achieves dynamic adaptation and integrates event data into the event database, supporting efficient operation and maintenance task generation and drainage behavior analysis.

[0144] Example 2: Figure 2 This invention presents an engineering operation and maintenance management system based on video recognition algorithms, comprising:

[0145] The frame sequence generation module acquires the monitoring video of the drainage outlet, splits it into image frames, and inputs them into the video recognition model after preprocessing to obtain the frame-level drainage status, forming a time-arranged sequence of frame-level drainage status.

[0146] The segment synthesis module merges adjacent image frames with the same drainage state and continuous time into candidate drainage segments based on the frame-level drainage state sequence, records the start and end times of each candidate drainage segment, and forms a set of candidate drainage segments.

[0147] The stability assessment module calculates the internal drainage rhythm coherence and segment boundary stability time band for each candidate drainage segment based on the frame-level drainage state sequence. The two parameters are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient of the corresponding candidate drainage segment. Based on this and the segment duration, the target drainage segment is determined and encapsulated as a drainage event object that records the outlet identifier and time interval, forming a drainage event object set.

[0148] The boundary verification module uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start and end times, marks the confidence level, and forms a drainage event result set.

[0149] The rule-adaptive module categorizes and statistically analyzes drainage event objects in the drainage event result set according to the outlet, updates the image frame merging rules and stability judgment parameters of the corresponding outlet based on the statistical results, and writes the drainage event result set into the event library of the engineering operation and maintenance management system.

[0150] Specifically, the above description is only a preferred embodiment of this application and is not intended to limit this application.

[0151] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0152] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. An engineering operation and maintenance management method based on video recognition algorithms, characterized in that, Including the following steps: S1 acquires the monitoring video of the discharge outlet, splits it into image frames, preprocesses it and inputs it into the video recognition model to obtain the frame-level drainage status, forming a time-arranged sequence of frame-level drainage status. S2 merges adjacent image frames with the same drainage state and continuous time into candidate drainage segments based on the frame-level drainage state sequence, records the start and end times of each candidate drainage segment, and forms a set of candidate drainage segments. S3 calculates the internal drainage rhythm coherence and segment boundary stability time band for each candidate drainage segment based on the frame-level drainage state sequence. The two parameters are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient of the corresponding candidate drainage segment. Based on this and the segment duration, the target drainage segment is determined and encapsulated as a drainage event object that records the outlet identifier and time interval, forming a drainage event object set. The internal drainage rhythm coherence is determined by traversing the local frame-level drainage state sequence and checking whether the frame-level drainage state labels of each intermediate frame (excluding the first and last frames) and its adjacent frames are completely identical and whether the time label difference meets the time continuity requirement. Intermediate frames that meet the conditions are counted as rhythm-stable frames. The ratio is calculated by dividing the number of rhythm-stable frames by the total number of frames within the segment. The segment boundary stable time band is determined by extending fixed durations near the start and end times to form a start boundary time band and an end boundary time band. The cumulative duration of the longest sub-interval where the frame-level drainage state label remains unchanged within each time band is counted. The non-flipping time length of the start boundary and the non-flipping time length of the end boundary are obtained. The ratio is calculated by dividing the sum of the non-flipping time lengths at both ends by the total duration of the two boundary time bands. S4 uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start and end times, marks the confidence level, and forms a drainage event result set. S5 categorizes and statistically analyzes the drainage event objects in the drainage event result set according to the discharge outlet, updates the image frame merging rules and stability judgment parameters of the corresponding discharge outlet based on the statistical results, and writes the drainage event result set into the event library of the engineering operation and maintenance management system.

2. The engineering operation and maintenance management method based on video recognition algorithm according to claim 1, characterized in that: Step S1 involves collecting and decoding the monitoring video of the discharge outlet into a sequence of original image frames, adding time tags, preprocessing the image frames, inputting them into a video recognition model to generate frame-level drainage status tags, and binding the time tags to form a corresponding frame-level drainage status sequence for the discharge outlet.

3. The engineering operation and maintenance management method based on video recognition algorithm according to claim 2, characterized in that: Step S2 starts from the first element of the frame-level drainage state sequence and sequentially traverses the image frames with the same frame-level drainage state label as the current frame and the next frame and whose time label difference is not greater than the preset time continuity threshold to obtain candidate drainage segments. Record the start time, end time and state statistics to form a set of candidate drainage segments for the corresponding outlet.

4. The engineering operation and maintenance management method based on video recognition algorithm according to claim 3, characterized in that: Step S3 performs stability judgment on the candidate drainage segment set. For each candidate drainage segment, the internal drainage rhythm coherence and segment boundary stability time band are calculated based on the frame-level drainage state sequence. The internal drainage rhythm coherence and segment boundary stability time band are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient. The target drainage segment is selected according to the drainage event stability determination coefficient and the duration of the candidate drainage segment. The target drainage segment is encapsulated as a drainage event object, and the outlet identification time interval and stability index are recorded to obtain the drainage event object set.

5. The engineering operation and maintenance management method based on video recognition algorithm according to claim 4, characterized in that: Step S5: Classify and statistically analyze the drainage event objects in the drainage event result set according to the outlet. Adjust the image frame merging rules and stability judgment parameters based on the drainage event objects with high confidence level. Write the drainage event result set into the event library of the engineering operation and maintenance management system as the data source for generating operation and maintenance tasks and performing operation and maintenance statistical analysis.

6. The engineering operation and maintenance management method based on video recognition algorithm according to claim 5, characterized in that: Step S5 adjusts the image frame merging rules and stability judgment parameters. By extracting short-term interruption time periods from high-confidence-level drainage event objects and selecting the maximum typical interruption time length, the median of the collected and sorted data is used to form an allowable interruption time threshold, which is used to ignore undrained segments that are not greater than the threshold during merging. By calculating the start and end blur band time lengths, the median of the collected and sorted data is used to select the maximum value to form a boundary blur band length threshold, which is used to adjust the boundary of candidate drainage segments to cover the complete drainage process.

7. An engineering operation and maintenance management system based on video recognition algorithms, used to implement the engineering operation and maintenance management method based on video recognition algorithms as described in any one of claims 1-6, characterized in that, include: The frame sequence generation module acquires the monitoring video of the drainage outlet, splits it into image frames, and inputs them into the video recognition model after preprocessing to obtain the frame-level drainage status, forming a time-arranged sequence of frame-level drainage status. The segment synthesis module merges adjacent image frames with the same drainage state and continuous time into candidate drainage segments based on the frame-level drainage state sequence, records the start and end times of each candidate drainage segment, and forms a set of candidate drainage segments. The stability assessment module calculates the internal drainage rhythm coherence and segment boundary stability time band for each candidate drainage segment based on the frame-level drainage state sequence. The two parameters are input into the machine learning model trained based on historical drainage events to obtain the drainage event stability determination coefficient of the corresponding candidate drainage segment. Based on this and the segment duration, the target drainage segment is determined and encapsulated as a drainage event object that records the outlet identifier and time interval, forming a drainage event object set. The boundary verification module uses the frame-level drainage state sequence to backtrack and verify the time interval of each drainage event object in the drainage event object set, adjusts the start and end times, marks the confidence level, and forms a drainage event result set. The rule-adaptive module categorizes and statistically analyzes drainage event objects in the drainage event result set according to the outlet, updates the image frame merging rules and stability judgment parameters of the corresponding outlet based on the statistical results, and writes the drainage event result set into the event library of the engineering operation and maintenance management system.

Citation Information

Patent Citations

  • Drainage monitoring method and system based on 3D convolution, and storage medium

    CN115457485A

  • Urban inland inundation prevention and control task generation method based on machine vision

    CN119647800A