Image deblurring method based on multi-scale improved residual block CNN

This paper proposes an image de-motion blurring method based on multi-scale improved residual block CNNs, which solves the problem of blurry images captured by power inspection robots. It achieves fast de-blurring and efficient recognition and is suitable for embedded system platforms.

CN117391973BActive Publication Date: 2026-11-20NANJING NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311444732.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-01
Publication Date
2026-11-20
Estimated Expiration
2043-11-01

AI Technical Summary

Technical Problem

Images captured by power line inspection robots are often blurry due to factors such as focal length, robot vibration, and changes in ambient light, which affects the effectiveness of subsequent image recognition and target detection.

Method used

A motion blur removal method based on multi-scale improved residual block CNN is adopted to achieve deblurring of blurred images through acquisition, frame segmentation, image preprocessing, dataset creation, and training of multi-scale improved residual block convolutional neural network.

Benefits of technology

It improves image clarity and readability, enhances the reliability of subsequent technical work, has fast computing capabilities and strong resistance to environmental interference, and is suitable for embedded system platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117391973B_ABST
    Figure CN117391973B_ABST
Patent Text Reader

Abstract

The application discloses an image motion deblurring method based on a multi-scale improved residual block CNN, and comprises the following steps: collecting and saving power inspection video data of a power transmission line inspection robot, making a data set, and recording the data set as a source data set; cutting and compressing the source data set to obtain a clear and fuzzy image pair, and recording the image pair as a power inspection deblurring data set; building a multi-scale improved residual block convolutional neural network, training the multi-scale improved residual block convolutional neural network by using the power inspection deblurring data set, and obtaining a trained multi-scale improved residual block convolutional neural network model; and using the trained multi-scale improved residual block convolutional neural network model to deblur power inspection fuzzy image data. The application improves the deblurring effect and accuracy of power inspection images, is suitable for processing the inspection image shooting blur problem of a high-voltage power transmission inspection robot, and has the advantages of fast operation speed, good motion deblurring effect and strong environmental interference resistance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power line inspection data processing, and relates to the acquisition of blurred image data and deep learning technology for power line inspection. Specifically, it relates to an image de-motion blurring method based on multi-scale improved residual block CNN. Background Technology

[0002] Currently, my country primarily uses three inspection methods for regularly inspecting overhead power transmission lines: manual inspection, drone inspection, and inspection robot inspection. Robotic inspection utilizes cables-climbing robots that walk along the transmission lines at a certain speed, traversing obstacles on the cables. Equipped with cameras and detection devices, they inspect the overhead power transmission lines. Inspection robots can autonomously navigate the transmission lines and, using visible light and infrared cameras, can conduct close-up inspections of the line corridors and the lines themselves. They eliminate blind spots, are not subject to airspace restrictions, and offer high efficiency and effectiveness. Compared to other inspection methods, their advantages are particularly pronounced in mountainous, lakeside, and forested areas. This method not only reduces labor costs but also improves work efficiency and inspection accuracy.

[0003] However, in actual engineering sites, inspection robots often capture blurry images due to factors such as the focal length of the camera, vibrations of the robot and gimbal camera in windy conditions, relative motion between the object being photographed and the imaging device, and varying lighting conditions. Blurry images significantly impact subsequent technical work to obtain clear image information, and can even interrupt some image-based intelligent technologies, such as image recognition, object detection, and image segmentation. Therefore, how to make blurry images clear, thereby enhancing the reliability and readability of image data and providing a prerequisite for subsequent technical work, has become an urgent problem to be solved. Summary of the Invention

[0004] Purpose of the invention: In order to overcome the shortcomings of the existing technology, an image de-motion blurring method based on multi-scale improved residual block CNN is provided, which has the advantages of fast operation speed, good de-motion blurring effect and strong resistance to environmental interference.

[0005] Technical Solution: To achieve the above objectives, this invention provides an image de-motion blurring method based on multi-scale improved residual block CNN, comprising the following steps:

[0006] S1: Collect and save power inspection video data from the power line inspection robot, perform frame segmentation on the collected power inspection video data, then perform image sample screening and image preprocessing to obtain clear and blurry image pairs, create a dataset, and record it as the source dataset.

[0007] S2: Complete the image reprocessing of the source dataset, crop and compress the source dataset to obtain 133 pairs of clear and blurry images, which are denoted as the power inspection deblurred dataset. This dataset is unique to this invention. At present, there is no deblurred dataset in the field of power inspection. Unlike the traditional public dataset GoPro, which uses a method of fusing a dozen consecutive clear images into a blurry image, the power inspection deblurred dataset uses a compression and cropping method of a single blurry image to form a new blurry image.

[0008] S3: Construct a multi-scale improved residual block convolutional neural network, and use the power inspection defuzzification dataset to fully train the multi-scale improved residual block convolutional neural network to obtain a trained multi-scale improved residual block convolutional neural network model. The difference between this model algorithm and the traditional multi-scale convolutional neural network lies in the improvement of the network residual structure and the construction of the loss function.

[0009] S4: Use a trained multi-scale improved residual block convolutional neural network model to deblur the blurred image data of power inspection, then perform target detection and recognition on the deblurred image to determine whether the power inspection target is in a defective state, and record it in the background and cloud.

