Power transmission line image recognition method and system based on mathematical morphological characteristics

Through the combination of mathematical morphological feature extraction and YOLOv5-ViT model, the problems of false detection and missed detection in transmission line image recognition are solved, the recognition accuracy and speed are improved, and more efficient recognition effect is achieved.

CN119048732AActive Publication Date: 2024-11-29SOUTH CHINA UNIV OF TECH

Patent Information

Application Number
CN202411053744.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-29
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

The prior art is prone to mis-detection and missed detection when identifying pole tower nests and insulator strings in transmission line images, resulting in low recognition accuracy and the model loses real-time detection capabilities.

Method used

Using a mathematical morphological feature recognition method, feature images are extracted through morphological top hat operation and gradient operation, and combined with the YOLOv5-ViT model, feature information transmission between the backbone network and the Neck network is enhanced, and features are processed using the multi-head self-attention mechanism. Figure to improve recognition ability.

Benefits of technology

It effectively improves the recognition accuracy and speed of the tower nest and insulator string, reduces false detection and missed detection, and improves the recognition ability and real-time detection performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048732A_ABST
    Figure CN119048732A_ABST
Patent Text Reader

Abstract

The invention discloses a mathematical morphology feature-based power transmission line image recognition method and system, and the method comprises the steps: extracting morphological feature maps of a tower nest and an insulator string in a power transmission line image through the mathematical morphology, and carrying out the fusion of the morphological feature maps, and obtaining a morphological processing feature image data set; constructing a model, and dividing the morphological processing feature image data set into a training set, a verification set and a test set; training the model by using the training set, determining an optimal model of the model by using the verification set, testing the optimal model by using the test set, and evaluating the recognition capability of the optimal model by using a preset evaluation index to obtain a power transmission line image recognition model; and inputting the to-be-recognized image into the power transmission line image recognition model to obtain a power transmission line image recognition result. According to the method, the problems of false detection and missing detection of power transmission line image recognition can be effectively avoided, and the accuracy of power transmission line image recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power transmission line inspection, and in particular to a power transmission line image recognition method and system based on mathematical morphological features. Background Art

[0002] At present, the main inspection of transmission lines is intelligent inspection. Inspection drones are used to collect transmission line image data, and objects such as bird nests and insulator strings in the image are identified through subsequent analysis and processing, providing reference for on-site operation and maintenance work of inspection personnel. With the gradual increase in the scale of my country's power grid, the distribution of transmission lines has gradually become widespread. Most of the transmission lines are built in the natural environment, which has led to an increase in the impact of birds on transmission lines. Birds are prone to nesting on transmission line towers, and foreign objects such as bird nests will have a serious impact on the safe operation of transmission lines. It may cause short circuits between phases or between phases and ground, causing transmission line tripping faults. For insulator strings, accurately identifying insulator strings in aerial images of transmission lines can effectively improve the efficiency of abnormal operation status detection and defect identification of insulators. By detecting transmission line components and foreign objects in aerial images, it is helpful to ensure the safe and reliable operation of transmission lines.

[0003] In recent years, domestic and foreign scholars have conducted relevant research on the identification of bird nests and insulator strings on transmission line towers, using computer vision technology to identify and detect bird nests and insulator strings on towers in aerial photos of transmission lines.

[0004] For example, in order to improve the detection speed of bird nests, the depthwise separable convolution is introduced into the YOLOv4 model. However, the SPP (Spatial Pyramid Pooling) module added between the Neck network and the output end leads to a decrease in the detection speed, and only improves the recall rate (Recall, R).

[0005] For example, the ResNet50 network with a residual structure is used to replace the feature extraction network in the original Faster R-CNN. However, the introduced ROI Align pooling operation can only optimize the recognition box deviation of small targets, and has no significant advantage for the large target bird nest image in the article. In addition, ROI Align requires the use of bilinear interpolation operations with large computational complexity.

[0006] For example, RetinaNet is used to build a bird's nest intelligent detection model, but it is a two-stage detection network. Compared with the one-stage detection YOLO model, it requires more calculations and has a slower recognition speed.

