A method and system for identifying defects in power distribution network equipment

CN122989732APending Publication Date: 2026-10-27STATE GRID ZHEJIANG HANGZHOU LINPING DISTRICT POWER SUPPLY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611468305.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]本发明提供了一种配电网设备的缺陷识别方法和系统,能够解决现有边缘终端执行配电网设备缺陷识别时的计算资源消耗较高的技术问题

Benefits of technology

[0007]采用本发明技术方案,由于拉格朗日松弛目标函数以基准深度网络模型的权重参数和结构参数为优化变量,并将基准深度网络模型的样本识别结果与样本标注信息之间的偏差作为检测损失分量,因此,在对拉格朗日松弛目标函数进行交替求解时,能够在约束模型识别偏差的基础上,对基准深度网络模型的权重参数进行更新,并对模型结构进行压缩调整,使每轮迭代或每组压缩约束条件下形成对应压缩等级的轻量型缺陷识别模型,进而得到多个具有不同模型参数量的轻量型缺陷识别模型。进一步地,在接收到边缘终端的识别请求后,基于识别任务数据从多个轻量型缺陷识别模型中查找并下发目标缺陷识别模型,以使得边缘终端通过目标缺陷识别模型对待识别的配电网设备图像进行缺陷识别,而无需在边缘终端运行参数规模和计算量较高的基准深度网络模型。由此,边缘终端在缺陷识别过程中所需加载的模型参数量和执行的推理计算量减少,从而可以降低边缘终端执行配电网设备缺陷识别时的计算资源消耗。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989732A_ABST
    Figure CN122989732A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of power equipment defect detection, and provides a power distribution network equipment defect identification method and system. The implementation scheme is as follows: taking the deviation between the sample identification result and the sample annotation information of a preset reference depth network model as a detection loss component, taking the weight parameter and the structure parameter of the reference depth network model as optimization variables, and constructing a Lagrange relaxation objective function; alternately solving the Lagrange relaxation objective function to alternately perform weight updating and structure compression on the reference depth network model, and generating multiple lightweight defect identification models; based on identification task data, searching for a target defect identification model from the multiple lightweight defect identification models, and issuing the target defect identification model to an edge terminal, so that the edge terminal performs defect identification on a power distribution network equipment image to be identified through the target defect identification model. The present application can reduce the calculation resource consumption of the edge terminal when performing power distribution network equipment defect identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power equipment defect detection technology, and in particular to a method and system for defect identification of power distribution network equipment. Background Technology

[0002] With the digitalization and intelligentization of power distribution network inspection, automated inspection based on visual perception has become an important technical means for detecting defects in power distribution network equipment. Existing technologies typically utilize edge terminals such as inspection drones and inspection robots to collect images of power distribution network equipment such as insulators, conductors, and fittings. The collected images are then analyzed by defect recognition models deployed on the edge terminals to achieve automatic identification of defects in power distribution network equipment.

[0003] However, to improve the accuracy of identifying complex defects such as cracks, broken strands, and fractures, existing defect identification models typically employ deep network structures with large parameter scales and numerous network layers, resulting in a high number of model parameters and computational load. When such models are deployed on edge terminals such as inspection drones and inspection robots, the computational resources of these edge terminals, including processor computing power, storage capacity, and power supply conditions, require significant amounts of processor and storage resources to run the defect identification model. This leads to high computational resource consumption when edge terminals perform defect identification of power distribution network equipment, making it difficult to meet the needs of edge-side deployments with limited computational resources. Summary of the Invention

[0004] This invention provides a method and system for identifying defects in power distribution network equipment, which can solve the technical problem of high computational resource consumption when existing edge terminals perform defect identification of power distribution network equipment.

[0005] In a first aspect, embodiments of the present invention provide a method for defect identification of power distribution network equipment, comprising: The deviation between the sample recognition results and sample annotation information of the preset benchmark deep network model is used as the detection loss component, and the weight parameters and structural parameters of the benchmark deep network model are used as optimization variables to construct a Lagrange relaxation objective function. The Lagrange relaxation objective function is solved alternately to alternately perform weight updates and structural compression on the baseline deep network model, generating multiple lightweight defect identification models; In response to an identification request from an edge terminal, the identification request carries identification task data; Based on the identification task data, a target defect identification model is searched from multiple lightweight defect identification models, and the target defect identification model is sent to the edge terminal so that the edge terminal can perform defect identification on the image of the power distribution equipment to be identified through the target defect identification model and obtain the defect identification result.

[0006] Secondly, embodiments of the present invention provide a defect identification system for power distribution network equipment, comprising: The construction module is used to construct a Lagrange relaxation objective function with the deviation between the sample recognition results and sample annotation information of the preset benchmark deep network model as the detection loss component and the weight parameters and structural parameters of the benchmark deep network model as optimization variables. The generation module is used to alternately solve the Lagrange relaxation objective function to alternately perform weight updates and structural compression on the baseline deep network model, thereby generating multiple lightweight defect recognition models. The request-response module is used to respond to the identification request from the edge terminal, wherein the identification request carries identification task data; The defect identification module is used to search for a target defect identification model from multiple lightweight defect identification models based on the identification task data, and send the target defect identification model to the edge terminal so that the edge terminal can perform defect identification on the image of the power distribution equipment to be identified through the target defect identification model and obtain the defect identification result.

[0007] By employing the technical solution of this invention, since the Lagrange relaxation objective function uses the weight parameters and structural parameters of the benchmark deep network model as optimization variables, and uses the deviation between the sample recognition results and sample annotation information of the benchmark deep network model as the detection loss component, when alternately solving the Lagrange relaxation objective function, the weight parameters of the benchmark deep network model can be updated and the model structure compressed and adjusted based on the constraint model recognition deviation. This results in a lightweight defect recognition model with a corresponding compression level being formed under each iteration or each set of compression constraints, thereby obtaining multiple lightweight defect recognition models with different model parameter counts. Furthermore, upon receiving the recognition request from the edge terminal, the target defect recognition model is searched and distributed from multiple lightweight defect recognition models based on the recognition task data. This allows the edge terminal to perform defect recognition on the distribution network equipment image to be identified using the target defect recognition model, without having to run the benchmark deep network model with high parameter scale and computational load on the edge terminal. As a result, the number of model parameters loaded and the amount of inference computation performed by the edge terminal during the defect recognition process are reduced, thereby reducing the computational resource consumption of the edge terminal when performing distribution network equipment defect recognition.

[0008] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0009] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of the invention. Wherein: Figure 1 This is a flowchart of a defect identification method for power distribution network equipment according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a defect identification system for power distribution network equipment according to an embodiment of the present invention; Figure 3 This is a schematic block diagram of a computer device used to implement the methods of the embodiments of the present invention. Detailed Implementation

[0010] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0011] This invention provides a method and system for identifying defects in power distribution network equipment. The entity executing this method can be the defect identification system provided in this invention, or a computer device integrating the defect identification system. The defect identification system can be implemented in hardware or software, and the computer device can be a terminal or a server.

[0012] In a specific application scenario, an inspection drone acts as an edge terminal to inspect power distribution network lines and collect images of insulators, conductors, and fittings. The drone establishes a communication connection with a server via a wireless communication link, which can be at least one of a cellular mobile communication link, a dedicated wireless communication link, a wireless local area network link, or a satellite communication link. The drone transmits the collected images of the power distribution network equipment to the server via the wireless communication link. The server receives these images and uses them as input to a baseline deep network model, obtaining the sample recognition results output by the model. The server pre-constructs a Lagrange relaxation objective function using the deviation between the sample recognition results and the sample annotation information of the baseline deep network model as the loss component, and uses the weight parameters and structural parameters of the baseline deep network model as optimization variables. Subsequently, the Lagrange relaxation objective function is solved alternately to alternately perform weight updates and structural compression on the baseline deep network model, generating multiple lightweight defect recognition models and storing them in a model library. When performing inspection tasks, the inspection drone sends an identification request to the server via a wireless communication link. This request includes identification task data such as the drone's available computing resources, the complexity of the current inspection scenario, and the required accuracy of the task. Based on this data, the server searches for the target defect identification model from multiple lightweight defect identification models in its model library and then sends this model to the drone via the wireless communication link. This allows the drone to use the target defect identification model to identify defects in the collected images of the power distribution network equipment and obtain the defect identification results.

[0013] Figure 1 This is a flowchart of a defect identification method for power distribution network equipment according to an embodiment of the present invention.

[0014] like Figure 1 As shown, the defect identification method for the power distribution network equipment may include: S110 uses the deviation between the sample recognition results and sample annotation information of the preset benchmark deep network model as the detection loss component, and uses the weight parameters and structural parameters of the benchmark deep network model as optimization variables to construct a Lagrange relaxation objective function.

[0015] For example, the benchmark deep network model is a deep neural network model used to classify and locate defects in images of power distribution network equipment. The benchmark deep network model includes a feature extraction network, a cross-scale feature integration network, and a detection output network; wherein, the feature extraction network is used to extract edge features, texture features, and semantic features from the images of power distribution network equipment, the cross-scale feature integration network is used to fuse image features at different scales, and the detection output network is used to output defect category, defect location, and confidence information.

[0016] In this example, the baseline deep network model employs an object detection network architecture without pre-defined candidate boxes. Specifically, the feature extraction network includes multi-level convolutional feature extraction layers and contour enhancement attention units, which encode features along the horizontal and vertical directions respectively. The cross-scale feature integration network includes a bidirectional feature fusion layer, used to fuse shallow localization features and deep semantic features. The detection output network includes a classification branch and a localization branch. The classification branch outputs the defect category of the power distribution network equipment, and the localization branch outputs the location of the defect in the image. The baseline deep network model can be trained using sample images of power distribution network equipment containing defect types such as insulator cracks, broken conductor strands, and damaged fittings. During training, a detection loss, including category loss and location regression loss, is used to update the model parameters.

[0017] For example, the sample recognition result is the output of the baseline deep network model after performing defect recognition on the inspection sample image. The sample recognition result includes the predicted defect category, the predicted defect location, and the prediction confidence. The sample annotation information is the manual annotation or review annotation information corresponding to the inspection sample image. The sample annotation information includes the true defect category and the true defect location.

