Inference resource adaptive method and system for flow matching defogging based on physical scattering parameter perception
Patent Information
- Application Number
- CN202611147368.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-08-28
AI Technical Summary
[0008]针对上述现有技术存在的缺陷,本发明的主要目的在于提供一种基于物理散射参数感知的流匹配去雾推理资源自适应方法与系统,旨在解决现有可见光图像去雾方法在真实户外场景中对人工雾等级标注与真实雾图物理退化标签依赖强、固定推理步数与单步步长导致轻雾算力浪费与重雾恢复不足、以及跨域部署时感知不确定性导致的映射失准等问题
(1)本发明通过获取成对的清晰RGB图像和场景深度图,依据大气散射模型在线生成训练雾图,并直接根据物理散射系数生成分类标签与回归目标。结合构建的特征提取骨干网络和双任务输出头结构进行联合训练,使得网络能够在不依赖真实雾图物理退化标签和人工离散雾强度等级标注的前提下,自主学习和输出连续散射系数估计值与等级置信度,极大地降低了训练数据获取的门槛与人工成本。
Smart Images

Figure CN122656912A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a flow matching dehazing inference resource adaptive method and system based on physical scattering parameter perception. Background Technology
[0002] Image dehazing is an important research topic in the field of computer vision, aiming to restore visible light images degraded by atmospheric scattering. Physical dehazing methods based on the Atmospheric Scattering Model (ASM) have always been a research hotspot. In recent years, with the rise of generative models, diffusion-based generative models such as flow matching have been successfully applied to image dehazing tasks due to their strong distribution fitting capabilities.
[0003] However, existing physical perception-based flow matching dehazing methods and related systems still generally suffer from the following technical shortcomings in real-world outdoor deployments: First, existing technologies heavily rely on real physical degradation labels or artificial fog level annotations. In real outdoor environments, obtaining accurate atmospheric physical scattering coefficients requires expensive specialized measurement equipment, while manually annotating fog intensity levels is highly subjective. This causes defogging models to heavily depend on synthetic or collected data with physical labels during the training phase, making it difficult to conduct effective physical degradation perception training directly from data without physical degradation labels.
[0004] Second, existing flow matching dehazing models use a fixed number of sampling steps and a single fixed step size, which fails to achieve adaptive allocation of inference resources. In real-world scenarios, fog concentration varies greatly, and most existing methods set the total number of sampling steps to a fixed constant, and the magnitude of a single state update is also a fixed value. This leads to a large amount of redundant computation and wasted computing power in light fog scenarios; while in heavy fog scenarios, the limited fixed number of inference steps cannot provide sufficient time steps for the velocity field network to fully recover, resulting in unsatisfactory dehazing results.
[0005] Third, existing technologies lack fault-tolerant fallback mechanisms for uncertain perception results, leading to insufficient robustness during cross-domain deployment. When there is a domain shift between the training and test sets, traditional scheduling models often directly map based on the perception results. Once the perception network output becomes uncertain or misjudged due to data from outside the domain, the scheduling strategy will be severely inaccurate (e.g., misjudging light fog as heavy fog and performing a lot of useless computation, or misjudging heavy fog as light fog and resulting in incomplete recovery). Existing solutions lack protective decision-making mechanisms for perception uncertainty.
[0006] Fourth, existing defogging resource scheduling schemes lack fine-grained perception of continuous physical scattering parameters. Most schemes rely solely on manually defined discrete fog intensity levels for heuristic adjustment of the number of sampling steps. This discretized level mapping is coarse-grained, ignoring the continuous changes in fog concentration across physical dimensions. It is difficult to achieve precise joint fine-grained control of the "number of sampling steps - single step size" that accurately matches the degree of physical degradation, thus hindering the balanced improvement of inference efficiency and recovery quality.
[0007] In summary, the key technical problem that urgently needs to be solved in this field is how to establish a flow matching dehazing inference system that can continuously and finely perceive physical scattering parameters without the need for real physical degradation labels and manual discrete level annotation, and can jointly and adaptively adjust the number of sampling steps and the single step size based on the perception results, while also having the ability to protect against uncertainty in cross-domain deployment. Summary of the Invention
[0008] To address the shortcomings of the existing technologies, the main objective of this invention is to provide an adaptive method and system for flow matching dehazing inference resources based on physical scattering parameter perception. This aims to solve problems such as the strong dependence of existing visible light image dehazing methods on artificial fog level labeling and physical degradation labels of real fog images in real outdoor scenarios, the waste of computing power for light fog and insufficient recovery of heavy fog due to fixed inference steps and single step size, and the mapping inaccuracy caused by perception uncertainty when deploying across domains.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a flow matching dehazing inference resource adaptive method based on physical scattering parameter awareness, comprising the following steps: Step S1: Obtain pairs of clear RGB images and scene depth maps, generate training fog maps online based on the atmospheric scattering model, and generate fog intensity level classification labels and scattering coefficient normalized regression targets based on the physical scattering coefficient β. Step S2: Construct a physical scattering parameter sensing network that includes a feature extraction backbone network, a feature convergence layer, and a dual-task output head; using the training fog map generated in step S1 as input, jointly train the physical scattering parameter sensing network using the classification label and regression target to obtain the trained sensing network; Step S3: Input the real fog image to be recovered into the trained perception network, output the continuous scattering coefficient estimate and fog intensity level confidence, adaptively determine the sampling steps and single-step scaling factor for flow matching defogging based on the continuous scattering coefficient estimate, and determine whether to backtrack to a conservative number of steps based on the confidence level. Step S4: Input the real fog image to be restored, the number of sampling steps, and the single-step scaling factor into the pre-trained flow matching defogging network, perform iterative inference based on the physical degradation perception parameters, and output the final defogging image.
[0010] Furthermore, the specific method for generating the training fog map and supervision labels online in step S1 is as follows: The scene depth map is normalized to map the depth values to the [0, 1] interval; Within the preset physical range [β] min ,β max The physical scattering coefficient β is randomly sampled in layers to ensure that the training samples for each fog intensity level are balanced. A non-uniform fog texture map generated by Markov chain Brownian motion is introduced into the clear RGB image, and combined with randomly sampled atmospheric light values A, the training fog map is synthesized according to the atmospheric scattering model. The physical scattering coefficient β obtained from the sampling is normalized to the interval [0, 1] as the target of the scattering coefficient normalization regression, and the level index at the time of sampling is used as the classification label of the fog intensity level.
[0011] Furthermore, the physical scattering parameter sensing network in step S2 includes a classification head and a regression head; The classification head is used to output the discrete category log probability of fog intensity, and calculate the difference between the maximum probability value and the second largest probability value in the category log probability to obtain the confidence level of the fog intensity level; The regression head is used to output the estimated value of the continuous scattering coefficient; The loss function for the joint training is a weighted sum of the cross-entropy classification loss and the smoothed L1 regression loss.
[0012] Furthermore, the method for adaptively determining the number of sampling steps based on the continuous scattering coefficient estimate in step S3 includes any of the following modes: Mode A: A preset set of candidate steps and corresponding step thresholds are used. Based on the threshold range into which the estimated continuous scattering coefficient falls, the corresponding sampling steps are selected from the candidate step set. Mode B: Based on the statistical mean and variance of the unlabeled fog map set of the target domain, the estimated value of the continuous scattering coefficient is converted into a standard score, and continuous mapping is performed through the sigmoid function. The corresponding sampling steps are selected from the candidate step set according to the mapping result.
[0013] Furthermore, the specific method for determining the single-step scaling factor (scale) in step S3 is as follows: Set the minimum and maximum scaling factors according to the formula. The single-step scaling factor is dynamically calculated, where The estimated value of the continuous scattering coefficient.
[0014] Furthermore, before deploying the target domain, step S3 also includes an unsupervised target domain calibration step: Obtain an unlabeled fog map set of the target domain, input it in batches into the trained perception network, and collect the estimated values of the continuous scattering coefficients of each sample; An empirical threshold is calculated based on a preset quantile and used as the step threshold for mode A; and / or, the mean and variance of the estimated values are statistically analyzed to construct the mapping parameters in mode B.
[0015] Furthermore, the trigger condition for determining whether to roll back to a conservative number of steps in step S3 is: When the confidence level of the fog intensity level is less than a preset confidence threshold; or, When the absolute difference between the estimated value of the continuous scattering coefficient and the pre-configured step threshold is less than the preset neighbor threshold; When any of the above conditions are met, the number of sampling steps is reset to a preset conservative number of sampling steps.
[0016] Furthermore, the update formula for iterative inference based on physical degradation perception parameters in step S4 is as follows: ; Where, x i For the state diagram of step i, ν θ For the pre-trained flow matching velocity field network, T is the flow time endpoint, t i Where N is the current time step, N* is the number of sampling steps, and scale is the scaling factor for the single-step size.
[0017] Furthermore, in step S3, before inputting the real fog image to be recovered into the perception network, the real fog image is first scaled to the preset resolution size during the training of the perception network, and then forward inference is performed to output the physical degradation representation.
[0018] Secondly, the present invention also provides a flow matching dehazing inference resource adaptive system based on physical scattering parameter awareness, comprising: The data synthesis module is used to acquire pairs of clear RGB images and scene depth maps, generate training fog maps online based on the atmospheric scattering model, and generate fog intensity level classification labels and scattering coefficient normalized regression targets based on the physical scattering coefficient β. The perception network training module is used to construct a physical scattering parameter perception network that includes a feature extraction backbone network and a dual-task output head, and to perform joint training with the training fog map generated by the data synthesis module as input, and output the trained perception network. The inference resource scheduling module is used to input the real fog map to be restored into the perception network, output the continuous scattering coefficient estimate and fog intensity level confidence, adaptively determine the sampling steps and single-step scaling factor of flow matching defogging based on the continuous scattering coefficient estimate, and determine whether to perform rollback to a conservative number of steps based on the confidence level. The flow matching dehazing inference module is used to input the real fog image to be restored, the number of sampling steps, and the single-step scaling factor into the pre-trained flow matching dehazing network, perform iterative inference based on the physical degradation perception parameters, and output the final dehazed image.
[0019] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention acquires paired clear RGB images and scene depth maps, generates training fog maps online based on an atmospheric scattering model, and directly generates classification labels and regression targets based on physical scattering coefficients. By combining the constructed feature extraction backbone network and the dual-task output head structure for joint training, the network can autonomously learn and output continuous scattering coefficient estimates and level confidence without relying on real fog map physical degradation labels and manual discrete fog intensity level annotations, which greatly reduces the threshold and manual cost of acquiring training data.
[0020] (2) This invention calls the trained perception network to output continuous physical degradation representations during the inference phase, and adaptively determines the sampling steps and single-step scaling factor for flow matching defogging based on these continuous scattering coefficient estimates. This mechanism replaces the existing fixed sampling steps and single-step scaling factor scheme, enabling the system to flexibly schedule according to the actual physical degradation degree of the fog concentration in the scene. It achieves a precise trade-off between reducing invalid computation to lower computing power consumption in light fog scenes and increasing the number of inference steps and step size to improve recovery quality in heavy fog scenes.
[0021] (3) In the adaptive scheduling process, this invention creatively introduces an uncertainty assessment step. By calculating the confidence level of the fog intensity level output by the perception network, it determines whether to backtrack to a conservative number of steps based on the confidence level. When there is a large uncertainty in the perception result (such as when facing abnormal inputs with a distribution offset between the training domain and the target domain), the system can avoid extreme scheduling schemes in a timely manner and backtrack to a conservative number of inference steps, effectively preventing insufficient defogging recovery or extreme waste of computing power due to perception misjudgment, and significantly improving the system's fault tolerance and survivability in unknown domain scenarios.
[0022] (4) In this invention, the scheduling parameters (number of sampling steps and single-step scaling factor) output by the perception network are jointly input into the pre-trained flow matching dehazing network along with the real fog map to be recovered, participating in the update process of iterative inference. The pre-trained flow matching dehazing model has the ability to dynamically adjust according to the degree of physical degradation, so that the generation trajectory of the final dehazing result is directly modulated and guided by the physical scattering parameters, which enhances the physical interpretability of the dehazing process while ensuring the strong recovery capability of the generative model. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the adaptive resource method for flow matching dehazing inference based on physical scattering parameter perception, according to an embodiment of the present invention. Figure 2 This is a diagram of the BetaPPM network architecture according to an embodiment of the present invention; Figure 3 This is a structural diagram of the inference resource adaptive control module according to an embodiment of the present invention. Detailed Implementation
[0024] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are for illustrative purposes only and should not be considered as limiting the scope of the invention. All other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present invention.
[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] like Figure 1 As shown, the present invention provides a flow matching dehazing inference resource adaptation method based on physical scattering parameter awareness, which includes the following four steps: Step 1: Online fog map synthesis and physically supervised generation; Step 2: Training the BetaPPM dual-head perceptron; Step 3: Scattering intensity sensing and sampling step scheduling; Step 4: Stream matching defogging inference.
[0027] For step 1: Online fog map synthesis and physically supervised generation, the inputs are a clear RGB image J(x), a scene depth map d(x), and physical scattering coefficients β. The clear RGB image and the scene depth map are acquired in pairs. The depth map information can be obtained through various means such as RGB-D devices, monocular depth estimation models (such as RA-Depth, DepthAnything, etc.), or LiDAR projection.
[0028] To eliminate the reliance on real physical annotations, this embodiment executes the following process: (1) Depth Normalization: Transform the depth map to the [0,1] interval, using the following formula:
[0029] in, The normalized depth value used for final ASM calculation is d(x), which is the original value of the input raw scene depth map (or disparity map) at pixel coordinate x. The minimum pixel value in the entire original depth map d(x) This is the result of the initial linear inversion transformation of the original depth map (intermediate transformed depth map). and These are intermediate transformation depth maps. The minimum and maximum values in the range. First calculate... This is a physically inverted mapping of the original depth. This operation ensures that pixels farther from the sensor (with a smaller original depth value d(x)) have a more accurate mapping of the intermediate variable. The larger the value, the more accurately it matches the actual physical attenuation law that "fog becomes denser at greater distances." Subsequently, the Min-Max linear normalization formula was used to... Compressing to the [0, 1] interval eliminates the numerical scale bias caused by the difference in measurement range between different depth sensors.
[0030] (2) Layered random sampling of scattering coefficients: The range of values for the physical scattering coefficient β is a preset [β... min ,β max The typical range of values for β is... min =0.2,β max =2.8, corresponding to light fog and extremely heavy fog, respectively. To ensure balanced training samples for each fog intensity level, a stratified sampling strategy is adopted: first, levels l∈{0,…,L-1} are uniformly and randomly selected, and then β is sampled within the sub-intervals corresponding to each level. The formula for sub-interval division is:
[0031] Wherein, parameter l represents the level index uniformly extracted from L discrete fog intensity levels (e.g., l∈{0,…,L-1}), and Δ represents the length occupied by each level interval.
[0032] This step strictly incorporates boundary margins during sampling. To avoid the sampled value β falling exactly on the boundary of adjacent levels, the actual sampling interval is adjusted to... It can eliminate network oscillations caused by label ambiguity during training (i.e., the network cannot determine whether a certain image belongs to "heavy" or "extra heavy"), ensuring smooth convergence of classification tasks in subsequent dual-head networks.
[0033] (3) ASM Non-uniform Fog Map Synthesis: To simulate the non-uniform distribution of fog affected by wind and terrain in real-world scenes, and to make the synthesized fog map more closely resemble real-world physical non-uniform degradation, this embodiment introduces a non-uniform fog texture map M(x) generated by Markov Chain Brownian Motion (MCBM). The synthesis process is as follows:
[0034] Where x represents the spatial coordinates (horizontal and vertical positions) of an image pixel. β map (x) is the spatial distribution map of the physical scattering coefficient, which is the final output result after non-uniform modulation, representing the specific "fog concentration" value of each pixel in the image. β is the global basic physical scattering coefficient, which is the macroscopic fog concentration index generated by hierarchical random sampling in step 1 of this method (typical value in the range of [0.2, 2.8]), which determines the average density of fog in the entire image. η is the non-uniformity intensity coefficient, which is a preset constant (e.g., 0.2 or 0.3) used to control the fluctuation amplitude of fog texture. The larger η is, the more uneven the distribution of fog in the image; when η is 0, the synthesized fog will be absolutely uniform. M(x) is the fog texture map generated by Markov chain Brownian motion (MCBM), which simulates the "random and irregular diffusion" of clouds and fog in nature. The value of each pixel in the map is usually distributed between 0 and 1 (some implementations may vary slightly, but it is usually normalized to [0,1]). 0.5 and 2 are adjustment constants. Since the typical value of MCBM texture M(x) is between 0 and 1, "subtracting 0.5" is to shift the fluctuation center to 0, and "multiplying by 2" is to stretch the fluctuation amplitude to the range of [-1, 1]. After this operation, the fluctuation of M(x) can linearly affect the final scattering coefficient β between 1-η times and 1+η times. map (x).
[0035] I(x) is the final synthesized foggy image (i.e., the data used for training). J(x) is the initial clear RGB image (the original fog-free photo). t(x) is the transmittance map (physically representing the proportion of light passing through the fog to reach the camera, with values between 0 and 1. 0 represents complete occlusion, and 1 represents no attenuation). A∈[A min A max ] represents random atmospheric light, which is the color and brightness of light after it is completely scattered by fog at infinity. Usually, a value is randomly sampled during training, for example, extracted from a uniform interval of [0.6, 1.0] or [0.7, 1.0], to simulate atmospheric light under different lighting and weather conditions.
[0036] (4) Supervision label generation: Classification labels directly record fog intensity level: y cls =l; The regression target normalizes the physical scattering coefficient: The final output is the synthesized fog map I(x) and the classification label y. cls and regression target β norm .
[0037] For step 2: BetaPPM dual-head perceptron training. For example... Figure 2 As shown, this step uses the synthetic fog map I(x) generated in step 1 as input to construct and train the Physical Scattering Parameter Perception Network (BetaPPM). This network includes a feature extraction backbone network, a feature pooling layer, and a dual-task output head.
[0038] (1) Network forward process: The feature extraction backbone network can adopt lightweight CNN, ResNet50, DenseNet121 or EfficientNet-B0 architectures to extract image feature maps F. The feature pooling layer performs global average pooling on the feature map to obtain g=GAP(F), and then passes it through the feature projection layer (containing Dropout and ReLU activation functions) to map and obtain the feature vector h.
[0039] The dual-task output head includes a classification head and a regression head, which calculate the classification log probability and the regression normalized scattering coefficient, respectively.
[0040] Here, logits is the raw log probability value of the classification output head. It is a vector of length L that has not been normalized by activation functions such as Softmax. Its physical meaning is the network's raw prediction score for the current fog map to belong to each level (light, medium, heavy, etc.) (the higher the score, the more likely the network thinks the class is).
[0041] z is the converged high-dimensional feature vector. It is a compact feature representation obtained by extracting image features from the previous backbone network, followed by dimensionality reduction through global average pooling (GAP) and projection layers (containing Dropout and activation functions). This vector condenses all visual information related to physical degradation in the current fog image.
[0042] W cls Let be the learnable weight matrix for the classification head. It is a trainable linear transformation matrix. The number of rows depends on the total number L of fog intensity levels (e.g., if fog is divided into 5 levels, the number of rows is 5), and the number of columns is equal to the dimension of the feature vector h. Its function is to map the high-dimensional feature vector h to the decision space of "fog intensity category".
[0043] b clsThis is a learnable bias vector for the classifier head. It is also a trainable vector with the same dimension as the total number of classes L. It is used to adjust the overall output baseline during mathematical calculations, ensuring the network can sensitively find the decision boundaries for classification.
[0044] The logits are not directly used for the final scheduling, but rather for calculating the subsequent "confidence margin". In step 3, we use the difference between the maximum and second-largest values of the logits vector, margin=z. (1) -z (2) This quantifies the network's "confidence" in the current judgment. If the two largest scores in the classification logits are very close, it indicates that the network itself is also hesitant (the classification is unclear). In this case, the invention will trigger an uncertainty conservative backoff mechanism, which significantly improves the system's security.
[0045] This is the normalized physical scattering coefficient for the predicted output. It is the core scheduling index in the technical solution of this invention. The value is between 0 and 1, with the closer to 1 indicating a higher predicted fog concentration by the network.
[0046] σ is the Sigmoid activation function. This is a non-linear activation function whose mathematical property is to hard-compress (map) the values of any real number field (-∞, +∞) to the interval [0, 1].
[0047] z is the same high-dimensional feature vector as in Equation 1. The two output heads share the same feature extraction base, achieving parameter sharing, significantly reducing computational load and enhancing the physical consistency of features.
[0048] W β This is the learnable weight vector (or matrix) for the regression head. Its function is to map high-dimensional features into a single-valued real number space. Because we need to output a single continuous physical value (normalized scattering coefficient), the final output dimension of this weight is 1.
[0049] b β This is a learnable bias scalar for the regression head. It is used to adjust the numerical offset during the mapping process.
[0050] The goal of this invention is to normalize the physical scattering coefficient β to the [0,1] interval. The neural network performs a linear mapping (W... β z+b β When σ is added, the original output value may be 5.0 or -3.0. Without σ, the range of the network output will lose its physical constraints, making it unsuitable as a basis for calculating the subsequent "scaling factor (scale)" and "number of sampling steps (N')".
[0051] After adding σ, the network output Strictly confined to the [0,1] range within physical constraints, this ensures that the physical prior logic in subsequent step 3, "the denser the fog, the larger the output value, resulting in more allocated computing power steps and a larger single-step scaling factor," can be accurately implemented.
[0052] (2) Joint Loss Function: The network is trained under supervision using a joint loss function.
[0053] Where L is the loss function; L cls Cross-entropy loss (with optional label smoothing technique) is used to supervise the classification task of discrete fog intensity levels; L reg λ is the Smooth L1 loss, used to supervise the regression task of continuous scattering coefficients. λ is the regression weight, used to balance the training intensity of the two tasks; in this embodiment, a value of 0.5 is preferred. After training, the optimal network weights are saved for use in the inference phase.
[0054] Using classification loss or regression loss alone cannot achieve optimal results. By using joint loss, the network can both macroscopically determine the "fog level (light / medium / heavy)" of the image and microscopically infer the "specific physical density value". This complementary dual-head joint training method provides data support for scheduling decisions in the subsequent inference stage that combines qualitative robustness with quantitative precision.
[0055] For step 3: Scattering intensity sensing and sampling step scheduling. This step is a prerequisite for resource scheduling in the inference phase, such as... Figure 3 As shown.
[0056] (1) Scattering intensity perception: The real fog image to be recovered is scaled to the training resolution (e.g., 224×224 or 256×256), and the trained BetaPPM is input. The network outputs continuously normalized scattering coefficients. ∈(0,1), and the logarithmic probabilities of L fog intensity levels.
[0057] To assess the uncertainty of the perceived results, this invention calculates the difference between the maximum and second-largest values in the logarithmic probability as the confidence margin:
[0058] Where z (1) and z (2) These represent the maximum and second-largest values of the logarithmic probability, respectively.
[0059] (2) Adaptive scheduling of sampling steps: Preset candidate step set N={N0,N1,…,N…} K-1(e.g., [1, 5, 10, 20]). Sampling step scheduling can be performed using any of the following modes: Mode A (Threshold Segmentation Mapping): The number of steps is selected based on the threshold interval into which the estimated value falls. The formula is:
[0060] Mode B (z-sigmoid continuous mapping): Utilizes statistical information from the target domain for continuous mapping. The formula is:
[0061] This is the estimated normalized continuous scattering coefficient output by the network, ranging from (0, 1). A larger value indicates denser fog in the current image, while a smaller value indicates lighter fog. This is the core physical basis for scheduling computing power in this method.
[0062] N is a preset set of candidate steps, such as N={1,5,10,20}. It contains K discrete values. K is the total number of options in the set.
[0063] N * The final number of sampling steps is determined and output to step 4.
[0064] In pattern A, τ k It is a static empirical threshold used to divide the step interval, τ0,τ1,...,τ K-2 These are pre-set (or calibrated using target domain quantiles) critical values for fog concentration. For example, if τ0 = 0.3 and τ1 = 0.6 are set.
[0065] N k This represents the number of sampling steps within the corresponding threshold interval. When the value falls into the k-th interval, the model will select N candidate steps for that interval. k .
[0066] For example: light fog ( <0.3), switch to level 1 (clear fog with very few steps); moderate fog (0.3≤ <0.6), switch to the second gear; if the fog is extremely heavy, switch to the highest gear.
[0067] In Mode B, μ and σ are the reference mean and standard deviation obtained from batch inference statistics of the unlabeled fog atlas of the target domain; k and b are the control parameters of the Sigmoid curve. k controls the steepness of the transition from light fog to heavy fog; b controls the position of the curve's translation center.
[0068] z represents the standard score (Z-score). This represents the perceived fog density of the current image. This is compared to the center position (μ) statistically determined from the target domain, and divided by the degree of dispersion (σ). This indicates how "special" the current fog concentration is relative to the historical statistics of the target domain.
[0069] w represents the output weights of the Sigmoid function. The value ranges from 0 to 1, representing the "proportional position" of the current fog concentration among the K candidate steps.
[0070] idx is a discrete index in the candidate step set N. The round() function is used to convert the continuous proportional weights w into the nearest integer index.
[0071] N*=N[idx]: Based on the calculated index value, retrieve the final execution step from the candidate step set.
[0072] Model B performs a smooth "curve mapping" based on the relative position of fog concentration in the statistical distribution of the entire target domain. For example, if the fog concentration is in an awkward position that is neither too light nor too heavy, Model A may get stuck at the boundary, while Model B will smoothly give a number of steps in the middle.
[0073] Mode B overcomes the shortcoming of Mode A, which suffers from poor adaptability due to fixed thresholds during cross-domain deployment. Because μ and σ are statistically calculated in real time for the actual target environment, Mode B has extremely strong cross-domain adaptive capabilities. It is suitable for scenarios with extremely high scheduling precision, such as cloud inference and high-performance computing servers, where frequent handling of different data distribution differences is required.
[0074] Mode A is suitable for lightweight hardware with extremely high real-time requirements and limited computing power; Mode B utilizes target domain statistics to perform unsupervised calibration of the scheduling strategy, greatly improving the system's distributed adaptive capability during cross-domain deployment. Both modes strictly adhere to the physical prior that "the larger the physical scattering coefficient (the denser the fog), the more sampling steps are allocated," solving the problems of "wasting time in light fog and insufficient recovery in heavy fog" in traditional fixed-step models.
[0075] (3) Unsupervised calibration of the target domain: Before deploying the target domain, to address the distribution offset between the training domain and the target domain, batch inference is performed on the unlabeled fog map of the target domain, and all samples are collected. Estimated value. Calculate the empirical threshold τ based on preset quantiles {qk} (e.g., 0.70, 0.85, 0.95). k Used for pattern A; or statistical mean μ ref Standard deviation σ ref Mapping parameters used to construct pattern B.
[0076] (4) Adaptive Single-Step Scaling Factor: In addition to adaptive sampling steps, this invention also dynamically modulates the effective step size for each flow matching update. The specific formula is:
[0077] Where, scale min and scale max These are the preset lower and upper limits for step scaling; the clamp function ensures that the output is strictly limited within the specified range.
[0078] (5) Uncertainty Conservative Rollback: After determining the number of sampling steps, if any of the following conditions are met, the system will force a rollback to the conservative number of steps N. safe To avoid extreme scheduling: Low confidence: when margin < δ margin hour; Near-threshold determination: When the absolute difference between the estimated value of the continuous scattering coefficient and the preset threshold is less than the nearest threshold, i.e. hour.
[0079] Where, δ margin This is the confidence level warning line. This serves as a threshold-based warning line. Real-world testing environments contain numerous out-of-domain anomalies (such as imaging styles from different sensors or extreme weather). If network perception is uncertain or physical estimation is on the verge of failure, directly using dynamic steps can easily lead to severe recovery failures. This fallback mechanism acts as a "safety valve," forcibly reducing computational scheduling risks when the network is "unconfident," ensuring the system's fault tolerance and robustness in complex scenarios.
[0080] Finally, this step outputs the scheduling triplet. This will be used to inject the defogging main network in the next step.
[0081] For step 4: Stream matching dehazing inference, this step receives the scheduling parameters N* and scale from step 3, as well as the fog map I to be restored. hazy This drives the pre-trained stream matching dehazing network to complete the recovery.
[0082] (1) Sampler initialization: Initialization state x0=I hazy The initial transmittance is estimated using the dark channel prior (DCP) to assist the flow matching process.
[0083] (2) Iterative Update: In the multi-step case, the process is repeated cyclically for i=0,1,…,N*-1. The pre-trained flow matching velocity field network ν is called. θ (x i ,t i The update direction is predicted, and the scheduling parameters are jointly injected into the ODE discretization process. The update formula is:
[0084] Where, x i This is the network state diagram for the i-th step in the defogging evolution process (initialized as the original fog diagram I). hazy T is the end point of the flow time, t i This is the current time step. θ This is a pre-trained flow-matching velocity field network responsible for predicting the update direction required for image restoration in the current state. N* and scale are the joint scheduling parameters determined in step 3 based on the physical scattering estimate. In the case of single-step sampling (N*=1), the denominator N* in the above formula is 1, that is, the update is directly performed with (T-t0)∙scale as the effective step size.
[0085] Traditional flow matching dehazing methods employ a fixed number of steps driven purely by data during the inference phase, ignoring the physical degradation of the current real-world image. This invention, through the aforementioned update formula, directly injects the physically perceived parameters (N* and scale) into the discretization solution of the flow matching ordinary differential equation (ODE), allowing the evolution trajectory of the dehazing main network to be directly modulated by the physical scattering parameters. This deep coupling between the physical and generative models ensures that regardless of the current fog concentration, the dehazing result can restore a physically consistent and visually clear high-quality image with the most reasonable computational power consumption.
[0086] (3) Output results: After the iteration is completed, the final recovered dehazed image is output. .
[0087] like Figure 1 As shown, the present invention also provides an adaptive resource system for flow matching dehazing inference based on physical scattering parameter perception. The system uses the above-mentioned method for dehazing inference and specifically includes a data synthesis module, a perception network training module, an inference resource scheduling module, and a flow matching dehazing inference module.
[0088] The data synthesis module is used to perform step 1. This module acquires paired clear RGB images and scene depth maps, generates training fog maps online based on an atmospheric scattering model, and performs depth normalization, scattering coefficient hierarchical sampling, and non-uniform fog map synthesis. The final output is a synthesized fog map I(x) and fog intensity level classification labels y. cls and scattering coefficient normalized regression target β norm .
[0089] The perceptual network training module is used to perform step 2. This module constructs a physical scattering parameter perceptual network that includes a feature extraction backbone network and a dual-task output head. Using the synthetic fog map generated by the data synthesis module as input, it performs joint training by combining classification labels and regression targets, outputting the trained perceptual network (BetaPPM).
[0090] The inference resource scheduling module is used to execute step 3. This module receives the real fog image to be recovered, scales it to the training resolution, and inputs it into the perceptron network to obtain continuous scattering coefficient estimates. And confidence margin. It dynamically determines the number of sampling steps N* based on a preset mode A or mode B, calculates the single-step scaling factor scale using a proportional formula, and triggers a conservative backoff mechanism based on the confidence margin, finally outputting a scheduling triple (N*, scale, ... ).
[0091] The flow matching dehazing inference module is used to execute step 4. This module receives the hazy image to be restored, the number of sampling steps N*, and the step size scaling factor scale. By calling the pre-trained flow matching velocity field network, it updates and solves the solution according to the joint modulation iterative formula unique to this invention, and finally outputs the restored clear dehazed image. .
[0092] Furthermore, in step 3, the "target domain unsupervised calibration" step can be automatically executed by the inference resource scheduling module before actual target domain deployment, involving data collection, statistical analysis, and parameter configuration. This process collects a large number of scattering coefficient estimates based on the unlabeled fog atlas of the target domain and maps empirical thresholds to quantiles, greatly improving the system's scene adaptability and defogging stability during cross-domain deployment.
[0093] Furthermore, in step 4, the flow-matched velocity field network ν θ The preferred method is to obtain the parameters through offline pre-training based on large-scale clear-synthetic fog map pairs. The parameters remain fixed during the inference phase, and the method only receives the scheduling parameters passed from the inference resource scheduling module for dynamic control of the nonlinear ODE solution process.
[0094] Furthermore, Mode A (threshold segmented mapping) and Mode B (z-sigmoid continuous mapping) in step 3 are two preferred parallel implementation methods. In specific implementation, the configuration can be selected according to the actual computing power platform and the statistical characteristics of the scenario. The scope of protection of this invention is not limited to a specific mapping method.
[0095] The above description is merely a preferred embodiment of the present invention and does not constitute any limitation on the technical scope of the present invention. Therefore, any minor modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A resource-adaptive method for flow matching dehazing inference based on physical scattering parameter awareness, characterized in that, Includes the following steps: Step S1: Obtain pairs of clear RGB images and scene depth maps, generate training fog maps online based on the atmospheric scattering model, and generate fog intensity level classification labels and scattering coefficient normalized regression targets based on the physical scattering coefficient β. Step S2: Construct a physical scattering parameter sensing network that includes a feature extraction backbone network, a feature convergence layer, and a dual-task output head; using the training fog map generated in step S1 as input, jointly train the physical scattering parameter sensing network using the classification label and regression target to obtain the trained sensing network; Step S3: Input the real fog image to be recovered into the trained perception network, output the continuous scattering coefficient estimate and fog intensity level confidence, adaptively determine the sampling steps and single-step scaling factor for flow matching defogging based on the continuous scattering coefficient estimate, and determine whether to backtrack to a conservative number of steps based on the confidence level. Step S4: Input the real fog image to be restored, the number of sampling steps, and the single-step scaling factor into the pre-trained flow matching defogging network, perform iterative inference based on the physical degradation perception parameters, and output the final defogging image.
2. The method according to claim 1, characterized in that, The specific method for generating the training fog map and supervision labels online in step S1 is as follows: The scene depth map is normalized to map the depth values to the [0, 1] interval; Within the preset physical range [β] min ,β max The physical scattering coefficient β is randomly sampled in layers to ensure that the training samples for each fog intensity level are balanced. A non-uniform fog texture map generated by Markov chain Brownian motion is introduced into the clear RGB image, and combined with randomly sampled atmospheric light values A, the training fog map is synthesized according to the atmospheric scattering model. The physical scattering coefficient β obtained from the sampling is normalized to the interval [0, 1] as the target of the scattering coefficient normalization regression, and the level index at the time of sampling is used as the classification label of the fog intensity level.
3. The method according to claim 1, characterized in that, The physical scattering parameter sensing network in step S2 includes a classification head and a regression head; The classification head is used to output the discrete category log probability of fog intensity, and calculate the difference between the maximum probability value and the second largest probability value in the category log probability to obtain the confidence level of the fog intensity level; The regression head is used to output the estimated value of the continuous scattering coefficient; The loss function for the joint training is a weighted sum of the cross-entropy classification loss and the smoothed L1 regression loss.
4. The method according to claim 1, characterized in that, The method for adaptively determining the number of sampling steps based on the continuous scattering coefficient estimate in step S3 includes any of the following modes: Mode A: A preset set of candidate steps and corresponding step thresholds are used. Based on the threshold range into which the estimated continuous scattering coefficient falls, the corresponding sampling steps are selected from the candidate step set. Mode B: Based on the statistical mean and variance of the unlabeled fog map set of the target domain, the estimated value of the continuous scattering coefficient is converted into a standard score, and continuous mapping is performed through the sigmoid function. The corresponding sampling steps are selected from the candidate step set according to the mapping result.
5. The method according to claim 1, characterized in that, The specific method for determining the single-step scaling factor (scale) in step S3 is as follows: Set the minimum and maximum scaling factors according to the formula. The single-step scaling factor is dynamically calculated, where The estimated value of the continuous scattering coefficient.
6. The method according to claim 4, characterized in that, Before deploying the target domain, step S3 also includes an unsupervised target domain calibration step: Obtain an unlabeled fog map set of the target domain, input it in batches into the trained perception network, and collect the estimated values of the continuous scattering coefficients of each sample; An empirical threshold is calculated based on a preset quantile and used as the step threshold for mode A; and / or, the mean and variance of the estimated values are statistically analyzed to construct the mapping parameters in mode B.
7. The method according to claim 1, characterized in that, The trigger condition for determining whether to roll back to a conservative step number in step S3 is: When the confidence level of the fog intensity level is less than a preset confidence threshold; or, When the absolute difference between the estimated value of the continuous scattering coefficient and the pre-configured step threshold is less than the preset neighbor threshold; When any of the above conditions are met, the number of sampling steps is reset to a preset conservative number of sampling steps.
8. The method according to claim 1, characterized in that, The update formula for iterative inference based on physical degradation sensing parameters in step S4 is as follows: ; Where, x i For the state diagram of step i, ν θ For the pre-trained flow matching velocity field network, T is the flow time endpoint, t i Where N is the current time step, N* is the number of sampling steps, and scale is the scaling factor for the single-step size.
9. The method according to claim 1, characterized in that, In step S3, before inputting the real fog image to be recovered into the perception network, the real fog image is first scaled to the preset resolution size during the training of the perception network, and then forward inference is performed to output the physical degradation representation.
10. A flow matching dehazing inference resource adaptive system based on physical scattering parameter perception, characterized in that, include: The data synthesis module is used to acquire pairs of clear RGB images and scene depth maps, generate training fog maps online based on the atmospheric scattering model, and generate fog intensity level classification labels and scattering coefficient normalized regression targets based on the physical scattering coefficient β. The perceptual network training module is used to construct a physical scattering parameter perceptual network that includes a feature extraction backbone network and a dual-task output head, and to perform joint training with the training fog map generated by the data synthesis module as input, and output the trained perceptual network. The inference resource scheduling module is used to input the real fog map to be restored into the perception network, output the continuous scattering coefficient estimate and fog intensity level confidence, adaptively determine the sampling steps and single-step scaling factor of flow matching defogging based on the continuous scattering coefficient estimate, and determine whether to perform rollback to a conservative number of steps based on the confidence level. The flow matching dehazing inference module is used to input the real fog image to be restored, the number of sampling steps, and the single-step scaling factor into the pre-trained flow matching dehazing network, perform iterative inference based on the physical degradation perception parameters, and output the final dehazed image.