[0010] Further, step S1 specifically includes:

[0011] A1: Under the swaying state of the power transmission line inspection robot, data is collected from the power inspection video of the inspection robot, and the power inspection video data under the swaying state of the power transmission line inspection robot is obtained and saved. The power inspection video includes clear images and blurry images in the same scene.

[0012] A2: The inspection video acquired in step A1 is processed by video frame segmentation to obtain the processed image. Then, the image samples are screened to obtain the images that meet the requirements.

[0013] A3: The image acquired in step A2 is preprocessed using the histogram equalization method to obtain the preprocessed image data;

[0014] A4: Perform classification and pairing operations on the preprocessed data obtained in step A3 to obtain one-to-one pairs of clear and blurry images, and record them as the source dataset.

[0015] Further, step A1 includes:

[0016] While the power transmission line inspection robot is swaying, data is collected from the power inspection video of the robot. The robot takes pictures at different locations on the inspection line, at different focal lengths, and in different scenes, resulting in a series of short videos with a frame rate of 16 frames / second, which are then saved.

[0017] Further, step A2 specifically includes:

[0018] The video acquired in step A1 is processed frame by frame to obtain 16*t images, where t is the duration of the video.

[0019] After the images are processed by framing, a sample selection process is performed to select images that contain the power line inspection target and discard images that are not related to the power line inspection target.

[0020] Furthermore, step A3 specifically includes:

[0021] Histogram equalization is used to preprocess the image obtained in step A2 to enhance local contrast without affecting overall contrast. Image histogram definition: For a digital image with gray levels in the range [0, L-1], the histogram is a discrete function.

[0022] p(r k ) = n k / n (1)

[0023] Where p is a probability function, r k It is the k-th gray level, k = 0, 1, 2, ..., L-1, where L is the total number of gray levels, and n k The total number of pixels at the k-th gray level in the image is given by , where n is the total number of pixels in the image. This process yields the preprocessed image.

[0024] Further, step A4 includes:

[0025] The preprocessed images are classified into two main categories: clear images and blurry images.

[0026] The obtained clear and blurry images are paired one-to-one based on the same background and the same inspection target location to obtain the source dataset A1.

[0027] Further, step S2 specifically includes:

[0028] B1: Crop the images in the source dataset A1. The original image resolution is 2688*1520. Use a fixed-size frame moving method to crop the area containing the power inspection target. The resulting image resolution should be greater than 256 pixels in length and width. The resolution of clear and blurry image pairs should be exactly the same.

[0029] B2: Compress the images obtained in step B1 to ensure that the image length is greater than 256 pixels, the width is greater than 256 pixels, and the resolution of the clear and blurry image pairs are exactly the same. This results in 133 pairs of clear and blurry images, which are denoted as the power inspection deblurring dataset A2.

[0030] Further, step S3 specifically includes:

[0031] C1: Construct a multi-scale improved residual block convolutional neural network and determine the network structure;

[0032] C2: Select a network optimizer and train a multi-scale improved residual block convolutional neural network using the public dataset GoPro and the power inspection deblurring dataset A2 to obtain a trained multi-scale improved residual block convolutional neural network model.

[0033] Furthermore, the multi-scale improved residual block convolutional neural network structure in step C1 consists of three neural network structures of different scales. At each scale, a sharp image is generated as a sub-problem of the deblurring task. This sub-problem takes a blurred image and the initial deblurring result (downsampling from the previous scale) as input and infers that at this scale, the sharp image is:

[0034] I m h m =Net(B m ,I m+1 ,h m+1 ;θ) (2)

[0035] Among them, I m h represents the deblurred image output by this layer of the network at this scale. m The hidden layer features are at this scale. Net is the multi-scale improved residual block convolutional neural network proposed in this invention. m For the blurred image input to this layer of the network at this scale, I m+1 h is the deblurred image output from the previous scale. m+1 θ represents the hidden layer features of the previous level, θ represents the parameters to be trained, m represents the current level scale, and m+1 represents the previous level scale.

[0036] Furthermore, the neural network structure is the same at any scale in step C1, and the specific construction method is as follows:

[0037] The first part is the input module, which includes a convolutional layer and three improved residual blocks. Each of these improved residual blocks differs from the traditional structure. This invention uses a concatenation operation instead of the element-wise addition operation of the original improved residual block, containing two convolutional layers, a linear rectified function, and a skip concatenation layer. The concatenation operation has three advantages over the element-wise addition operation of the original improved residual block: 1. Information fusion: By connecting two feature maps along the channel dimension, information fusion and combination can be achieved, enabling the network to utilize more contextual information. 2. Enhanced representational power: The connection operation expands the number of channels in the feature maps, increasing the network's representational power and facilitating the learning of more complex feature representations. 3. Multi-scale feature fusion: By connecting feature maps with different spatial resolutions, multi-scale feature fusion can be achieved, improving the model's ability to perceive targets at different scales. The first part of the input comes from the publicly available GoPro dataset and the power line inspection deblurring dataset A2. Each image in the dataset is processed by OpenCV to obtain a local image of size 256*256, which is then sent to the input module to the first convolutional layer. This layer uses 64 3*3 convolutional kernels with a stride of 1 and a padding of 1. The output size of the convolutional layer is calculated using the following formula:

[0038]

[0039] Where Z is the length of the convolution output data, W is the length of the convolution input data, P is the padding amount, F is the length of the convolution kernel, and S represents the stride. For the first coding block in the first part, the output size of the first convolutional layer is calculated by formula (3). The output size of the first convolutional layer is 256*256*64. Since the convolutional layers in the first part use the same kernel size and format, and the same parameters, the final output size of the convolutional layers in the first part and the three improved residual blocks is also 256*256*64.

[0040] The second part consists of a coding structure composed of two coding blocks, where each coding block contains a convolutional layer, a linear rectified function, and three improved residual blocks. For the first coding block in the second part, this layer uses 128 3*3 convolutional kernels with a stride of 2 and a padding of 0.5. The output size of the first convolutional layer is calculated using formula (3), and the output size of the first convolutional layer is 128*128*128. After the first convolutional layer of the coding block, a linear rectified function is used as the activation function, and the data after the activation function is sent to the second convolutional layer of the coding block. The second convolutional layer uses 64 3*3 convolutional kernels with a stride of 2 and a padding of 0.5. According to the formula (3) for calculating the output size of the convolutional layer, The output size of the second convolutional layer in the second part is also 128*128*128; since the convolutional layers in the second part use the same kernel size and format, and the same parameters, the final output size of the first coding block in the second part is 128*128*128; similarly, for the second coding block in the second part, this layer uses 256 3*3 convolutional kernels, with a stride of 2 and a padding amount of 0.5. The output size of the first convolutional layer is calculated by formula (3) and the output size of the first convolutional layer is 64*64*256; since the convolutional layers in the second part use the same kernel size and format, and the same parameters, the final output size of the second coding block in the second part is 64*64*256;

[0041] The third part consists of two decoding blocks, each of which comprises three improved residual blocks, one deconvolutional layer, and one linear rectified function. The output size of the deconvolutional layer is calculated using the following formula:

[0042] Z1=(W1-1)×S1-2×P1+F1 (4)

[0043] Where Z1 is the length of the convolution output data, W1 is the length of the convolution input data, P1 is the padding amount, F1 is the length of the convolution kernel, and S1 represents the stride; according to the formula (4) for calculating the output size of the deconvolution layer, this layer uses 256 3*3 convolution kernels, with a stride of 2 and a padding amount of 0.5. The output size of the first deconvolution layer in the third part is 128*128*256; since the deconvolution layer in the third part uses the same convolution kernel size and format, and the same parameters, and so on, the first decoding block in the third part is the largest The final output size is 128*128*256; similarly, in the second decoding block of the third part, this layer uses 128 3*3 convolution kernels, with a stride of 2 and a padding amount of 0.5. The output size of the first deconvolution layer is calculated by formula (4) and the output size of the first deconvolution layer is 256*256*128; since the deconvolution layer of the second decoding block uses the same convolution kernel size and format, and the same parameters, the final output size of the second decoding block of the third part is 256*256*128;

[0044] The fourth part is the output module, which includes three improved residual blocks and one convolutional layer. This layer uses 64 3*3 convolutional kernels with a stride of 1 and a padding of 1. The output size of the first convolutional layer in the fourth part is 256*256*64. Since the convolutional layers in the fourth part use the same kernel size and format, and have the same parameters, the final output size of the decoding block in the fourth part is 256*256*64.

[0045] Further, step C2 specifically includes:

[0046] The GoPro public dataset and the power line inspection deblurring dataset A2 were divided into training and testing sets in a 4:1 ratio. During training, a four-loss weighted balancing function was used as the loss function. The four-loss weighted balancing function is defined as follows:

[0047] L = L p +k1L1+k2L2+k3L3 (5)

[0048]

[0049]

[0050]

[0051]

[0052] Where L is the four-loss weight balance function, k1, k2, and k3 are fusion coefficients, and in this invention, k1, k2, and k3 are all taken as 0.3. pL1 is the perceptual loss function, L2 is the L2 norm loss function, L3 is the multi-scale frequency reconstruction loss function, and φ is the perceptual loss function. i,j W is the feature map obtained by the j-th convolution after activation in the VGG19 network before the max pooling in the i-th layer. i,j H is the width of the feature map. i,j Here, S represents the sharp image, I represents the generated deblurred image, x is the coordinate value in the width direction of the feature map, y is the coordinate value in the height direction of the feature map, n is the batch size, and I... n S is the deblurred image output at the nth scale in this network. n For the clear image output at scale n in this network, t k The total number of elements at the k-th scale is represented by ||·||1, which is the L1 distance operator, and ||·||2, which is the L2 distance operator. F represents the Fast Fourier Transform (FFT) that transmits the image signal to the frequency domain.

[0053] The network optimizer uses the Adam optimizer, with a training batch size of 24 and a learning rate of 5×10⁻⁶. -5 The network is trained sufficiently to obtain a well-trained multi-scale improved residual block convolutional neural network model.

[0054] Further, step S4 includes:

[0055] D1: Real-time acquisition of inspection image data captured by the power inspection robot during the inspection process, and deblurring of the real-time acquired image data using the trained model obtained in step S3 to obtain the current state of the inspection target.

[0056] D2: Based on the inspection target obtained in step D1, deblur the image, perform target detection and recognition in the image. If the inspection target has defects or damage, the backend and cloud will issue an alarm and record the data.

[0057] Beneficial effects: Compared with the prior art, the present invention has the following advantages.

[0058] 1. This invention provides an image de-motion blurring method based on a multi-scale improved residual block CNN. It fully considers the characteristics of blurred images captured by power line inspection robots and designs a multi-scale improved residual block convolutional neural network. Feature matching is performed by comparing clear and blurred image data, thus solving the current problem of motion blur removal in power line inspection robot images. Furthermore, it has high portability and can be applied to embedded system platforms, showing broad application prospects. This invention has the advantages of fast processing speed, good motion blur removal effect, and strong resistance to environmental interference.

[0059] 2. This invention addresses the problem of blurred images captured by power line inspection robots due to shaking. It creates a dataset suitable for power line inspection scenarios and proposes a method for removing motion blur from power line inspection images based on a multi-scale improved residual block convolutional neural network. A multi-scale improved residual block convolutional neural network model and algorithm are designed. This invention improves the effect and accuracy of deblurring power line inspection images and is suitable for handling the blurring problem in inspection images captured by high-voltage transmission line inspection robots. Attached Figure Description

[0060] Figure 1 This is a schematic diagram of the workflow of the image de-motion blurring method based on multi-scale improved residual block CNN provided in the embodiments of the present invention;

[0061] Figure 2 This is an overall block diagram of a power line inspection system for removing motion blur from inspection images based on a multi-scale improved residual block convolutional neural network, provided by an embodiment of the present invention.

[0062] Figure 3 This is a schematic diagram of the coordinate system of an inspection robot provided in an embodiment of the present invention;

[0063] Figure 4 This is a diagram of a multi-scale improved residual block convolutional neural network model provided in an embodiment of the present invention;

[0064] Figure 5 This is a diagram illustrating the overall structure of a power line inspection image motion blur removal network based on a multi-scale improved residual block convolutional neural network, as provided in this embodiment of the invention.

[0065] Figure 6 This is a power inspection image with motion blur removed, provided in an embodiment of the present invention. Detailed Implementation

[0066] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0067] To address the issue of blurry images captured by high-voltage power transmission line inspection robots, such as... Figure 1 and Figure 2 As shown, this invention provides an image de-motion blurring method based on multi-scale improved residual block CNN, comprising the following steps:

[0068] S1: Collect and save power inspection video data from the power line inspection robot, perform frame segmentation on the collected power inspection video data, then perform image sample screening and image preprocessing to obtain clear and blurry image pairs, create a dataset, and record it as the source dataset.

[0069] S2: Complete the image reprocessing of the source dataset, crop and compress the source dataset to obtain 133 pairs of clear and blurry images, which are denoted as the power inspection deblurred dataset. This dataset is unique to this invention. At present, there is no deblurred dataset in the field of power inspection. Unlike the traditional public dataset GoPro, which uses a method of fusing a dozen consecutive clear images into a blurry image, the power inspection deblurred dataset uses a compression and cropping method of a single blurry image to form a new blurry image.

[0070] S3: Construct a multi-scale improved residual block convolutional neural network, and use the power inspection defuzzification dataset to fully train the multi-scale improved residual block convolutional neural network to obtain a trained multi-scale improved residual block convolutional neural network model. The difference between this model algorithm and the traditional multi-scale convolutional neural network lies in the improvement of the network residual structure and the construction of the loss function.

[0071] S4: Use a trained multi-scale improved residual block convolutional neural network model to deblur the blurred image data of power inspection, then perform target detection and recognition on the deblurred image to determine whether the power inspection target is in a defective state, and record it in the background and cloud.

[0072] In this embodiment, the coordinate system of the power inspection robot is as follows: Figure 3 As shown, refer to Figure 3 The process involves collecting power line inspection data, preprocessing images, and creating datasets.

[0073] In this embodiment, step S1 specifically involves:

[0074] A1: Under the swaying state of the power transmission line inspection robot, data is collected from the power inspection video of the inspection robot, and the power inspection video data under the swaying state of the power transmission line inspection robot is obtained and saved. The power inspection video includes clear images and blurry images in the same scene.

[0075] A2: The inspection video acquired in step A1 is processed by video frame segmentation to obtain the processed image. Then, the image samples are screened to obtain the images that meet the requirements.

[0076] A3: The image acquired in step A2 is preprocessed using the histogram equalization method to obtain the preprocessed image data;

[0077] A4: Perform classification and pairing operations on the preprocessed data obtained in step A3 to obtain one-to-one pairs of clear and blurry images, and record them as the source dataset.

[0078] In this embodiment, step A1 includes:

[0079] While the power transmission line inspection robot is swaying, data is collected from the power inspection video of the robot. The robot takes pictures at different locations on the inspection line, at different focal lengths, and in different scenes, resulting in a series of short videos with a frame rate of 16 frames / second, which are then saved.