[0007] For example, Faster-RCNN is first used to locate the transmission line tower area in the aerial image, and then HRNet (High-resolution Networks) built based on the residual network is used to detect the bird's nest in the image. However, the multi-stage detection process makes the model lose the ability to detect bird's nests in real time.

[0008] For example, a channel attention feature fusion network is added to YOLOv3 to fuse shallow and deep features, so that the network can obtain richer feature information.

[0009] For example, depthwise separable convolution is used to replace the standard convolution in YOLOv4, and the output features of the backbone network are stacked to reduce the number of feature channels, but the ability to recognize insulators of extremely small targets is still insufficient.

[0010] For example, by adding a detection head at the output end of YOLOX-S, the feature map of shallow branches can be obtained to enhance the recognition ability of smaller insulators. However, shallow features are prone to carry more messy and irrelevant information, which increases unnecessary calculations.

[0011] For example, by improving the convolution structure and residual module in YOLOv5, a feature fusion module is added to the convolution structure, and the improved convolution structure is added to the side channel of the residual module. However, the introduced Sigmoid activation function is more prone to gradient explosion than the original Leaky ReLU activation function.

[0012] The above method mainly improves the network structure of the existing image recognition model, ignoring the image feature information of the bird's nest on the pole tower and the insulator string itself in the original image. Compared with the pole tower with a single color and obvious structure, the bird's nest has richer detailed texture information and an irregular shape, but it is easily confused with the texture of the woods or grass in the background. Although the insulator string has obvious contour information and the texture is smoother than that of the background, it has a rich appearance depending on the shooting angle of the drone. The characteristics of the bird's nest and insulator string on the above-mentioned pole tower are likely to cause false detection and missed detection in the process of image recognition, which poses certain challenges to the recognition ability of the image recognition model. Summary of the invention

[0013] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a transmission line image recognition method based on mathematical morphology features, which can effectively avoid the occurrence of false detection and missed detection problems in transmission line image recognition and improve the accuracy of transmission line image recognition.

[0014] Another object of the present invention is to provide a transmission line image recognition system based on mathematical morphology features.

[0015] The purpose of the present invention is achieved through the following technical solutions:

[0016] A method for power transmission line image recognition based on mathematical morphology features comprises the steps of:

[0017] Mathematical morphology is used to extract the morphological feature maps of tower bird nests and insulator strings in the transmission line image, and the morphological feature maps are fused to obtain the morphologically processed feature image dataset;

[0018] Build the YOLOv5-ViT model and divide the morphological processing feature image dataset into training set, validation set and test set;

[0019] The training set is used to train the YOLOv5-ViT model, the validation set is used to determine the optimal model of the YOLOv5-ViT model, the test set is used to test the optimal model, and the preset evaluation index is used to evaluate the recognition ability of the optimal model to obtain the transmission line image recognition model;

[0020] The image to be identified is input into the transmission line image recognition model to obtain the transmission line image recognition result.

[0021] Furthermore, mathematical morphology is used to extract the morphological feature maps of the bird nests and insulator strings in the transmission line images, and the morphological feature maps are fused to obtain the morphologically processed feature image dataset, specifically:

[0022] Labelme software was used to label tower bird nests and insulator strings in transmission line images;

[0023] The characteristic map of the tower bird's nest is extracted by using the morphological top-hat operation, and the characteristic map of the tower bird's nest is expanded, and then closed after threshold binarization to obtain the morphological characteristic map of the tower bird's nest;

[0024] The contour map of the insulator string is extracted by using morphological gradient operation, and the contour map of the insulator string is subjected to a preset number of dilation and corrosion processing, and the morphological feature map of the insulator string is obtained by combining the morphological smoothing feature;

[0025] The morphological feature map of the tower bird's nest and the morphological feature map of the insulator string are fused to obtain a morphologically processed feature image.

[0026] Furthermore, the morphological top hat operation is the difference between the original transmission line image and the open operation result image, which is used to extract the details and texture of the tower bird nest. The formula is:

[0027]

[0028] Among them, A is the original transmission line image, B is the morphological structure element, It means that B performs an opening operation on A, that is, corrosion first and then expansion, which is used to smooth the contour and eliminate small objects. The formula for the opening operation is expressed as:

[0029]

[0030] The morphological gradient operation is the difference between the expansion map and the erosion map, which is used to extract the edge contour of the insulator string. The formula is:

[0031]

[0032] in, Represents the result of the expansion operation, and its calculation formula is Indicates that A is expanded using the structural element B, and the origin of B is translated to the position of the image element (x, y). If the intersection of B and A at the image element (x, y) is not empty, the corresponding image element (x, y) is assigned a value of 1, otherwise it is assigned a value of 0; Represents the result of corrosion operation, and its calculation formula is It means using structural element B to erode A, and translating the origin of B to the position of image element (x, y). If B is completely contained in the overlapping area with image A at image element (x, y), the corresponding image element (x, y) is assigned a value of 1, otherwise the image element (x, y) is assigned a value of 0.

[0033] Furthermore, the morphologically processed feature image dataset is divided into training set, validation set and test set according to the ratio of 6:2:2. The images in the training set, validation set and test set are all from aerial images of different towers.

[0034] Further, the YOLOv5-ViT model is constructed, specifically:

[0035] A ViT module is added between the backbone network and the Neck network of the YOLOv5 model to enhance the feature information transmission between the backbone network and the Neck network, thereby obtaining the YOLOv5-ViT model. After the image is input into the backbone network, features are extracted layer by layer. The deep features of the backbone network are processed using the ViT module to provide the processed feature map for the Neck network. The feature maps of different layers are then fused through FPN, so that the output end of the YOLOv5 model can achieve target detection at different scales.

[0036] Furthermore, the process of using the ViT module to process the deep features of the backbone network is as follows:

[0037] First, the feature map is cut and flattened using the ViT module. For a feature map with a length of H, a width of W, and a number of channels of C If the resolution of the sliced ​​image is (P, P), the number of slices N is expressed as:

[0038]

[0039] The flattened feature map is represented as

[0040] Secondly, the image blocks are encoded, and the dimension P is converted into 2 C is mapped to D dimensions, and then a multi-head self-attention mechanism is used to calculate the encoding of each image block. The multi-head self-attention mechanism implements n attention heads h through the query element q, key element k and value element v i (i=1,...,n), attention head h i The calculation formula is:

[0041] h i =f(W i (q) q,W i (k) k,W i (v) v)

[0042] Among them, W i (q) , W i (k) , W i (v) Represents the parameters of neural network learning, f represents the scaled dot product attention operation, the output of each attention head will be spliced ​​together, and the attention splicing feature map will be processed through the linear layer to provide the Neck network with an attention feature map.

[0043] Furthermore, the evaluation indicators include precision, recall, average precision and confidence.

[0044] The precision Pre value is the ratio of the number of real samples to the number of all predicted samples in the model prediction results. The number of instances correctly predicted as positive samples is TP, and the number of instances incorrectly predicted as positive samples is FP. The calculation formula of the model precision Pre is:

[0045]

[0046] The recall rate R is the ratio of the number of instances predicted as true positive samples to the number of instances that are actually positive samples in the original sample. The number of instances that are incorrectly predicted as negative samples but are actually positive samples is FN. The calculation formula for the model recall rate R is:

[0047]

[0048] The mean average precision mAP is the average of the mean precision. The value of the mean average precision APi for category i is the area under the PR curve of the precision P and the recall rate R in a certain category. The AP of each category is calculated and the average is the mean average precision mAP. For the target detection task of K categories, the calculation formula of the mean average precision mAP is:

[0049]

[0050] In the target detection task, confidence is used to measure the probability of whether the detected object actually exists. The confidence calculation formula is:

[0051]

[0052] Among them, Pr(obj) is the probability of an object existing in the prediction box, It is the intersection-over-union ratio of the predicted box and the real object box position, and its calculation formula is:

[0053]

[0054] Among them, pred∩truth represents the area occupied by the intersection of the prediction box and the real object box, and pred∪truth represents the overall area of ​​the prediction box and the real object box.

[0055] Another object of the present invention is achieved by the following technical solutions:

[0056] A transmission line image recognition system based on mathematical morphology features, applied to the above-mentioned transmission line image recognition method based on mathematical morphology features, comprises:

[0057] The morphological processing module is used to extract the morphological feature maps of the bird nests on the towers and the insulator strings in the transmission line images by using mathematical morphology, and fuse the morphological feature maps to obtain a morphologically processed feature image data set;

[0058] A data partitioning module is used to divide the morphological processing feature image data set into a training set, a validation set and a test set;

[0059] Building module for building YOLOv5-ViT model;

[0060] A training and testing module is used to train the YOLOv5-ViT model using a training set, determine the optimal model of the YOLOv5-ViT model using a validation set, test the optimal model using a test set, and evaluate the recognition ability of the optimal model using a preset evaluation index to obtain a transmission line image recognition model;

[0061] The recognition module is used to input the image to be recognized into the power transmission line image recognition model to obtain the power transmission line image recognition result.

[0062] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0063] The present invention extracts feature maps based on mathematical morphology. Through the combination of different operators, specific shapes and contour features in the image can be extracted. Compared with traditional machine learning methods, mathematical morphology extracts features quickly, effectively and at low cost. At the same time, by adding a ViT module to the YOLOv5 model, the original SPPF module can only provide pooled feature maps of different scales for the Neck network. By adding the ViT module, the present invention enables the model to slice these pooled feature maps, and through the multi-head attention mechanism, the subsequent Neck network can pay more attention to the local feature information in the pooled feature map.

[0064] In summary, the hybrid model based on the mathematical morphological feature extraction graph combined with YOLOv5-ViT can effectively improve the recognition speed and recognition ability of pole tower bird nests and insulator strings, and improve the recognition accuracy of pole tower bird nests and insulator strings. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 The figure is a flow chart of the method of the present invention.

[0066] Figure 2 This is a comparison between the original picture and the morphological feature map of the tower bird's nest.

[0067] Figure 3 This is a comparison between the original image and the morphological feature map of the insulator string.

[0068] Figure 4 This is the structural diagram of the YOLOv5-ViT model.

[0069] Figure 5 Schematic diagram of the area occupied by the intersection of the prediction box and the real object box.

[0070] Figure 6 Schematic diagram of the overall area of ​​the prediction box and the real object box. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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 part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0072] Embodiment 1:

[0073] like Figure 1 As shown, this embodiment provides a method for power transmission line image recognition based on mathematical morphological features, comprising the steps of:

[0074] S1. Using mathematical morphology to extract morphological feature maps of tower bird nests and insulator strings in transmission line images, and fusing the morphological feature maps to obtain a morphologically processed feature image dataset; specifically,

[0075] Labelme software was used to label tower bird nests and insulator strings in transmission line images;

[0076] The characteristic map of the tower bird's nest is extracted by using the morphological top-hat operation, and the characteristic map of the tower bird's nest is expanded, and then closed after threshold binarization to obtain the morphological characteristic map of the tower bird's nest;

[0077] The contour map of the insulator string is extracted by using morphological gradient operation, and the contour map of the insulator string is subjected to a preset number of dilation and corrosion processing, and the morphological feature map of the insulator string is obtained by combining the morphological smoothing feature;

[0078] The morphological feature map of the tower bird's nest and the morphological feature map of the insulator string are fused to obtain a morphologically processed feature image.

[0079] Mathematical morphology processes complex signals by using different operators and their combinations, and dilation and erosion are the most basic but extremely important operators.

[0080] Dilation can expand the target boundary and fill the holes in the target area. The calculation formula is:

[0081]

