Foggy day vehicle detection method with CFLA and CSFC added

By introducing context and spatial feature calibration modules and focusing linear attention mechanisms into the YOLOV8 model, the problem of low detection accuracy in foggy weather conditions is solved, and higher vehicle and pedestrian detection accuracy is achieved.

CN119850906APending Publication Date: 2025-04-18HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411723726.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The YOLO series models are difficult to effectively detect vehicles and pedestrians under foggy weather conditions, mainly due to the reduced image contrast, reduced visibility and uneven brightness distribution, resulting in a decrease in detection accuracy.

Method used

Based on the original YOLOV8 model, the context feature calibration CFC module and the spatial feature calibration SFC module are introduced. Combined with the focus on the linear attention mechanism, the model's ability to capture local and global features is enhanced, the feature fusion pyramid and detection head are improved, and the model's detection performance in foggy weather conditions is improved.

Benefits of technology

The model's detection accuracy of vehicles and pedestrians in foggy days is significantly improved, mAP0.5, Precision and Recall are improved, and the model's performance in dealing with low contrast and uneven lighting conditions is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850906A_ABST
    Figure CN119850906A_ABST
Patent Text Reader

Abstract

The invention discloses a foggy day vehicle detection method added with CFLA and CSFC. The method comprises the following steps: obtaining related samples with labels from a foggy day vehicle data set; an improved YOLOV8 network structure is constructed, and the improved part of the network structure comprises the steps that a focusing linear attention mechanism is added to a standard backbone network, and a context feature calibration (CFC) module and a spatial feature calibration (SFC) module are added to the neck of the network; training the improved network structure by using a foggy day vehicle data set; generating a foggy day vehicle detection model; detecting a vehicle in foggy weather by using the model; pedestrians and vehicles appearing in foggy days are identified. The method can be used for detecting various vehicles and pedestrians in foggy weather, such as pedestrians, automobiles, buses, motorcycles and bicycles, has a good detection effect on vehicles and pedestrians which are difficult to identify by naked eyes, and improves the accuracy and efficiency of foggy weather detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image detection and target recognition, and in particular to a foggy vehicle detection method adding CFLA and CSFC. Background Art

[0002] Object detection is an important branch in the field of image processing, which is to frame the scope and category of the object of interest in an image. Object detection algorithms based on deep learning are divided into two-stage object detection algorithms and one-stage object detection algorithms. The main feature of the two-stage object detection algorithm is that the object detection task is divided into two stages, usually generating candidate regions and classifying and locating these regions. This method usually includes the following two stages: candidate region generation and region classification and bounding box regression. Representative algorithms include R-CNN and FastR-CNN. The one-stage object detection algorithm does not directly generate candidate box regions but regards the object detection task as a regression task for the entire image. Representative algorithms include the YOLO series. Among the current methods based on convolutional neural networks, the YOLO series of object detection methods have better performance in object detection and are used by many researchers for vehicle inspection.

[0003] In foggy weather conditions, the contrast in the image is significantly reduced and fog can cause light scattering, making the boundary between the object and the background unclear, making it difficult to distinguish the edges and details of the target. The YOLO series models rely on the boundaries and features of objects in the image for detection, and low contrast makes these features difficult to capture, which affects the detection accuracy. In addition, foggy weather reduces visibility and uneven light distribution, which can cause some areas in the image to be too dark or too bright, and then affect the model's extraction and recognition of image features. However, the YOLO series models usually assume that the image has a relatively uniform brightness distribution during training, and the uneven lighting conditions in foggy weather will interfere with the normal operation of the model. Therefore, vehicles in foggy weather are very prone to traffic accidents. If it is possible to detect whether there are vehicles or pedestrians in the foggy weather ahead, it will significantly reduce the traffic injury rate. Summary of the invention

[0004] In view of the technical problems that the YOLO series cannot cope well with situations such as reduced image contrast and visibility, and uneven light distribution, this technical solution provides a foggy vehicle detection method that adds CFLA and CSFC. On the basis of the original YOLOV8 model, the context feature calibration CFC module and the spatial feature calibration SFC module are introduced, which can accurately identify vehicles and pedestrians in foggy days and effectively solve the above problems.

