Lightweight image rain removal method and system for intelligent monitoring scene
By constructing a lightweight deraining model based on an encoder-decoder architecture, and combining an attention mechanism based on channel statistical features and a cross-domain feature alignment module, the problem of feature distribution differences between synthetic data and real-world scenarios is solved. This achieves efficient deraining effects and generalization performance under low computing resources, meeting the real-time and lightweight requirements of smart monitoring scenarios.
Patent Information
- Application Number
- CN202511842395.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2045-12-09
AI Technical Summary
Existing image deraining technologies exhibit significant differences in feature distribution between synthetic data and real monitoring scenarios, resulting in insufficient generalization ability and difficulty in balancing deraining performance and lightweight deployment under limited computing resources.
A lightweight rain removal model based on an encoder-decoder architecture is adopted, which combines an attention mechanism based on channel statistical features and a cross-domain feature alignment module. Through a progressive hybrid training strategy, the model is trained using optimized synthetic datasets and real-world rain images, thereby improving the rain removal effect and generalization performance in real and complex rainy weather environments.
It significantly improves the rain removal effect and generalization performance of the model with low computational cost, meeting the real-time and lightweight requirements of smart monitoring scenarios.
Smart Images

Figure CN121280255B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a lightweight image deraining method and system for intelligent monitoring scenarios. Background Technology
[0002] The rapid development of smart cities and public safety has led to the widespread deployment of video surveillance systems in scenarios such as traffic management, environmental monitoring, and public security. However, outdoor surveillance cameras are highly susceptible to adverse weather conditions such as rain, snow, and fog, with rain being one of the most common factors causing image quality degradation. Rainwater creates blurred fog and dense rain streaks in images, which not only severely impacts the subjective visual experience but, more importantly, significantly reduces the accuracy of subsequent advanced computer vision tasks (such as object detection, pedestrian re-tracking, and license plate recognition), thus limiting the effectiveness of smart surveillance systems. Therefore, researching and developing image de-raining technologies that can operate efficiently and stably in real-world surveillance scenarios is of crucial practical significance for improving the reliability and intelligence level of surveillance systems.
[0003] Currently, deep learning-based image deraining methods are the mainstream approach, mainly divided into two categories: The first category is fully supervised learning methods that rely entirely on synthetic data. These methods construct paired training datasets by artificially adding simple rain lines to processed images, and then train deep neural networks on these datasets. However, because the synthetic rain patterns are too simplistic and differ significantly from the diverse and complex rainfall patterns accompanied by rain and fog in the real world (i.e., "domain gaps"), these models exhibit poor generalization ability when applied to real surveillance videos, resulting in a significant reduction in deraining effectiveness. The second category attempts to introduce unlabeled real rainy images for semi-supervised or unsupervised learning to alleviate the domain gap problem. Although these methods improve the performance in real-world scenarios to some extent, they often suffer from complex model design and high computational resource consumption, making it difficult to meet the lightweight and real-time requirements of surveillance systems. Furthermore, their mechanisms for mining and aligning real data features are not sufficiently robust, resulting in limited improvement in model generalization performance.
[0004] In summary, existing image deraining technologies still face two major challenges: First, there is a significant difference in feature distribution between synthetic data and real monitoring scenes, making it difficult for models to adapt to complex degradation patterns involving rain streaks and fog, resulting in insufficient generalization ability in real-world scenarios. Second, it is difficult to achieve a performance balance with limited computing resources; high-performance models often have a large number of parameters and slow inference, failing to meet the stringent requirements of real-time performance and lightweight design in intelligent monitoring systems. Therefore, there is an urgent need for an image deraining method that balances strong cross-domain generalization ability with lightweight deployment requirements. Summary of the Invention
[0005] This invention provides a lightweight image deraining method and system for intelligent monitoring scenarios, which solves the shortcomings of existing technologies, such as insufficient generalization ability caused by significant differences in feature distribution between synthetic data and real scenes, and difficulty in balancing deraining performance and lightweight deployment under limited computing resources.
[0006] This invention provides a lightweight image deraining method for smart surveillance scenarios, comprising:
[0007] Acquire rainy day images to be processed in a smart monitoring scenario;
[0008] The rainy day image to be processed is input into a pre-trained lightweight rain removal model, and the processed image after rain removal is output.
[0009] The lightweight rain removal model is built on an encoder-decoder architecture and is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module in the model network.
[0010] The lightweight rain removal model is trained using a progressive hybrid training strategy on a training dataset; the training dataset includes an optimized synthetic dataset generated through physical model simulation and frequency domain adversarial alignment.
[0011] The lightweight image deraining method for intelligent monitoring scenarios provided by the present invention inputs the rainy image to be processed into a pre-trained lightweight deraining model and outputs a derained processed image, specifically including:
[0012] The encoder of the lightweight rain removal model, combined with the attention mechanism based on channel statistical features, performs multi-scale feature extraction and enhancement on the rainy day image to be processed, and obtains a latent feature map.
[0013] The latent feature map is input into the cross-domain feature alignment module for feature space mapping to maintain the consistency of feature distribution;
[0014] The lightweight deraining model's decoder upsamples and fuses the transformed feature map to reconstruct the derained image.
[0015] The lightweight image deraining method for intelligent monitoring scenarios provided by the present invention, through the encoder of the lightweight deraining model and combined with the attention mechanism based on channel statistical features, performs multi-scale feature extraction and enhancement on the rainy day image to be processed to obtain a latent feature map, specifically including:
[0016] For each level of input features in the encoder, the difference between the maximum and minimum values of the feature in the channel dimension is calculated to obtain the channel range descriptor that reflects the characteristics of rainwater distribution.
[0017] Based on the channel range descriptor, an attention weight map is generated using convolution operations;
[0018] The attention weight map is multiplied element-wise with the input features, and the result of the multiplication is residually connected with the original input features to enhance the channel features containing rainwater information and suppress background texture features, thereby obtaining the latent feature map.
[0019] According to the lightweight image deraining method for intelligent monitoring scenarios provided by the present invention, the optimized synthetic dataset included in the training dataset is generated by simulation using a phenomenological degradation pipeline, specifically including:
[0020] Based on the atmospheric light scattering model and by introducing a random perturbation factor, a non-uniform fog effect is added to the rainless image.
[0021] Gaussian noise is added to the image and Gamma correction is performed to simulate sensor imaging noise and the effects of ambient light;
[0022] A multimodal rain layer is constructed, which consists of rain line components generated by convolution and rain streak components based on rendering;
[0023] Based on scene depth information, a layered overlay strategy is adopted to overlay the multimodal rain layer onto the image, wherein a high-density rain layer is overlaid in areas with greater depth and a low-density rain layer is overlaid in areas with less depth to obtain initial synthetic data.
[0024] The initial synthetic data is subjected to frequency domain adversarial optimization using real-world rain maps to obtain the optimized synthetic dataset.
[0025] According to the lightweight image deraining method for smart monitoring scenarios provided by the present invention, the initial synthetic data is optimized by frequency domain adversarial optimization using a real monitoring scene rain map to obtain the optimized synthetic dataset. Specifically, the method includes: converting the initial synthetic data and the real monitoring scene rain map to the Fourier frequency domain and extracting the amplitude components, distinguishing the differences between the two in amplitude components using a discriminator and optimizing the generation process so that the frequency domain amplitude distribution of the initial synthetic data approximates the real monitoring scene rain map, and finally obtaining the optimized synthetic dataset.
[0026] According to the lightweight image deraining method for smart monitoring scenarios provided by the present invention, the lightweight deraining model is trained using a training dataset through a progressive hybrid training strategy, specifically including: training the model using the optimized synthetic dataset and constraining the model using a fully supervised loss function to enable the model to learn basic image deraining capabilities;
[0027] Real rain images from intelligent monitoring scenarios are introduced, and training is performed using a hybrid data stream approach. Synthetic data and real rain images are alternately input to optimize the model. The distribution alignment loss is added to the fully supervised loss function to guide the model features to migrate to the real data domain.
[0028] The lightweight rain removal model is further trained using the hybrid data stream and the distribution alignment loss, and the learning rate is reduced to fine-tune the model in order to stabilize its generalization performance in real monitoring scenarios.
[0029] According to the lightweight image deraining method for intelligent monitoring scenarios provided by the present invention, the method further includes: calculating the fully supervised loss function for the optimized synthetic data, the loss function being composed of a weighted sum of L1 loss for constraining pixel consistency and VGG perception loss for constraining perception quality; and calculating the distribution alignment loss for the real rain image and the optimized synthetic data, the distribution alignment loss being obtained by mapping the features of both to the regeneration kernel Hilbert space and calculating their maximum mean difference in the space.
[0030] This invention also provides a lightweight image deraining system for intelligent monitoring scenarios, comprising:
[0031] The image acquisition module is used to acquire rainy day images to be processed in smart monitoring scenarios;
[0032] The image processing module is used to input the rainy day image to be processed into a pre-trained lightweight rain removal model and output the processed image after rain removal.
[0033] The lightweight rain removal model is built on an encoder-decoder architecture and is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module in the model network.
[0034] The lightweight rain removal model is trained using a progressive hybrid training strategy on a training dataset; the training dataset includes an optimized synthetic dataset generated through physical model simulation and frequency domain adversarial alignment.
[0035] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a lightweight image deraining method for any of the above-described smart monitoring scenarios.
[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a lightweight image deraining method for any of the above-described smart monitoring scenarios.
[0037] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a lightweight image deraining method for any of the above-described smart monitoring scenarios.
[0038] The lightweight image deraining method and system for smart monitoring scenarios provided by this invention constructs a lightweight deraining model based on an encoder-decoder architecture. It utilizes an attention mechanism based on channel statistical features to accurately separate rainwater features with low computational cost. Furthermore, through a cross-domain feature alignment mechanism and a progressive hybrid training strategy including distribution alignment loss, the feature representations learned by the model on optimized synthetic data generated through physical model simulation and frequency domain adversarial alignment are effectively transferred to the real data domain. This significantly improves the deraining effect and generalization performance of the model in real and complex rainy environments while ensuring the real-time computational efficiency required for smart monitoring scenarios. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating the lightweight rain removal model construction and training process provided by the present invention.
[0041] Figure 2 This is a schematic diagram of the lightweight rain removal model provided by the present invention.
[0042] Figure 3 This is a flowchart illustrating the lightweight image deraining method for intelligent monitoring scenarios provided by the present invention.
[0043] Figure 4 This is a schematic diagram of the structure of a lightweight image deraining system for intelligent monitoring scenarios provided by the present invention.
[0044] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0046] In existing technologies, deep learning-based rain removal models perform poorly when applied to real-world surveillance scenarios. The fundamental reason lies in the significant "domain gap" between the training data and the real world. For example, traditional synthetic data generation methods often simply overlay a layer of white or gray linear rain streaks onto a clear background image. This method ignores the complex optical manifestations of rainfall in three-dimensional space. In a real surveillance scenario, such as a camera overlooking a city road, the field of view includes vehicles tens of meters away and buildings hundreds of meters away. When rain occurs, nearby raindrops may form clear, sparse streaks due to rapid movement; while distant rain appears as a blurry "rain fog" due to the scattering of light by numerous water droplets suspended in the atmosphere (i.e., atmospheric scattering effect), resulting in a sharp decrease in contrast and complete loss of detail in the distant scene. Rain images generated by traditional synthetic methods only contain rain streaks without rain fog. Models trained on this data only learn to "find and erase white lines." When faced with a real image containing heavy rain fog, they are helpless and unable to recover details in the distant scene.
[0047] Furthermore, traditional synthetic methods fail to simulate the image degradation process of real cameras. Due to factors such as cost and environment, real surveillance cameras' sensors produce significant noise (such as Gaussian noise) in low-light, rainy conditions, and their color response differs from the human eye or high-end cameras (requiring Gamma correction). A simple additive model cannot reflect these coupled degradation factors. Therefore, after training on "too clean" synthetic data, when faced with a real image containing sensor noise, color shifts, and complex rain patterns, the model easily misjudges the noise as texture that needs to be preserved, or treats the rain and fog as a normal background, resulting in incomplete deraining or unnatural artifacts.
[0048] On the other hand, to address the aforementioned challenges, some methods attempt to forcibly enhance the model's feature extraction capabilities by stacking deeper and more complex networks (such as increasing the number of convolutional layers and expanding the number of channels). While this design may achieve good metrics on specific datasets, it leads to an explosive increase in the number of model parameters and computational cost, violating the fundamental requirements of lightweight and real-time performance in smart monitoring scenarios. For example, a high-performance but bloated model might require a high-end GPU to process a single 1080P video stream in real time, which is an unbearable hardware cost for urban monitoring centers that need to manage hundreds or thousands of video streams simultaneously. The deeper flaw of this design lies in its failure to utilize the inherent, efficiently usable prior knowledge of rainwater itself.
[0049] Furthermore, a crucial but overlooked prior is the "channel correlation" of rainwater. Rainwater itself is translucent or white, and its response values across the RGB color channels of an image are typically very close. For example, the RGB value of a raindrop pixel might be (180, 182, 181), with minimal differences between channels. In contrast, the RGB value of a background object pixel, such as a green leaf, might be (50, 150, 55), with significant differences between channels. Existing large-scale networks using the same complex convolutional kernels to process these two drastically different features is undoubtedly inefficient. If a lightweight module could be designed specifically to utilize these statistical differences between channels to quickly locate rainwater areas, the network's rain removal directionality could be significantly improved with minimal computational overhead, thus achieving a better balance between lightweight design and high performance.
[0050] To overcome these challenges, this invention proposes a lightweight image deraining method and system, aiming to achieve efficient and stable deraining results through innovative data generation and model training strategies. Specifically, this invention constructs a high-quality optimized synthetic dataset, combining physical model simulation and frequency domain adversarial alignment techniques to generate synthetic data that more closely resembles the distribution of real rain images. This process not only enriches data diversity but also provides a sample foundation closer to real-world scenarios for model training. Based on this, this invention designs a lightweight deraining model based on an encoder-decoder architecture. By introducing an attention mechanism based on channel statistical features, it accurately separates rainwater features. Simultaneously, it utilizes a cross-domain feature alignment module and a progressive hybrid training strategy to effectively transfer features learned by the model on synthetic data to the real data domain. This series of innovative designs not only improves the model's deraining effect but also significantly enhances its generalization ability in complex rainy environments, while ensuring computational efficiency and meeting the real-time requirements of intelligent monitoring scenarios.
[0051] Before describing the specific implementation process of the embodiments of the present invention, the terms and concepts involved in the embodiments of the present invention will be explained illustratively.
[0052] GAN: Generative Adversarial Network, an unsupervised method that learns by having two neural networks play against each other.
[0053] VGG: A type of deep network containing multiple convolutional layers, commonly used in image processing.
[0054] ResNet: A type of deep neural network that uses skip connections to avoid information loss and is used for feature extraction of images.
[0055] Transformer: A deep network based on self-attention, with good global feature extraction capabilities.
[0056] Lightweight rain removal models: Lightweight rain removal models refer to rain removal algorithms designed by optimizing the network architecture, reducing the number of model parameters and computational complexity, enabling them to run efficiently with limited computing resources while maintaining good rain removal results. This type of model is particularly suitable for resource-constrained devices (such as embedded systems or real-time monitoring systems), effectively removing rain interference from images while ensuring real-time performance.
[0057] Attention Mechanism: An attention mechanism is a neural network module that simulates human visual attention, designed to focus the model on regions of an image that are more meaningful for the task. In image deraining, the attention mechanism can enhance rain-related features by calculating importance weights for each location in the input feature map, while suppressing background noise or irrelevant information. For example, an attention mechanism based on channel statistics can highlight rain features by calculating the channel range, thereby improving the accuracy of rain deraining.
[0058] Cross-domain feature alignment module: This module is a mechanism to reduce the distributional differences between synthetic and real data. It maps features from different domains to a shared feature space (such as a regenerating kernel Hilbert space) and optimizes the consistency of feature distribution, enabling the model to better adapt to real-world scenarios. In image deraining, this module can significantly improve the model's generalization ability, making it perform exceptionally well in real-world surveillance scenarios.
[0059] Optimized synthetic datasets: Optimized synthetic datasets refer to high-quality training datasets generated through physical model simulation and adversarial optimization. These datasets not only contain synthetic rain and no-rain image pairs, but also employ techniques such as frequency domain adversarial optimization to make their distribution closer to real rain images. Optimized synthetic datasets can provide diverse samples for model training, thereby improving the model's adaptability to complex rainfall patterns.
[0060] Channel range descriptor: The channel range descriptor is a statistical measure used to characterize the distribution of image features. In image rain removal, the channel range descriptor, reflecting the distribution characteristics of rainwater, can be obtained by calculating the difference between the maximum and minimum values of the input feature map in the channel dimension. Rainwater typically exhibits a consistent pattern across different channels, while background information shows significant channel differences. Therefore, the channel range descriptor can effectively separate rainwater features from background features.
[0061] Phenomenological Degradation Pipeline: The phenomenological degradation pipeline is a technique for simulating image degradation processes. Through physical modeling and random perturbation factors, it generates synthetic data incorporating various rain patterns and environmental factors. It considers the multifaceted effects of rain on images, such as illumination variations, noise interference, and raindrop distribution, thereby generating synthetic data that more closely resembles the real scene. This pipeline can significantly reduce the distributional discrepancies between synthetic and real data.
[0062] Latent Feature Maps: Latent feature maps refer to the intermediate feature representations obtained after encoder processing in a neural network. These feature maps contain key information about the input image and, after processing by attention mechanisms and feature alignment modules, can better highlight rain features and suppress background noise. Latent feature maps are the foundation for subsequent reconstruction and rain removal operations in rain removal models.
[0063] Gamma correction: Gamma correction is an image processing technique used to adjust the brightness and contrast of an image. In image deraining, gamma correction can simulate the changes in illumination during sensor imaging, adjusting the overall color level of the image to make it closer to the real scene. Gamma correction is often combined with operations such as noise addition to generate more realistic synthetic rain images.
[0064] Reproducing Kernel Hilbert Space: The Reproducing Kernel Hilbert Space (RKHS) is a mathematical space with completeness and metric properties, often used for feature alignment and distribution matching. In image deraining, by mapping features to the Reproducing Kernel Hilbert Space, the statistical distribution differences (such as maximum mean difference) between synthetic and real data can be calculated, and feature distribution alignment can be achieved by optimizing these differences. This method can significantly improve the generalization ability and stability of the model.
[0065] The lightweight image deraining method and system for smart monitoring scenarios described in this invention can be implemented on various hardware platforms, exhibiting good compatibility and adaptability. Its typical hardware environment includes image acquisition devices, an image processing module, storage devices, communication interfaces, and optional display devices. The image acquisition devices mainly consist of high-definition cameras, intelligent monitoring cameras, or vehicle-mounted cameras. These devices should possess high resolution and high frame rate to ensure accurate capture of rainy images in the monitored scene. The image processing module is the core of the system, typically composed of an embedded system, edge computing device, or server. It includes a processor (such as a CPU or GPU), memory (such as RAM and ROM), and necessary input / output interfaces, used to perform the calculation tasks of the deraining model and store relevant data.
[0066] Storage devices are used to save the acquired raw images and the results after rain removal processing. These can be local storage devices (such as hard drives or solid-state drives) or cloud storage services, the specific choice depending on the application requirements and data volume. Communication interfaces are responsible for transmitting data between the image acquisition device, image processing module, and storage device. They support various methods such as wireless communication (such as Wi-Fi, 4G / 5G) or wired communication (such as Ethernet, USB) to ensure efficient and stable data transmission. Furthermore, display devices (such as monitoring screens or mobile device screens) can be used to display the rain-removed images in real time, facilitating observation and analysis by monitoring personnel. While display devices are not essential in some automated monitoring scenarios, they are a crucial component in situations requiring manual intervention or real-time monitoring.
[0067] The hardware environment design of this invention is highly flexible and scalable, and can be adjusted according to different application scenarios. For example, in resource-constrained scenarios, lightweight embedded devices can be used to perform rain removal processing directly at the front end, achieving fast response and low-power operation; while in scenarios requiring higher processing power and large-scale data management, edge computing devices and servers can be combined for distributed processing, fully leveraging the advantages of each hardware component. This flexible hardware architecture design not only ensures that this invention can operate efficiently in various intelligent monitoring scenarios, but also facilitates system upgrades and expansions, enabling it to adapt to future technological developments and changes in application scenarios.
[0068] The lightweight deraining model of this invention is built on an encoder-decoder architecture and is designed to efficiently handle image deraining tasks in smart surveillance scenarios. The core of this model lies in its unique network design and training strategy, enabling it to achieve excellent deraining effects and generalization performance with low computational cost. Specifically, the model network is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module, which play crucial roles in the model's training and inference processes.
[0069] The model training process follows a progressive hybrid training strategy, which optimizes model performance step by step through multiple stages. First, the model is trained on optimized synthetic datasets generated through physical model simulation and frequency domain adversarial alignment. These optimized synthetic datasets, generated via a phenomenological degradation pipeline, cover various rainfall patterns and environmental factors, ensuring the model learns rich feature representations. During training, the model is constrained by a fully supervised loss function to learn basic image deraining capabilities. Subsequently, rain images from real-world surveillance scenarios are introduced, and training is performed using a hybrid data stream approach, alternately inputting optimized synthetic data and real rain images. A distribution alignment loss is added to the fully supervised loss function to guide the model's features towards the real data domain. Finally, the model is fine-tuned by reducing the learning rate to further stabilize its generalization performance in real-world surveillance scenarios.
[0070] Through the steps described above, the lightweight rain removal model not only performs exceptionally well on synthetic data but also demonstrates outstanding rain removal effectiveness and stability in real-world, complex rainy environments. This systematic design, from data generation to model training, provides an efficient and reliable solution for image rain removal tasks in smart surveillance scenarios.
[0071] like Figure 1 As shown, the following are the detailed steps in building and training the lightweight rain removal model:
[0072] Step S1: Input rainless images from multiple scenarios and rainfall images from real-time monitoring.
[0073] First, rainless images under various scenarios and rainy images from real-world monitoring scenarios are obtained from existing public datasets. Specifically, outdoor scene images from the public dataset RESIDE are used as the initial rainless label images. This dataset contains clear images of various outdoor scenarios, suitable as benchmark data for rain removal tasks. In this embodiment, 2061 images are selected from the RESIDE dataset as training images and 492 images as test images. In addition, 400 outdoor rainy images from real-world monitoring scenarios are selected, covering different lighting conditions, scene complexity, and rainfall intensity, for model training and testing.
[0074] By combining rainless images from the RESIDE dataset with rainy images from real-world surveillance scenarios, the diversity and representativeness of the training data were ensured, providing a high-quality data foundation for subsequent model training.
[0075] Step S2: Data augmentation and synthesis.
[0076] The acquired rainless labeled data and real rainy data were preprocessed, including random cropping, horizontal or vertical flipping, rotation, and regularization operations, to generate an augmented image of size 128×128. Subsequently, based on a classical atmospheric light scattering model, a non-uniform fog effect was added to the rainless image, and Gaussian noise and Gamma correction were introduced to simulate sensor imaging noise and the influence of ambient light. A multimodal rain layer was further constructed, including rain line components generated by convolution and rain streaks based on rendering. A layered overlay strategy was adopted according to scene depth information to generate the initial synthetic data.
[0077] The specific steps are as follows:
[0078] 1) Data Augmentation. Random cropping, horizontal or vertical flipping, rotation, and regularization operations are performed on the rainless labeled data and the actual rainy data to generate augmented images of size 128×128. These operations not only increase the diversity of the data but also improve the model's robustness to different image transformations.
[0079] 2) Fog effect simulation. Based on the atmospheric light scattering model and by introducing a random perturbation factor, a non-uniform fog effect is added to the rainless image.
[0080] Specifically, based on the classical atmospheric light scattering model, a non-uniform fog effect is added to the rainless image, and formula (1) is as follows:
[0081] H=Bt+A(1-t) (1)
[0082] Where t=e -βd The image represents the transmittance map, where A is the global atmospheric light value, β is the fog density control parameter, and d is the depth map obtained through depth estimation. In fog synthesis, β = 2 + β1, where β1 is a random perturbation factor ranging from [-0.5, 0.5) used to control the overall fog concentration and individual differences.
[0083] 3) Noise and Gamma Correction. Gaussian noise is added to the image and Gamma correction is performed to simulate sensor imaging noise and the effects of ambient light.
[0084] Specifically, Gaussian noise N is introduced into the fog image H, and Gamma correction is performed to simulate sensor imaging noise and the effects of ambient light. Final fog image I γ The generating formula (2) is:
[0085] I γ =γ(H+N) (2)
[0086] Where N is Gaussian noise with a mean of 0 and a standard deviation positively correlated with the depth map d, and γ(·) represents Gamma correction, used to adjust the overall color level of the image.
[0087] 4) Rain layer synthesis. A multimodal rain layer is constructed, which consists of rain line components generated by convolution and rain streaks based on rendering. According to the scene depth information, the multimodal rain layer is superimposed on the image using a layered overlay strategy. High-density rain layers are superimposed in areas with greater depth, and low-density rain layers are superimposed in areas with less depth to obtain the initial synthesized data.
[0088] Specifically, input the final fog map. As shown in formula (3), rainwater is superimposed to output rain map I.
[0089] (3)
[0090] in, This represents a multimodal rain layer with values ranging from [0, 255]. and These are all constants used to control the transparency and salience of rainwater in the image. A rain layer can be represented as... , This indicates a rain layer that includes multiple rain patterns. This represents the rain layer transmittance map, and its values are affected by the scene depth d. and Both are constants that control the transparency of the rain layer and the maximum depth at which rainwater appears, respectively.
[0091] Rainwater layer It consists of two parts: convolutional rain and rendered rain. Convolutional rain produces clear rain lines with controllable position, length, thickness, and direction through convolution operations combined with Gaussian filtering. As shown in formula (4), considering that rain lines are denser in areas with greater depth of field, this embodiment of the invention generates rain line layers by layering rain lines according to the depth map. :
[0092] (4)
[0093] Where x represents a pixel, and K represents the number of superimposed rain line layers, taking the value of a random integer in the range [1, 3]. This is a sub-rainline layer randomly generated based on convolution operations. This is the rain line mask for the k-th sub-rain line layer. As shown in formula (5), By gradually increasing the minimum depth at which rain lines appear in the sub-rain line layer, a close correlation between rain line density and scene depth was achieved.
[0094] (5)
[0095] in, , where represents the minimum depth at which the rain line appears in the k-th sub-rainline layer.
[0096] To ensure the similarity between the synthesized rain image and the real rain image, the rendered rain is synthesized based on realistic rendering technology. Also introduced During the generation process, = .
[0097] 5) Frequency Domain Adversarial Optimization. The initial synthetic data is subjected to frequency domain adversarial optimization using real-world rain maps from surveillance scenes to obtain the optimized synthetic dataset.
[0098] This process includes: converting the initial synthetic data and the real monitoring scene rain map to the Fourier frequency domain and extracting the amplitude components, using a discriminator to distinguish the differences in amplitude components between the two and optimizing the generation process so that the frequency domain amplitude distribution of the initial synthetic data approximates the real monitoring scene rain map, and finally obtaining the optimized synthetic dataset.
[0099] Specifically, the training set of the augmented real rainfall images O is input. Combine the rainless map B with the rain map I to output an optimized paired rain-no-rain map composite dataset. A generative adversarial network (GAN) is used to further align the rainfall distribution in the composite rain map and the real rain map in the frequency domain.
[0100] In the frequency domain of Fourier decomposition, the energy of rain features is mostly distributed in the amplitude component, while the phase component retains more of the image's structural contour information. Therefore, the difference images of the paired synthetic rain image I and the rainless image B are used. The amplitude components after Fourier decomposition are used as input to the generator, and the output is the optimized amplitude components. The introduction of rainless map B can help the generator focus more on the rainy areas in the synthetic rain map.
[0101] Randomly paired optimized amplitude components and real rain map amplitude components The inputs are fed into the discriminator network, and the output is the discrimination probability. As shown in Equation (6), the adversarial loss is used to optimize the GAN network.
[0102] (6)
[0103] Here, E(·) represents the expected value, and D(·) represents the output of the discriminator. This loss, by minimizing the distribution difference between the two, drives the generator to produce amplitude features that more closely resemble the actual rainwater distribution.
[0104] The optimized amplitude components With difference image The phase components are combined, and an inverse Fourier transform is performed to obtain an optimized difference image. Finally, this image is superimposed with the rainless image B to obtain an optimized synthetic rain image. Outputs a paired, optimized synthetic dataset, including synthetic rain maps. And no rain map B.
[0105] Step S3: Construct an image deraining network for real-world scenes.
[0106] The paired synthetic rainwater dataset obtained from input S2 -B and the expanded real dataset O in S2 output a lightweight rain removal model for real-world scenarios. The structure of the lightweight rain removal model is as follows: Figure 2 As shown.
[0107] The lightweight rain removal model is built on an encoder-decoder architecture, with each encoder and decoder containing multiple modules. Multi-scale feature fusion is achieved through skip connections. An attention mechanism based on channel statistical features is embedded in the encoder, generating an attention weight map by calculating the channel range to enhance rain features and suppress background texture. Simultaneously, a cross-domain feature alignment module is embedded in the network, mapping the features of synthetic and real data to the regeneration kernel Hilbert space, calculating distribution differences, and aligning them.
[0108] Specifically, the lightweight rain removal model primarily employs the Restormer framework with an encoding-decoding structure. Both the encoder and decoder contain four modules. The encoding stage uses three encoding layers for downsampling, progressively compressing the spatial dimension (from 1 / 1 to 1 / 8). The decoding stage uses three decoding layers for upsampling, progressively restoring the input size. Skip connections are established between the encoding and decoding layers to achieve multi-scale feature fusion. This architectural design not only effectively extracts multi-scale features from the image but also preserves rich detail information through skip connections.
[0109] An RCP (Residue Channel Prior) attention module is embedded before each encoding layer of the Restormer. For the input image or feature map F, the output is the attention feature map after processing by the RCP attention module. This is used to enhance the model's ability to extract rainwater features.
[0110] The specific implementation steps are as follows:
[0111] 1) Calculate the channel range descriptor.
[0112] For each level of the input feature F in the encoder, the difference between the maximum and minimum values in the channel dimension is calculated pixel-by-pixel to obtain the channel range descriptor Att. This descriptor can effectively separate rainwater features from background features because rainwater usually exhibits a consistent pattern across different channels, while background information shows greater channel differences. The specific formula is:
[0113] Att(x)=max(F(x,:))-min(F(x,:))
[0114] Where x represents the pixel position, and F(x,:) represents all channel values of feature map F at position x.
[0115] 2) Generate attention weight map.
[0116] Based on the channel range descriptor Att, an attention weight map M is generated using a 3×3 convolution operation. s The convolutional output is then processed through a sigmoid activation layer to obtain a normalized attention weight map, which is used for subsequent feature weighting operations. The specific formula is as follows:
[0117] M s =σ(Conv 3×3 (Att))
[0118] Where σ represents the Sigmoid activation function, Conv 3×3 This represents a 3×3 convolution operation.
[0119] 3) Feature enhancement and residual connection.
[0120] The attention weight map M s The latent feature map F is obtained by performing element-wise multiplication with the input feature F, and then performing residual concatenation between the result and the original input feature. This process enhances the channel features containing rainwater information and suppresses background texture features. att The specific formula is:
[0121] F att =F⊙M s +F
[0122] Here, ⊙ represents element-wise multiplication. This design not only improves the targeting of feature extraction but also preserves important information from the original features.
[0123] An intermediate self-attention block and a cross-domain feature alignment module are embedded sequentially between the encoder and decoder. The output of the self-attention block is input to the cross-domain feature alignment module to obtain the feature mapping in Hilbert space. (F). This module aligns feature distributions by calculating the distribution differences between synthetic and real data in Hilbert space. This module's design ensures feature consistency across different data domains, improving the model's generalization ability.
[0124] Step S4: Design the network training loss function.
[0125] After model building is complete, the next step is model training. The training process employs a progressive hybrid training strategy, gradually optimizing model performance through multiple stages. The specific training steps are as follows:
[0126] 1) Fully supervised training. In the initial stage of training, the model is trained using only optimized synthetic datasets. For paired synthetic data I... opt -B, the rain removal result output by the model is represented as D. syn Using the fully supervised loss function L1 and the perceptual loss L... per The model is constrained to learn basic image deraining capabilities. The specific formula is:
[0127]
[0128]
[0129] Here, VGG(x) represents the set of network features from several layers obtained by inputting x into a pre-trained VGG network. By minimizing these losses, the model can learn the rain features and rain removal patterns in synthetic data.
[0130] 2) Hybrid Data Training. In the second stage of training, rain images from real surveillance scenarios are introduced, and a hybrid data stream approach is used for training, alternately inputting synthetic data and real rain images to optimize the model. The feature maps output after inputting real data and synthetic data into the attention block are respectively represented as follows: and The corresponding feature map in Hilbert space can be expressed as: and Based on the fully supervised loss function, a distribution alignment loss L is added. diff This guides the migration of model features to the real data domain. The specific formula (7) is:
[0131] (7)
[0132] Where, n s and n r These represent the sample sizes for synthetic data and real data, respectively. Global distribution alignment is achieved by matching statistical measures such as the mean and variance of the features.
[0133] By minimizing the distributional differences between synthetic and real data, the model can better adapt to real-world monitoring scenarios.
[0134] 3) Fine-tuning and optimization. In the final stage of training, the model is trained again using mixed data streams and distribution alignment loss, and the learning rate is reduced to fine-tune the model, further stabilizing its generalization performance in real-world monitoring scenarios. This stage of optimization ensures the model's stability and robustness in complex scenarios.
[0135] Step S5: Train a lightweight rain removal network based on a synthetic dataset and real rain images.
[0136] After model building is complete, the next step is model training. The training process employs a progressive hybrid training strategy, gradually optimizing model performance through multiple stages. The specific training steps are as follows:
[0137] 1) Phase 1. In the initial phase of training (the first 50 epochs), only the optimized synthetic dataset I is used. opt -B trains the model. The fully supervised loss function L is used. s1 The model is constrained to learn basic image deraining capabilities. The specific formula is:
[0138]
[0139] Where L1 is the pixel-level loss, used to constrain the pixel consistency between the rain removal result and the rain-free image; L per This is the perceptual loss, used to constrain the perceived quality of the rain removal results. λ1 and λ2 are adjustable hyperparameters used to balance the weights of the two losses. At this stage, the learning rate is set to 0.0001.
[0140] 2) Phase 2. In the second phase of training (epochs 51-150), synthetic data is used for every 4 epochs of training, followed by 1 epoch of training on real data. This phase introduces rain maps O from real-world surveillance scenarios and employs a hybrid data stream approach for training. The fully supervised loss function L... s1 Based on this, add distribution alignment loss L diff This guides the migration of model features to the real data domain. The specific formula is:
[0141]
[0142] Among them, L diffThe distribution alignment loss is obtained by mapping the features of synthetic and real data to a regenerating kernel Hilbert space and calculating the maximum mean difference in that space. λ3 is an adjustable hyperparameter used to balance the weights of the distribution alignment loss. During this stage, the learning rate is kept at 0.0001.
[0143] 3) Phase 3. In the final phase of training (151-200 epochs), synthetic and real data are trained alternately in each epoch. This phase continues to use the loss function L from Phase 2. s2 Furthermore, the learning rate was reduced to 0.00001 to fine-tune the model parameters and stabilize the model's generalization performance in real monitoring scenarios.
[0144] Through the aforementioned progressive hybrid training strategy, the model gradually learns the basic features of synthetic data and the complex features of real data at different stages, ultimately demonstrating excellent rain removal and generalization performance in real-world monitoring scenarios. This phased training method not only improves the model's adaptability but also ensures its stability and robustness in complex scenarios.
[0145] Step S6: Obtain the rainy day image to be processed in the smart monitoring scenario, use the trained network to process the image and output the rain removal result.
[0146] See Figure 3 The lightweight image deraining method for smart monitoring scenarios disclosed in this invention includes:
[0147] Step 301: Obtain the rainy day image to be processed in the smart monitoring scenario.
[0148] In smart surveillance scenarios, acquiring images of rainy days is a crucial step, directly impacting the effectiveness of subsequent rain removal. First, suitable surveillance equipment needs to be selected, such as high-definition cameras or intelligent surveillance cameras. These devices should possess high resolution, high frame rate, and good low-light performance to ensure clear images are captured even in complex weather conditions. Cameras should be deployed in key locations, such as traffic intersections, city streets, or industrial parks, ensuring comprehensive coverage of the target area. Simultaneously, the equipment should be waterproof and dustproof to withstand harsh outdoor weather.
[0149] During image acquisition, the monitoring system needs to collect image data in real time and ensure that the image format and resolution meet the input requirements of the rain removal model. Acquired images should undergo preliminary preprocessing, such as cropping or scaling, to adapt to the model's input size. Furthermore, image data should be stored on local storage devices and transmitted to the processing module via a stable network. For scenarios requiring real-time processing, the stability and speed of network transmission are crucial. Regularly backing up image data can prevent data loss or corruption and ensure data security.
[0150] In certain application scenarios, to further improve the performance of rain removal models, the acquired rainy day images can be labeled, marking rain areas or target objects. Furthermore, based on monitoring needs, images meeting specific criteria can be selected for processing, such as images with heavy rainfall or those from specific time periods, to improve processing efficiency. Through these steps, high-quality rainy day images can be efficiently acquired, providing reliable data support for subsequent rain removal processing.
[0151] Step 302: Input the rainy day image to be processed into the pre-trained lightweight rain removal model, and output the processed image after rain removal.
[0152] After acquiring the rainy images to be processed in the smart monitoring scenario, the next step is to input these images into a pre-trained lightweight rain removal model to remove rainwater from the images. This process is the core of the entire rain removal system and directly determines the quality and efficiency of the rain removal effect.
[0153] Before inputting images into the model, they need to be standardized and preprocessed to ensure that the image format and size meet the model's input requirements. Specific operations include resizing the image and normalizing pixel values. For example, if the model's input size is 128×128, the acquired image needs to be cropped or scaled to that size, and the pixel values normalized to the range [0, 1]. Furthermore, for color images, they also need to be converted to a color channel format supported by the model (such as RGB or YUV).
[0154] The lightweight rain removal model is built on an encoder-decoder architecture, offering high computational performance and excellent rain removal results. During inference, the model first extracts multi-scale features from the input image through the encoder. Each stage in the encoder extracts features at different levels and passes these features to the decoder via skip connections. During feature extraction, the model utilizes channel statistical feature-based attention mechanisms (such as the RCP attention module) to enhance the expressive power of rain features while suppressing interference from background textures.
[0155] In the decoder stage, the model gradually restores the image resolution through upsampling operations and fuses and reconstructs the multi-scale features extracted in the encoder stage. Finally, the decoder outputs the de-rained processed image. The entire inference process is efficiently completed under a lightweight model architecture, ensuring the model's rapid response capability in real-time monitoring scenarios.
[0156] The de-rained image output by the model may require further post-processing to ensure it meets the needs of practical applications. Post-processing steps include restoring the image size to its original size, adjusting color balance, and removing potential artifacts. For example, if the input image was scaled during preprocessing, the output image needs to be restored to its original resolution using interpolation methods. Furthermore, to improve visual quality, the de-rained image can be enhanced in terms of contrast or sharpened.
[0157] Finally, the post-processed rain-removed images will be transmitted to the display terminal or storage device of the monitoring system for real-time viewing or subsequent analysis by monitoring personnel. This process not only effectively removes rain interference from the images but also ensures image clarity and usability, providing strong support for the efficient operation of the intelligent monitoring system.
[0158] The lightweight image deraining method for smart monitoring scenarios provided in this invention constructs a lightweight deraining model based on an encoder-decoder architecture. It utilizes an attention mechanism based on channel statistical features to accurately separate rainwater features with low computational cost. Furthermore, through a cross-domain feature alignment mechanism and a progressive hybrid training strategy including distribution alignment loss, the feature representations learned by the model on optimized synthetic data generated through physical model simulation and frequency domain adversarial alignment are effectively transferred to the real data domain. This significantly improves the deraining effect and generalization performance of the model in real and complex rainy environments while ensuring the real-time computational efficiency required for smart monitoring scenarios.
[0159] As can be seen from the above, the core of the method in this embodiment lies in inputting the rainy image to be processed into a pre-trained lightweight rain removal model, thereby outputting a processed image after rain removal. Specifically, this process includes the following key steps:
[0160] First, the input rainy day image is processed by an encoder using a lightweight rain removal model. The encoder incorporates an attention mechanism based on channel statistical features to perform multi-scale feature extraction and enhancement, thereby obtaining a latent feature map. This process enhances channel features containing rain information by calculating channel range descriptors and generating attention weight maps, while suppressing background texture features, ensuring that the model can accurately extract rain features.
[0161] Specifically, for each level of input features F in the encoder, the model calculates the channel range descriptor Att and generates an attention weight map M through convolution operations. s Subsequently, the attention weight map is multiplied element-wise with the input features, and a residual connection is made with the original input features to obtain the enhanced latent feature map F. att This process not only improves the targeting of feature extraction but also preserves important information from the original features.
[0162] Subsequently, the latent feature map is input into the cross-domain feature alignment module for feature space mapping. This module maps features to a shared feature space to maintain consistency in feature distribution. Through this process, the model can effectively align the feature distributions of synthetic and real data, thereby improving the model's generalization ability in real-world surveillance scenarios.
[0163] Finally, the transformed feature map is upsampled and fused for reconstruction using the decoder of the lightweight rain removal model. The decoder gradually restores the image resolution and fuses the multi-scale features extracted in the encoder stage, ultimately generating the processed image after rain removal. This process not only removes rain interference from the image but also preserves the image's detail information, ensuring that the de-rained image is clear and has good visual effects.
[0164] Through the above steps, this invention can efficiently remove rain interference from images in smart monitoring scenarios, significantly improving the quality and usability of monitoring images. This method is not only suitable for real-time monitoring systems, but also maintains a stable rain removal effect in various complex environments.
[0165] The lightweight image deraining system for smart monitoring scenarios provided in the embodiments of the present invention will be described below. The lightweight image deraining system for smart monitoring scenarios described below can be referred to in correspondence with the lightweight image deraining method for smart monitoring scenarios described above.
[0166] This invention provides a lightweight image deraining system for intelligent monitoring scenarios. See [link to relevant documentation]. Figure 4 ,include:
[0167] Image acquisition module 410 is used to acquire rainy day images to be processed in a smart monitoring scenario;
[0168] Image processing module 420 is used to input the rainy day image to be processed into a pre-trained lightweight rain removal model and output the processed image after rain removal.
[0169] The lightweight rain removal model is built on an encoder-decoder architecture and is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module in the model network.
[0170] The lightweight rain removal model is trained using a progressive hybrid training strategy on a training dataset; the training dataset includes an optimized synthetic dataset generated through physical model simulation and frequency domain adversarial alignment.
[0171] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a lightweight image deraining method for smart monitoring scenarios. The method includes: acquiring a rainy image to be processed in a smart monitoring scenario; inputting the rainy image to be processed into a pre-trained lightweight deraining model, and outputting a derained processed image; wherein the lightweight deraining model is built based on an encoder-decoder architecture and is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module in the model network; the lightweight deraining model is trained using a training dataset through a progressive hybrid training strategy; the training dataset includes an optimized synthetic dataset generated through physical model simulation and frequency domain adversarial alignment.
[0172] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0173] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the lightweight image deraining method for smart monitoring scenarios provided by the above methods. The method includes: acquiring a rainy image to be processed in a smart monitoring scenario; inputting the rainy image to be processed into a pre-trained lightweight deraining model, and outputting a derained processed image; wherein the lightweight deraining model is built based on an encoder-decoder architecture and is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module in the model network; the lightweight deraining model is trained using a training dataset through a progressive hybrid training strategy; the training dataset includes an optimized synthetic dataset generated by physical model simulation and frequency domain adversarial alignment.
[0174] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a lightweight image deraining method for smart monitoring scenarios provided by the methods described above. The method includes: acquiring a rainy image to be processed in a smart monitoring scenario; inputting the rainy image to be processed into a pre-trained lightweight deraining model, and outputting a derained processed image; wherein the lightweight deraining model is constructed based on an encoder-decoder architecture and is configured with an attention mechanism based on channel statistical features and a cross-domain feature alignment module in the model network; the lightweight deraining model is trained using a training dataset through a progressive hybrid training strategy; the training dataset includes an optimized synthetic dataset generated through physical model simulation and frequency domain adversarial alignment.
[0175] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0176] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for removing rain from an image in a smart monitoring scene with light weight, characterized in that, The method comprises the following steps: acquiring a to-be-processed rainy-day image in a smart monitoring scene; inputting the to-be-processed rainy-day image into a pre-trained lightweight rain removal model to output a processed image after rain removal; wherein the lightweight rain removal model is constructed based on an encoder-decoder architecture, and an attention mechanism based on channel statistical features and a cross-domain feature alignment module are configured in the model network; the lightweight rain removal model is trained by using a training data set through a progressive hybrid training strategy; the training data set contains an optimized synthetic data set generated through a physical model simulation and a frequency domain adversarial alignment; the optimized synthetic data set contained in the training data set is generated by using a phenomenological degradation pipeline, specifically including: adding a non-uniform fog effect to a rain-free processed image based on an atmospheric light scattering model and introducing a random disturbance factor; adding Gaussian noise to the image and performing Gamma correction to simulate sensor imaging noise and environmental light effects; constructing a multi-modal rain layer composed of a rain line component generated by convolution and a rain trace component based on rendering; according to scene depth information, using a layered superposition strategy to superimpose the multi-modal rain layer on the image, wherein a high-density rain layer is superimposed in a region with large depth, and a low-density rain layer is superimposed in a region with small depth, to obtain initial synthetic data; performing frequency domain adversarial optimization on the initial synthetic data using real monitoring scene rain images to obtain the optimized synthetic data set.
2. The method of claim 1, wherein, inputting the to-be-processed rainy-day image into a pre-trained lightweight rain removal model to output a processed image after rain removal, specifically including: performing multi-scale feature extraction and enhancement on the to-be-processed rainy-day image through the encoder of the lightweight rain removal model combined with the attention mechanism based on channel statistical features to obtain a latent feature map; inputting the latent feature map into the cross-domain feature alignment module for feature space mapping to maintain the consistency of feature distribution; performing upsampling and fusion reconstruction on the transformed feature map through the decoder of the lightweight rain removal model to generate the processed image after rain removal.
3. The method of claim 2, wherein, performing multi-scale feature extraction and enhancement on the to-be-processed rainy-day image through the encoder of the lightweight rain removal model combined with the attention mechanism based on channel statistical features to obtain a latent feature map, specifically including: for the input feature of each level in the encoder, calculating the difference between the maximum value and the minimum value of the feature in the channel dimension to obtain a channel range descriptor reflecting the distribution characteristics of rainwater; generating an attention weight map based on the channel range descriptor using convolution operation; element-wise multiplying the attention weight map and the input feature, and performing residual connection on the multiplied result and the original input feature to enhance the channel features containing rainwater information and suppress the background texture features to obtain the latent feature map.
4. The method of claim 1, wherein, performing frequency domain adversarial optimization on the initial synthetic data using real monitoring scene rain images to obtain the optimized synthetic data set, specifically including: The initial synthetic data is converted to a Fourier frequency domain and an amplitude component is extracted from a real monitoring scene rain map, respectively, a discriminator is used to distinguish the difference between the two in the amplitude component and optimize the generation process, so that the frequency domain amplitude distribution of the initial synthetic data approaches the real monitoring scene rain map, and finally the optimized synthetic data set is obtained.
5. The method of claim 1, wherein, The lightweight rain removal model is trained using a training data set through a progressive hybrid training strategy, specifically including: The model is trained using the optimized synthetic data set, and a full supervision loss function is used to constrain the model, so that the model learns the basic image rain removal capability; Real rain maps in a smart monitoring scene are introduced, and a hybrid data stream is used for training. The optimized synthetic data and real rain maps are input alternately, and a distribution alignment loss is added to the full supervision loss function to guide the model features to migrate to the real data domain; The hybrid data stream and the distribution alignment loss are used for training, and the learning rate is reduced to fine-tune the lightweight rain removal model to stabilize the generalization performance of the lightweight rain removal model in the real monitoring scene.
6. The method of claim 5, wherein, The method further includes: The full supervision loss function is calculated for the optimized synthetic data, which is composed of L1 loss for constraining pixel consistency and VGG perception loss for constraining perceptual quality; The distribution alignment loss is calculated for real rain maps and optimized synthetic data, which is obtained by mapping the features of the two to a reproducing kernel Hilbert space and calculating the maximum mean difference in the space.
7. A lightweight image deraining system for intelligent monitoring scenes, characterized in that, It includes: An image acquisition module is configured to acquire a to-be-processed rainy day image in a smart monitoring scene; An image processing module is configured to input the to-be-processed rainy day image into a pre-trained lightweight rain removal model and output a processed image after rain removal; The lightweight rain removal model is constructed based on an encoder-decoder architecture and is configured with a channel statistical feature-based attention mechanism and a cross-domain feature alignment module in the model network; The lightweight rain removal model is trained using a training data set through a progressive hybrid training strategy; the training data set includes an optimized synthetic data set generated through a physical model simulation and a frequency domain adversarial alignment; The optimized synthetic data set included in the training data set is simulated using a phenomenological degradation pipeline, specifically including: Based on an atmospheric light scattering model and introducing a random disturbance factor, non-uniform fog effects are added to a rain-free processed image; Gaussian noise is added to the image and Gamma correction is performed to simulate sensor imaging noise and environmental light effects; A multi-modal rain layer is constructed, which is composed of a convolution-generated rain line component and a rendering-based rain trace component; According to scene depth information, a layered superposition strategy is used to superimpose the multi-modal rain layer on the image, wherein high-density rain layers are superimposed in areas with large depth, and low-density rain layers are superimposed in areas with small depth, to obtain initial synthetic data; The initial synthetic data is subjected to frequency domain adversarial optimization using real monitoring scene rain maps to obtain the optimized synthetic data set.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The computer program is executed by the processor to implement the lightweight image deraining method for the intelligent monitoring scene as claimed in any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the lightweight image deraining method for the intelligent monitoring scene as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Image rain removal method and system based on direction perception frequency domain filtering
CN117474802A
Brightness-guided double-domain perception image defogging method and system
CN119168912A