Foggy day target detection method based on dark channel prior attention guiding mechanism

Through the dark channel prior guidance attention mechanism, the fog concentration and depth of field information are excavated, and the problem of low target detection accuracy in fog days is solved, and the detection accuracy and robustness are achieved. It is suitable for unmanned vehicles and unmanned vehicles. Machinery and other fields.

CN119152469AActive Publication Date: 2024-12-17CHONGQING UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411153022.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-17
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

The prior art is difficult to extract features with strong discernible characteristics from degraded images under foggy conditions, resulting in low target detection accuracy. Especially in UAV applications, existing methods often rely on image defogging and enhances, but increases computational complexity and does not necessarily improve machine perception.

Method used

The foggy day object detection method based on the dark channel prior guidance attention mechanism is adopted. Through the dark channel prior calculation module and the guidance attention module, the fog concentration information and depth of field information are excavated, the characteristics extracted by the backbone neural network are enhanced, and the detection accuracy is improved.

Benefits of technology

Improve the accuracy and robustness of target detection in foggy environments, enhance the model's adaptability to variable fog concentrations, promote the application of drones and drones in harsh environments, and improve detection accuracy and inference speed. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152469A_ABST
    Figure CN119152469A_ABST
Patent Text Reader

Abstract

The invention relates to a foggy day target detection method based on a dark channel prior attention guiding mechanism, and belongs to the technical field of computer vision, and the method comprises the following steps: S1, collecting foggy day images containing various types of targets, carrying out the preprocessing of the images, marking all interested targets in each image, and obtaining a foggy day image; dividing a training set, a verification set and a test set; s2, constructing a foggy day target detection model based on a dark channel prior guidance attention mechanism, wherein the foggy day target detection model comprises a dark channel prior guidance attention model, a backbone neural network, a feature pyramid network and a target detection head network; the backbone neural network is used for extracting multi-scale features of an input image; s3, training, verifying and testing the foggy day target detection model based on the dark channel prior attention guiding mechanism; and S4, calculating and outputting the position and category information of the target in the image by using the tested foggy day target detection model based on the dark channel prior attention guiding mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] In recent years, with the widespread use of autonomous vehicles and drones, the importance of object detection, as their "eyes," has become increasingly prominent. Thanks to the rapid development of deep learning, deep learning-based object detection methods have made significant progress. In practical applications, adverse weather conditions such as fog are a significant reality. However, existing methods are often designed for good weather conditions and struggle to adapt to adverse weather conditions like fog. This is primarily due to the absorption and scattering of the specific spectrum between the object being photographed and the camera in foggy conditions by tiny suspended particles (such as water droplets, ice crystals, dust, and other particles), significantly reducing image visibility and degrading image quality. Existing neural networks struggle to extract highly discriminative features from these degraded images for object detection, severely limiting object detection accuracy. Therefore, the key to improving object 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 foggy object detection based on dark channel prior-guided attention mechanism is to first combine the prior knowledge of foggy scenes, and then guide the attention mechanism to fully explore the key information that is discriminative and robust and conducive to detection, thereby improving the performance of object detection under foggy conditions.

[0004] Limitations of Related Methods: Fog degrades image quality, leading to reduced object detection performance. Several methods currently exist for object detection in foggy conditions. There are three main approaches for object detection in foggy conditions. The first and most direct approach is to remove specific weather information through image preprocessing to obtain a clear image before performing object detection. Li and Yang were the first to propose a method that uses loss supervision to restore a clear image and perform object detection. The second approach, based on multi-task learning, simultaneously learns multiple tasks, one of which may benefit the others. Huang designed a dual-subnet framework that generates clean features by designing an image restoration subnet that shares feature extraction layers with the detection subnet. This framework then jointly learns three tasks: visibility enhancement, object classification, and localization. Cui predicts image degradation parameters and simultaneously detects objects to extract features with better representation. The third approach is to apply a joint enhancement and detection method. First, the foggy input 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 uses the YOLOv3 model for detection in an end-to-end manner. The above methods usually perform image dehazing and object detection in sequence. However, these methods have two major drawbacks. First, although dehazed images may enhance the perceived quality of the human eye, they do not necessarily improve the perception of the machine. In addition, image dehazing introduces considerable computational complexity. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a foggy target detection method based on a dark channel prior-guided attention mechanism, aiming to improve the detection accuracy of foggy scenes. This method can be used in various scenarios such as unmanned vehicles and drones, effectively making up for the defect of low detection accuracy of unmanned vehicles and drones in foggy environments, thereby expanding the application scenarios of unmanned vehicles and drones.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A method for foggy target detection based on a dark channel prior-guided attention mechanism includes the following steps:

[0008] S1: Collect foggy images containing various categories of objects, preprocess the images, annotate all objects of interest in each image, and divide the images into training sets, validation sets, and test sets;

[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: Generate a corresponding dark channel prior for the input image according to the definition of the dark channel;

[0011] S22: downsampling the image to obtain a priori image that matches the feature size extracted by the backbone neural network;

[0012] S23: Calculating the guided attention weight using the prior map to mine the fog concentration information and target depth information contained in the dark channel prior;

[0013] S24: Fusion of attention weights with 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 of corresponding scales based on the enhanced features;

[0015] S3: using the training set to train the foggy object detection model based on the dark channel prior guided attention mechanism, using the validation set to verify the trained foggy object detection model based on the dark channel prior guided attention mechanism, to find the best performing training model, and using the test set to test the best training model;

[0016] S4: Use the foggy target detection model based on the dark channel prior-guided attention mechanism completed in the test to calculate and output the location and category information of the target in the image.

[0017] Furthermore, the preprocessing in step S1 includes: adjusting the resolution of the image, converting it into a unified format, and expanding the data set through data enhancement, wherein the data enhancement includes random or horizontal flipping, random cropping, and image scaling.

[0018] Furthermore, the multi-scale features extracted by the backbone neural network are equivalent to 1 / 4, 1 / 8,

[0019] 1 / 16 and 1 / 32, respectively, are represented as {X0, X1, X2, X3}.

[0020] Furthermore, the dark channel prior guided attention model includes a dark channel prior calculation 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 of the foggy image. According to 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 of field information, which can be used to help eliminate fog interference.

[0024] Calculate the dark channel prior (DCP) based on the input foggy image: First, obtain the channel with the minimum pixel value among the three RGB channels of the foggy image. After obtaining a single channel, select the minimum value in the local area. The dark channel definition is expressed by the following formula:

[0025]

[0026] Where J is an arbitrary image, J c is the color channel c∈{r,g,b} of J, and Ω(x) represents the local block area centered at x. dark (x) is expressed as the minimum value between all pixels in the RGB channels and Ω(x);

[0027] The dark channel prior guides the attention module 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 size of the corresponding feature map; according to 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, and the dark channel prior (DCP) features after downsampling are recorded as Then, using the guided attention mechanism, the dark channel prior features With the corresponding backbone network feature X, the attention module is guided by the dark channel prior, and the dark channel prior The prior features are enriched through three convolutional layers in sequence to further explore the potential features of DCP. The prior features output after the three convolutional layers are recorded as Y. The prior features Y are then used as the guiding attention weight and multiplied with the backbone features X to guide the detector to focus on favorable information that is friendly to 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 passes through a 1×1 convolutional layer to increase the number of channels from 1 to 1 / 4 of the number of channels of the corresponding backbone features. Then, it passes through a 3×3 convolutional layer to keep the number of channels unchanged. Finally, it passes through a 1×1 convolutional layer to increase the number of channels by 4 times, which is the same as the number of channels of the corresponding backbone features. It can be expressed as:

[0030]

[0031] in represents the input DCP feature, i represents the multi-scale feature level extracted by the backbone network, and f 1×1 represents a convolution operation with a convolution kernel size of 1, f 3×3 Indicates that the convolution kernel size is 3, Y i Represents the DCP prior features output after three convolutional layers;

[0032] The attention mechanism is introduced, and the DCP feature is multiplied bit by bit with the feature extracted by the backbone as the position-aware attention weight. The attention weight is obtained by convolution operation on the DCP feature Y i Perform sigmoid operation to obtain; then the backbone feature X i Through a 3×3 convolution operation, and then multiplying with the weight; using residual connection to avoid the offset caused by the fusion of different domains; the calculation process is expressed as follows:

[0033]

[0034] Among them, σ represents the sigmoid activation function, Represents the final output after the dark channel prior guides the attention module.

[0035] Furthermore, the multi-level features after the attention module are guided by the dark channel prior The input is input 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 perform target classification and bounding box regression.

[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 is the focal loss used by the detection head network for classification training; L loc SmoothL1 loss used by the detection head network for bounding box regression.

[0039] The beneficial effects of this invention lie in: by employing a guided attention mechanism based on a dark channel prior, the invention fully exploits the fog concentration and target depth information contained in the dark channel prior, enhancing the model's robustness to variable fog concentrations. Furthermore, the invention fully utilizes depth information to infer the presence and location of targets, thereby improving the backbone neural network's ability to extract image features and, in turn, enhancing the accuracy of target detection in foggy environments. This mechanism enhances the model's robustness in foggy environments, further promoting the application of the method in various fields, such as intelligent monitoring and autonomous driving, and enhancing its environmental adaptability in different mission scenarios.

[0040] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings, in which:

[0042] Figure 1 Flowchart for training and testing foggy object detection model based on dark channel prior guided attention mechanism;

[0043] Figure 2 This is the overall structure diagram of the foggy target detection model based on the dark channel prior-guided attention mechanism. DETAILED DESCRIPTION

[0044] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways 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 illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0045] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.

[0046] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present 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 the embodiments of the present invention.

[0047] like Figure 1 As shown, the present 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 in foggy scenes. They can be from real foggy scenes for training or testing, or they can be synthesized from clear images using foggy simulation libraries such as imgaug for training. At the same time, the images should contain objects whose categories need to be identified. For example, if a car needs to be detected, the prepared images need to contain car entities. In addition, the foggy target detection method based on the dark channel prior-guided attention mechanism of the present invention is a supervised learning method, so the prepared images also need to be labeled. The targets in the image need to be labeled, including bounding boxes and category information. This can be done manually using labeling tools, or using existing labeling 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 require some preprocessing, such as format conversion and size adjustment, to adapt to a specific target detection model.

[0053] (3) Data enhancement.

[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 detection accuracy of the model. Data augmentation methods can include random or horizontal flipping, random cropping, and image scaling.

[0055] The second step is to train a foggy object detection method based on the dark channel prior-guided attention mechanism.

[0056] (1) Constructing a backbone neural network

[0057] The backbone neural network is used to preliminarily extract the features of 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] The dark channel can provide information about fog concentration and target depth, and its introduction can assist the detector in extracting more discriminative features. Based on this, the present invention constructs a dark channel prior-guided attention model. This model consists of two core components: the dark channel prior calculation module (PC) and the dark channel prior-guided attention module (PGA), which are described in detail below.

[0060] Dark channel prior calculation module (PC): Figure 2 As shown on the right, based on the characteristics of outdoor fog-free images, it is found that in most local areas, except for the sky, there are some pixels (called dark pixels) with very low light intensity in at least one color (RGB) channel. The intensity of these dark pixels in foggy images is mainly contributed by atmospheric light, which provides information about the depth of the haze. The dark channel prior is 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 both fog concentration and depth information, which can be used to assist the detector in eliminating fog interference.

[0063] According to the definition of dark channel prior DCP, the DCP is calculated based on the input foggy image. First, the channel with the minimum pixel value among the three RGB channels of the foggy image is obtained. After obtaining a single channel, the minimum value in the local area is selected. The definition of dark channel can be expressed as follows:

[0064]

[0065] Where J is an arbitrary image, J c is the color channel c∈{r,g,b} of J, and Ω(x) represents the local block area centered at x. dark (x) is expressed as the minimum value among all pixels in the RGB channels and Ω(x).

[0066] Dark channel prior guided attention module (PGA): The PGA module is designed to enhance the features extracted by the backbone network to achieve better detection performance. A bilinear interpolation downsampling method is used on the original dark channel prior to obtain a resolution consistent with the size of the corresponding feature map. According to 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 DCP features after downsampling are recorded as Then, using the guided attention mechanism, the dark channel prior features With the corresponding backbone network feature X, through the proposed guided attention module PGA, the dark channel prior Three convolutional layers are sequentially used to enrich the prior features to further explore the potential features of the DCP. The prior features output after the three convolutional layers are denoted as Y. The prior features Y are then used as the attention weights to guide attention and multiplied by the backbone features X, guiding the detector to focus on information that is beneficial to detection. The specific operations of the three convolutional layers are as follows.

[0067] First, the dark channel prior passes through a 1×1 convolutional layer, increasing the number of channels from 1 to 1 / 4 the number of channels in the corresponding backbone feature. Then, it passes through a 3×3 convolutional layer, keeping the number of channels unchanged. Finally, a 1×1 convolutional layer increases the number of channels by a factor of 4, bringing it to the same number of channels in the corresponding backbone feature. A rich dark channel prior representation is obtained with just three convolutional layers. Furthermore, all convolution operations remain resolution-invariant and consistent with the input. This process can be expressed as follows:

[0068]

[0069] in represents the input dark channel prior feature DCP, i represents the multi-scale feature level extracted by the backbone network, and f 1 ×1 represents a convolution operation with a convolution kernel size of 1, f 3×3 Indicates that the convolution kernel size is 3, Y i Represents the DCP prior features output after three convolutional layers.

[0070] The DCP feature contains rich fog thickness information, which can effectively help the detector focus on learning detection-friendly information. For each position in the image, it contains different fog information. In order to provide corresponding fog information for each position, the attention mechanism is introduced. The DCP feature is used as the position-aware attention weight and multiplied by the backbone extracted feature bit by bit. The attention weight can be calculated by the DCP feature Y after the convolution operation. i Perform sigmoid operation to obtain the backbone feature X. iThrough a 3×3 convolution operation, and then multiplying by the weight. In addition, to avoid the offset caused by the fusion of different domains, residual connection is used to alleviate this problem. The calculation process can be expressed as follows:

[0071]

[0072] Among them, σ represents the sigmoid activation function, Represents the final output after the prior guided attention module (PGA).

[0073] (3) Constructing feature pyramid network and target detection head network

[0074] Next, we build a feature pyramid network to further enhance the robustness and discriminability of the features. The multi-level features after the prior guided attention module (PGA) are The input is fed into the feature pyramid network to obtain enhanced multi-level features. Finally, the detection head network uses the features obtained by the feature pyramid network to perform target classification and bounding box regression.

[0075] During the training phase, the detection head network uses focal loss for classification training, denoted as L cls ; For bounding box regression, the detection network uses SmoothL1 loss, denoted as L loc The total training loss L total It can be expressed as follows:

[0076] L total =L cls +L loc

[0077] The third step is to test the performance of the attention network model guided by dark channel prior.

[0078] (1) During testing, the present invention was tested on the RTTS dataset using an RTX4090D GPU.

[0079] (2) In order to verify the effectiveness of the proposed model, it is compared with some previous advanced foggy object detection methods, 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 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 (Average Precision) and inference speed FPS (Frame Per Second) of these models were tested under the same configuration. AP (Average Precision) represents the average precision, which is used to measure the accuracy of the target detection model. It takes into account the accuracy under different confidence thresholds and calculates an average value. There are also some other evaluation indicators: AP 50 Indicates the average precision when IoU (intersection over union) is greater than 50%; AP 75 Indicates the average precision when IoU is greater than 75%; AP s 、APm and AP l Represents the average accuracy of small targets, medium targets and large targets respectively. FPS represents the number of images that can be processed in 1 second. The larger the value, the faster the inference speed. The test results are shown in Table 1. Table 1 is an experiment conducted on the public 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, verifying that the present invention has excellent detection accuracy and fast inference ability, effectively meeting the current performance and efficiency requirements for foggy target detection, and proving the superiority of the method of the present invention.

[0080] Table 1

[0081]

[0082] In the above embodiments, references to "this embodiment" in the specification indicate that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least some embodiments, but not necessarily all embodiments. Multiple occurrences of "this embodiment" do not necessarily refer to the same embodiment.

[0083] In the above embodiments, although the invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory structures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed. The embodiments of the present invention are intended to encompass all such alternatives, modifications, and variations that fall within the broad scope of the appended claims.

[0084] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any one of the methods in this embodiment is implemented.

[0085] This embodiment also provides an electronic terminal, including: a processor and a memory;

[0086] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes any one of the methods in this embodiment.

[0087] Regarding the computer-readable storage medium in this embodiment, those skilled in the art will appreciate that all or part of the steps in the aforementioned method embodiments can be implemented using hardware associated with the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps in the aforementioned method embodiments. 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 with each other. The memory is used to store computer programs, the communication interface is used for communication, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes the various steps of the above method.

[0089] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0090] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0091] The present invention can be used in a wide variety of general-purpose or special-purpose computing system environments or configurations, such as 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 that include any of the above.