[0005] The present invention is achieved through the following technical solutions:

[0006] A method for detecting vehicles in foggy weather by adding CFLA and CSFC, the method comprising the steps of:

[0007] Step 1: Obtain relevant labeled foggy samples from the foggy vehicle dataset, wherein the samples include images of foggy parts and images of non-foggy parts;

[0008] Step 2: Build an improved YOLOV8 detection network: including improving the backbone network, improving the feature fusion pyramid, and decoupling the detection head;

[0009] The improved backbone network is to add a focused linear attention mechanism to the standard backbone network;

[0010] The improved feature fusion pyramid is to add a context feature calibration CFC module and a spatial feature calibration SFC module to the standard feature fusion pyramid;

[0011] Step 3: Use the foggy vehicle dataset to train the improved YOLOV8 detection network to obtain a foggy vehicle detection model;

[0012] Step 4: Detect vehicles in foggy weather using the foggy weather vehicle detection model;

[0013] Step 5: Mark the vehicle and pedestrian sections in foggy conditions.

[0014] Furthermore, the images in the foggy vehicle dataset include categories related to pedestrians, cars, buses, motorcycles, and bicycles.

[0015] Furthermore, the improved backbone network described in step 2 is to add a focused linear attention mechanism to the standard backbone network, which is achieved through the following steps:

[0016] Step 2.1: Generate Query, Key, and Value from the input features through linear projection;

[0017] Step 2.2: Divide the query and key into multiple local windows to reduce the computational complexity, improve the local feature extraction capability of the model, and match the spatial structure of the image;

[0018] Step 2.3: In order to extract more detailed information, the local enhancement information is extracted by applying convolution operation to the Value feature; at the same time, the position encoding is introduced into the Query and Key to enhance the model's perception of spatial location information;

[0019] Step 2.4: Calculate the dot product of Query and Key to get the attention weight, and then multiply the weight by Value to get the final attention result;

[0020] Step 2.5: In order to improve the ability to extract local features, a depth-wise separable convolution is introduced to process the feature map, which can effectively capture the texture and details in the local area and combine with the global attention mechanism to achieve a good balance between computational efficiency and feature expression ability;

[0021] Step 2.6: Map the local window features back to the original feature map space through reshaping and concatenation operations, ensuring that local features and global information are combined and the feature map maintains the same dimension and structure as the original input.

[0022] Furthermore, a C2f-FocusedLinearAttention module is provided in the standard backbone network, and the formula of the C2f-FocusedLinearAttention module is as follows:

[0023] Sim(Q i ,K j )=φ p (Q i )φ p (K j ) T

[0024] O=φ(Q)φ(K) T V+DWC(V)

[0025] In the above formula, Sim(.,.) represents the similarity function, Q i ,K j Represents the Query vector and Key vector, φ p (Q i ),φ p (K j ) represent Q i ,K j Apply the transformation function φ p The new vector after p (K j ) T Yes p (K j ), O represents the output after adding the deep convolution module (DWC) to the attention matrix, φ(Q)φ(K) represents the query matrix and key matrix respectively, φ(Q)φ(K) T denote the transpose of the query matrix and the key matrix respectively, V denotes the value matrix, i.e., the weighted sum of the feature representations of each input position, and DWC(.) denotes depthwise convolution.

[0026] Furthermore, the focused linear attention mechanism is added to the standard backbone network. The specific operation method is as follows: first, a mapping function is constructed to simulate the distribution characteristics of the original Softmax attention weights that are mainly concentrated on a few important elements; on this basis, a simple deconvolution technique is used to restore the diversity of features; the module is expressed by the formula:

[0027] O=Sim(Q,K)V=φ p (Q)φ p (K) T +DWC(V)

[0028] Among them, O represents the output after adding the deep convolution module (DWC) to the attention matrix, Sim(.,.) represents the similarity function, Q, K represent the query vector and key vector respectively, φ p (Q)φ p (K) represent the query matrix and key matrix respectively, φ p (Q)φ p (K) T denote the transpose of the query matrix and the key matrix respectively, V denotes the value matrix, i.e., the weighted sum of the feature representations of each input position, and DWC(.) denotes depthwise convolution.

