A codebook-guided night traffic low-light enhancement and overexposure suppression method

CN122415403BActive Publication Date: 2026-08-21HUNAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610867494.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-08-21
Estimated Expiration
2046-06-16

AI Technical Summary

Technical Problem

[0006]有鉴于此,本发明提供一种基于码本引导的夜间交通低光增强与过曝抑制方法,解决现有低光图像增强方法在交通夜间场景中容易产生全局曝光不一致、噪声与纹理耦合、车灯路灯过曝扩散、颜色溢出以及灯源周围结构细节丢失的问题

Benefits of technology

本发明通过高质量图像预训练离散视觉码本并引入低光自适应对齐,为夜间交通图像增强提供稳定的结构、颜色与纹理先验;结合Mamba状态空间建模以线性复杂度实现全局曝光与颜色一致性传播,同时利用离散小波变换在频域显式分离照明与纹理成分并进行区域选择性补偿;进一步通过过曝灯源层估计分支显式提取强光核心、光晕扩散及过渡区域掩膜,引导码本原型可信度调制、频域补偿抑制与三路门控融合,从而在提升暗区域亮度与细节可见性的同时,有效抑制车灯、路灯及交通信号灯的过曝扩散、眩光边缘与颜色溢出,兼具高分辨率实时处理能力与显著优于现有方法的PSNR、SSIM及OE-MAE指标表现。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122415403B_ABST
    Figure CN122415403B_ABST
Patent Text Reader

Abstract

The application relates to a night traffic low-light enhancement and overexposure suppression method based on codebook guidance, which comprises the following steps: a high-quality normal brightness image is used to pre-train a discrete visual codebook, visual prototypes are obtained through low-light self-adaptive alignment, a night traffic image to be enhanced is input into a multi-scale encoder to extract deep layer features, corresponding prototypes are obtained through codebook index prediction and lookup, a Mamba state space modeling module is introduced to perform global context propagation, the deep layer features are decomposed into low-frequency illumination and high-frequency texture components through discrete wavelet transform, and region-selective high-frequency compensation is performed through an overexposure light source mask; an overexposure light source layer estimation branch extracts a light efficiency layer and generates a core area, a halo diffusion mask and a transition area mask; global enhancement features, frequency domain features, codebook reliability and masks are fused to guide light source suppression and output an enhanced image; the application improves the brightness and details of dark areas, effectively suppresses the overexposure diffusion of car lights, street lamps and signal lights, and improves the halo, color overflow and background detail loss problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and image enhancement technology, and in particular to a codebook-guided method for low-light enhancement and overexposure suppression in nighttime traffic. Background Technology

[0002] In nighttime traffic scenarios, images captured by camera equipment typically contain both low-light and high-brightness light source areas. Low-light areas are characterized by insufficient brightness, low signal-to-noise ratio, color shift, blurred edges, and loss of structural details. High-brightness light source areas are usually generated by reflections from vehicle headlights, streetlights, traffic lights, reflective signs, or water on the road surface, which can easily lead to overexposure, halos, glare, and color overflow. These degradations reduce the reliability of nighttime road monitoring, vehicle recognition, pedestrian detection, and autonomous driving perception.

[0003] Traditional low-light image enhancement methods typically rely on histogram equalization, Retinex models, or manually designed prior constraints to improve image brightness to some extent. However, when there are overexposed car lights or streetlights in the image, simply increasing the overall brightness will further amplify the luminous effect of the bright areas, causing the overexposed areas to spread and resulting in the vehicle outlines, road boundaries, and traffic signs around the light source being submerged. Although deep learning methods based on convolutional neural networks improve the ability to restore local details, the local receptive field of convolutional operations is limited, making it difficult to fully model the exposure correlation between distant regions. Therefore, global brightness inconsistencies may occur in images with uneven lighting over a large area.

[0004] In recent years, state-space models and Mamba structures have been used for high-resolution image restoration tasks due to their long-range modeling capabilities with linear complexity; discrete visual codebooks can provide prior knowledge of structure, color, and texture in normal-brightness images for low-light enhancement; wavelet decomposition can separate low-frequency illumination information and high-frequency texture information in the frequency domain; layer decomposition methods can estimate the luminous effect layer in nighttime images; however, if the above techniques are simply stacked side by side, it is still difficult to solve the problem of strong light overexposure in nighttime traffic scenes. Overexposed headlights, streetlights, and traffic lights may be mistaken by codebook retrieval as high quality and high texture, resulting in color overflow or artifacts. If wavelet high-frequency compensation does not distinguish between the real road edge and the halo boundary, it is easy to mistakenly enhance the glare edge as texture detail. If Mamba global modeling lacks constraints on overexposed light source areas, it may propagate abnormal exposure in strong light areas to surrounding dark areas, resulting in inconsistent global exposure.

[0005] Therefore, there is an urgent need for an image enhancement method for nighttime traffic scenes that can introduce stable, high-quality visual priors while maintaining low computational complexity, and explicitly estimate the strong light core, halo diffusion, and transition region. This allows the overexposed light source estimation results to simultaneously constrain codebook prototype injection, wavelet high-frequency compensation, and global fusion output, thereby simultaneously improving the visibility of dark areas, the naturalness of light source areas, global exposure consistency, color stability, and the ability to preserve texture details. Summary of the Invention

[0006] In view of this, the present invention provides a codebook-guided method for low-light enhancement and overexposure suppression in nighttime traffic, which solves the problems of global exposure inconsistency, noise and texture coupling, overexposure diffusion of vehicle lights and streetlights, color overflow, and loss of structural details around the light source in existing low-light image enhancement methods in nighttime traffic scenes.

[0007] To achieve the above objectives, this invention provides a codebook-guided method for low-light enhancement and overexposure suppression in nighttime traffic. The method constructs an image enhancement model, including a codebook construction branch, a codebook-guided state-space modeling branch, a wavelet frequency domain enhancement branch, an overexposure light source layer estimation branch, a light source suppression-guided fusion module, and an image reconstruction module. The method includes the following steps: S1. Pre-train a discrete visual codebook using high-quality normal brightness images, wherein the discrete visual codebook includes high-quality visual prototypes for characterizing the structure, color, and texture of normal brightness images. S2. Input the nighttime traffic image to be enhanced into a multi-scale encoder to extract deep features; S3. Input the deep features into the codebook to guide the state space modeling branch. Obtain the high-quality visual prototype corresponding to the deep features through codebook index prediction and codebook lookup. Perform global context modeling based on the Mamba state space modeling module to obtain global enhanced features. S4. Input the nighttime traffic image to be enhanced into the overexposed light source layer estimation branch to estimate the overexposed light source luminous effect layer, and generate the overexposed light source core area mask, halo diffusion area mask and transition area mask according to the overexposed light source luminous effect layer. S5. Input the deep features into the wavelet frequency domain enhancement branch, and decompose the deep features into low-frequency lighting components and high-frequency texture components in multiple directions through discrete wavelet transform. Perform low-frequency lighting modeling and high-frequency texture compensation constrained by overexposed light source areas respectively to obtain frequency domain enhancement features. S6. Based on the global enhancement features, frequency domain enhancement features, high-quality visual prototype, overexposed light source core area mask, halo diffusion area mask and transition area mask, perform light source suppression guided fusion to obtain joint enhancement features; Reduce the injection intensity of high-quality visual prototypes and high-frequency texture compensation in the core area and halo diffusion area of ​​overexposed light sources, and increase the injection intensity of high-quality visual prototypes and high-frequency texture compensation in non-overexposed dark areas. S7. Input the joint enhancement features into the decoder and the thinning module to generate an enhanced image, thereby increasing the brightness of dark areas and suppressing overexposed light source areas generated by vehicle lights, streetlights, and traffic lights.

