A multi-target pedestrian tracking method from drone perspective based on yolov5 Deepsort

By combining the yolov5 detector and the DeepSort multi-target tracking algorithm, Kalman filtering and the Hungarian algorithm are used to solve the memory limitations and similar target interference problems of multi-target tracking in AI edge devices, achieving efficient pedestrian detection and tracking, and improving Improve detection speed and accuracy.

CN114820702BActive Publication Date: 2024-09-06DALIAN UNIV OF TECH +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210388211.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2024-09-06
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

Existing multi-target tracking algorithms cannot effectively solve problems such as memory capacity limitations and similar target interference and ID exchange in AI edge running devices, which affects the accuracy and efficiency of pedestrian detection and tracking.

Method used

Using the lightweight yolov5 detector and DeepSort multi-target tracking algorithm, combined with Kalman filtering and Hungarian algorithm, through parameter quantification and feature extraction network fusion, efficient pedestrian target detection and tracking is achieved, reducing memory usage and improving data association accuracy.

Benefits of technology

While maintaining high accuracy, it significantly reduces the model memory size, improves detection speed and data association accuracy, effectively reduces the impact of similar interference objects, and improves the feasibility of pedestrian multi-target tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114820702B
    Figure CN114820702B
Patent Text Reader

Abstract

The present invention belongs to the fields of machine learning, target detection, and target tracking, and provides a pedestrian multi-target tracking method from the perspective of a Deepsort drone based on yolov5. The target detector of the present invention uses a lightweight yolov5 detector, and after the parameters are quantized by int8, the memory size of the model is reduced while maintaining high accuracy, thereby improving the detection speed. The feasibility of deploying the detection network on an AI edge device is greatly improved. The present invention adopts the DeepSort multi-target tracking algorithm, and uses Kalman filtering and the Hungarian algorithm to solve the association problem between the current frame detection frame and the trajectory, thereby improving the accuracy of data association and effectively reducing the influence of similar interferences in the tracking process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of machine learning, target detection and target tracking, and relates to a lightweight target detector YOLOv5, a multi-target tracking algorithm Deepsort, a Kalman filter algorithm and a Hungarian algorithm. Background Art

[0002] In the field of target tracking, video processing mainly includes camera video capture, video image frame preprocessing, moving target monitoring, moving target tracking, moving target classification, and target behavior description and understanding. Among them, moving target detection and tracking is the core content, which mainly tracks the moving target continuously in a complex environment and conducts further target analysis based on this.

[0003] Object detection is at the core of computer vision. With the development of convolutional neural networks, object detection algorithms have made great achievements. The RCNN proposed by Ross Girshick in 2014 pioneered the two-stage algorithm, and based on this algorithm, he continuously improved it and proposed fast-RCNN and faster-RCNN. At the same time, the one-stage series of algorithms have also made rapid progress in recent years, and representative algorithms include the yolo series and retinanet. As a core task in computer vision, the SOTA algorithms currently proposed are still far from being implemented, but compared with previous traditional algorithms, they have made great improvements. In the process of development, some ideas and techniques mentioned in these algorithms have also radiated to other branches of computer vision and have had a huge impact on them. Object tracking is one of them.

[0004] Object tracking is a branch of computer vision tasks. It detects, extracts, identifies and tracks moving targets in image sequences, obtains the moving target's motion parameters, such as position, speed, acceleration and motion trajectory, etc., and then performs the next step of processing and analysis to understand the moving target's behavior and complete a higher level of detection tasks. It has many similarities with the tasks to be completed by target detection, but also has great differences:

[0005] 1. Both need to identify the target in the image and mark the bounding box, but tracking is based on the video stream. Tracking can be regarded as a series of detections;

[0006] 2. Target detection requires classification of the detected target, and the category of the detected target is known; the target identified by target tracking is obtained from the first frame of the video, and the target marked in the first frame is identified and continuously tracked in the subsequent video stream. The type of target tracked by the tracker is not predefined and can be any object;

[0007] 3. Both algorithms need to consider both speed and accuracy. Summary of the invention

[0008] The present invention aims to provide a DeepSort pedestrian detection and tracking method based on a lightweight yolov5 detector to solve the problem that the existing multi-target tracking algorithm is limited by the memory capacity of the AI ​​edge running device, and at the same time to solve the problems of similar target interference and ID exchange in the multi-target tracking process to a certain extent.

[0009] The method described in the present invention can be deployed on edge devices related to drones to act as a visual module for multi-target detection of pedestrians.

[0010] The technical solution of the present invention is:

[0011] A multi-target pedestrian tracking method based on Deepsort UAV perspective of yolov5, the steps are as follows:

[0012] Step 1: Obtain continuous video frames of the detection area with the help of the camera on the drone;

[0013] Step 2: Input a continuous video stream and obtain the pedestrian target detection frame of the current frame through the lightweight yolov5 detection algorithm; specifically:

[0014] The yolov5 target detection algorithm is composed of a feature extraction network and a prediction network. The basic module of the feature extraction network mainly refers to CSPNet. The CPS module is stacked to deepen the network depth, and a convolutional layer with a step size of 2 is used for downsampling to build a feature pyramid with 8 times, 16 times, and 32 times downsampling. The features of the feature pyramid are further fused using the FPN and PAN structures to obtain features with deep semantics and shallow position information. Based on the fused features, the prediction network is used to predict the confidence score and the anchor box regression coefficient to obtain the pedestrian target detection box of the current frame.

[0015] The model parameter quantization method is used to convert the parameters in the yolov5 detector from float32 to int8, thereby compressing the memory size occupied by the model parameters and achieving the purpose of model acceleration and lightweight.

[0016] The lightweight yolov5 detection algorithm processes video frames to obtain target detection frames, which mainly includes the following steps:

[0017] (1) Preprocessing: fill, crop, and scale the input image to make the image size the same as the network input size.

[0018] (2) The network forward inference obtains the confidence score and regression coefficient of the prior anchor point.

[0019] (3) Post-processing: Among all the target detection frames obtained in step (2), the detection frames with confidence lower than 0.3 are deleted, and the redundant detection frames are deleted by using the non-maximum suppression method. The filtered anchor point frames are decoded by predicting the regression coefficients to obtain the final target detection frame in the current frame.

[0020] Step 3: Use the feature extraction network to extract features from the detection box obtained in (2) to obtain a 256-dimensional feature vector for each pedestrian detection box.

[0021] Step 4: Based on the target detection frame of the current frame of the video, the deepsort multi-target tracking algorithm is used, specifically:

[0022] (1) Create the corresponding trajectory of the pedestrian detection frame detected in the first frame and initialize the motion variables of the Kalman filter. The trajectory at this time is in an unconfirmed state.

[0023] Use an 8-dimensional space to represent the state of the trajectory at a certain moment:

[0024] (u,v,γ,h,x,y,a,b)

[0025] Among them, (u,v) is the center coordinate of the bounding box, r is the aspect ratio, h is the height, and the remaining four variables represent the corresponding velocity information in the image coordinate system.

[0026] (2) Use the Kalman filter algorithm to predict the position of the trajectory in the previous frame in the current frame and obtain the predicted frame of the current frame

[0027] (3) The detection box of the target detection in the current frame is cascade matched with the prediction box of the confirmed state trajectory in (2), and the Hungarian algorithm is used for linear allocation. The matched trajectory updates the state of the trajectory according to the detection box of the current frame. The unmatched detection box is IOU matched with the prediction box of the unconfirmed state trajectory in the previous frame and the prediction box of the unmatched trajectory through cascade matching. The unmatched detection box creates a corresponding new trajectory and initializes the corresponding state and unconfirmed state; the unmatched trajectory updates its internal state according to its age; the matched trajectory updates its state according to the detection box.

[0028] Deep sort uses the Mahalanobis distance between the detection box and the tracker prediction box to describe the degree of motion correlation.

[0029]

[0030] Among them, d j Indicates the position of the jth detection box, y i represents the predicted position of the target by the ith tracker, S i Represents the covariance matrix between the detected position and the average tracking position. And the Mahalanobis distance is thresholded:

[0031]

[0032] The target appearance association method is to calculate the minimum cosine distance between the feature set of the 100 most recently successfully associated features of the i-th tracker and the feature vector of the j-th detection result in the current frame.

[0033]

[0034] Among them, r j represents the feature vector extracted from the jth detection box, represents the kth feature set of the most recent 100 successfully associated features of the ith trajectory. And by using the inverse χ 2 The minimum cosine distance is thresholded with a 95% confidence interval calculated from the distribution.

[0035]

[0036] The final metric is a linear weighted sum of the two metrics:

[0037] c i,j =λd (1) (i,j)+(1-λ)d (2) (i,j)

[0038] (4) The unmatched detection box in (3) is matched with the prediction box of the unconfirmed state trajectory in (2) and the prediction box of the cascade matching unmatched trajectory by IOU, and the Hungarian algorithm is used for linear allocation. The unmatched detection box creates a corresponding new trajectory and initializes the corresponding state and unconfirmed state; the unmatched trajectory updates its internal state according to its age; the matched trajectory updates its state according to the detection box.

