Power transformation equipment defect target detection method based on multi-scale features of generated image

Through the defect target detection method of substation equipment based on the multi-scale features generated by image generation, the problem of automated detection of substation equipment is solved by using the improved YOLOv7 network and specific modules, and efficient and accurate defect detection is achieved, suitable for multi-scale targets.

CN119090861APending Publication Date: 2024-12-06ELECTRIC POWER RES INST STATE GRID SHANXI ELECTRIC POWER

Patent Information

Application Number
CN202411271456.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively detect defects in substation equipment in an efficient and automated manner, resulting in an increase in the risk of equipment failures and power accidents. Traditional detection methods cannot meet the requirements of the rapidly developing power industry for intelligent and efficient maintenance.

Method used

Using the defect object detection method of substation equipment based on multi-scale features generated image, the improved YOLOv7 network is constructed and combined with the C3+ module, Swin Transformer Block, SimAM module and NWD-CIoU loss function, a model is generated and trained to detect device defects.

Benefits of technology

It realizes accurate detection of defects in substation equipment, improves detection accuracy and robustness, enhances the feature extraction and learning ability of the model, and is suitable for multi-scale object detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090861A_ABST
    Figure CN119090861A_ABST
Patent Text Reader

Abstract

The invention relates to a power transformation equipment defect target detection method based on multi-scale features of a generated image. The method comprises the following steps: acquiring a power transformation equipment generation image to be subjected to defect detection; a multi-scale power transformation equipment defect target detection model based on improved YOLOv7 is constructed and trained, and a trained power transformation equipment defect target detection model is obtained; according to the network based on the improved YOLOv7, in a backbone network in the YOLOv7 network, C3 + modules are additionally arranged behind a first CBS module, a second CBS module, a third CBS module and three MP-1 modules; adding a SimAM module behind each of the SPPCSPC module and the ELAN-W module in the neck structure and the head structure; and inputting the power transformation equipment defect generation image into a trained substation equipment defect target detection model, and predicting a defect region and a defect type in the power transformation equipment image. The detection precision of the method is obviously improved compared with that before improvement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid substation equipment defect generation, and in particular to a substation equipment defect target detection method based on generating multi-scale features of an image. Background Art

[0002] Substations are an important link between the main power grid and the distribution network, and are the central hub of the smart grid. As the power grid continues to expand, the number of equipment in substations continues to increase, the importance of equipment maintenance and inspection tasks is increasing, and the challenges are becoming increasingly severe, requiring great attention and vigilance. Common equipment defects in substations include metal corrosion, meter damage, transformer oil leakage, ground oil pollution, respirator damage, insulator rupture, floating debris, bird nests, etc. During routine inspections of electrical equipment in substations, any abnormal operating conditions or equipment defects, if not discovered in time, may lead to equipment failures and even power accidents of varying degrees.

[0003] At present, the inspection of substation equipment mainly relies on routine inspections by inspectors. However, in the rapidly developing power industry, traditional detection methods can no longer meet the requirements of substation operation, maintenance and safety control. The shift to intelligent operation and maintenance inspection is increasingly seen as an important trend in the advancement of substations and broader fields.

[0004] With the continuous development of artificial intelligence technologies such as computer vision and deep learning, intelligent detection of substation faults has become a research hotspot. The current research focus is to use these advanced technologies to achieve automated and efficient fault detection and diagnosis of substation equipment, thereby improving the safety and reliability of equipment. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method for detecting defective targets of substation equipment based on generating multi-scale features of images.

[0006] To solve the above problems, the technical solution adopted by the present invention is:

[0007] A method for detecting defective targets of substation equipment based on generating multi-scale features of an image, the method comprising:

[0008] Obtain defect generation images of substation equipment to be inspected, and use the constructed defect image generation tool to generate samples: Combine the equipment defect dataset in production to generate defect image samples with diversity and realism, and ensure that the generated image samples are realistic and highly similar to real defect images. These samples cover various defect types and degrees of variation, increasing the diversity of the dataset and the generalization ability of the model. Mix the generated defect images with the real equipment images to form a new dataset. Ensure that the mixed dataset contains sufficient defect samples and maintains a balance between normal samples and defect samples.

