A road vehicle detection and tracking method based on deep learning

By improving the YOLOv5 and Deep SORT algorithms, the CBM layer and ALCSP layer were introduced, and lightweight convolution and Soft-NMS/GIOU optimization were used to solve the problems of reduced detection accuracy and insufficient model size in complex road scenarios, achieving high-precision and fast vehicle detection and tracking.

CN116110009BActive Publication Date: 2025-04-08NANJING UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310124388.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2025-04-08
Estimated Expiration
2043-02-16

AI Technical Summary

Technical Problem

The existing visual algorithms have the problem of reduced detection accuracy in complex road scenarios (such as vehicle congestion and mixed traffic of people and vehicles), and the existing models are difficult to meet the actual deployment needs in size.

Method used

Improve the YOLOv5 object detection algorithm and Deep SORT tracking algorithm, improve feature extraction and information fusion capabilities by introducing the CBM layer and ALCSP layer, reduce model size using lightweight convolution, and optimize candidate box filtering and prediction box accuracy based on Soft-NMS and GIOU.

Benefits of technology

It realizes high-precision vehicle detection and tracking in complex road scenarios, reduces the model size, and improves the detection speed and reliability, meeting the needs of practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116110009B_ABST
    Figure CN116110009B_ABST
Patent Text Reader

Abstract

The present application discloses a road vehicle detection and tracking method based on deep learning. The method collects pictures containing traffic targets at actual intersections, then annotates and processes the data to produce its own data set. The vehicle detection module introduces the CBM module, proposes the ALCSP module, further uses lightweight convolution, and uses Soft‑NMS to filter candidate frames, and constructs an improved YOLOv5 network model to detect vehicle targets. The vehicle tracking module then uses the improved DeepSORT tracking algorithm to track the vehicle, adds the speed parameter component to the Kalman filter algorithm, and uses GIOU to improve the accuracy of the prediction frame and optimize the tracking performance. Combined with the virtual coil detection method, a traffic flow monitoring system is built to monitor the actual traffic flow, and the actual traffic video is input into the traffic flow monitoring system to complete the monitoring task of the actual traffic flow information. The present application has the advantages of high detection accuracy and small model size, and can meet the monitoring needs of traffic flow in practical applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle detection, and in particular relates to a road vehicle detection and tracking method based on deep learning. Background Art

[0002] In actual applications, historical traffic data is collected through intersection monitoring equipment, and target detection and tracking tasks are achieved from the surveillance video data of the intersection. After processing, statistical information on vehicle flow is obtained to provide data decision support for actual traffic control. In actual applications, due to the uneven quality of surveillance video data and in scenarios such as congestion, existing algorithms are difficult to meet the requirements of actual applications in terms of detection accuracy and detection speed.

[0003] Traditional vehicle detection and tracking tasks are mostly implemented using machine learning methods, relying on manual feature extraction. In actual complex road scenarios, the accuracy and speed do not meet actual needs. After years of development, deep learning has made the implementation of complex models a reality with the development of hardware computing power and storage technology. Target detection and tracking algorithms based on deep learning have been applied in many fields. Such algorithms have the advantages of saving time and cost, high reliability, and high detection accuracy. Therefore, traffic target detection and tracking technology based on deep learning has extremely high application value. Summary of the invention

[0004] The purpose of this invention is to solve the problem that the existing visual algorithms have reduced accuracy in complex scenarios such as vehicle congestion and mixed traffic of people and vehicles in actual road scenes, and the existing models are difficult to meet the needs of actual deployment in terms of size. An improved algorithm based on the YOLOv5 target detection algorithm and the Deep SORT tracking algorithm is proposed to realize the recognition and tracking tasks of vehicles on actual roads.

[0005] In order to achieve the purpose of the present invention, the present invention improves the detection algorithm and the tracking algorithm, and based on the particularity and complexity of the actual road scene, discloses a road vehicle detection and tracking method based on deep learning. The vehicle flow monitoring system includes a vehicle detection module, a vehicle tracking module and a detection line module; the vehicle detection module uses an improved YOLOv5 target detection algorithm to detect the vehicle target, and then the vehicle tracking module uses an improved Deep SORT tracking algorithm to track the vehicle. When the tracked vehicle passes through the set detection line module, the perception of the vehicle flow information can be realized, which specifically includes the following steps:

[0006] Step 1: Obtain pictures containing vehicles on the actual road, annotate the original images and perform data expansion preprocessing, and divide the data into training set and verification set;

[0007] Step 2: Improve the backbone network of the YOLOv5 target detection algorithm by introducing the CBM layer, which refers to a feature extraction unit composed of a convolutional layer, a BN layer, and a Mish activation function, to improve the iterative optimization speed of the model; propose the ALCSP layer, which is based on the spatial attention mechanism module and the convolutional layer. By introducing the CBAM spatial attention module, it is used to improve the ability to fuse information of feature maps of different sizes; further use MobileNet lightweight convolution to reduce the model size; finally, add the CBM layer at the output stage of the ALSCP layer to improve the nonlinear expression ability of the network; in view of the problem of missed detection of traffic targets in traffic target detection tasks, use Soft-NMS to filter candidate boxes, and build an improved YOLOv5 network model based on this to predict vehicle information;

[0008] Step 3: Use the training set obtained in step 1 to train the improved YOLOv5 network model until the model converges to obtain a vehicle detection module;

[0009] Step 4: Improve the Deep SORT multi-target tracking algorithm; add a speed parameter component to the Kalman filter algorithm and use GIOU to improve the accuracy of the prediction frame and optimize the tracking performance; based on this, build an improved Deep SORT vehicle tracking algorithm to track actual vehicle motion information;

[0010] Step 5: Use the training set obtained in step 1 to train the improved YOLOv5 network model to obtain a convolutional network for extracting vehicle appearance features until the model converges to obtain a vehicle tracking module.

[0011] Step 6: Set the position of the detection line module according to the angle and height of the actual traffic video, input the actual traffic video data into the improved traffic monitoring system, and complete the traffic monitoring task.

[0012] Furthermore, the specific method of step 1 is:

[0013] Step 1-1, by processing the video of the actual road, the Ffmpeg tool is used to cut the video frames into the pictures that actually contain the vehicle;

[0014] Step 1-2: annotate the image data, including target category and target bounding box information, where the target category is vehicle and pedestrian, and the target bounding box is the minimum circumscribed rectangular box of the target in the image;

[0015] Steps 1-3: Preprocess the original image data using the Mosaic data enhancement method, which combines multiple data sets to improve the model's ability to detect targets with unclear features, while further reducing the model's storage requirements.

[0016] Steps 1-4: Mix the processed self-made data sets and divide them into training set and validation set in a ratio of 8:2. The validation set does not participate in the training of the model, but only for model verification.

[0017] Furthermore, the specific method of step 2 is:

[0018] Step 2-1, neural network module design. The improved YOLOv5 model includes a feature extraction module and a feature fusion module. The actual road image is processed by the feature extraction module to output feature information containing different semantics. The features at different levels are fused in the feature extraction module to finally obtain feature information output of four sizes. After that, it enters the post-processing stage to filter the output feature map to obtain the actual detection result.

[0019] Step 2-2, feature extraction module design, the feature extraction module includes FOCUS layer, CBM layer, ALCSP layer, SPP layer; the input image first passes through a single FOCUS layer, and then passes through a module composed of CBM layer and ALCSP layer stacked in series, the module has 2 layers, and obtains shallow feature X1; shallow feature X1 passes through the module composed of the third CBM layer and the third ALCSP layer in series in turn, and obtains further feature X2; feature X2 passes through the fourth CBM layer, SPP layer, and the fourth ALCSP layer in turn, and obtains deep feature X3;

