Iterative dehazing method and system for real-world images

Through an iterative dehazing method, combined with generative capabilities and high-quality priors, and using pre-trained encoders and decoders, the quality of image features is gradually improved, solving the problem of poor dehazing effect of real-world images and achieving higher quality and stable dehazing effects.

CN119809979BActive Publication Date: 2025-09-30NANKAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411993661.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-09-30
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Existing image dehazing methods perform poorly on real-world images, especially in dense haze areas, and deep learning-based methods are not adaptable enough to different scenarios.

Method used

An iterative dehazing method is adopted, combining generation capabilities and high-quality priors. Through pre-trained encoders and decoders, code predictors and code evaluators are used for iterative processing to gradually improve the quality of image features, introduce multi-scale feature fusion, and gradually improve the dehazing effect.

Benefits of technology

It achieves higher quality image restoration, reduces color cast, improves dehazing effect and stability, and surpasses the qualitative and quantitative performance of existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119809979B_ABST
    Figure CN119809979B_ABST
Patent Text Reader

Abstract

The present invention discloses an iterative defogging method and system for real-world images, which belongs to the field of image defogging technology. The method comprises: inputting a haze image into a pre-trained encoder for processing, extracting fused image features; processing the haze image through a code predictor to determine an image coding sequence; using the quality sequence generated by the encoder in pre-training as a guide, evaluating the image coding sequence through a code evaluator, updating the fused image features based on the evaluation results and inputting the code predictor; looping the processing of the code predictor and the code evaluator until the iteration is completed to obtain a defogging image coding sequence; inputting the corresponding defogging image features into a decoder for processing, and combining the multi-scale image features generated during the encoder processing to obtain a defogging image. The generation capability and high-quality prior are combined, and the generalization capability of the model is improved through iteration. The method solves the problem that the existing defogging algorithm performs poorly on real-world haze images and the defogging performance needs to be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image defogging, and in particular to an iterative defogging method and system for real-world images. Background Art