[0080] In this embodiment, step A2 specifically involves:

[0081] The video acquired in step A1 is processed frame by frame to obtain 16*t images, where t is the duration of the video.

[0082] After the images are processed by framing, a sample selection process is performed to select images that contain the power line inspection target and discard images that are not related to the power line inspection target.

[0083] In this embodiment, step A3 specifically involves:

[0084] Histogram equalization is used [refer to Gonzalez et al. Digital Image Processing [M]. Electronic Industry Press, 2011: 72-85.] to preprocess the image obtained in step A2, which enhances the local contrast of the image without affecting the overall contrast. Image histogram definition: For a digital image with gray levels in the range [0, L-1], the histogram of this image is a discrete function.

[0085] p(r k ) = n k / n (1)

[0086] Where p is a probability function, r k It is the k-th gray level, k = 0, 1, 2, ..., L-1, where L is the total number of gray levels, and n k The total number of pixels at the k-th gray level in the image is given by , where n is the total number of pixels in the image. This process yields the preprocessed image.

[0087] In this embodiment, step A4 includes:

[0088] The preprocessed images are classified into two main categories: clear images and blurry images.

[0089] The obtained clear and blurry images are paired one-to-one based on the same background and the same inspection target location to obtain the source dataset A1.

[0090] In this embodiment, step S2 specifically involves:

[0091] B1: Crop the images in the source dataset A1. The original image resolution is 2688*1520. Use a fixed-size frame moving method to crop the area containing the power inspection target. The resulting image resolution should be greater than 256 pixels in length and width. The resolution of clear and blurry image pairs should be exactly the same.

[0092] B2: Compress the images obtained in step B1 to ensure that the image length is greater than 256 pixels, the width is greater than 256 pixels, and the resolution of the clear and blurry image pairs are exactly the same. This results in 133 pairs of clear and blurry images, which are denoted as the power inspection deblurring dataset A2.

[0093] In this embodiment, step S3 specifically involves:

[0094] C1: Construct a multi-scale improved residual block convolutional neural network and determine the network structure;

[0095] Reference Figure 4 and Figure 5 The multi-scale improved residual block convolutional neural network consists of three neural network structures of different scales. At each scale, a sharp image is generated as a sub-problem of the deblurring task. This sub-problem takes a blurred image and the initial deblurring result (downsampled from the previous scale) as input and infers what the sharp image will look like at that scale.

[0096] I m h m =Net(B m ,I m+1 ,h m+1 ;θ) (2)

[0097] Among them, I m h represents the deblurred image output by this layer of the network at this scale. m The hidden layer features are at this scale. Net is the multi-scale improved residual block convolutional neural network proposed in this invention. m For the blurred image input to this layer of the network at this scale, I m+1 h is the deblurred image output from the previous scale. m+1 θ represents the hidden layer features of the previous level, θ represents the parameters to be trained, m represents the current level scale, and m+1 represents the previous level scale.

[0098] The neural network structure remains the same at any scale, and the specific construction method is as follows:

[0099] The first part is the input module, which includes a convolutional layer and three improved residual blocks. Each of these improved residual blocks differs from the traditional structure. This invention uses a concatenation operation instead of the element-wise addition operation of the original improved residual block, containing two convolutional layers, a linear rectified function, and a skip concatenation layer. The concatenation operation has three advantages over the element-wise addition operation of the original improved residual block: 1. Information fusion: By connecting two feature maps along the channel dimension, information fusion and combination can be achieved, enabling the network to utilize more contextual information. 2. Enhanced representational power: The connection operation expands the number of channels in the feature maps, increasing the network's representational power and facilitating the learning of more complex feature representations. 3. Multi-scale feature fusion: By connecting feature maps with different spatial resolutions, multi-scale feature fusion can be achieved, improving the model's ability to perceive targets at different scales. The first part of the input comes from the publicly available GoPro dataset and the power line inspection deblurring dataset A2. Each image in the dataset is processed by OpenCV to obtain a local image of size 256*256, which is then sent to the input module to the first convolutional layer. This layer uses 64 3*3 convolutional kernels with a stride of 1 and a padding of 1. The output size of the convolutional layer is calculated using the following formula:

[0100]

[0101] Where Z is the length of the convolution output data, W is the length of the convolution input data, P is the padding amount, F is the length of the convolution kernel, and S represents the stride. For the first coding block in the first part, the output size of the first convolutional layer is calculated by formula (3). The output size of the first convolutional layer is 256*256*64. Since the convolutional layers in the first part use the same kernel size and format, and the same parameters, the final output size of the convolutional layers in the first part and the three improved residual blocks is also 256*256*64.