[0020] Step 2-3, feature fusion module design, the feature fusion module includes upsampling layer, splicing layer, CBM layer and ALCSP layer; feature X3 is passed through the 5th ALCSP layer to obtain feature X4; feature X4 passes through the 1st upsampling layer and then passes through the 1st splicing layer with feature X2 to obtain feature X5; feature X5 passes through the 5th ALCSP layer and the 6th CBM layer in sequence to obtain further fused feature X6; the fused feature X6 is further fused through the upsampling layer and the shallow feature X1 through the 2nd splicing layer to obtain feature X7; feature X7 is input into the 6th ALCSP layer to obtain fused feature X8, feature X7 is input into the 3rd splicing layer after passing through the 7th CBM layer and feature X6, and the output is further spliced ​​with the 8th CBM layer to obtain fused feature X9; the output of the 3rd splicing layer is spliced ​​with the 8th CBM layer feature X4, and then further feature extraction is performed through the 7th ALCSP layer to obtain the final fused feature X 10 ; 4 different sizes of fusion features X6, X8, X9, X 10 .

[0021] Furthermore, the components of the CBM layer are convolutional layer, BN layer and Mish activation function layer; in the CBM layer, the input passes through convolutional layers, BN layers and Mish activation function layers of different sizes in sequence, the purpose is to extract features and normalize the features to accelerate the convergence of the model; in the detection algorithm, two different scales of CBM layers are used, the difference is that the convolution size of the convolution layer is different;

[0022] The ALCSP layer is the core of the feature extraction module. The ALCSP layer integrates the CBM layer and the CA attention mechanism, and uses the MobileNet lightweight convolution to reduce the model size. The input features are divided into two paths through the ALCSP layer. The first path only passes through the convolution layer, and the second path passes through the CBM layer, the MobileNet lightweight convolution layer and the convolution layer. The feature outputs of the two paths pass through the concatenation layer, and then are further processed by the BN layer, the Mish layer and the CBM layer to obtain the output features.

[0023] Furthermore, the specific method of step 3 is: use the K-means clustering algorithm to perform preliminary processing on the training set to obtain the size prior information of the candidate box and speed up the model training; use the cosine annealing algorithm to optimize the loss function, the batch of the network in the training stage is set to 64, and the number of network training times is 300.

[0024] Furthermore, the specific method of step 4 is: adding speed information to the Deep SORT algorithm, estimating the approximate value of the current frame speed by collecting the speed information of the past 7 frames, and then generating more accurate position information, making the algorithm more robust; using GIOU as the distance calculation and using GIOU as the standard for vehicle matching will improve the matching success rate, thereby improving the tracking accuracy and reducing the ID jump rate.

[0025] Furthermore, step 5 uses vehicle information on actual roads, captures appearance images of the same vehicle from multiple perspectives, creates a vehicle tracking dataset, and uses convolutional network training to obtain a vehicle appearance extraction model.

[0026] Furthermore, the specific method of step 6 is: due to the different positions and angles of the cameras at the intersections, the actual traffic video can realize the task of monitoring the traffic flow by setting different detection line positions and setting different monitoring areas; the actual road video is input into the traffic flow monitoring system, and passes through the vehicle detection module, the vehicle tracking module and the detection line module in sequence, and finally outputs the two-way traffic information, displays the processed information, and saves the results.

[0027] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a road vehicle detection and tracking method based on deep learning is utilized to implement the road vehicle detection and tracking method based on deep learning.

[0028] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, a road vehicle detection and tracking method based on deep learning is used to implement urban traffic vehicle detection and tracking based on deep learning.

[0029] Compared with the prior art, the significant progress of the present invention is as follows: 1) in the vehicle detection module, the backbone network of the YOLOv5 target detection algorithm is improved; first, by introducing the CBM layer, the feature extraction efficiency is improved, and the iterative optimization speed of the model is improved; second, the ALCSP layer is proposed, which integrates the spatial attention mechanism and enhances the information fusion between feature maps of different sizes; third, lightweight convolution is used to greatly reduce the model size; fourth, in view of the problem of missed detection of traffic targets in the traffic target detection task, Soft-NMS is used to filter the candidate frame, and an improved YOLOv5 network model is constructed accordingly to predict vehicle information; 2) in the vehicle tracking module, the Deep SORT multi-target tracking algorithm is improved to address the phenomenon of vehicle ID jump and tracking loss; the speed parameter component is added to the Kalman filter algorithm and GIOU is used to improve the accuracy of the prediction frame and optimize the tracking performance. Combined with the virtual coil detection method, a traffic flow monitoring system is built to realize the monitoring task of actual traffic flow. The actual traffic video is input into the traffic flow monitoring system to complete the monitoring task of actual traffic flow information. The present invention has the advantages of high detection accuracy and small model size, and can meet the monitoring needs of vehicle flow in practical applications.