[0008] Preferably, the high-quality normal brightness image pre-training discrete visual codebook specifically includes the following steps: S101. Input the high-quality normal brightness image into a shared high-quality coding embedding layer and a Mamba multi-scale encoder, and obtain latent features through downsampling and multi-level coding. S102. Input the latent features into the codebook quantization module, and obtain a discrete visual codebook including K codewords through vector quantization; S103. In the low-light image enhancement stage, a learnable offset is introduced into the discrete visual codebook to obtain a low-light adaptive codebook. The low-light adaptive codebook provides stable priors for normal brightness, natural color, and structural texture in traffic images where low-light and overexposed light sources coexist.

[0009] Preferably, the discrete visual codebook expression is: ; in, Represents a discrete visual codebook. Indicates the first Each code character Represents the real number field. Represents codeword dimension, Indicates the number of codewords; The low-light adaptive codebook expression is: ; in, Indicates low-light adaptive codeword, Indicates the first The learnable codeword offset corresponding to each codeword Indicates the offset strength coefficient; A codeword offset regularization term is introduced to constrain the magnitude of the learnable codeword offset corresponding to each codeword. The codeword offset regular expression is: ; in, This represents the codeword offset regularization loss. The offset regularization coefficient is used to control the strength of the codeword offset constraint. Indicates the number of codewords. Indicates the first The learnable codeword offset corresponding to each codeword This represents the squared L2 norm, used to measure the offset of the codeword relative to the original codeword.

[0010] Preferably, the multi-scale encoder includes a convolutional embedding layer, at least one downsampling layer, and L encoder blocks. Each encoder block includes at least one upsampling layer and L decoding stages. Each decoding stage includes a convolutional module configured in parallel, residual connections for fusing the results of the parallel convolutions, and an element-wise summation operation.

[0011] Preferably, the Mamba state space modeling module includes a selective scanning unit and a state space model unit; the specific steps for obtaining global enhanced features using the codebook index prediction, codebook lookup, and Mamba state space are as follows: S301. Calculate the distance between the feature vector of each spatial location in the current layer's deep features and each codeword in the low-light adaptive codebook, and select the codeword with the smallest distance as the high-quality visual prototype of the spatial location. S302. Inject all the high-quality visual prototypes into the Mamba state space modeling module and the light source suppression guided fusion module by means of addition, splicing or feature modulation. S303. Generate a codebook credibility map based on the codebook matching distance and the mask of the core area of ​​the overexposed light source and the mask of the halo diffusion area, and inject a high-quality visual prototype, reducing the injection weight in the core area of ​​the overexposed light source and the halo diffusion area. S304. The scanning unit receives the current layer deep features obtained after codebook index prediction and codebook lookup processing, and expands them into sequence features according to at least one spatial direction. The state space model unit establishes a state update relationship based on sequence features and hidden states, and transmits context information between spatial locations corresponding to the deep features of the current layer through a learnable parameter matrix to obtain the global enhanced features of the current layer.

[0012] Preferably, the overexposed light source layer estimation branch decomposes the nighttime traffic image to be enhanced into a reflection structure layer, an illumination layer, and an overexposed light source luminous effect layer, as expressed by: ; in, This indicates nighttime traffic images that need improvement. Indicates the reflective structure layer. Indicates the lighting layer. Indicates an overexposed lamp source light effect layer. This represents element-wise multiplication; The overexposed light source layer estimation branch includes a brightness prior extraction unit, a color saturation response unit, a local contrast extraction unit, a gradient diffusion response unit, a multi-scale dilated convolution estimation unit, and a mask refinement unit. The brightness prior unit extracts the high-brightness core response from the night enhancement image to be enhanced; The color saturation response unit extracts the color intensity response corresponding to the vehicle headlights, brake lights, and traffic lights; The local contrast extraction unit is used to distinguish overexposure halos from traffic signs, license plates, and road edges; The gradient diffusion response unit extracts the halo boundary formed by the diffusion of a strong light source into the surrounding dark area. The high-brightness core response, color intensity response, local contrast response, and halo boundary response are used to characterize the location of the intensity core, the color light source area, the local brightness variation, and the halo boundary formed by the diffusion of intensity light into the surrounding dark area in nighttime traffic images, respectively. After channel concatenation of the high-brightness core response, color intensity response, local contrast response, and halo boundary response with shallow convolutional features, the data is input into a multi-scale dilated convolutional estimation unit to obtain the overexposed light source light effect layer. The mask refinement unit generates a mask for the core area of ​​the overexposed light source based on the light effect layer of the overexposed light source. Halo diffusion area mask and transition region mask The expression is: ; ; ; in, Indicates gradient diffusion response, , Represents the convolution mapping function, This represents the Sigmoid activation function. This indicates that the input value will be restricted to a certain range. A cutoff function within an interval.

[0013] Preferably, step S5, generating the frequency domain enhancement feature, specifically includes the following steps: S501, The wavelet frequency domain enhancement branch generates low-frequency illumination components and high-frequency texture components in the horizontal, vertical and diagonal directions by performing discrete wavelet transform on the deep features of the current layer; S502. Perform Mamba context modeling on the low-frequency lighting components to correct the overall brightness distribution, and perform directional convolution processing on the high-frequency texture components to recover road edges, vehicle outlines, traffic signs, and scene textures. S503. Perform region-selective compensation for high-frequency texture components based on the overexposed light source core area mask, halo diffusion area mask, and transition area mask. In non-overexposed dark areas, the weight of high-frequency texture compensation is increased, while in halo diffusion areas, the weight of high-frequency texture compensation is decreased. In overexposed light source core areas, high-frequency texture compensation is shielded or reduced to avoid enhancing light source halo, glare edges, or color overflow into texture details. Then, frequency domain enhancement features are reconstructed through inverse discrete wavelet transform.