[0102] The second part consists of a coding structure composed of two coding blocks, where each coding block contains a convolutional layer, a linear rectified function, and three improved residual blocks. For the first coding block in the second part, this layer uses 128 3*3 convolutional kernels with a stride of 2 and a padding of 0.5. The output size of the first convolutional layer is calculated using formula (3), and the output size of the first convolutional layer is 128*128*128. After the first convolutional layer of the coding block, a linear rectified function is used as the activation function, and the data after the activation function is sent to the second convolutional layer of the coding block. The second convolutional layer uses 64 3*3 convolutional kernels with a stride of 2 and a padding of 0.5. According to the formula (3) for calculating the output size of the convolutional layer, The output size of the second convolutional layer in the second part is also 128*128*128; since the convolutional layers in the second part use the same kernel size and format, and the same parameters, the final output size of the first coding block in the second part is 128*128*128; similarly, for the second coding block in the second part, this layer uses 256 3*3 convolutional kernels, with a stride of 2 and a padding amount of 0.5. The output size of the first convolutional layer is calculated by formula (3) and the output size of the first convolutional layer is 64*64*256; since the convolutional layers in the second part use the same kernel size and format, and the same parameters, the final output size of the second coding block in the second part is 64*64*256;

[0103] The third part consists of two decoding blocks, each of which comprises three improved residual blocks, one deconvolutional layer, and one linear rectified function. The output size of the deconvolutional layer is calculated using the following formula:

[0104] Z1=(W1-1)×S1-2×P1+F1 (4)

[0105] Where Z1 is the length of the convolution output data, W1 is the length of the convolution input data, P1 is the padding amount, F1 is the length of the convolution kernel, and S1 represents the stride; according to the formula (4) for calculating the output size of the deconvolution layer, this layer uses 256 3*3 convolution kernels, with a stride of 2 and a padding amount of 0.5. The output size of the first deconvolution layer in the third part is 128*128*256; since the deconvolution layer in the third part uses the same convolution kernel size and format, and the same parameters, and so on, the first decoding block in the third part is the largest The final output size is 128*128*256; similarly, in the second decoding block of the third part, this layer uses 128 3*3 convolution kernels, with a stride of 2 and a padding amount of 0.5. The output size of the first deconvolution layer is calculated by formula (4) and the output size of the first deconvolution layer is 256*256*128; since the deconvolution layer of the second decoding block uses the same convolution kernel size and format, and the same parameters, the final output size of the second decoding block of the third part is 256*256*128;

[0106] The fourth part is the output module, which includes three improved residual blocks and one convolutional layer. This layer uses 64 3*3 convolutional kernels with a stride of 1 and a padding of 1. The output size of the first convolutional layer in the fourth part is 256*256*64. Since the convolutional layers in the fourth part use the same kernel size and format, and have the same parameters, the final output size of the decoding block in the fourth part is 256*256*64.

[0107] C2: Select a network optimizer and train a multi-scale improved residual block convolutional neural network using the public dataset GoPro and the power inspection deblurred dataset A2 to obtain a trained multi-scale improved residual block convolutional neural network model;

[0108] In this embodiment, step C2 specifically involves:

[0109] The GoPro public dataset and the power line inspection deblurring dataset A2 were divided into training and testing sets in a 4:1 ratio. During training, a four-loss weighted balancing function was used as the loss function. The four-loss weighted balancing function is defined as follows:

[0110] L = L p +k1L1+k2L2+k3L3 (5)

[0111]

[0112]

[0113]

[0114]

[0115] Where L is the four-loss weight balance function, k1, k2, and k3 are fusion coefficients, and in this invention, k1, k2, and k3 are all taken as 0.3. p L1 is the perceptual loss function, L2 is the L2 norm loss function, L3 is the multi-scale frequency reconstruction loss function, and φ is the perceptual loss function. i,j W is the feature map obtained by the j-th convolution after activation in the VGG19 network before the max pooling in the i-th layer. i,j H is the width of the feature map. i,j Here, S represents the sharp image, I represents the generated deblurred image, x is the coordinate value in the width direction of the feature map, y is the coordinate value in the height direction of the feature map, n is the batch size, and I... n S is the deblurred image output at the nth scale in this network. n For the clear image output at scale n in this network, t k The total number of elements at the k-th scale is represented by ||·||1, which is the L1 distance operator, and ||·||2, which is the L2 distance operator. F represents the Fast Fourier Transform (FFT) that transmits the image signal to the frequency domain.

[0116] In this embodiment, the network optimizer uses the Adam optimizer [Adam optimizer, English name Adam Optimizer, see Yang Guanci, Yang Jing, Li Shaobo, Hu Jianjun. Improved CNN algorithm based on Dropout and ADAM optimizer [J]. Journal of Huazhong University of Science and Technology (Natural Science Edition), 2018, 46(07):122-127.], with a training batch size of 24 and a learning rate of 5×10⁻⁶. -5 The network is trained sufficiently to obtain a well-trained multi-scale improved residual block convolutional neural network model.

[0117] In this embodiment, step S4 includes:

[0118] D1: Real-time acquisition of inspection image data captured by the power inspection robot during the inspection process, and deblurring of the real-time acquired image data using the trained model obtained in step S3 to obtain the current state of the inspection target.

[0119] D2: Based on the inspection target obtained in step D1, deblur the image, perform target detection and recognition in the image. If the inspection target has defects or damage, the backend and cloud will issue an alarm and record the data.