[0029] Furthermore, the context feature calibration CFC module added to the standard feature fusion pyramid described in step 2 has specific operation steps including: the context feature calibration CFC module first performs a dimensionality reduction operation on the input to reduce the number of input channels by half, and then generates query and key features through convolution; then calculates the similarity through matrix multiplication to generate a weight coefficient; then performs a softmax operation on the weight coefficient to normalize it and finally obtain a probability distribution; then generates context features by performing matrix multiplication on the weight coefficient and value; then applies a local attention mechanism to weight the result to adjust the importance of different positions in the context features; finally, the weighted context features and the input are added to generate the final output.

[0030] Furthermore, the formula of the context feature calibration CFC module is as follows:

[0031]

[0032] Among them, x i Represents input, y i represents the output, α i represents the recalibration factor, z j represents the background information or auxiliary information used to calculate the similarity and further adjust the input features, f(·) represents the value of the affinity between the calculated features, and M represents the number of context feature sets extracted from the feature map and used for each pixel classification.

[0033] Furthermore, the spatial feature calibration SFC module added to the standard feature fusion pyramid described in step 2 has the following specific operation steps: the spatial feature calibration SFC module accepts two inputs and obtains the batch size and the height and width of the output, which will be used for alignment in subsequent operations and generate the required offsets and grid coordinates; by processing the fine-grained feature map and using bilinear interpolation to resize it to the size of the coarse-grained feature map, so that they can be effectively fused and aligned in subsequent steps; using a convolutional layer to process the coarse-grained feature map, and then splicing the coarse-grained feature map and the fine-grained feature map, the spliced ​​tensor is processed by a convolutional block to generate offsets for spatial transformation; these offsets are used for the subsequent The algorithm performs feature alignment and enhancement operations; then resizes the dimensions so that each group has its own independent channels and spatial features; extracts horizontal and vertical offsets, and then generates standardized grid coordinates for offset operations; combined with the offsets, these coordinates will be used to dynamically adjust the feature map in space to ensure that the feature map can be translated and transformed according to the offsets; a new resolution is generated by adjusting the standardized grid coordinates by the offset; the feature map is adjusted by sampling the coarse-grained feature map and the fine-grained feature map and applying the offset grid; the coarse-grained feature map and the fine-grained feature map are then weightedly fused using the attention weights, the low-resolution and high-resolution features are weighted summed, and the fused features are finally returned.

[0034] Furthermore, the formula of the spatial feature calibration SFC module is as follows:

[0035]

[0036] Where L represents the output of the SFC module; β l represents the weight factor of the low-frequency component, adjusting the contribution of the low-frequency component; T(·) represents the calibration function; u(·) represents the bilinear upsampling function; W l Represents the weight matrix corresponding to the low-frequency component features, used for feature transformation; F l Represents low-resolution features; Represents the weight factor of the high-frequency component and adjusts the contribution of the high-frequency component; Represents the weight matrix corresponding to the high-frequency component features, which is used for feature transformation; represents high-resolution features; Δ l , Represents two sets of offset maps.

[0037] Beneficial Effects

[0038] Compared with the prior art, the foggy vehicle detection method with the addition of CFLA and CSFC proposed in the present invention has the following beneficial effects:

[0039] (1) The present invention introduces CFLA and CSFC based on the original YOLOV8 algorithm. The introduction of CFLA can enhance local information. Depth-wise separable convolution can further process the information of local areas, and combined with the locally enhanced position embedding, the model can better perceive the detailed information of specific locations. It can also enhance global information integration, so that the model is not only stronger in capturing local features, but also can interact with information on a global scale. Since the focus factor and adaptive scaling factor are introduced during the design, the model can reduce the computational burden by controlling the amplification and scaling of the Query and Key vectors in the attention calculation. The windowed processing method also reduces the computational complexity of the model and improves computational efficiency.

