A low-light image defogging method and device

By training a two-color feature fusion dehazing network model in a low-light environment, the RGB and HSV features of the image are obtained and fused, which solves the problem of color imbalance in image dehazing under low-light conditions and improves the quality and reality of the dehazing effect. sex.

CN119151809BActive Publication Date: 2025-01-17WUHAN TEXTILE UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411630164.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-01-17
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

In low-light environments, existing image defog removal methods are difficult to effectively correct the color shift, resulting in color imbalance in the processed image.

Method used

By collecting a subset of image data in foggy and fog-free environments, a two-color feature fusion dehazing network model is trained to obtain the RGB and HSV color space features of the input image, and dehazing and reconstruction is performed through the fused feature map.

Benefits of technology

It improves the color authenticity of the image after dehazing, effectively improves the image dehazing ability in low-light environments, and improves the image quality after dehazing and reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151809B_ABST
    Figure CN119151809B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for defogging highway images in a low-light environment, and relates to the field of image processing technology. The method includes: obtaining a first image data subset in a foggy environment and a second image data subset in a fog-free environment; using the first image data subset and the second image data subset as a real-time image production data set, and training a two-color feature fusion defogging network model based on the real-time image production data set; obtaining RGB color space features and HSV color space features in the input image; obtaining a fusion feature map corresponding to the input image based on the RGB color space features and the HSV color space features through the two-color feature fusion defogging network model; and defogging and reconstructing the input image based on the fusion feature map. The present application solves the problem that when facing specific challenges under low-light conditions, existing defogging methods often cannot effectively correct color deviation, resulting in the problem that the processed defogging image still has color imbalance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for defogging low-light images. Background Art

[0002] In the field of image and video processing, foggy conditions often lead to a serious degradation of the quality of visual information in the acquired images, especially in low-light environments, such as at night, in the evening or in the early morning on highways. Fog reduces the contrast and color saturation of the image, blurring the details of the object, which seriously affects the accuracy and reliability of traffic monitoring applications on highways.

[0003] Under low-light conditions, the uneven distribution of overall illumination and the color interference of artificial light sources make the defogging task more challenging and complex. Early defogging methods directly migrated the defogging methods under conventional conditions to low-light scenes, but such methods could not adapt to low-light foggy scenes, resulting in residual fog and loss of details in defogging images. Later, some specific prior assumptions or physical models for low-light scenes were proposed, such as atmospheric scattering models, which restored images by estimating global atmospheric light and adjusting parameters such as transmittance. However, such methods based on prior assumptions and physical models are not effective in dealing with color cast problems caused by non-uniform illumination and multiple light sources, so they will produce image halos and artifacts when used in actual scenes. With the development of deep learning technology, many methods use convolutional neural networks and attention mechanisms to predict atmospheric model parameters or clear images, but for specific challenges at night or under low-light conditions, such as color interference and uneven illumination distribution under non-single light sources, existing methods often cannot effectively correct color casts, resulting in color imbalance in processed images.

[0004] Therefore, there is an urgent need for a low-light image defogging method and device. Summary of the invention

[0005] The present application provides a low-light image defogging method and device, which solves the specific challenges under nighttime or low-light conditions. Existing methods often cannot effectively correct color cast, resulting in color imbalance in the processed image.

[0006] In a first aspect of the present application, a low-light image defogging method is provided, the method comprising: in a first environment, collecting a first image data subset through a highway road monitoring camera, the first environment is a foggy environment; in a second environment, collecting a second image data subset through a highway road monitoring camera, the second environment is a fog-free environment, and the first environment and the second environment are in the same time period; using the first image data subset and the second image data subset as a real-time image production data set, and training a two-color feature fusion defogging network model based on the real-time image production data set; obtaining corresponding RGB color space features and HSV color space features in an input image through the two-color feature fusion defogging network model; obtaining a fusion feature map corresponding to the input image according to the RGB color space features and the HSV color space features through the two-color feature fusion defogging network model; defogging and reconstructing the input image according to the fusion feature map to obtain a first output image corresponding to the input image, the first output image being a defogged image.

[0007] Optionally, the corresponding RGB color space features and HSV color space features in the input image are obtained, specifically including: constructing an RGB color space feature extraction structure, the RGB color space feature extraction structure includes 3×3 Convolution structure and multiple RGB feature extraction structures, multiple RGB feature extraction structures are operated in series; multiple RGB color space feature maps corresponding to the input image are obtained according to the RGB color space feature extraction structure, and the RGB color space feature map includes RGB color space features; HSV color space feature extraction structure is constructed, and the HSV color space feature extraction structure includes 3×3 A convolution structure and a plurality of HSV feature extraction structures; obtaining a plurality of HSV color space feature maps corresponding to the input image according to the HSV color space feature extraction structure, wherein the HSV color space feature map includes HSV color space features.

[0008] Optionally, obtaining a fused feature map corresponding to the input image according to the RGB color space features and the HSV color space features specifically includes: performing cross-space feature fusion on multiple RGB color space feature maps and multiple HSV feature extraction structures in a preset process sequence, and obtaining a first fused feature map and a second fused feature map corresponding to the input image according to the following formula:

[0009] ;

[0010] in, is the first fusion feature map, is the second fusion feature map, ~ are the fusion weight coefficients corresponding to multiple HSV feature extraction structures, ε is the protection parameter, which is used to avoid the denominator being 0. One HSV feature extraction structure corresponds to one fusion weight coefficient. To change the image size, is a convolution structure, , , are multiple RGB color space feature maps, are multiple HSV color space feature maps, , , The fused feature map is obtained by fusing multiple RGB color space feature maps and multiple HSV color space feature maps in different ways, and is calculated by the following formula:

[0011] ;