[0014] Preferably, the light source suppression and guidance fusion module includes a mask gating unit, a codebook prototype credibility modulation unit, a frequency domain compensation modulation unit, and a three-way fusion unit; The masking unit generates dark area enhancement weights, light source suppression weights, and transition area retention weights based on the mask of the overexposed light source core area, the mask of the halo diffusion area, and the mask of the transition area. The codebook prototype credibility modulation unit generates a codebook credibility map based on the codebook matching distance and the mask of the overexposed light source area, and reduces the injection weight of the high-quality visual prototype in the core area and halo diffusion area of ​​the overexposed light source, and increases the injection weight of the high-quality visual prototype in the non-overexposed dark area. The frequency domain supplementary modulation unit adjusts the injection intensity of the frequency domain enhancement feature according to the mask of the overexposed lamp source region; The three-way fusion unit fuses the dark area enhancement feature, the light source suppression feature, and the transition area preservation feature pixel by pixel according to normalized weights; The input-output relationship expression of the light source suppression-guided fusion module is as follows: ; in, Represents the spatial characteristics of the structure. Indicates frequency characteristics, Indicates light source suppression characteristics, Indicates the mask in the overexposed lamp source area. This indicates a joint enhancement feature.

[0015] Preferably, when training the image enhancement model, a loss function is constructed, including: reconstruction loss, perceptual loss, codebook offset regularization loss, overexposed light source layer constraint loss, halo suppression loss, and edge consistency loss; The constrained loss of the overexposed light source layer is consistent with the strong light core and halo diffusion area in the nighttime traffic image to be enhanced. The halo suppression loss reduces the brightness diffusion of the overexposed light source area and its neighborhood in the enhanced image; The edge consistency loss preserves road edges, vehicle outlines, and traffic sign structures in non-overexposed areas.

[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention provides stable structural, color, and texture priors for nighttime traffic image enhancement by pre-training a discrete visual codebook with high-quality images and introducing low-light adaptive alignment. It combines Mamba state-space modeling to achieve global exposure and color consistency propagation with linear complexity, while using discrete wavelet transform to explicitly separate illumination and texture components in the frequency domain and perform region-selective compensation. Furthermore, it explicitly extracts strong light cores, halo diffusion, and transition region masks through an overexposed light source layer estimation branch, guiding codebook prototype credibility modulation, frequency domain compensation suppression, and three-way gated fusion. This effectively suppresses overexposure diffusion, glare edges, and color overflow in vehicle lights, streetlights, and traffic lights while improving brightness and detail visibility in dark areas. It also boasts high-resolution real-time processing capabilities and significantly superior PSNR, SSIM, and OE-MAE performance compared to existing methods. Attached Figure Description

[0017] Figure 1 This is a diagram of the overall network architecture of the present invention; Figure 2 This is a structural diagram of the encoder, decoder, and codebook quantization module of the present invention; Figure 3 This is a feature fusion structure diagram of the codebook-guided state space modeling branch and the wavelet frequency domain enhancement branch of this invention; Figure 4 This is a structural diagram of the overexposure lamp source layer estimation and light source suppression guidance fusion module provided in an embodiment of the present invention. Detailed Implementation

[0018] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0019] Example 1 This embodiment provides a codebook-guided method for enhancing low-light performance and suppressing overexposure in nighttime traffic. It constructs an image enhancement model, including a codebook construction branch, a codebook-guided state-space modeling branch, a wavelet frequency domain enhancement branch, an overexposure light source layer estimation branch, a light source suppression-guided fusion module, and an image reconstruction module. The method includes the following steps: S1. Pre-train a discrete visual codebook using high-quality normal brightness images, wherein the discrete visual codebook includes high-quality visual prototypes for characterizing the structure, color, and texture of normal brightness images. S101. Input the high-quality normal brightness image into a shared high-quality coding embedding layer and a Mamba multi-scale encoder, and obtain latent features through downsampling and multi-level coding. S102. Input the latent features into the codebook quantization module, and obtain a discrete visual codebook including K codewords through vector quantization; S103. In the low-light image enhancement stage, a learnable offset is introduced into the discrete visual codebook to obtain a low-light adaptive codebook. The expression for the discrete visual codebook is: ; in, Represents a discrete visual codebook. Indicates the first Each code character Represents the real number field. Represents codeword dimension, Indicates the number of codewords; The low-light adaptive codebook provides stable priors for normal brightness, natural color, and structural texture in traffic images where low-light and overexposed light sources coexist. The low-light adaptive codebook expression is: ; in, Indicates low-light adaptive codeword, Indicates the first The learnable codeword offset corresponding to each codeword Indicates the offset strength coefficient; A codeword offset regularization term is introduced to constrain the magnitude of the learnable codeword offset corresponding to each codeword. Due to the learnable codeword offset To adapt pre-trained discrete visual codebooks to degradation distributions in low-light and overexposed light source coexisting scenarios at night, if the offset is too large, it may cause the low-light adaptive codebook to deviate from the original high-quality visual prototype space, thereby weakening the prior knowledge of normal brightness, natural color, and structural texture contained in the pre-trained codebook. To address this, a codeword offset regularization term is introduced to constrain the magnitude of the learnable codeword offset corresponding to each codeword, so that the low-light adaptive codebook can maintain consistency with the high-quality visual codebook while adapting to low-light degradation features. The codeword offset regular expression is: ; in, This represents the codeword offset regularization loss. The offset regularization coefficient is used to control the strength of the codeword offset constraint. Indicates the number of codewords. Indicates the first The learnable codeword offset corresponding to each codeword This represents the square of the L2 norm, used to measure the offset of the codeword relative to the original codeword; By limiting the codeword offset, the codebook can be adapted to the degradation distribution of both low-light and overexposed light sources while maintaining the a priori dominance of high-quality images.

[0020] S2. Input the nighttime traffic image to be enhanced into a multi-scale encoder and extract at least one layer of deep features; The multi-scale encoder includes a convolutional embedding layer, at least one downsampling layer, and L encoder blocks. Each encoder block includes at least one upsampling layer and L decoding stages. Each decoding stage includes a convolutional module configured in parallel, residual connections for fusing the results of the parallel convolutions, and an element-wise summation operation.

