## Abstract

Given an unordered list of 2D or 3D point trajectories corrupted by noise and partial observations, in this paper we introduce a framework to simultaneously recover the incomplete motion tracks and group the points into spatially and temporally coherent clusters. This advances existing work, which only addresses partial problems and without considering a unified and unsupervised solution. We cast this problem as a matrix completion one, in which point tracks are arranged into a matrix with the missing entries set as zeros. In order to perform the double clustering, the measurement matrix is assumed to be drawn from a dual union of spatiotemporal subspaces. The bases and the dimensionality for these subspaces, the affinity matrices used to encode the temporal and spatial clusters to which each point belongs, and the non-visible tracks, are then jointly estimated via augmented Lagrange multipliers in polynomial time. A thorough evaluation on incomplete motion tracks for multiple-object typologies shows that the accuracy of the matrix we recover compares favorably to that obtained with existing low-rank matrix completion methods, specially under noisy measurements. In addition, besides recovering the incomplete tracks, the point trajectories are directly grouped into different object instances, and a number of semantically meaningful temporal primitive actions are automatically discovered.

## 1 Introduction

Motion visual tracking is an important and essential component of perception that has been an active research area in computer vision for past two decades. The developments of 2D and 3D visual tracking algorithms have shown rapid progress thanks to the explosive growth of video data which in turn creates high demand for accuracy and speed of tracking methods. Current approaches are motivated to design faster and better methods in spite of the challenges that exist in this topic, especially robustness to large occlusions, drastic scale change, accurate localization, multi-object tracking, and recovery from failure [25, 27]. Despite the success in addressing numerous challenges under a wide range of scenarios, a number of core problems still remain unsolved. A major challenge in real scenarios is handling missing entries of the data, due to ad hoc data collection, presence of outliers, sensor failure, or partial knowledge of relationships in a dataset. For instance, to recover object motions and deformations from video, the tracking algorithm may lose the track of features in some image frames due to lack of visibility or mismatches. In a similar manner, for 3D tracking, multi-camera systems (such as motion capture systems) [26, 46] are applied to obtain the time-varying evolution of a scenario. While these systems are now capable of recovering most of the observations, they can fail on real-world scenarios, such as those formed by multiple objects while performing different activities, deforming, moving, and even interacting between them. In these cases, missing tracks continually appear, as either self-occlusions or occlusions between objects. It is worth mentioning that this is especially relevant in outdoors scenarios, where current algorithms to estimate motion tracks often produce partial solutions with a wide amount of missing entries.

In many fields, an underlying tenet is that the data may contain certain type of structure that enables intelligent processing and representation, and they can be characterized by using parametric models. Assuming that, the visual tracking completion problem can be addressed as a matrix completion one. To this end, one can use the well-known linear subspaces since they are easy to estimate, and often effective in many real-world applications. For instance, these models have been successfully used to characterize several types of visual data, such as motion [39, 49], shape [32], and texture [35]. Maybe, the most common choice it is to use the principal component analysis method that is based on the hypothesis that the data are approximately drawn from a low-rank subspace. Unfortunately, real data from complex scenarios can rarely be well described by a single low-rank subspace. For these cases, a more reasonable model is to assume data are lying near several subspaces, i.e., the data are considered as samples approximately drawn from a union of several low-rank subspaces. The generality and importance of subspaces naturally lead to a challenging problem of subspace clustering, whose goal is to group data into clusters with every cluster corresponding to a different subspace. Solving clustering and finding low-dimensional representations of data are important unsupervised learning problems in machine learning with numerous applications, including image segmentation, system identification, data visualization, and collaborative filtering to name just a few. The problem becomes even more complex if the data are partially observed, due to either sensor failure or visual occlusions [1, 2, 4, 24].

In this paper, we propose, to the best of our knowledge, the first attempt to approximate high-dimensional data using a dual union of low-dimensional subspaces, accounting for two distinct criteria. Additionally, input data are assumed to be corrupted by partial observations and noise. We apply our approach to the specific case in which the input data encode 2D or 3D point trajectories of multiple dynamic objects with large percentages of missing entries, and we aim at hallucinating these missing tracks while simultaneously approximating the data using spatial and temporal subspaces, as well as filtering the noisy measurements.

We will formulate the problem as a matrix completion one. Input data will be arranged into a matrix with the missing entries set to zero. To encode data similarities, we introduce two affinity matrices to be learned. We will then devise an optimization scheme based on augmented Lagrangian multipliers (ALM) to simultaneously and efficiently estimate the missing entries, and the bases and dimensionality for of each low-rank subspace. The proposed algorithm is unsupervised, does not depend on the initialization nor relies on training data at all, and can be solved in polynomial time. An important corollary of our approach is that applying off-the-shelf state-of-the-art spectral clustering on the estimated affinity matrices results in consistent temporal and spatial segmentations of the input data.

We evaluate the proposed algorithm on 2D and 3D incomplete motion capture and real sequences of several objects performing complex actions and interacting with each other. We will show that the accuracy of the completed tracks we obtain improves that of state-of-the-art methods by a considerable margin, while we additionally provide a spatiotemporal clustering of the data, which in most cases has a direct physical interpretation (either the object identity or the type of motion it is performing).

## 2 Related work

The most standard approach to perform matrix completion is to assume the underlying data lies in a single low-dimensional subspace. Early works [30, 44] enforced this constraint based on expectation maximization strategies to optimize non-convex functions of the model parameters and the missing entries. Other attempts constrain the solution space using trajectory [24], or spatiotemporal models [5]. Nevertheless, all these methods require a good initialization, and most importantly, they need to set the rank of the subspace a priori, performing poorly when the dimension of the subspace increases. Additionally, trajectory-based methods normally use a predefined basis, making them very problem specific. To address these limitations, another family of low-rank matrix completion techniques has been recently proposed [7, 9,10,11, 14, 15]. These methods estimate missing entries by optimizing the convex surrogate of the rank, i.e., by they enforce the nuclear norm of the complete matrix. These ideas were also applied in problems where the matrix directly includes visual tracking information, imposing smooth [42, 43, 54] and sparse [47] representations. When the underlying subspace is not consistent with standard basis components and missing track locations are spread uniformly at random, these approaches are guaranteed to recover missing entries.

