An image detection method and device in a fog scene
By extracting and fusing features from foggy images using a multi-path defogging model, the problem of poor target detection performance in foggy scenes is solved, achieving efficient feature information fusion and improved target object clarity.
Patent Information
- Application Number
- CN202510204639.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-02-24
AI Technical Summary
Existing target detection methods struggle to effectively bridge the domain gap between normal weather and foggy conditions, resulting in poor detection performance.
A multi-path dehazing model is adopted. The first propagation path extracts the common and difference features of different categories of objects to be detected. The second propagation path extracts the contour and pose features of the objects. The third propagation path extracts the relative position features. Global fusion features are generated through feature fusion. Combined with residual downsampling layer and information entropy channel filtering, the feature extraction and fusion capabilities are enhanced.
It improves the model's adaptability to complex foggy scenes, enhances the visibility and recognizability of target objects, and significantly improves image clarity and detail reproduction.
Smart Images

Figure CN120125949B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image dehazing, and more particularly to an image detection method and apparatus for foggy scenes. Background Technology
[0002] With the widespread application of computer vision technology in various fields, the requirements for the accuracy and robustness of object detection are increasing. However, existing object detection methods struggle to meet performance demands in different scenarios, especially foggy conditions. This not only limits the application of object detection technology in adverse weather conditions but also hinders the development of related fields such as intelligent transportation and security monitoring.
[0003] In foggy scenes, the scattering and absorption of light by fog significantly reduces image sharpness, contrast, and color fidelity. This blurs the outlines of objects and causes a loss of detail, greatly hindering object detection. Traditional object detection algorithms, typically trained on clear images, perform poorly in foggy conditions. Although some research has attempted to address the domain disparity problem, effectively narrowing the significant domain gap between normal weather and foggy scenes to achieve accurate object detection remains a critical challenge.
[0004] Therefore, there is an urgent need for an image detection method and device for foggy scenes. Summary of the Invention
[0005] This application provides an image detection method and apparatus for foggy scenes, which solves the problem of how to effectively reduce the huge domain difference between normal weather and foggy scenes and achieve accurate target detection.
[0006] A first aspect of this application provides an image detection method for foggy scenes. The method includes: acquiring a target image to be detected, the target image including at least one object to be detected; inputting the target image to be detected into a multi-path dehazing model, the multi-path dehazing model including a first propagation path, a second propagation path, and a third propagation path; acquiring a first feature in the target image to be detected through the first propagation path, the first feature being common / discrete features of different categories of objects to be detected at different scales; acquiring a second feature in the target image to be detected through the second propagation path, the second feature including contour features and pose features of different categories of objects to be detected; acquiring a third feature in the target image to be detected through the third propagation path, the third feature including relative position features and spatial position features of different categories of objects to be detected; performing feature fusion on the first feature, the second feature, and the third feature, and outputting a global fusion feature corresponding to the object to be detected through the multi-path dehazing model; and outputting a dehazed target image to be detected based on the global fusion feature through the multi-path dehazing model.
[0007] Optionally, the multi-path dehazing model includes a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, and a first residual downsampling layer. It acquires a first feature from the target image to be detected through a first propagation path, specifically including: inputting the target image to be detected into the first feature extraction layer and outputting a first intermediate feature image through the first feature extraction layer; inputting the target image to be detected into the second feature extraction layer and outputting a second intermediate feature image through the second feature extraction layer; inputting the first intermediate feature image into the first residual downsampling layer and outputting a third intermediate feature image through the first residual downsampling layer; and simultaneously inputting the second and third intermediate feature images into the third feature extraction layer and outputting the first feature from the target image to be detected through the third feature extraction layer.
[0008] Optionally, the multi-path dehazing model further includes a fourth feature extraction layer and a second residual downsampling layer, which obtains the second feature in the target image to be detected through the second propagation path. Specifically, it includes: inputting the second intermediate feature image into the second residual downsampling layer and outputting the fourth intermediate feature image through the second residual downsampling layer; inputting the first feature and the fourth intermediate feature image into the fourth feature extraction layer at the same time and outputting the second feature through the fourth feature extraction layer.
[0009] Optionally, the multi-path dehazing model further includes a fifth feature extraction layer, which obtains the third feature in the target image to be detected through the third propagation path. Specifically, this includes: connecting the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer, and the fifth feature extraction layer in a preset order; and passing the target image to be detected through the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer, and the fifth feature extraction layer in a preset order to obtain the third feature in the target image to be detected.
[0010] Optionally, the multi-path dehazing model also includes a batch normalization layer. The method further includes: normalizing each feature dimension in each intermediate feature image using the batch normalization layer, with the normalization expression as follows:
[0011]
[0012] Among them, I conv (h,w,c1) represents the intermediate feature image obtained through a predefined 2D convolution, i.e., the normalized input image. h is the height index of the intermediate feature image, w is the width index, c1 is the channel index, and K... h K is the height of the preset 2D convolution. w The width of the preset 2D convolution is I. in(h+i,w+j,k) represents the pixel value corresponding to the coordinates (h+i,w+j) and channel k in the intermediate feature image, where i is the local spatial x-coordinate of the convolution kernel in the preset two-dimensional convolution, and j is the local spatial y-coordinate of the convolution kernel in the preset two-dimensional convolution. This represents the basic element feature map after normalization. This represents the mean of the image data corresponding to the intermediate feature image along the c1 dimension. I represents the variance of the image data corresponding to the intermediate feature image in the c1 dimension, ∈ is a protection parameter used to avoid a denominator of 0. bn This is the intermediate feature image after normalization, i.e., the normalized output image. This is the scaling factor for the image data corresponding to the intermediate feature image in the c1 dimension. The offset of the image data corresponding to the intermediate feature image in the channel c1 dimension.
[0013] Optionally, the first intermediate feature image is input into the first residual downsampling layer, and the third intermediate feature image is output through the first residual downsampling layer. Specifically, this includes: performing a downsampling operation on the first intermediate feature image through a preset convolutional layer, whereby the sampling operation reduces the first intermediate feature image to a preset ratio; normalizing the first intermediate feature image after the downsampling operation through a batch normalization layer; adjusting the channels of the normalized first intermediate feature image through the first residual branch of the first residual downsampling layer and based on the channel filtering mechanism of information entropy; directly adjusting the channels of the first intermediate feature image through the second residual branch of the first residual downsampling layer and based on the channel filtering mechanism of information entropy, so that the number of channels in the first intermediate feature image is consistent with the number of channels in the normalized first intermediate feature image; fusing the first intermediate feature image after channel adjustment by the first residual branch and the second residual branch of the first residual downsampling layer, respectively, and outputting the feature-fused third intermediate feature image.
[0014] Optionally, the second intermediate feature image is input into the second residual downsampling layer, and the fourth intermediate feature image is output through the second residual downsampling layer. Specifically, this includes: performing a pooling operation on the second intermediate feature image through a preset average pooling layer, whereby the pooling operation reduces the resolution of the second intermediate feature image; normalizing the pooled second intermediate feature image through a batch normalization layer; adjusting the channels of the normalized second intermediate feature image through the first residual branch of the second residual downsampling layer and a channel filtering mechanism based on information entropy; directly adjusting the channels of the second intermediate feature image through the second residual branch of the second residual downsampling layer and a channel filtering mechanism based on information entropy, so that the number of channels in the second intermediate feature image is consistent with the number of channels in the normalized second intermediate feature image; fusing the second intermediate feature images after channel adjustment by the first residual branch of the second residual downsampling layer and the second residual branch of the second residual downsampling layer, respectively, and outputting the fourth intermediate feature image after feature fusion.
[0015] Optionally, the channel filtering mechanism based on information entropy adjusts the intermediate feature map by: obtaining the information entropy value of the target channel output in the intermediate feature map, where the target channel is any channel in the intermediate feature map; determining whether the information entropy value is less than a preset information entropy value; and deleting the target channel to adjust the channel if the information entropy value is less than or equal to the preset information entropy value.
[0016] A second aspect of this application provides an image detection device for foggy scenes. The device includes an acquisition module and a processing module, wherein...
[0017] The acquisition module is used to acquire the image of the target to be detected, which includes at least one object to be detected.
[0018] A cross-scale extraction network module is used to input the target image to be detected into a multi-path dehazing model. The multi-path dehazing model includes a first propagation path, a second propagation path, and a third propagation path. The first propagation path is used to obtain the first feature in the target image to be detected, which is the common / discrepancy feature of different categories of target objects at different scales. The second propagation path is used to obtain the second feature in the target image to be detected, which includes the contour features and pose features of different categories of target objects. The third propagation path is used to obtain the third feature in the target image to be detected, which includes the relative position features and spatial position features of different categories of target objects.
[0019] The processing module is used to perform feature fusion on the first feature, the second feature, and the third feature, and output the global fusion feature corresponding to the object to be detected through the multi-path dehazing model; based on the global fusion feature, the dehazed target image to be detected is output through the multi-path dehazing model.
[0020] A third aspect of this application provides an electronic device including a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform the method as described above.
[0021] A fourth aspect of this application provides a computer-readable storage medium storing a computer program, which is executed by a processor using the method described in any of the foregoing descriptions.
[0022] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0023] 1. Acquire the target image to be detected and input it into the multi-path dehazing model. The model obtains the first feature of the target image through the first propagation path, the second feature through the second propagation path, and the third feature through the third propagation path. Feature fusion is performed on the first, second, and third features, and the global fusion feature corresponding to the target object is output through the multi-path dehazing model. Based on the global fusion feature, the dehazed target image is output through the multi-path dehazing model. Through multiple branching computational structures, the model can fully extract local detail features, global semantic features, and edge contour features from the target image in low-contrast, low-illuminance, and low-color environments, achieving efficient fusion of multiple feature information. This improves the model's adaptability to complex foggy scenes, enhances the clarity and detail restoration of the target image, and significantly improves the visibility and recognizability of the target object.
[0024] 2. By setting two different downsampling layers with residual structures, namely the first residual downsampling layer and the second residual downsampling layer, the deep semantic features of the input image are effectively extracted and fused through the first residual downsampling layer, and fine-grained feature information is further extracted through the second residual downsampling layer, while maintaining the structural consistency between features. This achieves efficient fusion of multi-scale features, enhances the model's ability to capture details and understand semantics of target objects in complex foggy scenes, and ultimately improves the accuracy and effect of the image dehazing process.
[0025] 3. By obtaining the information entropy value of the target channel output in the intermediate feature map, it is determined whether the information entropy value is less than the preset information entropy value. When the information entropy value is less than or equal to the preset information entropy value, the target channel is deleted to adjust the channel. This enables the multi-path dehazing model to automatically remove redundant or invalid feature channels, reduce the amount of computation, and thus improve the computational efficiency and inference speed of the multi-path dehazing model. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating an image detection method for foggy scenes provided in an embodiment of this application;
[0027] Figure 2 This is a schematic diagram of a first residual downsampling layer processing flow provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of a second residual downsampling layer processing flow provided in an embodiment of this application;
[0029] Figure 4 This is a schematic diagram of the output of a multi-path dehazing model provided in an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of a module of an image detection device in a foggy scene provided in an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0032] Explanation of reference numerals in the attached figures: 51, acquisition module; 52, cross-scale network extraction module; 53, processing module; 601, processor; 602, communication bus; 603, user interface; 604, network interface; 605, memory. Detailed Implementation
[0033] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0034] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0035] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0036] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0037] Please refer to Figure 1 The flowchart illustrates an image detection method for foggy scenes provided in an embodiment of this application. The flowchart mainly includes the following steps: S101 to S107.
[0038] Step S101: Obtain the image of the target to be detected, wherein the image of the target to be detected includes at least one object to be detected.
[0039] Specifically, the target image to be detected is acquired. The target image to be detected is an image taken under specific foggy conditions, which are low-contrast, low-illuminance, and low-color-saturation environments. The target image to be detected includes at least one object to be detected, including but not limited to vehicles, pedestrians, road signs, buildings, or other objects with specific target features.
[0040] Step S102: Input the target image to be detected into the multi-path dehazing model. The multi-path dehazing model includes a first propagation path, a second propagation path, and a third propagation path.
[0041] Specifically, the target image to be detected is input into a multi-path dehazing module. This module includes a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, a fourth feature extraction layer, a fifth feature extraction layer, a first residual downsampling layer, and a second residual downsampling layer. Through the combination of these different feature extraction layers and residual downsampling layers, three different propagation paths are formed: the first propagation path, the second propagation path, and the third propagation path. The target image to be detected passes through these three different propagation paths to perform different feature extractions. Each feature extraction layer has a similar structure. When the target image is input into the feature extraction layer, it first undergoes a convolutional layer operation. This convolutional layer is 3x3 in size, with a kernel size of 1 and a stride of 1. After passing through this convolutional layer, the image size (height and width) is reduced by half, reducing the amount of data for subsequent processing, and simultaneously extracting preliminary local features of the image. The batch normalization layer normalizes each feature dimension in each batch of data, making the data distribution more stable and accelerating network convergence. Then, a sinusoidal linear unit is used as the activation function. Assuming the introduction of nonlinearity increases the model's expressive power, improves training efficiency, and enhances its generalization ability, the batch normalization layer normalizes each feature dimension in each intermediate feature image. The normalization expression is as follows:
[0042]
[0043] Among them, I conv (h,w,c1) represents the intermediate feature image obtained through a predefined 2D convolution, i.e., the normalized input image, where h is the height index, w is the width index, and c1 is the channel index, and h∈{0,1,…,H}. in -1}、w∈{0,1,…,W in -1}、c1∈{0,1,…,C out1 -1},H in W represents the height in the intermediate feature image. in C represents the width of the intermediate feature image. out1 K represents the number of channels in the intermediate feature image. h To set the height of the 2D convolution, K w The width of the preset 2D convolution is I. in (h+i,w+j,k) represents the pixel value corresponding to the coordinates (h+i,w+j) and channel k in the intermediate feature image, where i is the local spatial x-coordinate of the convolution kernel in the preset two-dimensional convolution, and j is the local spatial y-coordinate of the convolution kernel in the preset two-dimensional convolution. This represents the basic element feature map after normalization. This represents the mean of the image data corresponding to the intermediate feature image along the c1 dimension. I represents the variance of the image data corresponding to the intermediate feature image in the c1 dimension, ∈ is a protection parameter used to avoid a denominator of 0. BN This is the intermediate feature image after normalization, i.e., the normalized output image. This is the scaling factor for the image data corresponding to the intermediate feature image in the c1 dimension. The offset of the image data corresponding to the intermediate feature image in the c1 dimension of the channel. For using a sinusoidal linear unit as the activation function, this can be expressed by the following formula:
[0044]
[0045] Among them, I act (h,w,c1) represents the intermediate feature image after activation, and σ(x) is the SiLU formula for positive linear units.
[0046] Step S103: Obtain the first feature in the target image to be detected through the first propagation path. The first feature is the common feature / difference feature of different categories of objects to be detected at different scales.
[0047] Specifically, the first feature in the target image to be detected is obtained through the first propagation path. This first feature represents the common / discrepancy features of different categories of objects at different scales. In other words, the first propagation path can fuse features from different scales and levels. This fusion method can uncover potential relationships between different features and better identify the common and discrepancy features of different categories of objects at different scales, thereby improving classification accuracy. Simultaneously, the sequential connection method in the third propagation path ensures the continuity and progression of feature extraction, allowing the network to gradually transition from shallow features to deeper, more abstract features, optimizing the overall feature extraction process. Through its internal convolutional layers, batch normalization, activation functions, and residual branch operations, the feature representation is continuously optimized to adapt to the feature extraction needs of different image content.
[0048] In one possible implementation, step S103 further includes: inputting the target image to be detected into a first feature extraction layer and outputting a first intermediate feature image through the first feature extraction layer; inputting the target image to be detected into a second feature extraction layer and outputting a second intermediate feature image through the second feature extraction layer; inputting the first intermediate feature image into a first residual downsampling layer and outputting a third intermediate feature image through the first residual downsampling layer; inputting the second intermediate feature image and the third intermediate feature image into a third feature extraction layer simultaneously and outputting a first feature in the target image to be detected through the third feature extraction layer.
[0049] Specifically, the target image to be detected is input into the first feature extraction layer, which extracts and outputs a first intermediate feature image. Simultaneously, the target image is input into the second feature extraction layer, which extracts and outputs a second intermediate feature image. Then, the first intermediate feature image is input into the first residual downsampling layer, where features are further extracted through multi-layer convolution and residual connection mechanisms, and a third intermediate feature image is output. Finally, the second and third intermediate feature images are simultaneously input into the third feature extraction layer. By integrating the feature information extracted from multiple paths, the first feature in the target image is output, laying the foundation for subsequent target analysis and detection.
[0050] Step S104: Obtain the second feature in the target image to be detected through the second propagation path. The second feature includes the contour features and pose features of different categories of objects to be detected.
[0051] Specifically, the second feature in the target image to be detected is obtained through the second propagation path. The second feature includes the contour features and pose features of different categories of objects to be detected. That is, the second propagation path can perform deeper feature abstraction and fusion, thereby extracting the object's category features, such as distinguishing the contour features of the object cat and the pose features of the object.
[0052] In one possible implementation, step S104 further includes: inputting the second intermediate feature image into the second residual downsampling layer and outputting the fourth intermediate feature image through the second residual downsampling layer; inputting the first feature and the fourth intermediate feature image into the fourth feature extraction layer simultaneously and outputting the second feature through the fourth feature extraction layer.
[0053] Specifically, the second intermediate feature image obtained through the second feature extraction layer is input into the second residual downsampling layer. This layer is used to further reduce the image resolution and extract features to obtain the fourth intermediate feature image. Subsequently, the first feature obtained through the third feature extraction layer and the fourth intermediate feature image are input into the fourth feature extraction layer. This layer performs deep fusion and feature enhancement of the two at multiple scales, and finally outputs the second feature for further target detection or image analysis operations.
[0054] Step S105: Obtain the third feature in the target image to be detected through the third propagation path. The third feature includes the relative position feature and spatial position feature of different categories of objects to be detected.
[0055] Specifically, the third feature in the target image to be detected is obtained through the third propagation path. That is, in the third propagation path, the features of the target image to be detected are further mined. At this time, the focus is on the spatial relationship and semantic association features between objects, so as to obtain the relative position features and spatial position features between different objects to be detected.
[0056] In one possible implementation, step S105 further includes: connecting the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer, and the fifth feature extraction layer in a preset order; and passing the target image to be detected sequentially through the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer, and the fifth feature extraction layer in a preset order to obtain the third feature in the target image to be detected.
[0057] Specifically, following a preset order, the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer, and the fifth feature extraction layer are sequentially connected in series to form a complete feature extraction network. Then, the target image to be detected is taken as input and passed through each feature extraction layer in the network in sequence to extract and fuse multi-scale and multi-level image features layer by layer. Finally, the third feature in the target image to be detected is output in the fifth feature extraction layer, providing high-quality feature representation for subsequent target detection or classification tasks.
[0058] In one possible implementation, step S105 further includes: performing a downsampling operation on the first intermediate feature image through a preset convolutional layer, wherein the sampling operation is used to reduce the first intermediate feature image to a preset ratio; performing normalization processing on the first intermediate feature image after the downsampling operation through a batch normalization layer; adjusting the channels of the first intermediate feature image after normalization processing through the first residual branch of the first residual downsampling layer and based on the channel filtering mechanism of information entropy; directly adjusting the channels of the first intermediate feature image through the second residual branch of the first residual downsampling layer and based on the channel filtering mechanism of information entropy, so that the number of channels in the first intermediate feature image is consistent with the number of channels in the first intermediate feature image after normalization processing; fusing the first intermediate feature image after channel adjustment by the first residual branch of the first residual downsampling layer and the second residual branch of the first residual downsampling layer respectively, and outputting the third intermediate feature image after feature fusion.
[0059] Specifically, this application designs two different downsampling layers with residual structures to effectively preserve the contours and local details of foggy images. Please refer to [reference needed]. Figure 2The document presents a schematic diagram of a first residual downsampling layer processing flow provided in an embodiment of this application. The first intermediate feature image input is downsampled using a preset convolutional layer. This downsampling operation reduces the first intermediate feature image to a preset ratio. The preset convolutional layer is a 3×3 layer with a stride of 2. The preset ratio means that the height and width of the output image are both reduced to half of the original first intermediate feature image. This step reduces the amount of data and expands the receptive field, extracting more abstract and global features. Next, a batch normalization layer is introduced after this convolutional layer to normalize the downsampled first intermediate feature image, stabilizing the data distribution and accelerating network convergence. Then, LeakyReLU is used as the activation function with a parameter set to 0.2, introducing a nonlinear factor to enhance the expressive power of the multi-path dehazing model. Subsequently, the first intermediate feature image after the above processing undergoes residual branching operations, passing through the first residual branch and the second residual branch of the first residual downsampling layer, respectively. In the first residual branch, the first intermediate feature image is first passed through a Conv1×1 convolutional layer to adjust the channel dimension, halving the number of channels. Then, it passes through a 3×3 convolutional layer with a stride of 1 for feature extraction and fusion. Finally, it passes through another Conv1×1 convolutional layer to restore the number of channels to the original input. In the second residual branch, the original first intermediate feature image is directly passed through a 1×1 convolutional layer to adjust the channel dimension, matching the number of channels after processing in the first branch. Finally, the results of the two branches are fused using an Element-wise Addition operation to obtain the output image of the first residual downsampling layer, which is the third intermediate feature image. The expression for downsampling through the first residual downsampling layer is:
[0060]
[0061] Where Y1(h,w,c) is the third intermediate feature image, Conv 3×3,s=2 This indicates that the first intermediate feature image is downsampled using a 3x3 method with a step size of 2. This represents a 1x1 convolution operation that adjusts the number of channels in the first intermediate feature image from C to C / 2. This indicates that the number of channels in the first intermediate feature image is adjusted from C / 2 to a 1*1 matching dimension of C, where
[0062] In one possible implementation, step S105 further includes: performing a pooling operation on the second intermediate feature image through a preset average pooling layer, the pooling operation being used to reduce the resolution of the second intermediate feature image; normalizing the second intermediate feature image after pooling through a batch normalization layer; adjusting the channels of the normalized second intermediate feature image through the first residual branch of the second residual downsampling layer and based on the channel filtering mechanism of information entropy; directly adjusting the channels of the second intermediate feature image through the second residual branch of the second residual downsampling layer and based on the channel filtering mechanism of information entropy, so that the number of channels in the second intermediate feature image is consistent with the number of channels in the normalized second intermediate feature image; fusing the second intermediate feature images after channel adjustment by the first residual branch of the second residual downsampling layer and the second residual branch of the second residual downsampling layer respectively, and outputting the fourth intermediate feature image after feature fusion.
[0063] Specifically, this application designs two different downsampling layers with residual structures to effectively preserve the contours and local details of foggy images. The second residual downsampling layer differs structurally from the first residual downsampling layer. Please refer to [reference needed]. Figure 3 The document presents a schematic diagram of the second residual downsampling layer processing flow provided in an embodiment of this application. The second intermediate feature image first enters a 2×2 average pooling layer with a stride of 2, which quickly reduces the image resolution and performs preliminary feature fusion through pooling. Subsequently, a batch normalization layer is introduced to stabilize the data distribution. The activation function is ReLU to enhance the model's nonlinear expressive power. Regarding the residual branch operation, the first residual branch first uses a Conv1×1 convolutional layer to double the number of channels in the second intermediate feature image, then passes it through a 3×3 convolutional layer with a stride of 1 for complex feature extraction and transformation, and finally uses another Conv1×1 convolutional layer to restore the number of channels to the original input number. The second residual branch first performs a 1×1 convolution operation on the original second intermediate feature image to adjust the channel dimension, making it consistent with the final number of channels in the first branch. Finally, the results of the two branches are fused through a Concat concatenation operation to form the output of the second residual downsampling layer, i.e., the fourth intermediate feature image. The expression for downsampling through the second residual downsampling layer is:
[0064]
[0065] Where Y2(h,w,c) is the fourth intermediate feature image, Conv 3×3,s=1 This indicates that the second intermediate feature image is downsampled using a 3x3 matrix with a step size of 1. This represents a 1x1 convolution operation that adjusts the number of channels in the second intermediate feature image from C to 2C. ⊕ denotes invariant channel convolution, BN denotes batch normalization layer, AvgPool denotes average pooling operation, and ⊕ denotes feature fusion.
[0066] In the processing of the first and second residual downsampling layers described above: In the first branch operation of the residual, the first intermediate feature image is flattened by a Conv1*1 two-dimensional convolution operation, and then enters the n-layer bottleneck layer. The n-layer bottleneck layer is connected in series, which can effectively reduce the number of channels, thereby reducing the complexity of subsequent calculations.
[0067]
[0068] in, The first intermediate feature image after flattening is the output after passing through n bottleneck layers. `mid1` represents the first intermediate feature image after flattening. n () indicates that within each bottleneck layer, all operations except the first Conv1*1 convolution are repeated n times on the flattened first intermediate feature image. In the residual second branch operation, the output of the second branch is flattened by 2D convolution and directly connected to the output of the first branch. The two branches are then joined by a Concat concatenation operation, and finally, a Conv1*1 convolution is performed to output the feature map, which is the output of the feature extraction layer.
[0069]
[0070] Among them, I out (h,w,c final W represents the final output feature map of the feature extraction layer. final (i,j,k,c final ) represents the weight parameters for this convolution, C out2 c is the number of channels in the feature map of the bi-branch aggregation. final I represents the number of channels in the final output feature map. concat (h+i,w+j,k) represents the pixel value corresponding to the coordinates (h+i,w+j) and channel k in the feature map of the bi-branch aggregation.
[0071] In one possible implementation, step S105 further includes: obtaining the information entropy value of the target channel output in the intermediate feature map, wherein the target channel is any channel in the intermediate feature map; determining whether the information entropy value is less than a preset information entropy value; and deleting the target channel to perform channel adjustment if the information entropy value is less than or equal to the preset information entropy value.
[0072] Specifically, an information entropy-based channel selection mechanism is introduced. In each convolutional layer, the information entropy value of the output feature map of each channel is calculated. Channels are sorted according to their information entropy values. If the information entropy value is less than or equal to a preset information entropy value, the channel with the lower information entropy is deleted; if the information entropy value is greater than the preset information entropy value, the channel with the higher information entropy is retained. Let the original number of channels in the convolutional layer be n, and the number of channels retained after selection be n'. The width of the new convolutional layer then becomes n' / n times the original width. Simultaneously, to compensate for potential information loss due to channel deletion, a cross-layer feature fusion module is introduced between adjacent convolutional layers. This module fuses the feature information of the deleted channels from the previous layer into the retained channels in the next layer using a weighted summation. Let the feature map of the deleted channels in the previous layer be Fd, and the feature map of the retained channels in the next layer be Fr. The fused feature map F = αFr + βFd, where α and β are learnable weight parameters. This method reduces the model width while preserving as much important feature information as possible, improving the model's lightweight effect and detection accuracy. The learnable weight parameters α and β are updated using a gradient descent algorithm, where τ is the learning rate and Loss is the loss function.
[0073]
[0074] Please refer to Figure 4 It presents a schematic diagram of the output of a multi-path dehazing model provided in an embodiment of this application. Figure 4 The output flow of the first, second, and third propagation paths is shown in the figure.
[0075] Step S106: Perform feature fusion on the first feature, the second feature, and the third feature, and output the global fused feature corresponding to the object to be detected through the multi-path dehazing model.
[0076] Specifically, the first, second, and third features are aligned to ensure consistency in channel count and spatial resolution. Alignment operations can include convolution, upsampling, or downsampling. Then, the aligned features are fused according to preset rules, such as using feature weighted summation, concatenation, or attention mechanisms to fully integrate feature information from different paths. After fusion, the features not only retain the independent characteristics of different paths but also include global contextual information. Finally, the fused features are further processed into global fused features corresponding to the object to be detected through the output layer of the multi-path dehazing model, supporting the final object detection or recognition task. This process improves the accuracy and robustness of object detection and recognition in complex scenes.
[0077] Step S107: Based on the global fusion features, output the dehazed target image after detection through the multi-path dehazing model.
[0078] Specifically, a multi-path dehazing model is used to generate a dehazed image of the target to be detected based on the fused global fusion features, thereby enhancing image clarity and providing higher quality image input for the target detection task.
[0079] This application employs the aforementioned method to acquire an image of the target to be detected. This image is then input into a multi-path dehazing model. The model obtains a first feature through a first propagation path, a second feature through a second propagation path, and a third feature through a third propagation path. Feature fusion is performed on the first, second, and third features, and the model outputs the global fusion feature corresponding to the target object. Based on the global fusion feature, the model outputs the dehazed target image. Through multiple branching computational structures, this model effectively extracts local detail features, global semantic features, and edge contour features from the target image, particularly in low-contrast, low-illuminance, and low-color environments like foggy days. This efficient fusion of various feature information improves the model's adaptability to complex foggy scenes, enhances the clarity and detail restoration of the target image, and significantly improves the visibility and recognizability of the target object.
[0080] Please refer to Figure 5 This illustration shows a schematic diagram of an image detection device for foggy scenes according to an embodiment of this application. The device includes an acquisition module 51, a cross-scale extraction network module 52, and a processing module 53.
[0081] The acquisition module 51 is used to acquire the target image to be detected, which includes at least one object to be detected.
[0082] The cross-scale extraction network module 52 is used to input the target image to be detected into the multi-path dehazing model, which includes a first propagation path, a second propagation path, and a third propagation path. The first propagation path is used to obtain the first feature in the target image to be detected, which is the common / difference feature of different categories of target objects at different scales. The second propagation path is used to obtain the second feature in the target image to be detected, which includes the contour features and pose features of different categories of target objects. The third propagation path is used to obtain the third feature in the target image to be detected, which includes the relative position features and spatial position features of different categories of target objects.
[0083] The processing module 53 is used to perform feature fusion on the first feature, the second feature and the third feature, and output the global fusion feature corresponding to the object to be detected through the multi-path dehazing model; based on the global fusion feature, the dehazed target image to be detected is output through the multi-path dehazing model.
[0084] In one possible implementation, the multi-path dehazing model includes a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, and a first residual downsampling layer. The cross-scale extraction network module 22 is used to obtain a first feature in the target image to be detected through a first propagation path, specifically including: inputting the target image to be detected into the first feature extraction layer and outputting a first intermediate feature image through the first feature extraction layer; inputting the target image to be detected into the second feature extraction layer and outputting a second intermediate feature image through the second feature extraction layer; inputting the first intermediate feature image into the first residual downsampling layer and outputting a third intermediate feature image through the first residual downsampling layer; and simultaneously inputting the second intermediate feature image and the third intermediate feature image into the third feature extraction layer and outputting the first feature in the target image to be detected through the third feature extraction layer.
[0085] In one possible implementation, the multi-path dehazing model further includes a fourth feature extraction layer and a second residual downsampling layer. The cross-scale extraction network module 52 is used to obtain the second feature in the target image to be detected through the second propagation path, specifically including: inputting the second intermediate feature image into the second residual downsampling layer and outputting the fourth intermediate feature image through the second residual downsampling layer; inputting the first feature and the fourth intermediate feature image into the fourth feature extraction layer at the same time and outputting the second feature through the fourth feature extraction layer.
[0086] In one possible implementation, the multi-path dehazing model further includes a fifth feature extraction layer. The cross-scale extraction network module 52 is used to obtain the third feature in the target image to be detected through the third propagation path. Specifically, it includes: connecting the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer and the fifth feature extraction layer in a preset order; and passing the target image to be detected through the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer and the fifth feature extraction layer in a preset order to obtain the third feature in the target image to be detected.
[0087] In one possible implementation, the multi-path dehazing model further includes a batch normalization layer. The cross-scale extraction network module 52 is used to normalize each feature dimension in each intermediate feature image through the batch normalization layer. The normalization expression is as follows:
[0088]
[0089] Among them, Iconv (h,w,c1) represents the intermediate feature image obtained through a predefined 2D convolution, i.e., the normalized input image. h is the height index of the intermediate feature image, w is the width index, c1 is the channel index, and K... h K is the height of the preset 2D convolution. w The width of the preset 2D convolution is I. in (h+i,w+j,k) represents the pixel value corresponding to the coordinates (h+i,w+j) and channel k in the intermediate feature image, where i is the local spatial x-coordinate of the convolution kernel in the preset two-dimensional convolution, and j is the local spatial y-coordinate of the convolution kernel in the preset two-dimensional convolution. This represents the basic element feature map after normalization. This represents the mean of the image data corresponding to the intermediate feature image along the c1 dimension. I represents the variance of the image data corresponding to the intermediate feature image in the c1 dimension, ∈ is a protection parameter used to avoid a denominator of 0. bn This is the intermediate feature image after normalization, i.e., the normalized output image. This is the scaling factor for the image data corresponding to the intermediate feature image in the c1 dimension. The offset of the image data corresponding to the intermediate feature image in the channel c1 dimension.
[0090] In one possible implementation, the cross-scale extraction network module 52 is used to input a first intermediate feature image into a first residual downsampling layer and output a third intermediate feature image through the first residual downsampling layer. Specifically, this includes: performing a downsampling operation on the first intermediate feature image through a preset convolutional layer, whereby the sampling operation reduces the first intermediate feature image to a preset ratio; normalizing the first intermediate feature image after the downsampling operation through a batch normalization layer; adjusting the channels of the normalized first intermediate feature image through the first residual branch of the first residual downsampling layer and based on a channel filtering mechanism using information entropy; directly adjusting the channels of the first intermediate feature image through the second residual branch of the first residual downsampling layer and based on a channel filtering mechanism using information entropy, so that the number of channels in the first intermediate feature image is consistent with the number of channels in the normalized first intermediate feature image; fusing the first intermediate feature image after channel adjustment by the first residual branch and the second residual branch of the first residual downsampling layer, respectively, and outputting the feature-fused third intermediate feature image.
[0091] In one possible implementation, the cross-scale extraction network module 52 is used to input the second intermediate feature image into the second residual downsampling layer and output the fourth intermediate feature image through the second residual downsampling layer. Specifically, it includes: performing a pooling operation on the second intermediate feature image through a preset average pooling layer, the pooling operation being used to reduce the resolution of the second intermediate feature image; normalizing the pooled second intermediate feature image through a batch normalization layer; adjusting the channels of the normalized second intermediate feature image through the first residual branch of the second residual downsampling layer and based on the channel filtering mechanism of information entropy; directly adjusting the channels of the second intermediate feature image through the second residual branch of the second residual downsampling layer and based on the channel filtering mechanism of information entropy, so that the number of channels in the second intermediate feature image is consistent with the number of channels in the normalized second intermediate feature image; fusing the second intermediate feature images after channel adjustment by the first residual branch of the second residual downsampling layer and the second residual branch of the second residual downsampling layer respectively, and outputting the fourth intermediate feature image after feature fusion.
[0092] In one possible implementation, the cross-scale extraction network module 52 is used for a channel filtering mechanism based on information entropy, and the intermediate feature map is adjusted for channel adjustment. Specifically, it includes: obtaining the information entropy value of the target channel output in the intermediate feature map, where the target channel is any channel in the intermediate feature map; determining whether the information entropy value is less than a preset information entropy value; if the information entropy value is less than or equal to the preset information entropy value, then deleting the target channel to adjust the channel.
[0093] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0094] This application also provides an electronic device. (See reference...) Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: at least one processor 601, at least one communication bus 602, a user interface 603, at least one network interface 604, and a memory 605.
[0095] The communication bus 602 is used to enable communication between these components.
[0096] The user interface 603 may include a display screen and a camera. Optionally, the user interface 603 may also include a standard wired interface and a wireless interface.
[0097] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0098] The processor 601 may include one or more processing cores. The processor 601 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 605, and by calling data stored in the memory 605. Optionally, the processor 601 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 601 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 601 and may be implemented as a separate chip.
[0099] The memory 605 may include random access memory (RAM) or read-only memory. Optionally, the memory 605 may include a non-transitory computer-readable storage medium. The memory 605 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 605 may also be at least one storage device located remotely from the aforementioned processor 601. (Refer to...) Figure 6The memory 605, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an image detection application for foggy scenes.
[0100] exist Figure 6 In the illustrated electronic device, the user interface 603 is primarily used to provide an input interface for the user and acquire user input data; while the processor 601 can be used to call the image detection application for foggy scenes stored in the memory 605. When executed by one or more processors 601, the electronic device performs one or more of the methods described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0101] This application also provides a computer-readable storage medium storing instructions. When executed by one or more processors, these instructions cause an electronic device to perform one or more of the methods described in the above embodiments.
[0102] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0103] In the various embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between apparatuses or units may be electrical or other forms.
[0104] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0105] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0106] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0107] The above description is merely an exemplary embodiment disclosed in this application and should not be construed as limiting the scope of this application. Any equivalent changes and modifications made in accordance with the teachings of this application shall still fall within the scope of this application. Those skilled in the art, upon considering the disclosure of the specification and practical truths, will readily conceive of other embodiments disclosed in this application.
[0108] This application is intended to cover any variations, uses, or adaptations disclosed herein that follow the general principles disclosed herein and include common knowledge or customary technical means in the art that are not described in this application.
Claims
1. A method for image detection in a foggy scene, characterized in that, The method includes: Acquire an image of a target to be detected, wherein the image of the target to be detected includes at least one object to be detected; The target image to be detected is input into a multi-path dehazing model, which includes a first propagation path, a second propagation path, and a third propagation path. The first feature in the target image to be detected is obtained through the first propagation path. The first feature is the common and differential features of the target objects of different categories at different scales. The multi-path dehazing model includes a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, and a first residual downsampling layer. The step of obtaining the first feature in the target image to be detected through the first propagation path specifically includes: inputting the target image to be detected into the first feature extraction layer and outputting a first intermediate feature image through the first feature extraction layer; inputting the target image to be detected into the second feature extraction layer and outputting a second intermediate feature image through the second feature extraction layer; inputting the first intermediate feature image into the first residual downsampling layer and outputting a third intermediate feature image through the first residual downsampling layer; inputting the second intermediate feature image and the third intermediate feature image into the third feature extraction layer simultaneously, and outputting the first feature in the target image to be detected through the third feature extraction layer. The second feature in the target image to be detected is obtained through the second propagation path. The second feature includes the contour features and pose features of the target objects of different categories. The third feature in the image of the target to be detected is obtained through the third propagation path. The third feature includes the relative position feature and spatial position feature of the target to be detected of different categories. The first feature, the second feature, and the third feature are fused together, and the global fused feature corresponding to the object to be detected is output through the multi-path dehazing model. Based on the global fusion features, the dehazed target image is output through the multi-path dehazing model.
2. The method of claim 1, wherein, The multi-path dehazing model further includes a fourth feature extraction layer and a second residual downsampling layer. The step of obtaining the second feature in the target image to be detected through the second propagation path specifically includes: The second intermediate feature image is input into the second residual downsampling layer, and the fourth intermediate feature image is output through the second residual downsampling layer; The first feature and the fourth intermediate feature image are simultaneously input into the fourth feature extraction layer, and the second feature is output through the fourth feature extraction layer.
3. The method of claim 2, wherein, The multi-path dehazing model further includes a fifth feature extraction layer, wherein obtaining the third feature in the target image to be detected through the third propagation path specifically includes: The first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer, and the fifth feature extraction layer are connected in series in a preset order; According to the preset order, the target image to be detected is sequentially passed through the first feature extraction layer, the second feature extraction layer, the third feature extraction layer, the fourth feature extraction layer and the fifth feature extraction layer to obtain a third feature in the target image to be detected.
4. The method of claim 2, wherein, The multi-path defogging model further comprises a batch normalization layer, and the method further comprises: The batch normalization layer is used to normalize each feature dimension in each intermediate feature image, and the expression of the normalization is as follows: ; wherein, represents the intermediate feature map image, i.e. normalized input image, by a preset two-dimensional convolution, is a height index in the intermediate feature map image, is a width index in the intermediate feature map image, is a channel index of the intermediate feature map image, is a height of the preset two-dimensional convolution, is a width of the preset two-dimensional convolution, is a number of channels of the preset two-dimensional convolution, is a coordinate and a channel corresponding pixel value in the intermediate feature map image, is a local spatial horizontal coordinate of a convolution kernel in the preset two-dimensional convolution, is a local spatial vertical coordinate of a convolution kernel in the preset two-dimensional convolution, represents a basic element feature map after the normalization processing, is a mean value of image data corresponding to the intermediate feature map image in a channel dimension, is a variance of image data corresponding to the intermediate feature map image in a channel dimension, is a protection parameter for avoiding a denominator being 0, is the intermediate feature map image, i.e. normalized output image, after the normalization processing, is a scaling factor of image data corresponding to the intermediate feature map image in a channel dimension, is an offset of image data corresponding to the intermediate feature map image in a channel dimension.
5. The method of claim 4, wherein, The first intermediate feature image is input into the first residual down-sampling layer, and a third intermediate feature image is output through the first residual down-sampling layer, specifically comprising: The first intermediate feature image is down-sampled through a preset convolutional layer, and the sampling operation is used to reduce the first intermediate feature image to an image of a preset scale; The first intermediate feature image after the down-sampling operation is normalized through the batch normalization layer; The first intermediate feature image after the normalization is adjusted in channels through a first residual branch of the first residual down-sampling layer based on an information entropy channel screening mechanism; The first intermediate feature image is directly adjusted in channels through a second residual branch of the first residual down-sampling layer based on the information entropy channel screening mechanism, so that the number of channels in the first intermediate feature image is consistent with the number of channels in the first intermediate feature image after the normalization; The first intermediate feature image after the channel adjustment of the first residual branch of the first residual down-sampling layer and the second residual branch of the first residual down-sampling layer is fused in features, and the third intermediate feature image after the feature fusion is output.
6. The method of claim 5, wherein, The second intermediate feature image is input into the second residual down-sampling layer, and a fourth intermediate feature image is output through the second residual down-sampling layer, specifically comprising: The second intermediate feature image is pooled through a preset average pooling layer, and the pooling operation is used to reduce the resolution of the second intermediate feature image; The second intermediate feature image after the pooling operation is normalized through the batch normalization layer; The second intermediate feature image after the normalization is adjusted in channels through a first residual branch of the second residual down-sampling layer based on the information entropy channel screening mechanism; The second intermediate feature image is directly adjusted in channels through a second residual branch of the second residual down-sampling layer based on the information entropy channel screening mechanism, so that the number of channels in the second intermediate feature image is consistent with the number of channels in the second intermediate feature image after the normalization; The second intermediate feature image after the channel adjustment of the first residual branch of the second residual down-sampling layer and the second residual branch of the second residual down-sampling layer is fused in features, and the fourth intermediate feature image after the feature fusion is output.
7. The method of claim 6, wherein, The channel adjustment of the intermediate feature image based on the information entropy channel screening mechanism specifically comprises: An information entropy value of a target channel output in the intermediate feature map is obtained, the target channel being any one channel in the intermediate feature map; It is judged whether the information entropy value is less than a preset information entropy value; If the information entropy value is less than or equal to the preset information entropy value, the target channel is deleted for the channel adjustment.
8. An image detection device in a foggy scene, characterized in that, The device comprises an acquisition module, a cross-scale extraction network module and a processing module, wherein, The acquisition module is configured to acquire a to-be-detected target image, the to-be-detected target image comprising at least one to-be-detected object; The cross-scale extraction network module is configured to input the to-be-detected target image into a multi-path defogging model, the multi-path defogging model comprising a first propagation path, a second propagation path and a third propagation path; the first feature in the to-be-detected target image is obtained through the first propagation path, the first feature being common features and difference features of different categories of the to-be-detected objects at different scales; the second feature in the to-be-detected target image is obtained through the second propagation path, the second feature comprising contour features and posture features of different categories of the to-be-detected objects; the third feature in the to-be-detected target image is obtained through the third propagation path, the third feature comprising relative position features and spatial position features of different categories of the to-be-detected objects; the multi-path defogging model comprises a first feature extraction layer, a second feature extraction layer, a third feature extraction layer and a first residual down-sampling layer; the first feature in the to-be-detected target image is obtained through the first propagation path, specifically comprising: inputting the to-be-detected target image into the first feature extraction layer and outputting a first intermediate feature image through the first feature extraction layer; inputting the to-be-detected target image into the second feature extraction layer and outputting a second intermediate feature image through the second feature extraction layer; inputting the first intermediate feature image into the first residual down-sampling layer and outputting a third intermediate feature image through the first residual down-sampling layer; inputting the second intermediate feature image and the third intermediate feature image into the third feature extraction layer at the same time and outputting the first feature in the to-be-detected target image through the third feature extraction layer; The processing module is configured to perform feature fusion on the first feature, the second feature and the third feature, and output a global fusion feature corresponding to the to-be-detected object through the multi-path defogging model; and output the to-be-detected target image after defogging through the multi-path defogging model according to the global fusion feature.
9. An electronic device, comprising: The electronic device comprises a processor, a communication bus, a user interface, a network interface and a memory, the memory being configured to store instructions, the user interface and the network interface being configured to communicate with other devices, and the processor being configured to execute the instructions stored in the memory to enable the electronic device to perform the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Non-uniform real foggy day image defogging method, device, equipment, medium and product
CN118864312A