Power transmission inspection image processing method, electronic device, medium and program product
By constructing a unified recognition model, the problem of storage and computational redundancy in power transmission and transformation inspection is solved. It enables the simultaneous output of results for multiple recognition tasks on a single vision backbone network, improving the model's perception capabilities and making it suitable for equipment such as drones and inspection robots.
Patent Information
- Application Number
- CN202611343894.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-27
AI Technical Summary
Existing image recognition models used in power transmission and transformation inspection suffer from storage and computational redundancy, especially on devices with limited computing power such as drones and inspection robots, which cannot meet the needs of real-time inspection.
A unified recognition model is constructed, comprising a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders. The preprocessing layer generates views at different scales, the visual backbone network is used for feature extraction, and the feature fusion layer and task decoders output the results of multiple recognition tasks, thus avoiding the redundancy of independent models.
It enables the simultaneous output of results for multiple recognition tasks on a single visual backbone network, reducing computational and storage overhead, improving the perception capability of multi-scale targets, and is suitable for edge devices with limited computing power.
Smart Images

Figure CN123182020A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial intelligent technology, and in particular to an image processing method, electronic device, medium and program product for power transmission and transformation inspection. Background Technology
[0002] Power transmission and transformation equipment is a core component of the power system, and its operational status directly affects grid security. Timely detection of equipment defects and potential hazards through image-based inspections is a crucial means of ensuring a reliable power supply. With the development of artificial intelligence technology, deep learning-based visual recognition methods have been initially applied in power transmission and transformation inspections, enabling tasks such as target detection, defect classification, and semantic segmentation.
[0003] However, when there are multiple recognition tasks, current solutions typically design and train dedicated models for each task independently. Each model contains a complete backbone network. When multiple tasks coexist, the backbone network repeatedly calculates shallow texture (edges, colors) and mid-level geometry (shapes, parts) features for the same input image, resulting in storage and computational redundancy. Furthermore, the system needs to maintain multiple models simultaneously, leading to an exponential increase in overhead, which cannot meet the needs of real-time inspection. This problem is particularly prominent on edge devices with limited computing power, such as drones and inspection robots. Summary of the Invention
[0004] In view of this, this application provides a power transmission and transformation inspection image processing method, electronic device, medium and program product, which can solve the problems of storage redundancy and computational redundancy in the current power transmission and transformation inspection image recognition model.
[0005] The present application is described below from multiple aspects, and the implementation methods and beneficial effects of these aspects can be referred to each other.
[0006] In a first aspect, this application provides a method for processing images of power transmission and transformation inspections. The method includes: acquiring power transmission and transformation inspection images; inputting the inspection images into a pre-trained recognition model; the recognition model includes a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders; performing image processing on the inspection images based on the preprocessing layer to obtain views at different scales; extracting features from the views at different scales based on the visual backbone network to obtain feature extraction results; fusing the feature extraction results based on the feature fusion layer to obtain fused features; and recognizing the fused features based on the multiple task decoders, and outputting recognition results corresponding to various recognition tasks respectively.
[0007] According to this scheme, by constructing a unified recognition model that includes a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders, the recognition results for multiple tasks can be output simultaneously based on a single visual backbone network. This avoids the computational and storage redundancy problems caused by deploying independent models for different tasks. Moreover, the preprocessing layer generates views at different scales, enabling the model to have multi-scale information perception capabilities before feature extraction. This is beneficial for simultaneously taking into account large targets and minute defects with significant scale differences in power transmission and transformation scenarios, thereby improving the overall recognition performance in complex scenarios.
[0008] In one possible implementation of the first aspect described above, the visual backbone network includes multiple feature extraction stages with progressively deeper feature abstraction levels; feature extraction is performed on views of different scales based on the visual backbone network to obtain feature extraction results, including: a first feature extraction stage of the visual backbone network extracts features from views of different scales and outputs a first feature map; a second feature extraction stage of the visual backbone network receives the first feature map output by the first feature extraction stage, performs feature extraction based on the first feature map, and outputs a corresponding second feature map; each subsequent feature extraction stage of the visual backbone network receives the feature map output by the previous feature extraction stage, performs feature extraction based on the feature map output by the previous feature extraction stage, and outputs the feature map corresponding to the current feature extraction stage; the feature maps output by each feature extraction stage of the visual backbone network are the feature extraction results.
[0009] According to this scheme, by designing the visual backbone network into multiple feature extraction stages with progressively deeper levels of feature abstraction, the network can gradually extract hierarchical visual features from the original image, ranging from low-level texture edges to high-level semantic concepts. The shallow stages preserve high-resolution spatial information, which is beneficial for locating small targets, while the deeper stages extract strong semantic abstract features, which is helpful for understanding the global scene structure. The outputs of each stage collectively constitute the feature extraction result, providing a feature foundation for subsequent multi-task fusion that includes both precise location information and rich semantic information.
[0010] In one possible implementation of the first aspect above, a split-feed self-attention module is set up in each feature extraction stage; the split-feed self-attention module is used to: divide the input feature map into multiple sub-feature branches along the channel dimension; each sub-feature branch is used to generate a query vector, a key vector, and a value vector respectively; and different sub-feature branches use different spatial sampling scales to extract features when generating key vectors and value vectors; and based on the query vector, key vector, and value vector generated by each sub-feature branch, determine the feature map corresponding to the current feature extraction stage.
[0011] According to this scheme, by introducing a split-aggregation mechanism, a split-attention module containing multiple sub-feature branches is set up in each feature extraction stage. Sampling operators with different strides or convolutional kernel sizes are configured for different branches, allowing features of different spatial granularities or semantic levels to be extracted simultaneously within a single feature extraction stage. Branches with smaller strides or convolutional kernels focus on local details such as pins and cracks, while branches with larger strides or convolutional kernels focus on global structural features such as towers and conductors. This approach structurally preserves high-resolution detail branches, enabling the model to maintain sensitivity to minute defects while extracting deep semantics, fundamentally solving the scale distortion problem between macroscopic background and microscopic targets during feature extraction. The split-aggregation design avoids the problem of small target information being easily submerged by a large background in traditional single-scale feature extraction, effectively improving the model's overall perception ability of multi-scale targets and taking into account both macroscopic topological relationships and microscopic defect details in power transmission and transformation scenarios.
[0012] In one possible implementation of the first aspect described above, the training process of the recognition model includes: constructing a student model and a teacher model; wherein both the student model and the teacher model include a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders, and the visual backbone networks of both the student model and the teacher model include multiple feature extraction stages with progressively deeper feature abstraction levels; inputting a first training sample image into the student model to obtain a student model feature map output by at least one feature extraction stage of the visual backbone network of the student model, and a first recognition result output by the task decoder of the student model; inputting a second training sample image into the teacher model to obtain a teacher model feature map output by at least one feature extraction stage of the visual backbone network of the teacher model; updating the parameters of the student model based on the student model feature map, the teacher model feature map, and the first recognition result to train the student model; the trained student model is the recognition model.
[0013] According to this scheme, a dual-branch training framework consisting of a student model and a teacher model is constructed. This allows the student model to use the output of the teacher model as a global semantic reference while training on regular visual tasks. Furthermore, this training method updates the parameters of the student model based on the feature maps output by both the teacher and student models during the feature extraction stage. This helps the student model maintain a robust understanding of the global semantic structure while learning the discriminative features required for specific tasks (such as detection and segmentation), avoiding over-optimization of a single task and loss of global contextual information, thus improving the model's generalization ability.
[0014] In one possible implementation of the first aspect described above, updating the parameters of the student model based on the student model feature map, the teacher model feature map, and the first recognition result includes: determining a cross-stage alignment loss based on the student model feature map and the teacher model feature map; the cross-stage alignment loss represents the difference between the student model feature map and the teacher model feature map; determining a visual task loss based on the first recognition result and the ground truth label; the visual task loss represents the difference between the first recognition result and the ground truth label; determining a total loss based on the cross-stage alignment loss and the visual task loss; and updating the parameters of the student model based on the total loss.
[0015] According to this scheme, multiple constraints are imposed on the student model by decomposing the total loss into a joint optimization of cross-stage alignment loss and visual task loss. The cross-stage alignment loss constrains the consistency between the student and teacher models in the feature space, maintaining the stability of the global semantic structure. The visual task loss constrains the discrimination accuracy of the student model on specific tasks. The weighted combination of these two constraints ensures that the student model, while pursuing performance on specific tasks, does not deviate too far from the global semantic structure.
[0016] In one possible implementation of the first aspect above, determining the cross-stage alignment loss based on the student model feature map and the teacher model feature map includes: expanding the student model feature map along the spatial dimension to obtain the corresponding two-dimensional feature matrix of the student model, and determining the corresponding first gram matrix based on the two-dimensional feature matrix of the student model; expanding the teacher model feature map along the spatial dimension to obtain the corresponding two-dimensional feature matrix of the teacher model, and determining the corresponding second gram matrix based on the two-dimensional feature matrix of the teacher model; and determining the cross-stage alignment loss based on the first gram matrix and the second gram matrix.
[0017] According to this scheme, the difference between the student model and the teacher model is measured by calculating the Gram matrix of the feature maps. The cross-stage alignment loss is based on the global correlation between feature channels, rather than directly constraining pixel-by-pixel feature differences. This approach enables the student model to maintain the global semantic structure of the teacher model without destroying the local spatial details required for tasks such as detection and segmentation. It effectively transmits the global semantic structure information from the teacher model, ensuring the student model's correct perception of the overall scene layout and component relationships, and preventing performance degradation due to over-alignment of local details.
[0018] In one possible implementation of the first aspect above, the teacher model is determined based on any of the following methods: using the student model with the best parameters during training as the teacher model; or updating the parameters of the initial teacher model based on the parameters of the student model during training to determine the teacher model; or using a pre-trained model as the teacher model.
[0019] According to the scheme, by providing multiple ways to obtain teacher models, the training framework can be flexibly selected according to actual training conditions. The multiple options improve the adaptability and flexibility of the training framework under different application scenarios and data scales.
[0020] In a second aspect, this application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the method disclosed in the first aspect and any possible implementation thereof.
[0021] Thirdly, this application provides a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the method disclosed in the first aspect and any possible implementation thereof.
[0022] Fourthly, this application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the methods disclosed in the first aspect and any possible implementation thereof.
[0023] It should be understood that the beneficial effects of the second to fourth aspects mentioned above can be referred to the beneficial effects described in the first aspect, and will not be repeated here. Attached Figure Description
[0024] Figure 1 A flowchart illustrating the image processing method for power transmission and transformation inspection provided in this application embodiment;
[0025] Figure 2 A schematic diagram of the framework of the recognition model provided in the embodiments of this application;
[0026] Figure 3 A schematic diagram of the feature extraction process provided in the embodiments of this application;
[0027] Figure 4 A schematic diagram of the feature extraction stage provided in an embodiment of this application;
[0028] Figure 5 A flowchart illustrating the model training process provided in this application embodiment;
[0029] Figure 6 A schematic diagram illustrating the process of updating parameters of a student model as provided in an embodiment of this application;
[0030] Figure 7 A schematic diagram illustrating the process for determining cross-stage alignment loss provided in an embodiment of this application;
[0031] Figure 8A schematic diagram of the framework for determining cross-stage alignment loss provided in an embodiment of this application;
[0032] Figure 9 A block diagram of an electronic device provided in an embodiment of this application;
[0033] Figure 10 This is a block diagram of a SoC (system on chip) provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] First, the technical problems to be solved by the embodiments of this application will be explained.
[0036] Power transmission and transformation equipment is a core component of the power system. Image inspection can promptly detect equipment defects and potential hazards.
[0037] In some embodiments, the recognition models for image inspection are designed and trained independently for each recognition task. For example, ResNet is used for global image classification. ResNet typically consists of cascaded residual blocks and utilizes skip connections to address the degradation problem of deep networks. Region-based convolutional neural networks (R-CNN series) or single-stage networks (YOLO series) are used for object detection and segmentation. The core mechanism of convolutional neural networks includes regional proposal networks (RPN) and region of interest pooling (RoI pooling), which decouple feature extraction from boundary regression. In actual deployment, these independent network models are run in series or in parallel. For example, after a drone acquires images, a classification model is first called to determine the scene, and then a detection model and a segmentation model are called to perform fine-grained analysis of specific parts. In other words, each model contains a complete backbone network. When multiple tasks coexist, multiple backbone networks need to repeatedly process and recognize the same input image, resulting in a large number of repetitive convolution calculations and occupying a huge amount of GPU memory space. This leads to storage redundancy and computational redundancy, which cannot meet the real-time inspection requirements.
[0038] In view of this, embodiments of this application provide a power transmission and transformation inspection image processing method, which sets up a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders in the recognition model. After acquiring the inspection image, the preprocessing layer first processes the inspection image to obtain multiple views at different scales. Then, the same visual backbone network extracts features from the views at different scales, the feature fusion layer performs feature fusion, and finally, the task decoders output the recognition results corresponding to the various recognition tasks. Through the power transmission and transformation inspection image processing method of this application embodiment, the recognition results of multiple recognition tasks can be output simultaneously based on a single visual backbone network, avoiding the computational and storage redundancy problems caused by deploying independent models for different tasks.
[0039] The image processing method for power transmission and transformation inspection according to the present application will be described below with reference to the embodiments and accompanying drawings.
[0040] It should be noted that the power transmission and transformation inspection image processing method of this application embodiment can run on a server with image processing capabilities, an edge computing device of an inspection robot, an unmanned aerial vehicle (UAV)-borne computing device, or a substation edge computing node. The software environment can be implemented based on PyTorch, TensorFlow, or other deep learning frameworks. The following description uses a server as the execution entity as an example to illustrate the power transmission and transformation inspection image processing method of this application embodiment.
[0041] Reference Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the image processing method for power transmission and transformation inspection provided in an embodiment of this application. Figure 2 This is a schematic diagram of the framework of the recognition model provided in the embodiments of this application.
[0042] like Figure 1 As shown, the power transmission and transformation inspection image processing method of this application embodiment may include steps S110 to S160.
[0043] S110: Acquire images of power transmission and transformation inspections.
[0044] It is understood that power transmission and transformation inspection images include, but are not limited to, images of power transmission lines, images of substation equipment, aerial images taken by drones, and images collected by inspection robots. Furthermore, power transmission and transformation inspection images may include objects such as towers, conductors, insulators, hardware, pins, surge arresters, bushings, switchgear, rusted areas, and cracked areas.
[0045] S120: Input the inspection image into the pre-trained recognition model.
[0046] It is understood that, depending on the task requirements, the training data of the recognition model may include image classification labels, object detection boxes, semantic segmentation masks, key point coordinates, or power transmission and transformation inspection images without manual annotation. This application embodiment does not limit this.
[0047] The recognition model may include a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders.
[0048] S130: Based on the preprocessing layer, the inspection image is processed to obtain views at different scales.
[0049] Understandably, the preprocessing layer can process the training images based on different cropping ratios, scaling factors, or sliding window slicing methods to obtain views at different scales (i.e., different resolutions), such as large-scale, medium-scale, and small-scale views. The preprocessing layer generates at least two types of views: the first is a global view, used to preserve the overall layout of towers, conductors, equipment, the surrounding environment, and the spatial relationships between equipment. The second is a local view, used to highlight fine-grained targets or defect areas such as insulators, hardware, pins, cracks, and rust spots. This provides a rich receptive field for the subsequent visual backbone network, simulating the observation perspectives at different distances during UAV inspections. This allows the visual backbone network to simultaneously receive global environmental information and local detail information, preventing minor defects from being overwhelmed by a large background during feature extraction.
[0050] In some embodiments, before the preprocessing layer performs image processing on the inspection image and obtains views at different scales, the preprocessing layer can first perform preprocessing on the inspection image. Preprocessing may include operations such as size normalization, pixel value normalization, noise suppression, brightness or contrast enhancement, thereby improving the reliability of subsequent recognition.
[0051] S140: Based on the visual backbone network, feature extraction is performed on views of different scales and the feature extraction results are obtained.
[0052] S150: Based on the feature fusion layer, the feature extraction results are fused to obtain the fused features.
[0053] Understandably, the feature fusion layer can adopt a feature pyramid structure, a cross-layer splicing structure, or a weighted fusion structure to fuse shallow detailed features and deep semantic features.
[0054] S160: Based on multiple task decoders, the fused features are identified and the identification results corresponding to the various identification tasks are output respectively.
[0055] It is understandable that multiple task decoders may include, but are not limited to, classification decoders, object detection decoders, semantic segmentation decoders, and keypoint detection decoders. The function of each decoder is explained below.
[0056] The classification decoder is used to perform image classification tasks. Image classification tasks involve making a global semantic judgment on the overall content of the inspection image and outputting the category label to which the image belongs, such as scene category identification and / or device status category identification.
[0057] The target detection decoding head is used to perform target detection tasks, which means locating the position of the target of interest in the inspection image and identifying the category to which each target belongs, such as locating the location and category of equipment, parts or defects.
[0058] The semantic segmentation decoding head is used to perform semantic segmentation tasks. Semantic segmentation tasks involve performing pixel-level dense classification on inspection images and assigning a category label to each pixel in the inspection image to its target region or defect region, such as pixel-level segmentation results for rusted regions, cracked regions, and equipment regions.
[0059] The key point detection decoding head is used to perform key point detection tasks, which involve locating the coordinates of predefined, structurally significant key locations in the inspection image, such as key locations like tower structure points, insulator connection points, and conductor hanging points.
[0060] Based on steps S110-S160, the power transmission and transformation inspection image processing method of this application constructs a unified recognition model comprising a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders. This allows the recognition results of multiple recognition tasks to be output simultaneously based on a single visual backbone network, avoiding the computational and storage redundancy problems caused by deploying independent models for different tasks. Moreover, the preprocessing layer generates views at different scales, enabling the model to have multi-scale information perception capabilities before feature extraction. This is beneficial for simultaneously considering large targets and minute defects with significant scale differences in power transmission and transformation scenarios, improving the overall recognition performance in complex scenarios.
[0061] Moreover, by constructing a unified visual backbone network, the overhead of edge computing resources is reduced, providing a unified path for self-supervised pre-training of large-scale data during the training process.
[0062] The image processing method for power transmission and transformation inspection in this application can be applied to scenarios with limited computing power, such as drones, inspection robots, and substation edge nodes, effectively solving the contradiction between real-time requirements and limited hardware computing power in industrial inspection.
[0063] Step S140 will be explained below.
[0064] Reference Figure 3 , Figure 3 This is a schematic diagram of the feature extraction process provided in an embodiment of this application.
[0065] In some embodiments, the visual backbone network may include multiple feature extraction stages with progressively deeper feature abstraction levels. For example, it may include a first feature extraction stage, a second feature extraction stage, a third feature extraction stage, and a fourth feature extraction stage, with each stage sequentially extracting features from the input image in ascending order of depth. The following section combines... Figure 3 Please provide a detailed explanation.
[0066] like Figure 3 As shown, the process of extracting features from views of different scales based on the visual backbone network and obtaining the feature extraction results in step S140 may include steps S310 to S330.
[0067] S310: The first feature extraction stage of the visual backbone network, which extracts features from views at different scales and outputs the first feature map.
[0068] S320: The second feature extraction stage of the visual backbone network receives the first feature map output by the first feature extraction stage, performs feature extraction based on the first feature map, and outputs the corresponding second feature map.
[0069] S330: Each feature extraction stage of the subsequent visual backbone network receives the feature map output by the previous feature extraction stage, performs feature extraction based on the feature map output by the previous feature extraction stage, and outputs the feature map corresponding to the current feature extraction stage.
[0070] It is understandable that the feature maps output by each feature extraction stage of the visual backbone network are the feature extraction results.
[0071] Based on steps S310-S330, by designing the visual backbone network into multiple feature extraction stages with progressively deeper levels of feature abstraction, the network can gradually extract hierarchical visual features from the original image, ranging from low-level texture edges to high-level semantic concepts. The shallow stages preserve high-resolution spatial information, which is beneficial for locating small targets, while the deeper stages extract strong semantic abstract features, which is beneficial for understanding the global scene structure. The outputs of each stage collectively constitute the feature extraction result, providing a feature foundation for subsequent multi-task fusion that includes both precise location information and rich semantic information.
[0072] In some embodiments, a split-attention module is set up in each feature extraction stage, and the processing procedure inside the split-attention module is as follows:
[0073] The split-feature self-attention module is used to divide the input feature map into multiple sub-feature branches along the channel dimension.
[0074] Each sub-feature branch is used to generate the query vector, key vector, and value vector, respectively. Furthermore, different sub-feature branches employ different spatial sampling scales for feature extraction when generating the key and value vectors. That is, sampling operators with different scales or different convolutional kernel sizes can be used for feature extraction.
[0075] The self-attention module determines the feature map corresponding to the current feature extraction stage based on the query vector, key vector, and value vector generated by each sub-feature branch.
[0076] Specifically, refer to Figure 4 , Figure 4 This is a schematic diagram of the feature extraction stage provided in an embodiment of this application.
[0077] like Figure 4 As shown, the input feature map can be denoted as input feature X, and the channel dimension can be represented as C×H×W. Here, C represents the number of channels, and H and W represent the height and width of the feature map, respectively. By grouping the channels, the input features can be... Figure X It is divided into X1, X2, X3, and X4. And through each sub-feature branch (corresponding to...) Figure 4 The feature extraction is performed on branches 1, 2, 3, and 4 in the algorithm to generate corresponding query vectors Q, key vectors K, and value vectors V. Different sub-feature branches use different spatial sampling scales when generating key vectors K and value vectors V, while different sub-feature branches use the same spatial sampling scale when generating query vector Q. After feature extraction, the split-attention module can also perform attention calculations (including concatenation, linear mapping, and residual fusion) based on the query vectors Q, key vectors K, and value vectors V generated by each sub-feature branch to obtain the feature map corresponding to the current feature extraction stage. Figure 4 The output feature Xout in the query vector Q represents the location of the feature that needs to be focused on, the key vector K represents the content of the feature that can be matched, and the value vector V represents the actual feature information that is aggregated.
[0078] Understandably, sub-feature branches with a smaller spatial sampling scale (i.e., a smaller step size) can be used to extract local detail features (such as details of small targets like pins, cracks, and rust spots), while sub-feature branches with a larger spatial sampling scale (i.e., a larger step size) can be used to extract global structural features (such as global structural information like towers, conductors, and equipment configurations). Figure 4As shown, branch 1 can use convolution with a stride of 1 to extract details such as pins and cracks. Branch 2 can use convolution with a stride of 2 to extract component-level local structures (e.g., bolt connections, repeating textures of insulator discs, and conductor stranding patterns). Branch 3 can use convolution with a stride of 4 to extract equipment-level semantics (e.g., entire insulator strings, surge arrester bodies, and circuit breaker bushings). Branch 4 can use convolution with a stride of 8 to extract environmental and topological relationships (e.g., the spatial layout of towers, conductors, and the ground, and the connection relationships between equipment).
[0079] Therefore, by introducing a split-aggregation mechanism, a split-attention module containing multiple sub-feature branches is set up in each feature extraction stage, and sampling operators with different strides or convolution kernel sizes are configured for different branches. This allows features of different spatial granularities or semantic levels to be extracted simultaneously within a single feature extraction stage. Branches with smaller strides or convolution kernels focus on local details such as pins and cracks, while branches with larger strides or convolution kernels focus on global structural features such as towers and conductors. This approach structurally preserves high-resolution detail branches, enabling the model to maintain sensitivity to minute defects while extracting deep semantics, fundamentally solving the scale distortion problem between macro background and micro targets during feature extraction. The split-aggregation design avoids the problem of small target information being easily submerged by a large area of background in traditional single-scale feature extraction, effectively improving the model's overall perception ability of multi-scale targets and taking into account both macro topological relationships and micro defect details in power transmission and transformation scenarios.
[0080] The training process of the recognition model will be explained below.
[0081] Reference Figure 5 , Figure 5 This is a flowchart illustrating the model training process provided in an embodiment of this application.
[0082] In some embodiments, such as Figure 5 As shown, the training process of the recognition model mentioned in step S120 may include steps S510 to S540.
[0083] S510: Construct student and teacher models.
[0084] It is understandable that the student model and the teacher model have the same structure, and both are also identical in structure to the recognition model. That is, both the student model and the teacher model include a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders, and the visual backbone network of both the student model and the teacher model includes multiple feature extraction stages with progressively deeper levels of feature abstraction.
[0085] The difference between the student model and the teacher model is that the student model (including its visual backbone network and task decoder) is untrained or needs further training, while the teacher model (including its visual backbone network and task decoder) is usually already trained and is used to provide a reference.
[0086] S520: Input the first training sample image into the student model to obtain the student model feature map output by at least one feature extraction stage of the visual backbone network of the student model, and the first recognition result output by the task decoder of the student model.
[0087] S530: Input the second training sample image into the teacher model to obtain the teacher model feature map output by at least one feature extraction stage of the visual backbone network of the teacher model.
[0088] It should be noted that the second training sample can be the same as the first training sample. Alternatively, the second training sample can be an enhanced version of the first training sample, such as with improved sharpness. This design forces the student model to grasp the essence of features amidst the chaos, thereby improving training effectiveness.
[0089] S540: Based on the student model feature map, the teacher model feature map, and the first recognition result, update the parameters of the student model to train the student model. The trained student model is the recognition model.
[0090] Specifically, the parameters of the student model are updated, that is, the parameters of the visual backbone network and the task decoder of the student model are updated.
[0091] Based on steps S510-S540, a dual-branch training framework of student and teacher models is constructed, enabling the student model to use the output of the teacher model as a global semantic reference while training on conventional visual tasks. Furthermore, this training method updates the parameters of the student model based on the feature maps output by both the teacher and student models during the feature extraction stage. This helps the student model maintain a robust understanding of the global semantic structure while learning the discriminative features required for specific tasks (such as detection and segmentation), avoiding over-optimization of a single task and loss of global contextual information, thus improving the model's generalization ability.
[0092] In some embodiments, the teacher model may be determined based on any of the following methods:
[0093] The first approach is to use the student model with the optimal parameters during training as the teacher model.
[0094] The second approach is to update the parameters of the initial teacher model based on the parameters of the student model during training, thereby determining the teacher model.
[0095] For example, the parameters of the initial teacher model can be updated in this way: Teacher model parameters = a * initial teacher model parameters + (1-a) * student model parameters during the current training process.
[0096] This approach enables the teacher model parameters to smoothly integrate the historical state of the student model throughout the entire training cycle, effectively filtering out parameter noise from a single iteration and providing a more stable and reliable global semantic reference.
[0097] The third approach is to use a pre-trained model as a teacher model.
[0098] Specifically, a teacher model can be used as a model that has been pre-trained or trained in stages and has stable performance and the same structure as the student model.
[0099] By providing multiple ways to obtain teacher models, the training framework can be flexibly selected according to actual training conditions. The multiple options enhance the adaptability and flexibility of the training framework under different application scenarios and data scales.
[0100] Reference Figure 6 , Figure 6 This is a schematic diagram illustrating the process of updating the parameters of a student model as provided in an embodiment of this application.
[0101] In some embodiments, such as Figure 6 As shown, the process of updating the parameters of the student model based on the student model feature map, the teacher model feature map, and the first recognition result mentioned in step S540 may include steps S610 to S640.
[0102] S610: Determine the cross-stage alignment loss based on the feature maps of the student model and the teacher model.
[0103] Understandably, the cross-stage alignment loss represents the difference between the student model feature map and the teacher model feature map.
[0104] Specifically, the cross-stage alignment loss can be determined based on the feature maps of the student model and the teacher model when they are in the same feature extraction stage or in the same two feature extraction stages.
[0105] S620: Determine the visual task loss based on the first recognition result and the true label. The visual task loss represents the difference between the first recognition result and the true label.
[0106] S630: Determine the total loss based on cross-stage alignment loss and visual task loss.
[0107] S640: Update the parameters of the student model based on the total loss.
[0108] Specifically, the total loss is used in gradient backpropagation, which in turn updates the parameters of the student model.
[0109] Based on steps S610-S640, multiple constraints on the student model are achieved by decomposing the total loss into a joint optimization of cross-stage alignment loss and visual task loss. The cross-stage alignment loss constrains the consistency between the student and teacher models in the feature space, maintaining the stability of the global semantic structure. The visual task loss constrains the discrimination accuracy of the student model on specific tasks. The weighted joint optimization of both ensures that the student model, while pursuing performance on specific tasks, does not deviate too far from the global semantic structure.
[0110] Reference Figure 7 and Figure 8 , Figure 7 This is a schematic diagram of the process for determining cross-stage alignment loss provided in an embodiment of this application. Figure 8 This is a schematic diagram of the framework for determining cross-stage alignment loss provided in an embodiment of this application.
[0111] In some embodiments, such as Figure 7 As shown, the process of determining the cross-stage alignment loss based on the student model feature map and the teacher model feature map mentioned in step S610 may include steps S710 to S730.
[0112] S710: Expand the student model feature map along the spatial dimension to obtain the corresponding two-dimensional feature matrix of the student model, and determine the corresponding first gram matrix based on the two-dimensional feature matrix of the student model.
[0113] Understandably, the first gram matrix is used to represent the global correlation between different channels of the student model feature map.
[0114] S720: Expand the teacher model feature map along the spatial dimension to obtain the corresponding two-dimensional feature matrix of the teacher model, and determine the corresponding second gram matrix based on the two-dimensional feature matrix of the teacher model.
[0115] Understandably, the second gram matrix is used to represent the global correlation between different channels of the teacher model feature map.
[0116] S730: Determine the cross-stage alignment loss based on the first and second gram matrices.
[0117] Specifically, the cross-stage alignment loss can be determined based on the feature maps of the student model and the teacher model in the deep feature extraction stage.
[0118] The following examples and Figure 8 right Figure 7 The corresponding process will be explained.
[0119] When the feature extraction stage comprises four stages, the third and fourth stages can be chosen as alignment targets. Let Fi be the feature maps output by the student model in the third and fourth stages, respectively. s3 and F s4 The feature maps output by the teacher model in the third and fourth feature extraction stages are F, respectively. t3 and F t4 .
[0120] Since the feature map F at any stage can be represented by the dimension C×H×W, where C represents the number of channels, and H and W represent the height and width of the feature map, unfolding this feature map along the spatial dimensions yields a two-dimensional feature matrix of dimension C×HW. Furthermore, the Gram matrix is calculated as: G=F×F T Among them, F T Let F be the transpose of F, and G be the C×C channel correlation matrix. This matrix is used to represent the global correlation between different feature channels.
[0121] Furthermore, the feature map output by the student model in the third feature extraction stage can be determined, and its Gram matrix is: G s3 =F s3 ×F s3 T The feature map output by the student model in the fourth feature extraction stage has a Gram matrix of: G s4 =F s4 ×F s4 T .
[0122] The feature map output by the teacher model in the third feature extraction stage has a Gram matrix of: G t3 =F t3 ×F t3 T The feature map output by the student model in the fourth feature extraction stage has a Gram matrix of: G t4 =F t4 ×F t4 T .
[0123] Then, the cross-stage alignment loss L can be calculated. align For: L align =||G s3 -G t3 ||²+||G s4 -G t4 ||². Where ||·||² represents the squared Euclidean distance or the squared Frobenius norm.
[0124] Then, the total loss L can be calculated. total For: L total =L task +λL align In the formula, L task Let λ represent the visual task loss, and λ be the weighting coefficient of the visual task loss.
[0125] The visual task loss can be determined based on the losses corresponding to each classification task, specifically the losses for image classification, object detection, semantic segmentation, and keypoint detection. Visual task loss L task The calculation formula can be: L task =L cls +L det +L seg +L keypoint In the formula, L cls L det L seg L keypoint denoted as the loss for image classification, object detection, semantic segmentation, and keypoint detection tasks, respectively.
[0126] Understandably, when a training sample does not contain the true label for a certain task, the loss term for that task may not be calculated. For example, for samples containing only object detection tasks, the loss for object detection and cross-stage alignment can be calculated, but the losses for other tasks are not calculated.
[0127] Finally, based on the total loss L total Gradient backpropagation updates the parameters of the student model's backbone visual network and task decoder without updating the teacher model's parameters. The teacher model's parameters are then updated using the three methods illustrated earlier.
[0128] Based on steps S710-S730, the difference between the student model and the teacher model is measured by calculating the Gram matrix of the feature maps. The cross-stage alignment loss is built upon the global correlation between feature channels, rather than directly constraining pixel-by-pixel feature differences. This approach enables the student model to maintain the global semantic structure of the teacher model without destroying the local spatial details required for tasks such as detection and segmentation. It effectively transmits the global semantic structure information from the teacher model, ensuring the student model's correct perception of the overall scene layout and component relationships, and preventing performance degradation due to over-alignment of local details.
[0129] In traditional model training, as models deepen and focus on local details to perform better in dense scene tasks (such as object detection and semantic segmentation), the global logic of high-level semantics (such as logical relationships between devices and translation invariance) degrades with increasing network depth. Feature maps tend to lose high-level spatial layout logic and global semantic continuity. This irreversible degradation of global semantic information leads to a decrease in the model's classification accuracy. Conventional linear weighted loss functions cannot resolve this technical contradiction; forcibly adjusting weights often results in a seesaw effect, where detection accuracy improves while classification accuracy drops significantly, failing to achieve true unified optimization across multiple tasks.
[0130] The model training method employed in this application introduces a cross-stage alignment loss and focuses the student model on the global correlation between channels rather than specific pixel locations. This design establishes a global semantic anchor for the model, optimizing local localization accuracy while forcing the visual backbone network to revert to a stable global information space. This ensures synergistic performance enhancement between the global recognition task and the dense localization task, avoiding the technical defect of mutual performance degradation between tasks.
[0131] Moreover, the model training method adopted in this application can fully utilize the massive amount of unlabeled inspection images in the power transmission and transformation field for feature pre-simulation. Compared with traditional methods that rely on specific labeled data, this scheme theoretically has stronger generalization ability. When faced with image quality degradation caused by drastic changes in lighting and severe weather such as rain, snow, and fog, the model trained through large-scale alignment can exhibit more robust semantic extraction stability, reducing the false alarm rate and false negative rate of the algorithm in actual complex inspection environments.
[0132] This application also provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program segment. The processor loads and executes the instruction or program segment to implement the power transmission and transformation inspection image processing method described in the above embodiments. The specific functions and corresponding technical effects can be found in the explanations of the embodiments corresponding to the power transmission and transformation inspection image processing method described above, and will not be repeated here.
[0133] Now for reference Figure 9 The diagram shown is a block diagram of an electronic device 1200 according to an embodiment of this application. The electronic device 1200 may include one or more processors (corresponding to...) coupled to a controller hub 1203. Figure 9The first processor 1201 is described above. In at least one embodiment, the controller hub 1203 communicates with the first processor 1201 via a multi-branch bus such as a front-side bus (FSB), a point-to-point interface such as a quick path interconnect (QPI), or a similar connection. The first processor 1201 executes instructions that control general types of data processing operations. In one embodiment, the controller hub 1203 includes, but is not limited to, a graphics memory controller hub (GMCH) (not shown) and an input / output hub (IOH) (which may be on a separate chip) (not shown), wherein the GMCH includes memory and a graphics controller and is coupled to the IOH.
[0134] Electronic device 1200 may also include a coprocessor coupled to controller hub 1203 (corresponding to...) Figure 9 The processor 1202 and memory 1204 are integrated within the processor (as described in this application). Alternatively, one or both of the memory and GMCH can be integrated within the processor (as described in this application), with memory 1204 and the first coprocessor 1202 directly coupled to the first processor 1201 and the controller hub 1203, which is located on a single chip with the IOH. Memory 1204 can be, for example, dynamic random access memory (DRAM), phase change memory (PCM), or a combination of both. In one embodiment, the first coprocessor 1202 is a dedicated processor, such as a high-throughput MIC processor (many integerized core, MIC), a network or communication processor, a compression engine, a graphics processor, a general-purpose computing on GPU (GPGPU), or an embedded processor, etc. Optional properties of the first coprocessor 1202 are indicated by dashed lines. Figure 9 middle.
[0135] As a computer-readable storage medium, memory 1204 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. For example, memory 1204 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device such as one or more hard-disk drives (HDDs), one or more compact disc (CD) drives, and / or one or more digital versatile disc (DVD) drives.
[0136] In one embodiment, electronic device 1200 may further include a network interface controller (NIC) 1206. Network interface 1206 may include a transceiver for providing a radio interface for electronic device 1200 to communicate with any other suitable device, such as a front-end module, antenna, etc. In various embodiments, network interface 1206 may be integrated with other components of electronic device 1200. Network interface 1206 can implement the functions of the communication unit in the above embodiments.
[0137] Electronic device 1200 may further include input / output (I / O) device 1205. I / O device 1205 may include: a user interface designed to enable a user to interact with electronic device 1200; a peripheral component interface designed to enable peripheral components to also interact with electronic device 1200; and / or sensors designed to determine environmental conditions and / or location information related to electronic device 1200.
[0138] It is worth noting that, Figure 9 This is merely an example. That is, although... Figure 9 The electronic device 1200 shown includes multiple devices such as a first processor 1201, a first coprocessor 1202, a controller hub 1203, and a memory 1204. However, in actual applications, devices using the methods of this application may include only a portion of the devices in the electronic device 1200. For example, it may include only the first processor 1201 and the network interface 1206. Figure 9 The properties of the optional devices are shown in dashed lines. According to some embodiments of this application, the memory 1204, which is a computer-readable storage medium, stores instructions that, when executed on a computer, cause the electronic device 1200 to perform the power transmission and transformation inspection image processing method according to the above embodiments. For details, please refer to the methods in the above embodiments, which will not be repeated here.
[0139] Now for reference Figure 10The diagram shown is a block diagram of a SoC 1300 (system on chip) according to an embodiment of this application. Figure 10 In the diagram, similar components share the same reference numerals. Additionally, dashed boxes are an optional feature for more advanced SoCs. Figure 10 In the SoC1300, interconnect unit 1350 is coupled to the processor (corresponding to...). Figure 10 The system includes a second processor 1310, a system agent unit 1380, a bus controller unit 1390, an integrated memory controller unit 1340, and one or more coprocessors (corresponding to...). Figure 10 The second coprocessor 1320 may include integrated graphics logic, an image processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 1330; and a direct memory access (DMA) unit 1360. In one embodiment, the second coprocessor 1320 includes a dedicated processor, such as a network or communication processor, a compression engine, a GPGPU, a high-throughput MIC processor, or an embedded processor.
[0140] The static random access memory (SRAM) cell 1330 may include one or more computer-readable media for storing data and / or instructions. The computer-readable storage medium may store instructions, specifically, temporary and permanent copies of those instructions. These instructions may include, when executed by at least one unit in the processor, causing the SoC 1300 to perform the power transmission and transformation inspection image processing method according to the above embodiments, specifically referring to the methods in the above embodiments, which will not be repeated here.
[0141] Various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or combinations of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0142] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. Furthermore, including structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0143] This application also provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement the power transmission and transformation inspection image processing method as described in the above embodiments. The specific functions and corresponding technical effects can be found in the explanations of the embodiments corresponding to the power transmission and transformation inspection image processing method described above, and will not be repeated here.
[0144] This application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are loaded and executed by a processor, they implement the power transmission and transformation inspection image processing method described in the above embodiments. The specific functions and corresponding technical effects can be found in the explanations of the embodiments corresponding to the power transmission and transformation inspection image processing method described above, and will not be repeated here.
[0145] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0146] It should be noted that in the examples and description of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0147] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.
Claims
1. A method for image processing in power transmission and transformation inspection, characterized in that, include: Acquire images of power transmission and transformation inspections; The inspection image is input into a pre-trained recognition model; the recognition model includes a preprocessing layer, a visual backbone network, a feature fusion layer, and multiple task decoders. Based on the preprocessing layer, the inspection image is processed to obtain views at different scales; Based on the visual backbone network, features are extracted from the views at different scales, and the feature extraction results are obtained. Based on the feature fusion layer, the feature extraction results are fused to obtain the fused features; The fused features are identified based on multiple task decoders, and the identification results corresponding to the various identification tasks are output respectively. The training process of the recognition model includes: Construct a student model and a teacher model; wherein, the student model and the teacher model each include the preprocessing layer, a visual backbone network, a feature fusion layer and multiple task decoders, and the visual backbone network of the student model and the teacher model each includes multiple feature extraction stages with progressively deeper feature abstraction levels; The first training sample image is input into the student model to obtain the student model feature map output by at least one feature extraction stage of the visual backbone network of the student model, and the first recognition result output by the task decoder of the student model. Input the second training sample image into the teacher model to obtain the teacher model feature map output by at least one feature extraction stage of the visual backbone network of the teacher model; Based on the student model feature map, the teacher model feature map, and the first recognition result, the parameters of the student model are updated to train the student model; the student model after training is the recognition model.
2. The image processing method for power transmission and transformation inspection according to claim 1, characterized in that, The visual backbone network includes multiple feature extraction stages with progressively deeper levels of feature abstraction. Based on the visual backbone network, features are extracted from the views at different scales, and the feature extraction results are obtained, including: In the first feature extraction stage of the visual backbone network, features are extracted from the views at different scales, and a first feature map is output. The second feature extraction stage of the visual backbone network receives the first feature map output by the first feature extraction stage, performs feature extraction based on the first feature map, and outputs the corresponding second feature map. Each subsequent feature extraction stage of the visual backbone network receives the feature map output from the previous feature extraction stage, performs feature extraction based on the feature map output from the previous feature extraction stage, and outputs the feature map corresponding to the current feature extraction stage; the feature maps output by each feature extraction stage of the visual backbone network are the feature extraction results.
3. The image processing method for power transmission and transformation inspection according to claim 2, characterized in that, Each of the aforementioned feature extraction stages includes a self-attention module for branching out. The diversion self-attention module is used for: The input feature map is divided into multiple sub-feature branches along the channel dimension; Each of the sub-feature branches is used to generate a query vector, a key vector, and a value vector, respectively; and different sub-feature branches use different spatial sampling scales for feature extraction when generating the key vector and the value vector. Based on the query vector, key vector, and value vector generated by each sub-feature branch, the feature map corresponding to the current feature extraction stage is determined.
4. The image processing method for power transmission and transformation inspection according to claim 1, characterized in that, Based on the student model feature map, the teacher model feature map, and the first recognition result, the parameters of the student model are updated, including: Based on the student model feature map and the teacher model feature map, a cross-stage alignment loss is determined; the cross-stage alignment loss represents the difference between the student model feature map and the teacher model feature map. Based on the first recognition result and the real label, the visual task loss is determined; the visual task loss represents the difference between the first recognition result and the real label. The total loss is determined based on the cross-stage alignment loss and the visual task loss. The parameters of the student model are updated based on the total loss.
5. The image processing method for power transmission and transformation inspection according to claim 4, characterized in that, Based on the student model feature map and the teacher model feature map, the cross-stage alignment loss is determined, including: The student model feature map is expanded along the spatial dimension to obtain the corresponding two-dimensional feature matrix of the student model, and the corresponding first gram matrix is determined based on the two-dimensional feature matrix of the student model. The teacher model feature map is expanded along the spatial dimension to obtain the corresponding two-dimensional feature matrix of the teacher model, and the corresponding second gram matrix is determined based on the two-dimensional feature matrix of the teacher model. The cross-stage alignment loss is determined based on the first gram matrix and the second gram matrix.
6. The image processing method for power transmission and transformation inspection according to claim 1, characterized in that, The teacher model is determined based on any of the following methods: The student model with the optimal parameters during training will be used as the teacher model; or... Based on the parameters of the student model during training, the parameters of the initial teacher model are updated to determine the teacher model; or, The pre-trained model is used as the teacher model.
7. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the power transmission and transformation inspection image processing method as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the power transmission and transformation inspection image processing method as described in any one of claims 1-6.
9. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the power transmission and transformation inspection image processing method according to any one of claims 1-6.