[0039] (5) According to the total number of video frames N, repeat the above (2)-(4) until the pedestrian target tracking frame in the Nth frame is obtained.

[0040] Step 5: According to the location information of multiple pedestrian trajectories obtained by the multi-target tracking algorithm, specify the corresponding flight strategy, transmit the coordinate information to the flight control end of the UAV, and control the UAV to fly and track the target.

[0041] Beneficial effects of the present invention:

[0042] (1) The target detector uses a lightweight YOLOv5 detector. After the parameters are quantized to int8, the model memory size is reduced while maintaining high accuracy, thereby increasing the detection speed. This greatly improves the feasibility of deploying the detection network on AI edge devices.

[0043] (2) The DeepSort multi-target tracking algorithm is adopted, and the Kalman filter and Hungarian algorithm are used to solve the association problem between the current frame detection box and the trajectory, which improves the accuracy of data association and effectively reduces the impact of similar interferences in the tracking process. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 Schematic diagram of the yolov5 detector structure.

[0045] Figure 2 This is the flowchart of the deepsort multi-target tracking algorithm. DETAILED DESCRIPTION

[0046] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.

[0047] Figure 1 This is a schematic diagram of the yolov5 detector structure. The basic convolution module of the network is CBS, which consists of a convolution layer, a BN layer, and a SiLu activation function; the basic residual unit ResUnit consists of two CBS modules and a residual structure; the basic residual module C3 is composed of repeated ResUnit units. The network input is feature downsampled through a CBS module with a step size of 2, and finally a 32-fold downsampled feature map is obtained. The 32-fold downsampled feature map is further feature fused through the SPPF module. The feature pyramid obtained by the backbone network is further fused with the shallow position information and deep semantic information through the FPN and PAN network structures, and then passes through the detection head to obtain the prediction confidence score and regression coefficient of the input image anchor box.

[0048] Figure 2 This is the flowchart of the deepsort multi-target tracking algorithm. The detection box of the target detection in the current frame is cascade matched with the prediction box of the confirmed state trajectory in the previous frame, and the Hungarian algorithm is used for linear allocation. For the matched trajectory, the state of the trajectory is updated according to the detection box of the current frame. The unmatched detection box is IOU matched with the prediction box of the unconfirmed state trajectory in the previous frame and the prediction box of the unmatched trajectory through cascade matching. The unmatched detection box creates a corresponding new trajectory and initializes the corresponding state and unconfirmed state; the unmatched trajectory updates its internal state according to its age; the matched trajectory updates its state according to the detection box.

[0049] The unmatched detection box is matched with the prediction box of the unconfirmed state track in the previous frame and the prediction box of the unmatched track in the cascade matching, and the Hungarian algorithm is used for linear allocation. The unmatched detection box creates a corresponding new track and initializes the corresponding state and unconfirmed state; the unmatched track updates the internal state according to its age; the matched track updates its state according to the detection box.

[0050] The training set of the Yolov5 network consists of the MOT training set, the pedestrian data set in the COCO data set, and the UAV pedestrian data set. The data set uses the mosaic data augmentation method for data augmentation. The Adam optimization method is selected for optimization, the initial learning rate is set to 0.001, and 300 epochs are trained. The learning rate gradually decays during the training process.

[0051] The network input image size of the reasoning process is 416×416, the confidence score threshold is 0.3, and the threshold of non-maximum suppression is set to 0.4.

[0052] The feature extraction network structure is as follows:

[0053]

[0054]

Claims