[0018] In this example, images of power distribution equipment collected by inspection drones or robots are first acquired, and defective areas in the images are marked to obtain sample annotation information. Then, the images of power distribution equipment with sample annotation information are used as inspection sample images and input into the baseline deep network model. The feature extraction network extracts the features of the sample images, the cross-scale feature integration network fuses the features of the sample images, and the detection output network outputs the sample recognition results.

[0019] In one implementation, step S110 includes the following steps: By using the feature extraction network of the baseline deep network model, edge feature extraction and texture feature extraction are performed on the inspection sample images of power distribution network equipment to obtain the sample image features.

[0020] For example, the inspection sample image is an image of power distribution network equipment collected by an inspection drone, inspection robot, or fixed camera terminal. The image includes equipment areas such as insulators, conductors, hardware, and tower connections. Before being input into the reference depth network model, the inspection sample image can undergo size normalization, pixel normalization, and image enhancement processing. The input size after size normalization can be set to a preset input size (e.g., width of 640 to 1280 pixels, height of 640 to 1280 pixels, specifically 640×640 pixels in this embodiment). Pixel normalization can map pixel values ​​to a preset numerical range (e.g., 0 to 1).

[0021] The feature extraction network of the benchmark deep network model can adopt a multi-level convolutional feature extraction structure, including a shallow edge extraction layer, a mid-level texture extraction layer, and a deep semantic extraction layer. The shallow edge extraction layer performs convolution processing on the wire edges, crack boundaries, and hardware contours in the inspection sample image using convolution kernels to obtain edge response features. The mid-level texture extraction layer performs convolution, normalization, and activation processing on the edge response features to obtain texture response features representing crack textures, broken strand textures, and damaged textures. The deep semantic extraction layer downsamples and performs channel transformation processing on the texture response features to obtain deep features containing equipment category semantics and defect morphology semantics. The sample image features are composed of shallow edge response features, mid-level texture response features, and deep semantic features.

[0022] For example, for an inspection sample image containing an insulator crack, the feature extraction network first extracts the insulator skirt outline and crack edge in shallow convolutions, then extracts the crack extension direction and local texture changes in mid-level convolutions, and finally extracts the semantic differences between the insulator equipment area and the background area in deep convolutions. The resulting sample image features contain both defect edge information and equipment area semantic information, facilitating subsequent multi-scale fusion and defect detection.

[0023] By using a cross-scale feature integration network based on a benchmark deep network model, multi-scale fusion processing is performed on the features of the sample images to obtain fused image features.

[0024] For example, the cross-scale feature fusion network receives multiple scale feature maps output by the feature extraction network and performs bidirectional fusion processing according to the feature map resolution from small to large and from large to small. For deep feature maps, upsampling is first performed to make their spatial resolution comparable to that of adjacent shallow feature maps. Figure 1 For shallow feature maps, channel alignment is performed to match the number of channels in the deep feature maps to be fused. Figure 1 The shallow feature maps, aligned to the channel alignment, are then concatenated or weighted together with the upsampled deep feature maps, and integrated through convolutional layers to obtain intermediate fused features. For intermediate fused features at multiple scales, downsampling and fusion are then performed in the opposite direction, enabling the interaction of localization and semantic information across different scales.

[0025] The preset number of fusion layers can be multiple scale layers (e.g., 3 to 5 scale layers, with 3 scale layers used in the specific embodiment). Each scale layer can correspond to a defect region of different sizes in the inspection sample image. For narrow defects such as cracks and broken strands, shallow scale features provide edge location and detailed texture, while deep scale features provide semantic information about the equipment category and defect type. The cross-scale feature integration network obtains fused image features through bidirectional fusion, enabling the detection output network to utilize both detailed localization information and category semantic information simultaneously.

[0026] The detection output network of the baseline deep network model is used to classify and locate the features of the fused image to obtain the sample recognition results.

[0027] For example, the detection output network includes a classification branch and a localization branch. The classification branch performs convolutional mapping and probability output processing on the fused image features to obtain the defect category prediction result corresponding to each candidate defect region. The defect category may include insulator cracks, conductor strand breaks, hardware cracks, equipment damage, and defect-free backgrounds. The localization branch performs bounding box regression processing on the fused image features to obtain the location prediction result of each candidate defect region in the inspection sample image. The location prediction result may include the bounding box center coordinates, width, height, or bounding box corner coordinates. The detection output network can also output a confidence score to represent the degree of confidence of the corresponding defect category and defect location.

[0028] For example, for an inspection sample image labeled with a broken wire strand, the sample recognition results output by the detection output network may include: a predicted defect category of broken wire strand, a predicted defect location as the bounding box of the wire defect area in the image, and a predicted confidence level as the probability of the corresponding category. These sample recognition results are then compared with the sample annotation information to construct the detection loss components.

[0029] Based on the sample recognition results and the sample annotation information corresponding to the inspection sample images, a detection loss component is constructed.

[0030] For example, the sample annotation information can be obtained by manual annotation or manual verification of annotation, including the true defect category and the true defect location. The true defect category is used to indicate the category to which the defect belongs in the inspection sample image, and the true defect location is used to indicate the true bounding box or contour region of the defect in the image.

[0031] When constructing the detection loss component, the predicted defect category in the sample identification result is compared with the true defect category in the sample annotation information to obtain the classification loss; the predicted defect location in the sample identification result is compared with the true defect location in the sample annotation information to obtain the localization loss; then, the classification loss and localization loss are combined according to the preset detection loss weight to obtain the detection loss component. The preset detection loss weight can be set according to the number of defect categories and the sensitivity of localization error (for example, the classification loss weight is 0.5 to 2, the localization loss weight is 0.5 to 2, and in the specific embodiment, both are set to 1).

[0032] Understandably, when the true defect category of the inspection sample image is an insulator crack, and the highest probability category output by the classification branch is also an insulator crack, the classification loss is relatively small; when the overlap between the predicted bounding box output by the localization branch and the true bounding box is insufficient, the localization loss increases. By using the classification loss and localization loss together to form the detection loss component, the model's expressive power related to the classification and localization of defects in distribution network equipment can be preserved during subsequent compression.

[0033] The compression loss term is obtained by weighting and summing the low-rank representation constraints of the weight parameters, the channel sparsity constraints of the structural parameters, and the detection loss components.

[0034] For example, the weight parameters include convolutional layer weights, detection output network weights, and fully connected layer weights; the structural parameters include network layer connectivity, the number of convolutional channels, feature map channel allocation, and detection output branch structure. Low-rank representation constraints are used to ensure that the weight matrix or weight tensor can be represented by low-dimensional factors, and channel sparsity constraints are used to ensure that some convolutional channels form pruningable structural units during compression.

[0035] The compression loss term can be expressed by the following formula: ; in, Represents the compression loss term; This represents the set of weight parameters for the baseline deep network model. This represents the set of structural parameters for a baseline deep network model; Indicates the detected loss component; This represents the low-rank regularization coefficient, and its value can be set to a preset range of low-rank regularization coefficients (e.g., ...). to In a specific embodiment, it is ); This indicates the number of weight matrices involved in the low-rank representation constraints; Let represent the weight matrix of the i-th component participating in the low-rank constraint; The nuclear norm is the sum of the singular values ​​of the weight matrix. This represents the structured sparse regularization coefficient, and its value can be set to a preset range of sparse regularization coefficients (e.g., ...). to In a specific embodiment, it is ); Indicates the number of network layers participating in the channel sparsity constraint; Represents the weight tensor of the l-th layer; Let f(l) represent the group sparse norm of the weight tensor of the l-th layer.

[0036] The group sparse norm can be further expressed as: ; in, This indicates the number of output channels in the l-th layer; This represents the kernel weight corresponding to the c-th output channel of the l-th layer; It represents Frobenius (Frobenius norm).

[0037] For example, in a certain convolutional layer with 64 output channels, the group sparsity norm in the compression loss term calculates the norm of the weights corresponding to each of the 64 output channels and sums the norms of each channel. If the weights corresponding to some channels are consistently close to zero, they can be considered as candidates for pruning in the subsequent structural compression stage. Through the above compression loss term, the weight update process is simultaneously constrained by defect identification bias, low-rank representation constraints, and channel sparsity constraints, providing an executable basis for subsequent low-rank approximation and structured pruning.

[0038] Construct the Lagrange constraint term and penalty term, and sum the compression loss term, Lagrange constraint term and penalty term to obtain the Lagrange relaxation objective function.

[0039] For example, the summation of the compression loss term, the Lagrange constraint term, and the penalty term yields the Lagrange relaxation objective function.

[0040] The Lagrange relaxation objective function can be expressed as: ; in, Denotes the Lagrange relaxation objective function; N represents the compression loss term; N represents the number of constraint terms. This represents the Lagrange multiplier corresponding to the i-th constraint term; This represents the constraint violation amount corresponding to the i-th constraint term; Indicates the penalty factor; This indicates the constraint violation amount after non-negative truncation.

[0041] The Lagrange relaxation objective function is used to unify the defect detection loss, low-rank representation constraint, channel sparsity constraint, and edge deployment resource constraint in the model compression process into the same optimization objective, so that subsequent alternating solutions can be performed around the task of image defect recognition of power distribution network equipment.

[0042] In one implementation, constructing the Lagrange constraint term and penalty term includes the following steps: Resource statistics are performed on the weight parameters and structural parameters to obtain statistical values ​​of model parameters, model computational load, and model inference latency.

[0043] For example, model parameter statistics can be obtained by counting the number of learnable parameters in each convolutional layer, normalization layer, detection output layer, and fully connected layer. For convolutional layers, the number of parameters can be counted based on the number of input channels, the number of output channels, and the kernel size; for detection output layers, the number of parameters can be counted based on the number of output categories and the bounding box regression dimension. Model computational complexity statistics can be obtained by counting the number of multiply-accumulate operations in each convolutional layer and detection output layer during a single forward inference. Model inference latency statistics can be obtained by running model forward inference on a target edge terminal or equivalent test equipment, inputting a pre-sized image of a power distribution network device (e.g., 640×640 pixels) and counting the time from image input to defect recognition result output.

[0044] Based on the sample recognition results and the sample annotation information corresponding to the inspection sample images, the recognition accuracy value of the benchmark deep network model is calculated.

