Multi-Stage Image Compression-Decompression System Using PCA/IPCA to Enhance Wireless Transmission Security

Abstract

The goal of this paper is to propose a fast and secure multi-stage image compression-decompression system by using a wireless network between two Personal Computers (PCs). In this paper, the Principal Component Analysis (PCA) technique is used for multi-stage image compression and Inverse Principal Component Analysis (IPCA) for multi-stage image decompression. The first step of the proposed system is to select the input image, the second step is to perform PCA up to 9 times on the input image, this compression, and after multi-stage compression process then the third step begins by transforming across wireless Ad hoc Network (WANET) to the second computing device, forth step start with multi-stage decompression process up 9 times. The proposed system for different images is transferred over the wireless network using Transmission Control Protocol/Internet Protocol (TCP/IP), which is programmed using the network role property of the MATLAB program. The proposed system implements 25 different images correctly (100%). The main contribution of this paper is that we are dealing with the black image at the end of the compressed process ad start with a black image at the start of the decompressed process of this proposed system. In this work, the compressed and uncompressed images are compared with each other in their size and transmission time. This system can be very useful in networks because they provide a high level of protection to the transmitted data from hackers because they cannot guess how much the image has been compressed or what kind of information the image represents.

Share and Cite:

Ibrahim, A. , Khalaf, T. and Ahmed, B. (2022) Multi-Stage Image Compression-Decompression System Using PCA/IPCA to Enhance Wireless Transmission Security. Journal of Computer and Communications, 10, 87-96. doi: 10.4236/jcc.2022.104008.

1. Introduction

With the fast development of the Internet, the use of high-resolution image transmission is increasing due to vast volumes of digital images being shared by people over the Internet every day. High-resolution images need greater bits for storage and transmission because the information amount in the digital image is very large, and it occupies a large number of resources. For these reasons, efficient transmission of digital images has become a major challenge in the field of information technology. Thus, it is important to use an appropriate method to compress images in order to store and transmit them efficiently. Taking into consideration, the bandwidth consumption over multimedia communication, having an effective compression coding technique is necessary to enable the effective and rapid transmission of image data over the network [1] [2].

In the image processing, there is one particular field by which the size of data can be reduced called Image Compression. These techniques use various mathematical models in order to minimize irrelevance and redundancy of image data so that it can be stored or transmitted efficiently. Image compression can be lossy or lossless. Lossless compression is generally preferred for backup storage e.g. medical picturing. Whereas Lossy methods are specially used for natural images e.g. personal digital images. One of the lossy compression techniques is PCA. PCA is the best image compression technique among many of the possible approaches used to reduce image file size at the expense of its perceptual quality because other lossy compression standards such as JPEG offer a tradeoff between image quality and file size, while in lossless compression techniques such as run-length encoding, no information reduction takes place, but the image file size may remain large [3].

In the field of communication between devices, networking is the most important area which is responsible for a source to destination transmission of data. The network is established using air as a transmission medium and there is no physical path between two nodes of the network such networks are called Wireless Networks. Wireless Adhoc Networks are networks in which nodes can communicate with others by wireless transmissions without the help of a centralized coordinator. WANET is becoming very popular to connect with each other within a particular region for the various applications. As this field as growing up very rapidly, it comes with new issues such as securing the network that has been one of the major concerns in today’s world [4] [5].

In this research, we have proposed a system that compresses/decompresses digital images multiple times by using the PCA/IPCA technique. The compressed images are transferred over the wireless network using Transmission Control Protocol/Internet Protocol (TCP/IP), which is programmed using the network role property of MATLAB program. For more security, PCA/IPCA method could be used also to secure image transmission against attackers over a wireless network because they can’t know what type of information the compressed image is holding. This project deal with 25 digital images samples from Air Freight dataset because the samples do have significant lighting, specular effects, so they are more realistic than some other image samples might be. This work is expanded on the previous work, which was presented by [5].

This paper consists of 4 sections, the first is the introduction, the second section is proposed methodology, while the third section is experimental results, and the last is conclusions.

2. Proposed Methodology: Main Steps

The proposed methodology for the multi-stage PCA/IPCA method is discussed in the following sections includes a brief discussion of the quality measurements and the proposed wireless network connection and transmission process.

2.1. Principle Component Analysis

Principle Component Analysis is a multivariate statistical method used to describe variability among observed, PCA depending on the idea of correlated variables in terms of a potentially lower number of unobserved variables called factors. In other words, it is possible, for example, that variations in three or four observed variables mainly reflect the variations in fewer unobserved variables. Factor analysis searches for such joint variations in response to unobserved latent variables. The observed variables are modeled as linear combinations of the potential factors, plus “error” terms. The information gained about the interdependencies between observed variables can be used later to reduce the set of variables in a dataset [6] [7].

The goals of PCA are included in the following [8]:

1) Extract the information (features) from the datasets.