[0120] To verify the effectiveness of the above-mentioned solution of the present invention, this embodiment takes the Tianjin State Grid inspection and acceptance project as an example. Figure 6As shown, a comparison between the blurred image captured by the robot on-site and the deblurred image reveals that the deblurring effect is particularly significant in the area within the red box. This area belongs to a key component of the hardware and is an important part of the power line inspection target. This demonstrates that the multi-scale improved residual block convolutional neural network provided by this invention has strong adaptability and superiority in motion blur removal for power line inspection.

[0121] Through the implementation of the above technical solution, the advantages of the present invention can be summarized as follows:

[0122] (1) A data acquisition method and data preprocessing process for power inspection robots are provided, including: frame processing, cropping and compression, graphic pairing and histogram equalization.

[0123] (2) It provides a method for creating a dataset and a method for building a multi-scale improved residual block convolutional neural network, which utilizes the difference between clear and blurry image pairs to complete the deblurring of power inspection images.

[0124] (3) A method for de-motion blurring of images based on multi-scale improved residual block CNN is provided. This method has the advantages of fast operation speed, good de-motion blurring effect and strong resistance to environmental interference.

Claims

1. A method for de-motion blurring of images based on multi-scale improved residual block CNN, characterized in that, Includes the following steps: S1: Collect and save power inspection video data from the power line inspection robot, perform frame segmentation on the collected power inspection video data, then perform image sample screening and image preprocessing to obtain clear and blurry image pairs, create a dataset, and record it as the source dataset. S2: The source dataset is cropped and compressed to obtain clear and blurry image pairs, which are denoted as the power inspection deblurred dataset; S3: Build a multi-scale improved residual block convolutional neural network, and use the power inspection defuzzification dataset to fully train the multi-scale improved residual block convolutional neural network to obtain a trained multi-scale improved residual block convolutional neural network model. S4: Use a trained multi-scale improved residual block convolutional neural network model to deblur the blurred image data of power line inspection; Step S1 is as follows: A1: Under the swaying state of the power transmission line inspection robot, data is collected from the power inspection video of the inspection robot, and the power inspection video data under the swaying state of the power transmission line inspection robot is obtained and saved. The power inspection video includes clear images and blurry images in the same scene. A2: The inspection video acquired in step A1 is processed by video frame segmentation to obtain the processed image. Then, the image samples are screened to obtain the images that meet the requirements. A3: The image acquired in step A2 is preprocessed using the histogram equalization method to obtain the preprocessed image data; A4: Perform classification and pairing operations on the preprocessed data obtained in step A3 to obtain one-to-one pairs of clear and blurry images, and record them as the source dataset; Step S3 is as follows: C1: Construct a multi-scale improved residual block convolutional neural network and determine the network structure; C2: Select a network optimizer and use the public dataset GoPro with the power line inspection deblurred dataset. The multi-scale improved residual block convolutional neural network is trained to obtain a trained multi-scale improved residual block convolutional neural network model; The multi-scale improved residual block convolutional neural network structure in step C1 consists of three neural network structures of different scales. At each scale, a sharp image is generated as a sub-problem of the deblurring task. This sub-problem takes a blurred image and the initial deblurring result as input and infers what the sharp image at that scale will look like: (2) in, This is the deblurred image output by this layer of the network at this scale. These are the hidden layer features at this scale. This invention proposes a multi-scale improved residual block convolutional neural network. This refers to the blurred image input to this layer of the network at this scale. This is the deblurred image output from the previous scale. These are the hidden layer features at the next higher scale. Here are the parameters to be trained, m is the current scale, and m+1 is the previous scale; The neural network structure is the same at any scale in step C1, and the specific construction method is as follows: The first part is the input module, which consists of a convolutional layer and three improved residual blocks; The second part consists of a coding structure composed of two coding blocks, each of which contains a convolutional layer, a linear rectified function, and three improved residual blocks. The third part consists of two decoding blocks, each of which consists of three improved residual blocks, a deconvolution layer and a linear rectified function. The fourth part is the output module, which includes three improved residual blocks and one convolutional layer.

2. The image de-motion blurring method based on multi-scale improved residual block CNN according to claim 1, characterized in that, Step A2 specifically involves: The video acquired in step A1 is processed frame by frame to obtain 16*t images, where t is the duration of the video. After the images are processed by framing, a sample selection process is performed to select images that contain the power line inspection target and discard images that are not related to the power line inspection target.

3. The image de-motion blurring method based on multi-scale improved residual block CNN according to claim 1, characterized in that, Step A3 specifically involves: Histogram equalization is used to preprocess the image obtained in step A2 to enhance local contrast without affecting overall contrast. Image histogram definition: For a digital image with gray levels in the range [0, L-1], the histogram is a discrete function. (1) in Let be a probability function. It is the k-th gray level, where k = 0, 1, 2, ..., L-1, and L is the total number of gray levels. It is the total number of pixels at the k-th gray level in the image. It is the total number of pixels in the image, which is then used to obtain the preprocessed image.

4. The image de-motion blurring method based on multi-scale improved residual block CNN according to claim 1, characterized in that, Step S2 specifically involves: B1: Source dataset The image is cropped. The original image resolution is 2688*1520. A fixed-size frame is used to crop the area containing the power inspection target. The resulting image resolution must be greater than 256 pixels in length and width. The resolution of clear and blurry image pairs must be exactly the same. B2: Compress the images obtained in step B1 to ensure that the image length and width are greater than 256 pixels, and that the resolution of the clear and blurred image pairs are exactly the same. This results in clear and blurred image pairs, which are denoted as the power inspection deblurring dataset. .