[0045] For example, the sample recognition results output by the baseline deep network model are matched with the sample annotation information. If the predicted defect category is consistent with the real defect category, and the overlap between the predicted defect location and the real defect location meets the preset matching conditions, then the prediction result is counted as a correct recognition result. Subsequently, the recognition accuracy value is calculated based on the number of correct recognition results, the number of prediction results, and the number of real annotations. The recognition accuracy value can use at least one of mAP (mean Average Precision), Precision, or Recall as an evaluation index. The preset accuracy constraint value can be set as a lower limit of accuracy or an upper limit of accuracy decline (for example, the lower limit of mAP is 0.80 to 0.95, and in a specific embodiment it is 0.90; or the upper limit of mAP decline relative to the baseline model is 1% to 5%, and in a specific embodiment it is 2%).

[0046] For example, when the validation set contains multiple inspection sample images of distribution network equipment, the defect category, location, and confidence level are first output for each image. Then, the images are sorted according to their confidence levels and matched with manually labeled bounding boxes. The average accuracy of each defect category is calculated, and finally, the average of all defect categories is calculated to obtain the recognition accuracy value. This recognition accuracy value is used to determine whether the compressed model meets the accuracy requirements of the distribution network equipment defect recognition task.

[0047] The model parameter statistics, model computational statistics, model inference delay statistics, and recognition accuracy values ​​are compared with the corresponding preset constraint values ​​to calculate the constraint violation amount, thus obtaining each constraint violation amount.

[0048] For example, the preset constraint values ​​can be set in conjunction with the edge terminal hardware conditions, including model parameter constraint values, model computation constraint values, and model inference latency constraint values. For instance, the model parameter constraint value can be set to a preset upper limit for the number of parameters (e.g., 1M to 10M, 5M in a specific embodiment); the model computation constraint value can be set to a preset upper limit for the amount of computation (e.g., 0.5GFLOPs to 5GFLOPs, 1GFLOPs in a specific embodiment, where GFLOPs stands for Giga Floating Point Operations, representing billions of floating-point operations per second); and the model inference latency constraint value can be set to a preset upper limit for latency (e.g., 20ms (Millisecond) to 100ms, 50ms in a specific embodiment).

[0049] For example, for upper limit constraints such as parameter quantity, computational quantity, and inference latency, the current statistical value can be calculated as a ratio to the corresponding preset upper limit, and then the baseline value can be subtracted to obtain the constraint violation amount. For recognition accuracy constraints, the ratio of accuracy decrease to the preset accuracy decrease upper limit can be used, or the difference between the preset accuracy lower limit and the current recognition accuracy value can be used to construct the constraint violation amount.

[0050] This embodiment uses the decrease in accuracy as an example for illustration.

[0051] The amount of constraint violation can be expressed as: ; in, This represents the constraint violation amount corresponding to the i-th constraint term; This represents the statistical value of the current model under the i-th constraint term; This represents the preset constraint value corresponding to the i-th constraint term.

[0052] Correspondingly, the number of parameters, computational cost, inference latency, and violation of accuracy degradation constraints can be expressed as: ; ; ; ; in, This represents the statistical values ​​of the model parameters; Indicates the upper limit of the preset model parameters; This represents the statistical value of the model's computational cost; This indicates the upper limit of the preset model's computational load; This represents the statistical value of model inference latency; This indicates the preset inference latency limit; This indicates the decrease in recognition accuracy of the current model compared to the model before compression; This indicates the upper limit of the preset reduction in recognition accuracy.

[0053] For example, if the current model has 6M parameters and the preset upper limit for model parameters is 5M, then the parameter constraint violation is positive, indicating that the current model has more parameters than the constraint. If the current model has 4M parameters, then the parameter constraint violation is negative, indicating that the current model has more parameters than the constraint. By using a unified constraint violation representation, parameter quantity, computational cost, latency, and accuracy degradation of different dimensions can be transformed into dimensionless constraint evaluation results, which facilitates the subsequent construction of Lagrange constraint terms and penalty terms.

[0054] By using each Lagrange multiplier to perform a weighted summation of the various constraint violations, the Lagrange constraint terms are obtained.

[0055] For example, a corresponding Lagrange multiplier is set for each constraint term, and the Lagrange multiplier is used to characterize the constraint weight of the constraint term in the current iteration. Each constraint violation is multiplied by its corresponding Lagrange multiplier, and the products are summed to obtain the Lagrange constraint term.

[0056] The Lagrange constraint term can be expressed as: ; in, Represent the Lagrange constraint term; Indicates the number of constraint terms; This represents the Lagrange multiplier corresponding to the i-th constraint term; This represents the constraint violation amount corresponding to the i-th constraint term.

[0057] For example, if the violation of parameter quantity constraints and the violation of inference delay constraints are positive, the corresponding Lagrangian constraint terms will add corresponding constraint weights to the objective function, making subsequent weight updates and structure compression more inclined to reduce parameter quantity and inference delay.

[0058] Each constraint violation is truncated using a non-negative method to obtain the individual truncated violation quantities.

[0059] For example, nonnegative truncation is performed on each constraint violation: if the constraint violation is greater than zero, it is retained; if the constraint violation is less than or equal to zero, it is truncated to zero. This yields the individual truncated violations.

[0060] The truncation violation can be expressed as: ; in, This represents the truncation violation amount corresponding to the i-th constraint term; This represents the constraint violation amount corresponding to the i-th constraint term; This indicates the operation of finding the maximum value.

[0061] For example, if the model's computational cost is lower than a preset upper limit, the computational cost constraint violation is negative, and after non-negative truncation, it becomes zero; if the inference latency exceeds a preset upper limit, the inference latency constraint violation is positive, and after non-negative truncation, this positive value is retained. This ensures that the penalty term only affects the indicators of actual constraint violations.

[0062] The penalty term is obtained by weighting the sum of each truncation violation by a penalty factor.

[0063] For example, the individual truncation violations are squared, summed, and then weighted by a penalty factor to obtain the penalty term. The penalty factor can be set to a preset penalty factor range (e.g., ...). to In a specific embodiment, the initial value is 1), and it is adaptively updated according to the constraint satisfaction in subsequent iterations.

[0064] The penalty term can be represented as: ; in, Indicates a penalty item; Indicates the penalty factor; Indicates the number of constraint terms; This represents the constraint violation amount corresponding to the i-th constraint term; This indicates the constraint violation amount after non-negative truncation.

[0065] Understandably, when the number of parameters, computational load, and inference latency all meet the preset constraints, but the decrease in recognition accuracy exceeds the preset upper limit for accuracy decrease, the penalty term only penalizes the truncation violation corresponding to the decrease in recognition accuracy; when all constraints are met, all truncation violations are zero, and the penalty term does not add any additional constraint burden. By combining the Lagrange constraint term and the penalty term, the compression process can reduce model resource consumption while uniformly handling resource constraints and recognition accuracy constraints in the task of identifying defects in distribution network equipment.

[0066] S120 involves alternately solving the Lagrange relaxation objective function to alternately perform weight updates and structural compression on the baseline deep network model, generating multiple lightweight defect identification models.

[0067] For example, the lightweight defect recognition model is a defect recognition model obtained by weight updating, low-rank approximation, structured sparsification, and knowledge distillation of a baseline deep network model. It is used to classify and locate defects such as insulator cracks, broken conductor strands, and damaged hardware in images of power distribution network equipment. The lightweight defect recognition model includes a compressed feature extraction network, a compressed cross-scale feature integration network, and a compressed detection output network.

[0068] In this example, the baseline deep network model is the initial model before compression, while the lightweight defect recognition model is a version of the baseline deep network model obtained under different iteration rounds or compression constraints. The baseline deep network model provides initial weight parameters, structural parameters, and teacher features; the lightweight defect recognition model is deployed to edge terminals to perform image defect recognition of power distribution network equipment. Multiple lightweight defect recognition models can correspond to different compression levels (e.g., compression rates from 20% to 70%, with specific embodiments including three versions: 20%, 40%, and 60%), different numbers of model parameters, different inference latency, and different applicable scenarios, and can be stored together with model metadata in a model library.

[0069] In one implementation, step S120 includes the following steps: In this iteration, the current weight parameters of the baseline deep network model are updated based on the gradient of the Lagrange relaxation objective function to obtain the updated weight parameters.

[0070] For example, in the k-th iteration, the current model structure parameters are fixed, and the training images of the power distribution network equipment are input into the current model. The images are then passed through a feature extraction network, a cross-scale feature integration network, and a detection output network in sequence to obtain the training recognition results. Based on the deviation between the training recognition results and the sample annotation information, low-rank representation constraints, channel sparsity constraints, Lagrange constraints, and penalty terms, the Lagrange relaxation objective function value for this iteration is calculated. Subsequently, an SGD (Stochastic Gradient Descent) or Adam (Adaptive Moment Estimation) optimizer is used to update the gradient of the current weight parameters.

[0071] Weight updates can be represented as: ; in, This represents the current weight parameter in the k-th iteration; This represents the updated weight parameters; This represents the current structure parameters in the k-th iteration; This indicates the learning rate for weight updates, and its value can be set to a preset learning rate range (e.g., ...). to In a specific embodiment, it is ); This represents the gradient of the Lagrange relaxation objective function with respect to the weight parameters; Let represent the Lagrange relaxation objective function.

[0072] For example, when performing a mini-batch training on training images containing insulator cracks and conductor strand breaks, the number of mini-batch samples can be set to a preset batch size (e.g., 4 to 32 images, 16 images in a specific embodiment). The optimizer calculates the gradient based on the classification loss, localization loss, low-rank regularization term, channel sparsity term, and constraint violation penalty term, and updates the weight parameters of the convolutional layer and the detection output layer. In this way, while maintaining the defect identification capability of the distribution network equipment, the current model gradually forms a distribution of weight parameters suitable for low-rank decomposition and channel pruning.

[0073] Based on the updated weight parameters, the baseline deep network model is compressed to obtain the candidate defect identification model for this iteration.

[0074] For example, after the weights are updated, the updated weight parameters are fixed, and architecture compression is performed on the current model structure. Architecture compression includes low-rank approximation, structured sparsity, and knowledge distillation. Low-rank approximation is used to replace the weight representation of the layer to be compressed with a low-dimensional factor representation; structured sparsity is used to remove convolutional channels with low contribution; and knowledge distillation is used to calibrate the parameters of the compressed model using the output distribution or intermediate feature distribution of the model before compression.

