Disclosure of Invention
The invention aims to overcome the defects and problems in the prior art and provide a power transmission line reliability prediction method, system and equipment with high accuracy based on SENet and EffNet.
In order to achieve the above purpose, the technical solution of the invention is that a transmission line reliability prediction method based on SENet and EffNet comprises the following steps:
S1, acquiring image data of a target area of a power transmission line, wherein the image data comprises a wire, an insulator, a tower, a line fitting, a stay wire and a grounding device;
S2, constructing a power transmission line CNN model based on Keras frames, wherein the CNN model comprises a convolution layer, a fusion module, a pooling layer, a full-connection layer, an activation function, a batch normalization layer, a composite scaling layer and a decision layer, wherein the fusion module is obtained by fusion of a CNN-SENet module and a EFFICIENTNET module, the CNN-SENet module comprises an SE module, the EFFICIENTNET module comprises a MBConv module, and the Keras frame comprises a splicing layer;
S3, inputting the image data into a convolution layer to obtain an image feature map, inputting the image feature map into a fusion module to fuse the SE module and the MBConv module, outputting the enhancement features of the image feature map, and inputting the enhancement features into a pooling layer to obtain global features;
The steps of fusing the SE module and the MBConv module are as follows:
S31, inputting an image feature map, expanding the initial channel number of the image feature map through a MBConv module, and carrying out depth separable convolution to obtain a feature map after the depth separable convolution;
S32, embedding the SE module into the MBConv module, and carrying out recalibration and projection convolution on the channel number of the feature map after the depth separable convolution;
S33, carrying out point-by-point convolution on the output characteristic diagram after projection convolution, and then carrying out residual connection on the characteristic diagram after point-by-point convolution under the condition that the channel number of the characteristic diagram after point-by-point convolution is the same as the initial channel number and the step length is 1, so as to realize the fusion of an SE module and a MBConv module;
S4, acquiring electrical parameters, environmental parameters and weather data of a target area of the power transmission line in real time, performing data splicing on the electrical parameters and the weather data through a splicing layer, and then inputting the spliced data and global features into a full-connection layer for fusion to obtain a comprehensive feature vector;
S5, performing nonlinear transformation on the comprehensive feature vectors by an activation function to obtain feature vectors after activation processing, inputting the feature vectors into a batch normalization layer to obtain normalized feature vectors, and inputting the normalized feature vectors into a composite scaling layer to adjust the scale of the feature vectors to obtain final feature vectors;
S6, inputting the final feature vector into a decision layer for prediction to obtain a reliability prediction result of the power transmission line;
And S7, mapping the reliability prediction result to a corresponding position on the map, and displaying the reliability of the transmission line corresponding to the visual element.
The step S32 specifically includes:
s321, carrying out global average pooling on the feature map after the depth separable convolution to obtain a first global feature of each channel;
s322, processing the first global feature through the first full-connection layer, the second full-connection layer and the activation function to generate a channel attention weight;
the expression of the first full connection layer is as follows:
Xse1=ReLU(Dense(Xgap,Wse1));
Wherein Xse1 is the feature processed by the first full connection layer Dense and ReLU activation function, Xgap is the first global feature, Wse1 is the weight of the first connection layer;
the expression of the second full connection layer is as follows:
Xse2=σ(Dense(Xse1,Wse2));
Xse2 is the channel attention weight processed by the second full connection layer Dense and sigma activation function, and Wse2 is the weight of the second connection layer;
s323, multiplying the generated channel attention weight by the characteristic diagram after the depth separable convolution, and carrying out recalibration on the channel number to obtain a recalibrated characteristic diagram, wherein the expression is as follows:
X′=X⊙Xse2;
X' is a feature map after the calibration, X is a feature map after the depth separable convolution, and the addition indicates the multiplication operation of elements;
s324, projecting the channel number of the recalibrated feature map to the initial channel number to complete projection convolution, wherein the expression is as follows:
Y=W·X′;
wherein Y is the output characteristic diagram after projection convolution, and W is the weight matrix.
The step S6 specifically includes:
S61, inputting the final feature vector into a decision layer, minimizing an objective function in the decision layer, and determining a weight vector and a bias term of the CNN model according to constraint conditions of the objective function under the condition that the objective function is minimized;
The expression of the objective function is as follows:
w is a weight vector, W2 is a coefficient of the weight vector, C is a penalty parameter, xii is a relaxation variable, and n is the number of samples;
the expression of the constraint condition is as follows:
yi(w·xi+b)≥1-ξi,ξi≥0,i=1,2,...,n;
W is a weight vector, yi is a label of a sample i, xi is an ith final feature vector, and b is a bias term;
s62, calculating a decision function in a decision layer based on the weight vector and the bias term to obtain a reliability predicted value of the power transmission line;
the expression of the decision function is as follows:
y=f(w·x+b);
wherein y is a reliability predicted value, f is an activation function, w is a weight vector, x is an input of a decision layer, and b is a bias term;
S63, the reliability prediction value is counted into probability distribution through a Softmax function so as to represent the probability of different reliability levels.
The step S7 specifically includes:
s71, calculating reliability predicted values of all target areas, and mapping the reliability predicted values of the power transmission lines of all the target areas to corresponding positions on a map through a GIS interface;
and S72, displaying the power transmission lines corresponding to the different reliability predicted values with different visual elements based on the different reliability predicted values.
The activation function is a leak ReLU function.
A transmission line reliability prediction system based on SENet and EffNet, the system comprising:
The image data acquisition module is used for acquiring image data of a target area of the power transmission line, wherein the image data comprises a wire, an insulator, a tower, a line fitting, a stay wire and a grounding device;
The power transmission line CNN model construction module is used for constructing a power transmission line CNN model based on a Keras framework, wherein the CNN model comprises a convolution layer, a fusion module, a pooling layer, a full connection layer, an activation function, a batch normalization layer, a composite scaling layer and a decision layer, the fusion module is obtained by fusion of a CNN-SENet module and a EFFICIENTNET module, the CNN-SENet module comprises a SE module, the EFFICIENTNET module comprises a MBConv module, and the Keras framework comprises a splicing layer;
The feature enhancement module is used for inputting the image data into the convolution layer to obtain an image feature map, inputting the image feature map into the fusion module to fuse the SE module and the MBConv module, outputting the enhancement features of the image feature map, and inputting the enhancement features into the pooling layer to obtain global features;
The steps of fusing the SE module and the MBConv module are as follows:
S31, inputting an image feature map, expanding the initial channel number of the image feature map through a MBConv module, and carrying out depth separable convolution to obtain a feature map after the depth separable convolution;
S32, embedding the SE module into the MBConv module, and carrying out recalibration and projection convolution on the channel number of the feature map after the depth separable convolution;
S33, carrying out point-by-point convolution on the output characteristic diagram after projection convolution, and then carrying out residual connection on the characteristic diagram after point-by-point convolution under the condition that the channel number of the characteristic diagram after point-by-point convolution is the same as the initial channel number and the step length is 1, so as to realize the fusion of an SE module and a MBConv module;
The feature fusion module is used for acquiring the electrical parameters, the environmental parameters and the weather data of the target area of the power transmission line in real time, splicing the electrical parameters and the weather data through the splicing layer, and inputting the spliced data and the global features into the full-connection layer for fusion to obtain a comprehensive feature vector;
The activation normalization module is used for carrying out nonlinear transformation on the comprehensive feature vectors by an activation function to obtain feature vectors after activation processing, inputting the feature vectors into the batch normalization layer to obtain normalized feature vectors, and inputting the normalized feature vectors into the composite scaling layer to adjust the scale of the feature vectors to obtain final feature vectors;
the decision prediction module is used for inputting the final feature vector into a decision layer for prediction to obtain a reliability prediction result of the power transmission line;
And the result display module is used for mapping the reliability prediction result to a corresponding position on the map and displaying the reliability of the transmission line corresponding to the visual element.
The feature enhancement module performs recalibration and projection convolution according to the following steps:
s321, carrying out global average pooling on the feature map after the depth separable convolution to obtain a first global feature of each channel;
s322, processing the first global feature through the first full-connection layer, the second full-connection layer and the activation function to generate a channel attention weight;
the expression of the first full connection layer is as follows:
Xse1=ReLU(Dense(Xgap,Wse1));
Wherein Xse1 is the feature processed by the first full connection layer Dense and ReLU activation function, Xgap is the first global feature, Wse1 is the weight of the first connection layer;
the expression of the second full connection layer is as follows:
Xse2=σ(Dense(Xse1,Wse2));
Xse2 is the channel attention weight processed by the second full connection layer Dense and sigma activation function, and Wse2 is the weight of the second connection layer;
s323, multiplying the generated channel attention weight by the characteristic diagram after the depth separable convolution, and carrying out recalibration on the channel number to obtain a recalibrated characteristic diagram, wherein the expression is as follows:
X′=X⊙Xse2;
X' is a feature map after the calibration, X is a feature map after the depth separable convolution, and the addition indicates the multiplication operation of elements;
s324, projecting the channel number of the recalibrated feature map to the initial channel number to complete projection convolution, wherein the expression is as follows:
Y=W·X′;
wherein Y is the output characteristic diagram after projection convolution, and W is the weight matrix.
The decision prediction module predicts the reliability of the power transmission line according to the following steps:
S61, inputting the final feature vector into a decision layer, minimizing an objective function in the decision layer, and determining a weight vector and a bias term of the CNN model according to constraint conditions of the objective function under the condition that the objective function is minimized;
The expression of the objective function is as follows:
w is a weight vector, W2 is a coefficient of the weight vector, C is a penalty parameter, xii is a relaxation variable, and n is the number of samples;
the expression of the constraint condition is as follows:
yi(w·xi+b)≥1-ξi,ξi≥0,i=1,2,...,n;
W is a weight vector, yi is a label of a sample i, xi is an ith final feature vector, and b is a bias term;
s62, calculating a decision function in a decision layer based on the weight vector and the bias term to obtain a reliability predicted value of the power transmission line;
the expression of the decision function is as follows:
y=f(w·x+b);
wherein y is a reliability predicted value, f is an activation function, w is a weight vector, x is an input of a decision layer, and b is a bias term;
S63, the reliability prediction value is counted into probability distribution through a Softmax function so as to represent the probability of different reliability levels.
The result display module displays the reliability according to the following steps:
s71, calculating reliability predicted values of all target areas, and mapping the reliability predicted values of the power transmission lines of all the target areas to corresponding positions on a map through a GIS interface;
and S72, displaying the power transmission lines corresponding to the different reliability predicted values with different visual elements based on the different reliability predicted values.
A transmission line reliability prediction apparatus based on SENet and EffNet, the apparatus comprising a processor and a memory;
The memory is used for storing computer program codes and transmitting the computer program codes to the processor;
The processor is configured to execute the above-described transmission line reliability prediction method based on SENet and EffNet according to instructions in the computer program code.
Compared with the prior art, the invention has the beneficial effects that:
In the application, the method comprehensively considers various data sources such as image data, electric data and weather data to comprehensively reflect the actual running state of the power transmission line and the influence of external environment, extracts and fuses multi-level characteristics through structures such as a convolution layer, a fusion module and a pooling layer to obtain more abundant and meaningful characteristic representation, fuses the image characteristics, the electric data and the weather data through a full connection layer to construct comprehensive characteristic vectors, can effectively integrate the characteristics of the multi-source data to form comprehensive description of the power transmission line state, can capture the complex characteristic relationship through nonlinear transformation, and normalize the characteristics, reduces the internal covariant offset in the model training process, improves the training efficiency and stability of the model, and in addition, adjusts the scale of the characteristics through a composite layer, outputs the reliability prediction value of the power transmission line through a decision layer.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings and detailed description.
Example 1:
referring to fig. 1, a power transmission line reliability prediction method based on SENet and EffNet includes:
S1, acquiring image data of a target area of a power transmission line, wherein the image data comprises a wire, an insulator, a tower, a line fitting, a stay wire and a grounding device;
In this embodiment, the high-resolution image capturing apparatus or the unmanned aerial vehicle is used to capture the image data of the power transmission line in the target area, and the obtained image data includes various details of the power transmission line, including wires, insulators, towers, line fittings, stay wires, grounding devices, and the like.
S2, constructing a power transmission line CNN model based on a Keras framework, wherein the CNN model comprises a convolution layer (preferably at least three layers of convolution layers), a fusion module, a pooling layer, a full-connection layer, an activation function, a batch normalization layer, a composite scaling layer and a decision layer, the fusion module is obtained by fusing a CNN-SENet module and a EFFICIENTNET module, the CNN-SENet module comprises an SE module, the EFFICIENTNET module comprises a MBConv module, and the Keras framework comprises a splicing layer;
S3, inputting the image data into a convolution layer to obtain an image feature map, inputting the image feature map into a fusion module to fuse the SE module and the MBConv module, outputting the enhancement features of the image feature map, and inputting the enhancement features into a pooling layer to obtain global features;
Further, in the scheme, the image data is input to a convolution layer of a Convolutional Neural Network (CNN), and the convolution layer extracts features in the image through a series of convolution operations. The principle of convolution operation is to slide over an image by convolution kernels (filters) and calculate the dot product of the convolution kernels with a local region of the image, thereby extracting features of that region, whereas multiple convolution kernels may extract different features, such as edges, textures, shapes, etc., and through a multi-layer convolution operation, the obtained image features gradually transition from low-level features to high-level features, such as from edges and textures to objects and scenes, and then the high-level features are further processed and combined in subsequent layers to form a comprehensive understanding of the image.
Furthermore, the fusion module in the scheme is obtained based on the fusion of the CNN-SENet module and the EFFICIENTNET module, and the design purpose of the fusion module is to further enhance the characteristics on the basis of extracting the image characteristics, so that the characteristics are more discernable and representative. Specifically, the CNN-SENet module introduces an attention mechanism, the attention of important features is enhanced by weighting the channels of the feature map, the EFFICIENTNET module enhances the performance of the model while maintaining efficient calculation by a composite scaling strategy, and the enhanced features output by the fusion module after the image features are input to the fusion module not only comprise the key features brought by the attention mechanism of the CNN-SENet module, but also comprise the efficient features optimized by the EFFICIENTNET module.
Furthermore, the pooling layer in the scheme has the main functions of reducing and compressing the feature map, retaining important feature information, reducing the size of the feature map through pooling operation, reducing the computational complexity and enhancing the robustness of the model. In this embodiment, the pooling operation may be maximum pooling in which the maximum value is taken as output in the pooling window, so that the salient features in the feature map can be highlighted, or average pooling in which the average value is taken as output in the pooling window, so that the noise in the feature map can be smoothed. After the enhanced features are input into the pooling layer, the obtained global features not only keep important information in the original feature map, but also reduce the size of the feature map through pooling operation. The global features are the integral description of the input image and comprise important information of each part in the image, and through the processing of the pooling layer, the global features provide concise and effective input for subsequent feature fusion and decision.
In this embodiment, the steps of fusing the SE module and MBConv module are as follows:
S31, inputting an image feature map, expanding the initial channel number of the image feature map through a MBConv module, and carrying out depth separable convolution to obtain a feature map after the depth separable convolution;
S32, embedding the SE module into the MBConv module, and carrying out recalibration and projection convolution on the channel number of the feature map after the depth separable convolution;
further, the method specifically comprises the following steps:
s321, carrying out global average pooling on the feature map after the depth separable convolution to obtain a first global feature of each channel;
Further, the feature map after the depth separable convolution is subjected to global average pooling, so that the first global feature of each channel can be obtained, and the global average pooling is a method for compressing the space dimension of the feature map into a single value, and a global feature vector is generated by averaging all pixel points of each channel. Specifically, the feature map is assumed to have dimensions H×W×C, where H represents height, W represents width, and C represents the number of channels. The global averaging pooling averages the H multiplied by W values of each channel to obtain a vector with the size of 1 multiplied by C, the spatial information of each channel can be compressed into a global feature, the whole information of each channel is reserved, the data volume is reduced, and concise input is provided for the subsequent full-connection layer processing.
S322, processing the first global feature through the first full-connection layer, the second full-connection layer and the activation function to generate a channel attention weight;
Further, the first global feature is processed through the first full connection layer, the second full connection layer and the activation function to generate the channel attention weight. First, the first fully-connected layer compresses the dimension of the global feature vector from C to a smaller dimension r, where r is a super-parameter, which is typically smaller to reduce the amount of computation. Then, through the ReLU activation function, nonlinear features are added to enable the model to learn more complex features, then the dimension is restored from r to C through the second full connection layer, and the output value is limited between 0 and 1 through the sigma (Sigmoid) activation function, so that channel attention weights are generated, the channel attention weights reflect the importance of each channel, and the larger the value is, the higher the importance of the channel is.
The expression of the first full connection layer is as follows:
Xse1=ReLU(Dense(Xgap,Wse1));
Wherein Xse1 is the feature processed by the first full connection layer Dense and ReLU activation function, Xgap is the first global feature, Wse1 is the weight of the first connection layer;
the expression of the second full connection layer is as follows:
Xse2=σ(Dense(Xse1,Wse2));
Xse2 is the channel attention weight processed by the second full connection layer Dense and sigma activation function, and Wse2 is the weight of the second connection layer;
s323, multiplying the generated channel attention weight by the characteristic diagram after the depth separable convolution, and carrying out recalibration on the channel number to obtain a recalibrated characteristic diagram, wherein the expression is as follows:
X′=X⊙Xse2;
X' is a feature map after the calibration, X is a feature map after the depth separable convolution, and the addition indicates the multiplication operation of elements;
Further, multiplying the generated channel attention weight by the characteristic diagram after the depth separable convolution to recalibrate the channel number. Specifically, the channel attention weight is a vector of 1×1×c, and is multiplied by each channel of the feature map, and the feature value of each channel is adjusted. By the mode, the important channels are amplified and the unimportant channels are suppressed, so that the important recalibration of the channels of the feature map is realized, the important feature information is reserved in the recalibrated feature map, the feature expression capacity of the model is enhanced, and the recognition accuracy of the model is improved.
S324, projecting the channel number of the recalibrated feature map to the initial channel number to complete projection convolution, wherein the expression is as follows:
Y=W·X′;
wherein Y is the output characteristic diagram after projection convolution, and W is the weight matrix.
Further, the channel number of the recalibrated feature map is projected to the initial channel number, the projection convolution is realized through 1×1 convolution, and the channel number of the recalibrated feature map is projected from C back to the initial channel number C0. A 1×1 convolution is an efficient convolution operation that integrates and compresses information of a plurality of channels by performing linear transformation at each pixel point. Assuming that the feature map after recalibration is h×w×c and the initial channel number is C0, the output of the projective convolution is h×w×c0, and the calculation formula of the 1×1 convolution is y=w·x'. Through the operation, the channel number of the feature map is compressed to the initial channel number, meanwhile, important feature information after recalibration is reserved, the effect of projection convolution is that the channel number of the feature map is reduced, the calculation complexity is reduced, meanwhile, the size and important features of the feature map are maintained, and the calculation efficiency and feature expression capability of a subsequent network layer are ensured.
In the embodiment, the global characteristics of each channel are extracted through global averaging pooling, the channel attention weight is generated by using the full connection layer and the activation function, the channels of the feature map are recalibrated and optimized, and finally the channel number of the feature map is adjusted through projection convolution, so that the expression capacity of the feature map is effectively enhanced, the model can pay attention to important characteristics better, the structure and information quantity of the feature map are optimized while the calculation efficiency is maintained, and more valuable input is provided for the subsequent network layer.
S33, carrying out point-to-point convolution on the output feature map after projection convolution, and then carrying out residual connection on the feature map after point-to-point convolution under the condition that the channel number of the feature map after point-to-point convolution is the same as the initial channel number and the step length is 1, so as to realize fusion of the SE module and the MBConv module.
In this embodiment, the feature map is obtained by the previous several layers of convolution operations, and includes various feature information of the image. The initial channel number of the feature map indicates the depth of the feature map, i.e. how many independent feature channels are included in the feature map, the input of the feature map is the basis of the whole fusion process, the subsequent operation will be processed and optimized based on the input feature map, and the process of inputting the feature map can be understood as taking the output of the previous layer of network as the input of the current layer, and the feature map includes various feature information extracted by the previous layers of network, such as edges, textures and the like.
The initial channel number of the feature map is expanded by MBConv modules and the feature map is subjected to depth separable convolution. The MBConv module is a core component of EFFICIENTNET, the expression capacity of the feature map is increased by expanding the number of channels of the feature map, the depth separable convolution is an efficient convolution operation, the standard convolution is decomposed into a depth convolution and a point-by-point convolution, so that the calculated amount is greatly reduced, the depth convolution independently carries out convolution operation on each channel, the point-by-point convolution integrates the features of each channel through 1x1 convolution, and the size and the number of channels of the feature map are optimized after the depth separable convolution, so that more useful features are extracted. Specifically, the depth convolution processes each channel independently, the spatial characteristics of each channel are reserved, and the point-by-point convolution fuses the information of each channel together through a 1x1 convolution operation, so that the high-level characteristics are further extracted. The advantage of the depth separable convolution is that it enables extraction of more rich feature information while maintaining computational efficiency.
After the depth separable convolution, embedding MBConv a SE module into the SE module, carrying out recalibration and projection convolution on the channel number of the feature map after the depth separable convolution, carrying out recalibration on the channel number of the feature map by the SE module through calculating the importance weight of each channel, namely adjusting the weight of each channel, so that important feature channels are enhanced, unimportant feature channels are restrained, and the projection convolution is used for projecting the channel number of the feature map after recalibration back to the initial channel number, so that the consistency of the size and the channel number of the feature map is maintained, the projection convolution is realized through 1x1 convolution, the channel number of the feature map after recalibration is consistent with the initial channel number, the important features are enhanced through recalibration of the SE module, and meanwhile, the channel number of the feature map is ensured to be unchanged through the projection convolution.
The method comprises the steps of carrying out point-by-point convolution on a feature map after projection convolution, carrying out residual connection on the feature map after the point-by-point convolution under the condition that the channel number of the feature map after the point-by-point convolution is the same as the initial channel number and the step length is 1, realizing the integration of MBConv modules and SE modules, integrating the channels of the feature map through 1x1 convolution to enable the channel number of the feature map to be consistent with the initial channel number, wherein residual connection is an effective feature integration method, and the method comprises the steps of adding an input feature map and a processed feature map, retaining information in the input feature map, enhancing the expression capability of the processed feature map, effectively integrating the features of MBConv modules and SE modules through residual connection, and enabling the output feature map to comprise rich features extracted by depth separable convolution and important features after the SE modules are recalibrated, so that the expression capability and identification degree of the feature map are improved. The residual connection has the advantages that the gradient vanishing problem can be relieved, the training and convergence of the network are promoted, and meanwhile, the effective transmission and fusion of the feature images among different modules are ensured.
The MBConv module and the SE module of the embodiment are fused, so that the output feature map not only contains rich features extracted by the depth separable convolution, but also contains important features after recalibration of the SE module, and the expression capability and the identification degree of the feature map are effectively improved.
S4, acquiring electrical parameters, environmental parameters and weather data of a target area of the power transmission line in real time, performing data splicing on the electrical parameters and the weather data through a splicing layer, and then inputting the spliced data and global features into a full-connection layer for fusion to obtain a comprehensive feature vector;
Further, the electrical parameters and the environmental parameters can be obtained in real time through sensors arranged on the power transmission line, the electrical parameters comprise current, voltage and the like, the environmental parameters comprise temperature, humidity and the like, and the gas number data can be obtained through weather stations or online weather services, wherein the gas number data comprise temperature, humidity, wind speed, rainfall and the like.
Sensor data and weather data are important external factors influencing the reliability of the power transmission line, in the scheme, the data and global characteristics are input into a full-connection layer together, the data from different sources are fused through linear transformation of the full-connection layer, a comprehensive feature vector is obtained, the comprehensive feature vector contains comprehensive information of image characteristics, sensor data and weather data, the state of the power transmission line and the influence of external environment can be comprehensively reflected, and the prediction capability of the reliability of the power transmission line is enhanced through feature fusion.
Furthermore, the CNN model in the present solution adopts Keras to construct and train a deep learning model, keras includes a splicing layer (Concatenate layer) to input the sensor data, the weather data and the global feature into the full-connection layer, so as to obtain the comprehensive feature vector. In operation, sensor data and weather data are spliced through Concatenate layers to integrate data from different sources into one integral input. Specifically, concatenate layers are one of Keras for stitching multiple tensors along a specified axis. Assuming that the shape of the sensor data is (N, D1), the shape of the weather data is (N, D2), where N is the number of samples, D1 and D2 are the characteristic dimensions of the sensor data and the weather data, respectively, and the Concatenate layer splices the two data in the characteristic dimensions to obtain spliced data with the shape of (N, d1+d2), a specific implementation may be implemented by Concatenate layers of Keras. In this way, the spliced data contains all the characteristics of the sensor data and the weather data, and complete input is provided for subsequent characteristic fusion. The method can integrate data from different sources into a whole, and retains the respective characteristic information, so that the subsequent processing and analysis are facilitated.
In the scheme, the spliced data are subjected to feature fusion with global features through the full connection layer, so that a comprehensive feature vector is obtained. The fully connected layer (Dense layer) is a common neural network layer used to map input data to a new feature space.
In this embodiment, the shape of the global feature is (N, G), where G is the dimension of the global feature. During operation, the spliced data is processed through one or more full-connection layers, high-level features are extracted, the output shape of the full-connection layers is (N, H), wherein H is the output dimension of the full-connection layers, the processed data is spliced with global features, and the processed data is further processed through one or more full-connection layers, so that a comprehensive feature vector is finally obtained. Specific implementations may be realized through the Dense layer of Keras and the Concatenate layer. In this way, the integrated feature vector contains fusion information of the sensor data, weather data, and global features.
In the embodiment, the features from different sources are fused to generate a comprehensive feature vector containing all important information, so that subsequent model training and prediction are facilitated, and the model can better capture the relationship between data through the feature fusion, and the accuracy and the robustness of prediction are improved.
S5, performing nonlinear transformation on the comprehensive feature vectors by an activation function to obtain feature vectors after activation processing, inputting the feature vectors into a batch normalization layer to obtain normalized feature vectors, and inputting the normalized feature vectors into a composite scaling layer to adjust the scale of the feature vectors to obtain final feature vectors;
furthermore, in the scheme, the comprehensive feature vector is subjected to nonlinear transformation through an activation function to obtain the feature vector after activation processing, and the function of the activation function is to introduce nonlinear factors, so that the neural network can fit a complex nonlinear relation. In this embodiment, the activation function is preferably a teaky ReLU function, which has the advantages of simple calculation and fast convergence, and when the input of the teaky ReLU function is a non-negative value, the output of the teaky ReLU is the same as the input, and when the input of the teaky ReLU function is a negative value, the output of the teaky ReLU is a positive number. The comprehensive feature vector is input into an activation function, and the linear relation in the feature vector is broken through nonlinear transformation, so that the complex feature relation can be fitted better, the feature vector after the activation processing contains the feature information after nonlinear transformation, the expression capacity and fitting capacity of the model are enhanced, the complex relation among the features can be captured by the model through introducing nonlinear factors, and the prediction precision of the reliability of the power transmission line is improved.
Furthermore, the main function of the batch normalization layer is to perform normalization processing on the feature vectors, so that the distribution of the feature vectors is more stable, the training process of the model is accelerated, and the stability of the model is improved. Specifically, the batch normalization layer performs normalization processing on the feature vectors by calculating the mean value and standard deviation of the feature vectors, so that the mean value of the feature vectors is zero, and the standard deviation is one. The feature vectors after normalization processing have more stable distribution, the adverse effect of overlarge or overlarge feature values on model training is avoided, the feature vectors after activation processing are input into a batch normalization layer, the obtained feature vectors after normalization processing have more stable distribution, subsequent feature processing and decision making are facilitated, the distribution of the feature vectors is more stable, and the training efficiency and stability of the model are improved.
Further, the normalized feature vector is input into a composite scaling layer to obtain a final feature vector, the composite scaling layer is used for further adjusting the feature vector to enable the dimension of the feature vector to be more reasonable, so that the prediction capability of a model is improved, and the composite scaling layer is used for adjusting the dimension of the feature vector by linearly transforming the feature vector to enable each dimension of the feature vector to have similar importance on the same dimension. Specifically, the composite scaling layer performs scaling adjustment on each dimension of the feature vector through the learned scaling factors, so that each dimension of the feature vector has similar importance on the same scale, the normalized feature vector is input into the composite scaling layer, the obtained final feature vector has more reasonable scale through scaling adjustment, subsequent decision is facilitated, each dimension of the feature vector has similar importance on the same scale through scaling adjustment, and the prediction capability of the model is improved.
S6, inputting the final feature vector into a decision layer for prediction to obtain a reliability prediction result of the power transmission line;
Further, the final feature vector is input into a decision layer to obtain a reliability predicted value of the power transmission line, the decision layer is used for processing the final feature vector to obtain the reliability predicted value of the power transmission line, and the decision layer adopts a classifier to obtain a predicted result through linear transformation and nonlinear transformation of the final feature vector. Specifically, the decision layer calculates the scores of all the categories by performing linear transformation on the final feature vector, and obtains a final predicted value by performing linear and nonlinear transformation on the final feature vector through an activation function, wherein the predicted value reflects the probability that the power transmission line can normally run within a certain time and does not have faults.
Further, the method specifically comprises the following steps:
S61, inputting the final feature vector into a decision layer, minimizing an objective function in the decision layer, and determining a weight vector and a bias term of the CNN model according to constraint conditions of the objective function under the condition that the objective function is minimized;
The expression of the objective function is as follows:
w is a weight vector, W2 is a coefficient of the weight vector, C is a penalty parameter, xii is a relaxation variable, and n is the number of samples;
the expression of the constraint condition is as follows:
yi(w·xi+b)≥1-ξi,ξi≥0,i=1,2,...,n;
W is a weight vector, yi is a label of a sample i, xi is an ith final feature vector, and b is a bias term;
Further, the final feature vector is input into the decision layer in the scheme, so that the objective function in the decision layer is minimized. The decision layer is typically the last layer of the neural network, responsible for generating the final prediction result. The objective function (loss function) is a function which needs to be optimized in the model training process, and after the final feature vector is input into the decision layer, the model is trained through a back propagation algorithm, so that parameters (comprising weight vectors and bias items) of the model are adjusted to minimize the value of the objective function. The back-propagation algorithm gradually updates the parameters by calculating the gradient of the objective function with respect to each parameter, so that the objective function gradually converges to a minimum value, in this way, the weight vector and the bias term of the model are continuously adjusted in the training process so as to minimize the value of the objective function, and the model can be more accurately fitted with training data by optimizing the parameters of the model, so that the prediction accuracy is improved.
S62, calculating a decision function in a decision layer based on the weight vector and the bias term to obtain a reliability predicted value of the power transmission line;
the expression of the decision function is as follows:
y=f(w·x+b);
Wherein y is a reliability predicted value, f is an activation function, W is a weight vector, x is an input of a decision layer, and b is a bias term;
Further, the decision function in this scheme is a function of the model to generate the prediction result, typically a linear or nonlinear transformation. Assuming that the input of the decision layer is x, the weight vector is W, and the bias term is b, the decision function can be expressed as y=f (w·x+b). The prediction value of the model can be obtained by calculating the decision function, and in the reliability prediction task of the power transmission line, the prediction value represents the reliability score of the power transmission line, and in this way, the output of the model is the reliability prediction value of the power transmission line.
S63, the reliability prediction value is counted into probability distribution through a Softmax function so as to represent the probability of different reliability levels.
Further, the predicted value of the model finally output by the decision function is a probability distribution calculated by a Softmax function. The output of the model is converted to a probability distribution by a Softmax function, one probability value for each class. For transmission line reliability prediction tasks, these probability values may be expressed as probabilities of different reliability levels. For example, assuming the model outputs three categories, high reliability, medium reliability, and low reliability, the model output may be [0.7,0.2,0.1], indicating that the transmission line has a probability of 70% being high reliability, 20% being medium reliability, and 10% being low reliability.
The embodiment generates a final prediction result, provides quantitative evaluation on the reliability of the power transmission line, and the reliability prediction value can be used for preventive maintenance and decision support to help improve the reliability and safety of the power transmission line.
And S7, mapping the reliability prediction result to a corresponding position on the map, and displaying the reliability of the transmission line corresponding to the visual element.
Further, the method specifically comprises the following steps:
s71, calculating reliability predicted values of all target areas, and mapping the reliability predicted values of the power transmission lines of all the target areas to corresponding positions on a map through a GIS interface;
and S72, displaying the power transmission lines corresponding to the different reliability predicted values with different visual elements based on the different reliability predicted values.
Further, in the scheme, the output results of the models are counted and arranged to form a data set containing reliability predicted values of the power transmission lines in all target areas, and then the reliability predicted values are mapped to corresponding positions on a map through a GIS (geographic information system) interface.
The GIS interface is a tool for processing and displaying geospatial data, can combine the geospatial data with attribute data to perform visual display, each power transmission line corresponds to one geographic path on a map, reliability predicted values of the paths are accurately mapped to corresponding positions on the map, and complex predicted data can be subjected to the geospatial visual display, so that a user can intuitively check and analyze the reliability conditions of the power transmission lines in different areas.
In order to make the reliability information of the power transmission line on the map more visual and easy to understand, different visual elements such as different colors, line thickness, transparency and the like can be adopted to represent different reliability levels. For example, a power transmission line with high reliability may be indicated by green, a power transmission line with medium reliability may be indicated by yellow, and a power transmission line with low reliability may be indicated by red. In addition, different reliability levels can be further distinguished by adjusting the thickness and transparency of the lines.
In the embodiment, the reliability of the corresponding power transmission line is represented by using different visual elements, so that a user can clearly identify which power transmission lines need to be focused and maintained, and the reliability information of the power transmission line is more visual and easy to understand through the distinction of the visual elements, thereby helping the user to quickly make decisions and take corresponding measures.
Example 2:
referring to fig. 3, a power transmission line reliability prediction method system based on SENet and EffNet, the system comprising:
The image data acquisition module 1 is used for acquiring image data of a target area of a power transmission line, wherein the image data comprises a wire, an insulator, a tower, a line fitting, a stay wire and a grounding device;
The power transmission line CNN model construction module 2 is used for constructing a power transmission line CNN model based on a Keras framework, wherein the CNN model comprises a convolution layer, a fusion module, a pooling layer, a full connection layer, an activation function, a batch normalization layer, a composite scaling layer and a decision layer, the fusion module is obtained by fusion of a CNN-SENet module and a EFFICIENTNET module, the CNN-SENet module comprises a SE module, the EFFICIENTNET module comprises a MBConv module, and the Keras framework comprises a splicing layer;
The feature enhancement module 3 is used for inputting the image data into the convolution layer to obtain an image feature map, inputting the image feature map into the fusion module to fuse the SE module and the MBConv module, outputting the enhancement features of the image feature map, and inputting the enhancement features into the pooling layer to obtain global features;
The steps of fusing the SE module and the MBConv module are as follows:
S31, inputting an image feature map, expanding the initial channel number of the image feature map through a MBConv module, and carrying out depth separable convolution to obtain a feature map after the depth separable convolution;
S32, embedding the SE module into the MBConv module, and carrying out recalibration and projection convolution on the channel number of the feature map after the depth separable convolution;
Further, the feature enhancement module 3 performs recalibration and projection convolution according to the following steps:
s321, carrying out global average pooling on the feature map after the depth separable convolution to obtain a first global feature of each channel;
s322, processing the first global feature through the first full-connection layer, the second full-connection layer and the activation function to generate a channel attention weight;
the expression of the first full connection layer is as follows:
Xse1=ReLU(Dense(Xgap,Wse1));
wherein Xse1 is the feature processed by the first full connection layer Dense and ReLU activation function, Xgap is the first global feature, and Xse1 is the weight of the first connection layer;
the expression of the second full connection layer is as follows:
Xse2=σ(Dense(Xse1,Wse2));
Xse2 is the channel attention weight processed by the second full connection layer Dense and sigma activation function, and Wse2 is the weight of the second connection layer;
s323, multiplying the generated channel attention weight by the characteristic diagram after the depth separable convolution, and carrying out recalibration on the channel number to obtain a recalibrated characteristic diagram, wherein the expression is as follows:
X′=X⊙Xse2;
X' is a feature map after the calibration, X is a feature map after the depth separable convolution, and the addition indicates the multiplication operation of elements;
s324, projecting the channel number of the recalibrated feature map to the initial channel number to complete projection convolution, wherein the expression is as follows:
Y=W·X′;
wherein Y is the output characteristic diagram after projection convolution, and W is the weight matrix.
S33, carrying out point-by-point convolution on the output characteristic diagram after projection convolution, and then carrying out residual connection on the characteristic diagram after point-by-point convolution under the condition that the channel number of the characteristic diagram after point-by-point convolution is the same as the initial channel number and the step length is 1, so as to realize the fusion of an SE module and a MBConv module;
The feature fusion module 4 is used for acquiring the electrical parameters, the environmental parameters and the weather data of the target area of the power transmission line in real time, splicing the electrical parameters and the weather data through a splicing layer, and then inputting the spliced data and global features into a full-connection layer for fusion to obtain a comprehensive feature vector;
the activation normalization module 5 is used for performing nonlinear transformation on the comprehensive feature vectors by an activation function to obtain feature vectors after activation processing, inputting the feature vectors into a batch normalization layer to obtain normalized feature vectors, and inputting the normalized feature vectors into a composite scaling layer to adjust the scale of the feature vectors to obtain final feature vectors;
the decision prediction module 6 is used for inputting the final feature vector into a decision layer for prediction to obtain a reliability prediction result of the power transmission line;
further, the decision prediction module 6 predicts the reliability of the power transmission line according to the following steps:
S61, inputting the final feature vector into a decision layer, minimizing an objective function in the decision layer, and determining a weight vector and a bias term of the CNN model according to constraint conditions of the objective function under the condition that the objective function is minimized;
The expression of the objective function is as follows:
w is a weight vector, W2 is a coefficient of the weight vector, C is a penalty parameter, xii is a relaxation variable, and n is the number of samples;
the expression of the constraint condition is as follows:
yi(w·xi+b)≥1-ξi,ξi≥0,i=1,2,...,n;
W is a weight vector, yi is a label of a sample i, xi is an ith final feature vector, and b is a bias term;
s62, calculating a decision function in a decision layer based on the weight vector and the bias term to obtain a reliability predicted value of the power transmission line;
the expression of the decision function is as follows:
y=f(w·x+b);
wherein y is a reliability predicted value, f is an activation function, w is a weight vector, x is an input of a decision layer, and b is a bias term;
S63, the reliability prediction value is counted into probability distribution through a Softmax function so as to represent the probability of different reliability levels.
And the result display module 7 is used for mapping the reliability prediction result to a corresponding position on the map and displaying the reliability of the transmission line corresponding to the visual element.
Further, the result display module 7 displays reliability according to the following steps:
s71, calculating reliability predicted values of all target areas, and mapping the reliability predicted values of the power transmission lines of all the target areas to corresponding positions on a map through a GIS interface;
and S72, displaying the power transmission lines corresponding to the different reliability predicted values with different visual elements based on the different reliability predicted values.
Example 3:
referring to fig. 4, a transmission line reliability prediction apparatus based on SENet and EffNet, the apparatus comprising a processor 8 and a memory 9;
The memory 9 is used for storing computer program code 91 and for transmitting the computer program code 91 to the processor 8;
The processor 8 is configured to predict the reliability of the transmission line based on SENet and EffNet according to the instruction in the computer program code 91, which is described in embodiment 1.
In general, the computer instructions to implement the methods of the present invention may be carried in any combination of one or more computer-readable storage media. The non-transitory computer-readable storage medium may include any computer-readable medium, except the signal itself in temporary propagation.
The computer readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EKROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, or combinations thereof, including an object oriented programming language such as Java, SMalltalk, C ++ and conventional procedural programming languages, such as the "C" language or similar programming languages, particularly Python languages suitable for neural network computing and TensorFlow, pyTorch-based platform frameworks may be used. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any number of types of networks, including a Local Area Network (LAN) or a Wide Area Network (WAN), or be connected to an external computer (for example, through the Internet using an Internet service provider).
The foregoing devices and non-transitory computer readable storage medium may refer to a specific description of a power transmission line reliability prediction method based on SENet and EffNet and beneficial effects, and are not described herein.
While embodiments of the present invention have been shown and described above, it should be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.