Low-light image enhancement method based on combination of partial head self-attention module and gated feedforward network

This low-light image enhancement method, which combines a partial head self-attention module and a gated feedforward network, solves the problems of computational complexity and resource consumption, and achieves efficient image enhancement and noise suppression, making it suitable for resource-constrained devices.

CN120807328APending Publication Date: 2025-10-17WUHAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511100703.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing low-light image enhancement methods suffer from bottlenecks in computational complexity and resource consumption, especially the computational redundancy and memory consumption caused by multi-head attention modules, making it difficult to maintain high performance on resource-constrained devices.

Method used

By combining a partial head self-attention module and a gated feedforward network, a U-shaped network is constructed to extract image features by reducing the number of heads and using a single head to process partial channels. The image enhancement process is optimized by combining convolutional layers and a gating mechanism.

Benefits of technology

It significantly reduces computational redundancy and memory access costs, improves model running efficiency and image enhancement effects, and can better process high-resolution images and remove noise while preserving image details and structural information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807328A_ABST
    Figure CN120807328A_ABST
Patent Text Reader

Abstract

The invention provides a low-light image enhancement method based on the combination of a partial head self-attention module and a gated feedforward network, and the method comprises the steps: embedding the partial head self-attention module and the gated feedforward network into a U-shaped network, and initializing an uncertainty model u [theta] and a diffusion model belonging to [theta] with the network as a skeleton; first-stage training is executed, training of preset iterations is carried out on the uncertainty model u theta, and the uncertainty model u theta after training is completed is used for outputting an uncertainty graph Pt; second-stage training is executed, parameters of the uncertainty model u theta are frozen, training of the diffusion model belonging to theta is assisted by using the uncertainty graph Pt, and training of preset iterations is carried out on the diffusion model belonging to theta; and inputting the low-light image Y into a diffusion model belonging to theta for model reasoning, and reconstructing a noise image into a normal-light image by the diffusion model belonging to theta under the condition of the low-light image. Experimental results on LOLv1 and LOLv2 real data sets show that the method provided by the invention has a good effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image inpainting, in particular to a low-light image enhancement method based on a partial head self-attention module and a gated feedforward network combination, which can be used in downstream applications such as target detection, target re-identification, automatic driving and agricultural monitoring. BACKGROUND

[0002] Low-light image enhancement is to improve the quality of images captured under insufficient lighting conditions, enhance the brightness, contrast and detail information of images, and make originally dull or severely noisy images clear and visible. As one of the key technologies in the field of computer vision and image processing, low-light image enhancement includes sub-tasks such as noise suppression, dynamic range adjustment and color fidelity, and can effectively solve the problem of image information loss in low-light environments. This technology is widely used in automatic driving, medical image analysis, security monitoring, remote sensing detection and many other fields. Through algorithm optimization, it compensates for the limitations of hardware devices and significantly improves the robustness of the vision system in complex environments, which has important engineering application value. In addition, low-light image enhancement plays a crucial role in promoting subsequent high-level visual tasks such as target recognition, scene understanding and image segmentation.

[0003] With the widespread use of deep learning technology, low-light image enhancement algorithms have developed rapidly. Low-light image enhancement methods can be mainly divided into two categories: one is based on traditional image processing techniques, such as histogram equalization, Gamma correction and Retinex theory, etc. These methods adjust the brightness distribution of the image or separate the illumination and reflection components to enhance the image. However, these methods often introduce noise when processing low-light images, and due to the complexity of lighting conditions or uneven reflection characteristics, the image may be too bright or too dark in some local areas, making it impossible to achieve balanced adjustment of the global illumination. The other is based on deep learning, which trains a neural network model to learn the mapping relationship from low-light images to normal light images and restores high-quality images.

