Research on image de-raining method based on high scale rain pattern image block training algorithm
Publié en ligne: 19 mars 2025
Reçu: 02 nov. 2024
Accepté: 09 févr. 2025
DOI: https://doi.org/10.2478/amns-2025-0355
Mots clés
© 2025 Kan Ni et al., published by Sciendo
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Image rain removal algorithm is an important algorithm that has emerged in the development of automated computer vision technology in recent years. It is applied in the field of image processing and computer vision to improve the quality of images captured in low light or bad weather (e.g., rain). It has been widely used in automated vision computer technology, such as robot navigation, street scene image recognition, etc. [1-4]. The basic principle of image rain removal algorithm is to use image restoration algorithm to restore the blurred raindrops and other noises. The core of image rain removal algorithm is model construction, accurate construction is conducive to improve image quality and reduce noise in the image [5-7]. The main technical strategies are: quality-based methods, application of deep learning techniques, hybrid entropy algorithms and optimization techniques [8-9].
The quality-based approach treats the rain removal process as a parameter estimation problem, estimates the noise and non-noise parts of the image separately, and uses least squares to estimate the noise, thus obtaining a small estimation error, which makes the quality of the image in low light or bad weather at the time of shooting greatly improved [10-13]. Deep learning technology, which utilizes deep neural networks, can automatically identify patterns and build models. In the image de-raining algorithm, deep learning technology can be used to train multiple deep neural networks, which can effectively enhance the performance of image processing, thus significantly improving the clarity of images in low light such as raindrops [14-17]. The mixed entropy algorithm combines the least squares technique, as well as information entropy and constrained optimization techniques to achieve better rain removal [18-19].
In this paper, a CNN-based rain removal algorithm for high-scale rain streak image patch training is proposed to address the problem of excessive blurring of rain-free regions in rain streak detection algorithms. A three-layer CNN network structure is used to extract the rain streak module using multi-scale feature extraction to obtain location information about rain streaks. The mapping relationship between the high scale rain streak image block and the rain-free image is trained by CNN to reduce the interference of the background features on the network training and optimize the accuracy of the rain removal algorithm. Establish the objective function that will separate the rain streak layer and the background layer. Remove the residuals in the background layer using a gradient before restoring the real image. Design experimental sessions and experimental details to compare the performance of this paper’s algorithm with the classical rain removal algorithm using public datasets.
Since rain and snow are often considered to be the same type of noise in image processing, this paper only discusses the case of rain. For the complexity of the direction and shape of rain streaks, it leads to localized blurring of the image after de-raining, which degrades the road recognition accuracy. In the case of heavy rain, it is easy to produce a masking effect similar to fog. If this type of situation is not considered, the masking effect distorts the road after de-raining and affects the accuracy of road recognition. Therefore, the study of effective rain removal algorithms can solve the problem of road recognition failure in complex weather.
In this regard, this paper proposes a rain removal algorithm based on the training of a high percentage of rain streak image blocks, and can automatically detect the location of rain streaks and remove the blurring effect of rain streaks and the masking effect on the image. The algorithm uses the following image processing techniques to address the shortcomings in existing methods.
Rain and fog are very common in nature. In rainy and foggy weather, the impact of rain and fog on the imaging quality of the imaging system should not be ignored, rain and fog can cause image degradation, color distortion, lack of saturation, brightness and contrast reduction and other problems.
Among computer vision, the generalized fog image imaging model is as follows:
where
where
Most studies on image defogging algorithms use the atmospheric scattering model as the theoretical model for image defogging. Based on the relevant a priori assumptions, the fog-free image
In general, when an imaging system photographs rain, the rain appears as vertical stripes on the image. In the presence of other factors such as wind, the rain vertical stripes become diagonal stripes under the effect of wind.
Models of rain are generally divided into three categories: simple additive models,
where
Where parameter
The nonlinear mixing model is:
The above model adds the nonlinear term
Since physical models play a key role in for describing the imaging process under rainfall conditions, this subsection provides a brief review of the evolution of rainfall modeling. For the traditional approach, a simple linear combination model is defined:
where
where
In order to solve the above problems, the formula is further extended to obtain a physical model for synthetic images that is more representative of natural images:
where
The atmospheric shading effect produced by rain streak accumulation is imposed on the image of rainwater pollution, and according to Equation (8), the division of rainwater accumulation effect and rain streak separation and removal has some rationality. However, in practice, solving the problem in the equation requires an artificial a priori decomposition method. Therefore, in this paper, we plan to use a convolutional neural network-based approach to learn a function
In this paper, Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM) are used as methods to objectively evaluate image quality. The performance of the de-raining methods is compared visually through numerical values. The principles of these two evaluation metrics will be described separately below.
PSNR: Peak Signal-to-Noise Ratio is an objective criterion for evaluating the quality of an image by the error between the corresponding pixel points of the image. Its unit is dB, and a larger value indicates a smaller distortion of the image. I.e.:
Where MSE denotes the mean square error of Fig.
SSIM: Structural similarity is a measure of similarity between two images. The similarity of the images is evaluated through three aspects: brightness, contrast and structure. It has a value range of [0,1]. Larger values indicate less distortion in the image. I.e.:
where
In this section, a CNN-based rain removal algorithm for high-percent rain streak images is proposed using the CNN deep learning framework [20]. The data processing process of this algorithm is divided into four steps, and the flowchart of CNN-based rain removal algorithm is shown in Figure 1.