[0012] An inverted residual structure and an expanded residual structure are obtained, the first fused feature map is input into the inverted residual structure to obtain a third fused feature map, and the second fused feature map is input into the expanded residual structure to obtain a fourth fused feature map; the third fused feature map and the fourth fused feature map are fused according to the following formula to obtain a fifth fused feature map:

[0013] ;

[0014] in, is the fifth fusion feature map, is the inverted residual structure, is the dilated residual structure, is a fusion process; obtaining a reconstruction unit structure, the reconstruction unit structure is used to restore contrast; inputting the fifth fusion feature map into the reconstruction unit structure to obtain a sixth fusion feature map, and using the sixth fusion feature map as the fusion feature map corresponding to the input image.

[0015] Optionally, the first fused feature map is input into the inverted residual structure to obtain a third fused feature map, specifically including: performing normalization processing and activation function processing on the first fused feature map through the inverted residual structure to generate a first intermediate feature map corresponding to the first fused feature map; constructing a similarity weight matrix corresponding to the intermediate feature map, and obtaining a second intermediate feature map according to the similarity weight matrix; and fusing the first intermediate feature map and the second intermediate feature map according to the following formula to obtain a third fused feature map:

[0016] ;

[0017] in, is the third fusion feature map, It is a 1×1 convolution structure. is the activation function, is the first intermediate feature map, is the second intermediate feature map; the second intermediate feature map can be obtained by the following formula:

[0018] ;

[0019] in, is the similarity weight matrix, is the similarity between the pixel at position i and the pixel at position j in the first intermediate feature map, To perform weighted summation on the feature map vector of the first intermediate feature map, is element-wise multiplication.

[0020] Optionally, the second fused feature map is input into the dilated residual structure to obtain a fourth fused feature map, specifically including: performing dilated convolution processing on the second fused feature map according to different dilation rates through the dilated residual structure to obtain multiple extended feature maps corresponding to the second fused feature map; fusing the multiple extended feature maps to obtain a third intermediate feature map; performing weighted processing on the third intermediate feature map through the CA attention mechanism to obtain a fourth intermediate feature map; and fusing the second fused feature map with the fourth intermediate feature map to obtain a fourth fused feature map.

[0021] Optionally, dehazing and reconstructing the input image is performed according to the fused feature map, specifically including: performing pixel attention processing and channel number adjustment processing on the fused feature map to obtain a first output image corresponding to the input image.

[0022] Optionally, after defogging and reconstructing the input image according to the fused feature map to obtain a first output image corresponding to the input image, the method further includes: obtaining a loss function corresponding to the two-color feature fusion defogging network model, and the loss function is obtained by the following formula:

[0023] ;

[0024] in, is the loss function, is the weight coefficient of the SmoothL1 loss function, is the structural similarity index weight coefficient between the first output image and the true haze-free image, x is the first output image, y is the true haze-free image, and the true haze-free image is any image in the second image data subset, is the mean pixel value in the first output image, is the pixel mean in the real fog-free image, is the standard deviation of pixels in the first output image, is the pixel standard deviation in the real fog-free image, is the covariance, and is a preset constant; whether the loss function is less than or equal to the preset function threshold; if the loss function is less than or equal to the preset function threshold, the parameter adjustment operation is performed on the two-color feature fusion dehazing network model, and the second output image corresponding to the input image is obtained through the two-color feature fusion dehazing network model after the parameter adjustment; the loss function corresponding to the two-color feature fusion dehazing network model is recalculated through the second output image, and it is determined whether the recalculated loss function is greater than the preset function threshold; if the recalculated loss function is greater than the preset function threshold, it is determined that the second output image meets the dehazing reconstruction requirements, and the parameter adjustment operation is completed.

[0025] In a second aspect of the present application, a low-light image defogging device is provided, the device comprising a defogging model building module, a fusion feature map building module and a defogging reconstruction module, wherein:

[0026] The defogging model building module is used to collect a first image data subset through a highway road monitoring camera in a first environment, and the first environment is a foggy environment; collect a second image data subset through a highway road monitoring camera in a second environment, and the second environment is a fog-free environment, and the first environment and the second environment are in the same time period; use the first image data subset and the second image data subset as real-time image production data sets, and train a two-color feature fusion defogging network model based on the real-time image production data sets.

[0027] The fusion feature map construction module is used to obtain the corresponding RGB color space features and HSV color space features in the input image through the two-color feature fusion dehazing network model; through the two-color feature fusion dehazing network model, the fusion feature map corresponding to the input image is obtained according to the RGB color space features and the HSV color space features.

[0028] The defogging and reconstruction module is used to perform defogging and reconstruction on the input image according to the fused feature map to obtain a first output image corresponding to the input image, and the first output image is the defogged image.

[0029] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.

[0030] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to perform any of the above methods.

[0031] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0032] 1. The present application obtains pictures in foggy and fog-free environments as training data sets respectively to train a two-color feature fusion defogging network model, and obtains the corresponding RGB color space features and HSV color space features in the input image through the two-color feature fusion defogging network model, thereby reducing the color imbalance problem that may occur after image defogging through the two-color feature fusion defogging network model, and obtains the fusion feature map corresponding to the input image through the RGB color space features and the HSV color space features, and defogs and reconstructs the input image according to the fusion feature map to obtain the first output image corresponding to the input image, thereby improving the authenticity of the image color, effectively improving the image defogging capability in low light environments, and improving the quality of the image after defogging and reconstruction.

[0033] 2. By introducing the loss function and adding the SmoothL1 loss function to the loss function design, it combines the advantages of L1 loss and L2 loss. When the error is small, it can show the characteristic of L2 loss being more sensitive to small errors, and when the error is large, it can show the characteristic of L1 loss being more robust to large errors, thereby better evaluating the similarity between the dehazed image and the clear image. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a flowchart of a low-light image defogging method provided in an embodiment of the present application;