[0009] A substation equipment defect target detection model based on the generated image multi-scale features is constructed and trained to obtain a trained substation equipment defect target detection model; the network based on the improved YOLOv7 includes an input, a backbone network, and a neck and head structure, wherein a C3+ module is added after the first to third CBS modules and after the three MP-1 modules in the backbone network of the YOLOv7 network; in the neck and head structure of the YOLOv7 network, a SimAM module is added after the SPPCSPC module in the top-down feature extraction path and the two ELAN-W modules;

[0010] The substation equipment image is input into the trained substation equipment defect target detection model to predict the defect area and defect type in the substation equipment image.

[0011] As an implementation mode of the invention, in the C3+ module, the input features are extracted by the upper branch and the lower branch respectively, and the features extracted by the two branches are fused and then outputted after passing through the SA conv module and the CA attention mechanism in sequence.

[0012] As an implementation mode of the invention, on the upper branch, the input features are first extracted through a convolution operation; then, the extracted features are halved and separated along the channel dimension, with one part output through the remaining branch and the other part passing through two bottleneck units; after the outputs of the two parts are concatenated along the channel dimension, feature information is extracted again through a convolution operation.

[0013] As an implementation mode of the invention, on the lower branch, the input features are first extracted through a convolution operation; then, the extracted features are halved and separated along the channel dimension, one part is output after passing through a convolution operation and a Swin module, and the other part passes through two bottleneck units; the outputs of the two parts are concatenated along the channel dimension, and feature information is extracted again through a convolution operation.

[0014] As an implementation mode of the invention, the following process is performed in the Swin module:

[0015] The features are input into the patch partition for block division, and then linearly transformed by Liner Embedding before being input into the subsequent Swin Transformer Block. Two Swin Transformer Blocks are set and connected in series.

[0016] As an implementation mode of the invention, the Swin Transformer module is improved based on SwinTranformerBlocks, which only retains the window multi-head self-attention structure, changes the Layernorm operation to Normalization, and also changes the MLP module to a WMSA module.

[0017] As an embodiment of the invention, the network based on improved YOLOv7 also replaces the coordinate loss function in the YOLOv7 network from the original CIoU loss function to the NWD-CIoU loss function, and the NWD-CIoU loss function is a fusion of the CIoU loss function and the NWD loss function.

[0018] As an implementation method of the invention, the calculation formula of the NWD-CIoU loss function is: NWD-CIoU =λ·L CIoU +(1-λ)L NWD ; Among them, λ is the fusion weight.

[0019] As an embodiment of the invention, the L CLoU The following formula is used to obtain:

[0020]

[0021]

[0022] Among them, B pre represents the bounding box of the prediction; B gt represents the ground truth; v is a parameter used to evaluate the aspect ratio consistency between width and height; w gt represents the width of the ground truth bounding box; h gt represents the height of the ground truth bounding box; w pre Indicates the width of the prediction bounding box; h pre Indicates the height of the prediction bounding box;

[0023] α determines the balance between the aspect ratio of the predicted bounding box and the ground truth bounding box; d represents the Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth; c represents the diagonal length of the minimum enclosing rectangle that contains the predicted bounding box and the ground truth.

[0024] As an embodiment of the invention, the L NWD The way to obtain is as follows:

[0025] For small objects, the bounding box is modeled as a two-dimensional Gaussian distribution, and the second-order Wasserstein distance between bounding boxes is:

[0026]

[0027] Among them, W2 2 (N g ,N t ) is the second-order Wasserstein distance between bounding box g and bounding box t, cx g is the horizontal coordinate of the center of the bounding box g, cy g is the center ordinate of the bounding box g, w g is the width of the bounding box g, h g is the height of the bounding box g; cx t is the central horizontal coordinate of the bounding box t, cy t is the center ordinate of the bounding box t, w t is the width of the bounding box t, h t is the height of the bounding box t, T represents transposition;

[0028] The second-order Wasserstein distance is normalized using the following formula and is called the normalized Gaussian Wasserstein distance:

[0029]

[0030] In the formula, NWD(N g ,N t ) represents the normalized Gaussian Wasserstein distance between the bounding box g and the bounding box t, and C is a normalization constant;

[0031] Using the formula L NWD =1-NWD(N g ,N t ) to obtain the NWD loss function L NWD .

[0032] The beneficial effects of adopting the above technical solution are:

[0033] The invention provides a method for detecting defective targets of substation equipment based on multi-scale features of generated images. On the basis of obtaining defective generated images of substation equipment to be detected, a defective target detection model of substation equipment based on multi-scale features of generated images is constructed and trained to obtain a trained defective target detection model of substation equipment. The network based on improved YOLOv7 includes input, backbone network, neck and head structure, wherein a C3+ module is added after the first to third CBS modules and after three MP-1 modules in the backbone network of the YOLOv7 network; a SimAM module is added after the SPPCSPC module in the top-down feature extraction path and two ELAN-W modules in the neck and head structure of the YOLOv7 network; the substation equipment image is input into the trained defective target detection model of substation equipment to predict the defective area and defect type in the substation equipment image. After the substation equipment image to be detected is input into the trained defective target detection model of substation equipment, accurate detection of defects in the substation equipment image can be achieved.

[0034] The model provided by the present invention can increase the network depth and receptive field by setting a C3+ module in the backbone network of the improved YOLOv7, thereby enhancing the feature extraction capability. Specifically, it is seamlessly integrated into the backbone network of the improved YOLOv7, and the SwinTrasformer Block and SA conv modules are used to realize the seamless interaction of information between windows in the backbone network. It not only retains complex depth details and expands the perception range of the network, but also integrates the CA attention mechanism, promotes a deeper exploration of feature information, and can amplify the feature extraction capability of the improved YOLOv7 backbone network when processing input features.

[0035] In addition, by setting up the SimAM module in the neck and head structure of the improved YOLOv7, it helps to improve the learning ability of the neck network in the improved YOLOv7. In addition, the algorithm can automatically learn and dynamically adjust the allocation ratio of attention according to different input scenarios such as complex features of the target, tiny features at the scale of distant targets, and oversized features at the scale of nearby targets. This will guide the neck to pay more attention to the detailed features of the defects of the substation equipment and filter out irrelevant information, thereby improving the accuracy of the neck network feature fusion and the overall detection accuracy of the model.

[0036] In addition, by replacing the CIoU loss function with the NWD-CIoU loss function, the NWD loss function is suitable for small scales, and the CIoU loss function is suitable for regular sizes, which enhances the robustness of defect target detection at different scales and further improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flow chart of a defect target detection method for substation equipment based on generating multi-scale features of images.

[0038] Figure 2 It is a structural schematic diagram of a defect target detection model for substation equipment based on generating multi-scale features of images.

[0039] Figure 3 It is a schematic diagram of the structure of the C3+ module.

[0040] Figure 4 It is a schematic diagram of the structure of the Swin module; (a) Swin module, (b) Swin TransformerBlock).

[0041] Figure 5 It is a schematic diagram of the structure of the SA conv module.

[0042] Figure 6 It is a structural diagram of the CA attention mechanism.

[0043] Figure 7 The result of histogram equalization of the original image is shown in Figure 1. Figure I (b) original Figure I Histogram equalization; (c) original Figure II ; (d) original Figure II Histogram equalization.

[0044] Figure 8-Figure 17 It is a test result diagram of the model provided by the present invention. DETAILED DESCRIPTION

[0045] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is clearly and completely described below in conjunction with specific embodiments.

[0046] The embodiment of the present invention provides a method for detecting defective targets of substation equipment based on generating multi-scale features of images, such as Figure 1 As shown, the method includes:

[0047] Step 1: Obtain defect generation images of substation equipment to be inspected for defects;

[0048] The image can be taken manually by a handheld terminal during inspection or by a defect image taken by a drone, and an image data set can be further generated through generation technology, which is not specifically limited in the implementation of the present invention.

[0049] Step 2: construct and train a defect target detection model for substation equipment based on the multi-scale features of the generated image to obtain a trained defect target detection model for substation equipment; Figure 2As shown, the network based on the improved YOLOv7 includes an input, a backbone network, and a neck and head structure, wherein in the backbone network of the YOLOv7 network, a C3+ module is added after the 1st to 3rd CBS modules and after the three MP-1 modules; in the neck and head structure of the YOLOv7 network, a SimAM module is added after the SPPCSPC module in the top-down feature extraction path and the two ELAN-W modules.

[0050] The following describes the C3+ module and the SimAM module respectively.

[0051] 1. C3+ module

[0052] Among them, the structure of the C3+ module is as follows Figure 3 As shown, in the C3+ module, the input features are extracted by the upper branch and the lower branch respectively, and the features extracted by the two branches are fused and then output after passing through the SA conv module and the CA attention mechanism in sequence.