[0021] S3. Input the deep features into the codebook to guide the state space modeling branch. Obtain the high-quality visual prototype corresponding to the deep features through codebook index prediction and codebook lookup. Perform global context modeling based on the Mamba state space modeling module to obtain global enhanced features. The Mamba state space modeling module includes a selective scanning unit and a state space model unit; the specific steps for obtaining global enhanced features using the codebook index prediction, codebook lookup, and Mamba state space are as follows: S301. Calculate the distance between the feature vector of each spatial location in the current layer's deep features and each codeword in the low-light adaptive codebook, and select the codeword with the smallest distance as the high-quality visual prototype of the spatial location. S302. Inject all the high-quality visual prototypes into the Mamba state space modeling module and the light source suppression guided fusion module by means of addition, splicing or feature modulation. S303. Based on the codebook matching distance and the mask of the core area of ​​the overexposed light source and the mask of the halo diffusion area, a codebook credibility map is generated and injected into a high-quality visual prototype. This allows the high-quality visual prototype to provide structural, color and texture priors in non-overexposed dark areas. The injection weight is reduced in the core area of ​​the overexposed light source and the halo diffusion area to avoid mismatching the light spot or halo of the overexposed light source as normal texture and generating color overflow and artifacts. S304. The scanning unit receives the current layer deep features obtained after codebook index prediction and codebook lookup processing, and expands them into sequence features according to at least one spatial direction. The state space model unit establishes a state update relationship based on sequence features and hidden states, and transmits context information between spatial locations corresponding to the deep features of the current layer through a learnable parameter matrix to obtain the global enhanced features of the current layer.

[0022] S4. Input the nighttime traffic image to be enhanced into the overexposed light source layer estimation branch to estimate the overexposed light source luminous effect layer, and generate the overexposed light source core area mask, halo diffusion area mask and transition area mask according to the overexposed light source luminous effect layer. The overexposed light source layer estimation branch decomposes the nighttime traffic image to be enhanced into a reflection structure layer, an illumination layer, and an overexposed light source luminous effect layer, expressed as: ; in, This indicates nighttime traffic images that need improvement. Indicates the reflective structure layer. Indicates the lighting layer. This refers to the overexposed light source effect layer formed by vehicle lights, streetlights, traffic lights, or other strong light sources. This represents element-wise multiplication; The overexposed light source layer estimation branch includes a brightness prior extraction unit, a color saturation response unit, a local contrast extraction unit, a gradient diffusion response unit, a multi-scale dilated convolution estimation unit, and a mask refinement unit. The brightness prior unit extracts the high-brightness core response from the night enhancement image to be enhanced; The color saturation response unit extracts the color intensity response corresponding to the vehicle headlights, brake lights, and traffic lights; The local contrast extraction unit is used to distinguish overexposure halos from traffic signs, license plates, and road edges; The gradient diffusion response unit extracts the halo boundary formed by the diffusion of a strong light source into the surrounding dark area. The high-brightness core response, color intensity response, local contrast response, and halo boundary response are used to characterize the location of the intensity core, the color light source area, the local brightness variation, and the halo boundary formed by the diffusion of intensity light into the surrounding dark area in nighttime traffic images, respectively. After channel concatenation of the high-brightness core response, color intensity response, local contrast response, and halo boundary response with shallow convolutional features, the data is input into a multi-scale dilated convolutional estimation unit to obtain the overexposed light source light effect layer. The mask refinement unit generates a mask for the core area of ​​the overexposed light source based on the light effect layer of the overexposed light source. Halo diffusion area mask and transition region mask The expression is: ; ; ; in, Indicates gradient diffusion response, , Represents the convolution mapping function, This represents the Sigmoid activation function. This indicates that the input value will be restricted to a certain range. A cutoff function within an interval.

[0023] S5. Input the deep features into the wavelet frequency domain enhancement branch, and decompose the deep features into low-frequency lighting components and high-frequency texture components in multiple directions through discrete wavelet transform. Perform low-frequency lighting modeling and high-frequency texture compensation constrained by overexposed light source areas respectively to obtain frequency domain enhancement features. S501, The wavelet frequency domain enhancement branch generates low-frequency illumination components and high-frequency texture components in the horizontal, vertical and diagonal directions by performing discrete wavelet transform on the deep features of the current layer; S502. Perform Mamba context modeling on the low-frequency lighting components to correct the overall brightness distribution, and perform directional convolution processing on the high-frequency texture components to recover road edges, vehicle outlines, traffic signs, and scene textures. S503. Perform region-selective compensation for high-frequency texture components based on the overexposed light source core area mask, halo diffusion area mask, and transition area mask. In non-overexposed dark areas, the weight of high-frequency texture compensation is increased, while in halo diffusion areas, the weight of high-frequency texture compensation is decreased. In overexposed light source core areas, high-frequency texture compensation is shielded or reduced to avoid enhancing light source halo, glare edges, or color overflow into texture details. Then, frequency domain enhancement features are reconstructed through inverse discrete wavelet transform.

[0024] S6. Based on the global enhancement features, frequency domain enhancement features, high-quality visual prototype, overexposed light source core area mask, halo diffusion area mask and transition area mask, perform light source suppression guided fusion to obtain joint enhancement features; Reduce the injection intensity of high-quality visual prototypes and high-frequency texture compensation in the core area and halo diffusion area of ​​overexposed light sources, and increase the injection intensity of high-quality visual prototypes and high-frequency texture compensation in non-overexposed dark areas. The light source suppression and fusion module includes a mask gating unit, a codebook prototype credibility modulation unit, a frequency domain compensation modulation unit, and a three-way fusion unit; The masking unit generates dark area enhancement weights, light source suppression weights, and transition area retention weights based on the mask of the overexposed light source core area, the mask of the halo diffusion area, and the mask of the transition area. The codebook prototype credibility modulation unit generates a codebook credibility map based on the codebook matching distance and the mask of the overexposed light source area, and reduces the injection weight of the high-quality visual prototype in the core area and halo diffusion area of ​​the overexposed light source, and increases the injection weight of the high-quality visual prototype in the non-overexposed dark area. The frequency domain supplementary modulation unit adjusts the injection intensity of the frequency domain enhancement feature according to the mask of the overexposed lamp source region; The three-way fusion unit is set in Figure 4 Fusion Mapping Internally, the dark area enhancement features, light source suppression features, and transition area preservation features are fused pixel by pixel according to normalized weights; The input-output relationship expression of the light source suppression-guided fusion module is as follows: ; in, Represents the spatial characteristics of the structure. Indicates frequency characteristics, Indicates light source suppression characteristics, Indicates the mask in the overexposed lamp source area. This indicates a joint enhancement feature.

[0025] S7. Input the joint enhancement features into the decoder and the thinning module to generate an enhanced image, thereby increasing the brightness of dark areas and suppressing overexposed light source areas generated by vehicle lights, street lights and traffic lights. When training the image enhancement model, a loss function is constructed, including: reconstruction loss, perceptual loss, codebook offset regularization loss, overexposed light source layer constraint loss, halo suppression loss, and edge consistency loss; The constrained loss of the overexposed light source layer is consistent with the strong light core and halo diffusion area in the nighttime traffic image to be enhanced. The halo suppression loss reduces the brightness diffusion of the overexposed light source area and its neighborhood in the enhanced image; The edge consistency loss preserves road edges, vehicle outlines, and traffic sign structures in non-overexposed areas.