[0092] The present invention may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in both 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 limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for foggy target detection based on dark channel prior-guided attention mechanism, characterized by: The following steps are involved: S1: Collect foggy images containing various categories of objects, preprocess the images, annotate all objects of interest in each image, and 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: Generate a corresponding dark channel prior for the input image according to the definition of the dark channel; S22: down-sampling the image to obtain a priori image that matches the feature size extracted by the backbone neural network; S23: using the prior map to calculate the weight of guiding attention, and mining the fog concentration information and target depth information contained in the dark channel prior; S24: Fusion of attention weights with multi-scale features generated by the backbone neural network to obtain enhanced features; The feature pyramid network and the target detection head network regress and classify targets of corresponding scales based on the enhanced features; S3: using the training set to train the foggy weather target detection model based on the dark channel prior guided attention mechanism, using the validation set to validate the trained foggy weather target detection model based on the dark channel prior guided attention mechanism, to find the best performing training model, and using the test set to test the best training model; S4: Use the foggy object detection model based on the dark channel prior guided attention mechanism completed in the test to calculate and output the location and category information of the object in the image.

2. The method for foggy target detection based on dark channel prior-guided attention mechanism according to claim 1 is characterized in that: The preprocessing in step S1 includes: adjusting the resolution of the image, converting it into a unified format, and expanding the data set through data enhancement, wherein the data enhancement includes random or horizontal flipping, random cropping, and image scaling.

