Small sample insulator infrared image fault detection method, device and medium
By using the improved YOLOv11 and VAE-GAN methods, high-quality synthetic infrared images are generated, and multi-scale feature fusion and attention mechanisms are introduced to solve the problem of scarce small sample data and improve the accuracy and precision of fault detection in insulator infrared images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-14
- Publication Date
- 2026-03-20
AI Technical Summary
Existing insulator infrared image fault diagnosis methods suffer from insufficient model generalization ability due to the scarcity of high-quality fault samples, and have low detection accuracy for small target features such as early fine hot spots.
An improved method for fault detection of insulators using small-sample infrared images based on YOLOv11 and VAE-GAN is proposed. A high-quality synthetic infrared image training set is generated using the VAE-GAN model, and BMFPN and SimAM attention mechanisms are introduced into the improved YOLOv11 model to enhance target discrimination and context awareness.
It significantly improves the accuracy and precision of insulator fault detection under small sample conditions, especially the accuracy and precision of small target fault detection, and realizes the accurate location and identification of faults in infrared images of insulators in real-world scenarios.
Smart Images

Figure CN121708025A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of insulator fault diagnosis technology, and more specifically to an insulator infrared image fault diagnosis method. Background Technology
[0002] Insulators are core components in power transmission and distribution lines, providing electrical insulation and mechanical support. Their operational status directly affects the stability and safety of the power grid. Traditional fault diagnosis relies mainly on manual inspections, which suffers from low efficiency, high subjectivity, and difficulty in detecting early thermal faults. Although infrared thermal imaging technology can detect faults by identifying temperature anomalies, existing automated methods based on deep learning are still limited by two major bottlenecks: first, the scarcity of high-quality fault samples leads to insufficient model generalization ability; second, the detection accuracy of small target features such as early, subtle hot spots still needs improvement. These limitations severely restrict the accuracy of insulator fault diagnosis and its engineering application value. Summary of the Invention
[0003] The small-sample insulator infrared image fault detection method proposed in this invention is specifically a small-sample insulator infrared image fault detection method based on improved YOLOv11 and VAE-GAN, which can at least solve one of the technical problems in the background art.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: An infrared image fault diagnosis method for insulators involves performing the following steps using computer equipment. Data preprocessing: First, the original infrared images of the training set, which account for 80% of the entire dataset, are loaded from the dataset, and their YOLO format label information is explicitly not loaded. Then, the pixel values of these images are normalized from the original range of [0, 255] to the interval of [-1, 1] to adapt to the output characteristics of the model activation function and significantly improve the stability of the training process. Finally, the normalized image data is directly used as the training input for the improved VAE-GAN model.
[0005] Variational Autoencoders (VAEs): A VAE consists of two networks that encode a data sample x into a latent variable z and decode that latent representation back into the data space.
[0006] This refers to the encoder, which receives input data. and output latent variables. The distribution parameters; Given input Latent variables The posterior distribution of; This indicates data reconstruction, where the input is from the encoding stage. Sampling hour, It is the original input Reconstruction; The decoder represents the latent variables sampled from the posterior distribution. and output reconstructed data. The distribution parameters, Given latent variables Data Conditional distribution; Variational autoencoders, through latent distribution The encoder is regularized by applying a prior distribution; its loss function consists of the sum of the expected log-likelihood term and the prior regularization term.
[0007]
[0008]
[0009] in This represents the overall loss function that the VAE needs to minimize; Represents the posterior distribution of the encoder output. Find the expected value; The decoder defines the generation distribution, which represents the distribution of the latent variables. Time-based data reconstruction The probability of; Representing the potential space The prior distribution is usually set as the standard normal distribution. ; This represents the reconstruction loss or negative log-likelihood loss; This represents the regularization loss or prior matching loss. It is the Kullback-Leibler divergence, used to measure the difference between two probability distributions.
[0010] Furthermore, the steps of generating adversarial networks include, The generator network Gen(z) maps the latent variable z to the data space, while the discriminator network determines the probability that the input data x belongs to the real training sample by outputting the probability value y=Dis(x)∈[0,1]. (The opposite 1-y indicates that x is generated by the latent variable z through x=Gen(z). (The probability of generation). The core goal of GANs is to find a binary classifier that can optimally distinguish between real and generated data, while simultaneously prompting the generator (Gen) to fit the real data distribution as closely as possible. Therefore, we aim to achieve this goal by optimizing the following binary cross-entropy function:
[0011] in, This represents the overall adversarial loss of the generative adversarial network. This indicates that the discriminator analyzes samples from the real data distribution. The discriminant output, That is, the discriminator believes It is the probability of a real sample, which is the discriminator's output of the generated sample, that is, the probability that the discriminator considers the generated sample to be a real sample.
[0012] Furthermore, the generative model also includes a reconstruction error calculation step based on VAE / GAN. To address the limitation of element-level reconstruction errors in representing invariant features of images, an improvement to the reconstruction error term in the VAE objective function is proposed. Feature representations from a GAN discriminator are used to construct the reconstruction error. To this end, let… Indicates the discriminator's first... The hidden layer feature representation of the layer introduces a mean distribution. The feature space is modeled using a Gaussian observation model with unit covariance:
[0013] This represents a conditional probability distribution; specifically, it means that given the latent variables obtained from the encoder... Under the conditions, generate samples A feature layer activated in the discriminator network The probability distribution that should be followed; this definition links the latent encoding with the high-level semantic features of the generated samples; Represents the identity matrix; in This is a sample from the decoder of x:
[0014] This formula defines the reconstruction loss function based on the discriminator feature space in the VAE-GAN framework. Indicates the discriminator's first... The reconstruction loss of layer features is an improvement on the traditional element-level reconstruction loss of VAE. Combined models trained with triple criteria:
[0015] This represents the total loss function that needs to be minimized during model training; It is worth noting that in the loss function Under the influence of this, the VAE is optimized. In addition, since both the decoder (Dec) and the generator (Gen) implement the mapping from the latent variable z to the data x, and they share network parameters, the loss function in the formula is used to limit the error signal to the relevant network.
[0016] Weighted VAEs and GANs: When DEC from and When an erroneous signal is received, the parameter γ is used to balance reconstruction capability with the ability to fool the discriminator, instead of applying γ to the entire model; the weighting is only applied when updating the DEC parameters.
[0017] This represents the parameter vector of the decoder. The update will be based on the gradient calculated on the right; where It is a hyperparameter that balances the weights of two terms, which drives the samples generated by the decoder in the discriminator's... The layer feature space closely resembles the real sample; Indicates the decoder parameters Find the gradient; Based on the differentiation of samples from p(z) and q(z|x), it was observed that in the GAN target, in addition to using the previous p(z), samples from q(z|x) (i.e. encoder Enc) are also used.
[0018] Furthermore, an improved YOLOv11 model is used for feature extraction and target detection of insulator infrared images. This method, building upon the efficient single-stage detection framework of YOLOv11, significantly enhances the model's ability to detect insulator faults in complex backgrounds by introducing multi-scale feature fusion and an adaptive attention mechanism. The method includes the following steps: The improved YOLOv11 model first introduces BMFPN into the connection layer of the original model's neck network. This enhances target discrimination and context awareness by dynamically optimizing multi-scale feature processing. Secondly, by fusing the SimAM attention mechanism with the original model's C3K2 module, the model can focus on key features of the target region while strengthening its ability to suppress background interference.
[0019] S21: The core function of BMFPN is to efficiently fuse multi-scale features. It processes only feature maps of the same scale with dual input paths, fusing backbone network features with path aggregation network features without introducing additional parameters. BMFPN implements a fast normalization method to improve feature fusion performance. A unique weight is assigned to each channel. Its definition is as follows:
[0020] Here, K represents the fused feature map. Indicates the first Feature maps of each input node Indicates the relationship with the first Input feature maps Associated learnable weights, The cumulative weights of the input nodes are represented; these weights are learnable. Finally, each bidirectional path is treated as a unit and reused multiple times to improve the fusion. For the i-th layer, the two fusion feature formulas of the Bidirectional Multi-Scale Feature Pyramid Network (BMFPN) are as follows:
[0021]
[0022] Indicates the first The intermediate feature map obtained after the layer is fused through a top-down path; Indicates the first The input feature map of the layer; Corresponding to two input feature maps respectively and Learnable weights are used to dynamically adjust their contribution to the fusion result; Indicates the first The final feature map output by the layer; Indicates the first The final output feature map of the layer; , , Corresponding to three inputs respectively , , Learnable weights; It is a very small positive number used to ensure that the denominator is not zero and to maintain numerical stability; () is a convolutional layer used to transform and integrate the fused weighted features.
[0023] SimAM assigns three-dimensional weights to each neuron in a feature map using a parameter-free attention mechanism based on an energy function. Inspired by spatial inhibition in neuroscience, this module quantifies the saliency of a neuron by calculating its linear separability from its environment—lower energy indicates greater importance. This approach can finely tune feature responses in both spatial and channel dimensions, enhancing the network's ability to capture key information without increasing model parameters, achieving efficient and lightweight performance improvements.
[0024] The core function of the SMC3K2 module is to adaptively enhance key features of insulator infrared images by introducing a parameter-free SimAM attention mechanism, while maintaining the efficient feature fusion capabilities of the C3K2 module. This module enables the model to accurately focus on the target region under complex background interference, effectively suppressing interference from similar features, thereby significantly improving detection accuracy and feature discrimination ability.
[0025] The SMC3K2 module employs an energy function to measure the linear separability between neurons, thereby identifying important neurons. The energy function is defined as follows:
[0026] in Represents the target neuron; This represents the energy function; the lower the value, the stronger the characteristic value representing the target neuron. The stronger the linear separability from surrounding neurons; This indicates that, excluding the target neuron, the first neuron in the same channel... The feature values of the other neurons; It is an index in the spatial dimension; is the regularization coefficient, used to prevent the denominator from being too small and to maintain numerical stability; M is the number of neurons; and These are the weights and bias parameters of the linear transformation, respectively; Refers to the target neuron The label information. This is achieved by solving the variables. and Substituting the closed-form solution into the above equation, we obtain the minimum energy expression as follows:
[0027] This represents the mean value of all neurons in the same feature channel, excluding the target neuron. It represents the variance of all neurons in the same feature channel, excluding the target neuron.
[0028] The expression in the above formula indicates that a smaller energy value corresponds to a larger linear separability between neuron t and other neurons, which represents higher importance. According to the definition of the attention mechanism, the SMC3K2 module can be represented as follows:
[0029] Where E is the classification function for all energy functions e∈t in the channel and spatial dimensions; Indicates the input feature map; This represents the output feature map after enhancement by the SMC3K2 module; the sigmoid function ensures that the larger values in E are constrained, thus not affecting the relative importance of each neuron.
[0030] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0031] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0032] In summary, the fault diagnosis method for insulator infrared images of the present invention aims to solve the technical problem of low detection accuracy and poor generalization ability of deep learning models due to the small number of labeled infrared fault samples in existing methods. To address this, the present invention discloses a small-sample insulator infrared image fault detection method based on improved YOLOv11 and VAE-GAN. The initial dataset is expanded using the VAE-GAN model to generate high-quality synthetic infrared images for constructing a hybrid training set. Finally, the hybrid training set is used to train an improved YOLOv11 target detection model. The improved YOLOv11 target detection model first introduces BMFPN into the connection layer of the original model's neck network, which enhances target discrimination and context awareness through dynamic optimization of multi-scale feature processing. Secondly, by fusing the SimAM attention mechanism with the original model's C3K2 module, the model can focus on key features of the target region and use the trained model to automatically locate and identify faults in insulator infrared images in real-world scenarios. This invention effectively addresses the data scarcity problem under small sample conditions through an improved generative model, significantly enhancing the detection accuracy of the YOLOv11 model for insulator faults, especially small target faults. It achieves precise fault localization and identification in infrared images of insulators in real-world scenarios. This method, through standardized data partitioning and efficient data augmentation, significantly improves the model's detection accuracy, generalization ability, and accuracy for small target faults under small sample conditions. Attached Figure Description
[0033] Figure 1 This is an overall block diagram of an embodiment of the present invention; Figure 2 This is the VAE-GAN model structure according to an embodiment of the present invention; Figure 3 This is an improved YOLOv11 model structure according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the BMFPN according to an embodiment of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0035] This invention specifically discloses an improved method for detecting faults in insulators using small-sample infrared images with YOLOv11 and VAE-GAN. The method includes: first, constructing an initial dataset of small-sample insulator infrared images; second, expanding the initial dataset using a VAE-GAN model to generate high-quality synthetic infrared images to construct a hybrid training set; and finally, training the improved YOLOv11 target detection model using the hybrid training set. The improved YOLOv11 target detection model first introduces BMFPN into the connection layer of the original model's neck network, which enhances target discrimination and context awareness through dynamic optimization of multi-scale feature processing. Secondly, by fusing the SimAM attention mechanism with the original model's C3K2 module, the model can focus on key features of the target region and automatically locate and identify faults in insulator infrared images in real-world scenarios using the trained model. This invention effectively solves the data scarcity problem under small-sample conditions through an improved generative model, significantly improving the detection accuracy and precision of the YOLOv11 model for insulator faults, especially small-target faults.
[0036] The above steps can be explained as follows: S1. This step is the data preprocessing stage, and its core function is to prepare suitable input data for the subsequent generative model. Through standardized partitioning and normalization, the original insulator infrared image dataset is transformed into a format that meets the requirements of unsupervised training, providing a stable and consistent input foundation for the training of the improved VAE-GAN model in step S2. S2. The core technology of this step lies in addressing the scarcity of small sample data through a structurally improved generative model—a hybrid model combining Variational Autoencoder (VAE) and Generative Adversarial Network (GAN). It directly receives the preprocessed image data output from step S1, trains the model to learn the data distribution, and then generates a large number of high-quality synthetic infrared images. The generated images are merged with the original training set images from S1 to construct a significantly expanded and more diverse hybrid training set. This hybrid training set is the key link between the generation and detection stages and will serve as the training material for the object detection model in step S3. S3. This step is the target detection model training phase. Its core function is to train a structurally improved YOLOv11 model using the hybrid training set output from S2, achieving high-precision insulator fault localization and classification. This model integrates optimization modules such as multi-scale feature fusion and attention mechanisms. Through end-to-end training and validation set tuning, it ultimately outputs a deeply optimized model for insulator fault (especially small target) detection, for use in step S4. S4. This step is the final application stage of the technical solution. Its key technical point lies in deploying the fully trained model in a real-world diagnostic scenario. The infrared image of the insulator in the real-world scenario to be diagnosed is input into the improved YOLOv11 model trained and optimized in step S3. The model automatically performs forward propagation, outputting a structured diagnostic result containing bounding box coordinates, fault category (e.g., normal, low value, damaged, etc.) and corresponding confidence level, thereby completing the automatic and accurate location and identification of the fault. The effectiveness of this step directly verifies the final performance improvement resulting from the combined effects of the preceding steps (data preparation in S1, data augmentation in S2, and model improvement in S3).
[0037] The following is a detailed explanation: Data preprocessing: First, the original infrared images of the training set, which account for 80% of the entire dataset, are loaded from the dataset, and their YOLO format label information is explicitly not loaded. Then, the pixel values of these images are normalized from the original range of [0, 255] to the interval of [-1, 1] to adapt to the output characteristics of the model activation function and significantly improve the stability of the training process. Finally, the normalized image data is directly used as the training input for the improved VAE-GAN model.
[0038] Variational Autoencoders (VAEs): A VAE consists of two networks that encode a data sample x into a latent representation z and decode that latent representation back into the data space.
[0039] This refers to the encoder, which receives input data. and output latent variables. The distribution parameters; Given input Latent variables The posterior distribution of; This indicates data reconstruction, where the input is from the encoding stage. Sampling hour, It is the original input Reconstruction; The decoder represents the latent variables sampled from the posterior distribution. and output reconstructed data. The distribution parameters, Given latent variables Data The conditional distribution.
[0040] Variational autoencoders, through latent distribution The encoder is regularized by applying a prior distribution; its loss function consists of the sum of the expected log-likelihood term and the prior regularization term.
[0041]
[0042]
[0043] in This represents the overall loss function that the VAE needs to minimize; Represents the posterior distribution of the encoder output. Find the expected value; The decoder defines the generation distribution, which represents the distribution of the latent variables. Time-based data reconstruction The probability of; Representing the potential space The prior distribution is usually set as the standard normal distribution. ; This represents the reconstruction loss or negative log-likelihood loss; This represents the regularization loss or prior matching loss. It is the Kullback-Leibler divergence, used to measure the difference between two probability distributions.
[0044] The steps involved in generating an adversarial network include: The generator network Gen(z) maps the latent variable z to the data space, while the discriminator network determines the probability that the input data x belongs to the real training sample by outputting the probability value y=Dis(x)∈[0,1]. (The opposite 1-y indicates that x is generated by the latent variable z through x=Gen(z). (The probability of generation). The core goal of GANs is to find a binary classifier that can optimally distinguish between real and generated data, while simultaneously prompting the generator (Gen) to fit the real data distribution as closely as possible. Therefore, we aim to achieve this goal by optimizing the following binary cross-entropy function:
[0045] in, This represents the overall adversarial loss of the generative adversarial network. This indicates that the discriminator analyzes samples from the real data distribution. The discriminant output, That is, the discriminator believes It is the probability of a real sample, which is the discriminator's output of the generated sample, that is, the probability that the discriminator considers the generated sample to be a real sample.
[0046] Furthermore, S2 also includes a reconstruction error calculation step based on VAE / GAN. To address the limitation of element-wise reconstruction errors in representing invariant features of images, an improvement is proposed to the reconstruction error term in the VAE objective function. Instead, feature representations from a GAN discriminator are used to construct the reconstruction error. To this end, let... This represents the hidden layer feature representation of the l-th layer of the discriminator. A feature with a mean distribution is introduced. Modeling with a Gaussian observation model of unit covariance Feature spatial distribution:
[0047] This represents a conditional probability distribution, meaning that given the latent variables obtained from the encoder... Under the conditions, generate samples A feature layer activated in the discriminator network The probability distribution that should be followed; this definition links the latent encoding with the high-level semantic features of the generated samples; Represents the identity matrix; in It is a sample from the decoder of x;
[0048] This formula defines the reconstruction loss function based on the discriminator feature space in the VAE-GAN framework. Indicates the discriminator's first... The reconstruction loss of layer features is an improvement on the traditional element-level reconstruction loss of VAE.
[0049] Combined models trained with triple criteria.
[0050]
[0051] This represents the total loss function that needs to be minimized during model training; It is worth noting that in the loss function Under the influence of this, the VAE is optimized. In addition, since both the decoder (Dec) and the generator (Gen) implement the mapping from the latent variable z to the data x, and they share network parameters, the loss function in the formula is used to limit the error signal to the relevant network.
[0052] Weighted VAEs and GANs: When DEC from and When an erroneous signal is received, the parameter γ is used to balance reconstruction capability with the ability to fool the discriminator, instead of applying γ to the entire model; the weighting is only applied when updating the DEC parameters.
[0053] The parameter vector representing the decoder The gradient will be updated based on the gradient calculated on the right. This represents the weighted feature reconstruction loss, where It is a hyperparameter that balances the weights of two terms, which drives the samples generated by the decoder in the discriminator's... The layer feature space closely resembles the real sample; Indicates the decoder parameters Find the gradient.
[0054] Based on the differentiation of samples from p(z) and q(z|x), it was observed that in the GAN target, in addition to using the previous p(z), samples from q(z|x) (i.e. encoder Enc) are also used.
[0055] Furthermore, an improved YOLOv11 model is used to achieve feature extraction and target detection of insulator infrared images, including the following steps: The improved YOLOv11 model first introduces BMFPN into the connection layer of the original model's neck network. This enhances target discrimination and context awareness by dynamically optimizing multi-scale feature processing. Secondly, by fusing the SimAM attention mechanism with the original model's C3K2 module, the model can focus on key features of the target region while strengthening its ability to suppress background interference.
[0056] The core function of BMFPN is to efficiently fuse multi-scale features. It processes only feature maps of the same scale with dual input paths, fusing backbone network features with path aggregation network features without introducing additional parameters. BMFPN implements a fast normalization method to improve feature fusion performance, assigning unique weights to each channel. The definitions are as follows:
[0057] Here, K represents the fused feature map. Indicates the first Feature maps of each input node Indicates the relationship with the first Input feature maps Associated learnable weights, This represents the cumulative weights of the input nodes; these weights are learnable. Finally, each bidirectional path is treated as a unit and reused multiple times to improve the mixture; to maintain numerical stability, the learning rate is set to 0.0001. Finally, each bidirectional (top-bottom and bottom-top) path is treated as a unit and reused multiple times to improve the mixture. Taking the i-th layer as an example, the two fusion feature formulas of BMFPN are as follows:
[0058]
[0059] Indicates the first The intermediate feature map obtained after the layer is fused through a top-down path; Indicates the first The input feature map of the layer; Corresponding to two input feature maps respectively and Learnable weights are used to dynamically adjust their contribution to the fusion result; Indicates the first The final feature map output by the layer; Indicates the first The final output feature map of the layer; , , Corresponding to three inputs respectively , , Learnable weights; It is a positive number used to ensure that the denominator is not zero and to maintain numerical stability; () is a convolutional layer used to transform and integrate the fused weighted features.
[0060] SimAM assigns three-dimensional weights to each neuron in a feature map using a parameter-free attention mechanism based on an energy function. Inspired by spatial inhibition in neuroscience, this module quantifies the saliency of a neuron by calculating its linear separability from its environment—lower energy indicates greater importance. This approach can finely tune feature responses in both spatial and channel dimensions, enhancing the network's ability to capture key information without increasing model parameters, achieving efficient and lightweight performance improvements.
[0061] The core function of the SMC3K2 module is to adaptively enhance key features of insulator infrared images by introducing a parameter-free SimAM attention mechanism, while maintaining the efficient feature fusion capabilities of the C3K2 module. This module enables the model to accurately focus on the target region under complex background interference, effectively suppressing interference from similar features, thereby significantly improving detection accuracy and feature discrimination ability.
[0062] The SMC3K2 module employs an energy function to measure the linear separability between neurons, thereby identifying important neurons. The energy function is defined as follows:
[0063] in Represents the target neuron; : Represents the energy function; the lower the value, the stronger the characteristic value representing the target neuron. The stronger the linear separability from surrounding neurons; It is the regularization coefficient; M is the number of neurons; and These are the weights and bias parameters of the linear transformation, respectively; Refers to the target neuron Tag information; This indicates that, excluding the target neuron, the first neuron in the same channel... The feature values of other neurons, It is an index in the spatial dimension. Then, by solving for the variables... and Substituting the closed-form solution into the above equation, we obtain the minimum energy expression as follows:
[0064] This represents the mean value of all neurons in the same feature channel, excluding the target neuron. It represents the variance of all neurons in the same feature channel, excluding the target neuron. This represents the regularization coefficient, used to prevent the denominator from being too small and to maintain numerical stability.
[0065] The expression in the above formula indicates that a smaller energy value corresponds to a larger linear separability between neuron t and other neurons, which represents higher importance. According to the definition of the attention mechanism, the SMC3K2 module can be represented as follows:
[0066] Where E is the classification function for all energy functions e∈t in the channel and spatial dimensions; Indicates the input feature map; This represents the output feature map after enhancement by the SMC3K2 module; the sigmoid function ensures that the larger values in E are constrained, thus not affecting the relative importance of each neuron.
[0067] The improved model shows significant improvements in detection accuracy and recall compared to the original model.
[0068] The dataset contains 5000 insulator images. Each image is labeled with over 4800 insulator fault instances, covering four insulator types: normal insulators, zero-value insulators, damaged insulators, and polluted insulators. The images have a resolution of 640×640 and are labeled in YOLO format. The experimental dataset was used as the training, testing, and validation sets in an 8:1:1 ratio. Baseline experiments with YOLOv11, experiments with BMFPN replacement, and an improved YOLOv11 dataset that replaces BMFPN and incorporates SMC3K2 were conducted.
[0069] The test was conducted on a Windows operating system using an Intel Ultra 9285k, an NVIDIA GeForce RTX 4070 Ti GPU with 16GB of VRAM, PyTorch framework version 1.9.0, and Python version 3.8.
[0070] The experimental parameters for this study were set as follows: initial learning rate (LearningRate) 0.001, final learning rate (FinalLearningRate) 0.0001, number of iterations (Epoch) 300, training batch size (batchSize) 1, learning rate weight decay 0.05, and learning rate momentum 0.8.
[0071] S21: Experimental evaluation metrics. Detection results generally include four cases: TP (TruePositive), FP (FalsePositive), TN (TrueNegative), and FN (FalseNegative). TP indicates that the model correctly predicted the correct detection target, meaning both the detection result and the actual result are positive. FP indicates that the model incorrectly predicted the wrong detection target, meaning the actual result is negative, but the detection result is positive. TN indicates that the model correctly predicted the wrong detection target, meaning both the detection result and the actual result are negative. Like TP, TN represents that the model's prediction is correct. FN represents that the model incorrectly predicted the correct detection target, meaning the actual result is positive, but the detection result is negative. Similarly, FN and FP are two outcomes where the model predicted incorrectly. The specific steps are as follows: S22: Precision (P), recall (R), harmonic mean (F1 score), and mean average precision (mAP) are used as experimental evaluation metrics.
[0072] Accuracy It is the ratio of true positives to the sum of true positives and false positives, representing the proportion of the target being correctly detected during the detection process. The higher the value, the higher the accuracy of the detection. When the accuracy rate is 100%, it means that all test results are correct. The calculation formula is:
[0073] S23: Recall Rate This is the ratio of true negatives to the sum of true negatives and false negatives. It represents the model's ability to accurately predict the target and eliminate background interference. When When the R-value is 100%, it means that all true positives have been detected. The formula for calculating R is:
[0074] S24: Harmonic Mean Score is based on accuracy. and recall rate The comprehensive parameters can serve as an evaluation index for the model's detection accuracy. The formula for calculating the F1Score is as follows:
[0075] S31: Mean Precision Also based on accuracy and recall rate The comprehensive parameters, the data of which are The area under the Precision-Recall curve and the horizontal and vertical axes can be used as an evaluation metric for the model's detection accuracy. The calculation formula is as follows:
[0076] Average precision mean yes The average value, This indicates the total number of insulator state categories that the model needs to identify, which can further help evaluate the model's detection accuracy. The calculation formula is as follows:
[0077] S32: The improved YOLOv11 model showed good detection performance on the detection task, with an overall detection precision of 98%, recall of 90.0%, F1 score of 88.2%, and mAP of 87.5%.
[0078] The following are examples: Reference Figure 1 A fault detection method for small-sample insulator infrared images based on improved YOLOv11 and VAE-GAN is proposed, including data preprocessing, variational autoencoding, generative adversarial network to expand the number of samples, reconstruction error calculation based on VAE / GAN, and feature extraction and target detection of insulator infrared images using the improved YOLOv11 model.
[0079] The data preprocessing involves first loading the original infrared images from the training set, which constitute 80% of the entire dataset, without loading their YOLO format label information; then, normalizing the pixel values of these images from the original range of [0, 255] to the interval of [-1, 1] to adapt to the output characteristics of the model's activation function and significantly improve the stability of the training process; finally, the normalized image data is directly used as the training input for the improved VAE-GAN model.
[0080] The variational autoencoder is responsible for learning the structured latent representation of the data and providing a stable training foundation and high-quality initial samples for GAN by aligning the latent distributions of real and generated samples, thereby collaboratively generating images that are both semantically correct and visually realistic.
[0081] The reconstruction error calculation based on VAE / GAN is described. A perceptual loss based on high-level semantic features (usually provided by the GAN discriminator) is introduced to replace or assist the traditional element-level MSE loss, thereby guiding the model to generate images that are visually and semantically more realistic and clearer, fundamentally solving the problem of blurry VAE-generated results.
[0082] The improved YOLOv11 model is used for feature extraction and target detection of infrared images of insulators.
[0083] Figure 2 The diagram shows the structure of the VAE-GAN model of this invention, which consists of VAE and GAN structures, and its specific form is as follows: S21: The steps of variational automatic coding include: The VAE consists of two networks that encode a data sample x into a latent representation z and decode that latent representation back into the data space.
[0084] This refers to the encoder, which receives input data. and output latent variables. The distribution parameters; Given input Latent variables The posterior distribution of; This indicates data reconstruction, where the input is from the encoding stage. Sampling hour, It is the original input Reconstruction; The decoder represents the latent variables sampled from the posterior distribution. and output reconstructed data. The distribution parameters, Given latent variables Data The conditional distribution.
[0085] The variational autoencoder passes through a latent distribution The encoder is regularized by applying a prior distribution; its loss function consists of the sum of the expected log-likelihood term and the prior regularization term.
[0086]
[0087]
[0088] in This represents the overall loss function that the VAE needs to minimize; Represents the posterior distribution of the encoder output. Find the expected value; The decoder defines the generation distribution, which represents the distribution of the latent variables. Time-based data reconstruction The probability of; Representing the potential space The prior distribution is usually set as the standard normal distribution. ; This represents the reconstruction loss or negative log-likelihood loss; This represents the regularization loss or prior matching loss. It is the Kullback-Leibler divergence, used to measure the difference between two probability distributions.
[0089] S22: The steps for generating an adversarial network include: Generative Adversarial Networks (GANs) consist of two networks: a generator network Gen(z) maps the latent variable z to the data space, while a discriminator network determines the probability that the input data x belongs to the real training sample by outputting the probability value y=Dis(x)∈[0,1]. (The opposite, 1-y, indicates that x is generated by the latent variable z through x=Gen(z). (The probability of generation). The core goal of GANs is to find a binary classifier that can optimally distinguish between real and generated data, while simultaneously prompting the generator (Gen) to fit the real data distribution as closely as possible. Therefore, we aim to achieve this goal by optimizing the following binary cross-entropy function:
[0090] in, This represents the overall adversarial loss of the generative adversarial network. This indicates that the discriminator analyzes samples from the real data distribution. The discriminant output, That is, the discriminator believes It is the probability of a real sample, which is the discriminator's output of the generated sample, that is, the probability that the discriminator considers the generated sample to be a real sample.
[0091] Figure 3 The improved YOLOv11 model structure takes the following form: S31: The core function of BMFPN is to efficiently fuse multi-scale features. It processes only feature maps of the same scale with dual input paths, fusing backbone network features with path aggregation network features without introducing additional parameters. BMFPN implements a fast normalization method to improve feature fusion performance. A unique weight is assigned to each channel. Its definition is as follows:
[0092] K represents the fused feature map. Indicates the first Feature maps of each input node Indicates the relationship with the first Input feature maps Associated learnable weights, The cumulative weights of the input nodes are represented; these weights are learnable. Finally, each bidirectional path is treated as a unit and reused multiple times to improve the mixture; these weights are also learnable. To maintain numerical stability, the learning rate is set to 0.0001.
[0093] S32: SimAM assigns three-dimensional weights to each neuron in a feature map using a parameter-free attention mechanism based on an energy function. Inspired by spatial inhibition in neuroscience, this module quantifies the saliency of a neuron by calculating its linear separability from its surroundings—lower energy indicates greater importance. This method can finely adjust feature responses in both spatial and channel dimensions, enhancing the network's ability to capture key information without increasing model parameters, achieving efficient and lightweight performance improvements.
[0094] S33: The core function of the SMC3K2 module is to adaptively enhance key features of insulator infrared images by introducing a parameterless SimAM attention mechanism, while maintaining the efficient feature fusion capability of the C3K2 module. This module enables the model to accurately focus on the target region under complex background interference, effectively suppressing interference from similar features, thereby significantly improving detection accuracy and feature discrimination ability.
[0095] The SMC3K2 module employs an energy function to measure the linear separability between neurons, thereby identifying important neurons. The energy function is defined as follows:
[0096] in Represents the target neuron; : Represents the energy function; the lower the value, the stronger the characteristic value representing the target neuron. The stronger the linear separability from surrounding neurons; It is the regularization coefficient; M is the number of neurons; and These are the weights and bias parameters of the linear transformation, respectively; Refers to the target neuron Tag information; This indicates that, excluding the target neuron, the first neuron in the same channel... The feature values of other neurons, It is an index in the spatial dimension.
[0097] Subsequently, by solving the variables and Substituting the closed-form solution into the above equation, we obtain the minimum energy expression as follows:
[0098] This represents the mean value of all neurons in the same feature channel, excluding the target neuron. It represents the variance of all neurons in the same feature channel, excluding the target neuron. This represents the regularization coefficient, used to prevent the denominator from being too small and to maintain numerical stability.
[0099] The expression in the above formula indicates that a smaller energy value corresponds to a larger linear separability between neuron t and other neurons, which represents higher importance. According to the definition of the attention mechanism, the SMC3K2 module can be represented as follows:
[0100] Where E is the classification function for all energy functions e∈t in the channel and spatial dimensions; Indicates the input feature map; This represents the output feature map after enhancement by the SMC3K2 module; the sigmoid function ensures that the larger values in E are constrained, thus not affecting the relative importance of each neuron.
[0101] Figure 4 The schematic diagram of the BMFPN of this invention is as follows: S41: The core function of BMFPN is to efficiently fuse multi-scale features. It processes only feature maps of the same scale with dual input paths, fusing backbone network features with path aggregation network features without introducing additional parameters. BMFPN implements a fast normalization method to improve feature fusion performance. A unique weight is assigned to each channel. Its definition is as follows:
[0102] Here, K represents the fused feature map. Indicates the first Feature maps of each input node Indicates the relationship with the first Input feature maps Associated learnable weights, The cumulative weights of the input nodes are represented; these weights are learnable. Finally, each bidirectional path is treated as a unit and reused multiple times to improve the fusion. For the i-th layer, the two fusion feature formulas of the Bidirectional Multi-Scale Feature Pyramid Network (BMFPN) are as follows:
[0103]
[0104] Indicates the first The intermediate feature map obtained after the layer is fused through a top-down path; Indicates the first The input feature map of the layer; Corresponding to two input feature maps respectively and Learnable weights are used to dynamically adjust their contribution to the fusion result; Indicates the first The final feature map output by the layer; Indicates the first The final output feature map of the layer; , , Corresponding to three inputs respectively , , Learnable weights; It is a positive number used to ensure that the denominator is not zero and to maintain numerical stability; () is a convolutional layer used to transform and integrate the fused weighted features.
[0105] In summary, this invention effectively addresses the data scarcity problem under small sample conditions through an improved generative model, significantly enhancing the detection accuracy and robustness of the YOLOv11 model for insulator faults, especially small target faults. It achieves accurate fault localization and identification in infrared images of insulators in real-world scenarios. This method, through standardized data partitioning and efficient data augmentation, significantly improves the model's detection accuracy, generalization ability, and robustness to small target faults under small sample conditions.
[0106] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0107] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0108] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the transformer mechanical fault diagnosis methods described above.
[0109] It is understood that the system provided in the embodiments of the present invention corresponds to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0110] This application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, communication interface, and memory communicate with each other via the communication bus. Memory, used to store computer programs; The processor, when executing the program stored in the memory, implements the above-mentioned method for diagnosing mechanical faults in transformers.
[0111] The communication bus mentioned in the aforementioned electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.
[0112] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0113] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0114] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0115] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0116] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0117] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0118] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting faults in small-sample insulators using infrared images, characterized in that, The method includes the following steps: S1. Convert the original insulator infrared image dataset into a format that meets the requirements of unsupervised training, and output the preprocessed image data. S2. Set up a generative model, which is a hybrid model combining variational autoencoder and generative adversarial network, to receive the preprocessed image data output from S1, learn the data distribution through model training, and generate synthetic infrared images; the generated infrared images will be merged with the original insulator infrared image dataset in S1 to construct a hybrid training set. S3. Using the mixed training set output by S2, train a structurally improved YOLOv11 model to achieve insulator fault location and classification. S4. Input the infrared image of the insulator in the real scene to be diagnosed into the improved YOLOv11 model trained and optimized in S3; the model automatically performs forward propagation and outputs a structured diagnostic result containing bounding box coordinates, fault category and corresponding confidence level, thereby completing the automatic and accurate location and identification of the fault.
2. The method for detecting small-sample insulator infrared image faults according to claim 1, characterized in that: S1 specifically includes: First, the original infrared images of the training set, which account for 80% of the entire dataset, are loaded, and YOLO format label information is explicitly not loaded. Then, the pixel values of the images are normalized from the original range of [0, 255] to the interval of [-1, 1] to adapt to the output characteristics of the model activation function and improve training stability. Finally, the normalized image data is used as the training input for the improved generative model.
3. The method for detecting small-sample insulator infrared image faults according to claim 1, characterized in that: The generative model includes a variational autoencoder, which consists of an encoding network and a decoding network, used to process data samples, respectively. Encode the data into a latent variable z, and decode the latent variable z back into the data space: Indicates encoder, Given input data Latent variables The posterior distribution of; This indicates data reconstruction, where the input is from the encoding stage. Sampling hour, It is the original input The reconstructed data formed by the reconstruction; The decoder represents the latent variables sampled from the posterior distribution. It outputs the distribution parameters of the reconstructed data. Given latent variables The following is a conditional distribution of data; The variational autoencoder passes through a latent distribution The encoder is regularized by applying a prior distribution; its loss function consists of the sum of the expected log-likelihood term and the prior regularization term. in This represents the overall loss function that minimizes the VAE. Represents the posterior distribution of the encoder output. Find the expected value; The decoder defines the generation distribution, which represents the distribution of the latent variables. The probability of reconstructing data at any time; Representing the potential space The prior distribution; This represents the reconstruction loss or negative log-likelihood loss. This represents the regularization loss or prior matching loss. It is the Kullback-Leibler divergence, used to measure the difference between two probability distributions.
4. The method for detecting small-sample insulator infrared image faults according to claim 3, characterized in that: The generative adversarial network includes the following steps: A generator network Gen(z) and a discriminator network Dis(x) are constructed. The generator maps the latent variable z to the data space, and the discriminator outputs the probability y = Dis(x) ∈ [0, 1], which represents the probability that the input data x belongs to the real sample. Its complement 1-y represents the probability that x is generated by Gen(z). By optimizing the following binary cross-entropy loss function, the discriminator can effectively distinguish between real data and generated data, while driving the generator to fit the distribution of real data: in, This represents the overall adversarial loss of the generative adversarial network. This indicates that the discriminator reacts to the input data. The discriminant output, That is, the discriminator believes It is the probability of a real sample, which is the discriminator's output of the generated sample, that is, the probability that the discriminator considers the generated sample to be a real sample.
5. The method for detecting small-sample insulator infrared image faults according to claim 4, characterized in that: S2 also includes a reconstruction error step when setting up a generative model: The feature representation of the GAN discriminator is used to replace the traditional reconstruction error; let Indicates the discriminator's first... The hidden layer characteristics of the layer are introduced, with a mean distribution. The feature space is modeled using a Gaussian observation model with unit covariance: This represents a conditional probability distribution, meaning that given the latent variables obtained from the encoder... Under the conditions, generate samples A feature layer activated in the discriminator network The probability distribution that should be followed; this definition links the latent encoding with the high-level semantic features of the generated samples; Represents the identity matrix; in This represents a sample from the decoder; This formula defines the reconstruction loss function based on the discriminator feature space in the VAE-GAN framework. Indicates the discriminator's first... Reconstruction loss of layer features; Combined models trained with triple criteria: This represents the total loss function that needs to be minimized during model training; Limit the erroneous signal to the relevant network: train a VAE and a GAN simultaneously using the loss function in the formula; Weighted VAEs and GANs: When DEC from and When an error signal is received, parameter γ is used to balance reconstruction capability with the ability to fool the discriminator; weighting is only applied when updating the DEC parameters. This represents the parameter vector of the decoder. The update will be based on the gradient calculated on the right; where It is a hyperparameter that balances the weights of two terms, which drives the samples generated by the decoder in the discriminator's... The layer feature space closely resembles the real sample; Indicates the decoder parameters Find the gradient; Based on from and Distinguishing between samples, it was observed that in GAN targets, in addition to using the previous... In addition, it also uses from The sample.
6. The method for detecting small-sample insulator infrared image faults according to claim 1, characterized in that: S3 includes the following steps: In the improved YOLOv11 model's neck network, a bidirectional multi-scale feature pyramid network (BMFPN) is first introduced to enhance target discrimination and context awareness by dynamically fusing multi-scale features. Secondly, the SimAM attention mechanism is integrated with the model's original SMC3K2 module, enabling the network to focus on key features of the target region and strengthen its ability to suppress background interference.
7. The method for detecting small-sample insulator infrared image faults according to claim 6, characterized in that: The Bidirectional Multi-Scale Feature Pyramid Network (BMFPN) is defined as follows: K represents the fused feature map. Indicates the first Feature maps of each input node Indicates the relationship with the first Input feature maps Associated learnable weights, This represents the cumulative weight of the input node; These weights are learnable. Finally, each bidirectional path is treated as a unit and reused multiple times to improve the fusion. For the i-th layer, the two fusion feature formulas of the Bidirectional Multi-Scale Feature Pyramid Network (BMFPN) are as follows: Indicates the first The intermediate feature map obtained after the layer is fused through a top-down path; Indicates the first The input feature map of the layer, , Corresponding to two input feature maps respectively and Learnable weights are used to dynamically adjust their contribution to the fusion result; Indicates the first The final feature map output by the layer; Indicates the first The final output feature map of the layer; , , Corresponding to three inputs respectively , , Learnable weights; It is a positive number used to ensure that the denominator is not zero and to maintain numerical stability; () is a convolutional layer used to transform and integrate the fused weighted features.
8. The method for detecting small-sample insulator infrared image faults according to claim 7, characterized in that: The SMC3K2 module retains the feature fusion capability of C3K2 and introduces the SimAM attention mechanism to adaptively enhance key features; The SMC3K2 module employs an energy function to measure the linear separability between neurons, thereby identifying important neurons. The energy function is defined as follows: in Represents the target neuron; This represents the energy function; the lower the value, the stronger the characteristic value representing the target neuron. The stronger the linear separability from surrounding neurons; This indicates that, excluding the target neuron, the first neuron in the same channel... The feature values of the other neurons; It is the regularization coefficient; M is the number of neurons; and These are the weights and bias parameters of the linear transformation, respectively; Refers to the target neuron Tag information; Subsequently, by solving the variables and Substituting the closed-form solution into the above equation, we obtain the minimum energy expression as follows: This represents the mean value of all neurons in the same feature channel, excluding the target neuron. It represents the variance of all neurons in the same feature channel, excluding the target neuron. The above formula indicates that a smaller energy value corresponds to a larger linear separability between neuron t and other neurons, which represents higher importance; according to the definition of the attention mechanism, the SMC3K2 module is represented as follows: Where E is the classification function for all energy functions e∈t in the channel and spatial dimensions; Indicates the input feature map; This represents the output feature map after enhancement by the SMC3K2 module; the sigmoid function ensures that the larger values in E are constrained, thus not affecting the relative importance of each neuron.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as claimed in any one of claims 1 to 8.
10. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Wire clamp heating fault detection method based on infrared image
CN119206392A
Cited By
Composite insulator infrared edge enhancement method and system based on generative adversarial network
CN122023220A