Insulator target detection method and system based on transfer learning

By adopting the transfer learning method in insulator target detection and using knowledge distillation and efficiency jump strategies to optimize the model, the problem of low recognition accuracy of non-lightweight models in real-time processing and complex environments is solved, and the efficient operation and adaptation of lightweight models are achieved. sex.

CN118505710BActive Publication Date: 2024-10-11NANCHANG INST OF TECH
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410978434.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-10-11
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

Existing non-lightweight models have low recognition accuracy in real-time processing and complex environments. They are especially difficult to run on devices with limited resources, and the inference speed cannot meet the demand for immediate response.

Method used

Adopting an insulator target detection method based on transfer learning, by constructing a target detection network and using knowledge distillation strategy and performance leap learning strategy, the backbone feature extraction network, classification tasks and regression tasks are optimized to generate a lightweight insulator detection model and strengthen edge information learning. and dynamically adjust learning attention and optimize hyperparameters to improve model performance.

Benefits of technology

It achieves real-time processing capabilities on devices with limited resources, improves recognition accuracy and model generalization capabilities, reduces computational complexity and inference time, and enhances model adaptability and interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118505710B_ABST
    Figure CN118505710B_ABST
Patent Text Reader

Abstract

The present invention discloses an insulator target detection method and system based on transfer learning, the method comprising: constructing a target detection network; according to the output result of a preset teacher network, adopting a preset knowledge distillation strategy to iteratively train the target detection network, and in each iterative training process, updating the learning parameters in the knowledge distillation strategy according to the performance leap learning strategy network to obtain a final insulator detection model; inputting an ultraviolet image containing insulators into the insulator detection model, the insulator detection model outputting a segmented image corresponding to the ultraviolet image, and the segmented image only contains insulators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of insulator detection, and in particular relates to an insulator target detection method and system based on transfer learning. Background Art

[0002] Within the traditional framework of image object detection, feature extraction relies heavily on meticulously hand-crafted feature extractors. This process relies heavily on deep expertise and is accompanied by tedious and complex parameter tuning, highlighting its inherent limitations. These algorithms are often tailored for specific application scenarios. While highly targeted, they sacrifice general applicability and robustness to complex visual content, particularly when it comes to extracting deep semantic information. Furthermore, some algorithms suffer from low inference efficiency, making them incapable of meeting the demands of immediate detection, limiting their application in rapidly changing environments.

[0003] Extracting edge information is crucial for improving the accuracy of object detection and localization. Given the significant contrast between the target and the background, clearly presenting edge information significantly improves detection accuracy, making the target more prominent and easier to identify. However, non-lightweight algorithms often have large model sizes and high computational complexity, making them difficult to run on resource-limited devices (such as mobile phones and embedded devices) or consuming excessive battery power during operation. Large models are expensive to deploy and maintain, and have strict hardware requirements, limiting their flexibility in practical applications. In scenarios requiring fast response, the inference speed of non-lightweight models may not meet the needs of real-time processing. Recognition accuracy is low when the background is replicated or the target is partially occluded. Summary of the Invention

[0004] The present invention provides a method and system for detecting insulator targets based on transfer learning, which is used to solve the technical problem that the inference speed of non-lightweight models may not meet the requirements of real-time processing and the recognition accuracy is low when the background is copied or the target is partially occluded.

[0005] In a first aspect, the present invention provides an insulator target detection method based on transfer learning, comprising:

[0006] Build a target detection network;

[0007] Based on the output results of the preset teacher network, the object detection network is iteratively trained using a preset knowledge distillation strategy. During each iterative training process, the learning parameters in the knowledge distillation strategy are updated according to the performance jump learning strategy network to obtain the final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy;

[0008] The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as:

[0009] ,

[0010] Where, As the loss function of the backbone feature extraction network knowledge distillation sub-strategy, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the corresponding annotation box of the feature map, is the width of the annotation box, is the height of the label box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the teacher network feature map, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the student network feature map;

[0011] ,

[0012] Where, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the vertical coordinate of the (i, j)th pixel in the feature map within the annotation box, 、 are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, 、 They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map;

[0013] An ultraviolet image containing insulators is input into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, wherein the segmented image only contains insulators.

[0014] In a second aspect, the present invention provides an insulator target detection system based on transfer learning, comprising:

[0015] A building module, configured to build a target detection network;

