A single image deraining method based on end-to-end neural network

By using end-to-end neural networks in image processing, combined with graph convolutional networks and attention convolutional networks, the problem of rain removal from images is solved, the effect of effectively removing raindrops is achieved, and the quality of image processing is improved.

CN114529470BActive Publication Date: 2024-09-20SHENZHEN HONGYUE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210156295.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2024-09-20
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

It is difficult to effectively remove raindrop interference in images with existing technology, which affects the performance of applications such as visual target detection and target segmentation.

Method used

Design a single image rain removal method based on end-to-end neural network, combining graph convolution network and attention convolution network, and extracting global and local features of the image through the loss function of short connection and contrast-aware regularization constraints. , remove raindrops.

Benefits of technology

It achieves better rain removal effect and improves the quality of image processing, especially on DID-Data, Rain200L, Rain200H, SPA-Data and other data sets, which outperforms existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114529470B
    Figure CN114529470B
Patent Text Reader

Abstract

The present invention provides a single image deraining method based on an end-to-end neural network, comprising the following steps: S1, constructing a neural network model; S2, designing a loss function; S3, training the neural network model using rainy images and rainless images to obtain model parameters of the neural network model; S4, importing the model parameters trained in step S3 into the neural network model, inputting a rainy image, adding a regularization constraint based on contrast perception to the loss function, and outputting a rainless image. The present invention proposes a single image deraining method based on an end-to-end neural network, designs a basic module that integrates a graph convolutional network and an attention convolutional network, which is used to extract global and local features of an image, and adds a regularization constraint based on contrast perception to the loss function, thereby achieving a good deraining effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a single image rain removal method based on an end-to-end neural network. Background Art

[0002] Rainfall is a common natural phenomenon. Vision-based applications such as object detection and object segmentation usually assume a good environment. Raindrops in images can easily interfere with these applications. Therefore, image deraining has high application value. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a single image deraining method based on an end-to-end neural network. A basic module that integrates a graph convolutional network and an attention convolutional network is designed to extract the global and local features of the image, and a regularization constraint term based on contrast perception is added to the loss function to achieve better deraining effect.

[0004] To solve the above technical problems, an embodiment of the present invention provides a single image rain removal method based on an end-to-end neural network, comprising the following steps:

[0005] S1. Build an end-to-end image deraining network model: It consists of a 3×3 convolution layer, two downsampling layers, several basic modules, two variable convolution layers, two upsampling layers and a 3×3 convolution layer;

[0006] S2. Design loss function: It consists of L1 distance function and contrast-aware regularization constraint;

[0007] S3, training a neural network model using rainy images and rainless images to obtain model parameters of the neural network model;

[0008] S4. Import the model parameters trained in step S3 into the neural network model, input the rainy image, and output the rain-free image.

[0009] In step S1, a short connection is made between the downsampling layer and the upsampling layer, and a short connection is made between the head and the tail of the basic module.

[0010] The short connection method is as follows: the low-level output F l and high-level output F h Cascade F = [F l ,F h ], and then processed by a 1×1 convolutional layer.

[0011] The basic module consists of a graph convolutional network and an attention convolutional network, and its input feature F inAfter extracting global and local features through a spatial graph convolutional network (sGCN), several attention convolutional networks (CAMs), and a channel graph convolutional network (cGCN), the features are introduced from the low-level network to the high-level network through short connections to obtain the output feature F out .

[0012] The attention convolution network (CAM) is composed of two dilated convolution layers and an attention module (AM), wherein the dilated convolution parameter DF of the first dilated convolution layer is 1, and the dilated convolution parameter DF of the second dilated convolution layer is 3;

[0013] Two short connections are added to the attention convolutional network to introduce global features and local features from the low-level network to the high-level network.

[0014] Furthermore, the attention unit is composed of the fusion of spatial attention and pixel attention, and the fusion steps are as follows:

[0015] (1) Use global average pooling to process input features:

