Rank-Adaptive Tensor Completion Based on Tucker Decomposition

Tensor completion is a fundamental tool to estimate unknown information from observed data, which is widely used in many areas, including image and video recovery, traffic data completion and the multi-input multi-output problems in information theory. Based on Tucker decomposition, this paper proposes a new algorithm to complete tensors with missing data. In decomposition-based tensor completion methods, underestimation or overestimation of tensor ranks can lead to inaccurate results. To tackle this problem, we design an alternative iterating method that breaks the original problem into several matrix completion subproblems and adaptively adjusts the multilinear rank of the model during optimization procedures. Through numerical experiments on synthetic data and authentic images, we show that the proposed method can effectively estimate the tensor ranks and predict the missing entries.


Introduction
Tensors, as a higher-order generalization of vectors and matrices, can preserve the original structure and the latent characteristics of multi-dimensional data, such as images and videos. To store and process these data, vectorization or matricization may break the adjacency relation and lead to the loss of crucial information in practical applications. Therefore, tensor analysis of data has gathered increasing attention due to its better performance in finding hidden structures and capturing potential features. Due to data missing from a transmission or insufficient collection, sometimes we have to deal with incomplete data, which increases the operation cost and the difficulty of multi-dimensional data analysis. Therefore, tensor completion, also referred to as tensor recovery, plays a key role in processing and analyzing incomplete multi-dimensional data. In tensor completion, the prediction of unknown data from a few observed entries is achieved based on the correlation between different parts of data or, simply, the hidden low-rank structure. Many real-world data lie in a latent low dimensional space since they may only relate to a small number of contributions; thus, we can use tensor completion to infer the missing data. It has already been widely applied in many scientific fields, including surrogate construction [1], image and video recovery [2][3][4], traffic data completion [5] and the MIMO (multi-input multi-output) problems in information theory [6].
The tensor completion methods can be roughly classified into model-based and nonmodel-based ones. Extending the idea from existing matrix completion algorithms [7,8], non-model-based methods directly formulate the tensor completion task as a rank minimization problem subject to linear constraints, and then relax it to a nuclear norm minimization problem, such as LRTC (low rank tensor completion) [9]. However, model-based methods achieve the goal differently. Based on a decomposition model with a given rank, these methods minimize the error on the known entries by adjusting the model parameters, such as CP-Wopt (CP-weighted optimization) [10], Tucker-Wopt (Tucker-weighted optimization) [5], M 2 SA (multilinear subspace analysis with missing values) [11] and so on.
The computation cost of non-model-based methods is closely related to the size of the tensor, leaving little room for reducing the time complexity. On the contrary, this can be more flexibly controlled in model-based methods by altering the model size. Nonetheless, there still exists a big challenge when choosing the model's rank. Underestimation of the tensor rank makes it harder to reach our desired accuracy, whereas overestimation may lead to a poor generalization on the unobserved part of entries. Therefore, rank-adaptive methods are needed and worth studying. In [1], a greedy scheme is designed to find the fittest rank by gradually increasing the number of factors in the CP decomposition model. In [12], from an overestimated rank, a systematic approach to reducing the CP ranks to optimal ones is developed.
Focusing on tensor completion based on Tucker decomposition, we propose a novel rank-adaptive tensor completion method and verify its efficiency through experiments on synthetic and real practical data. The rest of the paper is organized as follows. Section 2 formulates the problem setting. Section 3 presents Tucker decomposition and the related works. We propose our rank-adaptive tensor completion based on the Tucker decomposition (RATC-TD) approach in Section 4 and verify it through numerical experiments in Section 5. Finally, we conclude our work in Section 6.

Notations and the Tensor Completion Problem
Before summarizing the related work and presenting our algorithm, this section first introduces some basic definitions that will be used in the following sections, and then states our problem settings.

