Tree line contradiction state recognition method and device based on target detection and semantic segmentation

By combining target detection and semantic segmentation technology, it solves the problem of insufficient expression ability of tree line contradiction recognition features in the existing technology, achieves accurate identification and efficient judgment of tree line contradiction status, and meets the needs of various transportation inspection and monitoring scenarios. And accelerate model execution through OpenVINO optimization.

CN118762274AInactive Publication Date: 2024-10-11上海迈能创豪能源科技有限公司

Patent Information

Application Number
CN202410484263.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing tree line contradiction recognition method based on computer vision has insufficient feature expression capabilities, poor versatility and robustness, and cannot meet the needs of tree line contradiction status confirmation in various operation inspection monitoring scenarios.

Method used

Using methods based on target detection and semantic segmentation, through the joint use of target detection models and semantic segmentation models, combined with deep learning algorithms, the model weights are trained and evaluated to enhance image data and improve recognition accuracy.

Benefits of technology

It effectively confirms the blocked status of towers and wires, improves the recognition accuracy, enhances the robustness and generalization ability of the model, meets the needs of various operation inspection monitoring scenarios, and accelerates model execution through OpenVINO optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762274A_ABST
    Figure CN118762274A_ABST
Patent Text Reader

Abstract

The invention discloses a tree line contradiction state recognition method and device based on target detection and semantic segmentation, and relates to the technical field of power maintenance, and the method comprises a target detection model training step which comprises the steps: collecting image data, generating a target detection data set, and constructing and training a target detection model; a semantic segmentation model training step, including image data acquisition, semantic segmentation data set generation, and semantic segmentation model construction and training; and the model prediction step comprises leaf detection, mask extraction of electric wires, leaves, sky and tower parts in an image, and logic processing of a single-frame identification result. By applying the method, the shielded state of the tower and the electric wire can be effectively confirmed, and the identification accuracy 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 electric power maintenance, and in particular to a method for identifying a tree-line conflicting state, and in particular to a method for identifying a tree-line conflicting state based on target detection and semantic segmentation. Background Art

[0002] Power lines and electric poles are very common power equipment in real life, and they play a role in power transmission. Trees that threaten the safe operation of power lines in the line protection area are called "tree barriers", that is, too tall and too dense roadside trees may pose a threat to the safe operation of power lines. The threat of roadside trees to power lines is mainly manifested in many aspects. First, trees that are too tall and too dense may come into contact with power lines, causing problems such as short circuits and leakage, and ultimately causing power outages. Secondly, roadside trees are prone to breaking and falling in extreme weather, which may cause damage to power lines and cause traffic accidents or disasters such as wildfires. In addition, the presence of roadside trees also increases the risk of personal safety accidents such as electric shock.

[0003] In order to prevent the occurrence of tree barrier hazards, power supply companies have invested a lot of manpower, material and financial resources in recent years to clear tree barriers. Currently, regular manual pruning is generally used to manage them. However, this method has the disadvantages of untimely maintenance and longer maintenance cycles in remote locations. Therefore, there is an urgent need for a low-cost and accurate tree line conflict identification solution.

[0004] The tree-line conflict recognition method based on computer vision uses low-cost image acquisition equipment and cloud / edge computers to realize the recognition of tree-line conflicts. It is simple to install, easy to maintain, and has low procurement, installation and maintenance costs, and has gradually attracted attention from the industry. However, the existing tree-line conflict confirmation method based on computer vision usually uses traditional image processing technology. The extracted features have insufficient expression capabilities, and the algorithm has strict requirements on the operation and inspection monitoring scene, image background content, and the shooting angle of the image acquisition device. It has weak versatility, poor robustness, and low performance, and cannot meet the tree-line conflict status confirmation requirements of many operation and inspection monitoring scenes. Summary of the invention

[0005] The present invention proposes a tree-line contradictory state recognition method and device based on target detection and semantic segmentation. By using this method, the obstruction state of poles and wires can be effectively confirmed, thereby improving the recognition accuracy.

[0006] The technical solution of the present invention is as follows:

[0007] The tree-line contradictory state recognition method based on target detection and semantic segmentation includes

[0008] The object detection model training steps include image data collection, object detection dataset generation, object detection model construction and training;

[0009] The steps of semantic segmentation model training include image data acquisition, semantic segmentation dataset generation, and semantic segmentation model construction and training;

[0010] The model prediction steps include leaf detection, partial mask extraction of wires, leaves, sky and towers in the image, and logical processing of single-frame recognition results.

[0011] As a further optimization of this solution, in the target detection model training step, image data collection includes,

