Power construction violation identification early warning method and system based on computer vision

By improving the YOLOv8 model and pre-set rule base, the problem of insufficient target recognition accuracy in complex environments at power construction sites has been solved, achieving highly accurate violation identification and early warning, and improving the efficiency of safety supervision.

CN121661706APending Publication Date: 2026-03-13NANJING POWER PROPERTY MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies are insufficient in terms of recognition accuracy, with high rates of missed or false detections, when the power construction site environment is complex, the target size varies greatly, and the background is dynamically changing. This makes it difficult to meet the high standards of safety supervision requirements.

Method used

An improved YOLOv8 model is used for object detection. The receptive field and feature extraction capabilities are enhanced through a multi-scale feature extraction module, a multi-dimensional attention module, and a small object detection head. Violation judgment is performed by combining a preset rule base and reducing false judgments through multi-frame comprehensive judgment.

Benefits of technology

It improves the accuracy of target recognition and violation judgment, reduces the false detection rate and the missed detection rate, and achieves efficient safety supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661706A_ABST
    Figure CN121661706A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power construction violation identification early warning method and system based on computer vision, and relates to the technical field of electric power construction supervision. The method comprises the steps of obtaining video stream data of a power construction site and performing preprocessing to obtain a target video frame set; inputting the video frames into the improved YOLOv8 model to obtain position information of various targets; performing violation judgment according to the target position information and a preset rule base to obtain a first violation set; and through continuous multi-frame comprehensive judgment, a second violation set is obtained and early warning is sent out. Through intelligent violation judgment and multi-frame analysis, misjudgment is reduced, accuracy is improved, early warning can be performed in time when violation behaviors occur, manual monitoring pressure is reduced, construction safety and working efficiency are improved, and accident risks are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of power construction supervision, specifically to a computer vision-based method and system for identifying and issuing early warnings of violations in power construction. Background Technology

[0002] With the rapid development of my country's economy and the increasing demand for electricity from all sectors, the construction of power engineering projects has become the core of the country's energy infrastructure construction. Power engineering encompasses multiple fields such as power generation, transmission, transformation, distribution, and consumption, and is the foundation of the country's economic and social operation. However, power operations often involve various dangerous factors such as high voltage and high current, and the working environment is complex and harbors potential safety hazards. Therefore, safety supervision of power construction is particularly important.

[0003] Patent CN115797824A discloses an artificial intelligence-based method for identifying violations in power construction using drones. It utilizes a YOLO network model to perform target detection on video images collected by the drone, obtaining target detection results. If the target detection results indicate that the worker is wearing protective equipment and / or carrying work tools, an STN model is used to identify violations in the video images, obtaining violation detection results. This achieves automatic detection of violation categories and violation warnings based on artificial intelligence.

[0004] However, traditional target detection models often fail to provide ideal adaptability when facing the specific and complex scenario of power construction. Construction sites are characterized by chaotic environments, frequently changing backgrounds, and a wide range of target object sizes: from large construction machinery to small safety tools such as insulated gloves and helmet buckles. The receptive field design of traditional models often struggles to capture crucial information, resulting in insufficient accuracy in identifying these targets and a high risk of missed or false detections. Therefore, existing automatic identification technologies often fall short of meeting the high standards of safety supervision required for power construction sites and are ill-equipped to handle the complex and ever-changing on-site environment. Summary of the Invention

[0005] The purpose of this invention is to address the problems mentioned in the background art, such as insufficient recognition accuracy, high rate of missed detection or false detection, and difficulty in meeting the requirements of high-standard safety supervision when the power construction site environment is complex, the target scale varies greatly, and the background is dynamically changing. Therefore, this invention proposes a computer vision-based method and system for identifying and warning of violations in power construction.

