An Efficient Image Watermarking Method Based on Fast Discrete Cosine Transform Algorithm

This paper proposes an image watermarking method based on the fast discrete cosine transform (DCT) algorithm for implementation in digital signal processor. A digital watermark can be effectively embedded and efficiently extracted without the host image. The keys in watermarking process include four frequency coefficients in DCT, two random permutation vectors, and a quantization matrix for normalizing the watermark and the host image. The fast DCT algorithm has been shown to reduce the complexity of two-dimensional image transformation so that embedding/decoding an image watermark can be completed in real timewithin 0.33 seconds.The quality of bothwatermarked image and extracted (retrieved) watermark remains excellent. It is shown that the watermarking method is efficient in and robust to data cropping, transmission loss, and compression/decompression.


Introduction
Conventional technique of embedding watermark signals or patterns into digital image is to insert a secret bit string in spatial, frequency, or wavelet domain.In spatial domain watermarking, the human visual system (HVS) is applied to assure that modifications of an original image by embedded watermark are imperceptible.Koz and Alatan [1] applied the temporal contrast threshold of HVS to prevent image distortion after watermarking, but the watermarked image is vulnerable to data transmission.Kaur et al. [2] proposed a technique to substitute the blue component of image pixels with character bits, but it is also vulnerable to signal processing attack.Agarwal [3] embedded a watermark with data encryption which required substantial data capacity thus leading to low image quality.Tyagi et al. [4] also applied the least significant bit (LSB) to achieve high security at the price of lower image quality.Nath et al. [5] proposed a method for hiding encrypted secret message inside a cover file, which again is vulnerable to data compression and attack.Sara et al. [6] selected the pixels with higher intensity to embed watermark bits by LSB.A major constraint of the above studies is that they all require the original image data to decode the watermark.
In "blind" watermarking, Chadha et al. [7] proposed a method based on LSB and discrete cosine transform (DCT) for decoding watermark without the original image, but the method is sensitive to common image compression.Surrah and Mohamed [8] presented a binary data hiding algorithm by changing the position of every image block to increase security.Wang et al. [9] proposed watermarking by quaternion Fourier transform, but the image quality was reduced significantly by the embedded watermark.With Joint Photographic Experts Group (JPEG) adopting DCT to its compression process, many watermarking methods based on DCT have been developed.Benoraira et al. [10] proposed embedding the watermark bits sequence in both DCT and discrete wavelet transform (DWT) to guard against attack, but the procedure is computational intensive.A watermarking technique based on the so-called wavelet-tree [11] and another based on DWT [12] were also proposed achieving better robustness; however, both required substantial computation with large data capacity.
Singular value decomposition (SVD) is desirable for implementation together with DCT or DWT because it requires extensive computations if applied separately onto images.Rawat and Raman [13] proposed an SVD-based watermarking scheme to increase security in copyright protection.Makbol and Khoo [14] and Lagzian et al. [15] also developed image watermarking schemes based on DWT and SVD to achieve robustness against image processing, but the computational load was substantial.Hu and Hsu [16] proposed image watermarking with DWT-SVD-DCT features to guard against compression.Mishra et al. [17] applied a firefly algorithm based on DWT and SVD for watermarking, but the encryption is time consuming.The above SVDbased watermarking may have good robustness against JPEG compression; however, the embedded watermark becomes vulnerable because all pixels would be changed when one singular value is modified.This paper presents an efficient digital image watermarking method based on the fast DCT algorithm for real-time application.It is shown that the watermarked image quality, robustness, and computation loading can all be improved.