[0012] Based on the operation and inspection monitoring equipment, collect operation and inspection monitoring images for subsequent data set production;

[0013] The target detection dataset generation includes:

[0014] All images containing leaves are labeled with leaves. After the labeling is completed, the data set is divided into a training set and a validation set in a ratio of 8:2.

[0015] Data enhancement methods, including image brightness change, image flipping, image rotation, image scaling and Mosaic enhancement methods, are used to expand the training set and improve the sample capacity and richness of the training set.

[0016] As a further optimization of this solution, the construction and training of the target detection model includes:

[0017] The target detection model is built based on the deep learning algorithm, and the model identification category is leaves.

[0018] Based on the generated target detection dataset, train the constructed model, select appropriate optimization methods, design the target detection loss function, set hyperparameters such as initial learning rate, batch size, number of iterations, set the size of preset box anchors, start model training, and save the weight files generated by each iteration.

[0019] For model weight evaluation, we first exclude the models with higher loss values ​​in the initial stage of training, and then use the mAP 0.5 indicator to evaluate the remaining model weights, and select the optimal model weight as the final leaf detection model.

[0020] As a further optimization of this solution, in the semantic segmentation model training step,

[0021] Image data acquisition includes collecting operation and inspection monitoring images based on operation and inspection monitoring equipment;

[0022] The generation of semantic segmentation dataset includes labeling all acquired complete images of operation and inspection monitoring, with the labeled objects being the sky, leaves, poles and wires. After labeling, the dataset is divided into training set and validation set in a ratio of 9:1.

[0023] Data enhancement methods, including image brightness change, image flipping, and image rotation, are used to expand the training set and improve the sample capacity and richness of the training set.

[0024] As a further optimization of this solution, the construction and training of the semantic segmentation model includes

[0025] The semantic segmentation model is built based on the deep learning algorithm. The model recognition categories include sky, leaves, poles and wires. The specific algorithm can adopt the industry's advanced semantic segmentation algorithm according to the actual situation, including but not limited to FCVN, DeepLab-V3, U-Net, etc.

[0026] Based on the generated semantic segmentation dataset, train the constructed model, select appropriate optimization methods, design the loss function of semantic segmentation, set hyperparameters such as initial learning rate, batch size, number of iterations, start model training, and save the weight files generated by each iteration.

[0027] For model weight evaluation, we first exclude models with higher loss values ​​in the initial stage of training, and then use the MIOU indicator to evaluate the remaining model weights, and select the optimal model weights as the final insulator and switch semantic segmentation model.

[0028] As a further optimization of this scheme, in the model prediction step,

[0029] Leaf detection includes using a pre-trained leaf detection model to detect whether there are leaf targets in the image;

[0030] The mask extraction of the wires, leaves, sky and tower parts in the image includes selecting the optimal weights selected during the semantic segmentation model training process as the wires, leaves, sky and tower semantic segmentation model, setting the output confidence threshold, making predictions, and extracting the masks of the wires, leaves, sky and tower parts.

[0031] As a further optimization of this solution, the logical processing of single-frame recognition results includes:

[0032] Draw the minimum circumscribed rectangle for the tower mask, and draw a line segment connecting the midpoints of the two short sides of the circumscribed rectangle, and save the image as black_image.jpg;

[0033] Draw an extension line of the line segment in black_image.jpg, which runs through the entire image, and then save the image as fitline_image.jpg;

[0034] Remove the intersection of the white straight line, sky and tower mask in fitline_image.jpg, so as to get a picture with only the tower extension line, and save it as pureganta.jpg;

[0035] Compare the ratio of the white outline area in pureganta.jpg to the sum of the white outline area in pureganta.jpg and the white outline area in black_image.jpg with the set threshold value, which is 0.65. If it is greater than this, it is determined that the tower is blocked by the tree; if it is less than this, it starts to determine whether it blocks the power line;

[0036] At this time, we start to judge the shielding situation of the wires, fit the corresponding straight line to the wire mask, and draw the extension line that runs through the picture, and save the picture as mask_0.jpg;

[0037] Keep the part of mask_0.jpg where the white outline does not overlap with the outline of the leaves and wires. That is, the image now only contains the extension of the wire outline. Save the image as mask_diff.jpg.

[0038] Calculate the relationship between the difference between the white outlines in mask_0.jpg and mask_diff.jpg and the ratio of the white outline in mask_0.jpg to the set threshold. The threshold is 0.8. If it is greater than, it is judged that the wire is blocked by the tree. If it is less than, there is no blockage.

[0039] A tree-line contradictory state recognition device, according to the tree-line contradictory state recognition method based on target detection and semantic segmentation according to claims 1-7, comprising:

[0040] An image acquisition module is used for original images in real scenes as target images to be identified;

[0041] The object detection module is used to use the pre-trained leaf detection model to determine whether there are leaves in the image, and if so, to detect whether there are towers or wires blocked in the image;

[0042] The semantic segmentation module extracts the sky, poles, wires and leaves masks from the image to determine the occlusion status of the wires and poles.

[0043] As a further optimization of this solution, it also includes

[0044] The target detection model training module is used to input all pre-collected leaf samples into the target detection and semantic model for training, and retain the weights obtained through training;

[0045] The target detection model selection module is used to evaluate the weights saved in the training module and select the weights with the best evaluation index as the leaf detection model;

[0046] The semantic segmentation model training module is used to input all inspection and monitoring image samples into the semantic segmentation model for training and retain the weights obtained through training;

[0047] The semantic segmentation model selection module is used to evaluate the weights saved in the training module and select the weights with the best evaluation index as the sky, tower, wire and leaf recognition models;

[0048] The semantic segmentation model optimization acceleration module is used to convert the trained deep learning model into an intermediate representation (IR) file that can be used by the OpenVINO inference engine. The model optimized by the model optimizer can be executed faster on Intel's multi-platform hardware without affecting the accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0050] Figure 1 It is the overall framework of the tree-line contradictory state recognition method based on target detection and semantic segmentation in the present invention;

[0051] Figure 2 Original collection images for leaf detection;

[0052] Figure 3 Original pictures of the semantic segmentation training set;

[0053] Figure 4 For the recognition of the original image and the extraction of masks of the sky, towers, wires and leaves;

[0054] Figure 5 The ratio of the white contour area in b and c is calculated by formula (1) in the embodiment, and the rate is compared with the threshold value;

[0055] Figure 6 according to Figure 4 (c) The detected sky, poles, wires and leaves are masked to obtain the extension line of the wires (mask_0.jpg). The part of mask_0.jpg where the white outline does not overlap with the outline of the leaves and wires is retained to obtain mask_diff.jpg;

[0056] Figure 7 It is a flowchart of linear operation fusion;

[0057] Figure 8 Optimize the flow graph for OpenVINO suite. DETAILED DESCRIPTION

[0058] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] In a first aspect, an example of the present disclosure provides a tree-line contradiction identification method based on target detection and semantic segmentation, the method comprising:

[0060] 1. Object detection model training steps

[0061] 1. Image data acquisition

[0062] (1) Based on the operation and inspection monitoring equipment, operation and inspection monitoring images are collected for subsequent data set production.

[0063] 2. Object detection dataset generation

[0064] (1) All images containing leaves are labeled as leaves. After the labeling is completed, the dataset is divided into a training set and a validation set in a ratio of 8:2.

[0065] (2) Data enhancement methods, including image brightness change, image flipping, image rotation, image scaling, and mosaic enhancement methods, are used to expand the training set and improve the sample capacity and richness of the training set.

[0066] 3. Construction and training of target detection model

[0067] (1) Build a target detection model based on a deep learning algorithm, and the model identification category is leaves. The specific algorithm can adopt the industry's advanced target detection algorithm according to the actual situation, including but not limited to YOLO, Faster-RCNN, SSD, etc., as well as the Transformer-based detection algorithm.

[0068] (2) Based on the target detection dataset generated in step 2), train the constructed model. Select an appropriate optimization method. Design the loss function for target detection. Set hyperparameters such as initial learning rate, batch size, and number of iterations. Set the size of the preset box anchors (if the constructed algorithm involves preset boxes). Start model training and save the weight files generated for each iteration.

[0069] (3) Model weight evaluation. First, exclude the models with higher loss values ​​in the initial training stage, and then use the mAP 0.5 indicator to evaluate the remaining model weights, and select the optimal model weight as the final leaf detection model.

[0070] 2. Semantic Segmentation Model Training Steps

[0071] 1. Image data acquisition

[0072] (1) Based on the operation and maintenance monitoring equipment, collect operation and maintenance monitoring images.

[0073] 2. Semantic segmentation dataset generation

[0074] (1) Annotate all the complete images of the operation and inspection monitoring. The annotated objects are the sky, leaves, poles and wires. After the annotation is completed, the dataset is divided into a training set and a validation set in a ratio of 9:1.

[0075] (2) Data enhancement methods, including image brightness change, image flipping, and image rotation, are used to expand the training set and improve the sample capacity and richness of the training set.

[0076] 3. Construction and training of semantic segmentation model