Notations
We follow the notations in [13]. Let lowercase letters denote scalars, e.g., a; let lowercase bold letters denote vectors, e.g., a; let bold capital letter denote matrices, e.g., U; let capital fraktur letter denote high-order tensors, e.g., T . The ith element of a vector a is denoted as a i ; the element of matrix U with index (i, j) is denoted by u ij ; the element of N-way tensor T with index (i 1 , i 2 , · · ·, i N ) is denoted by t i 1 i 2 ···i N . A tensor can be viewed as a multi-dimensional array, and the number of dimensions is generally called the order of the tensor. For example, matrices are second-order tensors, while vectors are first-order tensors. A mode-n fiber is a vector extracted from a tensor by fixing all indices except the nth one. Consider a matrix as an example; mode-1 fibers refer to the columns, and mode-2 fibers refer to the rows. The mode-n unfolding of a tensor T ∈ R I 1 ×I 2 ×···× I N is to rearrange the mode-n fibers as the columns of the resulting matrix, denoted as T (n) ∈ R I n ×I 1 ···I n−1 I n+1 ···I N . Naturally, the reverse of unfolding, the process of rearranging T (n) ∈ R I n ×I 1 ···I n−1 I n+1 ···I N into T ∈ R I 1 ×I 2 ×···× I N , is called folding.
The n-mode matrix product is the multiplication of a tensor T ∈ R I 1 ×I 2 ×···× I N with a matrix U ∈ R J×I n , denoted as X = T × n U, where X ∈ R I 1 ×···×I n−1 ×J×I n+1 ×···×I N . It can be regarded as multiplying each mode-n fiber of T with U. The matricized form is given by and the element-wise operations can be obtained by The norm of a tensor T ∈ R I 1 ×I 2 ×···× I N is a higher-order analog of the matrix Frobenius norm, defined by The inner product of two same sized tensors T , X ∈ R I 1 ×I 2 ×···× I N is defined by

The Tensor Completion Problem
Tensor completion is the problem of predicting missing entries through a few sampled entries of a tensor based on the assumption that it has a low-rank structure. Supposing we have a partially observed tensor T ∈ R I 1 ×···×I N , the set of indices where entries are observed is denoted as Ω. Let P Ω be an operator on R I 1 ×···×I N , such that P Ω (X ) is equal to X on Ω and is equal to 0 otherwise. The low-rank tensor completion problem can be formulated as min X rank (X ) s.t. P Ω (X ) = P Ω (T ).
Although the formulation seems easy, how to measure the rank of a tensor is still an open question. In previous research, the CP rank [1,12] and the Tucker rank [9,14,15] were mostly considered. After the tensor-train (TT) decomposition was proposed in [16], tensor completion based on the TT rank was studied in [3,17,18]. The low-tubal rank tensor completion problem was studied in [19][20][21]. In addition, the combination of the CP and the Tucker ranks was investigated in [22].
Since matrices are second-order tensors, matrix completion can be viewed as a special case of tensor completion. Using the matrix nuclear norm to approximate the rank of a matrix is studied for matrix completion in [23]. Liu et al. [9] generalized this to the tensor scheme by defining the nuclear norm of tensors and proposing the following low-rank tensor completion problem: min X X * s.t. P Ω (X ) = P Ω (T ).
The nuclear norm of a tensor is defined by X * := ∑ N n=1 X (n) * , where X (n) * is the nuclear norm of the matrix X (n) . The nuclear norm can be computed by the sum of the singular values. However, the computation involves SVD (singular value decomposition) of the unfolding matrix T (n) in each iteration, which is expensive when the size of T is large. To control the computation cost, this problem is reformulated based on tensor decomposition [5,11]. Particularly, the low-rank tensor completion problem based on Tucker decomposition can be written as where X is the completed goal tensor, (R 1 , · · ·, R N ) is a predefined multilinear rank, A n ∈ R I n ×R n and · Ω denote the norm on the observation elements, i.e., P Ω (·) F . Methods are actively developed to solve this problem, including M 2 SA [11], gHOI (generalized higher-order orthogonal iteration) [24] and Tucker-Wopt [5]. However, these algorithms typically require the multilinear ranks given a priori, both underestimating and overestimating the ranks can result in inaccurate completion results. To handle this issue, we in this work propose a rank-adaptive tensor completion approach without requiring the multilinear ranks given a priori.

The Tucker Decomposition and Its Computation
We review Tucker decomposition and its related algorithms in this section.