[0016] A training module is configured to iteratively train the object detection network using a preset knowledge distillation strategy based on the output of a preset teacher network, and to update the learning parameters of the knowledge distillation strategy according to the performance jump learning strategy network during each iterative training process to obtain a final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy;

[0017] The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as:

[0018] ,

[0019] Where, As the loss function of the backbone feature extraction network knowledge distillation sub-strategy, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the corresponding annotation box of the feature map, is the width of the annotation box, is the height of the label box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the teacher network feature map, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the student network feature map;

[0020] ,

[0021] Where, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the vertical coordinate of the (i, j)th pixel in the feature map within the annotation box, 、 are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, 、 They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map;

[0022] The output module is configured to input the ultraviolet image containing the insulator into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, and the segmented image only contains the insulator.

[0023] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the insulator target detection method based on transfer learning of any embodiment of the present invention.

[0024] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program instructions are executed by a processor, the processor executes the steps of the insulator target detection method based on transfer learning of any embodiment of the present invention.

[0025] The transfer learning-based insulator object detection method and system employed in this application differs from existing knowledge distillation methods primarily in the knowledge distillation sub-strategy within the backbone feature extraction network. This sub-strategy introduces weighted learning regions to dynamically adjust learning attention across different regions within the image. By emphasizing the enhancement of edge information within the backbone feature extraction network, the student network is able to better learn and retain detailed features within the image or data. Edge information is often crucial for distinguishing different classes. Enhancing this information helps the model achieve richer representations of low-level features, thereby improving recognition and classification accuracy. Edge information often includes object contours and structural features, which are relatively invariant and robust to environmental changes. By enhancing the learning of these features, the model can better generalize to new samples or highly variable environments, reducing the risk of overfitting. During the knowledge distillation process, by specifically processing and enhancing edge information, the student network is guided to allocate learning resources more efficiently, focusing attention on the most critical information for the task rather than uniformly learning all features. This helps improve learning efficiency and ultimately model performance. Clear edge and structural features are easier for humans to understand and interpret. Strengthening the learning of these features not only helps improve model performance, but also enhances the transparency and interpretability of the model decision-making process, which is particularly important for many application scenarios that require high credibility and interpretability.

[0026] The performance-boosting learning strategy network employed differs significantly from existing algorithms such as particle swarm optimization and genetic optimization. Optimization algorithms lack a network structure and instead use the network model's hyperparameters as variables to construct an objective function for optimization (optimization refers to finding the values ​​of the variables that minimize or maximize the objective function). The performance-boosting learning strategy network directly optimizes hyperparameters and accelerates network model training through an end-to-end network structure. The optimization algorithm optimizes only a subset of the student network model's hyperparameters (including the learning rate, number of training runs, batch size, weight decay, anchor box size and ratio, and non-maximum suppression (NMS) threshold). This is a basic and straightforward approach that iterates through pre-defined combinations of hyperparameter values ​​to find the optimal configuration. While this approach is simple and intuitive, it is computationally expensive, especially as the number of hyperparameters increases. The performance-boosting learning policy network consists of a mixture of shared parameters and student network hyperparameters. The shared parameters capture the commonalities across different network models (teacher network and student network), while the student network hyperparameters are fine-tuned specifically for the student network. This design aims to balance generalization ability and adaptability of the student network while accelerating the convergence of the network model.

[0027] The optimization algorithm used only optimizes the hyperparameters of the student network model, which is computationally expensive. However, the performance-boosting learning strategy network requires less computation and accelerates the convergence of the student network model when optimizing some hyperparameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0029] Figure 1 A flow chart of a method for detecting insulator targets based on transfer learning provided by one embodiment of the present invention;

[0030] Figure 2 A structural block diagram of an insulator target detection system based on transfer learning provided by one embodiment of the present invention;

[0031] Figure 3 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0033] See also Figure 1 , which shows a flowchart of an insulator target detection method based on transfer learning in the present application.

[0034] like Figure 1 As shown in FIG, the insulator target detection method based on transfer learning specifically includes the following steps:

[0035] Step S101: constructing a target detection network.

[0036] In this step, the target detection network includes a network backbone connection, a network branch connection, and a detection head;

[0037] The network backbone connection is: the first lightweight mixed convolution layer, the second lightweight mixed convolution layer, the third lightweight mixed convolution layer, the fourth lightweight mixed convolution layer, the fifth lightweight mixed convolution layer, the first attention pooling pyramid, the sixth lightweight mixed convolution layer, the first upsampling layer, the first channel stacking layer, the seventh lightweight mixed convolution layer, the second upsampling layer, the second channel stacking layer, the eighth lightweight mixed convolution layer, the third channel stacking layer, the ninth lightweight mixed convolution layer, the fourth channel stacking layer, and the tenth lightweight mixed convolution layer are connected in sequence;