[0006] A first aspect of this invention provides a computer vision-based method for identifying and issuing early warnings of violations during power construction, the method comprising: Acquire video stream data from the power construction site and preprocess it to obtain the target video frame set; Any video frame is input into a pre-trained target detection model to obtain the location information of various targets. The target detection model is an improvement based on the YOLOv8 model, and the improvements include: replacing the SPPF module with a preset multi-scale feature extraction module to enhance the receptive field; inserting a preset multi-dimensional attention module at the skip connections in the backbone and neck to enhance shallow features in multiple dimensions; replacing the standard convolution of the CBS module in the neck network with GSConv; and adding a small target detection head. Based on the location information of various targets and a preset rule base, violations are judged to obtain a first set of violations. The rule base includes scenario description rules and violation judgment rules, wherein: the scenario description rules determine the work scenario and personnel protection status based on the positional relationship between personnel targets and equipment targets; the violation judgment rules determine safety specifications based on the work scenario and compare them with the personnel protection status to determine whether there is a violation. If there is a violation, the violation is included in the first set of violations. The intersection of the first set of violations across multiple consecutive frames yields the second set of violations, which is then used to issue a warning.

[0007] Optional, preprocessing includes: Video frames are extracted from the video stream at fixed time intervals; Denoising and contrast enhancement are performed on each extracted video frame to obtain the enhanced video frame; The resolution of the enhanced video frames is adjusted to obtain the target video frames, which are then included in the target video frame set.

[0008] Optionally, the operation process of the multi-scale feature extraction module includes: ; Where X0 is the input of the multi-scale feature extraction module; MP represents max pooling, and its subscript 5×5 represents the pooling window size; Conv represents convolution calculation, and its subscript 1×1 represents the convolution kernel size; DConv represents dilated convolution, and its subscript 3×3 represents the convolution kernel size, and its superscripts 3, 5, and 7 represent the dilation rate; cat represents channel concatenation; X1 to X7 are intermediate results generated during the operation; and X8 is the output of the multi-scale feature extraction module.

[0009] Optionally, the computation process of the multi-dimensional attention module includes: ; Where X is the input of the multi-dimensional attention module; WMPool represents global weighted average pooling, with subscripts C, H, and W indicating global weighted average pooling in the channel, height, and width dimensions, respectively; Conv represents convolution computation, with its subscript 1×1 indicating the kernel size; σ represents the Sigmoid function; T CT H T W The three dimensions represent the attention weights; BR represents the broadcast operation, with its subscripts C, H, and W indicating broadcasting along the channel dimension, height dimension, and width dimension, respectively; Y is the output of the multi-dimensional attention module.

[0010] Optionally, for any dimension S, S {C, H, W}; the formula for calculating the global weighted average pooling is: ; Among them, M k M is the feature matrix corresponding to position k of X in dimension S. k D1 and D2 are the dimensions of the remaining two dimensions; (i, j) and (p, q) are the matrix position indices; exp is an exponential function with the natural constant e as its base. It is the weight of position (i, j); It is the value of the pooling result at position k.

[0011] A second aspect of this invention provides a computer vision-based power construction violation identification and early warning system, the system comprising: The data acquisition module is used to acquire video stream data from the power construction site. The preprocessing module is used to preprocess the video stream data to obtain a target video frame set; The object detection module is used to input any video frame into a pre-trained object detection model to obtain the location information of various objects. The object detection model is an improvement based on the YOLOv8 model, with improvements including: replacing the SPPF module with a pre-defined multi-scale feature extraction module to enhance the receptive field; inserting a pre-defined multi-dimensional attention module at the skip connections in the backbone and neck network to enhance shallow features in multiple dimensions; replacing the standard convolution of the CBS module in the neck network with GSConv; and adding a small object detection head. The initial violation judgment module is used to judge violations based on the location information of various targets and a preset rule base to obtain a first set of violations. The rule base includes scenario description rules and violation judgment rules, wherein: the scenario description rules determine the work scenario and personnel protection status based on the positional relationship between personnel targets and equipment targets; the violation judgment rules determine safety specifications based on the work scenario and compare them with the personnel protection status to determine whether there is a violation. If there is a violation, the violation is included in the first set of violations. The comprehensive judgment module is used to intersect the first set of violations in multiple consecutive frames to obtain the second set of violations. The early warning module is used to issue early warnings based on the second set of violations.