[0077] (1) A semantic segmentation model is constructed based on a deep learning algorithm. The model recognition categories include sky, leaves, poles and wires. The specific algorithm can adopt the industry's advanced semantic segmentation algorithm according to the actual situation, including but not limited to FCVN, DeepLab-V3, U-Net, etc.

[0078] (2) Based on the semantic segmentation dataset generated in step 2), train the constructed model. Select an appropriate optimization method. Design the loss function for semantic segmentation. Set hyperparameters such as initial learning rate, batch size, and number of iterations. Start model training and save the weight files generated for each iteration.

[0079] (3) Model weight evaluation. First, exclude the models with higher loss values ​​in the initial training stage, and then use the MIOU indicator to evaluate the remaining model weights. Select the optimal model weight as the final insulator and switch semantic segmentation model.

[0080] 3. Model prediction steps

[0081] 1. Leaf detection

[0082] (1) Use the pre-trained leaf detection model to detect whether there are leaf targets in the image.

[0083] 2. Mask extraction of wires, leaves, sky and tower parts in the image

[0084] (1) The optimal weights selected during the semantic segmentation model training process are selected as the semantic segmentation model of wires, leaves, sky and towers, and the output confidence threshold is set to make predictions. Masks of wires, leaves, sky and towers are extracted.

[0085] 3. Logical processing of single frame recognition results

[0086] (1) Draw the minimum circumscribed rectangle for the tower mask and draw a line segment connecting the midpoints of the two short sides of the circumscribed rectangle. Save the image as black_image.jpg.

[0087] (2) Draw an extension line of the line segment in black_image.jpg that runs through the entire image, and then save the image as fitline_image.jpg.

[0088] (3) Remove the intersection of the white straight line, the sky, and the tower mask in fitline_image.jpg, so that an image with only the tower extension line is obtained and save it as pureganta.jpg.

[0089] (3) Compare the ratio of the white outline area in pureganta.jpg to the sum of the white outline area in pureganta.jpg and the white outline area in black_image.jpg with the set threshold (0.65). If it is greater than, it is determined that the tower is blocked by the tree; if it is less than, it starts to determine whether it blocks the power line.

[0090] (4) Now we start to determine the wire obstruction situation, fit the corresponding straight line to the wire mask, draw an extension line that runs through the image, and save the image as mask_0.jpg.

[0091] (5) Keep the part of mask_0.jpg where the white outline does not overlap with the outline of the leaves and wires. That is, at this time, the image only contains the extended outline of the wires. Save the image as mask_diff.jpg.

[0092] (6) Calculate the ratio of the difference between the white outlines in mask_0.jpg and mask_diff.jpg to the white outline in mask_0.jpg and the set threshold (0.8). If it is greater than, it is judged that the wire is blocked by the tree; if it is less than, there is no blockage.

[0093] In a second aspect, the present disclosure further provides a tree-line contradictory state identification device, the device comprising:

[0094] An image acquisition module is used for original images in real scenes as target images to be identified;

[0095] The object detection module is used to use the pre-trained leaf detection model to determine whether there are leaves in the image, and if so, to detect whether there are towers or wires blocked in the image;

[0096] The semantic segmentation module extracts the sky, poles, wires and leaves masks from the image to determine the occlusion status of the wires and poles.

[0097] According to a specific embodiment of the present disclosure, the device further includes:

[0098] The target detection model training module is used to input all pre-collected leaf samples into the target detection and semantic model for training, and retain the weights obtained through training;

[0099] The target detection model selection module is used to evaluate the weights saved in the training module and select the weights with the best evaluation index as the leaf detection model;

[0100] The semantic segmentation model training module is used to input all inspection and monitoring image samples into the semantic segmentation model for training and retain the weights obtained through training;

[0101] The semantic segmentation model selection module is used to evaluate the weights saved in the training module and select the weights with the best evaluation index as the sky, tower, wire and leaf recognition models;

[0102] The semantic segmentation model optimization acceleration module is used to convert the trained deep learning model into an intermediate representation, or IR file, that can be used by the OpenVINO inference engine. The model optimized by the model optimizer can be executed faster on Intel's multi-platform hardware without affecting accuracy.

[0103] In a third aspect, an embodiment of the present disclosure further provides a contour fitting program, which stores a computer program, and when the computer program is run on a processor, the tree-line contradictory state identification method described in the first aspect is executed.