[0030] In order to more clearly illustrate the functional characteristics and structural parameters of the present invention, further description is given below in conjunction with the accompanying drawings and specific implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0032] Figure 1 A flowchart of the steps of a road vehicle detection and tracking method based on deep learning of the present invention;

[0033] Figure 2 This is a network structure diagram of a road vehicle detection and tracking method based on deep learning of the present invention;

[0034] Figure 3This is a comparison diagram of the detection module effects of a road vehicle detection and tracking method based on deep learning of the present invention;

[0035] Figure 4 This is a rendering of a road vehicle detection and tracking method based on deep learning in the present invention. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0037] The present invention provides a road vehicle detection and tracking method based on deep learning, such as Figure 1 As shown, the following steps are included: (i) making a data set; (ii) building a detection and tracking model; (iii) training the detection and tracking model; and (iv) predicting actual traffic video data and outputting the prediction results.

[0038] The design and implementation of each step are introduced below.

[0039] (I) Creating a Dataset

[0040] By processing the video of the actual road, we obtain the image of the actual road scene, and use the Ffmpeg tool to skip the video frame and cut it into pictures that actually contain the detection target. The Labelmg software is used to complete the annotation of the picture. The annotation information includes the target category and the target bounding box information. The target category is vehicle and pedestrian. The annotation generates the corresponding target category and position coordinates, including the center coordinates x, y, width w and height h. The Mosaic data enhancement method is used. This method improves the detection ability of the model's unclear targets by splicing multiple data sets, and further reduces the model's storage requirements. The processed self-made data sets are mixed and divided into training sets and test sets in a ratio of 8:2.

[0041] 2. Building a detection and tracking model

[0042] The backbone network of the YOLOv5 target detection algorithm is improved by introducing the CBM layer to improve the iterative optimization speed of the model; the ALCSP layer is proposed, which integrates the spatial attention mechanism and enhances the information fusion between feature maps of different sizes; lightweight convolution is further used to greatly reduce the model size; in order to solve the problem of missed detection of traffic targets in traffic target detection tasks, Soft-NMS is used to filter candidate boxes, and an improved YOLOv5 network model is constructed based on this to predict vehicle information. The specific method is as follows:

[0043] (a) Neural network module design

[0044] The improved YOLOv5 model mainly includes a feature extraction module and a feature fusion module. The actual road image is processed by the feature extraction module, and feature information containing different semantics is output. The features at different levels are fused in the feature extraction network, and finally feature information of four sizes is output. Then, the post-processing stage is entered to filter the output feature map to obtain the actual detection result.

[0045] (b) Feature extraction module design

[0046] The feature extraction module is designed. The feature extraction module includes FOCUS layer, CBM layer, ALCSP layer and SPP layer. The input image first passes through a single FOCUS layer, and then passes through a module composed of CBM layer and ALCSP layer stacked in series. The module has two layers to obtain shallow feature X1. The shallow feature X1 passes through the module composed of the third CBM layer and the third ALCSP layer in series to obtain further feature X2. The feature X2 passes through the fourth CBM layer, SPP layer and the fourth ALCSP layer in sequence to obtain deep feature X3.

[0047] (c) Feature fusion network module design