3. The method for foggy target detection based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: The sizes of the multi-scale features extracted by the backbone neural network 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}.

4. The method for foggy target detection based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: 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 a dark channel prior of a foggy image; Calculate the dark channel prior DCP based on the input foggy image: first obtain the channel with the minimum pixel value in the RGB three channels of the foggy image, and then select the minimum value in the local area after obtaining the single channel. The dark channel definition is expressed by the following formula: where J is an arbitrary image, J c is the color channel c∈{r,g,b} of J, Ω(x) represents the local block area centered at x; J dark (x) is expressed as the minimum value between all pixels in the RGB channels and Ω(x); The dark channel prior guides the attention module 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 size of the corresponding feature map; according to the resolution size 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, and the dark channel prior DCP feature after downsampling is recorded as Then, the dark channel prior features are used to guide the attention mechanism. With the corresponding backbone network feature X, the attention module is guided by the dark channel prior, and the dark channel prior The prior features are enriched through three convolutional layers in turn to further explore the potential features of DCP. The prior features output after the three convolutional layers are recorded as Y. The prior feature Y is then used as the guiding attention weight and multiplied with the backbone feature X to guide the detector to focus on favorable information that is friendly to detection.

5. The method for foggy target detection based on dark channel prior-guided attention mechanism according to claim 4, 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 passes through a 1×1 convolution layer to increase the number of channels from 1 to 1 / 4 of the number of channels of the corresponding backbone features, and then passes through a 3×3 convolution layer to keep the number of channels unchanged; finally, it passes through a 1×1 convolution layer to increase the number of channels by 4 times, which is the same as the number of channels of the corresponding backbone features, expressed as: in represents the input DCP feature, i represents the multi-scale feature level extracted by the backbone network, and f 1×1 represents a convolution operation with a convolution kernel size of 1, f 3×3 Indicates that the convolution kernel size is 3, Y i Represents the DCP prior features output after three convolutional layers; The attention mechanism is introduced to multiply the DCP feature as the position-aware attention weight with the feature extracted by the backbone bitwise. The attention weight is calculated by the DCP feature Y after the convolution operation. i Perform sigmoid operation to obtain; then convert the backbone feature X i Through a 3×3 convolution operation, and then multiply by the weight; use residual connection to avoid the offset caused by the fusion of different domains; the calculation process is expressed as follows: Among them, σ represents the sigmoid activation function, Represents the final output after the dark channel prior guides the attention module.

6. The method for foggy target detection based on dark channel prior-guided attention mechanism according to claim 5, characterized in that: The multi-level features after the attention module will be guided by the dark channel prior The input is 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.

7. The method for foggy target detection based on dark channel prior-guided attention mechanism according to claim 1, characterized in that: In the training phase of step S3, the total training loss L total It is expressed as follows: L total =L cls +L loc L cls is the focal loss used by the detection head network for classification training; L loc SmoothL1 loss used by the detection head network for bounding box regression.

Citation Information

Patent Citations

  • Neural network image defogging method based on multi-level feature fusion and attention guidance

    CN111915531A

  • Non-uniform fog image defogging algorithm based on transmission attention mechanism

    CN113284070A

  • End-to-end image defogging method based on multi-feature fusion

    CN114742719A

  • Foggy day traffic sign detection and identification method based on YOLOV5

    CN115497074A

  • Underwater image enhancement method of multi-attention mechanism guided by brightness mask

    CN116402715A