[0035] Figure 2 It is a schematic diagram of an inverted residual structure processing flow provided by an embodiment of the present application;

[0036] Figure 3 It is a schematic diagram of a dilated residual structure processing flow provided in an embodiment of the present application;

[0037] Figure 4 This is a schematic diagram of a dual-thread cross-space feature fusion process provided by an embodiment of the present application;

[0038] Figure 5 This is a schematic diagram of a defogging image acquisition process provided by an embodiment of the present application;

[0039] Figure 6 is a module schematic diagram of a low-light image defogging device provided in an embodiment of the present application;

[0040] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0041] Explanation of the accompanying drawings: 61, dehazing model construction module; 62, fusion feature map construction module; 63, dehazing reconstruction module; 701, processor; 702, communication bus; 703, user interface; 704, network interface; 705, memory. DETAILED DESCRIPTION

[0042] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0043] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0044] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0045] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0046] Under low-light conditions, the uneven distribution of overall illumination and the color interference of artificial light sources make the defogging task more challenging and complex. Early defogging methods directly migrated the defogging methods under conventional conditions to low-light scenes, but such methods could not adapt to low-light foggy scenes, resulting in residual fog and loss of details in defogging images. Later, some specific prior assumptions or physical models for low-light scenes were proposed, such as atmospheric scattering models, which restored images by estimating global atmospheric light and adjusting parameters such as transmittance. However, such methods based on prior assumptions and physical models are not effective in dealing with color cast problems caused by non-uniform illumination and multiple light sources, so they will produce image halos and artifacts when used in actual scenes. With the development of deep learning technology, many methods use convolutional neural networks and attention mechanisms to predict atmospheric model parameters or clear images, but for specific challenges at night or under low-light conditions, such as color interference and uneven illumination distribution under non-single light sources, existing methods often cannot effectively correct color casts, resulting in color imbalance in processed images.

[0047] Therefore, there is an urgent need for a low-light image defogging method and device.

[0048] Please refer to Figure 1 , which shows a flow chart of a low-light image defogging method provided in an embodiment of the present application. The method is applied to a server. The flow chart mainly includes the following steps: S101 to S105.

[0049] Step S101, in a first environment, a first subset of image data is collected by a highway road monitoring camera, and the first environment is a foggy environment; in a second environment, a second subset of image data is collected by a highway road monitoring camera, and the second environment is a fog-free environment, and the first environment and the second environment are in the same time period.

[0050] Specifically, in an environment with sufficient light, the acquisition time is divided into two conditions: foggy and fog-free. When fog appears on the highway, which is the first environment, the monitoring camera will capture and record these fog images and their acquisition time, and use all the acquired images as the first image data subset. Subsequently, the system will synchronously acquire images in a fog-free environment, which is the second environment. In this environment, the acquisition time must be consistent with the acquisition time of the previous first image data subset, so that a set of comparison images containing foggy and fog-free conditions in a well-lit environment can be obtained. Similarly, when the environment enters low-light conditions, the monitoring camera will switch to night vision mode and use the same method to acquire foggy and fog-free images in low-light environments.

[0051] For example, on November 5th, it was foggy, and foggy images were collected at 8 am. At this time, 8 am on November 5th was the first environment, and the collected foggy images were used as the first image data subset. On November 7th, there was no fog on this day, and images were collected at 8 am to maintain synchronization. Then 8 am on the 7th was the second environment, and the real fog-free images were collected as the second image data subset.

[0052] Step S102: Use the first image data subset and the second image data subset as a real-time image production data set, and train a two-color feature fusion defogging network model based on the real-time image production data set.

[0053] Specifically, a first image data subset and a second image data subset taken respectively in a first environment and a second environment are used as a real-time image production data set, and a two-color feature fusion defogging network model is trained according to the real-time image production data set.

[0054] Step S103, obtaining the corresponding RGB color space features and HSV color space features in the input image through the two-color feature fusion dehazing network model.

[0055] Specifically, the corresponding RGB color space features and HSV color space features in the input image are obtained through the two-color feature fusion dehazing network model, wherein the input image is a foggy image to be processed.

[0056] In a possible implementation, step S103 further includes: constructing an RGB color space feature extraction structure, where the RGB color space feature extraction structure includes 3×3 Convolution structure and multiple RGB feature extraction structures, multiple RGB feature extraction structures are operated in series; multiple RGB color space feature maps corresponding to the input image are obtained according to the RGB color space feature extraction structure, and the RGB color space feature map includes RGB color space features; HSV color space feature extraction structure is constructed, and the HSV color space feature extraction structure includes 3×3 A convolution structure and a plurality of HSV feature extraction structures; obtaining a plurality of HSV color space feature maps corresponding to the input image according to the HSV color space feature extraction structure, wherein the HSV color space feature map includes HSV color space features.

[0057] Specifically, the dual-color feature fusion dehazing network model includes an RGB color space feature extraction structure and an HSV color space feature extraction structure. The RGB color space feature extraction structure is used to extract multiple RGB color space feature maps corresponding to the input image, wherein the RGB color space feature map includes the RGB color space features corresponding to the input image, and the HSV color space feature map includes the HSV color space features corresponding to the input image. The RGB color space feature extraction structure and the HSV color space feature extraction structure can be trained and constructed by making a data set of real-time images. For the RGB color space feature extraction structure, a 3×3 The convolution structure and two RGB feature extraction structures are constructed, where the RGB feature extraction structures are run in series. Each RGB feature extraction structure can be constructed by a 3×3 Convolution, 1 ReLU activation function, and 1 5×5 For the HSV color space feature extraction structure, it can be constructed by 1, 1 3×3 The convolution structure and three HSV feature extraction structures are constructed, where the HSV conversion module is used to convert the input image color space from RGB to HSV. The three HSV feature extraction structures are the first HSV feature extraction structure, the second HSV feature extraction structure and the third HSV feature extraction structure. Each HSV feature extraction structure is operated in series. The first HSV feature extraction structure can be obtained by a 7×7 Large kernel convolution, 1 ReLU activation function and 1 5×5 The second HSV feature extraction structure can be constructed by a 5×5 Convolution, 1 ReLU activation function, and 1 3×3 Convolution is used to construct the third HSV feature extraction structure. Convolution, 1 ReLU activation function and 1 1×1 Convolution is used to build.