CNN’s rain flow
In the first step, according to the characteristics of rain streaks belonging to high-frequency noise, low-pass bilateral filtering is used to initially separate the low-frequency background layer (IL) and high-frequency rain streak layer (IH). Meanwhile, in order to calculate the location information of rain streaks and improve the accuracy of the rain removal algorithm, the input RGB image with rain is transformed into a YUV image, and the CNN1 is trained to learn the mapping from the luminance image to the binary rain map.
The second step utilizes the rain streak location information of the binary rain map to select the image blocks with high percentage of rain in the high-frequency rain layer as the training set of the CNN2, so that the CNN2 learns the mapping from the high-frequency rain layer to the high-frequency rain-free layer, and improves the de-raining ability of the CNN2, so as to obtain the high-frequency rain-free layer.
The third step superimposes the low-frequency background layer and the high-frequency rain-free layer, which were separated in the first step, to compute the rain-free image.
In the fourth step when fog residue is detected in the image, the de-fogging algorithm in the rain-fog model is utilized to remove the masking effect of the image and improve the clarity of the image as well as to improve the subsequent road recognition accuracy.
The rain streak detection sub-network consists of a multi-scale feature extraction module and a multi-scale feature fusion module. The main purpose of the multi-scale feature extraction module is to extract additional features from multi-scale inputs. Different scales contain rich rain streak information, and the rain streaks at the same location will be complemented with the rain streak information at other locations after downsampling. The multi-scale feature fusion module is used to integrate and complement the obtained multi-scale rain streak information, so that the rain streak detection sub-network can quickly and accurately detect all rain streaks. These two parts are described in detail below.
The input continuous video frame
where
The multiscale representation information is first normalized by layer normalization (LN), and then the features are processed by 3D convolution with a convolution kernel size of 1×1×1 and 3D depth-separable convolution of 3×3×3. Model complexity can be reduced by using simple gating units (SGUs) instead of nonlinear activation functions. The SGU divides the features into two parts and multiplies them directly in the channel dimension, then passes the features into the simplified channel attention (SCA) for attention computation, and then outputs the results of the features in the upper half of the irrelevant block of the 3D nonlinear activation function through a convolution with a convolution kernel of 1×1×1.
The process of processing the feature results of the upper half of the 3D nonlinear activation function-independent block can be described using the following equation:
The inputs for the lower part of the 3D nonlinear activation function independent block are obtained by jump-joining, and the inputs are sequentially subjected to layer normalization, 1×1×1 -convolution, simple gating unit, and 1×1×1 -convolution to obtain the final multiscale feature result. The processing can be described using the following equation:
The obtained multiscale features have rich rain streak information at each scale, and the complementary information between them facilitates the subsequent multiscale feature fusion, and also provides an antecedent basis for accurate and fast rain streak detection.
In order to efficiently fuse spatio-temporal features extracted at different scales, a multi-scale feature fusion module (MSFF) is proposed. The structure of the multiscale feature fusion module is shown in Fig. 2, where the features extracted in the lower scale are subjected to an up-sampling operation

