Intelligent inspection method and system for power distribution room
By improving the YOLOv7 model, using a lightweight MobileViT network or a network combining EfficientNet and ResNet, the instability and resource consumption problems of YOLOv7 when detecting small targets is solved, achieving more efficient small target detection and lower resource occupation.
Patent Information
- Application Number
- CN202411514024.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing YOLOv7 network is susceptible to background noise interference when detecting small targets, resulting in unstable detection results or missed detection. The network structure is complex and the number of parameters is large, making it difficult to efficiently apply in resource-constrained environments.
Using the improved YOLOv7 model, its backbone network is replaced by a lightweight MobileViT network or a network combining EfficientNet and ResNet, through feature extraction, fusion and compression, it improves detection accuracy and reduces system resource consumption.
It significantly improves the detection accuracy of small targets, reduces the utilization of system resources, and makes it more suitable for deployment in edge computing devices.
Smart Images

Figure CN119625483A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent identification technology, and in particular, relates to an intelligent inspection method and system for a power distribution room. Background Art
[0002] The existing YOLOv7 network is easily affected by background noise when detecting small targets, resulting in unstable detection results or missed detections. In addition, the YOLOv7 network has a complex structure and a large number of parameters, which results in significant consumption of computing resources and makes it difficult to use efficiently in resource-constrained environments. Therefore, an improved model is urgently needed that can both improve the accuracy of small target detection and reduce the system's demand for computing resources. Summary of the invention
[0003] The present disclosure aims to provide a method and system for intelligent inspection of power distribution rooms, which can effectively improve the detection precision and accuracy of small targets of power distribution room equipment in a resource-constrained environment and reduce the computing resource consumption of the system.
[0004] A first aspect of an embodiment of the present disclosure provides a method for intelligent inspection of a power distribution room, comprising: Acquire a first image, where the first image is an image of equipment in an inspection area in a power distribution room; Recognize the first image based on the first YOLO model to obtain an inspection result of the inspection area; The first YOLO model is an improved YOLOv7 model, and the backbone network of the first YOLO model includes a MobileViT network or a first combined network; The first combined network is a network obtained by combining EfficientNet and ResNet.
[0005] A second aspect of the embodiments of the present disclosure provides an intelligent inspection system for a power distribution room, including: An acquisition module, used to acquire a first image, where the first image is an image of equipment in an inspection area in a power distribution room; A recognition module is used to recognize the first image based on a first YOLO model to obtain an inspection result of the inspection area; wherein the first YOLO model is an improved YOLOv7 model, and the backbone network of the first YOLO model includes a MobileViT network or a first combined network; the first combined network is a network obtained by combining EfficientNet and ResNet.
[0006] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned intelligent inspection method for a distribution room when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned intelligent inspection method for a distribution room are implemented.
[0008] The present invention uses an improved YOLOv7 model to achieve accurate detection and recognition of small targets on mobile devices and in resource-constrained environments. Compared with the existing YOLOv7 model, the present invention significantly improves the detection accuracy of small targets and reduces the occupation of system resources, making it more suitable for deployment in edge computing devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic diagram of a flow chart of a method for intelligent inspection of a power distribution room provided in one embodiment of the present disclosure; Figure 2 A MobileViT network architecture diagram provided for an embodiment of the present disclosure; Figure 3 A flowchart of an EfficientNet provided in one embodiment of the present disclosure; Figure 4 A flowchart of a ResNet provided in one embodiment of the present disclosure; Figure 5 A structural block diagram of an intelligent inspection system for a power distribution room provided in one embodiment of the present disclosure; Figure 6 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0011] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.
[0012] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0013] Please refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of a power distribution room intelligent inspection method provided in an embodiment of the present disclosure, the method comprising: S101: Acquire a first image, where the first image is an image of equipment in an inspection area in a power distribution room.
[0014] In this embodiment, the first image can be acquired through a camera, a mobile phone or other device; the first image can be a picture or video of equipment such as a power incoming cabinet, a circuit breaker, a transformer, a switch DC panel, etc.; the inspection area of the distribution room can be a high-voltage equipment area, a low-voltage equipment area, a cable channel area, etc. in the distribution room; the equipment can be a power incoming cabinet, a circuit breaker, a transformer, a switch DC panel, etc.
[0015] S102: Recognize the first image based on the first YOLO model to obtain an inspection result of the inspection area; wherein the first YOLO model is an improved YOLOv7 model, and the backbone network of the first YOLO model includes a MobileViT network or a first combined network; the first combined network is a network obtained by combining EfficientNet and ResNet.
[0016] In this embodiment, the first YOLO model is an improved model of the YOLOv7 model, and the backbone network in the YOLOv7 model can be replaced by a lightweight, general-purpose, and mobile-friendly visual transformer (Light-weight, General-purpose, and Mobile-friendly Vision Transformer, MobileViT) network or a first combined network obtained by combining the model scaling of the convolutional neural network (Rethinking Model Scaling for Convolutional Neural Networks, EfficientNet) and the residual network (Residual Network, ResNet); the combination method is to fuse the deep features after the convolution layer of feature extraction, specifically: a skip connection is made between the output feature map of EfficientNet and the residual module of ResNet to improve the recognition accuracy and efficiency of the model. The inspection results can be that the indicator light color on the high-voltage switch cabinet is normal, the switch DC screen displays normally, and the power supply line cabinet button state is abnormal.
[0017] Figure 2 A MobileViT network architecture diagram provided in an embodiment of the present disclosure, refer to Figure 2First, the feature map is used to extract local features of the image through an n×n convolution, and then the number of channels of the feature map is adjusted from C to d using a 1×1 convolution. Then, the global feature is extracted through the global feature expression module and the number of channels of the feature map is adjusted back to C using a 1×1 convolution. Finally, the feature map is simply spliced with the original input map along the channel direction with the help of the residual branch, and the features are fused through an n×n convolution to obtain the final output features.
[0018] Figure 3 A flowchart of an EfficientNet provided in one embodiment of the present disclosure is provided. Figure 3 The input layer is used to receive the original color image data (RGB three channels), and the image size is 224×224 pixels. The input layer performs preprocessing operations such as format adjustment and normalization on the image data so that the data can meet the calculation requirements of the subsequent network layers.
[0019] The convolution layer is used for preliminary feature extraction and increasing feature dimensions. The convolution layer extracts basic image features by performing convolution operations on the input image and enriches the dimension of feature representation by increasing the number of output channels. The size of the output feature map becomes 112×112 and the number of channels becomes 32.
[0020] The MBConv layer is used for efficient feature extraction and transformation and to adapt to features of different scales. The MBConv layer increases the dimension through 1×1 convolution, then performs convolution to efficiently extract features, and finally performs 1×1 convolution to reduce the dimension. This structure can effectively extract features at different levels while maintaining computational efficiency.
[0021] The global average pooling layer is used for feature map dimensionality reduction and global information integration. The global average pooling layer performs a global average pooling operation on the feature map output by the previous convolutional layer, averages all pixel values of each feature map, and converts the two-dimensional feature map into a one-dimensional feature vector. The size of the feature map becomes 1×1, and the number of channels becomes 192. The above steps greatly reduce the dimension of the features and the number of parameters of the subsequent fully connected layers. At the same time, it also integrates the global information of the entire feature map, allowing the network to grasp the feature representation of the image as a whole.
[0022] The fully connected layer is used for feature mapping and classification decisions. The fully connected layer further maps and transforms the one-dimensional feature vector output by the global average pooling layer, and associates the feature vector with the final output category through a large number of weight parameters.
[0023] The output layer is used to output the final result. The output layer processes the result through the Softmax function so that the output probability value is between 0 and 1.
[0024] Figure 4A flowchart of a ResNet provided in one embodiment of the present disclosure is provided. Figure 4 The input layer receives the original color image data (RGB three channels) with an image size of 224×224 pixels. The input layer performs preprocessing operations such as format adjustment and normalization on the image data so that the data can meet the calculation requirements of the subsequent network layers.
[0025] The convolution layer is used for preliminary feature extraction and increasing feature dimensions. The convolution layer extracts basic image features by performing convolution operations on the input image and enriches the dimension of feature representation by increasing the number of output channels. The size of the output feature map becomes 112×112 and the number of channels becomes 64.
[0026] The maximum pooling layer is used for downsampling and feature extraction, and downsamples the feature map after the convolution layer. By selecting the maximum value in the local area as the output, the size of the feature map is reduced (from 112×112 to 56×56) while keeping the number of channels unchanged.
[0027] The residual block is used for deep feature extraction and gradient propagation optimization. By stacking multiple residual blocks, more complex and abstract image features can be learned.
[0028] The global average pooling layer is used for global feature integration and dimensionality reduction. The global average pooling layer performs global average pooling on the feature maps processed by multiple residual blocks, averages all pixel values of each feature map, and converts the two-dimensional feature map into a one-dimensional feature vector. The size of the feature map becomes 1×1 and the number of channels becomes 512.
[0029] The fully connected layer is used for feature mapping and classification decisions. The fully connected layer further maps and transforms the one-dimensional feature vector output by the global average pooling layer, and associates the feature vector with the final output category through a large number of weight parameters.
[0030] The output layer is used to output the final result. The output layer processes the result through the Softmax function so that the output probability value is between 0 and 1.
[0031] MobileViT network is used as the backbone network for feature extraction. MobileViT combines the lightweight of mobile neural network (MobileNet) and the powerful feature extraction capability of vision transformer (ViT). It can capture the detailed features of the image while maintaining high efficiency. It has stronger adaptability and generalization capabilities. When there are certain requirements for detection accuracy and resources are relatively limited, MobileViT network can be selected as the backbone network for feature extraction.
[0032] The network obtained by combining EfficientNet and ResNet as the backbone network can achieve the best performance under different computing resource constraints. It can extract richer and more discriminative features. When training and testing on various target detection data sets, it can better adapt to different data distributions and target characteristics, thereby improving the accuracy of target detection. It can achieve efficient feature extraction while keeping the number of parameters and computational complexity low through scaling strategies. When resources are limited and the detection accuracy requirements are not high, the network obtained by combining EfficientNet and ResNet can be selected as the backbone network for feature extraction.
[0033] From the above, it can be concluded that the present invention realizes accurate detection and recognition of small targets in mobile devices and resource-constrained environments by adopting the improved YOLOv7 model. Compared with the existing YOLOv7 model, the present invention significantly improves the detection accuracy of small targets and reduces the occupation of system resources, making it more suitable for deployment in edge computing devices.
[0034] In one embodiment of the present disclosure, the first image is recognized based on the first YOLO model to obtain an inspection result of the inspection area, including: Using a first network to extract features from the first image to obtain a first feature set, wherein the first network is a MobileViT network or a first combined network; Perform feature fusion on the first feature set to obtain fused features; Perform feature extraction on the fused features to obtain compressed features; Identification is performed based on the compressed features to obtain the inspection results of the inspection area.
[0035] In this embodiment, the first network may be a MobileViT network or a first combined network; the first combined network may be a network obtained by combining EfficientNet with ResNet; the first image may be a picture or video of equipment such as a power incoming cabinet, a circuit breaker, a transformer, and a switch DC panel; the first feature set may be a data set formed by buttons, switches, display screens, and indicator lights in pictures or videos of equipment such as a power incoming cabinet, a circuit breaker, a transformer, and a switch DC panel; feature fusion may be performed through a Content-Aware ReAssembly of Features (CARAFE) upsampling network; fused features may be contours, colors, brightness, textures, and the like of buttons, switches, display screens, and indicator lights; feature extraction may be performed through a Grouped Shifted Convolution (GSConv) network; compressed features may be simplified features of contours, colors, brightness, and textures of buttons, switches, display screens, and indicator lights; compressed features may be identified through a YOLOv7 detection head; the inspection results may be key information of the distribution room equipment such as whether a button is pressed, whether a switch is turned on, whether a display screen is displayed, and what the color of the indicator light is.
[0036] For example, the first network is a MobileViT network, and the first image is a picture of a switch cabinet. The picture of the switch cabinet is recognized by the MobileViT network, and the first feature set is the button and indicator light area on the switch cabinet. Feature fusion is performed through the CARAFE upsampling network, and the contour of the switch cabinet button and the contour and color of the indicator light are obtained. Feature extraction is performed through the GSConv network, and the compressed features obtained may be the simplified shape features of the switch cabinet button and the representative color features of the indicator light. The simplified shape features of the switch cabinet button and the representative color features of the indicator light are recognized by the YOLOv7 detection head, and it is obtained that the button of the switch cabinet is pressed and the color of the indicator light is green.
[0037] From the above, it can be concluded that the present invention uses the MobileViT network or the first combined network as the backbone network of the YOLOv7 model to perform feature extraction, thereby improving the detection accuracy of the YOLOv7 model for small targets; through feature fusion, the features extracted can be integrated to enhance the expressive power of the features; through feature extraction, the computing cost can be reduced, the computing efficiency can be improved, and the stability and generalization ability of the model can be improved.
[0038] In one embodiment of the present disclosure, the first feature set is subjected to feature fusion to obtain fused features, including: The first feature set is subjected to feature fusion using a second network to obtain fused features, wherein the second network includes a CARAFE upsampling network, an FPN network, or a PANet.
[0039] In this embodiment, the first feature set can be a data set formed by buttons, switches, display screens, and indicator lights in pictures or videos of equipment such as power incoming cabinets, circuit breakers, transformers, and switch DC panels; feature fusion can be performed through a CARAFE upsampling network, a feature pyramid network (FPN) or a path aggregation network (PANet); the fused features can be the contours, colors, brightness, textures, etc. of buttons, switches, display screens, and indicator lights.
[0040] Using the CARAFE upsampling network for feature fusion can enhance the fusion capability of features of different scales. The CARAFE upsampling network can dynamically adjust the convolution kernel in the upsampling process to make feature fusion more accurate. The CARAFE upsampling network is used in the upsampling process of each layer of the feature pyramid network of YOLOv7 to ensure the effective fusion of multi-scale features; the CARAFE upsampling network can adaptively upsample according to the content of the input features, and can adjust the upsampling method according to the feature details of different regions; in the distribution room equipment image, for the edge, texture and other detail areas of the equipment, the CARAFE upsampling network can perform more fine upsampling and retain more detail information. For example, for small-sized but important features such as the nameplate of the transformer and the scale of the instrument, its clarity and accuracy can be better restored; when resources are limited and there are certain requirements for detection accuracy, the CARAFE upsampling network can be used for feature fusion.
[0041] Using FPN for feature fusion can build a pyramid structure to fuse features at different levels, avoiding full-image calculations on high-resolution images, thereby reducing the amount of calculations and enhancing the expressiveness of multi-scale features. In a power distribution room, the size of equipment varies greatly, ranging from large transformers to small instruments and switches. FPN can fuse features of different scales so that the model can process equipment of different sizes at the same time. For large equipment, low-resolution features with global context information help determine its approximate location and overall structure. For small equipment, high-resolution features can capture more details and improve detection accuracy. When resources are sufficient and there are certain requirements for the hierarchical fusion of features of different scales, FPN can be used for feature fusion.
[0042] Using PANet for feature fusion can be enhanced through a bottom-up path, which can better propagate the underlying detail information to the high-level features. For example, for detecting tiny scratches or marks on the surface of the device, the underlying high-resolution features can provide key clues, and the bottom-up path ensures that this information is not lost during the feature transmission process; at the same time, the top-down path passes the high-level semantic information back to the low-level, helping the low-level features to better understand the overall situation; this is very important for accurately identifying the type and status of the device. For example, high-level features can determine that an area may contain a certain type of device, and then pass this information to the low-level, so that the low-level features can perform more targeted feature extraction in the area; when resources are relatively sufficient and there are high requirements for detection accuracy, PANet can be used for feature fusion.
[0043] From the above, it can be concluded that the present disclosure provides that different networks can be used to fuse target features in different situations, enhance the expressiveness of features, and improve the detection accuracy of YOLOv7 for small targets in a diversified way, and can achieve more accurate detection in a lightweight manner.
[0044] In one embodiment of the present disclosure, feature extraction is performed on the fused features to obtain compressed features, including: The fused features are extracted using a third network to obtain compressed features, wherein the third network includes a GSConv network, a DSC network, or a PW network.
[0045] In this embodiment, the fused features may be the outline, color, brightness, texture, etc. of a button, switch, display, or indicator light; the compressed features may be simplified features of the outline, color, brightness, and texture of a button, switch, display, or indicator light; and the fused features may be extracted through a GSConv network, a depthwise separable convolution (DSC) network, or a pointwise convolution (PW) network.
[0046] The GSConv network is introduced in the middle layer of the feature pyramid network for feature extraction and channel shuffling. The GSConv network can improve the representation ability without significantly increasing the computational cost by generating redundant features and performing channel shuffling. Application location: The GSConv network is used after the features of each layer of the feature pyramid network are fused to reduce the computational complexity and automatically adjust the weights of the convolution kernel according to the input features to achieve dynamic feature selection. It helps to highlight important features and suppress irrelevant or redundant features, thereby improving the effect of feature extraction. In the inspection of equipment in the distribution room, the importance of features of different equipment may be different. The GSConv network can better adapt to this change and improve the representativeness of the compressed features. When resources are sufficient and the detection accuracy requirements are high, the GSConv network can be used for feature extraction.
[0047] Using DSC network for feature extraction can decompose the convolution operation into two independent steps in the depth direction and the spatial direction, greatly reducing the number of parameters; making DSC convolution highly parameter efficient in feature extraction, which can reduce the storage requirements and computational cost of the model; in large-scale inspection tasks, this can significantly improve the efficiency and scalability of the model; due to the small number of parameters, the computational complexity of DSC convolution is relatively small. This gives it a great advantage on resource-constrained devices, such as mobile devices or embedded systems; it can achieve real-time feature extraction and equipment inspection, and improve the response speed and practicality of the system; DSC network can be used for feature extraction when resources are limited and the detection accuracy requirement is not high.
[0048] The PW network is used for feature extraction through point-by-point convolution operations, which can effectively fuse global information; it can linearly combine the features of different channels to capture the complex relationship between features and global context information; in feature extraction, PW can help retain important global features and improve the quality and representativeness of compressed features; by setting different convolution kernel sizes and numbers of channels, feature dimension increase or dimension reduction operations can be achieved; this makes PW very flexible in feature extraction and can be adjusted according to different task requirements and model architectures; the PW network can be used for feature extraction when the inspection task is not large in scale and resources are relatively sufficient.
[0049] From the above, it can be concluded that the present disclosure provides different networks for target feature extraction in different situations, reduces computing costs, improves computing efficiency, improves the stability and generalization ability of the model, and diversifies the detection accuracy of YOLOv7 for small targets, and can achieve more accurate detection in a lightweight manner.
[0050] In one embodiment of the present disclosure, recognition is performed based on compression features to obtain inspection results of the inspection area, including: The fourth network is used to enhance the compressed features, and the enhanced compressed features are identified by using target recognition to obtain the inspection results of the inspection area; Among them, the fourth network includes a CA attention mechanism network, a SE network or a Non-local Block network.
[0051] In this embodiment, the fourth network can be a channel attention (CA) mechanism network, a squeeze and excitation (SE) network or a non-local block (Non-local Block) network; the compressed features can be simplified features of the contour, color, brightness, and texture of buttons, switches, display screens, and indicator lights; the enhanced compressed features can be features after increasing the weights of the contour, color, brightness, and texture of buttons, switches, display screens, and indicator lights; the YOLOv7 detection head can be used to identify the enhanced compressed features, and the inspection results are obtained by identifying the equipment in the inspection area.
[0052] The CA attention mechanism network is used to enhance compressed features to focus on the importance of the channel dimension. It also decomposes the global average pooling to capture the long-range spatial interaction of features in the horizontal and vertical directions, which can better integrate the relationship between space and channels, and help the model to more accurately locate and identify key features. For example, it can more accurately focus on the specific position and shape characteristics of the target object in the image; it is flexible and lightweight, with relatively low demand for computing resources, and is suitable for use in resource-constrained environments, such as mobile devices or embedded systems. It helps to improve the performance of the model on these devices without bringing too much computing burden; the CA attention mechanism network can be used to enhance compressed features when resources are limited and high detection accuracy is required.
[0053] The SE network is used to enhance the compression features by learning adaptive channel weights, so that the model can automatically adjust the focus on different channel features according to the data, effectively highlight the important channel information, and suppress the less important channel information. For example, in image classification tasks, the model can pay more attention to the feature channels related to the target category, thereby improving the model's ability to screen and utilize features and improving the model's performance. The SE network can be used to enhance the compression features when resources are limited and the detection accuracy requirements are not high.
[0054] Using the Non-local Block network to enhance the compressed features can effectively capture the long-distance dependencies in the input feature map, that is, it can establish the association between any two positions in the image or other data, no matter how far they are apart in space; by calculating the sum of the feature weights of each position and all other positions, a more representative and comprehensive feature representation can be generated for each position, so that the model can better handle complex semantic information and contextual relationships, thereby improving the performance and generalization ability of the model, and showing better results in some complex visual tasks; the Non-local Block network can be used for enhanced compression when resources are sufficient and the detection distance is far.
[0055] From the above, it can be concluded that the present disclosure provides different networks that can be used to enhance compressed features in different situations, thereby enhancing the attention of features, improving robustness, and improving the detection accuracy of YOLOv7 for small targets in a diversified way, and can achieve more accurate detection in a lightweight manner.
[0056] In one embodiment of the present disclosure, target recognition includes a YOLOv7 detection head, a Faster R-CNN detection algorithm, or an SSD detection algorithm.
[0057] In this embodiment, the use of the YOLOv7 detection head to identify the enhanced compressed features can achieve a good balance between speed and accuracy, and is suitable for real-time detection tasks; through improved feature extraction and improved feature fusion, the detection performance of YOLOv7 is significantly improved in complex environments, and the YOLOv7 detection head can be used to identify the enhanced compressed features when resources are limited and the detection requirements are high.
[0058] Using the Faster Region-based Convolutional Neural Networks (Faster R-CNN) detection algorithm to identify the enhanced compressed features can improve the detection accuracy, especially for the detection of high-precision, multi-scale and small objects. The two-order network structure enables it to have higher accuracy and can accurately locate the target and identify its category; it can achieve good results in multiple data sets and different object detection tasks, and has strong adaptability to various complex scenes and target types; the Faster R-CNN detection algorithm can be used to identify the enhanced compressed features when resources are sufficient, the detection time requirement is not high and the detection accuracy is high.
[0059] Using the Single Shot MultiBox Detector (SSD) detection algorithm to identify the enhanced compressed features can combine the regression idea with the anchor box mechanism, eliminate the candidate region generation and subsequent pixel or feature resampling stages in the two-stage algorithm, and encapsulate all calculations in one network, making it easy to train and fast, and able to meet scenarios with high real-time requirements; predictions can be made on multiple feature maps with different resolutions, and objects of various sizes can be processed. By setting default borders of different sizes and aspect ratios on feature maps of different scales, it can better adapt to the scale changes of the target; when the detection accuracy requirements are not high and the requirements on the size and shape of the detection border are not high, the SSD detection algorithm can be used to identify the enhanced compressed features.
[0060] From the above, it can be concluded that the present disclosure provides different algorithms that can be used to identify enhanced compressed features in different situations, which improves the detection accuracy of YOLOv7 for small targets in a diversified way and can achieve more accurate detection in a lightweight manner.
[0061] In one embodiment of the present disclosure, the intelligent inspection method for a power distribution room further includes: optimizing the inspection result by using a first algorithm to obtain a final inspection result; The first algorithm includes an NMS algorithm, a Soft-NMS algorithm or a DIoU-NMS algorithm.
[0062] In this embodiment, the non-maximum suppression (NMS) algorithm: Given a candidate box set B={ }, the corresponding confidence score set S = { ... }: Step 1: Select the box with the highest score , and its corresponding confidence score is .
[0063] Step 2: Calculate all remaining boxes and Intersection over Union (IoU):
[0064] in, For the A frame, The box with the highest score.
[0065] Step 3: If >threshold (usually 0.5), then and There is too much overlap and should be suppressed and deleted. .
[0066] The NMS algorithm is used to optimize the inspection results. By comparing the overlap degree and score of candidate frames, redundant candidate frames can be quickly removed. The computational complexity is relatively low, the execution speed is fast, and it can meet application scenarios with high real-time requirements. For most target detection tasks, especially scenarios where the overlap degree between targets is not very high, it can effectively screen out the most likely target frames, reduce false detections, and improve detection accuracy. The NMS algorithm can be used to optimize the inspection results when the overlap degree of the detection objects is not high and resources are limited.
[0067] Soft Non-Maximum Suppression (Soft-NMS) algorithm: Perform steps 1 and 2 of the NMS algorithm and use the following formula to attenuate The confidence score :
[0068] Among them, σ is a parameter that controls the decay rate. You can also use a linear or Gaussian function to adjust the score and delete those confidence scores. Boxes below a threshold, which can be manually set based on usage scenarios.
[0069] The Soft-NMS algorithm can be used to optimize the inspection results by gradually reducing the score instead of abruptly deleting the candidate boxes. In this way, for those candidate boxes that have a certain overlap with the highest-scoring box but may actually correspond to different targets, a certain score can be retained, reducing missed detections caused by overlapping threshold settings, and performing better in scenes with dense targets or occlusions. The Soft-NMS algorithm can be used to optimize the inspection results when resources are limited and there are certain requirements for detection accuracy.
[0070] Distance-IoU Non-Maximum Suppression (DIoU-NMS) algorithm: Perform steps 1 and 2 of the NMS algorithm and use the following formula to calculate :
[0071] in, is the prediction box and candidate boxes Center point distance, is the diagonal length of the smallest enclosing box containing the two boxes, and the box with the highest score is selected For each remaining candidate box ,calculate Whether to suppress the frame is determined based on a threshold, and the threshold can be manually set based on the usage scenario.
[0072] The DIoU-NMS algorithm is used to optimize the inspection results. While considering the overlapping areas of the candidate frames, it also introduces the distance information of the center points of the frames. This can more accurately judge the relationship between the candidate frames, and more reasonably screen those frames with farther center point distances but higher overlap, thus reducing false detections and missed detections. For example, for some targets with special shapes or special position distributions, the correct frames can be better retained. For different types of data sets and target detection tasks, especially those with complex target distributions and a large number of overlaps and occlusions, DIoU-NMS has better adaptability and robustness, and can improve the detection effect. When resources are sufficient and the overlap of the detection objects is high, the DIoU-NMS algorithm can be used to optimize the inspection results.
[0073] It can be concluded from the above that the present disclosure provides an optimization of the inspection results by using different algorithms in different situations, thereby improving the detection accuracy of the YOLOv7 model for small targets.
[0074] In one embodiment of the present disclosure, acquiring a first image includes: Acquire an image of the target area; Processing the image of the target area based on image enhancement to obtain a first image; Image enhancement, including: negative image and CLAHE.
[0075] In this embodiment, an image of the target area can be obtained through a camera, a mobile phone or other device. The target area can be a high-voltage equipment area, a low-voltage equipment area, a cable channel area, etc. in a power distribution room; the first image can be a picture or video of equipment such as a power incoming line cabinet, a circuit breaker, a transformer, and a switch DC panel; image enhancement can be negative image and contrast limited adaptive histogram equalization (CLAHE), Negative images can reverse the color or grayscale value of an image, making the originally bright parts dark and the dark parts bright, making the image closer to a grayscale image and enhancing the details; CLAHE can improve image contrast and suppress noise; CLAHE divides the image into multiple small areas and performs histogram equalization on each small area; it can enhance the contrast of the image in a local range, making the details in the image clearer and more visible; CLAHE introduces a contrast limitation mechanism to limit the contrast enhancement amplitude in each small area, avoiding the problem of over-enhancement.
[0076] It can be concluded from the above that the present disclosure performs image preprocessing through negative image and CLAHE, thereby enhancing image details, improving image contrast and suppressing noise.
[0077] In one embodiment of the present disclosure, the intelligent inspection method for a power distribution room further includes: Based on the optimized inspection results, an alarm signal or a normal signal is issued and an inspection record is generated.
[0078] In this embodiment, the optimized inspection results may be as shown in Table 1: Table 1 Inspection records of power distribution room
[0079] From the above, it can be concluded that the present invention can send alarm signals and normal signals to relevant personnel by processing the optimized inspection results, thereby improving the reliability of the system, facilitating subsequent maintenance and overhaul, helping relevant personnel understand the equipment operating status, and optimizing maintenance strategies.
[0080] In this embodiment, an RGB camera can be used to acquire an image of a target area of the distribution room equipment, the image of the target area can be processed by a negative image and CLAHE to obtain a first image, feature extraction can be performed by a MobileViT network, and feature fusion can be performed by a CARAFE upsampling network; feature extraction can be performed by a GSConv network; compressed features can be enhanced by a CA attention mechanism; the enhanced compressed features can be recognized by a YOLOv7 detection head to generate inspection results; the inspection results can be optimized by an NMS algorithm to obtain optimized inspection results; and alarm information or normal information can be sent to relevant personnel based on the optimized inspection results.
[0081] For example, an image of a low-voltage switch cabinet is acquired through an RGB camera, and then the grayscale value of the low-voltage switch cabinet image is inverted through a negative image, so that the originally bright part becomes dark and the dark part becomes bright, making the image closer to a grayscale image and enhancing the details. The low-voltage switch cabinet image is divided into multiple small areas through CLAHE, and each small area is subjected to histogram equalization to make the details in the image clearer and more visible; the feature information of the button and indicator light area on the low-voltage switch cabinet is extracted through the MobileViT network; the feature contour of the button and the color of the indicator light on the low-voltage switch cabinet are fused through the CARAFE upsampling network; and the GSCo The nv network fusion features are used for feature extraction to obtain the simplified shape features of the low-voltage switch cabinet button and the representative color features of the indicator light; the compressed features are enhanced through the CA attention mechanism to obtain the enhanced compressed features; the enhanced compressed features are identified through the YOLOv7 detection head to obtain that the button on the low-voltage switch cabinet has been pressed and the indicator light color is green; the inspection results are optimized through the NMS algorithm to obtain the optimized inspection results and remove redundant detection frames; according to the optimized inspection results, the inspection results of distribution room A are normal or the inspection results of distribution room A are abnormal, and an inspection report of the normal inspection results of distribution room A or the abnormal inspection results of distribution room A is generated.
[0082] From the above, it can be concluded that the present invention achieves lightweight and accurate monitoring of small targets through the MobileViT network, CARAFE upsampling network, GSConv network, CA attention mechanism, YOLOv7 detection head and NMS algorithm.
[0083] Corresponding to the power distribution room inspection method in the above embodiment, Figure 5 This is a structural block diagram of a power distribution room inspection system provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 5 , the power distribution room intelligent inspection system 20 includes: The acquisition module 21 is used to acquire a first image, where the first image is an image of equipment in an inspection area in a power distribution room; The recognition module 22 is used to recognize the first image based on the first YOLO model to obtain the inspection result of the inspection area; wherein the first YOLO model is an improved YOLOv7 model, and the backbone network of the first YOLO model includes a MobileViT network or a first combined network; the first combined network is a network obtained by combining EfficientNet and ResNet.
[0084] In one embodiment of the present disclosure, the recognition module 22 is specifically used to extract features from the first image using a first network to obtain a first feature set, wherein the first network is a MobileViT network or a first combined network; Perform feature fusion on the first feature set to obtain fused features; Perform feature extraction on the fused features to obtain compressed features; Identification is performed based on the compressed features to obtain the inspection results of the inspection area.
[0085] In one embodiment of the present disclosure, the recognition module 22 is further configured to extract features from the first image using a first network to obtain a first feature set, wherein the first network is a MobileViT network or a first combined network; Perform feature fusion on the first feature set to obtain fused features; Perform feature extraction on the fused features to obtain compressed features; Identification is performed based on the compressed features to obtain the inspection results of the inspection area.
[0086] In one embodiment of the present disclosure, the recognition module 22 is further configured to use a second network to perform feature fusion on the first feature set to obtain fused features, wherein the second network includes a CARAFE upsampling network, FPN or PANet.
[0087] In one embodiment of the present disclosure, the recognition module 22 is further configured to extract features from the fused features using a third network to obtain compressed features, wherein the third network includes a GSConv network, a DSC network, or a PW network.
[0088] In one embodiment of the present disclosure, the recognition module 22 is further configured to use the fourth network to enhance the compressed features, and use target recognition to identify the enhanced compressed features, so as to obtain the inspection result of the inspection area; Among them, the fourth network includes a CA attention mechanism network, a SE network or a Non-local Block network.
[0089] In one embodiment of the present disclosure, the recognition module 22 is specifically used for target recognition including a YOLOv7 detection head, a Faster R-CNN detection algorithm or an SSD detection algorithm.
[0090] In one embodiment of the present disclosure, the intelligent inspection system 20 for power distribution room further includes: a result optimization module; A result optimization module, used to optimize the inspection result by using the first algorithm to obtain the final inspection result; The first algorithm includes an NMS algorithm, a Soft-NMS algorithm or a DIoU-NMS algorithm.
[0091] In one embodiment of the present disclosure, the acquisition module 21 is further specifically used to acquire an image of the target area; Processing the image of the target area based on image enhancement to obtain a first image; Image enhancement, including: negative image and CLAHE.
[0092] In one embodiment of the present disclosure, the power distribution room inspection system 20 further includes: an alarm and recording module; The alarm and recording module is used to send out alarm signals or normal signals based on the optimized inspection results and generate inspection records.
[0093] See also Figure 6 , Figure 6 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 6 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303 and one or more memories 304. The processors 301, input devices 302, output devices 303 and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of each module / unit in the above-mentioned device embodiments, such as Figure 5 The functions of modules 21 to 22 are shown.
[0094] It should be understood that in the embodiment of the present disclosure, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0095] The input device 302 may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.
[0096] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.
[0097] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present disclosure can execute the implementation methods described in the first and second embodiments of the intelligent inspection method for the distribution room provided in the embodiments of the present disclosure, and can also execute the implementation methods of the electronic device described in the embodiments of the present disclosure, which will not be repeated here.
[0098] In another embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by the processor, all or part of the processes in the above-mentioned embodiment method are implemented, and the computer program can also be completed by instructing the relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0099] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0100] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0102] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or it can be an electrical, mechanical or other form of connection.
[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.
[0104] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0105] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for intelligent inspection of a power distribution room, characterized in that: include: Acquire a first image, where the first image is an image of equipment in an inspection area in a power distribution room; Recognize the first image based on the first YOLO model to obtain an inspection result of the inspection area; The first YOLO model is an improved YOLOv7 model, and the backbone network of the first YOLO model includes a MobileViT network or a first combined network; The first combined network is a network obtained by combining EfficientNet and ResNet.
2. The intelligent inspection method for power distribution room according to claim 1, characterized in that: The identifying the first image based on the first YOLO model to obtain an inspection result of the inspection area includes: Using a first network to extract features from the first image to obtain a first feature set, wherein the first network is a MobileViT network or a first combined network; Performing feature fusion on the first feature set to obtain fused features; Performing feature extraction on the fused features to obtain compressed features; Identification is performed based on the compression features to obtain inspection results of the inspection area.
3. The intelligent inspection method for power distribution room according to claim 2, characterized in that: The step of fusing the first feature set to obtain a fused feature includes: The first feature set is subjected to feature fusion using a second network to obtain the fused feature, wherein the second network includes a CARAFE upsampling network, FPN or PANet.
4. The intelligent inspection method for power distribution room according to claim 2, characterized in that: The extracting the fused features to obtain compressed features includes: A third network is used to extract features from the fused features to obtain the compressed features, wherein the third network includes a GSConv network, a DSC network or a PW network.
5. The intelligent inspection method for power distribution room according to claim 2, characterized in that: The identifying based on the compression feature to obtain the inspection result of the inspection area includes: Using a fourth network to enhance the compression feature, and using target recognition to identify the enhanced compression feature, to obtain an inspection result of the inspection area; Among them, the fourth network includes a CA attention mechanism network, a SE network or a Non-local Block network.
6. The intelligent inspection method for power distribution room according to claim 5, characterized in that: The target recognition includes a YOLOv7 detection head, a Faster R-CNN detection algorithm or an SSD detection algorithm.
7. The intelligent inspection method for power distribution room according to claim 5, characterized in that: The method further includes: optimizing the inspection result by using a first algorithm to obtain a final inspection result; The first algorithm includes an NMS algorithm, a Soft-NMS algorithm or a DIoU-NMS algorithm.
8. An intelligent inspection system for power distribution room, characterized in that: include: An acquisition module, used to acquire a first image, where the first image is an image of equipment in an inspection area in a power distribution room; A recognition module is used to recognize the first image based on a first YOLO model to obtain an inspection result of the inspection area; wherein the first YOLO model is an improved YOLOv7 model, and the backbone network of the first YOLO model includes a MobileViT network or a first combined network; the first combined network is a network obtained by combining EfficientNet and ResNet.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
A Grape Disease Identification Method and System Based on Improved YOLOV3
CN114937172A
Human body conflict detection method based on deep learning
CN114944011A
Winter jujube detection and positioning and mechanical arm picking sequence planning method based on YOLO-MLG and YAGR methods
CN118636150A
Power equipment target detection method, system and equipment for intelligent inspection
CN118799699A
Cited By
Intelligent inspection method for power distribution room based on robot collaboration
CN121165723A