[0038] The network branch connections are: the third lightweight mixed convolution layer, the first attention pooling pyramid, and the second channel stacking layer are connected in sequence; the fourth lightweight mixed convolution layer, the second attention pooling pyramid, and the first channel stacking layer are connected in sequence; the sixth lightweight mixed convolution layer, the second spatial channel attention mechanism, and the fourth channel stacking layer are connected in sequence; the seventh lightweight mixed convolution layer, the first spatial channel attention mechanism, and the third channel stacking layer are connected in sequence;

[0039] The detection head is: the eighth lightweight mixed convolution layer, the first convolution operation and the first output are connected in sequence; the ninth lightweight mixed convolution layer, the second convolution operation and the second output are connected in sequence; the tenth lightweight mixed convolution layer, the third convolution operation and the third output are connected in sequence.

[0040] It's important to note that the core architecture of the object detection model is based on a backbone feature extraction network, a feature pyramid network, and a detection head. The image to be detected is first input into the backbone feature extraction module for feature extraction. This backbone feature extraction network module consists of five hybrid convolutional layers (labeled 1-x, where x ranges from 1 to 5) connected in series.

[0041] For the processing of the input image, the size of the input image is first adjusted to 640×640×3.

[0042] In each lightweight hybrid convolutional layer 1-x, the input feature map undergoes a series of hybrid convolutional modules, normal convolution, and ReLU activation functions. Specifically, a lightweight hybrid convolutional layer 1-x consists of two hybrid convolutional modules, one normal convolution, and a ReLU activation function. After the input feature map passes through the two hybrid convolutional modules, its number of channels is doubled. It is then downsampled by normal convolution, halving the width and height of the output feature map. Subsequently, normal convolution is used for feature integration, and ReLU is applied for nonlinear transformation, resulting in the final output feature map.

[0043] Hybrid Convolution Module: A normal convolution layer is responsible for learning global features. The number of output channels is set appropriately, ensuring that the convolution layer is immediately followed by a Batch Normalization (BN) layer for normalization and a ReLU activation function to introduce nonlinearity. A grouped convolution layer is introduced to split the input channels into a pre-set number of groups. Similarly, the number of output channels of the grouped convolution layer should be consistent with that of the standard convolution layer to facilitate subsequent channel stacking. The grouped convolution is also followed by a BN layer and a ReLU activation function to maintain consistency and effectiveness of processing across the network layers. The outputs from the normal and grouped convolutions are directly stacked in the channel dimension to preserve the feature information extracted by each convolution layer. The stacked feature map has a higher number of channels (equal to the sum of the output channels of the two layers), which helps the model capture richer feature representations.

[0044] The backbone feature extraction module outputs three feature maps of different sizes, at lightweight mixed convolution layers 1-3, lightweight mixed convolution layers 1-4, and lightweight mixed convolution layers 1-5, with output feature map sizes of 64×64×128, 32×32x256, and 16×16×512, respectively.

[0045] After the image to be detected is processed by the backbone feature extraction module, it outputs three feature maps of different sizes. These three feature maps are then passed to the feature pyramid module for decoding. The feature pyramid module consists of an attention pooling pyramid structure, lightweight mixed convolutional layers 2-x, lightweight mixed convolutional layers 3-x, an upsampling layer, a channel stacking layer, and a spatial channel attention mechanism. First, these three feature maps are processed through the attention pooling pyramid structure for multi-scale feature extraction. Then, the encoded information is decoded using lightweight mixed convolutional layers 2-x and 3-x. The spatial channel attention mechanism module helps the model focus on important spatial and channel information.

[0046] In the attention pooling pyramid structure, the input feature map undergoes feature fusion through ordinary convolution, followed by multi-scale feature extraction through three cascaded average pooling layers, where the average pooling layer is connected to the spatial channel attention mechanism. Subsequently, the output feature maps of the three average pooling layers and the feature map before average pooling are stacked according to the number of channels and feature adjustment is performed through ordinary convolution.

[0047] The lightweight hybrid convolution layer 2-x processes the input through the hybrid convolution module, adjusts the number of channels through ordinary convolution, and performs nonlinear transformation through the activation function to obtain the output.