[0016]

[0017] Among them, H p represents the global average pooling function, X c (i,j) represents the value of the c channel of the input value at (i,j);

[0018] (2) The pooled features are extracted through two dilated convolutional layers. The dilated convolution parameter of the first dilated convolutional layer is set to DF=1, and the ReLU activation function is used. The dilated convolution parameter of the second dilated convolutional layer is set to DF=3, and the sigmoid activation function is used to obtain CA:

[0019] CA=σ(DConv(δ(DConv(g c ))));

[0020] Among them, σ represents the sigmoid function, δ represents the ReLU function;

[0021] (3) Multiply the input feature by CA to obtain the channel attention feature CA * :

[0022]

[0023] Then CA * Through two layers of dilated convolutional layers, the dilation parameters are set to DF=1 and DF=3 respectively:

[0024] PA=σ(Conv(δ(Conv(CA* ))));

[0025] Finally, the channel attention and pixel attention are fused to output:

[0026]

[0027] The spatial graph convolutional network (sGCN) is used to learn the association between pixels in the feature space, and the learning process is as follows:

[0028] (1) Let the input feature be F∈R HW×C ;

[0029] Among them, H and W represent the feature height and width respectively, and C represents the number of channels;

[0030] (2) The input features are processed by three 1×1 convolutional layers, where the last two convolutional layers add softmax activation functions to prevent numerical instability. The output features are:

[0031] F sGCN =F in +A sGCN F s W sGCN ;

[0032] Among them, F s =conv(F in ), A sGCN is the adjacency matrix, W sGCN is a weight matrix.

[0033] Among them, it is calculated by the last convolutional layer in the figure.

[0034] The channel graph convolutional network (cGCN) is used to learn the channel-level global correlation relationship in the feature graph, and the learning process is as follows:

[0035] (1) Let the input feature F in ∈R HW×C ;

[0036] Among them, H and W represent the feature height and width respectively, and C represents the number of channels;

[0037] (2) The input features are processed by two 1×1 convolutional layers, and the output features are:

[0038]

[0039] (3) Using the softmax activation function, the output features are:

[0040]

[0041] (4)F c After being processed by a 1×1 hole convolution layer, After being processed by a 3×3 dilated convolutional layer, where the dilation parameters are set to DF=1 and DF=3, we get F d ;

[0042] (5)F d and Performing the dot product, we get:

[0043] (6)F e After a 1×1 convolutional layer, the in The final output is expressed as:

[0044]

[0045] Among them, the loss function in step S2 is defined as follows:

[0046]

[0047] Among them, J represents the real rain-free image, I represents the input rainy image, φ(I,w) represents the de-rained image obtained after network processing, w represents the parameters of the model, and ‖J-φ(I,w)‖1 represents the L1 loss value;

[0048] represents the contrast-aware regularization constraint, G i (·) represents the image features extracted by the pre-trained model. Here, the VGG-19 pre-trained network is used. D(·) represents the L1 distance, n represents the number of layers of extracted image features, and ω i Represents the characteristic coefficient of each layer, and α represents the regularization ratio parameter.

[0049] The steps of training the neural network model are as follows: (1) selecting a sample set of rainy-no-rainy image pairs, 12,000 each, and 1,200 pairs of test images;

[0050] (2) The optimization function is Adam, the parameters β1 = 0.9 and β2 = 0.99, and the learning rate is set to 0.001;

[0051] (3) Train for 200 rounds and test the results every 20 rounds. The test results are measured using peak signal-to-noise ratio (PSNR) and structural similarity (SSIM). The best result is selected to save the model parameters.

[0052] The beneficial effects of the above technical solution of the present invention are as follows: The present invention proposes a single image deraining method based on an end-to-end neural network, designs a basic module that integrates a graph convolutional network and an attention convolutional network to extract global and local features of the image, and adds a regularization constraint term based on contrast perception to the loss function, thereby achieving better deraining effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a diagram of the image deraining network model in the present invention;