[0104] The tree-line conflict state recognition method, device and computer equipment provided by the disclosed example based on target detection and semantic segmentation detect whether the input image contains leaf targets; extract the masks of the sky, poles, wires and leaves for analysis, and finally give the tree-line conflict state recognition result. The background interference can be greatly reduced by leaf detection. By performing semantic segmentation on the operation and inspection monitoring scene image and extracting the sky, poles, wires and leaves, the obstruction state of the poles and wires can be effectively confirmed, and the recognition accuracy can be improved.

[0105] Embodiment 1:

[0106] In this example, Figure 1 The figure shows the overall framework of model training and prediction for a single frame image, which includes two stages: model training and model prediction. The model training stage includes image data acquisition, data preprocessing, data set generation, and model training steps. This stage is used for leaf detection model and sky, pole, wire, and leaf semantic segmentation model; the prediction stage includes leaf detection, sky, pole, wire, and leaf mask extraction, and single frame result logic processing.

[0107] 1. The model training phase of this example specifically includes the following steps:

[0108] S1: Image data collection. During the model training phase, this example collected 68 leaf images.

[0109] S2: Object detection dataset generation. Figure 2 The following figure shows some leaf images obtained in this example. All leaf images are labeled, and the labeled object is the entire leaf. After the labeling is completed, the dataset is divided into a training set and a validation set in a ratio of 8:2.

[0110] S3: Object detection training sample expansion: This embodiment uses HSV color threshold transformation, inversion and mosaic transformation methods to expand the samples, expanding the training set by 4 times.

[0111] S4: Model construction and training on the target detection side. This example uses YOLOv5 as the target detection model, and the backbone network uses CSP-DarkNet53. YOLOv5 training uses 9 sets of preset frames, with sizes of (10,13), (16,30), (33,23), (30,61), (62,45), (59,119), (116,90), (156,198), and (373,326).

[0112] The loss function of the model detection box regression part adopts DIoU, as shown in formula (1) (2):

[0113]

[0114]

[0115] Among them, L DIou is the DIoU loss function, v is the detection box, b gt is the annotation box, and ρ represents the Euclidean distance between the detection box and the center of the annotation box.

[0116] The loss function of the model category judgment part adopts the softmax cross entropy loss function, as shown in formula (3) (4):

[0117]

[0118]

[0119] Among them, S is the softmax function, y iis the output of category i. Since this method involves the category of leaves, n is 1. H(p,q) is the cross entropy loss function, where p(x) is the expected classification output of image x, that is, the one-hot of the category label, and vector q(x) is the output of the network for image x, after softmax calculation.

[0120] The training optimization method of the model uses the Adam function, and the momentum is set to 0.9. The training adopts the freeze-thaw training method. First, the backbone network is frozen for 50 cycles, the batch size is set to 32, and the initial learning rate is 0.001; then the backbone network is unfrozen on this basis and trained for 150 cycles, the batch size is set to 8, and the initial learning rate is set to 0.0001. Starting from the unfreezing training, the model weights of each cycle are saved.

[0121] S5: Target detection model evaluation. First, the five weights with the lowest loss are selected by the loss value corresponding to the weight. Then, the mAP 0.5 indicator is used to evaluate the model, and the model with the highest indicator value is selected as the leaf detection model weight. At this point, the target detection model training phase is completed.

[0122] S6: Semantic segmentation dataset generation. Figure 3 The overall image of the treeline contradiction obtained in this example is shown.

[0123] S7: Semantic segmentation training sample expansion. This example uses data enhancement methods, including image brightness change, image flipping, and image rotation, to expand the training set and improve the sample capacity and richness of the training set.

[0124] S8: Semantic segmentation model construction and training. This example uses U-Net as the semantic segmentation model. The U-Net model mainly consists of two parts. The first part is feature extraction. The second part is the upsampling part. The feature extraction part uses Mobilenet as the backbone network. The loss function uses BCEDiceLoss, which is a combination of BCELoss and DiceLoss. The BCELoss loss function is shown in formula (5):

[0125] loss(x i ,y i )=-w i [y i logx i +(1-y i )log(1-x i )] (5)

[0126] Where x, y are the theoretical labels and actual predicted values, respectively, and w is the weight.

[0127] The DiceLoss loss function is shown in formula (6):

[0128]

[0129] Where |X∩Y| is the intersection of the X-category elements and the Y-category elements, and |X| and |Y| represent the number of X-category elements and the number of Y-category elements, respectively. The numerator is multiplied by 2 to ensure that the denominator is in the range [0,1] after repeated calculations. The BCEDiceLoss used in this example is equal to 0.5 times BCELoss plus 1 times DiceLoss.

[0130] The training optimization method of the model uses the Adam function, and the momentum is set to 0.9. The training batch size is set to 4, the training cycle is 200, and the initial learning rate is set to 0.0001. The model weights of each cycle are saved.