[0048] The lightweight hybrid convolution layer 3-x performs a hybrid convolution module on the input to obtain the output out2. At the same time, the output out is downsampled through ordinary convolution, and then the feature is adjusted through ordinary convolution to obtain the output out1.

[0049] The spatial channel attention mechanism adjusts the number of channels of the input feature map by ordinary convolution, implements the spatial attention mechanism through a one-dimensional multi-head horizontal attention mechanism and a one-dimensional multi-head vertical attention mechanism, and finally obtains the channel weight through the variance of the normalization layer, and then multiplies it with the feature map to implement the channel attention mechanism.

[0050] The detection module uses ordinary convolution to adjust the number of channels and outputs the prediction results of the network model. The prediction results are converted and mapped to the image to be detected through the script to obtain the final output.

[0051] Step S102, based on the output results of the preset teacher network, the target detection network is iteratively trained using the preset knowledge distillation strategy, and during each iterative training process, the learning parameters in the knowledge distillation strategy are updated according to the performance leap learning strategy network to obtain the final insulator detection model.

[0052] In this step, during model knowledge distillation training, we focus on optimizing the backbone feature extraction module to ensure that the feature maps generated by the teacher network and the student network (object detection network) are dimensionally consistent. This is achieved by applying standard convolutional layers to the corresponding layers of the two networks, adjusting the number of channels to ensure feature map compatibility. The design of the loss function is crucial to this process, driving the student network's ability to learn from the teacher network.

[0053] For classification tasks, a weighted cross-entropy loss function is used. This is an effective metric that measures the gap between the predicted probability distribution and the actual class labels. Here, the soft labels (i.e., probability distribution) provided by the teacher network are used together with the actual hard labels (the true class) as optimization criteria. This strategy helps the student network learn a more refined decision boundary.

[0054] When dealing with regression tasks, a boundary regression loss is adopted, where the prediction results of the teacher network serve as the upper limit or reference standard for the student network to learn, thereby promoting the student network to approach the performance of the teacher network on the regression task.

[0055] The entire training process is carefully planned into two closely connected stages, aiming to gradually improve the performance of the model and achieve efficient knowledge transfer.

[0056] Phase 1: Establishment of basic weights

[0057] Training begins with 20 initial iterations. The core goal of this phase is to establish a solid starting point for the student network, specifically to determine a set of basic model weights. This not only gives the model basic recognition and prediction capabilities but also lays a solid foundation for subsequent fine-tuning, ensuring a better starting point and direction for subsequent training.

[0058] Phase 2: High-Efficiency Knowledge Distillation

[0059] Following the above phase, a 30-iteration rapid learning phase begins, during which an efficient knowledge distillation strategy is introduced. This efficiency-boosting learning mechanism helps the student network learn how to extract efficiency knowledge from previous tasks—in other words, learn a learning strategy. Using this mechanism requires that the teacher and student networks share the same structure (at least one layer) in the first few layers. This efficiency knowledge can be general rules for effectively adjusting network weights, optimizing paths, or feature representations. This allows the student network to quickly adapt itself to new tasks or changing environments, achieving rapid and effective learning. The efficiency-boosting learning mechanism guides the student network in dynamically adjusting hyperparameters such as its learning rate and the weight distribution of the loss function. This means that at different stages of knowledge distillation, the network can automatically select the most appropriate optimization strategy based on its current learning state and task requirements, accelerating convergence and improving generalization. Through this efficiency-boosting learning mechanism, the student network better understands how to extract key information from a small number of examples. This is particularly useful during the distillation phase, as it allows the network to effectively learn based on its self-generated "soft labels" even without a large amount of additional labeled data, simulating the human ability to quickly generalize from a small number of examples. The performance-boosting learning mechanism supports the student network in identifying which features are common and important for solving a class of problems (a family of tasks) and which features require customized learning for specific tasks. During distillation, the network can selectively retain, strengthen, or innovate feature representations, allowing the model to more quickly reuse and adapt existing knowledge when faced with new, related tasks, rather than learning from scratch each time. Combined with the performance-boosting learning mechanism, the student network can not only self-optimize through its internal knowledge, but also learn how to generate training tasks or samples that are suitable for it. This capability improves the initiative and specificity of learning, enabling the model to automatically generate the most beneficial training examples based on the shortcomings of its current learning state, thereby accelerating the learning process.

[0060] Specifically, the performance leap learning mechanism:

[0061] The teacher model and the student model share the initial convolutional layer to extract the basic features of the image. This means that for each image in the dataset, the same convolutional layer of the teacher model and the student model obtains feature maps and , i is the i-th image in the dataset. The features are aggregated and the feature maps of a single image are aggregated into a compact vector representing the entire task or support set, so that the performance jump learning strategy can learn the common features of the task. ) The average value of the mapping is used to obtain a global feature representation , for all image features of the student network (all feature maps ) The average value of the mapping is used to obtain a global feature representation .

[0062] Combining the converged features from different models to form a high-level "task descriptor" that can capture the key information of the task and guide the decision-making of the performance leap learning strategy. and Channel-wise stacking is performed to form a comprehensive feature map. This comprehensive feature map is input into a fully connected layer to obtain the output task descriptor d, which is a vector that can be directly used by the performance jump learning policy network to generate optimization instructions or policy parameters.

[0063] The performance jump learning strategy network includes a fully connected layer and a ReLU activation function, and the input of the performance jump learning strategy network is the task descriptor d, and the output is , Adjust the learning rate value for the student network model, Optimize the direction vector for the student model;

[0064] The weight parameter update expression of the performance jump learning strategy network is:

[0065] ,

[0066] Where, The updated weight parameters of the learning strategy network for performance improvement, The weight parameters of the learning strategy network for performance improvement, The learning rate of the learning strategy network for performance improvement, for The gradient, The updated weight parameters of the target detection network are Knowledge distillation loss when

[0067] ,

[0068] Where, is the weight parameter of the target detection network, Indicates the normalization of the optimization direction. for The gradient, The weight parameters of the target detection network are The knowledge distillation loss is

[0069] Furthermore, the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy;

[0070] The loss function of the knowledge distillation sub-strategy of the backbone feature extraction network is expressed as:

[0071] ,

[0072] Where, As the loss function of the backbone feature extraction network knowledge distillation sub-strategy, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the corresponding annotation box of the feature map, is the width of the annotation box, is the height of the label box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the teacher network feature map, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the student network feature map;

[0073] ,

[0074] Where, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the vertical coordinate of the (i, j)th pixel in the feature map within the annotation box, 、 are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, 、 They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map;

[0075] The loss function of the knowledge distillation sub-strategy for the classification task is expressed as:

[0076] ,

[0077] ,

[0078] Where, is the loss function of the knowledge distillation sub-strategy for the classification task, is the cross entropy loss function, is the classification score of the j-th pixel in the classification output of the student network model, For real classification, is the classification score of the i-th pixel in the classification output of the student network model, is the classification score of the j-th pixel in the classification output of the teacher network model, is the weight of the knowledge distillation sub-strategy for the classification task, The total number of pixels where the teacher network detects the target, is the total number of pixels in the feature map, is the total number of identifiable object categories, Whether there is a target detected in the pixel detection box (target detected =1, no target detected =0), is the true value of the category to which the detection box belongs (if it belongs to the i-th category, its size is equal to 1, otherwise it is 0).

[0079] The loss function of the knowledge distillation sub-strategy for the regression task is expressed as:

[0080] ,

[0081] Where, is the loss function of the knowledge distillation sub-strategy for the regression task, The number of categories detected for the teacher network, is the j-th pixel regression score in the student network model regression output, Detect the correct regression box for the teacher, is the true frame of the j-th pixel, is the student regression task loss function, is the migration regression loss function, is the migration regression weight, is the total number of pixels in the feature map, is the regression score of the i-th pixel in the regression output of the student network model, is the ground truth box of the i-th pixel.

[0082] Step S103: inputting the ultraviolet image containing the insulator into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, wherein the segmented image only contains the insulator.

[0083] In summary, the method of this application reconstructs the network structure using hybrid convolution, reducing the number of network model parameters and computational complexity, effectively reducing dependence on computer resources, and using a novel attention mechanism to improve the detection performance of the network model. Knowledge distillation is used to fine-tune the object detection network, achieving knowledge transfer, allowing the lightweight object detection network to approach the detection performance of a large teacher network. Model compression and accelerated inference: Knowledge distillation can transfer the rich knowledge contained in large, complex models into a small, simplified model, thereby achieving model compression and reducing inference time. This is very useful in resource-constrained environments such as mobile devices and embedded devices. Improved model generalization: Through knowledge distillation, the student model can learn more generalizable features and knowledge from the teacher model, thereby improving the model's performance on unseen data. Improved learning: In some cases, knowledge distillation can help the student model converge faster and better avoid overfitting, because the knowledge contained in the teacher model can guide the student model to learn more accurately. Transfer learning and cross-domain adaptation: Knowledge distillation can help transfer the knowledge of a well-trained model in one domain or task to another related domain or task, thereby accelerating the learning process of the new task. Explaining model decisions: By transferring knowledge from the teacher model to the student model, it becomes easier to explain the model’s decision-making process, as the student model is often simpler and easier to understand while still maintaining good performance.