[0048] The feature fusion module is designed. The feature fusion module includes an upsampling layer, a splicing layer, a CBM layer and an ALCSP layer. Feature X3 is passed through the 5th ALCSP layer to obtain feature X4. Feature X4 is passed through the 1st upsampling layer and then through the 1st splicing layer with feature X2 to obtain feature X5. Feature X5 is passed through the 5th ALCSP layer and the 6th CBM layer in sequence to obtain a further fused feature X6. The fused feature X6 is further fused through the upsampling layer and the shallow feature X1 through the 2nd splicing layer to obtain feature X7. Feature X7 is input into the 6th ALCSP layer to obtain fused feature X8. Feature X7 is input into the 3rd splicing layer after passing through the 7th CBM layer and feature X6, and the output is further spliced ​​with the 8th CBM layer to obtain fused feature X9. The output of the 3rd splicing layer is spliced ​​with the 8th CBM layer feature X4, and then further feature extraction is performed through the 7th ALCSP layer to obtain the final fused feature X 10 ; 4 different sizes of fusion features X6, X8, X9, X 10 .

[0049] (d) CBM layer design

[0050] The components of the CBM layer are convolutional layer, BN layer and Mish activation function layer. In the CBM layer, the input passes through convolutional layers, BN layers and Mish activation function layers of different sizes in sequence, with the purpose of extracting features and normalizing features to accelerate the convergence of the model. In the detection module, two different scales of CBM layers are used, the difference being that the convolution size of the convolution layer is different.

[0051] (e) ALSCP layer design

[0052] The ALCSP layer is the core of the feature extraction network. This module integrates the CBM layer and the CA attention mechanism, and uses MobileNet lightweight convolution to reduce the model size. The input features are divided into two paths through this module. The first path only passes through the convolution layer, and the second path passes through the CBM layer, the MobileNet lightweight convolution layer and the convolution layer. The feature outputs of the two paths pass through the concatenation layer, and then are further processed by the BN layer, the Mish layer and the CBM layer to obtain the output features.

[0053] (III) Training detection and tracking models

[0054] Detection model training: Use the K-means clustering algorithm to perform preliminary processing on the training data set to obtain the size prior information of the candidate box and speed up model training. Use the cosine annealing algorithm to optimize the loss function. The batch size of the network in the training phase is set to 64, and the number of network training times is 300.

[0055] Vehicle appearance extraction feature training: Using vehicle information on actual roads, we capture appearance images of the same vehicle from multiple perspectives to create a vehicle tracking dataset. We use a convolutional network for training with 40 iterations to obtain a vehicle appearance extraction model.

[0056] (IV) Predict actual traffic video data and output prediction results

[0057] In the prediction stage, the actual road traffic video is input into the traffic flow monitoring system. First, the vehicle in the video is identified in the vehicle detection module. Then, the optimal weight of the trained vehicle appearance extraction model is loaded to extract the vehicle's external features. The adjacent video frames of the target vehicle in the detection part are matched and associated to obtain the tracking effect, and the traffic flow is monitored based on the detection line.

[0058] The present invention mainly comprises a detection module and a vehicle tracking module, wherein the vehicle tracking module is realized by means of the accuracy of the detection module.

[0059] In the road object detection module, the average accuracy and model size are used to evaluate the performance of the model in the local dataset. The results are shown in Table 1:

[0060] Table 1 Comparison of detection results of local datasets

[0061]

[0062] As shown in Table 1, the Map of the YOLov5 target detection algorithm is 94.31, and the model parameters are 28.8M. By comparison, the Map of the improved algorithm of the present invention is improved by 1.01%, and the model size is reduced by 25.35%. This shows that the improved algorithm of the present invention has a significant performance improvement for the target detection task on the actual road.

[0063] Table 2 Comparison of the accuracy of actual road traffic monitoring

[0064]

[0065] As shown in Table 2, the accuracy of Deep SORT's target tracking algorithm is 83.3%, and the accuracy of the improved algorithm is 91.6%, indicating that the improved algorithm has higher algorithm accuracy in traffic flow monitoring on actual roads.

[0066] like Figure 2 As shown, Figure 2 This is the network structure diagram of the improved YOLOv5 target detection algorithm. The algorithm mainly includes a feature extraction module and a feature fusion module. By introducing the CBM layer and proposing the ALCSP layer, the ability of the feature extraction module to extract image features is improved. At the same time, lightweight convolution is used to reduce the size of the model. In the feature fusion module, multi-scale detection is added to utilize shallow feature information to reduce the leakage phenomenon of the model.