Unfortunately, matrix completion techniques based on a single low-rank subspace cannot handle the challenging and more general scenario in which input data lie in a union of low-rank subspaces (e.g., when dealing with simultaneous and incomplete tracks of multiple objects performing complex motions). Data segmentation from full annotations was proposed by assuming a union of subspaces by means of a subspace clustering based on sparse representation [18] or seeking the lowest rank one [34]. Going back to the completion problem, the objective would extend to recovering the missing entries together with the clustering of the data according to the subspaces. Mixture of factor analyzers [22], mixture of probabilistic principal component analysis [45], and incremental matrix completion algorithms with *K*-subspaces [6] are some early methods used to address grouping and completion of multi-subspace data. Again, the performance of these methods highly depends on the initialization and degrades for large subspace ranks. A polynomial number of data points in the ambient space dimension are required in [19] which often cannot be met in high-dimensional datasets. Ma et al. [36] proposed an algebraic approach to model data drawn from a union of subspaces based on generalized principal component analysis. Yet, due to the difficulty of estimating the polynomials from data, the method is sensitive to noise and is computationally very demanding. This strategy was extended in [40], yielding more robust solutions but only for low-dimensional input data and a reduced number of subspaces. A Lipschitz monotonic function was assumed to model the low-rank matrix in [21], even though this cannot cover the case of multiple subspaces. Another family of solutions proposed solving completion and clustering as a two-stage problem [50], by first obtaining a similarity graph for clustering and then applying low-rank matrix completion to each cluster. While this is an interesting direction, the solution proposed in [50] is prone to fail when subspaces intersect or when the initial grouping is incorrect. To solve this limitation, Elhamifar [17] has proposed self-expressive models for simultaneous clustering and completion of incomplete data. Along the same line, Fan and Chow [20] have recently presented a sparse representation to solve the problem. However, these approaches can only cluster the data based on one single criterion. In parallel, some works have relied on neural networks to learn temporal clustering [52] and infer missing entries [37, 55], but solving just a single problem. In all cases, these approaches propose to exploit a loss function as we do in this paper, but they require a large amount of training data to learn the model and demand a specific hardware to complete the training step. Unfortunately, this cannot be assumed for generic scenarios, where an unknown number of unknown object typologies can deform, move, and even interact between them, doing the process of simultaneously obtaining training data for track completion, spatial groups, and temporal ones very hard and expensive in practice. In contrast, our formulation can solve the problem in just few seconds in a commodity computer, without requiring sophisticated hardware, nor prior knowledge about the scenario to be solved. Moreover, none of them simultaneously solve multiple clustering and completion as we propose in this paper.

### 2.1 Our contributions

We go beyond previous works by proposing an efficient and robust method that does not require initialization, and it can jointly perform two types of clustering (spatial and temporal), while recovering missing entries and filtering the rest. To the best of our knowledge, no previous approach has jointly addressed the three problems in a unified and unsupervised framework. To this end, we assume the input data to lie in a dual union of low-rank subspaces, where no a priori knowledge about the dimensionality of the subspaces or which data points belong to which subspace is required. It is worth noting that our approach does not require any training data at all. Additionally, the proposed solution can handle situations with complex motion patterns, affected by large degrees of overlapping and percentage of missing entries, in a completely unsupervised manner.

Table 1 summarizes a qualitative comparison of our approach and the aforementioned techniques to jointly solve completion and clustering.

## 3 Preliminaries and problem statement

### 3.1 Notation

Matrices are represented with boldface uppercase letters, e.g., \(\mathbf {X}\). In particular, \(\mathbf {I}_{A}\) is used to denote the identity matrix of size \(A \times A\), and \(\mathbf {1}_{A}\) a column vector of ones of size \(A \times 1\). The entries of matrices are denoted by means of subscripts \([\cdot ]\). For instance, \(\mathbf {X}_{[:j]}\) corresponds to the *j*th column of the matrix \(\mathbf {X}\), \(\mathbf {X}_{[i:]}\) is the *i*th row of the matrix \(\mathbf {X}\), and \(\mathbf {X}_{[ij]}\) indicates its (*i*, *j*)th entry. We also define two types of products: \(\mathbf {X}\otimes \mathbf {Z}\) to denote the Kronecker product, and \(\mathbf {X}\odot \mathbf {Z}\) to denote the Hadamard (or element-wise) one. The negative of a binary matrix \(\mathbf {X}\) is denoted as \(\bar{\mathbf {X}}\). We also define several norms on matrices: The \(l_{\infty }\)-norm is defined as \(\Vert \mathbf {X}\Vert _{\infty }=\max _{(i,j)}|\mathbf {X}_{[ij]}|\), and the \(l_{2,1}\)-norm as \(\Vert \mathbf {X}\Vert _{2,1}=\varSigma _{j}\Vert \mathbf {X}_{[:j]}\Vert _{2}\), where the \(l_{2}\)-norm of a vector is denoted by \(\Vert \mathbf {X}_{[:j]}\Vert _{2}\). The Frobenius and nuclear norms are represented as \(\Vert \mathbf {X}\Vert _{F}\) and \(\Vert \mathbf {X}\Vert _{*}=\varSigma _{i} \sigma _{i}(\mathbf {X})\), respectively, with \(\sigma _i(\mathbf {X})\) being the *i*th singular value of the matrix \(\mathbf {X}\). Finally, the Euclidean inner product between two matrices is denoted as \(\langle \mathbf {X},\mathbf {Z}\rangle =\text {tr}(\mathbf {X}^{\top }\mathbf {Z})\), where \(\text {tr}(\cdot )\) represents the trace of a matrix.