[0053] like Figure 3 As shown in the figure, on the upper branch, the input features are first extracted through a convolution operation (1×1); then, the extracted features are halved and separated along the channel dimension, one part is output through the remaining branch, and the other part passes through two bottleneck units; the outputs of the two parts are concatenated along the channel dimension, and feature information is extracted again through a convolution operation (1×1).

[0054] Among them, Figure 3 As shown in the figure, each bottleneck unit has a residual branch, which includes a CBS module and a SimAM module. The extracted features are first extracted through a convolution operation (3×3) along the main path, and then enhanced through the SimAM module to focus on feature details. Finally, the main path and the residual branch are merged by addition to keep the size of the feature information between the input and output unchanged.

[0055] In the lower branch, the input features are first extracted through convolution operations; then, the extracted features are halved along the channel dimension, one part is output after convolution operations (3×3) and Swin modules, and the other part is output through two bottleneck units (consistent with the bottleneck units in the upper branch structure); finally, the outputs of the two parts are concatenated along the channel dimension and feature information is extracted again through convolution operations. By halving the extracted features along the channel dimension, the C3+ module can effectively capture local and cross-window information in the image, thereby enhancing sensitivity to detailed information through interactive processing.

[0056] The structure of the Swin module is as follows Figure 4 As shown, the following process is executed in the Swin module:

[0057] The features are input into the patch partition for block division, and then linearly transformed by Liner Embedding before being input into the subsequent Swin Transformer Block. Two Swin Transformer Blocks are set, and the two Swin Transformer Blocks are connected in series to construct feature maps of different sizes.

[0058] like Figure 4 As shown in (a), the Swin module uses a patch procedure to split the input feature map into different fixed-size and non-overlapping blocks, so that each block can be processed separately. This segmentation helps to capture detailed local features more effectively and improves the computational efficiency of the model. Then, Patch Partition and Liner Embedding convert the input feature information into a low-dimensional feature space, reduce the feature dimension, and obtain a more concise feature representation; then the processed feature information is input into the Swin Transformer Block in a structured manner. This arrangement is conducive to information conversion and interactive operations, leading to feature extraction and integration.

[0059] The Swin Transformer Block uses a sliding window mechanism to allow the model to access cross-window information. This mechanism promotes interaction between different windows, enabling the model to capture local and global contextual information in the image. By facilitating cross-window information exchange, the model enhances its overall expressiveness and performance.

[0060] The Swin Transformer Block contains two window-based multi-head self-attention modules (WMSA), such as Figure 4 (B) shows that WMSA uses a standard window setting to process the features of each local window independently. On the other hand, WMSA utilizes a moving window configuration and integrates a transfer operation to facilitate information exchange between different windows, effectively broadening the global receptive field of the model.

[0061] Furthermore, the processed upper main branch feature information is added to the right residual branch feature information, and the SA conv module convolution is used to further enhance the global receptive field of the entire network and ensure the integrity of the information weights; by applying the CA attention mechanism to the output feature information, it is possible to more accurately capture important functions, eliminate residual information, and directly provide output to the next layer of the network.

[0062] The structures of SA conv module and CA attention mechanism are as follows: Figure 5 and Figure 6 As shown, Figure 5 As shown in the figure, the SA Conv module includes a switchable Atrous convolution module, a front global context module, a back global context module, and a switching mechanism. This module adjusts the expansion rate and switch value of the Atrous convolution to capture target details at different scales, reduce information weight loss, and enhance the model's ability to process image data. More specifically, this module combines a switching mechanism that dynamically selects and balances the ratio between regular convolution and Atrous convolution. The effective fusion of Atrous convolution and the Switch mechanism defines the SAConv component. The calculation formula for the transition from regular convolution to SAConv component is as follows:

[0063]

[0064] Among them, r is a hyperparameter, △w is a trainable weight, and S(x) is a switching function, which includes an average pooling layer with a 5×5 kernel and a 1×1 convolutional layer. r and △w play an important role in SAConv.

[0065] The structure of the CA attention mechanism is as follows Figure 6 As shown, in the present invention, the CA attention mechanism is integrated into the end of the C3+ module, with the aim of reducing the loss of global position information weights, enhancing the focus of the backbone network during feature extraction, and directly inputting precise feature information into the next layer of the network to avoid retaining unnecessary redundant information.