[0004] In recent years, attention mechanisms have been combined with feedforward networks to capture long-range dependencies in images, enhance the expression of local features, and optimize feature selection and transmission through feedforward networks, thereby enhancing image details while suppressing noise amplification. Attention mechanisms have been widely used to improve model performance in image processing tasks. For example, Ruan et al. designed a cross-scale DMSA module to enable the model to focus on key areas of the image and capture long-range dependencies. Wang et al. incorporated a dual-attention convolutional block into a global and local aggregation framework to simultaneously learn non-local representations and local features. Fang et al. proposed a multi-scale attention Transformer to achieve balanced global illumination in images. In addition, Xu et al. used an attention module to guide the model to focus on high-noise areas, thereby improving image enhancement. Although these methods have many advantages, the combination of attention mechanisms and feedforward networks often comes with an increase in computational complexity, which can affect the real-time performance and performance of the model, especially when processing high-resolution images, the consumption of computing resources becomes a major bottleneck.

[0005] To improve image quality while reducing computational complexity, Alexandru Brateanu et al. proposed the LYT-Net model. LYT-Net is a low-light image enhancement model based on lightweight Transformers, designed to improve image quality through an efficient computing architecture. LYT-Net introduces two novel modules: a channel denoiser and a multi-stage compression excitation fusion module, and combines traditional multi-head self-attention mechanisms to achieve excellent image enhancement results while significantly reducing computational complexity. By optimizing the model structure and computing process, LYT-Net not only effectively restores detailed information in low-light images, but also significantly reduces the consumption of computing resources, making it more suitable for running on resource-constrained devices. Although this method effectively reduces the computational load of the model, the performance of the model does not improve, especially the degree of noise suppression in the enhanced image is insufficient.

[0006] Although multi-head attention mechanism performs well in improving model performance, it also has some significant shortcomings. First, the multi-head attention module independently calculates and applies attention maps in multiple subspaces, resulting in high computational complexity and memory overhead, especially when dealing with a large number of channels, each head needs independent query (Q), key (K) and value (V) calculation, which significantly increases the computational burden of the model. Second, studies have shown that there is a high degree of redundancy between many attention heads, and some heads contribute less to model performance, or even removing some heads has little effect on accuracy. This redundancy not only wastes computing resources, but also increases the memory occupancy of the model. In addition, memory-intensive operations in the multi-head attention module occupy a large part of the runtime, especially when processing high-resolution images or long sequence data, these operations will significantly limit the computational efficiency of the model. These shortcomings make the multi-head attention module inefficient when running on resource-constrained devices, making it difficult to maintain high performance while meeting strict delay and memory constraints. SUMMARY

[0007] Based on the above background, the present application proposes a low-light image enhancement method based on the combination of partial head self-attention module and gated feedforward network. The partial head self-attention module (PHA) reduces the number of heads and uses only a single head to process part of the channels, thereby significantly reducing computational redundancy and memory access cost. Specifically, the following technical solutions are adopted:

[0008] A low-light image enhancement method based on the combination of partial head self-attention module and gated feedforward network, comprising the following steps:

[0009] S1, embed the partial head self-attention module and the gated feedforward network into the U-shaped network, use the partial head self-attention module and the gated feedforward network to extract image features, and initialize the uncertainty model u θ and the diffusion model ∈ θ using the network as the skeleton;

[0010] S2, perform first-stage training, train the uncertainty model u θ for a preset number of iterations, and use the trained uncertainty model u θ to output an uncertainty map P t , the uncertainty map P t is used to guide the model to focus on the darker areas and areas with more noise distribution in the low-light image;

[0011] S3, perform second-stage training, freeze the parameters of the uncertainty model u θ , use the uncertainty map P θ output by the uncertainty model u t to assist the training of the diffusion model ∈ θ , train the diffusion model ∈θ training for a preset number of iterations is performed;

[0012] S4, input the low-light image Y into the trained diffusion model ∈ θ S4, input the low-light image Y into the trained diffusion model ∈ θ reconstruct a noise image into a normal light image under the condition of a low-light image.

[0013] Further, in step S1, the partial head self-attention module and the gated feedforward network are embedded into the U-shaped network, and the partial head self-attention module and the gated feedforward network are used to extract image features, which specifically includes:

[0014] S11, split the feature map X with C channels into two parts, a feature map X1 and a feature map X2, wherein the feature map X1 has C p channels, and the feature map X2 has C-C p channels:

[0015] X1,X2=split(X,[C p ,C-C p ],dim=1)

[0016] S12, input the feature map X1 into the projection layer to calculate the query Q, the key K and the value V:

[0017] Q,K,V=split(Proj(X1),[d qk ,d qk ,C p ],dim=1)

[0018] S13, calculate the attention score matrix A:

[0019]

[0020] S14, weight and sum the value V using the attention score matrix A:

[0021]

[0022] S15, splice the processed feature map X1 and the feature map X2, and output the feature map X through the projection layer:

[0023] X=Proj(concat(X1,X2))

[0024] S16, input the processed feature map X into the gated feedforward network, and the feature map X is first processed by point convolution:

[0025] X=PWConv(X)

[0026] S17, calculate the gating value by deep separable convolution, thereby weighting the feature map X:

[0027] X=X⊙DWConv(X)

[0028] S18, the final feature map X is output after point convolution:

[0029] Output=PWConv(X).

[0030] Further, in step S2, the uncertainty model u θ is trained for a preset number of iterations, and the training specifically includes:

[0031] S21, first, the parameters of the uncertainty model u θ are initialized;

[0032] S22, take a normal light and low light image pair (X0, Y), randomly sample a time step t ~ U(1, T) and a noise map ∈ ~ N(0, I);

[0033] S23, according to the time step t, add the noise map ∈ to the normal light image X0 to obtain a noisy image X t :

[0034]

[0035] S24, input the noisy image X t and the low light image Y into the uncertainty model u θ , the uncertainty model u θ outputs a predicted noise map and an uncertainty map P t , the predicted noise map and the noise map ∈ are constrained, and the uncertainty map P t is used for weighting:

[0036] P t =u θ (Y,X t ,t)

[0037]

[0038] S25, repeat the above steps until the model converges, and finally return the trained model.

[0039] Further, in step S3, the second stage of training specifically includes:

[0040] S31, initialize the parameters of the diffusion model ∈ θ , and freeze the parameters of the uncertainty pre-trained model u θ ;

[0041] S32, take a normal light and low light image pair (X0, Y), randomly sample time step t ~ U(1, T) and noise ∈ ~ N(0, I);

[0042] S33, add noise map ∈ to normal light image X0 according to time step t, get noisy image X t ;

[0043] S34, use the pre-trained uncertainty model u θ to generate uncertainty map Pt, and input noisy image X t and low light image Y to diffusion model ∈ θ to generate a predicted noise map ∈ θ (Y, X t , t);

[0044] S35, predict the state X θ of the previous time step through the reverse process formula in diffusion model ∈ t-1 :

[0045]

[0046] where, σ t is a noise scale parameter related to time step t, used to control the intensity of noise added in the reverse process, and z is a tensor randomly selected from a standard Gaussian distribution;

[0047] S36, divide X0 into n small vector blocks, and apply K-means clustering algorithm to divide these vector blocks into K groups Each group has n j blocks, and then stack the vector blocks of each group into a matrix to get Similarly, get t-1 from X Finally, singular value decomposition is performed on these matrices to get the decomposed diagonal matrix and

[0048] S37, calculate the global structure-aware loss:

[0049]

[0050] where diag(·) returns the vector of the main diagonal of the matrix, and κ t is an adaptive factor related to time step t;

[0051] S38, the total loss of diffusion model training is:

[0052]

[0053] where λ is a hyper-parameter, set to 10 in the experiment, P t is the uncertainty map, by which the model is guided to identify the areas that need to be denoised. t is weighted, and higher weights are added to the high-noise areas, so as to indicate to the model which places need to be denoised;

[0054] S39, repeat the above steps until the model converges, and finally return the trained model.

[0055] The beneficial effects of the present application are as follows:

[0056] (1) The partial head self-attention module reduces the number of heads and uses only a single head to process partial channels, thereby significantly reducing the computational redundancy and memory access cost. Specifically, the partial head self-attention module first eliminates the computational redundancy brought by the multi-head mechanism, reduces the use of memory-intensive operations, and thus can better utilize the computing power of GPU / CPU. Secondly, the partial head self-attention module can utilize local details and global context in parallel in a single token mixer through partial channel processing, avoiding the redundancy of traditional serial methods when processing all channels. In addition, the final projection of the partial head self-attention module is applied to all channels, ensuring that the attention features can be effectively propagated to the remaining channels, thereby maintaining the expressive ability of the model.

