Open Access

Research on target detection and tracking algorithms in real-time video streaming

, ,  and   
Sep 29, 2025

Cite
Download Cover

Introduction

With the rapid development of multimedia technology and network technology, video has become one of the main carriers of information dissemination and communication in modern society, and vision, as an important aspect of human information perception, its research in the field of video has been a hot spot [1-3]. In general, the moving target in a video stream is the part that the human eye pays most attention to, because compared with still images, image sequences or videos can provide more and richer motion information, and thus the analysis and study of moving targets deserve to be the focus of research in image sequences and video streams [4-7].

In the whole process of understanding the behavior of people or moving objects in real-time video streams, the detection and tracking of moving targets are very critical [8-9]. Usually a video surveillance system can be roughly decomposed into four different functional units, i.e., target detection, which searches for the target region of interest of the system. Target tracking, which captures the motion trajectory of the region of interest. Target classification, which categorizes the tracked target as a person, a car, or other moving objects. Target Behavior Recognition, which performs behavioral recognition of the tracked target [10-13]. Target detection, as a prerequisite for video surveillance, is a low-level vision problem, and there are a variety of mature algorithms. Target tracking, as the most basic function of video surveillance, is a medium-level visual problem, and is one of the main bottlenecks that limit the performance of current video surveillance systems [14-17]. The detection and tracking technology of moving targets has a wide range of application prospects in the fields of military, national defense, broadcasting and television, industrial process control, medical image information processing, automatic traffic monitoring, and aircraft aerial vehicle guidance [18-21]. At the same time, the detection of moving targets also has important applications in the military field, such as TV guidance, and TV guidance has outstanding advantages such as covertness, intuition, and anti-electronic interference, which are extremely valuable in military applications [22-25].

Yaseen, M.U. et al. proposed a cloud-based automated video analytics system to handle a large number of video streams, which is able to automate the video analytics process and reduce human intervention, verifying that the system is not only effective, but also exhibits good scalability and high classification accuracy [26]. Hatwar, R.B. et al. detailed the basic steps of the object detection process, including identification of objects in a video sequence, object classification, etc., and indicated a wide range of applications for object tracking, including computerized video surveillance, traffic surveillance, and military surveillance systems, outlining the steps involved in tracking objects [27]. Ramasamy, D., with &Shanmugavadivel, K. introduced the functionality of video surveillance system and pointed out that the detection, classification and tracking of moving targets in video streams are facing challenges and proposed the use of kernel support vector machine learning technique for moving target detection and tracking and verified that the method has good performance in terms of checking the full rate and checking the accuracy [28]. Funde, N. et al. aimed to increase the response time to forensic events to reduce the manual workload and therefore designed an effective target tracking system that has a network configuration of cameras and roads in the surveillance area, video dumps and images of the objects to be tracked [29]. Elhoseny, M. proposed the multi-target detection and tracking (MODT) method, which utilizes optimal Kalman filtering technique for tracking moving targets in video frames, and verified that the maximum detection and tracking accuracies of MODT are both relatively high [30]. Ramasamy, D.P. and Kanagaraj, K. described that deep learning has boosted the field of computer vision, thus advancing the application of video processing, prompting things to become smarter and more reliable, and examined the current state of the art of target detection and visual tracking methods as well as research problems and solutions [31]. Llano, C.R., Ren, Y. and Shaikh, N.I. reviewed relevant machine learning algorithms and techniques for human recognition and tracking of videos and presented a state space representation of the object tracking problem, revealing that the proposed method implements the tracking of video human bodies [32]. Wangulkar, S.S. et al. aimed to present the steps involved in tracking a target in a video sequence, including target detection, target classification and target tracking, not only describing various methods of target detection and tracking, but also comparing the techniques used for different tracking stages [33]. Banelas, D. and Petrakis, E.G. introduced MotionInsights and its application to video streaming, which is capable of object detection and tracking from multiple video streams in real time, utilizing the distributed stream processing capabilities of ApacheFlink and ApacheKafka, and its speed of object detection and tracking in video streams is faster than the traditional approaches fast [34].

In this paper, the target characterization methods (HOG and LBP) are elaborated in detail. In the target detection stage, the three-frame frame difference method incorporating the Sobel operator is designed, combined with morphological filtering to suppress the noise and repair the broken edges, to overcome the effects of the target’s fast motion, light, noise and other disturbances on the detection, and to significantly improve the detection accuracy. In the target tracking stage, the Mean Shift algorithm is improved to enhance the discriminative ability of the model against occlusion and background interference by introducing a context-aware mechanism and optimizing the loss function.

Methods underlying target detection and tracking algorithms

