Improved YOLOv8 network structure method for improving vehicle and pedestrian target segmentation precision in haze scene
By improving the YOLOv8 network structure and introducing multi-scale hole convolution and attention mechanism, the problem of insufficient segmentation accuracy of vehicles and pedestrians in hazy environments is solved, and high-precision segmentation and improved robustness are achieved under hazy conditions.
Patent Information
- Application Number
- CN202510678746.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-23
AI Technical Summary
The existing YOLOv8 model has the problem of decreased detection and segmentation accuracy in foggy and hazy scenes, while the accuracy of vehicle and pedestrian segmentation is improved. The existing technology is difficult to use in severe weather conditions such as fog, where image quality degradation leads to a significant decrease in model segmentation accuracy, making it difficult to meet the requirements for target detection and segmentation accuracy in actual scenes.
The YOLOv8 network structure is improved by introducing a perception enhancement module with multi-scale dilated convolution and attention mechanism, a lightweight feature extraction module that integrates contextual information and channel attention, and a feature fusion module that enhances the low-level semantic expression capability, thereby improving the model's pixel-level segmentation performance in hazy environments.
While maintaining real-time performance and lightweight model, the segmentation accuracy and robustness of vehicles and pedestrians in hazy environments are significantly improved, and the feature extraction capability and target boundary perception capability are enhanced.
Smart Images