[0057] (2) When constructing the model, the convolutional layer is used to replace the fully connected layer, and the gating mechanism is introduced, which reduces the computational complexity of the model while enhancing the image feature extraction ability of the model. The local receptive field characteristics of the convolutional layer enable the model to better capture the local features of the image, and the gating mechanism further improves the expressive ability of the model by dynamically adjusting the information flow. This design not only improves the running efficiency of the model, but also enables it to better balance performance and resource consumption on resource-constrained devices.

[0058] (3) By using the uncertainty map, the model can identify the areas in the image that are darker and have more noise distribution, thereby more targetedly performing enhancement operations, and the predicted noise map can quantify the noise level in the low-light image, helping the model to remove the noise of the image. In this way, the model can gradually optimize the denoising effect while progressively restoring important details and structural information of the image. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 is a schematic diagram of the convolutional neural network used in the method of the low-light image enhancement method embodiment of the present application.

[0060] Figure 2 is a schematic diagram of the first stage training flow of the low-light image enhancement method embodiment of the present application.

[0061] Figure 3 Schematic diagram of the second stage training flow of the low-light image enhancement method embodiment of the present invention.

[0062] Figure 4 This is a visual comparison diagram of the processing results of the method of the present invention and the processing results of the existing method.

[0063] Figure 5 This figure compares the test results of the method of the present invention on the LOLv2 real data set with the test results of the existing methods. DETAILED DESCRIPTION

[0064] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0065] The embodiment of the present invention provides a low-light image enhancement method based on a combination of a partial head self-attention module and a gated feedforward network, comprising the following steps:

[0066] S1. Embed the partial head self-attention module and the gated feedforward network into the U-shaped network, use the partial head self-attention module and the gated feedforward network to extract image features, and use the network as the skeleton to initialize the uncertainty model u θ and diffusion model∈ θ .

[0067] See also Figure 1 As a preferred implementation scheme, this step is specifically implemented through the following steps:

[0068] S11, split the feature map X with the number of channels C into two parts: feature map X1 and feature map X2, where the number of channels of feature map X1 is C p , the number of channels of X2 is CC p :

[0069] X1,X2=split(X,[C p ,CC p ],dim=1) (1)

[0070] S12. Input the feature map X1 into the projection layer to calculate the query Q, key K, and value V:

[0071] Q,K,V=split(Proj(X1),[d qk ,d qk ,Cp ],dim=1) (2)

[0072] S13. Calculate the attention score matrix A:

[0073]

[0074] S14. Use the attention score matrix A to perform weighted summation on the value V:

[0075]

[0076] S15. The processed feature map X1 and feature map X2 are concatenated, and the feature map X is output through the projection layer:

[0077] X=Proj(concat(X1,X2)) (5)

[0078] S16. Input the processed feature map X into the gated feedforward network. The feature map X is first processed by point convolution:

[0079] x=PWconv(X) (6)

[0080] S17. Calculate the gate value through depth-wise separable convolution to weight the feature map X:

[0081] X=x⊙DWConv(x) (7)

[0082] S18, the final feature map x is output after point convolution:

[0083] Output = PWConv(x) (8).

[0084] S2, perform the first stage of training, for the uncertainty model u θ Perform training for a preset number of iterations and use the trained uncertainty model u θ Output uncertainty map P t , the uncertainty graph P t It is used to guide the model to focus on darker areas and areas with more noise in low-light images.

[0085] See also Figure 2 As a preferred implementation scheme, this step is specifically implemented through the following steps:

[0086] S21. First, initialize the uncertainty model u θ Parameters;

[0087] S22, take the normal light and low light image pairs (X0, Y), randomly sample time steps t~U(1,T) and noise maps ∈~N(0,I);

[0088] S23, add noise map ∈ to normal light image X0 according to time step t to obtain noisy image X t :