[0066] The CA attention mechanism consists of two steps: coordinate information embedding and coordinate attention generation. It decomposes channel attention into feature sets in two spatial directions by embedding position information into the feature channel dimension. One direction captures long-distance dependencies, while the other provides precise position information in advance. The two are then complementary and fused to learn the importance weights of different channels, thereby enhancing the focus on complex target features and suppressing redundant or noisy channels.

[0067] In this application, adding a CA attention mechanism after the SAConv module in the C3+ module can reduce the weight of the lost global position information, support the backbone network's focus on the feature extraction process, and directly transfer the precise feature information to the subsequent layers of the network, thereby preventing the storage of excess redundant data.

[0068] The C3+ module provided by the present invention can increase the network depth and receptive field, thereby enhancing the feature extraction capability. Specifically, it is seamlessly integrated into the backbone network of YOLOv7, and uses the SwinTrasformer Block and SA conv modules to achieve seamless interaction of information between windows in the backbone network. It not only retains complex depth details and expands the perception range of the network, but also integrates the CA attention mechanism to promote a deeper exploration of feature information, and can amplify and improve the feature extraction capability of the YOLOv7 backbone network when processing input features.

[0069] 2. SimAM module

[0070] The SimAM module mainly evaluates the significance of individual neurons by optimizing the energy function to improve the performance of the neural network. By adding the SimAM module, the attention distribution weights are dynamically adjusted to shape the focus of the network. A key advantage of this module is that it is able to achieve these improvements without introducing additional parameters, effectively using its minimal set of parameters to estimate the feature map of the three-dimensional attention weight distribution.

[0071] In view of the simplicity, parameter-free and strong adaptability of the SimAM attention module, the present invention integrates the SimAM module into the neck and head structure (specifically the neck structure) of the improved YOLOv7, which helps to improve the learning ability of the neck network in the improved YOLOv7. In addition, the algorithm can also automatically learn and dynamically adjust the distribution ratio of attention according to different input scenarios such as complex features of the target, tiny features on the scale of distant targets, and oversized features on the scale of nearby targets. This will guide the neck to pay more attention to the detailed features of the defects of the substation equipment and filter out irrelevant information, thereby improving the accuracy of the neck network feature fusion and the overall detection accuracy of the model.

[0072] 3. In the present invention, the network based on the improved YOLOv7 also replaces the coordinate loss function in the YOLOv7 network from the original CIoU loss function to the NWD-CIoU loss function.

[0073] The loss function of the YOLOv7 network consists of coordinate loss, target confidence loss, and classification loss. The coordinate loss function uses the CIoU loss function. The CIoU loss function is very sensitive to the position deviation of small objects, so it will reduce the detection performance of the network model.

[0074] Considering that the images acquired by the substation are multi-scale, the improved YOLOv7 of this embodiment replaces the CIoU loss function with the NWD-CIoU loss function. The NWD loss function is suitable for small scales, and the CIoU loss function is suitable for regular sizes.

[0075] The calculation formula of NWD-CIoU loss function is: L NWD-CIoU =λ·L CIoU +(1-λ)L NWD ; Among them, λ is the fusion weight.

[0076] The L CLoU The following formula is used to obtain:

[0077]

[0078]

[0079]

[0080]

[0081] Among them, B pre represents the bounding box of the prediction; B gt represents the ground truth; v is a parameter used to evaluate the aspect ratio consistency between width and height; w gt represents the width of the ground truth bounding box; h gt represents the height of the ground truth bounding box; w pre Indicates the width of the prediction bounding box; h pre Indicates the height of the prediction bounding box;

[0082] The L NWD The way to obtain is as follows:

[0083] We first model bounding boxes as 2D Gaussian distributions and then propose a new metric called Normalized Gaussian Wasserstein Distance (NWD) to calculate the similarity between them via their corresponding Gaussian distributions.

[0084] In order to better describe the weights of different pixels in the bounding box, the bounding box is modeled as a two-dimensional Gaussian distribution, where the central pixel of the bounding box has the highest weight, and the importance of the pixel decreases from the center to the boundary. For a horizontal bounding box R = (cx, cy, w, h), where (cx, cy) represents the center coordinates (cx is the center horizontal coordinate, cy is the center vertical coordinate), w is the width, and h is the height, it can be modeled as a two-dimensional Gaussian distribution N (μ, ∑), where:

[0085]

[0086] In addition, based on the similarity between bounding boxes, bounding box 1 and bounding box 2 can be converted into the distribution distance between two Gaussian distributions. Use Wasserstein distance to calculate the distribution distance. For two two-dimensional Gaussian distributions μ1 = N (m1, ∑1) and μ2 = N (m2, ∑2), the second-order Wasserstein distance between them is:

[0087]

[0088] Wherein, μ1 represents two-dimensional Gaussian distribution 1, μ2 represents two-dimensional Gaussian distribution B, N represents two-dimensional Gaussian distribution function, m1 represents the mean vector of two-dimensional Gaussian distribution 1, m2 represents the mean vector of two-dimensional Gaussian distribution 2, ∑1 represents the covariance matrix of two-dimensional Gaussian distribution 1, and ∑2 represents the covariance matrix of two-dimensional Gaussian distribution 2. W2 2 (μ1,μ2) represents the second-order Wasserstein distance between bounding box 1 and bounding box 2, and ||·|| represents the Frobenius norm.

[0089] In addition, the bounding box g = (cx g ,cy g ,w g ,h g )’s two-dimensional Gaussian distribution and bounding box t=(cx t ,cy t ,w t ,h t ), the second-order Wasserstein distance between them is further simplified to:

[0090]

[0091] Among them, cx g is the horizontal coordinate of the center of the bounding box g, cy g is the center ordinate of the bounding box g, w g is the width of the bounding box g, h g is the height of the bounding box g; cx t is the central horizontal coordinate of the bounding box t, cy t is the center ordinate of the bounding box t, w t is the width of the bounding box t, h t is the height of the bounding box t, T represents transposition, W2 2 (N g ,N t ) is the second-order Wasserstein distance between bounding box g and bounding box t, which cannot be directly used as a similarity measure (i.e., a value between 0 and 1 as IoU). Therefore, we normalize it using its exponential form and obtain what is called the Normalized Gaussian Wasserstein Distance (NWD):

[0092]

[0093] In the formula, NWD(N g ,N t ) represents the normalized Gaussian Wasserstein distance between the bounding box g and the bounding box t, C is a normalization constant, and the average value of the second-order Wasserstein distance or a given second-order Wasserstein distance value can be used.

[0094] NWD loss function L NWD Using the formula L NWD =1-NWD(N g ,N t )get.

[0095] The following is an explanation of the generation process of the trained substation equipment defect target detection model.

[0096] In one possible implementation, it is generated as follows:

[0097] Construct a data set, obtain multiple images of substation equipment with defects (i.e., defect images), and mark the defect location and defect type on each image to construct a training set;

[0098] In a possible implementation, the defect types include: insulator damage, oil stains on the equipment surface, oil stains on the ground, metal corrosion and instrument damage; of course, it may also include other defect types, which are not specifically limited in the embodiment of the present invention.

[0099] In this step, after collecting multiple images of substation equipment with defects, a method of automatically generating data based on image defects is used to further increase the number of images to realize the training data process. The data generation method includes but is not limited to a means. Exemplarily, the image generation technology ADD-GAN, as well as scale transformation, rotation transformation and brightness adjustment processing can be used.

[0100] Among them, during the brightness adjustment process, in the case where the collected image contains relatively low brightness areas (this reduces the image quality and hinders the effectiveness of the target detection method based on image features), histogram equalization is used to enhance the dark areas in the image. By using this method, the brightness distribution in the histogram can be improved, allowing the local contrast to be enhanced while maintaining the overall contrast of the image (such as Figure 7 shown).

[0101] The details are as follows: Let p r (w) represents the probability density function of the original image grayscale r, and the transformation function of histogram equalization is as follows:

[0102]

[0103] Where T(r) is the cumulative distribution of r. As r increases, the value of s increases monotonically, with a maximum value of 1. For any image with L gray levels and N pixels, the pixel corresponding to the jth gray level r j The number of pixels is n j ; The histogram equalization mapping function at this time is:

[0104]

[0105] After obtaining the defect generation image of the substation equipment, the present invention uses the constructed defect image generation tool to generate samples: Combined with the equipment defect dataset in production, defect image samples with diversity and realism are generated to ensure that the generated image samples are realistic and highly similar to the real defect images. These samples cover various defect types and degrees of variation, increasing the diversity of the dataset and the generalization ability of the model. The generated defect images are mixed with the real equipment images to form a new dataset. Ensure that the mixed dataset contains sufficient defect samples and maintains a balance between normal samples and defect samples.