### 3.2 Problem Formulation

Let us consider *F* temporal subspaces \(\{S_f\}_{f=1}^{F}\) of dimension \(\{d_f>0\}_{f=1}^{F}\) in a C-dimensional space, and *G* spatial subspaces \(\{S_g\}_{g=1}^{G}\) of dimension \(\{d_g>0\}_{g=1}^{G}\) in a H-dimensional space. Let \(\mathbf {Y}\in \mathbb {R}^{C\times T}\) be a matrix of *T* data points lying on the union of the temporal subspaces, and \(\hat{\mathbf {Y}}\in \mathbb {R}^{H\times N}\) a matrix of *N* data points lying on the union of spatial subspaces. If we assume that both dimensions can be factorized by a factor *D* (i.e., \(C=DN\) and \(H=DT\)), the two matrices \(\mathbf {Y}\) and \(\hat{\mathbf {Y}}\) can then contain exactly the same number of values but in a different arrangement. Additionally, we will assume that only some entries of these matrices are observed, i.e., some locations can include null values. To denote this, we include the matrix \(\tilde{\mathbf {Y}}\), a sparse version of \(\mathbf {Y}\), in which non-observed entries are set to zero.

Our problem consists in, given an incomplete and noisy matrix \(\tilde{\mathbf {Y}}\) of data points from motion tracking, retrieving the full matrix, \(\mathbf {Y}\) or \(\hat{\mathbf {Y}}\), and clustering the data into the underlying temporal and spatial subspaces. To this end, we will encode the spatial and temporal subspaces using affinity matrices. It is worth noting that both the bases (\(\{S_f\}_{f=1}^{F}\) and \(\{S_g\}_{g=1}^{G}\)) and dimensions of each subspace (\(d_f\) and \(d_g\), respectively) are not known a priori, nor to which cluster each data point belongs to. The incomplete and noisy input matrix can be provided by any tracking algorithm, by considering, for instance, optimization [25, 27] or deep learning approaches (Joo et al. [28]). We next describe our unsupervised and unified approach that can solve the problem without requiring any training data at all.

## 4 Spatiotemporal subspace clustering

Drawing inspiration on the ideas of [3] for reconstructing non-rigid shapes, we next generalize a spatiotemporal constraint for joint motion track matrix completion and clustering. Note that this constraint was not used previously in the literature for completing missing entries as we present here. We first introduce the two types of interpretations of the tracking matrices we shall use. After that, and considering the previous interpretations, we will introduce the temporal and spatial constraints, extending our formulation to handle missing tracks.

### 4.1 Motion tracking matrix interpretations

Let us consider a dynamic set of *N* *D*-dimensional points tracked along *T* time instances. For the particular case of \(D=3\), i.e., a tridimensional space, we shall denote by \(\mathbf {x}_i^t=[x_i^t , y_i^t, z_i^t]^{\top }\) the spatial coordinates of the *i*th point at time instant *t*. All acquired point coordinates can be collected into the matrix \(\mathbf {Y}\in \mathbb {R}^{DN\times T}\) in an unordered manner in terms of any type of grouping that stores the *x*, *y*, and *z* coordinates in a block matrix form as:

We could assume the previous motion tracking matrix admits a low-rank decomposition of rank *K* (\(K=1\) for rigid objects), where *K* represents the number of bases in a single subspace. We know from the structure from motion theory this matrix is of low rank (Dai et al. [16], Xiao et al. [48]), but since no information about the motion is assumed, only a low-rank constraint can be considered. However, as discussed above, the single low-rank assumption may not have sufficient expressiveness power to model complex motion patterns of multi-object tracks. It is worth mentioning that if we know some kind of clustering or grouping of the *T* data points, we might handle this situation by enforcing the low-rank assumption to every particular cluster. In this work, however, the number and type of clusters is not known a priori, making the problem more challenging and generic. Consequently, we need to jointly solve for completion and clustering, without assuming any information about the dimensionality of the subspaces.

Since each column of the matrix \(\mathbf {Y}\) encodes all points at a time instant, this matrix cannot be directly used to retrieve spatial similarities. To address this limitation, we consider a new \(DT\times N\) matrix \(\hat{\mathbf {Y}}\), for which each column stores the point tracks. Following the previous case of \(D=3\), this matrix can be written as^{Footnote 1}:

that is also low rank as \({\mathbf {Y}}\) but differing in value.

Both matrices use two different matrix arrangements of the data points, but they include exactly the same information. We can map from \(\mathbf {Y}\) matrix to \(\hat{\mathbf {Y}}\) using the relation:

where \(\mathbf {A}\) is a \((D^D N)\times N\) binary matrix. The inverse mapping can be written as:

where \(\mathbf {B}\) is also a \((D^D T)\times T\) binary matrix. Both \(\mathbf {A}\) and \(\mathbf {B}\) matrices are known a priori, and they can be easily obtained by considering the data structure in data matrices \(\hat{\mathbf {Y}}\) and \(\mathbf {Y}\).

### 4.2 Dual union of spatiotemporal subspaces

The arrangement of the point tracks through the matrices \(\mathbf {Y}\) or \(\hat{\mathbf {Y}}\) gives two different interpretations, and each of it can be associated with a distinct subspace clustering process. For instance, when analyzing the temporal domain using \(\mathbf {Y}\), we can define an affinity matrix to capture the temporal similarities between instances at different time steps. This relation can be written as:

where \(\mathbf {T}\) encodes a temporal affinity \(T\times T\) matrix and \(\mathbf {E}_t\) is a \(DN\times T\) residual noise. In this context, the temporal affinity matrix \(\mathbf {T}\) measures the similarities between *D*-dimensional poses along time. Using this relation, we enforce \(\mathbf {Y}\) to lie in a union of \(S_f\) temporal subspaces, each of them with rank \(d_f\). We could say that the matrix \(\mathbf {T}\) is the lowest rank representation of the data \(\mathbf {Y}\) with respect to itself. It is worth noting that \(\mathbf {T}\) will be block-diagonal when the data samples have been grouped together in \(\mathbf {Y}\) according to the subspace memberships. This block pattern is lost for random entries, obtaining null entries when no affinities are provided. This type of self-expressive model was previously used by [18, 34] in the context of subspace clustering.