[0089]

[0090] S24, input noisy image X t and low light image Y to uncertainty model u θ , uncertainty model u θ outputs predicted noise map and uncertainty map P t , constrain predicted noise map and noise map ∈ while using uncertainty map P t to weight:

[0091] P t = u θ (Y, X t , t) (10)

[0092]

[0093] S25, repeat the above steps until the model converges, and finally return the trained model.

[0094] S3, perform second stage training, freeze parameters of uncertainty model u θ , use uncertainty map P θ output by uncertainty model u t to assist training of diffusion model ∈ θ , and train diffusion model ∈ θ for a preset number of iterations.

[0095] Referring to Figure 3 , as a preferred embodiment, this step is specifically implemented by the following steps:

[0096] S31, initialize parameters of diffusion model ∈ θ , and freeze parameters of uncertainty pre-trained model u θ ;

[0097] S32, take a normal light and low light image pair (X0, Y), randomly sample time step t ~ U(1, T) and noise ∈ ~ N(0, I);

[0098] S33, add noise map ∈ to normal light image X0 according to time step t to obtain noisy image X t , which is the same as formula (9);

[0099] S34, use pre-trained uncertainty model u θAn uncertainty map P is generated, and the noisy image X t and the low-light image Y are concatenated into the diffusion model ∈ θ to generate a predicted noise map ∈ θ :

[0100] ∈ θ = ∈ θ (Y, X t , t) (12)

[0101] S35, the state X θ at the previous time step is predicted by the reverse process formula in the diffusion model ∈ t-1 :

[0102]

[0103] where σ t is a noise scale parameter related to the time step t, which controls the intensity of the added noise in the reverse process, and z is a tensor randomly drawn from a standard Gaussian distribution;

[0104] S36, X0 is divided into n small vector blocks, and a K-means clustering algorithm is applied to divide these vector blocks into K groups Each group has n j blocks, and then the vector blocks in each group are stacked into a matrix to obtain Similarly, X t-1 is obtained by Finally, singular value decomposition is performed on these matrices to obtain the decomposed diagonal matrix and

[0105] S37, the global structure-aware loss is calculated:

[0106]

[0107] where diag(·) returns the vector of the main diagonal of the matrix, and κ t is an adaptive factor related to the time step t;

[0108] S38, the total loss of the diffusion model training is:

[0109]

[0110] where λ is a hyperparameter set to 10 in the experiment, and P t is the uncertainty map, which is weighted by the uncertainty map P t to add higher weights to high-noise areas, thereby indicating to the model which areas need to be denoised.

[0111] S39. Repeat the above steps until the model converges, and finally return to the training model.

[0112] S4. Input the low-light image Y into the diffusion model ∈ θ Model inference is performed in the diffusion model ∈ θ Under the condition of low-light image, a noise image is reconstructed into a normal-light image.

[0113] The following is a further explanation of the advancement of the present invention compared to the prior art with reference to actual cases.

[0114] In the following real-world examples, the model is evaluated using two widely used low-light image enhancement benchmark datasets: League of Legends v1 (LOLv1) and League of Legends v2. The LOLv1 dataset contains 485 pairs of training images and 15 pairs of test images, all collected from real scenes with varying exposure conditions. The LOLv2 dataset contains 689 pairs of training images and 100 pairs of test images, acquired in real-world environments with modified camera parameters. Evaluation metrics include peak signal-to-noise ratio (PSNR), structural similarity index (SSIM), and learning-perceptual patch similarity (LPIPS).

[0115] In this example, the model training is performed on an RTX4090 GPU and is divided into two stages: the first stage trains 1 million iterations, sets the diffusion model time step to 500, and uses a linear noise schedule (1×10 -4 to 4×10 -2 ), using Adam optimizer with a learning rate of 1×10 -4 The second stage is trained for 2 million iterations, and the rest of the settings are the same as the first stage. In addition, the cropped image size is set to 96 and the batch size is set to 8.