Tucker Decomposition
Tucker decomposition was first introduced by Tucker [25]. For a Nth-order tensor T ∈ R I 1 ×I 2 ×···×I N , its Tucker decomposition has the form where G ∈ R R 1 ×···×R N is a core tensor and A n ∈ R I n ×R n , n = 1, 2, · · ·, N, are factor matrices. For simplicity, we assume all the factor matrices have orthogonal columns. R n is the rank of the mode-n unfolding matrix T (n) . As described in [13], Tucker decomposition can be viewed as a higher-order generalization of PCA (principal component analysis) in some sense. In Tucker decomposition, the columns of the factor matrix represent the components in each mode, and each element of the core tensor characterizes the level of interaction between the components in different modes. The tuple (R 1 , · · ·, R N ) is called Tucker rank or multilinear rank. However, practically, we prefer to use the truncated version of Tucker decomposition, where we set R n < rank(T (n) ) for one or more n. Given the truncation (R 1 , · · ·, R N ), the approximation of the truncated Tucker decomposition of a tensor T ∈ R I 1 ×···×I N can be described as where G ∈ R R 1 ×···×R N , A n ∈ R I n ×R n is the nth factor matrix, and I R n ×R n is an identity matrix of size R n × R n .

The Higher-Order Orthogonal Iteration (HOOI) Algorithm
There are several approaches to computing the truncated Tucker decomposition of a tensor. One of the most popular methods is the higher-order orthogonal iteration (HOOI) algorithm [26], also referred to as the alternative least square (ALS) algorithm for Tucker decomposition. It is an alternative iterating method, where we fix all except one factor matrix each time, and then minimize the objective function in (9). Specifically, given initial guesses {A (0) n : n = 1, · · ·, N}, at the kth iteration, for each n = 1, · · ·, N, we fix all the factor matrices except A n , and then find the optimal solution to the subproblem n , this optimization problem can be simplified as where B ∈ R R 1 ×···R n−1 ×I n ×R n+1 ···R N and B (n) is the mode-n unfolding matrix form of B. It can be considered as a constrained least squares problem [27], and thus the solution to (10) can be easily obtained by the following steps: Unfold B * at the nth mode to obtain B * (n) , then perform a truncated rank-R n singular value decomposition (B * (n) ) [R] = UΣV T = B (n) ; 3.
Compute A (k) We iteratively solve these subproblems until a given stopping criterion is reached, i.e., the difference between the solutions at two adjacent iterations is small enough, or the value of the objective function decreases very slightly. The complete procedure of HOOI is presented in Algorithm 1.

The Rank-Adaptive HOOI Algorithm
HOOI requires the multilinear rank (R 1 , · · ·, R N ) given a priori, which is hard to be determined in practice. Instead of (9), Xiao and Yang [27] consider the following form of the low multilinear rank approximation problem: where is a given tolerance. A rank-adaptive HOOI algorithm is proposed in [27], which adjusts the truncation R n for dimension n in the HOOI iterations by where (B (n) ) [R] is the best rank-R approximation of B (n) . For the full SVD of B (n) = UΣV T , it can be calculated by (B (n) ) [R] = U :,1:R Σ 1:R,1:R V T :,1:R . In [27], it is proven that (13) is a local optimal strategy for updating R n , i.e., the optimal solution of the following problem: Details of the above procedure are summarized in Algorithm 2.

A Rank-Adaptive Tensor Recovery Scheme
This section proposes a rank-adaptive tensor completion scheme based on truncated Tucker decomposition (RATC-TD).
Analogous to the rank-adaptive HOOI algorithm, instead of (7), we consider a different form of the low-rank tensor completion problem: Note that if the data are noisy, the constraint must be relaxed to X − T 2 Ω < T 2 Ω , where is a given tolerance of the relative error on the observation part between the original tensor and the completed one.
Using an alternative optimization technique, problem (15) can be divided into N subproblems, which will be detailedly represented in Section 4.1. To address those subproblems, the singular value thresholding (SVT) algorithm [7] is introduced in Section 4.2. The entire algorithm is summarized in Section 4.3.

