Exhaustive Crisp Parameter Modification in Quantization Table for Effective Image Compression

In recent times, transmission of information over wireless channels is increasing at an exponential rate. Internet is major source of information; it can be in the form of video or images which alone size up to 72% of the global traffic. In order to tackle such immense data, available channel may not be enough for transmission or reception, in this regard it is imperative to use efficient compressions techniques to reduce its size. Compressed image quality depends on the Quantization Table performed after spatial transformation like Discrete Cosine Transform. Size of a raw image captured by Digital Single-Lens Reflex, having all of its traits can easily exceed 20 Mega Bytes. In proposed compression algorithm, a Crisp parameter p modification step is introduced for effective compression of an image by utilizing standard Joint Picture Expert Group Quantization Table as a baseline model. After implementation of the proposed algorithm, Mean Opinion Score is obtained from the masses through an online survey and it provide the scores of 47.633 at p = 1, 62.74 at p = 8, and 83.252 at p = 16. According to Mean opinion score, best trade-off between quality and size of an image is between the values of p ranges from 11-20, this is also proved by Mean Squared Error and Peak Signal to Noise Ratio, as their ranges are 0.00038-0.000301 and 34.09-34.92 dB respectively. Compression Ratio which is from 6.49-5.76 is also acceptable for the given range.


INTRODUCTION
Daily huge amount of information is transferred or uploaded from different sensory sources including cameras, sensors or any other equipment. If the data is transmitted to a server location containing data hub for multiple user interfaces, such process is called IOT (Internet of Things). There are estimated 4.7 billion mobile phone users around the globe that makes about 68% of the world's population. Almost all users utilize their gadgets like cell phones, digital cameras or tablets to captures images and videos which usually stacks up to over 80% of their storage capacity. We can store these images in the cloud from where we can easily retrieve them when needed. It is imperative to compress these images or videos for fast downloading and uploading. There are some hurdles that occur during the transmission such as lack of available bandwidth, not enough storage capacity and downloading speed in case of retrieving information from internet. Compression of an image basically exploits the ability of human eye which is sensitive to  280 low frequencies, which means that it can discriminate easily when the change of luminance occurs rather than chrominance. Human visual perception allows to exploit spatial redundancies to reduce the size of an image by utilizing efficient compression techniques. Every image have some redundant information that can be coded to differentiate between high and low frequencies. Almost all compression algorithm applies spatial transformation like DCT (Discrete Cosine Transform), DWT (Discrete Wavelet Transform), etc. to convert the image into spatial domain to represent data in terms of frequencies and apply entropy encoding for lossless compression. If we use quantization process before applying entropy coding then the compression will be lossy. QT (Quantization Table) can be exploited to determine true quality of a compressed image. Lossless compression algorithm are usually utilized in medical imaging because they require an image to retain all of its information after decompression, lossy compression techniques are used in almost all the rest of the image and video formats.

Exhaustive Crisp Parameter Modification in Quantization
Images techniques used in the field of Medicine are usually in a form of CT (Computed Tomography), X-Ray or MRI (Magnetic Resonance Image). These techniques tends to produce raw data that can easily exceed an allocated channel bandwidth. If the information is required to be delivered to the designated physician, it is imperative to apply compression algorithm [1][2][3][4][5][6]. Satellite images plays an important part in fields such as weather forecast and land cover classification, demand for fact transmission is necessary for fast acquisition of image thus compression is utilized [7]. In compression quantization is a lossy process used to reduce the information but eliminating or minimize the quantity of high spatial frequencies [8][9][10][11][12][13][14][15] in a DCT applied 8x8 Macro block [16][17][18][19][20][21]. Khowaja et. al. [22] and colleagues proposed a novel approach to implement the compression technique using moving average histogram and RBF (Radial Basis Function) network. In their proposed model, the color information is reduced using moving average histogram and the level adjustment is performed using RBF network.
In this paper, we proposed an algorithm to implement a compression technique in which a JPEG (Joint Picture Expert Group) quantization table is utilized as a baseline model for the modified version for fast internet based applications. A crisp factor is introduced denoted by p, through which we can alter the quality of an image by changing only its value. Different QT provided by the manufacturers include multiple tables in their software to provide better range of quality. By utilizing our proposed algorithm, we can easily manipulate the quality of an image as well as its size utilizing the Crisp (p) parameter on a single QT depending on the use.