[0040] (2) The present invention improves the model's ability to capture local and global features when processing images by introducing a focused linear attention mechanism, while optimizing computational efficiency. The performance in image tasks is significantly better than that of traditional convolutional neural network models, especially in tasks that require capturing long-distance dependencies or paying attention to subtle details. At the same time, adding a contextual feature calibration (CFC) module and a spatial feature calibration (SFC) module can enhance feature expression capabilities, and by fusing channel and spatial information, it can better capture detailed features and global information in images.

[0041] (3) The invention introduces the focused linear attention mechanism and adds the context feature calibration CFC module and the spatial feature calibration SFC module to improve the overall mAP of the model by 1.7. It can be seen that the introduction of these modules improves the accuracy of target detection and makes up for the shortcomings of the model in target detection. Compared with the existing technology, the model effectively improves the detection degree of common foggy days. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0043] Figure 2 The structural diagram of the present invention is that a focused linear attention mechanism is added to the standard bottleneck structure.

[0044] Figure 3 It is a structural diagram of the following feature calibration module of the present invention.

[0045] Figure 4 It is a structural diagram of the spatial feature calibration module of the present invention.

[0046] Figure 5 This is the improved YOLOV8 detection network structure diagram in the present invention.

[0047] Figure 6 It is a schematic diagram of the detection results of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Under the premise of not departing from the design concept of the present invention, various modifications and improvements made by ordinary persons in the art to the technical solutions of the present invention should all fall within the protection scope of the present invention.

[0049] Embodiment 1:

[0050] like Figure 1 As shown, a foggy vehicle detection method adding CFLA and CSFC, the method comprising the steps of:

[0051] Step 1: Obtain relevant labeled foggy samples from the foggy vehicle dataset, wherein the samples include foggy part images and non-foggy part images; obtain relevant labeled foggy vehicles as samples from the foggy vehicle dataset, wherein the categories in the images include: pedestrians, cars, buses, motorcycles, and bicycles.

[0052] Step 2: Build an improved YOLOV8 detection network: including improving the backbone network, improving the feature fusion pyramid, and decoupling the detection head.

[0053] The improved backbone network is to add a focused linear attention mechanism to the standard backbone network, which is achieved through the following steps:

[0054] Step 2.1: Generate Query, Key, and Value from the input features through linear projection.

[0055] Step 2.2: Divide the query and key into multiple local windows to reduce the computational complexity, improve the local feature extraction capability of the model, and match the spatial structure of the image.

[0056] Step 2.3: In order to extract more detailed information, the local enhanced information is extracted by applying convolution operation to the Value feature; at the same time, the position encoding is introduced into the Query and Key to enhance the model's perception of spatial location information.

[0057] Step 2.4: Calculate the dot product of Query and Key to get the attention weight, and then multiply the weight by Value to get the final attention result.

[0058] Step 2.5: In order to improve the ability to extract local features, a depth-wise separable convolution is introduced to process the feature map, which can effectively capture the texture and details in the local area and combine with the global attention mechanism to achieve a good balance between computational efficiency and feature expression ability.

[0059] Step 2.6: Map the local window features back to the original feature map space through reshaping and concatenation operations, ensuring that local features and global information are combined and the feature map maintains the same dimension and structure as the original input.

[0060] The C2f-Focused Linear Attention module is added to the standard backbone network. The formula of the C2f-Focused Linear Attention module is as follows:

[0061] Sim(Q i ,K j )=φ p (Q i )φ p (K j ) T

[0062] O=φ(Q)φ(K) T V+DWC(V)

[0063] In the above formula, Sim(.,.) represents the similarity function, Q i ,K j Represents the Query vector and Key vector, φ p (Q i ),φ p (K j ) represent Q i ,K j Apply the transformation function φ p The new vector after p (K j ) T Yes p (K j ), O represents the output after adding the deep convolution module (DWC) to the attention matrix, φ(Q)φ(K) represents the query matrix and key matrix respectively, φ(Q)φ(K) T denote the transpose of the query matrix and the key matrix respectively, V denotes the value matrix, i.e., the weighted sum of the feature representations of each input position, and DWC(.) denotes depthwise convolution.

[0064] The focused linear attention mechanism is added to the standard backbone network. The specific operation method is as follows: first, a mapping function is constructed to simulate the distribution characteristics of the original Softmax attention weights that are mainly concentrated on a few important elements; on this basis, a simple deconvolution technique is used to restore the diversity of features; the module is expressed as:

[0065] O=Sim(Q,K)V=φ p (Q)φp (K) T +DWC(V)

[0066] Among them, O represents the output after adding the deep convolution module (DWC) to the attention matrix, Sim(.,.) represents the similarity function, Q, K represent the query vector and key vector respectively, φ p (Q)φ p (K) represent the query matrix and key matrix respectively, φ p (Q)φ p (K) T denote the transpose of the query matrix and the key matrix respectively, V denotes the value matrix, i.e., the weighted sum of the feature representations of each input position, and DWC(.) denotes depthwise convolution.

[0067] The improved feature fusion pyramid is obtained by adding a context feature calibration CFC module and a spatial feature calibration SFC module to the standard feature fusion pyramid.

[0068] The context feature calibration CFC module added to the standard feature fusion pyramid has the following specific operation steps: the context feature calibration CFC module first performs a dimensionality reduction operation on the input to reduce the number of input channels by half, and then generates query and key features through convolution; then calculates the similarity through matrix multiplication to generate weight coefficients; then performs a softmax operation on the weight coefficients to normalize them and finally obtain a probability distribution; then generates context features by performing matrix multiplication on the weight coefficients and values; then applies a local attention mechanism to weight the results to adjust the importance of different positions in the context features; finally, the weighted context features and the input are added to generate the final output.

[0069] The formula of the context feature calibration CFC module is as follows:

[0070]

[0071] Among them, x i Represents input, y i represents the output, α i represents the recalibration factor, z j represents the background information or auxiliary information used to calculate the similarity and further adjust the input features, f(·) represents the value of the affinity between the calculated features, and M represents the number of context feature sets extracted from the feature map and used for each pixel classification.

[0072] The spatial feature calibration SFC module accepts two inputs and obtains the batch size and the height and width of the output. These dimensions will be used for alignment in subsequent operations and generate the required offsets and grid coordinates; by processing fine-grained feature maps and resizing them to the size of coarse-grained feature maps using bilinear interpolation, they can be effectively fused and aligned in subsequent steps; the coarse-grained feature maps are processed using convolutional layers, and then the coarse-grained feature maps and fine-grained feature maps are spliced. The spliced ​​tensors are processed through convolutional blocks to generate offsets for spatial transformation; these offsets are used for subsequent feature alignment and enhancement operations; the dimensions are then resized so that each Each group has its own independent channel and spatial features; extract horizontal and vertical offsets, and then generate standardized grid coordinates for offset operations; combined with the offsets, these coordinates will be used to dynamically adjust the feature map in space to ensure that the feature map can be translated and transformed according to the offsets; adjust the standardized grid coordinates by the offset to generate a new resolution; adjust the feature map by sampling the coarse-grained feature map and the fine-grained feature map, and apply the offset grid to adjust the feature map; then use the attention weights to weightedly fuse the coarse-grained feature map and the fine-grained feature map, weighted sum the low-resolution and high-resolution features, and finally return the fused features.

[0073] The formula of the spatial feature calibration SFC module is as follows:

[0074]

[0075] Where L represents the output of the SFC module; β l represents the weight factor of the low-frequency component, adjusting the contribution of the low-frequency component; T(·) represents the calibration function; u(·) represents the bilinear upsampling function; W l Represents the weight matrix corresponding to the low-frequency component features, used for feature transformation; F l Represents low-resolution features; Represents the weight factor of the high-frequency component and adjusts the contribution of the high-frequency component; Represents the weight matrix corresponding to the high-frequency component features, which is used for feature transformation; represents high-resolution features; Δ l , Represents two sets of offset maps.

[0076] Step 3: Use the foggy vehicle dataset to train the improved YOLOV8 detection network to obtain a foggy vehicle detection model;

[0077] Step 4: Detect vehicles in foggy weather using the foggy weather vehicle detection model;

[0078] Step 5: Mark the vehicle and pedestrian sections in foggy conditions.

[0079] The specific improvement data in this embodiment are shown in the following table:

[0080]

[0081]