[0084] See also Figure 2 , which shows a structural block diagram of an insulator target detection system based on transfer learning in this application.

[0085] like Figure 2 As shown, the insulator target detection system 200 includes a construction module 210 , a training module 220 and an output module 230 .

[0086] Wherein, the construction module 210 is configured to construct a target detection network;

[0087] The training module 220 is configured to iteratively train the object detection network using a preset knowledge distillation strategy based on the output of the preset teacher network, and update the learning parameters of the knowledge distillation strategy according to the performance jump learning strategy network during each iterative training process to obtain a final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy;

[0088] The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as:

[0089] ,

[0090] Where, As the loss function of the backbone feature extraction network knowledge distillation sub-strategy, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the corresponding annotation box of the feature map, is the width of the annotation box, is the height of the label box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the teacher network feature map, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the student network feature map;

[0091] ,

[0092] Where, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the vertical coordinate of the (i, j)th pixel in the feature map within the annotation box, 、 are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, 、 They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map;

[0093] The output module 230 is configured to input the ultraviolet image containing the insulator into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, where the segmented image only contains the insulator.

[0094] It should be understood that Figure 2 Modules and references documented in Figure 1 Therefore, the operations and features described above for the method and the corresponding technical effects also apply to Figure 2 The modules in it will not be described in detail here.

[0095] In other embodiments, embodiments of the present invention further provide a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor is caused to execute the insulator target detection method based on transfer learning in any of the above method embodiments;

[0096] As an embodiment, the computer-readable storage medium of the present invention stores computer-executable instructions, and the computer-executable instructions are configured as follows:

[0097] Build a target detection network;

[0098] Based on the output results of the preset teacher network, the object detection network is iteratively trained using a preset knowledge distillation strategy. During each iterative training process, the learning parameters in the knowledge distillation strategy are updated according to the performance jump learning strategy network to obtain the final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy;

[0099] The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as:

[0100] ,

[0101] Where, As the loss function of the backbone feature extraction network knowledge distillation sub-strategy, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the corresponding annotation box of the feature map, is the width of the annotation box, is the height of the label box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the teacher network feature map, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the student network feature map;

[0102] ,

[0103] Where, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the vertical coordinate of the (i, j)th pixel in the feature map within the annotation box, 、 are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, 、 They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map;

[0104] An ultraviolet image containing insulators is input into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, wherein the segmented image only contains insulators.

[0105] The computer-readable storage medium may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the transfer learning-based insulator target detection system. Furthermore, the computer-readable storage medium may include high-speed random access memory and may also include memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the computer-readable storage medium may optionally include memory remotely located relative to the processor, and such remote memory may be connected to the transfer learning-based insulator target detection system via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0106] Figure 3 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 3 As shown, the device includes: a processor 310 and a memory 320. The electronic device may also include: an input device 330 and an output device 340. The processor 310, the memory 320, the input device 330 and the output device 340 may be connected via a bus or other means. Figure 3 The example of a bus connection is shown. Memory 320 is the aforementioned computer-readable storage medium. Processor 310 executes the various server functional applications and data processing by running the non-volatile software programs, instructions, and modules stored in memory 320, thereby implementing the transfer learning-based insulator target detection method described in the aforementioned method embodiment. Input device 330 can receive input digital or character information and generate key signal input related to user settings and function control of the transfer learning-based insulator target detection system. Output device 340 can include a display device such as a screen.

[0107] The electronic device can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided by the embodiment of the present invention.

[0108] As an embodiment, the electronic device is applied to an insulator target detection system based on transfer learning and is used for a client, and includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0109] Build a target detection network;

[0110] Based on the output results of the preset teacher network, the object detection network is iteratively trained using a preset knowledge distillation strategy. During each iterative training process, the learning parameters in the knowledge distillation strategy are updated according to the performance jump learning strategy network to obtain the final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy;