[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.

[0003] Single Image Dehazing aims to restore clear, haze-free images from hazy images. Early dehazing methods mainly restored images by estimating the parameters of the imaging model. However, these methods based on hand-designed priors often lack sufficient generalization capabilities and cannot adapt to different scenes, resulting in poor results. With the development of deep learning, data-driven methods have achieved remarkable results. DehazeNet, Aod-Net, etc. are inspired by scattering models. However, when the scene does not conform to the ideal physical model, the dehazing effect is still not ideal. Another type of method, FFA-Net, Dehamer, etc., directly uses the network to restore clear images, but due to the domain gap between synthetic data and real data, these models often perform poorly on real-world hazy images.

[0004] In the study of real-world image dehazing, existing methods can be roughly divided into domain adaptation-based methods, generative adversarial network (GAN)-based methods, and deep prior-based methods. However, the following problems still exist:

[0005] (1) Domain adaptation-based methods use domain adaptation technology to narrow the gap between synthetic and real domains. They usually perform well on synthetic datasets, but have poor generalization ability on real haze images.

[0006] (2) Unlike supervised learning methods, GAN-based methods use unpaired clear and hazy images to learn dehazing mappings. Although they can generate clearer and more natural images, they often produce unnatural haze, which further affects the dehazing performance.

[0007] (3) Some methods introduce hand-designed priors into the network framework or loss function, but these methods still have difficulty overcoming their inherent limitations. In recent years, the use of high-quality priors based on VQGAN has achieved significant advantages in image restoration, but traditional one-shot prediction algorithms still perform poorly in dense haze areas. Summary of the Invention

[0008] In order to address the shortcomings of the existing technology, the present invention provides an iterative dehazing method, system, electronic device, computer-readable storage medium and computer program product for real-world images, which combines generative capabilities and high-quality priors, and improves the generalization ability of the model through an iterative approach.

[0009] In a first aspect, the present invention provides an iterative defogging method for real-world images;

[0010] An iterative dehazing method for real-world images, comprising:

[0011] Obtain a haze image, input the haze image into a pre-trained encoder for processing, and extract fused image features;

[0012] The fused image features are processed by a code predictor, and an image coding sequence is determined using an output distribution of the code predictor; the image coding sequence is evaluated by a code evaluator using a quality sequence generated by the encoder during pre-training as a guide, and the fused image features are updated based on the evaluation results and input into the code predictor; the processing of the code predictor and the code evaluator is repeated until the iterative conditions are met, thereby obtaining a dehazed image coding sequence;

[0013] The dehazed image features corresponding to the dehazed image coding sequence are input into the decoder for processing, and the dehazed image is obtained by combining the multi-scale image features generated during the encoder processing.

[0014] In some embodiments, inputting the haze image into a pre-trained encoder for processing and extracting fused image features includes:

[0015] Input the haze image into the pre-trained encoder to obtain the initial image features;

[0016] Determining a mask matrix by initialization, and combining the initial image features and the quantized features based on the mask matrix to obtain fused image features;

[0017] The quantized features are generated by pre-training an encoder.

[0018] In some embodiments, the image coding sequence is evaluated by a code evaluator, and the fused image features are updated based on the evaluation results. Specifically, the image coding sequence is input into a trained code evaluator, an output probability is obtained, and a two-dimensional mask matrix is ​​updated according to the output probability; and the fused image features are updated based on the two-dimensional mask matrix.

[0019] In some embodiments, the code predictor is trained using a cross-entropy loss function, and the code evaluator is trained using a binary cross-entropy loss function.

[0020] In some embodiments, pre-training the encoder specifically includes: inputting the image block into the encoder for processing, obtaining latent space features, and replacing each item in the latent space features with a codeword in a dictionary closest to it, obtaining quantized features and corresponding quality sequences;

[0021] The resolution of the image block is smaller than that of the haze image.

[0022] In some embodiments, the defogging image features corresponding to the defogging image coding sequence are input into the decoder for processing, and the defogging image is obtained by combining the multi-scale image features generated during the encoder processing. Specifically, the defogging image features and the multi-scale image features are fused, the defogging image features are updated and input into the decoder for processing to obtain the defogging image.

[0023] In a second aspect, the present invention provides an iterative defogging system for real-world images;

[0024] An iterative dehazing system for real-world images, including:

[0025] The acquisition module is configured to: acquire a haze image, input the haze image into a pre-trained encoder for processing, and extract fused image features;

[0026] The iterative dehazing module is configured to: process the fused image features through a code predictor, and determine an image coding sequence using the output distribution of the code predictor; evaluate the image coding sequence through a code evaluator guided by a quality sequence generated by the encoder during pre-training, update the fused image features based on the evaluation results and input them into the code predictor; loop the processing of the code predictor and the code evaluator until the iterative conditions are met to obtain a dehazed image coding sequence; input the dehazed image features corresponding to the dehazed image coding sequence into a decoder for processing, and obtain a dehazed image by combining them with the multi-scale image features generated during the encoder processing.

[0027] In a third aspect, the present invention provides an electronic device;

[0028] An electronic device includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-mentioned iterative defogging method for real-world images.

[0029] In a fourth aspect, the present invention provides a computer-readable storage medium;

[0030] A computer-readable storage medium stores a computer program / instruction thereon, which, when executed by a processor, implements the steps of the above-mentioned iterative defogging method for real-world images.

[0031] In a fifth aspect, the present invention provides a computer program product;

[0032] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned iterative defogging method for real-world images.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. The technical solution provided by the present invention proposes a novel iterative decoding dehazing framework, which uses the high-quality encoding obtained from the previous rounds of iterations as clues to guide the encoder to predict subsequent encoding, thereby achieving better iterative dehazing effect; the restored image has less color cast, higher image quality and more significant dehazing effect.

[0035] 2. The technical solution provided by the present invention introduces a code evaluator to evaluate the interdependencies in the encoder outputs and select which codes should be retained or rejected during the iterative decoding process, thereby guiding subsequent predictions; improving the consistency between the selected codes and avoiding the accumulation of errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0037] Figure 1 A schematic diagram of a flow chart of an iterative defogging method for real-world images provided by an embodiment of the present invention;

[0038] Figure 2 An example diagram showing the difference between using a code predictor and not using iterative processes according to an embodiment of the present invention;

[0039] Figure 3 This figure illustrates the difference between using a code evaluator and not using iterative processes according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0041] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0042] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.

[0043] Example 1