[0106] Furthermore, the present invention collected the above five defects by monitoring, on-site collection, etc., and obtained 165 equipment surface oil images, 186 ground oil images, 204 metal corrosion images, 220 insulator damage images, and 254 instrument damage images. Obviously, the number of images we prepared to describe various defects is unbalanced. In addition, this number is far from meeting the requirements of the training set capacity of the target detection model based on deep learning. Therefore, the image generation technology is used to expand the number of images of each type of defect to 1000.

[0107] After the model is built, the training set is input into the improved YOLOv7 network for training, and the model is adjusted and optimized to obtain the trained substation equipment defect target detection model.

[0108] The present invention evaluates the performance of the substation equipment defect training model and the SD model by checking the detection capabilities of 5 types tested on the IW4210-8G server. Table 1 provides the detailed specifications.

[0109] The initialization of the improved YOLOv7 model includes the parameters listed in Table 2. To ensure the best performance, the input image resolution is set to 640×640 and a batch size of 8 is used during training. Key parameters such as momentum, initial learning rate, and decay are inherited from the original YOLOv7 model as their effectiveness has been proven. To gain a deeper understanding of the training process, the proposed model is updated 3000 times and the learning rate is dynamically adjusted during training to improve model performance and convergence. By adhering to these training protocols and parameter configurations, the improved YOLOv7 model is effectively trained and evaluated for its effectiveness in detecting defects in the specified substation equipment.

[0110] Table 1 Configuration of IW4210-8G server

[0111]

[0112]

[0113] Table 2 Initialization parameters

[0114] Input image resolution 640×640 Batch size 8 Optimizer Adam momentum 0.999 Initial learning rate 0.01 attenuation 0.0005 Update times 3000

[0115] The present invention uses the 5000 images obtained above to train the improved YOLOv7 multi-scale substation equipment defect target detection model to obtain a trained substation equipment defect target detection model, and uses a test set composed of new defect images collected on-site at the substation to verify it. Some of the results obtained are as follows: Figure 8-Figure 17 As shown in the figure, Ins_dam represents insulator damage, sur_oil represents oil stains on the equipment surface, gnd_oil represents oil stains on the ground, corr represents metal corrosion, and met_bre represents instrument damage), it is obvious that the model can accurately detect the defects and locations of substation equipment.

[0116] In addition, the present invention also analyzes in detail the performance indicators of the trained substation equipment defect target detection model, as shown in Table 3. It can be seen from Table 3 that the detection results of the model on the above-mentioned 5 substation equipment defect testers have an mAP@.5 value of 90.3% and an FI score value of 81.1%, which shows accurate detection of substation equipment defects.

[0117] Table 3 Detection and evaluation parameters of different types of defects

[0118]

[0119]

[0120] Step three: input the substation equipment image into the trained substation equipment defect target detection model to predict the defect area and defect type in the substation equipment image.

[0121] By inputting the substation equipment image to be inspected for defects into the trained substation equipment defect target detection model, the defect location and defect type can be predicted.

Claims

1. A defect target detection method for substation equipment based on generating multi-scale features of images, characterized in that: The method comprises: Obtain defect generation images of substation equipment to be inspected for defects; A multi-scale substation equipment defect target detection model based on improved YOLOv7 is constructed and trained to obtain a trained substation equipment defect target detection model; the network based on improved YOLOv7 includes an input, a backbone network, and a neck and head structure, wherein in the backbone network of the YOLOv7 network, a C3+ module is added after the first to third CBS modules and after the three MP-1 modules; in the neck and head structure of the YOLOv7 network, a SimAM module is added after the SPPCSPC module in the top-down feature extraction path and the two ELAN-W modules; The substation equipment image is input into the trained substation equipment defect target detection model to predict the defect area and defect type in the substation equipment image.

2. According to claim 1, a method for detecting defective targets of substation equipment based on generating multi-scale features of images, characterized in that: In the C3+ module, the input features are extracted by the upper branch and the lower branch respectively, and the features extracted by the two branches are fused and outputted after passing through the SAconv module and the CA attention mechanism in sequence.