[0058] Step S104, using a two-color feature fusion dehazing network model, a fusion feature map corresponding to the input image is obtained according to the RGB color space features and the HSV color space features.

[0059] Specifically, the two-color feature fusion dehazing network model fuses multiple RGB color space feature maps and multiple HSV color space feature maps through the RGB color space feature extraction structure and the HSV color space feature extraction structure to obtain a fused feature map corresponding to the input image.

[0060] In a possible implementation, step S104 further includes: performing cross-space feature fusion on multiple RGB color space feature maps and multiple HSV feature extraction structures according to a preset process sequence, and obtaining a first fused feature map and a second fused feature map corresponding to the input image according to the following formula:

[0061] ;

[0062] in, is the first fusion feature map, is the second fusion feature map, ~ are the fusion weight coefficients corresponding to multiple HSV feature extraction structures, ε is the protection parameter, which is used to avoid the denominator being 0. One HSV feature extraction structure corresponds to one fusion weight coefficient. To change the image size, is a convolution structure, , , are multiple RGB color space feature maps, are multiple HSV color space feature maps, , , The fused feature map is obtained by fusing multiple RGB color space feature maps and multiple HSV color space feature maps in different ways, and is calculated by the following formula:

[0063] ;

[0064] An inverted residual structure and an expanded residual structure are obtained, the first fused feature map is input into the inverted residual structure to obtain a third fused feature map, and the second fused feature map is input into the expanded residual structure to obtain a fourth fused feature map; the third fused feature map and the fourth fused feature map are fused according to the following formula to obtain a fifth fused feature map:

[0065] ;

[0066] in, is the fifth fusion feature map, is the inverted residual structure, is the expansion residual structure, Concat is the fusion process; obtain the reconstruction unit structure, and the reconstruction unit structure is used to restore the contrast; input the fifth fusion feature map into the reconstruction unit structure to obtain the sixth fusion feature map, and use the sixth fusion feature map as the fusion feature map corresponding to the input image.

[0067] Specifically, the dual-color feature fusion dehazing network model performs cross-space feature fusion on multiple RGB color space feature maps and multiple HSV feature extraction structures in a preset process sequence. The processing flow consists of two processing flows. The preset process sequence of the processing flow is as follows: For the first process, which is the RGB color space processing flow, the input image is processed by 3×3 The obtained feature map is , After the first RGB feature extraction structure, the feature map is obtained , , And the feature map H1 output by the first HSV feature extraction structure is fused to obtain the feature map , After the second RGB feature extraction structure, the feature map is obtained ; , , , and the feature map output by the second HSV feature extraction structure Fusion is performed to obtain the first fusion feature map ; For the second process, which is the HSV color space processing process, the input image is converted from the RGB color space image to the HSV color space image after passing through the HSV conversion module, and then passes through a 3×3 Convolution operation obtains feature map , After the first HSV feature extraction structure, the feature map is obtained , , as well as Fusion, get , After the second HSV feature extraction structure, the feature map is obtained , , as well as Fusion, get ; After the third HSV feature extraction structure, the feature map is obtained , , as well as Perform feature fusion to obtain the second fusion feature map ; Afterwards, an inverted residual structure and an expanded residual structure are obtained, and the first fused feature map is input into the inverted residual structure to obtain a third fused feature map. The specific steps are as follows: the first fused feature map is normalized and activated by the inverted residual structure to generate a first intermediate feature map corresponding to the first fused feature map; a similarity weight matrix corresponding to the intermediate feature map is constructed, and a second intermediate feature map is obtained according to the similarity weight matrix; the first intermediate feature map and the second intermediate feature map are fused according to the following formula to obtain a third fused feature map:

[0068] ;

[0069] in, is the third fusion feature map, It is a 1×1 convolution structure. is the activation function, is the first intermediate feature map, is the second intermediate feature map; the second intermediate feature map can be obtained by the following formula:

[0070] ;

[0071] in, is the similarity weight matrix, is the similarity between the pixel at position i and the pixel at position j in the first intermediate feature map, To perform weighted summation on the feature map vector of the first intermediate feature map, For element-by-element multiplication, see Figure 2 , which shows a schematic diagram of an inverted residual structure processing flow provided in an embodiment of the present application; the second fused feature map is input into the dilated residual structure to obtain a fourth fused feature map, and the specific steps are as follows: the second fused feature map is subjected to dilated convolution processing according to different dilation rates through the dilated residual structure to obtain a plurality of extended feature maps corresponding to the second fused feature map, wherein the plurality of extended feature maps are respectively , , , and the corresponding different expansion rates are , =1,2,3; fuse multiple extended feature maps to obtain a third intermediate feature map; perform weighted processing on the third intermediate feature map through the CA attention mechanism to obtain a fourth intermediate feature map; fuse the second fused feature map with the fourth intermediate feature map, and obtain the fourth fused feature map according to the following formula:

[0072] ;

[0073] ;

[0074] ;

