A method for processing internal defects of high-voltage distribution cabinet images
By using adaptive gated residual blocks and image restoration modules in the internal defect image processing method of high-voltage distribution cabinet, the problems of low efficiency and poor reliability of traditional inspection methods are solved, and efficient and accurate defect detection is achieved. Improve image quality and detection efficiency and ensure the safety of the power system.
Patent Information
- Application Number
- CN202411116924.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Traditional manual inspection methods are low efficiency, poor reliability and low safety in high-voltage distribution cabinet defect detection, making it difficult to meet the image quality requirements of internal defects of high-voltage distribution cabinets, especially under different lighting conditions.
A method of internal defect image processing for high-voltage distribution cabinets is designed, including first-order image generation module, image conversion module and enhanced image generation module, through adaptive layer number of gated residual blocks, denoising units, image restoration modules and HSV color space conversion generates high-quality internal defect images of high-voltage distribution cabinets, enhancing details and brightness.
It significantly improves image quality and detection accuracy, reduces noise in low-light environments, improves detection efficiency and visual effects, supports the combination of multiple detection methods, and ensures the safe and reliable operation of the power system.
Smart Images

Figure CN118644414B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image enhancement, and in particular relates to a method for processing internal defect images of a high-voltage distribution cabinet. Background Art
[0002] High-voltage distribution cabinets play a vital role in the power system and are responsible for distributing power and controlling the operation of power equipment. With the development of the power system, the number and complexity of high-voltage distribution cabinets continue to increase, and efficient and accurate defect detection and processing have become particularly important. When defects occur inside the high-voltage distribution cabinet, they are often accompanied by safety hazards. Traditional manual inspection methods have problems such as low efficiency, poor reliability, and low safety. Therefore, high-voltage distribution cabinet defect detection methods based on image processing technology have gradually become a research hotspot.
[0003] High-voltage distribution cabinet defect detection has high requirements on the quality of high-voltage distribution cabinet defect images. The development of image enhancement technology provides new methods and means for high-voltage distribution cabinet defect detection. By enhancing the internal defect images of high-voltage distribution cabinets, the image quality can be significantly improved, the detail information can be enhanced, the edge detection effect can be improved, the performance of the automatic detection algorithm can be improved, it can adapt to different lighting conditions, assist manual inspection, and support the combination of multiple detection methods, which can effectively improve the accuracy and efficiency of high-voltage distribution cabinet defect detection and ensure the safe and reliable operation of the power system. Summary of the invention
[0004] The present invention provides a method for processing internal defect images of a high-voltage distribution cabinet, which aims to process internal defect images of a high-voltage distribution cabinet under different lighting conditions through efficient and accurate image processing technology to enhance detail information. The method for processing internal defect images of a high-voltage distribution cabinet comprises the following steps:
[0005] S1. Preparation of internal defect image dataset of high-voltage distribution cabinet. Use industrial camera to shoot the interior of defective high-voltage distribution cabinet, obtain defect images of high-voltage distribution cabinet under different lighting conditions, and construct internal defect image dataset of high-voltage distribution cabinet.
[0006] S2. Construct a first-order image generation module FOIG, including an encoder and a decoder. The encoder is composed of a gated residual block with an adaptive number of layers and a denoising unit DU. The decoder is composed of a deconvolution layer. Feature extraction and downsampling operations are completed in the encoder, and upsampling operations are completed in the decoder to generate a first-order internal defect image of a high-voltage distribution cabinet.
[0007] S3. Construct a second-order image generation module SOIG, including an encoder, a decoder and an image restoration module. The encoder is composed of a convolutional layer, and the decoder is composed of a convolutional layer. Feature extraction and multi-scale feature fusion are completed in the encoder. The decoder contains two branches for generating an intermediate image and an illumination map. The intermediate image and the illumination map are used to generate a second-order internal defect image of the high-voltage distribution cabinet through the image restoration module;
[0008] S4, constructing an image conversion module ICVM, converting the generated second-order high-voltage distribution cabinet internal defect image into a high-voltage distribution cabinet internal defect conversion image in the HSV color space through the image conversion module;
[0009] S5, constructing a third-order generation module TOIG, using the generated first-order high-voltage distribution cabinet internal defect image to replace the V channel of the high-voltage distribution cabinet internal defect conversion image, to generate a third-order high-voltage distribution cabinet internal defect image;
[0010] S6, constructing an enhanced image generation module ENIG to convert the internal defect image of the third-order high-voltage distribution cabinet into an enhanced internal defect image of the high-voltage distribution cabinet in RGB color space;
[0011] S7. Construct a high-voltage distribution cabinet internal defect image processing model, including input, a first-order image generation module, a second-order image generation module, an image conversion module, a third-order image generation module, an enhanced image generation module and an output.
[0012] Preferably, in step S2, the number of layers of the gated residual block in the encoder of the first-order image generation module is determined by the gating mechanism, and a gating unit is added in the gated residual block to determine whether to activate the gated residual block. The gating unit calculates the activation probability through a convolutional layer and a Sigmoid function. If the activation probability exceeds a set threshold, the gated residual block is activated and subsequent operations of the gated residual block are executed, otherwise it is skipped, and a gating mechanism is added to dynamically adjust the network depth according to the input image data.
[0013] Preferably, in step S2, for the first-order image generation module, the input is the internal defect image of the high-voltage distribution cabinet to be processed , , where H, W and 3 represent the height, width and number of channels of the internal defect image of the high-voltage distribution cabinet respectively; each gated residual block contains a gated unit, two 3x3 convolutions, batch normalization, ReLU activation function and residual connection, and the gated unit includes a 1x1 convolution and Sigmoid function; Image features are obtained through N residual blocks , , Block is a residual block, and the i-th residual block includes the following two steps:
[0014] S21, first calculate the activation probability through the gate control unit , , where Sigmoid represents the Sigmoid function, which maps the output value of the convolutional layer to the range of [0,1]. represents 1x1 convolution, Represents the input of the i-th residual block. If it is greater than the set threshold, the subsequent feature extraction operation is performed, otherwise it jumps out directly and outputs the feature map;
[0015] S22, feature extraction operation generation , ,in represents 3x3 convolution, BN represents batch normalization, and ReLU is the activation function.
[0016] Preferably, in step S2, the denoising unit is used to perform denoising processing in the feature space, by decomposing the features into low-rank and high-rank parts, retaining useful structural information and removing noise, the denoising unit uses 3×3 convolution for feature extraction, 1×1 convolution for subspace decomposition, and matrix multiplication between feature maps to obtain the potential space decomposition of the image, and the shallow feature output and the matrix multiplication output are added to obtain the denoised feature map; the input is the image feature , , H, W and C represent the height, width and number of channels of the feature map respectively, and then calculate , , , ,in represents 1x1 convolution, represents 3x3 convolution, represents the matrix transpose, represents matrix reshaping, , , is the characteristic matrix in the denoising unit process, The final matrix generated for the denoising unit is Upsampling is performed through the deconvolution layer to obtain the first-order internal defect image of the high-voltage distribution cabinet ,in represents deconvolution, BN represents batch normalization, and ReLU is the activation function.
[0017] Preferably, in step S3, for the second-order image generation module, the input is the internal defect image of the high-voltage distribution cabinet to be processed , , where H, W and 3 represent the height, width and number of channels of the internal defect image of the high-voltage distribution cabinet respectively; firstly, the internal defect image of the high-voltage distribution cabinet to be processed is subjected to preliminary feature extraction through a 3x3 convolution to extract local features, local features for: ; Then 3x3 convolution is used to capture contextual information of different scales. for: ; Local features and context information are spliced, and multi-scale feature fusion is completed through 3x3 convolution, multi-scale fusion feature map for: ; Generate a light map through 3x3 convolution, the light map A is: ; Generate the intermediate image through 3x3 convolution, the intermediate image for: ;in represents 3x3 convolution, represents special graph concatenation, BN represents batch normalization, ReLU is the activation function, , , , are the weights and biases of the output illumination map and the intermediate map, respectively, obtained through training.
[0018] Preferably, in step S3, the intermediate image represents the ratio of the brightness of the original scene of the internal defect image of the high-voltage distribution cabinet to the incident light that is not scattered by the atmosphere. The illumination map is the global illumination that is scattered by the atmosphere and reaches the camera, and is a global constant of the internal defect image of the high-voltage distribution cabinet. The image restoration module combines the intermediate image and the illumination map to estimate the brightness of the scene and generate a second-order internal defect image of the high-voltage distribution cabinet with improved brightness and color balance. The specific process is: ,in The generated internal defect image of the second-order high-voltage distribution cabinet is: is the internal defect image of the high-voltage distribution cabinet to be processed. is the middle picture, and A is the lighting map.
[0019] Preferably, in step S4, the generated second-order high-voltage distribution cabinet internal defect image is in RGB color space, which is converted into an image in HSV color space to separate brightness information. The specific method is: calculate the brightness V: , calculate the saturation S: , calculate the hue H: , where R is the value of the R channel of the internal defect image of the second-order high-voltage distribution cabinet, G is the value of the G channel of the internal defect image of the second-order high-voltage distribution cabinet, and B is the value of the B channel of the internal defect image of the second-order high-voltage distribution cabinet. is the maximum value of the three channels R, G, and B of the internal defect image of the second-order high-voltage distribution cabinet. It is the minimum value of the three RGB channels of the internal defect image of the second-order high-voltage distribution cabinet.
[0020] Preferably, in step S5, the first-order high-voltage distribution cabinet internal defect image is used to enhance the brightness information under low light conditions, and the first-order high-voltage distribution cabinet internal defect image replaces the V channel of the high-voltage distribution cabinet internal defect conversion image in the HSV color space, directly improving the brightness of the image, improving the overall visual effect of the image, and generating a third-order high-voltage distribution cabinet internal defect image.
[0021] Preferably, in step S6, the generated three-order high-voltage distribution cabinet internal defect image is an image in the HSV color space, which is converted into an image in the RGB color space, that is, the generated high-voltage distribution cabinet internal defect enhanced image, and the specific method is: when the value of the S channel of the three-order high-voltage distribution cabinet internal defect image is 0, the values of the three channels R, G, and B of the generated high-voltage distribution cabinet internal defect enhanced image are all set to the values of the V channel of the three-order high-voltage distribution cabinet internal defect image; when the value of the S channel of the three-order high-voltage distribution cabinet internal defect image is not 0, calculate , , ,
[0022] ,
[0023] , where V, S, H are the values of the V, S, H channels of the third-order high-voltage distribution cabinet internal defect image, and R, G, B are the values of the R, G, B channels of the high-voltage distribution cabinet internal defect enhanced image. is the remainder operation, C, X, m, , , These are all intermediate variables that appear in the calculation process.
[0024] Compared with the prior art, the present invention has the following technical effects: a first-order image generation module and a second-order image generation module are designed to effectively reduce image noise in a low-light environment and improve the visual effect of the image; a denoising unit is designed to generate images with less noise and better visual effect in a low-light environment; by replacing the V channel of the HSV image, the present invention can significantly enhance the brightness and contrast of the image, and the generated image has higher brightness and better contrast, and richer details; a gating mechanism is introduced to dynamically adjust the depth of the network according to the characteristics of the input image, thereby improving the flexibility and computational efficiency of the model, and having high practical value in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart of a method for processing internal defects of a high-voltage distribution cabinet provided by the present invention.
[0026] Figure 2 It is a diagram of the internal defect image processing process of the high-voltage distribution cabinet provided by the present invention.
[0027] Figure 3 It is a structural diagram of an encoder in a first-order image generation module FOIG provided by the present invention.
[0028] Figure 4 It is a structural diagram of the denoising unit DU provided by the present invention.
[0029] Figure 5 This is a diagram showing the effect of image processing of internal defects of a high-voltage distribution cabinet in an embodiment provided by the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the accompanying drawings of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] See also Figures 1 to 5 The present invention provides a method for processing internal defect images of a high-voltage distribution cabinet, aiming to process the internal defect images of a high-voltage distribution cabinet under different lighting conditions through efficient and accurate image processing technology to enhance detail information. A method for processing internal defect images of a high-voltage distribution cabinet includes the following steps.
[0032] S1. Production of internal defect image dataset of high-voltage distribution cabinet. Use industrial camera to shoot defective high-voltage distribution cabinet to obtain defect images of high-voltage distribution cabinet under different lighting conditions. A total of 3000 images are constructed to construct internal defect image dataset of high-voltage distribution cabinet, which is divided into training set and validation set according to 7:3.
[0033] S2. Construct a first-order image generation module FOIG, including an encoder and a decoder. The encoder consists of a gated residual block with an adaptive number of layers and a denoising unit DU. The decoder consists of a deconvolution layer. Feature extraction and downsampling operations are completed in the encoder, and upsampling operations are completed in the decoder to generate a first-order internal defect image of the high-voltage distribution cabinet.
[0034] Further, in step S2, the number of layers of the gated residual block in the encoder of the first-order image generation module is determined by the gating mechanism, and a gating unit is added in the gated residual block to determine whether to activate the gated residual block. The gating unit calculates the activation probability through a convolutional layer and a Sigmoid function. If the activation probability exceeds the set threshold, the operation of the block is executed, otherwise it is skipped. The gating mechanism is added to dynamically adjust the network depth according to the input image data. The threshold set in this embodiment is 0.5.
[0035] Further, in step S2, for the first-order image generation module, the input is the internal defect image of the high-voltage distribution cabinet to be processed , , where 640, 640 and 3 represent the height, width and number of channels of the internal defect image of the high-voltage distribution cabinet respectively; each gated residual block contains a gated unit, two 3x3 convolutions, batch normalization, ReLU activation function and residual connection, and the gated unit includes a 1x1 convolution and Sigmoid function; Image features are obtained through N residual blocks , , Block is a residual block, and the i-th residual block includes the following two steps:
[0036] S21, first calculate the activation probability through the gate control unit , , where Sigmoid represents the Sigmoid function, which maps the output value of the convolutional layer to the range of [0,1]. represents 1x1 convolution, Represents the input of the i-th residual block. If it is greater than 0.5, the subsequent feature extraction operation is performed, otherwise the residual block step is skipped and the feature map is output;
[0037] S22, feature extraction operation generation , ,in represents 3x3 convolution, BN represents batch normalization, and ReLU is the activation function;
[0038] Generated feature map , where 160, 160 and 1 represent feature maps respectively The height, width, and number of channels of the
[0039] Further, in step S2, the denoising unit is used to perform denoising in the feature space. By decomposing the features into low-rank and high-rank parts, useful structural information is retained and noise is removed. The denoising unit uses 3×3 convolution for feature extraction and 1×1 convolution for subspace decomposition. At the same time, matrix multiplication between feature maps is used to obtain the latent space decomposition of the image. The shallow feature output and the matrix multiplication output are added to obtain the denoised feature map. The input is the image feature , , H, W and C represent the height, width and number of channels of the feature map respectively, and then calculate , , , ,in represents 1x1 convolution, represents 3x3 convolution, represents the matrix transpose, represents matrix reshaping, , , is the characteristic matrix in the denoising unit process, The final matrix generated for the denoising unit is Upsampling is performed through the deconvolution layer to obtain the first-order internal defect image of the high-voltage distribution cabinet ,in represents deconvolution, BN represents batch normalization, ReLU is the activation function, and the generated first-order high-voltage distribution cabinet internal defect image , where 640, 640 and 1 represent feature maps respectively The height, width, and number of channels of the
[0040] S3. Construct a second-order image generation module SOIG, including an encoder, a decoder and an image restoration module. The encoder is composed of convolutional layers, and the decoder is composed of convolutional layers. Feature extraction and multi-scale feature fusion are completed in the encoder. The decoder contains two branches for generating intermediate images and illumination maps. The intermediate images and illumination maps are used to generate second-order internal defect images of high-voltage distribution cabinets through the image restoration module.
[0041] Further, in step S3, for the second-order image generation module, the input is the internal defect image of the high-voltage distribution cabinet to be processed , , where 640, 640 and 3 represent the height, width and number of channels of the internal defect image of the high-voltage distribution cabinet respectively; Firstly, the internal defect image of the high-voltage distribution cabinet to be processed is subjected to preliminary feature extraction through a 3x3 convolution to extract local features, local features for: ; Then 3x3 convolution is used to capture contextual information of different scales. for: ; Local features and context information are spliced, and multi-scale feature fusion is completed through 3x3 convolution, multi-scale fusion feature map for: ; Generate a light map through 3x3 convolution, and the light map A is: ; Generate the intermediate image through 3x3 convolution, the intermediate image for: ;in represents 3x3 convolution, represents special graph concatenation, BN represents batch normalization, ReLU is the activation function, , , , are the weights and biases of the output illumination map and the intermediate map, respectively, obtained through training, and the generated intermediate map , where 640, 640 and 3 represent the intermediate images respectively The height, width, and number of channels of the generated light map , where 640, 640 and 3 represent the height, width and number of channels of the illumination map A respectively.
[0042] Further, in step S3, the intermediate image represents the ratio of the brightness of the original scene of the internal defect image of the high-voltage distribution cabinet to the incident light that is not scattered by the atmosphere. The illumination map is the global illumination that is scattered by the atmosphere and reaches the camera, and is a global constant of the internal defect image of the high-voltage distribution cabinet. The image restoration module combines the intermediate image and the illumination map to estimate the brightness of the scene and generate a second-order internal defect image of the high-voltage distribution cabinet with improved brightness and color balance. The specific process is: ,in The generated internal defect image of the second-order high-voltage distribution cabinet is: is the internal defect image of the high-voltage distribution cabinet to be processed. is the middle picture, and A is the lighting map.
[0043] S4. Construct an image conversion module ICVM to convert the generated second-order high-voltage distribution cabinet internal defect image into a high-voltage distribution cabinet internal defect conversion image in the HSV color space through the image conversion module.
[0044] Further, in step S4, the generated second-order high-voltage distribution cabinet internal defect image is in RGB color space, which is converted into an image in HSV color space to separate the brightness information. The specific method is as follows: Calculate the brightness V: , calculate the saturation S: , calculate the hue H: , where R is the value of the R channel of the internal defect image of the second-order high-voltage distribution cabinet, G is the value of the G channel of the internal defect image of the second-order high-voltage distribution cabinet, and B is the value of the B channel of the internal defect image of the second-order high-voltage distribution cabinet. is the maximum value of the three channels R, G, and B of the internal defect image of the second-order high-voltage distribution cabinet. It is the minimum value of the three RGB channels of the internal defect image of the second-order high-voltage distribution cabinet.
[0045] S5. Construct a third-order generation module TOIG, use the generated first-order high-voltage distribution cabinet internal defect image to replace the V channel of the high-voltage distribution cabinet internal defect conversion image, and generate a third-order high-voltage distribution cabinet internal defect image.
[0046] Furthermore, in step S5, the first-order internal defect image of the high-voltage distribution cabinet is used to enhance the brightness information under low-light conditions, and the first-order internal defect image of the high-voltage distribution cabinet replaces the V channel of the internal defect conversion image of the high-voltage distribution cabinet in the HSV color space, directly improving the brightness of the image and improving the overall visual effect of the image, thereby generating a third-order internal defect image of the high-voltage distribution cabinet.
[0047] S6. Construct an enhanced image generation module ENIG to convert the internal defect image of the third-order high-voltage distribution cabinet into an enhanced internal defect image of the high-voltage distribution cabinet in RGB color space.
[0048] Further, in step S6, the generated three-order high-voltage distribution cabinet internal defect image is an image in the HSV color space, which is converted into an image in the RGB color space, that is, the generated high-voltage distribution cabinet internal defect enhanced image, the specific method is: when the value of the S channel of the three-order high-voltage distribution cabinet internal defect image is 0, the values of the three channels R, G, and B of the generated high-voltage distribution cabinet internal defect enhanced image are all set to the values of the V channel of the three-order high-voltage distribution cabinet internal defect image; when the value of the S channel of the three-order high-voltage distribution cabinet internal defect image is not 0, calculate , , ,
[0049] ,
[0050] , where V, S, H are the values of the V, S, H channels of the third-order high-voltage distribution cabinet internal defect image, and R, G, B are the values of the R, G, B channels of the high-voltage distribution cabinet internal defect enhanced image. is the remainder operation, C, X, m, , , These are all intermediate variables that appear in the calculation process.
[0051] S7. Construct a high-voltage distribution cabinet internal defect image processing model, including input, a first-order image generation module, a second-order image generation module, an image conversion module, a third-order image generation module, an enhanced image generation module and an output.
[0052] Furthermore, the internal defect image processing model of the high-voltage distribution cabinet was coded using the Pycharm application and Python language, using the Pytorch framework. The model input was trained with internal defect images of the high-voltage distribution cabinet with a resolution of 640×640×3. The model was trained for 200 epochs, of which 50 epochs were frozen.
[0053] For further information, see Figure 5In this embodiment, the contrast of the image is enhanced from 46.846 to 54.421.
[0054] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A method for processing internal defect images of a high-voltage distribution cabinet, characterized in that: The following steps are involved: S1. Preparation of internal defect image dataset of high-voltage distribution cabinet. Use industrial camera to take pictures, obtain defect images of the interior of high-voltage distribution cabinet under different lighting conditions, and construct internal defect image dataset of high-voltage distribution cabinet. S2. Construct a first-order image generation module FOIG, including an encoder and a decoder. The encoder consists of a gated residual block with an adaptive number of layers and a denoising unit, and the decoder consists of a deconvolution layer. The encoder completes feature extraction and downsampling, and the decoder completes upsampling to generate a first-order internal defect image of a high-voltage distribution cabinet. S3. Construct a second-order image generation module SOIG, including an encoder, a decoder and an image restoration module. The encoder is composed of a convolutional layer, and the decoder is composed of a convolutional layer. The encoder completes feature extraction and multi-scale feature fusion. The decoder contains two branches for generating an intermediate image and an illumination map. The intermediate image and the illumination map are used to generate a second-order internal defect image of the high-voltage distribution cabinet through the image restoration module; S4, constructing an image conversion module ICVM, converting the generated second-order high-voltage distribution cabinet internal defect order image into a high-voltage distribution cabinet internal defect conversion image in the HSV color space through the image conversion module; S5, constructing a third-order generation module TOIG, using the generated first-order high-voltage distribution cabinet internal defect image to replace the V channel of the high-voltage distribution cabinet internal defect conversion image, to generate a third-order high-voltage distribution cabinet internal defect image; S6, constructing an enhanced image generation module ENIG to convert the internal defect image of the third-order high-voltage distribution cabinet into an enhanced internal defect image of the high-voltage distribution cabinet in RGB color space; S7, constructing a high-voltage distribution cabinet internal defect image processing model, including input, a first-order image generation module, a second-order image generation module, an image conversion module, a third-order image generation module, an enhanced image generation module and an output; In step S2, the number of layers of the gated residual block in the encoder of the first-order image generation module is determined by a gating mechanism, and a gating unit is added to the gated residual block to determine whether to activate the gated residual block. The gated unit calculates the activation probability through a convolutional layer and a Sigmoid function. If the activation probability exceeds a set threshold, the gated residual block is activated and the subsequent operation of the gated residual block is performed, otherwise it is skipped; In step S2, the denoising unit decomposes the features into low-rank and high-rank parts, uses 3×3 convolution for feature extraction, 1×1 convolution for subspace decomposition, and uses matrix multiplication between feature maps to obtain the latent space decomposition of the image, and adds the shallow feature output and the matrix multiplication output to obtain the denoised feature map; Input is image feature F N , F N ∈R H ×W×C , H, W and C represent the height, width and number of channels of the feature map respectively, and then calculate Among them, Conv1 represents 1x1 convolution, Conv3 represents 3x3 convolution, Trans represents matrix transposition, and Reshape represents matrix reshaping. is the characteristic matrix in the denoising unit process, The final matrix generated for the denoising unit is Upsampling is performed through the deconvolution layer to obtain the first-order internal defect image of the high-voltage distribution cabinet Among them, ConvTranspose2d represents deconvolution, BN represents batch normalization, and ReLU is the activation function; In step S3, the second-order image generation module is inputted with the internal defect image I of the high-voltage distribution cabinet to be processed. LL , I LL ∈R H×W×3 , where H, W and 3 represent the height, width and number of channels of the internal defect image of the high-voltage distribution cabinet respectively; firstly, the internal defect image of the high-voltage distribution cabinet to be processed is subjected to preliminary feature extraction through a 3x3 convolution to extract local features, and the local feature F local For: F local =ReLU(BN(Conv3(I LL ))); Then, 3x3 convolution is used to capture context information of different scales. context For: F context =ReLU(BN(Conv3(F local ))); local features and context information are concatenated, and multi-scale feature fusion is completed through 3x3 convolution, and the multi-scale fusion feature map F fused For: F fused =ReLU(BN(Conv3(Concat(F local , F context )))); Generate a light map through 3x3 convolution, the light map A is: A = Conv3 (F fused , W A , b A ); Generate the intermediate image through 3x3 convolution, intermediate image I Mid For: I Mid =Conv3(F fused , W Mid , b Mid ), where Conv3 represents 3x3 convolution, Concat represents special graph concatenation, BN represents batch normalization, ReLU is the activation function, and W A , b A , W Mid , b Mid are the weights and biases of the output illumination map and the intermediate map, respectively, obtained through training; In step S3, the image restoration module combines the intermediate image and the illumination image to generate a second-order high-voltage distribution cabinet internal defect image. The specific process is as follows: Among them I SOIG is the generated second-order high-voltage distribution cabinet internal defect image, I LL is the internal defect image of the high-voltage distribution cabinet to be processed, I Mid is the middle picture, and A is the lighting map.
2. According to the method for processing internal defects of a high-voltage distribution cabinet according to claim 1, it is also characterized in that: In step S2, the first-order image generation module is inputted with the internal defect image I of the high-voltage distribution cabinet to be processed. LL , I LL ∈R H ×W×3 , where H, W and 3 represent the height, width and number of channels of the internal defect image of the high-voltage distribution cabinet respectively; each gated residual block contains a gated unit, two 3x3 convolutions, batch normalization, ReLU activation function and residual connection, and the gated unit includes a 1x1 convolution and Sigmoid function; I LL After N residual blocks, the image feature F is obtained N , F i =Block(F i-1 ), 1≤i≤N, Block is the residual block, and the i-th residual block includes the following two steps: S21, first calculate the activation probability α through the gate control unit, α = Sigmoid (Conv1 (F i-1 )), where Sigmoid represents the Sigmoid function, which maps the output value of the convolution layer to the range [0,1], Conv1 represents 1x1 convolution, and F i-1 Represents the input of the i-th residual block. If α is greater than the set threshold, the subsequent feature extraction operation of the residual block is performed, otherwise it is directly jumped out and the feature map is output; S22, feature extraction operation generates F i , F i =F i-1 +BN(Conv3(ReLU(BN(Conv3(F i-1 )))))), where Conv3 represents 3x3 convolution, BN represents batch normalization, and ReLU is the activation function.
3. The method for processing internal defects of a high-voltage distribution cabinet according to claim 1 is characterized in that: In step S4, the generated second-order high-voltage distribution cabinet internal defect image is in RGB color space, which is converted into an image in HSV color space to separate the brightness information. The specific method is: calculate the brightness V: V = max (R, G, B), calculate the saturation S: Calculate the hue H: Wherein R is the value of the R channel of the internal defect image of the second-order high-voltage distribution cabinet, G is the value of the G channel of the internal defect image of the second-order high-voltage distribution cabinet, B is the value of the B channel of the internal defect image of the second-order high-voltage distribution cabinet, max(R, G, B) is the maximum value of the three channels R, G, and B of the internal defect image of the second-order high-voltage distribution cabinet, and min(R, G, B) is the minimum value of the three channels RGB of the internal defect image of the second-order high-voltage distribution cabinet.
4. The method for processing internal defects of a high-voltage distribution cabinet according to claim 1 is characterized in that: In step S5, the first-order high-voltage distribution cabinet internal defect image replaces the V channel of the high-voltage distribution cabinet internal defect conversion image in the HSV color space to generate a third-order high-voltage distribution cabinet internal defect image.
5. The method for processing internal defects of a high-voltage distribution cabinet according to claim 1 is characterized in that: In step S6, the generated internal defect image of the third-order high-voltage distribution cabinet is an image in the HSV color space, which is converted into an image in the RGB color space. The specific method is: when the value of the S channel of the internal defect image of the third-order high-voltage distribution cabinet is 0, the values of the three channels R, G, and B of the generated internal defect enhanced image of the high-voltage distribution cabinet are all set to the value of the V channel of the internal defect image of the third-order high-voltage distribution cabinet; when the value of the S channel of the internal defect image of the third-order high-voltage distribution cabinet is not 0, C=V×S is calculated, (R,G,B)=((R'+m)×255,(G′+m)×255,(B′+m)×255), where V, S, H are the values of the V, S, and H channels of the third-order high-voltage distribution cabinet internal defect image, respectively; R, G, and B are the values of the R, G, and B channels of the high-voltage distribution cabinet internal defect enhanced image, respectively; mod is the remainder operation; C, X, m, R′, G′, and B′ are all intermediate variables that appear in the calculation process.