[0044] Existing dehazing algorithms usually rely on prior information of ideal assumptions, which makes them ineffective in actual scenarios and have limitations when applied to real-world images. The dehazing performance needs to be improved. Deep learning methods have made significant progress through data-driven approaches, but when faced with complex real-world scenes, the training data usually relies on ideal physical models and is difficult to adapt to different dehazing scenarios.

[0045] Therefore, this embodiment provides an iterative defogging method for real-world images, which performs iterative defogging from easy to difficult, thereby improving the overall accuracy and stability of the defogging process.

[0046] Next, combine Figure 1-Figure 3 , an iterative defogging method for real-world images disclosed in this embodiment is described in detail. The iterative defogging method for real-world images includes the following steps:

[0047] S1. Obtain a haze image, input the haze image into a pre-trained encoder for processing, and extract fused image features.

[0048] Here, the encoder can be the encoder in the VQGAN network, and the decoder described below can be the decoder in the VQGAN network. By pre-training the VQGAN network with high-quality image blocks, the quantitative feature Z is obtained. c ∈R m×n×d and the corresponding quality sequence S h , a high-quality prior is introduced.

[0049] As an implementation method, S1 includes:

[0050] S101, obtaining haze image I l , the haze image I lInput the pre-trained encoder for processing, through E L (I l ) Get the initial image feature Z l , and initialize a binary mask matrix M t .

[0051] At this time, M t All the items in are 1, t=1.

[0052] In this embodiment, the encoder includes one convolutional layer (input channel = 3, output channel = 64, kernel size = 4), two convolutional blocks, and one convolutional layer (input channel = 256, output channel = 256, kernel size = 1) connected in sequence; wherein each convolutional block includes one convolutional layer with a stride of 2 and two residual blocks connected in sequence.

[0053] In the encoder, the haze image I l During the processing, after the above convolution block containing the convolution layer with a step size of 2, the image features F of different scales are obtained. e .

[0054] S102, the binary mask matrix M t Applied to the initial image feature Z l and quantitative features Z c And perform weighted averaging to obtain the fusion image feature Z t , expressed as:

[0055] Z t =Z l ⊙M t +Z c ⊙(1-M t )

[0056] It should be noted here that, in the subsequent iteration process, t traverses from 1 to T, where T is a custom value set. In this embodiment, T is set to 8.

[0057] S2, fusion image feature Z t Input the trained code predictor and use the probability distribution p output by the code predictor θ , the coding sequence with the highest probability is taken as the final image coding sequence S; it is expressed as:

[0058] S=argmax(p θ ).

[0059] The input of the code predictor is a vector of shape (H / 4, W / 4, 256), and the output is a vector of shape (H / 4, W / 4, 1024). The code predictor consists of four RSTB modules (Residual Swin Transformer blocks), layer normalization (LayerNorm), and linear layer (Linear) connected in sequence. The RSTB module has a window size of 8, a dimension of 256, a multi-head number of 8, and a depth of 6. The dimension of layer normalization is 256, the dimension of the input feature of the linear layer is 256, and the dimension of the output feature is 1024.

[0060] S3. Guided by the quality sequence (high-quality image coding sequence) generated by the encoder during the pre-training process, the image coding sequence is evaluated and updated through the trained code evaluator, and the image features corresponding to the updated image coding sequence are input into the trained code predictor.

[0061] The processing of the code predictor and the code evaluator (S102-S4) is cyclical until the iterative condition is completed, and the last updated image coding sequence is used as the defogging image coding sequence, and S4 is executed.

[0062] In S2, a high-quality image coding sequence is obtained. However, the relationship between these codes is not considered. Therefore, in this step, a code estimator is introduced. to evaluate whether each code should be accepted.

[0063] The input of the code evaluator is a vector of shape (H / 4, W / 4, 256), and the output is a vector of shape (H / 4, W / 4, 1024). The code evaluator consists of two RSTB modules connected in sequence, a layer normalization layer, and a linear layer. The RSTB module has a window size of 8, a dimension of 256, a multi-head number of 8, and a depth of 6. The dimension of the layer normalization is 256. The input feature dimension of the linear layer is 256, and the output feature dimension is 1024.