2) Compress the size of the dataset by keeping only the related information.

3) Decompress the compressed dataset without losing information.

4) Analyze the structure of the observations and the variables.

2.2. One-Stage Image Compression/Decompression [6]

In the beginning, one-stage image compression/decompression must be expounded as shown in Figure 1(a) that illustrates PCA algorithm steps as one-stage image Compression/Decompression process in detail. This process is the foundation of the multi-stage image Compression/Decompression process that will be explained later on in this section.

Principal Component Analysis (PCA) is used as a dimension reduction method by reducing the number of dimension with low errors. Firstly, the RGB image from Air Freight dataset must be converted to greyscale image named as (I) and used in MATLAB code, the grey image format is row × column matrix. By using Air Freight images, the dimension of the images is 160 × 120. The grey image matrix is centred by computing the mean of the image matrix,

m e a n I ( 120 160 ) = m e a n ( I )

(a) Flowchart of PCA algorithm (b) Flowchart of IPCA algorithm

Figure 1. PCA and IPCA flowcharts of the one-stage image compression/decompression process, (a) represent PCA algorithm steps where the first step was input matrix (image), second step to calculate the mean of input matrix, third step to calculate the normalization, forth step was to calculate covariance matrix, forth step was to calculate the eigenvalue and eigenvector, fifth step was to sort eigenvalues in descending order, six step was to set eigenvalue corresponding with eigenvector, the output of this algorithm was image compression, (b) represent IPCA algorithm, which contain the first step was input image compression, the second step was to calculate the inverse matrix of eigenvalue, third step was to calculate the process of multiplication of inverse matrix with the compress image matrix, forth step calculate the process of adding the transpose of multiplication result to the mean matrix, and the last step which is the output was decompressed image matrix.

Then subtracting each pixel gray value from the mean gray value:

s u b I = I m e a n I

After that, the covariance matrix of the subtracted matrix must be computed in order to determine the eigenvectors (principal components) of the covariance matrix and collect them into the projection matrix.

cov = c o v a r i a n c e ( s u b I )

[ V D ] = e i g ( c o v )

V t r a n s ( 160 160 ) = t r a n s p o s e ( V )

Each of those eigenvectors is associated with an eigenvalue, which is the size or dimension of the corresponding eigenvector. The eigenvalues are arranged in descending order and the eigenvectors are chosen corresponding to the largest eigenvalues. Finally, the final matrix is constructed from the selected eigenvectors:

s u b I t r a n s = t r a n s p o s e ( s u b I )

f i n a l m a t r i x ( 120 160 ) = V t r a n s s u b I t r a n s

The final image matrix is decompressed by performing Inverse Principal Components Analysis (IPCA) on the compressed image as shown in Figure 1(b). The IPCA algorithm starts by computing the inverse of eigenvectors matrix, then multiply the inverse matrix by compressed image matrix [6].

I f i n a l m a t r i x t r a n s = i n v ( V t r a n s ) f i n a l m a t r i x

The decompressed image matrix is constructed by adding the mean of the image matrix to the transpose of the multiplication [6].

I f i n a l m a t r i x ( 160 120 ) = t r a n s p o s e ( I f i n a l m a t r i x t r a n s ) + m e a n I

2.3. Proposal Multi-Stage Image Compression/Decompression System

A new algorithm is proposed to compress the image at different stages, it’s a sequence of image compression stages. With each stage, there is a new different compressed image that has a different size. These sequences of image compression stages are corresponding to the decreasing of image sizes. The process is called the forward multi-stage image compression. The reverse direction or the backward multi-stage image compression contains a sequence of image decompression stages, which are corresponding to the increasing of image sizes. The images are compressed N times as shown in Figure 2 below, reaching to constant image size, Where N equals 9 and the final image size is equalled to 1 kB. N equals 9 because this is the last compression stage where image size cannot change anymore and settle on 1 kB and this was determined experimentally and it is the last compression step.

Figure 2. Multi-stage image compression/decompression and input image was imported from [6]. If N = 0, 2, 4, 6, 8, the compressed image dimension is 120 × 160 and decompressed image dimension is 160 × 120. But when N = 1, 3, 5, 7, 9, the compressed image dimension is 160 × 120 and decompressed image dimension is 120 × 160.

2.4. Wireless Network

The proposed network system consists of two PCs, network’s PCs transfer data by using Transmission Control Protocol/Internet Protocol (TCP/IP), which is programmed using the network role property of MATLAB program. TCP requires only the destination’s IP address and port number for the data to be transferred to that destination. Client and server TCP sockets are programmed using the network role property on the TCP/IP interface that supports a single remote connection. To communicate over TCP/IP interface, TCP/IP object must be created before transmission with remote host’s IP address and port number. The Port number must be a positive integer between 1 and 65,535. The typical workflow for TCP/IP server and TCP/IP client sessions is shown in Figure 3(a) and Figure 3(b) respectively. In the server session, after a server socket is opened, the server will wait until an incoming connection is established. In the client session, the received data have to be reshaped to their original data size. The time out for the writing and reading operations can be determined in both sessions. IP’s of network’s PCs have to be set up statically or dynamically before