[0012] Optionally, the preprocessing module includes: The sampling module is used to extract video frames from the video stream at fixed time intervals. The image enhancement module is used to denoise and enhance the contrast of each extracted video frame to obtain the enhanced video frame. The resolution adaptation module is used to adjust the resolution of the enhanced video frames to obtain the target video frames and include them in the target video frame set.

[0013] Optionally, the operation process of the multi-scale feature extraction module includes: ; Where X0 is the input of the multi-scale feature extraction module; MP represents max pooling, and its subscript 5×5 represents the pooling window size; Conv represents convolution calculation, and its subscript 1×1 represents the convolution kernel size; DConv represents dilated convolution, and its subscript 3×3 represents the convolution kernel size, and its superscripts 3, 5, and 7 represent the dilation rate; cat represents channel concatenation; X1 to X7 are intermediate results generated during the operation; and X8 is the output of the multi-scale feature extraction module.

[0014] Optionally, the computation process of the multi-dimensional attention module includes: ; Where X is the input of the multi-dimensional attention module; WMPool represents global weighted average pooling, with subscripts C, H, and W indicating global weighted average pooling in the channel, height, and width dimensions, respectively; Conv represents convolution computation, with its subscript 1×1 indicating the kernel size; σ represents the Sigmoid function; T C T H T W The three dimensions represent the attention weights; BR represents the broadcast operation, with its subscripts C, H, and W indicating broadcasting along the channel dimension, height dimension, and width dimension, respectively; Y is the output of the multi-dimensional attention module.

[0015] Optionally, for any dimension S, S {C, H, W}; the formula for calculating the global weighted average pooling is: ; Among them, M k M is the feature matrix corresponding to position k of X in dimension S. k D1 and D2 are the dimensions of the remaining two dimensions; (i, j) and (p, q) are the matrix position indices; exp is an exponential function with the natural constant e as its base. It is the weight of position (i, j); It is the value of the pooling result at position k.

[0016] The beneficial effects of this invention are: 1. An improved YOLOv8 model is used for target detection, which improves the model's accuracy and ability to identify targets at different scales.

[0017] 2. Based on a pre-set rule base, it can intelligently judge violations according to different scenarios and behavioral characteristics, thereby improving the level of automation.

[0018] 3. By comprehensively judging multiple consecutive frames, the possibility of misjudging data from a single frame is avoided, thus improving accuracy. Attached Figure Description

[0019] Figure 1 A flowchart illustrating a computer vision-based method for identifying and issuing early warnings of violations in power construction, provided as an embodiment of the present invention; Figure 2 A diagram of the original network architecture of YOLOv8 provided in an embodiment of the present invention; Figure 3 This is a network architecture diagram of a target detection model provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a multi-scale feature extraction module provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a multi-dimensional attention module provided in an embodiment of the present invention; Figure 6 This is an architecture diagram of a computer vision-based power construction violation identification and early warning system provided in an embodiment of the present invention. Detailed Implementation

[0020] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features and effects of the present invention is provided in conjunction with the accompanying drawings and preferred embodiments.

[0021] This invention provides a computer vision-based method for identifying and issuing early warnings of violations during power construction. See also... Figure 1 , Figure 1 A flowchart illustrating a computer vision-based method for identifying and issuing early warnings of violations during power construction, provided as an embodiment of the present invention. The method includes the following steps: S101: Acquire video stream data from the power construction site and preprocess it to obtain the target video frame set.

[0022] S102: Input any video frame into the pre-trained target detection model to obtain the location information of various targets.

[0023] S103, based on the location information of various targets and the preset rule base, make a violation judgment to obtain the first violation set.

[0024] S104: Intersect the first set of violations in multiple consecutive frames to obtain the second set of violations, and issue a warning based on this.