[0064] Specifically, the image coding sequence S is input into the code evaluator, and the output probability The one with the highest probability Set the codes to 1 and the rest to 0 to generate a binary mask matrix M t+1 , where γ(·) is the cosine function; using the binary mask matrix M t+1 Update the mask matrix in S102 and transform the initial image feature Z l and quantitative features Z c Average weighted fusion, update the corresponding fusion image feature Z t .

[0065] S4. Input the defogging image features corresponding to the defogging image coding sequence into the decoder for processing, and combine the multi-scale image features generated during the encoder processing to obtain the defogging image.

[0066] In this embodiment, the decoder includes one convolutional layer (input channel = 256, output channel = 256, kernel size = 4), a 2x upsampling block, a convolution block, a 2x upsampling block, a convolution block, and one convolutional layer (input channel = 64, output channel = 3, kernel size = 3) connected in sequence, wherein each convolutional block includes one convolutional layer with a stride of 2 and two residual blocks connected in sequence.

[0067] Specifically, first, the defogging image coding sequence is searched in the dictionary C, and the corresponding codeword is found in the dictionary C to form the corresponding defogging image feature vector; then, the defogging image feature vector is input into the decoder for processing, and after the above-mentioned upsampling block, the defogging image feature maps F of different scales are obtained respectively. d ; Then the defogging image feature map F is transformed into d The image features F of the corresponding scale generated during the encoder processing e Fusion to obtain updated dehazed image features Finally, the dehazed image features of different scales are updated Input the decoder, perform feature fusion at all different scales of the decoder, and output the dehazed image. Updated dehazed image features Expressed as:

[0068]

[0069] Based on this, by combining the features of high-quality images and low-quality images, a gradual decoding strategy is adopted to effectively improve the image dehazing effect; the dehazing process first focuses on relatively clear areas and gradually transitions to more challenging areas, thereby improving the stability and accuracy of the dehazing process.

[0070] Furthermore, before executing S1, it also includes: training the VQGAN network with the training set and training the code predictor and code evaluator. The specific process is as follows:

[0071] Step 1: Use a large-scale dataset containing high-resolution image patches to pre-train VQGAN to learn the dictionary (Codebook). The specific process is as follows:

[0072] (1) High-resolution image block I h ∈R H×W×3 Input encoder processing, the encoder converts the high-resolution image block I h ∈R H×W×3 Converted to latent space feature Zh , expressed as:

[0073] Z h =E H (I h )∈R m×n×d ;

[0074] Where, E H represents the encoder, and d represents the size of the dictionary embedding vector.

[0075] (2) The latent space feature Z h Perform nearest neighbor matching with dictionary C and convert Z h Each item in is replaced by the codeword in the dictionary C that is closest to it, and the quantitative feature Z is obtained. c ∈R m×n×d and the corresponding quality sequence S h , where S h Refers to the serial number in the dictionary corresponding to the encoding in the quantitative feature; it is expressed as:

[0076] Z c (i,j)=argmin{c k ∈C}∥Z h (i,j)-c k ∥2;S h (i,j)=k when Z c (i,j)=c k ;

[0077] Where i, j represent Z c The coordinates of the midpoint vector.

[0078] (3) Through decoder D H The quantitative feature Z c Decoded as I rec To reconstruct image I h , expressed as:

[0079] I rec =D H (Z c ).

[0080] Synthetic image data is generated from the DIV2K dataset and the Flickr2K dataset as a training set for training the dehazing network. The synthetic image data includes various degradation factors such as simulated real-world low light and color deviation to better handle complex dehazing tasks.

[0081] Step 2: Fix the model parameters of the decoder and dictionary in the pre-trained VQGAN and train the code predictor. This includes:

[0082] (1) Input the training set into the encoder for processing to obtain the initial image feature Zl and quantitative features Z c (2) Determine the binary mask matrix M by random sampling t , the binary mask matrix M t Applied to the initial image feature Z l and quantitative features Z c And perform weighted averaging to obtain the fusion image feature Z t , expressed as:

[0083] Z t =Z l ⊙M t +Z c ⊙(1-M t )

[0084] Here, the mask ratio (number of elements) is determined by the following formula: Among them, γ(r) is the cosine function, and r is a random number sampled from Uniform(0,1].

[0085] (3) Z t Input the code predictor and get the probability distribution p of the code predictor output θ