[0026] Example 2 like Figure 1 As shown, the image enhancement model in this embodiment includes two stages and a light source suppression guidance process: the first stage is the codebook pre-training stage, which uses high-quality normal brightness images to learn a shared discrete visual codebook; the second stage is the nighttime traffic image enhancement stage, which uses the pre-trained shared codebook, the codebook-guided state space modeling branch, and the wavelet frequency domain enhancement branch to enhance dark areas; the light source suppression guidance process uses the overexposed light source layer estimation branch to extract the overexposed light source light effect layer, and generates an overexposed light source core area mask, a halo diffusion area mask, and a transition area mask. Furthermore, the mask constrains the codebook prototype injection, wavelet high-frequency compensation, and three-way gated fusion to suppress strong light areas such as vehicle lights, streetlights, and traffic lights.

[0027] In this embodiment, This indicates a high-quality, normal brightness image. This represents a high-quality image reconstructed through codebook quantization, decoding, and upsampling layers during the codebook pre-training phase. This indicates nighttime traffic images that need improvement. This represents the final enhanced image output. Indicates a high-quality image encoder. Represents a discrete visual codebook. Indicates the first in the codebook Each code character Indicates the first Layer depth features Indicates the first Layer codebook prototype characteristics. Indicates the first Layer codebook credibility graph This represents the structural space characteristics after Mamba state space modeling. This indicates the wavelet frequency domain enhancement feature. Indicates an overexposed lamp source light effect layer. Indicates the mask in the overexposed lamp source area. This indicates the mask in the core area of ​​the overexposed light source. This indicates a mask for the halo diffusion area. This indicates the transition region mask.

[0028] Figure 1 and Figure 4 China and Israel This section summarizes the mask used to represent the overexposed light source area; in specific implementation, It can be further refined into a mask for the core area of ​​the overexposed light source. Halo diffusion area mask and transition region mask , or by , and Weighted generation.

[0029] During the codebook pre-training phase, a high-quality normal brightness image is input. The latent features are obtained by feeding them into a shared high-quality encoding embedding layer and a Mamba multi-scale encoder, and then undergoing downsampling and multi-level encoding. The latent feature expression is: ; in, Indicates a high-quality image encoder. Represents the latent features of a high-quality image; The latent features are fed into the codebook quantization module for vector quantization, resulting in... The discrete visual codebook, composed of 10 codewords, is expressed as: ; in, Represents a discrete visual codebook. Indicates the first Each code character Represents the real number field. Represents codeword dimension, Indicates the number of codewords; The quantized latent features are then reconstructed through a decoding stage and an upsampling layer to obtain a high-quality reconstructed image, the expression of which is: ; in, Indicates decoder, This indicates codebook quantization mapping. Indicates high-quality images The reconstructed image obtained after encoding, quantization, and decoding; Each codeword is used to characterize common brightness distributions, structural contours, color relationships, or texture detail patterns in high-quality images; the quantized features are used to reconstruct high-quality images through the decoding stage and upsampling, and the codebook parameters are updated through reconstruction loss, perceptual loss, and codebook constraint loss; after the codebook pre-training is completed, the shared codebook is fixed or partially fixed and serves as a structured prior for the nighttime traffic image enhancement stage. To mitigate the distribution discrepancy between high-quality normal-brightness image features and nighttime low-light degradation features, this embodiment introduces a learnable offset into the pre-trained discrete visual codebook during the nighttime traffic image enhancement stage to obtain a low-light adaptive codebook; for the... Each codeword has an adaptive form expression as follows: ; in, Indicates low-light adaptive codeword, Indicates the first The learnable codeword offset corresponding to each codeword Indicates the offset strength coefficient; The codeword offset regular expression is: ; in, This represents the codeword offset regularization loss. The offset regularization coefficient is used to control the strength of the codeword offset constraint. Indicates the number of codewords. Indicates the first The learnable codeword offset corresponding to each codeword This represents the squared L2 norm, used to measure the offset of the codeword relative to the original codeword.

[0030] During the nighttime traffic image enhancement phase, the nighttime traffic images to be enhanced First, shallow features are extracted through a convolutional embedding layer, and then multi-scale deep features are obtained through a downsampling layer and multiple encoder blocks. ,in This represents the network hierarchy; multi-scale deep features are simultaneously fed into the codebook to guide the state space modeling branch, the wavelet frequency domain enhancement branch, and the overexposure light source layer estimation branch.

[0031] like Figure 2 The codebook quantization module shown first predicts the codebook index based on the depth features of nighttime traffic images, and then searches for the high-quality visual prototype that best matches the current degradation features from the low-light adaptive codebook; for the first... The first in the layer Feature vectors of spatial locations The nearest neighbor quantization process is expressed as follows: ; ; in, This represents the codeword number that is closest to the current degradation feature. This represents a high-quality visual prototype obtained through codebook lookup or quantization mapping. To avoid incorrect referencing of high-quality bright texture prototypes in overexposed light source areas, this embodiment generates a codebook confidence map based on the codebook matching distance and the overexposed light source mask. The expression is: ; use Adjust the injection intensity of high-quality visual prototypes into subsequent modules; Through the above method, the unstable features under the combined effect of low light and overexposed light sources are mapped to a high-quality visual prototype space, while the erroneous prototype injection in the core and halo region of the overexposed light source is suppressed.

[0032] like Figure 3 As shown above, the Mamba state space branch includes a selective scan unit and a state space model unit. The selective scan unit is used to convert the deep features of the current layer into sequential features according to at least one spatial direction, and the state space model unit is used to model the long-distance dependencies of the sequential features. The continuous form expression of the state space model is: ; ; in, This represents the sequence input features obtained by transforming the deep features of the current layer. Indicates a hidden state. Represents the rate of change of the hidden state. Indicates the output response characteristics. , , Each represents a learnable parameter matrix; No. The structural spatial characteristic expression of a layer is: ; in, This represents a state-space modeling operator based on selective scanning. Indicates the first Layer codebook prototype characteristics. Indicates the first Layer codebook credibility graph; Compared to ordinary convolution, Mamba state-space modeling can propagate global context information with lower computational complexity, making the exposure and color relationships between different regions more consistent, and suppressing the impact of local noise anomalies on the global brightness distribution.

