Power transmission line defect identification method, system and equipment and storage medium
By building a transmission line defect recognition model including convolutional neural network, adaptive attention module, multi-layer feature fusion module and improved Softmax classifier, the problem of low recognition accuracy in small sample scenarios is solved, and high accuracy defect recognition is achieved, ensuring the safe operation of transmission lines.
Patent Information
- Application Number
- CN202411656501.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art has low accuracy in transmission line defect recognition in small sample scenarios, especially in complex scenarios such as wildfires and foreign objects, where defect samples are scarce, resulting in increased difficulty in training deep learning models and low accuracy, which affects the safe operation and maintenance of transmission lines.
The transmission line defect recognition model is adopted, which includes a feature extraction module based on a convolutional neural network, an adaptive attention module, a multi-layer feature fusion module, and an improved Softmax classifier. Through the adaptive attention module, the multi-layer feature fusion module integrates feature information at different levels and introduces cosine similarity into the Softmax classifier to improve the accuracy and robustness of classification.
In small sample scenarios, the accuracy of transmission line defect identification is effectively improved, and safety hazards in transmission channels can be discovered in a timely manner, ensuring the reliable operation of transmission lines.
Smart Images

Figure CN119579976A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power transmission lines and relates to a method, system, equipment and storage medium for identifying defects in a transmission line. Background Art
[0002] As a carrier for the transmission and distribution of electric energy, the safe and reliable operation of transmission lines is the key to the sustained and stable operation of the power grid. However, since most transmission lines are distributed in the wild, the traditional inspection method relies on inspectors to cross mountains and ridges, which is not only labor-intensive but also inefficient. In order to improve the safety and inspection efficiency of transmission lines, the construction of smart transmission lines has emerged, among which high-tech means such as drones and online monitoring devices are widely used, aiming to improve the perception level of transmission line defects and promote defect perception methods based on image recognition.
[0003] Deep learning models have achieved certain results in the task of power transmission line image classification, providing strong support for the construction of smart power transmission lines. However, the effectiveness of deep learning models is highly dependent on a large amount of training data. In the real world, due to the scarcity of labeled data and the high time and labor costs required to label unlabeled data, deep learning models are prone to overfitting when the scale of training data is small, resulting in poor performance in real scenarios.
[0004] Especially for complex scenarios such as wildfires and foreign objects in transmission lines, defect samples are even scarcer, which further aggravates the difficulty of training transmission line defect recognition models based on deep learning models. As a result, the accuracy of existing transmission line defect recognition models is often low, which in turn affects the accuracy of transmission line defect recognition and ultimately affects the safe operation and maintenance of transmission lines. Summary of the invention
[0005] The purpose of the present invention is to overcome the above-mentioned shortcomings of the prior art and provide a method, system, device and storage medium for identifying defects in a transmission line.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a method for identifying defects in a transmission line, comprising: obtaining a sampled image of the transmission line; inputting the sampled image of the transmission line into a pre-trained transmission line defect recognition model to obtain a defect recognition result of the transmission line; wherein the transmission line defect recognition model comprises a feature extraction module based on a convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier; the adaptive attention module is used to obtain the attention weights of each pre-selected layer of the feature extraction module; the multi-layer feature fusion module is used to weightedly fuse the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights, obtain the fused features and send them to the improved Softmax classifier for classification; the improved Softmax classifier is obtained by introducing cosine similarity in the probability distribution calculation of the Softmax classifier.
[0008] Optionally, the pre-trained transmission line defect recognition model is obtained in the following manner: constructing a triplet network based on a feature extraction module, pre-training the triplet network through a preset public image data set to obtain a pre-trained triplet network, and obtaining transmission line training images and training the pre-trained triplet network according to the transmission line training images to obtain a pre-trained feature extraction module; extracting and fusing feature vectors of various types of transmission line training images through the pre-trained feature extraction module to obtain initialization weight parameters of an improved Softmax classifier, and setting the initialization bias parameters of the improved Softmax classifier to 0 to obtain an initialized improved Softmax classifier; using the pre-trained feature extraction module and the initialized improved Softmax classifier to replace the feature extraction module and the improved Softmax classifier in the transmission line defect recognition model respectively, and training the transmission line defect recognition model according to the transmission line training images to obtain a pre-trained transmission line defect recognition model.
[0009] Optionally, the extracting and fusing feature vectors of various types of transmission line training images through a pre-trained feature extraction module to obtain initialization weight parameters of the improved Softmax classifier includes: extracting feature vectors of various types of transmission line training images through a pre-trained feature extraction module; averaging and normalizing the feature vectors of various types of transmission line training images to obtain initial values of the feature vectors of various types of transmission line training images; and using the initial values of the feature vectors of various types of transmission line training images as initialization weight parameters of the improved Softmax classifier.
[0010] Optionally, the improved Softmax classifier is obtained by replacing the probability distribution calculation method of the Softmax classifier with the following formula:
[0011] p=Softmax(sim(W,q)+b)
[0012] Among them, p is the probability distribution, Softmax() is the Softmax function, sim() is the cosine similarity function, W is the weight parameter, b is the bias parameter, and q is the fusion feature.
[0013] Optionally, the pre-selected layers include at least a low-level convolutional layer, a middle-level convolutional layer and a high-level convolutional layer of the feature extraction module.
[0014] Optionally, the attention weight includes a channel attention weight and a spatial attention weight; the output features of each pre-selected layer are weightedly fused according to the attention weight of each pre-selected layer and the preset adaptive weight to obtain a fused feature and send it to the improved Softmax classifier for classification, including: aligning the output features of each pre-selected layer to obtain an aligned output feature of each pre-selected layer; weighted fusion of the output features of each pre-selected layer is performed according to the following formula to obtain a fused feature F out :
[0015]
[0016] Where N is the number of pre-selected layers, w i is the adaptive weight of the i-th preselected layer, M c,i is the channel attention weight of the i-th pre-selected layer, ⊙ represents element-by-element multiplication, M s,i is the spatial attention weight of the i-th pre-selected layer, F i is the aligned output feature of the i-th pre-selected layer; α i and α j are the trainable parameters of the i-th and j-th preselected layers, respectively.
[0017] According to a second aspect of the present invention, a transmission line defect recognition system is provided, comprising: an image acquisition module for acquiring a transmission line sampling image; a defect recognition module for inputting the transmission line sampling image into a pre-trained transmission line defect recognition model to obtain a transmission line defect recognition result; wherein the transmission line defect recognition model comprises a feature extraction module based on a convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier; the adaptive attention module is used to obtain the attention weights of each pre-selected layer of the feature extraction module; the multi-layer feature fusion module is used to weightedly fuse the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights, obtain the fused features and send them to the improved Softmax classifier for classification; the improved Softmax classifier is obtained by introducing cosine similarity in the probability distribution calculation of the Softmax classifier.
[0018] Optionally, the pre-trained transmission line defect recognition model is obtained in the following manner: constructing a triplet network based on a feature extraction module, pre-training the triplet network through a preset public image data set to obtain a pre-trained triplet network, and obtaining transmission line training images and training the pre-trained triplet network according to the transmission line training images to obtain a pre-trained feature extraction module; extracting and fusing feature vectors of various types of transmission line training images through the pre-trained feature extraction module to obtain initialization weight parameters of an improved Softmax classifier, and setting the initialization bias parameters of the improved Softmax classifier to 0 to obtain an initialized improved Softmax classifier; using the pre-trained feature extraction module and the initialized improved Softmax classifier to replace the feature extraction module and the improved Softmax classifier in the transmission line defect recognition model respectively, and training the transmission line defect recognition model according to the transmission line training images to obtain a pre-trained transmission line defect recognition model.
[0019] According to a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned power transmission line defect identification method when executing the computer program.
[0020] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned power transmission line defect identification method are implemented.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] The power transmission line defect recognition method of the present invention realizes intelligent recognition of power transmission line defect images by constructing a power transmission line defect recognition model including a feature extraction module based on a convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier, and provides technical support for the safety monitoring of power transmission channels. Aiming at the problem that the recognition accuracy of power transmission line defects is not high in small sample scenarios, by introducing an adaptive attention module, the power transmission line defect recognition model can dynamically focus on key features in the image, thereby improving the pertinence and accuracy of feature extraction. At the same time, the multi-layer feature fusion module further improves the feature extraction capability of the network and enhances the feature representation of the network by comprehensively considering feature information at different levels, thereby achieving good recognition effects in small sample scenarios. In addition, by introducing cosine similarity into the probability distribution calculation of the traditional Softmax classifier to form an improved Softmax classifier, the classifier pays more attention to the similarity between samples when judging the category, improves the accuracy and robustness of the classification, and further optimizes the classification effect of a few samples. The defect recognition accuracy of the power transmission line in the small sample scenario can be effectively improved, and the potential safety hazards of the power transmission channel can be discovered in time, thereby ensuring the reliable operation of the power transmission line. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a method for identifying defects in a power transmission line according to an embodiment of the present invention.
[0024] Figure 2 Schematic diagram of a triplet network structure according to an embodiment of the present invention.
[0025] Figure 3 This is a schematic diagram of a method for calculating initialization weight parameters according to an embodiment of the present invention.
[0026] Figure 4 The structure block diagram of the power transmission line defect identification system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0030] See also Figure 1 In one embodiment of the present invention, a method for identifying defects in a transmission line is provided, specifically a method for identifying defects in a transmission line based on few-sample learning, which can effectively improve the accuracy of identifying defects in a transmission line in a small sample scenario and provide technical support for the safety monitoring of a transmission channel.
[0031] Specifically, the power transmission line defect identification method of the present invention comprises the following steps:
[0032] S1: Acquire a sampling image of a transmission line.
[0033] S2: Input the transmission line sampling image into the pre-trained transmission line defect recognition model to obtain the transmission line defect recognition result.
[0034] Among them, the transmission line defect recognition model includes a feature extraction module based on convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier; the adaptive attention module is used to obtain the attention weights of each pre-selected layer of the feature extraction module; the multi-layer feature fusion module is used to weightedly fuse the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights, obtain the fused features and send them to the improved Softmax classifier for classification; the improved Softmax classifier is obtained by introducing cosine similarity in the probability distribution calculation of the Softmax classifier.
[0035] The power transmission line defect recognition method of the present invention realizes intelligent recognition of power transmission line defect images by constructing a power transmission line defect recognition model including a feature extraction module based on a convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier, and provides technical support for the safety monitoring of power transmission channels. Aiming at the problem that the recognition accuracy of power transmission line defects is not high in small sample scenarios, by introducing an adaptive attention module, the power transmission line defect recognition model can dynamically focus on key features in the image, thereby improving the pertinence and accuracy of feature extraction. At the same time, the multi-layer feature fusion module further improves the feature extraction capability of the network and enhances the feature representation of the network by comprehensively considering feature information at different levels, thereby achieving good recognition effects in small sample scenarios. In addition, by introducing cosine similarity into the probability distribution calculation of the traditional Softmax classifier to form an improved Softmax classifier, the classifier pays more attention to the similarity between samples when judging the category, improves the accuracy and robustness of the classification, and further optimizes the classification effect of a few samples. The defect recognition accuracy of the power transmission line in the small sample scenario can be effectively improved, and the potential safety hazards of the power transmission channel can be discovered in time, thereby ensuring the reliable operation of the power transmission line.
[0036] In a possible implementation, the pre-trained transmission line defect recognition model is obtained in the following manner: constructing a triplet network based on a feature extraction module, pre-training the triplet network through a preset public image data set to obtain a pre-trained triplet network, and obtaining a transmission line training image and training the pre-trained triplet network according to the transmission line training image to obtain a pre-trained feature extraction module; extracting feature vectors of various types of transmission line training images through the pre-trained feature extraction module and fusing them to obtain an initialization weight parameter of an improved Softmax classifier, and setting the initialization bias parameter of the improved Softmax classifier to 0 to obtain an initialized improved Softmax classifier; using the pre-trained feature extraction module and the initialized improved Softmax classifier to replace the feature extraction module and the improved Softmax classifier in the transmission line defect recognition model respectively, and training the transmission line defect recognition model according to the transmission line training image to obtain a pre-trained transmission line defect recognition model.
[0037] For details, see Figure 2 , based on the feature extraction module, a triplet network is constructed. The triplet network is a special network structure used to solve the small sample problem in deep learning. It learns useful variables by comparing distances. The triplet network consists of three convolutional neural networks with shared weights. The purpose of constructing a triplet network is to improve the ability of convolutional neural networks to distinguish samples of different categories.
[0038] The input image of the triplet network is in the form of a triplet, and each input sample consists of an anchor point, a positive sample, and a negative sample. An anchor point is selected, and a sample of the same type in the category to which the anchor point belongs is randomly selected as a positive sample, and a sample is randomly selected from all samples outside the category to which the anchor point belongs as a negative sample. After the three input images pass through the convolutional neural network with shared weights, three feature vectors are obtained. A loss function is constructed based on these three feature vectors to achieve a feature extraction effect in which the difference between the feature vectors of the anchor point and the positive sample is as small as possible, and the difference between the feature vectors of the anchor point and the negative sample is as large as possible.
[0039] The loss function Loss calculation method of the triple network is as follows:
[0040] Loss(x a ,x + ,x - )=max{0,d + +α-d -}
[0041] in, α is the margin hyperparameter set, f(x + ) is the positive sample feature vector, f(x a ) is the anchor point feature vector, f(x - ) is the negative sample feature vector.
[0042] The collected transmission line training images are preprocessed, and the size of the transmission line training images is adjusted to 64×64, three-channel color images, and divided into support sets and query sets. The support set is used as labeled data to train and optimize the transmission line defect recognition model. The query set is used as unlabeled data to verify the effectiveness of the transmission line defect recognition model.
[0043] At the same time, due to the uneven distribution of transmission line training image samples and the lack of image data in specific scenarios, public image datasets are introduced to pre-train the triplet network, such as the Tiny-ImageNet dataset, in order to update the model parameters to improve the feature extraction capability of the feature extraction module for the input image.
[0044] Optionally, the feature vectors of various types of transmission line training images are extracted and fused by the pre-trained feature extraction module to obtain the initialization weight parameters of the improved Softmax classifier, including:
[0045] The feature vectors of various types of transmission line training images are extracted through a pre-trained feature extraction module; the feature vectors of various types of transmission line training images are averaged and normalized to obtain initial values of the feature vectors of various types of transmission line training images, and the initial values of the feature vectors of various types of transmission line training images are used as initialization weight parameters of the improved Softmax classifier.
[0046] Specifically, the parameters to be optimized of the Softmax classifier generally include a weight parameter W and a bias parameter b. The weight parameter W and the bias parameter b need to be initialized before training.
[0047] See also Figure 3 The initial value of the weight parameter W is determined by the feature vectors extracted by the pre-training feature extraction module from the various types of transmission line training images in the support set. n is the number of categories of transmission line training images, and k is the number of samples of each type of transmission line training images in the support set. After the k transmission line training images of each category are extracted by the pre-training feature extraction module, k feature vectors are obtained. After averaging and normalization, the initial value m of the feature vector of this category is obtained. i , and finally consists of m1, m2, ..., m n The initial value of the weight parameter W. The initial value of the bias parameter b is set to a vector of all zeros.
[0048] Optionally, when training the transmission line defect recognition model using the support set, the cross entropy loss function CrossEntropy is used to construct the following optimization objective function:
[0049]
[0050] Among them, y j To support the label of the j-th transmission line training image in the set, one-hot encoding is used; j is the prediction vector obtained after the j-th transmission line training image in the support set is processed by the improved Softmax classifier.
[0051] Taking the minimum cross entropy between sample labels and predicted values as the objective function, the transmission line training images in the support set are used to train the initialized improved Softmax classifier and the pre-trained feature extraction module. The weight parameter W and bias parameter b of the initialized improved Softmax classifier and the convolutional layer network parameters of the pre-trained feature extraction module are updated to obtain the optimal transmission line defect recognition model.
[0052] Furthermore, in order to improve the feature extraction capability of the transmission line defect recognition model, the adaptive attention module and the multi-layer feature fusion module are used to combine the features extracted from different convolutional layers of the feature extraction module.
[0053] In a possible implementation, the improved Softmax classifier is obtained by replacing the probability distribution calculation method of the Softmax classifier with the following formula:
[0054] p=Softmax(sim(W,q)+b)
[0055] Where p is the probability distribution, Softmax() is the Softmax function, sim() is the cosine similarity function, W is the weight parameter, b is the bias parameter, b=[b1……b n ] T , q is the fusion feature.
[0056] Specifically, the classifier is used to calculate the predicted probability of the feature vector extracted by the feature extraction module. The Softmax classifier is an algorithm for multi-category classification and is widely used in machine learning and deep learning. The Softmax classifier uses the softmax function to map the input data to the probability distribution of the output category. For the Softmax classifier, the input data first passes through a linear transformation, multiplying each input feature with the corresponding weight and summing them, and then adding a bias term. This linear transformation maps the input data into a vector space so that samples of different categories have a certain degree of separation in the vector space. Then, the result of the linear transformation is input into the softmax function to obtain the probability of each category.
[0057] The cosine similarity is introduced into the probability distribution calculation method of the improved Softmax classifier, so that the classifier pays more attention to the similarity between samples when judging the category. The calculation method of cosine similarity is as follows:
[0058]
[0059] in,
[0060] In a possible implementation, the pre-selected layer includes at least a low-level convolutional layer, a middle-level convolutional layer, and a high-level convolutional layer of a feature extraction module.
[0061] Specifically, the pre-selected layer is a convolutional layer pre-selected in each convolutional layer of the feature extraction module. Generally, multiple representative convolutional layers are selected as the source of feature fusion, usually including low-level convolutional layers, middle-level convolutional layers and high-level convolutional layers, so as to combine multi-scale information so that the network can simultaneously utilize low-level features (such as edges and textures, etc.) and high-level features (such as shapes and structures, etc.).
[0062] In a possible implementation, the attention weight includes a channel attention weight and a spatial attention weight; the weighted fusion of the output features of each pre-selected layer according to the attention weight of each pre-selected layer and the preset adaptive weight to obtain the fused features and send them to the improved Softmax classifier for classification includes:
[0063] The output features of each pre-selected layer are aligned to obtain aligned output features of each pre-selected layer.
[0064] The output features of each pre-selected layer are weighted and fused by the following formula to obtain the fusion feature F out :
[0065]
[0066] Where N is the number of pre-selected layers, w i is the adaptive weight of the i-th preselected layer, M c,i is the channel attention weight of the i-th pre-selected layer, ⊙ represents element-by-element multiplication, M s,i is the spatial attention weight of the i-th pre-selected layer, F i is the aligned output feature of the i-th pre-selected layer; α i and α j are the trainable parameters of the i-th and j-th preselected layers, respectively.
[0067] Specifically, the feature maps of each pre-selected layer, i.e., the output features, are resized. Since the feature maps of different layers may have different sizes, they are adjusted to the same size by upsampling or downsampling for subsequent fusion. Common alignment methods include bilinear interpolation or maximum pooling operations. Weighted fusion is performed on the aligned multi-layer feature maps. Feature maps of different pre-selected layers are directly spliced together, while weighted fusion performs weighted summation according to the importance of different pre-selected layers.
[0068] In order to effectively capture the details and semantic information at different levels, the power line defect recognition model is made more accurate and robust in image recognition tasks. By combining the advantages of channel attention and spatial attention, and adaptively fusing features at different levels, the power line defect recognition model can focus on the key areas in the image more flexibly. For each feature layer, the channel attention and spatial attention are calculated separately.
[0069] Channel Attention: Generate channel descriptors through Global Average Pooling (GAP) and Global Max Pooling (GMP), and calculate the importance of each channel through a Multi-layer Perceptron (MLP):
[0070] Mc,i =σ(MLP(GAP(F i ))+MLP(GMP(F i )))
[0071] Among them, F i is the feature map of the i-th pre-selected layer, M c,i is the channel attention weight of the i-th pre-selected layer.
[0072] Spatial attention: The feature map after channel attention enhancement is convolved through the results of average pooling and maximum pooling to obtain the importance of each position:
[0073] M s,i =σ(f 3×3 ([GAP(F i ); GMP(F i )]))
[0074] Among them, M s,i is the spatial attention weight of the i-th pre-selected layer.
[0075] For the feature maps of different pre-selected layers, adaptive weights are calculated. These adaptive weights are used to control the importance of each pre-selected layer in the final fusion. The adaptive weights are calculated as follows:
[0076]
[0077] Among them, α i and α j are the trainable parameters of the i-th and j-th preselected layers, respectively, Used for normalization so that the sum of all weights is 1.
[0078] Specifically, image feature extraction is achieved by applying the triplet network pre-trained on the Tiny-ImageNet dataset, the improved Softmax classifier is trained using transmission line training images, and the network parameters of the improved Softmax classifier and feature extraction module are updated to further improve the image recognition capability in the transmission line defect recognition scenario, and realize the recognition of transmission line defects based on the few-sample learning method.
[0079] The following are device embodiments of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.
[0080] See also Figure 4 In another embodiment of the present invention, a power transmission line defect recognition system is provided, which can be used to implement the above-mentioned power transmission line defect recognition method. Specifically, the power transmission line defect recognition system includes an image acquisition module and a defect recognition module.
[0081] Among them, the image acquisition module is used to acquire the transmission line sampling image; the defect recognition module is used to input the transmission line sampling image into the pre-trained transmission line defect recognition model to obtain the transmission line defect recognition result. Among them, the transmission line defect recognition model includes a feature extraction module based on a convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier; the adaptive attention module is used to obtain the attention weights of each pre-selected layer of the feature extraction module; the multi-layer feature fusion module is used to weightedly fuse the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights, obtain the fused features and send them to the improved Softmax classifier for classification; the improved Softmax classifier is obtained by introducing cosine similarity in the probability distribution calculation of the Softmax classifier.
[0082] In a possible implementation, the pre-trained transmission line defect recognition model is obtained in the following manner: constructing a triplet network based on a feature extraction module, pre-training the triplet network through a preset public image data set to obtain a pre-trained triplet network, and obtaining a transmission line training image and training the pre-trained triplet network according to the transmission line training image to obtain a pre-trained feature extraction module; extracting feature vectors of various types of transmission line training images through the pre-trained feature extraction module and fusing them to obtain an initialization weight parameter of an improved Softmax classifier, and setting the initialization bias parameter of the improved Softmax classifier to 0 to obtain an initialized improved Softmax classifier; using the pre-trained feature extraction module and the initialized improved Softmax classifier to replace the feature extraction module and the improved Softmax classifier in the transmission line defect recognition model respectively, and training the transmission line defect recognition model according to the transmission line training image to obtain a pre-trained transmission line defect recognition model.
[0083] All relevant contents of each step involved in the embodiment of the aforementioned power transmission line defect identification method can be referred to the functional description of the functional modules corresponding to the power transmission line defect identification system in the embodiment of the present invention, and will not be repeated here.
[0084] The division of modules in the embodiments of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present invention may be integrated into one processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0085] In another embodiment of the present invention, a computer device is provided, the computer device including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used for the operation of the power transmission line defect identification method.
[0086] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It can be understood that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the power transmission line defect identification method in the above embodiment.
[0087] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0088] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0089] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for identifying defects in a power transmission line, characterized in that: include: Acquire transmission line sampling images; Inputting the transmission line sampling image into the pre-trained transmission line defect recognition model to obtain the transmission line defect recognition result; Among them, the transmission line defect recognition model includes a feature extraction module based on convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier; the adaptive attention module is used to obtain the attention weights of each pre-selected layer of the feature extraction module; the multi-layer feature fusion module is used to weightedly fuse the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights, obtain the fused features and send them to the improved Softmax classifier for classification; the improved Softmax classifier is obtained by introducing cosine similarity in the probability distribution calculation of the Softmax classifier.
2. The method for identifying power transmission line defects according to claim 1, characterized in that: The pre-trained transmission line defect recognition model is obtained in the following manner: A triplet network is constructed based on the feature extraction module, the triplet network is pre-trained by using a preset public image data set to obtain a pre-trained triplet network, and a transmission line training image is obtained and the pre-trained triplet network is trained according to the transmission line training image to obtain a pre-trained feature extraction module; The feature vectors of various transmission line training images are extracted and fused through the pre-trained feature extraction module to obtain the initialization weight parameters of the improved Softmax classifier, and the initialization bias parameters of the improved Softmax classifier are set to 0 to obtain the initialized improved Softmax classifier; The pre-trained feature extraction module and the initialized improved Softmax classifier are used to replace the feature extraction module and the improved Softmax classifier in the transmission line defect recognition model respectively, and the transmission line defect recognition model is trained according to the transmission line training image to obtain the pre-trained transmission line defect recognition model.
3. The method for identifying power transmission line defects according to claim 2, characterized in that: The feature vectors of various transmission line training images are extracted and fused by the pre-trained feature extraction module to obtain the initialization weight parameters of the improved Softmax classifier, including: Extract feature vectors of various types of transmission line training images through a pre-trained feature extraction module; The feature vectors of various transmission line training images are averaged and normalized to obtain initial values of the feature vectors of various transmission line training images, and the initial values of the feature vectors of various transmission line training images are used as initialization weight parameters of the improved Softmax classifier.
4. The method for identifying power transmission line defects according to claim 1, characterized in that: The improved Softmax classifier is obtained by replacing the probability distribution calculation method of the Softmax classifier with the following formula: p=Softmax(sim(W,q)+b) Among them, p is the probability distribution, Softmax() is the Softmax function, sim() is the cosine similarity function, W is the weight parameter, b is the bias parameter, and q is the fusion feature.
5. The method for identifying power transmission line defects according to claim 1, characterized in that: The pre-selected layers include at least a low-level convolutional layer, a middle-level convolutional layer and a high-level convolutional layer of the feature extraction module.
6. The method for identifying power transmission line defects according to claim 1, characterized in that: The attention weights include channel attention weights and spatial attention weights; The step of weighting and fusing the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights to obtain the fused features and sending them to the improved Softmax classifier for classification includes: Align the output features of each pre-selected layer to obtain aligned output features of each pre-selected layer; The output features of each pre-selected layer are weighted and fused by the following formula to obtain the fusion feature F out : Where N is the number of pre-selected layers, w i is the adaptive weight of the i-th preselected layer, M c,i is the channel attention weight of the i-th pre-selected layer, ⊙ represents element-by-element multiplication, M s,i is the spatial attention weight of the i-th pre-selected layer, F i is the aligned output feature of the i-th pre-selected layer; α i and α j are the trainable parameters of the i-th and j-th preselected layers, respectively.
7. A transmission line defect identification system, characterized in that: include: An image acquisition module, used for acquiring a sampling image of a transmission line; A defect recognition module is used to input the transmission line sampling image into the pre-trained transmission line defect recognition model to obtain the transmission line defect recognition result; Among them, the transmission line defect recognition model includes a feature extraction module based on convolutional neural network, an adaptive attention module, a multi-layer feature fusion module and an improved Softmax classifier; the adaptive attention module is used to obtain the attention weights of each pre-selected layer of the feature extraction module; the multi-layer feature fusion module is used to weightedly fuse the output features of each pre-selected layer according to the attention weights of each pre-selected layer and the preset adaptive weights, obtain the fused features and send them to the improved Softmax classifier for classification; the improved Softmax classifier is obtained by introducing cosine similarity in the probability distribution calculation of the Softmax classifier.
8. The power transmission line defect identification system according to claim 7, characterized in that: The pre-trained transmission line defect recognition model is obtained in the following manner: A triplet network is constructed based on the feature extraction module, the triplet network is pre-trained by using a preset public image data set to obtain a pre-trained triplet network, and a transmission line training image is obtained and the pre-trained triplet network is trained according to the transmission line training image to obtain a pre-trained feature extraction module; The feature vectors of various transmission line training images are extracted and fused through the pre-trained feature extraction module to obtain the initialization weight parameters of the improved Softmax classifier, and the initialization bias parameters of the improved Softmax classifier are set to 0 to obtain the initialized improved Softmax classifier; The pre-trained feature extraction module and the initialized improved Softmax classifier are used to replace the feature extraction module and the improved Softmax classifier in the transmission line defect recognition model respectively, and the transmission line defect recognition model is trained according to the transmission line training image to obtain the pre-trained transmission line defect recognition model.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the power transmission line defect identification method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the power transmission line defect identification method according to any one of claims 1 to 6 are implemented.