[0116] The result graph obtained by the method of the present invention is compared with the result graph obtained by the existing method. The results are as follows Figure 4 As shown, Figure 4 (a) and Figure 4 (h) shows a pair of low-light image and normal-light image, and the middle columns are the result images of the existing method and the method of the present invention. Figure 4 (b) is the result of the SNR-Aware method proposed by Xu et al. Figure 4 (c) is the result of the RetinexFormer method proposed by Cai et al. Figure 4 (d) is the result of the LLFormer method proposed by Wang et al. Figure 4 (e) is the result of the GSAD method proposed by Hou et al. Figure 4 (f) is the result graph of the LYT-Net method proposed by Brateanu et al.Figure 4 Figure (g) shows the results of our method. As can be seen, the low-light image enhanced by our method exhibits no overexposed or underenhanced areas, while effectively suppressing noise. Furthermore, by incorporating a global structure-aware loss into the diffusion model, our method preserves structural information in the enhanced image.

[0117] As shown in Table 1 (Time (h) spent by different attention modules in the first stage of model training), several state-of-the-art attention modules were selected and embedded in the same location in the model for the first stage of training. The partial head self-attention module in our method significantly reduces the computational complexity of the model by performing attention calculations on partial dimensions, resulting in the shortest time spent in experimental comparisons. Dual attention is a module proposed by Sun et al., deformable attention is a module proposed by Xia et al., multi-scale attention is a module proposed by Wang et al., patch-aware attention is a module proposed by Xu et al., and token attention is a module proposed by Huang et al.

[0118] Table 1

[0119]

[0120] As shown in Table 2, the method of the present invention is compared with LLFormer, RetinexMamba, LYT-Net, SNR-Aware, RetinexFormer, and GSAD. The comparison shows that, on League of Legends version 1, the method of the present invention outperforms the other methods in all metrics except for a slightly lower PNSR. On the real League of Legends version 2 dataset, all metrics outperform the other methods. It is particularly important to emphasize that higher PNSR and SSIM metrics indicate better image enhancement, while lower LPIPS indicates better image enhancement.

[0121] Table 2

[0122]

[0123] In addition, if Figure 5 As shown in the figure, the method of the present invention has significant advantages on the LOLv2 real dataset, far exceeding other methods on the horizontal and vertical axes. This is due to the partial head self-attention module and the gated feedforward network. The image features are extracted through the partial head self-attention module, and then the features are weighted through the gating mechanism, so that the model generates more accurate prediction noise maps and better uncertainty maps.

[0124] In summary, the solution of the present invention significantly improves the robustness of low-light image enhancement and can efficiently generate clearer and more natural enhanced images.

[0125] Finally, it needs to be explained that the above is only the preferred embodiment of the present application, and is not used to limit the protection scope of the present application. Although the present application has been described in detail in combination with the embodiments, it can still be modified or some features can be replaced by the equivalent for those skilled in the art without departing from the core idea of the present application. Any modification, replacement or improvement made within the design idea and principle of the present application shall be included in the protection scope of the present application.

[0126] The above describes the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited by the above-mentioned embodiments, and the embodiments and the specification are only used to illustrate the principles of the present application. Any modification, replacement or improvement of the present application without departing from the spirit and scope of the present application falls within the protection scope. The present application combines part of the head self-attention module and the gated feed-forward network, significantly improves the efficiency and effect of low-light image enhancement, and provides an efficient and robust solution for the image processing field.

Claims

1. A low-light image enhancement method based on a partial head self-attention module and a gated feedforward network, characterized in that: The steps include: S1. Embed the partial head self-attention module and the gated feedforward network into the U-shaped network, use the partial head self-attention module and the gated feedforward network to extract image features, and use the network as the skeleton to initialize the uncertainty model u θ and diffusion model∈ θ ; S2, perform the first stage of training, for the uncertainty model u θ Perform training for a preset number of iterations and use the trained uncertainty model u θ Output uncertainty map P t , the uncertainty graph P t Used to guide the model to focus on darker areas and areas with more noise in low-light images; S3. Perform the second stage of training and freeze the uncertainty model u θ Parameters, using uncertainty model u θ Output uncertainty map P t Facilitated Diffusion Model∈ θ Training of diffusion model ∈ θ Perform training for a preset number of iterations; S4. Input the low-light image Y into the trained diffusion model ∈ θ In the diffusion model ∈ θ Reconstruct a noise image into a normal-light image under the condition of a low-light image.