Embedding Watermark by the Fast DCT Algorithm
Consider where  and  are integers,  < .The original image S is divided into nonoverlapping pixel blocks of size 8×8 and then transformed into frequency domain.Each block is processed independently by two-dimensional (2D) DCT into matrix F. The fast DCT algorithm [18] is applied to decompose the 2D DCT into a pair of 1D DCTs for computation efficiency.For a digital image S, the 2D DCT matrix F in frequency domain and its inverse transform back to spatial domain S  can be written in matrix form by where matrix M = {(, V)} with (, V) being the elements in the th row and Vth column The 2D spatial data matrix S  in (2b) is the linear combination of the base images, which are obtained by the outer product of the column and row vectors of M. By exploiting the redundancy in DCT coefficients, it can be shown that the fast DCT algorithm can reduce the complexity of a 2D DCT of 8 × 8 block from S to F in (2a) in only 24 multiplications, and the inverse transform from F to spatial domain S  in (2b) is simply the transpose of the DCT matrix M [18].Watermarking is performed first by decomposing a true color image into RGB components, and the watermark should be embedded in the main composition of the original image to maintain image quality after watermarking.For example, an image rich in blue shall be watermarked with gray-level blue watermarks.Due to the lower sensitivity of human eyes to blue light, it is recommended to embed watermark in blue component if one cannot determine the main composition of the image.The image embedding process of the watermarking method as shown in Figure 1 includes (1) computation optimization by the fast DCT algorithm and its inverse transform, (2) selection of the middle frequency coefficients, (3) permutation of the watermark, and (4) quantization (normalization) of the watermark and the host image.A spatial domain image S is processed by the fast DCT algorithm into spectral domain F. Intuitively a watermark should be embedded into the higher frequency coefficients in DCT for better perceptual invisibility.However, the image "energy" is concentrated in the low frequency coefficients (e.g., the 0th∼5th coefficients in Figure 2) so that the information embedded (hidden) in the high frequency coefficients (the 28th∼63th coefficients) may be vulnerable to data processing.To maintain the quality of a host image after watermarking and to improve the robustness of a watermarked image against data processing, it is recommended to embed the watermark in some of the middle frequency coefficients (the 6th∼27th coefficients) as shown in the light color region of Figure 2. Because the host image of size  ×  and the watermark  ×  are divided into nonoverlapping pixel blocks of size 8 × 8, the number of the middle frequency coefficients selected for embedding the watermark is (8/) 2 such that the sizes of the host image and the watermark are compatible.For an 8-bit original image of size 256 × 256 ( = 256) and 8-bit digital watermark of size 64 × 64 ( = 64), 4 middle frequency coefficients in each of the 8 × 8 blocks from the host image are needed to embed the watermark.The image block composed of these middle frequency coefficients is denoted as F m in frequency domain.
A random number generator is applied to simultaneously generate two vectors to permute the watermark W into W p in spatial domain.These vectors with elements in [1, 𝑀] representing the new coordinates (, ) serve as a key to watermark decoding.The permuted watermark is divided into nonoverlapping 4 × 4 blocks and processed by the fast DCT algorithm into W f in spectral domain.Quantization is required to normalize the image intensity of the host image and watermark thereby increasing the quality of watermarked image and reducing the watermark memory size.The process is to scale the watermark W f into W q by the host image property, represented by the average of the middle frequency   coefficients, denoted as  ave .The element of quantization matrix Q = {(, )} is defined such that W f is scaled element by element or block by block into W q .Note that the watermark W q now contains the host image information  ave so the impact on image quality after watermarking will be minimized.When embedding the watermark image, the four coefficients selected in F m will be substituted by the corresponding element in W q into F w .The final step is inverse transform of F w by the fast DCT algorithm in (2b) into watermarked image S  w in spectral domain.In summary, the parameters in the embedding process are the four middle frequency coefficients, two random vectors, and one quantization matrix for normalization.All are to be stored as keys for later decoding process.
A quantitative measurement for evaluating the fidelity of the watermarked image S  w is the peak to signal noise ratio where MSE is the mean-square error.For an image of block size 8 × 8, its MSE is where (, ) and    (, ) represent the pixel value in the original image S and watermarked image S  w , respectively.The higher the PSNR, the better the image quality.In general, human visual system cannot differentiate a watermarked image from the host image when PSNR ≥ 30 dB.

Decoding Watermark
The step of decoding process as shown in Figure 3 is reverse to the embedding process.A watermarked image is first divided into nonoverlapped blocks of size 8 × 8, and each block is processed by the fast DCT algorithm.The middle frequency coefficients in each block are extracted by using the key in the embedding process.Inverse quantization of the extracted watermark is by matrix Q = {(, )} from the key in embedding process.Inverse DCT can then be applied to obtain the watermark image in spatial domain.Reverse permutation by using the key of the two random vectors is to extract the watermark embedded in the image, denoted as W  .Note that no original image is required in decoding a watermarked image.
The normalized correlation (NC) is defined to evaluate the fidelity of the extracted watermark This is to represent the cross-correlation of the reference and extracted watermarks.If the extracted watermark   (, ) is the same as the reference (registered) watermark image (, ), then NC = 1.0.Note that NC is a quantitative measurement; it is not necessarily related to image quality.NC = 1.0 indicates that the watermarking method can extract the embedded watermark faithfully.In summary, the steps of decoding process are (1) selection of the RGB component of the watermarked image, (2) computation by the fast DCT algorithm, (3) extraction of the middle frequency coefficients, and (4) inverse quantization, inverse DCT, and reverse permutation.(1, 4), (4, 2), (3, 3), and (1, 5), corresponding to block numbers 6, 11, 12, and 14, are selected to embed the image watermark.Table 1 also lists the two random permutation vectors and the quantization matrix  of (4).The experiment result is shown in Table 2, where PSNR = 31.256dB and NC = 1.0, and the watermark embedding/decoding can be completed within 1.6 seconds.The result indicates that the proposed watermarking method can maintain the image quality and the embedding/decoding process is efficient.Experiments are also conducted to validate the robustness of the watermarking method against image cropping and data compression.Table 3 shows that, after 5% cropping of watermarked image, NC = 0.931.For 15% and 25% cropping, the watermarked image yields NC = 0.777 and 0.707, respectively, and the quality of the retrieved watermark remains satisfactory.These results show that selection of the four middle frequency coefficients for embedding watermark is robust to data compression.Although some distinct features in the retrieved watermark are lost after 25% cropping or 1/4 data compression, the method can still correctly extract and identify the watermark.