[0067] like Figure 3 As shown, Figure 3 This is a comparison chart of the detection effects of the detection algorithms in actual road scenarios. The left picture shows the effect of the YOLOv5 detection algorithm, and the right picture shows the detection effect of the improved algorithm. In actual congested scenarios, the improved algorithm has higher detection accuracy.

[0068] like Figure 4 As shown, Figure 4 This is the effect diagram of the actual vehicle flow monitoring system processing the actual monitoring video. It can be seen that by setting up a two-way detection line, the vehicle flow detection task can be achieved. Figure 4 The current road traffic conditions can be obtained in the upper left corner.

[0069] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0070] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0071] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A road vehicle detection and tracking method based on deep learning, characterized in that: The vehicle flow monitoring system includes a vehicle detection module, a vehicle tracking module and a detection line module; the vehicle detection module uses an improved YOLOv5 target detection algorithm to detect vehicle targets, and then the vehicle tracking module uses an improved Deep SORT tracking algorithm to track vehicles. When the tracked vehicle passes through the set detection line module, the perception of vehicle flow information is realized, which specifically includes the following steps: Step 1: Obtain pictures containing vehicles on the actual road, annotate the original images and perform data expansion preprocessing, and divide the data into training set and verification set; Step 2: Improve the backbone network of the YOLOv5 target detection algorithm by introducing the CBM layer, which refers to a feature extraction unit composed of a convolutional layer, a BN layer, and a Mish activation function; propose an ALCSP layer, which is based on the spatial attention mechanism module and the convolutional layer and introduces the CBAM spatial attention module; use MobileNet lightweight convolution, and finally add the CBM layer at the output stage of the ALSCP layer; in order to solve the problem of missed detection of traffic targets in traffic target detection tasks, use Soft-NMS to filter candidate boxes, and build an improved YOLOv5 network model based on this to predict vehicle information; Step 3: Use the training set obtained in step 1 to train the improved YOLOv5 network model until the model converges to obtain a vehicle detection module; Step 4: Improve the Deep SORT multi-target tracking algorithm; add a velocity parameter component to the Kalman filter algorithm and use GIOU; based on this, construct an improved Deep SORT vehicle tracking algorithm to track actual vehicle motion information; Step 5: Using the training set obtained in step 1, a convolutional network for extracting vehicle appearance features is obtained according to the improved Deep SORT multi-target tracking algorithm until the model converges to obtain a vehicle tracking module. Step 6: Set the position of the detection line module according to the angle and height of the actual traffic video, input the actual traffic video data into the improved traffic flow monitoring system, and complete the traffic flow monitoring task; Among them, the specific method of step 2 is: Step 2-1, neural network module design. The improved YOLOv5 model includes a feature extraction module and a feature fusion module. The actual road image is processed by the feature extraction module to output feature information containing different semantics. The features at different levels are fused in the feature extraction module to finally obtain feature information output of four sizes. After that, it enters the post-processing stage to filter the output feature map to obtain the actual detection result. Step 2-2, feature extraction module design, the feature extraction module includes FOCUS layer, CBM layer, ALCSP layer, SPP layer; the input image first passes through a single FOCUS layer, and then passes through a module composed of CBM layer and ALCSP layer stacked in series, the module has 2 layers, and a shallow feature X1 is obtained; the shallow feature X1 passes through a module composed of the third CBM layer and the third ALCSP layer in series in sequence to obtain a further feature X2; the feature X2 passes through the fourth CBM layer, SPP layer, and the fourth ALCSP layer in sequence to obtain a deep feature X3; Step 2-3, feature fusion module design, the feature fusion module includes an upsampling layer, a splicing layer, a CBM layer and an ALCSP layer; feature X3 is passed through the 5th ALCSP layer to obtain feature X4; feature X4 passes through the 1st upsampling layer and then passes through the 1st splicing layer with feature X2 to obtain feature X5; feature X5 passes through the 5th ALCSP layer and the 6th CBM layer in sequence to obtain a further fused feature X6; the fused feature X6 is further fused through the upsampling layer and the shallow feature X1 through the 2nd splicing layer to obtain feature X7; feature X7 is input into the 6th ALCSP layer to obtain fused feature X8, feature X7 is input into the 3rd splicing layer after passing through the 7th CBM layer and feature X6, and the output is further spliced ​​with the 8th CBM layer to obtain fused feature X9; the output of the 3rd splicing layer is spliced ​​with the 8th CBM layer feature X4, and then further feature extraction is performed through the 7th ALCSP layer to obtain the final fused feature X 10 ; 4 different sizes of fusion features X6, X8, X9, X 10 ; The components of the CBM layer are convolutional layer, BN layer and Mish activation function layer. In the CBM layer, the input passes through convolutional layers, BN layers and Mish activation function layers of different sizes in sequence to extract features and normalize the features. In the detection algorithm, two CBM layers of different scales are used, the difference being that the convolutional sizes of the convolutional layers are different. The ALCSP layer is the core of the feature extraction module. The ALCSP layer integrates the CBM layer and the CA attention mechanism, and uses the MobileNet lightweight convolution to reduce the model size. The input features are divided into two paths through the ALCSP layer. The first path only passes through the convolution layer, and the second path passes through the CBM layer, the MobileNet lightweight convolution layer and the convolution layer. The feature outputs of the two paths pass through the splicing layer, and then are further processed by the BN layer, the Mish layer and the CBM layer to obtain the output features.