[0075] in, is the fourth fusion feature map, is the fourth intermediate feature map, CA is the weight generated by the CA attention mechanism, For the fusion process, For the For extended feature maps, please refer to Figure 3 , which shows a schematic diagram of a dilated residual structure processing flow provided in an embodiment of the present application. Then, the third fused feature map and the fourth fused feature map are fused to obtain a fifth fused feature map , obtain a reconstruction unit structure, the reconstruction unit structure is used to restore contrast; input the fifth fusion feature map into the reconstruction unit structure to obtain a sixth fusion feature map, and use the sixth fusion feature map as the fusion feature map corresponding to the input image. The specific steps are as follows: First, the feature map is obtained by the first reconstruction unit. ,Then After the second reconstruction unit, the feature map is obtained ,at last and Perform a fusion to get the feature map , That is the sixth fused feature map, where the specific structure of the first reconstruction unit is two 3×3 convolutional layers running in series. After the first 3×3 convolutional layer processes the input feature map, the second 3×3 convolutional layer further processes the feature map. The constructed reconstruction unit uses continuous 3×3 small convolution kernels to effectively capture the subtle structures and patterns in the image, capture and reconstruct local detail features, and both convolutional layers use the ReLU activation function; the specific structure of the second reconstruction unit is a 3×3 convolutional layer and a 5×5 convolutional layer running in series. The first 3×3 convolutional layer processes the output feature map from the first reconstruction unit to capture the subtle structure. After that, the second 5×5 convolutional layer further processes the feature map to capture a wider range of contextual information, understand the structure in a larger range, and restore the details and contrast of the image. Both convolutional layers use the ReLU activation function. Please refer to Figure 4 , which shows a schematic diagram of a dual-thread cross-space feature fusion process provided in an embodiment of the present application.

[0076] Step S105, defogging and reconstructing the input image according to the fused feature map to obtain a first output image corresponding to the input image, where the first output image is a defogged image.

[0077] Specifically, the fused feature map is processed with pixel attention to improve the feature expression ability, and then goes through the first reconstruction unit and a 1×1 The convolution structure adjusts the number of channels to obtain the first output image corresponding to the input image. Please refer to Figure 5 , which shows a schematic diagram of a defogging image acquisition process provided in an embodiment of the present application.

[0078] In a possible implementation, step S105 further includes: after defogging and reconstructing the input image according to the fused feature map to obtain a first output image corresponding to the input image, the method further includes: obtaining a loss function corresponding to the two-color feature fusion defogging network model, and the loss function is obtained by the following formula:

[0079] ;

[0080] in, is the loss function, is the weight coefficient of the SmoothL1 loss function, is the structural similarity index weight coefficient between the first output image and the true haze-free image, x is the first output image, y is the true haze-free image, and the true haze-free image is any image in the second image data subset, is the mean pixel value in the first output image, is the pixel mean in the real fog-free image, is the standard deviation of pixels in the first output image, is the pixel standard deviation in the real fog-free image, is the covariance, and is a preset constant; whether the loss function is less than or equal to the preset function threshold; if the loss function is less than or equal to the preset function threshold, the parameter adjustment operation is performed on the two-color feature fusion dehazing network model, and the second output image corresponding to the input image is obtained through the two-color feature fusion dehazing network model after the parameter adjustment; the loss function corresponding to the two-color feature fusion dehazing network model is recalculated through the second output image, and it is determined whether the recalculated loss function is greater than the preset function threshold; if the recalculated loss function is greater than the preset function threshold, it is determined that the second output image meets the dehazing reconstruction requirements, and the parameter adjustment operation is completed.

[0081] Specifically, the loss function design of the two-color feature fusion defogging network model adds the SmoothL1 loss function to the loss function design, which combines the advantages of L1 loss and L2 loss. When the error is small, the L2 loss is more sensitive to small errors, and when the error is large, the L1 loss is more robust to large errors. And considering the three dimensions of brightness, contrast and structure, it can better evaluate the similarity between the defogging image and the clear image, so as to obtain a restoration result that is more in line with human visual habits. The first output image is evaluated by the loss function, and it is judged whether the defogging output image can meet expectations. If the defogging output image cannot meet expectations, the parameters of the two-color feature fusion defogging network model are adjusted, and the image is defogged and reconstructed until an output image that meets expectations is obtained, that is, the second output image. In the formula of the loss function, It is used to calculate the pixel difference between the output image and the real fog-free image, and Used to calculate the similarity between the output image and the real fog-free image, wherein a similarity value of 0~1 will be obtained when calculating the similarity. The larger the similarity value, the higher the similarity between the output image and the real fog-free image. At this time, we can set the similarity threshold to 0.95, that is, when the similarity value is greater than the similarity threshold of 0.95, it is judged that the defogging output image can meet expectations. It should be noted that, in this embodiment, the setting of the similarity threshold is limited, and it needs to be reasonably set according to different requirements, such as the actual shooting environment, computing resources, cost and other factors.

[0082] The present application adopts the above method to obtain pictures in a foggy environment and a fog-free environment as training data sets, respectively, to train a two-color feature fusion defogging network model, and obtains the corresponding RGB color space features and HSV color space features in the input image through the two-color feature fusion defogging network model, thereby reducing the color imbalance problem that may occur after image defogging through the two-color feature fusion defogging network model, and obtains the fusion feature map corresponding to the input image through the RGB color space features and the HSV color space features, and defogs and reconstructs the input image according to the fusion feature map to obtain a first output image corresponding to the input image, thereby improving the authenticity of the image color, effectively improving the image defogging capability in a low-light environment, and improving the quality of the image after defogging and reconstruction.

[0083] Please refer to Figure 6 , which shows a module schematic diagram of a low-light image defogging device provided in an embodiment of the present application. The device is a server, and the server includes a defogging model construction module 61, a fusion feature map construction module 62 and a defogging reconstruction module 63, wherein,

[0084] The defogging model building module 61 is used to collect a first image data subset through a highway road monitoring camera in a first environment, and the first environment is a foggy environment; collect a second image data subset through a highway road monitoring camera in a second environment, and the second environment is a fog-free environment, and the first environment and the second environment are in the same time period; use the first image data subset and the second image data subset as real-time image production data sets, and train a two-color feature fusion defogging network model based on the real-time image production data sets.