[0131] S9: Semantic segmentation model evaluation. First, exclude the models with high loss values ​​in the initial training, and then use the MIOU (Mean Intersection over Union) indicator to evaluate the remaining model weights, as shown in formula (7):

[0132]

[0133] It calculates the ratio of the intersection and union of two sets. In the semantic segmentation problem, these two sets are the ground truth and the predicted segmentation. This ratio can be transformed into the positive truth (intersection) divided by the sum of the true, false negative, and false positive (union). The IoU is calculated on each class and then averaged. The optimal model weight is selected as the final semantic segmentation model for the sky, towers, wires, and leaves. At this point, the semantic segmentation model training phase is completed.

[0134] 2. The model optimization acceleration phase of this example includes the following steps:

[0135] S1: Figure 8 The figure shows the typical development process of OpenVINO, which includes two stages: model optimizer and user application. The model optimizer includes xml model files and bin weight files; the user application stage includes inference engine, heterogeneous plug-ins and corresponding hardware.

[0136] S2: This step is used to convert the trained deep learning model into an intermediate representation, or IR file, that can be used by the OpenVINO inference engine. The IR file consists of .xml and .bin format files, where the .xml file records the network topology of the model and the .bin file is a binary file that records the convolution weight value. In order to perform inference on the target device. These models use quantization, freezing, fusion and other techniques to improve inference performance and reduce model size. In this step, the trained semantic segmentation model is configured according to the selected framework and then converted using a simple one-line command

[0137] S3: Models optimized by the model optimizer can run faster on Intel's multi-platform hardware without affecting accuracy. The optimization methods of the model optimizer include linear operation fusion or ResNet optimization. For example, linear operation fusion Figure 7 As shown in the figure, the model optimizer uses the batch normalization layer and scale and shift layer commonly used in general convolutional neural networks as a calculation sequence consisting of addition and multiplication, and fuses them into the adjacent convolutional layer to reduce the amount of memory copy calculation, thereby accelerating model reasoning.

[0138] S4: After obtaining the intermediate representation file, the calculation is completed by calling the inference engine in the user's application. The Inference Engine is an important component of OpenVINO, which contains C++ / Python API functions to initialize AI computing hardware, load models, perform inference calculations, and return calculation results. The frameworks supported by OpenVINO include TensorFlow, Caffe, MXNet, ONNX (PyTorch, Apple ML) and Kaldi.

[0139] S5: Allows users to quickly reduce the application footprint and is easy to implement. Application memory refers to the amount of space and latency that an application takes up on a user's computing device. In this example, a semantic segmentation model trained with the PyTorch framework may require a large amount of memory to execute during inference. OpenVINO can customize the compilation of Runtimes, floating-point model representation, and reduce the model size in the pre-included library.

[0140] S6: The optimized model in this example has a significant improvement in inference time. The average inference time for each photo on the CPU is about 150 ms, which can meet the real-time requirements of the computing model.

[0141] 3. The model prediction stage of this example includes the following steps:

[0142] S1: Input the inspection monitoring image to be predicted and obtain the current frame.

[0143] S2: Use the optimal model selected in the training phase to detect leaves in the current frame, and perform semantic segmentation and recognition on the image when leaves are detected.

[0144] S3: Use the optimal model selected in the training phase to extract the sky, towers, wires and leaves masks, such as Figure 4 shown.

[0145] S4: Calculate the ratio of the extended part of the tower contour fitting straight line that does not overlap with the sky tower mask to the complete extended line that does not include the sky part. The threshold in this example is set to 0.65. If it is greater than, an alarm is returned that the tower is blocked. If it is less than, continue to detect whether the wire is blocked.

[0146] S5: Calculate the ratio of the difference between the part of the extension line of the wire fitting straight line that is not blocked by the wire leaf mask and the contour area of ​​the complete extension line and the complete extension line, and compare it with the threshold. In this example, the threshold is set to 0.65. If it is greater than, an alarm is returned that the wire is blocked, and if it is less than, no alarm is given.

[0147] The application of the present invention has the following advantages:

[0148] Comprehensive recognition method: This invention uses two advanced computer vision technologies, target detection and semantic segmentation. Through target detection, the system can accurately identify the leaf targets in the image, thereby reducing background interference and improving the overall detection accuracy. At the same time, semantic segmentation technology effectively extracts the masks of the sky, poles, wires and leaves in the image, providing key information for the subsequent identification of conflicting states.