[0111] The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as:

[0112] ,

[0113] Where, As the loss function of the backbone feature extraction network knowledge distillation sub-strategy, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the corresponding annotation box of the feature map, is the width of the annotation box, is the height of the label box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the teacher network feature map, is the value of the pixel point (i, j) in the annotation box of the c-th channel coordinate in the student network feature map;

[0114] ,

[0115] Where, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the vertical coordinate of the (i, j)th pixel in the feature map within the annotation box, 、 are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, 、 They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map;

[0116] An ultraviolet image containing insulators is input into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, wherein the segmented image only contains insulators.

[0117] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods of each embodiment or certain portions of the embodiments.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for insulator target detection based on transfer learning, It is characterized in that include: Constructing a target detection network, wherein the target detection network includes a network trunk connection, a network branch connection, and a detection head; The network backbone connection is: the first lightweight mixed convolution layer, the second lightweight mixed convolution layer, the third lightweight mixed convolution layer, the fourth lightweight mixed convolution layer, the fifth lightweight mixed convolution layer, the first attention pooling pyramid, the sixth lightweight mixed convolution layer, the first upsampling layer, the first channel stacking layer, the seventh lightweight mixed convolution layer, the second upsampling layer, the second channel stacking layer, the eighth lightweight mixed convolution layer, the third channel stacking layer, the ninth lightweight mixed convolution layer, the fourth channel stacking layer, and the tenth lightweight mixed convolution layer are connected in sequence; The network branch connection is as follows: the third lightweight mixed convolution layer, the first attention pooling pyramid and the second channel stacking layer are connected in sequence; the fourth lightweight mixed convolution layer, the second attention pooling pyramid and the first channel stacking layer are connected in sequence; the sixth lightweight mixed convolution layer, the second spatial channel attention mechanism and the fourth channel stacking layer are connected in sequence; the seventh lightweight mixed convolution layer, the first spatial channel attention mechanism and the third channel stacking layer are connected in sequence; The detection head comprises: an eighth light mixed convolution layer, a first convolution operation and a first output connected in sequence; a ninth light mixed convolution layer, a second convolution operation and a second output connected in sequence; and a tenth light mixed convolution layer, a third convolution operation and a third output connected in sequence; According to the output result of the preset teacher network, the target detection network is iteratively trained using a preset knowledge distillation strategy, and in each iterative training process, the learning parameters in the knowledge distillation strategy are updated according to the performance jump learning strategy network to obtain a final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy; The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as: , In the formula, is the loss function of the knowledge distillation sub-strategy of the backbone feature extraction network, is the total number of pixels in the feature map, is the sum of the total number of pixels in the annotation box corresponding to the feature map, is the width of the annotation box, is the height of the annotation box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point with the coordinate of the cth channel in the teacher network feature map within the annotation box (i, j), is the value of the pixel point with the coordinate of the cth channel in the marked box (i, j) in the student network feature map; , In the formula, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the ordinate of the (i, j)th pixel in the feature map within the annotation box, , are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, respectively. , They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map; An ultraviolet image containing insulators is input into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, wherein the segmented image only contains insulators.

2. According to the insulator target detection method based on transfer learning according to claim 1, It is characterized in that The loss function of the classification task knowledge distillation sub-strategy is expressed as: In the formula, is the loss function of the knowledge distillation sub-strategy for the classification task, is the cross entropy loss function, is the classification score of the jth pixel in the classification output of the student network model, For real classification, is the classification score of the i-th pixel in the classification output of the student network model, is the classification score of the i-th pixel in the classification output of the teacher network model, is the weight of the knowledge distillation sub-strategy for the classification task, is the total number of pixels where the teacher network detects the target. is the total number of pixels in the feature map.

3. According to the insulator target detection method based on transfer learning in claim 1, It is characterized in that The loss function of the regression task knowledge distillation sub-strategy is expressed as: , In the formula, is the loss function of the knowledge distillation sub-strategy for the regression task, is the total number of pixels where the teacher network detects the target. is the j-th pixel regression score in the student network model regression output, Detect the correct regression box for the teacher, is the real box of the j-th pixel, is the student regression task loss function, is the transfer regression loss function, is the migration regression weight, is the total number of pixels in the feature map, is the regression score of the i-th pixel in the regression output of the student network model, is the true box of the i-th pixel.

