3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
International Journal of Image and Graphics Vol. 13, No. 2 (2013) 1340002 (11 pages) c World Scientific Publishing Company DOI: 10.1142/S0219467813400020
QUANTIZATION-BASED FRAGILE WATERMARKING USING BLOCK-WISE AUTHENTICATION AND PIXEL-WISE RECOVERY SCHEME FOR TAMPERED IMAGE
DURGESH SINGH∗ , SHIVENDRA SHIVANI† and SUNEETA AGARWAL‡ Department of Computer Science and Engineering Motilal Nehru National Institute of Technology Allahabad-211004, India ∗
[email protected] †
[email protected] ‡
[email protected] Received 20 December 2012 Revised 11 February 2013 Accepted 3 May 2013 Published 5 July 2013 This paper suggests an efficient fragile watermarking scheme for image content authentication along with altered region restoration capability. In this scheme, image is divided into nonoverlapping blocks of size 2 × 2 and for each block, eight bits for image content recovery data and four bits for authentication data from five most significant bits (MSBs) of each pixel, are generated. These 12 bits are embedded into the least significant bits (LSBs) of the pixels which are placed in its corresponding mapping block. At the receiver end by comparing the recalculated and extracted authentication data, the tampered blocks can easily be identified and using recovery data, one can easily restore the tampered block. Results of experiments demonstrate that the proposed scheme is effective enough for alteration detection as well as tamper recovery of the image. Keywords: Fragile watermarking; image recovery; self-embedding; tamper detection.
1. Introduction Nowadays image alteration detection and its recovery are very essential area of research for image processing researchers. Since internet is not secure and multimedia technologies are developing very rapidly, image authentication and image recovery become more and more important. Image is very basic digital media that is why its protection is very essential, especially when it is exploited in medical imaging and evidence of court. Therefore, we are focusing here on fragile watermarking scheme. In fragile watermark any trivial modification in watermarked image leads to destroy the watermark.1–3 Fragile watermark is used for image tamper detection due to its sensitivity for alteration in image. One type of the fragile watermarking 1340002-1
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
D. Singh, S. Shivani & S. Agarwal
approach divides a host image into small blocks,4–8 and insert the fragile watermark into these blocks. There are many previous literatures that focused on image alteration detection and recovery but their efficiency differs on the basis of quality of results, peak signal to noise ratio (PSNR) values of imperceptibly altered work and the overhead of time complexity. There are many problems related to the alteration in watermarked image, if we wish to identify the altered region and its recovery then the data representing the primary content which may be altered, should be hidden in a different region of the watermarked image. Thus restoration may fail only at that time when the certain region and the region containing its original data, both are tampered. It is called tampering coincidence problem.9 When coincidence problem will be absent then the content restoration will be effectively completed from the data hidden in the corresponding mapped block. Our proposed approach is based on a quantization-based fragile watermarking using block-wise authentication and pixel-wise recovery scheme for tampered image. In this proposal, a block-wise mechanism is used for tampered area detection and pixel-wise mechanism is used to recover it. Organization of the paper is as follows: In Sec. 2 we will talk about the proposed watermark embedding procedure, tamper detection and content restoration procedure. We provide experimental results and their analysis in Sec. 3. The proposed algorithm is concluded in Sec. 4 followed by the references. 2. Proposed Approach In our suggested scheme, the five most significant bits (MSBs) of all pixels in the host image will be unchanged, and the three least significant bits (LSBs) will be replaced with watermark data that is generated by the five MSBs of that pixel itself. The watermark is divided into two parts, which are respectively used to detect the tampered blocks and to recover the original content of the image. Consider a gray scale host image I having number of rows and columns as N1 and N2 . Then N represent the total number of pixels (N = N1 × N2 ). Hence the intensities of each pixel of the host image is denoted by Pn ∈ [0, 255] where n = 1, 2, 3, . . . , N . Here, we consider that N1 and N2 are multiples of 2. Each Pn can be represented by eight bits, bn,8 , bn,7 , . . . , bn,1 , where p n (1) bn,m = m−1 mod 2, m = 1, 2, 3, . . . , 8. 2 2.1. Watermark embedding procedure Watermark embedding procedure is separated into three phases namely recovery bit generation, authentication bit generation and last one is block mapping as shown in Fig. 1. Recovery bits are used to recover the principle content of the image whereas authentication bits are those which are used to check the integrity of the image. For each nonoverlapping block having size 2 × 2 of the host image, a vector V of 1340002-2
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
Quantization-Based Fragile Watermarking
Fig. 1.
Block diagram for watermark embedding procedure.
length 12 bits will be calculated in which eight bits will be reserved for recovery bits and other four bits will be reserved for authentication bits. 2.1.1. Recovery bit generation In the process of watermark generation first of all we focus on recovery bit generation. The process of these bits generation is as follows. Step 1. Divide the host image I into nonoverlapping blocks of size 2 × 2, so N/4 will be the total number of blocks. Remove the three LSB from each pixel of each block. Hence the resulting image will be called principle content image. Step 2. Each pixel of the principle content image has 32 possible values ranging from 0 to 31. These 32 values divide into four quantization levels, where each quantization level has eight intensity variations. Step 3. Now each pixel value of principle content image belonging to a particular quantization level will be represented by two bits binary encoding using Table 1. Step 4. After the encoding, eight bits will be generated for each block. These eight bits is called as recovery bits. These bits stored in vector V as shown in Fig. 2. Table 1. Encoding bits for quantization level with intensity ranges. Intensity range
Quantization level
Encoded bits
0–7 8–15 16–23 24–31
0 1 2 3
00 01 10 11
1340002-3
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
D. Singh, S. Shivani & S. Agarwal
Fig. 2.
Arrangement of bits in vector V .
2.1.2. Authentication bits generation In this proposed algorithm for each block, we are using four bits for tamper detection. These four bits are calculated for each block by two methods. Each method generates two bits. Consider any pixel Pn of host image I. So we take only five MSBs of Pn represented as bn,m where m ∈ (4 · · · 8). Authentication Bits Generation Method 1 Generate the Authentication bit (Ab1 ) for each block using following steps as shown in Fig. 3. Step 1. Calculate the Ab p1 as following: a1 = bn,4 ⊕ bn,5 , a2 = bn,7 ⊕ bn,8 ,
(2)
a3 = a1 ⊕ a2 , a4 = bn,6 ⊕ a3 , where p ranges from 1 to 4 for each block. K1 mod 32
Pixel MSBs
5 4 3 2 1
5 4 3 2 1 a
a
(Hamming Distance) mod 2
d
a3 a4
a5
Pseudo Random Binary Matrix of Size (N1 x N2)
p
Ab1
Fig. 3.
Block diagram of authentication bits generation method 1. 1340002-4
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
Quantization-Based Fragile Watermarking
Step 2. Now calculate the hamming distance d between MSBs of each pixel and a secret key K1 . k1 = K1
mod 32,
(3)
d = (HammingDistance(bn,m , k1 )) mod 2, a5 = a4 ⊕ d.
(4) (5)
Step 3. Take a pseudo random binary matrix B having the size same as of the host image, based on a secret key K2 . Apb1 = a5 ⊕ Bn ,
(6)
where Bn is value of corresponding pixel location of Pn in pseudo random binary matrix B. Hence Ab1 calculation for each block will be followed as 4 p Ab1 = Ab1 mod 4. (7) p=1
After getting Ab1 from Eq. (7), convert into binary and put into vector V at 9th and 10th index position. Authentication Bits Generation Method 2 Consider any pixel of I as Pn . Now set three LSBs of Pn as zero and five MSBs will remain unchanged. Similarly Pnr and Pnc are binary value of corresponding row and column value of Pn in spatial image plane. Block Diagram for Authentication bits (Ab2 ) generation is shown in Fig. 4. Step 1. Take the bitwise decimal sum of Pn , Pnr , Pnc in vector C of size 1 × 8. So the value range of vector C varies from 0 to 3. Pixel
Column
Row 000
8
3
0
0 8
8
0
2 bit binary conversion of Bitwise decimal sum M
a3
a1
a2
Ab2p Fig. 4.
Block diagram of authentication bits generation method 2. 1340002-5
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
D. Singh, S. Shivani & S. Agarwal
Step 2. Now convert each value of vector C in two bit binary representation and further reconvert the vector C in a 4 × 4 matrix M . Step 3. Take column-wise X-OR operation of matrix M as a1 = M 1 ⊕ M 2 , a2 = a1 ⊕ M 3 ,
(8)
a3 = a2 ⊕ M 4 , where M1 , M2 , M3 , M4 are column vectors of matrix M and a1 , a2 , a3 are 4 × 1 column vectors. Step 4. Now take the bitwise X-OR within vector a3 as shown in Fig. 4, and get the Apb1 , where p ranges from 1 to 4 for each block. Hence Ab2 calculation for each block will be followed as 4 p Ab2 mod 4. (9) Ab2 = p=1
After getting Ab2 from Eq. (9), convert it into binary and put into the vector V at 11th and 12th index position. Finally, we get eight recovery bits and four authentication bits which are called watermark for each block.
2.1.3. Block mapping Using a secret key K3 , permute the vector V and by using another secret key K4 embed this permuted vector in another block. In this watermark embedding scheme, five MSBs of the host image are unchanged and three LSBs are replaced with the recovery bits and authentication bits. Assuming that the original distribution of the three LSBs is uniform, the average energy of distortion caused by watermarking on each pixel is calculated as MSE =
N 1 −1 N 2 −1 1 2 (I(i, j) − D(i, j)) , N1 × N2 i=0 j=0
(10)
where MSE is Mean Square Error which is for N1 × N2 two monochrome images I and D in which one of the image is original host image and another one is watermarked image. Now the PSNR is defined as PSNR = 10 log10
Max2 MSE
here Max is the highest pixel intensity value of the image. 1340002-6
(11)
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
Quantization-Based Fragile Watermarking
2.2. Watermark restoration procedure Assume an attacker, without changing the image size alter some contents of a watermarked image intentionally or unintentionally. We first identify the tampered blocks using the embedded authentication bits, and then recover the tampered blocks by using the recovery bits extracted from the corresponding mapped blocks. 2.2.1. Tampered block detection At the receiver end, the prime task is to ensure that whether the image is authentic or not. For unauthentic image we have to locate the tampered region. Hence the tamper detection algorithm is as follows: Step 1. Generate a pseudo random binary matrix having dimension N1 × N2 with the same secret key K2 which was used for generation of Ab1 . Step 2. Enter the secret key K1 which is used for generation of Ab1 . Step 3. Extract 12 bits from each corresponding block using K4 which was used at the time of block mapping, fill the 12 bit vector V for each block and reshuffle it using K3 . Step 4. For each pixel of tampered image calculate the Ab1 discussed in Sec. 2.1.2, then extract bits from index 9th and 10th from vector V . Compare extracted and calculated bits if there will be any mismatch it means that particular block is tampered. Step 5. This step is carried out for that block for which calculated Ab1 is matched with extracted Ab1 . Calculate the Ab2 discussed in Sec. 2.1.2, then extract bits from 11th and 12th index of vector V. Compare the calculated Ab2 with the extracted one. If there is any mismatch found then those blocks will be marked as altered block. If there will be no mismatch, it means those blocks are not altered during any attack or intensity values of altered block and original block are same. 2.2.2. Tampered block restoration Once we identify the altered block we need to restore it. So for restoring the block, algorithm is as follows: Step 6. After getting the altered block and vector V , we will extract first eight bits from V . These eight bits are nothing but the encoded form of the four intensity values of that altered block. Step 7. By using Table 2 we will decode the two bit binary values into the quantization value for each pixel of a block. Step 8. Now convert the four quantization values in five bits and fill the five MSBs of corresponding pixel in tampered block and append three 0s as first three LSBs 1340002-7
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
D. Singh, S. Shivani & S. Agarwal Table 2.
Quantization table for encoded bits.
Encoded bits
Quantization level
Intensity values
00 01 10 11
0 1 2 3
4 12 20 28
at the end of each gray value to make the range from 0 to 255. So finally we recover the tampered block with pixel-by-pixel manner very effectively. 3. Experimental Results The effectiveness and accurateness of the suggested approach can be shown by experimental results and its analysis. Experiments have been performed on different host images. We have obtained very satisfactory results during embedding of watermark and recovery of tampered region with high level PSNR value. Here we have performed some main attacks on image which can change the valuable extensive content of image as shown in Fig. 5. To verify the proposed approach, many images have been taken from standard database. Here series (d) is the recovered image after the alteration similarly in series (c), all figures having black region shows the unaltered pixel whereas white region shows altered space. The first attack is object addition which is done on Lena image in which an attacker attaches some additional item on image. By the help of our proposed algorithm we can effectively locate the region of alteration as well as recover it. The second kind of attack is object removal which is applied on Camera Man image. Third type of attack is very sensitive attack because some time number plate is only evidence for court and it is owner’s liability to keep the integrity of that evidence. Similarly fourth attack is text addition, by the help of experimental view we can see the efficiency of our approach. The summary of the experimental results is shown in Table 3 in which we can see the altered number of pixels for various images along with their detection rate and PSNR value for both during embedding and during recovery. The PSNR value can be calculated using Eqs. (10) and (11). High PSNR value indicates the efficiency and noise resistance property of our algorithm. Here in order to check the imperceptibility property of the proposed watermarking scheme, histogram disparity is compared between the original cover image and Table 3. Host image Lena Camera Man Baboon Number Plate
Essential information observed during watermark embedding and extraction. PSNR (embedding)
No. of altered pixel
Detected (%)
PSNR (recovery)
40.40 dB 40.07 dB 40.52 dB 40.72 dB
1050 900 1600 130
94 97 97 99
38.35 dB 37.32 dB 38.76 dB 37.83 dB
1340002-8
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
Quantization-Based Fragile Watermarking
I(a)
I(b)
I(c)
I(d)
II(c)
II(d)
III(c)
III(d)
IV(c)
IV(d)
I. Lena Image
II(a)
II(b) II. Camera Man
III(a)
III(b) III. Number Plate
IV(a)
IV(b) IV. Baboon
Fig. 5. image.
(a) Watermarked, (b) altered watermarked, (c) tamper detected image and (d) recovered
1340002-9
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
D. Singh, S. Shivani & S. Agarwal
Fig. 6.
Histogram of (a) Lena original image and (b) watermarked image of Lena.
the watermarked image. In performed experiments, we have found reasonably high PSNR value (i.e. 40.40 dB). Figure 6 shows that the constructed histogram of the original cover image is almost similar to the histogram of watermarked image which is verified by the correlation coefficient that is almost equal to 1. So in another way it shows that the proposed approach is reasonably imperceptible. 4. Conclusion This paper proposes an efficient quantization-based fragile watermarking using block-wise authentication and pixel-wise recovery scheme for tampered image. Proposed authentication scheme is capable for exactly localizing the blocks that are tampered intentionally or unintentionally. Similarly proposed recovery scheme is good enough to recover the approximate value of the principle content of the image. This scheme generates 12 bits vector which contains eight recovery and four authentication bits. This algorithm has very less false acceptance and false rejection ratio. Here block-mapping sequence is jumbled up using a secret key to make it complicated to obtain the knowledge of the mapped block sequence. Experimental results show the effectiveness of suggested method which is not only capable enough to detect the altered block with high accuracy but also able to recover those tampered blocks with good imperceptibility. References 1. S. Shivani, A. K. Patel, S. Kamble and S. Agarwal, “An effective pixel-wise fragile watermarking scheme based on ARA bits,” Int. Conf. Communication, Computing & Security (ICCCS 2011 ) (ACM, New York, 2011), pp. 221–226. 2. E. T. Lin and E. J. Delp, A review of fragile watermarking, Center for Education and Research in Information Assurance and Security, Purdue University, West Lafayette, IN 47907-2086 (1999). 3. D. Singh, S. Shivani and S. Agarwal, “Self-embedding pixel wise fragile watermarking scheme for image authentication,” Int. Conf. Intelligent Interactive Technologies and Multimedia, Allahabad (IITM 2013 ), Vol. 276 (Springer CCIS, 2013), pp. 111–122. 1340002-10
3rd Reading July 2, 2013 16:42 WSPC/0219-4678
164-IJIG
1340002
Quantization-Based Fragile Watermarking
4. H.-J. He, J.-S. Zhang and H.-M. Tai, “Self-recovery fragile watermarking using blockneighborhood tampering characterization,” in IH 2009, eds. S. Katzenbeisser and A.-R. Sadeghi, LNCS, Vol. 5806 (Springer, Heidelberg, 2009), pp. 132–145. 5. X. Zhang and S. Wang, “Fragile watermarking with error-free restoration capability,” IEEE Transaction of Multimedia 10(8), 1490–1499 (2008). 6. M.-A. Kim and W.-H. Lee, “A content-based fragile watermarking scheme for image authentication,” in AWCC 2004, eds. C.-H. Chi and K.-Y. Lam, LNCS, Vol. 3309 (Springer, Heidelberg, 2004), pp. 258–265. 7. H. He, J. Zhang and F. Chen, “Block-wise fragile watermarking scheme based on scramble encryption,” in Proc. 2nd Int. Conf. Bio-Inspired Computing: Theories and Applications (BIC-TA) (2007), pp. 216–220. 8. W. C. Seng, J. Du and B. Pham, “Semi fragile watermark with self authentication and self recovery,” Malaysian Journal of Computer Science 22(1), 64–84 (2009). 9. X. Zhang, S. Wang, Z. Qian and G. Feng, “Self-embedding watermark with flexible restoration quality,” Journal Multimedia Tools and Applications 54, 385–395 (2010).
Durgesh Singh has received the B.Tech. degree, in computer science and engineering from UIET CSJM University Kanpur in 2010, after that he has joined IIT Kanpur for one year as a Project Associate in 2010. Currently he is pursuing M.Tech. from department of Computer Science and Engineering MNNIT. His current research interest includes Digital image Processing, Algorithm, Digital Watermarking and Computer vision.
Shivendra Shivani has received the B.E. degree, in computer science and engineering from CSVTU in 2009, after that he has completed master degree from MNNIT, Allahabad in Information security in 2011. Currently he is pursuing Ph.D. from MNNIT, Allahabad with digital image processing as an area of interest. His current research interest includes Digital watermarking, Pattern Recognition, Computer Vision, Algorithms, Compression, Biometrics and Face recognition. Suneeta Agarwal received B.Sc. degree in 1973 from University of Allahabad, M.Sc. degree in 1975 from University of Allahabad, Ph.D. in 1980 from IIT Kanpur and M.Tech. degree in 2007 from AAIDU. She is having 31 years of Teaching Experience and currently Professor in the Computer Science and Engineering Department, Motilal Nehru National Institute of Technology, Allahabad. Her current research interest includes Pattern Recognition, Computer Vision, Theory of Computation Science, Algorithms, Automata Theory, Compression, Patten matching, Finger print recognition.
1340002-11