[0075] In one implementation, the baseline deep network model is compressed based on the updated weight parameters to obtain the candidate defect identification model for this iteration, including the following steps: Based on the updated weight parameters, the baseline deep network model is approximated in low rank to obtain the first compressed model.

[0076] For example, a layer to be compressed is selected from the current model. This layer may include a convolutional layer in a feature extraction network, a convolutional layer in a cross-scale feature integration network, or a fully connected layer in a detection output network. For convolutional layers, the four-dimensional convolutional weight tensor can be first expanded into a two-dimensional weight matrix according to the output channel dimension and the input channel dimension. Then, the weight matrix is ​​subjected to SVD (Singular Value Decomposition) or Tucker decomposition to retain the principal components that meet the preset energy retention ratio (e.g., the energy retention ratio is 85% to 98%, and 95% in a specific embodiment). The original weight matrix is ​​then replaced with the factor matrix obtained from the decomposition.

[0077] The low-rank approximation loss can be expressed as: ; in, This represents the low-rank approximation loss; This represents the original weight matrix of the layer to be compressed; and This represents the factor matrix obtained from the low-rank decomposition. This represents Frobenius (Frobenius norm). This represents the low-rank approximation regularization coefficient, and its value can be set to a preset range of approximation regularization coefficients (e.g., ...). to In a specific embodiment, it is... ).

[0078] For example, if a convolutional layer has 128 original output channels, low-rank approximation can split the layer into two consecutive low-rank convolutional transformations, setting the intermediate rank to a preset decomposition rank (e.g., 25% to 75% of the original number of channels, specifically 50% of the original number of channels in a concrete embodiment). This yields the first compression model.

[0079] The importance of each channel in the first compression model is evaluated, and the channel importance score corresponding to each channel is obtained.

[0080] For example, the output channel weights of each convolutional layer in the first compressed model are read, and norm statistics or absolute value statistics are performed on the convolutional kernel weights corresponding to each output channel to obtain the channel importance score. The channel importance score can be obtained by using the L1 (Least Absolute Shrinkage) statistics or L2 (Euclidean norm) statistics of the channel weights.

[0081] For example, for the c-th output channel in layer l, the channel importance score can be obtained by summing the absolute values ​​of all convolutional kernel weights corresponding to that output channel; alternatively, the Frobenius norm of the output channel weights can be calculated as the channel importance score. If the importance score of an output channel is consistently lower than the preset quantile threshold of the channel scores in the same layer (e.g., from a minimum of 10% to 50%, with a minimum of 30% in a specific embodiment), then that output channel is identified as a candidate channel to be pruned.

[0082] Based on the preset compression ratio and the importance score of each channel, the first compression model is subjected to structured sparsity processing to obtain the second compression model.

[0083] For example, the output channels of each convolutional layer are sorted from low to high according to their channel importance scores, and the lower-ranked channels and their corresponding convolutional kernels are deleted according to a preset compression ratio. The preset compression ratio can be set according to the target level of the model library (e.g., 10% to 70%, with specific levels being 20%, 40%, and 60% in specific embodiments). After deleting the output channel of a certain convolutional layer, the input channel corresponding to that output channel in the next convolutional layer is simultaneously deleted, so that the compressed model structure maintains consistency in the channels between layers.

[0084] For example, in the first compression model, a convolutional layer has 64 output channels, with a preset compression ratio of 40%. Approximately 26 output channels with lower importance scores can be removed based on their importance scores, and the input channels of subsequent convolutional layers can be adjusted simultaneously. The resulting second compression model, after these removals, still maintains a complete forward inference path and can directly receive images of power distribution network equipment and output defect categories and locations.

[0085] A candidate defect identification model is obtained by using a baseline deep network model as the teacher model and a second compressed model as the student model for knowledge distillation training.

[0086] For example, the baseline deep network model before structural compression or the intermediate model before compression in the previous iteration is used as the teacher model, and the second compressed model is used as the student model. Training images of the same power distribution network equipment are input into the teacher and student models respectively. The end of the feature extraction network, the output of the cross-scale feature integration network, or the layer before the detection output network is selected as the distillation feature layer to obtain the teacher feature map and student feature map respectively. The teacher and student feature maps are normalized to obtain the teacher feature distribution and student feature distribution, and then the parameters of the student model are updated using cross-entropy loss and KL (Kullback-Leibler divergence) loss.

[0087] In this example, the knowledge distillation loss can be expressed as: ; in, This represents the loss from knowledge distillation. This represents the CE (Cross Entropy) loss; This represents the true class label corresponding to the training image; This represents the class probability distribution output by the student model; This represents the output probability distribution of the teacher model after softening by the temperature coefficient T; This represents the output probability distribution of the student model after softening by the temperature coefficient T; Indicates KL divergence; The value represents the balance coefficient between hard label loss and distillation loss, and can be set to a preset balance coefficient range (e.g., 0.1 to 0.9, 0.5 in a specific embodiment); T represents the temperature coefficient, and can be set to a preset temperature range (e.g., 1 to 8, 4 in a specific embodiment).

[0088] For example, in the category distribution output by the teacher model for a broken conductor image, the broken conductor category has the highest probability, followed by the insulator crack category. The student model learns both the real labels and the teacher model's category distribution through distillation training, enabling the second compressed model to retain the classification boundary information related to distribution network defect identification under the compressed structure. The candidate defect identification model for this iteration is obtained after distillation training.

[0089] Based on the constraint satisfaction of the candidate defect identification model, the function parameters of the Lagrange multipliers and penalty factor of the Lagrange relaxation objective function are updated to obtain the updated penalty factor and each updated Lagrange multiplier.

[0090] For example, resource statistics and verification are performed on the candidate defect identification models in this round to obtain the constraint violations of the candidate models under constraints such as parameter quantity, computational quantity, inference latency, and reduction in identification accuracy. Each constraint corresponds to a Lagrange multiplier, and the penalty factor is a penalty parameter shared in this round of iteration. It should be noted that one round of iteration yields one candidate defect identification model for this round, and multiple lightweight defect identification models are obtained by saving them from multiple rounds of iteration or by repeatedly executing them with different compression levels.

[0091] In one implementation, based on the constraint satisfaction of the candidate defect identification model, the Lagrange multipliers and penalty factor of the Lagrange relaxation objective function are updated to obtain the updated penalty factor and each updated Lagrange multiplier, including the following steps: For the constraint violation amount of the candidate defect identification model under each constraint term, obtain the constraint violation amount corresponding to the current iteration, and sum the product of the constraint violation amount and the preset multiplier update step size with the Lagrange multiplier corresponding to the previous iteration to obtain the candidate Lagrange multiplier.

[0092] For example, constraint violations corresponding to candidate defect identification models are calculated for parameter quantity constraints, computational quantity constraints, inference latency constraints, and recognition accuracy degradation constraints, respectively. For each constraint term, the constraint violation amount in this round is multiplied by a preset multiplier update step size, and then added to the Lagrange multiplier corresponding to that constraint term in the previous round to obtain the candidate Lagrange multiplier for that constraint term. The preset multiplier update step size can be set to a preset step size range (e.g., ...). Up to 1, specifically 0.1 in the embodiment).

[0093] Lagrange multiplier update can be represented as: ; in, This represents the candidate Lagrange multiplier corresponding to the i-th constraint term; This represents the Lagrange multiplier corresponding to the i-th constraint term in the previous iteration; Indicates the step size of the multiplier update; This represents the constraint violation amount of the candidate defect identification model under the i-th constraint term; This represents the weight parameters obtained in this iteration; This represents the structural parameters obtained in this iteration.

[0094] Each candidate Lagrange multiplier is nonnegatively truncated to obtain the updated Lagrange multipliers.

[0095] For example, a nonnegative truncation is performed on each candidate Lagrange multiplier. If a candidate Lagrange multiplier is less than zero, it is set to zero; if a candidate Lagrange multiplier is greater than or equal to zero, its value is retained.

[0096] Nonnegative truncation can be expressed as: ; in, This represents the updated Lagrange multiplier corresponding to the i-th constraint term; This represents the candidate Lagrange multiplier corresponding to the i-th constraint term; This indicates the operation of finding the maximum value.

[0097] For example, when the number of parameters in a candidate defect identification model exceeds a preset upper limit, the parameter constraint violation is positive, and the corresponding Lagrange multiplier increases. When the inference delay of a candidate defect identification model already meets the constraints, the inference delay constraint violation is negative or not greater than zero, and the corresponding Lagrange multiplier remains or decreases to a non-negative value. In this way, different constraint terms can be adjusted differently according to the actual state of the candidate model in this round.

[0098] Based on the comparison results between each constraint violation and the preset tolerance threshold, the penalty factor is updated by executing either the penalty factor growth strategy or the penalty factor decay strategy.

[0099] For example, a preset tolerance threshold is used to determine whether the amount of constraint violation exceeds an acceptable range, and can be set to a preset tolerance threshold range (e.g., 0 to 0.1, 0.05 in a specific embodiment). When any constraint violation is greater than the preset tolerance threshold, it indicates that the candidate defect identification model has a situation where the edge deployment constraint is not met, and a penalty factor growth strategy is executed; when each constraint violation is not greater than the preset tolerance threshold in consecutive iteration rounds, it indicates that the model continuously meets the constraints in multiple iteration rounds, and a penalty factor decay strategy is executed. The consecutive iteration rounds can be set to a preset consecutive round range (e.g., 2 to 5 rounds, 3 rounds in a specific embodiment).

[0100] In one implementation, based on the comparison results between each constraint violation and a preset tolerance threshold, a penalty factor growth strategy or a penalty factor decay strategy is executed, including the following steps: If at least one constraint violation exceeds a preset tolerance threshold, a penalty factor growth strategy is executed. The penalty factor growth strategy includes multiplying the penalty factor corresponding to the current iteration by a preset growth coefficient to obtain a candidate growth penalty factor, and taking the minimum value from the preset upper limit of the penalty factor and the candidate growth penalty factor as the updated penalty factor.

[0101] The penalty factor growth strategy can be expressed as: ; in, This indicates the updated penalty factor; This represents the penalty factor corresponding to this iteration; This represents the upper limit of the preset penalty factor, and the value can be set to a preset upper limit range (e.g., 10 to 1000, 100 in a specific embodiment). This represents a preset growth coefficient, and its value can be set to a preset growth coefficient range (e.g., 1.1 to 3, 2 in a specific embodiment). This indicates the minimum value operation.

