A substation water accumulation detection method, device, terminal equipment and computer program product
By improving the adaptive fine-grained channel attention and loss function of the YOLO11 model, and combining the area change of water accumulation features and the judgment of reflective areas, the high cost and low reliability of substation water accumulation detection are solved, and efficient and accurate water accumulation detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CYG SUNRI CO LTD
- Filing Date
- 2025-07-28
- Publication Date
- 2026-07-28
AI Technical Summary
Existing substation water accumulation detection methods are costly, lack stability, and have insufficient reliability and robustness of detection results, leading to safety hazards and low efficiency.
An improved YOLO11 model is used for water accumulation detection. By introducing adaptive fine-grained channel attention (AFCA) and modifying the loss function after the feature extraction network, and combining the area change of water accumulation features and the judgment of reflective areas, a target water accumulation detection model is constructed to reduce the false detection rate.
It improves the accuracy and robustness of substation water accumulation detection, reduces false detections, and enhances detection efficiency and safety.
Smart Images

Figure CN121010922B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of substation technology, and in particular to a method, device, terminal equipment and computer program product for detecting water accumulation in substations. Background Technology
[0002] Substation drainage systems may experience localized water accumulation during extreme weather conditions. This water accumulation can lead to moisture and corrosion of electrical equipment, causing malfunctions and impacting normal substation operation. It also increases the cost of maintenance and equipment replacement. Furthermore, it can endanger the safety of substation workers, potentially causing electric shock or slips and falls while operating equipment. These incidents pose a serious threat to the lives of substation personnel.
[0003] Currently, traditional methods for monitoring water accumulation in substations mainly employ the following two approaches: One conventional method involves manual observation and the establishment of a substation water accumulation monitoring and early warning platform. Manual observation is the most widely used method, but it requires a large workforce and has low inspection efficiency. The other conventional method involves using a professional water accumulation monitoring and early warning platform. Existing professional water accumulation monitoring and early warning platforms offer a certain degree of accuracy, but the equipment is expensive and requires dedicated personnel for maintenance.
[0004] Existing methods for detecting water accumulation on substation surfaces suffer from drawbacks such as high cost, lack of stability, and low reliability and robustness of the detection results. Summary of the Invention
[0005] This application provides a method, device, terminal equipment, and computer program product for detecting water accumulation in substations, aiming to solve the technical problems of high cost, lack of stability, and insufficient reliability and robustness of existing methods for detecting water accumulation on substation roads.
[0006] In a first aspect, embodiments of this application provide a method for detecting water accumulation in a substation, the method comprising:
[0007] The system acquires a video of a designated area of a substation captured by a camera device. The video includes M frames of video data from the early part of the video and N frames of video data from the later part of the video; where M and N are both positive integers.
[0008] The target water accumulation detection model is invoked to perform water accumulation detection on the M frames of video data and the N frames of video data;
[0009] If no water accumulation target is detected in either the M-frame or N-frame video data, then it is determined that there is no water accumulation in the video to be detected.
[0010] If a water-filled target is detected in the M frames of video data and no water-filled target is detected in the N frames of video data, or if no water-filled target is detected in the M frames of video data and water is detected in the N frames of video data, then it is determined that water exists in the video to be detected.
[0011] If water accumulation targets are detected in both the M-frame video data and the N-frame video data, then calculate the first area of the first detection box in the M-frame video data and the second area of the second detection box in the N-frame video data.
[0012] Obtain the area change value between the first area and the second area;
[0013] If the area change value is greater than a preset change threshold, it is determined that there is water accumulation in the video to be detected;
[0014] If the area change value is less than a preset change threshold, detect whether there is a reflective area in the first detection frame or the second detection frame: if there is a reflective area in the first detection frame or the second detection frame, it is determined that there is water accumulation in the video to be detected; otherwise, it is determined that there is no water accumulation in the video to be detected.
[0015] In one implementation, the reflective area is an image region in the first detection frame or the second detection frame where the brightness of the image to be tested is greater than a set brightness threshold and the saturation is less than a set saturation threshold.
[0016] In one implementation, detecting whether a reflective area exists within the first detection frame or the second detection frame includes:
[0017] Convert the image to be tested in the M-frame video data or the N-frame video data to the HSV color space;
[0018] Separate the image region of the luminance V channel and the image region of the saturation S channel from the HSV color space of the image under test;
[0019] The image region of the brightness V channel is traversed, and a first candidate region set whose brightness is greater than the set brightness threshold is selected.
[0020] The image region of the saturation S channel is traversed, and a second set of candidate regions with saturation less than the set saturation threshold is selected;
[0021] Image regions whose brightness is greater than a set brightness threshold and whose saturation is less than a set saturation threshold are selected from the first candidate region set and the second candidate region set as reflective regions.
[0022] In one embodiment, the target water accumulation detection model is obtained in the following manner:
[0023] Obtain the target water accumulation dataset of the substation;
[0024] After the YOLO11 backbone feature extraction network, an attention mechanism is introduced before each detection head to obtain an improved target detection algorithm.
[0025] Modify the loss function of YOLO11 to obtain the improved YOLO11;
[0026] The improved YOLO11 was trained using the expanded dataset to obtain the target water accumulation detection model.
[0027] In one implementation, modifying the loss function of YOLO11 to obtain the improved YOLO11 includes:
[0028] The original loss function of YOLO11 is modified to the target loss function to obtain the improved YOLO11;
[0029] The target loss function involves the angular relationship between the center line connecting the bounding box and the detection box and the vertical and horizontal directions.
[0030] In one implementation, the target loss function includes at least angle loss, distance loss, intersection-union ratio loss, and shape loss.
[0031] In one embodiment, the target water accumulation dataset is pre-constructed in the following manner:
[0032] Images or video frames of water accumulation in the substation are acquired as the initial water accumulation detection dataset. The initial water accumulation detection dataset is trained using the YOLO11 model algorithm to obtain the initial water accumulation detection model.
[0033] The initial water accumulation detection model is used to detect water accumulation on the test set of the computer vision dataset. Images that falsely detect water accumulation are used as negative samples to obtain a negative sample set.
[0034] The initial water accumulation detection model is used to detect the determined image set inside the substation, and the images of falsely detected water accumulation in the substation scene are added to the negative sample set as negative samples.
[0035] The negative sample set is added to the initial water accumulation detection dataset to obtain the water accumulation dataset;
[0036] The water accumulation dataset is augmented to obtain an expanded labeled sample set, resulting in a target water accumulation dataset for training the target water accumulation detection model.
[0037] Secondly, this application provides a water accumulation detection device for substations, the device comprising:
[0038] The pre-acquisition unit is used to acquire the target water accumulation dataset of the substation;
[0039] The pre-trained unit improves the target detection algorithm model based on the target water accumulation dataset by adding adaptive fine-grained channel attention after the YOLO11 feature extraction network and modifying the YOLO11 loss function to obtain the target water accumulation detection model.
[0040] The acquisition unit is used to acquire the video to be detected of a designated area of the substation acquired by the camera device. The video to be detected includes M frames of video data from the early stage of the video and N frames of video data from the later stage of the video.
[0041] The detection unit is used to call the target water accumulation detection model to perform water accumulation detection on the M-frame video data and the N-frame video data to determine whether there is water accumulation in the video to be detected.
[0042] Thirdly, this application provides a terminal device, which includes a camera, a memory, a processor, and a substation water accumulation detection program stored in the memory and executable on the processor. When the processor executes the substation water accumulation detection program, it implements the method described above.
[0043] Fourthly, this application provides a computer program product that stores a substation water accumulation detection program, which, when executed by a processor, implements the method described above.
[0044] The beneficial effects of this invention are as follows: the substation water accumulation detection method of this application can call the target water accumulation detection model to perform water accumulation detection on the M frames of video data in the early and middle stages and the N frames of video data in the middle and later stages of the video of the specified area of the substation; by comparing the two detection results, the presence of water accumulation in the detection video can be determined based on the unique change characteristics of water accumulation, and the presence of false detection can be checked based on the specular reflection characteristics of water accumulation, thereby reducing the false detection of water accumulation. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a schematic diagram of the structure of a terminal device provided in one embodiment of this application;
[0047] Figure 2 This is a schematic diagram of the main implementation process of the pre-built water accumulation dataset for training the target water accumulation detection model provided in this application;
[0048] Figure 3 This is a schematic diagram of the implementation process of the target water accumulation detection model trained based on the target water accumulation dataset provided in this application;
[0049] Figure 4 This is a network structure diagram of the improved YOLO11 provided in this application;
[0050] Figure 5 This is a model diagram provided by this application for Adaptive Fine-Grained Channel Attention (AFCA);
[0051] Figure 6 This is a schematic flowchart of the main embodiments of the substation water accumulation detection method provided in this application;
[0052] Figure 7 The device structure block diagram provided in this application. Detailed Implementation
[0053] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0054] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0055] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0056] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0057] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0058] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0059] Understandably, the inventors of this application have found that current substation water accumulation detection mainly faces the following shortcomings:
[0060] 1) The outdoor environment of the substation is complex, and differences in light, reflection (mirror reflection from water accumulation), and shadow occlusion lead to unstable image quality.
[0061] 2) The water may be in an irregular shape.
[0062] 3) Oil stains, dark-colored floors, and reflective metal surfaces are easily confused with standing water.
[0063] These issues can easily lead to missed or false detections of water accumulation in the water accumulation detection algorithm. Missed detections increase safety hazards, while false detections make it time-consuming, labor-intensive, and inefficient for staff to use automatic inspections. Therefore, there is an urgent need to propose a more robust substation water accumulation detection algorithm.
[0064] Based on the above considerations, this application provides a method, apparatus, terminal equipment, and computer program product for detecting water accumulation in substations, to solve the technical problem that existing electronic detection equipment cannot accurately detect abnormalities in tubular oil level gauges of power equipment. The following specific embodiments illustrate the technical content to be protected by this application:
[0065] Firstly, in a first aspect, embodiments of the present invention provide a terminal device, such as... Figure 1 As shown, Figure 1 This is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 1 of this embodiment includes: at least one processor 10 (… Figure 1(Only one is shown) processor 10, memory 11, camera device 13, and substation water accumulation detection program 12 stored in the memory 11 and capable of running on the at least one processor 10.
[0066] The terminal device 1 can be an electronic detection device, a drone, or other terminal device equipped with a substation water accumulation detection algorithm. This terminal device may include, but is not limited to, a processor 10 and a memory 11. Those skilled in the art will understand that... Figure 1 This is merely an example of terminal device 1 and does not constitute a limitation on terminal device 1. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0067] The camera device 13 is used to collect video footage of a designated area of the substation to be inspected.
[0068] The processor 10 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0069] In addition, the processor 10 will also receive the video of the substation to be detected collected by the camera device 13 in a designated area. The camera device can be deployed on the terminal equipment, such as an image sensor, a high-definition camera, or an industrial camera.
[0070] In some embodiments, the memory 11 may be an internal storage unit of the terminal device 1, such as a hard disk or memory of the terminal device 1. In other embodiments, the memory 11 may be an external storage device of the terminal device 1, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 1. Furthermore, the memory 11 may include both internal and external storage units of the terminal device 1. The memory 11 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 11 can also be used to temporarily store data that has been output or will be output.
[0071] When the processor 10 executes the substation water accumulation detection program 12, it implements the following steps of the substation water accumulation detection method according to the embodiment of this application:
[0072] The system acquires a video of a designated area of a substation captured by a camera device. The video includes M frames of video data from the early part of the video and N frames of video data from the later part of the video; where M and N are both positive integers.
[0073] The target water accumulation detection model is invoked to perform water accumulation detection on the M frames and N frames of video data:
[0074] If no water accumulation target is detected in either the M-frame or N-frame video data, then it is determined that there is no water accumulation in the video to be detected.
[0075] If a water-filled target is detected in the M frames of video data and no water-filled target is detected in the N frames of video data, or if no water-filled target is detected in the M frames of video data and water is detected in the N frames of video data, then it is determined that water exists in the video to be detected.
[0076] If water accumulation targets are detected in both the M-frame video data and the N-frame video data, then the first area S of the first detection box in the M-frame video data is calculated. M and the second area S of the second detection box in the N frames of video data N ;
[0077] Obtain the first area S M and the second area S N The change in area between;
[0078] If the area change value is greater than a preset change threshold, it is determined that there is water accumulation in the video to be detected;
[0079] If the area change value is less than a preset change threshold, detect whether there is a reflective area in the first detection frame or the second detection frame: if there is a reflective area in the first detection frame or the second detection frame, it is determined that there is water accumulation in the video to be detected; otherwise, it is determined that there is no water accumulation in the video to be detected.
[0080] This embodiment can detect whether there is water accumulation in a designated area of the substation in the video to be tested using a water accumulation detection method within the substation, thereby reducing false detections of water accumulation.
[0081] It should be noted that, in order to implement the above-mentioned substation water accumulation detection method, this application first needs to pre-construct a water accumulation dataset for training the target water accumulation detection model, which mainly includes the following construction steps:
[0082] A1: Obtain images or video frames of water accumulation in the substation as the initial water accumulation detection dataset, and train the initial water accumulation detection dataset using the YOLO11 model algorithm to obtain the initial water accumulation detection model;
[0083] For example, firstly, a large number of images and video frames of water accumulation in substations are acquired, and the images are labeled to obtain a substation water accumulation dataset. Publicly available water accumulation datasets from the internet are then added to this dataset as the initial water accumulation detection dataset. The YOLO11 algorithm model is then trained using this water accumulation dataset to obtain a preliminary substation water accumulation detection model.
[0084] A2: Use the initial water accumulation detection model to detect water accumulation on the test set of the computer vision dataset, and use the images of falsely detected water accumulation as negative samples to obtain a negative sample set;
[0085] For example, the preliminary water accumulation detection model described above is used to detect water accumulation on the test set of the computer vision dataset and to detect water accumulation on the set of images of the substation. It is determined whether there is water accumulation in the test image; if so, that portion of the image is saved for further processing; otherwise, it is discarded.
[0086] The computer vision dataset can be a large, widely used dataset. It contains a large number of images of objects in daily life and their annotation information, and is often used for tasks such as object detection and segmentation. In this embodiment, this dataset is used as an external test set. It is tested by a pre-trained substation water accumulation detection model to filter out false detection cases as negative samples, thereby enhancing the robustness of the dataset.
[0087] A3: Use the initial water accumulation detection model to detect the determined image set inside the substation, and add the images of falsely detected water accumulation in the substation scene as negative samples to the negative sample set; add the negative sample set to the initial water accumulation detection dataset to obtain the water accumulation dataset; perform data augmentation processing on the water accumulation dataset to obtain an expanded labeled sample set, and obtain the target water accumulation dataset for training the target water accumulation detection model.
[0088] For example, the identified images inside the substation can be image data of the substation's internal scene collected and owned by relevant R&D personnel, including real-world images of normal and flooded states. These images are private data collected for specific substation environments and are used for model verification and optimization in real-world scenarios, complementing publicly available datasets.
[0089] Understandably, this embodiment can determine whether the water accumulation detected by the model is a real situation. If the model detects water accumulation even though there is no water accumulation in the image, this part of the image is added as a negative sample to the water accumulation detection dataset. If the image does indeed show water accumulation, it is labeled and added to the water accumulation detection dataset. The water accumulation dataset is then divided to obtain the final target water accumulation dataset for the substation.
[0090] In this embodiment of the application, a method for expanding the substation water accumulation dataset is designed. The target water accumulation detection model is trained using the expanded substation water accumulation dataset, which helps the target water accumulation detection model to detect public datasets and substation scenes, obtain water accumulation images that are missed or falsely detected, enhance the richness of the dataset, and make the model trained using such a dataset more robust.
[0091] Furthermore, in order to implement the above-mentioned substation water accumulation detection method, after obtaining the target water accumulation dataset, a target water accumulation detection model will be trained based on the target water accumulation dataset. The main steps to obtain the target water accumulation detection model are as follows:
[0092] S21: Obtain the target water accumulation dataset for the substation;
[0093] In the specific implementation, participants mentioned above Figure 2 The dataset expansion method shown.
[0094] S22: After the YOLO11 backbone feature extraction network, an attention mechanism is introduced before each detection head to obtain an improved target detection algorithm;
[0095] It is understandable that the substation water accumulation detection method in this embodiment is designed to address the complex environment and various interference factors in the detection of water accumulation in substations.
[0096] In one embodiment, an Adaptive Fine-grained Channel Attention (AFCA) mechanism is added before the enhanced feature extraction network of YOLO11 to improve network performance and enhance the ability to extract features of substation water accumulation. The specific location of the AFCA addition is shown in [link to documentation]. Figure 4 The improved YOLO11 network model diagram, which was added in front of the enhanced feature extraction network of YOLO11.
[0097] The AFCA module generates a correlation matrix by calculating the correlation between local and global channel information. This matrix is then combined with the input feature map through pointwise multiplication to obtain an optimized feature map. In this way, the network can more sensitively react to and accurately determine whether a water-filled target exists in a region when subtle changes occur on the surface of the target.
[0098] Figure 5 The model diagram for Adaptive Fine-Grained Channel Attention (AFCA) is based on the above. Figure 5 As can be seen, AFCA first inputs the feature map F output by the backbone feature extraction network. Assume that the shape of the input feature map is (C, H, W), where C is the number of channels, H is the feature map height, and W is the feature map width.
[0099] Global average pooling is performed on the input feature map F to obtain channel-level global information G∈R. C×1×1 F c,i,j U represents the value at position (i, j) in the c-th channel. c It is the global average value of the c-th channel.
[0100]
[0101] Will U c It is decomposed into two branches, one of which is the global channel branch U. gc The overall channel information is preserved, and the dimension remains C×1×1. Local channel branch U lc , which represents the local correlation between channels, and the dimension is also C×1.
[0102] For U gc and U lc Multiplying by a diagonal matrix enhances the weights of specific channels, resulting in a C×1 dimension. This process transforms U... gc and U lc Transpose the vector to 1×C to obtain and
[0103] Next Generate a C×C global channel correlation matrix; Generate a C×C local channel correlation matrix. Apply the Sigmoid function to both matrices to normalize them to the [0, 1] interval to obtain Si. gc S lc The two matrices are then fused according to their weights to generate the final channel attention weights θ, where θ∈R. C×C α and β are learnable parameters.
[0104] θ=α·S gc +β·S lc
[0105] θ is multiplied channel by channel with the original feature map F to enhance the response of important channels. Apply the Sigmoid function to the enhanced feature map to ensure the output value is within a reasonable range. This yields the final feature map F. * Feature map F * It will be fed into the enhanced feature extraction network of YOLO11 to perform other operations on the feature map.
[0106] S23: Modify the loss function of YOLO11 to obtain the improved YOLO11; this enables the model to have better performance in complex scene detection and target edge detection tasks.
[0107] Understandably, YOLO11's original loss function is CIoU. However, for targets with relatively blurred edges, such as water accumulation, CIoU is difficult to fully capture their geometric characteristics, thus failing to accurately locate the position of the water accumulation target.
[0108] To address the above technical deficiencies, in one embodiment, the original loss function CIoU of YOLO11 is modified. The modified target loss function considers the angular relationship between the center line connecting the bounding boxes and the detection boxes and the vertical and horizontal directions. This can enhance the consistency of the shape and direction of the bounding boxes and the detection boxes, thereby improving the stability and accuracy of the regression.
[0109] In this embodiment, the target loss function includes at least angle loss, distance loss, intersection-union ratio loss, and shape loss.
[0110] For example, the angular loss of the target loss function is:
[0111]
[0112] Where A is the angle loss function, representing the degree of deviation between the line connecting the centers of the annotation box and the detection box and the vertical and horizontal directions. Let x be the center coordinates of the true bounding box, (x) c ,y c () represents the center coordinates of the prediction box.
[0113] For example, the distance in the target loss function refers to the distance from the center point to the edge of the bounding box, and the formula for the distance loss in the target loss function is:
[0114]
[0115] Among them, L dis Indicates distance loss;
[0116] ρ t h is the normalized value of the distance between the center points. c ,w c These represent the height and width of the prediction box, respectively.
[0117] For example, shape loss refers to the aspect ratio deviation between the ground truth bounding box and the predicted bounding box, and its calculation formula is as follows:
[0118]
[0119] w h w is the value after normalization of high difference. w This is the value after normalizing the width difference.
[0120] For example, the crossover ratio loss can be calculated using the following formula:
[0121] IoU = Area of the union of predicted bounding boxes and ground truth bounding boxes / Area of the intersection of predicted bounding boxes and ground truth bounding boxes;
[0122] In this embodiment, combining the above formulas, the final formula for the target loss function is:
[0123]
[0124] Understandably, the angle loss function A is applied in the distance loss formula; therefore, the final target loss function does not have an angle loss formula. The target loss function L used in this embodiment is as described above. SIoU This not only improves IoU but also significantly enhances the adaptability of the bounding box to the target's geometric characteristics and orientation, as well as its localization accuracy. This results in higher performance for the target loss function in complex scene detection and tasks with blurred target edges.
[0125] S24: Train the improved YOLO11 using the expanded dataset to obtain the target water accumulation detection model.
[0126] In this embodiment, the substation water accumulation dataset obtained in the above process and the improved YOLO11 algorithm are used. The YOLO11 small model is used to train the above water accumulation dataset, and the images are preprocessed through data augmentation. Finally, a substation water accumulation detection model with relatively high accuracy is obtained.
[0127] S25: Post-process the water accumulation detection results based on water accumulation characteristics to reduce the false detection rate of the water accumulation detection algorithm.
[0128] This application presents an improved YOLO11-based water accumulation detection algorithm. By adding adaptive fine-grained channel attention after the model's backbone feature extraction network, the algorithm further optimizes the network's ability to extract key features, achieving precise focus on the target region and thus improving the model's sensitivity to water accumulation. Furthermore, the YOLO11 loss function is modified to enhance the model's performance in complex scene detection and tasks involving blurred target edges.
[0129] Furthermore, after obtaining the target water accumulation detection model, the target water accumulation detection model can be deployed to the aforementioned... Figure 1 The terminal device shown is used to execute the substation water accumulation detection method according to the embodiments of this application.
[0130] Understandably, due to the characteristic that the shape of accumulated water changes continuously over time, and the specular reflective properties of accumulated water, the reflective areas of accumulated water typically exhibit high brightness and low saturation. Therefore, this embodiment can perform post-processing on the detection results based on these characteristics of accumulated water, reducing the false detection rate of the water accumulation detection algorithm in substations.
[0131] For example, refer to Figure 6 The substation water accumulation detection method includes:
[0132] Step S1: The terminal device acquires the video of the designated area of the substation to be inspected, collected by the camera device;
[0133] It should be noted that the video to be tested refers to the video obtained by a fixed camera in a fixed area inside the substation, so the footage in the video is consistent from beginning to end.
[0134] Execution step S1a: First, extract the first M frames of video data from the video to be detected for water accumulation detection; simultaneously, execute step S1b: extract the last N frames of video data from the water accumulation detection video for water accumulation detection. The water accumulation detection scenarios are as follows:
[0135] If no water accumulation is detected in either the M-frame or N-frame video data, then it is determined that there is no water accumulation in the video to be detected; correspondingly Figure 6 The result is "S2a-No → S2b-No → No water accumulation in the video to be tested".
[0136] If a water-filled target is detected in the M frames of video data, but not in the N frames of video data (or, if no water-filled target is detected in the M frames of video data, but water is detected in the N frames of video data), then it is determined that water exists in the video to be detected. Figure 6The format "S2a-Yes → S3a-No → There is water accumulation in the video and the location of the water accumulation is given" also corresponds to... Figure 6 The format is: "S2a-No → S2b-Yes → There is water accumulation in the video and the location of the water accumulation is given."
[0137] If water accumulation targets are detected in both the M-frame video data and the N-frame video data, then the first area S of the first detection box in the M-frame video data is calculated. M and the second area S of the second detection box in the N frames of video data N ;
[0138] For example, the first area S M And the second area S N Area change value between
[0139] Furthermore, implementation Figure 6 Step S4a: "Determine whether the area change value d of the water accumulation detection box exceeds the preset change threshold":
[0140] If the area change value is greater than a preset change threshold, it is determined that there is water accumulation in the video to be detected; if the area change value is less than the preset change threshold, it is detected whether there is a reflective area in the first detection frame or the second detection frame: if there is a reflective area in the first detection frame or the second detection frame, it is determined that there is water accumulation in the video to be detected; otherwise, it is determined that there is no water accumulation in the video to be detected.
[0141] For example, this embodiment sets a preset change threshold of 0.2. If the change in area d > 0.2, it is considered that there is water accumulation on the ground in the video; if the change in area d < 0.2, then execution is performed. Figure 6 Step S5a is used to further detect whether there is a reflective area within the detection box to determine whether the algorithm has false detections.
[0142] In some embodiments, in the process of determining whether there is a reflective area within the detection frame: this embodiment uses double threshold segmentation to assist in detecting water accumulation areas to determine whether there is a reflective area within the detection frame of the video under test. If there is a reflective area, it is determined that there is target water accumulation in the video under test.
[0143] Accordingly, the process for determining whether there is a reflective area within the detection frame includes:
[0144] Sub-step c1: Convert the image to be tested in the M-frame video data or the N-frame video data to the HSV color space;
[0145] Sub-step c2: Separate the image region of the luminance V channel and the image region of the saturation S channel from the HSV color space of the image to be tested;
[0146] Sub-step c3: Traverse the image region of the brightness V channel and select the first candidate region set whose brightness is greater than the set brightness threshold;
[0147] Sub-step c4: Traverse the image region of the saturation S channel and select a second candidate region set whose saturation is less than the set saturation threshold;
[0148] Sub-step c5: Select image regions from the first candidate region set and the second candidate region set whose brightness is greater than a set brightness threshold and whose saturation is less than a set saturation threshold as reflective regions.
[0149] Understandably, water accumulation exhibits characteristics where its shape changes over time and it has a specular reflective quality, typically displaying high brightness and low saturation in reflective areas. Therefore, post-processing can be applied to the detection results based on these characteristics of water accumulation, reducing the false detection rate of water accumulation detection algorithms in substations.
[0150] In the specific implementation, the image to be tested is first converted to the HSV color space to separate the image region of the brightness V channel and the image region of the saturation S channel.
[0151] A brightness threshold is preset, and a high brightness area is selected. When V>200, the area is considered a high brightness area and is sent to the first candidate area set as the first candidate area.
[0152] A saturation threshold is pre-set to remove high-saturation areas to avoid misidentifying colored objects. When S < 30, the area is considered a low-saturation area. The low-saturation area is then sent to the second candidate area set as a second candidate area.
[0153] Perform a double threshold test on the pixel (x, y) within the detection box, and combine the two conditions mentioned above. The high-brightness and low-saturation image area within the detection box is identified as the reflective area. If such an area is detected within the box, it is considered that there is water accumulation in the video; otherwise, it is considered that there is no water accumulation in the video.
[0154] This embodiment can detect water accumulation in video frames before and after the water accumulation video, compare the two detection results, determine whether there is water accumulation in the video based on the unique changing characteristics of water accumulation, and add a double threshold judgment based on the specular reflection characteristics of water accumulation to check whether there are false detections in the algorithm, thus completing the detection of video samples.
[0155] Furthermore, in one embodiment, the present invention also provides a substation water accumulation detection device, the device comprising:
[0156] Pre-acquisition unit A is used to acquire the target water accumulation dataset of the substation;
[0157] Pre-training unit B improves the target detection algorithm model based on the target water accumulation dataset by adding adaptive fine-grained channel attention after the YOLO11 feature extraction network and modifying the YOLO11 loss function to obtain the target water accumulation detection model.
[0158] Acquisition unit C is used to acquire the video to be detected of a designated area of the substation acquired by the camera device. The video to be detected includes M frames of video data from the early stage of the video and N frames of video data from the later stage of the video.
[0159] The detection unit D is used to call the target water accumulation detection model to perform water accumulation detection on the M frames of video data and the N frames of video data, so as to determine whether there is water accumulation in the video to be detected.
[0160] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0161] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0162] This application also provides a computer program product, which stores a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0163] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0164] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0165] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0166] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for detecting water accumulation in a substation, characterized by, The method includes: The video to be detected is collected by the camera device from a designated area of the substation. The video to be detected includes M frames of video data from the early stage of the video and N frames of video data from the later stage of the video. The target water accumulation detection model is invoked to perform water accumulation detection on the M frames of video data and the N frames of video data; If no water accumulation target is detected in either the M-frame or N-frame video data, then it is determined that there is no water accumulation in the video to be detected. If a water-filled target is detected in the M frames of video data and no water-filled target is detected in the N frames of video data, or if no water-filled target is detected in the M frames of video data and water is detected in the N frames of video data, then it is determined that water exists in the video to be detected. If water accumulation targets are detected in both the M-frame video data and the N-frame video data, then calculate the first area of the first detection box in the M-frame video data and the second area of the second detection box in the N-frame video data. Obtain the area change value between the first area and the second area; If the area change value is greater than a preset change threshold, it is determined that there is water accumulation in the video to be detected; If the area change value is less than a preset change threshold, detect whether there is a reflective area in the first detection frame or the second detection frame: if there is a reflective area in the first detection frame or the second detection frame, it is determined that there is water accumulation in the video to be detected; otherwise, it is determined that there is no water accumulation in the video to be detected.
2. The substation sump detection method of claim 1, wherein, The reflective area is the image area in the first detection frame or the second detection frame where the brightness of the image to be tested is greater than a set brightness threshold and the saturation is less than a set saturation threshold.
3. The substation water accumulation detection method according to claim 2, characterized in that, The detection of whether a reflective area exists within the first detection frame or the second detection frame includes: Convert the image to be tested in the M-frame video data or the N-frame video data to the HSV color space; Separate the image region of the luminance V channel and the image region of the saturation S channel from the HSV color space of the image under test; The image region of the brightness V channel is traversed, and a first candidate region set whose brightness is greater than the set brightness threshold is selected. The image region of the saturation S channel is traversed, and a second set of candidate regions with saturation less than the set saturation threshold is selected; Image regions with brightness greater than a set brightness threshold and saturation less than a set saturation threshold are selected from the first candidate region set and the second candidate region set as reflective regions.
4. The substation water accumulation detection method according to any one of claims 1 to 3, characterized in that, The target water accumulation detection model is obtained through the following methods: Obtain the target water accumulation dataset of the substation; After the YOLO11 backbone feature extraction network, an attention mechanism is introduced before each detection head to obtain an improved target detection algorithm. Modify the loss function of YOLO11 to obtain the improved YOLO11; The improved YOLO11 was trained using the expanded dataset to obtain the target water accumulation detection model.
5. The substation water accumulation detection method as described in claim 4, characterized in that, The modification of the loss function of YOLO11 to obtain the improved YOLO11 includes: The original loss function of YOLO11 is modified to the target loss function to obtain the improved YOLO11; The target loss function involves the angular relationship between the center line connecting the bounding box and the detection box and the vertical and horizontal directions.
6. The substation water accumulation detection method as described in claim 5, characterized in that, The target loss function includes at least angle loss, distance loss, cross-union ratio loss, and shape loss.
7. The substation water accumulation detection method as described in claim 4, characterized in that, The target water accumulation dataset is pre-constructed in the following manner: Images or video frames of water accumulation in the substation are acquired as the initial water accumulation detection dataset. The initial water accumulation detection dataset is trained using the YOLO11 model algorithm to obtain the initial water accumulation detection model. The initial water accumulation detection model is used to detect water accumulation on the test set of the computer vision dataset. Images that falsely detect water accumulation are used as negative samples to obtain a negative sample set. The initial water accumulation detection model is used to detect the determined image set inside the substation, and images of falsely detected water accumulation related to the scene inside the substation are added to the negative sample set as negative samples. The negative sample set is added to the initial water accumulation detection dataset to obtain the water accumulation dataset; The water accumulation dataset is augmented to obtain an expanded labeled sample set, resulting in a target water accumulation dataset for training the target water accumulation detection model.
8. A water accumulation detection device for substations, characterized in that, The device employs the substation water accumulation detection method as described in claim 1, and the device comprises: The pre-acquisition unit is used to acquire the target water accumulation dataset of the substation; The pre-trained unit improves the target detection algorithm model based on the target water accumulation dataset by adding adaptive fine-grained channel attention after the YOLO11 feature extraction network and modifying the YOLO11 loss function to obtain the target water accumulation detection model. The acquisition unit is used to acquire the video to be detected of a designated area of the substation acquired by the camera device. The video to be detected includes M frames of video data from the early stage of the video and N frames of video data from the later stage of the video. The detection unit is used to call the target water accumulation detection model to perform water accumulation detection on the M-frame video data and the N-frame video data to determine whether there is water accumulation in the video to be detected.
9. A terminal device, characterized in that, The terminal device includes a camera, a memory, a processor, and a substation water accumulation detection program stored in the memory and executable on the processor. When the processor executes the substation water accumulation detection program, it implements the substation water accumulation detection method as described in any one of claims 1-7.
10. A computer program product, said computer program product storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the substation water accumulation detection method as described in any one of claims 1 to 7.