Watermarking Implementation
Experiments of color image embedding in different components are also conducted.For the color image in Table 4, the watermark can be embedded into R, G, or B component in the middle frequency coefficients.The watermarked in any of the components can be completed within 2 seconds, with PSNR higher than 41 dB.

Conclusions
(1) A digital image watermarking method based on the fast DCT algorithm is developed to maintain the image quality and improve image robustness against signal processing.The decoding keys include (i) the four middle frequency coefficients, (ii) two random permutation vectors, and (iii) a quantization matrix for normalizing the watermark and the original image.A watermark with ownership information is embedded into the host image in an unnoticeable way.An index of peak signal to noise ratio (PSNR) is

Figure 1 :
Figure 1: The watermarking embedding process that integrates (1) the fast DCT algorithm, (2) selection of the four middle frequency coefficients, (3) random permutation of the watermark, and (4) normalization by quantization.

Figure 3 :
Figure 3: Watermark decoding process by the fast DCT algorithm with the key of (1) the four middle frequency coefficients, (2) the random permutation vectors, and (3) the quantization matrix.

Table 2 :
Validation of the watermarking method, where the watermarked image remains in excellent quality with PSNR ≥ 30 dB and the retrieved watermark with perfect NC = 1.0.The original image of size 256 × 256 and the watermark of size 64 × 64.The watermarked image using middle frequency coefficients(6,11,12, and 14 in Figure2) with PSNR = 31.256dB, and NC = 1.0.options for precision, hardware support for floating point operations, and large on-chip RAM.The C/C++ compiler is able to perform optimization ( = 0, 1, 2, and 3) in different level of clock cycles and code size. = 0: the lowest level optimization provides the operations of performing loop rotation, allocating variables to registers and simplifying expressions and statements. = 1: the first level performs the optimization on constant propagation and unused assignments. = 2: the second level performs the optimization on software pipelining, unused global assignments, loop unrolling, and incremented pointer. = 3: the highest level performs the optimization by simplifying functions with return values never used, removing all functions never called. = 0 and 1 level can efficiently reduce the code size, while  = 2 and 3 enhance the execution speed with larger code size.Higher levels generally result in the smallest code size.
Image attack on watermarked image Retrieved watermark 5% cropping at the upper right area NC = 0.931 15% cropping from the upper right to the lower left NC = 0.777 1/4 data compression on the watermarked image NC = 0.707 is the protocol between the deliverer and the receiver.The computation time and code size in DSP at different levels of optimization are listed in Table 5.The code size and computation time are 26 KB and 0.89 seconds in the lowest level ( = 0).The computation time in first level ( = 1) reduces to 0.61 seconds with code size 29 KB.In the second and third ( = 2 and 3), the computation time reduces to 0.35 and 0.33 seconds, but the code size increases to 43 and 44 KB, respectively.Implementation on DSP is much faster than PC-based operation.The higher the level of optimization, the less the time required.By comparison, implementation using Matlab on PC requires 1.6 seconds' computation time.The experiment starts with the highest optimization ( = 3), and the watermarked image and extracted watermark are shown in Table 5 with PSNR = 31.531dB and NC = 0.951.The calculation uses 57,149,130 clocks, corresponding to 0.33 seconds in 44 KB code size.In conclusion, the watermarking method on DSP is efficient and effective for real-time implementation.
Embedding a watermark is dependent on the main composition of the color image.An original image of size 256 × 256 and a digital watermark of 8-bit gray-level of size 64 × 64 as shown in Table 2 are to demonstrate the watermarking method.The original image divided into nonoverlap blocks of size 8 × 8 shall select 4 coefficients in the middle frequency range after DCT.The middle range coefficients in coordinates

Table 3 :
Robustness of the watermarking method against image cropping and data compression.