Digital Image Watermarking With Random Selection of Watermark Insertion Having Adaptive Strength

: We have presented an algorithm of digital image watermarking for gray scale images which we implemented in frequency domain. Before inserting the watermark, we added the Hamming codes row wise as well column wise. Two encryption techniques were implemented on the ECC inserted watermark for its security. The pixel position for inserting the watermark was calculated using starting row and column number for that 8×8 block. Pixel embedding strength is calculated using criteria that low frequency is robust in general signal processing attacks, thus choosing less value to be embedded and vice-versa. Results show that the watermarking algorithm is robust against common signal processing attacks. The algorithm is tested against multiple attacks also.


INTRODUCTION
The tremendous growth of internet resulted penetrating in the remote areas.It is even present where the person find hard to reach.Everyone needs latest images, audio files or video files and they are getting it free of cost on the internet.The original producer of the file even doesn't know that the file created by him/her is available for free through internet and even if knows, nothing can be done.Then the need arises for a method so that the actual producer can prove that the file belongs to him/her.There are many solutions for this problem as far images are concerned like Steganography, cryptography and digital watermarking.In digital watermarking, a specific code or mark is embedded permanently inside a cover multimedia file which remains within that cover invisibly or visibly even after decryption process.The embedding of watermark may be robust or fragile depending on the application.Also embedding can be in spatial domain or frequency domain.Generally, for robustness, embedding is done in the frequency domain so that the watermark could be scattered in a range of frequencies which are not noticeable by the human visual system.The watermark is a sequence of recognizable sequence of bits, a copyright mark or can be a image.Many techniques in spatial domain as well as in frequency domain using DCT, DWT and DFT exist.

LITERATURE REVIEW
Assigning codeword for the purpose of fingerprinting digital data were implemented (Dan and James, 1998) successfully, e.g., software, documents, music and video.Different codes were used for fingerprinting different files.These codes can be compared with certain other copies and some bits can be detected to get it changed.To secure those binary bits, the use of dual binary Hamming codes was introduced (Domingo-Ferrer and Herrera-Joancomarti, 2000).Hamming error correction technique was used for image watermarking using wavelet transform (Hongtao et al., 2002) in color images but the embedding results in low quality of image with PSNR below acceptable 30 dB.In an investigation (Terzija et al., 2002), watermark was encoded with three different error correction techniques which are Hamming, BCH and RS code.Following the idea of the JPEG standard, the encoded watermark was embedded by a method based on DWT.For some applications, it was proved that Hamming code to be the best ECC because with Hamming code there are fewer bits to be embedded.Similar analysis of ECC in spatial domain watermarking (Limin et al., 2003) shows no effect on bit error rate.ECC were also used effectively to store the history of the patient in the medical images (Nayak et al., 2004).For embedding the watermark, adaptive pixel coordinates can be considered depending on the local pixel selection criteria but it will create the desynchronization between the Hamming codes (Solanki et al., 2004;Man and Jian-Guo, 2009).Embedding of ECC considered being extra payload which is not actually a watermark, but only used to correct the watermark after extraction.Another technique used multiple watermarks embedding (Jayalakshmi et al., 2008) in the same image file for better security but reduces the perceptual quality of the image.As selection of local criteria for embedding watermark is not suitable for ECC, M-ary phase modulation (Yongqing et al., 2008;Kung and Troung, 2006) was introduced.In this model, they proposed a distributed watermark in some range of DCT coefficients.In these algorithms multi bit embedding was done which results in more damage, if certain part of image is corrupted.Pixel comparison technique (Shijun et al., 2008) was also presented in which pixel embedding results in the change of pixel in comparing to the neighboring pixel.The major disadvantage of this technique was that it is very immune to histogram equalization attack.Blind watermarking techniques in frequency domain are able to survive the common signal processing attacks for the color images (Zhang et al., 2009) also.BCH (Cika, 2009) and RS (Abdul et al., 2009;Guyeux and Dahi, 2010) codes employed in frequency domain provide more security to the watermark but for the burst errors and also the extra bits added are more which reduces the embedding capacity of the actual watermark.Block wise DCT along with Dynamic Fuzzy Inference System (DFIS) was introduced (Hossein et al., 2010) in which adaptive method of pixel insertion selection was done.The insertion place was decided by applying block DCT and DFIS on cover image as well watermark image and DC coefficients was modified.Multiple attacks on the watermarked image were able to reduce the non correlation below the required level.Adaptive pixel selection according to the local complexity was proposed (Xiaolong et al., 2011) which incorporate adaptive embedding but optimal adaptive-embeddingthreshold used for image partition was determined iteratively which was its major drawback.A sample projection approach (Akhaee et al., 2011) was employed for the embedding of watermark.Four samples from the approximation coefficients were taken to make a line segment in 2-D space.The slope of the line was invariant to the gain factor.Then the watermark code was embedded by projecting the line on the line build by message bits.The algorithm showed good results for AWGN, compression and filtering attacks but it was sensitive to the collusion attacks.The embedding of pixel value can also be adaptive which may depend upon local parameters.It can also be dependent upon the difference between actual pixel value and JND value calculated (Seung et al., 2011).
After reviewing the literature, we come to conclude that for developing an algorithm for watermarking certain points are to taken care.Digital image watermarking to be done should be blind and in frequency domain for the robustness of algorithm.For robustness of watermark, dual encryption techniques are to be used which are Arnold transformation and Chaos.For robustness against attacks, error correcting technique is to be employed which will be Hamming error correction technique for which extra data bits are less than the other ECC techniques.The Hamming codes are to be added row wise as well as column wise which makes it 2-D.Thus the iterations can improve the results of the extracted watermark.Watermark embedding is to be done in not single frequency but in multiple middle frequencies.Further, multiple frequencies are not equally immune to the attacks.So the frequencies which are less immune should contain low value of the watermark and which are highly immune should have more value of the watermark.Thus the embedding the pixel value will be adaptive.

