Image defogging enhancement method and system for complex night scene
Patent Information
- Application Number
- CN202611321992.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]现有夜间图像去雾方法在对上述复杂退化进行处理时,通常根据图像亮度、颜色、对比度或者深层图像特征判断雾退化程度,当人工光源辉光与雾霾退化同时存在时,辉光区域容易被作为高浓度雾区域参与去雾处理,使针对雾退化进行的特征抑制或增强作用同时施加于人工光源周围区域,进而容易造成光源附近区域过度处理,并伴随局部亮度异常、颜色偏移或者细节损失等现象
1.本发明通过提取颜色衰减先验图和高斯辉光估计图,并利用两类物理先验引导深层图像特征的注意力增强,有利于区分雾退化区域与人工光源辉光区域,减少光源周围区域因误判而产生的过度处理,改善局部亮度异常、颜色偏移及细节损失。
Smart Images

Figure CN122887728A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep learning and computer vision technology, specifically to an image dehazing and enhancement method and system for complex nighttime scenes. Background Technology
[0002] With the development of computer vision technology, image dehazing has been widely applied in fields such as intelligent monitoring, autonomous driving, and drone visual perception. In hazy weather, suspended particles in the atmosphere absorb and scatter light, causing reduced contrast, color distortion, and blurred texture details in the image, thus affecting the subsequent extraction and utilization of visual information.
[0003] Compared to daytime scenes, the degradation process of foggy images at night is more complex. Nighttime environments typically contain streetlights, vehicle headlights, architectural lighting, and other artificial light sources. These different light sources have varying brightness and spatial distributions. As light propagates through foggy atmospheres, it undergoes significant scattering and diffusion, creating glow areas of a certain spatial extent around the light sources. Simultaneously, the fog itself causes localized increases in image brightness, decreases in contrast, and loss of detail, making areas with high fog density and glow areas produced by artificial light sources appear somewhat similar in image representation.
[0004] Existing nighttime image dehazing methods typically determine the degree of fog degradation based on image brightness, color, contrast, or deep image features when processing the aforementioned complex degradation. When artificial light source glow and fog degradation coexist, the glow area is easily treated as a high-concentration fog area and participates in the dehazing process. This causes the feature suppression or enhancement effects aimed at fog degradation to be applied simultaneously to the area around the artificial light source, which can easily lead to over-processing of the area near the light source, accompanied by phenomena such as local brightness anomalies, color shifts, or loss of detail.
[0005] Therefore, this invention proposes an image dehazing and enhancement method and system for complex nighttime scenes. Summary of the Invention
[0006] The purpose of this invention is to provide an image dehazing and enhancement method and system for complex nighttime scenes, so as to solve the problems mentioned in the background art.
[0007] According to a first aspect of the present invention, in order to achieve the above-mentioned objective, the present invention provides the following technical solution: an image dehazing enhancement method for complex nighttime scenes, comprising the following steps: Acquire a foggy nighttime image, perform stepwise downsampling encoding on the foggy nighttime image to obtain first-scale encoding features and second-scale encoding features, and retain the first jump feature and the second jump feature respectively in the corresponding downsampling encoding process; Local feature extraction, frequency domain global modeling, and local-global gated modulation are performed on the second-scale encoded features to obtain deep image features; Based on the nighttime foggy image, a color attenuation prior map and a Gaussian glow estimation map are extracted. The color attenuation prior map and the Gaussian glow estimation map are concatenated along the channel dimension to obtain a dual-channel physical prior map. The dual-channel physical prior map is then mapped through a multilayer perceptron to obtain a query vector. Linear mapping is performed on the deep image features to obtain key vectors and value vectors. Multi-head attention is performed using the query vector as the query and the key vector and value vector as the key and value, respectively. The multi-head attention calculation result is convolved and projected, and then added to the deep image features by residual calculation to obtain the prior guided enhancement feature. The prior guided enhancement features and the second jump features are concatenated along the channel dimension to obtain the deep fusion features. Then, the deep fusion features are transposed and upsampled to obtain the dehazed image.
[0008] Furthermore, the nighttime foggy image is downsampled and encoded step by step to obtain first-scale encoded features and second-scale encoded features. The first jump feature and the second jump feature are retained respectively during the corresponding downsampling and encoding process, as detailed below: The foggy nighttime image is subjected to convolution processing to obtain initial image features; The initial image features are divided into spatial domain features to be processed and frequency domain features to be processed along the channel dimension. Local detail extraction is performed on the spatial domain features to be processed and spectral feature extraction is performed on the frequency domain features to be processed. The spatial domain features obtained from the local detail extraction and the frequency domain features obtained from the spectral feature extraction are concatenated along the channel dimension and channel compression is performed. The channel compressed features are added to the initial image features by residual addition to obtain the first scale encoded features. The first-scale encoded features are downsampled, and the same spatial and frequency domain parallel processing method as the first-scale encoded features is used to extract features from the downsampled features to obtain the second-scale encoded features. The intermediate features in the corresponding downsampling encoding process are retained as the first jump feature and the second jump feature, respectively.
[0009] Furthermore, spectral feature extraction is performed on the features to be processed in the frequency domain, as follows: A two-dimensional discrete Fourier transform is performed on the frequency domain feature to be processed, mapping the frequency domain feature to the frequency domain to obtain a complex-valued spectrum, and the amplitude spectrum and phase spectrum are determined according to the real part and imaginary part of the complex-valued spectrum, respectively. Convolution mapping, nonlinear activation and channel weighting are performed on the amplitude spectrum and the phase spectrum respectively. The residual amplitude spectrum is obtained by adding the residual amplitude spectrum with the amplitude spectrum before processing. The residual phase spectrum is obtained by adding the residual phase spectrum with the phase spectrum before processing. The complex-valued spectrum is reconstructed based on the residual amplitude spectrum and the residual phase spectrum, and the reconstructed complex-valued spectrum is subjected to a two-dimensional inverse discrete Fourier transform to obtain the frequency domain features.
[0010] Furthermore, channel weighting is applied to the amplitude spectrum and phase spectrum, as follows: Global average pooling along the channel dimension is performed on the intermediate features corresponding to the amplitude spectrum and the intermediate features corresponding to the phase spectrum, respectively. The pooling results are then mapped through two fully connected layers and an activation function to obtain the channel weights corresponding to each channel. The frequency components of different channels in the amplitude spectrum and the phase spectrum are weighted according to the channel weights. The amplitude spectrum and the phase spectrum are respectively processed by a first 1×1 convolution, a LeakyReLU activation function, channel weighting, and a second 1×1 convolution.
[0011] Furthermore, local detail extraction is performed on the spatial features to be processed, as follows: The spatial features to be processed are convolutionally processed using standard convolution, central difference convolution, angular difference convolution, horizontal difference convolution, and vertical difference convolution, respectively. The convolution kernels corresponding to each convolution process are merged to obtain the transform convolution kernel used for local detail extraction; The spatial features to be processed are convolved using the transformed convolution kernel. The convolution result is then processed by a linear rectified activation function and added to the spatial features to be processed for the first time using residuals. The features after the first residual addition are then convolved by 3×3 and added to the spatial features to be processed again using residuals to obtain the spatial features.
[0012] Furthermore, local feature extraction, frequency domain global modeling, and local-global gated modulation are performed on the second-scale encoded features to obtain deep image features, as detailed below: The second-scale encoded features are subjected to local detail convolution and nonlinear activation processing, and the processed features are added to the second-scale encoded features by residual addition to obtain local features; The local features are channel-mapped and divided into first branch features and second branch features along the channel dimension. The first branch features are processed by 3×3 depth convolution, and the second branch features are processed by 5×5 depth convolution. The features processed by the two branches are then concatenated along the channel dimension to obtain multi-scale local features. The multi-scale local features are subjected to a two-dimensional Fourier transform to obtain frequency domain features. The frequency domain features are then subjected to pointwise convolution, batch normalization, and nonlinear activation processing, and a two-dimensional inverse Fourier transform is performed to obtain global frequency domain features. The global frequency domain features and the multi-scale local features are added together by residual summation, and the features after residual summation are convolved point by point to obtain the global modeling features. The local features and the global modeling features are concatenated along the channel dimension to obtain the local-global fused features; The local-global fusion features are subjected to grouped convolution processing, and the grouped convolution processing results are mapped by the Sigmoid activation function to obtain pixel-wise gated weights; The pixel-by-pixel gate weights are multiplied element-by-element by the local-global fusion features to obtain the gated modulation features; The gated modulation features are convolved and thinned, and the thinned features are added to the second scale coding features by residual addition to obtain the deep image features.
[0013] Furthermore, the extraction of the color attenuation prior map is as follows: The brightness and saturation components of each pixel are determined based on the red, green, and blue channel values corresponding to each pixel in the nighttime foggy image. The brightness component and the saturation component are input into a linear regression model for weighted calculation to obtain the fog density depth value corresponding to each pixel. The fog density depth value is restricted to a range of 0 to 1, and the color attenuation prior map is constructed based on the fog density depth value corresponding to each pixel.
[0014] Furthermore, the extraction of the Gaussian glow estimation map is as follows: Based on the red, green, and blue channel values of each pixel in the nighttime foggy image, a weighted calculation is performed according to preset corresponding weights to obtain a perceived brightness map; The perceived brightness map is subjected to Gaussian blurring using a preset Gaussian kernel, and the brightness residual between the Gaussian blurring result and the perceived brightness map is calculated. The negative values in the brightness residual are truncated to zero, and the truncated brightness residual is normalized according to the maximum brightness residual corresponding to the night foggy image to obtain the Gaussian glow estimation map.
[0015] Furthermore, the dual-channel physical prior map is mapped to the query vector via a multilayer perceptron, as follows: The dual-channel physical prior map is obtained by concatenating the color attenuation prior map and the Gaussian glow estimation map along the channel dimension. The query vector is obtained by sequentially applying two 1×1 convolution layers to the dual-channel physical prior graph.
[0016] Furthermore, the multi-head attention calculation is specifically as follows: Calculate the scaled dot product between the query vector and each key vector, perform Softmax normalization on the scaled dot product to obtain the corresponding attention weights, and perform weighted aggregation on the corresponding value vectors according to the attention weights to obtain the output features corresponding to each attention head. The output features corresponding to each attention point are merged, and the merged features are projected by a 1×1 convolution and added to the residual of the deep image features to obtain the prior guided enhancement features.
[0017] Furthermore, the prior guided enhancement features are upsampled step by step, and the second jump feature and the first jump feature are fused at the corresponding scales to obtain the dehazed image, as follows: The prior guided enhancement feature and the second jump feature are concatenated along the channel dimension to obtain the deep fusion feature; The deep fusion features are transposed and upsampled to obtain the second-scale decoding features. Spatial and frequency domain features are extracted in parallel from the second-scale decoding features. The extracted spatial and frequency domain features are then fused to obtain the second-scale refined features. The second-scale refined feature is concatenated with the first jump feature along the channel dimension to obtain the middle-layer fused feature; The mid-layer fusion features are transposed and upsampled to obtain the first-scale decoding features. Spatial and frequency domain features are extracted in parallel from the first-scale decoding features, and the extracted spatial and frequency domain features are fused to obtain the first-scale refined features. The first-scale refinement features are subjected to 3×3 convolution mapping to obtain the three-channel dehazed image.
[0018] According to a second aspect of the present invention, the present invention provides an image dehazing enhancement system for complex night scenes, used to implement the image dehazing enhancement method for complex night scenes described in the first aspect, comprising: The image encoding module is used to acquire a foggy nighttime image, perform step-by-step downsampling encoding on the foggy nighttime image to obtain a first-scale encoding feature and a second-scale encoding feature, and retain the first jump feature and the second jump feature respectively in the corresponding downsampling encoding process. The deep feature generation module is used to obtain the second-scale encoded features, and to perform local feature extraction, frequency domain global modeling and local-global gated modulation on the second-scale encoded features to obtain deep image features. The physical prior processing module is used to extract a color attenuation prior map and a Gaussian glow estimation map based on the night foggy image, concatenate the color attenuation prior map and the Gaussian glow estimation map along the channel dimension to obtain a dual-channel physical prior map, and map the dual-channel physical prior map through a multilayer perceptron to obtain a query vector. The prior-guided enhancement feature generation module is used to obtain the deep image features and the query vector, perform linear mapping on the deep image features to obtain key vectors and value vectors, perform multi-head attention calculation using the query vector as the query and the key vector and value vector as the key and value respectively, and add the multi-head attention calculation result to the deep image features after convolutional projection to obtain the prior-guided enhancement features; The image reconstruction and output module is used to concatenate the prior guided enhancement features and the second jump features along the channel dimension to obtain deep fusion features, and then perform transposed convolution upsampling on the deep fusion features to obtain a dehazed image.
[0019] This invention has at least the following beneficial effects: 1. This invention extracts color attenuation prior maps and Gaussian glow estimation maps, and uses two types of physical priors to guide attention enhancement of deep image features. This helps to distinguish between fogged degraded areas and artificial light source glow areas, reduces overprocessing caused by misjudgment in areas around the light source, and improves local brightness anomalies, color shifts, and detail loss.
[0020] 2. This invention improves the adaptability to non-uniform haze and glow degradation at night by extracting local features, performing frequency domain global modeling and local-global gated modulation, taking into account the relationship between local texture information and global features, and performing selective feature modulation according to different spatial locations.
[0021] 3. This invention enhances edge and texture information in the spatial domain through coordinated processing of the spatial and frequency domains, and performs feature adjustment on the amplitude spectrum and phase spectrum in the frequency domain, which is beneficial to improving the characterization ability of complex degradation information such as haze, glow, noise and texture weakening.
[0022] 4. This invention combines deep recovery information with mid-to-shallow spatial structure and texture information by progressively upsampling and fusing jump features at corresponding scales. This helps to maintain image details and scene structure while reducing haze and glow interference, thereby improving the clarity, color naturalness and visual consistency of dehazed images.
[0023] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the three-level encoder-decoder network in this invention; Figure 2 A schematic diagram of the structure for parallel processing of spatial local detail extraction and frequency domain amplitude-phase decoupling; Figure 3 A schematic diagram of the structure for local feature extraction, frequency domain global modeling, and local-global gated modulation; Figure 4 A schematic diagram of a deep image feature enhancement structure guided by dual physical priors; Figure 5 Visual comparison images of dehazed images from the NHM dataset; Figure 6 Visual comparison images of dehazed images from the NHR dataset. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0027] Example 1: This embodiment provides an image dehazing enhancement method for complex nighttime scenes. The processing object is a foggy nighttime image. In the nighttime imaging environment, there may be fog scattering, artificial light glow, local brightness unevenness, texture weakening, and noise interference at the same time. In the processing, the foggy nighttime image is first downsampled and encoded step by step to obtain first-scale encoded features and second-scale encoded features. The first and second jump features are retained in the corresponding downsampling and encoding process. After obtaining the second-scale encoded features, local feature extraction, frequency domain global modeling, and local-global gated modulation are performed to form deep image features. At the same time, a color attenuation prior map and a Gaussian glow estimation map are formed based on the original foggy nighttime image. A query vector is further formed to guide the deep image feature processing. Then, multi-head attention is calculated using the query vector and the key vector and value vector formed according to the deep image features to obtain the prior guided enhancement features. Finally, the prior guided enhancement features are upsampled step by step, and the first and second jump features are fused at the corresponding scale to obtain the dehazed image. This forms a continuous data processing process from inputting a foggy nighttime image, step-by-step encoding, deep feature generation, physical prior guidance to image reconstruction output. Combination Figure 1 This embodiment employs a three-level encoder-decoder structure (U-Net) for image feature processing. It is divided into a first feature processing level, a second feature processing level, and a third feature processing level according to the progressively changing spatial resolution. In a specific parameter setting, the feature spaces corresponding to the three feature processing levels are respectively represented as follows: Among them, the number of basic channels Set to 32, so that the number of channels corresponding to the three feature processing levels are 32, 64 and 128 respectively. The first feature processing level and the second feature processing level are used to perform coded feature extraction from shallow to deep, and the third feature processing level is used to perform deep image feature processing. The first jump feature and the second jump feature are formed in the encoding process corresponding to the first feature processing level and the second feature processing level respectively, which are used for subsequent decoding and reconstruction at the corresponding scale. Before testing, the foggy nighttime images to be processed need to be preprocessed. For each image pair, the following steps are performed in sequence: (a) Paired random cropping: randomly crop 256×256 image blocks from the same position in the image pair as network input to ensure that the foggy image and the clear image are aligned at the pixel level. If the short side of the source image is less than 256 pixels, it is first enlarged proportionally until the short side is not less than 256 pixels before cropping; (b) Paired random horizontal flipping: the foggy block and the clear block are flipped synchronously with a probability of 0.5; (c) Normalization: the image pair is converted into a tensor and linearly normalized to the [0,1] interval. During testing and inference, the foggy nighttime image to be processed is preprocessed, converted into an image tensor, and the pixel values are linearly normalized to the range of 0 to 1. No random cropping is performed on the input image. When the height or width of the input image is not divisible by 4, reflection padding is used to pad the corresponding height and width to an integer multiple of 4, so that the input image can undergo continuous scale transformation. After obtaining the network output, the output image is cropped to restore the original spatial size corresponding to the input foggy nighttime image, and the output pixel values are restricted to the range of 0 to 1. At the start of the progressive downsampling encoding, the initial feature mapping of the foggy nighttime image is first performed using a 3×3 convolution to obtain the initial image features. In one implementation where the basic number of channels is set to 32, the number of channels of the initial image features is set to 32. The initial image features continue to be used as the input of the first-scale encoding process. The first-scale encoding process divides the initial image features into spatial domain features to be processed and frequency domain features to be processed along the channel dimension. Local detail extraction is performed on the spatial domain features to be processed, and spectral feature extraction is performed on the frequency domain features to be processed. Then, the features formed by the two processing paths are fused. Specifically, the local detail extraction of the spatial features to be processed employs five convolutional methods: standard convolution, central difference convolution, angular difference convolution, horizontal difference convolution, and vertical difference convolution. These five convolutional methods are applied to the input features in parallel and merged through the transformation relationship of the convolution kernels. The relationship between the input features and the output features is calculated according to formula (1): (1) in, Indicates input features, Indicates output features, Indicates the first The convolution kernels corresponding to each parallel branch This represents the convolution operation. This represents the transformed convolution kernel formed by merging the convolution kernels of each parallel branch. By transforming and merging the convolution kernels corresponding to multiple parallel convolution branches, the results of local detail extraction can participate in subsequent convolution calculations using the merged transformed convolution kernel. After performing local detail convolution using the transformed convolution kernel, the convolution result is input into the linear rectified activation function for nonlinear processing. The activation result is then fused with the input features before entering the spatial processing path using residual fusion. Finally, a 3×3 standard convolution is used for feature refinement. The output corresponding to the spatial path is calculated according to formula (2): (2) in, Indicates the spatial path output characteristics, Represents the linear rectified activation function. This indicates a standard convolutional layer with a kernel size of 3×3. This process preserves the basic spatial information of the input features and uses the local change information obtained by differential convolution to supplement edge and texture responses. The principle is to use the prior information in differential convolution to supplement the original image information, enhance spatial feature extraction, and effectively handle global blur, local glow and texture loss in nighttime degraded images. Spectral feature extraction of the features to be processed in the frequency domain first performs a two-dimensional discrete Fourier transform (2D-DFT) to map the spatial domain features to the frequency domain. For the input features, the first... Each channel corresponds to a two-dimensional discrete Fourier transform, which is calculated according to formula (3): (3) in, This represents the feature map entering the frequency domain processing path, where C×H×W represent the number of channels, height, and width, respectively. This represents the characteristic data of the corresponding channel. This represents the height and width of the feature map. The corresponding horizontal and vertical frequency positions after the two-dimensional discrete Fourier transform; The real and imaginary parts of the complex-valued spectrum obtained by the two-dimensional discrete Fourier transform are extracted respectively, and the amplitude spectrum and phase spectrum are further determined based on the real and imaginary parts. The single-channel amplitude spectrum is used to characterize the intensity of the corresponding frequency component. The amplitude spectrum is calculated according to formula (4): (4) in, Represents the real part of the complex-valued spectrum. Represents the imaginary part of the complex-valued spectrum; A single-channel phase spectrum is used to characterize the phase information of the corresponding frequency component. The phase spectrum is calculated according to formula (5): (5) By performing the calculations corresponding to formulas (3), (4), and (5) on each channel of the input features respectively, the full-channel amplitude spectrum is obtained. and full-channel phase spectrum This allows the frequency intensity information and phase information in the features to be processed in the frequency domain to be formed into mutually independent objects for subsequent processing. After obtaining the amplitude spectrum and phase spectrum, corresponding spectrum processing paths are constructed respectively. Both spectrum processing paths sequentially execute the first 1×1 convolution, LeakyReLU activation, channel weighting, and the second 1×1 convolution. Among them, the channel weighting adopts the SE channel attention layer. In this process, the corresponding intermediate features are first subjected to global average pooling, and then the channel weights corresponding to each channel are generated using two fully connected layers and corresponding activation functions. The amplitude spectrum and phase spectrum of different channels are aggregated by pointwise convolution. The channel attention mechanism SE layer realizes dynamic weight adjustment in the channel dimension. SELayer is shown in formula (6): (6) in, and This represents the weight matrix corresponding to the two fully connected layers. This represents the Sigmoid activation function. Represents the ReLU activation function. This represents the weighted operation of the corresponding elements, thereby forming the corresponding channel weights based on the channel responses of the input spectral features themselves; In one specific parameter setting, the negative half-axis parameter of the LeakyReLU activation function is set to 0.1, and the spectral processing operator corresponding to the amplitude spectrum is calculated according to formula (7): (7) The spectral processing operator corresponding to the phase spectrum is calculated according to formula (8): (8) in, This represents a 1×1 convolutional layer. This represents the LeakyReLU activation function with a negative half-axis parameter of 0.1. The magnitude spectrum and phase spectrum undergo convolution mapping, nonlinear processing, and channel weight adjustment in independent processing paths, respectively. After completing the amplitude spectrum processing, the amplitude spectrum processing result is added to the amplitude spectrum before processing to obtain the residual amplitude spectrum. The residual amplitude spectrum is calculated according to formula (9): (9) After completing the phase spectrum processing, the phase spectrum processing result is added to the phase spectrum before processing to obtain the residual phase spectrum. The residual phase spectrum is calculated according to formula (10): (10) The complex-valued spectrum is reconstructed based on the residual amplitude spectrum and residual phase spectrum, and the residual amplitude spectrum and residual phase spectrum are converted into complex rectangular coordinates. The real part is calculated according to formula (11): (11) The corresponding imaginary part is calculated according to formula (12): (12) This yields a complex spectrum that simultaneously contains processed amplitude and phase information. The frequency domain processing result is then remapped to the spatial domain using a two-dimensional inverse discrete Fourier transform. The frequency domain path output features are calculated according to formula (13): (13) in, Represents the two-dimensional inverse discrete Fourier transform. This represents the frequency domain features obtained by mapping back to the spatial domain after completing amplitude spectrum processing, phase spectrum processing, and complex-valued spectrum reconstruction. After obtaining the spatial and frequency domain features, the output features of the spatial and frequency domain paths are concatenated along the channel dimension. A 1×1 convolution is used to compress the concatenated features to the number of channels corresponding to the current feature processing structure. The channel compression result is then added to the input features of the current feature processing structure using global residuals to obtain the output features at the current scale. The spatial and frequency domain fusion relationship is calculated according to formula (14): (14) in, This represents the original input features of the current parallel spatial and frequency domain processing structure. This represents the output characteristics after spatial and frequency domain fusion. This represents a 1×1 convolution process used to recover the number of channels and fuse features. This indicates a splicing operation performed along the channel dimension. Indicates the spatial path output characteristics, Indicates the frequency domain path output characteristics; In the first scale encoding process, the initial image features are used as the input features in formula (14). The first scale encoding features are obtained through the aforementioned spatial and frequency paths. After obtaining the first scale encoding features, a 3×3 convolution with a stride of 2 is used followed by ReLU activation to complete downsampling. The downsampling result is used as the input of the second scale encoding process. The same spatial and frequency parallel processing logic is used to continue to extract the spatial and frequency features of the corresponding scale. Then, according to formula (14), channel splicing, channel compression and residual fusion are performed to obtain the second scale encoding features. In the stepwise downsampling encoding process, the intermediate features of the corresponding level are retained as the first jump feature and the second jump feature. The first jump feature is associated with the first scale image reconstruction process, and the second jump feature is associated with the second scale image reconstruction process. The two jump features do not participate in the generation of the subsequent color attenuation prior map and Gaussian glow estimation map, but participate again in the feature fusion of the corresponding scale in the stepwise upsampling process, so that the spatial structure and texture information retained in the encoding stage can be transferred to the image reconstruction stage. In a specific tensor processing state, when the batch size is set to 16, the number of channels at the first scale is set to 32, and the input image block size is set to 256×256, the tensor size corresponding to the first scale input features is 16×32×256×256. The output of the spatial path remains 16×32×256×256. The complex spectrum and corresponding amplitude spectrum, phase spectrum, residual amplitude spectrum, and residual phase spectrum formed after the frequency path performs a two-dimensional discrete Fourier transform have a size of 16×32×256×129. After a two-dimensional inverse discrete Fourier transform, it is restored to 16×32×256×256. The spatial and frequency features are concatenated along the channel dimension to form a concatenated feature of 16×64×256×256. After 1×1 convolution compression, it is restored to 16×32×256×256. The first scale encoded features are obtained through residual fusion. This parameter state is used to explain the size transfer relationship between intermediate data in each processing step during the first scale encoding process. Through the above-described step-by-step downsampling encoding process, the foggy nighttime image is first converted into initial image features through convolutional mapping. Then, the first scale encoding features are formed through spatial local detail extraction and frequency domain amplitude-phase decoupling. The first scale encoding features are further converted into second scale encoding features after downsampling. In the corresponding encoding process, first jump features and second jump features are formed. The second scale encoding features are used as inputs for subsequent local feature extraction, frequency domain global modeling, and local-global gated modulation. The first jump features and second jump features are retained for use in the subsequent step-by-step upsampling and corresponding scale feature fusion processes. After obtaining the second-scale encoded features, the second-scale encoded features are used as input to the deep image feature generation process. Local feature extraction, frequency domain global modeling, and local-global gated modulation are performed sequentially. Local feature extraction is used to preserve local texture, edge, and spatial difference information in the second-scale encoded features. Frequency domain global modeling is used to establish global feature connections across spatial locations based on local features. Local-global gated modulation forms a pixel-by-pixel gated response based on local information and feature information after frequency domain global modeling, so that different spatial locations participate in deep feature expression according to corresponding gate weights. Finally, deep image features are obtained for subsequent physical prior guidance processing. Combination Figure 3In one specific implementation, a set of feature processing structures that continuously perform local feature extraction, frequency domain global modeling, and local-global gated modulation is regarded as a deep feature processing process. The deep feature processing process first performs local detail convolution processing on the input features, performs nonlinear mapping on the result of local detail convolution processing through the ReLU activation function, and then adds the element-wise residuals of the activated features to the input features before entering the current deep feature processing process to obtain local features. At the same time, the local features retain the original information of the input features and the local change information formed after local detail enhancement, and serve as the input for subsequent multi-scale local feature extraction and frequency domain global modeling. In one specific implementation, the local detail convolution processing follows the local detail processing method formed by the aforementioned standard convolution, central difference convolution, corner difference convolution, horizontal difference convolution and vertical difference convolution. Each convolution response completes local feature extraction by transforming the convolution kernel. Then, the ReLU activation function is used to perform nonlinear mapping on the convolution processing result, and the residual is added with the input of the current deep feature processing process to form local features. Since the convolution kernel transformation and local response calculation relationship corresponding to the local detail convolution have been defined by formula (1), the same convolution kernel transformation relationship is executed in the deep feature processing process, and no new calculation formula is re-established. After obtaining local features, channel mapping is performed on the local features. In one specific implementation, firstly, using... Pointwise convolution performs channel transformation on local features, mapping the number of feature channels to twice the number before channel transformation. After GELU activation, the features are evenly divided along the channel dimension, thus forming the first branch feature and the second branch feature. The first branch feature and the second branch feature originate from the same local feature and enter local feature extraction paths with different convolution kernel sizes respectively. The first branch road adopts Depthwise convolution is used for spatial feature extraction, followed by GELU activation. The second branch uses... Depthwise convolution is used for spatial feature extraction, and GELU activation is performed after the depthwise convolution. and The corresponding local responses are extracted from two different spatial perception ranges, and the processing results of the first and second branches are then spliced along the channel dimension to obtain multi-scale local features. The generation relationship of multi-scale local features in the raw material is expressed by formula (15): (15) In the formula, This represents spatial features formed by convolutional paths of different scales and spliced together via channels. This indicates multi-scale depthwise convolution processing. This indicates pointwise convolution processing. This indicates splitting along the channel dimension. This indicates splicing along the channel dimension. This indicates GELU activation processing, and the data processing result corresponding to formula (15) is used as the input for subsequent frequency domain global modeling; In this embodiment, the multi-scale convolution processing in formula (15) specifically corresponds to the first branch. Depth convolution and second branch Deep convolution: local features are divided into two paths after pointwise convolution and channel mapping. Each path is processed by deep convolution and GELU activation at the corresponding scale. The outputs of the two paths are then concatenated to obtain multi-scale local features that simultaneously form spatial responses under different local receptive ranges. After obtaining multi-scale local features, frequency domain global modeling is performed on these features. Frequency domain global modeling first maps the multi-scale local features in the spatial domain to the frequency domain. In one specific implementation, the multi-scale local features undergo [further processing] before entering the frequency domain. Convolution and GELU activation are used for initial mapping, and then orthogonal normalized two-dimensional real Fourier transform is performed on the mapped features to convert the information corresponding to different spatial locations to the frequency domain for unified processing. After the two-dimensional Fourier transform is completed, the resulting frequency domain information is processed, and the corresponding features are analyzed in the frequency domain. Pointwise convolution, batch normalization, and ReLU activation are used to adjust the frequency domain features in the channel dimension through pointwise convolution, adjust the frequency domain feature distribution corresponding to the current batch through batch normalization, and complete the nonlinear mapping through ReLU activation. Then, the corresponding frequency domain features are reconstructed based on the processed frequency domain data, and a two-dimensional inverse Fourier transform is performed to remap the frequency domain modulated features back to the spatial domain to obtain the global frequency domain features. The relationship between the multi-scale local features and the global frequency domain features in the raw materials is expressed by formula (16): (16) In the formula, This represents the global frequency domain features formed after multi-scale local features are processed in the Fourier domain and remapped to the spatial domain. This represents the multi-scale local features generated by formula (15). Indicates Fourier transform, Indicates the inverse Fourier transform. This indicates pointwise convolution processing. This indicates batch normalization processing. This indicates that ReLU activation processing, through the above frequency domain processing, enables different spatial locations in multi-scale local features to establish a global response relationship in the frequency domain; The obtained global frequency domain features are added element-wise with the multi-scale local features, so that the global response formed by the frequency domain global modeling is fused with the multi-scale local spatial information retained before the frequency domain transformation. Then, pointwise convolution is used to adjust the channels and further fuse the residual addition results to form global modeling features. The feature fusion relationship in the raw materials is expressed by formula (17): (17) In the formula, Represents multi-scale local features. This represents the global frequency domain feature formed after multi-scale local features are modulated in the frequency domain and mapped back to the spatial domain. This indicates that pointwise convolution is performed on the result of adding the element-wise residuals of the two types of features. The output feature after the fusion of spatial local information and frequency domain global information is represented. In the data chain of the current claim, the output feature formed by formula (17) is used as the global modeling feature. Through the continuous processing of formulas (15) to (17), the local features are first processed in parallel at different convolution scales to form multi-scale local features. Then, the multi-scale local features are mapped to the frequency domain and global feature modulation is performed. After inverse Fourier transform, global frequency domain features are obtained. Then, the global frequency domain features are fused with the residuals of the multi-scale local features to form global modeling features. This enables the subsequent gated modulation to obtain feature information before and after global modeling in the frequency domain at the same time. Further gating modulation is applied to local information and global modeling information. In one specific implementation, the features before global modeling in the frequency domain and the global modeling features obtained by formula (17) are spliced along the channel dimension. Through channel splicing, the feature information used to describe the local spatial state and the feature information after global processing in the frequency domain are retained at the same time. Then, tensor rearrangement is performed on the spliced features so that the data to be gating weight calculation is rearranged according to the dimensional relationship required by the subsequent group convolution. Perform convolution on the features after tensor rearrangement with a kernel size of 1. Grouped convolution, through The spatial neighborhood extracts the spatial response relationship between local information and global modeling information. Then, the grouped convolution output is input into the Sigmoid activation function, and the convolution response at the corresponding spatial position is mapped to pixel-wise gate weights. The pixel-wise gate weights are used to control the response intensity of the features after frequency domain global modeling at different spatial positions, so that the global information does not act on all pixel positions with the same weight, but implements differentiated feature modulation according to the gate response corresponding to the current spatial position. The local-to-global gating modulation relationship in the raw materials is expressed by formula (18): (18) In the formula, This means concatenating the local features of the current deep feature processing process with the global modeling features formed by formula (17). This indicates that the concatenated features are subjected to dimensional rearrangement. Indicates the kernel size as Grouped convolution, This represents the Sigmoid activation function. This represents element-wise multiplication. This represents the output feature formed after pixel-by-pixel gated modulation. Based on the joint response between the current input feature and the global modeling feature, gate weights are generated, and the global modeling feature is spatially correlated and adaptively modulated using the gate weights. According to one implementation path corresponding to formula (18), the input information before frequency domain global modeling and the global modeling features jointly participate in the generation of pixel-by-pixel gating weights. The gating weights then perform element-by-element weighting on the global modeling features to obtain the gating modulation features. After gating modulation is completed, the gating features are used... Standard convolution further refines the gated modulation features, and then the refined features are added to the input features before entering the current deep feature processing process by global residual addition, so as to obtain the output of the current deep feature processing process. This allows the current processing process to retain the basic feature information before entering the processing process while introducing frequency domain global information and gated response. In a specific network configuration, the deep feature generation stage consists of eight consecutive deep feature processing steps. The data output from the previous deep feature processing step is used as the input for the next deep feature processing step. In each processing step, local detail convolution and residual processing, multi-scale local feature extraction, two-dimensional Fourier transform, frequency domain convolution modulation, two-dimensional inverse Fourier transform, spatial and frequency domain feature residual fusion, pixel-by-pixel gated modulation, convolution thinning, and residual output are executed sequentially. Through continuous feature remapping, deep image features for subsequent physical prior guidance processing are gradually formed.
[0028] After the above deep feature generation process, the second-scale encoded features first form local features through local detail processing. The local features are further transformed into multi-scale local features through different convolution scales. The multi-scale local features are transformed into global frequency domain features through two-dimensional Fourier transform, frequency domain convolution modulation, and two-dimensional inverse Fourier transform. Then, the global frequency domain features and the multi-scale local features are fused with residuals to form global modeling features. Based on the feature relationship before and after frequency domain global modeling, a pixel-wise gated response is formed. Deep image features are formed through gated modulation, convolution thinning, and residual processing. The deep image features are thus used as the basis for the generation of subsequent key vectors and value vectors, and feature interaction relationships are established with the physical prior information obtained from the nighttime foggy image in the subsequent processing.
[0029] In the technical solution of this embodiment, after obtaining deep image features, a color attenuation prior map and a Gaussian glow estimation map are extracted simultaneously based on the input nighttime foggy image. The color attenuation prior map is used to characterize the spatial distribution of fog concentration in the nighttime foggy image from the relationship between brightness and saturation, and the Gaussian glow estimation map is used to characterize the spatial distribution of glow based on the brightness diffusion characteristics around the artificial light source. The two types of physical priors correspond to fog degradation and artificial light source glow degradation, respectively. The two types of prior information with different degradation orientations are used together for subsequent query vector generation, so that the deep image feature processing process can obtain physical cue information related to the fog concentration location and glow location. In the process of extracting the color attenuation prior image, the brightness and saturation components of each pixel are determined based on the red, green, and blue channel values corresponding to each pixel in the foggy night image. In one specific implementation, the foggy night image in the red-green-blue color space is converted to the hue-saturation-brightness color space. For any pixel position, the brightness component is determined by the maximum value among the corresponding red, green, and blue channel values, and the saturation component is determined based on the difference between the maximum and minimum values in the three color channels, thus obtaining brightness and saturation information that correspond one-to-one with the spatial position of the foggy night image. After obtaining the lightness and saturation components of each pixel, a priori relationship for haze concentration estimation corresponding to color attenuation is established based on the lightness and saturation components. The lightness and saturation components are weighted and calculated using a linear regression model. The haze concentration depth corresponding to each pixel is calculated according to formula (19): (19) in, , and These represent the weight coefficients in a linear regression model. Indicates pixel position The corresponding lightness component, Indicates pixel position The corresponding saturation component, This represents the fog density depth at the corresponding pixel location, and the calculated fog density depth is restricted to a value range of 0 to 1. The larger the fog density depth value, the higher the fog density at the corresponding spatial location. The color attenuation prior map is constructed from the fog density depth values corresponding to all pixel locations. In the prior processing of color attenuation, the corresponding transmittance can be further determined based on the fog concentration depth. The transmittance is calculated according to formula (20): (20) in, Indicates pixel position The corresponding transmittance, The fog concentration depth calculated by formula (19) is used in this embodiment to use the spatial distribution of fog concentration depth as the corresponding prior information in the color attenuation prior map for subsequent physical prior interaction, so that the fog concentration response corresponding to each spatial location can be used as a component of the subsequent query conditions. In a specific parameter setting method, the spatial size of the color attenuation prior map corresponds to the height and width of the input night fog image, and the fog density depth of each pixel position is represented in a single channel form. That is, the color attenuation prior map has a 1×H×W feature shape. Since the color attenuation prior map is directly derived from the brightness and saturation relationship of each pixel in the input night fog image, this prior provides positional hints corresponding to the non-uniform spatial changes of fog density in subsequent processing. Furthermore, a Gaussian glow estimation map is extracted based on the same nighttime foggy image. The Gaussian glow estimation process first calculates the perceived brightness based on the red channel value, green channel value, and blue channel value of each pixel in the nighttime foggy image. In one specific implementation, the red channel, green channel, and blue channel are weighted according to corresponding weights of 0.299, 0.587, and 0.114, respectively. The perceived brightness map is formed by the perceived brightness value corresponding to each pixel. The high perceived brightness area is used to provide basic brightness information of artificial light sources and their adjacent brightness diffusion areas. After obtaining the perceived brightness map, a Gaussian blurring process is performed on the perceived brightness map using a fixed Gaussian kernel, so that the spatial response of the bright area forms a smooth diffusion result according to the neighborhood range corresponding to the Gaussian kernel. Then, the residual between the brightness after Gaussian blurring and the original perceived brightness is calculated, and the negative values in the residual are truncated to zero. The Gaussian glow residual is calculated according to formula (21): (twenty one) in, Indicates pixel position Gaussian glow response at the location; Indicates the spatial location of pixels in an image; Indicates position The original perceived brightness value at the location; The standard deviation is expressed as Two-dimensional Gaussian kernel; The standard deviation of the Gaussian kernel is represented by the symbol. Represents a two-dimensional convolution operation; Brightness diagram After Gaussian kernel smoothing, at position The brightness value at that location; This indicates a pixel-by-pixel truncation operation, which sets negative values to zero and retains only positive brightness residuals.
[0030] After obtaining the glow response corresponding to each pixel location, the glow response is normalized according to the maximum glow response value in the current night foggy image to form a Gaussian glow estimation map corresponding to the spatial location of the night foggy image. The Gaussian glow estimation map adopts a 1×H×W single-channel feature shape to represent the glow spatial range generated by the smooth diffusion of brightness near the light source, so that the prior and color attenuation prior map provide two different degradation hints: the spatial distribution of artificial light source glow and the spatial distribution of fog concentration. The calculation is performed according to formula (22): (twenty two) in, Indicates pixel position The normalized glow response value; Indicates the spatial location of pixels in an image; Indicates position The original glow response at the location; This represents the maximum original glow response value obtained across all pixel locations in the entire image; This indicates iterating through or taking values at all pixel locations in the image. The glow response can be scaled to a smaller value by normalizing the result with the maximum glow response value as the denominator. Interval.
[0031] Through the above processing, both the color attenuation prior map and the Gaussian glow estimation map are generated from the same foggy nighttime image, but they correspond to different image degradation information. The color attenuation prior map forms the spatial response of fog concentration based on the statistical relationship between brightness and saturation, while the Gaussian glow estimation map forms the spatial response of glow based on the brightness diffusion residual formed after the bright area is blurred by Gaussian. The two prior maps provide different physical descriptions of the fog area and the artificial light source glow area in terms of spatial location, and together serve as the input for the subsequent dual-channel physical prior map. After obtaining the color attenuation prior map and the Gaussian glow estimation map, the two single-channel prior maps are spliced along the channel dimension to form a dual-channel physical prior map. The dual-channel physical prior map is calculated according to formula (23): (twenty three) in, This represents a dual-channel physical prior graph. Represents the pixel position in the color decay prior image. The corresponding fog concentration depth, Indicates the pixel position in the Gaussian glow estimation image. The corresponding glow response, This indicates the splicing process performed along the channel dimension, which combines the two single-channel priors representing fog concentration and glow distribution into the same physical prior feature space through formula (23). After the dual-channel physical prior map is formed, it is input into a multilayer perceptron for channel mapping. In one specific implementation, the multilayer perceptron consists of two consecutive 1×1 convolutions. The two 1×1 convolutions are used to perform feature mapping on the color attenuation prior response and the Gaussian glow estimation response at the same spatial location, generating a query vector for subsequent multi-head attention calculation. The query vector is calculated according to formula (24): (twenty four) in, This represents the query vector generated from the dual-channel physical prior graph. This represents a multilayer perceptron mapping consisting of two 1×1 convolutional layers. The dual-channel physical prior graph formed by formula (23) is represented, thereby enabling the query vector to simultaneously contain fog concentration information corresponding to color attenuation prior and glow distribution information corresponding to Gaussian glow estimation. The dual-channel physical prior map is directly formed from the input nighttime foggy image, while the deep image features come from the aforementioned stepwise downsampling encoding, local feature extraction, frequency domain global modeling, and local-global gated modulation process. Therefore, in the subsequent multi-head attention processing, two independent data input paths are formed. One data path is formed by extracting the nighttime foggy image through color attenuation prior, Gaussian glow estimation, channel stitching, and multilayer perceptron mapping to form a query vector. The other data path is formed by processing the second-scale encoded features through deep feature processing to form deep image features. Linear mapping is performed on the deep image features to form key vectors and value vectors. The query vector, key vector, and value vector constitute the three input objects for multi-head attention computation. The query vector comes from the dual-channel physical prior map, while the key vector and value vector both come from the deep image features. The query vector serves as the query, the key vector serves as the key, and the value vector serves as the value. This allows the two types of physical prior information from the input nighttime foggy image to be aggregated into the deep image features without being directly added to the deep image features through simple channel concatenation. Instead, the deep feature information in the value vector is aggregated by calculating the correlation between the query and the key. In the multi-head attention computation process, the query vector, key vector, and value vector are processed separately by multiple attention heads. Each attention head calculates the scaled dot product between the query vector and the corresponding key vector. Based on the scaled dot product result, the correlation between different query positions and deep image features is determined. Then, the scaled dot product result is normalized using the Softmax function to generate the attention weight corresponding to the current attention head. Based on the attention weight, the corresponding value vector is weighted and aggregated to obtain the output feature of the current attention head. The scaling dot product and weighted aggregation relationship corresponding to multi-head attention are calculated according to formula (25): (25) in, This represents the output obtained by performing attention calculations on the query vector, key vector, and value vector. Represents the query vector. Represents the key vector. Represents a value vector. This represents the transpose of the key vector. This indicates normalization; the denominator corresponds to the scaling factor in the attention calculation. This is a scaling factor used to prevent the inner product result from becoming too large as the feature dimension increases.
[0032] For each attention head, the weighted aggregated features corresponding to the current attention head are obtained according to formula (25). After multiple attention heads have completed their respective calculations, the output features of each attention head are merged so that the feature responses formed by different attention heads constitute the multi-head attention calculation result. Then, the multi-head attention calculation result is output projected using 1×1 convolution so that the channel dimension of the attention output matches the deep image features before entering residual fusion. The multi-head attention calculation result after 1×1 convolution projection is added to the deep image features element-wise by residual addition to obtain the prior guided enhancement feature. The local texture, frequency domain global information and gated modulation information already formed in the deep image features are preserved through residual connection. At the same time, the feature response obtained by the retrieval guided by color attenuation prior and Gaussian glow estimation is added, so that the prior guided enhancement feature becomes the input of the subsequent stepwise upsampling and image reconstruction process. Combination Figure 4 The nighttime foggy image first forms two physical prior processing paths. The color attenuation prior processing path outputs a color attenuation prior map representing the spatial distribution of fog concentration, and the Gaussian glow estimation processing path outputs a Gaussian glow estimation map representing the spatial distribution of artificial light source glow. The two prior maps are concatenated by the channel dimension to form a dual-channel physical prior map, which is then mapped by two layers of 1×1 convolution to form a query vector. The aforementioned deep image features are linearly mapped to form key vectors and value vectors, respectively. The query vector, key vector, and value vector enter the multi-head attention calculation together. After attention aggregation, 1×1 convolution projection, and deep image feature residual fusion, the prior-guided enhancement features are output. Thus, the data processing relationship of the two data paths "nighttime foggy image - dual physical prior - query vector" and "second-scale encoded features - deep image features - key vector and value vector" converges in the multi-head attention stage. Through the aforementioned dual-physical prior guidance process, the color attenuation prior map is not used as an additional channel of the input image to input the deep network, and the Gaussian glow estimation map is not directly added to the deep image features pixel by pixel. Instead, the two are first combined to form a dual-channel physical prior map with different degradation orientations. Then, the dual-channel physical prior map is mapped to a query vector, using the fog concentration position and glow position in the physical prior as query conditions. The correspondence between the query conditions and the deep image features is established through the key vector, and the corresponding feature information is aggregated from the value vector according to the obtained attention weights. This allows the generated prior-guided enhancement features to simultaneously inherit the deep image features and physical prior guidance information, and serve as the input for the subsequent stepwise upsampling reconstruction process.
[0033] After obtaining the prior guided enhancement features, the prior guided enhancement features are used as the starting input for the image reconstruction stage. Combined with the first and second hop features retained in the encoding stage, the spatial resolution of the features is restored by upsampling step by step. The intermediate features retained in the encoding stage are reintroduced at the corresponding spatial scale. This allows the semantic information formed in the deep features after local feature extraction, frequency domain global modeling, local-global gated modulation and dual physical prior guidance to be fused with the middle and shallow texture information and spatial structure information retained in the encoding stage during the decoding process. Finally, a three-channel dehazed image corresponding to the input nighttime foggy image is formed. Combination Figure 1 The image reconstruction process in this embodiment corresponds to the aforementioned three-level feature processing hierarchy. The prior guidance enhancement features generated by the third feature processing hierarchy enter the decoding process. Then, the second-scale and first-scale features are restored sequentially from low spatial resolution to high spatial resolution. Spatial and frequency domain parallel feature processing continues at each decoding hierarchy, so that the spatial information restored during the upsampling process can be further refined by combining local spatial details and frequency information. Then, the intermediate features retained in the encoding stage are supplemented by the jump features corresponding to the encoding process. In one specific implementation, the prior guided enhancement feature and the second jump feature are concatenated along the channel dimension to obtain the deep fusion feature. The channel concatenation does not change the arrangement relationship between the corresponding spatial positions of the features involved in the concatenation. Instead, it combines the prior guided enhancement feature and the second jump feature along the channel dimension so that the deep fusion feature simultaneously contains deep degradation recovery information and the encoding information retained by the second jump feature. The deep fusion feature is then used as the input of the first transposed convolution upsampling process. Transposed convolution upsampling is performed on deep fusion features. In a specific parameter setting, the transposed convolution uses a 3×3 convolution kernel, a stride of 2, and output padding of 1. ReLU activation is performed after the transposed convolution. This process expands the spatial size of the feature map and forms the second-scale decoding features, so that the deep fusion features are gradually restored from the lower spatial resolution to the feature space corresponding to the second scale. After obtaining the second-scale decoding features, the spatial and frequency domain parallel feature extraction is performed on the second-scale decoding features. The spatial processing path processes spatial texture and local change information according to the aforementioned local detail extraction relationship. The frequency processing path extracts frequency information according to the aforementioned two-dimensional discrete Fourier transform, amplitude spectrum and phase spectrum independent processing and two-dimensional inverse discrete Fourier transform relationship. Then, the spatial and frequency domain features formed by the two processing paths are concatenated along the channel dimension, and channel compression and feature fusion are completed by 1×1 convolution. The second-scale refined features are obtained through residual processing. In a specific network configuration, four feature processing units that perform the above-mentioned parallel spatial and frequency domain processing are configured consecutively in the second-scale decoding stage. The output of the previous feature processing unit is used as the input of the next feature processing unit. Through continuous spatial local detail processing, frequency domain amplitude-phase decoupling processing and channel fusion, the second-scale decoding features formed by the first upsampling are gradually refined. The specific calculation relationship of the feature processing unit adopts the spatial and frequency domain processing relationship corresponding to the aforementioned formulas (1) to (14). Therefore, no new repeated formulas are established. After completing the second-scale feature refinement, the second-scale refined features and the first jump features are concatenated along the channel dimension to obtain the mid-level fusion features. The first jump features come from the first-scale downsampling encoding process corresponding to the encoding stage. Through this channel concatenation process, the relatively shallow spatial structure and texture information retained in the first jump features are reintroduced into the decoding process and jointly expressed with the features formed after the second-scale decoding and feature refinement. Transposed convolution upsampling is performed on the mid-layer fusion features. In a specific parameter setting, the second transposed convolution also uses a 3×3 convolution kernel, a stride of 2, and an output padding of 1. ReLU activation is performed after the transposed convolution to further restore the mid-layer fusion features to the spatial resolution corresponding to the first scale, thus obtaining the first-scale decoded features. After obtaining the first-scale decoding features, the spatial and frequency domain parallel feature extraction is performed in the manner corresponding to the first-scale feature processing in the encoding stage. The spatial path forms local detail responses based on standard convolution, center difference convolution, angular difference convolution, horizontal difference convolution, and vertical difference convolution. The frequency path performs two-dimensional discrete Fourier transform on the corresponding features and performs convolution mapping, nonlinear activation, channel weighting, and residual processing on the amplitude spectrum and phase spectrum, respectively. Then, frequency domain features are formed through complex-valued spectrum reconstruction and two-dimensional inverse discrete Fourier transform. The outputs of the spatial and frequency paths are concatenated along the channel dimension and fused by 1×1 convolution to obtain the first-scale refined features. In a specific network configuration, four feature processing units that perform parallel spatial and frequency domain processing are continuously configured in the first-scale decoding stage, so that the spatial texture, edge structure and frequency information in the night foggy image are gradually restored after continuous feature refinement of the first-scale decoding features. The spatial and frequency domain processing relationship corresponding to the first-scale decoding stage continues to adopt the processing rules defined by formulas (1) to (14), so that the encoding process and the decoding process adopt corresponding dual-domain feature processing methods at the corresponding scale. After obtaining the first-scale refinement features, the first-scale refinement features are processed by a 3×3 convolution to perform the final channel mapping, mapping the current feature space to three output channels to form image data corresponding to the red, green and blue channels. The three channels together form the dehazed image. During testing and inference, when the input stage performs reflection filling on the foggy night image, the obtained three-channel network output is cropped to the original height and width corresponding to the input image, and the pixel values are limited to the range of 0 to 1 to obtain the final output dehazed image. Through the above-described step-by-step image reconstruction process, the prior-guided enhancement features first enter the spatial scale recovery process from deep to intermediate layers, and then combine with the second jump features to complete the fusion of deep information and encoded information at the corresponding stage. Next, the second-scale dual-domain features are used to refine the second-scale refinement features, which are then combined with the first jump features to form intermediate-level fusion features. The first-scale spatial resolution is restored through a second upsampling, and further refinement is completed using the first-scale dual-domain features. Finally, a three-channel dehazed image is formed through 3×3 convolution mapping. In this way, the different scale information formed in the aforementioned encoding stage, the local and global information formed in the deep feature processing stage, and the fog density and glow cues information formed in the physical prior-guided stage are finally converged into the image output.
[0034] Example 2: This embodiment mainly describes a training implementation method for obtaining the aforementioned image dehazing processing parameters. It uses a nighttime foggy image and a fog-free reference image corresponding to the spatial location of the nighttime foggy image to form paired training samples. The paired training samples establish a correspondence between the network input and the supervised target. The nighttime foggy image is used as the network input, and the corresponding fog-free reference image is used as the supervised target for image restoration. The three-level encoder-decoder network sequentially performs the aforementioned step-by-step downsampling encoding, local feature extraction, frequency domain global modeling, local-global gated modulation, physical prior extraction, multi-head attention interaction, and step-by-step upsampling reconstruction to obtain the predicted dehazed image. Then, the training loss is determined based on the difference between the predicted dehazed image and the corresponding fog-free reference image, and the network parameters are updated in reverse based on the training loss. This embodiment conducted experiments on publicly available nighttime defogging datasets. The embodiment used three publicly available synthetic nighttime fog datasets: NHR (8970 images, 8073 for training and 897 for testing); NHM (350 images, 290 for training and 60 for testing); and UNREAL-NH (9072 images, 8064 for training and 1008 for testing). When preprocessing paired training samples, synchronous random cropping is performed from the same spatial location in the nighttime foggy image and the corresponding fog-free reference image. The image patch is pixel-level aligned with the cropped nighttime foggy image patch and the fog-free reference image patch. When the short side of the original image is less than 256 pixels, it is first enlarged proportionally according to the aspect ratio of the original image so that the short side is not less than 256 pixels. Then, random cropping is performed at the corresponding position. After cropping, the nighttime foggy image patch and the corresponding fog-free reference image patch are horizontally flipped simultaneously with a probability of 0.5. The image data that has been processed is converted into tensors, and the pixel values are linearly normalized to the range of 0 to 1 to obtain the input image patch and supervision image patch used for network training. During the testing and inference phases, the random cropping and random horizontal flipping of the training phase are not performed. Instead, the foggy nighttime image to be processed is directly converted into a tensor and normalized to the range of 0 to 1. When the image height or width is not divisible by 4, reflection padding is used to pad the height and width to an integer multiple of 4. The padded image is then input into the trained network for dehazing. After obtaining the network output, the image is cropped according to the original height and width before padding, and the output pixel values are restricted to the range of 0 to 1. This process restores the dehazed image corresponding to the spatial dimensions of the original foggy nighttime image. In one specific network training configuration, a three-level encoder-decoder structure is adopted. The basic number of channels is set to 32. The number of channels in the first, second, and third feature processing layers are set to 32, 64, and 128, respectively. The number of feature processing units corresponding to the first, second, third, second, and first decoding layers are set to 4, 4, 8, 4, and 4, respectively. Downsampling uses a stride of 2. Convolution followed by ReLU activation, upsampling using a convolution kernel size of [size missing]. A transposed convolution with a stride of 2 and an output padding of 1, followed by ReLU activation, corresponds to a specific implementation state of the aforementioned encoding, deep feature processing, and decoding reconstruction process; In a specific training environment, the PyTorch deep learning framework was used, and a single NVIDIA RTX4090Ti graphics processor was used for network training and testing. The network parameters were updated using the Adam optimizer, where the first moment estimates the exponential decay rate. Set to 0.9, the second moment estimates the exponential decay rate. Set to 0.999, a parameter used to improve numerical stability. Set as The initial learning rate is set to Furthermore, cosine annealing is used to dynamically adjust the learning rate during training, causing the learning rate to decay to a certain level at the end of training. The training batch size is set to 16, and the total number of training rounds is set to 500. During training, the loss function used includes three terms: L1 loss, FFT loss, and contrastive loss. The weighted combination of the three constitutes the total loss function, which jointly constrains the training process of the network. L1 loss constrains color, brightness, and overall structure pixel by pixel; FFT loss directly constrains the amplitude-phase consistency between the output and the true value in the frequency domain; contrastive loss makes the predicted image closer to the ground truth and farther from the degenerate input in terms of perceptual features. The formulas for L1 loss, FFT loss, and contrastive loss are shown in formulas (26), (27), and (28): (26) (27) (28) Dehazed image output from the network and Real, fog-free reference image, real part of Fourier transform The imaginary part of the Fourier transform ; This indicates the pre-trained perceptron network. Feature maps extracted from layers, Represents a network prediction graph. Indicates the first Layer weight coefficients, It represents a small constant whose denominator is not zero.
[0035] The total loss of the defogging method is shown in formula (29): (29) in and The weights for the frequency domain loss and the contrast perception loss are set respectively. and The values are 0.2 and 0.1 respectively, with joint supervision in the spatial, frequency and semantic domains. The semantic domain loss simultaneously brings the prediction closer to the clear map and pushes the prediction further away from the foggy map, explicitly guiding the network to remove fog and halo degradation. In each batch of training, the night foggy image patch after pairing cropping, synchronous data augmentation and normalization is input into the network, and the first scale encoding, second scale encoding, deep image feature generation, color attenuation prior and Gaussian glow estimation, query vector generation, multi-head attention interaction and stepwise upsampling reconstruction are completed in sequence to obtain the predicted defogging image corresponding to the current batch. Then, the three types of loss are calculated according to formula (26), formula (27) and formula (28) respectively, and the total loss of the current batch is calculated according to formula (29). Error backpropagation is performed according to the total loss, and the Adam optimizer is used to update the parameters participating in the training in the network, thereby completing one network parameter iteration. As the training rounds increase, the learning rate is gradually adjusted using cosine annealing. This allows the network to update parameters with a relatively high learning rate in the early stages of training, and then gradually decrease the learning rate in the later stages. Throughout the 500 training rounds, parameters are continuously updated based on the joint loss between the network prediction results and the corresponding fog-free reference image, thereby enabling the spatial-frequency feature processing in the encoding stage, the local-global feature processing in the deep stage, the physical prior guidance, and the image reconstruction in the decoding stage to be jointly optimized under the same supervision signal. In one experimental implementation, three publicly available synthetic nighttime fog datasets—NHR, NHM, and UNREAL-NH—were used for network training and testing. The NHR dataset contains 8970 images, of which 8073 were used for training and 897 for testing. The NHM dataset contains 350 images, of which 290 were used for training and 60 for testing. The UNREAL-NH dataset contains 9072 images, of which 8064 were used for training and 1008 for testing. The training data, generated from different nighttime fog scenarios, was used to iteratively learn the network parameters, and the corresponding test data was used to evaluate the defogging results after training. When evaluating dehazed images, peak signal-to-noise ratio (PSNR), structural similarity index, and learned perceptual patch similarity are used as evaluation metrics for image restoration quality. PNR is used to reflect the pixel reconstruction error between the predicted dehazed image and the haze-free reference image. Structural similarity index is used to reflect the degree of structural similarity between two images. Learned perceptual patch similarity is used to evaluate the visual differences between images from the perspective of deep perceptual features. The network output is evaluated from the perspectives of pixel restoration, structure preservation, and perceptual quality through these three evaluation metrics. In the comparative experiment, the image dehazing network used in this embodiment was compared with MRP, Fast-MRP, RIDCP, OSFD, CFEN-ViT, GAPSF, NHFormer, CGID and SFSNiD. For the deep learning-based comparative methods, the same training data and test data were used, and the tests were conducted according to the corresponding open source code or open pre-trained model. The peak signal-to-noise ratio, structural similarity index and learning-aware image patch similarity were calculated on the three night dehazing test sets NHR, NHM and UNREAL-NH respectively. The specific evaluation results are recorded in Table 1. Table 1. Quantitative comparison of defogging effects on the nighttime defogging dataset. Under the corresponding experimental parameters, this embodiment achieved a peak signal-to-noise ratio (PSNR) of 32.87 dB, a structural similarity index of 0.952, and a learned perceptual patch similarity of 0.043 on the NHR dataset; a PSNR of 25.43 dB, a structural similarity index of 0.935, and a learned perceptual patch similarity of 0.124 on the NHM dataset; and a PSNR of 28.21 dB, a structural similarity index of 0.886, and a learned perceptual patch similarity of 0.097 on the UNREAL-NH dataset. These values represent specific experimental results obtained under the aforementioned datasets, network structures, and training parameters, and are used to illustrate the image restoration performance under this specific implementation state. They are not intended to limit the achievement of the same values under other parameter configurations. Under the corresponding experimental configuration, the number of network parameters is approximately 6.51 M, the computational load is approximately 39.67 GMACs, and the inference time per image is approximately 0.06 s. The above parameter count, computational load, and inference time are all test results corresponding to the current network structure, experimental environment, and input settings. They are used to illustrate the computational resource consumption and operating efficiency corresponding to this specific implementation state, and are not intended as necessary performance limitations under different hardware environments, different input sizes, or different network parameter settings. Referring to Figure 5, which shows the visual restoration results of different nighttime image dehazing methods on the NHM dataset, in the corresponding test samples, the processing results of MRP, OSFD, and RIDCP show different degrees of color shift, the processing results of CFEN-ViT and GAPSF still have visible fog residue, and the processing results of NHFormer and SFSNiD have insufficient detail sharpness in some texture areas. The dehazed image formed in this embodiment maintains a high degree of consistency with the fog-free reference image in terms of color restoration, texture clarity, and overall contrast in the corresponding samples, indicating that dual-domain feature processing and physical prior guidance can work together to address fog degradation, glow, and texture information in nighttime foggy images. Referring to Figure 6, which shows the visual restoration results of different nighttime image dehazing methods on the NHR dataset, in the corresponding test examples, some of the comparative methods have issues such as darker sky areas, color variations, residual fog in the distance, insufficient contrast at building edges, or unnatural transitions at the boundary between the sky and buildings. The dehazed image generated in this embodiment can maintain a good fog removal state and structural continuity in the distance buildings, sky transition, and foreground building areas, while reducing obvious color casts, over-enhancement, and residual fog phenomena.
[0036] Example 3: This embodiment provides an image dehazing enhancement system for complex night scenes. The system is used to execute the image dehazing enhancement method for complex night scenes described in Embodiment 1. It includes an image encoding module, a deep feature generation module, a physical prior processing module, a priori guided enhancement feature generation module, and an image reconstruction and output module. Each module establishes feature input and output relationships according to the data processing order in the method embodiment. It does not additionally limit the server, cloud platform, edge terminal, communication interface, or other hardware deployment structures not described in the claims. The image encoding module is used to receive foggy nighttime images and perform step-by-step downsampling encoding on the foggy nighttime images. Spatial and frequency domain parallel feature processing is performed at the first and second scales respectively to form first-scale encoded features and second-scale encoded features. At the same time, the first jump feature and the second jump feature are retained in the corresponding downsampling encoding process. The second-scale encoded features output by the image encoding module are passed to the deep feature generation module, and the first jump feature and the second jump feature are passed to the image reconstruction and output module. In one specific implementation, the image coding module first uses 3×3 convolution to map the foggy nighttime image into initial image features, then performs first-scale spatial and frequency domain parallel processing on the initial image features to obtain first-scale coded features, downsamples the first-scale coded features and performs second-scale spatial and frequency domain parallel processing to obtain second-scale coded features, wherein the spatial domain processing is performed according to the local detail processing relationship corresponding to formulas (1) and (2), the frequency domain processing is performed according to the amplitude-phase decoupling processing relationship corresponding to formulas (3) to (13), and the spatial and frequency domain outputs are performed according to formula (14) for channel splicing, channel compression and residual fusion; The deep feature generation module receives the second-scale encoded features output by the image encoding module and sequentially performs local feature extraction, frequency domain global modeling, and local-global gated modulation on the second-scale encoded features. First, local features are formed through local detail processing, and then multi-scale local features are generated through different convolution scales. Fourier domain global processing is performed on the multi-scale local features to obtain global frequency domain features, and then global modeling features are further formed. Then, a pixel-wise gated response is formed based on local information and global modeling information. Deep image features are formed through gated modulation, convolution thinning, and residual connections. The deep image features are then passed to the prior-guided enhanced feature generation module. In one specific implementation, the multi-scale local feature processing in the deep feature generation module is performed according to formula (15), the frequency domain global processing is performed according to formula (16), the fusion of spatial local information and frequency domain enhancement information is performed according to formula (17), the local-global gating processing is performed according to formula (18), and after gating modulation, the output of the current deep feature processing unit is further formed by 3×3 convolution thinning and global residual. When multiple deep feature processing units are connected in sequence, the output of the previous processing unit is used as the input of the next processing unit. The physical prior processing module takes the original foggy nighttime image as input and extracts the color attenuation prior map and the Gaussian glow estimation map respectively. The color attenuation prior processing calculates the spatial distribution of fog concentration based on the brightness and saturation components of each pixel. The Gaussian glow estimation processing determines the spatial distribution of artificial light source glow based on the perceived brightness of each pixel, the Gaussian blur result and the corresponding brightness residual. The two prior maps are then stitched together along the channel dimension to form a dual-channel physical prior map. The dual-channel physical prior map is then mapped into a query vector using a multilayer perceptron consisting of two 1×1 convolution layers. In one specific implementation, the physical prior processing module determines the fog concentration depth corresponding to the color attenuation prior according to formula (19), determines the corresponding transmittance according to formula (20), forms the Gaussian glow response according to formula (21), splices the two types of physical priors along the channel dimension according to formula (22) to form a dual-channel physical prior map, and then forms a query vector through multilayer perceptron mapping according to formula (23). The query vector is then passed to the prior-guided enhancement feature generation module. The prior-guided enhancement feature generation module receives the deep image features output by the deep feature generation module and the query vector output by the physical prior processing module, respectively. It performs linear mapping on the deep image features to form key vectors and value vectors. The query vector is used as the query, the key vector as the key, and the value vector as the value for multi-head attention calculation. Each attention head establishes the feature correspondence between the dual physical prior information and the deep image features according to formula (24). Then, the output features formed by each attention head are merged and output projection is performed through 1×1 convolution. The projection result is added to the deep image features by residual calculation to form the prior-guided enhancement feature. The image reconstruction and output module receives prior guided enhancement features, first hop features, and second hop features respectively. It performs stepwise spatial scale recovery through transposed convolution and fuses the hop features retained during the encoding process at the corresponding decoding level. Then, it performs parallel spatial and frequency domain processing on the decoding features of different scales. Finally, it uses 3×3 convolution to map the first scale refinement features to the three image channels and outputs a dehazed image. In the case of reflection filling in the input stage, the output result is further cropped according to the original height and width of the input image. The image encoding module, deep feature generation module, physical prior processing module, prior-guided enhanced feature generation module, and image reconstruction and output module are functionally connected according to the data flow. The foggy nighttime image is processed by the image encoding module to form second-scale encoded features, which are then further processed by the deep feature generation module to form deep image features. On the other hand, it directly enters the physical prior processing module to form a query vector. The two data paths converge in the prior-guided enhanced feature generation module to form prior-guided enhanced features. The prior-guided enhanced features, together with the first and second jump features retained by the image encoding module, are input into the image reconstruction and output module, which generates the final dehazed image. Thus, the system implementation and method implementation form a one-to-one data processing relationship. The image encoding module corresponds to the stepwise downsampling encoding and skip feature preservation process. The deep feature generation module corresponds to the local feature extraction, frequency domain global modeling, and local-global gated modulation process. The physical prior processing module corresponds to the color attenuation prior map, Gaussian glow estimation map, dual-channel physical prior map, and query vector generation process. The prior-guided enhancement feature generation module corresponds to the key vector and value vector generation, multi-head attention calculation, convolution projection, and residual fusion process. The image reconstruction and output module corresponds to the stepwise upsampling, skip feature fusion, and three-channel image output process. This ensures that each functional module in the system has clear data input, processing rules, and output results, and forms a complete nighttime foggy image dehazing enhancement processing chain through continuous data transfer between modules.
[0037] In the description of this specification, the references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0038] The foregoing has shown and described the basic principles, main features, and advantages of this application. Those skilled in the art should understand that this application is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this application. Various changes and modifications can be made to this application without departing from the spirit and scope thereof, and all such changes and modifications fall within the scope of the claims of this application.
Claims
1. A method for image dehazing and enhancement in complex nighttime scenes, characterized in that, Includes the following steps: Acquire a foggy nighttime image, perform stepwise downsampling encoding on the foggy nighttime image to obtain first-scale encoding features and second-scale encoding features, and retain the first jump feature and the second jump feature respectively in the corresponding downsampling encoding process; Local feature extraction, frequency domain global modeling, and local-global gated modulation are performed on the second-scale encoded features to obtain deep image features; Based on the nighttime foggy image, a color attenuation prior map and a Gaussian glow estimation map are extracted. The color attenuation prior map and the Gaussian glow estimation map are concatenated along the channel dimension to obtain a dual-channel physical prior map. The dual-channel physical prior map is then mapped through a multilayer perceptron to obtain a query vector. Linear mapping is performed on the deep image features to obtain key vectors and value vectors. Multi-head attention is performed using the query vector as the query and the key vector and value vector as the key and value, respectively. The multi-head attention calculation result is convolved and projected, and then added to the deep image features by residual calculation to obtain the prior guided enhancement feature. The prior guided enhancement features and the second jump features are concatenated along the channel dimension to obtain the deep fusion features. Then, the deep fusion features are transposed and upsampled to obtain the dehazed image.
2. The image dehazing and enhancement method for complex nighttime scenes according to claim 1, characterized in that: The nighttime foggy image is downsampled and encoded step by step to obtain first-scale encoded features and second-scale encoded features. The first and second jump features are retained during the corresponding downsampling and encoding process, as detailed below: The foggy nighttime image is subjected to convolution processing to obtain initial image features; The initial image features are divided into spatial domain features to be processed and frequency domain features to be processed along the channel dimension. Local detail extraction is performed on the spatial domain features to be processed and spectral feature extraction is performed on the frequency domain features to be processed. The spatial domain features obtained from the local detail extraction and the frequency domain features obtained from the spectral feature extraction are concatenated along the channel dimension and channel compression is performed. The channel compressed features are added to the initial image features by residual addition to obtain the first scale encoded features. The first-scale encoded features are downsampled, and the same spatial and frequency domain parallel processing method as the first-scale encoded features is used to extract features from the downsampled features to obtain the second-scale encoded features. The intermediate features in the corresponding downsampling encoding process are retained as the first jump feature and the second jump feature, respectively.
3. The image dehazing and enhancement method for complex nighttime scenes according to claim 2, characterized in that: Spectral feature extraction is performed on the features to be processed in the frequency domain, as follows: A two-dimensional discrete Fourier transform is performed on the frequency domain feature to be processed, mapping the frequency domain feature to the frequency domain to obtain a complex-valued spectrum, and the amplitude spectrum and phase spectrum are determined according to the real part and imaginary part of the complex-valued spectrum, respectively. Convolution mapping, nonlinear activation and channel weighting are performed on the amplitude spectrum and the phase spectrum respectively. The residual amplitude spectrum is obtained by adding the residual amplitude spectrum with the amplitude spectrum before processing. The residual phase spectrum is obtained by adding the residual phase spectrum with the phase spectrum before processing. The complex-valued spectrum is reconstructed based on the residual amplitude spectrum and the residual phase spectrum, and the reconstructed complex-valued spectrum is subjected to a two-dimensional inverse discrete Fourier transform to obtain the frequency domain features.
4. The image dehazing and enhancement method for complex nighttime scenes according to claim 3, characterized in that: The amplitude and phase spectra are subjected to channel weighting, as detailed below: Global average pooling along the channel dimension is performed on the intermediate features corresponding to the amplitude spectrum and the intermediate features corresponding to the phase spectrum, respectively. The pooling results are then mapped through two fully connected layers and an activation function to obtain the channel weights corresponding to each channel. The frequency components of different channels in the amplitude spectrum and the phase spectrum are weighted according to the channel weights. The amplitude spectrum and the phase spectrum are respectively processed by a first 1×1 convolution, a LeakyReLU activation function, channel weighting, and a second 1×1 convolution.
5. The image dehazing and enhancement method for complex nighttime scenes according to claim 1, characterized in that: Local detail extraction is performed on the spatial features to be processed, as follows: The spatial features to be processed are convolutionally processed using standard convolution, central difference convolution, angular difference convolution, horizontal difference convolution, and vertical difference convolution, respectively. The convolution kernels corresponding to each convolution process are merged to obtain the transform convolution kernel used for local detail extraction; The spatial features to be processed are convolved using the transformed convolution kernel. The convolution result is then processed by a linear rectified activation function and added to the spatial features to be processed for the first time using residuals. The features after the first residual addition are then convolved by 3×3 and added to the spatial features to be processed again using residuals to obtain the spatial features.
6. The image dehazing and enhancement method for complex nighttime scenes according to claim 1, characterized in that: Local feature extraction, frequency domain global modeling, and local-global gated modulation are performed on the second-scale encoded features to obtain deep image features, as detailed below: The second-scale encoded features are subjected to local detail convolution and nonlinear activation processing, and the processed features are added to the second-scale encoded features by residual addition to obtain local features; The local features are channel-mapped and divided into first branch features and second branch features along the channel dimension. The first branch features are processed by 3×3 depth convolution, and the second branch features are processed by 5×5 depth convolution. The features processed by the two branches are then concatenated along the channel dimension to obtain multi-scale local features. The multi-scale local features are subjected to a two-dimensional Fourier transform to obtain frequency domain features. The frequency domain features are then subjected to pointwise convolution, batch normalization, and nonlinear activation processing, and a two-dimensional inverse Fourier transform is performed to obtain global frequency domain features. The global frequency domain features and the multi-scale local features are added together by residual summation, and the features after residual summation are convolved point by point to obtain the global modeling features. The local features and the global modeling features are concatenated along the channel dimension to obtain the local-global fused features; The local-global fusion features are subjected to grouped convolution processing, and the grouped convolution processing results are mapped by the Sigmoid activation function to obtain pixel-wise gated weights; The pixel-by-pixel gate weights are multiplied element-by-element by the local-global fusion features to obtain the gated modulation features; The gated modulation features are convolved and thinned, and the thinned features are added to the second scale coding features by residual addition to obtain the deep image features.
7. The image dehazing and enhancement method for complex nighttime scenes according to claim 1, characterized in that: The extraction of the color attenuation prior map is as follows: The brightness and saturation components of each pixel are determined based on the red, green, and blue channel values corresponding to each pixel in the nighttime foggy image. The brightness component and the saturation component are input into a linear regression model for weighted calculation to obtain the fog density depth value corresponding to each pixel. The fog density depth value is restricted to a range of 0 to 1, and the color attenuation prior map is constructed based on the fog density depth value corresponding to each pixel.
8. The image dehazing and enhancement method for complex nighttime scenes according to claim 7, characterized in that: The extraction of the Gaussian glow estimation map is as follows: Based on the red, green, and blue channel values of each pixel in the nighttime foggy image, a weighted calculation is performed according to preset corresponding weights to obtain a perceived brightness map; The perceived brightness map is subjected to Gaussian blurring using a preset Gaussian kernel, and the brightness residual between the Gaussian blurring result and the perceived brightness map is calculated. The negative values in the brightness residual are truncated to zero, and the truncated brightness residual is normalized according to the maximum brightness residual corresponding to the night foggy image to obtain the Gaussian glow estimation map.
9. The image dehazing and enhancement method for complex nighttime scenes according to claim 8, characterized in that: The query vector is obtained by mapping the dual-channel physical prior map through a multilayer perceptron, as follows: The dual-channel physical prior map is obtained by concatenating the color attenuation prior map and the Gaussian glow estimation map along the channel dimension. The query vector is obtained by sequentially applying two 1×1 convolution layers to the dual-channel physical prior graph.
10. The image dehazing and enhancement method for complex nighttime scenes according to claim 9, characterized in that: The multi-head attention calculation is as follows: Calculate the scaled dot product between the query vector and each key vector, perform Softmax normalization on the scaled dot product to obtain the corresponding attention weights, and perform weighted aggregation on the corresponding value vectors according to the attention weights to obtain the output features corresponding to each attention head. The output features corresponding to each attention point are merged, and the merged features are projected by a 1×1 convolution and added to the residual of the deep image features to obtain the prior guided enhancement features.
11. The image dehazing and enhancement method for complex nighttime scenes according to claim 10, characterized in that: The prior guided enhancement features are upsampled step by step, and the second jump feature and the first jump feature are fused at the corresponding scales to obtain the dehazed image, as follows: The prior guided enhancement feature and the second jump feature are concatenated along the channel dimension to obtain the deep fusion feature; The deep fusion features are transposed and upsampled to obtain the second-scale decoding features. Spatial and frequency domain features are extracted in parallel from the second-scale decoding features. The extracted spatial and frequency domain features are then fused to obtain the second-scale refined features. The second-scale refined feature is concatenated with the first jump feature along the channel dimension to obtain the middle-layer fused feature; The mid-layer fusion features are transposed and upsampled to obtain the first-scale decoding features. Spatial and frequency domain features are extracted in parallel from the first-scale decoding features, and the extracted spatial and frequency domain features are fused to obtain the first-scale refined features. The first-scale refinement features are subjected to 3×3 convolution mapping to obtain the three-channel dehazed image.
12. An image dehazing enhancement system for complex night scenes, used to implement the image dehazing enhancement method for complex night scenes according to any one of claims 1 to 11, characterized in that, include: The image encoding module is used to acquire a foggy nighttime image, perform step-by-step downsampling encoding on the foggy nighttime image to obtain a first-scale encoding feature and a second-scale encoding feature, and retain the first jump feature and the second jump feature respectively in the corresponding downsampling encoding process. The deep feature generation module is used to obtain the second-scale encoded features, and to perform local feature extraction, frequency domain global modeling and local-global gated modulation on the second-scale encoded features to obtain deep image features. The physical prior processing module is used to extract a color attenuation prior map and a Gaussian glow estimation map based on the night foggy image, concatenate the color attenuation prior map and the Gaussian glow estimation map along the channel dimension to obtain a dual-channel physical prior map, and map the dual-channel physical prior map through a multilayer perceptron to obtain a query vector. The prior-guided enhancement feature generation module is used to obtain the deep image features and the query vector, perform linear mapping on the deep image features to obtain key vectors and value vectors, perform multi-head attention calculation using the query vector as the query and the key vector and value vector as the key and value respectively, and add the multi-head attention calculation result to the deep image features after convolutional projection to obtain the prior-guided enhancement features; The image reconstruction and output module is used to concatenate the prior guided enhancement features and the second jump features along the channel dimension to obtain deep fusion features, and then perform transposed convolution upsampling on the deep fusion features to obtain a dehazed image.