Aiming at the core challenges of target detection and tracking in real-time video streaming, this chapter will systematically elaborate the basic algorithm design, including feature extraction, motion detection optimization and tracking model construction.

Characterization of target tracking
HOG Characterization

The extraction of HOG features is obtained by calculating and counting the histogram distribution of directional gradients in the image region, the HOG features are first divided into small connected slices of the image, each small slice is also a cellular cell, the gradient is calculated for the pixel points on each connected slice, the gradient histograms are collected for the gradients of the edge part, and the histograms of these regions are combined to form the HOG features. The process of HOG feature extraction is shown in Figure 1 below.

Figure 1.

HOG feature extraction process

HOG features are based on local square features to characterize the whole image, so they are not sensitive to changes in the environment caused by light and to the deformation of the image occurring in the geometric dimension. The detection results obtained by HOG features are stable in the presence of large local grayscaling gradients, roughness in the null domain, and fine sampling of directions.

LBP Characterization

LBP features refer to the local binary mode, which is a kind of artificially designed feature, and the LBP feature is obtained in the following way: firstly, by comparing the pixel value in the selected target gray matrix and the pixels in the pixel area around the gray matrix, the upbase representation of the pixel is converted into a binary representation, and the field pixel larger than the center point pixel is recorded as 1, and vice versa is 0, and then the binary map of the center pixel association can be obtained; Then, the histogram information of the gray matrix is updated according to the binary information as a new feature of the follow-up target, and finally the value of the binary graph is recoded and converted into the value of the upbase as the value of the central pixel according to the rules.

The binary histogram of the grayscale matrix, although it contains the relationship between the target grayscale information matrix and the domain pixels, still loses a lot of information and the robustness of the features is not very good.

Introduction and Improvement of Motion Target Detection Algorithm

The main purpose of the motion target detection algorithm is to enable computers and other devices to actively detect moving targets in images or video frames, and draw bounding boxes around the targets. The main function of the target detection algorithm in this design is to detect the coordinates of the moving target in the frame in real time to facilitate the tracking and processing of the subsequent algorithms, and for the fast-moving objects that are easy to be detected using the inter-frame difference method, as well as the detection of fuzzy edges inaccurate and so on, a three-frame frame difference method incorporating the Sobel operator is designed and morphological filtering to fill in the broken edges to provide good detection results. The results are summarized as follows.

Inter-frame Difference Methods

The video stream acquired by the sensor is spliced from consecutive single-frame images, if there is no moving object in the video stream, the change between two adjacent frames will be very small, if there is a moving object, there will be a significant change between two adjacent frames, and the moving target can be judged by doing the difference operation on the two adjacent frames and processing the difference result.

Figure 2 shows the two-frame difference algorithm operation, the current frame is Fk(x, y), the previous frame is Fk−1(x, y), the two frames corresponding to the gray value of the pixel for the difference of the absolute value can be obtained difference image Dk(x, y): Dk(x,y)=|Fk(x,y)Fk1(x,y)|

Figure 2.

Two frame difference algorithm