1. A pedestrian multi-target tracking method based on YOLOv5 Deepsort UAV perspective, characterized in that: Here are the steps: Step 1: Obtain continuous video frames of the detection area with the help of the camera on the drone; Step 2: Input the continuous video stream and obtain the pedestrian target detection frame of the current frame through the lightweight yolov5 target detection algorithm; The yolov5 target detection algorithm is mainly composed of a feature extraction network and a prediction network; the feature extraction network uses a convolution module with a step size of 2 to obtain 2 times down-sampling features, and continuously uses a convolution module with a step size of 2 and a residual module to obtain 4 times down-sampling features, 8 times down-sampling features, and 16 times down-sampling features. Finally, a convolution module with a step size of 2, a residual module, and a pooling module are used to obtain 32 times down-sampling features; 8 times, 16 times, and 32 times down-sampling features are used to construct a feature pyramid; The prediction network upsamples the 32-fold downsampled features to obtain 16-fold downsampled features, which are spliced ​​with the 16-fold downsampled features of the feature pyramid. After the residual module, convolution module, and upsampling, 8-fold downsampled features are obtained, which are spliced ​​with the 8-fold downsampled features of the feature pyramid. After the residual module, convolution layer, and detection head, the confidence score and regression coefficient of 8-fold downsampling are obtained; the output of the residual module after 8-fold downsampling splicing is spliced ​​with the 16-fold downsampled features through a convolution module with a step size of 2, and then the residual module, convolution layer, and detection head are obtained. The confidence score and regression coefficient of 16-fold downsampling; the output of the residual module after 16-fold downsampling splicing is spliced ​​with the 32-fold downsampled features through a convolution module with a step size of 2, and then the residual module, convolution layer, and detection head are obtained. The confidence score and regression coefficient of 32-fold downsampling; The lightweight yolov5 target detection algorithm processes the video frame to obtain the pedestrian target detection frame, including the following steps: (2.1) Pre-processing: fill, crop, and scale the input image to make the image size the same as the network input size; (2.2) Feature extraction network, prediction forward reasoning to obtain the confidence score and regression coefficient of the prior anchor point, decode the regression coefficient to obtain the pedestrian target detection frame; (2.3) Post-processing: Among all the pedestrian target detection frames obtained in step (2.2), the detection frames with confidence scores lower than 0.3 are deleted, and the redundant detection frames are deleted by using the non-maximum suppression method. The filtered detection frames are the final target detection frames. Step 3: Use the feature extraction network to extract features from the final target detection frame obtained in step 2 to obtain a 256-dimensional feature vector for each pedestrian detection frame; Step 4: Based on the target detection frame of the current frame of the video, the Deepsort multi-target tracking algorithm is used, specifically: (4.1) The pedestrian detection frame detected in the first frame is created and its corresponding trajectory is created. The trajectory state is set to an unconfirmed trajectory, the number of matches is 1, the motion variables of the Kalman filter are initialized, and an 8-dimensional space is used to represent the state of the trajectory at a certain moment: (u,v,γ,h,x,y,a,b) Among them, (u, v) is the center coordinate of the bounding box, r is the aspect ratio, and h is the height; the other four variables represent the corresponding velocity information in the image coordinate system; (4.2) Use the Kalman filter algorithm to predict the position of the trajectory in the previous frame in the current frame to obtain the trajectory of the current frame; among them, the trajectory with more than 3 matching times is a confirmed trajectory, and the trajectory with less than 3 matching times is an unconfirmed trajectory; (4.3) The detection box of the target detection in the current frame and the confirmed state trajectory in step (4.2) are cascade matched using the Hungarian algorithm; for the matched trajectory, the trajectory state is updated according to the detection box of the current frame, and the number of matches is increased by 1; the unmatched detection box is IOU matched with the unconfirmed state trajectory in step (4.2) and the unmatched trajectory in the cascade matching, and the unmatched detection box creates a corresponding new trajectory, initializes the corresponding state and sets it to the unconfirmed state; the unmatched trajectory updates its internal state according to its age; the matched trajectory updates its state according to the detection box; Deepsort uses the Mahalanobis distance between the detection box and the tracker trajectory to describe the degree of motion association; Among them, d j Indicates the position of the jth detection box, y i represents the i-th predicted position of the target from the trajectory, S i Represents the covariance matrix between the detection position and the trajectory position; and the Mahalanobis distance is thresholded: The object appearance association method is to calculate the minimum cosine distance between the feature set of the most recent 100 successfully associated features of the i-th trajectory and the feature vector of the j-th detection result of the current frame; Among them, r j represents the feature vector extracted from the jth detection box, represents the kth feature set of the most recent 100 successfully associated features of the i-th trajectory; and by 2 The minimum cosine distance is thresholded with a 95% confidence interval calculated from the distribution; The final metric is a linear weighted sum of the two metrics: c i,j =λd (1) (i,j)+(1-λ)d (2) (i,j) (4.4) According to the total number of video frames N, repeat the above steps (4.2)-(4.3) until the pedestrian target trajectory in the Nth frame is obtained; Step 5: According to the location information of multiple pedestrian trajectories obtained by the multi-target tracking algorithm, specify the corresponding flight strategy, transmit the coordinate information to the flight control end of the UAV, and control the UAV to fly and track the target.

Citation Information

Cited By

  • Vehicle target detection system and method based on multiple unmanned aerial vehicle video streams

    CN119723382A