THE PROPOSED SCHEME
The proposed scheme is made up after concluding the literature survey.It utilizes the advantages of discrete cosine transformation, wavelet transform, Arnold Transform, Chaos and Hamming error codes.Two encryption techniques are used to enhance the security of the watermark.
The image for watermarking is first applied by the discrete wavelet transform up to two levels as shown in Fig. 1.This is because depending upon the discrete wavelets theory and human visual characteristics; we know that the embeddable watermarking capacity will decrease with the increase of layer numbers.
Then 2 D-DCT will be applied on the middle frequency band which is HL 2. Discrete Cosine Transform (DCT) have the advantage over the other domains like, spatial and DWT.It is more robust against the attacks specifically jpeg lossy compression because of its energy compaction property.
As far as watermark is concerned, Hamming error codes are to be inserted row wise as well as column wise.Arnold and chaos encryption will be applied on the coded watermark.Arnold transformation defined by ( 1) is a one-to-one transformation: (1) Fig. 1: Three level wavelet decomposition x where, µ ∈ (0, 4); x (n) ∈ (0, 1).By initializing µ and x (0), we can get the required chaotic signal.In order to get chaotic sequences, the chaotic signal x (n) must be transformed into binary sequence s (n).So quantized function T [x (n)] is used and can be given by (4): where, m is random integer and should be greater than 0 and the interval is divided by 2 m .The original image was taken and resized to 1024×1024 pixels.Discrete wavelet transformation was applied on the resized image up to second level which will yield LL2, LH2, HL2 and HH2 bands.Middle frequency band was taken which was now 256×256 sized and 8×8 discrete cosine transformation was applied as shown in the flow chart for the embedding algorithm shown in Fig. 2. We targeted particular middle frequencies, so that the algorithm should be able to sustain low pass and high pass filtering attacks.For a particular 8×8 DCT block, nine middle frequencies were selected for embedding the watermark.These nine frequencies are randomly selected in our case but it could also depend upon the application.The selection of frequencies to form the 3×3 mask is shown in Fig. 3.
As it is clear from Fig. 3 that top left corner have the lowest frequency pixel selected and right bottom have the highest frequency from the selected pixels.We know that low frequency pixels are less immune to the common signal processing attacks and high frequency pixels are more.Thus, we also need the embedded value to be adaptive for these pixels.Thus, we embedded low embedding strength in the low frequency pixels and more embedding strength in the high frequency pixels.The embedding strength frame is shown in Fig. 4.
Here, Ψ represents the embedding strength calculated according to the formula: where, σ 2 = The variance of the original image α = The embedding strength division factor Now the task is to find the exact pixel depending on the row and column number, where the pixel value is to be embedded.First of all, all the numeric in the first row and first column number of that particular block are to be added till the end result becomes a single digit.This digit will remain the same for embedding as well as extraction process as the size of the image will remain same and so the number of 8×8 blocks is.Then new coordinates of the embedding pixel are to be decided as follows: where, x m and y m are the first row and column numbers of that particular block and (x', y') is the new calculated pixel position.On this pixel position 1 has to be inserted and rest all pixels of 3×3 are to be made 0 as shown in Fig. 5.Here we have shown that (x', y') are coming out to be (3,5).Now combining this frame with the other two frames shown in Fig. 4, the net value and the pixel position can be decided according to these three frames as shown Fig. 6.

