Sparsity estimation in compressive sensing with application to MR images

The theory of compressive sensing (CS) asserts that an unknown signal $\mathbf{x} \in \mathbb{C}^N$ can be accurately recovered from $m$ measurements with $m\ll N$ provided that $\mathbf{x}$ is sparse. Most of the recovery algorithms need the sparsity $s=\lVert\mathbf{x}\rVert_0$ as an input. However, generally $s$ is unknown, and directly estimating the sparsity has been an open problem. In this study, an estimator of sparsity is proposed by using Bayesian hierarchical model. Its statistical properties such as unbiasedness and asymptotic normality are proved. In the simulation study and real data study, magnetic resonance image data is used as input signal, which becomes sparse after sparsified transformation. The results from the simulation study confirm the theoretical properties of the estimator. In practice, the estimate from a real MR image can be used for recovering future MR images under the framework of CS if they are believed to have the same sparsity level after sparsification.


Introduction
Compressive sensing (CS) initially emerged around the year 2006 (Donoho 2006;Candès, Romberg, and Tao 2006). The aim of CS is to recover a s-sparse signal x ∈ C N from m noisy observations y ∈ C m : y = Ax + e.
( 1 ) In (1), x has s nonzero elements implying that s = x 0 , A ∈ C m×N is a measurement matrix with m N satisfying restricted isometry property (Foucart and Rauhut 2013, Chapter 6) and e ∈ C m is additive noise such that e 2 ≤ η for some η ≥ 0.
To recover x in (1), it can be translated into a quadratically constrained 1minimization problem: minimize z∈C N z 1 subject to Az − y 2 ≤ η.
There are several specific algorithms to solve the optimization problem, e.g., orthogonal matching pursuit (OMP), compressive sampling matching pursuit (CoSaMP), iterative hard thresholding (IHT), and hard thresholding pursuit (HTP) (Foucart and Rauhut 2013, Chapter 3). All the algorithms mentioned above need sparsity s as an input. However, s is typically unknown in practice. The difficulty to recover x consists in estimating the sparsity s.
In this study, we propose a novel estimator for sparsity by using Bayesian hierarchical model (BHM). By assuming the sparsity s to be random, our target parameter is the mathematical expectation of s, E(s). The assumption of the randomness of s is reasonable in practice, since noise commonly exists in the process of acquiring signals such that it is impossible to obtain two sparse signals that are exactly the same even under the same control (Henkelman 1985). We estimate E(s) by using an observed 2D sparse image x. The unbiasedness of the estimator is derived analytically, and it can be confirmed through a simulation study. Another interesting finding is that the estimator is asymptotically normally distributed under regular conditions, which could be used to construct confidence interval of E(s). This property is also confirmed through the simulation study. In the simulation study, 2D magnetic resonance (MR) image is considered as an input signal. MR images are not sparse in general, but they are compressible (Haldar, Hernando, and Liang 2010). For instance, they can be transformed into a sparse image, x, through wavelet thresholding techniques (Prinosil, Smekal, and Bartusek 2010). In MR imaging circumstance, the measurement matrix A is a partial Fourier matrix and y is the measurements in frequency domain called k-space. In practice, once the estimate from the model is obtained for a sparsified image, it could be directly used for recovering future MR images under the framework of CS if the MR scanner can implement the wavelet thresholding techniques to sparsify the future dense images at the scanning stage and all the relevant images are believed to have the same sparsity level (E(s)) after sparsification, for example, but not limited to two scans of one person's brain within a short time interval.
This article is organized as follows. The statistical theory is introduced in Sec. 2. In Sec. 3, the methods used for the simulation study and real data analysis are specified. Results are presented in Sec. 4, followed by conclusion and discussion in Sec. 5. The article is closed with proofs of the statistical properties in Appendix.

