A road visibility detection method and device based on double-branch cooperative fusion
By using a dual-branch collaborative fusion network, the problems of reliance on human prior assumptions and insufficient information interaction in existing methods are solved, and high-precision, stable and physically consistent visibility detection is achieved in complex foggy environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI UNIV OF SCI & TECH
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-31
AI Technical Summary
Existing image-based road visibility detection methods rely too heavily on human prior assumptions and lack sufficient information exchange between multiple tasks, resulting in insufficient stability and accuracy of detection results in complex foggy environments.
A network structure based on dual-branch collaborative fusion is adopted. Multi-scale texture features and depth prior features are extracted through transmittance and depth dual-branch coding modules. Information retrieval and adaptive adjustment are performed through bidirectional cross-attention mechanism and risk-difference joint gating mechanism. Pixel-level visibility detection results are calculated by combining atmospheric scattering model.
In complex foggy conditions, it significantly improves the accuracy, stability and physical consistency of visibility detection, and outputs smooth, continuous and numerically accurate pixel-level visibility results.
Smart Images

Figure CN122493210A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of visibility detection technology, specifically relating to a road visibility detection method and device based on dual-branch collaborative fusion. Background Technology
[0002] Visibility is a core indicator reflecting atmospheric transparency, directly determining a driver's ability to identify the road and obstacles ahead. It is a key parameter for traffic safety monitoring and early warning in the field of intelligent transportation. With the widespread adoption of road monitoring systems, visibility detection methods based on road monitoring images have become the mainstream technology to replace traditional manual observation and scattering / transmission instrument detection due to their advantages such as low deployment cost, wide coverage, and strong real-time performance. This is of great significance for solving road traffic safety problems in low-visibility weather conditions such as fog.
[0003] Currently, image-based road visibility detection methods are mainly divided into prior theory-based methods and deep learning-based methods. Prior theory-based methods estimate physical parameters such as transmittance and atmospheric light from foggy images using manually designed prior rules, and then derive visibility values by combining them with atmospheric scattering models. These methods require no data training, have low computational costs, and possess a certain degree of physical interpretability. However, these methods heavily rely on manual prior assumptions. In real-world road environments with uneven fog intensity, complex lighting, and diverse scene structures, they are prone to physical parameter estimation errors. Furthermore, visibility is derived from multiple intermediate physical quantities in series, and errors in any step will accumulate and amplify in subsequent processes, leading to insufficient stability of the final detection results. With the development of deep learning technology, multi-branch deep learning methods that integrate atmospheric scattering physical models have become the mainstream research direction for visibility detection. These methods directly extract features from foggy images using convolutional neural networks or encoding / decoding networks, and then combine them with atmospheric scattering models to complete pixel-level visibility inference. Deep learning-based methods both leverage the feature extraction capabilities of deep learning to reduce reliance on manual priors and ensure the interpretability of detection results through physical models. However, such methods still suffer from insufficient information exchange between multiple tasks and the tendency for errors to accumulate and amplify in the physical inference link. Summary of the Invention
[0004] The purpose of this invention is to provide a road visibility detection method and device based on dual-branch collaborative fusion, which solves the technical problems of existing image-based road visibility detection methods that rely too much on human prior assumptions and have insufficient information interaction between multiple tasks.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A road visibility detection method based on dual-branch collaborative fusion includes the following steps: The acquired foggy road images are input into a pre-built and trained dual-branch collaborative fusion network, which outputs a transmittance map and a depth map. Based on the transmittance map and depth map, combined with the existing atmospheric scattering model, pixel-level visibility detection results are calculated; The dual-branch collaborative fusion network includes a transmittance and depth dual-branch encoding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module, wherein; The transmittance and depth dual-branch coding module is used to extract transmittance multi-scale texture features and depth prior features; The dual-branch interactive fusion module performs interactive fusion of the transmittance multi-scale texture features and the depth prior features to obtain dual-branch fused features. The dual-branch fusion features are input into the dual-branch decoding module to obtain the predicted transmittance map and depth map; The visibility detection module calculates pixel-level visibility detection results based on the transmittance map, the depth map, and the atmospheric scattering model. The acquisition of the dual-branch fusion feature includes: A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features. A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection; Coordinate attention is introduced to enhance features, and adaptive feature fusion is performed on the enhanced bi-branch features to obtain the final bi-branch fused features.
[0006] Furthermore, the dual-branch collaborative fusion network uses the U-Net encoding / decoding structure as its main framework; The transmittance and depth dual-branch encoding module includes a transmittance encoding branch and a depth encoding branch; The transmittance multi-scale texture features are extracted using the transmittance coding branch, and the depth prior features are extracted using the depth coding branch.
[0007] Furthermore, the transmittance multi-scale texture features are extracted using the transmittance encoding branch, including: In the shallow feature stage, a frequency domain enhancement strategy is introduced. The input image is subjected to fast Fourier transform and high-pass filtering is applied to obtain a high-frequency enhanced map. Then, it is mapped to the same spatial scale as the shallow features and fused. A wavelet attention module is introduced on the skip connection feature, and the feature is decomposed by Haar wavelet to obtain low-frequency components and three high-frequency components. The high-frequency components are adaptively recalibrated by channel attention. The original spatial domain is restored by inverse wavelet reconstruction, and the residual method is used to fuse it with the original features.
[0008] Furthermore, the depth prior features are extracted using the depth coding branch, including: The Depth Anything V2 algorithm is used to perform online depth prediction on the input foggy image to obtain an initial depth map. The initial depth map is numerically cleaned and extreme values are truncated. The initial depth map is adjusted to the same spatial resolution as the input and then input into a lightweight convolutional embedding module. The channel dimension is increased while downsampling at each level to obtain depth prior features at the same scale as the high-level features of the transmittance coding branch.
[0009] Furthermore, the bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between transmissivity multi-scale texture features and depth prior features, including: The first query value is obtained by linearly mapping the flattened transmittance sequence features, and the first key and first value are obtained by linearly mapping the flattened depth sequence features. The first query, first key, and first value are multiplied by a scaled dot product. Normalization yields attention weights; The first value is weighted and summed using the attention weights to obtain the transmissivity multi-scale texture feature enhanced by the depth prior features; Repeat the above process to obtain depth prior features enhanced by transmittance multi-scale texture features.
[0010] Furthermore, a risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection, including: A lightweight prediction network predicts the risk value of each location based on its respective query features, resulting in transmittance branch risk gating and deep branch risk gating. Transmittance branch difference gating and depth branch difference gating are obtained from the degree of feature difference between the two branches at the same location; All risk gating and differential gating are merged, and a lower bound constraint is set to obtain the final gating coefficient; The final gating coefficients are applied to the bidirectional cross-attention output, and the bi-branch update is completed in the form of residuals.
[0011] Furthermore, the dual-branch collaborative fusion network is trained using a joint loss function, which includes the basic task loss and the risk-difference joint gating loss.
[0012] Secondly, this invention provides a road visibility detection system based on dual-branch collaborative fusion, comprising an output module and a calculation module, wherein: Output module: Used to calculate pixel-level visibility detection results based on transmittance maps and depth maps, combined with existing atmospheric scattering models; Calculation module: used to input the acquired image into the existing monocular depth estimation model to obtain the initial depth estimate corresponding to the head center point; The dual-branch collaborative fusion network includes a transmittance and depth dual-branch encoding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module, wherein; The transmittance and depth dual-branch coding module is used to extract transmittance multi-scale texture features and depth prior features; The dual-branch interactive fusion module performs interactive fusion of the transmittance multi-scale texture features and the depth prior features to obtain dual-branch fused features. The dual-branch fusion features are input into the dual-branch decoding module to obtain the predicted transmittance map and depth map; The visibility detection module calculates pixel-level visibility detection results based on the transmittance map, the depth map, and the atmospheric scattering model. The acquisition of the dual-branch fusion feature includes: A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features. A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection; Coordinate attention is introduced to enhance features, and adaptive feature fusion is performed on the enhanced bi-branch features to obtain the final bi-branch fused features.
[0013] Thirdly, a terminal device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0014] Fourthly, a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0015] Compared with the prior art, the present invention has the following beneficial technical effects: This invention provides a road visibility detection method based on dual-branch collaborative fusion. By constructing a collaborative fusion network of transmittance and depth branches, it effectively combines the degradation features of foggy road images with prior physical information. A bidirectional cross-attention mechanism with risk-difference joint gating is introduced to suppress error propagation and noise injection during dual-branch interaction, improving the reliability and physical consistency of feature fusion. Frequency domain enhancement and wavelet attention modules are added to supplement the edge contours and texture details of foggy areas, enhancing the expressive power of multi-scale features. Coordinate attention and adaptive feature fusion strengthen spatial structure information and key region modeling, making transmittance and depth map predictions more accurate and effectively suppressing error accumulation in the physical inference link. Ultimately, under complex and harsh scenarios such as dense fog, rain fog, night fog, sandstorms, and snow, it can output smooth, continuous, numerically accurate, and physically reliable pixel-level visibility results, significantly improving the accuracy, stability, and physical consistency of foggy road visibility detection. Attached Figure Description
[0016] Figure 1 This is a flowchart of a road visibility detection method based on dual-branch collaborative fusion in an embodiment of the present invention; Figure 2 This is a diagram of a dual-branch collaborative fusion network architecture. Figure 3 Here is a diagram of the wavelet attention module structure; Figure 4 This is a structural diagram of the dual-branch interactive fusion module; Figure 5 This is a coordinate attention structure diagram; Figure 6 Figure a shows the Pred-GT scatter plot of the visibility detection results of the dual-branch collaborative fusion network on the Foggy Cityscapes dataset; Figure 6 Figure b shows the Pred-GT scatter plot of the visibility detection results of the dual-branch collaborative fusion network on the FACI dataset; Figure 7 Visualization of visibility estimation results on real-world complex scene images; Figure 8 This is a visualization of the progressive ablation results of the dual-branch fusion module. Detailed Implementation
[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0018] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0019] It should be noted that the terms "first" and "second" in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] In foggy road scenarios, accurate and real-time visibility detection is crucial for improving road traffic safety early warning capabilities. Due to atmospheric scattering during fog imaging, the contours, edges, and textures of objects in the image degrade to varying degrees. This makes visibility assessment relying solely on image appearance features susceptible to fluctuations in fog density, lighting conditions, and scene structure, making it difficult to maintain stability. Furthermore, visibility formation is closely related to key physical quantities such as transmittance and scene depth. Therefore, how to comprehensively utilize image degradation features and relevant physical information to achieve accurate visibility estimation in complex foggy environments is a significant problem that needs to be addressed in the current technological field.
[0021] Currently, existing visibility detection methods in foggy weather still face challenges in complex scenarios, including severe image degradation, unstable estimation of key physical quantities, and insufficient utilization of bi-branch information. Specifically, fog imaging causes image texture degradation and edge blurring, making it difficult for traditional methods to effectively extract discriminative features related to fog attenuation. Transmittance and depth, as core physical quantities for visibility inference, are prone to accumulation and amplification of estimation errors in subsequent physical inference processes, leading to deviations in detection results. Simultaneously, existing deep learning methods generally suffer from insufficient interaction of bi-branch features and inadequate mining of key region information, making it difficult to guarantee the physical consistency and stability of visibility detection results in complex road scenarios such as uneven fog intensity and changing illumination. These factors result in unstable and inaccurate visibility detection results, failing to meet the practical needs for real-time and accurate visibility detection in foggy weather.
[0022] Currently, existing visibility detection technologies for foggy road scenes have the following significant drawbacks: (1) It is difficult to balance physical consistency and accuracy. Although methods based on prior theory (such as dark channel prior) have physical interpretability, they are highly dependent on manually designed rules. In scenarios such as uneven fog intensity, sky reflection, and complex road textures, they are prone to distortion in transmittance and depth estimation. Furthermore, errors in intermediate physical quantities will accumulate and amplify during the visibility derivation process, resulting in large deviations and poor robustness in the detection results. On the other hand, although pure data-driven deep learning methods can improve feature extraction capabilities, they often ignore the physical constraints of atmospheric scattering, and the detection results are prone to lacking physical consistency and have insufficient generalization ability in extreme foggy scenarios.
[0023] (2) Errors are easily accumulated and amplified during the physical inference process. Transmittance and depth are the core intermediate physical quantities in visibility inference in foggy weather. Existing technologies are easily affected by factors such as texture degradation, edge blurring, local brightness changes, and unreliable depth regions when estimating these physical quantities, resulting in errors. When the transmittance and depth estimation results are further used for visibility physical inference, these local errors will be propagated and accumulated in subsequent calculations, leading to a decrease in the accuracy and stability of the final visibility results. Especially in complex road scenarios, existing methods lack effective means to suppress the error propagation process, making it difficult to ensure the consistency of the inference results.
[0024] (3) Insufficient feature interaction and key region modeling capabilities in complex scenarios. Existing deep learning methods often lack explicit constraints on the transmission of unreliable information during the process of dual-branch or multi-feature fusion, which makes it easy for erroneous information to be injected between different branches, affecting the quality of feature fusion. At the same time, the edges, textures and local structural details in foggy images are easily degraded, and existing methods have limited ability to mine and enhance information in key regions, making it difficult to maintain stable detection performance under conditions such as uneven fog intensity, changes in illumination and complex distribution of road targets.
[0025] Therefore, in view of the shortcomings of the prior art, the purpose of this invention is to provide a visibility detection method suitable for complex foggy road scenarios. By co-modeling transmittance features and depth features, introducing a gating suppression mechanism for unreliable interactions, and combining key area enhancement and physical model constraints, the accuracy, stability and physical consistency of visibility detection results in complex foggy environments are improved.
[0026] This invention provides a visibility detection method suitable for complex foggy road scenarios. The method takes a single foggy road image as input, constructs a dual-branch collaborative fusion network with transmittance and depth branches, jointly estimates key physical information affecting visibility inference, and combines this with an atmospheric scattering model to complete visibility detection. This method can simultaneously utilize image degradation features, scene structure information, and relevant physical constraints, improving the accuracy, stability, and physical consistency of visibility detection results in complex foggy environments.
[0027] The present invention will now be described in further detail with reference to the accompanying drawings: like Figure 1 As shown, a road visibility detection method based on dual-branch collaborative fusion includes the following steps: Step 1: Input the acquired foggy road image into a pre-built and trained dual-branch collaborative fusion network to output a transmittance map and a depth map; Two-branch collaborative fusion network such as Figure 2 As shown, the U-Net encoding and decoding structure forms the main framework, including a transmittance and depth dual-branch encoding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module. The input is a single foggy road image, and the outputs are a transmittance map, a depth map, and the final visibility detection result. The transmittance encoding branch extracts image appearance features related to fog attenuation, contrast changes, edge blurring, and texture degradation; the depth encoding branch extracts depth prior features related to scene structure, target distance, and spatial hierarchy. The dual-branch collaborative fusion module enables information interaction, alignment, and joint optimization between transmittance and depth features. The dual-branch decoding module recovers the transmittance map and depth map respectively, and the visibility detection module outputs pixel-level visibility detection results based on the transmittance map, depth map, and atmospheric scattering model.
[0028] The dual-branch collaborative fusion network includes a transmittance and depth dual-branch coding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module, among which; A dual-branch encoding module for transmittance and depth is used to extract multi-scale texture features of transmittance and prior features of depth. The dual-branch interactive fusion module is used to interactively fuse the multi-scale texture features of transmittance and the prior features of depth to obtain the dual-branch fused features. The dual-branch fusion features are input into the dual-branch decoding module to obtain the predicted transmittance map and depth map; The visibility detection module calculates pixel-level visibility detection results based on the transmittance map, depth map, and atmospheric scattering model.
[0029] The transmittance and depth dual-branch coding module includes a transmittance coding branch and a depth coding branch, specifically: Visibility inference in foggy road scenes is related to both texture degradation and contrast changes caused by fog in the image, as well as the spatial structure of the scene and the distribution of target distances. To simultaneously acquire texture degradation information and scene structure information related to visibility detection, this invention constructs a dual-branch encoding module to extract transmittance-related features and depth prior features, respectively. The transmittance branch focuses on learning appearance changes such as contrast attenuation, edge blurring, and texture weakening caused by fog, while the depth branch provides scene geometry and distance priors. The two feature paths will be aligned and interacted in a subsequent dual-branch interactive fusion module, thereby providing a more comprehensive feature foundation for transmittance and depth decoding and visibility inference.
[0030] 1) Transmittance coding branch Transmittance multi-scale texture features are extracted using a transmittance coding branch, including: A frequency domain enhancement strategy is introduced in the shallow feature stage. The input image is subjected to a fast Fourier transform and a high-pass filter is applied to obtain a high-frequency enhanced map, which is then mapped to the same spatial scale as the shallow features before fusion. A wavelet attention module is introduced on the skip connection feature, and the feature is decomposed by Haar wavelet to obtain low-frequency components and three high-frequency components. The high-frequency components are adaptively recalibrated by channel attention. The original spatial domain is restored by inverse wavelet reconstruction, and the residual method is used to fuse it with the original features.
[0031] In detail, the transmittance branch is mainly used to characterize the appearance changes caused by fog during the image imaging process, such as contrast attenuation, edge blurring, and texture degradation. Therefore, it is necessary to extract stable multi-scale texture features from foggy images. To balance feature representation capability and network training stability, ResNet50 is used as the backbone encoder of the transmittance branch. Multi-scale texture features are extracted through stepwise downsampling, outputting three layers of multi-scale features (128×128, 64×64, 32×32) for skip connections, as well as 16×16 low-resolution high-level semantic features. To facilitate alignment with the depth branch, 1×1 convolutions are further used to project the high-level semantic features into channels, unifying the number of channels to 512, which serves as the final high-level representation of the transmittance branch.
[0032] Because the fogging process significantly weakens high-frequency components in an image, edge contours and fine structural information are easily weakened in the shallow coding stage, making it difficult to fully recover foggy details by relying solely on spatial domain convolutional features. Therefore, a frequency domain enhancement strategy is introduced in the shallow feature stage. The input image undergoes a Fast Fourier Transform and a high-pass filter is applied to obtain a high-frequency enhanced map. This enhanced map is then mapped to the same spatial scale as the shallow features (128×128) and fused to supplement the edge and structural detail information of the foggy area.
[0033] However, simply supplementing high-frequency information through frequency domain enhancement is insufficient to fully address the issue of uneven detail response during the transmission of multi-scale features, especially in the skip connection stage, where texture and edge information from different scales may still be further diluted. To further enhance the texture detail representation capability of features at different scales, a method such as... is introduced into the skip connection features. Figure 3 The wavelet attention module WA is shown. This module performs Haar wavelet decomposition on the features to obtain low-frequency components and three high-frequency components. Channel attention is then used to adaptively recalibrate the high-frequency components. Finally, the original spatial domain is restored through inverse wavelet reconstruction, and the residuals are used to fuse with the original features, thereby enhancing the expression of texture details while maintaining the overall structural stability.
[0034] 2) Depth coding branch Extracting deep prior features using deep coding branches includes: The Depth Anything V2 algorithm is used to perform online depth prediction on the input foggy image to obtain an initial depth map. Numerical cleaning is performed on the initial depth map, and extreme values are truncated. The initial depth map is adjusted to the same spatial resolution as the input and then fed into a lightweight convolutional embedding module. The depth prior features are downsampled step by step while the channel dimension is increased, resulting in depth prior features at the same scale as the high-level features of the transmissivity coding branch.
[0035] In detail, in foggy road scenes, visibility is closely related to the distribution of scene distances. Estimating visibility solely based on image appearance information is prone to bias under different depths of field, lighting, and material conditions, thus reducing the model's stability in complex scenes. To introduce distance-related geometric constraints, this invention sets up a scene depth encoding branch, utilizing depth priors to provide structural information support for visibility detection, assisting in subsequent visibility inference.
[0036] The depth coding branch uses Depth Anything V2 to perform online depth prediction on the input foggy image to obtain an initial depth map. Considering the potential presence of near-infinite regions such as the sky in the image, depth predictions are prone to anomalies or extreme values. Therefore, the depth results are numerically cleaned and extreme values are truncated to ensure the stability of subsequent feature learning. In the feature extraction stage, the depth coding branch adjusts the initial depth map to the same spatial resolution as the input and designs a lightweight convolutional embedding module to map single-channel depth into a high-dimensional feature representation suitable for network learning. This embedding module consists of five concatenated convolutional layers with a stride of 2. Through progressive downsampling, the spatial resolution is compressed from 512×512 to 16×16, while the channel dimension is gradually increased and aligned to 512 channels at the end. This obtains depth prior features at the same scale as the high-level features of the transmissivity branch, used for feature interaction and decoding prediction in subsequent modules.
[0037] The dual-branch interaction fusion module is used to obtain dual-branch fusion features, including: A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features. A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection; Coordinate attention is introduced to enhance features, and adaptive feature fusion is performed on the enhanced bi-branch features to obtain the final bi-branch fused features.
[0038] In detail, during foggy imaging, there is a clear physical coupling between transmittance and depth. Both influence the extinction coefficient and further affect the visibility detection results. This means that the estimation errors of the transmittance branch and the depth branch are not independent. When the scene depth is large or the local fog concentration changes significantly, any local deviation in either the transmittance or depth branch may be amplified in the physical inference, thus affecting the final visibility inference. If the dual-branch features are fused simply by stitching or directly adding them, it is often difficult to establish an effective semantic correspondence between transmittance and depth features, and it is also difficult to suppress noise interference caused by local inconsistencies during the dual-branch interaction, leading to error propagation.
[0039] To this end, this invention designs a dual-branch interactive fusion module for aligning, interacting with, and complementarily enhancing transmissivity features and depth features at the semantic level. For example... Figure 4 As shown, this module is based on a risk-difference joint gating bidirectional cross-attention mechanism: on the one hand, bidirectional cross-attention enables information retrieval and semantic alignment between the two branches, allowing transmissivity features to selectively absorb structural and geometric cues from depth features, while depth features can also obtain fog attenuation and contrast change information from transmissivity features; on the other hand, the risk-difference joint gating mechanism adaptively modulates unreliable or highly differentiated regions during the interaction process, reducing the transmission intensity of uncertain information flows, thereby reducing error complementation and noise propagation. Through the above design, the bidirectional interaction fusion module can achieve more stable and controllable feature interaction, providing a more accurate and consistent feature representation for subsequent visibility inference.
[0040] 1) Bidirectional cross-attention A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features, including: The first query value is obtained by linearly mapping the flattened transmittance sequence features, and the first key and first value are obtained by linearly mapping the flattened depth sequence features. The first query, first key, and first value are multiplied by a scaled dot product. Normalization yields attention weights; By using attention weights to perform a weighted summation of the first value, we obtain the transmissivity multi-scale texture features enhanced by depth prior features; Repeating the above process yields depth prior features enhanced by transmittance multi-scale texture features. In detail, to achieve semantic alignment and complementarity between the transmittance branch and the depth branch, a risk-difference gate bidirectional cross-attention (RDG-BiCA) approach is introduced into the dual-branch interaction fusion module. To establish the positional correspondence between the dual-branch features, the two-dimensional spatial features obtained from the dual-branch encoding must first be flattened into a sequence representation.
[0041] in, B For batch processing numbers, C For the number of channels, S For sequence number, H and W Spatial resolution, The transmittance sequence characteristics are those after flattening. The features are the flattened depth sequence features.
[0042] To enable mutual querying and guidance of information between the two branches, bidirectional cross-attention, as shown in the following formula, is used to achieve information retrieval and updating of the two branches.
[0043]
[0044]
[0045] in, This is the updated transmittance characteristic. For the updated depth features, Q For the information you are currently looking for, K For information indexing used for matching, V The actual information content to be obtained.
[0046] Specifically, bidirectional attention is divided into two stages. In the first stage, the transmittance branch will analyze the transmittance features. Perform a linear mapping to obtain the query , to depth features Linear mapping to key Sum By scaling the dot product and Normalization is performed to obtain attention weights, and finally, these attention weights are used to adjust the values. Weighted summation is performed to obtain the transmittance feature enhanced by depth features. In the second stage, the depth branch will incorporate depth features. Perform a linear mapping to obtain the query Linearly mapping transmittance characteristics to bonds Sum Similarly, another attention calculation is performed to finally obtain the depth features enhanced by transmittance features. By employing bidirectional cross-attention, the two branches of features can perceive each other and perform bi-branch alignment updates, thereby fully utilizing the complementarity of the two types of features and improving the stability and accuracy of subsequent visibility inference.
[0047] 2) Risk-difference joint gating A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection, including: A lightweight prediction network predicts the risk value of each location based on its respective query features, resulting in transmittance branch risk gating and deep branch risk gating. Transmittance branch difference gating and depth branch difference gating are obtained from the degree of feature difference between the two branches at the same location; All risk gating and differential gating are merged, and a lower bound constraint is set to obtain the final gating coefficient; The final gating coefficients are applied to the bidirectional cross-attention output, and the bi-branch update is completed in the form of residuals.
[0048] In areas with uneven fog intensity or large depth estimation deviations, transmittance and depth features may exhibit significant inconsistencies. If features from one branch are directly and indiscriminately injected into the other branch via bidirectional cross-attention, unreliable information can easily be transmitted simultaneously, amplifying subsequent inference errors. To address this, this invention introduces a Risk-Difference Gate (RD-Gate) at the output of the bidirectional cross-attention mechanism to adaptively adjust the injection intensity of information from both branches, thereby enhancing complementary information while suppressing the propagation of erroneous information.
[0049] Risk gating is used to characterize the uncertainty of the current query branch features themselves, and it predicts the risk value at each position based on the respective query features:
[0050]
[0051] in, Transmittance branch risk gating For deep branch risk gating, It is a lightweight prediction network composed of MLPs. This is the Sigmoid function.
[0052] Difference gating is used to characterize the degree of feature difference between two branches at the same location, and is constructed from the absolute difference of the features of the two branches:
[0053]
[0054] in, This represents the characteristic difference between transmittance and depth. Differential gating for transmittance branches Difference gating for deep branches.
[0055] To prevent gating from completely shutting down the information flow and causing feature updates to fail, a lower bound constraint is set for the gating, and risk gating and difference gating are merged to obtain the final gating coefficient:
[0056]
[0057] in, This is the transmittance gating factor. For depth-gating coefficient, Let be the lower bound coefficient, and take . It is 0.25.
[0058] Ultimately, the risk-difference joint gating acts on the bidirectional cross-attention output, and completes the bi-branch update in the form of residuals:
[0059]
[0060] in, For the final transmittance characteristics, This is the final depth feature.
[0061] By using risk-difference joint gating, the module can prioritize the fusion of consistent and reliable regional information in dual-branch interactions and suppress noise injection into the other branch from uncertain or highly different regions, thereby reducing the impact of error accumulation on subsequent visibility detection.
[0062] 3) Coordinate attention enhancement and adaptive feature fusion After completing the bi-branch interaction, the transmittance branch and the depth branch have acquired mutually guided and corrected semantic features. However, in foggy scenes, the key factors affecting visibility determination often exhibit significant directional structure and positional dependence. To further enhance the spatial representation capability within the branches, this invention introduces, for example, […]. Figure 5 The example illustrates Coordinate Attention (CA) for feature enhancement. Unlike attention mechanisms that only focus on channel relationships, Coordinate Attention aggregates contextual information along both the horizontal and vertical directions, preserving spatial location information while establishing channel dependencies. This allows for more effective modeling of directional features in fog-attenuation-related regions, edge contours, and distant structural regions. Based on this, Coordinate Attention can provide more stable and spatially discriminative feature inputs for subsequent two-branch fusion.
[0063] After obtaining the enhanced bi-branch features, an adaptive feature fusion strategy is employed for collaborative fusion. Considering the dynamic changes in the contributions of the transmittance and depth branches in different regions, local context modeling is performed using 3×3 convolutions, followed by 1×1 convolutions to output two weight maps, thus adaptively allocating the weights of transmittance and depth information in the fusion process. This mechanism enables the model to automatically reduce the influence of unreliable branches in regions with complex fog distributions, unstable depth estimation, or large local transmittance deviations, while fully utilizing complementary information in regions with clear structures and strong physical consistency. Finally, the weighted bi-branch features are fused using 3×3 convolutions to obtain the final bi-branch fused features.
[0064] By enhancing coordinate attention and adaptive feature fusion, the model can dynamically adjust the fusion weights based on the relative reliability of transmittance and depth features in different regions while maintaining spatial structure information. This further improves the stability and expressive power of the fused features, thereby enhancing the accuracy of the final visibility detection.
[0065] The fused features output by the dual-branch interactive fusion module already contain complementary information on transmittance and depth. However, transmittance and depth correspond to different physical meanings. Directly regressing visibility from the fused features can weaken the interpretability of intermediate physical quantities and is not conducive to subsequent physical relationship constraints. Therefore, this invention adopts a dual-branch decoding structure to recover the transmittance map and depth map separately. The dual-branch decoder takes the fused features with a resolution of 16×16 as input and constructs transmittance decoding branches and depth decoding branches respectively. The decoding process uses upsampling blocks based on PixelShuffle to restore the spatial resolution step by step, performing a total of 5 upsampling operations to restore the feature map from a resolution of 16×16 to 512×512. To reduce the loss of detail caused by upsampling and enhance the structural recovery capability, the transmittance decoder introduces multi-scale skip connection features output by the encoder in the first 3 upsampling stages, concatenates them with the current upsampling features in the channel dimension, and performs feature fusion and refinement through convolutional fusion blocks. In the subsequent two high-resolution stages, skip connections are no longer introduced. Instead, features are gradually refined and output through upsampling and convolution. Finally, the transmittance branch outputs a single-channel transmittance map, and the depth branch outputs a single-channel depth map, which are used for subsequent visibility calculations.
[0066] Step 2: Based on the transmittance map and depth map, and combined with the existing atmospheric scattering model, the pixel-level visibility detection results are calculated. The visibility detection module takes the transmittance map and depth map output from the dual-branch decoder as input and calculates the pixel-level visibility map based on the physical model of visibility. The module uses the relationship between transmittance, depth and visibility to calculate the visibility value pixel by pixel and further outputs the pixel-level visibility map, thus forming an end-to-end visibility detection output.
[0067] Because logarithmic operations are sensitive to numerical ranges, a lower bound is set on transmittance when estimating visibility to avoid logarithmic divergence. Simultaneously, for areas with unreliable depth or near-infinity, such as the sky, an effective depth range mask is introduced for filtering, reducing the interference of abnormal regions on the visibility results. Since visibility is derived from a physical model, the output has clear physical interpretability. Furthermore, a dual-branch interactive fusion module is introduced to effectively mitigate the cumulative amplification effect of transmittance and depth estimation errors in subsequent inferences, thereby improving the stability and reliability of visibility detection in foggy scenarios.
[0068] This invention also provides a training and optimization process for a dual-branch collaborative fusion network, specifically: To achieve joint optimization of transmittance and depth, and to guide the gating branches to learn modulation capabilities consistent with feature reliability, this invention employs a joint loss function to train the dual-branch collaborative fusion network. The joint loss function comprises two parts: a basic task loss and a risk-difference joint gating loss.
[0069]
[0070] in, Represents the loss function of the basic task; This represents the risk-difference joint gated loss function; and These represent the relative weights between the two loss functions.
[0071] 1) Basic task loss The basic task loss is used to ensure that transmittance and depth predictions have clear optimization objectives and to provide reliable intermediate physical quantities for subsequent physics inference. To this end, supervision is applied to the transmittance branch and the depth branch separately.
[0072] The transmittance branch uses mean squared error loss to constrain the consistency between predicted and true values. Since the overall transmittance map changes relatively smoothly, mean squared error can more effectively constrain its global numerical deviation.
[0073]
[0074] in, For transmittance loss, This represents the total number of pixels in the image. The predicted transmittance map is shown in the first... The predicted value of each pixel. The true transmittance map is shown in the first... The actual value of each pixel.
[0075] Considering that there may be near-infinite regions such as the sky in the image, the depth values may be unreliable in some areas. Therefore, supervision is applied to the depth branch only within the effective depth range.
[0076]
[0077] in, For deep loss, Represents the set of pixels within the effective depth range. Indicates the predicted depth map at the 1st The predicted value of each pixel. The true depth map is represented at the th The actual value of each pixel.
[0078] Therefore, the loss for the basic task is:
[0079] 2) Risk-difference joint gating loss In the bi-branch interaction fusion process, risk gating and difference gating are used to characterize the uncertainty of single-branch features and the consistency of corresponding positions in the two branches, respectively. Without explicit supervision, gated branches can easily degenerate into uninterpretable free weight assignments, making it difficult to stably suppress interference from unreliable information interactions. Therefore, a supervision signal related to the prediction error is introduced into risk gating and difference gating to guide the gating learning to a response distribution consistent with feature reliability.
[0080] For risk gating, this invention downsamples the transmittance error map and depth error map to the resolution corresponding to the gating map, and uses them as a monitoring signal to constrain the risk gating to produce a stronger response in high-error regions. The risk gating loss formula is:
[0081] in, Indicates the transmittance branch at the 1st Risk threshold value per pixel, The depth branch is represented in the first position. Risk threshold value per pixel, This indicates that the error map is downsampled to the spatial resolution corresponding to the gated map.
[0082] For difference-gating, a weighted combination of transmittance error and depth error is used to construct a comprehensive error signal to approximately characterize the estimated divergence of the two branches at corresponding locations, thereby guiding difference-gating to suppress inconsistencies. Difference-gating loss. As shown in the following formula:
[0083]
[0084] in For balance coefficient, Indicates the relationship between transmittance and depth in the first... The overall error of each pixel, Indicates the transmittance branch at the 1st The difference value of each pixel Indicates the depth branch at the 1st The difference value of each pixel.
[0085] Therefore, the risk-difference joint gating loss is:
[0086] Through the above design, the total loss ensures stable convergence of the transmittance and depth main tasks, while also promoting the gating branch to learn adaptive modulation capabilities consistent with the error distribution, thereby improving the stability and reliability of the dual-branch interactive fusion.
[0087] Experimental verification: Visual analysis of test results: To verify the visibility detection performance of the dual-branch collaborative fusion network in different scenarios, this invention performs visualization analysis on synthetic data, simulated data, and real complex scenarios. The Pred-GT scatter distribution on the Foggy Cityscapes and FACI datasets is shown below. Figure 6 As shown, where, Figure 6 Figure a shows the Pred-GT scatter plot of the visibility detection results of the two-branch collaborative fusion network on the FoggyCityscapes dataset. Figure 6 Figure b shows the Pred-GT scatter plot of the visibility detection results of the two-branch collaborative fusion network on the FACI dataset. The red dashed line in the figure represents the ideal prediction relationship y=x. The closer the scatter points are to this line, the better the consistency between the prediction results and the actual values. It can be seen that the scatter points of both sets of data are generally distributed around y=x, indicating that the two-branch collaborative fusion network can accurately estimate the visibility values under different data sources and exhibits good prediction stability.
[0088] In addition, this invention selected 12 representative real-world complex scene images for supplementary verification, covering conditions such as dense fog, rain fog, night fog, sandstorm weather, and snowy weather. The results are as follows: Figure 7 As shown in the figures, figures a, b, and c represent dense fog, figure d represents rain and fog, figures e and f represent night fog, figures g, h, and i represent sandstorms, and figures j, k, and l represent snow. The corresponding statistical data are shown in Table 1. Overall, the model's predictions are largely consistent with the visibility trends in the scenarios, providing reasonable visibility estimates under various complex conditions. For low visibility samples, the model can effectively distinguish between extreme and poor visibility levels; for medium-to-high visibility samples, the predicted values are also close to the actual values. Although some deviations exist in extreme scenarios such as strong reflections in snow and sandstorm obstruction, the overall results demonstrate that the dual-branch collaborative fusion network has a certain adaptability in real-world complex scenarios.
[0089] Table 1. Visibility estimation results on real complex scene images
[0090] Performance comparison of different models: To ensure the representativeness and fairness of the comparative experiments, this invention selects representative visibility detection methods on the Foggy Cityscapes and FACI datasets for comparison. On the Foggy Cityscapes dataset, ShuffleNet V2 and DenseNet121 are selected as image-level visibility classification methods, while VENet and Pixel-Wise-Visibility are introduced as joint task methods with both classification and regression capabilities. On the FACI dataset, DMRVisNet, GRNN, VENet, and Pixel-Wise-Visibility are selected as comparison methods. Since the task settings of different methods differ—some methods only support classification tasks, while others support both classification and regression tasks—this invention compares them from both classification and regression metrics. The comparison results are shown in Table 2, where CLS represents the classification task, REG represents the regression task, and bold indicates the best results.
[0091] Table 2 Comparison of visibility detection results of various methods on the Foggy Cityscapes and FACI datasets
[0092] As shown in Table 2, the method of this invention achieved superior performance on both datasets. On the Foggy Cityscapes dataset, the classification accuracy of the two-branch collaborative fusion network reached 94.56±0.02%, which is higher than ShuffleNet V2, VENet, and Pixel-Wise-Visibility, and basically on par with DenseNet121. Meanwhile, in the regression task, AbsRel, SqRel, and RMSE reached 0.0809±0.0004, 0.0121±0.0002, and 64.587±1.014m, respectively, all of which are better than VENet and Pixel-Wise-Visibility. On the FACI dataset, the two-branch collaborative fusion network also achieved the best results in various regression metrics, with AbsRel, SqRel, and RMSE values of 0.0688±0.0006, 0.0154±0.0004, and 37.863±2.357 m, respectively, and a classification accuracy of 94.50±0.02%. Overall, the two-branch collaborative fusion network demonstrates good comprehensive performance in both visibility level discrimination and continuous numerical estimation tasks, validating the effectiveness of the proposed two-branch collaborative fusion strategy in visibility detection.
[0093] Comparison of progressive ablation in dual-branch fusion modules: To verify the effectiveness of each core module in the dual-branch interactive fusion architecture, this invention conducts progressive ablation experiments around five key components: FFT, WA, BiCo-Attention, RD-Gate, and CA, setting up seven models in total, S1-S7. S1 is the baseline model, not containing the above modules; S2 introduces BiCo-Attention on top of S1; S3 further adds RD-Gate; S4 adds CA on top of S1; S5 and S6 introduce FFT and WA respectively on top of S4; and S7 introduces both FFT and WA.
[0094] To visually demonstrate the impact of each module on the prediction of intermediate physical quantities and visibility inference results, Figure 8 Visualization results are presented under different progressive ablation settings, among which, Figure 8 Image a is the fog map, image b is the transmittance map, image c is the depth map, image d is the visibility map, and image e is the visibility histogram. Overall, with the gradual introduction of each module, the visibility map output by the model gradually becomes smoother and more continuous in spatial distribution, and no obvious systematic artifacts were observed. The visibility map in S1 has some local fluctuations, with a predicted value of 437.036 m, which deviates significantly from the true value of 454.962 m. After introducing BiCo-Attention in S2, the interaction of information between the two branches is enhanced, but the prediction result is still too low. After adding RD-Gate in S3, the local abnormal areas are significantly reduced, and the predicted value is improved to 449.450 m. After introducing CA in S4, the overall distribution is further smoothed, and the predicted value reaches 456.454 m, which is basically close to the true value. Furthermore, S5 and S6 respectively verify the effects of FFT and WA, both of which improve the continuity and spatial structure consistency of the visibility map. The predicted value of the complete model S7 is 455.014 m, which is closest to the true value, indicating that FFT and WA have a good complementary effect and can further improve the stability and accuracy of visibility inference. In addition to the visual comparison, Table 3 further presents the objective evaluation results of different ablation settings on the Foggy Cityscapes dataset, with bold indicating the optimal results. Overall, as modules are gradually introduced, AbsRel, SqRel, RMSE, and Err_phys show a downward trend, while ACC shows an upward trend. Compared to S1, S2 shows improvement in all metrics, indicating that BiCo-Attention helps improve the collaborative modeling ability of transmittance and depth information; after adding RD-Gate in S3, the regression error and physical consistency error further decrease, indicating that this module can effectively reduce the error propagation caused by unreliable interactions; after introducing CA in S4, although ACC fluctuates slightly, the overall error continues to decrease, indicating that the spatial attention mechanism has a positive effect on improving the representation of intermediate physical quantities. Further comparison of S5 and S6 reveals that both FFT and WA can bring additional gains, and the two are complementary in terms of frequency domain enhancement and local detail modeling. Ultimately, the complete model S7 achieved the best results on AbsRel, SqRel, RMSE, ACC, and Err_phys. Among them, Err_phys decreased from 0.0213 in S1 to 0.0114, indicating that the proposed progressive fusion strategy not only improved the detection accuracy but also enhanced the physical consistency between transmittance, depth, and visibility.
[0095] Table 3 Objective Evaluation Results of Progressive Ablation in Dual-Branch Fusion Module
[0096] The key points and areas to be protected in this invention include: (1) A dual-branch collaborative fusion visibility detection method suitable for complex foggy road scenarios, which overcomes the problems of insufficient physical consistency, insufficient interaction of dual-branch features, and error accumulation and amplification in complex scenarios in existing visibility detection technologies; (2) By using the risk-difference joint gating bidirectional cross-attention fusion mechanism, bidirectional semantic alignment, error perception and adaptive suppression of transmittance features and depth features are achieved, solving the pain point of mutual propagation and amplification of bi-branch estimation errors, and improving the physical consistency and stability of visibility detection. (3) By using the risk-difference joint gating bidirectional cross-attention fusion mechanism, bidirectional semantic alignment, error perception and adaptive suppression of transmittance features and depth features are achieved, solving the pain point of mutual propagation and amplification of bi-branch estimation errors, and improving the physical consistency and stability of visibility detection. (4) Substitute the transmittance map and depth map estimated by deep learning into the atmospheric scattering physics model, and derive the pixel-level visibility value by combining Koschmieder's law, so as to realize high-precision and physically interpretable end-to-end visibility detection in foggy weather. In another embodiment of the present invention, a road visibility detection system based on dual-branch collaborative fusion is provided, comprising an output module and a calculation module, wherein: Output module: Used to calculate pixel-level visibility detection results based on transmittance maps and depth maps, combined with existing atmospheric scattering models; Calculation module: used to input the acquired image into the existing monocular depth estimation model to obtain the initial depth estimate corresponding to the head center point; The dual-branch collaborative fusion network includes a transmittance and depth dual-branch coding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module, among which; A dual-branch encoding module for transmittance and depth is used to extract multi-scale texture features of transmittance and prior features of depth. The dual-branch interactive fusion module is used to interactively fuse the multi-scale texture features of transmittance and the prior features of depth to obtain the dual-branch fused features. The dual-branch fusion features are input into the dual-branch decoding module to obtain the predicted transmittance map and depth map; The visibility detection module calculates pixel-level visibility detection results based on the transmittance map, depth map, and atmospheric scattering model. The acquisition of dual-branch fusion features includes: A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features. A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection; Coordinate attention is introduced to enhance features, and adaptive feature fusion is performed on the enhanced bi-branch features to obtain the final bi-branch fused features.
[0097] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can be implemented in one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs) containing computer-usable program code. The form of a computer program product implemented on ROM (optical memory, etc.).
[0098] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0100] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit its scope of protection. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading the present invention, they can still make various changes, modifications or substitutions to the specific implementation of the invention, but these changes, modifications or substitutions are all within the scope of protection of the pending claims of the invention.
Claims
1. A road visibility detection method based on dual-branch collaborative fusion, characterized in that, Includes the following steps: The acquired foggy road images are input into a pre-built and trained dual-branch collaborative fusion network, which outputs a transmittance map and a depth map. Based on the transmittance map and depth map, combined with the existing atmospheric scattering model, pixel-level visibility detection results are calculated; The dual-branch collaborative fusion network includes a transmittance and depth dual-branch encoding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module, wherein; The transmittance and depth dual-branch coding module is used to extract transmittance multi-scale texture features and depth prior features; The dual-branch interactive fusion module performs interactive fusion of the transmittance multi-scale texture features and the depth prior features to obtain dual-branch fused features. The dual-branch fusion features are input into the dual-branch decoding module to obtain the predicted transmittance map and depth map; The visibility detection module calculates pixel-level visibility detection results based on the transmittance map, the depth map, and the atmospheric scattering model. The acquisition of the dual-branch fusion feature includes: A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features. A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection; Coordinate attention is introduced to enhance features, and adaptive feature fusion is performed on the enhanced bi-branch features to obtain the final bi-branch fused features.
2. The road visibility detection method based on dual-branch collaborative fusion according to claim 1, characterized in that, The dual-branch collaborative fusion network uses the U-Net encoding and decoding structure as its main framework. The transmittance and depth dual-branch encoding module includes a transmittance encoding branch and a depth encoding branch; The transmittance multi-scale texture features are extracted using the transmittance coding branch, and the depth prior features are extracted using the depth coding branch.
3. The road visibility detection method based on dual-branch collaborative fusion according to claim 2, characterized in that, Extracting the transmittance multi-scale texture features using the transmittance encoding branch includes: In the shallow feature stage, a frequency domain enhancement strategy is introduced. The input image is subjected to fast Fourier transform and high-pass filtering is applied to obtain a high-frequency enhanced map. Then, it is mapped to the same spatial scale as the shallow features and fused. A wavelet attention module is introduced on the skip connection feature, and the feature is decomposed by Haar wavelet to obtain low-frequency components and three high-frequency components. The high-frequency components are adaptively recalibrated by channel attention. The original spatial domain is restored by inverse wavelet reconstruction, and the residual method is used to fuse it with the original features.
4. The road visibility detection method based on dual-branch collaborative fusion according to claim 2, characterized in that, Extracting the depth prior features using the depth coding branch includes: The Depth Anything V2 algorithm is used to perform online depth prediction on the input foggy image to obtain an initial depth map. The initial depth map is numerically cleaned and extreme values are truncated. The initial depth map is adjusted to the same spatial resolution as the input and then input into a lightweight convolutional embedding module. The channel dimension is increased while downsampling at each level to obtain depth prior features at the same scale as the high-level features of the transmittance coding branch.
5. The road visibility detection method based on dual-branch collaborative fusion according to claim 1, characterized in that, The bidirectional cross-attention mechanism is used to achieve information retrieval and semantic alignment between transmissivity multi-scale texture features and depth prior features, including: The first query value is obtained by linearly mapping the flattened transmittance sequence features, and the first key and first value are obtained by linearly mapping the flattened depth sequence features. The first query, first key, and first value are multiplied by a scaled dot product. Normalization yields attention weights; The first value is weighted and summed using the attention weights to obtain the transmissivity multi-scale texture feature enhanced by the depth prior features; Repeat the above process to obtain depth prior features enhanced by transmittance multi-scale texture features.
6. The road visibility detection method based on dual-branch collaborative fusion according to claim 1, characterized in that, A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the injection intensity of bi-branch information, including: A lightweight prediction network predicts the risk value of each location based on its respective query features, resulting in transmittance branch risk gating and deep branch risk gating. Transmittance branch difference gating and depth branch difference gating are obtained from the degree of feature difference between the two branches at the same location; All risk gating and differential gating are merged, and a lower bound constraint is set to obtain the final gating coefficient; The final gating coefficients are applied to the bidirectional cross-attention output, and the bi-branch update is completed in the form of residuals.
7. The road visibility detection method based on dual-branch collaborative fusion according to claim 1, characterized in that, The dual-branch collaborative fusion network is trained using a joint loss function, which includes the basic task loss and the risk-difference joint gating loss.
8. A road visibility detection system based on dual-branch collaborative fusion, characterized in that, It includes an output module and a calculation module, wherein: Output module: Used to calculate pixel-level visibility detection results based on transmittance maps and depth maps, combined with existing atmospheric scattering models; Calculation module: used to input the acquired image into the existing monocular depth estimation model to obtain the initial depth estimate corresponding to the head center point; The dual-branch collaborative fusion network includes a transmittance and depth dual-branch encoding module, a dual-branch interactive fusion module, a dual-branch decoding module, and a visibility detection module, wherein; The transmittance and depth dual-branch coding module is used to extract transmittance multi-scale texture features and depth prior features; The dual-branch interactive fusion module performs interactive fusion of the transmittance multi-scale texture features and the depth prior features to obtain dual-branch fused features. The dual-branch fusion features are input into the dual-branch decoding module to obtain the predicted transmittance map and depth map; The visibility detection module calculates pixel-level visibility detection results based on the transmittance map, the depth map, and the atmospheric scattering model. The acquisition of the dual-branch fusion feature includes: A bidirectional cross-attention mechanism is employed to achieve information retrieval and semantic alignment between multi-scale transmissivity texture features and depth prior features. A risk-difference joint gating mechanism is introduced at the bidirectional cross-attention output end to adaptively adjust the intensity of bi-branch information injection; Coordinate attention is introduced to enhance features, and adaptive feature fusion is performed on the enhanced bi-branch features to obtain the final bi-branch fused features.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements as claimed in claim 1.
7. The steps of any of the methods described.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements as described in claim 1.
7. The steps of any of the methods described.