Solder joint image adaptive block compressive sensing with convex optimisation and Gini index

: This study aims to improve the performance in solder joint image compression and reconstruction. A novel adaptive block compressive sensing with convex optimisation and Gini index (Ad_BCSGB_Gini) methodology for solder joint image compression and reconstruction is proposed. At first, the image is split into square blocks and each block is resized into a row which consists of a new image. Then, the new image is transformed into a sparse signal by an orthogonal basis matrix, and the image reconstruction is handled as a convex optimisation problem. Moreover, a gradient-based method which has fast computational speed is used to reconstruct image. There is a control factor which controls a norm l 1 in the optimisation problem. To achieve the best performance, at last, the proposed method adaptively selects the best result by comparing Gini index of the reconstruction results based on different control factor values. Experimental results with different methods indicate that the Ad_BCSGB_Gini method is able to achieve the best performance in quantisation comparison than several classical algorithms, and Ad_BCSGB_Gini has a good robustness.


Introduction
Unlike common signal reconstruction methods, compressive sensing (CS) can reconstruct a sparse signal accurately from a small number of random linear measurements. It provides signal compression at a significantly lower rate than the Nyquist rate [1]. Owing to this unordinary advantage, CS has gained a fast-growing interest in a wide variety of applications in recent years including image fusion [2], synthetic aperture radar [3], magnetic resonance imaging [4] and solder joint image compression and reconstruction [5].
In CS theory, there are two steps in signal CS. Given a k-sparse signal, where k is the number of the non-zero entries of the sparse signal. At first, a k-sparse representation is constructed. Since most natural signals, for example, natural image, are not sparse. They can be made sparse by applying orthogonal transforms. Given s is an N-dimensional non-sparse signal, this step can be shown as where Ω is an N × N orthogonal basis matrix and x is a weighted Ndimensional sparse vector. The orthogonal basis matrix can be discrete cosine transform (DCT), discrete wavelet transform and fast Fourier transform. Next step is compression. In this step, a random measurement matrix is applied to the sparse signal. A sampling rate u is defined as the sampling per cent from the signal. M is defined as the number of measurements, so M = Nu. The random measurement matrix is an M × N matrix. The second step can be done by the following equation: According to CS theory, signal s in (2) may be estimated from measurement y by solving as a minimisation problem. Usually the measurements are corrupted with noise, we can reconstruct x as the solution to the optimisation problem by solving where ε is an upper bound on the amount of error in the signal ∥ ∥ l 1 and ∥ ∥ l 2 are defined as norms l 1 and l 2 , respectively. The matrix A = ΦΩ obeys a condition called restricted isometry property, [6] which is introduced below: where δ k is the k-restricted isometry constant of a matrix. In the classical image CS methods, a column or row of an image is normally viewed as a vector. However, in many applications, the non-zero elements of sparse vectors tend to cluster in blocks [7]. In this case, the sampling problems over unions of subspaces can be converted into block-sparse recovery problems. Block CS has many applications recently. Gan [8] proposed and studied block CS for natural images. Fowler et al. [9] proposed a BPL_SPL method for video and image CS, but this method needed the random measurement Φ as an orthogonal matrix.
Surface mount technology components are key part of electronics products. Its assembly quality affects the product's quality greatly. To improve the inspection rate of solder joint defects (such as pseudo-solder and insufficient solder), image compression ， image segmentation, image enhancing image filtering etc. are used in automatic optical inspection. Zhao et al. [5] proposed a solder joint image compression method and used different square block dimensions 4, 8 or 16 when image size is 256 × 256.
According to Section 1 above, one can find that, despite many CS algorithms appearing in the literature, there are still lots of challenge works in CS to approximate a signal. On one hand, the reconstruction performance in block CS methods above needs to be improved. On the other hand, the computational cost for many methods, some classical methods such as orthogonal matching pursuit (OMP) have good computational cost. Third, some of the algorithms require several parameters, and are not adaptive.
In this paper, we develop a novel CS algorithm named Ad_BCSGB_Gini. The two main contributions of this context are summarised as follows: • First, we split the image into square block and transform an image to a sparse signal so that the image reconstruction is changed to a convex optimisation problem. By using the gradient-based method, our method has lower computational cost than several classical algorithms. • Second, the proposed method adaptively selects the best result by comparing Gini index of the reconstruction results based on different control factor values.
This paper is organised as follows. In Section 1, we introduce some related work on solder joint image processing and CS. In Section 2, we introduce the block CS for an image. Gradient method for solder joint image CS optimisation problems in our approach is described in Section 3. We also show some experimental results and comparison in Section 4. Finally, we conclude our paper in Section 5.

