Complex background insulator string directional detection method and system
By combining an adaptive keypoint set and a modulated deformable convolution function with a spatial loss function, the directional detection model solves the problems of angle regression error and background interference in insulator string detection under complex backgrounds, and achieves high-precision directional detection of insulator strings.
Patent Information
- Application Number
- CN202511008272.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-11-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for directional detection of insulator strings suffer from large angle regression errors in complex backgrounds and have difficulty effectively suppressing background interference, resulting in low detection accuracy.
An adaptive keypoint set is used to construct a directional detection model. By combining a modulated deformable convolution function and a spatial loss function, the spatial loss function is used in the initial and refined detection stages to improve the detection model's ability to focus on the target region and reduce angular errors and background interference.
It enables accurate orientation detection of insulator strings under complex backgrounds, improves detection accuracy, and reduces the impact of background interference on detection results.
Smart Images

Figure CN120894629A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent power line inspection technology, specifically to a method and system for directional detection of insulator strings in complex backgrounds. Background Technology
[0002] Insulator strings, as core components of transmission lines, are crucial for the stable operation of power systems. However, they are susceptible to damage from harsh environments, contributing to up to 81.3% of power accidents. my country's transmission lines are widely distributed in the field, making them vulnerable to damage from sunlight, lightning strikes, and pollution, leading to performance degradation of insulator strings and potentially serious consequences. Therefore, regular inspection of insulator strings is essential. Currently, inspection methods include manual labor, helicopters, and drones. Manual inspection is inefficient, arduous, and dangerous; helicopter inspection is efficient but costly and lacks flexibility. Drone inspection, leveraging 5G + BeiDou technology, achieves precise navigation and safe, efficient detection, and has been applied to inspections in mountainous areas. Combined with artificial intelligence algorithms, drone inspection images can significantly improve the accuracy and efficiency of insulator string defect detection, becoming a key technology for building smart grids. Therefore, researching intelligent detection methods for insulator strings not only has significant application value but also important strategic significance.
[0003] However, insulator string images contain very complex backgrounds, such as towers, rivers, fields, buildings, and vegetation, and the insulator strings themselves are multi-scale, elongated, and arranged in arbitrary directions. In this situation, conventional intelligent detection methods struggle to achieve satisfactory accuracy and results. This is because conventional detection methods typically use horizontal bounding boxes for insulator string detection (including insulator string localization and defect identification). The bounding boxes surrounding slanted, elongated insulator strings are highly likely to contain a lot of complex background, sometimes even larger than the insulator string itself, ultimately affecting feature extraction quality and detection performance.
[0004] Currently, methods based on traditional image processing and deep learning are mainly used to detect insulator strings in complex backgrounds. Among them, directional target detection based on deep learning has achieved the best detection accuracy because it uses directional bounding boxes to better reduce the impact of complex backgrounds on insulator string detection. This affirms the advantages and necessity of directional detection to a certain extent.
[0005] Despite this, insulator string orientation detection methods still suffer from a key problem: neglecting the impact of angle regression errors on the detection results. Furthermore, current mainstream orientation detection methods all rely heavily on angle regression. Experiments have revealed that near the critical point of discontinuity in the loss function, existing orientation detection methods inevitably introduce angle regression errors, reaching up to 8°. This can result in the background occupying as much as 75% of the bounding box when the insulator string's aspect ratio is 20. Therefore, current orientation detection methods do not adequately suppress background interference, and there is room for improvement in detection performance. Summary of the Invention
[0006] The purpose of this application is to provide a method and system for directional detection of insulator strings against complex backgrounds. This application can effectively remove complex backgrounds and avoid introducing angle regression errors during the directional detection of insulator strings, thereby achieving accurate detection of insulator strings against complex backgrounds.
[0007] The first aspect of this application provides a method for directional detection of insulator strings in complex backgrounds, including:
[0008] Step S1: Obtain insulator string image sample data, perform image augmentation processing on the insulator string image sample data to obtain target insulator string image data, and obtain insulator string dataset based on the target insulator string image data;
[0009] Step S2: Construct a feature pyramid network; obtain adaptive sampling points and construct a target detection network using the adaptive sampling points; construct a preliminary orientation detection model based on the feature pyramid network and the target detection network; wherein the detection process of the preliminary orientation detection model includes an initial detection stage and a refined detection stage;
[0010] Step S3: Set the modulated deformable convolution function; In the initial detection stage of the preliminary orientation detection model, the modulated deformable convolution function is introduced, and the adaptive acquisition points are located according to the modulated deformable convolution function;
[0011] Step S4: Design the spatial loss function of the preliminary orientation detection model, which includes the initial stage spatial loss function and the refinement stage spatial loss function; obtain the classification loss function and the localization loss function, and construct the overall loss function of the preliminary orientation detection model based on the spatial loss function, the classification loss function and the localization loss function;
[0012] Step S5: Train the preliminary orientation detection model based on the insulator string dataset to obtain an accurate orientation detection model; detect the insulator string image to be detected according to the accurate orientation detection model to obtain the detection result corresponding to the insulator string image to be detected.
[0013] Preferably, step S1 specifically includes:
[0014] The image augmentation process includes horizontal flipping, random brightness variation processing, and Gaussian noise addition.
[0015] Obtain a preset division ratio, and divide the insulator string images in the target insulator string image data according to the preset division ratio to obtain an insulator string image training set, an insulator string image verification set, and an insulator string image test set.
[0016] The insulator string dataset is constructed based on the insulator string image training set, insulator string image verification set, and insulator string image test set.
[0017] Preferably, step S2 specifically includes:
[0018] Construct a feature pyramid network based on the residual network;
[0019] The geometric features of the insulator string are obtained based on the feature pyramid network. An adaptive sampling point set containing nine adaptive sampling points is constructed based on the geometric features of the insulator string, and the adaptive sampling point set is used as the target detection network.
[0020] Preferably, a modulated deformable convolution function is set, specifically as follows:
[0021] Introducing the modulation scalar Δm i ;
[0022] The modulated deformable convolution function is: Where w represents the network weights, x(p0) represents the input features of the image at point p0, y(p0) represents the output features of the image at point p0, and Δp i The learnable offset, Δm i ∈[0,1] represents a learnable modulation scalar.
[0023] Preferably, a modulated deformable convolution function is introduced in the initial detection stage of the preliminary orientation detection model, and the adaptive acquisition points are located based on the modulated deformable convolution function, specifically as follows:
[0024] In the initial detection phase, the target center point of the adaptive sampling point set is obtained and used as the modulation start point; based on the modulation start point and the debug deformable convolution function, deformable convolution prediction is performed to obtain the predicted position offset, and the first set of adaptive sampling points is obtained based on the predicted position offset.
[0025] Set a transformation function to convert the first set of adaptive sampling points into oriented bounding boxes according to the transformation function;
[0026] In the refinement detection stage, the first set of adaptive sampling points is refined and adjusted to obtain the second set of adaptive sampling points, and the object is located based on the second set of adaptive sampling points.
[0027] Preferably, the spatial loss function of the preliminary orientation detection model is designed as follows:
[0028] Space loss function L c The function L can be calculated c =L B,G +L B,B Calculated;
[0029] L B,G It can be calculated by function The calculation yielded B. i Indicates the prediction box. N represents the true bounding box with the largest intersection-union ratio excluding the specified target. + Indicates the number of positive samples; the Smoothln function is used to generate differentiable functions, and the IoG function represents B. i and The proportion of the area of the intersection between them to the actual frame area;
[0030] L B,B It can be calculated by function The calculation yields RIOU(B) i B j ) represents B i B j The cross-union ratio between the two oriented bounding boxes.
[0031] Preferably, the Smoothln function is used to generate differentiable functions, specifically:
[0032] The Smoothln function has the following operation rules: Where σ is an adjustable smoothing parameter, and s represents the sensitivity of the loss function;
[0033] The IoG function represents B. i and The proportion of the area of the intersection between them to the actual frame area is as follows:
[0034] The function operation rules for IoG functions are as follows: Where area represents the area of the oriented bounding box.
[0035] Preferably, the classification loss function and the localization loss function are obtained, and the overall loss function of the preliminary orientation detection model is constructed based on the spatial loss function, the classification loss function, and the localization loss function, specifically as follows:
[0036] Set the balance weight coefficients λ1 and λ2;
[0037] The overall loss function L can be calculated using the function L = L cls +λ1(L loc1 +L c1 )+λ2(L loc2 +L c2 )Calculation yielded L cls For the classification loss function, L loc1 L is the localization loss function in the initial detection phase. loc2 To refine the localization loss function during the detection phase, L c1 L is the spatial loss function for the initial detection phase. c2 To refine the spatial loss function in the detection phase.
[0038] Preferably, the image of the insulator string to be detected is detected according to the accurate orientation detection model to obtain the detection result corresponding to the image of the insulator string to be detected, specifically as follows:
[0039] Acquire an image of the insulator string to be detected, and use the image of the insulator string to be detected as input to the accurate orientation detection model;
[0040] The accurate orientation detection model performs orientation detection on the image of the insulator string to be detected and outputs the detection result corresponding to the image of the insulator string to be detected.
[0041] A second aspect of this application provides a system for directional detection of insulator strings against complex backgrounds, which is applied to a method for directional detection of insulator strings against complex backgrounds. The system includes:
[0042] Data set acquisition module: used to acquire insulator string image sample data, perform image augmentation processing on the insulator string image sample data to obtain target insulator string image data, and obtain insulator string dataset based on the target insulator string image data;
[0043] The detection model construction module is used to construct a feature pyramid network; obtain adaptive sampling points and construct a target detection network using the adaptive sampling points; and construct a preliminary directional detection model based on the feature pyramid network and the target detection network. The detection process of the preliminary directional detection model includes an initial detection stage and a refined detection stage.
[0044] Model First Setting Module: Used to set the modulated deformable convolution function; Introducing the modulated deformable convolution function in the initial detection stage of the preliminary orientation detection model, and performing object localization on the adaptive acquisition points based on the modulated deformable convolution function;
[0045] The second model setting module is used to design the spatial loss function of the preliminary orientation detection model. The spatial loss function includes the initial stage spatial loss function and the refinement stage spatial loss function. It also obtains the classification loss function and the localization loss function, and constructs the overall loss function of the preliminary orientation detection model based on the spatial loss function, the classification loss function, and the localization loss function.
[0046] The detection model determination module is used to train the preliminary orientation detection model based on the insulator string dataset to obtain an accurate orientation detection model; and to detect the image of the insulator string to be detected according to the accurate orientation detection model to obtain the detection result corresponding to the image of the insulator string to be detected.
[0047] In summary, the beneficial effects of this application are:
[0048] 1. The orientation detection model based on the adaptive keypoint set can adaptively and accurately capture the geometric structure of the insulator string without producing the angle error that occurs during bounding box regression in traditional orientation detection methods.
[0049] 2. The preliminary orientation detection model introduces a modulated deformable convolution function in the initial stage, replacing the traditional deformable convolution to allow the adaptive sampling point set to focus on the relevant target region. This makes the model more focused on the target region and improves its ability to extract key features. Furthermore, a spatial loss function is introduced in both the initial detection stage and the refinement detection stage to suppress mutual interference between multiple adjacent insulator strings. This effectively solves the problem that local points in the adaptive key point set are easily influenced by adjacent insulator strings with strong key features, causing them to move towards adjacent insulator strings and leading to multiple insulator strings being mistaken for a single insulator string, ultimately resulting in missed detections. This improves the detection accuracy of the orientation detection model. The combination of modulated deformable convolution and the spatial loss function further enhances the modeling capability of the adaptive sampling point set. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of this application, some of the accompanying drawings in the embodiments of this application will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be considered as a limitation on the scope of this application.
[0051] Figure 1 A flowchart illustrating the directional detection method for insulator strings with complex backgrounds provided in this application;
[0052] Figure 2 A schematic diagram of the structure of the complex background insulator string orientation detection system provided in this application;
[0053] Figure 3 Flowchart of the overall loss function design for the directional detection method for insulator strings with complex backgrounds provided in this application;
[0054] Figure 4 A block diagram of the insulator string detection software system for the complex background insulator string orientation detection method provided in this application. Detailed Implementation
[0055] The following examples and... Figures 1 to 4 This application will be described in further detail, but the implementation of this application is not limited thereto.
[0056] Reference Figure 1 The diagram shown is a flowchart illustrating the method for directional detection of insulator strings with complex backgrounds provided in an embodiment of this application.
[0057] Methods for directional detection of insulator strings in complex backgrounds include:
[0058] Step S1: Obtain insulator string image sample data, perform image augmentation processing on the insulator string image sample data to obtain target insulator string image data, and obtain insulator string dataset based on the target insulator string image data;
[0059] Step S2: Construct a feature pyramid network; obtain adaptive sampling points and construct an object detection network using the adaptive sampling points; construct a preliminary orientation detection model based on the feature pyramid network and the object detection network; the detection process of the preliminary orientation detection model includes an initial detection stage and a refined detection stage;
[0060] Step S3: Set the modulated deformable convolution function; Introduce the modulated deformable convolution function in the initial detection stage of the preliminary orientation detection model, and use the modulated deformable convolution function to locate objects at adaptive acquisition points;
[0061] Step S4: Design the spatial loss function of the preliminary orientation detection model, which includes the initial stage spatial loss function and the refinement stage spatial loss function; obtain the classification loss function and the localization loss function, and construct the overall loss function of the preliminary orientation detection model based on the spatial loss function, the classification loss function, and the localization loss function;
[0062] Step S5: Train the preliminary orientation detection model based on the insulator string dataset to obtain an accurate orientation detection model; perform detection on the insulator string image to be detected based on the accurate orientation detection model to obtain the detection result corresponding to the insulator string image to be detected.
[0063] Step S1 is as follows:
[0064] Image augmentation processing includes horizontal flipping, random brightness variation processing, and Gaussian noise addition.
[0065] Obtain a preset division ratio, and divide the insulator string images in the target insulator string image data according to the preset division ratio to obtain an insulator string image training set, an insulator string image verification set, and an insulator string image test set.
[0066] An insulator string dataset is constructed based on an insulator string image training set, an insulator string image verification set, and an insulator string image test set.
[0067] In some embodiments, for the 848 images provided by the existing Chinese transmission line insulator dataset, these 848 images are used as insulator string image sample data. Image enhancement techniques such as horizontal flipping and brightness variation are used to expand the images to 2544. If the preset division ratio is 8:1:1, then all images are divided into training set, validation set and test set in a ratio of 8:1:1.
[0068] Step S2, specifically:
[0069] Construct a feature pyramid network based on the residual network;
[0070] The geometric features of the insulator string are obtained based on the feature pyramid network. An adaptive sampling point set containing nine adaptive sampling points is constructed based on the geometric features of the insulator string, and the adaptive sampling point set is used as the target detection network.
[0071] In some embodiments, a feature pyramid network (FPN) is constructed with a residual network (specifically ResNet101) as the backbone to extract features from the insulator string image;
[0072] Specifically, the FPN input is an 800x500 pixel image of an insulator string. ResNet convolutional residual blocks are used to generate five top-down feature maps {C1, C2, C3, C4, C5} at five scales. Then, the high-level feature maps are upsampled, and the lower-level feature maps are horizontally connected from top to bottom to fuse semantic and positional information. Multiple layers of feature maps {P2, P3, P4, P5, P6} are obtained as the FPN output for subsequent prediction. Notably, to reduce computational load without sacrificing detection accuracy, only {P3, P4, P5, P6} are retained in the output, while P2 is removed.
[0073] Set the modulated deformable convolution function as follows:
[0074] Introducing the modulation scalar Δm i ;
[0075] The modulated deformable convolution function is: Where w represents the network weights, x(p0) represents the input features of the image at point p0, y(p0) represents the output features of the image at point p0, and Δp iThe learnable offset, Δm i ∈[0,1] represents a learnable modulation scalar.
[0076] In the initial detection stage of the preliminary orientation detection model, a modulated deformable convolution function is introduced. Object localization is then performed on the adaptive acquisition points based on this modulated deformable convolution function. Specifically:
[0077] In the initial detection phase, the target center point of the adaptive sampling point set is obtained and used as the modulation start point; based on the modulation start point and the debugged deformable convolution function, deformable convolution prediction is performed to obtain the predicted position offset, and the first set of adaptive sampling points is obtained based on the predicted position offset.
[0078] Set a transformation function to convert the first set of adaptive sampling points into oriented bounding boxes based on the transformation function;
[0079] In the refinement detection stage, the first set of adaptive sampling points is refined and adjusted to obtain the second set of adaptive sampling points, and the object is located based on the second set of adaptive sampling points.
[0080] In some embodiments, an adaptive sampling point set (i.e., Reppoints) is used as the target detection network; a set of 9 adaptive sampling points Repponits is used, which is transformed into oriented bounding boxes by the transformation function ConvexHull;
[0081] Specifically, Reppoints are a set of 9 adaptive sampling points, and a bounding box is generated through a transformation function. The whole process is divided into two stages. In the initial stage, starting from the target center point, the position offset is predicted by modulating deformable convolution to obtain the first set of Reppoints and generate the bounding box. In the refinement stage, the first set of Reppoints is refined and adjusted to obtain the second set of Reppoints, which represents a more refined object localization.
[0082] In some embodiments, to prevent reppoints from exceeding the region of interest, a modulation scalar Δm is introduced into the deformable convolution in the initial stage. i By adjusting the weighting coefficient Δm of the sampling points i Distinguish whether the area of interest is outside the region of interest;
[0083] Specifically, setting the network weights to w, and x(p0) and y(p0) to represent the input and output features at position w, respectively, the modulated deformable convolution can be expressed as:
[0084] Where Δp i and Δm i∈[0,1] represents the learnable offset and modulation scalar, respectively, Δm i The value range is [0,1], so that the output features can be well concentrated on the relevant image regions. Bilinear interpolation is used to calculate the corresponding feature values. The offset and modulation scalar are obtained through separate convolutional layers. The output of the convolution is 3N channels, of which the first 2N channels correspond to the learned offset, and the remaining N channels are further passed through a sigmoid layer to predict the modulation scalar. N is 9.
[0085] The spatial loss function of the preliminary orientation detection model is designed as follows:
[0086] Space loss function L c The function L can be calculated c =L B,G +L B,B Calculated;
[0087] L B,G It can be calculated by function The calculation yielded B. i Indicates the prediction box. N represents the true bounding box with the largest intersection-union ratio excluding the specified target. + Indicates the number of positive samples; the Smoothln function is used to generate differentiable functions, and the IoG function represents B. i and The proportion of the area of the intersection between them to the actual frame area;
[0088] L B,B It can be calculated by function The calculation yields RIOU(B) i B j ) represents B i B j The cross-union ratio between the two oriented bounding boxes.
[0089] The Smoothln function is used to generate differentiable functions, specifically:
[0090] The Smoothln function has the following operation rules: Where σ is an adjustable smoothing parameter, and s represents the sensitivity of the loss function;
[0091] The IoG function represents B. i and The proportion of the area of the intersection between them to the actual frame area is as follows:
[0092] The function operation rules for IoG functions are as follows: Where area represents the area of the oriented bounding box.
[0093] Obtain the classification loss function and the localization loss function. Based on the spatial loss function, classification loss function, and localization loss function, construct the overall loss function of the preliminary orientation detection model, specifically as follows:
[0094] Set the balance weight coefficients λ1 and λ2;
[0095] The overall loss function L can be calculated using the function L = L cls +λ1(L loc1 +L c1 )+λ2(L loc2 +L c2 )Calculation yielded L cls For the classification loss function, L loc1 L is the localization loss function in the initial detection phase. loc2 To refine the localization loss function during the detection phase, L c1 L is the spatial loss function for the initial detection phase. c2 To refine the spatial loss function in the detection phase.
[0096] The image of the insulator string to be detected is analyzed based on the accurate orientation detection model, and the corresponding detection results are obtained. Specifically:
[0097] Acquire an image of the insulator string to be detected and use the image of the insulator string to be detected as input to the accurate orientation detection model;
[0098] The accurate orientation detection model performs orientation detection on the image of the insulator string to be detected and outputs the detection result corresponding to the image of the insulator string to be detected.
[0099] In some embodiments, to prevent Reppoints from misidentifying multiple adjacent insulator strings as a single string, leading to missed detections, a spatial loss function L is further introduced in the initialization and refinement stages, building upon the existing mainstream classification and localization loss functions. c The design of the overall loss function is as follows: Figure 3 As shown;
[0100] Specifically, using Foaclloss as the classification loss function, GIoU as the localization loss function in the initial and refinement stages, and introducing a spatial loss function in the initial and refinement stages, the overall loss function can be expressed as: L = L cls +λ1(L loc1 +L c1 )+λ2(L loc2 +L c2 ); where λ1 and λ2 are the balancing weight coefficients, L cls For the classification loss function, L loc1 and L loc2L is the localization loss function for the initial and refinement stages. c1 and L c2 The spatial loss function is used for both the initialization and refinement stages, and the localization and spatial loss functions for the initialization and refinement stages have the same expression;
[0101] Specifically, the space loss function is L c =L B,G +L B,B , where L B,G This describes the overlap between the predicted bounding box and the adjacent ground truth bounding boxes, L B,B This describes the overlap between predicted bounding boxes representing targets corresponding to different insulator strings, assuming that the number of positive samples in Reppoints is N. + So L B,G It can be represented as: Among them B i Indicates the prediction box. N represents the true bounding box with the largest intersection-union ratio excluding the specified target. + Indicates the number of positive samples;
[0102] The IoG function can be expressed as: The Smoothln function can be expressed as:
[0103] Where area represents the area of the bounding box, Smoothln is used to generate a differentiable function, is an adjustable smoothing parameter, and represents the sensitivity of the loss function. Let the number of true bounding boxes be N. G , using S + Let S represent the set of positive samples of the predicted bounding boxes, and let S be the set of the predicted bounding boxes based on the assigned ground truth bounding boxes. + Divided into N G A disjoint subset, Among them, in S j (j=1,2,N G The bounding box samples in the diagram correspond to the j-th ground truth box, and each predicted box B is defined as follows: i Belongs to only a subset Indicates assignment to B i The index of the real box.
[0104] Based on the above representation, L B,B It can be represented as
[0105] RIoU represents B i and B j The intersection-union ratio (IoU) between the two oriented bounding boxes is 1(s) = 1 when s > 0 and 1(s) = 0 when s = 0. ε is a small positive number to prevent the denominator from becoming zero. The constructed spatial loss function L... cThis not only maintains the independence between predicted boxes, but also prevents predicted boxes from shifting to the ground truth boxes of other nearby objects, thus enhancing the model's performance.
[0106] In some embodiments, the insulator string dataset from step 1 is used to train the preliminary orientation detection model. The hyperparameters set during training are as follows: the batch size for model training and validation is set to 2, the number of epochs is 100, and the input image size is uniformly adjusted to 800×500×3. To effectively update network weights and biases, a momentum-based SGD optimizer is used, with a weight decay coefficient set to 0.0001. To achieve the best training results, pre-trained weights from ImageNet classification are used as the initial weights of the network. Furthermore, a warm-up is employed, i.e., the learning rate is gradually increased in the early stages of training and then gradually decreased thereafter, to ensure convergence while accelerating the training speed.
[0107] In some embodiments, the present invention also relates to software for insulator string identification using the insulator string accurate orientation detection method in complex backgrounds described above, the software framework being as follows: Figure 4 As shown, it specifically includes a data access layer, a business logic layer, and a presentation layer.
[0108] Specifically, the overall framework of the insulator string detection software adopts a B / S architecture, with the server and browser communicating via the HTTPS protocol. The backend uses the Flask framework, and the web pages are created using Hypertext Markup Language (HTML).
[0109] The presentation layer is mainly divided into a user interface module and an input / output module. The user interface module is responsible for user login and displaying data, while the input / output module is responsible for extracting insulator images and displaying recognition results.
[0110] The business logic layer is mainly divided into an image preprocessing module, a model loading module, and an insulator string image detection module. These three functional modules are responsible for detecting and recognizing the uploaded insulator images.
[0111] The data access layer is divided into a module for reading insulator string images and a module for storing recognition results. It mainly extracts local images and saves the recognized images.
[0112] This software can upload images of insulator strings to be inspected individually or in batches, inputting them into a backend-deployed accurate orientation detection model. The server then analyzes and calculates the data, displaying and saving the results. By using a B / S architecture for the detection software, with the detection model deployed on the backend and a login interface on the front end, and by automatically and accurately identifying images collected by drones, it significantly reduces labor costs and improves detection speed while maintaining accuracy.
[0113] Reference Figure 2 The diagram shown is a structural schematic of the complex background insulator string orientation detection system provided in an embodiment of this application. The system includes:
[0114] Dataset acquisition module: used to acquire insulator string image sample data, perform image augmentation processing on the insulator string image sample data to obtain target insulator string image data, and obtain insulator string dataset based on the target insulator string image data;
[0115] The detection model construction module is used to build a feature pyramid network; obtain adaptive sampling points and build a target detection network with the adaptive sampling points; and build a preliminary directional detection model based on the feature pyramid network and the target detection network. The detection process of the preliminary directional detection model includes an initial detection stage and a refined detection stage.
[0116] The first model setting module is used to set the modulated deformable convolution function; the modulated deformable convolution function is introduced in the initial detection stage of the preliminary orientation detection model, and the object is located by adaptive acquisition points based on the modulated deformable convolution function;
[0117] The second model setting module is used to design the spatial loss function of the preliminary orientation detection model. The spatial loss function includes the initial stage spatial loss function and the refinement stage spatial loss function; obtain the classification loss function and the localization loss function; and construct the overall loss function of the preliminary orientation detection model based on the spatial loss function, the classification loss function, and the localization loss function.
[0118] The detection model determination module is used to train the preliminary orientation detection model based on the insulator string dataset to obtain the accurate orientation detection model; and to detect the insulator string image to be detected based on the accurate orientation detection model to obtain the corresponding detection result of the insulator string image.
[0119] The above are merely preferred embodiments of this application. The scope of protection of this application is not limited to the above embodiments. All technical solutions within the scope of this application's concept are within the scope of protection of this application. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of this application should also be considered within the scope of protection of this application.
Claims
1. A method for directional detection of insulator strings in complex backgrounds, characterized in that, include: Step S1: Obtain insulator string image sample data, perform image augmentation processing on the insulator string image sample data to obtain target insulator string image data, and obtain insulator string dataset based on the target insulator string image data; Step S2: Construct the feature pyramid network; Obtain adaptive sampling points and construct a target detection network using the adaptive sampling points; construct a preliminary orientation detection model based on the feature pyramid network and the target detection network; wherein the detection process of the preliminary orientation detection model includes an initial detection stage and a refined detection stage; Step S3: Set the modulated deformable convolution function; In the initial detection stage of the preliminary orientation detection model, the modulated deformable convolution function is introduced, and the adaptive acquisition points are located according to the modulated deformable convolution function; Step S4: Design the spatial loss function of the preliminary orientation detection model, which includes the initial stage spatial loss function and the refinement stage spatial loss function; obtain the classification loss function and the localization loss function, and construct the overall loss function of the preliminary orientation detection model based on the spatial loss function, the classification loss function and the localization loss function; Step S5: Train the preliminary orientation detection model based on the insulator string dataset to obtain an accurate orientation detection model; detect the insulator string image to be detected according to the accurate orientation detection model to obtain the detection result corresponding to the insulator string image to be detected.
2. The method for directional detection of insulator strings in complex backgrounds according to claim 1, characterized in that, Step S1 is as follows: The image augmentation process includes horizontal flipping, random brightness variation processing, and Gaussian noise addition. Obtain a preset division ratio, and divide the insulator string images in the target insulator string image data according to the preset division ratio to obtain an insulator string image training set, an insulator string image verification set, and an insulator string image test set. The insulator string dataset is constructed based on the insulator string image training set, insulator string image verification set, and insulator string image test set.
3. The method for directional detection of insulator strings in complex backgrounds according to claim 2, characterized in that, Step S2, specifically: Construct a feature pyramid network based on the residual network; The geometric features of the insulator string are obtained based on the feature pyramid network. An adaptive sampling point set containing nine adaptive sampling points is constructed based on the geometric features of the insulator string, and the adaptive sampling point set is used as the target detection network.
4. The method for directional detection of insulator strings in complex backgrounds according to claim 3, characterized in that, Set the modulated deformable convolution function as follows: Introducing the modulation scalar Δm i ; The modulated deformable convolution function is: Where w represents the network weights, x(p0) represents the input features of the image at point p0, y(p0) represents the output features of the image at point p0, and Δp i The learnable offset, Δm i ∈[0,1] represents a learnable modulation scalar.
5. The method for directional detection of insulator strings in complex backgrounds according to claim 4, characterized in that, In the initial detection stage of the preliminary orientation detection model, a modulated deformable convolution function is introduced. Object localization is performed on the adaptive acquisition points based on this modulated deformable convolution function, specifically as follows: In the initial detection phase, the target center point of the adaptive sampling point set is obtained, and the target center point is used as the modulation start point; Based on the modulation start point and the debugged deformable convolution function, deformable convolution prediction is performed to obtain the predicted position offset, and the first set of adaptive sampling points is obtained based on the predicted position offset. Set a transformation function, and convert the first set of adaptive sampling points into oriented bounding boxes according to the transformation function; In the refinement detection stage, the first set of adaptive sampling points is refined and adjusted to obtain the second set of adaptive sampling points, and the object is located based on the second set of adaptive sampling points.
6. The method for directional detection of insulator strings in complex backgrounds according to claim 5, characterized in that, The spatial loss function of the preliminary orientation detection model is designed as follows: Space loss function L c By calculating function L c =L B,G +L B,B Calculated; L B,G By calculating the function The calculation yielded B. i Indicates the prediction box. N represents the true bounding box with the largest intersection-union ratio excluding the specified target. + Indicates the number of positive samples; the Smoothln function is used to generate differentiable functions, and the IoG function represents B. i and The proportion of the area of the intersection between them to the actual frame area; L B,B By calculating the function The calculation yields RIOU(B) i B j ) represents B i B j The cross-union ratio (CUC) between the two oriented bounding boxes, N + S represents the number of positive samples. + This represents the set of positive samples for the predicted bounding box.
7. The method for directional detection of insulator strings with complex backgrounds according to claim 6, characterized in that, The Smoothln function is used to generate differentiable functions, specifically: The Smoothln function operates according to the following rules: Where σ is an adjustable smoothing parameter, and s represents the sensitivity of the loss function; The IoG function represents B. i and The proportion of the area of the intersection between them to the actual frame area is as follows: The function operation rules for IoG functions are as follows: Where area represents the area of the oriented bounding box, B i Indicates the prediction box. This indicates that the predicted box has the highest intersection-union ratio (IU) among the true boxes except for the specified target.
8. The method for directional detection of insulator strings with complex backgrounds according to claim 7, characterized in that, Obtain the classification loss function and the localization loss function. Based on the spatial loss function, classification loss function, and localization loss function, construct the overall loss function of the preliminary orientation detection model, specifically as follows: Set the balance weight coefficients λ1 and λ2; The overall loss function L is calculated using the function: L = L cls +λ1(L loc1 +L c1 )+λ2(L loc2 +L c2 )Calculation yielded L cls For the classification loss function, L loc1 L is the localization loss function in the initial detection phase. loc2 To refine the localization loss function during the detection phase, L c1 L is the spatial loss function for the initial detection phase. c2 To refine the spatial loss function in the detection phase.
9. The method for directional detection of insulator strings with complex backgrounds according to claim 8, characterized in that, The image of the insulator string to be detected is analyzed based on the accurate orientation detection model, and the detection result corresponding to the image of the insulator string to be detected is obtained, specifically as follows: Acquire an image of the insulator string to be detected, and use the image of the insulator string to be detected as input to the accurate orientation detection model; The accurate orientation detection model performs orientation detection on the image of the insulator string to be detected and outputs the detection result corresponding to the image of the insulator string to be detected.
10. A system for directional detection of insulator strings against complex backgrounds, the system being used to implement the directional detection method for insulator strings against complex backgrounds as described in any one of claims 1-9, characterized in that, The system includes: Data set acquisition module: used to acquire insulator string image sample data, perform image augmentation processing on the insulator string image sample data to obtain target insulator string image data, and obtain insulator string dataset based on the target insulator string image data; The detection model construction module is used to construct a feature pyramid network; obtain adaptive sampling points and construct a target detection network using the adaptive sampling points; and construct a preliminary directional detection model based on the feature pyramid network and the target detection network. The detection process of the preliminary directional detection model includes an initial detection stage and a refined detection stage. Model First Setting Module: Used to set the modulated deformable convolution function; Introducing the modulated deformable convolution function in the initial detection stage of the preliminary orientation detection model, and performing object localization on the adaptive acquisition points based on the modulated deformable convolution function; The second model setting module is used to design the spatial loss function of the preliminary orientation detection model. The spatial loss function includes the initial stage spatial loss function and the refinement stage spatial loss function. It also obtains the classification loss function and the localization loss function, and constructs the overall loss function of the preliminary orientation detection model based on the spatial loss function, the classification loss function, and the localization loss function. The detection model determination module is used to train the preliminary orientation detection model based on the insulator string dataset to obtain an accurate orientation detection model; and to detect the image of the insulator string to be detected according to the accurate orientation detection model to obtain the detection result corresponding to the image of the insulator string to be detected.