[0085] The fused feature map construction module 62 is used to obtain the corresponding RGB color space features and HSV color space features in the input image through the two-color feature fusion dehazing network model; through the two-color feature fusion dehazing network model, according to the RGB color space features and the HSV color space features, obtain the fused feature map corresponding to the input image.

[0086] The defogging and reconstruction module 63 is used to perform defogging and reconstruction on the input image according to the fused feature map to obtain a first output image corresponding to the input image, where the first output image is a defogged image.

[0087] In a possible implementation, the acquisition module 61 is used to acquire the corresponding RGB color space features and HSV color space features in the input image, specifically including: constructing an RGB color space feature extraction structure, the RGB color space feature extraction structure includes 3×3 Convolution structure and multiple RGB feature extraction structures, multiple RGB feature extraction structures are operated in series; multiple RGB color space feature maps corresponding to the input image are obtained according to the RGB color space feature extraction structure, and the RGB color space feature map includes RGB color space features; HSV color space feature extraction structure is constructed, and the HSV color space feature extraction structure includes 3×3 A convolution structure and a plurality of HSV feature extraction structures; obtaining a plurality of HSV color space feature maps corresponding to the input image according to the HSV color space feature extraction structure, wherein the HSV color space feature map includes HSV color space features.

[0088] In a possible implementation, the fusion feature map construction module 62 is used to obtain a fusion feature map corresponding to the input image according to the RGB color space features and the HSV color space features, specifically including: performing cross-space feature fusion on multiple RGB color space feature maps and multiple HSV feature extraction structures according to a preset process sequence, and obtaining a first fusion feature map and a second fusion feature map corresponding to the input image according to the following formula:

[0089] ;

[0090] in, is the first fusion feature map, is the second fusion feature map, ~ are the fusion weight coefficients corresponding to multiple HSV feature extraction structures, ε is the protection parameter, which is used to avoid the denominator being 0. One HSV feature extraction structure corresponds to one fusion weight coefficient. To change the image size, is a convolution structure, , , are multiple RGB color space feature maps, are multiple HSV color space feature maps, , , The fused feature map is obtained by fusing multiple RGB color space feature maps and multiple HSV color space feature maps in different ways, and is calculated by the following formula:

[0091] ;

[0092] An inverted residual structure and an expanded residual structure are obtained, the first fused feature map is input into the inverted residual structure to obtain a third fused feature map, and the second fused feature map is input into the expanded residual structure to obtain a fourth fused feature map; the third fused feature map and the fourth fused feature map are fused according to the following formula to obtain a fifth fused feature map:

[0093] ;

[0094] in, is the fifth fusion feature map, is the inverted residual structure, is the dilated residual structure, is a fusion process; obtaining a reconstruction unit structure, the reconstruction unit structure is used to restore contrast; inputting the fifth fusion feature map into the reconstruction unit structure to obtain a sixth fusion feature map, and using the sixth fusion feature map as the fusion feature map corresponding to the input image.

[0095] In a possible implementation, the fused feature map construction module 62 is used to input the first fused feature map into the inverted residual structure to obtain a third fused feature map, specifically including: performing normalization processing and activation function processing on the first fused feature map through the inverted residual structure to generate a first intermediate feature map corresponding to the first fused feature map; constructing a similarity weight matrix corresponding to the intermediate feature map, and obtaining a second intermediate feature map according to the similarity weight matrix; and fusing the first intermediate feature map and the second intermediate feature map according to the following formula to obtain a third fused feature map:

[0096] ;

[0097] in, is the third fusion feature map, It is a 1×1 convolution structure. is the activation function, is the first intermediate feature map, is the second intermediate feature map; the second intermediate feature map can be obtained by the following formula:

[0098] ;

[0099] in, is the similarity weight matrix, is the similarity between the pixel at position i and the pixel at position j in the first intermediate feature map, To perform weighted summation on the feature map vector of the first intermediate feature map, is element-wise multiplication.

[0100] In a possible implementation, the fused feature map construction module 62 is used to input the second fused feature map into the dilated residual structure to obtain a fourth fused feature map, specifically including: performing dilated convolution processing on the second fused feature map according to different dilation rates through the dilated residual structure to obtain multiple extended feature maps corresponding to the second fused feature map; fusing the multiple extended feature maps to obtain a third intermediate feature map; performing weighted processing on the third intermediate feature map through the CA attention mechanism to obtain a fourth intermediate feature map; and fusing the second fused feature map with the fourth intermediate feature map to obtain a fourth fused feature map.

[0101] In a possible implementation, the dehazing and reconstruction module 63 is used to perform dehazing and reconstruction on the input image according to the fused feature map, specifically including: performing pixel attention processing and channel number adjustment processing on the fused feature map to obtain a first output image corresponding to the input image.

[0102] In a possible implementation, the defogging and reconstruction module 62 is used to perform defogging and reconstruction on the input image according to the fusion feature map to obtain a first output image corresponding to the input image. The method further includes: obtaining a loss function corresponding to the two-color feature fusion defogging network model, and the loss function is obtained by the following formula:

[0103] ;

[0104] in, is the loss function, is the weight coefficient of the SmoothL1 loss function, is the structural similarity index weight coefficient between the first output image and the true haze-free image, x is the first output image, y is the true haze-free image, and the true haze-free image is any image in the second image data subset, is the mean pixel value in the first output image, is the pixel mean in the real fog-free image, is the standard deviation of pixels in the first output image, is the pixel standard deviation in the real fog-free image, is the covariance, and is a preset constant; whether the loss function is less than or equal to the preset function threshold; if the loss function is less than or equal to the preset function threshold, the parameter adjustment operation is performed on the two-color feature fusion dehazing network model, and the second output image corresponding to the input image is obtained through the two-color feature fusion dehazing network model after the parameter adjustment; the loss function corresponding to the two-color feature fusion dehazing network model is recalculated through the second output image, and it is determined whether the recalculated loss function is greater than the preset function threshold; if the recalculated loss function is greater than the preset function threshold, it is determined that the second output image meets the dehazing reconstruction requirements, and the parameter adjustment operation is completed.

