An image defogging method based on phase field dynamics and deep learning
By introducing the Cahn-Hilliard equation of phase field dynamics and deep learning, an image dehazing network is constructed, which solves the problems of poor adaptability of traditional methods in complex scenes and color cast, fog residue and artifacts caused by data-driven methods under domain shift, and achieves high-precision image dehazing effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGCHUN UNIV OF SCI & TECH
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-14
AI Technical Summary
Existing image dehazing methods are difficult to adapt to complex scenes. Traditional physical model methods cannot adapt to complex scenes, while pure data-driven methods are prone to color shift, fog residue and artifacts in domain offset scenes.
An image dehazing network is constructed using the Cahn-Hilliard equation based on phase field dynamics. Through an encoder-decoder architecture and a Cahn attention-guided module, physical modeling and separation of fog and real images are achieved. The phase separation process is simulated using the Cahn-AG module, and the network parameters are optimized by combining the Heun two-step propagation strategy and a multi-task loss function.
It significantly improves the accuracy and interpretability of image dehazing, reduces color cast and artifacts, and enhances the dehazing effect in real-world application scenarios.
Smart Images

Figure CN122391013A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to an image dehazing method based on phase field dynamics and deep learning. Background Technology
[0002] Image dehazing is an important topic in computer vision, aiming to recover a clear scene image from an image degraded by fog. Existing image dehazing methods mainly fall into two categories: image dehazing methods based on prior knowledge and image dehazing methods based on deep learning.
[0003] The main idea behind prior knowledge-based image dehazing methods is to embed prior statistical knowledge or manually designed prior features into an atmospheric scattering model. The mathematical form of the atmospheric scattering model is:
[0004]
[0005] in, This indicates an observation of a fog map. For a true image without attenuation, For global atmospheric light, Transmittance. Traditional dehazing methods are typically based on this physical model, estimating transmittance. With atmospheric light Restore the haze-free image This type of method relies on manually designed prior assumptions (such as dark channel priors, gray-world assumptions, etc.) to estimate model parameters and recover a clear image through the inverse process of the atmospheric scattering model. This type of method is computationally efficient, but prior statistics are prone to failure in complex real-world scenarios such as non-uniform illumination and multiple scattering, resulting in a significant decrease in dehazing performance.
[0006] Deep learning methods utilize convolutional neural networks or Transformers to directly learn the mapping from foggy images to clear images without explicitly relying on atmospheric scattering models. These methods enhance feature representation capabilities through multi-scale feature fusion, attention mechanisms, and residual learning, achieving significant progress on synthetic datasets. However, most existing deep learning methods are still trained with atmospheric scattering models as implicit constraints. When real-world scenes involve complex lighting, multiple scattering, reflective surfaces, and other factors that cause images to deviate from the model assumptions, the network is forced to learn within an incorrect physical framework, resulting in systematic biases such as color cast, fog retention, and artifacts, thus limiting generalization ability.
[0007] Therefore, overcoming the shortcomings of traditional physical model methods in adapting to complex scenes and the tendency of pure data-driven methods to produce color shift, fog residue and artifacts in domain offset scenarios is a technical problem that urgently needs to be solved in the field of image dehazing. Summary of the Invention
[0008] This invention aims to solve the aforementioned problems in existing image dehazing techniques and proposes an image dehazing method based on phase field dynamics and deep learning.
[0009] To achieve the above objectives, the present invention provides the following technical solution:
[0010] An image dehazing method based on phase field dynamics and deep learning includes the following steps:
[0011] Step 1: Model the dehazing task of hazy images as a phase separation problem, and construct an image dehazing network based on the physical prior of the Cahn-Hilliard equation. The image dehazing network adopts an encoder-decoder architecture, and each stage of the encoder-decoder architecture is composed of CahnBlocks. Each CahnBlock includes a prediction unit and a correction unit cascaded with the prediction unit. The prediction unit is used to make a preliminary prediction of the input features and output the predicted features. The correction unit is a Cahn attention guidance module, which is used to physically correct the predicted features based on the Cahn-Hilliard equation and output the corrected features.
[0012] Step 2: Input the hazy image to be processed into the pre-trained image dehazing network;
[0013] Step 3: In the pre-trained image dehazing network, the input hazy image is first mapped to embedded features through a convolutional layer;
[0014] During the encoding stage, the embedded features are fed into a three-level encoder, which uses stride convolution to downsample step by step and extract multi-scale features.
[0015] During the decoding stage, the three-level decoder performs upsampling step by step through transposed convolution, and the features output by each level decoder are concatenated with the features output by the corresponding encoder of the same scale, and then the number of channels is compressed through convolutional layers.
[0016] In the residual reconstruction stage, a residual image is generated by a convolutional layer. The residual image is then added to the input hazy image to output the restored hazy image.
[0017] Compared with the prior art, the present invention has the following beneficial effects:
[0018] (1) This invention introduces the Cahn-Hilliard equation, which describes the phase separation dynamics, into the image dehazing task for the first time, and models the dehazing task as a phase separation problem between the "real background phase" and the "fog phase", which injects powerful physical priors into deep learning networks and improves the interpretability and generalization ability of the model.
[0019] (2) The present invention designs the Cahn attention guidance module and embeds it at the end of each encoder and decoder to realize physical modeling and separation between fog and real image, effectively improving the accuracy and interpretability of the dehazing process, significantly reducing color cast and artifacts in image dehazing, and effectively overcoming the degradation problems such as color cast, fog residue and artifacts in the real application scenario of existing image dehazing technology. Attached Figure Description
[0020] Figure 1 This is a structural diagram of the image dehazing network based on the physical prior of the Cahn-Hilliard equation in this invention;
[0021] Figure 2 Network structure diagram of phase separation potential operator;
[0022] Figure 3 This is a network structure diagram of the flux evolution operator. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This invention provides an image dehazing method based on phase field dynamics and deep learning. This method, by embedding phase field dynamics theory into a deep learning network, solves the technical problems of existing pure data-driven methods easily producing color shift, fog residue, and artifacts in domain offset scenarios, as well as the inability of traditional physical model methods to adapt to complex scenes.
[0024] See Figure 1 This embodiment provides an image dehazing method based on phase field dynamics and deep learning, including the following steps:
[0025] Step 1: Model the dehazing task of hazy images as a phase separation problem and construct an image dehazing network based on the physical prior of the Cahn-Hilliard equation;
[0026] Step 2: Input the hazy image to be processed into the pre-trained image dehazing network;
[0027] Step 3: The specific processing flow of the pre-trained image dehazing network for the input hazy image is as follows:
[0028] (1) Feature embedding stage: Input foggy image (or degraded fog map) After passing through a regular convolutional layer (e.g. Convolutional layers are mapped to embedded features. ;in, For the real number field, The number of feature channels, For feature height, This represents the feature width.
[0029] (2) Encoding stage: Embedded features The third-level encoder uses stride convolution (convolution kernel=3, stride=2) to downsample step by step, reducing spatial resolution and expanding the number of channels to extract multi-scale features.
[0030] (3) Decoding stage: The three-level decoder performs upsampling step by step through transposed convolution (convolution kernel=4, stride=2), and the features output by each level decoder are concatenated with the corresponding features output by the encoder of the same scale, and then passed through a convolutional layer (e.g. Convolutional layers compress the number of channels by half;
[0031] (4) Residual reconstruction stage: Finally, it passes through a regular convolutional layer (e.g., The convolutional layer generates a residual image, which is then compared with the input hazy image. Add them together to output the restored haze-free image.
[0032] In this embodiment, the image dehazing network adopts an encoder-decoder architecture, the core of which is to use the Cahn attention guidance module to transform the phase separation dynamics process described by the Cahn-Hilliard equation into a learnable neural network operator, thereby achieving a deep fusion of physical priors and data-driven approaches.
[0033] Each stage of the encoder-decoder architecture consists of a Cahn Block, and each Cahn Block includes a prediction unit (i.e., a residual neural network) and a correction unit cascaded with the prediction unit. The prediction unit is used to process the input features. Preliminary predictions are made; the prediction unit contains 6 residual blocks (each residual block consists of two...). Composed of convolution and activation functions, it is responsible for preliminary feature prediction and outputs predicted features. Predicted features Input features They all enter the correction section, which is the Cahn attention-guided module (Cahn-AG module for short). This module is used to predict features based on the Cahn-Hilliard equation. Perform physical corrections and output the corrected features. .
[0034] The Cahn-AG module includes a phase separation potential operator and a flux evolution operator, used to transform the physical evolution process of the Cahn-Hilliard equations into a computationally feasible graph for deep learning, simulating the feature evolution operators of the Cahn-Hilliard equations. .
[0035] The classical Cahn-Hilliard equation describes the evolution of the concentration field during phase separation, and its basic form is:
[0036] (1)
[0037] Among them, free energy functional .
[0038] When the left side of equation (1) is 0, it means that the phase field concentration does not change with time, which is the steady-state equation: .
[0039] in, For concentration field; The diffusion coefficient is denoted as . This is the interface width parameter; The integral volume; For free energy functionals; Represents the gradient operator; Represents the free energy functional For concentration field The variational derivative of .
[0040] Because the steady-state equation contains nonlinear terms and higher-order derivative terms Since there is usually no analytical solution, this invention employs a time-stepping method to merge nonlinear terms and higher-order derivative terms and transform them into learnable feature evolution operators. Specifically, the time-stepping method includes the following steps:
[0041] First, the forward Euler method is used to discretize formula (1) in time, as shown in the following formula:
[0042] (2)
[0043] in, For time step; For the current moment Concentration field; For the next moment Concentration field; Indicates the current moment right To retrieve the value.
[0044] Simplifying equation (2), we obtain the explicit iterative scheme for the concentration field:
[0045] (3)
[0046] Furthermore, the spatial differential operator is defined globally as the characteristic evolution operator. :
[0047] (4)
[0048] in, This represents the characteristics at the current moment, in relation to the concentration field. Corresponding in space, that is , Represents spatial coordinates; Represents the features at the next time step. Feature evolution operator. It incorporates nonlinear effects and higher-order diffusion, namely the Cahn-AG module. The final characteristic evolution operator is obtained. Discrete iterative form:
[0049] (5)
[0050] The Cahn-AG module approximates the target state by iteratively updating features. The specific update formula is as follows:
[0051] (6)
[0052] in, This represents the characteristics at the current moment; considering that there are higher-order derivatives in formula (4) and there is no analytical solution, therefore, we introduce... This allows us to represent the predicted features for the next time step, replacing traditional numerical format evolution (such as explicit, semi-implicit, or multigrid methods), thereby avoiding the complex gradient calculations in traditional methods. It is the time step; It is a phase-separating potential operator; It is a flux evolution operator used for combining Output and prediction features To update features; This indicates the characteristics of the next moment after the correction.
[0053] The Cahn-AG module receives two sets of input data: the input features at the current time. and the predicted features of the next time step Input features and predictive features Entering the phase separation potential operator This operator simulates the variational derivative of the free energy functional of the Cahn-Hilliard equation and calculates the phase separation potential data.
[0054] The phase separation potential is calculated by determining the variational derivative of the free energy functional. For concentration field The variational derivative is:
[0055] (7)
[0056] This invention re-divides it according to time steps as follows:
[0057] (8)
[0058] in, To expand the potential, It represents a contraction potential.
[0059] See Figure 2 The phase separation potential operator includes two parallel branches: an expansion potential branch and a contraction potential branch.
[0060] The extended potential branch consists of three parallel convolutional layers with different kernel sizes (e.g., 5×5, 3×3, 1×1) and a first channel-spatial attention module cascaded with the three parallel convolutional layers.
[0061] Multi-scale feature extraction: Three parallel convolutional layers extract input features. Feature extraction is performed to obtain multi-scale features; depthwise separable convolution can be used in the convolutional layers to reduce computational cost.
[0062] Feature fusion: The outputs of the three convolutional layers are summed element by element, and the sum is fed into the first channel - spatial attention module;
[0063] Attention Weighting: The first channel - spatial attention module adaptively weights the input features, enhancing key region features, and finally outputs the extended potential feature. .
[0064] The contraction potential branch consists of three sequentially decreasing convolutional kernels (e.g., 5×5, 3×3, 1×1) and a second channel-spatial attention module cascaded with the three sequential convolutional kernels.
[0065] Hierarchical feature extraction: Input data After being processed by convolutional layers with progressively smaller kernels arranged in a series, the output features enter the second channel – the spatial attention module.
[0066] Attention Weighting: The second channel - spatial attention module adaptively weights the input features and outputs contraction potential features. .
[0067] The first-channel spatial attention module and the second-channel spatial attention module employ the same architectural design. First, average pooling (AP) is used to aggregate spatial background information. Then, a 3×3 convolutional layer compresses the channel dimension, and the SiLU activation function is used to extract non-linear features. Next, a 1×1 convolutional layer restores the channel dimension to generate attention weights. Finally, element-wise multiplication applies these weights to the input features, achieving adaptive spatial modulation of the features.
[0068] The design of the expansion and contraction potentials corresponds to the nonlinear double-well potential structure in the Cahn-Hilliard equation, which respectively handles the "repulsion" and "attraction" dynamic behaviors in the phase separation process.
[0069] Expansion potential characteristics and contraction potential characteristics After the following fusion calculation, the phase separation potential data is output. :
[0070] (9)
[0071] in, The input features at the current time; This is the predicted feature for the next time step.
[0072] Output phase separation potential data Enter , It is responsible for estimating the local gradient field and generating evolution rate and orientation embedding data for feature-wise information.
[0073] See Figure 3 , The processing steps include:
[0074] (1) Calculation of directional gradient: First, the phase separation potential data is calculated through directional convolutional layers. In respectively direction and The flux gradient in the direction is given by the following formula:
[0075] (10)
[0076] in, Represents phase separation potential data exist Flux gradient in the direction; Represents phase separation potential data exist Flux gradient in the direction; express The directional convolution is composed of a convolutional layer with a kernel of 1×3 and a convolutional layer with a kernel of 1×1. express The directional convolution is composed of a convolutional layer with a kernel of 3×1 and a convolutional layer with a kernel of 1×1.
[0077] (2) Gating mechanism decomposition: The flux gradient is mapped into positive and negative components using the Sigmoid gating mechanism, and the evolution direction is controlled by the following formula:
[0078] (11)
[0079] (12)
[0080] in, The Sigmoid activation function is used to implement nonlinear gating of flux. and These represent the positive and negative components, respectively, indicating the values after processing by the Sigmoid activation function. direction and Flux in the direction; This indicates a normal convolution operation.
[0081] (3) Feature update (phase field update): The merged flux gradient is passed through a convolutional layer (e.g., The convolutional layer is projected back into the feature space, outputting incremental evolution data. The update formula is as follows:
[0082] (13)
[0083] in, This indicates a normal convolution operation.
[0084] To improve the stability and accuracy of phase field updates, the Cahn attention-guided module employs the Heun two-step propagation strategy (prediction-correction mechanism) for feature updates. The flowchart of the Heun two-step propagation strategy is shown in Table 1.
[0085] Table 1 Heun's two-step propagation strategy process
[0086]
[0087] Predictor: Features at the current time step The Cahn-AG module is input, and after calculation, it outputs the first evolutionary increment data. Calculate predictive features To obtain the predicted field;
[0088] Correction step: This step adjusts the predicted features... Input the Cahn-AG module again to output the second evolution increment data. ;
[0089] Update step: Calculate a weighted average of the first and second evolutionary increment data, and output the features for the next time step. .
[0090] Heun's two-step propagation strategy enables the Cahn-AG module to achieve both stability and accuracy when simulating Cahn-Hilliard dynamics, avoiding the accumulation of time-stepping errors in the simple Euler method.
[0091] This invention uses the phase separation potential operator and flux evolution operator in the Cahn-AG module to simulate the dynamics of "repulsion" and "attraction" in the phase separation process and the evolution of the local gradient field, respectively. Combined with the Heun two-step propagation strategy, it significantly suppresses the problems of color shift, fog residue and artifacts that are common in traditional dehazing methods, and improves the dehazing effect in complex scenes.
[0092] In this embodiment, a multi-task loss function is used to optimize the network parameters of the image dehazing network constructed in step 1. The total loss function used during training is a weighted sum of the normalized spatial loss function and the frequency domain loss function.
[0093] Spatial loss calculation: Haze-free image data output by the network Clear image data of the target Perform element-by-element difference operation, after Norm calculation outputs spatial loss data:
[0094] (14)
[0095] in, This is spatial loss data; Indicates calculation Norm.
[0096] Frequency domain loss calculation: and The data are fed into the Fast Fourier Transform (FFT) module, which outputs a frequency domain representation of the data. and ; Perform element-by-element difference operation on the two sets of frequency domain data, and then... Norm calculation outputs frequency domain loss data:
[0097] (15)
[0098] in, This is frequency domain loss data.
[0099] Total Loss Fusion: Spatial Loss Data and frequency domain loss data By weight =0.1 is used for weighted summation, and then the total number of pixels is calculated. Normalize and output total loss data. :
[0100] (16)
[0101] Total loss data The network parameters are updated using the backpropagation algorithm.
[0102] The Cahn-AG module is the core technology of this invention, which transforms the physical evolution process of the Cahn-Hilliard equation into a computational graph achievable by deep learning. The image dehazing problem is abstracted as a phase separation process: an image shrouded in fog can be considered a non-equilibrium system composed of a mixture of a "real background phase" and a "fog phase." The dehazing task is modeled as a phase separation problem, achieving effective separation of the background and fog.
[0103] The present invention has the following main advantages:
[0104] (1) This invention proposes a U-shaped dehazing framework (Cahn-Net) that integrates phase field theory. For the first time, phase field theory is introduced into the image dehazing task, injecting physical modeling capabilities into the traditional U-Net architecture and opening up a new research perspective on the dehazing problem.
[0105] (2) The present invention designs a Cahn-AG module based on the Cahn-Hilliard equation and embeds it at the end of each encoder and decoder to realize physical modeling and separation between fog and real image, effectively improving the accuracy and interpretability of the dehazing process, significantly reducing color shift and artifacts in image dehazing, and effectively overcoming the degradation problems such as color shift, fog residue and artifacts in existing image dehazing technology in real application scenarios.
[0106] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. An image dehazing method based on phase field dynamics and deep learning, characterized in that, Includes the following steps: Step 1: Model the dehazing task of hazy images as a phase separation problem, and construct an image dehazing network based on the physical prior of the Cahn-Hilliard equation. The image dehazing network adopts an encoder-decoder architecture, and each stage of the encoder-decoder architecture is composed of CahnBlocks. Each CahnBlock includes a prediction unit and a correction unit cascaded with the prediction unit. The prediction unit is used to make a preliminary prediction of the input features and output the predicted features. The correction unit is a Cahn attention guidance module, which is used to physically correct the predicted features based on the Cahn-Hilliard equation and output the corrected features. Step 2: Input the hazy image to be processed into the pre-trained image dehazing network; Step 3: In the pre-trained image dehazing network, the input hazy image is first mapped to embedded features through a convolutional layer; During the encoding stage, the embedded features are fed into a three-level encoder, which uses stride convolution to downsample step by step and extract multi-scale features. During the decoding stage, the three-level decoder performs upsampling step by step through transposed convolution, and the features output by each level decoder are concatenated with the features output by the corresponding encoder of the same scale, and then the number of channels is compressed through convolutional layers. In the residual reconstruction stage, a residual image is generated by a convolutional layer. The residual image is then added to the input hazy image to output the restored hazy image.
2. The image dehazing method based on phase field dynamics and deep learning according to claim 1, characterized in that, The Cahn attention guidance module is used to simulate the time evolution operator of the Cahn-Hilliard equation, which iteratively updates features to approximate the target state using the following formula: (6) in, This indicates the characteristics of the next moment after the correction; Indicates the characteristics of the current moment; This represents the predicted features for the next time step, output by the prediction unit. It is the time step; It is a phase-separating potential operator; It is a flux evolution operator used for combining Output and prediction features To update the features.
3. The image dehazing method based on phase field dynamics and deep learning according to claim 2, characterized in that, The phase separation potential operator includes parallel expansion potential branches and contraction potential branches; The dilatation potential branch includes three parallel convolutional layers with different kernel sizes and a first channel-spatial attention module cascaded with the three parallel convolutional layers. After the three parallel convolutional layers extract multi-scale features, the outputs of the three convolutional layers are added element by element. The added result enters the first channel-spatial attention module for adaptive weighting processing and outputs the dilatation potential feature. The contraction potential branch includes three sequential convolutional layers with progressively smaller kernels and a second channel-spatial attention module cascaded with the three sequential convolutional layers. The features output by the three sequential convolutional layers enter the second channel-spatial attention module, which performs adaptive weighting on the input features and outputs contraction potential features. The output of the phase separation potential operator is the phase separation potential data obtained by fusing the expansion potential feature and the contraction potential feature.
4. The image dehazing method based on phase field dynamics and deep learning according to claim 3, characterized in that, Both the parallel convolutional layers in the expanding potential branch and the serial convolutional layers in the contracting potential branch employ depthwise separable convolution.
5. An image dehazing method based on phase field dynamics and deep learning according to claim 3 or 4, characterized in that, The kernel sizes of the three parallel convolutional layers in the expansion potential branch are 5×5, 3×3, and 1×1, respectively; the kernel sizes of the three serial convolutional layers in the contraction potential branch are 5×5, 3×3, and 1×1, respectively.
6. An image dehazing method based on phase field dynamics and deep learning according to claim 3 or 4, characterized in that, The formula for the phase separation potential data is: (9) in, This represents the phase separation potential data; This is a characteristic of the expansion potential; It is a characteristic of contraction potential; The input features at the current time; The prediction feature for the next time step is output by the prediction unit.
7. The image dehazing method based on phase field dynamics and deep learning according to claim 2, characterized in that, The phase separation potential data output by the phase separation potential operator is fed into the flux evolution operator, and the processing procedure of the flux evolution operator includes: Phase separation potential data were calculated using directional convolution. direction and Flux gradient in the direction; The flux gradient is mapped into positive and negative components using the Sigmoid gating mechanism; The merged flux gradient is projected back into the feature space through a convolutional layer to output the evolutionary increment data.
8. The image dehazing method based on phase field dynamics and deep learning according to claim 7, characterized in that, The formula for the positive component is: (11) in, Indicates positive components; This represents the Sigmoid activation function; Indicates the predictive features for the next moment; Indicating phase separation potential data in Flux gradient in the direction; This represents a regular convolution operation; The formula for the negative component is: (12) in, Indicates the negative component; Indicating phase separation potential data in Flux gradient in the direction; The update formula for the evolutionary increment data is: (13) in, This means that the merged flux gradient is projected back into the feature space through the convolutional layer.
9. The image dehazing method based on phase field dynamics and deep learning according to claim 1, characterized in that, The Cahn attention guidance module uses the Heun two-step propagation strategy for feature updating. The Heun two-step propagation strategy includes: Prediction step: Calculate the first evolutionary increment data based on the current features to obtain the prediction field; Correction step: Calculate the second evolution increment data based on the predicted field; Update step: Perform a weighted average of the first evolutionary increment data and the second evolutionary increment data to obtain the features at the next time step.
10. The image dehazing method based on phase field dynamics and deep learning according to claim 1, characterized in that, The total loss function used when training the image dehazing network is a weighted sum of the normalized spatial loss function and the frequency domain loss function.