Alternative Optimization in Tensor Completion
We solve (15) by an alternative iteration method. For each n = 1, · · ·, N, initialize R (0) n = I n , and the initial guess A (0) n can be either randomly set or given by HOSVD (higherorder SVD) [13] of P Ω (T ). At the kth iteration, for each n = 1, · · ·, N, by fixing all the factor matrices except A n , we solve the subproblem Denoting B := G × n A (k) n , (16) is equivalent to min B rank(B (n) ) s.t. P Ω (X ) = P Ω (T ), where B (n) is the mode-n unfolding matrix form of B. However, this rank minimization problem is NP-hard. Its tightest convex relaxation is min B B (n) * s.t. P Ω (X ) = P Ω (T ), where B (n) * is the nuclear norm of the matrix B (n) , which can be computed by the sum of the singular values. The matrix form of this problem can be written as [27] min B B * s.t. P Ω (BM T ) = P Ω (T (n) ), where T (n) is the mode-n unfolding matrix form of T , and ⊗ is the Kronecker product. In this work, we use the singular value thresholding (SVT) algorithm [7] to obtain a proximity solution to (19).

Solving the Subproblems Using SVT
Following the notation used in [7], we first introduce the singular value thresholding operator. Consider the skinny singular value decomposition of a matrix X ∈ R n 1 ×n 2 of rank r, where U and V are, respectively, n 1 × r and n 2 × r matrices with orthonormal columns, and the singular values σ i > 0 for i = 1, · · ·, r. Given the shrinkage threshold τ > 0, the singular value thresholding operator D τ is defined by According to the deduction of [7], for each τ > 0 and Y ∈ R n 1 ×n 2 , the singular value shrinkage operator (21) obeys The SVT algorithm utilizes the singular value thresholding operator D τ and its property (22) to handle the subproblem (19). Consider the proximal problem for τ > 0, the solution of which converges to that of (19) as τ → ∞. This optimization problem can be solved by a Lagrangian multiplier method known as the Uzawa's algorithm [28]. Given the Lagrangian of (23) where Y has the same size as T (n) , the optimal B * and Y * should satisfy Starting with Y (0) = 0, Uzawa's algorithm finds the saddle point (B * , Y * ) through an iterative procedure given by where {δ k } k≥1 > 0 are scalar step sizes. The sequence {B (k) } converges to the unique solution to (23). The update of Y is actually based on the gradient descent method if we note that Now, we have to compute the minimizer of (26). Observe that the factor matrices {A k : k = 1, · · ·, N} have orthogonal columns. Based on the orthogonal invariance property of the Frobenius norm, we have which in the matrix form gives that Utilizing this property, According to (22), the optimal B * is given by D τ (P Ω (Y)M) = D τ (Y M) since P Ω (Y) = Y for all k ≥ 0. Therefore, Uzawa's algorithm finally takes the form also referred to as the shrinkage iterations in SVT.
To obtain an approximation to the solution of (19), we choose a large enough τ and perform the iterations (31) until the stopping criteria T − B (k) M T 2 Ω < T 2 Ω are reached, starting with Y (0) = 0 ∈ R I 1 ×···×I N .
The overall process of solving the subproblem (18) is shown in Algorithm 3.

The Rank-Adaptive Tensor Completion Algorithm
This section summarizes our proposed method, namely the rank-adaptive tensor completion algorithm. Based on Tucker decomposition, this algorithm can complete a tensor with only a few observed entries and adaptively estimate its multilinear rank.
Given a tensor T ∈ R I 1 ×···×I N , only entries with indices in the set Ω are observed. Our goal is to predict the unobserved entries based on the premise that T has a low-rank structure. In this work, we consider the multilinear rank of the tensor. We solve this problem by finding a low multilinear rank tensor X whose entries on the observation part satisfy X − T 2 Ω < T 2 Ω , where is a given tolerance. Here, we restate our problem setting (15) min G,A 1 ···,A N (R 1 , R 2 , · · ·, R N ) s.t. P Ω (X ) = P Ω (T ), Similar to HOOI, we solve (15) by alternative iterations. By fixing all the factor matrices except one, we obtain the rank minimization subproblem (17). Since it is NP-hard, we instead consider its convex relaxation form (18), i.e., minimizing the nuclear norm, which can be handled by the SVT algorithm. The solution can be computed using Algorithm 3.
n is monotone decreasing. We perform the iterations until some stopping criteria are satisfied, e.g., the estimated rank (R 1 , R 2 , · · ·, R N ) remains unchanged, and the factor matrices have slight improvement, or the maximum number of iterations is reached. We present the detailed procedure of our proposed method in Algorithm 4.
folding at mode-n. 13: end while