[0105] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0106] The present application also provides an electronic device. Figure 7 , Figure 7 701 , at least one communication bus 702 , a user interface 703 , at least one network interface 704 , and a memory 705 .

[0107] The communication bus 702 is used to realize the connection and communication between these components.

[0108] The user interface 703 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 703 may also include a standard wired interface and a wireless interface.

[0109] The network interface 704 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0110] Among them, the processor 701 may include one or more processing cores. The processor 701 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 705, and calling data stored in the memory 705. Optionally, the processor 701 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 701 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 701, and it can be implemented separately through a chip.

[0111] Among them, the memory 705 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 705 includes a non-transitory computer-readable storage medium. The memory 705 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 705 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 705 may optionally also be at least one storage device located away from the aforementioned processor 701. Refer to Figure 7 , the memory 705 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a low-light image defogging application.

[0112] exist Figure 7In the electronic device shown, the user interface 703 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 701 can be used to call the low-light image defogging application stored in the memory 705. When executed by one or more processors 701, the electronic device executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0113] The present application also provides a computer-readable storage medium, which stores instructions. When executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments.

[0114] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0119] The above are only exemplary embodiments disclosed in this application, and the scope of the disclosure of this application cannot be limited by this. That is, any equivalent changes and modifications made according to the teachings disclosed in this application are still within the scope of the disclosure of this application. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other implementation schemes disclosed in this application.

[0120] This application is intended to cover any modifications, uses or adaptive changes disclosed in this application, which follow the general principles disclosed in this application and include common knowledge or customary technical means in the technical field not recorded in this application.

Claims

1. A highway image defogging method in a low-light environment, characterized in that: The method comprises: In a first environment, a first subset of image data is collected by a highway road monitoring camera, and the first environment is a foggy environment; in a second environment, a second subset of image data is collected by the highway road monitoring camera, and the second environment is a fog-free environment, and the first environment and the second environment are in the same time period; Using the first image data subset and the second image data subset as a real-time image production data set, and training a two-color feature fusion defogging network model according to the real-time image production data set; Through the two-color feature fusion dehazing network model, an RGB color space feature extraction structure is constructed, the RGB color space feature extraction structure includes a 3×3Conv convolution structure and multiple RGB feature extraction structures, and the multiple RGB feature extraction structures are operated in series; according to the RGB color space feature extraction structure, multiple RGB color space feature maps corresponding to the input image are obtained, and the RGB color space feature map includes the RGB color space feature; an HSV color space feature extraction structure is constructed, the HSV color space feature extraction structure includes a 3×3Conv convolution structure and multiple HSV feature extraction structures; according to the HSV color space feature extraction structure, multiple HSV color space feature maps corresponding to the input image are obtained, and the HSV color space feature map includes the HSV color space feature; Through the two-color feature fusion dehazing network model, the multiple RGB color space feature maps and the multiple HSV feature extraction structures are cross-space feature fused in a preset process sequence, and the first fused feature map and the second fused feature map corresponding to the input image are obtained according to the following formula: ; in, is the first fusion feature map, is the second fusion feature map, ~ are the fusion weight coefficients corresponding to the multiple HSV feature extraction structures respectively, ε is a protection parameter, and the protection parameter is used to prevent the denominator from being 0. One HSV feature extraction structure corresponds to one fusion weight coefficient, and Resize is to change the image size. , , are a plurality of RGB color space feature maps, are a plurality of HSV color space feature maps, , , The fused feature map is obtained by fusing a plurality of the RGB color space feature maps and a plurality of the HSV color space feature maps in different ways, and is calculated by the following formula: ; An inverted residual structure and an expanded residual structure are obtained, and the first fused feature map is normalized and activated by the inverted residual structure to generate a first intermediate feature map corresponding to the first fused feature map; a similarity weight matrix corresponding to the intermediate feature map is constructed, and a second intermediate feature map is obtained according to the similarity weight matrix; the first intermediate feature map and the second intermediate feature map are fused according to the following formula to obtain a third fused feature map: ; in, is the third fusion feature map, It is a 1×1 convolution structure. is the activation function, is the first intermediate feature map, is the second intermediate feature map; the second intermediate feature map can be obtained by the following formula: ; in, is the similarity weight matrix, is the similarity between the pixel at position i and the pixel at position j in the first intermediate feature map, To perform weighted summation on the feature map vector of the first intermediate feature map, ⊗ is element-by-element multiplication, the second fused feature map is subjected to dilated convolution processing according to different dilation rates through the dilated residual structure to obtain a plurality of extended feature maps corresponding to the second fused feature map; the plurality of extended feature maps are fused to obtain a third intermediate feature map; the third intermediate feature map is weightedly processed through the CA attention mechanism to obtain a fourth intermediate feature map; the second fused feature map is fused with the fourth intermediate feature map to obtain a fourth fused feature map; the third fused feature map and the fourth fused feature map are fused according to the following formula to obtain a fifth fused feature map: ; Wherein, P0 is the fifth fused feature map, IIR is the inverted residual structure, IWR is the dilated residual structure, and Concat is a fusion process; a reconstruction unit structure is obtained, and the reconstruction unit structure is used to restore contrast; the fifth fused feature map is input into the reconstruction unit structure to obtain a sixth fused feature map, and the sixth fused feature map is used as the fused feature map corresponding to the input image; The input image is defogged and reconstructed according to the fused feature map to obtain a first output image corresponding to the input image, where the first output image is a defogged image.