[0025] These targets include personnel targets and various equipment targets (such as safety helmets, safety belts, insulated gloves, guardrails, ladders, and ladders for climbing).

[0026] This invention provides a computer vision-based method for identifying and issuing early warnings of violations in power construction. By automatically monitoring real-time video stream data and combining a target detection model and a rule base, the method can accurately identify and judge violations at construction sites. Through multi-frame comprehensive analysis, the system can issue timely warnings when violations occur, reducing the burden of manual monitoring, improving work efficiency and safety, and lowering the risk of accidents.

[0027] In one embodiment, step S101 includes the following preprocessing steps: Step one: Extract video frames from the video stream at fixed time intervals. Specifically, you can extract one frame per second, for a total of 5 frames.

[0028] Step two involves denoising and contrast enhancement on each extracted video frame to obtain the enhanced video frame. Specifically, bilateral filtering can be used for denoising, and gamma correction can be used for contrast enhancement.

[0029] Step three involves adjusting the resolution of the enhanced video frames to obtain the target video frames, which are then added to the target video frame set. Specifically, the resolution is adjusted to match the input of the adaptation model, for example, to 640*640.

[0030] In power construction environments, video may be affected by factors such as weather and lighting, resulting in blurred images or noise interference. Denoising can eliminate this unwanted noise, making the target clearer. Contrast enhancement helps highlight the difference between the target and the background in the image, especially in low-light environments, where the enhanced image makes the target stand out more, improving the accuracy of target detection.

[0031] This embodiment extracts video frames at fixed time intervals instead of processing every frame in the entire video stream, which can significantly reduce the number of frames that need to be processed, thereby saving computing resources and time. Furthermore, the original video has little variation between adjacent frames and a lot of frame information is highly repetitive. By extracting frames, the repetitive information can be removed, and only key frames are retained, providing a high-quality data foundation for the comprehensive judgment of continuous multi-frames in step S104. Here, continuous multi-frames refer to continuous frames after frame extraction.

[0032] In one implementation, relying solely on a single frame for judgment is susceptible to noise or random occurrences, potentially leading to misjudgments. For example, a target might appear to be in a violation state in a single frame, but this could actually be due to occlusion or a momentary movement. Therefore, by intersecting the results of multiple frames, a violation is only identified as genuine when the same violation occurs in multiple consecutive frames, significantly reducing misjudgments caused by random factors.

[0033] In one implementation, the warning method includes flashing lights and voice broadcasting.

[0034] In one embodiment, the object detection model is an improvement upon the YOLOv8 model. See also Figure 2 , Figure 2 This diagram illustrates the original network architecture of YOLOv8 as provided in this embodiment of the invention. As shown, the YOLOv8 architecture typically includes three key components: the backbone network, the neck network, and the head. The backbone network extracts features from the input image. The neck network fuses and enhances the multi-scale features extracted by the backbone network. The head performs final target detection based on the feature map output by the neck network, including the target's category, location, and confidence level. The modules CBS, C2f, SPPF, Upsample, Concat, and Detect shown in the diagram are inherent to the YOLO model and will not be elaborated upon here.