Numerical Experiments
In this section, numerical experiments are conducted to the effectiveness of our proposed rank-adaptive tensor completion based on Tucker decomposition (RATC-TD) algorithm.

Test Problem 1: The Recovery of Third-Order Tensors
Many tensor recovery algorithms in the Tucker scheme require a priori given the rank of the tensor, but our method does not require this. In this test problem, synthetic data are considered, and we set the random composition tensor in the same way as [9]. We consider the tensor T ∈ R I 1 ×I 2 ×I 3 and obtain tensors by multiplying a randomly generated kernel G of size r 1 × r 2 × r 3 with randomly generated factor matrices A i , where A i ∈ R I i ×r i , i = 1, 2, 3. So, the tensor T can be represented by G × 1 A 1 × 2 A 2 × 3 A 3 , and the number of entries of T is denoted by |T |. By setting tensors in this way, we can obtain random tensors and ensure that the obtained tensors have a low-rank structure, which can be handled well by the classical low-rank tensor recovery methods.
In this experiment, we set the tensor size as 50 × 50 × 50, the kernel size as 5 × 5 × 5, and the kernel data are randomly generated from the interval [0, 1]. The factor matrices are of size 50 × 5, and the data of factor matrices are randomly generated from [−0.5, 0.5]. In order to show the robustness and reliability of our proposed algorithm, we add a small perturbation to the synthetic data. We add Gaussian noise with zero mean and standard deviation as 0.1 times the element mean and take the tensor with Gaussian noise as the ground truth data. As described above, our algorithm does not require the rank in advance, and the algorithm takes the size of the tensor as the initial tensor rank. With the continuous operation of the algorithm, the tucker rank is constantly reduced, and the exact rank can be approximated.
We compare the proposed algorithm with other Tucker-decomposition-based tensor completion algorithms (that require appropriate ranks given a priori), including gHOI [24], M 2 SA [11] and Tucker-Wopt [5], and test the sample estimation error error obs and outof-sample estimation error error val with different initial ranks at sampling rates r (the proportion of known data in the total data) of 0.05, 0.1 and 0.2, respectively. The size of the observed index set Ω is r|T |, and each index in Ω is randomly generated through the uniform distribution. Ω denotes the complementary set of Ω. The specific definitions of two kinds of errors are given by the following formulas: where X is the result obtained by completion algorithms.
To ensure the generalization of the proposed algorithms, we set the error tolerance on the observed data to 0.0025, which means we stop optimizing B with SVT when the relative error is less than or the maximum number of iterations is reached. When using SVT to optimize B, we set the relative error error SVT in the following format: For the estimated tensor X obtained at each iteration in Algorithm 4, the relative error is assessed as (32) and (33), for other methods considered, the relative errors are also assessed using the same form. In addition to the relative error and the maximum number of iterations, Algorithm 4 also terminates if the difference of the relative errors obtained from the algorithm for two consecutive steps is less than a certain threshold η, i.e., where the error (k) iter represents the relative error obtained at the kth iteration. The initial rank is set to R (0) = [r, r, r], r = 5, 10, 15. Tables 1 and 2 respectively show recovery error (32) and (33) of test problem 1. It can be seen that when the given initial rank does not match the ground truth data, gHOI, M 2 SA and Tucker-Wopt have large errors, while our RATC-TD has small errors. We emphasize that our proposed method does not require a given tensor rank; the initial rank of our proposed algorithm is set to the size of the tensor we aim to complete, i.e., R (0) = size(T ). In this experiment, we use our RATC-TD algorithm to estimate the tensor ranks. We next use the M 2 SA method to improve the estimated results. Our algorithm can be considered an initial step for other algorithms, and the effects of tensor completion are also sound when only our method is used for optimization. The recovery results without using M 2 SA are shown in Table 3. As seen from Table 2, since our method was used for optimization in advance, compared with the results obtained by simply using the M 2 SA method with a given rank, it gives a better recovery effect. Notably, our proposed algorithm can also stably complete the tensor under a small sampling rate and does not need to give an appropriate rank in advance.