Watermark pre-processing:
Original binary watermark is to be resized to 32×32 pixels shown in Fig. 7b.Original watermark is converted to 64×64 watermark, by inserting 4 rows and 4 columns as watermark and rest 4, 4 as zeros.Then hamming codes was calculated and inserted on these places row wise and column wise respectively as shown in Fig. 7d.Then Chaos and Arnold encryptions were performed on the processed watermark and are shown in Fig. 8a and b respectively.

Watermark extraction:
Watermark extraction procedure is shown in Fig. 9. Few steps are same as presented in watermark embedding algorithm.Threshold in our case was a crisp set which was considered to be zero.Further when extraction was performed, inverse Arnold and inverse chaos was performed.Now the extracted watermark contained the 2-dimensional Hamming codes.We used Hamming (7, 4) for which we need only seven bits and we used eighth bit as a parity which we used to find that if there are more than one, even number of errors.We performed inverse Hamming codes column wise and then performed inverse Hamming row wise.If error was found with the parity, inverse hamming was skipped for that particular row or column.After extraction some iterations were performed due to the fact that, after column wise extraction, it is possible that some error remained there which can be corrected after row wise inverse hamming.Now, after removal of some errors, again same iterations were performed to reduce the bit error rate.

PERFORMANCE EVALUATION
The performance of the watermarked image can be evaluated on the basis of Peak Signal to Noise Ratio (PSNR) in decibels (dB).Higher the value of PSNR better is the quality of the watermarked image.PSNR more than 30 dBs is considered to be the acceptable quality image in which watermark is making no alteration to the quality of the image: where, MSE is the mean square error of the watermarked image and the original image and m, n are the number of rows and number of columns.I and K are the watermarked images.
The quality of the extracted watermark is evaluated using term Normalized Cross-correlation (NC).The ideal value of the NC is 1 which means the original and the extracted watermarks are exactly the same which is given by the (9): The Bit Error Rate (BER) can be calculated as given in ( 10 where, W (i, j) is the original watermark and W' (i, j) is the extracted watermark.

RESULTS AND DISCUSSION
The watermarked Cameraman, Lena, Peppers and Baboon images with size 1024×1024 are shown in Fig. 10.These watermarked images are tested for various attacks and then extracted the watermark from the attacked images.The NC values are calculated for original watermark and extracted watermark at three steps which are without error correcting codes, with error correcting codes and with iterations of error correcting codes.

Gaussian noise:
The watermarked images were tested against Gaussian noise with mean = 0 and different variance values.The Gaussian noised images (a-d) and extracted watermarks (e-h) are shown in Fig. 11.The overall performance of the algorithm against Gaussian noise with different values of variance is shown in Fig. 12.With different values of variance from 0 to 0.15, the algorithm shows robust against till variance value of 0.10 but it also depend upon the frequencies present in the image.If the image is having high frequencies like in baboon, the watermark was able to be protected till variance value 0.15.

Salt and pepper noise:
The watermarked images were tested against salt and pepper noise with different values of depth.The salt and pepper noised images (ad) with depth of 10% and extracted watermarks (e-h) are shown in Fig. 13.The overall performance of the algorithm against salt and pepper noise with different values depth is shown in Fig. 14.With different values depth from 1 to 25%, the algorithm shows robust against salt and pepper noise till 15% depth.If the image is having high frequencies like in baboon, the watermark was able to be protected till depth of 25%.

Speckle noise:
The watermarked images were tested against speckle noise with different values of variance.It is a granular noise that inherently exists in and degrades the quality of the active radar and synthetic aperture radar images.The speckle noised images (a-d) with variance and extracted watermarks (e-h) are shown in Fig. 15.The overall performance of the algorithm against salt and pepper noise with different values depth is shown in Fig. 16.With different values of variance from 0.1 to 0.20, the algorithm shows robustness against speckle noise till variance of 0.35.If the image is having high frequencies like in baboon, the watermark was able to be protected till depth of 25%.
Jpeg compression: For evaluating our watermarking algorithm, watermarked images were compressed by jpeg compression with quality factors 50, 40, 30 and 20%, respectively and watermark is extracted from the compressed images and corresponding PSNR values and NC values are given in Table 1.The watermarked images with 30% jpeg compression (a-d) and extracted watermarks (e-h) are shown in Fig. 17.
Median filtering: Generally median filtering is able to attack the watermark present in the watermarked images.Thus we applied 3×3 and 5×5 mask with the median filter and corresponding PSNR and NC values are listed in Table 1 and watermarked images with 3×3 median filter (a-d) and the extracted watermarks (e-h) are shown in Fig. 18.

CONCLUSION
We have presented an algorithm for digital image watermarking for gray scale images.The algorithm shows robustness against some common signal attacks like jpeg compression, median filtering, addition of AWGN, salt and pepper noise, speckle noise and scaling.The watermark was able to survive till the image gets badly affected for its quality, which is then for no use.This is due to the fact that, we inserted our watermark after selection of particular band of frequencies by using DWT and then applying DCT.Also, error correcting odes helps to reduce the error and in turn increases the non correlation.The algorithm proved to be efficient than the techniques compared in both individual attacks as well as multiple attacks.

Fig. 2 :
Fig. 2: Flow chart for embedding algorithm Equation (2) is used to transform each and every pixel coordinates of the images.Where (x, y) is the location coordinates of the original image pixels and (x', y') is the location coordinates of image pixels that after transform When all the coordinates are transformed, the image we obtain is scrambled images.Chaos signals are a kind of pseudorandom, irreversible and dynamical signals, which process good characteristics of pseudorandom sequences.Chaotic systems are highly sensitive to initial parameters.The output sequence has good randomness, correlation, complexity and is similar to white noise and shown in (3):

Fig. 6 :
Fig. 6: Net frame for embedding pixel place and embedding strength

Table 1 :
PSNR and NC of cameraman, Lena, pepper and baboon images against different attacks Attack

Table 2 :
Comparison of PSNR and NC for Lena, pepper and baboon images against different attacks Attack

Table 3 :
Comparison of proposed method and Hossein method [] after multiple attacks in terms of PSNR and NC Hossein method  (Hossein et al., 2010)Proposed method , 30 and 20%, respectively of their actual size.Then they again resized back to the actual size of watermarked images.The PSNR and NC values are shown in Table1and watermarked images of Cameraman, Lena, Peppers and Baboon with 30% of scaling, 1024×1024 images were resized to 308×308 images and again to 1024×1024 image (a-d) and extracted watermarks (e-h) are shown in Fig.20.The results with various attacks are listed in Table2and are compared with the three state of the art methods mentioned in the table.Further, multiple attacks are performed on the images and results are presented in Table3.These results are compared with the Hossein method of watermarking.