[0102] For example, when the inference delay constraint violation of the candidate defect identification model is greater than 0.05, the current penalty factor is multiplied by a growth factor and compared with the upper limit of the penalty factor to take the smaller value, in order to avoid the penalty factor increasing indefinitely. This can improve the influence of the constraint violation term on the Lagrange relaxation objective function in the next iteration.

[0103] If the amount of each constraint violation does not exceed the preset tolerance threshold in consecutive iterations, then the penalty factor decay strategy is executed. The penalty factor decay strategy includes multiplying the penalty factor corresponding to the current iteration by the preset decay coefficient to obtain the candidate decay penalty factor, and taking the maximum value from the preset penalty factor lower limit and the candidate decay penalty factor as the updated penalty factor.

[0104] The penalty factor decay strategy can be expressed as: ; in, This indicates the updated penalty factor; This represents the penalty factor corresponding to this iteration; This represents the lower limit of the preset penalty factor, and its value can be set to a preset lower limit range (e.g., ...). Up to 1, in a specific embodiment it is ); This represents the preset attenuation coefficient, and its value can be set to a preset attenuation coefficient range (e.g., 0.1 to 0.9, 0.5 in a specific embodiment). This indicates the operation of finding the maximum value.

[0105] For example, when a candidate defect identification model satisfies the constraints on parameter quantity, computational cost, inference latency, and decreased identification accuracy in three consecutive iterations, the current penalty factor is multiplied by a decay coefficient and compared with the lower limit of the penalty factor to take the larger value, thus avoiding an excessively small penalty factor. This reduces excessive penalty when the constraints are continuously satisfied, allowing the model compression process to retain further structural search space.

[0106] Based on the updated penalty factor and each updated Lagrange multiplier, the Lagrange relaxation objective function corresponding to the next iteration is updated, and the above weight update, architecture compression and function parameter update are repeated based on the updated Lagrange relaxation objective function until the preset iteration termination condition is met, so as to obtain multiple lightweight defect identification models.

[0107] For example, the updated Lagrange multipliers and the updated penalty factor are substituted into the Lagrange relaxation objective function of the next iteration, and the candidate defect identification model of this round is used as the input model of the next iteration. The preset iteration termination condition may include at least one of the following: the model compression rate reaches the preset target compression rate (e.g., 20% to 70%, 50% in a specific embodiment); the amount of each constraint violation is not greater than the preset tolerance threshold (e.g., 0 to 0.1, 0.05 in a specific embodiment); the preset maximum number of iterations is reached (e.g., 5 to 30 rounds, 10 rounds in a specific embodiment); the decrease in recognition accuracy exceeds the preset protection threshold and the preset accuracy constraint is still not met after fine-tuning (e.g., the accuracy decrease protection threshold is 3% to 8%, 5% in a specific embodiment).

[0108] At the end of each iteration, candidate defect recognition models that meet the inclusion criteria can be written into the model library. Inclusion criteria may include: the candidate defect recognition model meets constraints on parameter quantity, computational cost, inference latency, and recognition accuracy; the compression level of the candidate defect recognition model differs from existing model versions; and the candidate defect recognition model is verified using a power distribution network equipment verification image set. The model library can record model metadata for each lightweight defect recognition model, including compression ratio, number of model parameters, computational cost, inference latency, recognition accuracy, applicable scenario type, and update time.

[0109] For example, after the first iteration, a candidate defect recognition model with a compression ratio of approximately 20% is generated; after the third iteration, a candidate defect recognition model with a compression ratio of approximately 40% is generated; and after the fifth iteration, a candidate defect recognition model with a compression ratio of approximately 60% is generated. If all these candidate defect recognition models satisfy the above constraints, they are written into the model library as multiple lightweight defect recognition models. Thus, the server can subsequently select models with different compression levels for distribution based on the recognition task data from the edge terminal, eliminating the need for the edge terminal to run benchmark deep network models with larger parameter counts and computational demands.

[0110] S130, responding to the identification request from the edge terminal, the identification request carries identification task data.

[0111] For example, an edge terminal is a computing device deployed at the distribution network inspection site, possessing image acquisition and local inference capabilities. For instance, an edge terminal can be an inspection drone, inspection robot, handheld inspection terminal, pole-side edge computing box, or substation edge computing node. The edge terminal may include an image acquisition unit, a processor, a memory, a communication module, and a model inference module; wherein, the image acquisition unit is used to acquire images of distribution network equipment, the processor is used to perform image preprocessing and model inference, and the communication module is used to interact with the server. The communication module can employ wireless communication methods, such as 4G (4th Generation Mobile Communication Technology), 5G (5th Generation Mobile Communication Technology), Wi-Fi (Wireless Fidelity), private network communication, or Ethernet communication.

[0112] An identification request is a model invocation request sent by an edge terminal to the server when performing a power distribution network equipment inspection task. The identification request requests the server to select a lightweight defect identification model from the model library that matches the current inspection task. The identification request carries identification task data, which may include one or more of the following: scene complexity of the image to be identified, available computing resources of the edge terminal, task accuracy requirements, terminal device type, type of device to be identified, and network connection status.

[0113] In this example, after acquiring the image of the power distribution network equipment to be identified, the edge terminal first performs image preprocessing and scene analysis on the image. Image preprocessing may include image resizing, noise reduction, brightness normalization, and image format conversion; the image size may be adjusted to a preset inference input size (e.g., width 640 to 1280 pixels, height 640 to 1280 pixels, specifically 640×640 pixels in this embodiment). Scene analysis may include texture complexity statistics, edge density statistics, and illumination state statistics. For example, the edge terminal can use edge detection operators to count the proportion of edge pixels in the image and calculate texture complexity using gray-level co-occurrence matrix or local gradient statistics; when the proportion of edge pixels and the degree of texture change are within a preset complex scene range (e.g., the proportion of edge pixels is 15% to 40%, specifically 25% in this embodiment), the current scene can be marked as a complex scene.

[0114] The edge terminal also collects its own available computing resources. Available computing resources may include at least one of the following: processor utilization, remaining memory, graphics processing unit utilization, remaining battery power, and local available storage space. Processor utilization can be read from the operating system resource monitoring interface, remaining memory can be read from the memory management interface, and remaining battery power can be read from the power management interface. For example, if the current processor utilization of the inspection drone is 70%, the remaining memory is 800MB (Megabyte), and the remaining battery power is 35%, then this resource status can be encapsulated as part of the identification task data. The preset resource judgment threshold corresponding to the available computing resources can be set according to the edge terminal model (for example, the processor utilization threshold is 60% to 90%, specifically 80% in this embodiment; the remaining memory threshold is 256MB to 2GB (Gigabyte), specifically 512MB in this embodiment).

[0115] The accuracy requirement for a task can be determined by the type of inspection task. For example, for routine rapid line inspection tasks, the accuracy requirement can be set to a rapid identification mode; for suspected defect review tasks, the accuracy requirement can be set to a fine identification mode; and for nighttime or obstructed scene inspection tasks, the accuracy requirement can be set to an enhanced identification mode. The accuracy requirement can also be represented by preset accuracy levels (e.g., low latency level, balanced level, high precision level; in specific embodiments, this includes three levels: rapid, balanced, and fine), which are used to subsequently select lightweight defect identification models with different compression levels.

[0116] When generating an identification request, the edge terminal encapsulates the identification task data into a request message. The request message may include a terminal identifier, task identifier, device type, scene complexity, available computing resources, task accuracy requirements, image summary information, and a timestamp. The terminal identifier distinguishes different inspection terminals, the task identifier distinguishes different inspection tasks, and the image summary information may include the size of the image to be identified, the acquisition time, the acquisition location, and the device category; it is not necessary to upload the complete image in each request. The request message can be in JSON (JavaScript Object Notation) format, Protocol Buffers format, or other structured data formats.

[0117] For example, when an inspection drone is inspecting power lines in a mountainous area, it collects images containing insulators and conductors to be identified. Analysis reveals that the current scene is complex, with high processor utilization and the remaining battery power below a preset threshold. The task accuracy requirement is balanced. The inspection drone encapsulates this data along with the terminal identifier, task identifier, and the type of device to be identified into an identification request, which is then sent to the server via a 5G communication network. Upon receiving the identification request, the server parses the identification task data, providing input for subsequently searching for the target defect identification model in the model library.

[0118] When the server responds to an identification request, it can first perform integrity and permission checks on the request message. Integrity checks determine whether the identification task data contains the fields required for model selection, such as scene complexity, available computing resources, and task accuracy requirements. Permission checks determine whether the edge terminal is a terminal authorized to access the model library. If the request message lacks necessary fields, the server can return a supplementary request or use default identification task data. Default identification task data can be set to a preset default scene complexity, preset default resource status, and preset default task accuracy requirements (e.g., medium scene, resource balanced status, balanced level). If the request message verification passes, the server proceeds to the target defect identification model search process.

[0119] In this way, the edge terminal uploads the current inspection scenario, terminal resource status and identification task requirements together before requesting the model. This allows the server to select the target defect identification model based on the actual edge conditions, avoiding the use of models with fixed operating parameters and large computational loads by the edge terminal. This provides a data foundation for reducing the computational resource consumption of the edge terminal when performing defect identification of power distribution network equipment.

[0120] S140: Based on the identification task data, the target defect identification model is searched from multiple lightweight defect identification models and sent to the edge terminal so that the edge terminal can identify defects in the image of the power distribution equipment to be identified through the target defect identification model and obtain the defect identification result.

[0121] For example, the target defect recognition model is a defect recognition model selected from multiple lightweight defect recognition models in a model library for the current edge terminal recognition request. The target defect recognition model includes a compressed feature extraction network, a compressed cross-scale feature integration network, and a compressed detection output network, which can output the defect category, defect location, and confidence value for the image of the distribution network equipment to be identified.

[0122] In this example, the model library pre-stores multiple lightweight defect recognition models and their corresponding application scenario parameters. These lightweight defect recognition models can correspond to different compression ratios and edge deployment conditions (e.g., compression ratios ranging from 20% to 70%, with specific embodiments including 20%, 40%, and 60% compression versions). Model application scenario parameters may include model compression ratio, number of model parameters, model computational cost, model inference latency, model recognition accuracy, applicable scenario complexity, applicable device type, and model version number. After receiving a recognition request from the edge terminal, the server parses the recognition task data and selects the target defect recognition model based on the matching relationship between the recognition task data and the model application scenario parameters. Then, it sends the target defect recognition model or its download address to the edge terminal.

