tracking closely spaced targets under ambiguity -凯发k8网页登录
this example shows how to track objects when the association of sensor detections to tracks is ambiguous. in this example, you use a single-hypothesis tracker, a multiple-hypothesis tracker, and a probabilistic data association tracker to compare how the trackers handle this ambiguity. to track, the maneuvering targets better, you estimate the motion of the targets by using various models.
introduction
tracking is the process of estimating the situation based on data gathered by one or more sources of information. tracking attempts to answer the following questions:
how many objects are there?
where are the objects located in space?
what is their speed and direction of motion?
how do the objects maneuver relative to each other?
trackers rely on sensor data such as radar detections. sensors can generate two detections for two targets if the sensors can resolve the targets spatially. if two targets are closely spaced, they can fall within a single sensor resolution cell and the sensor reports only one detection of them. to illustrate the problem, the following figure shows a radar with a 1.5 degrees azimuth resolution. at a range of 20 km, the radar sensor bin has a width of above 540 m, which means that any detection reported from that range is located at the center of the bin, with a ±270 m uncertainty around it. any two targets within this bin are reported as a single detection.
scenario
to demonstrate a case where sensor reports are ambiguously assigned to tracks, you create a simple scenario. in this scenario, a single radar object, located at the origin (not shown), scans a small region about 20 km from the radar. initially, the radar reports about two detections per scan. when the detections are coming from a region around the x = 0, y = -20 km position, the radar reports a single detection per scan for a while, followed by two radar detections reported from around y = -19.5km and toward the sensor (up).
the scenario and detections log is already saved in a matfile. you can uncomment the lines below to regenerate the scenario and the synthetic detections.
load atcdata.mat % scenario = helpercreatescenario; % datalog = helperrundetections(scenario); plotscenarioanddetections(datalog);
looking only at the detections in this plot, it is reasonable to assume that there are two targets, but it is unclear whether their trajectories crossed. the targets did not cross as seen by their trajectory.
single-hypothesis tracker with constant velocity model
the simplest choice of a multi-target tracker is a single-hypothesis tracker like the trackergnn
. you set it to use a score logic, to allow easier comparison with trackertomht
later in this example.
this example is small and does not require more than 20 tracks. the gate should be chosen to allow tracks to be established without spurious tracks and was increased from the default.
the sensor bin volume can be roughly estimated using the determinant of a detection measurement noise. in this case, the value is about 1e9, so you set the volume to 1e9. the value of beta should specify how many new objects are expected in a unit volume. as the number of objects in this scenario is constant, set beta to be very small. the values for probability of detection and false alarm rate are taken from the corresponding values of the radar.
numtracks = 20; % maximum number of tracks gate = 45; % association gate vol = 1e9; % sensor bin volume beta = 1e-14; % rate of new targets in a unit volume pd = 0.8; % probability of detection far = 1e-6; % false alarm rate
you use a constant velocity extended kalman filter. the initcvfilter
function modifies the filter that initcvekf
returns to allow for a higher uncertainty in the velocity terms and a higher horizontal acceleration in the process noise. these modifications are needed to track the targets in this scenario, which move at a high speed and maneuver by turning in the horizontal plane.
tracker = trackergnn( ... 'filterinitializationfcn',@initcvfilter,... 'maxnumtracks', numtracks, ... 'maxnumsensors', 1, ... 'assignmentthreshold',gate, ... 'tracklogic', 'score', ... 'detectionprobability', pd, 'falsealarmrate', far, ... 'volume', vol, 'beta', beta);
the following line runs the scenario and produces the visualization.
[tracksummary, truthsummary, trackmetrics, truthmetrics,timegnncv] = helperruntracker(datalog,tracker,false);
with the benefit of using a simulated ground truth, we can compare the results of the tracker with the truth, using trackassignmentmetrics
. the results show that there are two truth objects, but three tracks were generated by the tracker. one of the tracks did not survive until the end of the scenario, that is, it was dropped, and two other tracks did.
at the end of the scenario, truth object 2 was associated with track 8, which was created midway through the scenario after track 2 was dropped. truth object 3 was assigned track 1 at the end of the scenario, but has two breaks.
note that the establishment length of both truth objects was small while there were few false tracks, which means that the confirmation threshold is good.
disp(tracksummary) disp(truthsummary)
trackid assignedtruthid surviving totallength divergencestatus _______ _______________ _________ ___________ ________________ 1 3 true 190 false 2 nan false 77 true 8 2 true 111 false truthid associatedtrackid totallength breakcount establishmentlength _______ _________________ ___________ __________ ___________________ 2 8 192 1 4 3 1 192 2 2
use the trackerrormetrics
to analyze the quality of tracking in terms of position and velocity errors between the truth objects and the tracks associated with them. the results show that the position errors are about 50-60 m and the velocity errors are about 30 m/s rms.
disp(trackmetrics) disp(truthmetrics)
trackid posrms velrms posanees velanees _______ ______ ______ ________ ________ 1 59.461 26.119 7.9331 3.495 2 51.803 39.433 5.7494 3.0362 8 62.914 28.877 7.2004 3.0465 truthid posrms velrms posanees velanees _______ ______ ______ ________ ________ 2 62.147 27.546 8.3597 3.9608 3 56.218 32.109 6.3234 2.6642
single-hypothesis tracker with interacting multiple models
the combination of a single-hypothesis tracker and a constant velocity filter could not track the maneuvering targets. this result is evident by the fact that one of the tracks stops and then a new track begins, while there are only two targets in the scenario. it is also evident from the inability to follow the target turns.
one option to improve the tracker is to modify the filter to be an interacting multiple-model (imm) filter, which allows you to consider two or more motion models for the targets. the filter switches to the correct model based on the likelihood of one model over the other given the measurements. in this example, the targets move in a constant velocity until they turn at a constant rate, so you define an imm filter with these two models using the initimmfilter
function.
tracker = trackergnn( ... 'filterinitializationfcn',@initimmfilter,... 'maxnumtracks', numtracks, ... 'maxnumsensors', 1, ... 'assignmentthreshold',gate, ... 'tracklogic', 'score', ... 'detectionprobability', pd, 'falsealarmrate', far, ... 'volume', vol, 'beta', beta); [tracksummary, truthsummary, trackmetrics, truthmetrics, timegnnimm] = helperruntracker(datalog,tracker,false);
the addition of an imm filter enables the tracker to identify the target maneuver correctly. you can observe this conclusion by looking at the tracks generated during the target turns and notice how well both turns are tracked. as a result, truth object 2 has zero breaks, which you can see in the plot by the continuous history of its associated track.
however, even with the interacting models, one of the tracks breaks in the ambiguity region. the single-hypothesis tracker gets only one detection with that region, and can update only one of the tracks with it, coasting the other track. after a few updates, the score of the coasted track falls below the deletion threshold and the tracker drops the track.
disp(tracksummary) disp(truthsummary)
trackid assignedtruthid surviving totallength divergencestatus _______ _______________ _________ ___________ ________________ 1 2 true 190 false 2 nan false 77 true 8 3 true 111 false truthid associatedtrackid totallength breakcount establishmentlength _______ _________________ ___________ __________ ___________________ 2 1 192 0 4 3 8 192 1 2
the use of an imm also improved the tracking accuracy, as the position errors reduced to 40-60 meters, while the velocity errors reduced to 25-30 m/s. this improvement can be attributed to the lower process noise values used in the imm for each model, which allow better smoothing of the noisy measurements.
disp(trackmetrics) disp(truthmetrics)
trackid posrms velrms posanees velanees _______ ______ ______ ________ ________ 1 52.445 22.4 7.6006 6.0031 2 48.149 35.239 6.5401 3.4887 8 34.787 20.279 5.2549 4.2032 truthid posrms velrms posanees velanees _______ ______ ______ ________ ________ 2 52.445 22.4 7.6006 6.0031 3 40.75 27.364 5.7772 3.9128
multiple-hypothesis tracker with constant velocity model
to resolve the problem of the broken track, use a multiple-hypothesis tracker (mht), trackertomht
. in the ambiguity region, the tracker generates multiple hypotheses about the association of the detection with the tracks. in particular, it maintains one hypothesis that the first track is assigned this detection and another hypothesis that the second track is assigned the detection. by doing so, both tracks are kept alive, so that the tracker gets enough detections to resolve the ambiguity in the next updates.
trackertomht
uses the same parameters as trackergnn
, except:
assignmentthreshold
allows a track to be considered unassigned even when there is an assigned detection. this setting allows multiple branches per track. however, the second element of the gate disallows new tracks from assigned detections, to reduce the total number of tracks and improve performance.maxnumhistoryscans
is increased to 10, to delay thenscanpruning
.maxnumtrackbranches
is increased to 5, to allow more branches (hypotheses) per track.
tracker = trackertomht( ... 'filterinitializationfcn',@initcvfilter, ... 'maxnumtracks', numtracks, ... 'maxnumsensors', 1, ... 'assignmentthreshold', [0.2, 1, 1]*gate,... 'detectionprobability', pd, 'falsealarmrate', far, ... 'volume', vol, 'beta', beta, ... 'maxnumhistoryscans', 10,... 'maxnumtrackbranches', 5,... 'nscanpruning', 'hypothesis', ... 'outputrepresentation', 'tracks'); [tracksummary, truthsummary, trackmetrics, truthmetrics, timetomhtcv] = helperruntracker(datalog,tracker,false);
the results show the multiple-hypothesis tracker is capable of tracking the two truth objects throughout the scenario. for the ambiguity region, the mht tracker formulates two hypotheses about the assignment:
the detection is assigned to track 1.
the detection is assigned to track 2.
with these hypotheses, both tracks generate branches (track hypotheses) that update them using the same detection. obviously, using the same detection to update both tracks causes the tracks to become closer in their estimate, and eventually the two tracks may coalesce. however, if the duration of the ambiguous assignment is short, the tracker may be able to resolve the two tracks when there are two detections. in this case, you see that the two tracks cross each other, but the metrics show that the break count for each truth is 1, meaning that the true targets probably did not cross each other.
disp(tracksummary) disp(truthsummary)
trackid assignedtruthid surviving totallength divergencestatus _______ _______________ _________ ___________ ________________ 1 3 true 190 false 2 2 true 191 false truthid associatedtrackid totallength breakcount establishmentlength _______ _________________ ___________ __________ ___________________ 2 2 192 1 2 3 1 192 1 2
in terms of tracking accuracy, the position and velocity errors of this tracker are similar to the ones from the combination of a single-hypothesis tracker with a constant velocity filter.
disp(trackmetrics) disp(truthmetrics)
trackid posrms velrms posanees velanees _______ ______ ______ ________ ________ 1 45.553 28.805 4.5831 3.2817 2 61.951 29.849 6.7165 2.733 truthid posrms velrms posanees velanees _______ ______ ______ ________ ________ 2 48.913 28.578 5.0099 3.2762 3 58.178 29.891 6.1356 2.8033
multiple-hypothesis tracker with interacting multiple models
building on the success of using an multiple-hypothesis tracker with constant velocity to maintain continuous tracking, combine the tracker with the benefits of an imm filter. the imm filter may be more successful in preventing the track crossing as it improves the tracking when the targets turn. the following code configures trackertomht
with a trackingimm
filter.
tracker = trackertomht( ... 'filterinitializationfcn',@initimmfilter, ... 'maxnumtracks', numtracks, ... 'maxnumsensors', 1, ... 'assignmentthreshold', [0.2, 1, 1]*gate,... 'detectionprobability', pd, 'falsealarmrate', far, ... 'volume', vol, 'beta', beta, ... 'maxnumhistoryscans', 10,... 'maxnumtrackbranches', 5,... 'nscanpruning', 'hypothesis', ... 'outputrepresentation', 'tracks'); [tracksummary, truthsummary, trackmetrics, truthmetrics, timetomhtimm] = helperruntracker(datalog,tracker,false);
the plot shows that the two tracks did not cross. this result is also evident in the break count of the true targets below, which shows zero breaks.
you can also see the true path of the targets, shown in solid line.
disp(tracksummary) disp(truthsummary)
trackid assignedtruthid surviving totallength divergencestatus _______ _______________ _________ ___________ ________________ 1 2 true 190 false 2 3 true 191 false truthid associatedtrackid totallength breakcount establishmentlength _______ _________________ ___________ __________ ___________________ 2 1 192 0 2 3 2 192 0 2
the tracking accuracy is similar to the combination of single-hypothesis tracker with imm filter. note that the truth accuracy and the associated track accuracy are the same because there was no break in the tracking throughout the scenario.
disp(trackmetrics) disp(truthmetrics)
trackid posrms velrms posanees velanees _______ ______ ______ ________ ________ 1 55.917 24.434 6.9456 5.5389 2 37.78 25.963 5.249 4.0935 truthid posrms velrms posanees velanees _______ ______ ______ ________ ________ 2 55.917 24.434 6.9456 5.5389 3 37.78 25.963 5.249 4.0935
joint probabilistic data association tracker with constant velocity model
although the tracking metrics are greatly improved by using trackertomht
over trackergnn
, the computer processing time is also significantly increased. a joint probabilistic data association (jpda) tracker, trackerjpda
, will allow you to explore further trade-off considerations. unlike gnn, jpda allows a single detection to be used for updating multiple tracks in its vicinity. moreover, multiple detections can be clustered together with several tracks and update each of those tracks. this resolves the issue of the broken track. however, jpda does not maintain multiple hypothesis over multiple scans, which makes it a sub-optimal approach as opposed to mht.
trackerjpda
uses the same parameters as trackergnn
except:
clutterdensity
is the ratio offalsealarmrate
andvolume
.newtargetdensity
replacesbeta
.timetolerance
allows for processing multiple detections from the scanning radar in a single cluster.
additionally, set the tracklogic
to integrated
which is conceptually closer to the score logic used with the previous two trackers.
tracker = trackerjpda(... 'filterinitializationfcn',@initcvfilter,... 'maxnumtracks', numtracks, ... 'maxnumsensors', 1, ... 'assignmentthreshold',gate, ... 'tracklogic','integrated',... 'detectionprobability', pd, ... 'clutterdensity', far/vol, ... 'newtargetdensity', beta,... 'timetolerance',0.05); [tracksummary, truthsummary, trackmetrics, truthmetrics, timejpdacv] = helperruntracker(datalog,tracker,false);
although, trackerjpda does not maintain multiple hypothesis, it allows both tracks to remain confirmed in the ambiguity region where only one detection is reported per update. both tracks can be assigned to the detection with different probabilities. however, the tracks cross each other as observed before with the other trackers. the metrics break count of each truth is also 1.
disp(tracksummary) disp(truthsummary)
trackid assignedtruthid surviving totallength divergencestatus _______ _______________ _________ ___________ ________________ 1 3 true 191 false 2 2 true 191 false truthid associatedtrackid totallength breakcount establishmentlength _______ _________________ ___________ __________ ___________________ 2 2 192 1 1 3 1 192 1 2
the tracking accuracy is on par with what is obtained with trackergnn
and trackertomht
.
disp(trackmetrics) disp(truthmetrics)
trackid posrms velrms posanees velanees _______ ______ ______ ________ ________ 1 44.911 29.911 5.1872 3.5598 2 58.906 31.485 7.0021 3.0945 truthid posrms velrms posanees velanees _______ ______ ______ ________ ________ 2 47.304 29.606 5.4673 3.5092 3 56.103 31.564 6.5957 3.1816
joint probabilistic data association tracker with interacting multiple models
as seen with the other two trackers, the turn before the ambiguity region is better addressed with interacting multiple models. trackerjpda
can also be used with trackingimm
, using the same filterinitializationfcn
as before.
tracker = trackerjpda( ... 'filterinitializationfcn',@initimmfilter,... 'maxnumtracks', numtracks, ... 'maxnumsensors', 1, ... 'assignmentthreshold',gate, ... 'tracklogic','integrated',... 'detectionprobability', pd, ... 'clutterdensity', far/vol, ... 'newtargetdensity', beta,... 'timetolerance',0.05); [tracksummary, truthsummary, trackmetrics, truthmetrics,timejpdaimm] = helperruntracker(datalog,tracker,true);
the results are comparable to trackertomht
, thanks to the interacting multiple models, the targets are more precisely tracked during the turn and are sufficiently separated before entering the ambiguity region. both tracks 1 and 2 are assigned to a target with zero break counts.
disp(tracksummary) disp(truthsummary)
trackid assignedtruthid surviving totallength divergencestatus _______ _______________ _________ ___________ ________________ 1 2 true 191 false 2 3 true 191 false truthid associatedtrackid totallength breakcount establishmentlength _______ _________________ ___________ __________ ___________________ 2 1 192 0 1 3 2 192 0 2
again, tracking accuracy results are similar to what is obtained previously using trackergnn
and trackertomht
.
disp(trackmetrics) disp(truthmetrics)
trackid posrms velrms posanees velanees _______ ______ ______ ________ ________ 1 57.026 27.538 7.6753 6.2773 2 39.171 29.157 6.1248 4.7594 truthid posrms velrms posanees velanees _______ ______ ______ ________ ________ 2 57.026 27.538 7.6753 6.2773 3 39.171 29.157 6.1248 4.7594
time performance comparison
another point of comparison for each tracker and filter combination is the runtime. the plot below shows records of the tracking loop duration. the results are normalized based on the runtime value of the gnn tracker with cv model.
figure c1 = categorical({'cv','imm'}); timedata = [timegnncv timejpdacv timetomhtcv ; timegnnimm timejpdaimm timetomhtimm]/timegnncv; bar(c1,timedata) legend('gnn','jpda','tomht','location','northwest') ylabel('normalized time (x timegnn-cv)') title('time performance comparison') ax = gca; ax.ygrid = 'on';
the results show that gnn and jpda can track the targets 5 to 6 times faster than mht depending on the motion model. the imm motion model makes all three trackers run 3 to 4 times slower. note that each tracker processing time varies differently depending on the scenario's number of target, density of false alarms, density of targets, etc. this example does not guarantee similar performance comparison in different use cases.
summary
in this example, you created a scenario in which two maneuvering targets are detected by a single sensor, where some of their motion is within an area of ambiguity. you used six combinations of trackers and filters to show the contribution of each to the overall tracking. you observed that the constant velocity filter was less accurate in tracking the targets during their maneuver, which required an interacting multiple-model filter. you also observed the ability of mht and jpda to handle the case of ambiguous association of detections to tracks, and how it can be used to maintain continuous tracking while a single-hypothesis tracker cannot do that. finally, you noticed the trade-offs between tracking results and processing time when choosing a tracker. in this case jpda proves to be the best option. in different scenarios, you may require the more complex mht when neither gnn nor jpda gives acceptable tracking results. you may as well prefer gnn if there are less ambiguity regions or low clutter density.