3. According to claim 2, a method for detecting defective targets of substation equipment based on generating multi-scale features of images is characterized in that: On the upper branch, the input features are first extracted through a convolution operation. After that, the extracted features are halved and separated along the channel dimension, with one part being output through the remaining branch and the other part passing through two bottleneck units. The outputs of the two parts are concatenated along the channel dimension, and feature information is extracted again through a convolution operation.

4. According to claim 2, a method for detecting defective targets of substation equipment based on generating multi-scale features of images, characterized in that: On the lower branch, the input features are first extracted through convolution operations. After that, the extracted features are halved and separated along the channel dimension, one part is output after passing through convolution operations and Swin modules, and the other part passes through two bottleneck units. The outputs of the two parts are concatenated along the channel dimension, and feature information is extracted again through convolution operations.

5. According to claim 4, a method for detecting defective targets of substation equipment based on generating multi-scale features of images is characterized in that: The following process is performed in the Swin module: The features are input into the patch partition for block division, and then linearly transformed by Liner Embedding before being input into the subsequent Swin Transformer Block. Two Swin Transformer Blocks are set and connected in series.

6. The method for detecting defective targets of substation equipment based on generating multi-scale features of images according to claim 5 is characterized in that: The Swin Transformer module is improved based on SwinTranformerBlocks, which only retains the window multi-head self-attention structure, changes the Layernorm operation to Normalization, and also changes the MLP module to a WMSA module.

7. The method for detecting defective targets of substation equipment based on generating multi-scale features of images according to claim 1 is characterized in that: The improved YOLOv7-based network also replaces the coordinate loss function in the YOLOv7 network from the original CIoU loss function to the NWD-CIoU loss function, and the NWD-CIoU loss function is a fusion of the CIoU loss function and the NWD loss function.

8. The method for detecting defective targets of substation equipment based on generating multi-scale features of images according to claim 7 is characterized in that: The calculation formula of the NWD-CIoU loss function is: NWD-CIoU =λ·L CIoU +(1-λ)L NWD ; Among them, λ is the fusion weight.

9. The method for detecting defective targets of substation equipment based on generating multi-scale features of images according to claim 8, characterized in that: The L CLoU The following formula is used to obtain: Among them, B pre represents the bounding box of the prediction; B gt represents the ground truth; v is a parameter used to evaluate the aspect ratio consistency between width and height; w gt represents the width of the ground truth bounding box; h gt represents the height of the ground truth bounding box; w pre Indicates the width of the prediction bounding box; h pre Indicates the height of the prediction bounding box; α determines the balance between the aspect ratio of the predicted bounding box and the ground truth bounding box; d represents the Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth; c represents the diagonal length of the minimum enclosing rectangle that contains the predicted bounding box and the ground truth.

10. The method for detecting defective targets of substation equipment based on generating multi-scale features of images according to claim 8, characterized in that: The L NWD The way to obtain is as follows: For small objects, the bounding box is modeled as a two-dimensional Gaussian distribution, and the second-order Wasserstein distance between bounding boxes is: Among them, W2 2 (N g ,N t ) is the second-order Wasserstein distance between bounding box g and bounding box t, cx g is the horizontal coordinate of the center of the bounding box g, cy g is the center ordinate of the bounding box g, w g is the width of the bounding box g, h g is the height of the bounding box g; cx t is the central horizontal coordinate of the bounding box t, cy t is the center ordinate of the bounding box t, w t is the width of the bounding box t, h t is the height of the bounding box t, T represents transposition; The second-order Wasserstein distance is normalized using the following formula and is called the normalized Gaussian Wasserstein distance: In the formula, NWD(N g ,N t ) represents the normalized Gaussian Wasserstein distance between the bounding box g and the bounding box t, and C is a normalization constant; Using the formula L NWD =1-NWD(N g ,N t ) to obtain the NWD loss function L NWD .

Citation Information

Patent Citations

  • Fan blade defect detection method based on improved YOLOv5

    CN114926400A

  • PCB surface defect detection method based on improved YOLOv5 algorithm

    CN116258707A

  • High-precision textile defect intelligent detection method considering large and small targets

    CN116402769A

  • PCB defect image detection method fusing GAM and SimAM attention mechanisms to improve YOLOv5

    CN117152080A

Cited By

  • Metal surface microdefect detection method and system based on deep learning

    CN120125575A