[0123] In one implementation, step S140 involves searching for a target defect identification model from multiple lightweight defect identification models based on the identification task data. The identification task data includes scenario complexity, available computing resources, and task accuracy requirements, and includes the following steps: Obtain the model application scenario parameters for multiple lightweight defect recognition models.

[0124] For example, the server reads the model application scenario parameters corresponding to each lightweight defect recognition model from the model library. The model application scenario parameters can be written when the lightweight defect recognition model is generated and added to the library, or updated after model validation. The model application scenario parameters include: model compression ratio, number of model parameters, model computational cost, model inference latency, model recognition accuracy, applicable scenario complexity, applicable task accuracy level, and applicable terminal resource conditions.

[0125] Among them, model compression ratio is used to represent the degree of compression of the lightweight defect recognition model relative to the benchmark deep network model; model parameter count is used to represent the storage scale occupied when the model is loaded; model computational cost is used to represent the amount of computational operations required for a single inference; model inference latency is used to represent the time taken to process an image of a preset size on a preset test terminal; model recognition accuracy can be represented by mAP (mean Average Precision), Precision, or Recall; applicable scenario complexity can include simple, medium, and complex scenarios; applicable task accuracy levels can include fast recognition level, balanced recognition level, and fine recognition level.

[0126] For example, the model library stores three lightweight defect recognition models: the first model has a compression rate of 20%, a large number of model parameters, and is suitable for fine-grained recognition levels and complex scenarios; the second model has a compression rate of 40%, and is suitable for balanced recognition levels and medium-level scenarios; the third model has a compression rate of 60%, a small number of model parameters, and is suitable for fast-grained recognition levels or resource-constrained scenarios. The above compression rates are only specific examples, and can be set to other compression levels (e.g., multiple levels between 15% and 75%) according to the edge terminal model and inspection task requirements.

[0127] Based on the fit score between scenario complexity, task accuracy requirements and model application scenario parameters, candidate defect recognition models are selected from multiple lightweight defect recognition models.

[0128] For example, the server matches the scenario complexity and task accuracy requirements in the identification task data with the applicable scenario complexity and applicable task accuracy level of each lightweight defect identification model, respectively, to obtain a fit score for each lightweight defect identification model. The fit score can be obtained by weighting the scenario fit score and the accuracy fit score.

[0129] In this example, the scene fit score is used to represent the degree of matching between the scene complexity of the current image to be recognized and the applicable scene of the model; the accuracy fit score is used to represent the degree of matching between the task accuracy requirements and the model recognition accuracy.

[0130] For example, the scene adaptation score can be calculated using a scene level matching method. The server can classify scene complexity into simple, medium, and complex scenes, and configure an applicable scene level for each lightweight defect recognition model. When the scene complexity of the image to be recognized matches the applicable scene level of the lightweight defect recognition model, the scene adaptation score is set to a first preset score value; when the two are adjacent, the scene adaptation score is set to a second preset score value; when the two are not adjacent, the scene adaptation score is set to a third preset score value. The first preset score value is greater than the second preset score value, and the second preset score value is greater than the third preset score value. For example, the first preset score value can be 1, the second preset score value can be 0.5 to 0.8, and the third preset score value can be 0 to 0.3.

[0131] Optionally, the scene adaptation score can also be calculated using continuous feature distance. The server can assemble a scene feature vector from the texture complexity, edge density, and illumination deviation of the image to be recognized, and assemble a model scene vector from the applicable scene parameters of each lightweight defect recognition model; calculate the distance between the scene feature vector and the model scene vector, and determine the scene adaptation score based on the distance. The smaller the distance, the larger the scene adaptation score. For example, Euclidean distance, cosine distance, or Manhattan distance can be used to calculate the difference between the two, and the distance can be normalized and converted into a scene adaptation score between 0 and 1.

[0132] For example, the accuracy fit score can also be calculated using an accuracy difference normalization method. The server can calculate the accuracy difference between the model recognition accuracy and the task accuracy requirement, and determine the accuracy fit score based on the accuracy difference. When the model recognition accuracy meets or exceeds the task accuracy requirement, a higher accuracy fit score is assigned; when the model recognition accuracy is lower than the task accuracy requirement, the accuracy fit score decreases as the difference increases. For example, the accuracy difference can be mapped to a range of 0 to 1 to obtain the accuracy fit score. For example, the fit score can be expressed as: ; in, This represents the fit score of the j-th lightweight defect identification model; This represents the scene adaptation score corresponding to the j-th lightweight defect recognition model; This represents the accuracy fit score corresponding to the j-th lightweight defect identification model; This indicates the scene adaptation score weight, and the value can be set to a preset weight range (e.g., 0.3 to 0.7, 0.5 in a specific embodiment). This indicates the accuracy-adaptive scoring weight, and the value can be set to a preset weight range (e.g., 0.3 to 0.7, 0.5 in a specific embodiment). .

[0133] For example, the image to be identified is a wire inspection image obscured by tree branches, representing a complex scene with a high accuracy requirement of fine recognition. If the first model is applicable to a complex scene and its recognition accuracy meets the fine recognition requirement, then the first model's fit score is higher than that of the third model, which is suitable for a fast recognition level. The server can sort multiple lightweight defect recognition models from high to low according to their fit scores and determine the models whose fit scores reach a preset score threshold as candidate defect recognition models. The preset score threshold can be set to a preset score range (e.g., 0.5 to 0.9, 0.7 in a specific embodiment).

[0134] For each candidate defect identification model, the candidate defect identification model that meets the requirements of available computing resources is determined as the target defect identification model.

[0135] For example, the server reads the available computing resources from the identification task data and matches these resources with the number of model parameters, the computational load, and the inference latency of each candidate defect identification model. Available computing resources may include the remaining memory of the edge terminal, the idle percentage of the processor, the idle percentage of the graphics processing unit, the remaining battery power, and the allowed inference latency. If the number of model parameters of a candidate defect identification model does not exceed the model loading limit corresponding to the remaining memory of the edge terminal, the computational load does not exceed the computational load limit corresponding to the current computing power of the edge terminal, and the inference latency does not exceed the allowed latency of the task, then the candidate defect identification model meets the requirements for available computing resources.

[0136] For example, the inspection drone currently has 512MB of remaining memory, an allowed single-frame inference latency of 50ms, and 30% battery remaining. If the first model has the highest fit score but its inference latency exceeds the allowed single-frame inference latency, the server will not identify the first model as the target defect identification model. If the second model meets the available computing resources and has the highest fit score among the remaining candidate models, the second model will be identified as the target defect identification model. If the remaining battery power is lower than a preset power threshold (e.g., 20% to 40%, 30% in a specific embodiment), the server may prioritize candidate defect identification models with higher compression ratios and acceptable inference latency.

[0137] If multiple candidate defect identification models exist, all meeting the available computing resources, the candidate defect identification model with the highest fitness score can be selected as the target defect identification model. If the fitness scores are the same, the candidate defect identification model with shorter inference latency or fewer parameters can be prioritized. If no candidate defect identification model simultaneously meets both the fitness score threshold and available computing resources, the server can select the lightweight defect identification model with the highest recognition accuracy that meets the available computing resources, or return a resource shortage warning and request the edge terminal to adjust the task accuracy requirements.

[0138] After determining the target defect identification model, the server distributes the model to the edge terminal. Distribution methods may include directly distributing the model file, distributing incremental update packages, or distributing a model download address. The model file may include a network structure file, a weight file, a model version number, and verification information. Upon receiving the target defect identification model, the edge terminal can perform integrity and version verification on the model file. If the verification passes, the target defect identification model is loaded into the local inference module.

[0139] When the edge terminal performs defect identification on the image of the distribution network equipment to be identified using the target defect identification model, it first resizes and normalizes the pixels of the image before inputting the processed image into the target defect identification model. The target defect identification model extracts image features through a compressed feature extraction network, performs feature fusion through a compressed cross-scale feature integration network, and outputs the defect identification result through a compressed detection output network. The defect identification result may include defect category, defect location, and confidence value.

[0140] For example, an edge terminal inputs a 640×640 pixel image of an insulator into a target defect identification model. The model outputs the "insulator crack" category, the coordinates of the bounding box where the crack is located, and a confidence score. The edge terminal can then use this defect identification result for local alarm generation, inspection report generation, or upload it to a server for verification. Through this process, the edge terminal does not need to run a fixed, computationally intensive baseline deep network model; instead, it runs a target defect identification model that matches the current identification task and its own resource status, thereby reducing the computational resource consumption during the defect identification process of power distribution network equipment.

[0141] In one implementation, step S140 sends a target defect identification model to the edge terminal so that the edge terminal can identify defects in the distribution network equipment image to be identified through the target defect identification model and obtain the defect identification result. The method further includes receiving the defect identification result sent by the edge terminal. If the confidence value in the defect identification result is less than a preset confidence threshold, the distribution network equipment image and the defect identification result are used as incremental samples to update the target defect identification model.

[0142] For example, after completing a defect identification, the edge terminal sends the defect identification result to the server. The defect identification result may include terminal identifier, task identifier, image identifier of the power distribution network equipment image, defect category, defect location, confidence value, acquisition time, and acquisition location. The confidence value is the degree of credibility of the target defect identification model's output of the defect category and defect location, and can be obtained from the category probability output by the classification branch of the detection output network, the target existence probability output by the localization branch, or a combination of both.

[0143] After receiving the defect identification results, the server reads the confidence value from the results and compares it with a preset confidence threshold. The preset confidence threshold can be set according to the inspection task type, defect category risk level, and false alarm tolerance (e.g., 0.6 to 0.9, 0.8 in a specific embodiment). When the confidence value is less than the preset confidence threshold, the server determines that the target defect identification model's identification result for the current distribution network equipment image needs to be verified, and writes the corresponding distribution network equipment image and defect identification result into the incremental sample cache. The incremental sample cache can be located in the server's local storage, edge server storage, or a cloud-based model management platform.