[0086] In this embodiment, a dynamic mask matrix is ​​introduced during the training process to randomly block part of the image area, thereby improving the generalization ability of the network and the defogging effect; the sampling of the mask matrix is ​​based on a scheduling function generated by random numbers to ensure the diversity and challenge of different training stages. In this embodiment, in the code predictor G θ During the training process, the cross entropy loss function L is used θ To train G θ , the loss function is expressed as:

[0087]

[0088] In the code predictor G θ During the training, the model parameters of the decoder and dictionary in the pre-trained VQGAN are fixed, the training set is input into the encoder and code predictor for processing, and the data processing flow of S1-S2 is executed. According to the code predictor G θ The code prediction error is updated using the gradient descent method. θ The parameter θ is:

[0089] Step 3: Fix the parameters of the pre-trained VQGAN network and the parameters of the trained code predictor, and train the code evaluator using the training set.

[0090] In this embodiment, the binary cross entropy loss function is used to calibrate the code evaluator. Perform training, expressed as:

[0091]

[0092] Specifically, the image coding sequence S is input into the code evaluator, and the output probability Represents each code and quality sequence S in S h To check whether each code in S is consistent with the quality sequence S h If the encoding is consistent, it is rejected; otherwise, it is accepted; use M=(S≠S h ) generates a mask label M to supervise the learning of the evaluator.

[0093] During the training of the code estimator, the parameters of the pre-trained VQGAN network and the trained code predictor are fixed, the training set is input into the encoder, code predictor, and code estimator for processing, and the data processing flow S1-S4 is executed; according to the loss function, the parameters φ of the code estimator are updated using the gradient descent method, that is:

[0094] Different from the actual application, during the training process of the code estimator, the sequence S is resampled from pθ. In order to enable the code estimator to accurately evaluate various situations of the code predictor output, in this embodiment, a sampling temperature is introduced to enhance the sampling diversity of the code predictor, which is expressed as:

[0095]

[0096] Temp is set to 2.

[0097] A probability distribution with temperature sampling is adopted to increase the diversity of generated codes and the richness of dehazing results.

[0098] In summary, considering that light fog areas contain more information, while dense fog areas contain less information, this embodiment proposes an innovative iterative decoding defogging framework, which uses pre-trained VQGAN as a priori and adopts a high-quality codebook to assist the defogging process; based on the iterative decoding framework, the accuracy and stability of defogging are improved through a gradual defogging approach. The encoder first maps the foggy image into a token. Then, based on the current token, a prediction-evaluation mechanism is used to alternately predict and evaluate high-quality codes to determine which codes need to be retained. As the iteration proceeds, the number of retained codes gradually increases until all codes are finally determined. Through this iterative defogging method, a progressive defogging process is achieved, and the quality of the image is gradually improved; in real-world defogging tasks, it surpasses the existing state-of-the-art methods both qualitatively and quantitatively.

[0099] Next, in order to verify the advancedness of the iterative dehazing method for real-world images described in this embodiment, the RTTS, Fattal, and URHI datasets were selected as test datasets to test different methods, and indicators such as MUSIQ, PI, MANIQA, CLIPQIA, Q-ALIGN, and TOPIQA were used for evaluation.

[0100] Finally, the experimental results show that compared with other dehazing methods, the method described in this embodiment has significant advantages in MUSIQ, PI, MANIQA, CLIPQIA, Q-ALIGN, and TOPIQA indicators, and the restored image has less color deviation, higher image quality, and more significant dehazing effect.

[0101] Example 2

[0102] This embodiment discloses an iterative defogging system for real-world images, including:

[0103] The acquisition module is configured to: acquire a haze image, input the haze image into a pre-trained encoder for processing, and extract fused image features;

[0104] The iterative dehazing module is configured to: process the fused image features through a code predictor, and determine an image coding sequence using the output distribution of the code predictor; evaluate the image coding sequence through a code evaluator guided by a quality sequence generated by the encoder during pre-training, update the fused image features based on the evaluation results and input them into the code predictor; loop the processing of the code predictor and the code evaluator until the iterative conditions are met to obtain a dehazed image coding sequence; input the dehazed image features corresponding to the dehazed image coding sequence into a decoder for processing, and obtain a dehazed image by combining them with the multi-scale image features generated during the encoder processing.