Similarly, we can analyze the spatial domain through the matrix \(\hat{\mathbf {Y}}\), by introducing an affinity matrix associated with a union of spatial subspaces in the presence of noise. In this case, we can write:

where \(\mathbf {S}\) encodes a spatial affinity \(N\times N\) matrix and \(\mathbf {E}_s\) is a \(DT \times N\) residual noise. In this case, we are enforcing \(\hat{\mathbf {Y}}\) to lie in a union of \(S_g\) spatial subspaces of rank \(d_g\), respectively, measuring the similarities between *D*-dimensional points in a same time instant. Basically, \(\mathbf {S}\) and \(\mathbf {T}\) are made of low-rank coefficients that define the union of subspaces in every domain, respectively. Once these affinity matrices are learned from data, off-the-shelf spectral clustering algorithms like [13] can be applied on each of them to discover the grouping in every domain. The temporal clustering splits the data into motion primitives and the spatial one into different object instances.

Nevertheless, the previous formulation requires full measurements on the tracking matrices \(\mathbf {Y}\) or \(\hat{\mathbf {Y}}\), which is not often the case in real applications. Previous subspace clustering algorithms assume the observation matrices to be complete [3, 18, 29, 34, 56]. As mentioned above, other approaches [17, 20] proposed an algorithm to jointly estimate missing entries and build a similarity graph for clustering, when considering a *single* union of temporal subspaces. The algorithm we present in the following section goes beyond these approaches and allows solving the matrix completion problem when considering the data to be spanned by *two different* union of subspaces. Our approach can handle high levels of missing entries and noisy measurements, and solve the problem by means of a one-stage optimization algorithm. This means our approach can produce more accurate solutions than competing techniques, while being more general.

## 5 Motion tracking completion and spatiotemporal subspace clustering

We next present our algorithm to simultaneously recover missing entries and estimate two similarity matrices for computing the spatial and temporal grouping. Note that neither prior information nor training data is used at all. The input to our algorithm are incomplete motion tracks of *N* *D*-dimensional points observed along *T* time instances that are arranged into the matrix \(\tilde{\mathbf {Y}}\). In addition, we also introduce an observation matrix \(\mathbf {O}\in \mathbb {R}^{N\times T}\) with binary entries that indicate whether the coordinates of a point at a specific time instant are observed or not.

### 5.1 Proposed formulation

Let us denote by \(\varvec{\varTheta }\equiv \{\mathbf {Y},\hat{\mathbf {Y}},\mathbf {T},\mathbf {S},\mathbf {E}_t,\mathbf {E}_s\}\) the set of model parameters we have to learn from the input data \(\varvec{\varGamma }\equiv \{\tilde{\mathbf {Y}},\mathbf {O}\}\). We introduce an optimization framework ruled by a cost function that accounts for the spatiotemporal clustering constraints of Eqs. (3) and (4), and enforces the similarity matrices \(\mathbf {T}\) and \(\mathbf {S}\) to be spanned by low-rank subspaces. Consequently, the combination of both constraints enforces the data in order to lie in a dual union of subspaces. Indeed, the single union of subspaces model can be seen as a degenerate case of our model (see Remark 1).

Since rank minimization is a non-convex NP-hard problem [41], the nuclear norm is approximated by its convex relaxation [12, 14]. Additionally, in order to be able to deal with data corrupted by noise and outliers, we use \(l_{2,1}\)-norm regularization, as the convex relaxation of the \(l_{2,0}\)-norm [33]. The objective function can therefore be written as:

where \(\{\phi ,\gamma ,\lambda _t,\lambda _s\}\) are predefined penalty term parameters.

### Remark 1

When the data points are not connected in the spatial domain, it means that the affinity matrix \(\mathbf {S}\) becomes the identity \(\mathbf {I}_N\) (we assume the data points are clean in this domain, i.e., \(\mathbf {E}_s=\mathbf {0}\)), and hence, our formulation degenerates to a union of temporal subspaces. On the other hand, when this occurs in the temporal domain (\(\mathbf {T}=\mathbf {I}_T\) and \(\mathbf {E}_t=\mathbf {0}\)), our formulation degenerates to a union of spatial subspaces.

### 5.2 Efficient augmented Lagrangian multiplier optimization

The optimization problem in Eq. (5) can be efficiently solved in a unified manner via an ALM method [8, 31]. Without loss of generality, we set \(\lambda \equiv \lambda _t\equiv \lambda _s\). In order to reduce the number of parameters and the complexity of the problem while improving convergence, we choose to bring the clustering constraints into the energy function using several Lagrange multipliers with a unique penalty weight \(\beta >0\). In addition, we introduce three support matrices \(\mathbf {Y}\equiv \mathbf {M}\), \(\mathbf {T}\equiv \mathbf {J}\), and \(\mathbf {S}\equiv \mathbf {K}\), to obtain the corresponding augmented Lagrangian function that can be written as:

where \(\varvec{\varTheta }_{L}\equiv \{\mathbf {M},\mathbf {Y},\mathbf {J},\mathbf {T},\mathbf {K},\mathbf {S},\hat{\mathbf {Y}},\mathbf {E}_s,\mathbf {E}_t\}\) includes the tracking completion, spatiotemporal similarity parameters, and residual noises. The Lagrange multipliers are defined as \(\{\mathbf {L}_1,\mathbf {L}_4\}\in \mathbb {R}^{DN\times T}\), \(\{\mathbf {L}_2,\mathbf {L}_3\}\in \mathbb {R}^{DT\times N}\), \(\mathbf {L}_5\in \mathbb {R}^{T\times T}\), and \(\mathbf {L}_6\in \mathbb {R}^{N\times N}\). Recall that we do not need to know the dimensions nor the bases of the temporal and spatial subspaces a priori, since Eq. (5) automatically selects the appropriate number of data points from every spatiotemporal subspace.