[0054] Figure 2 A network model diagram of a basic module in the present invention;

[0055] Figure 3 This is the attention convolution network model diagram in the present invention;

[0056] Figure 4 is a structural diagram of the attention unit in the present invention;

[0057] Figure 5 This is a model diagram of the spatial graph convolutional network in the present invention;

[0058] Figure 6 It is a channel graph convolutional network model diagram in the present invention;

[0059] Figure 7 A comparison diagram of an image before and after defogging in the first embodiment of the present invention;

[0060] Figure 8 This is a comparison diagram of an image before and after defogging in the second embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0062] The present invention provides a single image rain removal method based on an end-to-end neural network, comprising the following steps:

[0063] S1. Build an end-to-end image deraining network model (see Figure 1 ): It consists of a 3×3 convolutional layer, two downsampling layers, several basic modules, two variable convolutional layers, two upsampling layers and a 3×3 convolutional layer;

[0064] S2. Design loss function: It consists of L1 distance function and contrast-aware regularization constraint;

[0065] S3, training a neural network model using rainy images and rainless images to obtain model parameters of the neural network model;

[0066] S4. Import the model parameters trained in step S3 into the neural network model, input the rainy image, and output the rain-free image.

[0067] In the step S1, a short connection is made between the downsampling layer and the upsampling layer, and a short connection is made between the head and the tail of the basic module.

[0068] The short connection method is: the low-level output F l and high-level output F h Cascade F = [F l ,F h ], and then processed by a 1×1 convolutional layer.

[0069] The basic module consists of a spatial graph convolutional network and an attention convolutional network, and its network model is as follows: Figure 2 As shown, its input feature F in After extracting global and local features through a spatial graph convolutional network (sGCN), several attention convolutional networks (CAMs), and a channel graph convolutional network (cGCN), the features are introduced from the low-level network to the high-level network through short connections to obtain the output feature F out .

[0070] The attention convolutional network (CAM) consists of two hole convolutional layers and an attention module (AM), and its structure is as follows: Figure 3 As shown, the dilated convolution parameter DF of the first dilated convolution layer is 1, and the dilated convolution parameter DF of the second dilated convolution layer is 3;

[0071] Two short connections are added to the attention convolutional network to introduce global features and local features from the low-level network to the high-level network.

[0072] The attention unit is composed of the fusion of spatial attention and pixel attention, and its structure is as follows: Figure 4 As shown, the fusion steps are as follows:

[0073] (1) Use global average pooling to process input features:

[0074]

[0075] Among them, H p represents the global average pooling function, X c (i,j) represents the value of the c channel of the input value at (i,j);

[0076] (2) The pooled features are extracted through two dilated convolutional layers. The dilated convolution parameter of the first dilated convolutional layer is set to DF=1, and the ReLU activation function is used. The dilated convolution parameter of the second dilated convolutional layer is set to DF=3, and the sigmoid activation function is used to obtain CA:

[0077] CA=σ(DConv(δ(DConv(g c ))));

[0078] Among them, σ represents the sigmoid function, δ represents the ReLU function;

[0079] (3) Multiply the input feature by CA to obtain the channel attention feature CA * :

[0080]

[0081] Then CA * Through two layers of dilated convolutional layers, the dilation parameters are set to DF=1 and DF=3 respectively:

[0082] PA=σ(Conv(δ(Conv(CA * ))));

[0083] Finally, the channel attention and pixel attention are fused to output:

[0084]

[0085] The spatial graph convolutional network (sGCN) is used to learn the association between pixels in the feature space. The structure is as follows Figure 5 As shown, the learning process is as follows:

[0086] (1) Let the input feature be F∈R HW×C ;

[0087] Among them, H and W represent the feature height and width respectively, and C represents the number of channels;

[0088] (2) The input features are processed by three 1×1 convolutional layers, where the last two convolutional layers add softmax activation functions to prevent numerical instability. The output features are:

[0089] F sGCN =F in +A sGCN F s W sGCN ;

[0090] Among them, F s =conv(F in ),A sGCNis the adjacency matrix, which is calculated by the convolution shown in the figure:

[0091]

[0092] Among them, W sGCN is a weight matrix calculated by the last convolutional layer shown in the figure.

[0093] The channel graph convolutional network (cGCN) is used to learn the channel-level global correlation relationship in the feature graph, and its structure is as follows: Figure 6 As shown, the learning process is as follows:

[0094] (1) Let the input feature F in ∈R HW×C ;

[0095] Among them, H and W represent the feature height and width respectively, and C represents the number of channels;

[0096] (2) The input features are processed by two 1×1 convolutional layers, and the output features are:

[0097]

[0098] (3) Using the softmax activation function, the output features are:

[0099]

[0100] (4)F c After being processed by a 1×1 hole convolution layer, After being processed by a 3×3 dilated convolutional layer, where the dilation parameters are set to DF=1 and DF=3, we get F d ;

[0101] (5)F d and Performing the dot product, we get:

[0102] (6)F e After a 1×1 convolutional layer, the in The final output is expressed as:

[0103] The loss function in step S2 is defined as follows:

[0104]

[0105] Among them, J represents the real rain-free image, I represents the input rainy image, φ(I,w) represents the de-rained image obtained after network processing, w represents the parameters of the model, and ‖J-φ(I,w)‖1 represents the L1 loss value;

[0106] represents the contrast-aware regularization constraint, G i (·) represents the image features extracted by the pre-trained model. Here, the VGG-19 pre-trained network is used. D(·) represents the L1 distance, n represents the number of layers of extracted image features, and ω i Represents the characteristic coefficient of each layer, and α represents the regularization ratio parameter.

[0107] Preferably, when the present invention is implemented, the features of the 1st, 3rd, 5th, 9th and 13th layers of VGG-19 are extracted, ω i They are and α=0.2.

[0108] In the present invention, the steps of training the neural network model are:

[0109] (1) Select a sample set of "rainy-no-rainy" image pairs, 12,000 each, and 1,200 pairs of test images;

[0110] (2) The optimization function is Adam, the parameters β1 = 0.9 and β2 = 0.99, and the learning rate is set to 0.001;

[0111] (3) Train for 200 rounds and test the results every 20 rounds. The test results are measured using peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) to obtain the trained model parameters.

[0112] In order to verify the innovation of the present invention, tests were conducted and the test results are as follows: using peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) as measurements, the test results on multiple data sets such as DID-Data, Rain200L, Rain200H, and SPA-Data are better than the existing methods. The visualization effect after rain removal is as follows: Figure 7 , Figure 8 shown.

[0113] in, Figure 7 a and Figure 8 a is the image before rain removal, Figure 7 b and Figure 8 b is the image after rain removal.

[0114] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A single image deraining method based on an end-to-end neural network, characterized in that: The steps include: S1. Construct a neural network model: It consists of a 3×3 convolution layer, two downsampling layers, several basic modules, two variable convolution layers, two upsampling layers and a 3×3 convolution layer; S2. Design loss function: It consists of L1 distance function and contrast-aware regularization constraint; S3, training a neural network model using rainy images and rainless images to obtain model parameters of the neural network model; S4, importing the model parameters trained in step S3 into the neural network model, inputting the rainy image, and outputting the rain-free image; The basic module consists of a spatial graph convolutional network and an attention convolutional network, whose input feature F in After extracting global and local features through a spatial graph convolutional network, several attention convolutional networks, and a channel graph convolutional network, the features are introduced from the low-level network to the high-level network through short connections to obtain the output feature F out ; The spatial graph convolutional network is used to learn the association relationship between pixels in the feature space. The learning process is as follows: (1) Let the input feature be F∈R HW×C ; Among them, H and W represent the feature height and width respectively, and C represents the number of channels; (2) The input features are processed by three 1×1 convolutional layers, where the last two convolutional layers add softmax activation functions to prevent numerical instability. The output features are: F sGCN =F in +A sGCN F s W sGCN ; Among them, F s =conv(F in ), A sGCN is the adjacency matrix, W sGCN is the weight matrix; The channel graph convolutional network is used to learn the channel-level global association relationship in the feature graph, and the learning process is as follows: (1) Let the input feature F in ∈R HW×C ; Among them, H and W represent the feature height and width respectively, and C represents the number of channels; (2) The input features are processed by two 1×1 convolutional layers, and the output features are: (3) Using the softmax activation function, the output features are: (4)F c After being processed by a 1×1 hole convolution layer, After being processed by a 3×3 dilated convolutional layer, where the dilation parameters are set to DF=1 and DF=3, we get F d ; (5)F d and Performing the dot product, we get: (6)F e After a 1×1 convolutional layer, F in Add together to get the final output:

2. The single image deraining method based on end-to-end neural network according to claim 1, characterized in that: In step S1, a short connection is made between the downsampling layer and the upsampling layer, and a short connection is made between the head and the tail of the basic module.

3. The single image deraining method based on end-to-end neural network according to claim 2, characterized in that: The short connection method is: Low level output F l and high-level output F h Cascade F = [F l ,F h ], and then processed by a 1×1 convolutional layer.

4. The single image deraining method based on end-to-end neural network according to claim 3 is characterized in that: The attention convolution network consists of two dilated convolution layers and an attention unit, wherein the dilated convolution parameter DF of the first dilated convolution layer is 1, and the dilated convolution parameter DF of the second dilated convolution layer is 3; Two short connections are added to the attention convolutional network to introduce global features and local features from the low-level network to the high-level network.

5. The single image deraining method based on end-to-end neural network according to claim 4, characterized in that: The attention unit is composed of the fusion of spatial attention and pixel attention. The fusion steps are as follows: (1) Use global average pooling to process input features: Among them, H p represents the global average pooling function, X c (i,j) represents the value of the c channel of the input value at (i,j); (2) The pooled features are extracted through two dilated convolutional layers. The dilated convolution parameter of the first dilated convolutional layer is set to DF=1, and the ReLU activation function is used. The dilated convolution parameter of the second dilated convolutional layer is set to DF=3, and the sigmoid activation function is used to obtain CA: CA=σ(DConv(δ(DConv(g c )))); Among them, σ represents the sigmoid function, δ represents the ReLU function; (3) Multiply the input feature by CA to obtain the channel attention feature CA * : Then CA * Through two layers of dilated convolutional layers, the dilation parameters are set to DF=1 and DF=3 respectively: PA=σ(Conv(δ(Conv(CA * )))); Finally, the channel attention and pixel attention are fused to output:

6. The single image deraining method based on end-to-end neural network according to claim 1, characterized in that: The loss function in step S2 is defined as follows: Among them, J represents the real rain-free image, I represents the input rainy image, φ(I,w) represents the de-rained image obtained after network processing, w represents the parameters of the model, and ||J-φ(I,w)||1 represents the L1 loss value; represents the contrast-aware regularization constraint, G i (·) represents the image features extracted by the pre-trained model, D(·) represents the L1 distance, n represents the number of layers of extracted image features, ω i Represents the characteristic coefficient of each layer, and α represents the regularization ratio parameter.

7. The single image deraining method based on end-to-end neural network according to claim 1, characterized in that: The steps for training the neural network model are as follows: (1) select a sample set of rainy-no-rainy image pairs, 12,000 each, and 1,200 pairs of test images; (2) The optimization function is Adam, with parameters β1 = 0.9 and β2 = 0.99, and the learning rate is set to 0.001; (3) Train for 200 rounds and test the results every 20 rounds. The test results are measured using peak signal-to-noise ratio and structural similarity. The best result is selected to save the model parameters.