2. The low-light image enhancement method based on the combination of a partial head self-attention module and a gated feedforward network according to claim 1, characterized in that: In step S1, the embedding of the partial head self-attention module into the U-shaped network and the use of the partial head self-attention module and the gated feedforward network to extract image features specifically include: S11, split the feature map X with the number of channels C into two parts: feature map X1 and feature map X2, where the number of channels of feature map X1 is C p , the number of channels of X2 is CC p : X1,X2=split(X,[C p ,C-C p ],dim=1) S12. Input the feature map X1 into the projection layer to calculate the query Q, key K, and value V: Q,K,V=split(Proj(X1),[d qk ,d qk ,C p ],dim=1) S13. Calculate the attention score matrix A: S14. Use the attention score matrix A to perform weighted summation on the value V: S15. The processed feature map X1 and feature map X2 are concatenated, and the feature map X is output through the projection layer: X=Proj(concat(X1,X2)) S16. Input the processed feature map X into the gated feedforward network. The feature map X is first processed by point convolution: X=PWConv(X) S17. Calculate the gate value through depth-wise separable convolution to weight the feature map X: X=X⊙DWConv(X) S18, the final feature map X is output after point convolution: Output = PWConv(X).

3. The low-light image enhancement method based on the combination of partial head self-attention module and gated feedforward network according to claim 1, characterized in that: In step S2, the uncertainty model u θ Training for a preset number of iterations specifically includes: S21. First, initialize the uncertainty model u θ Parameters; S22, take the normal light and low light image pairs (X0, Y), randomly sample time steps t~U(1,T) and noise maps ∈~N(0,I); S23, add a noise map ∈ to the normal light image X0 according to the time step t, and obtain the image X with noise t : S24, the image X with noise t And the low light map Y is input to the uncertainty model u θ In the uncertainty model u θ Output predicted noise map and uncertainty graph P t , the noise map will be predicted and noise graph ∈ to constrain, and use uncertainty graph P t Weighted: P t =u θ (Y,X t ,t) S25. Repeat the above steps until the model converges, and finally return to the training model.

4. The low-light image enhancement method based on the combination of partial head self-attention module and gated feedforward network according to claim 3, characterized in that: In step S3, the second stage of training specifically includes: S31, initialize the diffusion model ∈ θ Parameters and freeze the uncertainty pre-training model u θ Parameters; S32, take a normal light and low light image pair (X0, Y), randomly sample time step t~U(1,T) and noise ∈~N(0,I); S33, add a noise map ∈ to the normal light image X0 according to the time step t, and obtain the image X with noise t ; S34. Use pre-trained uncertainty model u θ Generate an uncertainty map Pt and transform the noisy image X t And the low light map Y is stitched and input to the diffusion model ∈ θ Generate a prediction noise map ∈ θ (Y,X t ,t); S35, through the diffusion model ∈ θ The reverse process formula in predicts the state X of the previous time step t-1 : Among them, σ t A noise scale parameter related to the time step t, which is used to control the intensity of the noise added in the inverse process. z is a tensor randomly drawn from a standard Gaussian distribution; S36, split X0 into n small vector blocks, and apply K-mean clustering algorithm to divide these vector blocks into K groups Each group n j blocks, and then stack the vector blocks of each group into a matrix to get The same method is used by X t-1 get Finally, these matrices are subjected to singular value decomposition Get the decomposed diagonal matrix and S37. Calculate the global structure perception loss: where diag(·) returns the vector of the main diagonal of the matrix, κ t is the adaptive factor, and its size is related to the time step t; S38. The total loss of diffusion model training is: Where λ is a hyperparameter, which is set to 10 in the experiment, and P t is the uncertainty graph, through the uncertainty graph P t Perform weighting, adding higher weights to high-noise areas, thereby indicating to the model which areas need to be focused on denoising; S39. Repeat the above steps until the model converges, and finally return to the training model.