Multi-scale feature fusion module structure
The processing can be represented by the following process:
where
According to the frequency characteristics of rain streaks, low-pass filtering such as bilateral filtering or median filtering will have rain image (low-pass filtering method for layer separation of the image is shown in Fig. 3), initially decomposed into a high-frequency rain streak image and a low-frequency background layer image [21]. As shown in equation (19):
where

Low pass filtering method for image layer separation
Where
By using the mean square error to minimize the difference between layer
For example, as can be seen in Fig. 3(c), there are still some rain streaks in layer
To overcome these constraints and limitations, a binary rain map is used to provide a high proportion of rain streak image blocks as a training set to solve the above problem.
In order to compute the binary rain map as well as to save storage space, the color image with rain
Where,
where
In order to obtain the high-frequency rain-free image, this paper combines the binary rain streak location information and the high-frequency layer rain streak image to obtain a denser rain streak feature map. Then CNN2 is trained to learn the mapping from the high-frequency rain streak map to the rain-free high-frequency image (
The rain-free image
After 1000 iterations of the CNN2 network, the high

Comparison of rain algorithm
In order to solve the above problems and to speed up the processing of the algorithm, the fusion of LiDAR and vision sensors is used to obtain the position information of the object as well as the road. Then the image of the region is optimized instead of optimizing the whole image. In this regard, based on the observation of the residual rain streaks in the image and the a priori knowledge of the natural image, it can be obtained that the color gradient of the natural image varies more compared to the area covered by the rain streaks. Therefore, the objective function based on gradient constraints is used to optimize the local regions of the de-raining image.
Assuming that a spatial point
where
To optimize the region of interest (background layer), the binary rain streak location map (
The first term
The rain removal algorithm combining CNN and gradient constraints can obtain rain-free images with high clarity. However, under heavy rain conditions, rain streaks and masking effect exist simultaneously as shown in Fig. 5. The image after rain removal is still affected by the masking effect and locally blurred, resulting in reduced image clarity as well as subsequent road recognition failure. According to the rain and fog model proposed in this paper, the fog in the image is removed, the image color information is restored, and the road recognition accuracy is improved. Finally, the rain removal effect is obtained as shown in Fig. 5(c).

Rain precipitation
The experiments in this paper are network models built using Python programming language and the Pytorch framework. Table 1 illustrates the specific hardware experimental environment.
Experimental environment
| Device name | Equipment type | Detailed parameter information |
|---|---|---|
| Operating system | Windows 10 | E7-2620 |
| CPU | I7-8700K | 2.1GHz |
| GPU | NVIDIA RTX 3060 | 64G |
| Memory | DDR4 2666 hackers | 16G×2 |
| Hard disk | 860EVO | 1TB |
The software environment for the experiments is Python 3.6.7, CUDA 10.0, and CUDNN 7.5. In the experiments, the models are trained using the same training setups except for specific statements. The patch size is 100 × 100 and the training batch size is chosen as 10. In this paper, the Adam optimizer is chosen with a learning rate of 1 × 10−3 and ends after 500 iterations.
The datasets used for experimental training and testing are shown in Table 2. All the training and test sets used in this paper to train the model are listed in the table. Among them, the SPA-data test set is the real rain map test set, and all other training and test sets are synthetic datasets. All the above mentioned datasets are public datasets.
Experimental training and test use of data sets
| Training set | Test set | |
|---|---|---|
| Heavy rain image data set | Rain Train H | Rain100H |
| Rain Train H | Rain300H | |
| Small rain image data set | Rain Train L | Rain100L |
| Rain Train L | Rain300L | |
| Irregular pattern data set | Rain Train H | Rain10 |
| Multi-type rain striped data set | Rain12600 | Rain1500 |
| Real rain chart data set | Rain12600 | SPA-data |
In this section, a dataset with a single class of rain streaks will be used for training and their effect on rain removal will be evaluated.
In order to demonstrate the ability of the rain removal algorithm trained on a high percentage of CNN-based rain streak image blocks proposed in this paper to produce high fidelity outputs. In this section, the output results of several state-of-the-art models are quantitatively compared on the test sets Rain10 and Rain100H, Rain100L and such as GMM, DDN, SSIR, ResGuigeNet, JORDER, and RESCAN. The comparison results are shown in Fig. 6. The algorithms in this paper have significant advantages in both datasets Rain10, Rain100H, and Rain100L. The PSNR, SSIM metrics scores of the CNN based rain removal algorithm trained on high percentage rain streak image blocks are 35.77/0.977, 30.41/0.925, 38.97/0.984 in datasets Rain10, Rain100H, Rain100L respectively.

Comparison result
In order to verify the generalization ability and robustness of the CNN-based rain streak image de-raining algorithm proposed in this paper for various types of rain streaks, this section is tested on another dataset, Rain1500. The Rain1500 test set is synthesized for each clean image with 15 types of rain streaks. This section provides examples of the effectiveness of the rain removal algorithm for various road scenes, including different rain streak orientations and sizes, and the road recognition results after rain removal.
A comparison of the rain removal results of different algorithms is shown in Fig. 7. As can be seen from the figure, the first row shows three different scenarios of roads with rain images, the directions of the rain streaks are +50°, -50° and +45°, and their corresponding rain sizes are light rain, heavy rain and heavy rain, respectively. The second to seventh rows are the results of GMM, RESCAN, SSIR, JORDER and DDN and this paper, respectively. The eighth row shows the real image without rain. JORDER removes most of the rain streaks, but some of the background details appear to have been over-simplified compared to the real image without rain in the last row. The results of the method proposed in this paper are in the seventh row, and compared with the real rain-free image in the eighth row, the local areas of the de-rain image do not show excessive smoothing, and a larger and more accurate road drivable area is obtained than other methods.

Comparison of rain effect of different algorithms
In order to validate the necessity of the design of each module of the CNN-based rain streak image de-raining model for high scale rain streak images proposed in this paper, ablation experiments are conducted in this section. It is divided into three parts for validation:
Single use of rain-streak modeling module Single use of multi-scale convolution module Instead of using LSTM in the rain and fog model module, ordinary convolution is used instead of LSTM module for learning the rain and fog layer transfer spectra (NLSTM).
In this section, these three parts are trained separately and finally tested at Rain100H, Rain100L, Rain300H, Rain300H, and Rain10 respectively, and the PSNR and SSIM obtained are shown in Table 3. The table shows the single use of the rain and fog model module and the single use of the multi-scale convolution module respectively. NLSTM is rain and fog model module without LSTM.
The ablation experiment is compared (SSIM/PSNR)
| Data set | SSIM/PSNR | Single use rain fog model module | Single use multiscale convolution module | NLSTM | Based on CNN’s high ratio rain stripe image to rain model |
|---|---|---|---|---|---|
| Rain100H | SSIM | 0.875 | 0.922 | 0.896 | 0.941 |
| PSNR | 30.44 | 29.55 | 21.65 | 30.79 | |
| Rain100L | SSIM | 0.961 | 0.971 | 0.874 | 0.981 |
| PSNR | 34.96 | 35.43 | 20.14 | 35.67 | |
| Rain300H | SSIM | 0.873 | 0.913 | 0.803 | 0.939 |
| PSNR | 28.89 | 29.68 | 22.69 | 30.65 | |
| Rain300L | SSIM | 0.968 | 0.975 | 0.878 | 0.987 |
| PSNR | 35.51 | 34.78 | 21.41 | 36.12 | |
| Rain10 | SSIM | 0.957 | 0.908 | 0.952 | 0.966 |
| PSNR | 36.42 | 36.69 | 24.57 | 36.58 |
It can be seen that the combination of a single rain and fog model module with a multi-scale convolution module has a significant optimization effect on the rain removal. The use of LSTM has a significant optimization effect on the model, and using only a single convolution to predict the rain and fog layer transfer spectra is very unsatisfactory. The CNN based rain streak image de-raining algorithm for high percentage of rain streak images proposed in this paper has obtained the best results on both the study datasets. The mean value of SSIM is 0.9628 on the datasets Rain100H, Rain100L, Rain300H, Rain300H, Rain10.
The next step will be to compare time from the perspective of comparing time, keeping all settings unchanged, using pictures of different concentrations. Four concentrations of images in the SPA-data test set are selected, no fog light rain, no fog medium rain, no fog medium rain, and medium rain medium fog, all of which have a size of 256 × 256. Ten images of each concentration are processed using each algorithm for image processing, and the time difference between the input image and the output image result is calculated.
The results of the runtime test experiments are shown in Fig. 8. In the figure, RESCAN is the algorithm that focuses on removing raindrops, and the algorithm of this paper has an improvement of 0.062s to 0.076s in time compared to the RESCAN raindrop removal algorithm. This paper outperforms several other algorithms in time performance on all four concentration pictures. Meanwhile, the fastest processing speed is achieved on the medium rain and fog pictures, which takes only 0.056s. The time for all four concentration pictures is less than 0.1s.

Run time test results
Fog and rain pictures containing different concentrations in the SPA-data dataset are selected and tested based on the rain and fog removal algorithm, and the simulation experimental results of the image rain and fog removal in this paper are obtained. In order to verify the effectiveness of the model provided in this paper, several models with significant effects in recent years are used for comparison, and the model is tested with different concentrations of fog as well as rain of different size and direction, and compared and analyzed with GMM, DDN, SSIR, ResGuigeNet, JORDER, and RESCAN algorithms in terms of numerical value and picture effect in PNSR and SSIM. Among them, RESCAN focuses on removing raindrops and DDN focuses on removing fog.
In this paper, different concentration pictures are taken and tested separately, and classical and latest algorithms are applied for comparison, and the test metrics are used as PNSR (Peak Signal to Noise Ratio) and SSIM (Structural Similarity). Two different sets of test samples are applied for each type of picture. Each group has 100 pictures with different rain and fog concentrations in the same environmental conditions, and the PNSR and SSIM values of the pictures obtained from each test sample after de-raining and fogging were recorded and averaged. The comparison of PSNR and SSIM values is shown in Figure 9.

Comparison of PSNR and SSIM
The PNSR values of this paper’s algorithm are significantly better than those of other algorithms for rain in no fog pictures, fog in no rain pictures, and rain in medium fog pictures. It can be seen that RESCAN as a rain removal model is not effective in removing foggy pictures, and the SSIM values are 0.755 and 0.764 for foggy pictures without rain 1 and 2 respectively. The rest of the algorithms are poorly processed on foggy pictures with large concentrations, compared to this paper’s algorithm which performs better in rainy and foggy pictures of all concentrations.
In this paper, we propose a rain removal algorithm based on the training of high scale rain streak image patches to improve the image quality and reduce the impact of rain and fog images on road recognition in complex weather. The proposed algorithm is compared with the most common methods in the field to verify the efficiency of the proposed rain removal algorithm for high-scale rain streak images.
Images with different road scenes and rain streak directions are selected to test the algorithm, and the CNN-based high-ratio rain streak image de-raining algorithm proposed in this paper does not have over-smoothing in the local area of the de-raining image compared with real rain-free images, and obtains a larger and more accurate drivable area of the road than other methods. In terms of processing real images, the CNN-based high-scale rain streak image de-raining algorithm takes 0.062s to 0.076s less time than RESCAN (an algorithm that focuses on de-raining raindrops).
The combined rain streak removal accuracy and the real image processing speed are seen. The CNN-based rain streak image removal algorithm for high scale rain streak images proposed in this paper performs better in all concentrations of rain and fog images, and is more operational and universal.
