Low-illumination image enhancement method based on diffusion model and improved Retinex theory
Through multi-stage collaborative optimization of DecomNet, DenoiseNet, and ReLightNet, combined with EMA and Mamba modules, the problems of insufficient brightness, noise interference, and loss of detail in low-light images are solved, achieving high-quality image enhancement effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KUNMING UNIV OF SCI & TECH
- Filing Date
- 2026-03-30
- Publication Date
- 2026-05-15
AI Technical Summary
Existing low-light image enhancement methods struggle to balance brightness enhancement in dark areas and halo suppression in bright areas under complex lighting conditions, and also suffer from noise interference and loss of detail.
We employ a low-light image enhancement method based on a diffusion model and improved Retinex theory. This method uses DecomNet for image decomposition, DenoiseNet for progressive denoising, and ReLightNet for illumination enhancement. It also combines the EMA attention mechanism and the Mamba module to achieve multi-stage collaborative optimization.
It significantly improves the brightness, detail, and naturalness of low-light images, effectively suppresses noise, overcomes the problems of halo artifacts and detail loss in existing methods, and improves image quality and generalization ability.
Smart Images

Figure CN122048699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of low-light image processing technology, and in particular to a low-light image enhancement method based on a diffusion model and improved Retinex theory. Background Technology
[0002] In the field of digital image processing, low-light image enhancement technology has become a hot topic in computer vision research. With the popularization of multimedia devices and the large-scale deployment of monitoring systems, image acquisition equipment has been widely used in key areas such as security monitoring, autonomous driving, and medical imaging. However, due to factors such as insufficient lighting conditions, limitations in imaging equipment performance, and shooting parameter settings, images acquired at night or in low-light environments generally suffer from problems such as insufficient brightness, low contrast, blurred details, and noise interference, which seriously restricts their application in practical scenarios. In security monitoring, low-quality images make it difficult to accurately identify facial features and behavioral actions; in autonomous driving scenarios, they may lead to deviations in the vehicle's perception of obstacles; and in medical image analysis, they can easily cause doctors to miss or misdiagnose lesions.
[0003] Traditional low-light image enhancement methods are mainly divided into two categories: spatial domain-based and transform domain-based. Spatial domain methods such as histogram equalization and gamma correction improve brightness through pixel-level mapping. While simple and efficient, they are prone to over-enhancement and color distortion. Methods based on Retinex theory mimic human visual perception by decomposing the image into reflection and illumination components, which improves image contrast to some extent. However, in complex, non-uniform lighting scenes, they still struggle to avoid halo artifacts and local overexposure. Another common drawback of variational models and traditional learning methods is their reliance on complex mathematical modeling and manual parameter tuning, resulting in limited generalization ability.
[0004] In recent years, the rapid development of deep learning has brought new breakthroughs to low-light image enhancement. Convolutional neural network-based methods have achieved significant progress in image brightness enhancement and detail recovery by learning the mapping relationship between low-light inputs and enhanced outputs using large-scale data. Researchers have successively proposed deep learning models based on Retinex theory, end-to-end enhancement networks, and zero-reference contrastive learning frameworks. However, existing methods still face many challenges: the cost of acquiring paired training data is high, the model's generalization ability under different scenes is insufficient, and color distortion or detail loss easily occurs under complex lighting conditions. Especially in real-world scenes with strong light sources or non-uniform illumination, how to balance brightness enhancement in dark areas and halo suppression in bright areas while maintaining image detail and natural color remains a pressing problem.
[0005] To address the aforementioned challenges, developing a low-light image enhancement technique that effectively suppresses noise, preserves image details, and delivers natural enhancement results has become a critical issue urgently needing resolution. Breakthroughs in this technology have significant practical implications and application value for improving image quality in related fields, enhancing the recognition accuracy of security monitoring, ensuring the environmental perception safety of autonomous driving, and improving the reliability of medical image diagnosis. This paper proposes a low-light image enhancement method that integrates the EfficientMulti-ScaleAttentionModule (EMA) and the Mamba module. Experiments will be conducted on multiple publicly available datasets to validate the method, and the effectiveness and generalization ability of the proposed method in low-light image enhancement tasks will be demonstrated through objective evaluation metrics and subjective visual effect comparisons. Summary of the Invention
[0006] This invention addresses the problems of insufficient brightness, blurred details, and noise interference in low-light images, as well as the shortcomings of existing enhancement methods in denoising, detail preservation, and naturalness enhancement. It proposes an improved Retinex model to improve image quality through three stages: image decomposition, reflection denoising, and illumination enhancement. This includes decomposing the image using a network structure, denoising with a diffusion model and an improved loss function, and combining specific modules and an attention mechanism to achieve illumination enhancement. The proposed improved Retinex model performs excellently on multiple datasets, effectively improving image brightness, detail, and naturalness, thus meeting the practical needs of low-light image enhancement in various aspects.
[0007] This invention provides a low-light image enhancement method based on a diffusion model and improved Retinex theory, comprising the following steps: Step (1) Select a relatively classic dataset and obtain the low-light images and corresponding normal-light images from it; Step (2) Based on Retinex theory, construct an improved Retinex model; Step (3) Train the improved Retinex model; Step (4) Apply the trained improved Retinex model to low-light images on multiple validation datasets to obtain the enhancement results.
[0008] Specifically, the training data is constructed by collecting paired images of low-light and standard-light conditions in multiple scenes using imaging equipment, and then integrating samples with different light distributions from a public data warehouse.
[0009] Specifically, dataset creation refers to the training and testing of the improved Retinex model, using diverse datasets that have undergone systematic screening. These primarily include the LOL series datasets (v1 and v2 versions). The LOL-v1 dataset contains 500 pairs of low-light and normal-light images taken indoors, with an image resolution of 400×600 pixels; 485 pairs are used for model training, and the remaining 15 pairs are used for testing. The LOL-v2 dataset is further subdivided into two subsets: LOL-v2-real, which acquires low-light images by adjusting exposure time and ISO parameters, containing 689 pairs of training images and 100 pairs of test images; and LOL-v2-synthetic, which is synthesized based on the illumination distribution of RAW images.
[0010] Furthermore, to comprehensively evaluate model performance, the study also selected several advanced low-light image enhancement datasets (such as DICM, LIME, MEF, NPE, and VV) for visual comparison experiments. Simultaneously, to verify the model's effectiveness in real-world scenes, the LSRW real-world dataset, collected using a Nikon D7500 camera and a Huawei P40 Pro smartphone, was introduced. These datasets cover diverse scene types, lighting conditions, and image features, providing rich and comprehensive data support for improving the training, testing, and performance evaluation of the Retinex model.
[0011] Specifically, the low-light image enhancement model described in this invention is based on an improved Retinex theory. Its core component, DecomNet, employs a dual-branch architecture to optimize the image component extraction process. Addressing the problems of traditional methods struggling to effectively separate illumination and reflection components and easily losing low-level image structural features when processing regions of varying brightness and complex lighting conditions, DecomNet utilizes a low-light image S... low and normal lighting image S normal As input, the reflection component R and the illuminance component I are extracted respectively through a dual-branch structure with shared weights.
[0012] In the reflection component branch, five cascaded 3×3 convolutional layers are designed to construct a feature pyramid, with each layer followed by a ReLU activation function to achieve stepwise extraction of image features. To preserve high-frequency details, a cross-layer channel stitching strategy is adopted to fuse the features of layers 2-6 with those of layers 3-5, enabling the reflection component to more accurately represent the inherent material and texture information of the object. Finally, after processing by 3×3 convolutional layers and a Sigmoid activation function, the reflection component R is output.
[0013] The illuminance component branch first extracts basic features through a 3×3 convolutional layer, then concatenates them with the features from the 6th layer of the reflection branch, and then uses two sets of 3×3 convolutions and ReLU modules to extract low-frequency information, finally outputting the illuminance component I to accurately describe the impact of external lighting conditions on the image.
[0014] To optimize the image decomposition process, DecomNet introduces an overall optimization objective comprising four loss functions: Reconstruction Loss ensures that the decomposed reflectance and illuminance components can effectively reconstruct the original image; Reflectance Consistency Loss constrains the consistency of reflectance components between low-light and normal-light images; Illuminance Smoothing Loss maintains the smoothness of illumination information, avoiding loss of detail; and Illuminance Consistency Loss ensures the consistency of illumination information in images under different lighting conditions. By appropriately adjusting the weights of each loss function, DecomNet can achieve more accurate image decomposition, providing high-quality component data for subsequent reflectance denoising and illumination enhancement modules, thereby improving the overall enhancement effect of low-light images.
[0015] Specifically, the low-light image enhancement model introduces a diffusion model and self-constrained consistency loss in the DenoiseNet module, aiming to solve the technical problems of easy loss of details and difficulty in noise suppression during the denoising of reflection components.
[0016] In low-light image denoising scenarios, traditional methods often focus only on single-dimensional feature processing, making it difficult to effectively grasp the complex relationship between noise and details in the image. This results in either excessive loss of detail or significant noise residue in the denoised image. To address this issue, this model introduces a diffusion model and adopts a progressive denoising strategy: first, noise is gradually added to the reflection component through a forward diffusion process, and then the clear reflection component is gradually restored from the noisy state through a reverse diffusion process, thereby achieving synergistic optimization of noise suppression and detail preservation. During the denoising process, the diffusion model comprehensively captures the feature dependencies of the reflection component under different noise levels through a cross-stage feature interaction mechanism, enhancing the model's ability to model noise distribution and further improving denoising accuracy.
[0017] The diffusion model introduces a time-step scheduling mechanism, gradually transforming the reflection component from its original state to a pure noise state by progressively increasing the noise level. Forward diffusion: utilizing low-light images. and highlight images Perform diffusion modeling and combine them This is used as input data. The input data undergoes forward diffusion processing, gradually adding noise to ultimately generate a noisy image. To achieve this process, a pre-defined variance scheduling strategy is employed. , so that the input image It is progressively converted into noise at each time step. The formula is expressed as: in, Indicates at time The noise data. By adjusting the time step, the input image can be guided. Gradually evolved into noise The reverse diffusion stage: After the forward diffusion process, the goal is to recover a clear image from the noise through reverse denoising. This is achieved by utilizing the editing and data synthesis capabilities of the conditional diffusion model, using random noise... Starting with this, noise is gradually removed until a final, clear image is generated. This process depends on the feature information of the input image. This is to ensure high fidelity of the recovery results. Its mathematical expression is as follows: .
[0018] Compared with other denoising methods, the diffusion model can perform feature extraction and denoising in parallel at different noise levels, effectively fusing feature information of reflection components at various noise stages to achieve comprehensive capture of multi-scale noise and detailed features. This integrated denoising strategy significantly improves the network's ability to preserve the details of reflection components and can effectively address the problems of complex noise interference and subtle texture loss in low-light images.
[0019] Meanwhile, to ensure that the denoised reflection component remains consistent with the original reflection component, a self-constrained consistency loss is introduced. The improved denoising loss function is: This loss function, by introducing expectation operations, effectively smooths out the interference caused by outlier samples, thereby improving the stability of the training process and the generalization ability of the model. The self-constrained consistency loss is: The total loss function is: By balancing these two loss functions, the learning direction of the denoising network is effectively constrained, preventing the introduction of additional biases during the denoising process, thereby further improving the denoising quality of the reflection component.
[0020] Specifically, the low-light image enhancement model, within the improved Retinex framework, uses ReLightNet as the core illumination enhancement module. This module achieves adaptive illumination correction and detail enhancement for low-light images through a deep fusion of an encoder-decoder architecture and an attention mechanism. Its core design is as follows: The network architecture adopts a U-Net structure. The encoder consists of four sets of downsampling convolutional modules, each containing a 3×3 convolutional layer (stride 2), instance normalization, and a LeakyReLU activation function. The number of channels increases from 64 to 512, progressively extracting multi-level features. The decoder reduces the number of channels to 64 through a transposed convolutional layer (stride 2) and uses skip connections to fuse encoder features, restoring the image spatial resolution. Finally, an enhanced image is generated through 3×3 convolutions and a sigmoid activation function, with pixel values normalized to the [0,1] range.
[0021] EMA uses exponential moving average to smoothly update model parameters, enhancing the stability and robustness of low-light image features. Its parameter update formula is as follows: Mamba, as an efficient selective state-space model, achieves linear complexity sequential feature modeling through state-space modeling while retaining its ability to perceive spatial sequence location information. In the specific computational process, positional encoding is first embedded into the input features to enhance the model's perception of location. Where L is the sequence length, corresponding to the total number of pixels H×W after flattening in the image processing scenario, and D is the feature dimension and the learnable position encoding matrix. Adding them together yields features that enhance location information. .
[0022] For features encoded by embedding position First, a dimensional transformation is performed using a linear projection layer, and the data is split into a gated branch and a state input branch. The specific calculation is as follows: Where d is the Mamba hidden state dimension, which is usually consistent with the input feature dimension D, and then along the feature dimension... Split into and Two branches, of which It is used as a gating vector for subsequent output modulation. This serves as the input sequence for the state-space model. Next, It will be mapped through a linear layer to the core parameters and inputs of the state-space model, that is: in These are the diagonal elements of the state matrix (diagonalization is used to simplify and reduce computational complexity). For the input matrix, For the output matrix, It is a selective decay coefficient used to dynamically adjust the state update rate at different locations.
[0023] The core of the state-space model is the recursive state update along the sequence dimension. For the t-th position in the sequence, the state update formula is: in Let be the hidden state at position t. This is the initial hidden state. This means converting a vector into a diagonal matrix. This approach decays the hidden state at the previous position, ensuring the model's ability to model long sequences while controlling computational cost. Subsequently, the hidden state is projected onto the output matrix to obtain the output state. And combined with the gating vector, we obtain the core output of Mamba: in For element-wise multiplication, Using the sigmoid activation function, the outputs at all positions are concatenated to form the complete sequence output. .
[0024] Finally, the output features of Mamba are further processed by a feedforward network (FFN) to extract higher-order features. Simultaneously, layer normalization (LN) and residual connections are used to optimize the training process. This design ensures stable information flow in deep networks, avoids the gradient vanishing problem, and Mamba's overall computational complexity is O(n log n). It has significant efficiency advantages in long sequence scenarios such as high-resolution image processing.
[0025] This module first uses EMA to perform parameter smoothing and feature calibration, and then inputs the processed features into Mamba for efficient spatial feature modeling. The two work together to balance computational efficiency and output stability in high-resolution low-light image enhancement, effectively suppressing noise and artifacts and improving the overall robustness of the model.
[0026] Specifically, the improved Retinex model involves randomly cropping the input image to 96×96 pixels to improve training efficiency. Training is conducted using an NVIDIA 4090 GPU, based on the PyTorch framework, with Python version 3.8 and CUDA version 11.3. A staged training strategy is employed, using the Adam optimizer with default parameter settings and a fixed learning rate of 0.0001. The training iterations total 200, with a batch size of 128.
[0027] Specifically, the model's validation results on real-world datasets refer to the comprehensive testing conducted on the LSRW real-world dataset, following assessments of the model's robustness and generalization ability on multiple datasets. This dataset contains low-light images taken with a Huawei P40 Pro phone and a Nikon D7500 camera, effectively verifying the model's enhancement effects and adaptability in real-world shooting scenarios.
[0028] Compared with existing technologies, the beneficial effects of adopting the above technical solution are as follows: (1) For low-light image enhancement tasks, the improved Retinex model proposed in this paper significantly improves performance through three-stage collaborative optimization: First, in the image decomposition stage, DecomNet based on a dual-branch architecture and cross-layer feature fusion strategy is adopted to accurately separate the illumination component and the reflection component, effectively solving the problem of noise residue and loss of details caused by component coupling in traditional methods; Second, in the denoising stage, DenoiseNet based on the diffusion model is introduced to progressively denoise the reflection component, combined with an improved denoising loss function, to suppress noise while preserving complex texture structure; Finally, in the illumination enhancement stage, ReLightNet, which integrates the Mamba module and the EMA attention mechanism, realizes adaptive illumination adjustment and key region enhancement, effectively overcoming the overexposure and artifact problems of existing methods such as EnlightenGAN.
[0029] (2) The improved Retinex model effectively achieves multi-dimensional enhancement of low-light images, demonstrating excellent robustness, detail preservation ability, and natural enhancement effect, providing an innovative solution for low-light image processing. Future research can further explore the performance optimization of the model under extreme low-light conditions, and improve its adaptability to complex lighting changes and diverse noise. At the same time, combining more advanced deep learning techniques to continuously improve the degree of image detail preservation and enhancement quality remains an important direction worthy of in-depth exploration in this field. Attached Figure Description
[0030] Figure 1 This is an overall flowchart of a low-light image enhancement method based on a diffusion model and improved Retinex theory provided in the embodiments of this application; Figure 2 This is an overall structural diagram of the improved Retinex in the embodiments of this application; Figure 3 This is a diagram of the ReLightNet network structure in this application; Figure 4 This is a diagram of the Mamba module structure in this application; Figure 5 This is a diagram showing the results of low-light enhancement in this application. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It should be noted that the described embodiments are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0032] See Figure 1The diagram shown is an overall flowchart of a low-light image enhancement method based on a diffusion model and improved Retinex theory provided in an embodiment of the present invention, which specifically includes the following steps: Step (1): Select a relatively classic dataset and obtain the low-light images and corresponding normal-light images from it; This invention constructs a multi-dimensional dataset covering both synthetic and real-world scenes. LOLv1 and LOLv2 are used for model training, while other datasets are used for performance testing. The core training set is the LOL series, comprising two versions: LOLv1 consists of 500 pairs of indoor low-light and normal-light images (485 pairs for training, 15 pairs for testing); LOLv2 is further subdivided into the real-world scene subset LOLv2-real (689 pairs for training, 100 pairs for testing) and the synthetic data subset LOLv2-syn (synthesized based on RAW image illumination distribution). The testing phase incorporates multiple benchmark datasets such as DICM, LIME, MEF, NPE, and VV, covering application scenarios in various fields including medical imaging, natural scenes, multi-exposure fusion, nighttime environments, and vehicle vision.
[0033] During the data selection process, the focus was on clear samples under different shooting angles, distances, and lighting conditions to ensure that the dataset fully covers the complexity and diversity of real-world scenes. LOLv2-syn uses synthetic techniques to simulate extreme low-light environments and dynamic lighting changes, significantly improving the model's adaptability to complex lighting conditions. All datasets were constructed using a combination of real-world data acquisition and synthetic data generation, overcoming the limitations of traditional datasets with only single lighting conditions and providing a comprehensive and reliable foundation for training and evaluation of low-light image enhancement algorithms. The test dataset was used to verify the model's generalization ability, ensuring the algorithm exhibits good robustness in both professional applications and everyday scenarios.
[0034] Step (2): Design an improved Retinex model based on Retinex theory; First, the DecomNet decomposition network of this invention employs a dual-branch architecture to decouple image components. The network uses a low-light image (Slow) and a normal-light image (Snormal) as input pairs, and extracts the reflection component R and the illuminance component I respectively through a dual-branch structure with shared weights.
[0035] In the reflection component branch, a feature pyramid is constructed using five cascaded 3×3 convolutional layers (each followed by a ReLU activation function). Features from different levels are then fused using a cross-layer channel stitching strategy to effectively preserve high-frequency details of the image. Finally, the reflection component R is output after processing by a 3×3 convolutional layer and a Sigmoid activation function.
[0036] The illuminance component branch first extracts basic features through a 3×3 convolutional layer, then concatenates them with the features from the 6th layer of the reflection branch, and then extracts low-frequency information through two sets of 3×3 convolutions and ReLU modules, finally outputting the illuminance component I.
[0037] After feature extraction, the network maps the extracted features into reflectance and illuminance components through a reconstruction layer. The reflectance component mainly characterizes the inherent properties of the image that do not change with illumination (such as object material and texture), while the illuminance component describes the influence of external lighting conditions on the image.
[0038] In DecomNet, multiple loss functions are used to jointly optimize the image decomposition process. The overall loss function includes four parts: reconstruction loss, reflection consistency loss, illumination smoothing loss, and illumination consistency loss, in order to ensure the accuracy and physical rationality of the decomposition results.
[0039] Secondly, refer to the appendix Figure 2 As shown, a diffusion model is introduced to denoise the reflection component, effectively removing noise and improving image restoration quality. Compared with traditional denoising methods, the diffusion model can better preserve image details and structural information while suppressing noise. Through this method, the quality of the reflection component is significantly improved, noise is effectively suppressed, and the image restoration result is clearer and more natural.
[0040] Forward diffusion process: First, the low-light reflection component of the input image is gradually contaminated into a noisy image. Specifically, starting with the original clear image, a small amount of Gaussian noise is gradually added at each time step, with the noise level dynamically controlled by a preset variance scheduling strategy. As the time steps increase, the noise gradually accumulates, eventually transforming the original image completely into a pure noise signal. This process simulates the degradation process of signals in a natural environment, providing training data for inverse denoising.
[0041] The inverse denoising process starts with a purely noisy image and progressively recovers the sharp reflection components through a neural network. The network learns the relationship between noise distribution and image content, predicting the sharp image corresponding to the current noisy image at each time step. The prediction process is based on the inverse of forward diffusion, gradually removing noise and restoring details by adjusting noise intensity and direction. This process employs a conditional generation strategy, combining feature information from low-light images to ensure high fidelity of the restored results.
[0042] Loss function design: The denoising loss guides the network to learn accurate noise estimation ability by calculating the difference between the noise predicted by the network and the real noise; the self-constrained consistency loss ensures the structural consistency between the denoised image and the original low-light image through feature matching, avoiding the loss of details caused by excessive denoising.
[0043] This invention proposes the ReLightNet model, which uses an encoder-decoder framework and integrates the EMA attention mechanism and the Mamba module to construct an architecture for brightness enhancement. As the core module for low-light image enhancement, ReLightNet achieves high-quality image enhancement results through a multi-dimensional collaborative mechanism.
[0044] See attached document Figure 3 As shown, ReLightNet employs an encoder-decoder architecture. The encoder consists of four downsampling convolutional modules. The input low-light image is processed sequentially through each module, which includes a 3×3 convolution, instance normalization, and the LeakyReLU activation function. During this process, the image spatial size is gradually reduced, and the number of channels increases from 64 to 512, thereby extracting multi-level features covering global structural information and local detail textures. The decoder gradually restores the spatial resolution of the image through transposed convolutional layers, decreasing the number of channels from 512 to 64. Simultaneously, skip connections are introduced to fuse the features of corresponding layers in the encoder with those in the decoder, achieving effective integration of high-level semantic information and low-level detail information. Finally, after processing by 3×3 convolutional layers and the sigmoid activation function, the enhanced image is output.
[0045] The EMA attention mechanism optimizes features through multi-scale feature extraction and cross-dimensional interaction. This mechanism divides the input features into multiple subgroups along the channel dimension, performing feature extraction and attention calculations at different scales within each subgroup, capturing multi-scale illumination features through parallel processing. Simultaneously, EMA integrates feature responses from different scales through cross-group information interaction, enhancing the model's ability to perceive key regions under complex lighting conditions, effectively improving the accuracy of illumination correction and detail preservation.
[0046] See attached document Figure 4 As shown, the Mamba module plays a crucial role in illumination enhancement. This module, designed based on a state-space model, reshapes the feature map output by the encoder into a sequence and adds positional encoding to preserve spatial location information. Mamba globally models the sequence features through a recursive structure, enabling it to capture long-range dependencies within linear complexity. In the illumination enhancement task, Mamba, through its selective state-space transition mechanism, dynamically adjusts the information transmission path according to the illumination distribution of the input features, allowing the network to adaptively focus on feature representations in low-light regions while maintaining awareness of the global illumination distribution.
[0047] Step (3): Train the improved Retinex model; The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1 is characterized in that training the improved Retinex model includes the following settings: To improve training efficiency, the input images were randomly cropped to 96×96 pixels. Training was conducted using the PyTorch framework, an NVIDIA 4090 GPU, Python version 3.8, and CUDA version 11.3. A staged training strategy was adopted, using the Adam optimizer with default parameter settings and a fixed learning rate of 0.0001. The training iterations totaled 200, with a batch size of 128.
[0048] To evaluate algorithm performance, the paired dataset uses metrics such as Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index (SSIM), and Learned Perceptual Image Patch Similarity (LPIPS) to quantitatively compare the enhanced image with its corresponding ground truth reference image. The unpaired dataset uses Natural Image Quality Evaluation (NIQE) and No-Reference Spatial Quality Evaluation (BRISQUE) as evaluation methods.
[0049] PSNR is the ratio of the maximum possible power of a signal to the noise power, and is commonly used to evaluate image quality. The formula for calculating PSNR is: in, This represents the maximum pixel value of the image. To enhance the mean square error between the image and the ground truth reference image.
[0050] SSIM (Structural Similarity Index) is a metric used to measure the similarity between two images. It takes into account the brightness, contrast, and structural information of the images. The formula for calculating SSIM is: in, and These represent the enhanced reference image and the true reference image, respectively. and for and The average value, and for and variance for and covariance, and It is a small constant for stable division.
[0051] LPIPS (Learned Perceptual Patch Similarity) is a metric based on human visual perception used to evaluate the perceptual similarity between two images. It comprehensively considers visual elements such as color, texture, and structure to capture perceptual differences between images. LPIPS extracts patch features from two images using a pre-trained deep neural network and calculates the differences between these features to measure perceptual similarity; a smaller value indicates that the two images are perceptually closer.
[0052] NIQE (Natural Image Quality Assessment) is a no-reference image quality assessment metric that evaluates the quality of a test image by extracting statistical features from a natural image. Its basic principle is as follows: First, a series of features are extracted from the image and fitted to a multivariate Gaussian model; then, the difference between the feature model of the test image and the pre-established feature model of the natural image is calculated. The smaller the NIQE value, the closer the quality of the test image is to that of the natural image, and the better the image quality. Its calculation formula can be expressed as: It is the input image. It is the feature vector of the image (the natural image statistical features extracted from the image). It is the mean of the feature vectors, which comes from the training set of natural images. It is the covariance matrix of the eigenvectors, derived from the training set of natural images. It is the inverse of the covariance matrix.
[0053] BRISQUE (No-Reference Image Spatial Quality Assessment) is a no-reference metric for measuring the perceptual quality of images, requiring no high-quality reference image for evaluation. Based on the Natural Scene Statistical (NSS) model, this method assesses the degree of image distortion, including blur, noise, and compression artifacts, by analyzing the image's local contrast, brightness normalization characteristics, and statistical distribution features. A smaller BRISQUE value indicates better perceptual quality.
[0054] The improved Retinex model was trained using the aforementioned training parameters, and the training results were comprehensively compared across multiple evaluation metrics, including PSNR, SSIM, LPIPS, NIQE, and BRISQUE. Based on the training performance and comparison results, the model module structure and hyperparameter settings were continuously optimized to ultimately obtain the optimal model suitable for production applications.
[0055] Step (4): Apply the trained improved Retinex model to low-light images on multiple validation datasets to obtain the enhancement results.
[0056] To further verify the effectiveness and generalization ability of the proposed method in real-world scenarios, the model was tested on the real-world dataset LSRW. This dataset contains low-light images captured in various real-world scenes using a Nikon D7500 camera and a Huawei P40 Pro smartphone, covering different lighting conditions, shooting environments, and device types. It effectively tests the model's enhancement effect and adaptability in practical applications. Specific results are shown in the appendix. Figure 5 As shown.
[0057] The improved Retinex model is an innovative deep learning framework for low-light image enhancement, based on Retinex theory and employing a multi-stage collaborative optimization mechanism. The model decomposes the image into illumination and reflection components using the DecomNet module, effectively preserving low-level features through skip connections and branching structures. The DenoiseNet module introduces a diffusion model for progressive denoising of the reflection component, achieving a balance between detail restoration and noise suppression through an improved denoising loss function. The ReLightNet module integrates the EMA attention mechanism and Mamba to construct an encoder-decoder network architecture, enabling adaptive adjustment of illumination features and local contrast enhancement.
[0058] In the decomposition stage, the model preserves high-frequency detail information through multi-scale feature extraction; in the denoising stage, it restores the texture structure through the inverse process of the diffusion model; and in the enhancement stage, it highlights the response of key regions through an attention mechanism. Through the coordinated optimization of these three stages, the problems of insufficient brightness, noise interference, and loss of detail in low-light images are effectively solved. This method shows significant advantages in illumination modeling, detail preservation, and perceptual quality optimization, especially demonstrating excellent performance in enhancing small targets and suppressing artifacts under complex lighting environments.
[0059] Future research will focus on improving the model's adaptability under extreme low-light conditions, exploring lightweight designs to optimize computational efficiency, and further promoting the technology's potential for cross-scenario applications in fields such as autonomous driving and medical imaging.
[0060] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A low-light image enhancement method based on a diffusion model and improved Retinex theory, characterized in that, Includes the following steps: Step (1) Select a relatively classic dataset and obtain the low-light images and corresponding normal-light images from it; Step (2) Based on Retinex theory, construct an improved Retinex model; Step (3) Train the improved Retinex model; Step (4) Apply the trained improved Retinex model to low-light images on multiple validation datasets to obtain the enhancement results.
2. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1, characterized in that, The training data was constructed by collecting paired images of low-light and standard-light conditions in multiple scenes using imaging equipment and then fusing them with samples from a public data warehouse that have different light distributions.
3. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1, characterized in that, During the training phase, the LOL-v1 and LOL-v2 synthetic datasets and paired images of various indoor scenes were used to enrich the sample distribution. During the validation phase, the model was deployed on cross-domain datasets such as DICM and LIME, and the generalization performance was evaluated using peak signal-to-noise ratio and structural similarity metrics. During the real-world testing phase, actual data collected from LSRW-HUAWEI and LSRW-Nikon were used to determine the practicality and reliability of the model from visual quality dimensions such as brightness balance, color fidelity, and detail sharpness.
4. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1, characterized in that, The construction of a DecomNet based on the improved Retinex model includes: deploying a dual-branch weight-sharing structure in the decomposition network architecture to replace the traditional single-branch decomposition paradigm, with one branch dedicated to reflection component extraction and the other focusing on illumination component estimation; during feature processing, DecomNet implements a cross-layer channel cascading strategy, fusing the high-frequency texture information of the shallow network with the abstract semantic representation of the deep network along the channel dimension, thereby achieving effective aggregation of multi-scale features; in addition, DecomNet implements end-to-end supervision of the image decomposition process by jointly optimizing multiple loss functions such as reconstruction error, reflection component consistency constraint, illumination smoothness regularization, and illumination gradient consistency constraint, ensuring that while achieving accurate decoupling of illumination and reflection components, it can reconstruct the input image with high quality and maintain the coherence and stability of the illumination distribution.
5. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 4, characterized in that, The construction of a DenoiseNet based on the improved Retinex model includes: introducing a diffusion probability model to progressively denoise the reflection component; unlike traditional methods which inherently contradict noise suppression and detail preservation, the diffusion model learns the noise statistics of the reflection component through a controllable forward denoising and backward denoising process; at the loss function level, reconstruction error and self-constrained consistency terms are fused, with the former constraining pixel-level recovery accuracy and the latter ensuring consistency between the feature space and the intrinsic properties of the input low-light image; by jointly optimizing the above loss terms, the model is guided to effectively preserve texture details and edge structures during the denoising process; DenoiseNet inputs the denoised reflection component and the initial illumination component into the subsequent illumination enhancement network, providing a high-fidelity, low-noise reflection foundation for the final image reconstruction, thereby improving the overall enhancement effect.
6. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1, characterized in that, The RelightNet component, built upon the improved Retinex model, comprises: an encoder-decoder architecture where the encoder extracts multi-scale features through cascaded downsampling convolutional modules, and achieves stable training with instance normalization and LeakyReLU activation functions; within the encoder, an EMA (Exponential Moving Average) attention mechanism is introduced, which effectively enhances the model's perception of illumination features through multi-scale feature extraction and cross-dimensional interaction. During the illumination enhancement stage, EMA adaptively adjusts the illumination response of different regions, synergistically improving the brightness, color reproduction, and detail of the image; simultaneously, a Mamba module is introduced, which, through its unique sequence modeling capabilities, adds positional encoding before processing image features, thereby better capturing spatial location information in the image and achieving image enhancement.
7. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1, characterized in that, A training configuration based on the improved Retinex model is as follows: To improve training efficiency, the input image is randomly cropped to a size of 96×96 pixels. An NVIDIA 4090 graphics processor is used, and training is conducted based on the PyTorch deep learning framework. The Python version is 3.8, the CUDA version is 11.3, a staged training strategy is adopted, the Adam optimizer is selected and the default parameter settings are used, the learning rate is fixed at 0.0001, the training iterations are repeated a total of 200 times, and the batch size is set to 128.
8. The low-light image enhancement method based on a diffusion model and improved Retinex theory according to claim 1, characterized in that, The trained model is directly deployed to real-world scenarios to obtain enhanced image results. The specific operation process is as follows: First, the robustness and generalization ability of the trained model described in claim 7 are evaluated on multiple validation datasets such as DICM, LIME, MEF, NPE, and VV, as well as real-world scene datasets such as LSRW-HUAWEI and LSRW-Nikon. Then, the performance of the model under different low-light environments is comprehensively measured from multiple dimensions using evaluation metrics such as PSNR, SSIM, LPIPS, NIQE, and BRISQUE, to test its adaptability and processing stability to diverse images. Once the evaluation is passed, the model can be directly applied to actual low-light images to output enhancement results.