[0082] mAP0.5: mAP refers to the "average accuracy", which is a key indicator to measure the comprehensive performance of the model in the object detection task. mAP0.5 refers to the "average accuracy" when the loU threshold is 0.5. Specifically, mAP0.5 is the value obtained by calculating the average accuracy of each category and averaging all categories.

[0083] Precision: refers to the proportion of true positives in the model prediction. The formula involved in Precision is:

[0084]

[0085] In the above formula, TP refers to true positive examples and FP refers to false positive examples.

[0086] Recall: refers to the proportion of actual positive examples that are correctly predicted as positive examples during the prediction process. The formula involved in Recall is:

[0087]

[0088] In the above formula, FN is a false counterexample.

[0089] From the data in the above table, we can conclude that after adding the focused linear attention mechanism to the backbone network of the original Yolov8 and adding the context feature calibration CFC module and the spatial feature calibration SFC module to the feature fusion pyramid, mAP0.5 increased by 1.7%, Precision increased by 3.6%, and Recall increased by 0.1% compared with the original Yolov8. The data results show that the combination of the improvements of the present invention is helpful to the improvement of the model.

[0090] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the present invention.

Claims

1. A foggy vehicle detection method adding CFLA and CSFC: characterized by: The method comprises the steps of: Step 1: Obtain relevant labeled foggy samples from the foggy vehicle dataset, wherein the samples include images of foggy parts and images of non-foggy parts; Step 2: Build an improved YOLOV8 detection network: including improving the backbone network, improving the feature fusion pyramid, and decoupling the detection head; The improved backbone network is to add a focused linear attention mechanism to the standard backbone network; The improved feature fusion pyramid is to add a context feature calibration CFC module and a spatial feature calibration SFC module to the standard feature fusion pyramid; Step 3: Use the foggy vehicle dataset to train the improved YOLOV8 detection network to obtain a foggy vehicle detection model; Step 4: Detect vehicles in foggy weather using the foggy weather vehicle detection model; Step 5: Mark the vehicle and pedestrian sections in foggy conditions.

2. A foggy vehicle detection method adding CFLA and CSFC according to claim 1, characterized in that: The images in the foggy vehicle dataset include pedestrians, cars, buses, motorcycles, and bicycles.

3. A foggy vehicle detection method adding CFLA and CSFC according to claim 1, characterized in that: The improved backbone network described in step 2 is to add a focused linear attention mechanism to the standard backbone network, which is achieved through the following steps: Step 2.1: Generate Query, Key, and Value from the input features through linear projection; Step 2.2: Divide the query and key into multiple local windows; Step 2.3: Apply convolution operation to the Value feature to extract local enhancement information; at the same time, introduce position encoding into Query and Key; Step 2.4: Calculate the dot product of Query and Key to get the attention weight, and then multiply the weight by Value to get the final attention result; Step 2.5: Introduce depthwise separable convolution to process the feature map and combine it with the global attention mechanism; Step 2.6: Through reshaping and concatenation operations, the local window features are mapped back to the original feature map space, and the feature map maintains the same dimension and structure as the original input.

4. A foggy vehicle detection method adding CFLA and CSFC according to claim 1 or 3, characterized in that: The standard backbone network is provided with a C2f-Focused Linear Attention module, and the formula of the C2f-Focused Linear Attention module is as follows: Sim(Q i ,K j )=φ p (Q i )φ p (K j ) T O=φ(Q)φ(K) T V+DWC(V) In the above formula, Sim(.,.) represents the similarity function, Q i ,K j Represents the Query vector and Key vector, φ p (Q i ),φ p (K j ) represent Q i ,K j Apply the transformation function φ p The new vector after p (K j ) T Yes p (K j ), O represents the output after adding the deep convolution module (DWC) to the attention matrix, φ(Q)φ(K) represents the query matrix and key matrix respectively, φ(Q)φ(K) T denote the transpose of the query matrix and the key matrix respectively, V denotes the value matrix, i.e., the weighted sum of the feature representations of each input position, and DWC(.) denotes depthwise convolution.