[0033] like Figure 4 As shown, the overexposed light source layer estimation branch is used to separate the overexposed light source luminous effect layer formed by vehicle lights, streetlights, traffic lights, reflective signs, or road surface reflections from the nighttime traffic image to be enhanced; specifically, the nighttime traffic image to be enhanced is represented as a combination of a reflective structure layer, an illumination layer, and an overexposed light source luminous effect layer, expressed as: ; in, This indicates nighttime traffic images that need improvement. Indicates the reflective structure layer. Indicates the lighting layer. This refers to the overexposed light source effect layer formed by vehicle lights, streetlights, traffic lights, or other strong light sources. This represents element-wise multiplication; To enable the overexposed light source effect layer to distinguish between strong light cores, halo diffusion, and normal traffic structures, the estimation branch of the overexposed light source layer first extracts brightness priors, color saturation responses, local contrast responses, and gradient diffusion responses from the input image. The bright core response, colored strong light response, local contrast response, and halo boundary response are used to characterize the location of the strong light core, the colored light source region, local brightness changes, and the halo boundary formed by the diffusion of strong light into the surrounding dark areas in the nighttime traffic image, respectively. After concatenating the bright core response, colored strong light response, local contrast response, and halo boundary response with the shallow convolutional features, the results are input into a multi-scale dilated convolutional estimation unit to obtain the overexposed light source effect layer. Among them, brightness prior is used to locate the bright core, color saturation response is used to identify the colored strong light corresponding to headlights, brake lights and traffic lights, local contrast response is used to distinguish overexposure halo from traffic signs, license plates or road edges, and gradient diffusion response is used to characterize the halo boundary formed by the diffusion of strong light source into the surrounding dark area. Figure 4 The decomposition module can include internal processing units such as the aforementioned luminance prior extraction, color saturation response, local contrast extraction, and gradient diffusion response. These internal processing units... Figure 4The term "decomposition module" is used to summarize this; a mask for the core area of ​​the overexposed light source is generated based on the overexposed light source light effect layer. Halo diffusion area mask and transition region mask The expression is: ; ; ; in, Indicates gradient diffusion response, , Represents the convolution mapping function, This represents the Sigmoid activation function. This indicates that the input value will be restricted to a certain range. The cutoff function within the interval; three masks are used to indicate the areas in the image that need light source suppression, halo suppression, and boundary smoothing transition, so that the model avoids further magnifying the areas of car lights, street lights, or traffic lights when enhancing the brightness of dark areas.

[0034] Figure 4 As shown This is a general representation of the mask used for the overexposed light source area. In specific implementation, it can be determined by... , and It is composed of three elements together, or obtained by weighted fusion of the three.

[0035] like Figure 3 As shown below, the wavelet frequency domain enhancement branch is used to explicitly separate low-frequency illumination information and high-frequency texture information; For the Discrete wavelet transform is performed on the deep layer features to obtain the low-frequency illumination component and the high-frequency texture components in the horizontal, vertical, and diagonal directions, expressed as: ; in, This represents the overall brightness distribution and large-scale structure. , , It represents edges, textures, and details in different directions; it performs Mamba context modeling on low-frequency lighting components to correct overall exposure; and it performs directional convolution processing on high-frequency texture components to enhance road edges, vehicle outlines, traffic signs, and scene textures, while suppressing noise interference.

[0036] Furthermore, this embodiment is based on , and Selectively adjust the intensity of high-frequency texture compensation in different regions: increase the weight of high-frequency texture compensation in non-overexposed dark areas, decrease the weight of high-frequency texture compensation in halo diffusion areas, and shield or reduce high-frequency texture compensation in overexposed light source core areas to avoid enhancing light source halo, glare edges or color overflow into texture details.

[0037] Perform inverse discrete wavelet transform on the processed low-frequency illumination component and high-frequency texture component to obtain the frequency domain enhancement feature, expressed as: ; in, This represents the low-frequency lighting components after low-frequency lighting modeling. , , These represent the high-frequency texture components in the horizontal, vertical, and diagonal directions after region-selective compensation. This represents the inverse discrete wavelet transform.

[0038] The overexposed light source suppression branch generates light source suppression features based on depth features, the overexposed light source luminous effect layer, and the mask of the overexposed light source region. The expression is as follows: ; in, Indicates the first Overexposure lamp source suppression characteristics, Represents light source suppression mapping, Indicates the first Layer depth features Indicates an overexposed lamp source light effect layer. This indicates an overexposed light source area mask; this feature is used to suppress overexposed areas formed by vehicle lights, streetlights, or traffic lights, and restore the road boundaries, vehicle outlines, and background structure around the light source.

[0039] like Figure 4 As shown, the light source suppression guided fusion module will incorporate structural spatial features. Frequency characteristics Light source suppression characteristics and overexposed light source area mask Perform channel splicing and input the fusion mapping. , obtain joint features In this embodiment, the fusion mapping Internally, it includes a mask gating unit, a codebook prototype credibility modulation unit, a frequency domain compensation modulation unit, and a three-way fusion unit. This unit adaptively adjusts the fusion weights of the dark area enhancement features, light source suppression features, and transition area preservation features based on the mask of the overexposed light source region. The expression is as follows: ; in, The structural space characteristics are represented by the global state space model. The frequency characteristics are represented by the wavelet frequency domain enhancement branch. This indicates light source suppression characteristics, generated under the guidance of the overexposed lamp source luminous efficacy layer and its mask. Indicates the mask in the overexposed lamp source area. This represents the joint enhancement feature, used to maintain the continuity of road edges, vehicle outlines, and traffic signs near the light source boundary; the joint enhancement feature simultaneously incorporates the global consistency brought by codebook priors and state space models, the local detail compensation capability brought by wavelet frequency domain branching, and the region-selective suppression capability brought by overexposed light source masks.

[0040] like Figure 1 , Figure 2 and Figure 4 As shown, the joint enhancement features gradually restore the image spatial resolution through multiple decoding stages and upsampling layers. Each decoding stage may include parallel convolutional modules and residual connections or element-wise summation operations to improve reconstruction stability. The final enhanced image is obtained by adaptively fusing the dark area enhancement result and the overexposed light source suppression result based on a comprehensive overexposed light source region mask, expressed as: ; in, This represents the final enhanced image. This indicates the result of dark area enhancement. This indicates the results of suppressing overexposure lamp sources. Indicates the mask in the overexposed lamp source area; This fusion method primarily performs brightness enhancement and texture restoration in non-light source areas, while primarily performing brightness compression, halo suppression, and color restoration in overexposed light source areas; when Refined into , and hour, Figure 4 In This can be understood as a comprehensive overexposure light source area guidance map formed by the above multiple masks, and the three-way gated fusion can be used as a fusion mapping. Internal detailed implementation.