[0082] Where A is the original transmission line image, B is the morphological structure element, and the formula means that A is expanded using the structure element B, and the origin of B is translated to the position of the image element (x, y). If the intersection of B and A at the image element (x, y) is not empty, the corresponding image element (x, y) is assigned 1, otherwise it is assigned 0.

[0083] Erosion can shrink the target boundary and eliminate small and meaningless targets in the target area. The calculation formula is:

[0084]

[0085] This formula means that the structural element B is used to erode A, and the origin of B is translated to the position of the image element (x, y). If B is completely contained in the overlapping area with image A at the image element (x, y), the corresponding image element (x, y) is assigned a value of 1, otherwise the image element (x, y) is assigned a value of 0.

[0086] The effectiveness of mathematical morphology in extracting image features depends on the size, content and nature of logical operations of the structural elements, and the goal of feature extraction is achieved through the combination of different morphological operators.

[0087] The opening operation can be expressed as Its formula is:

[0088]

[0089] The opening operation is to erode first and then expand, which can smooth the contour and eliminate small objects.

[0090] The closing operation can be expressed as A·B, and its formula is:

[0091]

[0092] The closing operation is to expand first and then corrode, which can fill the tiny holes inside the object.

[0093] By combining the opening and closing operators, first performing the opening operation and then the closing operation, a morphological smoothing operator can be formed to remove noise from the image. The formula for the morphological smoothing operation of B on A is:

[0094]

[0095] The morphological top hat operation is the difference between the original transmission line image and the open operation result image, which is used to extract the details and texture of the tower bird's nest. The formula is:

[0096]

[0097] The comparison between the morphological feature map of the tower bird's nest after morphological top-hat operation and subsequent combination operator operation and the original picture is as follows: Figure 2 As shown, the left picture is the original picture taken by drone, and the right picture is the morphological feature diagram of the tower bird's nest.

[0098] The morphological gradient operation is the difference between the expansion map and the erosion map, which is used to extract the edge contour of the insulator string. The formula is:

[0099]

[0100] The comparison between the edge contour of the insulator string after morphological gradient operation and subsequent combination operator operation and the original image is as follows: Figure 3As shown, the left picture is the original picture taken by the drone, and the right picture is the morphological feature diagram of the insulator string.

[0101] The transmission line images used in this embodiment are pictures of a transmission line collected by drones. The picture resolution is 7360×4912, and 643 transmission line pictures are included, of which 55 pictures contain bird nests on towers. Since the number of images with bird nests on towers is relatively small, aerial pictures of transmission lines with several towers are randomly selected, and all images containing bird nests are put into the data set, forming an original data set with 249 pictures containing insulator strings and all tower bird nests.

[0102] S2. Build the YOLOv5-ViT model and divide the morphologically processed feature images into training set, validation set and test set in a ratio of 6:2:2; specifically:

[0103] YOLO is a representative target detection algorithm, while YOLOv5 has the characteristics of fast speed and high accuracy, is compatible with data sets of different resolutions, and has superior performance in real-time target detection tasks. The YOLOv5 model consists of three parts: the backbone network, the Neck network, and the output end, and uses a joint feature fusion method to obtain rich feature information. The backbone network is responsible for extracting image features layer by layer; the Neck network enriches image features from top to bottom through the Feature Pyramid Networks (FPN) module; the output end uses three detection heads to process the feature maps of three different scales in the Neck network, so that YOLOv5 can treat the target detection task as a regression problem and directly obtain the category and bounding box detection results of different scales.

[0104] Although YOLOv5 has powerful performance in the field of image recognition, it requires the construction of a large number of training data sets during the training process, and consumes a lot of hardware resources. Faced with target detection tasks with a small number of training samples, YOLOv5 is prone to missed detections and false detections, and the model training convergence is difficult and has poor versatility.

[0105] At the same time, since there are fewer samples of towers with bird nests in actual scenes, this embodiment uses ViT to improve and optimize the YOLOv5 model based on this feature in the data set. By adding a ViT module between the backbone network and the Neck network of the YOLOv5 model, the feature information transmission between the backbone network and the Neck network is enhanced, thereby obtaining the YOLOv5-ViT model, as shown in Figure 2. Figure 4As shown in the figure, after the image is input into the backbone network, features are extracted layer by layer, and the deep features of the backbone network are processed using the ViT module to provide the processed feature map for the Neck network. The feature maps of different layers are then fused through FPN, so that the output end can realize target detection at different scales.