[0105] It should be noted that the acquisition module and iterative dehazing module described above correspond to the steps in Example 1. The examples and application scenarios implemented by these modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the modules described above, as part of a system, can be executed in a computer system, such as a set of computer-executable instructions.

[0106] Example 3

[0107] Embodiment 3 of the present invention provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the above-mentioned iterative defogging method for real-world images are completed.

[0108] Example 4

[0109] A fourth embodiment of the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps of the above-mentioned iterative defogging method for real-world images are completed.

[0110] Example 5

[0111] A fifth embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned iterative defogging method for real-world images.

[0112] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0113] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing device, and a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide the functions for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0115] The descriptions of the various embodiments in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0116] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. An iterative dehazing method for real-world images, characterized by: include: Obtain haze images, train the VQGAN network, code predictor, and code evaluator on the training set, input the haze images into the pre-trained encoder for processing, and extract fused image features; The fused image features are processed by a code predictor, and an image coding sequence is determined using an output distribution of the code predictor; the image coding sequence is evaluated by a code evaluator using a quality sequence generated by the encoder during pre-training as a guide, and the fused image features are updated based on the evaluation results and input into the code predictor; the updating of the fused image features based on the evaluation results is specifically as follows: the image coding sequence is input into a trained code evaluator, an output probability is obtained, and a two-dimensional mask matrix is ​​updated according to the output probability; and the fused image features are updated based on the two-dimensional mask matrix; The processing of the code predictor and the code evaluator is cyclic until the iterative conditions are completed and the dehazed image coding sequence is obtained; The defogged image features corresponding to the defogged image coding sequence are input into the decoder for processing, and the defogged image is obtained by combining the multi-scale image features generated during the encoder processing. The defogged image is obtained by fusing the defogged image features with the multi-scale image features, updating the defogged image features and inputting them into the decoder for processing to obtain the defogged image.

2. The iterative dehazing method for real-world images according to claim 1, wherein: The step of inputting the haze image into a pre-trained encoder for processing and extracting fused image features includes: Input the haze image into the pre-trained encoder to obtain the initial image features; Determining a mask matrix by initialization, and combining the initial image features and the quantized features based on the mask matrix to obtain fused image features; The quantized features are generated by pre-training an encoder.

3. The iterative dehazing method for real-world images according to claim 1, wherein: The code predictor is trained by the cross-entropy loss function, and the code evaluator is trained by the binary cross-entropy loss function.

4. The iterative dehazing method for real-world images according to claim 1, wherein: The encoder is pre-trained as follows: the image block is input into the encoder for processing, the latent space features are obtained, and each item in the latent space features is replaced by the codeword in the dictionary closest to it, and the quantized features and the corresponding quality sequence are obtained; The resolution of the image block is smaller than that of the haze image.

5. Iterative dehazing system for real-world images, characterized by: include: The acquisition module is configured to: acquire haze images, train the VQGAN network and the code predictor and code evaluator on the training set, input the haze images into the pre-trained encoder for processing, and extract fused image features; The iterative dehazing module is configured to: process the fused image features through a code predictor and determine an image coding sequence using an output distribution of the code predictor; evaluate the image coding sequence through a code evaluator using a quality sequence generated by the encoder during pre-training as a guide, update the fused image features based on the evaluation results and input them into the code predictor; updating the fused image features based on the evaluation results is specifically performed by: inputting the image coding sequence into the trained code evaluator, obtaining output probabilities, and updating a two-dimensional mask matrix based on the output probabilities; and updating the fused image features based on the two-dimensional mask matrix; The processing of the code predictor and the code evaluator is cyclic until the iterative conditions are completed and the dehazed image coding sequence is obtained; The defogged image features corresponding to the defogged image coding sequence are input into the decoder for processing, and the defogged image is obtained by combining the multi-scale image features generated during the encoder processing. The defogged image is obtained by fusing the defogged image features with the multi-scale image features, updating the defogged image features and inputting them into the decoder for processing to obtain the defogged image.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the iterative defogging method for real-world images according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the iterative defogging method for real-world images described in any one of claims 1 to 4 are implemented.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the iterative defogging method for real-world images described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Image deblurring method and device, equipment, medium and computer program product

    CN115205150A

  • Image defogging method and system based on high-quality coding dictionary prior

    CN116416151A