Image enhancement method and device based on dark channel guidance
By combining the dehazing branch and the prior correction guidance branch of the Unet architecture, and utilizing the dark channel guidance and frequency domain selection mechanism, the low efficiency problem of the dehazing algorithm in the existing technology is solved, and an efficient and robust image dehazing effect is achieved.
Patent Information
- Application Number
- CN202510722842.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-26
AI Technical Summary
Existing single-image dehazing methods have high computational cost and low efficiency when dealing with complex haze scenes. Traditional methods fail to fully utilize the complementary information in the spatial and frequency domains, and the quadratic computational complexity of the Transformer model limits its real-time performance.
An image enhancement method based on dark channel guidance is adopted, combined with the dehazing branch and the prior correction guidance branch of the Unet architecture. Global modeling is performed through the complementary information of the spatial domain and the frequency domain, and feature enhancement is performed using the haze perception frequency selection submodule and the multi-level hybrid gated aggregation submodule.
While reducing computing resources, the efficiency and performance of the dehazing algorithm are improved, and the robustness and real-time performance of the dehazing effect are significantly enhanced, especially in outdoor scenes and scenes with uneven fog and haze.
Smart Images

Figure CN120707407A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to an image enhancement method and device based on dark channel guidance. Background Art
[0002] In computer vision, single image dehazing is an important research direction, aiming to restore clear image content from images affected by haze. Traditional dehazing methods mostly rely on spatial domain features to construct long-range dependencies, which leads to high computational cost and difficulty in handling complex haze scenes. In recent years, although some methods have introduced frequency domain analysis, they have failed to fully utilize the complementary information between the spatial and frequency domains, limiting their performance improvement in non-uniform haze scenes. In addition, the Transformer model has brought new opportunities to the single image dehazing task with its powerful global modeling capabilities. However, its quadratic computational complexity limits its real-time performance. Therefore, how to improve the efficiency of dehazing algorithms while maintaining high-quality reconstruction is a key issue in current research. Summary of the Invention
[0003] To solve the above technical problems, the present invention proposes an image enhancement method and device based on dark channel guidance.
[0004] According to a first aspect of the present invention, there is provided an image enhancement method based on dark channel guidance, the method comprising the following steps:
[0005] Step S1: Obtain an image to be processed, and perform a convolution operation on the image to be processed to obtain shallow features and dark channel prior information respectively;
[0006] Step S2: Input shallow features and dark channel prior information into the defogging branch and prior correction guidance branch of the trained defogging network model respectively; the defogging branch generates a residual image corresponding to the image to be processed, and the residual image is superimposed with the image to be processed as the defogged image;
[0007] The defogging branch uses the Unet architecture, which includes three defogging modules. The encoder of the first defogging module receives shallow features. The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module are connected in sequence, and the encoder and decoder of the same defogging module are skipped.
[0008] The prior correction guidance branch uses the Unet architecture, which includes five sequentially connected guidance modules. The first guidance module, the second guidance module, the third guidance module, the fourth guidance module, and the fifth guidance module interact bidirectionally with the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module, respectively.
[0009] The guidance module fuses the output of the previous level guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the encoder or decoder or defogging module corresponding to the guidance module is recorded as the corresponding module, and the corresponding module generates a spatial attention map based on the haze-related features, and uses the spatial attention map to process the input of the corresponding module in the defogging branch to generate spatial enhancement features; the spatial enhancement features are processed in the frequency domain, and semantic features are obtained based on the processed features; the semantic features are semantically enhanced at multiple scales through a multi-level hybrid gated aggregation sub-module; the guidance module generates the output of the guidance module based on the enhanced semantic features and haze-related features; the output of the previous level guidance module of the first guidance module is set as the dark channel prior information, and the output of the fifth guidance module is set to empty.
[0010] Preferably, the outputs of the first and second guidance modules are downsampled when input to the next module; the outputs of the third and fourth guidance modules are upsampled when input to the next module; the guidance module performs feature fusion on the output of the previous guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the guidance module generates the output of the guidance module based on the semantic features generated by its corresponding corresponding module and the haze-related features generated by the guidance module.
[0011] Preferably, the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module all include multiple stacked feature enhancement sub-modules, the encoder of the first defogging module and the decoder of the first defogging module have the same number of channels, and the same number of feature enhancement sub-modules included; the encoder of the second defogging module and the decoder of the second defogging module have the same number of channels, and the same number of feature enhancement sub-modules included; the number of channels of the encoder of the first defogging module, the encoder of the second defogging module, and the third defogging module increases successively, and the resolution decreases successively; the number of feature enhancement sub-modules in the encoder of the first defogging module, the encoder of the second defogging module, and the third defogging module increases successively.
[0012] Preferably, the feature enhancement submodule includes a haze perception frequency selection submodule and a multi-level hybrid gated aggregation submodule;
[0013] The haze perception frequency selection submodule obtains haze-related features from the corresponding guidance module based on the encoder or decoder to which it belongs, generates a spatial attention map based on the haze-related features, and performs a dot product between the spatial attention map and the input of the encoder or decoder to which the feature enhancement submodule belongs in the dehazing branch to generate enhanced features. The enhanced features are processed in the frequency domain based on the fast Fourier transform, and semantic features are obtained based on the processed features.
[0014] The multi-level hybrid gated aggregation submodule uses multiple convolution kernels of different scales to perform multi-scale reconstruction on the processed features, generates a gating signal from the reconstructed low-order features, and controls the extraction of reconstructed high-order features based on the gating signal; the extracted high-order features are input into the corresponding guidance module, and the guidance module fuses the high-order features and the guidance features of the guidance module to generate the output of the guidance module.
[0015] Preferably, the outputs of the encoder of the first defogging module and the encoder of the second defogging module are downsampled by stride convolution when input to the next module; the outputs of the decoder of the third defogging module and the second defogging module are upsampled by pointwise convolution and pixel shuffling operations when input to the next module.
[0016] According to a second aspect of the present invention, there is provided an image enhancement device based on dark channel guidance, the device comprising:
[0017] Image acquisition module: configured to acquire the image to be processed, and perform convolution operation on the image to be processed to obtain shallow features and dark channel prior information respectively;
[0018] Dehazing module: This module is configured to input shallow layer features and dark channel prior information into the dehazing branch and prior correction guidance branch of the trained dehazing network model, respectively. The dehazing branch generates a residual image corresponding to the image to be processed, and the residual image is superimposed on the image to be processed to obtain the dehazed image.
[0019] The defogging branch uses the Unet architecture, which includes three defogging modules. The encoder of the first defogging module receives shallow features. The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module are connected in sequence, and the encoder and decoder of the same defogging module are skipped.
[0020] The prior correction guidance branch uses the Unet architecture, which includes five sequentially connected guidance modules. The first guidance module, the second guidance module, the third guidance module, the fourth guidance module, and the fifth guidance module interact bidirectionally with the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module, respectively.
[0021] The guidance module fuses the output of the previous level guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the encoder or decoder or defogging module corresponding to the guidance module is recorded as the corresponding module, and the corresponding module generates a spatial attention map based on the haze-related features, and uses the spatial attention map to process the input of the corresponding module in the defogging branch to generate spatial enhancement features; the spatial enhancement features are processed in the frequency domain, and semantic features are obtained based on the processed features; the semantic features are semantically enhanced at multiple scales through a multi-level hybrid gated aggregation sub-module; the guidance module generates the output of the guidance module based on the enhanced semantic features and haze-related features; the output of the previous level guidance module of the first guidance module is set as the dark channel prior information, and the output of the fifth guidance module is set to empty.
[0022] According to a third aspect of the present invention, there is provided an electronic device, comprising:
[0023] A processor, which is used to execute multiple instructions;
[0024] A memory for storing a plurality of instructions;
[0025] The plurality of instructions are used to be stored by the memory and loaded and executed by the processor to implement the method as described above.
[0026] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the aforementioned method.
[0027] This paper proposes a dehazing network model based on dark channel-guided frequency perception. By combining haze localization in the spatial domain with a selection mechanism in the frequency domain, this model leverages the complementary information of the two domains to achieve efficient global information modeling. While reducing computational resources, this method balances efficiency and performance, significantly improving the robustness and real-time performance of the dehazing effect.
[0028] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which constitute part of the present invention, are used to provide a further understanding of the present invention. The present invention is described with the following accompanying drawings. In the accompanying drawings:
[0030] Figure 1 This is a flowchart of an image enhancement method based on dark channel guidance according to one embodiment of the present invention;
[0031] Figure 2Schematic diagram of the architecture of an image enhancement method based on dark channel guidance according to one embodiment of the present invention;
[0032] Figure 3 This is a structural block diagram of an image enhancement device based on dark channel guidance according to one embodiment of the present invention. DETAILED DESCRIPTION
[0033] First combine Figure 1-Figure 2 The image enhancement method based on dark channel guidance according to one embodiment of the present invention is described. Figure 1-Figure 2 As shown, the method includes the following steps:
[0034] Step S1: Obtain an image to be processed, and perform a convolution operation on the image to be processed to obtain shallow features and dark channel prior information respectively;
[0035] Step S2: Input shallow features and dark channel prior information into the defogging branch and prior correction guidance branch of the trained defogging network model respectively; the defogging branch generates a residual image corresponding to the image to be processed, and the residual image is superimposed with the image to be processed as the defogged image;
[0036] The defogging branch uses the Unet architecture, which includes three defogging modules. The encoder of the first defogging module receives shallow features. The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module are connected in sequence, and the encoder and decoder of the same defogging module are skipped.
[0037] The prior correction guidance branch uses the Unet architecture, which includes five sequentially connected guidance modules. The first guidance module, the second guidance module, the third guidance module, the fourth guidance module, and the fifth guidance module interact bidirectionally with the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module, respectively.
[0038] The guidance module fuses the output of the previous level guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the encoder or decoder or defogging module corresponding to the guidance module is recorded as the corresponding module, and the corresponding module generates a spatial attention map based on the haze-related features, and uses the spatial attention map to process the input of the corresponding module in the defogging branch to generate spatial enhancement features; the spatial enhancement features are processed in the frequency domain, and semantic features are obtained based on the processed features; the semantic features are semantically enhanced at multiple scales through a multi-level hybrid gated aggregation sub-module; the guidance module generates the output of the guidance module based on the enhanced semantic features and haze-related features; the output of the previous level guidance module of the first guidance module is set as the dark channel prior information, and the output of the fifth guidance module is set to empty.
[0039] In the present invention, the prior correction guidance branch generates guidance features that interact with the defogging branch based on the dark channel prior information and the feedback information of the defogging branch; the defogging branch generates feedback information and a residual image based on the shallow features and the guidance features.
[0040] Furthermore, the outputs of the first and second guidance modules are downsampled when input into the next module; the outputs of the third and fourth guidance modules are upsampled when input into the next module; the guidance module performs feature fusion on the output of the previous guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the guidance module generates the output of the guidance module based on the semantic features generated by its corresponding corresponding module and the haze-related features generated by the guidance module.
[0041] The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module all include multiple stacked feature enhancement sub-modules. The encoder of the first defogging module has the same number of channels as the decoder of the first defogging module, and the same number of feature enhancement sub-modules included; the encoder of the second defogging module has the same number of channels as the decoder of the second defogging module, and the same number of feature enhancement sub-modules included; the number of channels of the encoder of the first defogging module, the encoder of the second defogging module, and the third defogging module increases successively, and the resolution decreases successively; the number of feature enhancement sub-modules in the encoder of the first defogging module, the encoder of the second defogging module, and the third defogging module increases successively.
[0042] The feature enhancement submodule includes the haze perception frequency selection submodule and the multi-level hybrid gated aggregation submodule;
[0043] The haze perception frequency selection submodule obtains haze-related features from the corresponding guidance module based on the encoder or decoder to which it belongs, generates a spatial attention map based on the haze-related features, and performs a dot product between the spatial attention map and the input of the encoder or decoder to which the feature enhancement submodule belongs in the dehazing branch to generate enhanced features. The enhanced features are processed in the frequency domain based on the fast Fourier transform, and semantic features are obtained based on the processed features.
[0044] The multi-level hybrid gated aggregation submodule uses multiple convolution kernels of different scales to perform multi-scale reconstruction on the processed features, generates a gating signal from the reconstructed low-order features, and controls the extraction of reconstructed high-order features based on the gating signal; the extracted high-order features are input into the corresponding guidance module, and the guidance module fuses the high-order features and the guidance features of the guidance module to generate the output of the guidance module.
[0045] In the present invention, different feature enhancement submodules and numbers of channels are set to process features of different resolutions.
[0046] The outputs of the encoder of the first defogging module and the encoder of the second defogging module are downsampled by strided convolution when input to the next module; the outputs of the decoder of the third defogging module and the second defogging module are upsampled by pointwise convolution and pixel shuffling operations when input to the next module.
[0047] In this method, the dehazing branch downsamples via strided convolution and upsamples via pointwise convolution and pixel shuffling to adjust feature resolution. When processing a hazy input image, the downsampling process gradually reduces the image resolution to extract high-level semantic features. The upsampling process restores these high-level semantic features to the original image resolution and combines them with the low-level detail features introduced by skip connections, resulting in a more detailed and accurate dehazed image.
[0048] The prior correction guidance branch extracts haze-related features, which are used to guide haze perception in each feature enhancement submodule in the dehazing branch. At the end of each feature enhancement submodule, haze-related features are fed back to the prior correction guidance branch to dynamically adjust the prior guidance features and further refine the haze perception information. This operation improves the accuracy of haze localization and achieves higher-quality dehazing results. Furthermore, to match the feature size of the dehazing branch, the prior correction guidance branch uses the same downsampling and upsampling structure as the dehazing branch.
[0049] The haze-aware frequency selection submodule generates a spatial attention map based on haze-related features input from the prior-corrected guidance branch. This map is then point-multiplied with the input to enhance the spatial representation of the features, enabling spatial perception of haze information. Compared with traditional spatial self-attention methods, this approach more accurately and efficiently locates degraded regions and captures their degree of degradation. Leveraging the global modulation properties of frequency-domain operations, a fast Fourier transform (FFT)-based frequency selection unit is constructed to perform frequency-domain processing on the spatially enhanced features, emphasizing important frequency bands while suppressing noisy ones. By combining spatial and frequency-domain selection mechanisms, global dependencies can be effectively modeled, significantly improving the efficiency and accuracy of the dehazing process.
[0050] The multi-level hybrid gating aggregation submodule uses stacked small convolution kernels of different scales to model local information, focusing on the multi-scale reconstruction of image details. Low-level features are used to generate gating signals to control the feature extraction process of high-level features. This approach dynamically adjusts the propagation of high-level semantic information and enables fine-grained haze perception. By combining multi-scale feature representation learning with a hybrid gating mechanism, more flexible feature fusion is achieved, reducing the risk of loss of local details and texture information during reconstruction, and achieving high-quality local modeling.
[0051] The prior correction guidance branch uses a 5×5 convolution and a 1×1 convolution to encode the dark channel prior. This is then compared with the dehazing branch, and two downsampling modules are used to generate features at three scales as initial dark channel guidance features. Considering that the dark channel prior, while able to approximate haze distribution, can fail in outdoor images with sky areas and in non-uniform real-world haze scenes, a progressive correction of the prior guidance information is adopted. The prior guidance branch first uses the initial dark channel guidance features at the first scale to guide spatial enhancement in the haze-aware frequency selection submodule. The multi-level hybrid gated aggregation submodule then obtains dark channel correction feedback features after information interaction with the dehazing branch. The dark channel correction feedback features are then fused with the initial dark channel guidance features at this scale using an adaptive selection fusion module to serve as the next dark channel prior guidance features. This interaction with the dehazing branch dynamically optimizes the dark channel prior information, resolving the potential inaccuracy of prior information in traditional methods and further improving the dehazing robustness of the present invention in outdoor and non-uniform haze scenes.
[0052] The present invention provides a specific embodiment of an image enhancement method based on dark channel guidance.
[0053] Given a haze image I∈R 3×H×W , first use a 3×3 convolution to extract shallow features X f ∈R C×H×W , and obtain the dark channel prior X corresponding to the image d ∈R H×W Then, the shallow feature X f and dark channel prior X d The two branches interact with each other in a bidirectional manner to generate restored features. Specifically, in the dehazing branch, shallow features are processed by a series of feature enhancement submodules to extract and fuse features at different scales; the prior correction guidance branch uses dark channel prior information to guide and optimize the processing of the dehazing main branch. The two branches interact with each other to continuously adjust and improve the feature representation. Finally, these features are mapped back to the image space through a 3×3 convolution to generate the residual image I r The final reconstruction result is obtained through I c =I+I r Get, where I c This is the output of the dark channel guided image dehazing method.
[0054] like Figure 3 As shown, the present invention provides an image enhancement device based on dark channel guidance, the device comprising:
[0055] Image acquisition module: configured to acquire the image to be processed, and perform convolution operation on the image to be processed to obtain shallow features and dark channel prior information respectively;
[0056] Dehazing module: This module is configured to input shallow layer features and dark channel prior information into the dehazing branch and prior correction guidance branch of the trained dehazing network model, respectively. The dehazing branch generates a residual image corresponding to the image to be processed, and the residual image is superimposed on the image to be processed to obtain the dehazed image.
[0057] The defogging branch uses the Unet architecture, which includes three defogging modules. The encoder of the first defogging module receives shallow features. The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module are connected in sequence, and the encoder and decoder of the same defogging module are skipped.
[0058] The prior correction guidance branch uses the Unet architecture, which includes five sequentially connected guidance modules. The first guidance module, the second guidance module, the third guidance module, the fourth guidance module, and the fifth guidance module interact bidirectionally with the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module, respectively.
[0059] The guidance module fuses the output of the previous level guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the encoder or decoder or defogging module corresponding to the guidance module is recorded as the corresponding module, and the corresponding module generates a spatial attention map based on the haze-related features, and uses the spatial attention map to process the input of the corresponding module in the defogging branch to generate spatial enhancement features; the spatial enhancement features are processed in the frequency domain, and semantic features are obtained based on the processed features; the semantic features are semantically enhanced at multiple scales through a multi-level hybrid gated aggregation sub-module; the guidance module generates the output of the guidance module based on the enhanced semantic features and haze-related features; the output of the previous level guidance module of the first guidance module is set as the dark channel prior information, and the output of the fifth guidance module is set to empty.
[0060] An embodiment of the present invention further provides an electronic device, including:
[0061] A processor, which is used to execute multiple instructions;
[0062] A memory for storing a plurality of instructions;
[0063] The plurality of instructions are used to be stored by the memory and loaded and executed by the processor to implement the method as described above.
[0064] An embodiment of the present invention further provides a computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the method described above.
[0065] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0066] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, which may be electrical, mechanical or other forms.
[0067] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0068] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional units.
[0069] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a physical server, or a network cloud server, etc., and requires the Ubuntu operating system to be installed) to perform some of the steps of the method described in various embodiments of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.
[0070] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Any simple modifications, equivalent changes and modifications made to the above embodiment based on the technical essence of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. An image enhancement method based on dark channel guidance, characterized in that: Methods include: Step S1: Obtain an image to be processed, and perform a convolution operation on the image to be processed to obtain shallow features and dark channel prior information respectively; Step S2: Input shallow features and dark channel prior information into the defogging branch and prior correction guidance branch of the trained defogging network model respectively; the defogging branch generates a residual image corresponding to the image to be processed, and the residual image is superimposed with the image to be processed as the defogged image; The defogging branch uses the Unet architecture, which includes three defogging modules. The encoder of the first defogging module receives shallow features. The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module are connected in sequence, and the encoder and decoder of the same defogging module are skipped. The prior correction guidance branch uses the Unet architecture, which includes five sequentially connected guidance modules. The first guidance module, the second guidance module, the third guidance module, the fourth guidance module, and the fifth guidance module interact bidirectionally with the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module, respectively. The guidance module fuses the output of the previous level guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the encoder or decoder or defogging module corresponding to the guidance module is recorded as the corresponding module, and the corresponding module generates a spatial attention map based on the haze-related features, and uses the spatial attention map to process the input of the corresponding module in the defogging branch to generate spatial enhancement features; the spatial enhancement features are processed in the frequency domain, and semantic features are obtained based on the processed features; the semantic features are semantically enhanced at multiple scales through a multi-level hybrid gated aggregation sub-module; the guidance module generates the output of the guidance module based on the enhanced semantic features and haze-related features; the output of the previous level guidance module of the first guidance module is set as the dark channel prior information, and the output of the fifth guidance module is set to empty.
2. The method according to claim 1, wherein The outputs of the first and second guiding modules are downsampled when input to the next module; the outputs of the third and fourth guiding modules are upsampled when input to the next module; The guidance module fuses the output of the previous guidance module and the dark channel prior information to generate the haze-related features of the guidance module; The guidance module generates an output of the guidance module based on the semantic features generated by its corresponding corresponding module and the haze-related features generated by the guidance module.
3. The method according to claim 1, wherein The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module all include multiple stacked feature enhancement submodules. The encoder of the first defogging module and the decoder of the first defogging module have the same number of channels and include the same number of feature enhancement submodules. The encoder of the second defogging module has the same number of channels as the decoder of the second defogging module, and the number of feature enhancement sub-modules included is the same; the number of channels of the encoder of the first defogging module, the encoder of the second defogging module, and the third defogging module increases successively, and the resolution decreases successively; the encoder of the first defogging module, the encoder of the second defogging module, and the number of feature enhancement sub-modules in the third defogging module increase successively.
4. The method according to claim 2, wherein The feature enhancement submodule includes the haze perception frequency selection submodule and the multi-level hybrid gated aggregation submodule; The haze perception frequency selection submodule obtains haze-related features of the corresponding guidance module based on the encoder or decoder to which it belongs, generates a spatial attention map based on the haze-related features, and performs a dot product between the spatial attention map and the input of the encoder or decoder to which the feature enhancement submodule belongs in the dehazing branch to generate enhanced features; Based on fast Fourier transform, the enhanced features are processed in the frequency domain, and semantic features are obtained based on the processed features; The multi-level hybrid gated aggregation submodule uses multiple convolution kernels of different scales to perform multi-scale reconstruction on the processed features, generates a gating signal from the reconstructed low-order features, and controls the extraction of reconstructed high-order features based on the gating signal; the extracted high-order features are input into the corresponding guidance module, and the guidance module fuses the high-order features and the guidance features of the guidance module to generate the output of the guidance module.
5. The method according to claim 3, wherein The outputs of the encoder of the first defogging module and the encoder of the second defogging module are downsampled by strided convolution when input to the next module; the outputs of the decoder of the third defogging module and the second defogging module are upsampled by pointwise convolution and pixel shuffling operations when input to the next module.
6. An image enhancement device based on dark channel guidance, characterized in that: The device includes: Image acquisition module: configured to acquire the image to be processed, and perform convolution operation on the image to be processed to obtain shallow features and dark channel prior information respectively; Dehazing module: configured to input shallow layer features and dark channel prior information into the dehazing branch and prior correction guidance branch of the trained dehazing network model respectively; The defogging branch generates a residual image corresponding to the image to be processed, and superimposes the residual image with the image to be processed as the defogging image; The defogging branch uses the Unet architecture, which includes three defogging modules. The encoder of the first defogging module receives shallow features. The encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module are connected in sequence, and the encoder and decoder of the same defogging module are skipped. The prior correction guidance branch uses the Unet architecture, which includes five sequentially connected guidance modules. The first guidance module, the second guidance module, the third guidance module, the fourth guidance module, and the fifth guidance module interact bidirectionally with the encoder of the first defogging module, the encoder of the second defogging module, the third defogging module, the decoder of the second defogging module, and the decoder of the first defogging module, respectively. The guidance module fuses the output of the previous level guidance module and the dark channel prior information to generate the haze-related features of the guidance module; the encoder or decoder or defogging module corresponding to the guidance module is recorded as the corresponding module, and the corresponding module generates a spatial attention map based on the haze-related features, and uses the spatial attention map to process the input of the corresponding module in the defogging branch to generate spatial enhancement features; the spatial enhancement features are processed in the frequency domain, and semantic features are obtained based on the processed features; the semantic features are semantically enhanced at multiple scales through a multi-level hybrid gated aggregation sub-module; the guidance module generates the output of the guidance module based on the enhanced semantic features and haze-related features; the output of the previous level guidance module of the first guidance module is set as the dark channel prior information, and the output of the fifth guidance module is set to empty.
7. An electronic device comprising: A processor, which is used to execute multiple instructions; A memory for storing a plurality of instructions; The plurality of instructions are used to be stored in the memory and loaded and executed by the processor according to any one of claims 1 to 5.
8. A computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the method according to any one of claims 1 to 5.