4. According to the insulator target detection method based on transfer learning in claim 1, It is characterized in that The performance jump learning strategy network includes a fully connected layer and a ReLU activation function, and the input of the performance jump learning strategy network is the task descriptor d, and the output is , Adjust the learning rate value for the student network model, Optimize the direction vector for the student model; The weight parameter update expression of the performance jump learning strategy network is: , In the formula, The updated weight parameters of the learning strategy network for performance improvement, The weight parameters of the learning strategy network for performance improvement, The learning rate of the learning strategy network for performance jump, for The gradient of The updated weight parameters for the target detection network are The knowledge distillation loss when , In the formula, is the weight parameter of the target detection network, Indicates the normalization of the optimization direction. for The gradient of The weight parameter of the target detection network is The knowledge distillation loss is 5. An insulator target detection system based on transfer learning, It is characterized in that include: A construction module configured to construct a target detection network, wherein the target detection network includes a network trunk connection, a network branch connection, and a detection head; The network backbone connection is: the first lightweight mixed convolution layer, the second lightweight mixed convolution layer, the third lightweight mixed convolution layer, the fourth lightweight mixed convolution layer, the fifth lightweight mixed convolution layer, the first attention pooling pyramid, the sixth lightweight mixed convolution layer, the first upsampling layer, the first channel stacking layer, the seventh lightweight mixed convolution layer, the second upsampling layer, the second channel stacking layer, the eighth lightweight mixed convolution layer, the third channel stacking layer, the ninth lightweight mixed convolution layer, the fourth channel stacking layer, and the tenth lightweight mixed convolution layer are connected in sequence; The network branch connection is as follows: the third lightweight mixed convolution layer, the first attention pooling pyramid and the second channel stacking layer are connected in sequence; the fourth lightweight mixed convolution layer, the second attention pooling pyramid and the first channel stacking layer are connected in sequence; the sixth lightweight mixed convolution layer, the second spatial channel attention mechanism and the fourth channel stacking layer are connected in sequence; the seventh lightweight mixed convolution layer, the first spatial channel attention mechanism and the third channel stacking layer are connected in sequence; The detection head comprises: an eighth light mixed convolution layer, a first convolution operation and a first output connected in sequence; a ninth light mixed convolution layer, a second convolution operation and a second output connected in sequence; and a tenth light mixed convolution layer, a third convolution operation and a third output connected in sequence; A training module is configured to iteratively train the target detection network using a preset knowledge distillation strategy according to an output result of a preset teacher network, and in each iterative training process, update the learning parameters in the knowledge distillation strategy according to the performance jump learning strategy network to obtain a final insulator detection model, wherein the knowledge distillation strategy includes a backbone feature extraction network knowledge distillation sub-strategy, a classification task knowledge distillation sub-strategy, and a regression task knowledge distillation sub-strategy; The loss function of the backbone feature extraction network knowledge distillation sub-strategy is expressed as: , In the formula, is the loss function of the knowledge distillation sub-strategy of the backbone feature extraction network, is the sum of all pixels in the feature map, is the sum of the total number of pixels in the annotation box corresponding to the feature map, is the width of the annotation box, is the height of the annotation box, is the total number of channels of the feature map, is the weighted value of the weighted learning area, is the value of the pixel point with the coordinate of the cth channel in the teacher network feature map within the annotation box (i, j), is the value of the pixel point with the coordinate of the cth channel in the marked box (i, j) in the student network feature map; , In the formula, is the horizontal coordinate of the (i, j)th pixel in the feature map within the annotation box, is the ordinate of the (i, j)th pixel in the feature map within the annotation box, , are the horizontal and vertical coordinates of the center pixel of the annotation box in the feature map, respectively. , They are the attenuation factors in the horizontal and vertical directions, respectively. Min means taking the minimum value in the brackets, and max means taking the maximum value in the brackets. For all pixels in the feature map; The output module is configured to input the ultraviolet image containing the insulator into the insulator detection model, and the insulator detection model outputs a segmented image corresponding to the ultraviolet image, and the segmented image only contains the insulator.

6. An electronic device, It is characterized in that include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Deep learning-based insulator sheet falloff fault quick detection method for aerial image

    CN108596886A

  • SAR ship target detection method based on network pruning and knowledge distillation

    CN112308019A

  • Surface defect detection method based on multi-scale attention guidance and knowledge distillation

    CN113947590A

  • Method for compressing YOLOX target detection model based on positioning distillation

    CN115035386A

  • Underwater target detection method and system based on multi-knowledge distillation

    CN116612379A