• Keine Ergebnisse gefunden

4.4 Iterative tracking

4.4.2 Track joining

The idea is to implement an algorithm that is able to connect and merge tracks together according to similar criteria as one would connect single spots. The method is based on the same linear optimization problem as the method of Karrenbauer et al. but now for the connection of tracks instead of single spots.

This leads to some subtle amendments. It is not only possible to continue a trajectory by connecting it with another one, but also to really merge overlapping trajectories in the sense that one track is allowed to fill the time gaps of the other one (like shown in Figure4.6 going from panel C to panel D). In the next paragraphs the steps of this procedure are discussed in more detail. The focus of the description is on new features and changes with regard to the technique of Karrenbauer et al. a detailed introduction to the construction of the linear optimization problem is given in Section4.3.

Virtual track endings

In order to take into account the past and future evolution of the tracks for the selection of the most probable joinings, the decision time length๐‘กdecis introduced. Virtual starting points and endpoints of the trajectories are retrieved by computing the average (=ฬ‚center of mass) of the positions of the first and the last๐‘กdecsnapshots. If there are gaps at the endings of the track, they reduce the number of spots that go into the average, so that one always obtains time averaged virtual endings. A choice of๐‘กdec = 1avoids any averaging, then the actual endings of the tracks are used.

Search for connectable non-overlapping tracks

For each virtual endpoint one searches for virtual starting points of other tracks at a distance closer than ๐›ฟ๐‘Ÿmax. The time interval between endpoint and starting point has to be smaller than๐›ฟ๐‘กmaxand bigger than zero, which only allows non-overlapping tracks. Connectable tracks found this way are added to the list of possible links.

Search for connectable overlapping tracks

For each track one also searches for other tracks that have their starting time during the course of that track and have their virtual starting point closer than ๐‘“ โ‹…๐›ฟ๐‘Ÿmaxto that trackโ€™s virtual endpoint. A good choice for all purposes is๐‘“ = 3, which avoids the missing of any possible connections. Before adding these links to the list, one has to do more tests. For each of the other tracks found, one needs to check if the other track only fills time gaps, or if there are spots at common times in both tracks. If only gaps are filled, everything is fine, else it depends on whether one wants to allow โ€œjoined spotsโ€ (see section4.3.3).

Figure 4.8:For overlapping tracks one looks at the spots๐‘กdecbefore and after a transition from one track to the other. Here they are marked with lighter colors (๐‘กdec= 3). The average position of all light green spots has to be closer than๐›ฟ๐‘Ÿmax to the average position of all light magenta spots. If spot joining is allowed, spots at common times, here at๐‘ก= 38, must be closer than the join radius๐›ฟ๐‘Ÿjoin

4.4 Iterative tracking If they shall be allowed, one checks if the distance of spots at common times is always smaller than the join radius๐›ฟ๐‘Ÿjoin. If this is not the case, this possible link is discarded. Finally, before adding the link to the list, one has to decide if the spatial distance between the two overlapping tracks is small enough. In order to do this one has to look at all transitions from one track to the other, more precisely at the spots ๐‘กdecbefore and๐‘กdecafter the transitions (see Figure4.8). For each of both tracks the average position of all those spots is computed. Only if the distance between these two averages is smaller than๐›ฟ๐‘Ÿmaxthe corresponding link is added to the list of possible links.

Search for conflicts

The connection of overlapping tracks can lead to conflicts. In this context it is not a transitive relation, in the sense that if Aโ†”B and Bโ†”C are allowed it does not follow that Aโ†”C is possible, too. Track A is compatible with track C only if either Aโ†”C is on the list of possible connections or if the time lines of A and C do not overlap. Otherwise their connection leads to wrong and unexpected results, e.g. tracks with two spots at one time. Figure4.9gives examples for such conflicts.

coordinate

Figure 4.9: Conflicts in the connection of overlapping tracks: Aโ†”B or Bโ†”C is allowed, but not both, since Aโ†ฎC. Another conflict is: Aโ†”B or Aโ†”D is allowed but not both, since Bโ†ฎD. A third one is:

Aโ†”B or Aโ†”E is allowed but not both, since Bโ†ฎE. Note that the latter conflict is already avoided by the rule that a track can only have one successor track if no โ€œeatingโ€ is involved (the concept of โ€œeatingโ€ is explained later). The solution for this case would be Aโ†”Dโ†”E and Bโ†”C.