5. A foggy vehicle detection method adding CFLA and CSFC according to claim 4, characterized in that: The focused linear attention mechanism is added to the standard backbone network. The specific operation method is as follows: first, a mapping function is constructed to simulate the distribution characteristics of the original Softmax attention weights that are mainly concentrated on a few important elements; on this basis, a simple deconvolution technique is used to restore the diversity of features; the module is expressed by the formula: O=Sim(Q,K)V=φ p (Q)φ p (K) T +DWC(V) Among them, O represents the output after adding the deep convolution module (DWC) to the attention matrix, Sim(.,.) represents the similarity function, Q, K represent the query vector and key vector respectively, φ p (Q)φ p (K) represent the query matrix and key matrix respectively, φ p (Q)φ p (K) T denote the transpose of the query matrix and the key matrix respectively, V denotes the value matrix, i.e., the weighted sum of the feature representations of each input position, and DWC(.) denotes depthwise convolution.

6. A foggy vehicle detection method adding CFLA and CSFC according to claim 1, characterized in that: The context feature calibration CFC module added to the standard feature fusion pyramid described in step 2 has specific operation steps including: the context feature calibration CFC module first performs a dimensionality reduction operation on the input to reduce the number of input channels by half, and then generates query and key features through convolution; then calculates the similarity through matrix multiplication to generate a weight coefficient; then performs a softmax operation on the weight coefficient to normalize it and finally obtain a probability distribution; then generates context features by performing matrix multiplication on the weight coefficient and value; then applies a local attention mechanism to weight the result to adjust the importance of different positions in the context features; finally, adds the weighted context features and the input to generate the final output.

7. A foggy vehicle detection method adding CFLA and CSFC according to claim 1 or 6, characterized in that: The formula of the context feature calibration CFC module is as follows: Among them, x i Represents input, y i represents the output, α i represents the recalibration factor, z j represents the background information or auxiliary information used to calculate the similarity and further adjust the input features, f(·) represents the value of the affinity between the calculated features, and M represents the number of context feature sets extracted from the feature map and used for each pixel classification.

8. The method for detecting vehicles in foggy weather by adding CFLA and CSFC according to claim 1, characterized in that: The spatial feature calibration SFC module added to the standard feature fusion pyramid described in step 2 has the following specific operation steps: the spatial feature calibration SFC module accepts two inputs and obtains the batch size and the height and width of the output, which will be used for alignment in subsequent operations and generate the required offsets and grid coordinates; by processing the fine-grained feature map and using bilinear interpolation to resize it to the size of the coarse-grained feature map, so that they can be effectively fused and aligned in subsequent steps; using a convolutional layer to process the coarse-grained feature map, and then splicing the coarse-grained feature map and the fine-grained feature map, the spliced ​​tensor is processed by a convolution block to generate offsets for spatial transformation; these offsets are used for subsequent feature feature alignment and enhancement operations; then resize the dimensions so that each group has its own independent channels and spatial features; extract horizontal and vertical offsets, and then generate standardized grid coordinates for offset operations; combined with the offsets, these coordinates will be used to dynamically adjust the feature map in space to ensure that the feature map can be translated and transformed according to the offsets; adjust the standardized grid coordinates by the offset to generate a new resolution; adjust the feature map by sampling the coarse-grained feature map and the fine-grained feature map, and apply the offset grid to adjust the feature map; then use the attention weights to weightedly fuse the coarse-grained feature map and the fine-grained feature map, weighted sum the low-resolution and high-resolution features, and finally return the fused features.

9. A foggy vehicle detection method adding CFLA and CSFC according to claim 1 or 8, characterized in that: The formula of the spatial feature calibration SFC module is as follows: Where L represents the output of the SFC module; β l represents the weight factor of the low-frequency component, adjusting the contribution of the low-frequency component; T(·) represents the calibration function; u(·) represents the bilinear upsampling function; W l Represents the weight matrix corresponding to the low-frequency component features, used for feature transformation; F l represents low-resolution features; β h Represents the weight factor of the high-frequency component and adjusts the contribution of the high-frequency component; Represents the weight matrix corresponding to the high-frequency component features, which is used for feature transformation; represents high-resolution features; Δ l , Represents two sets of offset maps.