[0035] See Figure 3 , Figure 3 This is a network architecture diagram of an object detection model provided in an embodiment of the present invention. Compared with the original YOLOv8 model, the improvements made in this invention include: 1. A multi-scale feature extraction module, MSFEM, is proposed. See [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of a multi-scale feature extraction module provided in an embodiment of the present invention. In the diagram, MaxPool represents max pooling; Conv represents standard convolution; DConv represents dilated convolution, where d represents the dilation rate; and Cat represents concatenation.

[0036] The computational process of the multi-scale feature extraction module includes: ; Where X0 is the input of the multi-scale feature extraction module; MP represents max pooling, and its subscript 5×5 represents the pooling window size; Conv represents convolution calculation, and its subscript 1×1 represents the convolution kernel size; DConv represents dilated convolution, and its subscript 3×3 represents the convolution kernel size, and its superscripts 3, 5, and 7 represent the dilation rate; cat represents channel concatenation; X1 to X7 are the intermediate results generated during the operation; and X8 is the output of the multi-scale feature extraction module.

[0037] Dilated convolution (DConv) can expand the receptive field and capture a wider range of contextual information without increasing computational complexity. By using different dilation rates (such as 3, 5, and 7), MSFEM can extract contextual features at different scales, avoiding information loss or over-compression that may be caused by traditional convolution operations.

[0038] In one implementation, the SPPF module in the original model is replaced with the multi-scale feature extraction module MSFEM. In complex environments such as power construction sites, there are targets of various scales (such as equipment or personnel of different sizes), and single-scale feature extraction methods may not be able to effectively capture all targets. With MSFEM, the model can extract features more effectively from targets of different scales, improving detection accuracy.

[0039] 2. A multi-dimensional attention module (MAM) is proposed. See [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of a multi-dimensional attention module provided in an embodiment of the present invention. In the diagram, WMPool represents globally weighted average pooling; for any dimension S, S... {C, H, W}; The formula for global weighted average pooling is: ; Among them, M k M is the feature matrix corresponding to position k of X in dimension S. k D1 and D2 are the dimensions of the remaining two dimensions; (i, j) and (p, q) are the matrix position indices; exp is an exponential function with the natural constant e as its base. It is the weight of position (i, j); It is the value of the pooling result at position k.

[0040] H Dimensional indicates pooling in the height dimension (e.g., the input feature X). After global pooling along dimension H, the height descriptor V is obtained. H ).

[0041] W Dimensional and C Dimensional represent pooling in the width dimension and channel dimension, respectively, to obtain the width descriptor V. W and channel descriptor V C Sigmoid is a normalization function; Mul represents weighted multiplication, where attention weights of different dimensions are multiplied with the input feature map through a broadcast mechanism; Average represents averaging.

[0042] The computational process of the multi-dimensional attention module includes: ; Where X is the input to the multi-dimensional attention module; WMPool represents global weighted average pooling, with subscripts C, H, and W indicating global weighted average pooling in the channel, height, and width dimensions, respectively; Conv represents convolution computation, with its subscript 1×1 indicating the kernel size; σ represents the Sigmoid function; T C T H T W This represents the attention weights corresponding to the three dimensions; BR represents the broadcast operation, with its subscripts C, H, and W indicating broadcasting along the channel dimension, height dimension, and width dimension, respectively; Y is the output of the multi-dimensional attention module.

[0043] Traditional attention modules (such as ECA and SE) often compute spatial or channel attention independently, failing to capture the interconnected information of a target across multiple dimensions. The MAM module, through operations such as pooling and convolutional activation, simultaneously computes and integrates the attention weights of the three dimensions to generate a unified feature representation, enabling a more complete focus on the target's key information.

[0044] In complex scenarios such as power construction, targets are often affected by background interference (such as workers and equipment being similar in color, trees obscuring the view, and complex lighting). The MAM module, through multi-dimensional attention enhancement, can effectively suppress background noise, highlight foreground target features, and enable the model to accurately detect targets even under severe background interference.

[0045] In one implementation, the Multi-Dimensional Attention Module (MAM) is inserted at the skip connections between the backbone network and the neck network to enhance the shallow features extracted by the backbone network. Typically, the shallow features extracted by the backbone network contain rich texture information, while the neck network is responsible for multi-scale fusion of these features. Inserting the MAM at the skip connections can further enhance this texture information and optimize the feature representation capability of the entire network.

[0046] 3. Replace the standard convolution of the CBS module (standard convolution Conv + batch normalization BatchNorm + activation function SiLU) in the neck network with a mixed depthwise separable convolution GSConv to obtain GCBS (GSConv + BatchNorm + SiLU).

[0047] Hybrid Depthwise Separable Convolution (GSConv) is essentially a combination of Depthwise Separable Convolution (DSConv) and standard convolution, but with less computation. Standard convolution operates on the same kernel for each input channel, while Depthwise Separable Convolution breaks down the convolution operation into two steps: depthwise convolution (convolution on each input channel individually) and pointwise convolution (channel fusion using 1×1 convolutions). This decomposition significantly reduces the number of parameters and computational complexity of the convolution operation, thereby improving the computational efficiency of the model.

[0048] 4. Add a small object detection head and modify the neck network, adding the corresponding feature fusion process; the structure of the small object detection head is consistent with the original detection head. The feature map resolutions corresponding to the original three detection heads of YOLO are 20*20, 40*40, and 80*80, while the feature map resolution corresponding to the added detection head is 160*160.

[0049] In scenarios such as power construction, workers, tools, and equipment appear at different scales at different line-of-sight distances. Small targets such as safety helmets and gloves typically contain less pixel information, and their features are more easily lost during traditional feature compression. Ordinary detection heads may be effective for medium to large targets, but their ability to detect small targets is weak. By adding a small target detection head, the model can simultaneously focus on both large and small targets, making it more robust when handling targets of different scales.

[0050] To verify the effectiveness of the improvements proposed in this embodiment, the performance of the proposed target detection model (MMG-YOLO) was compared with that of the original YOLOv8n model. The evaluation metrics included precision (P), recall (R), mean precision (mAP@0.5), and multi-IoU threshold mean precision (mAP@0.5: 0.95).

[0051] A dataset was created by collecting video images from power construction sites, covering typical scenarios such as high-altitude operations, ground operations, and live-line work. The experimental environment was configured as follows: GPU: NVIDIA RTX 3090, framework: PyTorch, input size: 640×640. The same dataset and hyperparameter settings were used for both training and testing (batch size: 32; optimizer: SGD; initial learning rate: 0.01, using a cosine annealing decay strategy). The comparison results are shown in Table 1.

[0052] Table 1 Model P R mAP@0.5 mAP@0.5: 0.95 YOLOv8 0.865 0.810 0.842 0.625 MMG-YOLO 0.911 0.875 0.897 0.683 MMG-YOLO significantly outperformed the original YOLOv8n in both precision and recall, indicating that the improved model is more accurate and has a lower false negative rate in identifying various targets (personnel and protective equipment) at power construction sites. The improvement of mAP@0.5 by approximately 5.5% and mAP@0.5:0.95 by approximately 5.8% demonstrates that the improved model exhibits higher detection accuracy at different IoU thresholds.

[0053] In one embodiment, the rule base includes scene description rules and violation judgment rules. Step S103, based on the location information of various targets and the preset rule base, includes determining violations, which involves: Step one: Based on scenario description rules, determine the work scenario and personnel protection status according to the positional relationship between personnel and equipment targets. For example, determine whether the work scenario is at height based on the positional relationship between the worker and the aerial work platform; determine whether the work scenario is live-lined based on the positional relationship between the worker and live electrical equipment. Determine whether the worker is wearing protective equipment such as safety helmets, insulated gloves, and safety belts based on the positional relationship between the worker's body parts and protective equipment.

[0054] Step two involves determining the safety regulations for the work scenario based on the violation judgment rules, and comparing these regulations with the personnel's protective status to determine if any violations exist. If so, the violation is included in the violation set. For example, wearing a safety belt is required for working at heights, but not for ground work. Therefore, not wearing a safety belt is a violation in a high-altitude work scenario, but not in a ground work scenario. This differentiated judgment method is more in line with the actual working environment and improves the accuracy of violation identification.

[0055] This invention provides a computer vision-based system for identifying and issuing early warnings of violations during power construction. See also... Figure 6 , Figure 6 This is an architecture diagram of a computer vision-based power construction violation identification and early warning system provided in an embodiment of the present invention. The system includes: The data acquisition module is used to acquire video stream data from the power construction site. The preprocessing module is used to preprocess the video stream data to obtain the target video frame set; The target detection module is used to input any video frame into a pre-trained target detection model to obtain the location information of various targets.

[0056] The initial violation judgment module is used to judge violations based on the location information of various targets and the preset rule base to obtain the first set of violations; The comprehensive judgment module is used to intersect the first set of violations in multiple consecutive frames to obtain the second set of violations.

[0057] The early warning module is used to issue early warnings based on the second set of violations.

[0058] This invention provides a computer vision-based power construction violation identification and early warning system. Through automatic monitoring of real-time video stream data, combined with a target detection model and rule base, the system can accurately identify and judge violations at construction sites. Through multi-frame comprehensive analysis, the system can issue timely warnings when violations occur, reducing the burden of manual monitoring, improving work efficiency and safety, and lowering the risk of accidents.

[0059] In one embodiment, the preprocessing module includes: The sampling module is used to extract video frames from the video stream at fixed time intervals.

[0060] The image enhancement module is used to denoise and enhance the contrast of each extracted video frame to obtain the enhanced video frame.

[0061] The resolution adaptation module is used to adjust the resolution of the enhanced video frames to obtain the target video frames and include them in the target video frame set.

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

Claims

1. A computer vision-based method for identifying and issuing early warnings of violations in power construction, characterized in that, The method includes: Acquire video stream data from the power construction site and preprocess it to obtain the target video frame set; Any video frame is input into a pre-trained target detection model to obtain the location information of various targets. The target detection model is an improvement based on the YOLOv8 model, and the improvements include: replacing the SPPF module with a preset multi-scale feature extraction module to enhance the receptive field; inserting a preset multi-dimensional attention module at the skip connections in the backbone and neck to enhance shallow features in multiple dimensions; replacing the standard convolution of the CBS module in the neck network with GSConv; and adding a small target detection head. Based on the location information of various targets and a preset rule base, violations are judged to obtain a first set of violations. The rule base includes scenario description rules and violation judgment rules, wherein: the scenario description rules determine the work scenario and personnel protection status based on the positional relationship between personnel targets and equipment targets; the violation judgment rules determine safety specifications based on the work scenario and compare them with the personnel protection status to determine whether there is a violation. If there is a violation, the violation is included in the first set of violations. The intersection of the first set of violations across multiple consecutive frames yields the second set of violations, which is then used to issue a warning.

2. The method for identifying and issuing early warnings of violations in power construction based on computer vision according to claim 1, characterized in that, Preprocessing includes: Video frames are extracted from the video stream at fixed time intervals; Denoising and contrast enhancement are performed on each extracted video frame to obtain the enhanced video frame; The resolution of the enhanced video frames is adjusted to obtain the target video frames, which are then included in the target video frame set.

3. The method for identifying and issuing early warnings of violations in power construction based on computer vision according to claim 1, characterized in that, The operation process of the multi-scale feature extraction module includes: ; Where X0 is the input of the multi-scale feature extraction module; MP represents max pooling, and its subscript 5×5 represents the pooling window size; Conv represents convolution calculation, and its subscript 1×1 represents the convolution kernel size; DConv represents dilated convolution, and its subscript 3×3 represents the convolution kernel size, and its superscripts 3, 5, and 7 represent the dilation rate; cat represents channel concatenation; X1 to X7 are intermediate results generated during the operation; and X8 is the output of the multi-scale feature extraction module.

4. The method for identifying and issuing early warnings of violations in power construction based on computer vision according to claim 1, characterized in that, The computation process of the multi-dimensional attention module includes: ; Where X is the input of the multi-dimensional attention module; WMPool represents global weighted average pooling, with subscripts C, H, and W indicating global weighted average pooling in the channel, height, and width dimensions, respectively; Conv represents convolution computation, with its subscript 1×1 indicating the kernel size; σ represents the Sigmoid function; T C T H T W The three dimensions represent the attention weights; BR represents the broadcast operation, with its subscripts C, H, and W indicating broadcasting along the channel dimension, height dimension, and width dimension, respectively; Y is the output of the multi-dimensional attention module.

5. A computer vision-based method for identifying and issuing early warnings of violations in power construction, as described in claim 4, is characterized in that... For any dimension S, S {C, H, W}; the formula for calculating the global weighted average pooling is: ; Among them, M k M is the feature matrix corresponding to position k of X in dimension S. k D1 and D2 are the dimensions of the remaining two dimensions; (i, j) and (p, q) are the matrix position indices; exp is an exponential function with the natural constant e as its base. It is the weight of position (i, j); It is the value of the pooling result at position k.

6. A computer vision-based power construction violation identification and early warning system, characterized in that, The system includes: The data acquisition module is used to acquire video stream data from the power construction site. The preprocessing module is used to preprocess the video stream data to obtain a target video frame set; The object detection module is used to input any video frame into a pre-trained object detection model to obtain the location information of various objects. The object detection model is an improvement based on the YOLOv8 model, with improvements including: replacing the SPPF module with a pre-defined multi-scale feature extraction module to enhance the receptive field; inserting a pre-defined multi-dimensional attention module at the skip connections in the backbone and neck network to enhance shallow features in multiple dimensions; replacing the standard convolution of the CBS module in the neck network with GSConv; and adding a small object detection head. The initial violation judgment module is used to judge violations based on the location information of various targets and a preset rule base to obtain a first set of violations. The rule base includes scenario description rules and violation judgment rules, wherein: the scenario description rules determine the work scenario and personnel protection status based on the positional relationship between personnel targets and equipment targets; the violation judgment rules determine safety specifications based on the work scenario and compare them with the personnel protection status to determine whether there is a violation. If there is a violation, the violation is included in the first set of violations. The comprehensive judgment module is used to intersect the first set of violations in multiple consecutive frames to obtain the second set of violations. The early warning module is used to issue early warnings based on the second set of violations.

7. A computer vision-based power construction violation identification and early warning system according to claim 6, characterized in that, The preprocessing module includes: The sampling module is used to extract video frames from the video stream at fixed time intervals. The image enhancement module is used to denoise and enhance the contrast of each extracted video frame to obtain the enhanced video frame. The resolution adaptation module is used to adjust the resolution of the enhanced video frames to obtain the target video frames and include them in the target video frame set.

8. A computer vision-based power construction violation identification and early warning system according to claim 6, characterized in that, The operation process of the multi-scale feature extraction module includes: ; Where X0 is the input of the multi-scale feature extraction module; MP represents max pooling, and its subscript 5×5 represents the pooling window size; Conv represents convolution calculation, and its subscript 1×1 represents the convolution kernel size; DConv represents dilated convolution, and its subscript 3×3 represents the convolution kernel size, and its superscripts 3, 5, and 7 represent the dilation rate; cat represents channel concatenation; X1 to X7 are intermediate results generated during the operation; and X8 is the output of the multi-scale feature extraction module.

9. A computer vision-based power construction violation identification and early warning system according to claim 6, characterized in that, The computation process of the multi-dimensional attention module includes: ; Where X is the input of the multi-dimensional attention module; WMPool represents global weighted average pooling, with subscripts C, H, and W indicating global weighted average pooling in the channel, height, and width dimensions, respectively; Conv represents convolution computation, with its subscript 1×1 indicating the kernel size; σ represents the Sigmoid function; T C T H T W The three dimensions represent the attention weights; BR represents the broadcast operation, with its subscripts C, H, and W indicating broadcasting along the channel dimension, height dimension, and width dimension, respectively; Y is the output of the multi-dimensional attention module.

10. A computer vision-based power construction violation identification and early warning system according to claim 9, characterized in that, For any dimension S, S {C, H, W}; the formula for calculating the global weighted average pooling is: ; Among them, M k M is the feature matrix corresponding to position k of X in dimension S. k D1 and D2 are the dimensions of the remaining two dimensions; (i, j) and (p, q) are the matrix position indices; exp is an exponential function with the natural constant e as its base. It is the weight of position (i, j); It is the value of the pooling result at position k.