BLOCK REPRESENTATION OF A COMPRESSION ALGORITHM WITH CRISP (P) MODIFIED QUANTIZATION TABLE
Compression process in any multimedia application is mandatory because of human visual system. High frequencies present in an image has very minor or no effect on its overall quality, so if they are removed we can still recover an image after compression having all of its traits with almost no loss in its quality. This process of distinguishing high and low frequencies in an image is achieved using a spatial transformation process called DCT, it is the most popular method applied in compression process by the researchers [18][19][20][21]. For the application of DCT algorithm an input image is transformed into equal 8x8 macro blocks as given in Fig. 1, where M represents the rows and N represents the columns. Each macro block have 64 pixels means that it possess 64 sets of frequencies in spatial domain. DCT is applied on each of these blocks to separate them, Equation (1) represents its model. Before the application of DCT, whole macro block is subtracted by 128 to make zero a center point.
where Cu = Cv = 0.7071 if u = v = 0 and Cu = Cv = 1 if u and v are not equal to 0. P(x,y) is Pixel values in rows and columns, N is Total number of pixels in Macro block. High frequency components possess small values as compared to low frequency components. QT is a key part of a compression technique, this is the process due to which the whole technique is called lossy compression. Each macro block, when divided by the given QT will eliminate the high frequency components or make them close to zero. This is where we can modify the QT for quality selection before applying zigzag scanning as given in Fig. 2. This parameter p is basically a quantity that can control of an image, proposed method is discussed in section 3.

Exhaustive Crisp Parameter Modification in Quantization
It is important to apply scan first before entropy encoding, which further compresses the data by converting it into binary bit stream for transmission or storage. For decoding process, whole algorithm is applied in reverse order. Binary bit stream is decoded and converted back into 8x8 macro blocks by inverse zigzag process and de-quantize using the same p modified QT. IDCT (Inverse DCT) will convert it back the spatial frequency components into data points, these components are placed back in in their designated places to reconstruct an image received in the form of a bit stream.

CRISP (p) MODIFICATION METHOD
Quality of an image depend on QT, it can be modified in order to produce desired image quality. Human eye is more sensitive to luminance rather than chrominance, their QT are different for perceptive reasons. We can rigorously reduce chrominance features in an image with more effective QT because it will not affect its overall quality. An acquired RGB (Red, Green and Blue) image is transformed in YCbCr, where Y is Luminance and CbCr are blue and red-difference chrominance components. As we discussed about human visual system, its perception of change in chrominance is not good but it can perceive changes in luminance very effectively, hence this conversion from RGB to YCbCr is necessary in this regard.
In the proposed algorithm, a standard JPEG QT is introduced as a base model and modified it with p parameter using Equations (2-3). It basically allows a user to set the sharpness of an image. Range of p extends from 1-100. Although we can place values less than 1 but p must never be equal to zero and its quality will degrade.
FIG2: LOSSY COMPRESSION BLOCK DIAGRAM WITH p FACTOR MODIFICATION.
where, Z(k) is the sum of all elements present in the row denoted by k, here k = 1 to 8 for an entire row, z(k) denotes a row vector and k represent the row number i.e. from 1 to 8, N is the number of columns and for this application it is equal to 8 due to 8x8 QT,

282
M is the number of columns and for this application it is equal to 8 due to 8x8 QT, a(k, j) is a sum of an entire row for Equation (1). b(i, j) represents the value of an individual pixel, p is Crisp parameter. In the proposed algorithm total control falls on p, its value will be multiplied with the maximum quantity of a row thus generating a small value for QT in turn improving the quality of recovered image. Table 1 represents a standard JPEG QT and Table 2 is basically a version acquired after the implementation of p parameter modified QT on standard JPEG QT.
Range of k is 1 to 8 as it is an 8x8 matrix. Assume the value of k=1, if applied on the first row of standard JPEG QT will give a sum of an entire row for all values of j making Z(1) = 229. The value of Z(1) is placed in Proposed QT equation which is multiplied by the value of b(1,1) that is 16 as given in standard JPEG QT. Maximum value of row denoted by z(k) is 61 at k = 1 is multiplied by p value which is 1 in this case. We acquire a value for the modified QT which is 61 as shown in p modified QT table. Whole process is repeated for all values of k from 1 to 8 and when the value of a denominator of Proposed QT equation becomes large enough that it make the value of QT element zero which is not valid. In such case, we placed a rule that if any value of b(i,j) becomes zero then it will be considered to be 1, and there will be no compression for that individual pixel. Bigger the QT values means more compression of the DCT acquired block. Hence if the value of p increases quality of an image will also increase and also its size or Compression Ratio (CR) will decrease.  OF 50  16  11  10  16  24  40  51  61  12  12  14  19  26  58  60  55  14  13  16  24  40  57  69  56  14  17  22  29  51  87  80  62  18  22  37  56  68  109  103  77  24  35  55  64  81  104  113  92  49  64  78  87  103  121  120  101  72  92  95  98  112  100  103  99   TABLE 2. MODIFIED QT AT P = 1  61  42  38  61  91  151  192  229  52  52  60  82  111  248  256  235  59  55  68  101  168  239  289  235  59  71  92  121  213  362  333  258  81  99  167  252  306  490  464  347  121  176  277  322  408  523  568  463  293  383  467  520  616  723  718  604  496  634  654  675  771  689 710 682