[0106] The ViT module has good feature processing capabilities when facing image data. In this embodiment, the process of using the ViT module to process the deep features of the backbone network is as follows:

[0107] First, the feature map is cut and flattened using the ViT module. For a feature map with a length of H, a width of W, and a number of channels of C If the resolution of the sliced ​​image is (P, P), the number of slices N is expressed as:

[0108]

[0109] The flattened feature map is represented as

[0110] Secondly, the image blocks are encoded, and the dimension P is converted into 2 C is mapped to D dimensions, and then a multi-head self-attention mechanism is used to calculate the encoding of each image block. The multi-head self-attention mechanism implements n attention heads h through the query element q, key element k and value element v i (i=1,...,n), attention head h i The calculation formula is:

[0111] h i =f(W i (q) q,W i (k) k,W i (v) v)

[0112] Among them, W i (q) , W i (k) , W i (v) Represents the parameters of neural network learning, f represents the scaled dot product attention operation, the output of each attention head will be spliced ​​together, and the attention splicing feature map will be processed through the linear layer to provide the Neck network with an attention feature map.

[0113] S3, using the training set to train the YOLOv5-ViT model, using the validation set to determine the optimal model of the YOLOv5-ViT model, using the test set to test the optimal model, and using the preset evaluation index to evaluate the recognition ability of the optimal model to obtain a transmission line image recognition model;

[0114] Among them, the evaluation indicators include precision, recall, average precision and confidence.

[0115] The precision Pre value is the ratio of the number of real samples to the number of all predicted samples in the model prediction results. The number of instances correctly predicted as positive samples is TP, and the number of instances incorrectly predicted as positive samples is FP. The calculation formula of the model precision Pre is:

[0116]

[0117] The recall rate R is the ratio of the number of instances predicted as true positive samples to the number of instances that are actually positive samples in the original sample. The number of instances that are incorrectly predicted as negative samples but are actually positive samples is FN. The calculation formula for the model recall rate R is:

[0118]

[0119] The mean average precision mAP is the average of the mean precision. The value of the mean average precision APi for category i is the area under the PR curve of the precision P and the recall rate R in a certain category. The AP of each category is calculated and the average is the mean average precision mAP. For the target detection task of K categories, the calculation formula of the mean average precision mAP is:

[0120]

[0121] In the target detection task, confidence is used to measure the probability of whether the detected object actually exists. The confidence calculation formula is:

[0122]

[0123] Among them, Pr(obj) is the probability of an object existing in the prediction box, It is the intersection-over-union ratio of the predicted box and the real object box position, and its calculation formula is:

[0124]

[0125] Among them, pred∩truth represents the area occupied by the intersection of the prediction box and the real object box, and pred∪truth represents the overall area of ​​the prediction box and the real object box, such as Figure 5 , Figure 6 As shown, the two boxes represent the predicted box and the real object box respectively. Figure 5 The shaded area in is ped∩truth, Figure 6 The shaded area in is pred∪truth.

[0126] S4. Input the image to be recognized into a power transmission line image recognition model to obtain a power transmission line image recognition result.

[0127] Embodiment 2:

[0128] This embodiment provides a transmission line image recognition system based on mathematical morphological features, which is applied to the above-mentioned transmission line image recognition method based on mathematical morphological features, including:

[0129] The morphological processing module is used to extract the morphological feature maps of the bird nests on the towers and the insulator strings in the transmission line images by using mathematical morphology, and fuse the morphological feature maps to obtain a morphologically processed feature image data set;

[0130] A data partitioning module is used to divide the morphological processing feature image data set into a training set, a validation set and a test set;

[0131] Building module for building YOLOv5-ViT model;