Figure CN120689876A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to an improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian segmentation in haze scenes. Background Art
[0002] With the rapid development of autonomous driving, intelligent transportation, and urban security, the accuracy and robustness of object segmentation technology in complex environments have become a research hotspot. YOLOv8, a next-generation end-to-end real-time object detection and segmentation model, performs well in conventional environments. However, in adverse weather conditions such as haze, image quality degrades and contrast decreases, significantly reducing the model's segmentation accuracy, making it difficult to meet the target detection and segmentation accuracy requirements in real-world scenarios.
[0003] Current research focuses on object detection. Existing methods can detect vehicles and pedestrians in foggy and smoggy conditions (i.e., obtaining the bounding rectangle of the target), but detection results alone cannot provide detailed boundary information. In tasks such as autonomous driving and intelligent inspection, pixel-level segmentation information is more valuable for path planning, collision warning, and scene understanding. For example, segmentation results can be used to more accurately identify the true outline of an object, especially in foggy and smoggy scenes where the target boundary is blurred or severely obscured, providing greater robustness and reliability.
[0004] On the other hand, existing methods focus primarily on image preprocessing, such as image enhancement and dehazing, but pay insufficient attention to how the model structure itself can adapt to perception tasks in hazy scenes. In particular, within segmentation networks, enhancing feature extraction, boundary perception, and multi-scale perception capabilities while maintaining real-time performance and model lightweightness remains a challenge and a gap in current research.
[0005] Therefore, a new segmentation model design method based on the network structure level and oriented to low-visibility scenes such as haze is urgently needed to improve the segmentation accuracy and robustness of vehicles and pedestrians under complex conditions such as blur and occlusion. To this end, this paper proposes a method to improve the YOLOv8 network structure. The design introduces a perception enhancement module that combines multi-scale dilated convolution and attention mechanism, a lightweight feature extraction module that integrates contextual information and channel attention, and a feature fusion module that enhances the low-level semantic expression ability. This method comprehensively improves the pixel-level segmentation performance of the model in haze environments, which has important research and engineering application value. Summary of the Invention
[0006] The purpose of this invention is to provide an improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes, so as to improve the model's feature extraction ability and target boundary perception ability in haze scenes, thereby improving the segmentation accuracy and robustness.
[0007] To achieve the above objectives, the present invention proposes an improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes, comprising the following steps:
[0008] The Foggy Cityscapes dataset was used to preprocess the target image dataset containing haze scenes, converting it into YOLO format labels and dividing it into training, validation, and test sets.
[0009] Improve the YOLOv8 backbone network by replacing the standard convolutional layer (Conv) with the HDConv2 module to enhance feature extraction capabilities;
[0010] Replace the spatial pyramid pooling structure SPPF in YOLOv8 with the DSCBlock module;
[0011] Insert the FogC2f module between the 0th and 1st layers of the YOLOv8 backbone network to build an improved object segmentation model;
[0012] The improved YOLOv8 target segmentation model is trained using the training set;
[0013] The validation set is input into the optimal model, the target segmentation results are output and performance evaluation is performed.
[0014] Optionally, preprocess the target image dataset containing foggy scenes, convert it into YOLO-format labels, and divide it into training, validation, and test sets. Specifically, convert the JSON-format label file of the Foggy Cityscapes dataset into the txt-format label file required by YOLOv8, and divide the Foggy Cityscapes dataset into training, validation, and test sets according to a 7:2:1 ratio.
[0015] Preferably, the HDConv2 module includes:
[0016] A multi-scale dilated convolution unit, which includes multiple convolution modules with different dilation rates, each of which is composed of a dilated convolution layer, a batch normalization layer, and a SiLU activation function layer connected in sequence;
[0017] an adaptive expansion rate prediction unit, connected to the multi-scale dilation convolution unit, for adaptively adjusting the expansion rate according to different features of the image;
[0018] 1 SEBlock attention mechanism module, which is connected to the multi-scale dilated convolution unit and performs channel attention weighting on the output features of the multi-scale dilated convolution unit;
[0019] 1 lightweight Transformer module, the Transformer module and the SEBlock attention mechanism module are set in series;
[0020] 1 feature fusion unit, which includes 1 1x1 convolution layer, 1 batch normalization layer, 1 SiLU activation function layer and 1 Dropout layer. The feature fusion unit is used to fuse the output features of the multi-scale void convolution unit, the SEBlock attention mechanism module and the Transformer module.
[0021] Preferably, the DSCBlock module includes:
[0022] 1 input convolution unit, wherein the input convolution unit includes 2 1×1 convolution layers;
[0023] A multi-scale dilated convolution unit, comprising three 3×3 convolutional layers with different dilation rates;
[0024] A feature fusion unit, wherein the feature fusion unit includes a 1×1 convolution layer, and the feature fusion unit is connected to the multi-scale dilated convolution unit;
[0025] 1 attention mechanism module, the attention mechanism module adopts a CBAM structure, and the attention mechanism module is connected to the feature fusion unit;
[0026] 1 output convolution unit, where the output convolution unit includes 1 1×1 convolution layer, and the output convolution unit is connected to the attention mechanism module.
[0027] Preferably, the FogC2f module includes:
[0028] 1 input convolution unit, the feature input convolution unit includes 1 1x1 convolution layer, 1 batch normalization layer and 1 SiLU activation function layer;
[0029] 1 boundary enhancement branch, which includes 1 3x3 convolution layer, 1 batch normalization layer and 1 SiLU activation function layer;
[0030] A multi-scale feature extraction unit, comprising multiple FogBottleneck modules, each of which is composed of a depthwise separable convolution layer, a pointwise convolution layer, a batch normalization layer, and a SiLU activation function layer;
[0031] 1 lightweight Transformer module for modeling long-range contextual dependencies;
[0032] 1 adaptive feature fusion unit, wherein the adaptive feature fusion unit includes 1 adaptive average pooling layer, 1 flattening layer, 1 fully connected layer and 1 softmax activation function layer;
[0033] 1 output convolution unit, the output convolution unit includes 1 1x1 convolution layer, 1 batch normalization layer and 1 SiLU activation function layer;
[0034] A FogC2f module is inserted between the 0th and 1st layers of the backbone network. The FogC2f module includes a lightweight global attention mechanism, a boundary enhancement branch, an efficient convolution structure, an adaptive feature fusion unit, and a boundary-guided feature processing module. The module is used to enhance the context modeling capability, edge texture extraction capability, and boundary feature expression capability in shallow features.
[0035] This paper proposes an improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian segmentation in haze scenarios. This method aims to address the existing model's weak feature extraction capabilities and the easy loss of low-level detail information under complex climatic conditions such as haze. The proposed method uses the HDConv2 module, which incorporates adaptive dilation rate prediction, the SE channel attention mechanism, and a lightweight Transformer architecture, to enhance the model's capabilities in multi-scale feature extraction and long-range dependency modeling. A FogC2f module, combining the FogBottleneck structure, the SE attention mechanism, and the lightweight Transformer architecture, is designed to enhance the model's ability to discriminate low-contrast images. Furthermore, by replacing the SPPF module in the original YOLOv8 with the DSCBlock module, which integrates multi-scale dilated convolution and the CBAM attention mechanism, the model's spatial information modeling capabilities in complex scenarios are further enhanced. This method provides a feasible technical path and structural improvement solution for improving target segmentation accuracy in haze environments without significantly increasing model complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 This is a flow chart of an improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes of the present invention;
[0038] Figure 2 This is a schematic diagram of the original network structure of YOLOv8;
[0039] Figure 3 It is the Backbone diagram of the improved YOLOv8 of the present invention;
[0040] Figure 4 This is a schematic diagram of the network structure of HDConv2;
[0041] Figure 5 This is a schematic diagram of the network structure of the adaptive expansion rate prediction module;
[0042] Figure 6 This is a schematic diagram of the network structure of SEBlock channel attention;
[0043] Figure 7 This is a schematic diagram of the network structure of the ContextualTransformer module;
[0044] Figure 8 This is a schematic diagram of the DSCBlock network structure;
[0045] Figure 9 This is a schematic diagram of the network structure of CBAM attention;
[0046] Figure 10 This is a schematic diagram of the network structure of FogC2f;
[0047] Figure 11 This is a schematic diagram of the network structure of FogBottleneck;
[0048] Figure 12 This is a schematic diagram of the network structure of the lightweight Transformer module;
[0049] Figure 13 It is a schematic diagram of the network structure of adaptive fusion weights. DETAILED DESCRIPTION
[0050] In order to more clearly describe the technical solution of the present invention, the structural design and working principle of the improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes proposed by the present invention are described below with reference to the accompanying drawings and examples. It should be understood that the following content is only one or more optional implementation methods of the present invention and is not a limitation of the present invention. Any technical variation or replacement made by a person of ordinary skill in the art based on the contents of this specification without creative work should be included in the scope of protection of the present invention.
[0051] See also Figure 1 The present invention provides an improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes, comprising the following steps:
[0052] The Foggy Cityscapes dataset was used to preprocess the target image dataset containing haze scenes, converting it into YOLO format labels and dividing it into training, validation, and test sets.
[0053] Improve the YOLOv8 backbone network by replacing the standard convolutional layer (Conv) with the HDConv2 module to enhance feature extraction capabilities;
[0054] Replace the spatial pyramid pooling structure SPPF in YOLOv8 with the DSCBlock module;
[0055] Insert the FogC2f module between the 0th and 1st layers of the YOLOv8 backbone network to build an improved object segmentation model;
[0056] The improved YOLOv8 target segmentation model is trained using the training set;
[0057] The validation set is input into the optimal model, the target segmentation results are output and performance evaluation is performed.
[0058] The present invention is further described below in conjunction with specific implementation steps and the YOLOv8 network structure adjustment principle:
[0059] This example uses the Foggy Cityscapes dataset as the training dataset for foggy scene images. This dataset, developed by the Swiss Federal Institute of Technology (ETH Zurich), is based on the Cityscapes dataset. It uses a physical model to simulate real-world foggy conditions. By adding synthetic fog of varying concentrations to the original Cityscapes images, realistic foggy street scene images are generated.
[0060] The Foggy Cityscapes dataset contains 8,975 images covering road traffic scenes in multiple cities and varying weather conditions. The image resolution is 2048 × 1024, and the dataset retains the object information and annotations from the original images. In this implementation, only vehicle and pedestrian objects closely related to traffic safety are selected from the dataset. Car, truck, and bus are categorized as "car," while person and rider are categorized as "person." Given the different label formats required by the YOLOv8 network, the original annotation files are converted from the JSON format provided in the Cityscapes dataset to the txt format supported by YOLOv8. During the conversion, the category and bounding box information are kept consistent to ensure training accuracy.
[0061] After conversion, the Foggy Cityscapes dataset was partitioned into training, validation, and test sets based on training requirements. The training set accounted for 70%, the validation set for 20%, and the test set for 10%. The training set now contains 6,282 images, the validation set for 1,795, and the test set for 898. All images were resized to 640×640 before model training. Data augmentation, such as brightness perturbation, contrast adjustment, and random flipping, was performed according to the model training strategy to enhance model robustness and generalization.
[0062] After completing the data set preparation, we will proceed to the step of improving the YOLOv8 model structure. As the current advanced single-stage target detection network, YOLOv8 has end-to-end detection efficiency and excellent feature extraction capabilities. The original network structure of YOLOv8 is as follows Figure 2 As shown in the figure, the network can be divided into the backbone, neck, and head. The backbone network's main task is to extract features from the input image and transform the image into a feature representation with rich semantic information. The neck network's role is to fuse feature maps from different stages of the backbone network to enhance feature representation capabilities. The head network is responsible for object classification and localization based on the fused feature maps provided by the neck network.
[0063] The present invention improves Backbone based on the original network structure of YOLOv8. Figure 3 As shown, in order to better adapt to the detection and segmentation needs of targets in haze environments,
[0064] The backbone network includes 4 Conv modules, 1 HDConv2 module, 4 C2f modules, 1 DSCBlock module and 1 FogC2f module. Among them, the Conv module consists of a convolution layer, a BatchNorm normalization layer and a SiLU activation function, and is mainly used for basic feature extraction. The HDConv2 module includes multi-scale dilated convolution, which integrates an adaptive expansion rate prediction mechanism, an SE channel attention mechanism and a lightweight Transformer architecture to enhance the model's feature perception capabilities at different scales and improve the fusion of multi-scale contextual information and long-range dependency modeling capabilities. The C2f module consists of two Conv modules and a Bottleneck module, which is used to further extract and compress features. The DSCBlock module includes four standard convolution modules, three dilated convolution modules of different scales and an attention mechanism module, aiming to improve the feature expression capabilities under complex backgrounds and haze interference. The FogC2f module consists of two 1×1 convolutional modules for initial feature conversion, a local feature enhancement branch consisting of multiple FogBottlenecks, a lightweight Transformer module for modeling long-range dependencies, and a weight branch for adaptive fusion. Finally, 1×1 convolutions are used to fuse and activate multi-branch features, effectively improving object perception in complex scenarios such as fog.
[0065] In the improved YOLOv8 backbone network proposed in this invention, part of the original standard convolution (Conv) is replaced by the custom module HDConv2 (Hybrid Dilated Convolution 2) designed by this invention. Its structure is as follows Figure 4 Specifically, the HDConv2 module first applies an adaptive expansion rate prediction module to the input feature map, as shown in Figure 5 As shown in the figure, the dilation rate of the dilated convolution is dynamically adjusted according to the different requirements of the input features. Subsequently, dilated convolution operations with multiple dilation rates are applied to extract contextual information of different scales through convolution kernels with different dilation rates. After the dilated convolution, the SEBlock channel attention mechanism is connected, as shown in the figure. Figure 6 As shown in , we further explore the dependencies between channels and enhance the expressive power of salient features. Next, the module introduces the ContextualTransformer module, as shown in Figure 7As shown in the figure, by modeling long-range dependencies and global contextual information, the spatial perception of features is enhanced. Finally, a 1×1 convolution operation is performed on the fused feature map to reduce its dimensionality, thereby achieving efficient information integration and transmission. This module replaces the standard convolutional structure of the original backbone network layer 0. While maintaining low parameter complexity, it significantly improves the model's ability to express and perceive target features in complex scenarios (such as haze weather), providing strong support for subsequent improvements in object detection and segmentation performance.
[0066] In the YOLOv8 improved backbone network proposed in this paper, the original SPPF (Spatial Pyramid Pooling-Fast) module is replaced by a custom-designed DSCBlock (Dilated SPP-CSP Block) module, whose structure is as follows: Figure 8 shown.
[0067] Specifically, the DSCBlock module adopts a dual-path structure input, and performs preliminary transformation on the input feature map through two 1×1 convolutions (cv1 and cv2). One main path (cv1) is connected to the multi-scale hole convolution operation, and the other path (cv2) participates in the subsequent feature fusion as a residual branch. In the main path, the input features are successively subjected to three 3×3 hole convolutions (d1, d2, d3) with different dilation rates (dilation∈{1,2,1}) to mine contextual information under different receptive fields, thereby enhancing the multi-scale semantic expression ability. Then, the three hole convolution results are spliced (cat) together with the features after the initial transformation in the channel dimension, and preliminarily fused through 1×1 convolution. In order to further improve the discriminative ability of features, the CBAM (Convolutional Block Attention Module) attention mechanism is introduced, such as Figure 9 As shown in the figure, the fused features are weighted in both channel and spatial dimensions to enhance the response expression of key areas. Subsequently, the enhanced features of the main path are concatenated with the output of the residual path (cv2), and the fused feature map is output through the final 1×1 convolution (cv_out), completing information integration and channel matching.
[0068] While maintaining manageable computational overhead, the DSCBlock module enhances the multi-scale and attention capabilities of feature extraction through the collaborative design of dilated convolution and attention mechanisms. By replacing the SPPF module in the original backbone network, it provides more robust semantic support for object detection and segmentation tasks in complex scenarios.
[0069] In the improved YOLOv8 backbone network of the present invention, a custom designed FogC2f module is inserted between the 0th layer and the 1st layer to enhance the fusion and representation capabilities of the convolutional features and further improve the adaptability of the model to haze scenes. Figure 10 shown.
[0070] First, the input feature map is transformed through a 1×1 convolution (conv1) for channel number conversion, and then processed by BatchNorm and SiLU activation functions to obtain the feature map after preliminary conversion. Next, the feature map output by the first convolution module (conv1) is copied. Then, the copied feature map is transformed through another 1×1 convolution (conv2) for channel conversion, and processed by BatchNorm and SiLU activation functions to obtain the second set of feature maps. The feature map output by the first convolution module is processed by the FogBottleneck layer, as shown in the following figure. Figure 11 As shown in Figure 2. FogBottleneck is composed of a combination of depthwise separable convolution and pointwise convolution to further extract key local features in a hazy environment. The feature map processed by FogBottleneck is input into the lightweight Transformer module, as shown in Figure 2. Figure 12 As shown in , it is used to model global context information and capture long-distance dependencies, thereby further improving feature expression capabilities. After completing the Transformer module processing, the feature map copied by the first convolution module is combined to perform feature fusion. By calculating the adaptive fusion weight (using adaptive average pooling, flattening layer and linear layer, and obtaining the fusion weight through the Softmax activation function), the two parts of the feature map are weighted, as shown in Figure 13 As shown in the figure, this ensures the effective combination of low-level and high-level features. The weighted feature map and the copied feature map are concatenated along the channel dimension using the concat operation, then fused using a 1×1 convolution (conv_fusion). Finally, the fused feature map is output using the BatchNorm and SiLU activation functions to complete the information integration.
[0071] The improved YOLOv8 object segmentation model is trained using the training set.
[0072] Furthermore, a Conda virtual environment running Python 3.8 was created, and the deep learning framework PyTorch (version torch-1.13.1+cu117) was installed. The experimental platform used an NVIDIA GeForce RTX 3090 GPU. Using a unified training configuration, the number of training rounds was set to 300, the input image size was 640×640, the batch size was 64, the SGD optimizer was used, the initial learning rate was set to 0.0005, a warmup learning rate adjustment strategy was adopted, and the Mosaic data augmentation strategy was applied to improve training performance. The training set was then used to train the object detection and segmentation model using the improved YOLOv8 network architecture. After training, a model for detecting and segmenting vehicles and pedestrians in haze scenarios was obtained, and the validation set was input into this model for verification.
[0073] The specific detection and performance evaluation process is as follows.
[0074] Using the mean average precision (mAP), the experiment uses four indicators: mean average precision (mAP@0.5), parameter quantity (Parameters) and model size (Size) to evaluate the model performance. Among them, mAP@0.5 represents the average value of the average precision of each category when the IoU threshold is 0.5, which is used to measure the detection accuracy. mAP is closely related to precision (Precision) and recall (Recall). The former is the proportion of positive samples predicted as positive, and the latter is the proportion of correct predictions in actual positive samples. Precision refers to the proportion of correctly predicted positive (TP) to all predicted positive (TP+FP). The calculation formula is shown in formula (1):
[0075]
[0076] The recall rate refers to the ratio of correctly predicted positive (TP) to actual positive (TP+FN), and is calculated as shown in formula (2):
[0077]
[0078] mAP (mean Average Precision) is the average precision calculated at different recall thresholds, which summarizes the model's detection capabilities at different decision thresholds. In this experiment, we primarily use mAP@0.5 as the detection accuracy evaluation metric, setting the IoU threshold to 0.5 and calculating the average precision across all categories.
[0079] Experimental Setup and Results
[0080] This study first conducted performance verification experiments on the designed HDConv2 and FogC2f modules and integrated them into the backbone network of the YOLOv8 segmentation model to improve the accuracy of vehicle and pedestrian segmentation in hazy scenes. The training and validation data used in the experiment were both from the Foggy Cityscapes dataset, with images of a uniform size of 640×640. The number of training epochs was set to 300, and the SGD optimizer was used with an initial learning rate of 0.0005.
[0081] To validate the effectiveness of this invention, we conducted ablation experiments comparing the performance of the original YOLOv8 segmentation model with that of the model incorporating the improved modules. The currently completed implementation includes comparative experiments incorporating the HDConv2 module and the FogC2f module. The experimental results show that the introduction of the HDConv2 and FogC2f modules significantly enhances feature extraction capabilities. The relevant experimental results are shown in Table 1.
[0082] Table 1: Module performance comparison test results
[0083] Detection mAP@0.5 Segmentation mAP@50 Parameter quantity Model size (MB) YOLOv8n-seg 0.631 0.476 3258454 6.8 YOLOv8n-seg+HDConv2 0.731 0.593 3261254 6.9 YOLOv8n-seg+FogC2f 0.731 0.588 3260188 6.9
[0084] As shown in Table 1, with only the HDConv2 module, the optimized model achieves significant improvements in both segmentation and detection performance while maintaining its lightweight nature. Specifically, detection mAP@0.5 increases by 15.8%, and segmentation mAP@50 increases by 24.6%, while the number of parameters increases by only 0.09% and the model size increases by 0.1MB. This achieves a good balance between performance improvement and computational overhead, validating the effectiveness of the HDConv2 module in complex scenarios.
[0085] Similarly, the model that introduced the FogC2f module also showed similar performance improvements. The above results further demonstrate that the HDConv2 module and the FogC2f module proposed in this paper have significant advantages in improving target detection and segmentation performance, and are particularly suitable for target detection and segmentation tasks under low visibility conditions such as haze.
[0086] The DSCBlock module will be further verified in the future to further improve the adaptability and robustness of the model in complex environments.
[0087] These results demonstrate that the proposed HDConv module has the advantage of enhanced feature extraction capabilities, making it particularly suitable for object detection and segmentation tasks in low-visibility conditions such as haze. Future work will continue to validate the DSCBlock module to further improve the model's adaptability and robustness in complex environments.
[0088] In summary, the present invention has the following beneficial effects:
[0089] 1. To address the issue of decreased vehicle and pedestrian detection and segmentation accuracy in foggy and hazy weather, the HDConv2 module was proposed. Combining adaptive dilation rate prediction, the SE channel attention mechanism, and the ContextualTransformer module, it replaces some Conv layers and enhances the model's feature perception and context modeling capabilities in complex environments, effectively improving object detection and segmentation performance.
[0090] 2. Furthermore, the proposed FogC2f module combines the FogBottleneck structure, SE attention mechanism and lightweight Transformer architecture, and inserts FogC2f between the 0th and 1st layers of the backbone network, which effectively enhances the model's discrimination ability in low-contrast and complex backgrounds, while optimizing the fusion of multi-scale features and improving target detection and segmentation accuracy, especially in adverse weather conditions such as haze.
[0091] 3. This module barely increases model complexity. While maintaining the same number of parameters and model size, it significantly improves both detection and segmentation mAP, balancing accuracy and lightweight requirements.
[0092] 4. The proposed structure has good modularity and portability, and can be embedded in mainstream target detection frameworks such as YOLOv8. It is suitable for edge device deployment and intelligent perception tasks in complex weather environments.
[0093] The above disclosure is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. An improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes, characterized by: The Foggy Cityscapes dataset was used to preprocess the target image dataset containing haze scenes, converting it into YOLO format labels and dividing it into training, validation, and test sets. Improve the YOLOv8 backbone network by replacing the standard convolutional layer (Conv) with the HDConv2 module to enhance feature extraction capabilities; Replace the spatial pyramid pooling structure SPPF in YOLOv8 with the DSCBlock module; Insert the FogC2f module between the 0th and 1st layers of the YOLOv8 backbone network to build an improved object segmentation model; The improved YOLOv8 target segmentation model is trained using the training set; The validation set is input into the optimal model, the target segmentation results are output and performance evaluation is performed.
2. The improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes according to claim 1 is characterized in that: Preprocess the target image dataset containing haze scenes, convert it into YOLO format labels, and divide it into training, validation, and test sets. Specifically, convert the JSON format label file of the Foggy Cityscapes dataset into the txt format label file required by YOLOv8, and divide the Foggy Cityscapes dataset into training, validation, and test sets according to a 7:2:1 ratio.
3. The improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes according to claim 2 is characterized in that: The HDConv2 module includes: A multi-scale dilated convolution unit, which includes multiple convolution modules with different dilation rates, each of which is composed of a dilated convolution layer, a batch normalization layer, and a SiLU activation function layer connected in sequence; an adaptive expansion rate prediction unit, connected to the multi-scale dilation convolution unit, for adaptively adjusting the expansion rate according to different features of the image; 1 SEBlock attention mechanism module, which is connected to the multi-scale dilated convolution unit and performs channel attention weighting on the output features of the multi-scale dilated convolution unit; A lightweight Transformer module, which is set in series with the SEBlock attention mechanism module; 1 feature fusion unit, which includes 1 1x1 convolution layer, 1 batch normalization layer, 1 SiLU activation function layer and 1 Dropout layer. The feature fusion unit is used to fuse the output features of the multi-scale void convolution unit, the SEBlock attention mechanism module and the Transformer module.
4. The improved YOLOv8 network structure method for improving the accuracy of vehicle and pedestrian target segmentation in haze scenes according to claim 3 is characterized in that: The DSCBlock module includes: 1 input convolution unit, wherein the input convolution unit includes 2 1×1 convolution layers; A multi-scale dilated convolution unit, comprising three 3×3 convolutional layers with different dilation rates; A feature fusion unit, wherein the feature fusion unit includes a 1×1 convolution layer, and the feature fusion unit is connected to the multi-scale dilated convolution unit; 1 attention mechanism module, the attention mechanism module adopts a CBAM structure, and the attention mechanism module is connected to the feature fusion unit; 1 output convolution unit, where the output convolution unit includes 1 1×1 convolution layer, and the output convolution unit is connected to the attention mechanism module.
5. The method for improving target segmentation accuracy in haze scenes based on improved YOLOv8 according to claim 4, characterized in that: The FogC2f module includes: 1 input convolution unit, the feature input convolution unit includes 1 1x1 convolution layer, 1 batch normalization layer and 1 SiLU activation function layer; 1 boundary enhancement branch, which includes 1 3x3 convolution layer, 1 batch normalization layer and 1 SiLU activation function layer; A multi-scale feature extraction unit, comprising multiple FogBottleneck modules, each of which is composed of a depthwise separable convolution layer, a pointwise convolution layer, a batch normalization layer, and a SiLU activation function layer; 1 lightweight Transformer module for modeling long-range contextual dependencies; 1 adaptive feature fusion unit, wherein the adaptive feature fusion unit includes 1 adaptive average pooling layer, 1 flattening layer, 1 fully connected layer and 1 softmax activation function layer; 1 output convolution unit, where the output convolution unit includes 1 1x1 convolution layer, 1 batch normalization layer, and 1 SiLU activation function layer. A FogC2f module is inserted between the 0th and 1st layers of the backbone network. The FogC2f module includes a lightweight global attention mechanism, a boundary enhancement branch, an efficient convolution structure, an adaptive feature fusion unit, and a boundary-guided feature processing module. The module is used to enhance the context modeling capability, edge texture extraction capability, and boundary feature expression capability in shallow features.