We propose to solve the problem in Eq. (6) by minimizing each variable individually and in closed form, while keeping fixed the rest of model parameters. Algorithm 1 explains the details. The expressions for estimating \(\mathbf {Y}\), \(\mathbf {T}\), \(\mathbf {S}\), and \(\hat{\mathbf {Y}}\) (steps 4, 6, 8, and 9) are obtained by computing the derivatives of Eq. (6) in \(\mathbf {Y}\), \(\mathbf {T}\), \(\mathbf {S}\), and \(\hat{\mathbf {Y}}\), respectively, and equating to zero. The subproblems to recover \(\mathbf {M}\), \(\mathbf {J}\), \(\mathbf {K}\), \(\mathbf {E}_t\), and \(\mathbf {E}_s\) are convex and have closed-form solutions. Particularly, for steps 2, 5, and 7, we apply a singular value thresholding minimization [10] with a ‘shrinkage operator’ \(S\frac{*}{\beta }(x)=\max (0,x-\frac{*}{\beta })\) where \(*=\{\phi ,\gamma \}\). In order to optimize the noise terms \(\mathbf {E}_t\) and \(\mathbf {E}_s\) (steps 10 and 11, respectively), we apply the Lemma 4.1 in [51]. After each iteration, the Lagrange multipliers are updated according to standard rules as shown in lines 12-13. Additionally, we also update the penalty weight \(\beta \) (step 14) to guarantee the convergence of our algorithm, following the upper bounded requirement of the alternating direction methods. Particularly, we apply a factor of 1.1 to increase \(\beta \) every iteration.

The theoretical convergence of our algorithms is not easy to proof, as the method is based on nine different blocks. However, we have empirically observed that for all experiments reported in the following section, the algorithm always converged in about \(190-220\) iterations. Additionally, we observe the optimality gap obtained in every iteration to monotonically decrease. An example of this analysis is displayed in Fig. 1, where both constraints and full errors in Eq. (6) are represented for a specific case. As it can be seen, after around 50 iterations all constraints are almost perfectly satisfied and the overall energy converges.

### 5.3 Complexity analysis

The most computationally demanding parts of Algorithm 1 are the steps 2, 5 and 7, which require computing several SVD operations over matrices of size \(DN\times T\), \(T\times T\) and \(N\times N\), respectively. Hence, our problem can be solved in polynomial time with a computational complexity of at most of \(\mathcal {O}(N^2 T+T^3+N^3)\) [23]. Note that this complexity could be easily reduced by orthogonalizing the columns of the matrices \(\mathbf {Y}\) and \(\hat{\mathbf {Y}}\). The computation times (in unoptimized MATLAB code) on a commodity laptop with an Intel Core i7 processor at 2.4GHz for motion capture sequences for two and four people are displayed in Fig. 2. On average, the median computation time in experiments with sequences between 277 and 652 frames, and two people (\(N=82\) points) was of 51 seconds. Processing between 214 and 432 frames, and four people (\(N=164\) points) required a median time of 44 seconds. In any case, to handle larger datasets we could use current results Yao et al. [53] on the use of SVD operations on large datasets to address large-scale low-rank problems. This could really help to reduce the reported complexity. Moreover, our formulation could be extended to be employed in a sequential manner, being this a part of our future work.

## 6 Experimental results

In this section we report the performance of our algorithm to solve motion tracking completion, as well as temporal and spatial clustering on several challenging datasets. For all cases, we denote by \(\rho \) the fraction of missing entries in the input data. In all experiments, we set \(\phi =1.0\), \(\gamma =2.0\) and \(\lambda =0.03\). It is worth pointing out that we do not need fine-tuning these parameters, as the results were stable for wide range of values for \(\phi \in [0.1,10]\) and \(\gamma \in [0.2,20]\). Regarding the competing approaches, we will compare our algorithm, denoted as spatiotemporal track completion (ST2C), with the low-rank matrix completion (LRMC) [10], and the bilinear factorization matrix completion (BFMC) [9], two approaches where the rank is automatically estimated. We do not include [6, 22] as these methods require knowing the rank of every subspace a priori. Unfortunately, neither can we report the results of [17, 20] as its source code is not publicly available. Recall, however, that both approaches did only consider a single union of subspaces.

To establish a quantitative evaluation, we will compute three types of errors: the temporal \(e_{TC}\) and spatial \(e_{SC}\) clustering error as well as the motion tracking completion \(e_{MTC}\) (this error is equivalent to a matrix completion evaluation) that are defined as:

where \(\mathbf {Y}_{GT}\) and \(\mathbf {Y}\) denote the ground truth and the recovered matrices, respectively. For the temporal clustering error, we have obtained the ground truth segmentation over noise-free and complete measurement matrices by applying [34] to compute the similarity matrices and [13] to obtain the clusters. Spatial ground truth were annotated by hand. This means the evaluation we propose for temporal clustering is actually an implicit comparison with respect to the competing approach [34] by assuming clear measurements.

### 6.1 Real experiments on motion capture data

We evaluate the proposed approach on the CMU MoCap dataset. We consider several scenarios with either two or four people interacting and performing complex motions in 3D. On average, the sequences we consider are 433 frames long, and the number of points per frame is either 82 (two people) or 164 (four people). Specifically, we select eight sequences with two people: *23_16 (Jump)*: subjects alternating synchronized jumping jacks; *19_05 (Pull)*: a subject pulls the other by the elbow; *22_20 (Violence)*: a subject picks up high stool and threatens to strike the other; *20_06 (Soldiers)*: subjects follow a soldiers march; *23_19 (Stares Down)*: a subject stares down the other and leans with hands on high stool; *22_12 (Stumbles)*: a person stumbles into the other; *20_09 (Nursery)*: people follow a nursery rhyme; and *22_10 (Shelters)*: a person shelters the other from harm. A total of four sequences with four people are considered, synthetically generated by combining pairs of sequences with two people.