Theory
Since s = x 0 , the concrete nonzero value of each element in x is not of interest. Assume that s is random, in the sense of that each element of x is randomly assigned by either zero or nonzero value. Thus, instead of s, the mathematical expectation of s, E(s), is the parameter of interest. In this section, we introduce a BHM (Cressie and Wikle 2011) to construct a new estimator for E(s) of an observed sparse image x.
BHM is a statistical model consisting of multiple layers. It is common to have three layers in the model. The first layer is data model used to model observed data, the second layer is process model used to model the unknown parameters of interest in data model, and the last one is hyperparameter model used to model unknown hyperparameters. Let o i = 1 (x i =0) , where 1 is the indicator function. A Bernoulli distribution can be used to describe the assumption of randomness of s: Then a second layer is needed to describe the distribution of p i given by where μ is intercept term, m i represents structured spatial effect, and i represents unstructured spatial effect. It is very common to include these two types of spatial effects, since there is typically a correlated random structure that induces correlation based on neighborhood structure as well as an uncorrelated random noise that varies from pixel to pixel (Carroll et al. 2015). Let m = {m 1 , m 2 , . . . , m N } be normal distributed with common mean 0 and precision matrix Q(θ), i.e., m ∼ N(0, Q(θ)). The precision matrix is defined as the inverse of covariance matrix of the random field. Let = { 1 , 2 , . . . , N } be independent and identically distributed normal with common mean 0 and precision matrix τ iid · I N , i.e., ∼ N(0, τ iid · I N ), where τ iid is marginal precision and I N is an identity matrix with dimension N × N. There are several spatial models using Markov property to construct the precision matrix Q such that the random field m is called as Gaussian Markov random field (GMRF), for instance, Besag model (Besag, York, and Mollié 1991), Leroux model (Leroux, Lei, and Breslow 2000) by using neighborhood information. The advantage of using GMRF is to produce great computational benefits (Rue and Held 2005). To use such models, conditional properties of the GMRF should be specified in advance, i.e., the order of neighborhood structure. More often a GMRF with Matérn covariance is more intuitive and easier to specify for two distinct sites i and j than to specify the conditional properties, especially in geostatistics. Matérn covariance is defined as (Matérn 1960): where K ν is the modified Bessel function of the second kind, is the Gammafunction, ν is a smoothness parameter, κ is a range parameter, and σ 2 is marginal variance. Two important properties of a random field with Matérn covariance are that the random field is stationary and isotropic (when the distance is Euclidean) and the covariance decreases as the distance between two sites i and j increases (Matérn 1960;Stein 1999). In this study, a GMRF with Matérn covariance is used. Actually, a continuous Gaussian random field with Matérn covariance function is a solution to stochastic partial differential equation (Whittle 1954(Whittle , 1963, where d is the dimension of the Gaussian random field z(s) with location index s, is the Laplacian operator and W(s) is a random field with Gaussian white noises. Lindgren, Rue, and Lindström (2011) have proposed that a GMRF defined on a regular unit distance lattice with a sparse precision can be used to represent a continuous Gaussian random field with Matérn covariance for ν ∈ Z + . The sparseness of the precision matrix Q is controlled by ν. The smaller the ν is, the sparser the Q is. For example, if ν = 1, Q can be regarded as a precision matrix defined through the third order of neighborhood structure, and the nonzero values of Q are controlled by κ.
Layer 3 It provides the prior distributions of the unknown hyperparameters such as Bayesian inference is applied to obtain the posterior distribution of p, i.e., the distribution of p|o. By using the posterior mean of p, we construct an estimator for the mean sparsity E(s): where O is a random field from which o is sampled. Its statistical properties are presented in the following propositions, of which the proofs are left in Appendix.
Proposition 1. E(s) is an unbiased estimator and its variance equals to the summation over all the elements of the covariance matrix of E(p|O).
Before presenting the next proposition, we introduce one definition and some notations which help to understand the proposition as well as its proof.

Definition.
A set of random variables, of which the dimension could be any positive integer, is said to be ρ-radius dependent if any two random variables in the set are independent as long as the distance between the two random variables is greater than ρ, where ρ ≥ 0.
Remark 1. ρ = 0 implies that the random variables are independent.
Let ρ * = ρ , the smallest integer greater than or equal to ρ. Let φ be a positive integer greater than ρ * . Let n 1 , n 2 be the dimensional size of a sparse image such that n 1 × n 2 = N. And the sparse image can be divided into a set of independent squares and borders which separate the squares. Each square has dimension (2φ + 1) × (2φ + 1) and consists of (2φ + 1) 2 random variables (pixels). The width of each border is ρ * and the border regions surrounding each square consist of 2(2φ + 1)ρ * + (ρ * ) 2 random variables. Let n sq be the number of squares. Let S k be the sum of the random variables in the kth square, S B k be the sum of the random variables in the borders surrounding the kth square, where k = 1, 2, . . . , n sq , also σ 2 k be the variance of S k and r 3 k = E|S k | 3 . Proposition 2. E(s) is asymptotically normally distributed as n 1 , n 2 → ∞, if (a) E p i |O 's are absolutely continuous random variables for 1 ≤ i ≤ N, and (b) n sq → ∞, and φ → ∞ at a rate slower than n 1/6 sq .
Remark 3. Condition (b) says that one can choose a relatively smaller smoothness parameter ν compared to the size of the image, implying that the spatial dependence is not strong, otherwise this assumption may not hold.
Remark 4. The asymptotics in the proposition refers to increasing-domain asymptotics. There is another type of asymptotics, i.e., infill asymptotics (fixeddomain asymptotics). The infill asymptotics can lead the spatial dependence ρ to increase rapidly as well as φ, which might break down condition (b). This is in line with what Cressie (1993) mentioned, infill asymptotics is preferable in geostatistical data, whereas increasing-domain asymptotics is often more appropriate for lattice data.

Methods
In this section, we briefly introduce background about MR images to be used and specify how to sparsify the images such that it can be analyzed using the BHM described in Sec. 2. Furthermore, how to set the prior distributions for the BHM and how to evaluate the performance of the estimator are also presented in this section.

Input data
Two kinds of MR images are analyzed in the study. One kind is simulated brain images with resolution 128 × 128, and the other kind is a real brain image with resolution 256 × 256. The simulated images were produced by using simulated gradient echo based dynamic contrast enhanced MRI scans at 3T with a noise level equivalent of a 12-channel head coil based on an anatomical model from BrainWeb (Aubert-Broche, Evans, and Collins 2006). Each image consisted of background/air and 13 tissue labels annotating CSF, gray matter, white matter, fat, muscle, muscle/skin, skull, vessels, connective tissue, dura matter, bone marrow, tumor necrosis, and tumor rim (Brynolfsson et al. 2014). The real brain image was acquired with a 2D spin-echo sequence on a 3T GE Signa Positron emission tomography (PET)/MR scanner.
To be able to fit the BHM to a sparsified MR image, the following question should be answered. Is the sparsity of sparsified MR image random? Assume x 1 , x 2 are two sparse images transformed from two sequential scans of MR images, x MRI 1 and x MRI 2 , of the same brain under the same conditions, any slight difference between the two images may result in the positions as well as the numbers of nonzero values in x 1 and x 2 are different, i.e., s 1 = s 2 , which implies that s is varying and can be considered as random.

Sparsification
Since MR image is not sparse in general, one discrete wavelet transform (DWT) followed by one thresholding method could be used to transform a MR image to a sparse image in wavelet domain. There are many DWT and thresholding methods can be used (Vanithamani and Umamaheswari 2011). Since this study does not focus on evaluation of the performance among these methods, DWT of Daubechies 1 with level 3 is used and followed by the hard thresholding method to eliminate the noise. The reason of using wavelet thresholding method is that wavelet transform is good at energy compaction, the smaller coefficients represent noise and larger coefficients represent the image features. DWT decomposes the image into four sub-bands in general (i.e., A, DH, DV, and DD) shown in Fig. 1. The numbers 1, 2, and 3 in Fig. 1 indicate the three levels of the DWT, while DH, DV, and DD are the detail sub-bands in horizontal, vertical, and diagonal directions, respectively and A sub-band is the approximation sub-band.
The hard thresholding method eliminates coefficients that are smaller than a certain threshold value T. The function of hard thresholding is given by where c is the detailed wavelet coefficient. Note that when the threshold value T is too small, the noise reduction is not sufficient. In the other way around, when T is too large, the noise reduction is over sufficient. In this study, one of the most commonly used method is considered to estimate the value T (Braunisch, Wu, and Kong 2000;Prinosil, Smekal, and Bartusek 2010;Vanithamani and Umamaheswari 2011), and the estimator is defined aŝ where N is the number of image pixels, σ image is the standard deviation of noise of the image which can be estimated by Donoho (1995), Prinosil, Smekal, and Bartusek (2010), and Vanithamani and Umamaheswari (2011) where c 1 D indicates detailed wavelet coefficients from level 1.

Priors of the BHM
After thresholding, a sparse image in wavelet domain is obtained. Before fitting the BHM to the sparse image, prior distributions of the unknown random variables in the third layer should be specified. A flat prior is assigned to μ which is equivalent to a Gaussian distribution with 0 precision. The priors for log(τ iid ) and log(1/σ 2 ) are set to be Log-Gamma(1, 5×10 −5 ). The Log-Gamma distribution is defined as that a random variable X ∼ Log-Gamma(a, b) if exp(X) ∼ Gamma(a, b) (Martino and Rue 2010). Thus, a Log-Gamma(a, b) distribution is assigned to the logarithm of the precision, e.g., log(τ iid ), which is equivalent to assign a Gamma(a, b) to τ iid , and the prior knowledge about τ iid is reflected through a and b. The prior for log( √ 8ν/κ) is set to be Log-Gamma(1, 10 −2 ). √ 8ν/κ represents a distance where the covariance is about 0.1.
ν is treated as a fixed number. In this study, ν = 1 is used, which implies that for a pixel in the sparse image, the conditional mean of this pixel given remaining pixels is only affected by its third order nearest neighbors.
R-INLA (Rue, Martino, and Chopin 2009) is used to implement the BHM.

Evaluation
E(s) is the parameter of interest, which can also be estimated by another unbiased estimator, i.e., the sample mean E sim (s) = 1 n n i=1 s i , where n is the number of simulated images and s i is the sparsity of the ith sparse image. We use E sim (s) as a reference of the true mean value by choosing a larger value for n according to law of large numbers (LLN). A series of E(s) I can be obtained from the simulated images, which can be used to compare with E sim (s) in order to confirm the theoretical property of the unbiasedness. The unbiasedness is measured by the mean of absolute difference in percentage | E sim (s) − E(s) I | * 100/N over the series of E(s) I . The range of I should not be too small in terms of LLN, whereas it should not be too large in terms of computational time. To state that the estimator is unbiased, the measurement should be close to zero. Besides the unbiasedness, the measurement also indicates the difference in terms of image size. Furthermore, the asymptotic normality of the BHM estimator could also be examined in the simulation study, since in this case n 1 = n 2 = 128 (large dimensional size) and ρ * = 2 (weak spatial dependence), which indicates the condition (b) in Proposition 2 could be possibly met.
The evaluation methods mentioned above cannot be extended to real images analysis, since it is not practical to scan one brain even for several times. We only compare E(s) with the true sparsity and measure the absolute difference in percentage, i.e., | E(s) − s| * 100/N. Figure 2 is one slice of simulated MR image of human brain with resolution 128 × 128. The DWT of Daubechies 1 with level 3 is shown in the left subfigure of Fig. 3. The most upper left corner of the sub-figure is the approximation sub-band, while the remaining parts are the detail sub-bands. The estimated threshold valueT ≈ 0.01, implying that the detailed coefficients which are less than 0.01 are set to 0. The sparsified image is shown in the right sub-figure of Fig. 3. It is difficult to see the difference between these two sub-figures except that the right sub-figure in general is darker than the left sub-figure, which is a consequence of thresholding. From the right sub-figure in Fig. 3, it also shows that the nonzero coefficients are clustered, implying that given a pixel with higher probability to be a nonzero coefficient, its neighboring pixels should also have higher probabilities to have nonzero coefficients, and this relationship falls apart as the distance between two pixels becomes larger. This phenomenon could be described either by Matérn covariance or by its correspond sparse precision matrix. Thus, it confirms the reasonability of using BHM with Matérn covariance.  After fitting the BHM to the sparsified image, the posterior mean of p i for each pixel can be estimated and is shown in Fig. 4.

Simulated MR images
The left sub-figure of Fig. 4 is scatter plot of the posterior mean of p i , while the right sub-figure of Fig. 4 shows the posterior mean of p i in image form which is easier to relate the posterior mean of p i to the sparse image in Fig. 3. It shows some pixels, located at the most upper left corner of the right sub-figure of Fig. 4, are with higher probabilities to have nonzero coefficients, while most of the remaining pixels are with lower probabilities to have nonzero coefficients. The summation of the posterior mean of p i over all pixels, i.e., the estimator of E(s), is 4241.768. The true sparsity of the sparsified MR image is 4213. The absolute difference between the estimate and the true sparsity in percentage | E(s) − s| * 100/N ≈ 0.2. Afterwards, 1000 simulated MR images were generated under the The black line is the mean of | E sim (s)− E(s) I | * 100/N over the 90 simulations, and its value is about 0.21, which is a relatively small number that could confirm the theoretical property of unbiasedness. From Fig. 5, | E sim (s)− E(s)| * 100/N ∈ [0.01, 0.53]. The variance of E(s) based on the 90 simulations is 480.069. All of these show that the BHM estimator from an image does not diverge too much from E sim (s). Furthermore, a normal quantile-quantile plot of standardized E(s) from the 90 simulations is shown in Fig. 6. The Shapiro-Wilk test of normality is performed and p-value = 0.7715, implying that the estimator is normal distributed. It confirms the theoretical result about asymptotic normality of the estimator.

Real MR image
The same sparsification procedure as for the simulated images is applied here. One slice of real MR image of human brain with resolution 256 × 256 is shown in Fig. 7. The DWT of Daubechies 1 with level 3 is shown in the left sub-figure of Fig. 8. Sequentially, the hard thresholding method is used to eliminate the noise, and the result is shown in the right sub-figure of Fig. 8.    By analyzing the sparsified image using the BHM, the posterior mean of p i for each pixel is estimated and shown in Fig. 9. The left sub-figure of Fig. 9 is scatter plot of the posterior mean of p i . The right sub-figure of Fig. 9 is the posterior mean of p i in the image form. The summation of the posterior mean of p i over all pixels is 8254.679. The true sparsity of the sparsified MR image is 8120. The absolute difference in percentage | E(s) − s| * 100/N ≈ 0.2.

Conclusion and Discussion
In the study, we propose a novel estimator for the mathematical expectation of sparsity, E(s), and prove that it is unbiased and asymptotically normally distributed. Its variance can also be derived analytically. Simulation study is used to confirm the theoretical results. The absolute difference in percentage, i.e., | E sim (s) − E(s)| * 100/N, is about 0.21 in average, which indicates the unbiasedness. The asymptotic normality is also examined through the simulation study. The real data analysis is used for demonstration of the model and corresponding theoretical results that are not only valid for simulations, but also for real images, and illustration of the new method's applicability in the sense of that E(s) could be used directly in the recovery algorithms of CS for future MR images if the MR scanner can implement the wavelet thresholding techniques to sparsify the future dense images and all the relevant images are believed to have the same sparsity level after sparsification, e.g., two images of the same subject are scanned within a short time interval that could be several weeks or months. It is worth noticing that the stability of the sparsified images in terms of the sparsity is definitely related to the time interval, thus the relationship therein can be an interesting research direction.
There are some issues that are not considered in this study. Relatively conservative priors are used in the study, thus more informative priors could be used according to properties of MR images. Also different models can be used to model the GMRF, e.g., Besag and Leroux model, and comparisons are made among different models. Besides these, it is possible to fit the model to a 3D image and prove that the statistical properties still hold for 3D images. Based on the image patterns of the posterior means shown in Figs. 4 and 9, the dimension of measurement matrix, A ∈ C m×N , is possible to be further reduced. Since if some pixels in x ∈ C N are believed to have zero coefficients, i.e., the probabilities are close to 0, then these pixels do not need to be measured through CS. Similarly, if some pixels are believed to possess image features, i.e., the probabilities are close to 1, then the values can be measured by a direct method rather than by CS. And CS is only applied to the remaining pixels, which leads to dimension reduction.
Proof of Proposition 1. The unbiasedness follows from the fact that Calculation of variance is straightforward: Proof of Proposition 2. We prove this proposition by verifying that all conditions in the theorem in Harvey, Weng, and Beckett (2010) are met, since Harvey, Weng, and Beckett (2010) have proven that the sum of ρ-radius dependent three dimensionally indexed random variables is asymptotically normally distributed under conditions. The proof for two dimensionally indexed random variables in our case follows similar to that given in Harvey, Weng, and Beckett (2010) if (i) {E p i |O : 1 ≤ i ≤ N} are ρ-radius dependent random variables, and (ii) σ 2 k and r 3 k are finite for a given square size, and (iii) n sq → ∞ and φ → ∞ at a rate slower than n 1 , n 2 as well as n sq such that We verify the three conditions one by one, sequentially. It has been shown that the dependence structure of a transformed GMRF is the same as the one of original GMRF if the transformed GMRF consists of absolutely continuous variables (Prates et al. 2015;Cardin 2009). Since Matérn covariance is used to model logit(p) under the model setting, in which the random variables are ρ-radius dependent, the same dependence structure is inherited by E p|O if condition (a) holds, i.e., two distinct sites for E p|O are pairwise non-negative correlated and {E p i |O : 1 ≤ i ≤ N} are ρ-radius dependent random variables. Thus condition (i) is met.