(a) (b)

Figure 3. Proposal wireless network system communication, where (a) represent creating TCP/IP processing connection, while part (b) represent the translation data(image) with existing client using TCP/IP.

network transmission takes place. Static IP addressing is applied to the proposal network because it provides more reliability than a dynamic IP address. The network transfers compressed and input images into one line. First, PC1 sends the chosen image to PC2 (which is either a compressed image or input uncompressed image). Then PC2 receive either compressed image or input uncompressed image, then decompresses the compressed image. In this network, Acer AOD257 CORE i3 notebook and Toshiba Portege M780 CORE i5 computers were used for image transmission [6].

3. Experimental Results

The system is tested by using 25 image samples from Air Freight dataset. These images must be converted to grayscale in order to employ a multi-stage compression process. In this system, PC1 is the server that writes the image to the client’s buffer and PC2 is the client that reads the image from the server. In PC1 (the server), the gray scale input image is gone through 9-stage of compression as shown in Figure 4. In each stage, the compression index is assigned to each compressed image matrix to help PC2 identify the stage of compression. Using GUI, the user can choose the compressed image to be sent wirelessly to PC2. PC2 (the client) will receive the compressed images along with compression indexes and preform the decompression process as shown in Figure 5.

The size of compressed Air Freight images is shown in Table 1. The table shows a huge decrease in the size of the images without affecting their quality as shown in Figure 2 when they are decompressed later on in this system. The size of the decompressed images is reduced to almost less than half of the original

Figure 4. Multi-stage image compression.

Figure 5. Multi-stage image decompression.

Table 1. Performance results for 25 samples using the proposed system before and after compression/decompression process.

input image size. This means that there is information loss which is about 62% of the original size without losing the important features of the original image. The time factor is also affected by the compression. In this project, image transmits and receive time are measured during opening and closing of sockets. When comparing the total time of image transmissions before and after multi-stage compression, a decline in time is shown in Table 1. The time before multi-stage compression is almost more than two times of the time which is after multi-stage compression.

The main contribution of this paper is that we are dealing with the black image at the end of the compressed process ad start with a black image at the start of the decompressed process of this proposed system.

4. Conclusion

All implementation results of the proposed system as shown in Table 1 have demonstrated that multi-stage compression reduces the size of the image massively. Also, the information loss in the multi-stage decompression process has no impact on the overall important features of reconstructed images Image size reduction has an influence on image transmission across the wireless network which decreases transmission time. So, multi-stage compression contributes well to enhancing image transmission. Overall, multi-stage image compression/decompression can be used as a method to encode/decode image information in order to give more security to the data that the image holds from unauthorized users where the hackers do not know the number of iterations of compression/decompression process that was used in this proposed system.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Chen, Y.X., Huang, Z.C., Sun, H., Chen, M.Y. and Tan, H. (2016) Lossy Image Compression Using PCA and Contourlet Transform. MATEC Web of Conferences, 54, 1-5.
https://doi.org/10.1051/matecconf/20165408002
[2] Ng, S.C. (2017) Principal Component Analysis to Reduce Dimension on Digital Image. 8th International Conference on Advances in Information Technology, 19-22 December 2016, Macau, 113-119.
[3] Hladnik, A. (2013) Image Compression and Face Recognition: Two Image Processing Applications of Principal Component Analysis. International Circular of Graphic Education and Research, No. 6, 56-60.
[4] Yang, X., Wang, L., Xie, J. and Zhang, Z.L. (2018) Cross-Layer Model Design in Wireless ad Hoc Networks for the Internet of Things. PLOS ONE, 13, e0196818.
https://doi.org/10.1371/journal.pone.0196818
[5] Storkey amos (2000) Image Sequence Segmentation Data.
http://homepages.inf.ed.ac.uk/amos/afreightdata.html
[6] Ali Abdulhafidh, I., Ali Khalaf, T. and Ahmed, B.M. (2016) Design and Implementation of Iris Pattern Recognition Using Wireless Network System. Journal of Computer and Communications, 15-21.
https://doi.org/10.4236/jcc.2016.47003
[7] Ali Abdulhafidh, I., Al Rikabi, Z.H.A. and Ahmed, N.S. (2014) Using Hierarchical Cluster and Factor Analysis to Classify and Built a Phylogenetic Tree Species of ND1 Mitochondria. Journal of Al-Nahrain University-Science, 114-122.
[8] Ali Abdulhafidh, I. (1996) Using the Factor Analysis Method to Extract the Parameters That Determine the Suitability of Powdered Milk for Human Consumption. The Scientific Journal of Tikrit University of Engineering Sciences, 71-82.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.