[0144] To avoid directly using misidentified results for model updates, the server can perform verification annotations on the distribution network equipment images in the incremental sample cache. Verification annotation can be done manually using a terminal or by an auxiliary annotation tool after manual confirmation. The verification annotation results include the verified defect category and the verified defect location. The server associates the distribution network equipment images, defect identification results, and verification annotation results to form incremental samples. The data structure of incremental samples may include image data, model prediction category, model prediction location, model prediction confidence, verified defect category, and verified defect location. If the verification result indicates that there are no defects in the image, the verified defect category can be marked as a defect-free background.

[0145] Once the number of incremental samples reaches a preset update threshold, the server initiates an update of the target defect identification model. The preset update threshold can be set to a preset sample size range (e.g., 10 to 200 images, 30 images in this specific embodiment). Before initiating the update, incremental samples can undergo quality screening, including removing images with blurriness exceeding a preset blur threshold, images with defect area occlusion exceeding a preset occlusion threshold, and images with missing verification annotations. Image blurriness can be statistically analyzed using Laplacian variance, and the preset blur threshold can be set to a preset variance range (e.g., 50 to 300, 100 in this specific embodiment). The occlusion ratio can be estimated based on the effective visible area within the verification annotation region, and the preset occlusion threshold can be set to a preset ratio range (e.g., 50% to 90%, 70% in this specific embodiment).

[0146] When updating the target defect recognition model, the server can use an incremental fine-tuning approach. Specifically, the current version of the target defect recognition model is loaded, and the incremental samples are divided into an incremental training set and an incremental validation set (e.g., a ratio of 7:3 to 9:1, specifically 8:2 in this embodiment). The target defect recognition model's parameters are updated in a few rounds on the incremental training set (e.g., 1 to 10 training epochs, specifically 5 training epochs in this embodiment), and the updated model is validated on the incremental validation set. During parameter updates, some shallow feature extraction layers of the target defect recognition model can be frozen, and only the detection output network and the feature fusion layer near the output end are updated to reduce computational overhead and the risk of model forgetting during the update process.

[0147] The incremental update loss can consist of classification loss and localization loss, or it can be combined with knowledge distillation loss. This involves using the uncompressed target defect identification model as the teacher model and the updated target defect identification model as the student model, ensuring that the updated model maintains the original defect category identification ability. If knowledge distillation loss is used, the aforementioned knowledge distillation loss formula can be applied: ; in, This represents the loss from knowledge distillation. This represents the CE (Cross Entropy) loss; Indicates the review defect category of the incremental sample; This represents the category probability distribution output by the target defect identification model during the update process; This represents the output probability distribution of the target defect identification model before updating, after softening by the temperature coefficient T. This represents the output probability distribution of the target defect identification model after softening by the temperature coefficient T. Indicates KL; The value represents the balance coefficient between hard label loss and distillation loss, and can be set to a preset balance coefficient range (e.g., 0.1 to 0.9, 0.5 in a specific embodiment); T represents the temperature coefficient, and can be set to a preset temperature range (e.g., 1 to 8, 4 in a specific embodiment).

[0148] After the update is completed, the server performs model verification on the updated target defect identification model. Model verification may include recognition accuracy verification, inference latency verification, and model resource usage verification. Recognition accuracy verification can be performed on the incremental verification set and the historical verification set respectively to detect the recognition status of the updated model for new and existing scenarios; inference latency verification can be performed on the same or equivalent test device as the edge terminal; model resource usage verification can count the number of model parameters and the model file size. If the updated target defect identification model meets the preset storage conditions, the updated target defect identification model is written into the model library, and the updated model metadata is recorded. The preset storage conditions may include recognition accuracy not lower than a preset accuracy threshold, inference latency not exceeding a preset latency threshold, number of model parameters not exceeding a preset parameter number threshold, and recognition accuracy decrease in the historical verification set not exceeding a preset decrease threshold; the preset accuracy threshold can be set to 0.80 to 0.95, and in a specific embodiment, it is 0.90; the preset latency threshold can be set to 20ms to 100ms, and in a specific embodiment, it is 50ms; the preset decrease threshold can be set to 1% to 5%, and in a specific embodiment, it is 2%.

[0149] For example, during an inspection of a power distribution line, a drone outputting a confidence score of 0.65 for a crack in a new type of composite insulator, which is lower than the preset confidence threshold of 0.8. The server writes the corresponding power distribution network equipment image and defect identification result into the incremental sample cache, and after manual review, obtains the verified defect category as insulator crack and the verified defect location as the bounding box of the crack area. After accumulating 30 similar low-confidence images, the server performs incremental fine-tuning of the target defect identification model for 5 training cycles and validates it on the incremental validation set and the historical validation set. After successful validation, the server writes the updated target defect identification model as the new version into the model library and prioritizes the distribution of this model version to the next similar edge terminal request.

[0150] Through the above processing, the low-confidence defect identification results will not be directly used as unconfirmed training basis, but will be combined with the distribution network equipment images and verification annotation results to form incremental samples before participating in model updates. At the same time, through the updated model verification and data entry condition control, the target defect identification model can adapt to new inspection scenarios and changes in equipment appearance, while maintaining the range of model resources that can be deployed on the edge terminal.

[0151] Figure 2 This is a structural block diagram of a defect identification system for power distribution network equipment according to an embodiment of the present invention.

[0152] like Figure 2 As shown, the defect identification system for the power distribution network equipment may include: The construction module 510 is used to construct a Lagrange relaxation objective function with the deviation between the sample recognition result and the sample annotation information of the preset benchmark deep network model as the detection loss component and the weight parameters and structural parameters of the benchmark deep network model as optimization variables. The generation module 520 is used to alternately solve the Lagrange relaxation objective function to alternately perform weight updates and structural compression on the baseline deep network model, thereby generating multiple lightweight defect recognition models. The request response module 530 is used to respond to the identification request of the edge terminal, wherein the identification request carries identification task data; The defect identification module 540 is used to search for a target defect identification model from multiple lightweight defect identification models based on the identification task data, and send the target defect identification model to the edge terminal so that the edge terminal can perform defect identification on the image of the power distribution equipment to be identified through the target defect identification model and obtain the defect identification result.

[0153] In one implementation, the building module includes: The feature extraction network unit is used to extract edge features and texture features from the inspection sample images of power distribution equipment through the feature extraction network of the benchmark deep network model to obtain sample image features. A cross-scale feature integration network unit is used to perform multi-scale fusion processing on the sample image features through the cross-scale feature integration network of the baseline deep network model to obtain fused image features; The detection output network unit is used to classify and locate the fused image features through the detection output network of the baseline depth network model to obtain the sample recognition result; The detection loss component construction unit is used to construct the detection loss component based on the sample recognition result and the sample annotation information corresponding to the inspection sample image; The compression loss term construction unit is used to perform a weighted summation of the low-rank representation constraint of the weight parameters, the channel sparsity constraint of the structure parameters, and the detection loss components to obtain the compression loss term; The Lagrange relaxation objective function construction unit is used to construct the Lagrange constraint term and the penalty term, and to sum the compression loss term, the Lagrange constraint term and the penalty term to obtain the Lagrange relaxation objective function.

[0154] In one implementation, the construction of the Lagrange constraint term and penalty term is specifically used for: Resource statistics are performed on the weight parameters and the structural parameters to obtain statistical values ​​of model parameters, statistical values ​​of model computational load, and statistical values ​​of model inference latency. Based on the sample recognition results and the sample annotation information corresponding to the inspection sample images, the recognition accuracy value of the benchmark deep network model is calculated; The model parameter statistics, model computational complexity statistics, model inference delay statistics, and recognition accuracy values ​​are respectively compared with the corresponding preset constraint values ​​to calculate the constraint violation amount, thus obtaining each constraint violation amount; The Lagrange constraint terms are obtained by weighted summation of each constraint violation using each Lagrange multiplier. Each constraint violation is truncated to obtain a truncated violation. The penalty term is obtained by weighting the sum of each of the truncation violations using a penalty factor.

[0155] In one embodiment, the generation module includes: The weight update unit is used to update the current weight parameters of the baseline deep network model based on the gradient of the Lagrange relaxation objective function in the current iteration, so as to obtain the updated weight parameters. An architecture compression unit is used to compress the architecture of the baseline deep network model based on the updated weight parameters to obtain the candidate defect identification model for this iteration. The function parameter update unit is used to update the function parameters of the Lagrange multipliers and penalty factor of the Lagrange relaxation objective function based on the constraint satisfaction of the candidate defect identification model, so as to obtain the updated penalty factor and each updated Lagrange multiplier. The iterative update unit is used to update the Lagrange relaxation objective function corresponding to the next iteration based on the updated penalty factor and each of the updated Lagrange multipliers, and to repeatedly perform the above weight update, architecture compression and function parameter update based on the updated Lagrange relaxation objective function until the preset iteration termination condition is met, so as to obtain multiple lightweight defect identification models.

[0156] In one embodiment, the architecture compression unit includes: The low-rank approximation processing subunit is used to perform low-rank approximation processing on the baseline deep network model based on the updated weight parameters to obtain the first compressed model. The importance assessment subunit is used to assess the importance of each channel in the first compression model and obtain the channel importance score corresponding to each channel. The structured sparsity processing subunit is used to perform structured sparsity processing on the first compression model according to a preset compression ratio and the importance score of each channel to obtain a second compression model. The knowledge distillation training subunit is used to perform knowledge distillation training using the baseline deep network model as the teacher model and the second compressed model as the student model to obtain the candidate defect identification model.

[0157] In one implementation, the function parameter update unit includes: The candidate Lagrange multiplier calculation subunit is used to obtain the constraint violation amount corresponding to the current iteration for the constraint violation amount of the candidate defect identification model under each constraint term, and to sum the product of the constraint violation amount and the preset multiplier update step size with the Lagrange multiplier corresponding to the previous iteration to obtain the candidate Lagrange multiplier. The non-negative truncation processing subunit is used to perform non-negative truncation processing on each of the candidate Lagrange multipliers to obtain each of the updated Lagrange multipliers. The execution subunit is used to execute a penalty factor growth strategy or a penalty factor decay strategy based on the comparison results between each of the constraint violation amounts and the preset tolerance threshold, so as to obtain the updated penalty factor.

