A foggy image vehicle detection method based on cycle generative adversarial network and interest domain enhancement
By using a cyclic generative adversarial network and interest domain enhancement method, fog-free images are generated and feature extraction and clustering are performed, which solves the problems of image quality and insufficient model generalization in foggy vehicle detection and achieves high-precision and robust vehicle detection.
Patent Information
- Application Number
- CN202411820387.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Vehicle detection in foggy environments faces problems such as degraded image quality, difficulty in feature extraction, and insufficient model generalization capabilities. Existing technologies are unable to effectively improve detection accuracy and robustness.
A cyclic generative adversarial network is used to generate fog-free images, and through feature extraction, clustering and mask map generation, combined with feature fusion and uncertainty minimization query selection, image quality and detection accuracy are improved.
It improves the accuracy and robustness of vehicle detection in foggy weather, simplifies hardware requirements, enhances image semantic features, and improves detection accuracy.
Smart Images

Figure CN119672651B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle targets in foggy weather, and in particular to a vehicle detection method for foggy weather images based on a cyclic generative adversarial network and domain of interest enhancement. Background Art
[0002] With the rapid development of intelligent transportation systems and autonomous driving technologies, vehicle detection, as one of the core technologies, plays a vital role in areas such as traffic monitoring, driver assistance, and intelligent navigation. However, in practical applications, complex weather conditions pose severe challenges to the performance of vehicle detection systems. Foggy weather, due to low visibility, light attenuation, and decreased contrast, is a major challenge for vehicle detection in autonomous driving and intelligent monitoring. On the one hand, the quality of images captured by ordinary cameras is significantly degraded. In particular, vehicle outlines and details are obscured or blurred by fog, making it difficult for traditional detection algorithms based on edge, texture, or color features to operate stably. On the other hand, fog causes optical attenuation and color distortion in images, making it difficult for deep learning-based vehicle detection models to extract effective features from low-quality images, thus affecting the detection accuracy and robustness of the models.
[0003] Some research has attempted to improve vehicle detection performance in foggy environments through image preprocessing techniques. For example, dehazing algorithms can enhance image quality by enhancing contrast and restoring true colors. However, dehazing algorithms inherently suffer from high computational complexity, poor real-time performance, and the potential for artifacts, making them difficult to directly apply in efficient vehicle detection scenarios. Furthermore, relying solely on image enhancement techniques still cannot fully address the lack of vehicle appearance information caused by fog.
[0004] In recent years, deep learning-based vehicle detection methods have developed rapidly and have gradually become the mainstream means to solve vehicle detection problems in complex scenarios. Through models such as convolutional neural networks and Transformer, researchers can learn multi-level semantic features from large-scale data and significantly improve the robustness and adaptability of vehicle detection. However, current deep learning methods still face challenges in the task of vehicle detection in foggy weather. Specifically, due to the difficulty in collecting foggy weather data and the high cost of annotation, existing training datasets often lack sufficient coverage of foggy weather scenes, resulting in insufficient out-of-domain generalization capabilities of the model in practical applications. In addition, specific optical properties under foggy conditions, such as scattering and attenuation of reflected light, may cause the model to be ineffective in detecting long-distance vehicles.
[0005] To address these issues, existing technologies have proposed methods for fusing multi-sensor data. For example, multimodal fusion methods combining lidar, millimeter-wave radar, and cameras can effectively alleviate the reliance on single-source visual information in foggy environments. However, multi-sensor fusion methods are costly in hardware and still face technical bottlenecks in data synchronization and cross-modal information fusion. Summary of the Invention
[0006] The purpose of this invention is to disclose a vehicle detection method for foggy images based on a recurrent generative adversarial network and domain of interest enhancement, which can simplify the necessary hardware conditions required for detection, while enhancing the semantic features of the image and improving the robustness and accuracy of detection.
[0007] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0008] A vehicle detection method for foggy images based on a recurrent generative adversarial network and interest domain enhancement, the method comprising:
[0009] S1, obtains a road vehicle image under foggy conditions, and obtains a fog-free road vehicle image through a cyclic generative adversarial network;
[0010] S2: Construct a feature extraction network to extract deep features of fog-free road vehicle images. Input multiple fog-free image feature maps of different sizes into the region generation network to generate candidate boxes of different sizes and positions. The candidate boxes are processed by a clustering algorithm to obtain clustered rectangular boxes and generate a mask map of the region of interest.
[0011] S3, constructing a mask image feature extraction network, downsampling the mask image of the region of interest, and obtaining a mask image feature map corresponding to the size of the haze-free image feature map;
[0012] S4, constructing a feature fusion module to perform feature splicing and fusion of the extracted haze-free image feature map and mask image feature map within the same scale and between different scales;
[0013] S5, constructs an uncertainty minimization query selection method, screens the query results generated by the target detection model, and selects the query results with the least uncertainty; uses a lightweight decoder to perform multi-level decoding processing on the fused features of step S4, and inputs the decoding results into the target detection model built based on the prediction network to generate the final detection output, including target category and bounding box information.
[0014] Step S1 further comprises:
[0015] The road camera collects images of vehicles on the road under foggy conditions and converts them into fog-free images of vehicles on the road through a cyclic generative adversarial network.
[0016] Label the vehicle images on fog-free roads, generate a dataset, and randomly divide the dataset into a training set and a test set according to a preset ratio.
[0017] Step S2 further comprises:
[0018] A feature extraction network is built based on the CSPDarknet53 network to extract features from fog-free road vehicle images and output image feature maps of various sizes.
[0019] The extracted feature map is input into the region generation network to generate candidate boxes of different sizes and positions, and then the candidate boxes are clustered using the clustering algorithm using the following formula:
[0020]
[0021] box new =box+m(box)
[0022] Where box=(x center ,y center ,w,h) represents the center coordinates, width and height of the candidate box; box j represents the jth candidate box; K(box j -box) is the kernel function used to calculate box and box j r is the bandwidth parameter, which controls the perception range and neighborhood size of the kernel function; m(box) is the mean shift vector, which indicates the offset of the box to the density center; N(box) represents the set of candidate boxes in the neighborhood of the current box; box new is the updated candidate box position; the coordinates of the upper left corner and lower right corner of the rectangular box are:
[0023]
[0024] Among them, left_top is the coordinate of the upper left corner of the rectangular box; right_bottom is the coordinate of the lower right corner of the rectangular box; min(·) is the minimum value operation, and max(·) is the maximum value operation; box j (1) represents the x-axis coordinate x of the center of the candidate box center ;box j (2) represents the y-axis coordinate y of the center of the candidate box center ;
[0025] After clustering, the rectangular box is used as the region of interest to design the corresponding mask map.
[0026] As a preferred example, after clustering, the process of designing a corresponding mask map using the rectangular box as the region of interest includes the following steps:
[0027] Construct an empty image with background pixels δ and size W×H, where W is the width resolution of the input image and H is the height resolution of the input image;
[0028] The candidate boxes obtained by clustering are processed in the corresponding area of the empty image, and the pixel value in the corresponding area is set to α;
[0029] The processed image is fused with the fog-free road vehicle image to obtain the mask map of the region of interest.
[0030] As a preferred example, the feature extraction network includes a first convolutional layer, a second convolutional layer, a first C2f module, a third convolutional layer, a second C2f module, a fourth convolutional layer, a third C2f module, a fifth convolutional layer, a fourth C2f module and an AIFI module connected in sequence;
[0031] The first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, and the fifth convolutional layer all include convolution operations, batch normalization, and SiLU function activation;
[0032] The first C2f module, the second C2f module, the third C2f module, and the fourth C2f module each include three groups of residual modules. After the input passes through the 1×1 convolution layer to double the original number of channels, it is divided into two branches. The output result of the first branch is directly passed to the splicing module. The output result of the second branch enters the first group of residual modules for processing. The results of the first group of residual modules are split into two parts, one part is passed to the splicing module, and the other part enters the second group of residual modules for processing. The output results of the second group of residual modules are split into two parts, one part is passed to the splicing module again, and the other part enters the third group of residual modules. The output results of the third group of residual modules are directly passed to the splicing module, spliced with the output results of the first branch passed to the splicing module, part of the output results of the first group of residual modules, and part of the output results of the second group of residual modules, and finally enter the 1×1 convolution layer.
[0033] The AIFI module uses the position encoder to generate a two-dimensional sine-cosine position code that matches the input size from the output features of the fourth C2f module, converts the image data shape from a 4D tensor to a 3D tensor, and then passes the transformed image data and the generated position code into the transformer encoder for feature interaction and processing; finally, the result is resized to a 4D tensor shape, and the processed haze-free image feature map is output.
[0034] As a preferred example, in step S3, the mask map feature extraction network uses five pooling layers to downsample the mask map so that the size of the output mask map is consistent with the feature map output by the haze-free image feature extraction network.
[0035] Step S4 further comprises:
[0036] For image feature maps and mask feature maps The inter-scale feature fusion module is used for splicing and fusion. The fusion operation is as follows:
[0037]
[0038] Among them, ISFM(·) represents inter-scale feature fusion; Concat(·) represents the concatenation operator; M3, and M1 represent the fusion features of the feature fusion modules in three scales, respectively, and are expressed as:
[0039]
[0040] in, is the fusion feature of IFM; CBS1(·) indicates the convolution operation with a convolution kernel of 1, batch normalization operation and activation function operation; CBS3(·) indicates the convolution operation with a convolution kernel of 3, batch normalization operation and activation function operation; UP(·) indicates the upsampling operation; IFM(·) indicates the intra-scale feature fusion, and its operation is as follows:
[0041]
[0042] Among them, Flatten(·) represents the flattening operation, Conv(·) represents the convolution operation, and RepB(·) represents the module operation consisting of three sets of heavy parameter convolutions.
[0043] As a preferred example, in step S5, a query selection method for minimizing uncertainty is constructed. The query results generated by the target detection model are screened, and the process of selecting the query result with the minimum uncertainty includes the following steps:
[0044] For multiple queries generated during the target detection process, the uncertainty value of each query is calculated based on its prediction score distribution or confidence; the uncertainty value is determined by the entropy or other uncertainty measurement function of the category prediction score corresponding to the query;
[0045] Based on the calculated uncertainty value, one or more queries with the smallest uncertainty are selected from all queries as valid queries for subsequent detection tasks;
[0046] The final detection results are generated using the filtered uncertainty queries.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] The vehicle detection method for foggy images based on a cyclic generative adversarial network and interest region enhancement of the present invention generates fog-free images according to the cyclic generative adversarial network, which can improve image quality and visibility. It generates a region of interest mask map through target detection and clustering algorithms, which can effectively focus on specific areas of the image and make the detection more accurate. At the same time, it can simplify the necessary hardware conditions required for detection, while enhancing the semantic features of the image, improving the robustness and accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a schematic diagram of the overall process of a vehicle detection method for foggy images based on a cyclic generative adversarial network and interest domain enhancement according to an embodiment of the present invention;
[0050] Figure 2 2 is a before-and-after comparison diagram of a recurrent generative adversarial network according to an embodiment of the present invention;
[0051] Figure 3 2. This is a schematic diagram of a candidate frame image generated by a region generation network (RPN) according to an embodiment of the present invention;
[0052] Figure 4 Schematic diagram of a rectangular frame image clustered by a clustering algorithm according to an embodiment of the present invention;
[0053] Figure 5 is a schematic diagram of a mask image of a region of interest according to an embodiment of the present invention;
[0054] Figure 6 is a schematic diagram of a feature fusion module according to an embodiment of the present invention;
[0055] Figure 7 is a schematic diagram of the overall network structure of an embodiment of the present invention;
[0056] Figure 8 Schematic diagram of the detection results of an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
[0058] like Figure 1-8 As shown, a vehicle detection method for foggy images based on a cyclic generative adversarial network and interest domain enhancement according to an embodiment of the present invention includes:
[0059] S1: Collect foggy image data on the highway through road cameras. And convert the foggy image into fog-free road image through CycleGAN. Figure 2 As shown in Figure 2, a dataset containing 25,048 highway images and their corresponding labels is created, and the dataset is randomly divided into training and test sets in a ratio of 8:2.
[0060] S2: Construct a feature extraction network to extract the depth features of the fog-free image, then generate candidate boxes through the region generation network, process the candidate boxes through the clustering algorithm, obtain the clustered rectangular boxes and generate a mask map of the region of interest.
[0061] The feature extraction network uses the CSPDarknet53 network. The fog-free image is downsampled by 32 times when it passes through the network for feature extraction, and the final three-layer feature map is output for subsequent operations. When the output image resolution is W×H×3, three different sizes of image features are output, denoted as and The output feature map scales are W is the width resolution of the image, and H is the height resolution of the image. For example, when the input image resolution is 640×640, the output feature map scale is 80×80×256, 40×40×512, and 20×20×1024.
[0062] For the CSPDarknet53 network, it includes convolutional layers, residual modules, C2f modules, and the SPPF module is replaced by the AIFI module. The convolutional layer includes convolution operations, batch normalization and SiLU function activation; the residual module reduces the input by half the number of channels through a 1×1 convolutional layer, and then increases it to the original number of channels through a 3×3 convolutional layer, and finally adds it to the input; the C2f module divides the input into two branches after it passes through a 1×1 convolutional layer to twice the original number of channels. Each C2f module includes 3 groups of residual modules; the input is divided into two branches after it passes through a 1×1 convolutional layer to twice the original number of channels. The output result of the first branch is directly passed to the splicing module; the output result of the second branch enters the first group of residual modules for processing. The result of the first group of residual modules is split into two parts according to the number of channels 1:1, one part is passed to the splicing module, and the other part enters the second group of residual modules for processing; the output result of the second group of residual modules is split into two parts, one part is passed to the splicing module again The output of the third residual module is passed to the splicing module, and the other part enters the third residual module. The output of the third residual module is directly passed to the splicing module and spliced with the output of the first branch passed to the splicing module, the partial output of the first residual module, and the partial output of the second residual module. Finally, it enters the 1×1 convolution layer. The AIFI module generates a two-dimensional sine-cosine position code that matches the input size through the position encoder. Secondly, the image data shape is converted from a 4D tensor (batch_size, channels, height, width) to a 3D tensor (batch_size, height*width, channels). The transformed image data and the generated position code are then passed to the transformer encoder for feature interaction and processing. Finally, the result is resized to a 4D tensor shape, thereby outputting the processed image features.Specific network structure: the first layer is a convolution layer with a convolution kernel size of 3×3, a stride of 2, a padding of 2, a number of channels of 64, and an output size of 320×320×64; the second layer is a convolution layer with a convolution kernel size of 3×3, a stride of 2, a number of channels of 128, and an output size of 160×160×128; the third layer is a C2f module, which consists of 3 groups of residual modules, and the output size is 160×160×128; the fourth layer is a convolution layer with a convolution kernel size of 3×3, a stride of 2, a number of channels of 256, and an output size of 80×80×256; the fifth layer is a C2f module, which consists of 3 groups of residual modules. The output size is 80×80×256; the sixth layer is a convolutional layer with a convolution kernel size of 3×3, a stride of 2, a number of channels of 512, and an output size of 40×40×512; the seventh layer is a C2f module, which consists of 3 groups of residual modules with an output size of 40×40×512; the eighth layer is a convolutional layer with a convolution kernel size of 3×3, a stride of 2, a number of channels of 1024, and an output size of 20×20×1024; the ninth layer is a C2f module, which consists of 3 groups of residual modules with an output size of 20×20×1024; the tenth layer is an AIFI module with an output size of 20×20×1024.
[0063] Then the candidate box is generated by the region generation network, such as Figure 3 As shown, the candidate boxes are then clustered using the Meanshift clustering algorithm. The specific clustering process is as follows:
[0064]
[0065] Where box=(x center ,y center ,w,h) represents the center coordinates, width and height of the candidate box; box j represents the jth candidate box; K(box j -box) is the kernel function used to calculate box and box j r is the bandwidth parameter, which controls the perception range and neighborhood size of the kernel function; m(box) is the mean shift vector, which indicates the offset of the box to the density center; N(box) represents the set of candidate boxes in the neighborhood of the current box; box new is the updated candidate box position. The coordinates of the upper left corner and lower right corner of the rectangular box are:
[0066]
[0067] Among them, left_top is the coordinate of the upper left corner of the rectangular box; right_bottom is the coordinate of the lower right corner of the rectangular box; min(·) is the minimum value operation, and max(·) is the maximum value operation; box j(1) represents the x-axis coordinate of the center of the candidate box, i.e. x center ;box j (2) represents the y-axis coordinate of the center of the candidate box, i.e. y center .
[0068] After clustering, the rectangular box is used as the region of interest to design the corresponding mask map. The specific process includes:
[0069] First, construct an empty image with background pixels δ and size W×H;
[0070] Then, the candidate boxes obtained by clustering are processed in the corresponding area of the empty image, and the pixel value in the corresponding area is set to α;
[0071] Finally, the processed image is fused with the fog-free image to obtain the mask map of the region of interest.
[0072] S3: Construct a mask map feature extraction network. The mask map of the region of interest is downsampled through the feature extraction network to obtain a feature map of the same size as the feature map of the fog-free image. Since the region of interest only contains the region coordinate information, the mask map feature extraction network mainly uses five pooling layers to downsample the mask map so that the output mask map size is consistent with the feature map output by the fog-free image feature extraction network, so as to facilitate subsequent fusion operations. That is, the output mask map sizes are That is, the sizes of the extracted feature maps are 80×80×3, 40×40×3, and 20×20×3 respectively.
[0073] The pooling layer network for the ROI mask image has a total of five max pooling layers. If the input is a 640×640×3 ROI mask image, the output sizes are 320×320×3, 160×160×3, 80×80×3, 40×40×3, and 20×20×3 respectively.
[0074] S4: Construct a feature fusion module to perform feature splicing and fusion on the extracted feature maps within the same scale and between different scales. The specific operations are as follows:
[0075] For image feature maps and mask feature maps The inter-scale fusion module (ISFM) is used for splicing and fusion. The fusion operation is as follows:
[0076]
[0077] Among them, ISFM(·) represents inter-scale feature fusion; Concat(·) represents the concatenation operator; M3, M1 and M2 represent the fusion features of the three intra-scale fusion modules (IFM), which can be expressed as:
[0078]
[0079] in, is the fusion feature of IFM; CBS1(·) indicates the convolution operation with a convolution kernel of 1, batch normalization operation and activation function operation; CBS3(·) indicates the convolution operation with a convolution kernel of 3, batch normalization operation and activation function operation; UP(·) indicates the upsampling operation; IFM(·) indicates the intra-scale feature fusion, and its operation is as follows:
[0080]
[0081] Among them, Flatten(·) represents the flattening operation, Conv(·) represents the convolution operation, and RepB(·) represents the module operation consisting of three sets of heavy parameter convolution (RepConv).
[0082] The specific fusion process is:
[0083] The input image feature map Image feature map after upsampling and after convolution layer with convolution kernel size of 1×1 And the mask feature map The intra-scale feature fusion module is used for fusion. After the intra-scale fusion module splices the input features, it is divided into two branches. One branch passes through the convolution layer with a convolution kernel size of 1×1, and then passes through three layers of RepBlock. It is then added and flattened with the other branch that only passes through the convolution layer with a convolution kernel size of 1×1, and recorded as a feature map. After a convolution layer with a convolution kernel size of 1×1, and then up-sampled, the image feature map is the same as the image feature map after the convolution layer with a convolution kernel size of 1×1. And the mask feature map The IFM module is used for fusion, which is recorded as feature map M3; after M3 passes through a convolution layer with a convolution kernel size of 3×3, it is combined with the feature map of M3 after passing through a convolution layer with a convolution kernel size of 1×1. Use the IFM module for fusion and record it as a feature map After a convolution layer with a convolution kernel size of 3×3, the image feature map And the mask feature map Use IFM module to fuse and record it as feature map M1. Finally, the feature map M1, M3 performs splicing and outputs the fused data.
[0084] S5: Construct a detection architecture that includes uncertainty-minimizing query selection, a lightweight decoder, and a prediction network to achieve target detection and classification. Specifically, construct an uncertainty-minimizing query selection method that filters the queries generated by the target detection model and selects the query with the lowest uncertainty to enhance the stability and accuracy of the detection results. The method includes the following steps:
[0085] (1) Query uncertainty measurement: For multiple queries generated during the target detection process, the uncertainty value of each query is calculated based on its prediction score distribution or confidence. The uncertainty value is determined by the entropy of the category prediction score corresponding to the query or other uncertainty measurement function.
[0086] (2) Selection of queries with minimum uncertainty: Based on the calculated uncertainty value, one or more queries with the minimum uncertainty are selected from all queries as valid queries for subsequent detection tasks.
[0087] (3) Optimization of detection results: Use the filtered low-uncertainty queries to generate the final detection results, thereby reducing the false detection and missed detection problems caused by high-uncertainty queries and improving the performance of the detection model.
[0088] A detection architecture consisting of a lightweight decoder and prediction network is constructed to perform multi-level decoding processing on the input features and generate the final detection output, including target category and bounding box information. The algorithm is compared with other algorithms, and the final detection results are shown in Table 1:
[0089] Table 1 Detection results of the present invention and other target detection networks on the self-made vehicle dataset
[0090]
[0091] Table 1 shows the detection results of the present invention and other target detection networks on a self-made vehicle dataset. It can be seen that the present invention has the highest detection accuracy for each type of vehicle, with an overall mAP index of 79.35%, which is better than other target detection algorithms. The improvement is very high for special trucks that are difficult to monitor, with an improvement of more than 10%, which is enough to prove the superiority of the present invention. Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 and Figure 8 The text in the figure has no effect on the technical solution of the present invention and is only used to illustrate the image processing process and the final effect.
[0092] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiment of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal translation scripting language JavaScript, etc.
[0093] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions for executing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0096] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0097] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A vehicle detection method for foggy images based on recurrent generative adversarial networks and interest domain enhancement, characterized by: The method comprises: S1, obtain a road vehicle image under foggy conditions, and obtain a fog-free road vehicle image through image style conversion; S2: Construct a feature extraction network to extract deep features of fog-free road vehicle images. Input multiple fog-free image feature maps of different sizes into the region generation network to generate candidate boxes of different sizes and positions. The candidate boxes are processed by a clustering algorithm to obtain clustered rectangular boxes and generate a mask map of the region of interest. S3, constructing a mask image feature extraction network, downsampling the mask image of the region of interest, and obtaining a mask image feature map corresponding to the size of the haze-free image feature map; S4, constructing a feature fusion module to perform feature splicing and fusion of the extracted haze-free image feature map and mask image feature map within the same scale and between different scales; S5: Constructing an uncertainty-minimizing query selection method to filter the query results generated by the target detection model and select the query result with the least uncertainty; using a lightweight decoder to perform multi-level decoding processing on the fused features of step S4, and inputting the decoding results into the target detection model built based on the prediction network to generate the final detection output, including target category and bounding box information; Step S2 further comprises: A feature extraction network is built based on the CSPDarknet53 network to extract features from fog-free road vehicle images and output image feature maps of various sizes. The extracted feature map is input into the region generation network to generate candidate boxes of different sizes and positions, and then the candidate boxes are clustered using the clustering algorithm using the following formula: box new =box+m(box) Where box=(x center ,y center ,w,h) represents the center coordinates, width and height of the candidate box; box j represents the jth candidate box; K(box j -box) is the kernel function used to calculate box and box j r is the bandwidth parameter, which controls the perception range and neighborhood size of the kernel function; m(box) is the mean shift vector, which indicates the offset of the box to the density center; N(box) represents the set of candidate boxes in the neighborhood of the current box; box new is the updated candidate box position; the coordinates of the upper left corner and lower right corner of the rectangular box are: Among them, left_top is the coordinate of the upper left corner of the rectangular box; right_bottom is the coordinate of the lower right corner of the rectangular box; min(·) is the minimum value operation, and max(·) is the maximum value operation; box j (1) represents the x-axis coordinate x of the center of the candidate box center ;box j (2) represents the y-axis coordinate y of the center of the candidate box center ; After clustering, the rectangular box is used as the region of interest to design the corresponding mask map; Step S4 further comprises: For image feature maps and mask feature maps The inter-scale feature fusion module is used for splicing and fusion. The fusion operation is as follows: Among them, ISFM(·) represents inter-scale feature fusion; Concat(·) represents the concatenation operator; M3, and M1 represent the fusion features of the feature fusion modules in three scales, respectively, and are expressed as: in, is the fusion feature of IFM; CBS1(·) indicates the convolution operation with a convolution kernel of 1, batch normalization operation and activation function operation; CBS3(·) indicates the convolution operation with a convolution kernel of 3, batch normalization operation and activation function operation; UP(·) indicates the upsampling operation; IFM(·) indicates the intra-scale feature fusion, and its operation is as follows: Among them, Flatten(·) represents the flattening operation, Conv(·) represents the convolution operation, and RepB(·) represents the module operation consisting of three sets of heavy parameter convolutions.
2. The vehicle detection method for foggy images based on recurrent generative adversarial networks and interest domain enhancement according to claim 1 is characterized in that: Step S1 further comprises: The road camera collects images of vehicles on the road in foggy conditions and converts them into fog-free images of vehicles on the road using the image style conversion algorithm CycleGAN. Label the vehicle images on fog-free roads, generate a dataset, and randomly divide the dataset into a training set and a test set according to a preset ratio.
3. The vehicle detection method for foggy images based on recurrent generative adversarial networks and interest domain enhancement according to claim 1 is characterized in that: After clustering, the process of designing the corresponding mask map using the rectangular box as the region of interest includes the following steps: Construct an empty image with background pixels δ and size W×H, where W is the width resolution of the input image and H is the height resolution of the input image; The candidate boxes obtained by clustering are processed in the corresponding area of the empty image, and the pixel value in the corresponding area is set to α; The processed image is fused with the fog-free road vehicle image to obtain the mask map of the region of interest.
4. The vehicle detection method for foggy images based on recurrent generative adversarial networks and interest domain enhancement according to claim 1 is characterized in that: The feature extraction network includes a first convolutional layer, a second convolutional layer, a first C2f module, a third convolutional layer, a second C2f module, a fourth convolutional layer, a third C2f module, a fifth convolutional layer, a fourth C2f module and an AIFI module connected in sequence; The first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer, and the fifth convolutional layer all include convolution operations, batch normalization, and SiLU function activation; The first, second, third, and fourth C2f modules each consist of three groups of residual modules. The input is divided into two branches after passing through a 1×1 convolutional layer to double the original number of channels. The output of the first branch is directly passed to the concatenation module. The output of the second branch is processed by the first group of residual modules. The output of the first group of residual modules is split into two parts, one of which is passed to the concatenation module and the other is processed by the second group of residual modules. The output results of the second group of residual modules are split into two parts. One part is passed to the splicing module again, and the other part enters the third group of residual modules. The output results of the third group of residual modules are directly passed to the splicing module and spliced with the output results of the first branch passed to the splicing module, part of the output results of the first group of residual modules, and part of the output results of the second group of residual modules, and finally enter the 1×1 convolution layer; The AIFI module uses the position encoder to generate a two-dimensional sine-cosine position code that matches the input size from the output features of the fourth C2f module, converts the image data shape from a 4D tensor to a 3D tensor, and then passes the transformed image data and the generated position code into the transformer encoder for feature interaction and processing; finally, the result is resized to a 4D tensor shape, and the processed haze-free image feature map is output.
5. The vehicle detection method for foggy images based on recurrent generative adversarial networks and interest domain enhancement according to claim 1 is characterized in that: In step S3, the mask map feature extraction network uses five pooling layers to downsample the mask map so that the size of the output mask map is consistent with the feature map output by the haze-free image feature extraction network.
6. The vehicle detection method for foggy images based on recurrent generative adversarial networks and interest domain enhancement according to claim 1, characterized in that: In step S5, a query selection method for minimizing uncertainty is constructed. The query results generated by the target detection model are screened, and the process of selecting the query result with the minimum uncertainty includes the following steps: For multiple queries generated during the target detection process, the uncertainty value of each query is calculated based on its prediction score distribution or confidence; the uncertainty value is determined by the entropy or other uncertainty measurement function of the category prediction score corresponding to the query; Based on the calculated uncertainty value, one or more queries with the smallest uncertainty are selected from all queries as valid queries for subsequent detection tasks; The final detection results are generated using the filtered uncertainty queries.
Citation Information
Patent Citations
Remote sensing image target detection method based on attention and generative adversarial network
CN113989612A
Vehicle adaptive fusion detection method and system
CN114332655A