Parallel Implementation of Singular Value Decomposition (SVD) in Image Compression Using Open Mp and Sparse Matrix Representation
Total Page:16
File Type:pdf, Size:1020Kb
ISSN (Print) : 0974-6846 Indian Journal of Science and Technology, Vol 8(13), 59410, July 2015 ISSN (Online) : 0974-5645 Parallel Implementation of Singular Value Decomposition (SVD) in Image Compression using Open Mp and Sparse Matrix Representation J. SairaBanu, Rajasekhara Babu and Reeta Pandey School of Computing Science and Engineering, VIT University, Vellore-632014, India Abstract The advent of Multi-core processors has offered powerful processing capabilities and provided new avenues for parallel processing. As the traditional methods of computation are inherently based on single core of execution, they are not capable of taking the advantage of high computational power offered by multi core processors, even if available. Singular Value Decomposition (SVD) has been proven well for many image processing techniques such as image compression, quality measure and in watermarking. SVD is a highly compute intensive algorithm that applies numerous matrix operations to an image such as transpose, inverse, multiplication of high orders to form a compressed image. However accelerating the improving the speedup of SVD algorithm used in image compression technique. This is achieved by identifying the areas whereSVD routines data parallelism to exploit canthe beunderlying applied and hardware parallel poses programming a significant model challenge OpenMp to is the used programmers. to run the parallel This paper components deals with on multiple processors. This results in faster execution of the algorithm and hence reduces the execution time when applied to image compression for large images. This paper also addresses the space overhead of storing the matrices of SVD technique, the speedup achieved through OpenMp is around 1.15 and better compression ratio with sparse matrix storage format. by adapting efficient sparse matrix storage format such as Compressed Row Storage (CSR). Experimental results show that Keywords: 1. Introduction CSR, Image Compression, SVD, OpenMp, Sparse Matrixas an image compression technique and compared the error in the images at different levels of compression. A digital image is stored in a computer in the form of Singular Value Decomposition is a concept of linear a two dimensional array of pixels or picture elements, algebra which factorizes a real matrix A(MxN) into depending on the height and width of the image. Each components U, S and V such that the following relation pixel in turn, is a combination of the varying intensities is satisfied: A = U*S*V’. This relation is the singular of red, green and blue colors which are commonly value decomposition of A where U is of dimension stored in the form of triplets of 8 bit each in the MxM, S is a diagonal matrix of dimension MxN in computer memory. Thus an image size is dependent on which non-diagonal elements are zero, also called the the number of pixels it is having which is a function singular values of A and V is of dimension NxN. SVD of the dimensions of the image. In general, the space allows us to write the matrix A as a summation of rank complexity of an image is O (MN) where the M is the one matrix in the manner shown below: A= U1*S1 height of the image and N is the width of the image. *V1’ + U2* S2*V2’…………UN*SN*VN’. The terms of the Image compression techniques aim towards reducing diagonal matrix S are sorted in value such that S1> S2> the space complexity for the image. Thus less space is S3…>SN. Therefore we can reconstruct the matrix A required for storing and transmission of an image. In completely if we have the complete matrices U, S and this paper we have used Singular Value Decomposition V. However, if we remove some of the lower diagonal * Author for correspondence Parallel Implementation of Singular Value Decomposition (SVD) elements of S, we can still get a good approximation Section 5 explores the OpenMp programming model for of A. The fact that we can approximate the matrix A SVD, Section 6 presents the results of SVD and Sparse even with lesser elements in S is the basis for image storage format for image compression, Section 7 talks compression using SVD. The approximation becomes about the conclusion. more accurate with the increase in number of singular values used. As a result of quantization, it is common to 2. Related Work have matrices that have a large number of zeroes than the non-zero values. An elegant method of storing such SVD routines which are used in many scientific or matrices is the use of sparse matrix storage formats. In engineering applications such as Image processing, this approach, we store only the non-zero elements of a Image compression, Data clustering, etc. have been matrix thereby reducing the total storage needed for the implemented in many scientific libraries like LAPACK, original matrix. This also helps in reducing the amount GNU Scientific library, INTEL MKL library etc. of data that needs to be transmitted for communication Chaitanya Gunta et al6 made an attempt to accelerate across computers. the SVD routines in LAPACK scientific Library. Sheetal The growth of computing power has also been a Lahabar et al10 proposed parallelizing SVD routines for fast paced one. Today we have high processing power GPU using CUDA programming. Michal W. Berry et al2 available in the form of multi-core processors such as provided a comprehensive study on SVD for dense and the Intel multi-cores processors. In order to fully tap the sparse matrices which are suitable for parallel computing potential of multiprocessing; calls for a new approach platforms. Sivashankaran Rajamanickam12 has worked in towards programming where we distribute the processing efficient algorithm for sparse singular value decomposition. load to different cores thereby reducing execution time Mostafa I. Soliman16 has proposed a new algorithm for and producing faster results. In this paper we have computing the singular value decomposition on one used OpenMp for achieving distribution of workload side Jacobi based techniques. The above referred papers to different cores. Open Multiprocessing, commonly explore the way to accelerate the SVD technique. Rowayda known as OpenMp is a shared memory multiprocessing A. Sadek15 has conducted an experimental survey on SVD paradigm. We have used the OpenMp in C++ for parallel as an efficient image processing applications. Prasantha execution of sections of the code which require high et al11 adapted SVD as an image compression technique performance. OpenMp is based on a fork and join and performed experimental study using MATLAB. model where a single thread forks into multiple threads Awwal Mohammed Rufal et al14 presents a new lossy for performing the parallel tasks and after the execution image compression techniques which combines both of the parallel region, it resumes as a single thread. The SVD and wavelet difference reduction (WDR) to increase performance gain offered by OpenMp comes from the the performance of image compression. Vasil Kolev et al8 fact that the multiple threads can execute concurrently has applied SVD for images from scanned photographic on different cores in a multi-core processor. OpenMp plates. Mahendra M. Dixit4 worked on adaptive SVD works best when there is no data dependency among the algorithm for 2D/3D still image compression application. parallel threads. Z hongxiaojia7 concerned about accurate computation In this paper we have used SVD routine implemented of SVD using cross product matrices. Taro Konda et al9 in GNU Scientific Library for image compression and presented the double Divide and Conquer algorithm parallelized the routines and achieved around 1.15% (dDC) for bidiagonal SVD which performs well in speed, speedup using dual core Intel processor. We preferred accuracy and orthogonality compared to the standard GSL rather than INTEL MKL library because it is an open algorithms such as QR and Divide and Conquer. Literature Source which in turn uses LAPACK and BLAS library. review reveals that SVD is used as one of the image The rest of the paper is organized as follows: Section 2 compression techniques. In this paper, the SVD technique presents the related work, Section 3 describes the SVD is accelerated and it is employed for image compression technique and its application in image compression application and the space overhead is addressed with the section 4 deals with sparse matrix storage formats, help of efficient sparse matrix storage format. 2 Vol 8 (13) | July 2015 | www.indjst.org Indian Journal of Science and Technology J. SairaBanu, Rajasekhara Babu and Reeta Pandey 3. Singular Value Decomposition singular values of A is defined as the square root of the T (SVD) roots the Eigen vector of A* A . 80 SVD is an approach of advanced linear algebra. It is based Thus we have, S = 02 on the packing the maximum energy of a signal into a lesser number of coefficients. It is an effective method In the next step we determine the values of the matrix to split a matrix into linearly independent constituents U as follows: to determine the columns of U, we solve for T where each constituent has its own contribution in the Eigen vectors of A* A . This should satisfy the relation, terms of energy. The uses of SVD are diverse ranging [A*AT- λI][x] = 0. Using the Eigen values, we get the Eigen from areas such an image processing, latent semantic −1 0 analysis, approximation of the pseudo inverse of a vectors as X1 = and X2 = . To get the columns matrix, least square minimization of a matrix, efficient 0 1 medical imaging, topographical analysis, watermarking of U, we determine the unit Eigen vectors of u1 and u2. −10 schemes and many other areas. In the case of image Thus we determine U as U = . To determine the compression, SVD offers its advantage in the form of 01 its sensitivity to local adaptations in the statistics of columns of V we first determine the Eigen vectors of the an image.