Methodology
Given an N 1 × N 2 image, it is split into small blocks with n 1 × n 2 , and K = (N 1 × N 2 )/(n 1 × n 2 ). Here, f i (i = 1, 2, …, K) is defined as a row vector of the ith block. According to the describing above, one is able to get with the following linear transformation: where measurement matrix Φ b ∈ R m × n 1 n 2 . One can find that the block CS method is memory efficient as we just need to store an m × n 1 n 2 Gaussian random matrix Φ B , rather than a full M × N 1 × N 2 one. This means the signal requires less memory storage and allows faster processing, while large data produce more accurate reconstruction.

Constrained minimisation convex optimisation problems with gradient based
In our approach, (3) is more natural to study a problem by solving arg min In this context, we reconstruct x as the solution to a convex optimisation problem. Define h(x) as a convex function, a common method for solving the convex minimisation problem is the gradient-based algorithm. The key step is to generate a sequence x k via where p k > 0 is an appropriate step size. For a signal in (6), we can define a new objective function We solved this minimisation problem based on a gradient-based method. So we can approximate the function hg(x) at point x k − 1 x k − 1 by a quadratic function as (see (8)) . Then ignore constant terms in x k − 1 , and update Define v k = x k − 1 − (1/ p k )∇h(x k − 1 ) and replace (9) to We rewrite v k with (6), so

Gini index
As mentioned above, we can get a sparse result by solving (6) and get a reconstructed image with an inverse transformation. One can see from (3) that λ is a very important parameter for achieving a good result. During our method, λ value is [1,100], which can be used to improve the result with different sampling rates. We proposed an adaptive method for selecting a best reconstructed signal based on its sparsity. Gini index was proposed by Breiman in 1984 and has widely been used in statistics and image processing [10]. In this context, a λ method selection based on Gini index is proposed for block CS. Given a series of non-zero signal vector (1), (2), …, (N) are the new indices after the sorting operation. The Gini index can be given by For each x generated by different λ, we can get its Gini index by (12). Moreover, the value of Gini index can be used as a measurement of signal sparsity, and larger index mean more sparsity, which is favourite for our adaptive allocation of reconstruction results based on different λ.

Algorithm
On the basis of describing above, we design an adaptive block CS with Gini Index, and the details are shown as Algorithm 1 (Fig. 1).

Experiments and discussion
There are some metrics to evaluate the quality of the reconstructed results. Peak-signal-to-noise rate (PSNR) is an common method in image processing [11]. In this context, the PSNR is also used to compare the reconstruction results. The experiments were implemented on a Pentium IV with 2.27 GHz central processing unit. We capture a solder joint image (size 256 × 256) of a chip component. It is shown in Fig. 2 and a sparse transform DCT orthogonal basis matrix (size 256 × 256) is shown in Fig. 3.
One can see that our method can achieve a best result than SP, OMP, BOMP, CoSaMP and BCoSaMP.
By setting sampling rate u ∈ [0.1, 0.9], we can also compare their results with different numbers of sampling for reconstructing solder joint image in Fig. 2. The quantisation comparison of PSNR and runtime are shown in Fig. 5.
From Fig. 5, one can see that the proposed Ad_BCSGB_Gini approach can always obtain the best result in terms of PSNR as compared with SP, OMP, BOMP, CoSaMP and BCoSaMP. At the same time, the Ad_BCSGB_Gini method has lowest computational cost than SP, OMP, BOMP, CoSaMP and BCoSaMP. Increasing the sample rate can improve the reconstruction result. Unlike CoSaMP, BCoSaMP and SP, our method can keep the lowest computational cost with the increasing sample rate.
One can see from the above figure that, Ad_BCSGB_Gini can achieve the best result too. It is also proven that our adaptive selection method based on Gini Index has a good robustness.

Conclusions
This paper proposes an adaptive block CS with convex optimisation and Gini index (Ad_BCSGB_Gini) for solder joint image. Experiments reveal that the (Ad_BCSGB_Gini can achieve the best result in terms of PSNR with lowest computational cost than classical algorithms SP, OMP, BOMP, CoSaMP and BCoSaMP. If a reconstruction result has more sparsity than other blocks which are around it, it can generate a better result than the other reconstruction result, so there are some blocky artefacts in the reconstruction result. In the future study, how to avoid blocking artefacts will be researched, and more relationships between sparsity of pixels and block size will also be researched.