[0041] During the training process, this embodiment adopts a two-stage training strategy: the first stage is a high-quality image codebook pre-training stage, and the training objective is: ; in, This represents the total loss during the codebook pre-training phase. This indicates the loss in high-quality image reconstruction. Indicates perceived loss. Indicates codebook constraint loss. and Indicates the weighting coefficient; The second stage is the joint training stage for nighttime traffic image enhancement and overexposed light source suppression. In this stage, the pre-trained discrete visual codebook is fixed or partially fixed, and training is performed using nighttime traffic images and their corresponding normal brightness reference images. The training objective is: ; in, Indicates low light enhancement loss, This indicates the constraint loss of the overexposed lamp source layer. This indicates a loss of halo suppression. This represents the edge consistency loss. This indicates the codeword offset regular expression. , , and This represents the weighting coefficient of the corresponding loss term; The overexposed light source layer constraint loss is used to constrain the overexposed light source light effect layer to be consistent with the strong light core and halo diffusion area in the nighttime traffic image. The halo suppression loss is used to reduce the brightness diffusion of the overexposed light source area and its neighborhood in the enhanced image. The edge consistency loss is used to maintain the road edges, vehicle outlines and traffic sign structures in the non-overexposed area.

[0042] Furthermore, the expression for the low-light enhancement loss is: ; in, Indicates pixel reconstruction loss, This indicates the perceptual loss during the low-light enhancement phase. Represents the codebook constraint loss during the low-light phase. This represents the generation of adversarial constraint loss. , and Indicates the corresponding weight coefficient; With the above constraints, the model can simultaneously optimize dark area brightness recovery, overexposed light source suppression, structural consistency, and perceived quality.

[0043] In this embodiment, the image enhancement model can be deployed in road monitoring cameras, vehicle-mounted cameras, edge computing devices, autonomous driving computing platforms, mobile terminals, or servers. When a nighttime traffic image to be enhanced is received, the model generates the enhanced image according to the above steps. Since state-space modeling has linear complexity, the method is suitable for processing high-resolution nighttime traffic images. By introducing an adaptive discrete codebook, wavelet frequency domain branch, overexposed light source layer estimation branch, and light source suppression-guided fusion module, the method can simultaneously achieve dark area enhancement, overexposed light source suppression, noise control, and detail preservation under complex traffic lighting conditions.

[0044] To verify the technical effect of the present invention, this embodiment conducted experiments on datasets or subsets such as LOL-v1, LSRW-Huawei, Night-LE, and Traffic-LE. Night-LE and Traffic-LE include strong light cores and halo diffusion areas caused by vehicle lights, street lights, traffic lights, reflective signs, or road surface reflections. In addition to commonly used low-light enhancement metrics such as PSNR, SSIM, and LPIPS, this embodiment further uses the overexposure error metric OE-MAE to evaluate the brightness compression and halo suppression effects of the light source area. The lower the OE-MAE, the smaller the abnormal brightness diffusion of the overexposed light source area and its neighborhood in the enhancement result. The results are shown in Table 1. Table 1. Performance metrics of different methods on various datasets

[0045] Compared with traditional methods, zero-reference methods, unsupervised methods, and low-light enhancement methods based on Transformer or diffusion models, this invention maintains higher PSNR and SSIM on ordinary low-light enhancement datasets, and further reduces OE-MAE in strong light traffic scenes such as Night-LE and Traffic-LE. The above results show that the overexposed light source layer estimation branch and the light source suppression guided fusion module not only improve the visibility of dark areas, but also reduce halo diffusion, glare edges, and color overflow around vehicle lights, street lights, and traffic lights.

[0046] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A codebook-guided method for low-light enhancement and overexposure suppression in nighttime traffic, comprising an image enhancement model including a codebook construction branch, a codebook-guided state-space modeling branch, a wavelet frequency domain enhancement branch, an overexposure light source layer estimation branch, a light source suppression-guided fusion module, and an image reconstruction module, characterized in that, Includes the following steps: S1. Pre-train a discrete visual codebook using high-quality normal brightness images, wherein the discrete visual codebook includes high-quality visual prototypes for characterizing the structure, color, and texture of normal brightness images. S2. Input the nighttime traffic image to be enhanced into a multi-scale encoder to extract deep features; S3. Input the deep features into the codebook to guide the state space modeling branch. Obtain the high-quality visual prototype corresponding to the deep features through codebook index prediction and codebook lookup. Perform global context modeling based on the Mamba state space modeling module to obtain global enhanced features. S4. Input the nighttime traffic image to be enhanced into the overexposed light source layer estimation branch, estimate the overexposed light source luminous effect layer, and generate the overexposed light source core area mask, halo diffusion area mask and transition area mask based on the overexposed light source luminous effect layer. S5. Input the deep features into the wavelet frequency domain enhancement branch, and decompose the deep features into low-frequency lighting components and high-frequency texture components in multiple directions through discrete wavelet transform. Perform low-frequency lighting modeling and high-frequency texture compensation constrained by overexposed light source areas respectively to obtain frequency domain enhancement features. S6. Based on the global enhancement features, frequency domain enhancement features, high-quality visual prototype, overexposed light source core area mask, halo diffusion area mask and transition area mask, perform light source suppression guided fusion to obtain joint enhancement features; Reduce the injection intensity of high-quality visual prototypes and high-frequency texture compensation in the core area and halo diffusion area of ​​overexposed light sources, and increase the injection intensity of high-quality visual prototypes and high-frequency texture compensation in non-overexposed dark areas. S7. Input the joint enhancement features into the decoder and the thinning module to generate an enhanced image, expressed as: ; in, This represents the final enhanced image. This indicates the result of dark area enhancement. This indicates the results of suppressing overexposure lamp sources. Indicates the mask in the overexposed lamp source area. This represents element-wise multiplication; It enhances the brightness of dark areas while suppressing overexposed light source areas from vehicle lights, streetlights, and traffic lights.

2. The method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 1, characterized in that, The high-quality normal brightness image pre-training discrete vision codebook specifically includes the following steps: S101. Input the high-quality normal brightness image into a shared high-quality coding embedding layer and a Mamba multi-scale encoder, and obtain latent features through downsampling and multi-level coding. S102. Input the latent features into the codebook quantization module, and obtain a discrete visual codebook including K codewords through vector quantization; S103. In the low-light image enhancement stage, a learnable offset is introduced into the discrete visual codebook to obtain a low-light adaptive codebook. The low-light adaptive codebook provides stable priors for normal brightness, natural color, and structural texture in traffic images where low-light and overexposed light sources coexist.

3. The method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 2, characterized in that, The discrete visual codebook expression is: ; in, Represents a discrete visual codebook. Indicates the first Each code character Represents the real number field. Represents codeword dimension, Indicates the number of codewords; The low-light adaptive codebook expression is: ; in, Indicates low-light adaptive codeword, Indicates the first The learnable codeword offset corresponding to each codeword Indicates the offset strength coefficient; A codeword offset regularization term is introduced to constrain the magnitude of the learnable codeword offset corresponding to each codeword. The codeword offset regular expression is: ; in, This represents the codeword offset regularization loss. The offset regularization coefficient is used to control the strength of codeword offset constraints. Indicates the number of codewords. Indicates the first The learnable codeword offset corresponding to each codeword This represents the squared L2 norm, used to measure the offset of the codeword relative to the original codeword.