[0158] In one implementation, the execution subunit is specifically used for: If at least one of the constraint violations is greater than the preset tolerance threshold, the penalty factor growth strategy is executed, wherein the penalty factor growth strategy includes multiplying the penalty factor corresponding to the current iteration by a preset growth coefficient to obtain a candidate growth penalty factor, and taking the minimum value from the preset upper limit of the penalty factor and the candidate growth penalty factor; If the amount of each constraint violation is not greater than the preset tolerance threshold in consecutive iterations, then the penalty factor decay strategy is executed. The penalty factor decay strategy includes multiplying the penalty factor corresponding to the current iteration by a preset decay coefficient to obtain a candidate decay penalty factor, and taking the maximum value from the preset penalty factor lower limit and the candidate decay penalty factor.

[0159] In one implementation, the step of searching for a target defect identification model from multiple lightweight defect identification models based on the identification task data, wherein the identification task data includes scenario complexity, available computing resources, and task accuracy requirements, is specifically used for: Obtain the model application scenario parameters of multiple lightweight defect recognition models; Based on the fit score between the scenario complexity, the task accuracy requirements, and the model application scenario parameters, each candidate defect recognition model is searched from multiple lightweight defect recognition models. For each of the candidate defect identification models, the candidate defect identification model that satisfies the available computing resources is determined as the target defect identification model.

[0160] In one embodiment, after the defect identification module, the system further includes: The incremental update module is used to receive the defect identification result sent by the edge terminal. If the confidence value in the defect identification result is less than the preset confidence threshold, the distribution network equipment image and the defect identification result are used as incremental samples to update the target defect identification model.

[0161] The specific functions and examples of each module and submodule of the system in this embodiment of the invention can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0162] The acquisition, storage, and application of user personal information involved in the technical solution of this invention all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0163] This invention also provides a computer device, comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in any one of the embodiments of the present invention.

[0164] The beneficial effects of the computer equipment in this embodiment of the invention are equivalent to the beneficial effects of the defect identification method for power distribution network equipment described above, and will not be repeated here.

[0165] This invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method described in any one of the embodiments of this invention.

[0166] The beneficial effects of the storage medium of the present invention are equivalent to the beneficial effects of the defect identification method for power distribution network equipment described above, and will not be repeated here.

[0167] Figure 3 A schematic block diagram of an example computer device 800 that can be used to implement embodiments of the present invention is shown. Computer device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Computer device 800 may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0168] like Figure 3 As shown, the computer device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the computer device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0169] Multiple components in computer device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows computer device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0170] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as a defect identification method for distribution network equipment. For example, in some embodiments, the defect identification method for distribution network equipment can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the computer device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the defect identification method for distribution network equipment described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform a defect identification method for power distribution network equipment by any other suitable means (e.g., by means of firmware).

[0171] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0172] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0173] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0174] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0175] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0176] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0177] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.

[0178] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for defect identification in power distribution network equipment, characterized in that, include: The deviation between the sample recognition results and sample annotation information of the preset benchmark deep network model is used as the detection loss component, and the weight parameters and structural parameters of the benchmark deep network model are used as optimization variables to construct a Lagrange relaxation objective function. The Lagrange relaxation objective function is solved alternately to alternately perform weight updates and structural compression on the baseline deep network model, generating multiple lightweight defect identification models; In response to an identification request from an edge terminal, the identification request carries identification task data; Based on the identification task data, a target defect identification model is searched from multiple lightweight defect identification models, and the target defect identification model is sent to the edge terminal so that the edge terminal can perform defect identification on the image of the power distribution equipment to be identified through the target defect identification model and obtain the defect identification result.

2. The method according to claim 1, characterized in that, The step involves using the deviation between the sample recognition results and sample annotation information of the benchmark deep network model as the detection loss component, and using the weight parameters and structural parameters of the benchmark deep network model as optimization variables to construct a Lagrange relaxation objective function, including: The feature extraction network of the aforementioned benchmark deep network model is used to extract edge features and texture features from the inspection sample images of power distribution network equipment to obtain sample image features. The sample image features are fused by multi-scale fusion processing through the cross-scale feature integration network of the baseline deep network model to obtain fused image features. The fused image features are classified and localized using the detection output network of the baseline deep network model to obtain the sample recognition result. Based on the sample recognition results and the sample annotation information corresponding to the inspection sample images, the detection loss component is constructed; The compression loss term is obtained by weighting and summing the low-rank representation constraint of the weight parameters, the channel sparsity constraint of the structure parameters, and the detection loss components. Construct Lagrange constraint terms and penalty terms, and sum the compression loss term, the Lagrange constraint terms and the penalty terms to obtain the Lagrange relaxation objective function.

3. The method according to claim 2, characterized in that, The construction of the Lagrange constraint term and penalty term includes: Resource statistics are performed on the weight parameters and the structural parameters to obtain statistical values ​​of model parameters, statistical values ​​of model computational load, and statistical values ​​of model inference latency. Based on the sample recognition results and the sample annotation information corresponding to the inspection sample images, the recognition accuracy value of the benchmark deep network model is calculated; The model parameter statistics, model computational complexity statistics, model inference delay statistics, and recognition accuracy values ​​are respectively compared with the corresponding preset constraint values ​​to calculate the constraint violation amount, thus obtaining each constraint violation amount; The Lagrange constraint terms are obtained by weighted summation of each constraint violation using each Lagrange multiplier. Each constraint violation is truncated to obtain a truncated violation. The penalty term is obtained by weighting the sum of each of the truncation violations using a penalty factor.

4. The method according to claim 1, characterized in that, The method involves alternately solving the Lagrange relaxation objective function to alternately perform weight updates and structural compression on the baseline deep network model, generating multiple lightweight defect identification models, including: In this iteration, the current weight parameters of the baseline deep network model are updated based on the gradient of the Lagrange relaxation objective function to obtain the updated weight parameters. Based on the updated weight parameters, the baseline deep network model is compressed to obtain the candidate defect identification model for this iteration. Based on the constraint satisfaction of the candidate defect identification model, the function parameters of the Lagrange multipliers and penalty factor of the Lagrange relaxation objective function are updated to obtain the updated penalty factor and each updated Lagrange multiplier. Based on the updated penalty factor and each of the updated Lagrange multipliers, the Lagrange relaxation objective function corresponding to the next iteration is updated, and the above weight update, architecture compression and function parameter update are repeated based on the updated Lagrange relaxation objective function until the preset iteration termination condition is met, so as to obtain multiple lightweight defect identification models.

5. The method according to claim 4, characterized in that, The step of compressing the baseline deep network model based on the updated weight parameters to obtain the candidate defect identification model for this iteration includes: Based on the updated weight parameters, the baseline deep network model is approximated in low rank to obtain the first compressed model. The importance of each channel in the first compression model is evaluated to obtain the channel importance score corresponding to each channel in each layer; Based on the preset compression ratio and the importance score of each channel, the first compression model is subjected to structured sparsity processing to obtain the second compression model; The candidate defect identification model is obtained by using the baseline deep network model as the teacher model and the second compressed model as the student model for knowledge distillation training.

6. The method according to claim 4, characterized in that, Based on the constraint satisfaction of the candidate defect identification model, the Lagrange multipliers and penalty factor of the Lagrange relaxation objective function are updated to obtain the updated penalty factor and each updated Lagrange multiplier, including: For the constraint violation amount of the candidate defect identification model under each constraint term, obtain the constraint violation amount corresponding to the current iteration, and sum the product of the constraint violation amount and the preset multiplier update step size with the Lagrange multiplier corresponding to the previous iteration to obtain the candidate Lagrange multiplier. Each of the candidate Lagrange multipliers is subjected to non-negative truncation to obtain each of the updated Lagrange multipliers; Based on the comparison results between each constraint violation and the preset tolerance threshold, a penalty factor growth strategy or a penalty factor decay strategy is executed to obtain the updated penalty factor.

7. The method according to claim 6, characterized in that, The step of executing a penalty factor growth strategy or a penalty factor decay strategy based on the comparison results between each of the constraint violation amounts and a preset tolerance threshold includes: If at least one of the constraint violations is greater than the preset tolerance threshold, the penalty factor growth strategy is executed, wherein the penalty factor growth strategy includes multiplying the penalty factor corresponding to the current iteration by a preset growth coefficient to obtain a candidate growth penalty factor, and taking the minimum value from the preset upper limit of the penalty factor and the candidate growth penalty factor; If the amount of each constraint violation is not greater than the preset tolerance threshold in consecutive iterations, then the penalty factor decay strategy is executed. The penalty factor decay strategy includes multiplying the penalty factor corresponding to the current iteration by a preset decay coefficient to obtain a candidate decay penalty factor, and taking the maximum value from the preset penalty factor lower limit and the candidate decay penalty factor.

8. The method according to claim 1, characterized in that, The identification task data includes scene complexity, available computing resources, and task accuracy requirements. The step of searching for a target defect identification model from multiple lightweight defect identification models based on the identification task data includes: Obtain the model application scenario parameters of multiple lightweight defect recognition models; Based on the fit score between the scenario complexity, the task accuracy requirements, and the model application scenario parameters, each candidate defect recognition model is searched from multiple lightweight defect recognition models. For each of the candidate defect identification models, the candidate defect identification model that satisfies the available computing resources is determined as the target defect identification model.

9. The method according to claim 1, characterized in that, After the step of sending the target defect identification model to the edge terminal, so that the edge terminal can perform defect identification on the image of the distribution network equipment to be identified using the target defect identification model and obtain the defect identification result, the method further includes: If the confidence value in the defect identification result sent by the edge terminal is less than the preset confidence threshold, the image of the power distribution network equipment and the defect identification result are used as incremental samples to update the target defect identification model.

10. A defect identification system for power distribution network equipment, characterized in that, include: The construction module is used to construct a Lagrange relaxation objective function with the deviation between the sample recognition results and sample annotation information of the preset benchmark deep network model as the detection loss component and the weight parameters and structural parameters of the benchmark deep network model as optimization variables. The generation module is used to alternately solve the Lagrange relaxation objective function to alternately perform weight updates and structural compression on the baseline deep network model, thereby generating multiple lightweight defect recognition models. The request-response module is used to respond to the identification request from the edge terminal, wherein the identification request carries identification task data; The defect identification module is used to search for a target defect identification model from multiple lightweight defect identification models based on the identification task data, and send the target defect identification model to the edge terminal so that the edge terminal can perform defect identification on the image of the power distribution equipment to be identified through the target defect identification model and obtain the defect identification result.