All sequences are corrupted in three different ways: 1) randomly removing a fraction \(\rho =\{0.1, \ldots , 0.8\}\) of entries of the measurement matrix \(\mathbf {Y}\); 2) removing a structured fraction \(\rho =\{0.1, \ldots , 0.4\}\) of entries of the measurement matrix \(\mathbf {Y}\) where we emulate temporal self-occlusions or lack of visibility, by including patterns with 50% of structured missing entries per frame; and 3) adding noise to the observed points, according to a Gaussian distribution with standard deviation \(\sigma _{noise}=\frac{\tau }{100} \psi \), where \(\tau \) controls the amount of noise, and \(\psi \) represents the maximum distance of a point to the centroid of all the points. An example of these artifacts is shown in Fig. 3, for both random and structured missing entries.

Figures 4 and 5 summarize the results for two and four people, respectively. Each graph depicts the results of all 3 methods for one specific sequence, at increasing levels or missing data for the two types of cases we propose. Solid and dashed lines represent results for noise-free and noisy measurements, respectively. Our approach and BFMC [9] show similar error patterns, even though ours being always consistently better. A breaking point is achieved earlier by BFMC [9], showing our superiority in terms of robustness against this type of artifacts. As it can be seen, our solution by assuming noise can even provide better solutions than the competing approaches for clean annotations. The performance of LRMC [10] is far below the other two algorithms. We hypothesize this is due to the *pseudo-block structure* of the missing data, as each missing point does indeed represent three—recall that for this experiment, D\(=\)3—adjacent null elements in \(\mathbf {Y}\). This is especially relevant when the missing entries are structured, as it can be seen in the bottom part of Figs. 4 and 5. Note also that BFMC [9] and LRMC [10] are specifically designed for matrix completion. These algorithms do not provide any kind of affinity measure, that allows subsequent clustering. Some instances for several scenarios when the missing entries are random are displayed in Fig. 6. Moreover, our algorithm is faster than the competing approaches, producing an speed up of \(2.7\times \) when BFMC [9] is considered.

As we have commented above, our approach also estimates spatial and temporal clustering. Tables 2 and 3 summarize the mean error for each sequence and all levels of missing data for the random and structured cases, respectively, for noiseless (\(\tau =0\)) and noisy (\(\tau =\{1,2\}\)) measurements. As it can be seen, our approach produces very good results for most of the sequences, especially in terms of spatial clustering where we obtain an almost negligible clustering error. In fact, our algorithm produces better spatial clustering solutions with artifacts that the provided by LRR [34] even assuming full observations (remember that this method needs full data, i.e., \(\rho =0\)), as it is observed in Table 2. For temporal clustering, our solution is implicitly compared with respect to LRR Liu et al. [34], showing consistent solutions as a function of the level of noisy. For both types of artifacts, the worst results are obtained for the sequences *Shelters* and *Nursery*, since the type of motion does not include many deformation cycles. In any case, even for these complex motions, our algorithm provides a good trade-off between accuracy and computational cost.

### 6.2 Real experiment on ASL tracking completion

We now consider the completion of time series trajectories from a real monocular video. We use two American Sign Language (ASL) sequences [24] of 114 image frames, where 77 feature points per sequence are tracked. For the purpose of evaluating the spatial clustering ability of our algorithm, we merge the frames of the two sequences to render a unique video with two faces (with N=154 feature points). The face tracks are corrupted by missing entries (corresponding to \(\rho =0.1445\)) due to partial occlusions produced by one or two hands (self-occlusion), or by the face self-rotation causing lack of visibility.

Results are shown in Fig. 7. We compare against [24], a completion algorithm that estimates missing tracks enforcing low-rank trajectory models. Note that this approach requires fine-tuning the rank of the subspace a priori, producing very different solutions when this is done. We use the rank value provided by the authors. For the non-visible points, there is no ground truth, but from a qualitative inspection we observe our approach to be remarkably more accurate (see, for instance, the rightmost frame of Fig. 7). We may nevertheless measure the accuracy of the estimated position for the visible points (red dots). For these, our method provides a solution 2.35 times more accurate than that obtained by [24] without assuming any rank knowledge.

### 6.3 Real experiment on multi-fish data

Finally, we consider a very challenging multi-fish real sequence taken from the DAVIS dataset Perazzi et al. [38]. Particularly, this is a sequence of 51 frames where 33 points per image are tracked. The incomplete tracks are provided by hand, obtaining a level of missing entries of \(\rho =0.129\) (as a combination of random and structured missing tracks), due mainly to multiple partial occlusions produced by the dynamic motion of the animals. A qualitative evaluation of our algorithm is displayed in Fig. 8. As it can be seen, our algorithm can accurately recover the missing tracks without assuming any extra information about the type of observed scene, such as the number of objects, the type of deformations, or the rank of every subspace.

## 7 Conclusion

We have proposed an algorithm for simultaneous motion track completion and clustering based on two different criteria. For this purpose, we have devised a model that allows to jointly enforce the entries of the matrix to lie in a dual union of subspaces. This goes beyond state-of-the-art solutions, which were restricted to single union of subspaces. Using the machinery of the augmented Lagrange multipliers, we have obtained an efficient solution to the problem, and applied it to the case of input data obtained from motion capture systems of multiple human motion, and to challenging real videos. Extensive evaluation demonstrates the ability of our approach to recover missing tracks and segment input data into each of the objects being captured, and automatically discovering their motion primitives. Further theoretical analysis of the algorithm and convergence proofs will be investigated in the future. Moreover, we pretend to extend our formulation for sequential estimation as the data arrive.

## Notes