RESULTS
Images after decompression may have a lot of distortion artefacts such as blockiness, ringing and blurriness. They are visible if an image is over compressed, although its size will be reduced but its quality is not desirable. In proposed algorithm p parameter will provide an acceptable compromise in between quality and size. Fig. 3(a) is an original dry fruit raw image take from a DSLR (Digital Single-Lens Reflex) camera, it is resized at 680x960 resolution in this case. Resizing is not included in the compression algorithm although raw image captured by a camera has a resolution of 4000x6000, and may size up to 35 MB (Mega Bytes) depending on its content. Resizing alone can easily reduce an image size by a lot. In this paper, compression algorithm is utilized to reduce the size of an image using p parameter that ranges from 1-100. This range is selected after visualizing simulation results on MATLAB, it is possible to accept the value of p less than zero but that reconstructed image quality will be of no use, similarly we can take value greater than 100, and in that case there will be no compression as QT values will be close to unity. Fig. 3(b) is a reconstructed image after compression at p = 1, it possess blockiness artefact as it is over compressed. Fig. 3(c-d) are the reconstructed images at p = 8 and 16 respectively. Their quality is much better than an image with p = 1 as they are not over compressed for better image quality. For basic visual perception and to determine the quality of an image after the implementation of compressed image, a survey was conducted to obtain the opinion of the masses. An opinion is obtained from the masses to determine which image at the values of p =1, 8 and 16 closely resembles the Raw original one. MOS (Mean Opinion Score) also provides a response according to the results obtained in a form of MSE (Mean Squared Error) and PSNR (Peak Signal to Noise Ratio) that the best compromise between quality and size is between the values p ranges from 11 to 20. If the value is greater than 20 quality may increase but size will also increase and on the other hand, if the value is less than 11, its size will decrease and so does the quality. Image in Fig. 3 is captured with a personal MSE at p = 1 is 0.002 and PSNR is 27.2335 dB. Size of an original raw image at 1290x1920 resolution is 1.24 MB and after application of a proposed compression algorithm with modified QT, its size reduced to 130.32 Kbytes with a CR of 9.51 as given in Table 3. It represents the detail analysis of results acquired after the implementation of p parameter modified QT in JPEG based compression.

283
Obtained MSE at p reduces more with the values form 1-10 but from 11-20 there is not much difference in MSE as well as in PSNR. CR is also in an acceptable range that is from 6.49-5.88 in reverse order for values of p from 11-20. When the value of p is selected between the ranges of 11-20, it provides with the best compromise between quality and size. Although, in many cases size of an image depends on its contents.
JPEG 2000 is a much better option when compared to the standard JPEG format. It utilizes DWT for the identification of high and low frequency components. It is also less affected by the bit error due to more effective and efficient coding schemes. Although JPEG 2000 provides better quality then the original JPEG compression but it seem not many people tend to use it. It requires much more computation as its structure is more complex as compared with the JPEG compression. Fig. 4(a) represent the original image on which the process of JPEG 2000 is applied. Fig. 4(b) is reconstructed image that provides 25% quality of image with respect to the original, on the other hand Fig. 4(c-d) provides 60% and 90% qualities respectively. Table 4 represents the comparison of the proposed model with the standard JPEG and JPEG 2000 formats. The size of an image utilized for The p value to acquire 25% image quality is 4, p = 1 provides the quality of 60% and p = 24 provides the quality 0f 90%.

DISCUSSION
MOS was calculated from the masses by providing them an original image and also the reconstructed images at p = 1, 8 and 16 given in Table 5. In order to gain MOS, people were asked to rate the reconstructed image y means of an online survey that closely resembles the original one and for the fair analysis each person must rate all three images in terms of percentage. For all three reconstructed images, a fix range of similarity index was given as a reference. A range for an image at p = 1 was from 35% -50%, range at p = 8 was from 50% -70% and the range at p = 16 285 was from 70% -90%. This means that the people were provided with the hint about the reconstructed images that closely resembles the original and they must choose the similarity index in terms of percentage of all three image from the given range. For example, a person rated the reconstructed image at p = 1 with the score of 45%, this means that he thinks, it has 45% similarity with the original, he chose 45% from the given range of 35% -50% and he rated the image at p = 8 with the score of 70%, which means it has 70% similarity with the original and vice versa. The mean was calculated from the acquired percentages of all three images to determine the cumulative MOS, the reconstructed image at p = 1 was found to be 47.633%, which means that the image at p = 1 has the least resemblance with the original image and on the other hand, the image at p =16 has the most resemblance as its cumulative score is more than 83%. The total of 113 people rate the reconstructed images and their mean was calculated to achieve cumulative MOS score in percentage.

CONCLUSION
Compression is a necessary process in all forms of multimedia applications, an image after compression process must retain most of its original attributes without losing is overall quality. This can be achieved with efficient compression algorithm that provides a good trade-off between an image size and quality. In this paper, a method is proposed that can modify any QT, in this case JPEG standard QT using p parameter. All the results were obtained using proposed algorithm on standard JPEG QT on MATLAB. MSE and PSNR calculated at p ranges from 1-5, 11-15, 25, 50 and 75, they provide a conclusion result for the best trade-off between size and quality lies in the range from 11-20, because their MSE and PNSR are not changing by a large margin as they are in the range from 1-10. According to the MOS at (p) = 16 has the best result, which proves the MSE and PSNR for the given range possess the best trade-off. Although it is quit hard to judge an image by visualizing it from a distance, but quality of an image will differ in this case or over compression.