Test Problem 2: The Recovery of Fourth-Order Tensors
Similarly to test problem 1, following the procedures in [9], we in this test problem generate the object tensor T ∈ R 30×30×30×30 by multiplying a randomly generated kernel G ∈ R 5×5×5×5 with randomly generated factor matrices of size R 30×5 . The ground truth data is defined by T with Gaussian noise added (the same setting as in test problem 1). For gHOI, M 2 SA, Tucker-Wopt and our proposed RATC-TD, different initial ranks are tested, and the sampling rate r is set to 0.1. The corresponding number of entries in the observed data set Ω is r|T |, and the index of each entry in Ω is randomly generated through the uniform distribution. The errors for this test problem are shown in Table 4, where error obs is the error on the observed data set (32) and error val is the error on the validation set (33). It can be seen that our RATC-TD method performs well for this test problem.

Test Problem 3: The Recovery of Real Missing Pictures
In this test problem, real practical data are considered, and the performance of our RATC-TD is compared with that of gHOI and M 2 SA. The initial complete images considered are shown in Figure 1. The data format of each image can be regarded as a third-order tensor. Each image here is stored as a tensor with size 256 × 256 × 3, where the third dimension is 3, representing three color channels of red, green, and blue. The ground truth data T for this test problem are the images in Figure 1 (details are as follows).  Two ways to construct partial images are considered, and our method is tested to recover the original images using the partial images. First, some black lines are added to the images, which can be considered a kind of structural missing, and the corrupted images are shown in the first column of Figure 2. The black line parts of images correspond to Ω, and the rest correspond to Ω. Second, after the initial image is converted into the data format of a third-order tensor T , the observed index set Ω is constructed with each index randomly generated through the uniform distribution, and the size of Ω is r|T | (where the sampling rate is r = 0.1). The images associated with Ω are shown in the first column of Figure 3.
From Figure 2, it is clear that the images obtained by our RATC-TD are closer to the ground truth images than the ones obtained by gHOI and M 2 SA. The numerical results representing the qualities of recovery are shown in Table 5. In addition to the errors error obs (32) on the observation set and the errors error val (33) on the unobserved data set, we also use SSIM (structure similarity index measure) [29] and PSNR (peak signal-to-noise ratio) parameters to evaluate the effect of our image restoration, which are often used to assess the quality of image restoration. SSIM ranges from 0 to 1; the larger the SSIM is, the smaller the image distortion is. Similarly, the larger the PSNR is, the less distortion there is. PSNR is used to measure the difference between two images. For the restored image X and the original image T , the PSNR between them is given by the following formula: where Maxpixel is the maximum value of the image pixel. In our test problem, Maxpixel = 255, and MSE is the mean square error between X and T . For the case with sampling rate r = 0.1, the corresponding restoration results are shown in Figure 3, and the numerical results representing the qualities of recovery are shown in Table 6. In this case, we only use 10 percent of the ground truth data, but it can be seen that our RATC-TD gives effective recovery results for this test problem.     For the gHOI method and the M 2 SA method, which need to be given the rank of the initial tensor in advance, we choose the initial rank as R (0) = [20,20,3]. It is worth noting that for real image data, it is difficult for us to know the exact Tucker rank in advance. When there is no way to know the rank in advance, in order to use gHOI and M 2 SA to achieve data completion, the initial rank can only be constantly adjusted through experiments, or the rank is given based on prior experience.

Conclusions
In this paper, we propose a novel rank-adaptive tensor completion based on the Tucker decomposition (RATC-TD) method. As the existing tensor completion methods based on Tucker decomposition, such as gHOI, M 2 SA and Tucker-Wopt, typically require the tensor rank given a priori, overestimating or underestimating the tensor ranks can lead to poor results. Inspired by the RaHOOI algorithm, we propose our algorithm based on the HOOI structure. Our proposed algorithm can adaptively estimate the multilinear rank of data in the process of tensor completion. We show the algorithm's effectiveness through experiments on completing synthetic data and genuine pictures. The results of our algorithm can also provide effective initial data for other tensor completion methods, such as M 2 SA. The further work we expect is to extend the algorithm to higher-dimensional problems, which requires us to optimize the algorithm further to reduce the algorithm's computational time.