B I O D I V E R S IT A S ISSN: 1412-033X Volume 16, Number 1, April 2015 E-ISSN: 2085-4722 Pages: xx-xx DOI: 10.13057/biodiv/d1601xx Robustness Test of Discrete Cosine Transform Algorithm in Digital Image Watermarking on Android Platform Oky Rahmanto 1*, M Reza Faisal 2**, and Radityo Adi Nugroho 3** 1 Department of Computer Science, Faculty of Mathematics and Natural Sciences, Lambung Mangkurat University. Jl.A. Yani Km 35.8 South Kalimantan, Indonesia. Tel./Fax. +62-511-4663375, * email: oky.rahmanto@gmail.com 2 Department of Computer Science, Faculty of Mathematics and Natural Sciences, Lambung Mangkurat University. Jl.A. Yani Km 35.8 South Kalimantan, Indonesia. Tel./Fax. +62-511-4663375, ** email: reza.faisal@unlam.ac.id 3 Department of Computer Science, Faculty of Mathematics and Natural Sciences, Lambung Mangkurat University. Jl.A. Yani Km 35.8 South Kalimantan, Indonesia. Tel./Fax. +62-511-4663375, *** email: radityo.adi@unlam.ac.id ABSTRACT Watermark embedding is one way to detect violations of copyright in digital image. One of watermarking techniques used is Discrete Cosine Transform (DCT). Research using DCT watermarking technique is generally done in MATLAB. In this research, DCT algorithm is implemented on Android device using JAVA programming language to detect the watermark insertion and then examine the watermarked image that has been manipulated to determine the level of resistance of the watermark. From this study, we can conclude several things such as α value affects the imperceptibility of watermarked image by using DCT algorithm. Watermark which is embedded on the image can withstand the image manipulation such as sharpening, contrasting, brightening, compressing and changing of certain file extension. The embedded watermark cannot be detected if manipulation such as resize, Gaussian blur and cropping was performed. There is a damage in the form of white spots on particular images that possibly happened because of Android system operation which basically has not supported YcbCr color format. YcbCr or YUV color space support is available on API level 19 or Android 4.4. Key words: Android, Discrete Cosine Transform eywords, Image, Java, Watermark. Abbreviations (if any): All important abbreviations must be defined at their first mention there. Ensure consistency of abbreviations throughout the article. INTRODUCTION In general, multimedia data are presented in the form of image, audio and video. Digital image is one of digital data that is widely used in multimedia applications. Like other digital data, digital image has characteristics and also weakness, that is easy to duplicate with the exact same result as the original. In addition, digital image is easy to distribute, either through magnetic storage media or internet. Slight changes in digital image are not easily perceived by the sight senses[1]. Digital image watermarking is a technique used to control duplication and distribution of digital image by embedding the information of copyright in the form of watermark[2]. The embedding is done in such a way so that it cannot be perceived by human eyes (imperceptible). Watermark must also be robust against the attacks aimed to destroy or remove it from a digital image. Discrete Cosine Transform (DCT) is one of algorithms which can be used to embed and detect the watermark in a digital image. Research conducted by Munir stated that watermarked image 374
SETYAWAN et al. Running title is about five words generated by DCT algorithm could not be distinguished from the original image and proven to be robust against attacks, such as JPEG compression, histogram equalization, gamma correction, cropping, resizing, noising and sharpening[1]. Munir s research on DCT algorithm for watermarking was performed by using desktop devices using MATLAB. From previous studies on the implementation of DCT algorithm for watermark embedding in digital images, the author has not found the implementation of this algorithm aside from using MATLAB. Moreover, author has not found the implementation of this algorithm on real applications such as mobile applications. With those backgrounds, algorithm DCT implementation for watermarking digital images is done on Android devices using JAVA programming language. A resistance test of DCT algorithm for watermarking digital image on Android device is carried out in this study. REVIEW OF LITERATURE This study is based on the research by Rinaldi Munir with his paper entitled Image Watermarking untuk Citra Berwarna dengan Metode Berbasis Korelasi dalam Ranah DCT (Image Watermarking for Color Images with Method Based on Correlation on DCT Domains). This study is conducted using MATLAB software to perform the test on image manipulations such as JPEG compression, histogram equalization, gamma correction, cropping, resizing, noising, and sharpening. Research by Munir proved that watermark embedding with DCT algorithm produced a watermarked image that was resistant to image manipulations. BASIC THEORY Discrete Cosine Transform DCT algorithm is an algorithm to transform a spatial space into frequency space. For twodimensional signal such as digital images, two-dimensional DCT to the matrix I sized M x N is defined as follows: M 1 N 1 C(p, q) = α p α q I(m, n)cos m=0 m=0 π(2m + 1)p π(2n + 1)q cos 2M 2N Values of C(p,q) is called as DCT coefficents of image I. Inverse DCT transformation is expressed by the following equation: I(m, n) = α p α q C(p, q)cos Wherein: and M 1 m=0 α p = 1 M α q = 1 N N 1 m=0 π(2m + 1)p π(2n + 1)q cos 2M 2N, p = 0 or α p = 2, p = 0, 1 p M 1 M, q = 0 or α q = 2 N, p = 0, 1 q N 1 (3) Barni Algorithm Barni algorithm is included in Linear additive algorithm category[3]. According [1], Barni algorithm is one of good watermarking methods. In this algorithm, the watermark which is embedded into the image also serves as a watermark key. (1) (2) 375
B I O D I V E R S IT A S 16 (1): xx-xx, April 2015 In this case, the image is initially transformed into DCT space and then the N coefficient, which is selected in middle frequency, is extracted. A zig zag sequence is required, as in JPEG compression algorithm, to extract that coefficient[3]. Figure 1. A zig zag sequence of Barni algorithm. Figure 2. Three channel frequency division. DCT algorithm divided an image into three sub-band frequency (low, middle, and high). Insertion in low frequency part can damage the image because human eyes are more sensitive in lower frequency than higher frequency. On the contrary, if watermark is embedded in high frequency part, it will be deleted by quantization process as in lossy compression (e.g. JPEG). Therefore, the watermark is embedded in middle frequency in order to balance the robustness and imperceptibility. IMPLEMENTATION DCT algorithm implementation in this study is written with JAVA programming language and Android SDK to create application that runs on Android-based devices. This application consists of two main parts, namely watermark embedding and watermark detection. The algorithm is used in both parts. The steps of DCT algorithm implementation in watermark embedding and detection part can be seen below. 376
SETYAWAN et al. Running title is about five words Watermark embedding Watermark embedding is done with the following steps. Start Change RGB color space to YCbCr Choose luminance color space (y) Take 8 x 8 pixel form luminance (y) Do DCT algorithm Sort the DCT coefficients as Zig Zag Embed/insert watermark in middle area Restore the DCT coefficient sequence Invers DCT Return the value of the inverse DCT to the luminance color space (y) Is entire pixel image has been processed? Yes Change YCbCr Color Space ke RGB No End Figure 3. Watermark embedding steps. Watermark embedding process is done by iterating each pixel block sized 8x8. This is performed in order to save memory used by Android device. Moreover, this process follows JPEG compression method using DCT[4]. Watermark detection Watermark detection steps are as follows: Start Change RGB color space to YCbCr Choose luminance color space (y) Take 8 x 8 pixel form luminance (y) Do DCT algorithm Sort the DCT coefficients as Zig Zag Take the DCT coefficients in the middle Save the coefficients in the array Is entire pixel image has been processed? No Yes Calculate the value of C and T of coefficients that have been taken Compare the value of C and T Detection results End Figure 4. Watermark detection steps. 377
B I O D I V E R S IT A S 16 (1): xx-xx, April 2015 The following formula is used to calculate the value of C: N c = 1 (v (i). w(i)) N i=1 Where N is the array length of the obtained DCT coefficient, v* is a row of DCT coefficient, and w is the array row of watermark. T is calculated by the following formula: N T = α ( v (i) ) 3N i=1 Where α is coefficient value used in embedding, N is the array length of the obtained DCT coefficient, and v* is a row of DCT coefficient. If the value of C T then the image is considered to have a watermark but if C < T then the image is considered not to have a watermark. Each embedding and detection process, color space transformation from RGB to YCbCr is performed using this calculation: Y = 0.299R + 0.587G + 0.114B Cb = 0.168R + 0.3313G + 0.5B (6) Cr = 0.5R 0.4187G 0.0813B And the following formulas are used to transform color space from YCbCr to RGB. R = Y + 1.402(Cr 128) G = Y 0.34414G(Cb 128) 0.71414(Cr 128) (7) B = Y + 1.772(Cb 128) (4) (5) TESTING lementation phase, hereinafter the testing is done which is generally aimed at testing the success of DCT algorithm implementation with JAVA programming language as the application that is run on Android device. The test is conducted in order to determine the parameters that must be considered when using this algorithm in this environment. Additionally, robustness test is conducted to analyze the comparison of DCT algorithm robustness which has been done in the previous studies in MATLAB with Android environment which is conducted in this recent study. The tests performed in this study are imperceptibility test and robustness test. Imperceptibility This test is conducted to determine the good α value which when the watermark is embedded, there will be noticeable changes from the original image. Figure 5. Original image. 378
SETYAWAN et al. Running title is about five words Figure 6. Images resulted from watermark embedding with different α values. From left to right: α = 1, α = 0,8, α = 0,5, dan α = 0,1. Figure 5 is a image which has not been given a watermark. Figure 6 is watermarked image. α value = 1 causes obvious changes or damages to the image. If α value is reduced, the level of changes or damages is also reduced. The changes or damages to the image have not been visible when α value = 0,1. In testing, a few pictures are found damaged when watermarking is applied although α value = 0,1. Figure 7. The image prior to embedding. Figure 8. Pixel damage in the form of visible white spots caused by watermark embedding process. However, this pixel damage is not visible in the picture below. 379
B I O D I V E R S IT A S 16 (1): xx-xx, April 2015 Figure 9. On the left side is the original picture of Lenna and on the right side is Lenna s picture after the embedding but there are no visible damages. Robustness This testing is conducted to determine what image manipulation can cause the watermark becomes undetectable. The manipulation applied are in the form of cropping, resizing, sharpening, blurring, noising, compressing, and changing the image format (file extension). Table 1. The result of file type detection. *.bmp 0,09 0,05 0,0910 0,0730 detected *.jpg 0,09 0,05 0,0961 0,0661 detected *.png 0,09 0,05 0,0910 0,0730 detected *.gif 0,09 0,05 0,0789 0,0795 not detected The above table is the testing result of watermark detection with file type (file extension) variable. This result shows that the conversion of file type into *.gif makes the watermark become undetectable. Table 2. Detection result of image resizing. 25% 0,09 0,05-0,0215 0.1577 not detected 50% 0,09 0,05-0,0266 0,130 not detected 75% 0,09 0,05 0,0595 0,111 not detected 125% 0,09 0,05 0,0164 0,047 not detected 150% 0,09 0,05-0,0266 0,0410 not detected The above table is the testing results of watermark detection by image resizing as the variable. The results show that the watermark cannot be detected when the image is resized by 50%-150% of its original size. This finding is different from previous research [1] which stated that the watermark could still be detected when the image was resized by 50%-200% of its original size. 380
SETYAWAN et al. Running title is about five words Table 3. Brightness detection results. -100 0,09 0,05 0,207 0.67 detected -50 0,09 0,05 0,1701 0,073 detected -25 0,09 0,05 0,1490 0,072 detected +50 0,09 0,05 0,0641 0,0628 detected +100 0,09 0,05 0,0345 0,046 not detected The above table is the testing results of watermark detection by image brightness as the variable. The results show that the watermark can be detected when the brightness is changed from -100 to +50. This finding is similar with [1] which stated that the watermark could be detected when the image was manipulated by changing the brightness. Table 4. Contrast detection results. -50 0,09 0,05 0,1256 0,068 detected -25 0,09 0,05 0,1232 0,0706 detected +25 0,09 0,05 0,1120 0,0762 detected +50 0,09 0,05 0,1076 0,0791 detected +75 0,09 0,05 0,1005 0,0822 detected The above table is the testing results of watermark detection by image contrast as the variable. The results show that watermark can be detected when the contrast is changes from -50 to +75. This result is similar with [1] which stated that the watermark could be detected when the image was manipulated by changing the contrast. Table 5. Compressing detection results. Quality α input α detection C T Status 0 0,09 0,05 0,0934 0,0268 detected 1 0,09 0,05 0,0994 0,0307 detected 2 0,09 0,05 0,1061 0,0400 detected 3 0,09 0,05 0,1142 0,0525 detected 4 0,09 0,05 0,1085 0,0566 detected Table V shows the testing results of watermark detection using image compressing as the variable. Compression is done by using a scale of 0 to 12. These findings, together with the result from Munir s research, show that the watermark can still be detected even in the smallest compression. Table 6. Cropping detection result. crop1 0,09 0,05 0,2876 0,0561 detected crop2 0,09 0,05-0,2237 0,0670 not detected crop3 0,09 0,05 0,1836 0,0713 detected crop4 0,09 0,05-0,0332 0,0854 not detected crop5 0,09 0,05 0,305 0,0439 detected 381
B I O D I V E R S IT A S 16 (1): xx-xx, April 2015 The above table is the testing results of watermark detection using image cropping as the variable. The cropped image is then given a black piece. The results show that the watermark can still be detected for several types of cropping. Table 7. Gaussian blur detection results. 1px 0,09 0,05 0,0165 0,0265 not detected 2px 0,09 0,05 0,0022 0,0128 not detected 3px 0,09 0,05-0,0028 0,0077 not detected 4px 0,09 0,05-0,0037 0,0060 not detected 5px 0,09 0,05-0,0037 0,0054 not detected The above table is the testing results of watermark detection using image Gaussian blur as the variable. The results show that the watermark cannot be detected at all when manipulated with Gaussian blur. Table 8. Noise detection results. 5px 0,09 0,05 0,0106 0,0119 not detected 10px 0,09 0,05 0,125 0,172 not detected 15px 0,09 0,05 0,111 0,223 not detected 20px 0,09 0,05 0,0806 0,267 not detected 25px 0,09 0,05 0,191 0,313 not detected The above table is the testing results of watermark detection using image noising as the variable. The results show that the watermark cannot be detected. This finding is different from [1] which stated that the watermark could still be detected when the noising was applied to the image. Table 9. Sharpening detection results. 1px 0,09 0,05 0,239 0,122 detected 2px 0,09 0,05 0,228 0,133 detected 3px 0,09 0,05 0,2024 0,135 detected 4px 0,09 0,05 0,187 0,135 detected 5px 0,09 0,05 0,175 0,134 detected The above table is the testing results of watermark detection using image sharpen as the variable. The results show that the watermark can be detected. This finding is similar with Munir s study results. From the data of test results, watermark that is embedded into an image can be lasted from image manipulations such as sharpen, contrast, brightness, compressing and the changing of file extension. The embedded watermark cannot be detected when manipulations such as resizing, Gaussian blur and cropping are applied into the image. 382
SETYAWAN et al. Running title is about five words DISCUSSION This research was carried out by implementing watermarking applications on Android device. Previous study [1] proved that watermark embedding with DCT algorithm produced a watermarked image which is resistant to manipulations such as JPEG compression, histogram equalization, gamma correction, cropping, resizing, noising, and sharpening. Results of this study have differences with [1]. For example, in resize, cropping and noising tests. In [1] stated that the watermarked image can be resistant or detected if manipulations such as resizing, cropping, and noising are performed. However, the watermark cannot be detected in this study. This study also carries out tests in the form of manipulation to Gaussian blur and file extension change. The results show that the watermark cannot withstand the manipulation on Gaussian blur and *.gif file type. Pixel damage that occurs in embedding process is possible because of the Android operating system basically has not supported YCbCr color format. YCbCr or YUV color space support is available on API level 19 or Android 4.4 Kitkat. Thus, error values on particular pixel values occur in the process of changing color space. CONCLUSION From this study, we can conclude several things as the following: α value affects the imperceptibility of watermarked image by using DCT algorithm. Watermark which is embedded on the image can withstand the image manipulation such as sharpening, contrasting, brightening, compressing and changing of certain file extension. The embedded watermark cannot be detected if manipulation such as resize, Gaussian blur and cropping was performed. There is a damage in the form of white spots on particular images that possibly happened because of Android system operation which basically has not supported YcbCr color format. YcbCr or YUV color space support is available on API level 19 or Android 4.4. REFERENCES References are suggested from the scientific journal published in the last 10 years, i.e. 70-80%. R. Munir, Image Watermarking untuk Citra Berwarna dengan Metode Berbasis Korelasi dalam Ranah DCT. Jurnal Petir Vol. 3 No. 1. 2010 Ingemar J. Cox, dkk, Secure Spread Spectrum Watermarking for Multimedia, IEEE Trans. On Image Processing, Vol. 6, No. 12, Dec 1997, pp.1673-1688 Sharma, M.M. & Bhargava, N., Review of Various Digital Watermarking Embedding Algorithms. A.M.Raid, W.M.Khedr, M. A. El-dosuky and Wesam Ahmed, Jpeg Image Compression Using Discrete Cosine Transform - A Survey, International Journal of Computer Science & Engineering Survey (IJCSES) Vol.5, No.2, April 2014 383