4. The method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 1, characterized in that, The multi-scale encoder includes a convolutional embedding layer, at least one downsampling layer, and L encoder blocks. Each encoder block includes at least one upsampling layer and L decoding stages. Each decoding stage includes a convolutional module configured in parallel, residual connections for fusing the results of the parallel convolutions, and an element-wise summation operation.

5. The method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 1, characterized in that, The Mamba state space modeling module includes a selective scanning unit and a state space model unit; the specific steps for obtaining global enhanced features using the codebook index prediction, codebook lookup, and Mamba state space are as follows: S301. Calculate the distance between the feature vector of each spatial location in the current layer's deep features and each codeword in the low-light adaptive codebook, and select the codeword with the smallest distance as the high-quality visual prototype of the spatial location. S302. Inject all the high-quality visual prototypes into the Mamba state space modeling module and the light source suppression guided fusion module by means of addition, splicing or feature modulation. S303. Generate a codebook credibility map based on the codebook matching distance and the mask of the core area of ​​the overexposed light source and the mask of the halo diffusion area, and inject a high-quality visual prototype, reducing the injection weight in the core area of ​​the overexposed light source and the halo diffusion area. S304. The scanning unit receives the current layer deep features obtained after codebook index prediction and codebook lookup processing, and expands them into sequence features according to at least one spatial direction. The state space model unit establishes a state update relationship based on sequence features and hidden states, and transmits context information between spatial locations corresponding to the deep features of the current layer through a learnable parameter matrix to obtain the global enhanced features of the current layer.

6. The method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 1, characterized in that, The overexposed light source layer estimation branch decomposes the nighttime traffic image to be enhanced into a reflection structure layer, an illumination layer, and an overexposed light source luminous effect layer, expressed as: ; in, This indicates nighttime traffic images that need improvement. Indicates the reflective structure layer. Indicates the lighting layer. Indicates an overexposed lamp source light effect layer. This represents element-wise multiplication; The overexposed light source layer estimation branch includes a brightness prior extraction unit, a color saturation response unit, a local contrast extraction unit, a gradient diffusion response unit, a multi-scale dilated convolution estimation unit, and a mask refinement unit. The brightness prior unit extracts the high-brightness core response from the night enhancement image to be enhanced; The color saturation response unit extracts the color intensity response corresponding to the vehicle headlights, brake lights, and traffic lights; The local contrast extraction unit is used to distinguish overexposure halos from traffic signs, license plates, and road edges; The gradient diffusion response unit extracts the halo boundary formed by the diffusion of a strong light source into the surrounding dark area. The high-brightness core response, color intensity response, local contrast response, and halo boundary response are used to characterize the location of the intensity core, the color light source area, the local brightness variation, and the halo boundary formed by the diffusion of intensity light into the surrounding dark area in nighttime traffic images, respectively. After channel concatenation of the high-brightness core response, color intensity response, local contrast response, and halo boundary response with shallow convolutional features, the data is input into a multi-scale dilated convolutional estimation unit to obtain the overexposed light source light effect layer. The mask refinement unit generates a mask for the core area of ​​the overexposed light source based on the light effect layer of the overexposed light source. Halo diffusion area mask and transition region mask The expression is: ; ; ; in, Indicates gradient diffusion response, , Represents the convolution mapping function, This represents the Sigmoid activation function. This indicates that the input value will be restricted to a certain range. A cutoff function within an interval.

7. A method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 6, characterized in that, Step S5, generating frequency domain enhancement features, specifically includes the following steps: S501, The wavelet frequency domain enhancement branch generates low-frequency illumination components and high-frequency texture components in the horizontal, vertical and diagonal directions by performing discrete wavelet transform on the deep features of the current layer; S502. Perform Mamba context modeling on the low-frequency lighting components to correct the overall brightness distribution, and perform directional convolution processing on the high-frequency texture components to recover road edges, vehicle outlines, traffic signs, and scene textures. S503. Perform region-selective compensation for high-frequency texture components based on the overexposed light source core area mask, halo diffusion area mask, and transition area mask. In non-overexposed dark areas, the weight of high-frequency texture compensation is increased, while in halo diffusion areas, the weight of high-frequency texture compensation is decreased. In overexposed light source core areas, high-frequency texture compensation is shielded or reduced to avoid enhancing light source halo, glare edges, or color overflow into texture details. Then, frequency domain enhancement features are reconstructed through inverse discrete wavelet transform.

8. A method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 7, characterized in that, The light source suppression and fusion module includes a mask gating unit, a codebook prototype credibility modulation unit, a frequency domain compensation modulation unit, and a three-way fusion unit. The masking unit generates dark area enhancement weights, light source suppression weights, and transition area retention weights based on the mask of the overexposed light source core area, the mask of the halo diffusion area, and the mask of the transition area. The codebook prototype credibility modulation unit generates a codebook credibility map based on the codebook matching distance and the mask of the overexposed light source area, and reduces the injection weight of the high-quality visual prototype in the core area and halo diffusion area of ​​the overexposed light source, and increases the injection weight of the high-quality visual prototype in the non-overexposed dark area. The frequency domain supplementary modulation unit adjusts the injection intensity of the frequency domain enhancement feature according to the mask of the overexposed lamp source region; The three-way fusion unit fuses the dark area enhancement feature, the light source suppression feature, and the transition area preservation feature pixel by pixel according to normalized weights; The input-output relationship expression of the light source suppression-guided fusion module is as follows: ; in, Represents the spatial characteristics of the structure. Indicates frequency characteristics, Indicates light source suppression characteristics, Indicates the mask in the overexposed lamp source area. This indicates a joint enhancement feature.

9. A method for enhancing low light and suppressing overexposure in nighttime traffic based on codebook guidance according to claim 1, characterized in that, When training the image enhancement model, a loss function is constructed, including: reconstruction loss, perceptual loss, codebook offset regularization loss, overexposed light source layer constraint loss, halo suppression loss, and edge consistency loss; The overexposed light source layer constraint loss is used to constrain the overexposed light source light effect layer to be consistent with the strong light core and halo diffusion area in the nighttime traffic image to be enhanced. The halo suppression loss reduces the brightness diffusion of the overexposed light source area and its neighborhood in the enhanced image; The edge consistency loss preserves road edges, vehicle outlines, and traffic sign structures in non-overexposed areas.

Citation Information

Patent Citations

  • Image glare removing method based on codebook prior and double-domain alignment

    CN119941564A

  • Low-light image enhancement method combining state space model and wavelet transform

    CN121258858A