[0132] A training and testing module is used to train the YOLOv5-ViT model using a training set, determine the optimal model of the YOLOv5-ViT model using a validation set, test the optimal model using a test set, and evaluate the recognition ability of the optimal model using a preset evaluation index to obtain a transmission line image recognition model;

[0133] The recognition module is used to input the image to be recognized into the power transmission line image recognition model to obtain the power transmission line image recognition result.

[0134] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and invention concept of the present invention within the scope disclosed by the present invention, which shall fall within the protection scope of the present invention.

Claims

1. A method for power transmission line image recognition based on mathematical morphology features, characterized in that: Including steps, Mathematical morphology is used to extract the morphological feature maps of tower bird nests and insulator strings in the transmission line image, and the morphological feature maps are fused to obtain the morphologically processed feature image dataset; Build the YOLOv5-ViT model and divide the morphological processing feature image dataset into training set, validation set and test set; The training set is used to train the YOLOv5-ViT model, the validation set is used to determine the optimal model of the YOLOv5-ViT model, the test set is used to test the optimal model, and the preset evaluation index is used to evaluate the recognition ability of the optimal model to obtain the transmission line image recognition model; The image to be identified is input into the transmission line image recognition model to obtain the transmission line image recognition result.

2. The method for power transmission line image recognition based on mathematical morphology features according to claim 1, characterized in that: Mathematical morphology is used to extract the morphological feature maps of tower bird nests and insulator strings in the transmission line image, and the morphological feature maps are fused to obtain the morphologically processed feature image dataset, specifically: Labelme software was used to label tower bird nests and insulator strings in transmission line images; The characteristic map of the tower bird's nest is extracted by using the morphological top-hat operation, and the characteristic map of the tower bird's nest is expanded, and then closed after threshold binarization to obtain the morphological characteristic map of the tower bird's nest; The contour map of the insulator string is extracted by using morphological gradient operation, and the contour map of the insulator string is subjected to a preset number of dilation and corrosion processing, and the morphological feature map of the insulator string is obtained by combining the morphological smoothing feature; The morphological feature map of the tower bird's nest and the morphological feature map of the insulator string are fused to obtain a morphologically processed feature image.

3. The method for power transmission line image recognition based on mathematical morphology features according to claim 2, characterized in that: The morphological top hat operation is the difference between the original transmission line image and the open operation result image, which is used to extract the details and texture of the tower bird's nest. The formula is: Among them, A is the original transmission line image, B is the morphological structure element, It means that B performs an opening operation on A, that is, corrosion first and then expansion, which is used to smooth the contour and eliminate small objects. The formula for the opening operation is expressed as: The morphological gradient operation is the difference between the expansion map and the erosion map, which is used to extract the edge contour of the insulator string. The formula is: in, It represents the result of the expansion operation, and its calculation formula is Indicates that A is expanded using the structural element B, and the origin of B is translated to the position of the image element (x, y). If the intersection of B and A at the image element (x, y) is not empty, the corresponding image element (x, y) is assigned a value of 1, otherwise it is assigned a value of 0; Represents the result of corrosion operation, and its calculation formula is It means using structural element B to erode A, and translating the origin of B to the position of image element (x, y). If B is completely contained in the overlapping area with image A at image element (x, y), the corresponding image element (x, y) is assigned a value of 1, otherwise the image element (x, y) is assigned a value of 0.

4. The method for power transmission line image recognition based on mathematical morphology features according to claim 1, characterized in that: The morphologically processed feature image dataset is divided into training set, validation set and test set according to the ratio of 6:2:

2. The images in the training set, validation set and test set are all from aerial images of different towers.

5. The method for power transmission line image recognition based on mathematical morphology features according to claim 1, characterized in that: Build the YOLOv5-ViT model, specifically: A ViT module is added between the backbone network and the Neck network of the YOLOv5 model to enhance the feature information transmission between the backbone network and the Neck network, thereby obtaining the YOLOv5-ViT model. After the image is input into the backbone network, features are extracted layer by layer. The deep features of the backbone network are processed using the ViT module to provide the processed feature map for the Neck network. The feature maps of different layers are then fused through FPN, so that the output end of the YOLOv5 model can achieve target detection at different scales.