Note that other dimensions could be used, such as 2D motion tracking where \(D=2\). In this case, we only need to eliminate the rows of the matrices \(\mathbf {Y}\) and \(\hat{\mathbf {Y}}\) corresponding to the

*z*component. Theoretically, other dimensions can be also used, such as 1D image sensors.

## References

Agudo, A., Moreno-Noguer, F.: Learning shape, motion and elastic models in force space. In: International Conference on Computer Vision, pp. 756–764 (2015)

Agudo, A., Moreno-Noguer, F.: Combining local-physical and global-statistical models for sequential deformable shape from motion. Int. J. Comput. Vis.

**122**(2), 371–387 (2017)Agudo, A., Moreno-Noguer, F.: DUST: Dual union of spatio-temporal subspaces for monocular multiple object 3D reconstruction. In: Computer Vision and Pattern Recognition, pp. 1513–1521 (2017)

Agudo, A., Moreno-Noguer, F.: Force-based representation for non-rigid shape and elastic model estimation. IEEE Trans. Pattern Anal. Mach. Intell.

**40**(9), 2137–2150 (2018)Akhter, I., Simon, T., Khan, S., Matthews, I., Sheikh, Y.: Bilinear spatiotemporal basis models. TOG

**31**(2), 17:1-17:12 (2012)Balzano, L., Szlam, A., Recht, B., Nowak, R.: K-subspaces with missing data. In: Statistical Signal Processing Workshop, pp. 612–615 (2012)

Bhojanapalli, S., Jain, P.: Universal matrix completion. In: International Conference on Machine Learning, pp. 1881–1889 (2013)

Boyd, S., Parikh, N., Chu, E., Peleato, B., Eckstein, J.: Distributed optimization and statistical learning via the alternating direction method of multipliers. Found. Trends Mach. Learn.

**3**(1), 1–122 (2011)Cabral, R., de la Torre, F., Costeira, J. P., Bernardino, A.: Unifying nuclear norm and bilinear factorization approaches for low-rank matrix decomposition. In: International Conference on Computer Vision, pp. 2488–2495 (2013)

Cai, J., Candes, E., Shen, Z.: A singular value thresholding algorithm for matrix completion. SIAM J. Optim.

**20**(4), 1956–1982 (2010)Candès, E.J., Plan, Y.: Matrix completion with noise. IEEE J. Mag.

**99**(6), 925–936 (2010)Candès, E.J., Recht, B.: Exact matrix completion via convex optimization. Found. Comput. Math.

**9**(6), 717 (2008)Chen, W.Y., Song, Y., Bai, H., Lin, C., Chang, E.: Parallel spectral clustering in distributed systems. IEEE Trans. Pattern Anal. Mach. Intell.

**33**(3), 568–586 (2010)Chen, Y., Xu, H., Caramanis, C., Sanghavi, S.: Robust matrix completion with corrupted columns. In: International Conference on Machine Learning, pp. 873–880 (2011)

Chiang, K.Y., Hsieh, C.J., Dhillon, I.S.: Matrix completion with noisy side information. In: Neural Information Processing Systems, pp. 3447–3455 (2015)

Dai, Y., Li, H., He, M.: A simple prior-free method for non-rigid structure from motion factorization. In: Computer Vision and Pattern Recognition, pp. 2018–2025 (2012)

Elhamifar, E.: High-rank matrix completion and clustering under self-expressive models. In: Neural Information Processing Systems, pp. 73–81 (2016)

Elhamifar, E., Vidal, R.: Sparse subspace clustering: algorithm, theory, and applications. IEEE Trans. Pattern Anal. Mach. Intell.

**35**(11), 2765–2781 (2013)Eriksson, B., Balzano, L., Nowak, R.: High-rank matrix completion and subspace clustering with missing. In: International Conference on Artificial Intelligence and Statistics (2012)

Fan, J., Chow, T.: Sparse subspace clustering for data with missing entries and high-rank matrix completion. Neural Netw.

**93**(9), 36–44 (2017)Ganti, R., Balzano, L., RWillett.: Matrix completion under monotonic single index models. In: Neural Information Processing Systems, pp. 1873–1881 (2015)

Ghahramani, Z., Hinton, G.E.: The EM algorithm for mixtures of factor analyzers. Technical Report CRG-TR-96-1, University of Toronto (1996)

Golub, G., Van Loan, C.: Matrix computations. Johns Hopkins Univ Pr (1996)

Gotardo, P.F.U., Martinez, A.M.: Computing smooth time-trajectories for camera and deformable shape in structure from motion with occlusion. IEEE Trans. Pattern Anal. Mach. Intell.

**33**(10), 2051–2065 (2011)Hare, S., Saffari, A., Torr, P.: Struck: Structured output tracking with kernels. In: International Conference on Computer Vision, pp. 263–270 (2011)

Ionescu, C., Papava, D., Olaru, V., Sminchisescu, C.: Human3.6M: large scale datasets and predictive methods for 3D human sensing in natural environments. IEEE Trans. Pattern Anal. Mach. Intell.

**36**(7), 1325–1339 (2014)Jia, X., Lu, H., Yang, M.: Visual tracking via adaptive structural local sparse appearance model. In: Computer Vision and Pattern Recognition, pp. 1822–1829 (2012)

Joo, H., Simon, T., Sheikh, Y.: Total capture: A 3D deformation model for tracking faces, hands, and bodies. In: Computer Vision and Pattern Recognition, pp. 8320–8329 (2018)

Kanatani, K.: Motion segmentation by subspace separation and model selection. In: International Conference on Computer Vision, pp. 586–591 (2001)

Knott, M., Bartholomew, D.: Latent Variables Models and Factor Analysis. Edward Arnold, London (1999)

Lin, Z., Chen, M., Ma, Y.: The augmented lagrange multiplier method for exact recovery of corrupted low-rank matrices. Mathematical Programming (2010)

Liu, G., Yan, S.: Latent low-rank representation for subspace segmentation and feature extraction. In: International Conference on Computer Vision, pp. 1615–1622 (2011)