5. The image de-motion blurring method based on multi-scale improved residual block CNN according to claim 4, characterized in that, In the first part of the input module, this invention uses a concatenation operation to replace the element-wise addition operation of the original improved residual block, and includes two convolutional layers, a linear rectified function, and a skip concatenation layer; the input of the first part comes from the public dataset GoPro and the power inspection deblurring dataset. Each image in the dataset is processed by OpenCV to obtain a local image of size 256*256, which is then sent to the input module and fed into the first convolutional layer. This layer uses 64 3*3 convolutional kernels with a stride of 1 and a padding of 1. The output size of the convolutional layer is calculated using the following formula: (3) in, It is the length of the convolution output data. It is the length of the input data for the convolution. It is the fill quantity. It is the length of the convolution kernel. The step size is indicated; for the first coding block in the first part, the output size of the first convolutional layer is calculated by formula (3). The output size of the first convolutional layer is 256*256*64; since the convolutional layers in the first part use the same kernel size and format, and the same parameters, the final output size of the convolutional layers in the first part and the three improved residual blocks is also 256*256*64. In the second part of the coding structure, for the first coding block in the second part, this layer uses 128 3*3 convolutional kernels with a stride of 2 and a padding amount of 0.

5. The output size of the first convolutional layer is calculated using formula (3), and the output size of the first convolutional layer is 128*128*128. After the first convolutional layer of the coding block, a linear rectified function is used as the activation function, and the data after the activation function is sent to the second convolutional layer of the coding block. The second convolutional layer uses 64 3*3 convolutional kernels with a stride of 2 and a padding amount of 0.

5. According to the formula (3) for calculating the output size of the convolutional layer, the output size of the second convolutional layer in the second part is also 128*128*128. 8*128*128; Since the convolutional layers in the second part use the same kernel size and format, and the same parameters, the final output size of the first coding block in the second part is 128*128*128; Similarly, for the second coding block in the second part, this layer uses 256 3*3 convolutional kernels, with a stride of 2 and a padding amount of 0.

5. The output size of the first convolutional layer is calculated by formula (3) and the output size of the first convolutional layer is 64*64*256; Since the convolutional layers in the second part use the same kernel size and format, and the same parameters, the final output size of the second coding block in the second part is 64*64*256; In the two decoding blocks of the third part, the formula for calculating the output size of the deconvolution layer is as follows: (4) in, It is the length of the convolution output data. It is the length of the input data for the convolution. It is the fill quantity. It is the length of the convolution kernel. The stride is indicated by the formula (4) for calculating the output size of the deconvolution layer. This layer uses 256 3*3 convolution kernels with a stride of 2 and a padding of 0.

5. The output size of the first deconvolution layer in the third part is 128*128*256. Since the deconvolution layer in the third part uses the same kernel size and format, and the same parameters, the final output size of the first decoding block in the third part is 128*128*256. Similarly, for the second decoding block in the third part, this layer uses 128 3*3 convolution kernels with a stride of 2 and a padding of 0.

5. The output size of the first deconvolution layer is calculated by formula (4) and is 256*256*128. Since the deconvolution layer in the second decoding block uses the same kernel size and format, and the same parameters, the final output size of the second decoding block in the third part is 256*256*128. The output module of the fourth part uses 64 3*3 convolutional kernels with a stride of 1 and a padding quantity of 1. The output size of the first convolutional layer in the fourth part is 256*256*64. Since the convolutional layers in the fourth part use the same kernel size and format, and have the same parameters, the final output size of the decoding block in the fourth part is 256*256*64.

6. The image de-motion blurring method based on multi-scale improved residual block CNN according to claim 1, characterized in that, Step C2 specifically involves: Compare the public GoPro dataset with the power inspection deblurred dataset The dataset is divided into training and test sets in a 4:1 ratio. During training, a four-loss weighted balancing function is used as the loss function. The four-loss weighted balancing function is defined as follows: (5) (6) (7) (8) (9) in, This is a four-loss weighting balance function. , and The fusion coefficient is... For the perceptual loss function, The L1 norm loss function, The L2 norm loss function, For multi-scale frequency reconstruction loss function, It is the feature map obtained by the j-th convolution after activation in the network before the max pooling in the i-th layer. It is the width of the feature map. It is the height of the feature map. Represents a clear image. This represents the generated deblurred image. These are the coordinate values ​​along the width direction of the feature map. These are the coordinates of the feature map's height direction, where n is the batch size. This is the deblurred image output at the nth scale in this network. This is the clear image output at the nth scale in this network. Indicates the first The total number of elements at each scale It is an L1 distance operator. It is the L2 distance operator. This represents the Fast Fourier Transform (FFT) that transmits image signals to the frequency domain. The network optimizer uses the Adam optimizer, with a training batch size of 24 and a learning rate of 0.5%. The network is trained thoroughly to obtain a well-trained multi-scale improved residual block convolutional neural network model.