[0149] Dataset processing and enhancement: This invention makes full use of dataset processing and enhancement technology in the target detection and semantic segmentation model training stage. By annotating image data and using data enhancement methods such as brightness change, flipping, rotation, etc., the sample capacity and richness of the training set are effectively improved, thereby increasing the robustness and generalization ability of the model.

[0150] Model evaluation and selection: After model training, the invention evaluates the model weights and selects the optimal model weights as the final leaf detection and semantic segmentation model. This evaluation mechanism uses mAP 0.5 and MIOU indicators to ensure the performance stability and robustness of the model in different scenarios.

[0151] Real-time recognition and state judgment: The invention not only provides a training method, but also includes a step of real-time state judgment of the image to be recognized. Through the logical processing step, the system can determine whether the leaves block the tower or wire in a single frame image, thereby achieving rapid and accurate recognition of the contradictory state of the tree and wire.

[0152] Combination of deep learning and traditional image recognition: Compared with the judgment scheme using only deep learning, the method of combining traditional image recognition and deep learning image recognition in the present invention effectively improves the accuracy of the detection results and increases the generalization ability of recognition.

[0153] The model is widely used: the invention not only provides a method, but also designs corresponding devices and computer equipment, so that it can be widely used in practical scenarios. At the same time, the model can be applied to different deep learning algorithms, which increases its flexibility and applicability.

[0154] High performance: A state recognition algorithm based on the OpenVINO optimized model is proposed: Based on the original model, transfer learning is used to reduce the difficulty of model training; the model is optimized through the OpenVINO toolkit to improve the computing performance of the model. After testing, the target detection accuracy of the optimized model exceeds 93.17%. Compared with the original model, the computing power of the optimized model has been significantly improved in various indicators, especially the inference speed on CPU devices, which can meet the real-time requirements of edge mobile computing devices.

[0155] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A tree-line contradictory state recognition method based on target detection and semantic segmentation, characterized in that: include The object detection model training steps include image data collection, object detection dataset generation, object detection model construction and training; The steps of semantic segmentation model training include image data acquisition, semantic segmentation dataset generation, and semantic segmentation model construction and training; The model prediction steps include leaf detection, partial mask extraction of wires, leaves, sky and towers in the image, and logical processing of single-frame recognition results.

2. The tree-line contradictory state recognition method based on target detection and semantic segmentation according to claim 1 is characterized in that: In the target detection model training step, image data collection includes, Based on the operation and inspection monitoring equipment, collect operation and inspection monitoring images for subsequent data set production; The target detection dataset generation includes: All images containing leaves are labeled with leaves. After the labeling is completed, the data set is divided into a training set and a validation set in a ratio of 8:

2. Data enhancement methods, including image brightness change, image flipping, image rotation, image scaling and Mosaic enhancement methods, are used to expand the training set and improve the sample capacity and richness of the training set.

3. The tree-line contradictory state recognition method based on target detection and semantic segmentation according to claim 2 is characterized in that: The construction and training of the target detection model includes: The target detection model is built based on the deep learning algorithm, and the model identification category is leaves. Based on the generated target detection dataset, train the constructed model, select appropriate optimization methods, design the target detection loss function, set hyperparameters such as initial learning rate, batch size, number of iterations, set the size of preset box anchors, start model training, and save the weight files generated by each iteration. For model weight evaluation, we first exclude the models with higher loss values ​​in the initial stage of training, and then use the mAP0.5 indicator to evaluate the remaining model weights, and select the optimal model weights as the final leaf detection model.

4. The tree-line contradictory state recognition method based on target detection and semantic segmentation according to claim 1 is characterized in that: In the semantic segmentation model training step, Image data acquisition includes collecting operation and inspection monitoring images based on operation and inspection monitoring equipment; The generation of semantic segmentation dataset includes labeling all acquired complete images of operation and inspection monitoring, with the labeled objects being the sky, leaves, poles and wires. After labeling, the dataset is divided into training set and validation set in a ratio of 9:

1. Data enhancement methods, including image brightness change, image flipping, and image rotation, are used to expand the training set and improve the sample capacity and richness of the training set.

5. The tree-line contradictory state recognition method based on target detection and semantic segmentation according to claim 4 is characterized in that: The construction and training of the semantic segmentation model includes The semantic segmentation model is built based on the deep learning algorithm. The model recognition categories include sky, leaves, poles and wires. The specific algorithm can adopt the industry's advanced semantic segmentation algorithm according to the actual situation, including but not limited to FCVN, DeepLab-V3, U-Net, etc. Based on the generated semantic segmentation dataset, train the constructed model, select appropriate optimization methods, design the loss function of semantic segmentation, set hyperparameters such as initial learning rate, batch size, number of iterations, start model training, and save the weight files generated by each iteration. For model weight evaluation, we first exclude models with higher loss values ​​in the initial stage of training, and then use the MIOU indicator to evaluate the remaining model weights, and select the optimal model weights as the final insulator and switch semantic segmentation model.

