A method for detecting a target in fog weather based on deep learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2026-08-11
AI Technical Summary
首先,现有的方法在应对恶劣天气下众多复杂背景和低对比度场景时,检测精度和泛化性能仍有待提高
[0062]有益效果:本发明首先搭建深度学习的目标检测网络,然后采用雾天图像HazyDet目标检测数据集进行训练,重复训练使网络收敛,获取最优网络权重,最后模型推理实现雾天下的目标识别。本发明优化了目标检测网络的训练方法,实现了检测网络进一步稳定调整训练,同时提高了网络对雾天目标快速检测的性能。本发明提出的网络有效权衡了检测速度和精度,易于设备部署,适合于雾天图像目标实时检测的需要。
Smart Images

Figure CN120876814B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to image processing technology, and in particular to a method for target detection in foggy weather based on deep learning. Background Technology
[0002] With the rapid development of computer vision, image processing in adverse weather conditions has become an important research direction in this field. In the military, target detection in foggy scenes can be used for intrusion detection, enhancing the perception capabilities of surveillance systems in low-visibility environments, thereby enabling the timely detection of potential illegal intrusions, crossings, or other threats. In civilian sectors, it can help people accurately identify obstacles, pedestrians, traffic signs, and other information in autonomous driving, ensuring the normal operation of vehicles in complex environments and reducing the risk of accidents caused by environmental factors. Target detection in foggy scenes has wide applications in marine monitoring, road surveillance, and other fields. Therefore, further improving target detection in foggy environments is of great significance.
[0003] Building upon the strengths of previous YOLO models, YOLO11 represents the latest iteration in this evolutionary series. It introduces new architectural enhancements, including an improved attention mechanism, deeper feature extraction layers, and an anchorless detection paradigm. These innovations aim to improve the model's detection accuracy and computational efficiency, particularly in the face of variable and complex environments, achieving a better balance between efficiency and accuracy. The advancements in YOLO, especially with the introduction of YOLO11, mark a significant step forward in developing more efficient and accurate object detection systems. By building upon deep learning innovations, including modern self-attention architectures such as CNNs and ViTs, YOLO11 aims to further bridge the gap between detection accuracy and computational efficiency in real-world applications. Despite these advancements, several challenges remain when dealing with object detection tasks under adverse weather conditions. First, existing methods still need improvement in detection accuracy and generalization performance when handling numerous complex backgrounds and low-contrast scenes in adverse weather conditions. Second, existing improvements often increase the model's computational complexity and parameter count, impacting real-time performance in practical applications. Summary of the Invention
[0004] Purpose of the invention: The technical problem to be solved by the present invention is to address the shortcomings of existing technologies by providing a deep learning-based method for target detection in foggy weather, comprising the following steps:
[0005] Step 1: Build a multi-scale target detection network;
[0006] Step 2: Train a multi-scale object detection network using the HazyDet object detection dataset of foggy images;
[0007] Step 3: Repeat the iterative training until the multi-scale object detection network converges;
[0008] Step 4: Input the image into the multi-scale target detection network, calculate the fog detection results, and output the location and category information of the target in the fog.
[0009] Step 1 includes:
[0010] Step 1.1: The multi-scale target detection network is an improved YOLOv11 network. First, the backbone network of the YOLOv11 network is improved by constructing a spatial interaction module SIBlock and a wavelet attention downsampling module HAAD in the backbone network.
[0011] Step 1.2, improve the neck network of YOLOv11 by constructing a multi-scale feature fusion and splicing module BifpnCat, a detection head, and a spatial adaptive attention fusion module SAAF in the neck network;
[0012] Step 1.3: Modify the splicing input layer in the neck network: replace the inputs of the last two splices of the neck network with the outputs of the first two splices of the neck network.
[0013] Step 1.1 includes: The spatial interaction module SIBlock is used to realize the interaction between spaces in the feature map and capture the spatial dependencies in the image. In the spatial interaction module SIBlock, layer normalization is first used to ensure that each layer of the input foggy feature map has the same output distribution, and then iterative convolution g is used. n Conv enables long-term and high-level space interactions, represented as:
[0014] X mid =X+DP(g) n Conv(LN(X))),
[0015] X out =X mid +DP(MLP(LN(X mid ))),
[0016] Where LN represents layer normalization, MLP represents multilayer perceptron, DP represents random deactivation, and X represents the foggy feature map processed by the layer preceding the SIBlock spatial interaction module. mid This represents a foggy weather feature map after spatial interaction, X out This represents the output foggy weather feature map;
[0017] The wavelet attention downsampling module HAAD includes GhostConv, wavelet transform, pooling operation and channel attention mechanism module SE-block, which performs the following steps: First, the foggy feature map with spatial information, which has been processed by the spatial interaction module SIBlock, extracts the target features through GhostConv.
[0018] Then, the target features are divided into two branches, and max pooling and average pooling are used to extract the local salient features and the overall feature trend of the target, respectively, to obtain the max pooling result X. max Compared with the average pooling result X avg The formula is:
[0019] X max =Max(Chunk(X′*W1+G(X′)*W2)),
[0020] X avg =Avg(Chunk(X′*W1+G(X′)*W2)),
[0021] Where G represents ghost convolution, W1 and W2 represent weight hyperparameters, Chunk represents partitioning operation, Max represents max pooling operation, Avg represents average pooling operation, and X′ represents a foggy feature map with spatial information processed by the spatial interaction module SIBlock.
[0022] Channel attention optimization is performed using the SE-block module to obtain the max-pooling branch output X. se_max and average pooling branch output X se_avg The frequency domain transform branch further processes features through GhostConv convolution, and then uses wavelet transform to extract low-frequency structural information and high-frequency detail features to enhance edge and texture representation. The formula is as follows:
[0023]
[0024] Where P l (i,j) represents the low-frequency information of the image at position (i,j), P h (i,j) represents the high-frequency information of the image at position (i,j). This represents the pixel value at position (i,j) of the feature map after further processing of fog features through GhostConv convolution;
[0025] Finally, the features from each branch are fused using element-wise addition, and the final features are extracted using GhostConv convolution, outputting the optimized downsampled feature map X. out :
[0026] Xout =G(α*X) se_max +β*X se_avg +γX wave );
[0027] Where α, β, and γ represent the fusion weight hyperparameters, X wave This represents the output of the frequency domain transform branch.
[0028] Step 1.2 includes: The multi-scale feature fusion and stitching module BifpnCat includes two feature fusion paths, one of which is from p1 to... The other one is arrive The feature formulas output by the two feature fusion paths are:
[0029]
[0030] Where λ1, μ1, λ2, and μ2 are hyperparameters, p1 is the first input to the stitching layer, and p2 is the second input to the stitching layer. It is an intermediate feature of the first input. It is an intermediate feature of the second input. This is the first output feature map of the concatenation layer. It is the second output feature map of the splicing layer;
[0031] Then, the multi-scale feature fusion and splicing module BifpnCat retains the bidirectional path of feature fusion. Each bidirectional path is treated as an independent feature network layer, and the feature network layer is repeated more than twice. Finally, the splicing operation combines the features... and The final output is obtained by piecing them together.
[0032] The detection head integrates feature maps of three different scale foggy images obtained from the backbone network and the neck network, denoted as P2, P3, and P5, respectively.
[0033] The spatial adaptive attention fusion module SAAF performs the following steps: First, it uses a learnable spatial self-variation function f SC The convolution kernel is adjusted based on the spatial location (h, w) obtained from the height h and width w.
[0034] K h,w =f SC (X h,w ;Θ h,w ),
[0035] Where K h,w It is the convolution kernel at spatial location (h, w), Θ h,w X represents the set of trainable parameters used to generate the adaptive convolutional kernel.h,w This represents the local features of the previous layer's input foggy feature map X at spatial location (h, w);
[0036] The Spatial Adaptive Attention Fusion (SAAF) module calculates attention weights using contextual information at different scales and obtains feature maps at different scales using multi-layer convolution operations. Calculate the attention weights for each scale:
[0037]
[0038] Where R represents the real number space, and H s W s C s W represents the height, width, and number of channels of the feature map at scale s, respectively. (s) It is the attention weight matrix at scale s, α (s) These are the attention coefficients at various scales, and exp is the natural exponential function;
[0039] By fusing different scales, the enhanced feature map X is obtained. Ms :
[0040] X MS =∑ s α (s) X (s) ,
[0041] Finally, the enhanced fog feature map X is obtained based on an adaptive weighting mechanism. FIN :
[0042] X FIN =ε1X SC +ε2X MS ;
[0043] Where ε1 and ε2 are the fusion weight hyperparameters, X SC It is after convolution kernel K h,w The result obtained after calculation.
[0044] Step 2 includes:
[0045] Step 2.1: Train a multi-scale object detection network using the HazyDet object detection dataset of foggy images. During the training process, the AdamW optimizer and cosine annealing strategy are used.
[0046] Step 2.2: Record the accuracy of the multi-scale object detection network in detecting objects on the validation set in HazyDet during the training process, and determine whether the training process has converged based on the accuracy. Record the weights of the multi-scale object detection network after convergence as the final weights.
[0047] In step 2.1, the simplified formula for the AdamW optimizer is:
[0048]
[0049] Where θ is the weight decay coefficient and β is the learning rate. and These are the momentum term and the second moment estimate at the t-th update round, respectively. t These are the model parameters at the t-th update round, and e is a parameter to prevent the denominator from being 0.
[0050] In step 2.1, the momentum term is expressed as:
[0051] φ t =α1φ t-1 +(1-α1)d t ,
[0052]
[0053] Where d t It is the gradient, φ t It is a first-order momentum estimate of the gradient, where α1 is the momentum hyperparameter;
[0054] The second-order moment estimate is expressed as:
[0055]
[0056] Where n t It is the second moment estimate of the gradient, and α2 is the second momentum hyperparameter.
[0057] In step 2.1, the cosine annealing strategy formula is:
[0058]
[0059] Where ζ t ζ is the learning rate in the current t-round. max It is the initial learning rate, ζ min It is the minimum learning rate, Υ cur It is the count of the current round, Υ max It is the total training cycle.
[0060] The present invention also provides an electronic device, including a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method.
[0061] The present invention also provides a storage medium storing a computer program or instructions that, when the computer program or instructions are run on a computer, execute the steps of the method described.
[0062] Beneficial Effects: This invention first constructs a deep learning-based object detection network, then trains it using the HazyDet object detection dataset for foggy images. Repeated training allows the network to converge, obtaining the optimal network weights. Finally, the model performs inference to achieve object recognition in foggy conditions. This invention optimizes the training method of the object detection network, enabling further stable adjustments to the network training, while improving the network's performance in rapidly detecting objects in foggy conditions. The proposed network effectively balances detection speed and accuracy, is easy to deploy on devices, and is suitable for the real-time object detection needs of foggy images. Attached Figure Description
[0063] Figure 1 This is a flowchart of the method of the present invention.
[0064] Figure 2 This is a model diagram of the overall network architecture SD-YOLOv11 of this invention.
[0065] Figure 3 This is a structural diagram of SIBlock in the main body of this invention.
[0066] Figure 4 This is a diagram of the HAAD structure in the neck network of this invention.
[0067] Figure 5 This is a diagram of the BifpnCat structure in the neck network of this invention.
[0068] Figure 6 This is a schematic diagram comparing the application results of the method of this invention and the prior art. Detailed Implementation
[0069] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0070] like Figure 1 As shown, a deep learning-based target detection method in foggy weather includes the following steps:
[0071] Step 1: Construct a multi-scale target detection network, including the following steps:
[0072] Step 1.1: Establish an improved YOLOv11 network structure, starting with improvements to the backbone.
[0073] A spatial interaction module, SIBlock, was constructed to realize multiple interactions between spatial elements in feature maps, capturing long-term spatial dependencies in images and thus improving the network's target recognition ability in complex backgrounds, especially for blurred and low-contrast targets. In this module, layer normalization is first used to ensure that the output of each layer has the same distribution. Then, g... nConv enables long-term and high-level space interactions. The module's process is represented as follows:
[0074] X mid =X+DP(g) n Conv(LN(X))),
[0075] X out =X mid +DP(MLP(LN(X mid ))),
[0076] Where LN represents layer normalization, MLP represents multilayer perceptron, and g n Conv represents iterative convolution, DP represents random deactivation, and X represents the input feature map. mid The feature map representing the intermediate state, X out This represents the output feature map.
[0077] In this way, the model's expressive power is maintained while controlling computational resource consumption. This allows SIBlock to capture long-range spatial dependencies and enhance its ability to perceive detailed information, especially in blurred backgrounds, effectively distinguishing targets from the background and avoiding false detections due to occlusion or blurring.
[0078] Subsequently, to balance inference speed and detection accuracy, a HAAD downsampling module was designed. HAAD combines GhostConv, wavelet transform, pooling operations, and SE-block, enhancing feature representation capabilities while reducing computational costs. Its main process is as follows: First, redundant features are extracted from the input features using GhostConv to reduce computational load.
[0079] Then, the features are divided into two branches, where the pooling branch uses max pooling and average pooling to extract local salient features and overall feature trends, respectively, to obtain X. max With X avg The formula is as follows:
[0080] X max =Max(Chunk(X*W1+G(X)*W2)),
[0081] X avg =Avg(Chunk(X*W1+G(X)*W2)),
[0082] Where G represents ghost convolution, and W1 and W2 represent weight hyperparameters;
[0083] X is obtained by using SE-block for channel attention optimization. se_max and X se_avgThe frequency domain transform branch further processes features through GhostConv, then uses wavelet transform to extract low-frequency structural information and high-frequency detail features to enhance edge and texture representation. The formula is as follows:
[0084]
[0085] Where P l (i,j) is the low-frequency component, representing the low-frequency information of the image at position (i,j), P h (i,j) represents the high-frequency component, indicating the high-frequency information of the image at position (i,j). This represents the pixel value at position (i,j) of the input image.
[0086] Finally, the features from each branch are fused using element-wise addition, and GhostConv is used for final feature extraction, outputting the optimized downsampled feature map X. out :
[0087] X out =G(α*X) se_max +β*X se_avg +γX wave );
[0088] Step 1.2, improve the neck network.
[0089] A multi-scale feature fusion and stitching module, BifpnCat, is proposed. Unlike the fusion strategy of BiFPN, since stitching only involves two inputs, and to ensure full feature fusion, this invention improves the structure of BiFPN and enriches the feature fusion paths, one of which is p1 to... The other one is arrive In this way, the transfer of features across different scales is more complete, thereby enhancing the integration capability of multi-scale features. The feature formulas for the two outputs are as follows:
[0090]
[0091] Where λ1, μ1, λ2, and μ2 are hyperparameters.
[0092] Furthermore, each bidirectional path (top-down and bottom-up) is treated as an independent feature network layer, and this layer is repeated multiple times, thereby enabling the fusion of more high-level features. This design can improve the model's feature representation ability while reducing computational complexity, especially when dealing with complex backgrounds and multi-scale targets, and can more effectively fuse features of different scales.
[0093] This invention further enhances the network's capabilities by adding a detection head that integrates feature maps from three different scales of foggy images obtained from the model, denoted as P2, P3, and P5, respectively. This enhancement significantly improves the network's ability to detect small objects.
[0094] This embodiment also constructs a Spatial Adaptive Attention Fusion (SAAF) module to enhance feature representation capabilities. The module's process is as follows: First, Spatial Self-Variant Convolution (SAAF) aims to dynamically adjust the kernel size and weights based on the features of each local region. This is achieved through a learnable spatial self-variant function f. SC Adjust the convolution kernel according to the spatial location (h, w):
[0095] K h,w =f SC (X h,w ;Θ h,w ),
[0096] Where K h,w It is the convolution kernel at spatial location (h, w), Θ h,w X represents the set of trainable parameters used to generate the adaptive convolutional kernel, including network weights, biases, scale adaptation parameters, and position information encoding parameters used to dynamically generate the convolutional kernel. h,w This represents the local features of the previous layer's input foggy feature map X at spatial location (h, w);
[0097] Then, the multi-scale attention module calculates attention weights using contextual information at different scales to enhance the representation of targets at different scales, and uses multi-layer convolutional operations to obtain feature maps at different scales. Calculate the attention weights for each scale:
[0098]
[0099] Among them, W (s) It is the attention weight matrix at scale s, α (s) These are the attention coefficients at various scales, and exp is the natural exponential function;
[0100] By fusing different scales, the enhanced feature map is obtained:
[0101] X MS =∑ s α (s) X (s) ,
[0102] Finally, an adaptive weighting mechanism is used to further enhance the representation capability of important features, resulting in the final enhanced feature map:
[0103] X FIN =ε1X SC +ε2XMS ;
[0104] Step 1.3 modifies the stitching input layer in the neck network to improve detection accuracy. One of the last two stitching inputs in the neck network comes from the outputs of the first two C3K2 modules. However, after stitching, the number of channels is usually significantly reduced, which limits the network's ability to capture detailed information. To address this issue, this invention replaces the input of the last two stitches with the outputs of the first two stitches, thus preserving more channels. The advantage of this improvement is that it effectively enhances the network's ability to perceive detailed features, avoiding insufficient feature representation due to a small number of channels. Through this adjustment, the network can better capture detailed information in the image while maintaining high computational efficiency, thus improving overall detection accuracy.
[0105] The structure of the deep learning object detection network is as follows: Figure 2 As shown, the SIBlock structure is as follows Figure 3 As shown, HAAD is as follows Figure 4 As shown, BifpnCat is as follows Figure 5 As shown.
[0106] Step 2, train the network using the HazyDet object detection dataset for foggy images, including the following steps:
[0107] Step 2.1: Train the network using the HazyDet object detection dataset for foggy images. The AdamW optimizer and cosine annealing strategy were employed during training.
[0108] The simplified formula for the AdamW optimizer is as follows:
[0109]
[0110] Where θ is the weight decay coefficient and β is the learning rate. and These are the momentum term and the second moment estimate, Γ. t These are the model parameters at the t-th update, where t is the update round and e is a decimal value to prevent the denominator from being 0.
[0111] The momentum term is expressed as:
[0112] φ t =α1φ t-1 +(1-α1)d t ,
[0113]
[0114] Where d t It is the gradient, φ tIt is the first-order momentum estimate of the gradient, and α1 is the momentum hyperparameter.
[0115] The second-order moment estimate is expressed as:
[0116]
[0117] Where n t It is the second moment estimate of the gradient, and α2 is the second momentum hyperparameter.
[0118] The formula for the cosine annealing strategy is as follows:
[0119]
[0120] Where ζ t ζ is the learning rate in the current t-round. max It is the initial learning rate, ζ min It is the minimum learning rate, Υ cur It is the count of the current round, Υ max It is the total training cycle;
[0121] Step 2.2: Record the accuracy of the network in detecting targets on the validation set during the training process, and use this to determine whether the training process has converged. Record the weights of the network after convergence as the weights of the detection network.
[0122] Step 3: Repeat iterative training to bring the multi-scale object detection network to convergence: Record the accuracy of the network in detecting objects on the validation set during training. If the accuracy fluctuates by no more than 0.05 mAP in 10 training rounds, the network is considered to have converged.
[0123] In this embodiment, a multi-scale object detection network trained 200 times was used to conduct ablation experiments on 11,000 images representing three different targets in the HazyDet object detection dataset for foggy images. Starting with the original YOLOv11 model, its baseline performance is: mAP 50 It was 77.4%, mAP 50-95 The mAP was 59.4%; after adding a fourth detection head, the model's mAP... 50 It remained unchanged at 77.4%, while mAP 50-95 The 0.4% improvement indicates that the additional detection head enhances the model's adaptability to object detection under different IoU thresholds to some extent. Subsequently, after adding the SIBlock spatial interaction module, mAP... 50 Increased by 0.6%, mAP 50-95 The 0.9% increase demonstrates that this module effectively improves the model's detection capabilities in complex backgrounds and low-contrast scenes by enhancing spatial interaction and feature fusion. Subsequently, combined with the HAAF module, mAP... 50 Further increased to 78.4%, mAP50-95 Reaching 61.0%, this demonstrates HAAF's advantages in capturing global contextual information and multi-scale features. Based on this result, adding the multi-scale feature fusion and stitching module BifpnCat slightly decreased the mAP, but improved the accuracy by 0.6%. This may reflect a trade-off in the feature fusion process, but it also further enhances the ability to integrate multi-scale information. Finally, integrating the spatial adaptive attention fusion module SAAF further improved the mAP... 50 and mAP 50-95 The performance was further improved by 0.5% and 0.7% respectively, indicating that the model achieved superior performance when handling complex backgrounds and blurred targets through the DASI attention mechanism. Overall, after gradually introducing these improved modules, the model's mAP improved significantly. 50 and mAP 50-95 The improvements were 1.4 and 2.0 percentage points respectively, validating the advantages of the proposed improvement scheme in target detection tasks under foggy conditions.
[0124] Table 1
[0125]
[0126]
[0127] Step 4: Input the image into the multi-scale target detection network, calculate the fog detection results, and output information such as the location and category of the target in the fog.
[0128] from Figure 6 It is evident from the experiments on the HazyDet dataset that YOLOv11's detection performance is significantly insufficient when the scene is complex and the target distribution is dense, or when the target has a low resolution in the image, resulting in problems such as missed detections and false detections. For example, Figure 6 In the image, the top row shows low-resolution targets, targets blurred by dense fog, and targets with blurred edges. Missed detections are observed in the second, third, and fourth rows. This indicates that other algorithms fail to adequately capture information about small and blurred targets in complex foggy scenes. In contrast, the method proposed in this embodiment... Figure 6 The fifth line effectively addresses these issues. Through model improvements, its feature extraction and multi-scale fusion capabilities are significantly enhanced, thereby improving the detection capabilities of low-resolution targets and targets obscured by dense fog, and significantly reducing false negatives and missed detections.
[0129] This invention provides a deep learning-based target detection method in foggy weather. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A deep learning-based target detection method in foggy weather, characterized in that, Includes the following steps: Step 1: Build a multi-scale target detection network; Step 2: Train a multi-scale object detection network using the HazyDet object detection dataset of foggy images; Step 3: Repeat the iterative training until the multi-scale object detection network converges; Step 4: Input the image into the multi-scale target detection network, calculate the fog detection results, and output the location and category information of the target in the fog. Step 1 includes: Step 1.1: The multi-scale target detection network is an improved YOLOv11 network. First, the backbone network of the YOLOv11 network is improved by constructing a spatial interaction module SIBlock and a wavelet attention downsampling module HAAD in the backbone network. Step 1.2, improve the neck network of YOLOv11 by constructing a multi-scale feature fusion and splicing module BifpnCat, a detection head, and a spatial adaptive attention fusion module SAAF in the neck network; Step 1.3, modify the splicing input layer in the neck network: replace the inputs of the last two splices of the neck network with the outputs of the first two splices of the neck network; Step 1.1 includes: The spatial interaction module SIBlock is used to realize the interaction between spaces in the feature map and capture the spatial dependencies in the image. In the spatial interaction module SIBlock, layer normalization is first used to ensure that each layer of the input foggy feature map has the same output distribution, and then iterative convolution is used. Achieving long-term and high-level space interactions is represented as: , , Where LN represents layer normalization, MLP represents multilayer perceptron, DP represents random deactivation, and X represents the foggy feature map processed by the layer preceding the SIBlock spatial interaction module. This represents a feature map of foggy weather after spatial interaction. This represents the output foggy weather feature map; The wavelet attention downsampling module HAAD includes GhostConv, wavelet transform, pooling operation and channel attention mechanism module SE-block, which performs the following steps: First, the foggy feature map with spatial information, which has been processed by the spatial interaction module SIBlock, extracts the target features through GhostConv. Then, the target features are divided into two branches, and max pooling and average pooling are used to extract the local salient features and the overall feature trend of the target, respectively, to obtain the max pooling results. Compared with average pooling results The formula is: , , Where G represents ghost convolution. and This represents the weight hyperparameter. This indicates a partitioning operation. This indicates a max pooling operation. This indicates the average pooling operation. This represents a foggy weather feature map with spatial information, processed by the SIBlock spatial interaction module. The channel attention mechanism module SE-block is used to optimize channel attention and obtain the max pooling branch output. and average pooling branch output The frequency domain transform branch further processes features through GhostConv convolution, and then uses wavelet transform to extract low-frequency structural information and high-frequency detail features to enhance edge and texture representation. The formula is as follows: , , in It indicates the position of the image. Low-frequency information, Indicates the image at position High-frequency information, This indicates the feature map at the location after further processing of fog features using GhostConv convolution. Pixel value at; Finally, the features from each branch are fused using element-wise addition, and the final features are extracted using GhostConv convolution, outputting an optimized downsampled feature map. : ; in , and This represents the fusion weight hyperparameter. This represents the output of the frequency domain transform branch; Step 1.2 includes: The multi-scale feature fusion and stitching module BifpnCat includes two feature fusion paths, one of which is... arrive The other one is arrive The feature formulas output by the two feature fusion paths are: , , in, , , , It's a hyperparameter. It is the first input to the splicing layer. It is the second input to the splicing layer. It is an intermediate feature of the first input. It is an intermediate feature of the second input. This is the first output feature map of the concatenation layer. It is the second output feature map of the splicing layer; Then, the multi-scale feature fusion and splicing module BifpnCat retains the bidirectional path of feature fusion. Each bidirectional path is treated as an independent feature network layer, and the feature network layer is repeated more than twice. Finally, the splicing operation combines the features... and The final output is obtained by piecing them together. The detection head integrates feature maps of three different scale foggy images obtained from the backbone network and the neck network, denoted as P2, P3, and P5, respectively. The spatial adaptive attention fusion module (SAAF) performs the following steps: First, it uses a learnable spatial self-variable function... The convolution kernel is adjusted based on the spatial location (h, w) obtained from the height h and width w. , in It is the convolution kernel at spatial location (h, w). This represents the set of trainable parameters used to generate the adaptive convolutional kernel. This represents the foggy feature map input from the previous layer. Local features at spatial location (h, w); The Spatial Adaptive Attention Fusion (SAAF) module calculates attention weights using contextual information at different scales and obtains feature maps at different scales using multi-layer convolution operations. Calculate the attention weights for each scale: , Where R represents the real number space. , , Let represent the height, width, and number of channels of the feature map at scale s, respectively. It is the attention weight matrix at scale s. These are the attention coefficients at various scales, and exp is the natural exponential function; Enhanced feature maps are obtained by fusing different scales. : , Finally, the enhanced fog feature map is obtained based on an adaptive weighting mechanism. : ; in and It is a fusion weight hyperparameter. It is through the convolution kernel The result obtained after calculation.
2. The method according to claim 1, characterized in that, Step 2 includes: Step 2.1: Train a multi-scale object detection network using the HazyDet object detection dataset for foggy images. During training, the AdamW optimizer and cosine annealing strategy are used. Step 2.2: Record the accuracy of the multi-scale object detection network in detecting objects on the validation set in HazyDet during the training process, and determine whether the training process has converged based on the accuracy. Record the weights of the multi-scale object detection network after convergence as the final weights.
3. The method according to claim 2, characterized in that, In step 2.1, the simplified formula for the AdamW optimizer is: , in, It is the weight decay coefficient. It's the learning rate. and These are the momentum term and the second moment estimate at the t-th update round, respectively. These are the model parameters at the t-th update round, and e is a parameter to prevent the denominator from being 0.
4. The method according to claim 3, characterized in that, In step 2.1, the momentum term is expressed as: , , in It is the gradient. It is a first-order momentum estimate of the gradient. It is a momentum hyperparameter; The second-order moment estimate is expressed as: , , in It is a second-moment estimate of the gradient. It is a second-order momentum hyperparameter.
5. The method according to claim 4, characterized in that, In step 2.1, the cosine annealing strategy formula is: , in This is the learning rate for the current t-round. It is the initial learning rate. It is the minimum learning rate. It is the count of the current round. It is the total training cycle.
6. An electronic device, characterized in that, It includes a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 5.
7. A storage medium, characterized in that, It stores a computer program or instructions that, when run on a computer, perform the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
AOD-Net enhanced YOLOv8-based detection method for mining ground fissures of coal mine in foggy weather environment
CN118864981A