International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 Robust and Oblivious Watermarking based on Swapping of DCT Coefficients Dr. K. Ramanjaneyulu 1, Dr. P. Pandarinath 2 and B. Rakesh Reddy 3 1 Electronics and Communication Engineering Department, PVP Siddhartha Institute of Technology, Vijayawada, India 2 Computer Science and Engineering Department, Gudlavalleru Engineering College, Gudlavalleru, India 3 Computer Science and Engineering Department, Sir CRR College of Engineering, Eluru, India Abstract In this paper, a robust digital image watermarking algorithm using the Discrete Cosine Transform (DCT) is proposed for the secret message protection. Results show that this algorithm is robust to many image attacks. Various attacks were tested on a number of 8-bit grayscale cover images of size 512×512, embedded with binary watermark images of size 32×32 and 64×64. Visual quality of both watermarked image and extracted watermark is good. The performance of the proposed algorithm is calculated in terms of PSNR, NCC, BER and SM. Keywords: Digital Watermark, Discrete Cosine Transform, Robust, Jpeg compression and Attacks. 1. INTRODUCTION In recent years digital watermarking is used to protect the secret data; it can be images, audio, video and documents. Digital image watermarking can offer copyright protection of image data by hiding copyright information in the original image [1]-[2]. Image watermarks may be visible or invisible, where a visible watermark is easily detected by observation [3] while an invisible watermark is designed to be transparent to the observer and detected using signal processing techniques [4]-[5]. Two different types of methods in watermarking they are spatial domain methods and frequency domain methods. Spatial domain algorithms are simple and data embedding capacity is more and vulnerable [6]. The watermarking of image is good with frequency domain that is on Discrete Cosine Transform (DCT) [7]-[9]. DCT converts data from spatial domain to frequency domain. An invisible watermarking scheme was designed with robust and oblivious DCT based watermarking process. In this paper, an invisible watermarking algorithm is proposed in DCT domain which is robust and oblivious. Robust indicates that there is high possibility of extracting watermark with less error even the watermarked image is subjected to different attacks and Oblivious indicates that cover image is not needed during extraction. The cover image is firstly transformed into DCT domain by 8×8 block DCT transform. The watermark bits are embedded into the cover image by adjusting the relationship among a group of middle frequency coefficients. And the approach of embedding process is based on swapping of two coefficients which are selected. The Alignment of the paper is as follows. Section 2 describes Watermarking Requirements. In section 3, Proposed Watermarking Method is explained. Section 4 provides Simulation Results and Conclusions are presented in Section 5. 2. WATERMARKING REQUIREMENTS The main requirements for an acceptable quality [10] [11] of watermarking are as follows. a) Imperceptibility: The watermark should not be easily noticed by simple visual inspection. b) Key uniqueness: Different keys should produce different, statistically independent watermarks. c) Non invertibility: It should not be computationally feasible to find the watermark by possessing a watermarked image. d) Image dependency: A single key produces a single watermark; however, this watermark should be adapted to the image content. e) Reliable detection: The watermark should be efficiently detected for any value of false alarm probability up to a certain threshold. f) Tranparency: The watermark is not visible in the image under typical viewing conditions. g) Capacity: Ability to detect watermarks with a low probability of error as the number of watermarked versions of the image increases. h) Robust: The watermark can still be detected after the image has undergone some linear or non linear operations. Volume 2, Issue 7, July 2013 Page 445 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 3. PROPOSED WATERMARKING METHOD 3.1 Coefficient Selection Transform the cover image into 8×8 DCT blocks. Here, Fig. 1 represents a single 8×8 DCT block which is selected from the cover image. Select the coefficients of two which are neighbor to each other. In Fig. 1, the selected two coefficients are indicated in two colors. Red color coefficient is the selected coefficient one i.e. coeff1 (i, j) and dark blue color is the second selected coefficient i.e. coeff2 (i, j). (1,1) (2,1) (3,1) (4,1) (5,1) (6,1) (7,1) (8,1) (1,2) (1,3) (1,4) (1,5) (1,6) (1,7) (2,2) (2,3) (2,4) (2,5) (2,6) (2,7) (3,2) (3,3) (3,4) (3,5) (3,6) (3,7) (4,2) (4,3) (4,4) (4,5) (4,6) (4,7) (5,2) (5,3) (5,4) (5,5) (5,6) (5,7) (6,2) (6,3) (6,4) (6,5) (6,6) (6,7) (7,2) (7,3) (7,4) (7,5) (7,6) (7,7) (8,2) (8,3) (8,4) (8,5) (8,6) (8,7) Fig. 1 Coefficient Selection in a 8×8 DCT block (1,8) (2,8) (3,8) (4,8) (5,8) (6,8) (7,8) (8,8) 3.2 Description of Watermark Embedding Method 1) In order to authenticate the image successfully, the embedded information should be robust against different attacks. The modified embedding process uses the proposed scheme and it utilizes the relationship among 2 selected coefficients from each block to embed the watermark. This section will illustrate the embedding process in detail. The block diagram of the watermark embedding process is shown in Fig. 2. Watermark image Cover Image 8×8 DCT 8×8 Blocks and coefficients Selection Embedding Process Inverse DCT Watermarked image Fig. 2 Watermark Embedding Process Now we see details of embedding process in stepwise below: a. Spilt the Original Image into 8×8 blocks, and then apply DCT transformation on each block. b. Select two coefficients from each 8×8 DCT block as per Fig. 1 and denote them as coeff1 and coeff2 respectively. When the watermark is inserted in low frequency coefficients then it reduces the image quality and if inserted high frequency it is easily influenced by attacks such as filtering. So, mid band DCT coefficients for embedding the watermark are selected. c. Introduce three variables x and y which are used to modify the coefficients values after proper initialization. Experimentally, it is found that the following values are good for Mountsea.bmp cover image and 32×32 size watermark. x=3.5 and y=2.45 Modify the values of coefficients; coeff1 (i, j) = x×coeff2 (i, j) and then coeff2 (i, j)= (coeff1(i,j)+y×coeff1(i,j)). While swapping the coefficients for 64×64 size watermark image, initialize the variables x=1.6 and y=1.7 to modify the values of coefficients; coeff1 (i, j) = x×coeff2 (i, j) and then coeff2 (i, j)= y×coeff1(i,j). d. Mid band DCT coefficients are compared and adjusted for each DCT block based on the following rules. Volume 2, Issue 7, July 2013 Page 446 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 Where, represents the bit of watermark and for simulation of results use coeff1 (5, 2) and coeff2 (4, 3) and coeff1 (i, j) or coeff2 (i, j) represents DCT coefficients. If the watermark bit is 0 then DCT transform coeff1 (5, 2) should be greater than coeff2 (4, 3). If the watermark bit is 1 then DCT transform coeff2 (4, 3) should be greater than coeff1 (5, 2). If any of above cases is false then this two coefficients are swapped. 3.3 Description of Watermark Extraction Method The watermark extraction process does not require the original image, i.e. the paper scheme is oblivious. The watermark embedding position and the block selection sequence during watermark embedding are utilized to extract the watermark. The following Fig. 3 describes the extraction process. Suspected image 8×8 DCT 2 Neighbor 8×8 Blocks and coefficients Selection Extraction Process Extracted watermark Fig 3: Watermark Extraction Process Watermark Extraction Method steps are given below. a. Spilt the possibly attacked watermarked image into 8×8 blocks, and then apply DCT transformation on each block. b. Select two coefficients from each 8×8 DCT block as per Fig. 1 and identify them as coeff1 (i, j) and coeff2 (i, j). c. Watermark extraction process can be done with following rule. Where, w (i, j) is extracted watermark. d. The decoded watermark bits are organized into m×n matrix form W’. Compare the extracted watermark with the original watermark W. The bit error rate (BER) formula can be defined as follows: Where, ⊕ is XOR operation. e. The peak signal-to-noise ratio (PSNR) is used to evaluate the quality of the watermarked image in comparison with the original cover image. PSNR Formula is as follows: Where, m and n are the height and width of the image, respectively. f (i, j) and g (i, j) are the pixel values located at coordinates (i, j) of the original image, and the attacked image, respectively. f. After extracting the watermark, the normalized correlation coefficient (NCC) is computed using the original watermark and the extracted watermark to measure the quality of an extracted watermark. It is defined as Where, m and n are the height and width of the watermark, respectively. The symbols (i, j) and w’ (i, j) are the bits located at the coordinates (i, j) of the original watermark and the extracted watermark respectively. The symbols and are the values of the original watermark and the extracted watermark respectively. g. The similarity factor is a metric which determines the similarity between the watermark inserted and the extracted watermark. SM is the similarity factor ranging from 0 to 1. SM=1 indicates that original watermark and the extracted watermark are the same and any other value indicates the deviation among them. Generally, SM >0.75 is accepted for visible similarity. SM can be calculated using the following equation. Where, w and w’ represents the original and the detected watermarks respectively. Volume 2, Issue 7, July 2013 Page 447 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 4. SIMULATED RESULTS Proposed Algorithm has been executed on several standard 512×512 grayscale images, including Mountsea.bmp, paddy.bmp and road.bmp and y×y pixels of watermark image (both 32×32 pixels and 64×64 pixels). Both binary watermark images of size 32×32 and 64×64 are used in this work. Fig. 4 shows the embedding process with Mountsea.bmp (512×512) cover image and 32×32 size watermark. Parameters x and y are initialized as x=3.5 and y=2.45. The simulation results are shown in Table 1. Mountsea.bmp (512×512) PSNR = 37.46 dB watermark image (32×32) Watermarked.bmp (WI) PSNR = 37.43 dB Fig. 4 Embedding Process from cover image to Watermarked image Table 1 describes all measures like Quality Factor of JPEG Compression, Extracted watermark image, Attacked PSNR (dB), Bit-Error-Rate (BER), Similarity factor Measure (SM) and Normalized Cross-Correlation Coefficient (NCC). Table 2 describes the different types of attacks on watermarked image like Gaussian Filtering (2×2) at density 0.2, Gaussian Filtering (3×3) at density 0.6, Gaussian Filtering (3×3) at density 0.4,Gaussian Filtering (5×5) at density 0.3, Gaussian Noise at 0.00005, Blurring at 0.6, Sharpening at 0.6, Motion 2bits with 90 degrees, Motion Blurred Image at 20,45, Cropping left-side (1,1,255,255) and Rotating watermarked image to 5 degree and then rotated back. Let us take same cover image (Mountsea.bmp) of size 512×512 which is embedded with 64×64 size binary watermark image. Fig. 5 describes the embedding process. Mountsea.bmp (512×512) watermark Watermarked Image (512×512) PSNR = 34.12 dB image (64×64) PSNR = 34.10 dB Fig. 5 Embedding Process from cover image to Watermarked image The values for x and y given are x=1.6 and y=1.7. The simulated results for quality factor of JPEG Compression attack on watermarked image listed in the Table 3. Table 4 describes with different types of attacks on watermarked image like Gaussian Filtering (2×2) at density 0.2, Gaussian Filtering (3×3) at density 0.6, Gaussian Filtering (3×3) at density 0.4,Gaussian Filtering (5×5) at density 0.3, Gaussian Noise at 0.00005, Blurring at 0.6, Sharpening at 0.6, Motion 2bits with 90 degrees and soon. Table 1 Simulated Results of JPEG Compression attack on Watermarked image S.NO QF of JPEG Compression Attack Extracted Watermar k image PSNR (dB) of attacked Watermark image Quality of the Extracted Watermark BER SM NCC 1 10 26.92 0.3018 0.8046 0.1432 2 20 28.83 0.2930 0.8000 0.2692 Volume 2, Issue 7, July 2013 Page 448 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 3 30 29.88 0.2461 0.8315 0.3969 4 40 30.55 0.2217 0.8498 0.4412 5 50 31.09 0.1846 0.8743 0.5487 6 60 31.61 0.1602 0.8911 0.6118 7 70 32.34 0.1250 0.9160 0.6833 8 80 33.37 0.0977 0.9349 0.7457 9 90 35.16 0.0439 0.9710 0.8825 10 100 37.28 0.0146 0.9904 0.9596 Table 2 Simulated Results for Other Attacks on Watermarked Image S.NO 1 Attacked Watermarked Image Gaussian Filtering(2×2) at 0.2 PSNR (dB) Extracted Image BER SM NCC 28.69 0.1484 0.8991 0.6432 2 Gaussian Filtering(3×3) at 0.6 33.81 0.0459 0.9696 0.8798 3 Gaussian Filtering(3×3) at 0.4 37.71 0.0146 0.9904 0.9598 4 Gaussian Filtering(5×5) at 0.3 37.54 0.0068 0.9955 0.9810 5 Gaussian Noise,0.00005 36.37 0.0547 0.9639 0.8538 6 Blurring, 0.6 37.71 0.0146 0.9904 0.9598 7 Sharpening, 0.6 19.71 0.0469 0.9690 0.8782 8 Motion 2bits, 90 degree 34.28 0.0781 0.9478 0.8035 9 Motion Blurred Image, at 20,45 23.34 0.3555 0.7425 0.2486 10 Cropping, left-side 7.96 0.0508 0.9684 0.8571 11 Rotate 5 degree 26.49 0.0742 0.9505 0.8117 Table 3 Simulated Results of JPEG Compression attack on Watermarked image S.NO QF of JPEG Compression Attack Volume 2, Issue 7, July 2013 Extracted Watermark image PSNR (dB) of attacked Watermark image Quality of the Extracted Watermark BER SM NCC Page 449 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 1 10 26.54 0.2766 0.8240 0.1824 2 20 28.23 0.2395 0.8403 0.3683 3 30 29.07 0.2068 0.8606 0.4749 4 40 29.61 0.1577 0.8952 0.5831 5 50 30.06 0.1313 0.9132 0.6466 6 60 30.48 0.1174 0.9222 0.6880 7 70 31.02 0.1060 0.9297 0.7211 8 80 31.75 0.0674 0.9555 0.8222 9 90 32.90 0.0466 0.9694 0.8746 10 100 34.10 0.0276 0.9820 0.9243 Table 4 Simulated Results for Other Attacks on Watermarked Image S.NO Types of Attack PSNR (dB) of attacked Watermark image Extracted Watermark image Quality of the Extracted Watermark BER SM NCC 1 Gaussian Filtering(2×2) at 0.2 28.21 0.1482 0.8997 0.6420 2 Gaussian Filtering(3×3) at 0.6 32.46 0.0564 0.9628 0.8511 Volume 2, Issue 7, July 2013 Page 450 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 3 Gaussian Filtering(3×3) at 0.4 34.43 0.0332 0.9782 0.9099 4 Gaussian Filtering(5×5) at 0.3 34.18 0.0254 0.9834 0.9303 5 Gaussian Noise,0.00005 33.59 0.0581 0.9617 0.9303 6 Blurring, 0.6 34.43 0.0334 0.9781 0.8472 7 Sharpening, 0.6 19.44 0.0747 0.9506 0.9093 8 Motion 2bits, 90 degree 32.65 0.0723 0.9522 0.8039 9 Motion Blurred Image, at 20,45 23.33 0.4399 0.6713 0.1189 10 Cropping, left-side 7.95 0.0535 0.9666 0.8459 11 Rotate 5 degree 26.20 0.0732 0.9514 0.8117 5. CONCLUSION In this work, Robust and oblivious watermarking algorithm is proposed and its performance against various image attacks is good. Algorithm is designed for embedding both 32×32 size and 64×64 size watermarks. Proposed method is modified version of the existing method [12] for 32×32 size watermark image. It is an extension of the proposed method for 64×64 size watermark. The performance of proposed method against various attacks for watermark images of 32×32 size and 64×64 size is presented in terms of PSNR, BER, NCC and SM. Visual quality of both watermarked image and extracted watermark is good. References [1.] Anderson, R. J, Ed., “Information Hiding”, First International Workshop, Lecture Notes in Computer Science, Springer-Verlag, vol. 1174, 1996, pp. 1-7. [2.] Cox, I. J., Miller, M. L., and Bloom, J. A., “Digital Watermarking”, New York: Morgan Kaufmann Publishers Inc., San Fransisco, CA, 2002. [3.] Shu-Kei Yip, Oscar C. Au, Chi-Wang Ho and Hoi-Ming Wong, “Lossless Visible Watermarking,” in IEEE, 1424403677/06. [4.] Yonggang Fu,” Robust oblivious image watermarking scheme based on coefficient relation,” in International Journal for Light and Electron Optics, Optik 124 (2013), 517– 521. [5.] N. Nikolaidis and I. Pitas, “Copyright protection of images using robust digital signatures,” in Proc. IEEE Int. Conf. Acoustics, Speech, Signal Processing (ICASSP ’96), vol. 4, Atlanta, GA, May 1996, pp. 2168–2171. [6.] Dr GN Swamy and B Surekha,“A Spatial Domain Public Image Watermarking,” in International Journal of Security and Its Applications, Vol. 5 No. 1, 2011. Volume 2, Issue 7, July 2013 Page 451 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 7, July 2013 ISSN 2319 - 4847 [7.] A. Piva,M. Barni, F. Bartolini, and V. Capellini, “DCT-based watermark recovering without resorting to the uncorrupted original image,” in Proc. IEEE Int. Conf. Image Processing (ICIP’97), vol. 1, Santa Barbara, CA, Oct. 1997, pp. 520–523. [8.] M. Barni, et al, “A DCT-domain system for robust image watermarking,” in IEEE, Signal Process. 66 (3) (1998), pp. 357–372. [9.] S.D. Lin, S.-C. Shie, J.Y. Guo, Improving the robustness of DCT-based image watermarking against JPEG compression, Comput. Stand. Interfaces 32 (2010) pp.54–60. [10.] G. Voyatzis and I. Pitas, “Protecting digital-image copyrights: A framework,” IEEE Comput. Graph. Applicat., vol. 19, no. 1, pp. 18–24. [11.] S. Craver, N. Memon, B. L. Yeo, and M. M. Yeung, “On the invertibility of invisible watermarking techniques,” in Proc. IEEE Int. Conf.Image Processing (ICIP’97), vol. 1, Santa Barbara, CA, Oct. 1997, pp.540–543. [12.] Reena Gunjan, Saurabh Maheshwari, Vijay Laxmi and Manoj S. Gaur,” A DCT Based Permuted Image Digital Watermarking Method” in IEEE on TENCON 2010, 978-1-4244-6888-1/10. AUTHORS K.Ramanjaneyulu completed his B.Tech in ECE in 1990 and M.Tech in ECE in 1993. He completed his doctoral degree in Andhra University in 2012. He has a total experience of 20 years in teaching. Presently, he is working as a Professor in PVP Siddhartha Institute of Technology, Kanuru, Vijayawada. He has guided several UG & PG student projects. His areas of interest include Wireless Communications, Digital Watermarking, Data Security & Cryptography and Analog & Digital Communications. P. Pandarinath did his B.E in CSE in 1994 and M.Tech in CSE in 2001. He completed his doctoral degree in Andhra University in 2012. He has a total experience of 17 years. He is working as a Professor in Gudlavalleru Engineering College. He has guided over 100 UG & PG student projects. His areas of interest include Network Security and Cryptography, Advanced Computer Architecture, DataBase Management System, Computer Organization, Computer Networks and Bio-informatics. B. Rakesh Reddy completed his B.E in Computer Science and Engineering in 2009 at Kamban Engineering College, Tiruvannamalai. Presently he is studying final year M.tech in Computer Science and Technology (2012-2013) in Sir CRR college of Engineering, Eluru. His areas of interest include, Digital Watermarking, Data Security & Cryptography and Software Engineering. G. Nirmala completed her B.Tech in CSE in 2003 and M.Tech (Ph.D) in CSE in 2007. She has a total experience of 10 years. She is working as a Sr. Associate Professor in Sir CRR College of Engineering, Eluru. She has guided several UG & PG student projects. Her areas of interest include Computer Networks, Design and Analysis of Algorithm, Operating System, Data Mining & Data Warehousing, Cryptography and Network Security and System Programming. Volume 2, Issue 7, July 2013 Page 452