Fog target detection method based on dark channel prior guided attention mechanism
Patent Information
- Application Number
- CN202411153022.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2044-08-21
AI Technical Summary
[0004]相关方法的局限性:雾天会导致图像质量下降,从而导致目标检测的性能下降
[0039]The beneficial effects of this invention are as follows: By employing a guided attention mechanism based on dark channel priors, this invention fully mines the fog concentration information and target depth information contained in the dark channel priors, enhancing the model's robustness to varying fog concentrations. Furthermore, it fully utilizes depth information to infer the existence and location of targets, thereby improving the discriminative power of the backbone neural network in extracting image features, and ultimately increasing the accuracy of target detection in foggy environments. This mechanism enhances the model's robustness in foggy environments, further promoting the application of this invention's method in numerous fields such as intelligent monitoring and autonomous driving, and improving environmental adaptability under different task scenarios.
Smart Images

Figure CN119152469B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision technology and relates to a foggy target detection method based on a dark channel prior-guided attention mechanism. Background Technology
[0002] In recent years, with the widespread application of autonomous driving and drones, target detection, as their "eyes," has become increasingly important. Thanks to the rapid development of deep learning, deep learning-based target detection methods have made significant progress. In practical applications, severe weather conditions such as fog are an unavoidable reality. However, existing methods are often designed for good weather conditions and are difficult to adapt to severe weather conditions such as fog. The main reason is that in foggy conditions, the specific spectrum between the photographed object and the camera is affected by the absorption and scattering of tiny suspended particles (such as water droplets, ice crystals, dust, and other particles), resulting in a significant reduction in image visibility and a deterioration in image quality. Existing neural networks struggle to extract discriminative features from such degraded images for target detection, severely limiting the accuracy of target detection. Therefore, the key to improving target detection accuracy in foggy conditions lies in enhancing the ability of neural network models to extract highly discriminative features from foggy images.
[0003] Task Definition: The key to the fog target detection method based on the dark channel prior guided attention mechanism is to first combine prior knowledge in the fog scene, and then fully explore the key information that is discriminative and robust to be useful for detection through the guided attention mechanism, thereby improving the performance of target detection under fog conditions.
[0004] Limitations of related methods: Fog degrades image quality, leading to decreased object detection performance. Several methods exist for object detection in foggy conditions. There are three main approaches to object detection in foggy weather. The first and most direct method involves image preprocessing to remove specific weather information, resulting in a clear image before object detection. Li and Yang were the first to propose a method using loss supervision to recover a clear image and perform object detection. The second approach is based on multi-task learning, simultaneously learning multiple tasks, where one task may benefit others. Huang designed a dual-subnet framework, generating clean features by designing an image recovery subnet that shares feature extraction layers with the detection subnet, while jointly learning three tasks: visibility enhancement, object classification, and localization. Cui predicts image degradation parameters and simultaneously detects targets to extract features with better representations. The third approach applies joint enhancement and detection methods. First, the input foggy image is enhanced in some way. Then, the enhanced image is fed into a standard object detection model for detection. Liu proposed a differentiable image processing (DIP) module whose parameters are predicted by a small convolutional neural network (CNN-PP) so that each image can be adaptively enhanced. Qin proposed a joint enhancement detection framework, DENet, which decomposes the input image into low-frequency and high-frequency components, adaptively enhances each component, and performs detection using a YOLOv3 model in an end-to-end manner. These methods typically perform image dehazing and object detection sequentially. However, these methods suffer from two main drawbacks. First, while dehazed images may enhance the perceived quality by the human eye, they do not necessarily improve machine perception. Furthermore, image dehazing introduces considerable computational complexity. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a fog target detection method based on a dark channel prior-guided attention mechanism, which aims to improve the detection accuracy in foggy scenes. This method can be used in various scenarios such as unmanned vehicles and drones, effectively making up for the shortcomings of unmanned vehicles and drones in low detection accuracy in foggy environments, thereby expanding the application scenarios of unmanned vehicles and drones.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A foggy target detection method based on a dark channel prior-guided attention mechanism includes the following steps:
[0008] S1: Collect foggy images containing various types of targets, preprocess the images, and label all targets of interest in each image to divide them into training set, validation set and test set;
[0009] S2: Construct a foggy target detection model based on a dark channel prior-guided attention mechanism, including a dark channel prior-guided attention model, a backbone neural network, a feature pyramid network, and a target detection head network; the backbone neural network is used to extract multi-scale features of the input image; the dark channel prior-guided attention model is used to perform the following steps:
[0010] S21: Based on the definition of dark channel, generate the corresponding dark channel prior for the input image;
[0011] S22: Perform downsampling on it to obtain a prior map that matches the size of the features extracted by the backbone neural network;
[0012] S23: Calculate the guiding attention weight using the prior map and mine the fog concentration information and target depth information contained in the dark channel prior;
[0013] S24: The attention weights are fused with the multi-scale features generated by the backbone neural network to obtain enhanced features;
[0014] The feature pyramid network and the target detection head network regress and classify targets at corresponding scales based on the enhanced features;
[0015] S3: Train the fog target detection model based on the dark channel prior guided attention mechanism using the training set, validate the trained fog target detection model based on the dark channel prior guided attention mechanism using the validation set, and test the best-performing training model using the test set.
[0016] S4: Utilize the fog-day target detection model based on the dark channel prior-guided attention mechanism, which was completed during testing, to calculate and output the location and category information of targets in the image.
[0017] Furthermore, the preprocessing in step S1 includes: adjusting the resolution of the image, converting it to a uniform format, and augmenting the dataset through data augmentation, which includes random or horizontal flipping, random cropping, and image scaling.
[0018] Furthermore, the multi-scale features extracted by the backbone neural network are respectively equivalent to 1 / 4, 1 / 8, and 1 / 4 of the original image size.
[0019] 1 / 16 and 1 / 32 are represented as {X0, X1, X2, X3}, respectively.
[0020] Furthermore, the dark channel prior guided attention model includes a dark channel prior computation module (PC) and a dark channel prior guided attention module (PGA);
[0021] The dark channel prior calculation module is used to generate the dark channel prior for foggy images. Based on the atmospheric scattering model, the transmittance map is defined as follows:
[0022] t(x)=e -βd(x)
[0023] Where t(x) represents the transmittance map, β is the atmospheric scattering coefficient containing fog concentration information, and d(x) is the scene depth; the dark channel prior is often used to recover the transmittance map. According to the definition of the transmittance map, it can be inferred that the dark channel prior contains fog concentration information and depth information, which can be used to help eliminate the interference of fog.
[0024] Calculate the dark channel prior (DCP) based on the input hazy image: First, obtain the channel with the minimum pixel value among the RGB three channels of the hazy image. After obtaining a single channel, select the minimum value within a local region. The definition of the dark channel is expressed by the following formula:
[0025]
[0026] Where J is any image, J c Let J be the color channel c∈{r,g,b}, and Ω(x) represent the local block region centered at x. dark (x) represents the minimum value among all pixels in the RGB channels and Ω(x);
[0027] The dark channel prior guided attention module is used to enhance the features extracted by the backbone network. A bilinear interpolation downsampling method is used on the original dark channel prior to obtain a resolution consistent with the corresponding feature map size. Based on the resolution of the multi-scale features extracted by the backbone neural network, the dark channel features are downsampled by 1 / 8, 1 / 16, and 1 / 32 respectively. The downsampled dark channel prior (DCP) features are denoted as... Then, using the guided attention mechanism, dark channel prior features are utilized. With the corresponding backbone network feature X, the attention module is guided by the dark channel prior. The prior features are enriched by passing them through three convolutional layers in sequence, and the potential features of DCP are further explored. The prior features output after passing through the three convolutional layers are denoted as Y. Then, the prior features Y are used as guiding attention weights and multiplied with the backbone features X to guide the detector to focus on the beneficial information that is helpful for detection.
[0028] Furthermore, the specific operations of the three convolutional layers in the dark channel prior-guided attention module are as follows:
[0029] First, the dark channel prior is passed through a 1×1 convolutional layer, increasing the number of prior channels from 1 to 1 / 4 of the number of channels in the corresponding backbone feature. Then, it is passed through a 3×3 convolutional layer, keeping the number of channels unchanged. Finally, it is passed through a 1×1 convolutional layer to increase the number of channels by a factor of 4, making it the same as the number of channels in the corresponding backbone feature. This can be represented as:
[0030]
[0031] in The input DCP features are represented by i, which represents the multi-scale feature level extracted by the backbone network, and f is the input DCP feature. 1×1 f represents a convolution operation with a kernel size of 1. 3×3 This indicates that the kernel size is 3, Y i This represents the DCP prior features output after three convolutional layers;
[0032] An attention mechanism is introduced, where the DCP features are multiplied bitwise with the features extracted from the backbone as position-aware attention weights. The attention weights are applied to the DCP features Y after the convolution operation. i Obtained by performing a sigmoid operation; then the backbone feature X is... i A 3×3 convolution operation is performed, followed by multiplication with weights; residual connections are used to avoid offset caused by the fusion of different domains; the calculation process is as follows:
[0033]
[0034] Where σ represents the sigmoid activation function, This represents the final output after the dark channel prior-guided attention module.
[0035] Furthermore, multi-level features following the attention module will be guided by dark channel priors. The input is fed into the feature pyramid network to obtain enhanced multi-level features; the detection head network uses the features obtained by the feature pyramid network to classify the target and regress the bounding box.
[0036] Furthermore, in the training phase of step S3, the total training loss L total It is expressed as follows:
[0037] L total =L cls +L loc
[0038] L cls To detect the focus loss used by the head network for classification training; L loc The SmoothL1 loss is used by the detection head network for bounding box regression.
[0039] The beneficial effects of this invention are as follows: By employing a guided attention mechanism based on dark channel priors, this invention fully mines the fog concentration information and target depth information contained in the dark channel priors, enhancing the model's robustness to varying fog concentrations. Furthermore, it fully utilizes depth information to infer the existence and location of targets, thereby improving the discriminative power of the backbone neural network in extracting image features, and ultimately increasing the accuracy of target detection in foggy environments. This mechanism enhances the model's robustness in foggy environments, further promoting the application of this invention's method in numerous fields such as intelligent monitoring and autonomous driving, and improving environmental adaptability under different task scenarios.
[0040] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0041] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0042] Figure 1 This is a flowchart illustrating the training and testing of a fog-day target detection model based on a dark channel prior-guided attention mechanism.
[0043] Figure 2 This is a diagram showing the overall structure of a fog-day target detection model based on a dark channel prior-guided attention mechanism. Detailed Implementation
[0044] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0045] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0046] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0047] like Figure 1 As shown, this invention provides a foggy target detection method based on a dark channel prior-guided attention mechanism, comprising the following steps:
[0048] The first step is to prepare the dataset.
[0049] (1) Prepare data.
[0050] The prepared image data first needs to include images of foggy scenes. These can be from real foggy scenes for training or testing, or foggy images can be synthesized from clear images using a fog simulation library such as imgaug for training. Simultaneously, the images should contain objects whose categories need to be identified; for example, if detecting cars is required, the prepared images must contain car entities. Furthermore, the foggy object detection method of this invention, based on a dark channel prior-guided attention mechanism, is a supervised learning method, therefore the prepared images also need to be labeled. Objects in the images need to be labeled, including bounding boxes and category information. This can be done manually using annotation tools or by utilizing existing labeled datasets.
[0051] (2) Perform data processing.
[0052] In addition to dividing the prepared dataset into training, validation, and test datasets, the acquired data may also need to undergo some preprocessing, such as format conversion and size adjustment, to adapt to a specific object detection model.
[0053] (3) Data augmentation.
[0054] Since foggy image datasets are typically smaller than those under normal weather conditions, data augmentation may be necessary to expand the dataset and improve the model's detection accuracy. Data augmentation techniques can include random or horizontal flipping, random cropping, and image scaling.
[0055] The second step is to train a fog-day target detection method based on a dark channel prior-guided attention mechanism.
[0056] (1) Constructing a backbone neural network
[0057] The backbone neural network is used to initially extract features from the input foggy image. The present invention designs a backbone network that can extract multi-scale features. The sizes of the extracted multi-scale features are equivalent to 1 / 4, 1 / 8, 1 / 16 and 1 / 32 of the original image size, respectively, and are represented as {X0, X1, X2, X3}.
[0058] (2) Constructing a dark channel prior-guided attention model
[0059] Dark channels can provide fog density information and target depth information, and introducing dark channels can assist detectors in extracting more discriminative features. Based on this, this invention constructs a dark channel prior-guided attention model. This model consists of two core parts: a dark channel prior computation module (PC) and a dark channel prior-guided attention module (PGA), which are described in detail below.
[0060] Dark channel prior calculation module (PC): such as Figure 2 As shown on the right. Based on the characteristics of outdoor fog-free images, it was found that in most local areas except for the sky, at least one color (RGB) channel contains some pixels (called dark pixels) with very low illumination intensity. The intensity of these dark pixels in foggy images is mainly contributed by atmospheric light, which provides information about the depth of the fog. Dark channel priors are often used to recover the transmittance map in image dehazing. According to the atmospheric scattering model, the transmittance map is defined as follows:
[0061] t(x)=e -βd(x)
[0062] Where t(x) represents the transmittance map, β is the atmospheric scattering coefficient containing fog concentration information, and d(x) is the scene depth. Inspired by this, the dark channel prior contains fog concentration information and depth information, which can be used to assist the detector in eliminating fog interference.
[0063] Based on the definition of Dark Channel Prior Value (DCP), the DCP is calculated using the input hazy image. First, the channel with the minimum pixel value among the RGB three channels of the hazy image is obtained. After obtaining a single channel, the minimum value within a local region is selected. The definition of the Dark Channel can be expressed by the following formula:
[0064]
[0065] Where J is any image, J c Let J be the color channel c∈{r,g,b}, and Ω(x) represent the local block region centered at x. dark (x) represents the minimum value among all pixels in the RGB channels and Ω(x).
[0066] Dark Channel Prior Guided Attention (PGA) Module: The PGA module aims to enhance the features extracted by the backbone network to achieve better detection performance. It employs bilinear interpolation downsampling on the original dark channel prior to obtain a resolution consistent with the corresponding feature map size. Based on the resolution of the multi-scale features extracted by the backbone neural network, the dark channel features need to be downsampled by 1 / 8, 1 / 16, and 1 / 32, respectively. The downsampled DCP features are denoted as... Then, using the guided attention mechanism, dark channel prior features are utilized. With the corresponding backbone network feature X, the proposed Guided Attention Module (PGA) and dark channel prior are used. The prior features are enriched sequentially through three convolutional layers to further explore the latent features of the DCP. The prior features output after the three convolutional layers are denoted as Y. Then, the prior feature Y is used as the guiding attention weight and multiplied with the backbone feature X to guide the detector to focus on the beneficial information that is conducive to detection. The specific operations of the three convolutional layers are as follows.
[0067] First, the dark channel prior is passed through a 1×1 convolutional layer, increasing the number of prior channels from 1 to 1 / 4 of the corresponding backbone feature channels. Then, it passes through a 3×3 convolutional layer, keeping the number of channels constant. Finally, a 1×1 convolutional layer increases the number of channels by a factor of four, making it the same as the corresponding backbone feature channels. A rich dark channel prior feature representation can be obtained using only three convolutional layers. Furthermore, all convolutional operations do not change the resolution and remain consistent with the input. This process can be represented as follows:
[0068]
[0069] in Let f represent the dark channel prior features (DCP) of the input, i represent the multi-scale feature level extracted by the backbone network, and f 1 ×1 f represents a convolution operation with a kernel size of 1. 3×3 This indicates that the kernel size is 3, Y i This represents the DCP prior features output after three convolutional layers.
[0070] DCP features contain rich fog thickness information, which can powerfully help the detector focus on learning detection-friendly information. Each location in the image contains different fog information. To provide corresponding fog information for each location, an attention mechanism is introduced, multiplying the DCP features as position-aware attention weights with the backbone-extracted features bitwise. The attention weights can be calculated by applying the convolutional DCP features Y... i Obtained by performing a sigmoid operation. Then, the backbone feature X is... iA 3×3 convolution operation is performed, followed by multiplication with weights. Furthermore, to mitigate the bias caused by the fusion of different domains, residual connections are used. This computation process can be represented as follows:
[0071]
[0072] Where σ represents the sigmoid activation function, This represents the final output after passing through the Prior Guided Attention (PGA) module.
[0073] (3) Constructing a feature pyramid network and an object detection head network
[0074] Next, a feature pyramid network is constructed to further enhance the robustness and discriminative power of the features. This network will guide the multi-level features following the attention module (PGA) through prior knowledge. The input is fed into the feature pyramid network to obtain enhanced multi-level features. Finally, the detection head network uses the features obtained from the feature pyramid network to classify the target and regress the bounding box.
[0075] During the training phase, the detection head network uses focus loss for classification training, denoted as L. cls For bounding box regression, the detection network uses the SmoothL1 loss, denoted as L. loc Total training loss L total It can be represented as follows:
[0076] L total =L cls +L loc
[0077] The third step is to test the performance of the attention network model based on dark channel prior guidance.
[0078] (1) During testing, this invention was tested on the RTTS dataset using an RTX4090D GPU.
[0079] (2) To verify the effectiveness of the model of this invention, it was compared with some previous advanced target detection methods in foggy weather, namely AODNet[Li B, Ren W, Fu D, et al.Benchmarking Single-Image Dehazing and Beyond[J].IEEE Transactions on Image Processing,2019,28(1):492-505.], DSNet[Huang SC, Le TH, Jaw DW.DSNet: Joint Semantic Learning for Object Detection in Inclement Weather Conditions[J].IEEE Transactions on Pattern Analysis and Machine Intelligence,2020:1-1.], IANet[Liu W, Ren G, Yu R, et al.Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions[Z].arXiv,2022(2022-07-04).] and DENet[Qin Q, Chang K, Huang M, et al.DENet: Detection-driven Enhancement Network for Object Detection Under Adverse Weather Conditions]. WeatherConditions [M]. Wang L, Gall J, Chin TJ, et al., eds. / / Computer Vision–ACCV2022.2023,13843:491-507Cham:Springer Nature Switzerland,2023:491-507.]. The detection accuracy (AP) and inference speed (FPS) of these models were tested under the same configuration. AP (Average Precision) represents the average precision and is used to measure the accuracy of the target detection model. It considers the precision at different confidence thresholds and calculates an average value. Other evaluation metrics include AP. 50 This indicates the average accuracy when the IoU (Intersection over Union) is greater than 50%; AP 75 This represents the average accuracy when IoU is greater than 75%; AP s APm and AP l The values represent the average accuracy for small, medium, and large targets, respectively. FPS represents the number of images that can be processed per second; the higher the value, the faster the inference speed. The test results are shown in Table 1. Table 1 shows the experiments conducted on the publicly available target detection dataset RTTS [Li B, Ren W, Fu D, et al. Benchmarking Single-Image Dehazing and Beyond[J].IEEE Transactions on Image Processing, 2019, 28(1):492-505.] under foggy conditions. The experiments verified that the present invention has excellent detection accuracy and fast inference capability, effectively meeting the current performance and efficiency requirements for target detection in foggy conditions, and demonstrating the superiority of the method of the present invention.
[0080] Table 1
[0081]
[0082] In the above embodiments, the reference to "this embodiment" in the specification indicates that a specific feature, structure, or characteristic described in connection with the embodiment is included in at least some embodiments, but not necessarily all embodiments. Multiple appearances of "this embodiment" do not necessarily all refer to the same embodiment.
[0083] In the above embodiments, although the invention has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory structures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed. The embodiments of the invention are intended to cover all such substitutions, modifications, and variations falling within the broad scope of the appended claims.
[0084] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods in this embodiment.
[0085] This embodiment also provides an electronic terminal, including: a processor and a memory;
[0086] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to cause the terminal to perform any of the methods in this embodiment.
[0087] As will be understood by those skilled in the art, the computer-readable storage medium described in this embodiment allows for the implementation of all or part of the steps in the above method embodiments by computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0088] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic terminal performs the steps of the above method.
[0089] In this embodiment, the memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0090] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0091] This invention can be used in a wide range of general-purpose or special-purpose computing system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0092] This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A foggy target detection method based on a dark channel prior-guided attention mechanism, characterized in that: Includes the following steps: S1: Collect foggy images containing various types of targets, preprocess the images, and label all targets of interest in each image to divide them into training set, validation set and test set; S2: Construct a foggy target detection model based on a dark channel prior-guided attention mechanism, including a dark channel prior-guided attention model, a backbone neural network, a feature pyramid network, and a target detection head network; the backbone neural network is used to extract multi-scale features of the input image; the dark channel prior-guided attention model is used to perform the following steps: S21: Based on the definition of dark channel, generate the corresponding dark channel prior for the input image; S22: Perform downsampling on it to obtain a prior map that matches the size of the features extracted by the backbone neural network; S23: Calculate the guiding attention weight using the prior map and mine the fog concentration information and target depth information contained in the dark channel prior; S24: The attention weights are fused with the multi-scale features generated by the backbone neural network to obtain enhanced features; The dark channel prior-guided attention model includes a dark channel prior calculation module and a dark channel prior-guided attention module. The dark channel prior calculation module is used to generate the dark channel prior of the foggy image; Calculate the dark channel prior DCP based on the input hazy image: First, obtain the channel with the minimum pixel value among the RGB three channels of the hazy image. After obtaining a single channel, select the minimum value within a local region. The definition of the dark channel is expressed by the following formula: in It is any image. yes Color channels , Indicated by A local block region centered on; Represented as RGB channels and The minimum value among all pixels in the array; The dark channel prior guided attention module is used to enhance the features extracted by the backbone network. A bilinear interpolation downsampling method is used on the original dark channel prior to obtain a resolution consistent with the corresponding feature map size. Based on the resolution of the multi-scale features extracted by the backbone neural network, the dark channel features are downsampled by 1 / 8, 1 / 16, and 1 / 32 respectively. The downsampled dark channel prior DCP features are denoted as... Then, using the guided attention mechanism, dark channel prior features... Corresponding backbone network features The attention module is guided by the dark channel prior. The prior features are enriched by passing them through three convolutional layers in sequence, further mining the latent features of DCP. The prior features output after passing through the three convolutional layers are denoted as... Then the prior features As a weight to guide attention, it is related to backbone features. Multiplication guides the detector to focus on information that is beneficial to detection. The feature pyramid network and the target detection head network regress and classify targets at corresponding scales based on the enhanced features; S3: Train the fog target detection model based on the dark channel prior guided attention mechanism using the training set, validate the trained fog target detection model based on the dark channel prior guided attention mechanism using the validation set, and test the best-performing training model using the test set. S4: Utilize the fog-day target detection model based on the dark channel prior-guided attention mechanism, which was completed during testing, to calculate and output the location and category information of targets in the image.
2. The fog target detection method based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: The preprocessing in step S1 includes: adjusting the resolution of the image, converting it to a uniform format, and augmenting the dataset through data augmentation, which includes random or horizontal flipping, random cropping, and image scaling.
3. The fog target detection method based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: The multi-scale features extracted by the backbone neural network are respectively equivalent to 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image size, and are represented as follows: .
4. The fog target detection method based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: The specific operations of the three convolutional layers in the dark channel prior-guided attention module are as follows: First, the dark channel prior is passed through a 1×1 convolutional layer, increasing the number of prior channels from 1 to 1 / 4 of the number of channels in the corresponding backbone feature. Then, it is passed through a 3×3 convolutional layer, keeping the number of channels unchanged. Finally, it is passed through a 1×1 convolutional layer to increase the number of channels by a factor of 4, making it the same as the number of channels in the corresponding backbone feature. This can be represented as: in This represents the input DCP features. This represents the multi-scale feature levels extracted by the backbone network. This represents a convolution operation with a kernel size of 1. This indicates that the kernel size is 3. This represents the DCP prior features output after three convolutional layers; An attention mechanism is introduced, where DCP features are multiplied positionally with the features extracted from the backbone as position-aware attention weights. The attention weights are applied to the DCP features after convolution. Obtained by performing a sigmoid operation; then the backbone features are... A 3×3 convolution operation is performed, followed by multiplication with weights; residual connections are used to avoid offset caused by the fusion of different domains; the calculation process is as follows: in, This represents the sigmoid activation function. This represents the final output after the dark channel prior-guided attention module.
5. The foggy target detection method based on dark channel prior-guided attention mechanism according to claim 4, characterized in that: Multi-level features will be guided by the dark channel prior to the attention module. The input is fed into the feature pyramid network to obtain enhanced multi-level features; the detection head network uses the features obtained by the feature pyramid network to classify the target and regress the bounding box.
6. The fog target detection method based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: In step S3, during the training phase, the total training loss is... It is expressed as follows: To detect the focus loss used by the head network for classification training; The method used by the detection head network for bounding box regression loss.