Figure 4.10:Walking the network of possible links of overlapping tracks in the search for conflicts in the connections of the tracks shown in Figure4.9. In the left panel we see the network of possible links, to the right we see how the network is explored, starting individually from each of the five nodes indicated with large capitals. Numbers give the order in which track compatibility is tested. Jagged lines denote incompatible tracks that lead to the registration of a set of conflicting possible links in the list of conflicts.

In this case the sets{Aโ†”B, Bโ†”C}and{Aโ†”B, Aโ†”D}are added to this list.

In order to avoid them, starting from each track individually one needs to walk through the network given by the list of possible links of overlapping tracks and check for a conflict between connectable tracks.

Tracks are the nodes of this network. The search must go forward and backward in time, if the link Aโ†’B is possible, the link Bโ†’A is possible too, there is no direction in track connectivity. Figure4.10 illustrates how the network is explored. As an example, let us look at the walk starting from D (magenta arrows): From D one can go directly to A. Now the task is to search for other connections starting at D and conflicting with Dโ†”A. First one has to test if Dโ†”E is allowed at the same time and yes, since A and E do not overlap in time they are compatible (marked with the number 1). Therefore, the links Dโ†”A and Dโ†”E are not conflicting. There are no other links starting directly at D or E, therefore one goes further with the direct links starting at A: Is Dโ†”A allowed together with Aโ†”B? No it is not, tracks B and D are not compatible (marked as test number 2). No other links start from A and since the path to B is not allowed it is not necessary to continue the search with B. The search for conflicts starting from D can be stopped here.

Since the network is walked starting individually from each node, it is clear that one finds many of the incompatibilities more than once (see Figure 4.10). Each incompatibility can be described by a set of conflicting links that might not be selected together in the optimization step (in the example above there are only sets with two links, but larger sets are definitely possible). When a set is added to the list of all the sets that have been found before, it makes sense to check if adding this set is necessary and/or if other sets in the list become obsolete after this set has been added. This keeps the list of conflicts as short as possible.

Cost function

Again the aim of the optimization step is to minimize the distances squared with the proper selection of possible links. Therefore, a very similar cost function is used for track joining. It depends on the squared space distance between the virtual endings of the tracks and the squared time interval between their real endings. The cost for a connection of a track A and a track B is defined as:

๐‘๐ด๐ต = (๐‘ฅ๐ต,๐‘ โˆ—โˆ’๐‘ฅ๐ด,๐‘’โˆ—)2+ (๐‘ฆ๐ต,๐‘ โˆ—โˆ’๐‘ฆ๐ด,๐‘’โˆ—)2+ (๐‘ง๐ต,๐‘ โˆ—โˆ’๐‘ง๐ด,๐‘’โˆ—)2+ (๐‘ก๐ต,๐‘ โˆ’๐‘ก๐ด,๐‘’)2 (4.8) Here๐‘ โˆ—and๐‘’โˆ—denote virtual starting points and endpoints, as well as๐‘ and๐‘’denote real ones. For each track that has no successive track the costs are๐›ฟ๐‘Ÿ2max+๐›ฟ๐‘ก2max, which is analogue to Karrenbauerโ€™s method (see Equation4.7). The same cost is paid for having no predecessive track, which means one has to pay twice for an unconnected track. Note that this cost function can also be adapted to include other particle features like e.g. particle diameters or detection quality.

Modifications to the optimization step: Conflicting links and โ€œeatingโ€ links

The general form of the linear optimization problem given above in Equations4.4and4.5stays the same as before. However, new rules must be included in the linear equations of constraints๐Œ ๐ฑ=๐›in order to avoid the selection of conflicting links. In the list of conflicts each entry is a set of links that may not be selected all at once. Remember that selecting link number๐‘— means that in the solution vector๐ฑwe have ๐‘ฅ๐‘— = 1. Let us assume the set๎ˆฟ๐‘ = {๐‘—, ๐‘˜, ๐‘™}represents a set of conflicting links, saying that selecting together all the links with the numbers๐‘—, ๐‘˜and๐‘™is not allowed. If the inequality

๐‘ฅ๐‘—+๐‘ฅ๐‘˜+๐‘ฅ๐‘™ <3

is fulfilled it is clear that at least one of the three links is not selected in the solution vector.

4.4 Iterative tracking

Figure 4.11:Track A โ€œeatsโ€ track B: In this situation one should allow a second track to connect to track A and forbid further connections to track B.

More generally written, we demand ๐‘€2๐‘›+๐‘,โˆ—โ‹…๐ฑ=โˆ‘

๐‘˜

