A vehicle target detection method based on OMCR-YOLO network
By introducing a full-core network, deformable convolution, CRR module and residual depth convolution attention head into the vehicle object detection algorithm, the problem of difficult to take into account in both detection accuracy and real-time in low-light environments is solved, and efficient vehicle object detection is achieved.
Patent Information
- Application Number
- CN202411760458.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing vehicle object detection algorithms are difficult to take into account both detection accuracy and real-time in low-light environments, especially in the dark environment and target occlusion, which is prone to missed detection.
The vehicle object detection method based on the OMCR-YOLO network is adopted. By introducing a full-core network at the front end of the model, the light interference is reduced and the characteristic response of the bright and dark areas is balanced; the downsampled convolution is replaced with a deformable convolution enhancement module to enhance the model's adaptability to image geometric transformation; the C2f module in the backbone network is replaced with a CRR module to dynamically adjust the receptive field; the original detection head is replaced with a residual depth convolution attention head to reduce the parameter amount and improve the detection accuracy.
It improves the accuracy and robustness of vehicle target detection, reduces the probability of missing detection in the dark environment and target occlusion, and achieves a balance between detection accuracy and real-time.
Smart Images

Figure CN119229099B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and to technologies such as image processing, deep learning, and target detection and recognition, and is specifically manifested in a vehicle target detection method based on an OMCR-YOLO network. Background Art
[0002] With the rapid development of autonomous driving technology and intelligent transportation systems, autonomous vehicles have gradually become the focus of attention of scholars from all walks of life. Autonomous driving vehicles are the product of the deep integration of the automotive industry with artificial intelligence, the Internet of Things, big data and other technologies. They play an important role in improving driving safety, driving comfort and traffic efficiency. In the process of autonomous driving, vehicles need to be able to perceive and understand their surrounding environment in real time to make correct decisions. In order to ensure the safety of autonomous driving vehicles, the system must have the ability to identify key information such as pedestrians, other vehicles, traffic signs and road conditions. This requires a set of accurate and efficient target detection technologies. Among them, vehicle target detection, as the core of the autonomous driving perception system, directly affects the vehicle's driving safety and intelligent decision-making ability. Vehicle target detection technology uses sensors such as cameras and radars to identify surrounding vehicle information in real time and provide location information and motion trajectories. Whether it is dealing with congested sections in urban traffic or maintaining vehicle distance on highways, vehicle target detection provides reliable data support for autonomous driving systems. Therefore, how to improve the accuracy and robustness of vehicle target detection has become a key link in promoting the development of autonomous driving technology.
[0003] Traditional computer vision algorithms often rely on image enhancement techniques, such as histogram equalization and adaptive filtering, when performing vehicle detection. However, due to the limitations of these methods for complex lighting conditions, it is difficult to balance detection accuracy and real-time performance. In recent years, target detection algorithms based on deep learning have shown unprecedented advantages, especially the YOLO (YouOnly Look Once) series of models have achieved significant breakthroughs in real-time performance and accuracy. However, in night scenes, the main problems faced by vehicle detection include uneven lighting, blurred vehicle shape, and reflected light interference. In order to ensure safe driving all day, autonomous vehicles must have the ability to efficiently perceive the surrounding environment under various lighting conditions. To this end, research in recent years has gradually introduced some enhanced networks and feature fusion technologies to further improve the robustness of detection, but this will bring a large number of parameters to the model, resulting in a decrease in the model detection speed and affecting its real-time performance in practical applications. Therefore, it is of great practical significance to develop a vehicle detection algorithm that can achieve a balance between detection accuracy and real-time performance and is suitable for low-light environments such as night. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention proposes a vehicle target detection method based on the OMCR-YOLO network, which can balance the feature responses of bright and dark areas, reduce lighting interference, and enhance feature extraction capability, thereby avoiding the phenomenon of missed vehicle detection and reducing the probability of missed detection events in dark environments and target occlusion. It not only improves the accuracy of feature extraction, but also reduces the number of model parameters, achieving a balance between performance and efficiency.
[0005] In order to solve the above technical problems, the technical solution of the present invention is:
[0006] A vehicle target detection method based on OMCR-YOLO network includes the following steps:
[0007] Step 1: Obtain an open source data set of road traffic, wherein the data set is marked with a category label, a time label, and a weather label;
[0008] Step 2: Configure the model training environment;
[0009] Step 3, construct an OMCR-YOLO network model, wherein the OMCR-YOLO network model uses the YOLOv8 network as the basic network, and the YOLOv8 network includes a backbone network, a neck network and a head network. A full-core network is introduced at the front end of the backbone network, and the C2f module in the backbone network is replaced with a CRR module. The downsampling convolution in the backbone network and the neck network is replaced with a deformable convolution enhancement module, and the original detection head in the head network is replaced with a residual deep convolution attention head;
[0010] Step 4: Load the constructed OMCR-YOLO network model into the configured model training environment, modify the model parameter file, and train and test the acquired data set;
[0011] Step 5: The traffic image data to be detected is used as input, and the trained OMCR-YOLO network model is used to detect vehicle targets.
[0012] Preferably, in step 2, the configured training environment is: cuda11.8, deep learning framework pytorch2.3.0, Intel core i9-13900ks CPU, 128G memory, GPU is NVIDIA GeForce RTX 4090, and video memory is 24G.
[0013] Preferably, in the full-core network, the input image first undergoes a 3×3 convolution for channel adjustment and feature extraction, and then the feature map is downsampled through a three-level residual convolution group, and then the downsampled feature map is processed by a full-core module, and then the feature map is restored to its initial resolution through two groups of 1×1 convolutions, a residual convolution group and a 3×3 convolution; at the same time, a jump connection operation is used to fuse feature information at different levels.
[0014] In the above technical solution, a full-core network is introduced at the front end of the model. This structure processes the input original image, which can balance the feature responses of bright and dark areas, reduce light interference, effectively improve the accuracy of target detection, and avoid missed detection.
[0015] Preferably, in the full-core module, the input feature map is processed by 1×1 convolution, and then processed by 1×1 depth convolution, 31×1 depth convolution, 31×31 depth convolution, 1×31 depth convolution and branch processing consisting of a dual-domain channel attention module and a frequency-based spatial attention module. Finally, the results of the five branch outputs are added to the feature map output by the 1×1 convolution on the input side of the full-core module and then processed by a 1×1 convolution.
[0016] Preferably, the method for performing data enhancement by the deformable convolution enhancement module is expressed as follows:
[0017]
[0018] in, represents the output of deformable convolution, is the learned offset, is the modulation factor, is the position in the output feature map, is each sampling point of the convolution kernel, is the convolution kernel weight, is the sampling window.
[0019] In the above technical solution, the downsampling convolution in the model is replaced with a deformable convolution, which introduces a learnable spatial offset to achieve dynamic adjustment of the receptive field and enhance the adaptability of the convolutional neural network to image geometric transformations. This helps the model better focus on unobstructed areas, thereby improving the accuracy of detecting partially obstructed vehicles.
[0020] Preferably, in the CRR module, a 1×1 convolution is first used to adjust the number of channels of the input feature map to a predetermined value m, and then the input is divided into two branches through a segmentation operation, each of which has a channel number of 0.5m; the first branch is processed by n Bottle2neck_RFAConvs, and each Bottle2neck_RFAConv generates a residual connection with a channel number of 0.5m; the other branch is directly spliced with the feature map processed by Bottle2neck_RFAConv to obtain a feature map with a channel number of (n+2)*0.5m; finally, a 1×1 convolution is used to adjust the number of feature map channels to the output channel number c_out.
[0021] In the above technical solution, the C2f module in the model backbone network is replaced by the CRR module, which replaces Bottleneck in the C2f structure with Bottle2neck, and introduces the receptive field attention convolution in Bottle2neck, so that the convolution can dynamically adjust the receptive field according to the far-field and near-field information to adapt to targets of different scales. At the same time, the Bottle2neck structure reduces the number of parameters to a certain extent by sharing some input features.
[0022] Preferably, the Bottle2neck_RFAConv uses Bottle2neck as a basic structure, and replaces the ordinary convolution responsible for feature extraction in the middle with a receptive field attention convolution.
[0023] Preferably, the specific process expression of the receptive field attention convolution is as follows:
[0024]
[0025]
[0026]
[0027]
[0028] in, Indicates average pooling of the input feature map. Represents deep convolution, generating corresponding weights according to the number of channels; represents the activation function, represents the convolution operation that generates features, Represents batch normalization operation; represents the generated features, represents the generated weight, Represents element-wise multiplication; Represents a convolution operation that adjusts the number of channels so that the number of output channels is the same as the number of input channels. represents a shape transformation operation, represents the weighted feature, Represents the output of the receptive field attention convolution.
[0029] Preferably, the residual deep convolution attention head merges the two parallel 3×3 convolutions in the original detection head into one, and replaces the 3×3 convolution with a lightweight residual deep convolution, and then introduces a hybrid local channel attention mechanism after the residual deep convolution, and then divides it into two paths, adjusts the number of channels through 1×1 two-dimensional convolution, and finally calculates the bounding box loss and classification loss.
[0030] The original detection head of the model is replaced with a residual deep convolution attention head. The detection head first merges two conventional convolutions and replaces the shared convolution with a residual deep convolution. Then, a hybrid local channel attention mechanism is introduced after the residual deep convolution, which not only greatly reduces the number of parameters brought by the detection head to the model, but also combines channel and spatial attention at the local and global levels, thereby improving detection accuracy.
[0031] Preferably, the residual depth convolution adopts depth convolution, and a residual connection is added to the depth convolution.
[0032] Preferably, the training method is: the number of training rounds is 300, and 8 images are input in each round. During the training process, the training log is observed in real time through Wandb, and the weight file is saved after the training is completed.
[0033] The present invention has the following characteristics and beneficial effects:
[0034] By adopting the above technical solution, (1) in order to enhance the original image, the present invention introduces a full-core network at the front end of the model. This structure effectively reduces the illumination interference in the image by enhancing and adjusting the tone of the image, thereby improving the model's feature extraction ability and target detection accuracy. (2) In order to cope with challenges such as target occlusion in a dark environment, the present invention replaces the downsampling convolution in the model with a deformable convolution, which can dynamically adjust the position and shape of the convolution kernel according to the input features. This flexibility enables the model to better adapt to different scenes and object shapes, especially in environments with insufficient light or occlusion, and can improve the adaptability to vehicle shape changes. (3) In order to more effectively understand and process local areas in the image, the present invention replaces the C2f module in the backbone network with a CRR module. This module adaptively adjusts the receptive field so that the model can dynamically determine the scope of the convolution according to the input features, thereby better capturing the feature differences caused by changes in lighting conditions. At the same time, the Bottle2neck structure in the module reduces the number of model parameters to a certain extent by sharing some input features. (4) In order to reduce the number of model parameters, the present invention replaces the original detection head with a residual deep convolution attention head. The detection head reduces the number of model parameters through lightweight deep convolution, and introduces a hybrid local channel attention mechanism to integrate channel information and spatial information, thereby improving detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative labor.
[0036] Figure 1 It is a diagram of the overall model structure of an embodiment of the present invention.
[0037] Figure 2 for Figure 1 Schematic diagram of the network structure of the whole core.
[0038] Figure 3 This is a comparison diagram of the image enhancement effect of an embodiment of the present invention.
[0039] Figure 4 This is a comparison diagram of the thermal map effects of an embodiment of the present invention.
[0040] Figure 5 4 is a comparison chart of the detection effects of the embodiments of the present invention.
[0041] Figure 6 This is a CRR structure diagram of an embodiment of the present invention.
[0042] Figure 7 This is the Bottle2neck_RFAConv structure diagram in the CRR structure diagram.
[0043] Figure 8 This is a structural diagram of the residual deep convolution attention head according to an embodiment of the present invention.
[0044] Fig. 9 This is the detection effect diagram of the original model.
[0045] Fig.10 This is a diagram of the OMCR-YOLO detection effect of an embodiment of the present invention. DETAILED DESCRIPTION
[0046] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0047] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0048] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.
[0049] The present invention provides a vehicle target detection method based on OMCR-YOLO network, such as Figure 1 As shown, the following steps are included:
[0050] Step 1: Obtain an open source data set of road traffic, where the data set is marked with category labels, time labels, and weather labels.
[0051] Specifically, in this embodiment, the BDD100K dataset released by the AI Lab of the University of Berkeley is used, which contains more than 100,000 images and 40,000 video clips. The category labels include buses, traffic lights, traffic signs, people, bicycles, trucks, motorcycles, cars, and trains, the time labels include day and night, and the weather labels include sunny, cloudy, and rainy.
[0052] Step 2: Configure the model training environment.
[0053] After preprocessing the dataset, we then build the dataset configuration file corresponding to the dataset. In the dataset configuration file, we need to write the paths of the training set and validation set as well as the category information in the dataset. Then, we modify the default.yaml file of YOLOV8 according to the experimental requirements and adjust the input image size to 640×640. This model is trained for 300 rounds, with a batch size of 8 and a number of detection object categories of 3.
[0054] In this embodiment, the environment is built according to the environment required by the model and the basic hardware conditions. The environmental information of the present invention is as follows: cuda11.8, deep learning framework pytorch2.3.0, Intel core i9-13900ks CPU, 128G memory, GPU is NVIDIA GeForce RTX 4090, and the video memory is 24G.
[0055] Step 3, construct an OMCR-YOLO network model. The OMCR-YOLO network model uses the YOLOv8 network as the basic network. The YOLOv8 network includes a backbone network, a neck network and a head network. A full-core network is introduced at the front end of the backbone network, and the C2f module in the backbone network is replaced with a CRR module. The downsampling convolution in the backbone network and the neck network is replaced with a deformable convolution enhancement module, and the original detection head in the head network is replaced with a residual deep convolution attention head.
[0056] In this embodiment, the ODCR-YOLO network model uses the YOLOv8 network as the basic network and is divided into three parts: the backbone network, the neck network, and the head network. The backbone network gradually converts the original image into feature maps of different scales and depths by introducing the full-core network and CRR. The neck network is responsible for fusing the multi-scale features from the backbone network so that the model can better cope with target objects of different scales. Deformable convolution is introduced in the backbone network and the neck network to enhance the feature extraction capability of the model. The head network is responsible for the classification of the target and the regression of the bounding box. The head network will further process the feature map passed by the neck network to output the category prediction and position prediction of the target object.
[0057] Step 4: Load the constructed OMCR-YOLO network model into the configured model training environment, modify the model parameter file, and train and test the acquired data set.
[0058] During training, in this embodiment, images with weather labels of night and category labels of cars, trucks, and buses in the BDD100K data set are selected as the training set of the model, and are divided into a training set and a test set. The training set contains 10,000 images and the validation set contains 2,000 images. The improved OMCR-YOLO network model is imported into a pre-configured deep learning environment, the parameter configuration file in the network model is modified according to the actual environmental information, and then the model is trained using the processed data set. The training rounds are 300, and 8 images are input in each round. During the training process, the training log is observed in real time through Wandb, and the weight file is saved after the training is completed.
[0059] After the model training is completed, the corresponding weight file will be generated. Select the best.pt weight file, the image to be tested and the label, and import them into the test program. After the program is executed, the test effect diagram will be output. By analyzing these pictures, we can evaluate whether the experiment meets the expected requirements.
[0060] Step 5: The traffic image data to be detected is used as input, and the trained OMCR-YOLO network model is used to detect vehicle targets.
[0061] Specifically, images taken in the dark have problems such as insufficient light, low overall brightness, and blurred details. At the same time, there is a large difference between the vehicle's light source and the surrounding environment, which can easily cause overexposure, making it difficult for the model to recognize the target. Figure 1 As shown, the full-core network is introduced at the front end of the YOLOV8 model. The full-core network structure is as follows Figure 2As shown. The input image first undergoes a 3×3 convolution for channel adjustment and feature extraction, and then the feature map is downsampled through a three-level residual convolution group. The full-core module processes the downsampled feature map, which is processed by a 1×1 convolution, and then processed by a 1×1 depth convolution, a 31×1 depth convolution, a 31×31 depth convolution, a 1×31 depth convolution, and a branch consisting of a dual-domain channel attention module and a frequency-based spatial attention module. The results of the last five branches are added to the feature map output by the 1×1 convolution on the input side of the full-core module and then processed by a 1×1 convolution. The full-core module is the core structure of the full-core network, which uses large-core convolution and deep convolution to capture long-distance dependencies and global features in the image. In order to reduce the number of parameters brought to the model by the full-core network, the present invention reduces the large-core convolution dimension in the original full-core module from 63 to 31. The feature map is then restored to its initial resolution through two groups of 1×1 convolutions, residual convolution groups, and 3×3 convolutions. At the same time, the skip connection operation is used to fuse feature information at different levels, allowing the model to more accurately locate the target and generate details when restoring the image.
[0062] in, Figure 3 The left side is the initial image, and the right side is the enhanced image. Figure 3 It can be seen that the full-core network can adjust the image tone and reduce the lighting interference in the image, thereby capturing the characteristics of the vehicle more comprehensively and improving the accuracy of target detection.
[0063] in, Figure 4 The left side is the initial image, and the right side is the heat map. Figure 4 It can be seen that the thermal distribution of images processed by the full-core network in the same level of the model is more reasonable, indicating that the model can focus on the target area more accurately, thereby improving the accuracy of detection.
[0064] in, Figure 5 The left side is the original model detection result, and the right side is the detection effect diagram of this embodiment. Figure 5 It can be seen that when performing vehicle target detection in a dark environment, the original model cannot recognize the vehicle targets in the distance because they are small and the truck targets are only partially visible, while the model introducing the full-core network structure successfully recognizes these targets.
[0065] Furthermore, the present invention introduces deformable convolution into the model, which adds two key parts on the basis of ordinary convolution: offset and modulation factor. The offset is used to dynamically adjust the sampling position of the convolution kernel, so that the convolution kernel can adaptively adjust the sampling point and is no longer limited to a fixed sampling position. The modulation factor controls the weight of each sampling point. By introducing a modulation factor, the contribution of each sampling point is different, which improves the ability to express complex features.
[0066] (1)
[0067] (2)
[0068] Formula (1) represents the output of the standard convolution, where is the position in the output feature map, is each sampling point of the convolution kernel, is the convolution kernel weight, is the sampling window. Formula (2) represents the output of deformable convolution, where is the learned offset, is the modulation factor. Both the offset and the modulation factor are generated by an additional convolutional layer whose output is split into , and Three parameters, and They correspond to the offsets of the convolution kernel in the x and y directions respectively, and the two are concatenated in the channel dimension to form a complete offset .because As a modulation factor, it is responsible for controlling the weighting coefficient at each convolution kernel position, so it needs to go through The activation function is processed. In this embodiment, its value is limited to within the range.
[0069] Vehicle targets in dark environments are often difficult to capture due to low light levels and densely packed vehicles easily block each other, causing target deformation. Deformable convolution can flexibly handle changes in the shape, size, and posture of objects and adjust the importance of sampling at different positions through a weighted mechanism, which can avoid missed detections to a certain extent.
[0070] Furthermore, the present invention replaces the C2f module in the backbone network with a CRR module. The structure of the CRR module is as follows: Figure 6As shown in the figure, firstly, a 1×1 convolution is used to adjust the number of channels of the input feature map to a predetermined value m, and then the input is divided into two branches through a split operation, each with a channel number of 0.5m. The first branch is processed by n Bottle2neck_RFAConvs, and each Bottle2neck_RFAConv generates a residual connection with a channel number of 0.5m. The other branch is directly spliced with the feature map processed by Bottle2neck_RFAConv to obtain a feature map with a channel number of (n+2)*0.5m. Finally, a 1×1 convolution is used to adjust the number of feature map channels to the output channel number c_out. The Bottle2neck_RFAConv structure is introduced in the CRR module. This structure is an improvement on the Bottle2neck structure, replacing the ordinary convolution responsible for feature extraction in the middle with the receptive field attention convolution. The convolution kernel weights of the receptive field attention convolution are adaptively generated according to the input features, and can be dynamically weighted to focus on key features. The specific process of the receptive field attention convolution is as shown in equations (3) to (6):
[0071] (3)
[0072] (4)
[0073] (5)
[0074] (6)
[0075] In formula (3) Indicates average pooling of the input feature map. Represents deep convolution, generating corresponding weights according to the number of channels.
[0076] In formula (4) represents the activation function, represents the convolution operation that generates features, Represents a batch normalization operation.
[0077] In formula (5) represents the generated features, represents the generated weight, Represents element-wise multiplication.
[0078] In formula (6) Represents a convolution operation that adjusts the number of channels so that the number of output channels is the same as the number of input channels. represents a shape transformation operation, represents the weighted feature, Represents the output of the receptive field attention convolution.
[0079] The Bottle2neck_RFAConv module enhances the model's detection capability in scenes where the target is partially occluded by introducing receptive field attention convolution. Figure 7 As shown in the figure, compared with Bottleneck, Bottle2neck uses segmentation operation to divide the input features into multiple groups. Each group is processed by an independent convolution kernel to gradually fuse small to large scale features. Different branches have different receptive fields, which enables the network to capture local details and global context information at the same time, which is helpful for target detection in dark environments.
[0080] Finally, in this embodiment, the original detection head is replaced with the residual deep convolution attention head, such as Figure 8 As shown in Figure 1. The original detection head consists of two branches. Each branch passes through two 3×3 convolutions and one 1×1 two-dimensional convolution, and finally calculates the bounding box loss and classification loss respectively. The residual deep convolution attention head optimizes the original design, as shown in Figure 1. Figure 8 As shown in the figure, two parallel 3×3 convolutions are merged into one, and the 3×3 convolution is replaced by a lightweight residual deep convolution. In addition, a hybrid local channel attention mechanism is introduced after the residual deep convolution, and then it is divided into two paths, and the number of channels is adjusted by 1×1 two-dimensional convolution respectively, and finally the bounding box loss and classification loss are calculated. The deep convolution performs convolution operations on each channel of the input separately and will not be mixed with other channels. However, such convolution will lack information interaction between channels, resulting in its weak ability to capture cross-channel features and reduced detection accuracy. To this end, a residual connection is added to the deep convolution, and the input is added to the output after convolution, which retains the global information of the input features and ensures that the key cross-channel features can still be retained in the model. The hybrid local channel attention mechanism can adaptively adjust the weights of different channels, enhance the feature interaction between channels, and further improve the overall feature expression ability of the model. In summary, the residual deep convolution attention head not only reduces the number of parameters by integrating the residual deep convolution and the hybrid local channel attention mechanism, but also improves the detection accuracy to a certain extent.
[0081] Comparative Example
[0082] The following will analyze the ablation test results to verify whether each module plays a role in the model. The ablation test results are shown in the table:
[0083] Table 1 Ablation experiment (√ indicates that the model uses this module)
[0084] Model Yolov8n OKNet MDConv RDMHead CRR <![CDATA[mAP 50 / %]]> mAP50-95 / % Param / M A √ 56.2 36.4 3.0 B √ √ 59.4 39.2 5.0 C √ √ √ 60.6 39.9 5.1 D √ √ √ √ 61.0 40.8 4.4 Ours √ √ √ √ √ 61.1 40.4 4.1
[0085] The ablation experiment results show that the model with the full-core network structure has an improvement of 3.2% in mAP50, but the number of parameters has increased by about 2M, reaching 66% of the original model's number of parameters. On this basis, the deformable convolution structure is introduced to replace the downsampling convolution, which further improves mAP50 by 1.2%, while the number of parameters only increases by 0.1M. Since the model parameters are large at this time, more video memory and computing resources are required during training, so the residual deep convolution attention head is introduced. This structure achieves the goal of lightweight, reducing the number of model parameters by 0.7M, and increasing mAP50 by 0.4%. In order to further reduce the number of model parameters, the C2f structure in the backbone is replaced with the CRR structure, which reduces the number of parameters by 0.3M and increases mAP50 by 0.1%.
[0086] In order to demonstrate the effect achieved by the invention, combined Fig. 9 and Fig.10 Compare the detection graph of the improved model with the detection graph of the original model, as shown in Fig. 9 As shown in the figure, in the dark environment, due to insufficient light and blurred features of the vehicle, the original model failed to detect the truck and the car blocked in front of the truck. Fig.10 It can be seen that the improved model can successfully identify these missed vehicles even in the dark environment and insufficient light. The comparison chart shows that the improved model has better detection performance than the original model in the dark environment when the target is blocked and the target features are blurred.
[0087] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments including components are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
Claims
1. A vehicle target detection method based on OMCR-YOLO network, characterized in that: The steps include: Step 1: Obtain an open source data set of road traffic, wherein the data set is marked with a category label, a time label, and a weather label; Step 2: Configure the model training environment; Step 3, construct an OMCR-YOLO network model, wherein the OMCR-YOLO network model uses the YOLOv8 network as the basic network, and the YOLOv8 network includes a backbone network, a neck network and a head network. A full-core network is introduced at the front end of the backbone network, and the C2f module in the backbone network is replaced with a CRR module. The downsampling convolution in the backbone network and the neck network is replaced with a deformable convolution enhancement module, and the original detection head in the head network is replaced with a residual deep convolution attention head; The full-core network includes a 3×3 convolution, a three-level residual convolution group, a full-core module, two groups of 1×1 convolutions and a residual convolution group and a 3×3 convolution connected in sequence; In the CRR module, firstly, a 1×1 convolution is used to adjust the number of channels of the input feature map to a predetermined value m, and then the input is divided into two branches through a segmentation operation, each of which has a channel number of 0.5m; the first branch is processed by n Bottle2neck_RFAConvs, and each Bottle2neck_RFAConv generates a residual connection with a channel number of 0.5m; the other branch is directly spliced with the feature map processed by Bottle2neck_RFAConv to obtain a feature map with a channel number of (n+2)*0.5m; finally, a 1×1 convolution is used to adjust the number of channels of the feature map to the output channel number c_out; The residual deep convolution attention head combines two parallel 3×3 convolutions in the original detection head into one path, and replaces the 3×3 convolution with a lightweight residual deep convolution. Then, a hybrid local channel attention mechanism is introduced after the residual deep convolution, and then it is divided into two paths, and the number of channels is adjusted by 1×1 two-dimensional convolution respectively, and finally the bounding box loss and classification loss are calculated; Step 4: Load the constructed OMCR-YOLO network model into the configured model training environment, modify the model parameter file, and train and test the acquired data set; Step 5: The traffic image data to be detected is used as input, and the trained OMCR-YOLO network model is used to detect vehicle targets.
2. A vehicle target detection method based on OMCR-YOLO network according to claim 1, characterized in that: In step 2, the configured training environment is: cuda11.8, deep learning framework pytorch2.3.0, Intel corei9-13900ks CPU, 128G memory, GPU is NVIDIA GeForce RTX 4090, and video memory is 24G.
3. A vehicle target detection method based on OMCR-YOLO network according to claim 1, characterized in that: In the full-core network, the input image first undergoes a 3×3 convolution for channel adjustment and feature extraction, and then the feature map is downsampled through a three-level residual convolution group, and then the downsampled feature map is processed by a full-core module, and then the feature map is restored to its initial resolution through two groups of 1×1 convolutions, a residual convolution group and a 3×3 convolution; at the same time, a jump connection operation is used to fuse feature information at different levels.
4. A vehicle target detection method based on OMCR-YOLO network according to claim 1, characterized in that: In the full-core module, the input feature map is processed by 1×1 convolution, and then processed by 1×1 depth convolution, 31×1 depth convolution, 31×31 depth convolution, 1×31 depth convolution and branches consisting of a dual-domain channel attention module and a frequency-based spatial attention module. Finally, the results of the five branch outputs are added to the feature map output by the 1×1 convolution on the input side of the full-core module and then processed by a 1×1 convolution.
5. A vehicle target detection method based on OMCR-YOLO network according to claim 1, characterized in that: The method for data enhancement by the deformable convolution enhancement module is expressed as follows: Among them, y(p0) represents the output of deformable convolution, Δp n is the learned offset, Δm n is the modulation factor, p0 is the position in the output feature map, and p n is each sampling point of the convolution kernel, ω(p n ) is the convolution kernel weight, and R is the sampling window.
6. A vehicle target detection method based on OMCR-YOLO network according to claim 5, characterized in that: The Bottle2neck_RFAConv is based on Bottle2neck and replaces the ordinary convolution responsible for feature extraction with the receptive field attention convolution.
7. A vehicle target detection method based on OMCR-YOLO network according to claim 6, characterized in that: The specific process expression of the receptive field attention convolution is as follows: W(x)=Softmax(AvgPool2d(x)*Conv2d(x)) F(x) = ReLU(BN(Conv2d(x))) O(x)=F(x)⊙W(x) O RFAConv =Conv2d(rearrange(O(x))) Among them, AvgPool2d(·) represents average pooling of the input feature map, Conv2d(·) represents depth convolution, and generates corresponding weights according to the number of channels; ReLU(·) represents activation function, Conv2d(·) represents convolution operation of generating features, BN(·) represents batch normalization operation; F(·) represents generated features, W(·) represents generated weights, ⊙ represents element multiplication; Conv2d(·) represents convolution operation of adjusting the number of channels so that the number of output channels is the same as the number of input channels, rearrange(·) represents shape transformation operation, O(·) represents weighted features, O RFAConv Represents the output of the receptive field attention convolution.
8. A vehicle target detection method based on OMCR-YOLO network according to claim 7, characterized in that: The residual depth convolution adopts depth convolution and adds residual connection to the depth convolution.
9. The vehicle target detection method based on the OMCR-YOLO network according to claim 1, characterized in that: The training method is as follows: the number of training rounds is 300, 8 images are input in each round, the training log is observed in real time through Wandb during the training process, and the weight file is saved after the training is completed.
Citation Information
Patent Citations
Unmanned vehicle carried camera target detection method based on YOLOv5
CN114548363A
Lightweight infrared target detection algorithm based on improved YOLOv8
CN117636111A