Image recognition method for electric power inspection scene
By enhancing and sample balancing the power inspection image data, and using convolutional neural network to extract multi-scale features, combining attention mechanism and multi-model fusion, the problems of limited data set scale and high error detection rate in power inspection image recognition are solved, and efficient and accurate image recognition and defect detection are achieved.
Patent Information
- Application Number
- CN202411626176.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
AI Technical Summary
In the power inspection image recognition, the prior art has problems such as limited data set scale, high error detection and missed detection rates, lack of effective capture of multi-scale features, insufficient adaptability and real-timeness, and high complexity of model tuning.
By acquiring power inspection image data for data augmentation, using the generative adversarial network to achieve data amplification, perform sample balance processing, and fine-tuning for pre-trained convolutional neural network models. Residual connections are used to extract multi-scale features, high-dimensional fusion features are obtained through cascade fusion or weighted fusion, and attention to the region of interest is improved through attention mechanism, and the final image recognition results are finally obtained through the fusion of recognition results of multiple models.
Perform well on small sample data sets, effectively capture multi-scale features, reduce error detection rates and missed detection rates, improve adaptability and real-time, simplify the model tuning process, and improve the practicality and performance of the model through performance comparison research with traditional methods.
Smart Images

Figure CN119580089A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of machine learning and electric power inspection, and in particular to an image recognition method for electric power inspection scenarios. Background Art
[0002] At present, image recognition and defect detection technologies have made some progress in the field of power inspection. Typical image recognition models include convolutional neural networks (CNN) and their variants, such as ResNet and DenseNet. These models can extract complex features from large amounts of image data to complete tasks such as target recognition, image classification, and defect detection. Some studies have shown that deep learning models can significantly improve inspection efficiency and detection accuracy in certain application scenarios.
[0003] Although existing technologies have made some progress, there are still some obvious shortcomings and challenges:
[0004] (1) Limited dataset size: Image data in the field of power inspection is often small and of a single type, especially image samples involving anomalies or defects are even more scarce. This leads to limited performance of the model in small sample scenarios. Although transfer learning can partially solve this problem, due to insufficient training data, the generalization ability of the model is still not ideal.
[0005] (2) High false detection and missed detection rates: Existing image recognition models still have false detection and missed detection in practical applications, especially in high-frequency inspection scenarios. This is because traditional models are easily affected by noise interference, image resolution, lighting conditions and other factors when dealing with complex and changeable transmission line environments, resulting in reduced recognition accuracy.
[0006] (3) Lack of effective capture of multi-scale features: Most existing models rely on single-scale feature extraction methods, which make it difficult to fully capture image information at different levels. This is particularly evident in power inspection images, which contain both global structural information of the equipment and subtle defect features. Existing models find it difficult to process these multi-scale information at the same time, thus affecting the accuracy of defect detection.
[0007] (4) Lack of adaptability and real-time performance: Although existing deep learning models can process static image data, they are insufficient in processing real-time data during the actual inspection process. Especially in the scenario of real-time drone inspection, the existing models have certain limitations in response speed and processing efficiency and cannot meet the real-time needs of high-frequency inspections.
[0008] (5) Complexity of model tuning: Model tuning in existing technologies is relatively complex in applications, involving multiple links such as parameter setting and model architecture adjustment. The performance of the model varies greatly for different application scenarios and inspection equipment, and there is a lack of a unified optimization solution, which makes model optimization time-consuming and difficult.
[0009] (6) Insufficient performance comparison with traditional methods: Although deep learning models are theoretically superior to traditional rule-based detection methods, in practical applications, the existing literature does not provide sufficient comparative studies between deep learning and traditional methods, especially in terms of key indicators in practical applications such as detection rate and false positive rate. There is a lack of systematic performance evaluation and bottleneck analysis.
[0010] Therefore, although the existing technology has achieved certain results in power inspection image recognition, it still needs to be deeply optimized and improved in small sample learning, multi-scale feature fusion, real-time and adaptability, false detection and missed detection problems, and performance comparison research with traditional methods to further improve the practicality and performance of the model. Summary of the invention
[0011] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide an image recognition method for power inspection scenarios, so as to solve or partially solve the problems of limited data set size, high false detection rate and missed detection rate, lack of effective capture of multi-scale features, insufficient adaptability and real-time performance, and high complexity of model tuning.
[0012] The purpose of the present invention can be achieved by the following technical solutions:
[0013] One aspect of the present invention provides an image recognition method for power inspection scenarios, comprising the following steps:
[0014] Acquire power inspection image data and perform data enhancement processing, use generative adversarial networks to achieve data amplification, and construct a power inspection image dataset through annotation;
[0015] Performing sample balancing processing on the power inspection image data set;
[0016] The convolutional neural network model pre-trained on a large-scale data set is fine-tuned using the power inspection image data set;
[0017] Obtain the power inspection scene image to be identified and input it into the convolutional neural network model, extract the multi-scale features of the image by residual connection, and obtain high-dimensional fusion features by cascade fusion or weighted fusion;
[0018] For the fused features, the attention mechanism is used to increase the attention to the region of interest;
[0019] Based on the fusion features, multiple models are used for recognition, and the final image recognition result is obtained by fusing the recognition results of the multiple models.
[0020] As a preferred technical solution, the process of pre-training the convolutional neural network model on a large-scale data set includes:
[0021] Dividing the large-scale data set into a training set, a test set, and a validation set;
[0022] With the goal of minimizing the loss function on the validation set, optimize the model's hyperparameters through grid search or random search;
[0023] Dynamically update the learning rate during training via cosine annealing learning rate or learning rate decay;
[0024] During the training process, a penalty term is added to the model's weights.
[0025] As a preferred technical solution, the cosine annealing learning rate is calculated using the following formula:
[0026]
[0027] Among them, η t is the current learning rate, T cur is the current training step number, T max is the maximum number of training steps, η min , η max is the preset minimum and maximum learning rate,
[0028] Adding a penalty term to the model's weights is implemented using the following formula:
[0029]
[0030] Among them, L is the updated loss function, L data is the data loss, λ is the regularization coefficient, w i is the weight of the model.
[0031] As a preferred technical solution, it also includes:
[0032] Acquire incremental power inspection image data and annotate them to obtain incremental samples, and use the incremental samples to update the weights of the convolutional neural network model;
[0033] The convolutional neural network model is used as the teacher model, and the student model is obtained through model distillation. The student model is used to realize the recognition of the power inspection scene image to be identified.
[0034] As a preferred technical solution, the weights of the convolutional neural network model are updated using the incremental samples using the following formula:
[0035]
[0036] Among them, θ t is the parameter of the current convolutional neural network model, η is the learning rate, l is the loss function, θ t+1 are the parameters of the updated convolutional neural network model, Indicates the incremental power inspection image data x new When used as the input of the current convolutional neural network model, the predicted label, y new is the true label of the incremental sample.
[0037] As a preferred technical solution, the loss function of model distillation is:
[0038] L distill =αL studdent +(1-α)L KL (p teacher , p studdent )
[0039] Among them, L student is the standard loss of the student model, L KL is the KL divergence of the prediction results of the teacher model and the student model, P teacher With P student are the predicted probability distributions of the teacher and student models respectively, and α is the weight parameter.
[0040] As a preferred technical solution, the process of obtaining high-dimensional fusion features through cascade fusion or weighted fusion is implemented by the following formula:
[0041] F1=f conv (I, k1), F2 = f conv (I, k2), F3 = f conv (I, k3)
[0042] F res =F input +f conv (F input )
[0043] F multi ′=Concat(F1,F2,F3)
[0044]
[0045] Among them, I is the power inspection scene image to be identified, k1, k2, k3 are convolution kernels of different sizes, and F input is the input feature, f cinv is the convolution operation, F res is the output of the residual unit, F multi ′、Fmulti ″ are the fusion features obtained by cascade fusion or weighted fusion respectively.
[0046] As a preferred technical solution, the attention mechanism is used to improve the attention to the region of interest by the following formula:
[0047]
[0048] Among them, F multi is the fusion feature, α i is the attention weight, W i is a learnable weight parameter, F att is the weighted fusion feature.
[0049] As a preferred technical solution, the recognition results of multiple models are fused through model voting, weighted averaging or stacking.
[0050] As a preferred technical solution, data enhancement processing of power inspection image data is achieved through rotation transformation, color jittering, random cropping and scaling; oversampling processing is performed on the minority classes in the power inspection image data set, and undersampling processing is performed on the majority classes in the power inspection image data set to achieve sample balance processing.
[0051] Another aspect of the present invention provides an electronic device, characterized in that it includes: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned image recognition method for power inspection scenarios.
[0052] Another aspect of the present invention provides a computer-readable storage medium, characterized in that it includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing the aforementioned image recognition method for power inspection scenarios.
[0053] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0054] (1) Good performance on smaller-volume power inspection image data: The present invention uses a generative adversarial network to perform data amplification on the acquired power inspection image data, constructs a power inspection image dataset through annotation, and performs sample balancing processing. At the same time, the model is pre-trained on a large-scale dataset and then fine-tuned using the power inspection image dataset, so that better training results can be obtained even when there is less power inspection image data.
[0055] (2) Effective capture of multi-scale features with low false positive rate and missed detection rate: The present invention extracts multi-scale features of images by residual connection, obtains high-dimensional fusion features by cascade fusion or weighted fusion, improves the focus on the region of interest by the attention mechanism, uses multiple models for recognition, and obtains the final image recognition result by fusing the recognition results of multiple models. While fully capturing multi-scale features, the advantages of different models are utilized to improve the recognition effect of defects and anomalies in power inspection images, with low false positive rate and missed detection rate.
[0056] (3) Strong adaptability and real-time performance: The present invention obtains incremental power inspection image data and labels them to obtain incremental samples, and uses the incremental samples to update the weights of the convolutional neural network model. In addition, the convolutional neural network model is used as a teacher model, and a student model is obtained through model distillation. The student model is used to recognize the power inspection scene image to be recognized, which can effectively adapt to the incremental learning scenario. At the same time, knowledge distillation can reduce the cost of model reasoning while retaining most of the recognition accuracy.
[0057] (4) Low model tuning complexity: The present invention aims to minimize the loss function on the validation set and optimizes the model's hyperparameters through grid search or random search. In addition, the learning rate during training is dynamically updated through cosine annealing learning rate or learning rate decay. Finally, during the training process, a penalty term is added to the model's weights, which effectively reduces the tuning complexity of the model parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 Schematic diagram of the process of an image recognition method for power inspection scenarios in an embodiment. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0060] Example 1
[0061] In response to the problems existing in the aforementioned prior art, this embodiment provides an image recognition method for power inspection scenarios, aiming to improve the overall performance of image recognition and defect detection, and to ensure the reliability and effectiveness of the model by systematically evaluating and verifying the recognition results, including key indicators such as accuracy and recall rate. For cases of recognition errors, in-depth analysis is conducted and corresponding measures are taken, such as introducing more training data, adjusting model parameters, etc., so as to achieve optimization and improvement of the model. At the same time, this method focuses on high-frequency business scenarios such as intelligent inspection of power transmission drones and power transmission channels. By comparing the performance with traditional models, bottleneck research is carried out around key indicators such as discovery rate and false detection rate to identify and solve obstacles to model improvement, and ultimately achieve comprehensive progress and application promotion of intelligent inspection.
[0062] In order to comprehensively improve the accuracy and robustness of power inspection image recognition and defect detection, this embodiment proposes a multi-faceted solution from data processing, model design, feature extraction to model optimization. Figure 1 ,The following is a detailed description and extension of each step of the ,method, which aims to build an efficient and suitable ,for power inspection intelligent identification method / system for small sample environments.
[0063] (1) Data processing and enhancement.
[0064] Step S1: small sample data enhancement.
[0065] Since power inspection image data is often limited and samples are unbalanced, especially defect and abnormal image samples are scarce, conventional deep learning models are prone to overfitting. Therefore, data enhancement is crucial to improving the generalization ability of the model. The enhancements used in this embodiment include image geometric transformation (rotation, translation, flipping), color space transformation (brightness adjustment, contrast enhancement, color jitter), noise addition, etc. The specific data enhancement steps include:
[0066] -Rotation transformation: Randomly rotate the image (for example, ±10 degrees), the formula is as follows: rot =R(θ)I, where R(θ) is the rotation matrix and R(θ) is the randomly generated rotation angle.
[0067] -Color jitter: Generate diverse samples by adjusting image brightness, contrast, saturation and other parameters. Suppose the original image is I and the color-adjusted image is I color , can be achieved through the following formula: color =αI+β, where α and β are brightness and contrast adjustment parameters respectively.
[0068] - Random Cropping and Scaling: Randomly crop the image into different ratios and scale it to capture local features in the image.
[0069] To further increase the amount of data, we can use a generative adversarial network (GAN) to generate additional defect images. GAN consists of a generator and a discriminator, which generate high-quality image samples in an adversarial manner. The generator G generates defect images through random noise z: gen =G(z), the discriminator D is used to distinguish between generated images and real images, and the loss functions of G and D are:
[0070]
[0071] Through repeated training, the generator gradually generates realistic defect images, thus enriching the dataset.
[0072] Step S2: sample imbalance processing.
[0073] In the power inspection image dataset, there are few defect image samples, which easily leads to the deviation of the model in defect recognition. To solve this problem, the following processing can be used:
[0074] -Oversampling: For the minority class (defective images), new samples are generated by copying existing samples or using SMOTE (Synthetic Minority Oversampling), the formula is:
[0075] x new =x minor +λ(x neighbor -x minor )
[0076] where x minor is a minority class sample, x neighbor are neighboring samples of the minority class, λ∈[0,1].
[0077] -Undersampling: Randomly downsample the majority class samples to reduce their number to balance the data distribution.
[0078] Through the above data enhancement and sample balancing, the generalization ability of the model can be effectively improved and the problems caused by sample imbalance can be reduced.
[0079] (2) Model design.
[0080] Step S3: transfer learning and fine-tuning.
[0081] Transfer learning makes up for the problem of insufficient samples in the power inspection dataset by using a pre-trained large model. In this method, a convolutional neural network (CNN) model (such as ResNet, EfficientNet) trained on a large-scale dataset (such as ImageNet) is first selected, and then fine-tuned on the power inspection dataset. The specific steps are as follows:
[0082] -Use of pre-trained model: The parameters of the pre-trained model (such as ResNet50) are θ pre , input power inspection image I, after passing through the convolutional layer and fully connected layer of the pre-trained model, output the preliminary feature representation F pre :
[0083]
[0084] in, Represents the forward propagation function of the pre-trained model.
[0085] - Fine-tuning process: The pre-trained model is applied to the power inspection task and fine-tuned using the labeled data of the power inspection image. During fine-tuning, only the high-level parameters of the network are updated, and the low-level features remain unchanged. Its loss function is defined as:
[0086]
[0087] Among them, y i is the true label of the sample, is the fine-tuned model, l is the cross entropy loss, and N is the number of samples.
[0088] In this way, the pre-trained model can adapt to the specific image features in the power inspection scenario and show good generalization ability under small sample conditions.
[0089] Step S4: multi-scale feature extraction and fusion.
[0090] In order to capture information of different scales in the power inspection image to the maximum extent, this embodiment adopts multi-scale feature extraction and fusion. Multi-scale feature extraction extracts local and global features of the image by using convolution kernels with different receptive fields and residual connections.
[0091] -Convolution operation: Convolution operations of different scales extract features of different resolutions. Assuming the input image is I and the convolution kernel sizes are k1, k2, k3, the multi-scale convolution feature can be expressed as:
[0092] F1=f conv (I, k1), F2 = f conv (I, k2), F3 = f conv (I, k3)
[0093] The local details and global information of the image are captured by convolution kernels of different sizes.
[0094] -Residual connection: The residual connection is introduced to enable effective transfer of features between different levels. The residual unit can be expressed as:
[0095] Fres =F input +f conv (F iaput )
[0096] Among them, F input is the input feature, f conv is the convolution operation.
[0097] -Feature fusion: Combine multi-scale features through cascading or weighted fusion to generate a high-dimensional feature representation F multi F mum =Concat(F1, F2, F3) or Among them, W i is a learnable weight parameter.
[0098] Step S5, introduces the attention mechanism.
[0099] In order to further improve the model's attention to key image areas, this embodiment introduces an attention mechanism. The attention mechanism improves the model's attention to defect areas by dynamically allocating weights to different areas.
[0100] -Attention weight calculation: Given the input feature F multi , attention weight α i Calculated by the softmax function:
[0101]
[0102] Among them, W i is the learnable weight matrix.
[0103] -Attention feature fusion: The weighted feature is represented as F att =∑ i α i F i
[0104] Through the attention mechanism, the model can automatically identify and focus on defects or abnormal areas in the image, thereby improving recognition accuracy.
[0105] (3) Model optimization and fusion.
[0106] Step S6: Multi-model fusion
[0107] In order to further improve the robustness of the model, this embodiment provides a multi-model fusion solution. By combining multiple architectures (such as ResNet, DenseNet, EfficientNet), their respective advantages are utilized to improve the recognition effect of defects and anomalies in power inspection images. The specific fusion methods include:
[0108] - Voting Ensemble: The prediction results of multiple models are voted on and the category that the majority of models consider most likely is selected as the final prediction result. Assume that the outputs of the M models are Final prediction results This can be determined by:
[0109]
[0110] Among them, mode means taking the majority voting result.
[0111] -Weighted Averaging: Give different weights to the output of each model. The size of the weight can be determined based on the performance of the model on the validation set. The final prediction result is obtained by weighted averaging. Among them, w i is the weight of the i-th model, satisfying
[0112] - Stacking Ensemble: Based on multiple base models, a meta-model is trained to combine the prediction results of the base models to obtain the final prediction. The specific steps are as follows: First, multiple base models are trained to obtain their prediction outputs on the validation set, and then these outputs are input into the meta-model as new features. The meta-model then learns how to combine these prediction outputs to improve the accuracy of the overall prediction.
[0113] Through multi-model fusion, we can fully utilize the advantages of different models and improve the model's recognition accuracy and robustness of defects and anomalies in power inspection images.
[0114] Step S7: model parameter optimization.
[0115] Optimization of model parameters is a key step to ensure model performance. In this embodiment, the following optimization strategy is adopted:
[0116] -Hyperparameter optimization: Optimize the model's hyperparameters, such as learning rate, batch size, weight decay coefficient, etc., through methods such as Grid Search or Random Search. The optimization goal is to minimize the loss function on the validation set.
[0117] -Learning rate scheduling: During the training process, a strategy of dynamically adjusting the learning rate, such as cosine annealing learning rate or learning rate decay, is adopted to ensure that the model converges quickly in the early stages of training and fine-tunes in the later stages. Cosine annealing formula:
[0118]
[0119] Among them, η t is the current learning rate, T cur is the current training step number, T max is the maximum number of training steps.
[0120] -Regularization strategy: To prevent the model from overfitting, L2 regularization and Dropout are used. L2 regularization adds a penalty term to the weights. The formula is Where L data is the data loss, λ is the regularization coefficient, w i is the weight of the model.
[0121] Step S8, adaptive learning mechanism.
[0122] In order to further improve the performance of the model in actual scenarios, this embodiment introduces an adaptive learning mechanism. Through online learning and dynamic model updates, the model can adapt to new data and changing environments over time.
[0123] -Online learning: In the actual power inspection scenario, the system will continuously receive new image data, and the model will continuously update the weights through the online learning mechanism. Assume that the new input sample is x new , the corresponding label is y new , the model can be updated using the following formula:
[0124]
[0125] Among them, θ t is the parameter of the current model, η is the learning rate, and l is the loss function.
[0126] -Model Distillation: In order to reduce the complexity of the model while maintaining high performance, model distillation can be used. By using a complex teacher model to guide the lightweight student model to learn, the student model can obtain similar prediction capabilities as the teacher model, while having higher inference speed and lower computational cost. The loss function of model distillation is:
[0127] L distill =αL student +(1-α)L KL (p teacher , P student )
[0128] Among them, L student is the standard loss of the student model, L KL is the KL divergence of the prediction results of the teacher model and the student model, p teacher With pstudent are the predicted probability distributions of the teacher and student models respectively, and α is the weight parameter.
[0129] In order to more clearly demonstrate the specific implementation of the above solution, an actual experimental case is used below to illustrate the specific steps and experimental results.
[0130] (1) Experimental procedures.
[0131] 1) Dataset preparation.
[0132] The dataset is derived from the actual inspection records of a power company and contains 500 labeled images. The image types include:
[0133] -Cracks (1000 pieces)
[0134] -Corrosion (1000 pieces)
[0135] - Equipment failure (1000 photos)
[0136] -Connection Problem (1000 photos)
[0137] -External pollution (1000 photos)
[0138] The partitioning strategy is 80% of the data for training (4000 images) and 20% of the data for testing (1000 images), ensuring that each category has a balanced sample distribution in the training and test sets.
[0139] 2) Pre-training model selection.
[0140] The pre-trained ResNet50 model is selected as the base model. This model has been trained on the ImageNet dataset and has good feature extraction capabilities.
[0141] 3) Transfer learning and fine-tuning.
[0142] Fine-tune ResNet50: replace the last layer of the network and adjust the output layer to 5 neurons corresponding to the 5 defect categories; freeze the previous convolutional layers and only fine-tune the last few layers to retain the common features learned in the pre-trained model; use the Adam optimizer with a learning rate of 0.0001 and a batch size of 16.
[0143] 4) Multi-scale feature extraction and attention mechanism.
[0144] Integrate multi-scale feature extraction in the model: use convolution kernels of different sizes (3x3 and 5x5) to extract information of different scales; combine with global average pooling layer to retain important contextual information; introduce attention mechanisms such as Squeeze-and-Excitation (SE) module to enhance the model's attention to key information, thereby improving recognition accuracy.
[0145] 5) Data enhancement and model training.
[0146] The training set was expanded using a variety of data augmentation techniques (such as rotation, horizontal flipping, random cropping, color jittering, etc.) to make the model more robust. The model was trained for 30 epochs and the performance was monitored using the validation set after each epoch, and the model with the lowest validation loss was selected.
[0147] 6) Model evaluation.
[0148] Use the test set to evaluate the model performance and calculate the following evaluation indicators: Accuracy, Recall, and F1 value; perform confusion matrix analysis to gain a deeper understanding of the model's performance in different categories.
[0149] (2) Experimental results
[0150] 1) Model performance.
[0151] -Accuracy: 98.5%
[0152] -Recall: 95.2%
[0153] -F1 value: 96.8%
[0154] 2) Compare with traditional models.
[0155] The performance of the traditional convolutional neural network (without using transfer learning and multi-scale processing) is as follows: accuracy is 88.0%, recall is 82.5%, and F1 value is 85.1%.
[0156] 3) Confusion matrix analysis.
[0157] The confusion matrix shows that the model performs well in detecting equipment failures and cracks, with recall rates of 98.5% and 96.0%, respectively. The recall rate for external contamination is slightly lower, at 90.0%, indicating that the sample size and feature representation of this category in the dataset are more complex.
[0158] (3) Result analysis
[0159] The experimental results show that the power inspection image recognition model of the present invention performs well in defect detection, and its accuracy and recall rates are significantly better than those of traditional models. This shows that the combination of transfer learning and multi-scale feature extraction effectively improves the recognition ability of the model in a small sample environment.
[0160] 1) Model advantages
[0161] -High efficiency: The model can still achieve high accuracy on small sample data sets, indicating the effectiveness of transfer learning.
[0162] - Robustness: Through multi-scale feature extraction, the model is able to capture key features in the image from different angles, improving the ability to detect various defects.
[0163] 2) Conclusion.
[0164] This experiment verifies the effectiveness of the large-model-based power inspection image recognition method. This method combines transfer learning, multi-scale feature extraction, and attention mechanism, and can achieve high-precision defect detection in a small sample environment, providing effective technical support for the intelligent development of power inspection. Future work can focus on further optimizing model performance, as well as promotion and deployment in practical applications.
[0165] In summary, this method aims to improve the performance of image recognition and defect detection, and ensure the reliability of the model by evaluating the recognition results (such as accuracy, recall, etc.). For cases of recognition errors, in-depth analysis is conducted and measures are taken, such as introducing more training data and adjusting model parameters, to optimize the model. At the same time, focusing on high-frequency scenarios such as intelligent inspection of power transmission drones and power transmission channels, by comparing with traditional models, bottleneck research is carried out around key indicators such as detection rate and false detection rate, identifying and solving obstacles to model improvement, thereby promoting the advancement and application of intelligent inspection technology.
[0166] Example 2
[0167] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned image recognition method for power inspection scenarios.
[0168] Example 3
[0169] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned image recognition method for power inspection scenarios.
[0170] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An image recognition method for power inspection scenarios, characterized in that: The steps include: Acquire power inspection image data and perform data enhancement processing, use generative adversarial networks to achieve data amplification, and construct a power inspection image dataset through annotation; Performing sample balancing processing on the power inspection image data set; The convolutional neural network model pre-trained on a large-scale data set is fine-tuned using the power inspection image data set; Obtain the power inspection scene image to be identified and input it into the convolutional neural network model, extract the multi-scale features of the image by residual connection, and obtain high-dimensional fusion features by cascade fusion or weighted fusion; For the fused features, the attention mechanism is used to increase the attention to the region of interest; Based on the fusion features, multiple models are used for recognition, and the final image recognition result is obtained by fusing the recognition results of the multiple models.
2. The image recognition method for power inspection scenarios according to claim 1 is characterized in that: The process of pre-training the convolutional neural network model on a large-scale data set includes: Dividing the large-scale data set into a training set, a test set, and a validation set; With the goal of minimizing the loss function on the validation set, optimize the model's hyperparameters through grid search or random search; Dynamically update the learning rate during training via cosine annealing learning rate or learning rate decay; During the training process, a penalty term is added to the model's weights.
3. The image recognition method for power inspection scenarios according to claim 2 is characterized in that: The cosine annealing learning rate is calculated using the following formula: Among them, η t is the current learning rate, T cur is the current training step number, T max is the maximum number of training steps, η min , η max is the preset minimum and maximum learning rate, Adding a penalty term to the model's weights is implemented using the following formula: Among them, L is the updated loss function, L data is the data loss, λ is the regularization coefficient, w i is the weight of the model.
4. The image recognition method for power inspection scenarios according to claim 1 is characterized in that: Also includes: Acquire incremental power inspection image data and annotate them to obtain incremental samples, and use the incremental samples to update the weights of the convolutional neural network model; The convolutional neural network model is used as the teacher model, and the student model is obtained through model distillation. The student model is used to realize the recognition of the power inspection scene image to be identified.
5. The image recognition method for power inspection scenarios according to claim 4 is characterized in that: The weights of the convolutional neural network model are updated using the incremental samples using the following formula: Among them, θ t is the parameter of the current convolutional neural network model, η is the learning rate, l is the loss function, θ t+1 are the parameters of the updated convolutional neural network model, Indicates the incremental power inspection image data x new When used as the input of the current convolutional neural network model, the predicted label, y new is the true label of the incremental sample.
6. The image recognition method for power inspection scenarios according to claim 4 is characterized in that: The loss function of model distillation is: L distill =αL student +(1-α)L KL (p teacher ,p student ) Among them, L student is the standard loss of the student model, L KL is the KL divergence of the prediction results of the teacher model and the student model, p teacher With p student are the predicted probability distributions of the teacher and student models respectively, and α is the weight parameter.
7. The image recognition method for power inspection scenarios according to claim 1 is characterized in that: The process of obtaining high-dimensional fusion features through cascade fusion or weighted fusion is implemented by the following formula: F1=f conv (I,k1),F2=f conv (I,k2),F3=f conv (I,k3) F res =F input +f conv (F input ) F multi ′=Concat(F1,F2,F3) Among them, I is the power inspection scene image to be identified, k1, k2, k3 are convolution kernels of different sizes, and F input is the input feature, f conv is the convolution operation, F res is the output of the residual unit, F multi ′、F multi ″ are the fusion features obtained by cascade fusion or weighted fusion respectively.
8. The image recognition method for power inspection scenarios according to claim 1 is characterized in that: The above-mentioned method of increasing the attention to the region of interest through the attention mechanism is implemented as follows: Among them, F multi is the fusion feature, α i is the attention weight, W i is a learnable weight parameter, F att is the weighted fusion feature.
9. The image recognition method for power inspection scenarios according to claim 1 is characterized in that: The recognition results of multiple models can be integrated through model voting, weighted averaging or stacking.
10. The image recognition method for power inspection scenarios according to claim 1, characterized in that: Data enhancement processing of power inspection image data is achieved through rotation transformation, color jitter, random cropping and scaling; Oversampling is performed on the minority classes in the power inspection image dataset, and undersampling is performed on the majority classes in the power inspection image dataset to achieve sample balance processing.
Citation Information
Cited By
Transformer substation inspection method and system based on image recognition
CN121640386A