2. A road vehicle detection and tracking method based on deep learning according to claim 1, characterized in that: Step 1: Step 1-1, by processing the video of the actual road, the Ffmpeg tool is used to cut the video frames into the pictures that actually contain the vehicle; Step 1-2: annotate the image data, including target category and target bounding box information, where the target category is vehicle and pedestrian, and the target bounding box is the minimum circumscribed rectangular box of the target in the image; Step 1-3: Use the Mosaic data enhancement method to preprocess the original image; Step 1-4: Mix the processed self-made data sets and divide them into training set and validation set in a ratio of 8:

2. The validation set does not participate in the training of the model but only verifies the model.

3. The method for detecting and tracking road vehicles based on deep learning according to claim 1, characterized in that: The specific method of step 3 is: use the K-means clustering algorithm to perform preliminary processing on the training set to obtain the size prior information of the candidate box; use the cosine annealing algorithm to optimize the loss function, set the batch of the network in the training stage to 64, and the number of network training times is 300.

4. The method for detecting and tracking road vehicles based on deep learning according to claim 1, characterized in that: The specific method of step 4 is: add speed information to the Deep SORT algorithm, estimate the approximate value of the current frame speed by collecting speed information of the past 7 frames, and then generate more accurate location information; use GIOU as the distance calculation, and use GIOU as the standard for vehicle matching to improve the matching success rate.

5. The method for detecting and tracking road vehicles based on deep learning according to claim 1, characterized in that: Step 5 uses the vehicle information on the actual road to create a vehicle tracking dataset by capturing the appearance images of the same vehicle from multiple perspectives, and uses a convolutional network for training to obtain a vehicle appearance extraction model.

6. The method for detecting and tracking road vehicles based on deep learning according to claim 1, characterized in that: The specific method of step 6 is: due to the different positions and angles of the cameras at the intersections, the actual traffic video can realize the task of monitoring the traffic flow by setting different detection line positions and setting different monitoring areas; the actual road video is input into the traffic flow monitoring system, and passes through the vehicle detection module, vehicle tracking module and detection line module in turn, and finally outputs the two-way traffic information, displays the processed information, and saves the results.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, a road vehicle detection and tracking method based on deep learning is implemented using a road vehicle detection and tracking method based on deep learning according to any one of claims 1 to 6.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the road vehicle detection and tracking method based on deep learning according to any one of claims 1 to 6 is used to implement urban traffic vehicle detection and tracking based on deep learning.

Citation Information

Patent Citations

  • Road vehicle tracking method and system based on attention mechanism and multi-target tracking

    CN114627447A

  • Automatic driving target detection method based on improved YOLOv4

    CN114708566A