Liu, G., Lin, Z., Yu, Y.: Robust subspace segmentation by low-rank representation. In: International Conference on Machine Learning, pp. 663–670 (2010)

Liu, G., Lin, Z., Yan, S., Sun, J., Yu, Y., Ma, Y.: Robust recovery of subspace structures by low-rank representation. IEEE Trans. Pattern Anal. Mach. Intell.

**35**(1), 171–184 (2013)Ma, Y., Derksen, H., Hong, W., Wright, J.: Segmentation of multivariable mixed data via lossy data coding and compression. IEEE Trans. Pattern Anal. Mach. Intell.

**29**(9), 1546–1562 (2007)Ma, Y., Yang, A., Derksen, H., Fossum, R.: Estimation of subspace arrangements with applications in modeling and segmenting mixed data. SIAM Rev.

**50**(3), 413–458 (2008)Nguyen, D.M., Calderbank, R., Deligiannis, N.: Geometric matrix completion with deep conditional random fields. IEEE Trans. Neural Netw. Learn. Syst.

**31**(9), 3579–3593 (2020)Perazzi, F., Pont-Tuset, J., McWilliams, B., Van Gool, L., Gross, M., Sorkine-Hornung, A.: A benchmark dataset and evaluation methodology for video object segmentation. In: Computer Vision and Pattern Recognition, pp. 724–732

Rao, S., Tron, R., Vidal, R., Ma, Y.: Motion segmentation in the presence of outlying, incomplete or corrupted trajectories. IEEE Trans. Pattern Anal. Mach. Intell.

**32**(10), 1832–1845 (2010)Rao, S., Yang, A., Sastry, S., Ma, Y.: Robust algebraic segmentation of mixed rigid-body and planar motions in two views. Int. J. Comput. Vis.

**88**(3), 425–446 (2010)Recht, B., Fazel, M., Parrilo, P.A.: Guaranteed minimum-rank solutions of linear matrix equations via nuclear norm minimization. SIAM Rev.

**52**(3), 471–501 (2010)Sui, Y., Zhao, X., Zhang, S., Yu, X., Zhao, S., Zhang, L.: Self-expressive tracking. Pattern Recog.

**48**(9), 2872–2884 (2015)Sui, Y., Wang, G., Tang, Y., Zhang, L.: Tracking completion. In: European Conference on Computer Vision, pp. 194–209 (2016)

Tipping, M., Bishop, C.: Probabilistic principal component analysis. J. R. Stat.

**21**(3), 611–622 (1999)Tipping, M.E., Bishop, C.M.: Mixtures of probabilistic principal component analysers. Neural Comput.

**11**(2), 443–482 (1999)Van der Aa, N.P., Luo, X., Giezeman, G.J., Tan, R.T., Veltkamp, R.C.: UMPM benchmark: a multi-person dataset with synchronized video and motion capture data for evaluation of articulated human motion and interaction. In: International Conference on Computer Vision Workshops, pp. 1264–1269 (2011)

Wang, D., Lu, H., Yang, M.: Least soft-thresold squares tracking. In: Computer Vision and Pattern Recognition, pp. 2371–2378 (2013)

Xiao, J., Chai, J., Kanade, T.: A closed-form solution to non-rigid shape and motion. Int. J. Comput. Vis.

**67**(2), 233–246 (2006)Yan, J., Pollefeys, M.: A general framework for motion segmentation: independent, articulated, rigid, non-rigid, degenerate and non-degenerate. In: European Conference on Computer Vision, pp. 94–106 (2006)

Yang, C., Robinson, D., Vidal, R.: Sparse subspace clustering with missing entries. In: International Conference on Machine Learning, pp. 2463–2472 (2015)

Yang, J., Yin, W., Zhang, Y., Wang, Y.: A fast algorithm for edge-preserving variational multichannel image restoration. SIAM J. Imaging Sci.

**2**(2), 569–592 (2009)Yang, J., Parikh, D., Batra, D.: Joint unsupervised learning of deep representations and image clusters. In: CVPR (2016)

Yao, Q., Kwok, J.T., Wang, T., Liu, T.: Large-scale low-rank matrix learning with nonconvex regularizers. IEEE Trans. Pattern Anal. Mach. Intell.

**41**(11), 2628–2643 (2019)Zhang, T., Ghanem, B., Liu, S., Ahuja, N.: Low-rank sparse learning for robust visual tracking. In: European Conference on Computer Vision, pp. 470–484 (2012)

Zheng, Y., Tang, B., Ding, W., Zhou, H.: A neural autoregressive approach to collaborative filtering. In: ICML (2016)

Zhu, Y., Huang, D., de la Torre, F., Lucey, S.: Complex non-rigid motion 3D reconstruction by union of subspaces. In: Computer Vision and Pattern Recognition, pp. 1542–1549 (2014)

## Acknowledgements

This work has been partially supported by the Spanish State Research Agency through the María de Maeztu Seal of Excellence to IRI MDM-2016-0656, by the Spanish Ministry of Science and Innovation under project HuMoUR TIN2017-90086-R and the Salvador de Madariaga grant PRX19/00626, and by the ERA-net CHIST-ERA project IPALM PCI2019-103386.

## Funding

Open Access funding provided thanks to the CRUE-CSIC agreement with Springer Nature.

## Author information

### Authors and Affiliations

### Corresponding author

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

The original online version of this article was revised: The funding note was missing.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Agudo, A., Lepetit, V. & Moreno-Noguer, F. Simultaneous completion and spatiotemporal grouping of corrupted motion tracks.
*Vis Comput* **38**, 3937–3952 (2022). https://doi.org/10.1007/s00371-021-02238-8

Accepted:

Published:

Issue Date:

DOI: https://doi.org/10.1007/s00371-021-02238-8

### Keywords

- Point track completion
- Spatiotemporal clustering
- Augmented Lagrangian multiplier