6. The method for power transmission line image recognition based on mathematical morphology features according to claim 5, characterized in that: The process of processing the deep features of the backbone network using the ViT module is as follows: First, the feature map is cut and flattened using the ViT module. For a feature map with a length of H, a width of W, and a number of channels of C If the resolution of the sliced ​​image is (P, P), the number of slices N is expressed as: The flattened feature map is expressed as Secondly, the image blocks are encoded, and the dimension P is converted into 2 C is mapped to D dimensions, and then a multi-head self-attention mechanism is used to calculate the encoding of each image block. The multi-head self-attention mechanism implements n attention heads h through the query element q, key element k and value element v i (i=1,...,n) calculation, attention head h i The calculation formula is: h i =f(W i (q) q,W i (k) k,W i (v) v) Among them, W i (q) , W i (k) , W i (v) Represents the parameters of neural network learning, f represents the scaled dot product attention operation, the output of each attention head will be spliced ​​together, and the attention splicing feature map will be processed through the linear layer to provide the Neck network with an attention feature map.

7. The method for power transmission line image recognition based on mathematical morphology features according to claim 1, characterized in that: The evaluation indicators include precision, recall, average precision and confidence. The precision Pre value is the ratio of the number of real samples to the number of all predicted samples in the model prediction results. The number of instances correctly predicted as positive samples is TP, and the number of instances incorrectly predicted as positive samples is FP. The calculation formula of the model precision Pre is: The recall rate R is the ratio of the number of instances predicted as true positive samples to the number of instances that are actually positive samples in the original sample. The number of instances that are incorrectly predicted as negative samples but are actually positive samples is FN. The calculation formula for the model recall rate R is: The mean average precision mAP is the average of the mean precision. The value of the mean average precision APi for category i is the area under the PR curve of the precision P and the recall rate R in a certain category. The AP of each category is calculated and the average is the mean average precision mAP. For the target detection task of K categories, the calculation formula of the mean average precision mAP is: In the target detection task, confidence is used to measure the probability of whether the detected object actually exists. The confidence calculation formula is: Among them, Pr(obj) is the probability of an object existing in the prediction box, It is the intersection-over-union ratio of the predicted box and the real object box position, and its calculation formula is: Among them, pred∩truth represents the area occupied by the intersection of the prediction box and the real object box, and pred∪truth represents the overall area of ​​the prediction box and the real object box.

8. A transmission line image recognition system based on mathematical morphology features, characterized in that: The method for power transmission line image recognition based on mathematical morphological features as claimed in any one of claims 1 to 7 comprises: The morphological processing module is used to extract the morphological feature maps of the bird nests on the towers and the insulator strings in the transmission line images by using mathematical morphology, and fuse the morphological feature maps to obtain a morphologically processed feature image data set; A data partitioning module is used to divide the morphological processing feature image data set into a training set, a validation set and a test set; Building module for building YOLOv5-ViT model; A training and testing module is used to train the YOLOv5-ViT model using a training set, determine the optimal model of the YOLOv5-ViT model using a validation set, test the optimal model using a test set, and evaluate the recognition ability of the optimal model using a preset evaluation index to obtain a transmission line image recognition model; The recognition module is used to input the image to be recognized into the power transmission line image recognition model to obtain the power transmission line image recognition result.

Citation Information

Patent Citations

  • Power transmission line target detection and identification method based on feature fusion

    CN114445706A

  • U-ViT network small target detection method based on heat conduction principle

    CN116977662A

  • Contrast learning and semantic segmentation method for improving MBI through semi-supervised scene fusion

    CN117496158A

  • Underground coal mine pedestrian detection method based on image fusion and feature enhancement

    WO2024037408A1

Cited By

  • Pedestrian detection and tracking method based on visual attention mechanism

    CN119810921A

  • A pedestrian detection and tracking method based on visual attention mechanism

    CN119810921B