6. The tree-line contradictory state recognition method based on target detection and semantic segmentation according to claim 1, characterized in that: In the model prediction step, Leaf detection includes using a pre-trained leaf detection model to detect whether there are leaf targets in the image; The mask extraction of the wires, leaves, sky and tower parts in the image includes selecting the optimal weights selected during the semantic segmentation model training process as the wires, leaves, sky and tower semantic segmentation model, setting the output confidence threshold, making predictions, and extracting the masks of the wires, leaves, sky and tower parts.

7. The tree-line contradictory state recognition method based on target detection and semantic segmentation according to claim 6, characterized in that: The logical processing of single-frame recognition results includes: Draw the minimum circumscribed rectangle for the tower mask, and draw a line segment connecting the midpoints of the two short sides of the circumscribed rectangle, and save the image as black_image.jpg; Draw an extension line of the line segment in black_image.jpg, which runs through the entire image, and then save the image as fitline_image.jpg; Remove the intersection of the white straight line, sky and tower mask in fitline_image.jpg, so as to get a picture with only the tower extension line, and save it as pureganta.jpg; Compare the ratio of the white outline area in pureganta.jpg to the sum of the white outline area in pureganta.jpg and the white outline area in black_image.jpg with the set threshold value, which is 0.

65. If it is greater than this, it is determined that the tower is blocked by the tree; if it is less than this, it starts to determine whether it blocks the power line; At this time, we start to judge the shielding situation of the wires, fit the corresponding straight line to the wire mask, and draw the extension line that runs through the picture, and save the picture as mask_0.jpg; Keep the part of mask_0.jpg where the white outline does not overlap with the outline of the leaves and wires. That is, the image now only contains the extension of the wire outline. Save the image as mask_diff.jpg. Calculate the relationship between the difference between the white outlines in mask_0.jpg and mask_diff.jpg and the ratio of the white outline in mask_0.jpg to the set threshold. The threshold is 0.

8. If it is greater than, it is judged that the wire is blocked by the tree. If it is less than, there is no blockage.

8. A tree-line contradictory state recognition device, according to the tree-line contradictory state recognition method based on target detection and semantic segmentation according to claims 1-7, characterized in that: include An image acquisition module is used for original images in real scenes as target images to be identified; The object detection module is used to use the pre-trained leaf detection model to determine whether there are leaves in the image, and if so, to detect whether there are towers or wires blocked in the image; The semantic segmentation module extracts the sky, poles, wires and leaves masks from the image to determine the occlusion status of the wires and poles.

9. The tree-line contradictory state recognition device according to claim 8, characterized in that: Also includes The target detection model training module is used to input all pre-collected leaf samples into the target detection and semantic model for training, and retain the weights obtained through training; The target detection model selection module is used to evaluate the weights saved in the training module and select the weights with the best evaluation index as the leaf detection model; The semantic segmentation model training module is used to input all inspection and monitoring image samples into the semantic segmentation model for training and retain the weights obtained through training; The semantic segmentation model selection module is used to evaluate the weights saved in the training module and select the weights with the best evaluation index as the sky, tower, wire and leaf recognition models; The semantic segmentation model optimization acceleration module is used to convert the trained deep learning model into an intermediate representation, or IR file, that can be used by the OpenVINO inference engine. The model optimized by the model optimizer can be executed faster on Intel's multi-platform hardware without affecting accuracy.

Citation Information

Patent Citations

  • Leaf-shielding-resistant CIM real-time imaging method for detecting abnormal parking of shared bicycle

    CN111612895A

  • Behavior recognition method and device and computer equipment

    CN113065474A

  • Method and device for detecting shielding of monitoring equipment by foreign matter

    CN113221603A

  • Knife switch opening and closing state identification method and system, storage medium and computer equipment

    CN113569819A

  • Distribution network line unmanned aerial vehicle intelligent inspection and dynamic inventory management system

    CN115578651A

Cited By

  • Intelligent seabed polymetallic nodule identification method based on YOLO-Nodules

    CN120047790A

  • Power transmission and transformation line inspection method, system and equipment and storage medium

    CN120808065A

  • Pet rope-pulling-free identification method based on fine-grained detection and segmentation

    CN121033741A

  • Submarine pipeline real-time detection and positioning method and device and related products

    CN122066709A

  • Facility management device, facility management method, and recording medium

    WO2026154666A1