๐‘€2๐‘›+๐‘,๐‘˜๐‘ฅ๐‘˜ < ๐‘›! ๐‘ =๐‘2๐‘›+๐‘ with ๐‘€2๐‘›+๐‘,๐‘™ = 1 for every link๐‘™โˆˆ๎ˆฟ๐‘, (4.9) where๐‘€2๐‘›+๐‘,โˆ—is the(2๐‘›+๐‘)th row of๐Œ,๐‘2๐‘›+๐‘is the(2๐‘›+๐‘)th element of the constraint vector๐›and ๐‘›๐‘is the number of links in set number๐‘from the list of conflicts. The constraint matrix is thus extended with๐ถnew rows, where๐ถis the number of sets in the list of conflicts. Analogously, the constraint vector ๐›is also extended with๐ถnew elements, each of them being the number of links๐‘›๐‘of the corresponding set of conflicting links. So for each set in the list of conflicting links one linear inequality in the form of Equation4.9is appended to the constraints of the linear optimization problem.

Another subtle problem arises if a possible link means that one track โ€œeatsโ€ another one. A โ€œeatsโ€ B means that track B only fills gaps in the timeline of track A but does not extend the track in time (see Figure4.11). In this case there should be the possibility to connect a second track to track A and further connections to track B should be forbidden. In order to allow for a second connection starting at A one has to change the equation of constraints, because one of the key rules is that one spot may only have one successor spot. A second change in the constraints is required to prohibit further connections starting from B.

To this end, the solution vector๐ฑis extended with๐ธ more entries (before it had2๐‘›elements),๐ธbeing the total number of possible eating links. Consequently, also the matrix of constraints๐Œ is extended with๐ธmore columns (entries of๐Œnot mentioned later are all set to โ€œ0โ€). By adding another row to the constraints for each eating link, the solution vector๐ฑis forced to be โ€œ1โ€ at position๐‘š+ 2๐‘›+๐‘’if an eating connection๐‘— is selected:

๐‘€2๐‘›+๐ถ+๐‘’,โˆ—โ‹…๐ฑ=โˆ‘

๐‘˜

๐‘€2๐‘›+๐ถ+๐‘’๐‘ฅ๐‘˜ = 0! with ๐‘€2๐‘›+๐ถ+๐‘’,๐‘— = โˆ’1and๐‘€2๐‘›+๐ถ+๐‘’,๐‘š+2๐‘›+๐‘’ = 1. (4.10) Here๐‘— is the position of the eating link in the list of all possible links, ๐‘’ is its position in the list of eating links only; ๐ถ is the number of rows that have been added before to deal with conflicting links.

Letโ€™s say the eating link๐‘’connects track number๐‘™(A in Fig.4.11) with track number๐‘Ÿ(B in Fig.4.11).

Equation4.10enforces๐‘ฅ๐‘š+2๐‘›+๐‘’ = 1if the โ€œeatingโ€ link๐‘— is selected. If๐‘—is selected, the permission for track๐‘™to have a successor must be re-enabled, which is done by setting๐‘€๐‘›+๐‘™,๐‘š+2๐‘›+๐‘’= โˆ’1. Furthermore, track๐‘Ÿmay not have a successor if๐‘—is selected, which is enforced by setting๐‘€๐‘›+๐‘Ÿ,๐‘š+2๐‘›+๐‘’= 1.

Implementation

For tests of Karrenbauer and Wรถllโ€™s algorithm on experimental data, their code was already translated to a Python/NumPy version for 3D data points. Their MATLAB script published onarXiv.org[78]

therefore serves as the basis for the implementation of the new track joining algorithm. However, since

so many details and subtleties have been added, there is not so much left of their code in the end. Some key parts like the (adapted) matrix of constraints and the solution of the linear optimization problem with the IBM ILOG CPLEX optimizer are still used.

The computational performance of the implementation depends on the number and complexity of the tracks to be connected: With many small tracks a big part of the computation time is consumed by the CPLEX optimizer. With fewer and longer tracks at complex constellations the search for possible links takes most of the time. As an example, the reduction ofโˆผ 40000small tracks toโˆผ 20000longer tracks is done in about 30 seconds on a3GHz machine, at a RAM usage ofโˆผ 1GB. In the evaluation of the experimental data discussed here, this is comparable to an average step in an iterative tracking sequence, so the code is fast enough to do about 20iterations in about ten minutes, and does not need excessive amounts of RAM. Compared to Karrenbauer and Wรถllโ€™s code that was not applicable due to its large memory requirement, this is a great improvement.