2. The method according to claim 1, characterized in that The defogging and reconstruction of the input image according to the fused feature map specifically includes: The fused feature map is subjected to pixel attention processing and channel number adjustment processing to obtain a first output image corresponding to the input image.

3. The method according to claim 1, characterized in that After defogging and reconstructing the input image according to the fused feature map to obtain a first output image corresponding to the input image, the method further includes: Obtain the loss function corresponding to the two-color feature fusion dehazing network model. The loss function is obtained by the following formula: ; in, is the loss function, is the weight coefficient of the SmoothL1 loss function, is the structural similarity index weight coefficient between the first output image and the real fog-free image, x is the first output image, y is the real fog-free image, and the real fog-free image is any image in the second picture data subset, is the mean value of pixels in the first output image, is the pixel mean in the real fog-free image, is the standard deviation of pixels in the first output image, is the pixel standard deviation in the real fog-free image, is the covariance, and is a preset constant; Determine whether the loss function is less than or equal to a preset function threshold; If the loss function is less than or equal to the preset function threshold, a parameter adjustment operation is performed on the two-color feature fusion defogging network model, and a second output image corresponding to the input image is obtained through the two-color feature fusion defogging network model after the parameter adjustment; Recalculate the loss function corresponding to the two-color feature fusion dehazing network model through the second output image, and determine whether the recalculated loss function is greater than the preset function threshold; If the recalculated loss function is greater than the preset function threshold, it is determined that the second output image meets the dehazing and reconstruction requirements, and the parameter adjustment operation is completed.

4. A highway image defogging device in a low-light environment, characterized in that: The device comprises a defogging model building module, a fusion feature map building module and a defogging reconstruction module, wherein: The defogging model building module is used to collect a first image data subset through a highway road monitoring camera in a first environment, wherein the first environment is a foggy environment; collect a second image data subset through the highway road monitoring camera in a second environment, wherein the second environment is a fog-free environment, and the first environment and the second environment are in the same time period; use the first image data subset and the second image data subset as a real-time image production data set, and train a two-color feature fusion defogging network model based on the real-time image production data set; The fusion feature map construction module is used to construct an RGB color space feature extraction structure through the two-color feature fusion defogging network model, the RGB color space feature extraction structure includes a 3×3Conv convolution structure and multiple RGB feature extraction structures, and the multiple RGB feature extraction structures are operated in series; obtain multiple RGB color space feature maps corresponding to the input image according to the RGB color space feature extraction structure, and the RGB color space feature map includes the RGB color space feature; construct an HSV color space feature extraction structure, the HSV color space feature extraction structure includes a 3×3Conv convolution structure and multiple HSV feature extraction structures; obtain multiple HSV color space feature maps corresponding to the input image according to the HSV color space feature extraction structure, and the HSV color space feature map includes the HSV color space feature; through the two-color feature fusion defogging network model, the multiple RGB color space feature maps and the multiple HSV feature extraction structures are cross-space feature fused in accordance with a preset process sequence, and the first fusion feature map and the second fusion feature map corresponding to the input image are obtained according to the following formula: ; in, is the first fusion feature map, is the second fusion feature map, ~ are the fusion weight coefficients corresponding to the multiple HSV feature extraction structures respectively, ε is a protection parameter, and the protection parameter is used to prevent the denominator from being 0. One HSV feature extraction structure corresponds to one fusion weight coefficient, and Resize is to change the image size. , , are a plurality of RGB color space feature maps, are a plurality of HSV color space feature maps, , , The fused feature map is obtained by fusing a plurality of the RGB color space feature maps and a plurality of the HSV color space feature maps in different ways, and is calculated by the following formula: ; An inverted residual structure and an expanded residual structure are obtained, and the first fused feature map is normalized and activated by the inverted residual structure to generate a first intermediate feature map corresponding to the first fused feature map; a similarity weight matrix corresponding to the intermediate feature map is constructed, and a second intermediate feature map is obtained according to the similarity weight matrix; the first intermediate feature map and the second intermediate feature map are fused according to the following formula to obtain a third fused feature map: ; in, is the third fusion feature map, It is a 1×1 convolution structure. is the activation function, is the first intermediate feature map, is the second intermediate feature map; the second intermediate feature map can be obtained by the following formula: ; in, is the similarity weight matrix, is the similarity between the pixel at position i and the pixel at position j in the first intermediate feature map, To perform weighted summation on the feature map vector of the first intermediate feature map, ⊗ is element-by-element multiplication, the second fused feature map is subjected to dilated convolution processing according to different dilation rates through the dilated residual structure to obtain a plurality of extended feature maps corresponding to the second fused feature map; the plurality of extended feature maps are fused to obtain a third intermediate feature map; the third intermediate feature map is weightedly processed through the CA attention mechanism to obtain a fourth intermediate feature map; the second fused feature map is fused with the fourth intermediate feature map to obtain a fourth fused feature map; the third fused feature map and the fourth fused feature map are fused according to the following formula to obtain a fifth fused feature map: ; Wherein, P0 is the fifth fused feature map, IIR is the inverted residual structure, IWR is the dilated residual structure, and Concat is a fusion process; a reconstruction unit structure is obtained, and the reconstruction unit structure is used to restore contrast; the fifth fused feature map is input into the reconstruction unit structure to obtain a sixth fused feature map, and the sixth fused feature map is used as the fused feature map corresponding to the input image; The defogging and reconstruction module is used to perform defogging and reconstruction on the input image according to the fused feature map to obtain a first output image corresponding to the input image, where the first output image is a defogged image.

5. An electronic device, characterized in that: It includes a processor, a communication bus, a user interface, a network interface and a memory, wherein the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 3 is performed.

Citation Information

Patent Citations

  • Low-light image defogging method based on context perception attention

    CN115100076A

  • Low-illumination image defogging method based on lightweight deep neural network

    CN116309110A