A binarized image Rk(x, y) is obtained by setting a threshold T for the difference value corresponding to each pixel point of the difference image Dk(x, y): Rk(x,y)={ Dk(x,y)T,Rk(x,y)=1 Dk(x,y)<T,Rk(x,y)=0

The computed binary map Rk(x, y) can be used to obtain the coordinate region of the moving target in the image by using the connectivity domain discrimination.

The inter-frame difference method utilizes two consecutive frames of the video sequence to obtain the moving target, which has the advantages of small computation volume, insensitivity to light interference, and high real-time performance, easy to implement in hardware, compared with the optical flow method, background subtraction method, and so on. The shortcomings of the interframe difference method are that if the target moves too fast, it is easy to appear ghosting phenomenon, and the detection results will be affected by the background interference, the edge information is incomplete, and if there is a strong change in illumination, it will be accompanied by noise burr phenomenon, which affects the results of the boundary extraction.

Improved inter-frame differencing method

This design proposes an improved inter-frame difference algorithm, which uses the three-frame frame difference method to extract fast moving targets and remove ghosting, and integrates the Sobel operator edge detection and morphological filtering algorithm can play a good boundary differentiation as well as denoising effect, which is convenient for the subsequent extraction of bounding box. The whole algorithm calculation is shown in Figure 3.

Figure 3.

Improved frame difference algorithm

When the video image sequence enters, the DDR caches two frames of images Fk−1(x, y), Fk(x, y), and waits for the third frame of image Fk+1(x, y) to enter the DDR cache at the same time, the output of the two neighboring frames to do the difference operation and judge the threshold value T to obtain the difference image D1(x, y) and D2(x, y), as shown in Eqs. (3) and (4): D1(x,y)={ |Fk(x,y)Fk1(x,y)|>T,1 |Fk(x,y)Fk1(x,y)|T,0 D2(x,y)={ |Fk+1(x,y)Fk(x,y)|>T,1 |Fk+1(x,y)Fk(x,y)|T,0

The result D1(x, y) obtained from the frame difference of the three frames and D2(x, y) can be obtained by doing the operation with the binary image R1(x, y), and the result of the operation obtained and the result of Sobel’s operator in the kth frame can be obtained by doing the operation with R2(x, y) again, as shown in Eqs. (5) and (6): R1(x,y)=D1(x,y)D2(x,y) R2(x,y)=R1(x,y)S1(x,y)

For the binary value obtained in the above steps to take the morphological filtering algorithm, using the open operation to filter out the burr noise and fill in the broken edges, to restore a clear outline of the target, and ultimately extract the target around the boundary output coordinates.

Mean Shift based target tracking algorithm

In a vision-based target tracking task for a given scenario, the mathematical representation of the background or target is crucial, and the problem is essentially a modeling process. One of the well-established representations is statistical modeling of the target model. Currently, there are two main approaches to describe and model the target using the probability density distribution of features: parametric density estimation and nonparametric density estimation. The parametric density estimation method must be premised on the a priori knowledge of the probability density function, and the a priori knowledge is difficult to obtain in practice, while the nonparametric density estimation can be based on the sample data to directly estimate the density of the sample totality, and then use the density distribution function obtained from the estimation to describe the data totality.

Meanshift algorithm is a nonparametric kernel density estimation algorithm. Kernel density estimation is one of the most commonly used and effective nonparametric density estimation methods. It is similar in principle to the histogram technique. For a set of sampled data, according to its value domain is divided into a number of equal intervals, each interval is called a bin, the data is divided into a number of groups according to this interval bin, and the probability value of each bin is the number of each group of sample data and the ratio of the total number of samples. The difference with the histogram method is that the kernel density estimation method employs a kernel function for smoothing the data. The kernel density estimation method is well suited for situations where the size of the sample data is relatively small. So this method is mainly suitable for small to medium sized datasets, when an asymptotic unbiased density estimate can be produced quickly.

Kernel estimation

Let the window radius (kernel window width) be h, in d dimensions, then the kernel density of sample x is estimated as: f^(x)=1nhdi=1nK(xxih)

where K(x) is a kernel function and the profile of kernel function K is a function k of [0, ∞) → R which makes K(x)=k(x2) .

Commonly used kernel functions are the optimization kernel Epanechnikov kernel that produces the minimum mean integration error (MISE), which is mathematically expressed as: KE(x)={ 12cd1(d+2)(1x2) x<1 0 Other

Another commonly used kernel function is the multivariate normal kernel for: KN(x)={ (2π)d/2exp(12x2) x<1 0 Other

Equation (7) can be written if the multivariate kernel density estimation is represented using the Profile of the kernel function: fh,k^(x)=1nhdi=1nk(xxih2)

The kernel density gradient of the sample is further estimated from the above equation is estimated as: ^fh,K(x)=fh,k^(x)=2nhd+2i=1n(xxi)k(xxih2)2

Let g(x) = −k′(x), assume that the contour function k(x) has derivatives for all x ∈ [0, ∞) except a finite number of points. Taking g(x) as a contour function, the kernel function K(x) can be defined as K(x) = Cg(x), and C is the normalization factor. Bringing g(x) into Eq. (11), we have: ^fh,x(x) = 2Cnhd+2i=1n(xxi)g(xxih2) = 2Cnhd+2[i=1ng(xxih2)][i=1nxi(xxih2)i=1ng(xxih2)x]

It can be seen that the above equation contains two terms, the first term in front of the second middle bracket and the second term inside the second middle bracket. Referring to Eq. (10), it is easy to see that the first term is an uninformed density estimate based on the kernel function K(x) at point x, i.e: f^h,G(x)=Cnhdi=1ng(xxih2)

The second term is the Meanshift vector, denoted as: mh,G(x)=i=1nxi(xxih2)i=1ng(xxih2)x

Eq. (14) with a slight distortion yields mh,G(x)=12h2C^fh,K(x)fh,K^(x)

Representation of the target model

In Meanshift tracking algorithm, the target is usually represented by a color histogram, and can also be characterized by edges, textures, shapes, or a combination of them. The target model includes the target model in the current frame and the candidate target model in the next frame. The target model in the current frame is represented by a probability density function q^=(q1,K,qm)u=1,2,m and the candidate target model is represented by a probability density function p^(y)=(p1(y),K,pm(y))u=1,2,m .

Let {xin}i=1,2,,n denote all pixel points in the target region, defining the center of the target at the origin. Define k(x) as the contour function of the kernel function. Assign a certain weight to each pixel point in the region, the closer the point is to the center the higher the reliability and therefore has a higher weight; conversely, the point is less reliable and has a lower weight.

Define function b : R2 → {1, …, m}, quantize the pixels in the target in the feature space into m bins, corresponding to each probabilistic feature u = 1, 2, …, m, then the target model can be expressed as: q^n=Ci=1nk(xin2)δ[b(xin)u]

where δ is the Kronecker delta function. C is the normalization constant factor for making u=1mqu=1 , thus C=1i=1nk(xin2)

Similarly, a candidate target model centered on y can be represented as follows: p^u(y)=Chi=1nhk(yxih2)δ[b(xi)u]

where Ch=1i=1nhk(yxih2) , h are the bandwidths and p^u(y) is the probability density of the first u feature vector in the candidate model p^(y) .

Similarity function

The similarity function describes the degree of similarity between the target model and the target candidate model, where ideally the probability distributions of the two models are exactly the same. The Bhattacharyya coefficient is a dispersion-type measure, whose direct geometric significance is the cosine of the angle between two vectors. The Bhattacharyya coefficient is used to define the distance between the target model and the candidate model: d(y)=1ρ[p^(y),q^]

One of them ρ(y)=ρ[p^(y),q^]=u=1mp^u(y)q^u .

Target localization

In order to find the target in the current frame, the distance between the target candidate model and the target model determined according to Eq. (19) should be minimum, that is, the Bhattacharyya coefficient of the two should be maximum. In order to maximize ρ(y), the target center localization in the current frame starts from the position y0 of the target center in the previous frame, and firstly, the candidate model of the candidate region centered at y0 is calculated, and then the Taylor method is used to expand it at pu(y0) . The Bhattacharyya coefficient can be approximated as: ρ[p^(y),q^]12u=1mp^u(y0)q^u+12u=1mp^u(y)q^up^u(y0)

In the above equation, the first term on the right side of the equation is a constant term and the second term about is a function of y. Therefore to have maximum similarity for ρ[p^(y),q^] , the second term on the right side of the equation should be taken as maximized. Substituting equation (18) in the above equation, Bhattacharyya coefficient can be expressed as: ρ[p^(y),q^]12u=1mp^u(y0)q^u+Ch2i=1ninwik(yxih2)

In the formula: wi=u=1mq^up^u(y0)δ[b(xi)u]

The second term of Eq. (21) is taken to be locally maximal, i.e., the derivative of the second term is taken to be equal to zero, so that the new target position can be obtained: y1=i=1n0xiwig(xxih2)i=1niwig(xxih2)

Experimental design and result analysis of target detection and tracking algorithms

In order to verify the effectiveness of the above algorithms, Chapter 3 quantitatively analyzes them in terms of the dimensions of detection accuracy, tracking robustness, and real-time performance by means of multiple sets of comparative experiments.

Experiments based on the improved inter-frame difference method
Comparison of Matching Correctness

In order to verify the feature point matching effect of this paper’s algorithm, quantitative comparison experiments are conducted using four methods, namely, SURF+FLANN, SURF+Bidirectional FLANN, SURF+Bidirectional FLANN+RANSAC, SURF+Bidirectional FLANN + RANSAC based on parallax-gradient constraints, respectively.

Matching correct rate is a key indicator of feature descriptor matching performance. In this paper, the level of matching correct rate directly affects the effect of background compensation, which in turn affects the effect of subsequent target detection, and its calculation formula is as follows: P=TPTP+FP

Where TP is the number of correctly matched feature point pairs and FP is the number of mismatched feature point pairs. Figure 4 shows the matching accuracy of SURF+FLANN, SURF+bidirectional FLANN, SURF+bidirectional FLANN+ RANSAC and the method in this paper under three sets of experiments, experiments 1 to 3 are Highway, Road and Highway2 sequences, the three groups of experiments contain rich background content and different shooting angles, and the UAV is in different motion states during shooting.

Figure 4.

Comparison of matching accuracy of different algorithms

From the experimental results, it can be seen that the SURF+FLANN method matches more pairs of feature points, but there are more wrongly matched feature points, and the correct matching rate is lower. After adding two-way matching, the two images are used as reference images for feature matching, which obviously improves the correct rate of matching, but there are still a large number of false matches in Experiment 1. After adding the RANSAC algorithm to re-match the feature point pairs, basically no obvious mis-matched point pairs can be seen, and the correct rate of matching is significantly improved. Finally, after the purification of feature pairs in this paper, the number of pairs is reduced again and the correct matching rate is improved. In Highway’s Experiment 1, the number of matched pairs is 296, and the number of correctly matched pairs is 274, and the matching accuracy rate reaches 92.57%. The experimental results show that the method in this paper has good stability and anti-interference ability in matching feature points of aerial images.

Comparison of quantitative experiments

In order to verify the accuracy of the improved inter-frame differencing algorithm in this paper for detecting moving targets, quantitative comparison experiments are conducted in multiple scenes using multiple methods, and the detection accuracy of different algorithms is objectively analyzed using three indexes, namely, the recall rate Re, the accuracy rate P, and the comprehensive score F-measure, and the formulas for the calculation of Re and F-measure are as follows Re=TPTP+FN Fmeasure=2×Pr×RePr+Re

where TP denotes the number of pixels of the motion target that are correctly detected; and FN denotes the number of pixels that incorrectly detect the motion target as background.

Three video sequences in the data set are compared experimentally using five methods. Experiments 1 to 3 correspond to the three video sequences of Highway, Road and Highway2 respectively. The five methods are traditional three-frame difference method before improvement, traditional hybrid Gaussian algorithm, optical flow method, background subtraction method and the algorithm in this paper. To avoid the interference caused by the dynamic background generated by the UAV movement on the moving target detection, the comparison results of the experiments under three different sequences are shown in Fig. 5, Fig. 6 and Fig. 7.

Figure 5.

Accuracy comparison of 5 detection methods under Highway

Figure 6.

Accuracy comparison of 5 detection methods under Road

Figure 7.

Accuracy comparison of 5 detection methods under Highway2

As can be seen from the above figure, for the experiments in the three scenes, the traditional three-frame difference method detects the lowest F-measure, the traditional hybrid Gaussian algorithm improves, the optical flow method and the background subtraction method improve the recall, accuracy and overall score compared to the previous two algorithms, while the improved inter-frame difference algorithm incorporating Sobel operator in this paper for the experiments in the three scenes, all have the highest F MEASURE, which are 93.38%, 96.20% and 91.83%, respectively. It greatly improves the completeness and accuracy of target detection, and has obvious detection advantages.

Mean Shift based target tracking algorithm test
Dataset and parameter environment

In this paper, two public datasets, UAV123 and VOT2024, are selected to provide vehicle motion videos for training and to validate the success rate and accuracy of the proposed algorithm for tracking. The 26 video sequences in UAV123 are UAV captured, which contain a variety of influences such as scale variation, motion blur, etc. The VOT2024 contains 30 video sequences of vehicles with manually labeled target bounding boxes, which amounted to 63,422. The size of the images in the dataset is 1280 pixels × 720 pixels, and each frame corresponds to four labeled values, which represent the horizontal and vertical coordinates of the center point of the vehicle and the width and height of the bounding box in the image, respectively.

The proposed algorithm is implemented in Ubuntu 16.0.4 system using python 3.7, Cuda 10.1 and Py Torch 1.5.0 framework. The experiments performed were carried out on Intel(R) Core(TM) i7-8750H CPU@3.60GHz CPU and NVIDIA RTX 2070 graphics card.

Experimental parameters and evaluation indicators

In this paper, the dataset is preprocessed during training, initialized on a modified feature extraction network Res2Net-50 with a learning rate in the form of exponential decay from 0.01 to 0.00001, a stochastic gradient descent method with a momentum value of 0.9 and weight decay of 0.0005 is used to reduce the training loss, and a random initialization is performed on the parameters in the attention mechanism. The number of iterations is 100 and the minimum number of batch samples per iteration is 8.

In this paper, we use tracking accuracy and average success rate, which are common in target tracking algorithms, as evaluation metrics, and draw graphs of accuracy and success rate. Tracking accuracy is defined as the distance between the target center position estimated by the tracking algorithm and the actual center point position defined by the label by comparing the number of videos whose distance is less than a given threshold as a percentage of the total, which is set to 20 pixel points. The distance is used as the Euclidean distance in centroid coordinates with the following formula: dCLE=(xixg)2+(yiyg)2

Where (xi,yi) denotes the coordinates of the target center point predicted by the tracking algorithm and (xg,yg) is the true center point coordinates of the target. The success rate is calculated as the average overlap score (AOS), and the intersection and concurrency ratio between the bounding box obtained by the tracking algorithm and the real bounding box is denoted as the AOS. When the AOS is greater than or equal to a set threshold, the target is tracked successfully in the current frame, otherwise the tracking fails. The threshold is set to 0.5 and the success rate is the percentage of successful frames to the total number of frames.

Qualitative analysis

In order to further verify the effectiveness and accuracy of the proposed Mean Shift-based target tracking algorithm, on two datasets, UAV123 and VOT2024, this paper uses the proposed algorithms Mean Shift, SiamFC, Siam-Res2Net, Siam-AM, Siam-Tri, and SiamRPN, which are the main streams of target tracking algorithm The qualitative analysis is carried out and the accuracy and success rate on the two datasets are shown in Fig. 8, Fig. 9, Fig. 10 and Fig. 11 respectively.

Figure 8.

Accuracy of different algorithms in the UAV123 data set

Figure 9.

AOC of different algorithms in the UAV123 data set

Figure 10.

Accuracy of different algorithms in the VOT2024 data set

Figure 11.

AOC of different algorithms in the VOT2024 data set

As can be seen in Fig. 8, Fig. 9, Fig. 10 and Fig. 11, Mean Shift has higher accuracy and success rate than the other five target tracking algorithms, SiamFC, Siam-Res2Net, Siam-AM, Siam-Tri, and SiamRPN, on the two datasets, UAV123 and VOT2024. Compared to the SiamFC algorithm, SiamRPN incorporates RPN after the feature extraction network to classify and regress the template image and the search image, respectively, and improves the accuracy by 3.02% and 4.62% on the two datasets, while the success rate is also improved by 0.53% and 1.14%, respectively.

The MeanShift algorithm proposed in this paper references the recognizable interferer model and utilizes contextual information to enhance the discriminative ability of the model, which still improves the accuracy by 2.67% and 3.09% on the two datasets of UAV123 and VOT2024, compared to the best of the other five models, the SiamRPN algorithm, while the success rates are improved by 0.98% and 1.75%. It also combines the dual attention mechanism and improves the loss function. Better tracking results are achieved and the real-time tracking speed is reached.

Comparison of integrated detection and tracking models
Quantitative comparison of models

In this experiment, Mean Average Precision (MAP), Recall and Frames Per Second (FPS) transmitted are used as evaluation metrics for vehicle detection algorithms. The mean accuracy of each vehicle category is denoted as AP, and the number of video sequences that can be detected per second is denoted as FPS. The formula for calculating the mean accuracy is as follows:

In order to verify the effectiveness of the improved algorithm in this paper, we continue to test it on the UAV123 dataset, and conduct comparative experiments on the designed anchor box, the replaced feature extraction network, and the optimized loss function, respectively, and the evaluation indexes are shown in Table 1.

Comparison of improved inter-frame difference method on UAV123 dataset

Detection method Precision% MAP% Recall% FPS (f/s)
Car Bus Van Others
Interframe difference method 86.09 86.01 84.37 84.87 85.34 84.68 24
Recluster the anchor box only 87.27 88.98 86.36 85.54 87.04 86.53 29
Only after improving the extraction network 89.56 87.88 88.36 86.41 88.05 86.41 25
Only after improving the loss function 90.15 87.54 91.29 87.09 89.02 87.96 30
Improved interframe difference method+Mean shift 96.62 94.28 94.68 93.22 94.70 89.92 32

As can be seen from Table 1, the reclustered anchor box is more favorable for vehicle bounding box regression, which further improves the detection precision and recall. The reduction of network parameters improves the detection speed relative to the original inter-frame differencing method. The improvement of the loss function improves the intersection and concurrency ratio of the predicted and real frames, and balances the problem of positive and negative sample imbalance, and at the same time makes the model focus on the learning of difficult to classify samples, which is more due to the benefit of the vehicle classification accuracy. Combined with the Mean shift target tracking network, the inter-frame difference method uses the anchor box reclustering, replacing the original feature extraction network and the optimized loss function, and the accuracy, recall and frame rate of the improved algorithm after fusing the Sobel operator are improved to 94.7%, 89.92% and 32f/s, respectively, which are higher than the original inter-frame difference method, only reclustering the anchor box, only improving the extraction network and only improving the loss function. At the same time, the improvements of anchor box, feature extraction network and loss function are higher than those of the original inter-frame difference algorithm in terms of accuracy, recall and frame rate.

Comparison of different target detection algorithms

In order to further mention the accuracy and practicality of the algorithm, the more mainstream detection algorithms Faster-RCNN, SSD-512, YOLOv3, YOLOx and YOLOv7 are compared in the test set, and in order to better verify the performance of the improved algorithms in this paper, the data comparison of parametric quantities and computational quantities of GFLOPs are added, and the experimental results are shown in Table 2.

Comparison of results of different target detection algorithms

Detection method Precision% MAP% Recall% FPS (f/s) Parameter quantity/M GFLOPs/G
Car Bus Van Others
Faster-RCNN 89.63 88.36 90.88 88.21 89.27 85.96 11 51.1 124.1
SSD-512 87.84 86.43 85.64 87.7 86.90 84.24 15 47.6 129.7
YOLOv3 84.36 85.06 85.61 86.07 85.28 83.32 8 48.7 109.7
YOLOx 85.97 86.81 86.72 85.10 86.15 82.56 21 38.1 114.28
YOLOv7 87.18 88.58 87.93 89.52 88.30 86.36 23 49.8 117.3
OURS 96.62 94.28 94.68 93.22 94.70 89.92 32 37.4 112.9

As can be seen from Table 2, the algorithm proposed in this paper obtains higher MAP, Recall, and frame rate than Faster-RCNN, SSD-512, YOLOv3, YOLOx, and YOLOv7 while satisfying real-time performance. This is mainly due to the fact that this paper, using the ANCHOR BOX from the reclustering of the UAV123 dataset, the EfficientNet feature extraction network and optimized loss function fusion multi-scale vehicle detection algorithms, using the EfficientNet feature extraction network which is more efficient in terms of accuracy and speed, reduces the number of network parameters and computation, reduces the impact of shallow network features on small-size vehicle localization by increasing the feature information of smaller-size vehicles, and, under the real-time requirement, the The precision of vehicle detection is improved, and the algorithm in this paper achieves an average precision of 94.70%, a recall of 89.92%, and a frame rate of 32 with 37.4M parametric quantities and 112.9G GFLOPs of computation.

Research on correlation of multi-target tracking data

Based on the validation of single-target tracking, Chapter 4 further extends to multi-target scenarios to explore the optimization effect of data association strategies on complex tracking tasks.

Experimental dataset and experimental setup

For the tracking optimization module of this thesis, this section serves to demonstrate the effectiveness of the proposed optimization strategy. In order to meet the requirements of real traffic scenarios, this section performs additional multi-object tracking experiments on the VisDrone2019 dataset, which manually labels its tracking results with high quality for each frame. The dataset contains five object classes, specifically pedestrians, cars, vans, buses and trucks. In this paper, we use the default training and validation dataset of this dataset, but exclude the pedestrian objects and keep only the four vehicle objects for related experiments.

Due to the poor performance of self-built servers resulting in long training time and the model batch size is limited by its memory, the experiments in this chapter use rented cloud servers, and the relevant server configurations are shown in Table 3.

Cloud server configuration

Module Model/Version
Internal memory 4 Cores
Graphics card 32GB
Hard disk Tesla V108
Operating system Ubuntu
Python 3.8.15
CUDA 11.8
CuDnn 8.2.0
Evaluation indicators

In order to demonstrate the effectiveness of the overall framework of the algorithm, we need to conduct comparative experiments also on the MOT16 dataset. The evaluation metrics here are Accuracy, Precision, Recall, Total False Alarms (FP), Total Missed Alarms (FN), Proportion of correctly tracked target trajectories (MT), Proportion of lost target trajectories (ML), Multi-target Tracking Accuracy (MOTA), Proportion of detected targets acquiring correct IDs (IDF1 ) and identity switching (IDSW). These metrics combine to reflect the performance of the tracking algorithm in terms of accuracy, robustness and identity retention capability. The MOTA and IDF1 are calculated as follows. MOTA=1FN+FP+IDSWGT IDF1=2(1IDP+1IDR)

Where GT refers to the actual labeling or pairs; IDP represents the accuracy of ID tracking, and IDR denotes the recall of ID tracking. The IDF1 metric focuses more on the length of time that the tracking algorithm tracks a particular target, examining the continuity of the tracking and the accuracy of the re-recognition. The IDF1 is 1 as the best case, and a higher value represents the better the accuracy of tracking a particular target.

MOT16 experimental results

For the dataset MOT16, the evaluated metrics are Accuracy, Precision, Recall, MT, ML, MOTA, IDF1, and IDSW. The comparative two-stage target detection algorithms were selected from DeepSORT2, RAR16, TAP, CNNMTT, and POI models using the consistent detector RCNN, as well as the industry advanced algorithms JDE, TubeTK and CTracker. The experimental results of the comparison of the models with the traditional two-stage multi-target tracking algorithms on the MOT16 dataset are shown in Table 4.

MOT16 comparison experiment

Method Accuracy Precision Recall MT ML MOTA IDF1 IDSW
DeepSORT2 95.37% 93.72% 94.54% 35.21% 18.18% 62.53 61.20 894
JDE 94.15% 93.89% 94.02% 35.72% 17.21% 63.39 67.36 1022
RAR16 87.14% 85.18% 86.15% 33.76% 18.62% 61.22 64.33 560
TAP 92.14% 90.73% 91.43% 37.84% 19.97% 65.50 67.31 839
CNNMTT 94.59% 93.41% 94.00% 37.59% 20.74% 68.06 71.49 1106
POI 94.48% 94.12% 94.30% 38.74% 21.42% 63.42 70.86 699
TubeTK 95.39% 95.37% 95.11% 39.20% 17.48% 69.47 71.39 1185
CTracker 96.18% 96.18% 96.37% 40.18% 17.84% 71.30 72.05 1244
OURS 97.57% 98.82% 98.19% 43.86% 16.62% 75.76 73.37 1376

From the results of the comparison experiments, all the indexes are further improved after using the improved data association strategy. On the MOT16 dataset, the precision, accuracy and recall of this paper’s algorithm are 97.57%, 98.82% and 98.19%, respectively, which are significantly better than other algorithms. The proportion of correctly tracked target trajectories and the proportion of lost target trajectories are 43.86% and 16.62%, respectively, and the proportions of multi-target tracking accuracy and the proportion of detected targets obtaining the correct ID are 75.76 and 73.37, respectively, and the identity switching is 1376, which significantly outperforms the other eight algorithms. The effectiveness of the overall framework of the joint detection tracking algorithm is further demonstrated.

Results of the MOT17 experiment

For the MOT17 dataset, two metrics, FP and FN, are evaluated on the experimental evaluation metrics for the MOT16 dataset. The comparison experiments of the final model on the MOT17 dataset and the same 8 algorithms are shown in Table 5.

MOT17 comparison experiment

Method Accuracy Precision Recall MT ML MOTA IDF1 IDSW FP FN
DeepSORT2 96.76% 94.62% 95.43% 38.34% 17.45% 64.78 63.56 1534 22746 143976
JDE 95.55% 94.65% 93.49% 39.03% 16.34% 65.43 68.40 1735 22420 193791
RAR16 90.56% 87.25% 88.43% 36.51% 17.35% 62.90 64.78 1575 19527 135461
TAP 94.50% 92.07% 93.01% 38.52% 17.43% 66.34 68.50 1903 18811 183747
CNNMTT 95.43% 94.20% 93.94% 39.07% 19.34% 68.96 75.63 2154 15345 184952
POI 95.32% 95.38% 95.30% 40.39% 21.07% 65.04 72.11 1865 22966 167528
TubeTK 96.03% 96.12% 96.09% 43.56% 16.40% 71.33 73.75 2287 16778 168269
CTracker 96.77% 96.84% 97.14% 45.43% 15.45% 73.986 72.94 2335 15549 149950
OURS 98.91% 99.43% 99.52% 49.45% 14.34% 80.61 75.37 3408 10184 129203

On the MOT17 dataset, there is a further performance improvement of the model after using the improved data association strategy. And the enhancement is even better relative to the results of the comparison experiments on MOT16. The precision, accuracy and recall reach 98.91%, 99.43% and 99.52%, the MT and ML are 49.45% and 14.34%, the MOTA and IDF1 are 80.61 and 75.37, the switched IDs are 3408, and the total number of false positives and misses are 10184 and 129203 respectively. Again significantly better than other algorithms.

Conclusion

In this paper, for the problem of target detection and tracking in real-time video streaming, we propose a three-frame frame-difference method fusing Sobel operator and an improved Mean Shift tracking algorithm. The improved detection method achieves the highest integrated score F-measure of 96.20% on datasets such as Highway, and the detection speed is improved to 32f/s. The tracking algorithm achieves an accuracy of 75.76% and 80.61% on the UAV123 and VOT2024 datasets, which is significantly better than the mainstream model. The optimized network parameter count is reduced to 37.4M, and the computation (GFLOPs) is 112.9G, which is more efficient than YOLOv7 (49.8M, 117.3G), while maintaining 94.70% MAP with 89.92% recall. In addition, the multi-target tracking experiments achieve MOTA metrics of 75.76% and 80.61% on the MOT16 and MOT17 datasets, respectively, and the IDF1 values are improved to 73.37% and 75.37%, which validate the comprehensive performance of the algorithm in complex scenes. The algorithmic framework proposed in this paper, which integrates the improved inter-frame differencing method and Mean Shift, outperforms the mainstream methods in detection accuracy, tracking robustness and real-time performance, and provides efficient and reliable technical support for real-world scenarios such as intelligent surveillance and autonomous driving.

Language:
English