Real-time target detection method and system for power operation violation
By introducing AMCA and DC2f modules in the YOLOv8 model, the problem of insufficient expression of irregular shapes and multi-scale targets in power operation violation detection is solved, and the detection accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202510477378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-25
AI Technical Summary
The existing YOLOv8 model lacks the feature expression ability of irregular shape targets and multi-scale targets in power operation violation detection, resulting in serious missed inspection.
Adaptive multi-scale channel attention module (AMCA) and deformable C2f module (DC2f) are introduced, and the multi-scale depth separation convolution is combined with the channel attention mechanism to enhance feature expression capabilities.
The detection accuracy of irregular shapes and multi-scale targets is improved, the missed detection rate is reduced, and the calculation efficiency of the model is improved.
Smart Images

Figure CN120375286A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of object detection in deep learning, and specifically relates to a real-time object detection method and system for power operation violations. Background Technique
[0002] Object detection is a key computer vision task, aiming to identify target objects in an image and determine their positions in the image. For example, in the field of autonomous driving, traffic lights, obstacles, vehicles, pedestrians, etc. can be automatically identified to provide accurate information for constructing an autonomous driving path; in the field of intelligent safety supervision, violation behaviors can be detected in real time to timely remind violators, thereby reducing the probability of accidents. It has very wide applications in other fields such as face recognition and medical image analysis.
[0003] Nowadays, object detection algorithms based on deep learning theory mainly include Faster R-CNN, Mask R-CNN, YOLOv5, YOLOv7, YOLOv8, etc. These object detection methods are mainly divided into two aspects: two-stage and one-stage. Among them, convolutional neural networks (CNNs) and their optimized versions such as Faster R-CNN and Mask R-CNN are two-stage object detection algorithms, which complete object detection in two steps during detection. For example, Wei Yewen et al. (Wei Yewen, Li Mei, Xie Yuanlin, et al. Transmission line inspection image detection based on improved Faster-RCNN [J]. Electric Power Engineering Technology, 2022, 41(02): 171-178.) proposed an improved region-based convolutional neural network (Faster-RCNN) for the problems of slow response speed and low accuracy in the recognition of power transmission line target inspection images. A lightweight convolutional neural network (ZFnet) was used to extract the features of the detected image, and then a fully connected layer was added before the regressor in the Faster-RCNN network to further remove the possible influence caused by the background.
[0004] For example, Liu Yi et al. (Liu Yi, Yu Changyang, Li Guoyan, et al. UAST-RCNN: An object detection algorithm for occluded pedestrians [J]. Journal of Electronic Measurement and Instrumentation, 2022, 36(12): 168-175.) introduced a window multi-head self-attention mechanism and a progressive focal loss function into the Faster-RCNN network, improving the global receptive field of the model and the balance problem between positive and negative samples, resulting in a significant improvement in the requirements for occluded pedestrian detection of the model.
[0005] Although two-stage object detection algorithms have significant advantages in terms of accuracy, they suffer from slow speed and long training time due to their complex computational processes. To address these issues, experts have proposed single-stage object detection algorithms, such as the YOLO series of algorithms. Zhang Linxiong et al. (Zhang Linxiong, Bayintana, Zeng Qingsong. Grape leaf early disease detection method based on StyleGAN2-ADA and improved YOLOv7 [J]. Transactions of the Chinese Society for Agricultural Machinery, 2024, 55(01): 241-252.) used BiFPN to replace PA-FPN to better combine low-level detail features and high-level semantic information, and at the same time introduced the BiFormer attention mechanism and a loss function combination of CIoU and NWD, and proposed an improved YOLOv7 grape leaf disease detection model, which improved the accuracy of disease detection.
[0006] Wang Ru et al. (Wang Ru, Liu Daming, Zhang Jian. Wear-YOLO: Research on the detection method of safety equipment for power personnel in substations [J]. Computer Engineering and Applications, 2024, 60(09): 111-121.) used the MobileViTv3 module to replace C2f to enhance the model's feature extraction ability in actual substation scenarios, and used WIoUv3 to optimize the regression loss function of the bounding box to improve the model's adaptability in complex situations. The results show that the accuracy of this algorithm is better than that of traditional YOLO series algorithms. Sun et al. (Sun L, Li H, Wang L. HWD-YOLO: A New Vision-Based Helmet Wearing Detection Method [J]. Computers, Materials & Continua, 2024, 80(3): 4543-4560.) proposed a new multi-scale context aggregation model for globally aggregating multi-scale feature information to address the problems of complex and changing real-world scenarios, light changes, and perspective distortion. At the same time, to meet the need for effective extraction of deep features, a new detection block combining extended convolution and attention mechanism was proposed. This module is very effective for features that retain fine-grained detail information such as edges and small objects. After improvement, the performance is significantly improved compared to the YOLOv5 model. Although the YOLO series of algorithms have improved the overall performance of object detection a lot compared to two-stage algorithms, there are still deficiencies, such as poor detection effects in complex environments and insufficient small object detection capabilities.
[0007] To solve the above-mentioned problems, many scholars have developed improved versions of the YOLO series, such as many improved algorithms like YOLOv5s, YOLOv5x, YOLOv8, etc. Among them, YOLOv8 replaces the C3 convolution module with a new C2f convolution module, further enhancing the feature fusion of information to make it particularly effective for detecting small targets, and at the same time improving the computational efficiency of the model by reducing computational redundancy. At the same time, the modular design and high encapsulation degree of YOLOv8 make its network structure very easy to add and replace modules, which greatly improves the versatility of the model. This is also an important reason for selecting the YOLOv8 object detection model as the benchmark model in the present invention.
[0008] Although the YOLOv8 model has achieved good detection results in multiple application scenarios, there are still the following two problems in the scenario of identifying illegal behaviors in power operations:
[0009] 1) The ability to express the features of irregular-shaped targets is insufficient, resulting in missed detections of irregular targets such as ladders and high-altitude objects in the illegal power operation site.
[0010] 2) The ability to express the features of multi-scale targets is insufficient, resulting in missed detections of targets with too large or too small sizes such as cranes and locking hooks in the illegal power operation site. Summary of the Invention
[0011] Object of the Invention: To solve the above technical problems, the present invention provides a real-time object detection method for identifying illegal power operations, which solves the problems in the background technology. The present invention also provides a real-time object detection system for identifying illegal power operations.
[0012] Technical Solution: To achieve the above object, the present invention is realized through the following technical solutions:
[0013] In the first aspect, the present invention provides a real-time object detection method for identifying illegal power operations, and the method includes:
[0014] Collect data related to illegal power operations, label the data set, construct an object detection data set for the type of illegal power operation identification, and divide the data set into a training set, a validation set, and a test set;
[0015] Build a Violation-YOLO object detection model. The Violation-YOLO object detection model includes a YOLOv8n base model and an adaptive multi-scale channel attention module. The adaptive multi-scale channel attention module is set after the spatial pyramid pooling fast module in the backbone network part of the YOLOv8n base model, that is, the feature map obtained from the spatial pyramid pooling fast module is input into the adaptive multi-scale channel attention module, and the output of the adaptive multi-scale channel attention module is connected to the relevant module in the neck of the YOLOv8n base model;
[0016] The adaptive multi-scale channel attention module includes a global feature vector representation unit, a convolutional unit, and an output unit. The global feature vector representation: the input feature map is respectively passed through three depthwise separable convolutional modules with different convolutional kernel sizes to obtain three feature maps with different scales, and then the three feature maps are fused by element-wise addition. Finally, a global average pooling operation is performed on the fused feature map to obtain a global feature vector. The global feature vector is input into the convolutional unit. The convolutional unit represents: first perform an adaptive one-dimensional convolution operation on the global feature vector and then activate it to obtain a channel attention vector; The output unit represents: after broadcasting the channel attention vector, perform an element-wise dot product with the input feature map to obtain an output feature map;
[0017] Use the training set and the validation set to train the Violation-YOLO object detection model, and input the test set into the trained Violation-YOLO object detection model to obtain the corresponding detection results.
[0018] Further, it includes:
[0019] The global feature vector representation unit is expressed by the formula:
[0020] X G = GAP(DSConv1(X i ) + DSConv2(X i ) + DSConv3(X i ));
[0021] Among them, represents the global feature vector, represents the input feature map, DSConv1, DSConv2, and DSConv3 respectively represent depthwise separable convolutions with convolutional kernel sizes of l1×l1, l2×l2, and l3×l3, and GAP(·) represents the global average pooling operation;
[0022] The convolutional unit is expressed by the formula:
[0023] W C= Sigmoid(AConv1D z (X G ));
[0024] Among them, represents the channel attention vector, and AConv1D z represents an adaptive one-dimensional convolution operation with a convolution kernel of 1×Z, where Z is the convolution kernel;
[0025] The output unit is expressed by the formula:
[0026] X o = X i ·W C ' = X i eBrod(W C );
[0027] Among them, represents the output feature map, Brod(·) represents the broadcast operation, and e represents the element-wise multiplication operation, represents the result after performing the broadcast operation on , and the broadcast operation is to copy the content of each channel, that is: the content of each channel in W C ' is copied from the corresponding channel content of W C .
[0028] Furthermore, it includes:
[0029] The size of the convolution kernel Z is adaptively determined by the following formula:
[0030]
[0031] Among them, C represents the number of channels of the feature map, S represents the scaling coefficient for controlling the growth rate of Z, and O represents the offset for adjusting the initial value of Z, represents the ceiling operation to the nearest odd number.
[0032] Furthermore, it includes:
[0033] The Violation-YOLO object detection model also includes a DC2f module, which replaces the last C2f module in the backbone network of the YOLOv8n base model with a DC2f module, that is, the backbone network of the Violation-YOLO object detection model sequentially includes: the first ConvModule, the second ConvModule, the first C2f module, the third ConvModule, the second C2f module, the fourth ConvModule, the third C2f module, the fifth ConvModule, and then the corresponding feature map is sent to the DC2f module;
[0034] The DC2f module sequentially includes a first DSConv module, a Split module for feature decomposition, a DBottleneck module, a Concat module for feature concatenation, and a second DSConv module.
[0035] Further, it includes:
[0036] The DBottleneck module processes the input feature map through a DConvModule to compress the channels; secondly, the compressed feature map restores the number of channels through a second DConvModule, and at the same time further extracts deep features; finally, the input feature map and the output of the second DConvModule are added through a short connection.
[0037] Further, it includes:
[0038] The DconvModule includes: a DConv module, which is used to enhance the input feature map; the enhanced and previous feature maps are input into the BatchNorm2d module for batch normalization processing, and the processed feature maps are input into the SiLU activation function module.
[0039] Further, it includes:
[0040] The operation process of the DConv module is as follows: First, two additional convolutional layers are used to predict the offset of the original sampling points and the ROI metric factor respectively; then, according to the predicted offset, the sampling position of the convolutional kernel is dynamically adjusted, and at the same time, the ROI metric factor is used to weight these dynamic sampling points; finally, the convolutional kernel and the weighted sampling points in the feature map are convolved to obtain the output feature map.
[0041] Further, it includes:
[0042] In the process of convolving the convolutional kernel and the weighted sampling points in the feature map to obtain the output feature map, the convolution operation is expressed as:
[0043]
[0044] where w k represents the value corresponding to the k-th convolution point in the convolutional kernel, K is the number of sampling points, x and y represent the input and output feature maps respectively, p represents any current position in the feature map, p k represents the coordinates of the k-th convolution point inside the convolutional kernel, Δp k represents the predicted offset corresponding to the k-th convolution point, x(p + p k + Δp k ) represents the sampling point corresponding to the k-th convolution point, Δm k∈[0,1] represents the ROI measurement factor of the k-th sampling point.
[0045] In a second aspect, the present invention also provides a real-time object detection system for power operation violations, and the system includes:
[0046] A data acquisition module, which is used to collect data related to power operation violations, label the data set, construct an object detection data set for power operation violation recognition types, and divide the data set into a training set, a validation set, and a test set;
[0047] A model construction module, which is used to construct a Violation-YOLO object detection model. The Violation-YOLO object detection model includes a YOLOv8n base model and an adaptive multi-scale channel attention module. The adaptive multi-scale channel attention module is set after the spatial pyramid pooling fast module in the backbone network part of the YOLOv8n base model, that is, the feature map obtained from the spatial pyramid pooling fast module is input into the adaptive multi-scale channel attention module, and the output of the adaptive multi-scale channel attention module is connected to the relevant module in the neck of the YOLOv8n base model;
[0048] The adaptive multi-scale channel attention module includes a global feature vector representation unit, a convolution unit, and an output unit. The global feature vector representation: the input feature map respectively passes through three depthwise separable convolution modules with different convolution kernel sizes to obtain three feature maps with different scales, then the three feature maps are fused by element-wise addition, and finally the global feature vector is obtained by performing global average pooling operation on the fused feature map. The global feature vector is input into the convolution unit, and the convolution unit represents: first performing an adaptive one-dimensional convolution operation on the global feature vector and then activating it to obtain a channel attention vector; the output unit represents: after the channel attention vector undergoes a broadcast operation, it is element-wise multiplied with the input feature map to obtain an output feature map;
[0049] A training module, which is used to train the Violation-YOLO object detection model using the training set and the validation set, and input the test set into the trained Violation-YOLO object detection model to obtain corresponding detection results.
[0050] Finally, the present invention also provides a storage medium containing computer-executable instructions, characterized in that when the computer-executable instructions are executed by a processor, the processor executes any one of the above methods.
[0051] Compared with the prior art, it has the following beneficial effects:
[0052] The present invention proposes a deformable C2f module, namely the DC2f module, and introduces it into the backbone network. This module uses the DBottleneck module and the DSConv module to replace the conventional convolution modules in C2f, which can reduce the number of parameters while having a more accurate feature expression ability for irregular-shaped targets. The present invention also proposes an adaptive multi-scale channel attention module, namely the AMCA module, and introduces it into the backbone network. This module effectively combines multi-scale depthwise separable convolution with the channel attention mechanism, enabling the features enhanced by this module to better express the features of targets at different scales and improving the detection ability for multi-scale targets. Description of the Drawings
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0054] Figure 1 It is the network structure diagram of the Violation-YOLO object detection algorithm described in the embodiments of the present invention;
[0055] Figure 2(a) is the overall structure diagram of the DC2f module described in the embodiments of the present invention;
[0056] Figure 2(b) is the network structure diagram of the DBottleneck described in the embodiments of the present invention;
[0057] Figure 3 It is the schematic diagram of the principle of the DConv module described in the embodiments of the present invention;
[0058] Figure 4 It is the network structure diagram of the AMCA module described in the embodiments of the present invention;
[0059] Figure 5(1a), Figure 5(1b), and Figure 5(1c) are respectively the visualization diagrams of the detection results corresponding to the YOLOv8 model, the model of the present invention, and the ground truth manually labeled under the first high-altitude operation example described in the embodiments of the present invention;
[0060] Figure 5(2a), Figure 5(2b), and Figure 5(2c) are respectively the visualization diagrams of the detection results corresponding to the YOLOv8 model, the model of the present invention, and the ground truth manually labeled under the second high-altitude operation example described in the embodiments of the present invention;
[0061] Figures 5(3a), 5(3b), and 5(3c) are the visualization diagrams of the detection results corresponding to the YOLOv8 model, the model of the present invention, and the ground truth of manual annotation under the third high-altitude operation example described in the embodiments of the present invention, respectively;
[0062] Figures 5(4a), 5(4b), and 5(4c) are the visualization diagrams of the detection results corresponding to the YOLOv8 model, the model of the present invention, and the ground truth of manual annotation under the fourth high-altitude operation example described in the embodiments of the present invention, respectively. Detailed implementation manners
[0063] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0064] Embodiment 1: This embodiment provides a real-time object detection method for power operation violations. The method includes the following steps:
[0065] S1 Collect data related to power operation violations, annotate the data set, construct an object detection data set for the recognition types of power operation violations, and divide the data set into a training set, a validation set, and a test set.
[0066] In this embodiment, data related to power operation violations is collected, and the data set is annotated using labelimg. An object detection data set for the recognition of five types of power operation violations (electrical operation violation recognition, EOVR) is constructed and labeled as: EOVR-v1.0. This data set contains 1200 pictures, covering 8 key objects in the power operation scenario. Among them, the training set has 840 images, the validation set has 120 images, and the test set has 240 images. In this implementation, the training samples and the validation set in the training set are used for the training of the Violation-YOLO model, and the test set is used for the testing of the Violation-YOLO model. The test samples are from the test set.
[0067] S2 constructs a Violation - YOLO object detection model. The Violation - YOLO object detection model includes a YOLOv8n base model and an adaptive multiscale channel attention (AMCA) module. The AMCA module is set after the spatial pyramid pooling fast (SPPF) module in the backbone network part of the YOLOv8n base model. The obtained feature map is input into the AMCA module, and the output of the AMCA module is connected to the relevant modules in the neck of the YOLOv8n base model.
[0068] The adaptive multiscale channel attention module includes a global feature vector representation unit, a convolutional unit, and an output unit. The global feature vector representation: the input feature map respectively passes through three depth - separable convolution modules with different convolutional kernel sizes to obtain three feature maps with different scales, then the three feature maps are fused by element - wise addition, and finally, through global average pooling operation on the fused feature map, a global feature vector is obtained. The global feature vector is input into the convolutional unit. The convolutional unit represents: first, an adaptive one - dimensional convolution operation is performed on the global feature vector and then activation is carried out to obtain a channel attention vector. The output unit represents: after the channel attention vector undergoes a broadcast operation, it is element - wise multiplied with the input feature map to obtain an output feature map.
[0069] Specifically, in this embodiment, an AMCA module is introduced in the last layer of the backbone network, that is, the Backbone network. The specific structure is as Figure 4 shown. The AMCA module enhances the model's ability to recognize targets of different scales by combining multi - scale convolutional kernels; at the same time, one - dimensional convolution is used to dynamically adjust the weights of each channel, highlighting key features and suppressing irrelevant features, thereby effectively enhancing the network's feature extraction ability. Most importantly, the AMCA module abandons the fully - connected layer in the traditional channel attention mechanism and captures the dependencies between channels through efficient one - dimensional convolution. This reduces the computational amount and also reduces the number of parameters, thus reducing the computational complexity of the model.
[0070] Its calculation process is as follows:
[0071] X G = GAP(DSConv1(X i ) + DSConv2(X i ) + DSConv3(X i )) (1)
[0072] W C = Sigmoid(AConv1D z(X G )) (2)
[0073] X o = X i ·W C ' = X i e Brod(W C ) (3)
[0074] Among them, represents the input feature map, H, W, and C respectively represent the height, width, and number of channels of the input feature map, DSConv1, DSConv2, and DSConv3 respectively represent depthwise separable convolutions with convolution kernel sizes of l1×l1, l2×l2, and l3×l3. In this embodiment, the specific values of l1×l1, l2×l2, and l3×l3 are not limited and are set according to specific requirements. GAP(·) represents global average pooling, represents the global feature vector, AConv1D z represents an adaptive one-dimensional convolution operation with a convolution kernel of 1×Z, W c represents the channel attention coefficient, X o represents the output feature map, Brod(·) represents the broadcast operation, and e represents the element-wise multiplication operation. represents the result after performing the broadcast operation on . The so-called broadcast operation is to copy the content of each channel, that is: the content of each channel in W C ' is copied from the corresponding channel content of W C .
[0075] Among them, the DSConv module is a flexible quantization convolution operator. It replaces single-precision operations with lower-cost integer operations while maintaining the probability distribution on the kernel weights and outputs. It decomposes the convolution weights into low-precision components of the same size as the original kernel and high-precision distribution displacement components of variable size. It can significantly improve the inference speed of the neural network while maintaining high precision.
[0076] In this embodiment, the size of the convolution kernel Z is adaptively determined by the following formula:
[0077]
[0078] Among them, C represents the number of channels of the feature map, S represents the scaling coefficient, which is used to control the growth rate of Z, and O represents the offset, which is used to adjust the initial value of Z. represents the operation of rounding up to an odd number.
[0079] S3 uses the training set and the validation set to train the Violation-YOLO object detection model, and inputs the test set into the trained Violation-YOLO object detection model to obtain the corresponding detection results.
[0080] In this embodiment, the training set and the validation set of the EOVR-v1.0 dataset are used as training samples, and the original loss function and training strategy of the YOLOv8n model are used to train the Violation-YOLO model.
[0081] Embodiment 2: On the basis of Embodiment 1, this embodiment proposes a deformable C2f module (deformable-cross stage partial fusion with 2 convolutions, DC2f) to replace the last C2f module in the Backbone network. The core lies in: replacing the Bottleneck in the original C2f module with a DBottleneck to enhance the network's feature extraction ability for irregularly shaped objects.
[0082] That is, the Violation-YOLO object detection model further includes a DC2f module, which replaces the last C2f module in the backbone network of the YOLOv8n base model. That is, the backbone network of the Violation-YOLO object detection model sequentially includes: a first ConvModule, a second ConvModule, a first C2f module, a third ConvModule, a second C2f module, a fourth ConvModule, a third C2f module, and a fifth ConvModule. After obtaining the corresponding feature map, it is sent to the DC2f module;
[0083] The DC2f module sequentially includes a first DSConv module, a Split module for feature decomposition, a DBottleneck module, a Concat module for feature splicing, and a second DSConv module.
[0084] The ConvModule includes: a Conv module, and the corresponding feature map is obtained through the Conv module; the feature map is input into the BatchNorm2d module for batch normalization processing, and the processed feature map is input into the SiLU activation function module.
[0085] The DBottleneck module processes the input feature map through a DConvModule to compress the channels. Secondly, the compressed feature map restores the number of channels through the second DConvModule while further extracting deep features. Finally, the input feature map and the output of the second DConvModule are added together through a short connection.
[0086] The DconvModule includes: a DConv module, and the corresponding feature map is obtained through the DConv module; the feature map is input into the BatchNorm2d module for batch normalization processing, and the processed feature map is input into the SiLU activation function module.
[0087] The DConv module predicts the offsets of the original sampling points and the ROI metric factors through two additional convolutional layers respectively; then, the sampling positions of the convolutional kernels are dynamically adjusted according to the predicted offsets, and at the same time, these dynamic sampling points are weighted by combining the ROI metric factors; finally, the convolutional kernels are convolved with the weighted sampling points in the feature map to obtain the output feature map.
[0088] Specifically, in this embodiment, in order to reduce the number of model parameters and the computational amount, the Conv module in the DC2f module is replaced by a depthwise separable convolution (DSConv) module. The overall structure of DC2f is shown in Fig. 2(a). First, DC2f extracts features from the input feature map through the DSConv module, and then performs a splitting operation on the extracted feature map along the channel dimension. Half of it flows to the DBottleneck module to complete deep feature mining, and the other half is concatenated with the feature map output by the DBottleneck along the channel dimension. Finally, the concatenated features are again subjected to a channel transformation operation through DSConv to ensure that the size of the feature map output by the DC2f module is the same as that of the input feature map.
[0089] Among them, the network structure of DBottleneck is shown in Fig. 2(b). First, the DBottleneck module processes the input feature map through a DConvModule to compress the channels. Secondly, the compressed feature map restores the number of channels through the second DConvModule while further extracting deep features. Finally, the input feature map and the output of the second DConvModule are added together through a short connection. In the Dconv module, a learnable ROI metric factor is introduced, which represents the correlation between the sampling region and the target and is proportional to the size of the ROI metric factor, thereby effectively improving the model's detection ability for irregular-shaped targets.
[0090] The principle of the Dconv module is asFigure 3 As shown below. First, for the input feature map, DConv predicts the offset of the original sampling points and the ROI metric factor through two additional convolutional layers respectively. Second, the sampling positions of the convolutional kernel are dynamically adjusted according to the predicted offsets, and these dynamic sampling points are weighted in combination with the ROI metric factor. Finally, the adjusted sampling points are convolved with the input feature map to output the enhanced feature map. The convolution operation of DConv is as shown in Equation (5):
[0091]
[0092] where w k represents the value corresponding to the k-th convolutional point in the convolutional kernel, K is the number of sampling points, x and y represent the input and output feature maps respectively, p represents any current position in the feature map, p k represents the coordinates of the k-th convolutional point inside the convolutional kernel, Δp k represents the predicted offset corresponding to the k-th convolutional point, x(p + p k + Δp k ) represents the sampling point corresponding to the k-th convolutional point, and Δm k ∈[0,1] represents the ROI metric factor of the k-th sampling point.
[0093] To illustrate the effectiveness of this application, the following specific embodiments are given:
[0094] Step 1: Construction of the EOVR-v1.0 dataset. Data on electrical operation violations were collected, and the dataset was labeled using labelimg to construct an object detection dataset for five types of electrical operation violation recognition (EOVR), labeled as: EOVR-v1.0. This dataset contains 1200 images, covering 8 key objects in the electrical operation scenario. Among them, the training set has 840 images, the validation set has 120 images, and the test set has 240 images. In this embodiment, the training samples and the validation set in the training set are used for the training of the Violation-YOLO model, and the test set is used for the testing of the Violation-YOLO model. The test samples are from the test set.
[0095] Step 2: Construct the Violation-YOLO model. Most of the model architecture is the same as YOLOv8n. The main differences include two aspects: one is to replace a C2f module with a DC2f module in the Backbone network, and the other is to add an AMCA module after the SPPF module, as Figure 1 shown by the red dotted line part in
[0096] Step 3: DC2f module. First, each image in the EOVR-v1.0 training set and validation set is scaled to 640×640, and then fed into the backbone network. As shown in Figure 1 , after passing through ConvModule, ConvModule, C2f, ConvModule, C2f, ConvModule, C2f, ConvModule in sequence, a feature map of 20×20×256 is obtained and fed into the DC2f module. As shown in Figure 2(a), the DC2f module is sequentially composed of a DSConv module, a Split module for feature decomposition, a DBottleneck module, a Concat module for feature concatenation, and a DSConv module. The specific process is as follows:
[0097] As shown in Figure 2(a), first, the feature map of size 20×20×256 is input into the DSConv module to obtain a feature map of 20×20×128; second, the Split module is used to split the feature map in half along the channel dimension. One half of the 20×20×64 feature map is directly retained for subsequent feature concatenation, and the other half of the 20×20×64 feature map is input into the DBottleneck module to obtain a feature map of 20×20×64; third, the Concat concatenation module is used to concatenate the feature map output by the DBottleneck module with the other half of the directly retained feature map along the channel direction to obtain a feature map of 20×20×128; fourth, the concatenated feature map is fed into the DSConv module to obtain a feature map of 20×20×256, ensuring that the size of the feature map output by the DC2f module is the same as that of the input feature map.
[0098] In the above DC2f module, the structural block diagram of the DBottleneck module is shown on the left side of Figure 2(b). First, the feature map of 20×20×64 is input into a DConvModule with a 3×3 convolutional kernel to output a feature map of 20×20×32; second, the feature map of 20×20×32 is input into a DConvModule with a 3×3 convolutional kernel to output a feature map of 20×20×64, and it is added point by point with the 20×20×64 feature map input into the DBottleneck module through a short connection, and finally a feature map of 20×20×64 is output.
[0099] In the above DBottleneck module, the structural block diagram of the DconvModule is shown on the right side of Figure 2(b). First, the feature map of 20×20×64 is input into the DConv module with a 3×3 convolutional kernel to obtain a feature map of 20×20×32. Second, the feature map of 20×20×32 is input into the BatchNorm2d module for batch normalization processing, and a feature map of 20×20×32 is output. Finally, the feature map of 20×20×32 is input into the SiLU activation function module, and a feature map of 20×20×32 is output.
[0100] In the above DconvModule, the schematic diagram of the principle of the DConv module is as Figure 3 shown. First, for the input feature map, the DConv predicts the offset of the original sampling points and the ROI metric factor through two additional convolutional layers respectively. Second, the sampling position of the convolutional kernel is dynamically adjusted according to the predicted offset, and at the same time, the dynamically sampled points are weighted in combination with the ROI metric factor. Finally, the adjusted sampled points are convolved with the input feature map to output an enhanced feature map. Compared with the ordinary convolution, the DConv adds a learnable correlation metric factor, whose function is to be able to flexibly capture the local features and irregular shapes of the target, significantly improving the recognition ability of complex targets. The following formula represents the calculation process of the output feature map y at an arbitrary position p as follows:
[0101]
[0102] where k represents the number of sampling points of the convolutional kernel. For example, in a 3×3 convolutional kernel, K = 9, and w k represents the value corresponding to the k-th convolutional point in the convolutional kernel, where k ∈ [1, K], x and y represent the input feature map, p represents an arbitrary current position in the feature map, and p k represents the coordinates of the k-th convolutional point inside the convolutional kernel, Δp k represents the predicted offset corresponding to the k-th convolutional point, which is used to adjust the position of the sampling point. Δm k represents the learnable correlation metric factor at the k-th position, which controls the weight of each sampling point, and Δm k ∈ [0, 1]. Δp k and Δm k are both predicted from the same input feature map x through an independent convolutional layer. The output channel number of this convolutional layer is 3K, where the first 2K channels correspond to the learned offsets, and the remaining K channels generate the correlation metric factor after passing through the Sigmoid activation function. The convolutional kernel weights of this independent convolutional layer are initially set to 0, and the offset Δp k and the correlation metric factor Δm kThe initial values are 0 and 0.5 respectively.
[0103] Step 4: AMCA module. As Figure 1 shown, the 20×20×256 feature map output by the DC2f module is input into the SPPF module to obtain a 20×20×256 feature map and then input into the adaptive multiscale channel attention (AMCA) module. By combining multi-scale depthwise separable convolution with channel attention mechanism, the AMCA module can efficiently extract local detail features and global context information at different scales, thus significantly enhancing the model's feature expression ability for various scale targets. The network structure diagram of the AMCA module is as Figure 4 shown, and its calculation process can be expressed by the following formula:
[0104] X G = GAP(DSConv1(X i ) + DSConv2(X i ) + DSConv3(X i ));
[0105] W C = Sigmoid(AConv1D z (X G ));
[0106] X o = X i ·W C ' = X i eBrod(W C );
[0107] Among them, represents the input feature map, DSConv1, DSConv2, and DSConv3 respectively represent depthwise separable convolutions with convolution kernel sizes of 1×1, 3×3, and 5×5, GAP(·) represents the global average pooling operation, represents the global feature vector, AConv1D z represents the adaptive one-dimensional convolution operation with a convolution kernel of 1×Z, represents the channel attention coefficient, represents the output feature map, Brod(·) represents the broadcast operation, e represents the element-wise multiplication operation, represents the result after performing the broadcast operation on . The so-called broadcast operation is to copy the content of each channel, that is: the content of each channel in W C ' is copied from the corresponding channel content of W C .
[0108] The size of the convolutional kernel Z is adaptively determined by the following formula:
[0109]
[0110] where C = 256 represents the number of channels of the feature map, S = 2 represents the scaling factor for controlling the growth rate of Z, and O = 1 represents the offset for adjusting the initial value of Z. represents the operation of rounding up to an odd number.
[0111] Step 5: Training of the Violation-YOLO model. This model uses the training set and validation set of the EOVR-v1.0 dataset, as well as the loss function and training strategy of the original YOLOv8n model to train the Violation-YOLO model. The test set is input into the trained Violation-YOLO model to obtain the corresponding detection results.
[0112] The hardware configuration of the present invention: An experiment is carried out on a workstation with an E5-2650V4 CPU (2.2GHz 12x2 cores), 512GB of memory, and a single NVIDIA RTX Titan graphics card (24GB of video memory). The software platform configuration: Ubuntu16.04, Python3.8, Pytorch1.7.1.
[0113] To better prove the performance of the present invention, ablation experiments and comparative experiments are conducted on the self-built dataset EOVR-V1.0. As shown in Table 1, the ablation experiment of the present invention is as follows. As shown in Table 2, the present invention conducts comparative experiments with 7 popular algorithms. The 7 algorithms are respectively:
[0114] YOLOv5[Jocher, G. (2020). YOLOv5 by Ultralytics (Version 7.0) [Computer software]. https: / / doi.org / 10.5281 / zenodo.3908559];
[0115] YOLOv6[Li C, Li L, Jiang H, et al. YOLOv6: A single-stage object detection framework for industrial applications [J]. arXiv preprint arXiv:2209.02976, 2022.];
[0116] YOLOv7[Wang C Y,Bochkovskiy A,Liao H Y M.YOLOv7:Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C] / / Proceedings of the IEEE / CVF conference on computer vision andpatternrecognition.2023:7464-7475.];
[0117] YOLOv8
[0118] [Jocher,G.,Chaurasia,A.,&Ultralytics.YOLOv8.GitHubrepository.Retrievedfromhttps: / / github.co m / ultralytics / ultralytics,2023];
[0119] YOLOv9[Wang C Y,Yeh I H,Mark Liao H Y.Yolov9:Learning what you wantto learn using programmable gradient information[C] / / European conference oncomputer vision.Cham:Springer Nature Switzerland,2024:1-21.];
[0120] YOLOv10n[Wang A,Chen H,Liu L,et al.Yolov10:Real-time end-to-endobject detection[J].arXiv preprint arXiv:2405.14458,2024.];
[0121] YOLOv11[Jocher,G.,Qiu,J.,&Chaurasia,A.(2023).Ultralytics YOLO(Version11.0.0)[Computer software].https: / / github.com / ultralytics / ultralytics]。
[0122] Table 1 Comparison of ablation experiments of the present invention on the EOVR-v1.0 dataset
[0123]
[0124]
[0125] Table 2 Comparison of the present invention with 7 popular algorithms on the EOVR-v1.0 dataset regarding average precision and localization precision
[0126] Method mAP@0.5 (%) mAP@0.5 - 0.95 (%) Parameters / M FLOPS / G FPS YOLOv5n 83.2 57.3 2.5 7.1 88.7 YOLOv6n 82.5 56.9 4.2 12.1 83.3 YOLOv7 - tiny 84.3 58.5 6.0 13.1 79.6 YOLOv8n 85.0 59.5 3.0 8.1 86.2 YOLOv9t 82.3 57.7 2.0 7.7 87.8 YOLOv10n 81.9 56.8 2.3 6.5 89.7 YOLOv11n 84.3 59.0 2.6 6.3 90.3 Violation - YOLO 88.2 63.9 2.9 7.9 86.7
[0127] As can be seen from Table 2, compared with the other 7 object detection algorithms, the present invention reaches 88.2% and 63.9% in mAP@0.5(%) and mAP@0.5-0.95(%) respectively, which are the best compared with the other seven mainstream YOLO series models. The Parameters and FLOPS reach 2.9M and 7.9M respectively, higher than YOLOv6n, YOLOv7t and YOLOv8n, lower than YOLOV9t, YOLOv10n and YOLOv11n. The FPS reaches 86.7, higher than YOLOv6n, YOLOv7t and YOLOv8n, lower than YOLOv5n, YOLOv10n and YOLOv11n. In summary, on the premise of meeting real-time performance, the detection accuracy of the model of the present invention is the highest, that is: for the task of identifying violations in electric power operations, the model of the present invention has more advantages than other mainstream YOLO models.
[0128] Figure 5 in this embodiment shows the detection effect diagrams corresponding to two detection models and manual annotation ground truth under four different high-altitude operations. Among them, Fig. 5(1a), Fig. 5(1b), and Fig. 5(1c) are the detection effect diagrams corresponding to the YOLOv8 model, the model of the present invention, and the manual annotation ground truth under the first high-altitude operation example, respectively. Fig. 5(2a), Fig. 5(2b), and Fig. 5(2c) are the detection effect diagrams corresponding to the YOLOv8 model, the model of the present invention, and the manual annotation ground truth under the second high-altitude operation example, respectively. Fig. 5(3a), Fig. 5(3b), and Fig. 5(3c) are the detection effect diagrams corresponding to the YOLOv8 model, the model of the present invention, and the manual annotation ground truth under the third high-altitude operation example, respectively. Fig. 5(4a), Fig. 5(4b), and Fig. 5(4c) are the detection effect diagrams corresponding to the YOLOv8 model, the model of the present invention, and the manual annotation ground truth under the third high-altitude operation example. Thus, it can be seen that the YOLOv8n model misses the detection of the locking hook with an irregular shape, high-altitude objects, and operators, while the model of the present invention can correctly detect them all, verifying the effectiveness of the DC2f module in extracting the features of objects with irregular shapes. Considering the large size differences among the above three types of missed detection targets, the detection results of the model of the present invention also verify the effectiveness of the AMCA module in extracting the features of multi-scale targets.
[0129] Embodiment 3: The present invention also provides a real-time target detection system for power operation violations, and the system includes:
[0130] A data acquisition module, which is used to collect data related to power operation violations, annotate the data set, construct a target detection data set for power operation violation recognition types, and divide the data set into a training set, a validation set, and a test set;
[0131] A model construction module, which is used to construct a Violation-YOLO target detection model. The Violation-YOLO target detection model includes a YOLOv8n basic model and an adaptive multi-scale channel attention module. The adaptive multi-scale channel attention module is set after the spatial pyramid pooling fast module in the backbone network part of the YOLOv8n basic model, that is, the feature map obtained from the spatial pyramid pooling fast module is input into the adaptive multi-scale channel attention module, and the output of the adaptive multi-scale channel attention module is connected to the relevant modules in the neck of the YOLOv8n basic model;
[0132] The adaptive multi-scale channel attention module includes a global feature vector representation unit, a convolution unit, and an output unit. The global feature vector representation is as follows: the input feature map is respectively passed through three depthwise separable convolution modules with different convolution kernel sizes to obtain three feature maps with different scales, then the three feature maps are element-wise added and fused, and finally, a global average pooling operation is performed on the fused feature map to obtain a global feature vector. The global feature vector is input into the convolution unit, and the convolution unit represents: first, an adaptive one-dimensional convolution operation is performed on the global feature vector and then activation is carried out to obtain a channel attention vector; the output unit represents: after the channel attention vector undergoes a broadcast operation, it is element-wise multiplied with the input feature map to obtain an output feature map;
[0133] The training module is used to train the Violation-YOLO object detection model using the training set and the validation set, and input the test set into the trained Violation-YOLO object detection model to obtain corresponding detection results.
[0134] In this embodiment, the Violation-YOLO object detection model further includes a DC2f module, which replaces the last C2f module in the backbone network of the YOLOv8n basic model. That is, the backbone network of the Violation-YOLO object detection model sequentially includes: the first ConvModule, the second ConvModule, the first C2f module, the third ConvModule, the second C2f module, the fourth ConvModule, the third C2f module, the fifth ConvModule. After obtaining the corresponding feature map, it is sent into the DC2f module; the DC2f module sequentially includes the first DSConv module, the Split module for feature decomposition, the DBottleneck module, the Concat module for feature concatenation, and the second DSConv module.
[0135] Other technical features of the real-time object detection system for power operation violations described in this embodiment are similar to the corresponding real-time object detection method for power operation violations, and will not be elaborated here.
[0136] In the description of the present invention, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The meaning of "plurality" is two or more, unless otherwise specifically defined.
[0137] In the present invention, unless otherwise clearly defined or limited, terms such as "installed", "connected", "coupled", "fixed", etc. shall be construed broadly. For example, it may be a fixed connection, a detachable connection, or an integral one; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the internal communication of two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0138] In the present invention, unless otherwise clearly defined or limited, the first feature being "on" or "under" the second feature may mean that the first and second features are in direct contact, or the first and second features are indirectly in contact through an intermediate medium. Moreover, the first feature being "above", "over" and "on top of" the second feature may mean that the first feature is directly above or obliquely above the second feature, or merely indicates that the first feature has a higher horizontal height than the second feature. The first feature being "under", "beneath" and "underneath" the second feature may mean that the first feature is directly below or obliquely below the second feature, or merely indicates that the first feature has a lower horizontal height than the second feature.
[0139] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0140] Any process or method description shown in a flowchart or described in other ways herein can be understood as representing a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of the present invention includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0141] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection part with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, then editing, interpreting, or otherwise processing it as appropriate, and then storing it in a computer memory.
[0142] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0143] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the methods of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0144] In addition, in each embodiment of the present invention, each functional unit may be integrated into a processing module, may exist separately as individual physical units, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0145] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A real-time object detection method for power operation violations, characterized in that, The method includes: Collecting data on power operation violations, annotating the dataset, constructing an object detection dataset for power operation violation recognition types, and dividing the dataset into a training set, a validation set, and a test set; Constructing a Violation-YOLO object detection model, where the Violation-YOLO object detection model includes a YOLOv8n base model and an adaptive multi-scale channel attention module. The adaptive multi-scale channel attention module is set after the spatial pyramid pooling fast module in the backbone network part of the YOLOv8n base model. That is, the feature map obtained from the spatial pyramid pooling fast module is input into the adaptive multi-scale channel attention module, and the output of the adaptive multi-scale channel attention module is connected to the relevant module of the neck network of the YOLOv8n base model; The adaptive multi-scale channel attention module includes a global feature vector representation unit, a convolution unit, and an output unit. The global feature vector representation: the input feature map respectively passes through three depthwise separable convolution modules with different convolution kernel sizes to obtain three feature maps with different scales, then the three feature maps are fused by element-wise addition, and finally, a global average pooling operation is performed on the fused feature map to obtain a global feature vector. The global feature vector is input into the convolution unit, and the convolution unit represents: first performing an adaptive one-dimensional convolution operation on the global feature vector and then activating it to obtain a channel attention vector; the output unit represents: after the channel attention vector undergoes a broadcast operation, it is element-wise multiplied with the input feature map to obtain an output feature map. Using the training set and the validation set to train the Violation-YOLO object detection model, and inputting the test set into the trained Violation-YOLO object detection model to obtain corresponding detection results.
2. The real-time target detection method for power operation violations according to claim 1, wherein The global feature vector representation unit is expressed by the formula: X G = GAP(DSConv1(Xi) + DSConv2(Xi) + DSConv3(Xi)); Among them, represents the global feature vector, represents the input feature map, DSConv1, DSConv2, and DSConv3 respectively represent depthwise separable convolutions with convolution kernel sizes of l1×l1, l2×l2, and l3×l3, and GAP(·) represents the global average pooling operation; The convolution unit is expressed by the formula: W C = Sigmoid(AConv1D z (X G )); Among them, represents the channel attention vector, and AConv1D z represents an adaptive one-dimensional convolution operation with a convolution kernel of 1×Z, where Z is the convolution kernel; The output unit is expressed by the formula: X o = X i ·W C ' = X i e Brod(W C ); Among them, represents the output feature map, Brod(·) represents the broadcast operation, and e represents the element-wise multiplication operation. represents the result after performing the broadcast operation on The broadcast operation is to copy the content of each channel, that is: the content of each channel in W C ' is copied from the corresponding channel content in W C 3. The real-time target detection method for power operation violations according to claim 2, characterized in that The size of the convolution kernel Z is adaptively determined by the following formula: Among them, C represents the number of channels of the feature map, S represents the scaling factor used to control the growth rate of Z, and O represents the offset used to adjust the initial value of Z. represents the operation of rounding up to an odd number.
4. The real-time target detection method for power operation violations according to any one of claims 1-3, characterized in that, The Violation-YOLO object detection model further includes a DC2f module, which replaces the last C2f module in the backbone network of the YOLOv8n base model with a DC2f module. That is, the backbone network of the Violation-YOLO object detection model sequentially includes: a first ConvModule, a second ConvModule, a first C2f module, a third ConvModule, a second C2f module, a fourth ConvModule, a third C2f module, a fifth ConvModule. After obtaining the corresponding feature map, it is sent into the DC2f module; The DC2f module sequentially includes a first DSConv module, a Split module for feature decomposition, a DBottleneck module, a Concat module for feature concatenation, and a second DSConv module.
5. The real-time target detection method for power operation violations according to claim 4, characterized in that The DBottleneck module processes the input feature map through a DConvModule to compress the channels; secondly, the compressed feature map restores the number of channels through the second DConvModule while further extracting deep features; finally, the input feature map and the output of the second DConvModule are added together through a short connection.
6. The real-time target detection method for power operation violations according to claim 5, characterized in that The DconvModule includes: a DConv module for enhancing the input feature map; inputting the feature map before and after enhancement into a BatchNorm2d module for batch normalization processing, and inputting the processed feature map into a SiLU activation function module.
7. The real-time target detection method for power operation violations according to claim 6, wherein The operation process of the DConv module is as follows: First, two additional convolutional layers are used to predict the offsets of the original sampling points and the ROI metric factors respectively; then, according to the predicted offsets, the sampling positions of the convolutional kernels are dynamically adjusted, and at the same time, the ROI metric factors are used to weight these dynamic sampling points; finally, the convolutional kernels are convolved with the weighted sampling points in the feature map to obtain the output feature map.
8. The real-time target detection method for power operation violations according to claim 7, characterized in that, In the process of convolving the convolutional kernels with the weighted sampling points in the feature map to obtain the output feature map, the convolution operation is expressed as: Among them, w k represents the value corresponding to the k-th convolution point in the convolution kernel, K is the number of sampling points, x and y represent the input and output feature maps respectively, p represents any current position in the feature map, p k represents the coordinates of the k-th convolution point inside the convolution kernel, Δp k represents the predicted offset corresponding to the k-th convolution point, x(p + p k + Δp k ) represents the sampling point corresponding to the k-th convolution point, Δm k ∈[0,1] represents the ROI measurement factor of the k-th sampling point.
9. A real-time target detection system for power operation violations, characterized in that, The system includes: A data acquisition module for collecting data on power operation violations, annotating the data set, constructing a target detection data set for power operation violation recognition types, and dividing the data set into a training set, a validation set, and a test set. A model construction module for constructing a Violation-YOLO target detection model. The Violation-YOLO target detection model includes a YOLOv8n base model and an adaptive multi-scale channel attention module. The adaptive multi-scale channel attention module is set after the spatial pyramid pooling fast module in the backbone network part of the YOLOv8n base model, that is, the feature map obtained from the spatial pyramid pooling fast module is input into the adaptive multi-scale channel attention module, and the output of the adaptive multi-scale channel attention module is connected to the relevant modules in the neck of the YOLOv8n base model. The adaptive multi-scale channel attention module includes a global feature vector representation unit, a convolutional unit, and an output unit. The global feature vector representation is as follows: the input feature map is respectively passed through three depthwise separable convolutional modules with different convolutional kernel sizes to obtain three feature maps with different scales, and then the three feature maps are added element-wise and fused. Finally, a global average pooling operation is performed on the fused feature map to obtain a global feature vector. The global feature vector is input into the convolutional unit, and the convolutional unit means: first performing an adaptive one-dimensional convolution operation on the global feature vector and then activating it to obtain a channel attention vector; the output unit means: after broadcasting the channel attention vector, performing an element-wise dot product with the input feature map to obtain the output feature map. A training module, which is used to train the Violation-YOLO object detection model using a training set and a validation set, and input a test set into the trained Violation-YOLO object detection model to obtain corresponding detection results.
10. The real-time target detection system for power operation violations according to claim 9, characterized in that The Violation-YOLO object detection model further includes a DC2f module, which replaces the last C2f module in the backbone network of the YOLOv8n basic model with a DC2f module. That is, the backbone network of the Violation-YOLO object detection model sequentially includes: a first ConvModule, a second ConvModule, a first C2f module, a third ConvModule, a second C2f module, a fourth ConvModule, a third C2f module, and a fifth ConvModule. After obtaining the corresponding feature map, it is sent to the DC2f module. The DC2f module sequentially includes a first DSConv module, a Split module for feature decomposition, a DBottleneck module, a Concat module for feature concatenation, and a second DSConv module.
11. A storage medium containing computer-executable instructions, characterized in that, When the computer-executable instructions are executed by a processor, the processor executes the method according to any one of claims 1-8.
Citation Information
Cited By
High-altitude parabolic object detection method based on Swinin-Transform and YOLOv8 fusion detection algorithm
CN120726453A