Transformer substation inspection image optimization method and device, terminal and medium
By generating degenerated thermal images and optimizing image features using the conditional causal attention module, the problem of image clarity reduction during substation inspection is solved, and higher quality image monitoring and defect recognition are achieved.
Patent Information
- Application Number
- CN202510708724.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-29
AI Technical Summary
During substation inspection, complex environmental factors and hardware deterioration lead to a decrease in image acquisition clarity, affecting the accuracy and reliability of image monitoring.
By acquiring the characteristics of the inspection image, degenerated thermal images are generated, and the conditional causal attention module is fused with the thermogram mask to generate weighted degenerated image features, and the image restoration model is used for optimization processing to improve image quality.
It improves the accuracy and reliability of image monitoring in the substation and achieves more accurate inspection defect identification.
Smart Images

Figure CN120564084A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power system inspection technology, and in particular to a substation inspection image optimization method, device, terminal and medium. Background Art
[0002] In modern power systems, substations are key nodes for power conversion and distribution, and the stable operation of their equipment is crucial. With the development of artificial intelligence and image processing technologies, using cameras and drones to capture substation images and then monitor equipment status through image analysis has become an efficient and common method.
[0003] However, in actual applications, complex environmental factors and hardware degradation of inspection equipment will affect image acquisition, interfere with image clarity, and cause inspection image degradation. These image degradation situations will affect the accuracy and reliability of image monitoring in substations. Summary of the Invention
[0004] The present application provides a substation inspection image optimization method, device, terminal and medium for achieving the invention purpose of improving the accuracy and reliability of image monitoring within the substation.
[0005] To solve the above technical problems, the first aspect of the present application provides a substation inspection image optimization method, comprising:
[0006] Acquire inspection images to be optimized;
[0007] extracting image features of the inspection image, and determining a degradation type of the inspection image based on the image features;
[0008] generating a degraded thermal image corresponding to the inspection image according to the image features, wherein the degraded thermal image is used to reflect the degree of degradation of different areas in the inspection image;
[0009] Based on an image restoration model including a conditional causal attention module, the degradation type is fused with a heat map mask using conditional causal attention to generate weighted degraded image features, wherein the heat map mask is mask data obtained by converting the degraded thermal image;
[0010] Based on the weighted degraded image features, the inspection image is restored and optimized through the image restoration model to obtain an optimized inspection image, so as to perform inspection defect identification based on the optimized inspection image.
[0011] Preferably, generating the degraded thermal image corresponding to the inspection image specifically includes:
[0012] Calculating an image gradient of the inspection image according to the image features, wherein the image gradient is probability data of the inspection image belonging to different degradation types;
[0013] Calculating the relative gradient of the image gradient relative to each pixel point in the inspection image;
[0014] Performing global average pooling on the relative gradient in the channel dimension, and then performing weighted summation on the relative gradient after global average pooling and the image feature to obtain a weighted image feature;
[0015] After performing activation function and normalization processing on the weighted image features, sampling is performed through bilinear interpolation according to the size parameters of the inspection image to obtain a degraded thermal image corresponding to the inspection image.
[0016] Preferably, the image restoration model including the conditional causal attention module performs conditional causal attention fusion on the degradation type and the heat map mask to generate weighted degraded image features, specifically comprising:
[0017] Based on the conditional causal attention module in the image restoration model, the input degradation type and degraded thermal image are nonlinearly transformed through the MLP layer in the conditional causal attention module to obtain QKV features, where the Q feature is the query vector feature associated with the degradation type, and the K feature and the V feature are the key vector feature and value vector feature associated with the degraded thermal image;
[0018] According to the degradation type, the Q feature is expanded into a feature matrix of a preset dimension specification, and then the Q feature is matrix multiplied with the transposed matrix of the K feature to obtain a similarity score;
[0019] Adding the similarity score to the binarized degraded thermal image to obtain a thermal map mask;
[0020] The heat map mask and the V feature are expanded to a preset dimension specification through repeat processing, and then the heat map mask and the V feature are dot-multiplied to obtain a weighted degraded image feature.
[0021] Preferably, determining the degradation type of the inspection image according to the image features specifically includes:
[0022] The image features are input into a preset image degradation classification model to determine the degradation type of the inspection image through calculation of the image degradation classification model.
[0023] Preferably, before performing conditional causal attention fusion on the degradation type and the heat map mask, the method further includes:
[0024] The degradation type is encoded, and then the encoded degradation type information is subjected to feature mapping through three linear layers to convert the degradation type information into a feature representation that is compatible with the image restoration model.
[0025] A second aspect of the present application provides a substation inspection image optimization device, comprising:
[0026] An image acquisition unit, used for acquiring an inspection image to be optimized;
[0027] an image degradation type determination unit, configured to extract image features of the inspection image and determine the degradation type of the inspection image based on the image features;
[0028] a degradation thermodynamic image generating unit, configured to generate a degradation thermodynamic image corresponding to the inspection image according to the image features, wherein the degradation thermodynamic image is used to reflect the degree of degradation of different areas in the inspection image;
[0029] a degraded image feature processing unit configured to perform conditional causal attention fusion on the degradation type and the heat map mask based on an image restoration model including a conditional causal attention module to generate weighted degraded image features, wherein the heat map mask is mask data obtained by converting the degraded thermal image;
[0030] The degraded image optimization processing unit is used to perform restoration optimization processing on the inspection image based on the weighted degraded image features through the image restoration model to obtain an optimized inspection image, so as to perform inspection defect identification based on the optimized inspection image.
[0031] Preferably, the degradation heat map generating unit is specifically used to:
[0032] Calculating an image gradient of the inspection image according to the image features, wherein the image gradient is probability data of the inspection image belonging to different degradation types;
[0033] Calculating the relative gradient of the image gradient relative to each pixel point in the inspection image;
[0034] Performing global average pooling on the relative gradient in the channel dimension, and then performing weighted summation on the relative gradient after global average pooling and the image feature to obtain a weighted image feature;
[0035] After performing activation function and normalization processing on the weighted image features, sampling is performed through bilinear interpolation according to the size parameters of the inspection image to obtain a degraded thermal image corresponding to the inspection image.
[0036] Preferably, the degraded image feature processing unit is specifically used to:
[0037] Based on the conditional causal attention module in the image restoration model, the input degradation type and degraded thermal image are nonlinearly transformed through the MLP layer in the conditional causal attention module to obtain QKV features, where the Q feature is the query vector feature associated with the degradation type, and the K feature and the V feature are the key vector feature and value vector feature associated with the degraded thermal image;
[0038] According to the degradation type, the Q feature is expanded into a feature matrix of a preset dimension specification, and then the Q feature is matrix multiplied with the transposed matrix of the K feature to obtain a similarity score;
[0039] Adding the similarity score to the binarized degraded thermal image to obtain a thermal map mask;
[0040] The heat map mask and the V feature are expanded to a preset dimension specification through repeat processing, and then the heat map mask and the V feature are dot-multiplied to obtain a weighted degraded image feature.
[0041] A third aspect of the present application provides a substation inspection image optimization terminal, comprising: a memory and a processor;
[0042] The memory is used to store program code, and the program code is used to implement a substation inspection image optimization method provided in the first aspect of the present application;
[0043] The processor is configured to read and execute the program code.
[0044] The fourth aspect of the present application provides a computer-readable storage medium, in which program code is stored. The program code is used to be read and executed by a processor to implement a substation inspection image optimization method as provided in the first aspect of the present application.
[0045] It can be seen from the above technical solutions that this application has the following advantages:
[0046] The solution provided in this application determines the degradation type through an image quality estimation module and generates a degraded thermal image of the corresponding degradation type. The thermal image of the image degradation type is then introduced as a dynamic spatial mask through a conditional causal attention mechanism to constrain the perception range of different degradation types in the cross-attention mechanism, so that the model can focus on local areas related to specific degradation in a targeted manner, avoid feature interference between multiple degradation conditions, and enable the image restoration model to effectively repair different degradation types. Finally, the enhanced high-quality image is input into the defect analysis module to obtain more accurate defect identification, thereby achieving the invention purpose of improving the accuracy and reliability of image monitoring within the substation. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] Figure 1 This is a schematic diagram of the overall process of substation image inspection.
[0049] Figure 2 A flowchart of an embodiment of a substation inspection image optimization method provided in this application.
[0050] Figure 3 This is a logic block diagram of substation inspection image optimization provided in this application.
[0051] Figure 4 Schematic diagram of the comparison of the degraded inspection image, degraded thermal image, superimposed image, and restored image.
[0052] Figure 5 This is a structural diagram of an embodiment of a substation inspection image optimization device provided in this application.
[0053] Figure 6 This is a structural diagram of an embodiment of a substation inspection image optimization terminal provided in this application. DETAILED DESCRIPTION
[0054] The embodiments of the present application provide a substation inspection image optimization method, device, terminal and medium for achieving the invention purpose of improving the accuracy and reliability of image monitoring within the substation.
[0055] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0056] See also Figure 1 and Figure 2 , this application provides an embodiment of a substation inspection image optimization method, comprising:
[0057] Step 101: Acquire an inspection image to be optimized;
[0058] It should be noted that inspection images must first be acquired. Specifically, drones fly over the substation along a pre-set inspection route, using high-definition cameras to capture equipment images from multiple angles. HD cameras positioned at key locations continuously capture equipment images. The captured image data is transmitted in real time to subsequent processing modules.
[0059] Step 102: extract image features of the inspection image, and determine the degradation type of the inspection image based on the image features;
[0060] It should be noted that based on the inspection images obtained in the previous step, image features of these inspection images are extracted. Specifically, image data transmitted by the image acquisition module is received and evaluated using a deep learning-based image quality estimation model. The image is first input into the encoder to extract image features, and then the decoder is used to classify the image features into degradation types (uneven illumination, noise, blur, etc.). During training, the BCE loss is used for supervision to adapt to the situation where a single image may exhibit multiple degradation types. If the image quality is good and there is no degradation, the image is directly used for recognition. If image degradation is detected, the subsequent steps are continued to restore and optimize the degraded inspection image.
[0061] Step 103: Generate a degraded thermal image corresponding to the inspection image, wherein the degraded thermal image is used to reflect the degree of degradation of different areas in the inspection image;
[0062] It should be noted that, based on the image features, this patent uses the class gradient back propagation technology to obtain the degraded thermal image corresponding to the image degradation type. .
[0063] More specifically, the generation process of the degraded thermal image in step 103 includes:
[0064] Calculating the image gradient of the inspection image according to the image features, wherein the image gradient is the probability data of the inspection image belonging to different degradation types;
[0065] Calculate the relative gradient of the image gradient relative to each pixel in the inspection image;
[0066] It should be noted that, first, the gradient of the input image is calculated, that is, for each degradation type probability value predicted by the model, its relative gradient relative to each pixel in the image is calculated.
[0067] The relative gradient is globally averaged pooled in the channel dimension, and then the relative gradient after global average pooling is weighted summed with the image features to obtain the weighted image features;
[0068] It should be noted that the gradient value after global average pooling is weighted and summed with the output feature map of the last convolutional layer in the model, so that the channel that contributes most to the final prediction occupies a more important position in the feature map.
[0069] After the weighted image features are activated and normalized, they are sampled by bilinear interpolation according to the size parameters of the inspection image to obtain the degraded thermal image corresponding to the inspection image.
[0070] It should be noted that the result of the weighted summation is processed with the ReLU activation function to ensure that the value is non-negative, and then its value is normalized to ensure that the value range is between [0, 1].
[0071] Upsample to the same size as the original image through bilinear interpolation to obtain the category heat map , whose dimensions are .in Refers to the number of images when the model performs one inference. refers to the length of the original image, Refers to the width of the original image, Refers to the number of image degradation types supported by the image quality estimation model. Take the inversion to get the final category heat map , which represents the area where this type of degradation appears in the image. Figure 4 As shown in the figure, the redder the category heat map, the less severe the degradation, and the bluer it is, the more severe the degradation area.
[0072] Step 104: Based on the image restoration model including the conditional causal attention module, the degradation type and the heat map mask are fused with conditional causal attention to generate weighted degraded image features;
[0073] Among them, the heat map mask is the mask data obtained based on the conversion of the degraded thermal image;
[0074] It should be noted that after receiving the degraded image and the corresponding degradation type information (using noise as an example), the degradation type is first encoded. The encoded information is then passed through three "Linear" layers for feature mapping, converting it into a feature representation compatible with a general-purpose restoration model (existing general-purpose restoration models are based on CNNs (convolutional neural networks), diffusion models, or GANs (generative adversarial networks)). These features are then fused with the features from the general-purpose restoration model's encoder and the mask formed by the category heatmap using conditional causal attention. This generates weighted degraded image features for subsequent image restoration tasks, ultimately outputting the restored image to the image defect analysis module.
[0075] More specifically, if Figure 3 As shown, the conditional causal attention mechanism proposed in this embodiment introduces a heat map of image degradation types (Grad-CAM) as a dynamic spatial mask to constrain the perception range of different degradation types (such as blur, noise, and artifacts) in the cross-attention mechanism. This allows the model to focus on local areas related to specific degradations and avoid feature interference between multiple degradation conditions. The specific operating mechanism is shown in the following example:
[0076] After passing through the MLP layer (multi-layer perceptron, which consists of multiple fully connected layers and is used to perform nonlinear transformation on the input features), the features Q (query vector), K (key vector), and V (value vector) are obtained. At this time, the feature dimension of Q is , the feature dimension of K is , the characteristic dimension of V is .in Refers to the number of images when the model performs one inference. Refers to the length of the feature map at this time, Refers to the width of the feature map at this time, Refers to the intermediate feature dimension, the intermediate feature dimension It is the transition dimension obtained after the MLP layer transformation, which is used to balance the amount of computation and the model expression ability while ensuring the effective representation of feature information. Refers to the basic dimension of the output feature and the subsequent multiplication of the number of categories to obtain the dimension of the final output feature. Refers to the number of degradation types provided by the image quality estimation module.
[0077] Then the Q feature will expand its own dimension according to the degradation type , for defects that are not identified, fill in a dimension of The full zero vector, and then the transposed matrix of Q feature and K feature is multiplied to get the similarity score, which is consistent with the category heat map Before adding, the category heat map needs to be binarized to ensure that the values are 0 and 1, and then multiplied by a very small number such as .
[0078] The mask score dimension after adding the similarity score and the category heat map is , use Softmax to normalize, and then repeat the matrix to expand it to And for dimension V, the repeat operation is also used to expand its dimension and transpose it, and the final dimension is .
[0079] The expanded feature V and the mask score are combined by point multiplication to obtain the weighted degraded image feature, which is then imported into the feature map of the forward calculation main path of the encoder of the general type restoration model in the form of channel splicing.
[0080] Step 105 : Based on the weighted degraded image features, the inspection image is restored and optimized using an image restoration model to obtain an optimized inspection image, so as to perform inspection defect recognition based on the optimized inspection image.
[0081] Finally, the processed degraded image features are used to restore and optimize the inspection image through the image restoration model to obtain the optimized inspection image, so that inspection defects can be identified based on the optimized inspection image, thereby improving the accuracy of substation inspection defect detection.
[0082] The solution provided in the embodiment of the present application determines the degradation type through an image quality estimation module and generates a degraded thermal image of the corresponding degradation type. The thermal image of the image degradation type is then introduced as a dynamic spatial mask through a conditional causal attention mechanism to constrain the perception range of different degradation types in the cross-attention mechanism, so that the model can focus on local areas related to specific degradation in a targeted manner, avoid feature interference between multiple degradation conditions, and enable the image restoration model to effectively repair different degradation types. Finally, the enhanced high-quality image is input into the defect analysis module to obtain more accurate defect identification, thereby achieving the invention purpose of improving the accuracy and reliability of image monitoring within the substation.
[0083] The above is a detailed description of an embodiment of a substation inspection image optimization method provided by the present application. The following is a detailed description of an embodiment of a substation inspection image optimization device provided by the present application.
[0084] See also Figure 5 , the present application provides an embodiment of a substation inspection image optimization device, comprising:
[0085] An image acquisition unit 201 is used to acquire an inspection image to be optimized;
[0086] The image degradation type determination unit 202 is used to extract image features of the inspection image and determine the degradation type of the inspection image based on the image features;
[0087] The degradation thermographic generation unit 203 is configured to generate a degradation thermographic image corresponding to the inspection image based on the image features, wherein the degradation thermographic image is configured to reflect the degree of degradation of different regions in the inspection image;
[0088] A degraded image feature processing unit 204 is configured to perform conditional causal attention fusion on the degradation type and the heat map mask based on an image restoration model including a conditional causal attention module to generate weighted degraded image features, wherein the heat map mask is mask data obtained by converting the degraded thermal image.
[0089] The degraded image optimization processing unit 205 is used to perform restoration optimization processing on the inspection image based on the weighted degraded image features through the image restoration model to obtain an optimized inspection image, so as to perform inspection defect identification based on the optimized inspection image.
[0090] Preferably, the degradation heat map generating unit 203 is specifically configured to:
[0091] Calculating the image gradient of the inspection image according to the image features, wherein the image gradient is the probability data of the inspection image belonging to different degradation types;
[0092] Calculate the relative gradient of the image gradient relative to each pixel in the inspection image;
[0093] The relative gradient is globally averaged pooled in the channel dimension, and then the relative gradient after global average pooling is weighted summed with the image features to obtain the weighted image features;
[0094] After the weighted image features are activated and normalized, they are sampled by bilinear interpolation according to the size parameters of the inspection image to obtain the degraded thermal image corresponding to the inspection image.
[0095] Preferably, the degraded image feature processing unit 204 is specifically configured to:
[0096] Based on the conditional causal attention module in the image restoration model, the input degradation type and degraded thermal image are nonlinearly transformed through the MLP layer in the conditional causal attention module to obtain QKV features, where Q feature is the query vector feature associated with the degradation type, K feature and V feature are the key vector feature and value vector feature associated with the degraded thermal image;
[0097] According to the degradation type, the Q feature is expanded into a feature matrix of preset dimension specifications, and then the Q feature is matrix multiplied with the transposed matrix of the K feature to obtain the similarity score;
[0098] Add the similarity score to the binarized degraded thermal image to obtain the thermal map mask;
[0099] Through repeat processing, the heat map mask and V features are expanded to the preset dimension specifications, and then the heat map mask and V features are dot-multiplied to obtain the weighted degraded image features.
[0100] like Figure 6 As shown, the present application provides an embodiment of a substation inspection image optimization terminal. The terminal implementation types include but are not limited to: personal computers, industrial computers, servers and embedded intelligent devices. The terminal mainly comprises: a memory 33 and a processor 31, wherein the memory 33 and the processor 31 can be connected via a communication bus 34;
[0101] The memory 33 is used to store program codes, and the program codes are used to implement a substation inspection image optimization method provided in the above embodiment;
[0102] The processor 31 is used to read and execute program codes.
[0103] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored. The program code is used to be read and executed by a processor to implement a substation inspection image optimization method as provided in the above embodiment.
[0104] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the terminals, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0105] In the several embodiments provided in this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0106] The terms "first," "second," "third," "fourth," and the like (if any) in the specification of the present application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present application described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.
[0107] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0108] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0109] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0110] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0111] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A substation inspection image optimization method, characterized in that: include: Acquire inspection images to be optimized; extracting image features of the inspection image, and determining a degradation type of the inspection image based on the image features; generating a degraded thermal image corresponding to the inspection image according to the image features, wherein the degraded thermal image is used to reflect the degree of degradation of different areas in the inspection image; Based on an image restoration model including a conditional causal attention module, the degradation type is fused with a heat map mask using conditional causal attention to generate weighted degraded image features, wherein the heat map mask is mask data obtained by converting the degraded thermal image; Based on the weighted degraded image features, the inspection image is restored and optimized through the image restoration model to obtain an optimized inspection image, so as to perform inspection defect identification based on the optimized inspection image.
2. A substation inspection image optimization method according to claim 1, characterized in that: Generating the degraded thermal image corresponding to the inspection image specifically includes: Calculating an image gradient of the inspection image according to the image features, wherein the image gradient is probability data of the inspection image belonging to different degradation types; Calculating the relative gradient of the image gradient relative to each pixel point in the inspection image; Performing global average pooling on the relative gradient in the channel dimension, and then performing weighted summation on the relative gradient after global average pooling and the image feature to obtain a weighted image feature; After performing activation function and normalization processing on the weighted image features, sampling is performed through bilinear interpolation according to the size parameters of the inspection image to obtain a degraded thermal image corresponding to the inspection image.
3. A substation inspection image optimization method according to claim 1, characterized in that: The image restoration model including the conditional causal attention module performs conditional causal attention fusion on the degradation type and the heat map mask to generate weighted degraded image features, specifically including: Based on the conditional causal attention module in the image restoration model, the input degradation type and degraded thermal image are nonlinearly transformed through the MLP layer in the conditional causal attention module to obtain QKV features, where the Q feature is the query vector feature associated with the degradation type, and the K feature and the V feature are the key vector feature and value vector feature associated with the degraded thermal image; According to the degradation type, the Q feature is expanded into a feature matrix of a preset dimension specification, and then the Q feature is matrix multiplied with the transposed matrix of the K feature to obtain a similarity score; Adding the similarity score to the binarized degraded thermal image to obtain a thermal map mask; The heat map mask and the V feature are expanded to a preset dimension specification through repeat processing, and then the heat map mask and the V feature are dot-multiplied to obtain a weighted degraded image feature.
4. A substation inspection image optimization method according to claim 1, characterized in that: Determining the degradation type of the inspection image according to the image feature specifically includes: The image features are input into a preset image degradation classification model to determine the degradation type of the inspection image through calculation of the image degradation classification model.
5. The substation inspection image optimization method according to claim 1, characterized in that: Before the conditional causal attention fusion of the degradation type and the heat map mask, it also includes: The degradation type is encoded, and then the encoded degradation type information is subjected to feature mapping through three linear layers to convert the degradation type information into a feature representation that is compatible with the image restoration model.
6. A substation inspection image optimization device, characterized in that: include: An image acquisition unit, used for acquiring an inspection image to be optimized; an image degradation type determination unit, configured to extract image features of the inspection image and determine the degradation type of the inspection image based on the image features; a degradation thermodynamic image generating unit, configured to generate a degradation thermodynamic image corresponding to the inspection image according to the image features, wherein the degradation thermodynamic image is used to reflect the degree of degradation of different areas in the inspection image; a degraded image feature processing unit configured to perform conditional causal attention fusion on the degradation type and the heat map mask based on an image restoration model including a conditional causal attention module to generate weighted degraded image features, wherein the heat map mask is mask data obtained by converting the degraded thermal image; The degraded image optimization processing unit is used to perform restoration optimization processing on the inspection image based on the weighted degraded image features through the image restoration model to obtain an optimized inspection image, so as to perform inspection defect identification based on the optimized inspection image.
7. The substation inspection image optimization device according to claim 6, characterized in that: The degradation heat map generating unit is specifically used for: Calculating an image gradient of the inspection image according to the image features, wherein the image gradient is probability data of the inspection image belonging to different degradation types; Calculating the relative gradient of the image gradient relative to each pixel point in the inspection image; Performing global average pooling on the relative gradient in the channel dimension, and then performing weighted summation on the relative gradient after global average pooling and the image feature to obtain a weighted image feature; After performing activation function and normalization processing on the weighted image features, sampling is performed through bilinear interpolation according to the size parameters of the inspection image to obtain a degraded thermal image corresponding to the inspection image.
8. The substation inspection image optimization device according to claim 6, characterized in that: The degraded image feature processing unit is specifically used for: Based on the conditional causal attention module in the image restoration model, the input degradation type and degraded thermal image are nonlinearly transformed through the MLP layer in the conditional causal attention module to obtain QKV features, where the Q feature is the query vector feature associated with the degradation type, and the K feature and the V feature are the key vector feature and value vector feature associated with the degraded thermal image; According to the degradation type, the Q feature is expanded into a feature matrix of a preset dimension specification, and then the Q feature is matrix multiplied with the transposed matrix of the K feature to obtain a similarity score; Adding the similarity score to the binarized degraded thermal image to obtain a thermal map mask; The heat map mask and the V feature are expanded to a preset dimension specification through repeat processing, and then the heat map mask and the V feature are dot-multiplied to obtain a weighted degraded image feature.
9. A substation inspection image optimization terminal, characterized in that: include: memory and processor; The memory is used to store program code, and the program code is used to implement the substation inspection image optimization method according to any one of claims 1 to 5; The processor is configured to read and execute the program code.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program code, and the program code is used to be read and executed by a processor to implement the substation inspection image optimization method according to any one of claims 1 to 5.
Citation Information
Cited By
Aerodynamic optical effect degraded image restoration method
CN121304496A
Circuit maintenance fault performance detection method and system
CN122109794A