Reversible Digital Image Watermarking Scheme Using Bit Replacement and Majority Algorithm Technique

The current paper presents a new digital watermarking method through bit replacement technology, which stores multiple copies of the same data that is to be hidden in a scrambled form in the cover image. In this paper an indigenous approach is described for recovering the data from the damaged copies of the data under attack by applying a majority algorithm to find the closest twin of the embedded information. A new type of non-oblivious detection method is also proposed. The improvement in performance is supported through experimental results which show much enhancement in the visual and statistical invisibility of hidden data.


Introduction
Recent history has witnessed the rapid development in information technologies that has given an extended and easy access to digital information.Along with several developments it leads to the problem of illegal copying and redistribution of digital media.As a result, the integrity and confidentiality of the digital information has come under immense threat.Digital watermarking, an emerging technology, came in order to solve the problems [1].Digital watermarking is a technique which allows an individual to add hidden copyright notices or other verification messages or even classified information into digital media [2,3].
Watermarks can either be visible or invisible.Here in this paper we utilize the invisible watermarking technique.This is used in public information settings such as digital image libraries, museums, and art galleries and also in defense communication where data security is of prime importance [4].Watermark embedding utilizes two kinds of methods, one in the spatial domain and the other in the transform domain.In the spatial domain the watermark is directly embedded into the image pixels whereas in the frequency domain the image is decomposed into blocks and then mapped into the transform domain [5].
Watermarking is basically a process of hiding information in an image known as cover image.According to the behavior it is of two types: robust and fragile.Copyright protection is achieved by robust watermarking [6] while image authentication is usually achieved by fragile watermarking techniques [7][8][9].Robust watermarking technique ensures the quality of the hidden information by several protection algorithms.In the fragile watermarking scheme if any alteration of the message is found then the message breaks up by itself and can be easily detected as tampered by the provider of the watermark [1].Invertible watermarking is a new process which enables the exact recovery of the original image upon extraction of the embedded information.
In the present paper the work implements both authentication and confidentiality in a reversible [10] manner without affecting the image in any way.Security of images imposes three mandatory characteristics: confidentiality, reliability and availability [11].Confidentiality means that only the entitled persons have access to the images.Reliability has two aspects: 1) Integrity-means the image has not been modified by a non-authorized person [12]; 2) Authentication corroborates that the image belongs indeed to the correct person and is issued from an authorized source.Availability is the capacity that an image is available to the entitled persons in the normal conditions of access and exercise [13].

LSB Watermarking and Its Limitation
The most straight-forward method of watermark embedding would be to embed the watermark into the least-significant-bits (LSB) of the cover object [14].Given the extraordinarily high channel capacity of using the entire cover for transmission in this method, a smaller object may be embedded multiple times [8].Even if most of these are lost due to attacks, a single surviving watermark would be considered as a success.LSB substitution, however, despite its simplicity brings a lot of drawbacks.Although it may survive from all these transformations such as cropping, addition of noise or lossy compression etc.A better attack would be to simply set the LSB bits of each pixel to defeat the watermark with negligible impact on the cover object.Furthermore, once the algorithm is discovered, the embedded watermark could be easily modified by an intermediate party.An improvement on basic LSB substitution would be to use a pseudo-random number generator to determine the pixels to be used for embedding based on a given "seed" or key [1].The algorithm however would still be vulnerable to replacing the LSB's with a constant.Even locations that were not used for the watermarking bits, the impact of the substitution on the cover image would be negligible.LSB modification proves to be a simple and fairly powerful tool for steganography [15], however, it lacks the basic robustness that watermarking applications require.

Attack and Distortion
In practice, a watermarked image may be altered either on purpose or accidentally.The watermarking system should be robust enough to detect and extract the watermark [16].Different types of alterations or attacks can be done to degrade the image quality by adding distortions.
The distortions are limited to those factors which do not produce excessive degradations; otherwise the transformed object would be unusable.These distortions also introduce degradation on the performance of the watermark extraction algorithm [17,18].Methods or a combination of methods, considered unintentional are used intentionally as an attack on a watermarked image in order to render the watermark undetectable.
Compression is a common attack, as data transferred via network is often compressed using JPEG.High quality images are often converted to JPEG to reduce their size.Another method is deletion or shuffling of blocks.In images rows or columns of pixels may be deleted or shuffled without a noticeable degradation in image quality.These may render an existing watermark undetectable.
Salt and pepper noise is another type of attack that replaces the intensity levels of some of the pixels of an image resulting in loss of information from those pixels.Some of the best known attacks are mentioned here; they may be intentional or unintentional, depending on the application.
In this paper we have taken two very popular attacks known as Salt and pepper noise and image compression.

Proposed Watermarking Technique for Data Authentication
Our proposed methodology for data hiding does not follow the conventional LSB technique because of the inherent limitations mentioned earlier.A new digital watermarking scheme described here, uses several bits of the cover image starting from the lower order to the higher order to hide the information logo.Several sets of the same data forming the information logo are hidden into the cover image.Thus, even if some of the information is lost due to attack, we can still collect the remaining information from the cover image and reconstruct the hidden information resembling the original one [19].
The detail algorithm for both the embedding scheme and the recovery scheme is given bellow.

Embedding the Digital Watermark
Step 1: Two images are taken as input: First of all, the cover image and the message or information logo are taken as inputs.The cover image is taken to be a gray scale image.The logo or information is a binary image, basically a sequence of 0's and 1's.
Step 2: The Size of the images is extracted: Next to make the program compatible to run for any size of the cover image and information logo keeping in mind the data carrying capacity of the cover image the dimensions of the respective images are extracted.
Mc=size(cover_image,1);Nc=size(cover_image,2); Mm=size(logo,1);Nm=size(logo,2); Step 3: Normalizing and reshaping the logo: After normalizing the information logo it is reshaped in one dimension.logo_nor=logo/.256; Step 4: Transforming the cover image into wavelet domain using dwt: The cover image is transformed to the wavelet domain using discrete wavelet transform.We use Haar transform to do the DWT.Here the 1st level DWT was used to obtain more capacity for hiding the information.The cover image is decomposed into 4 subdomains as HH, HL, LH and LL according to the different frequencies of the cover image.
[HHi,HLi,LHi,LLi] = dwt2(cover_image,'haar'); Step 5: Calculating the length of the transformed cover image and 1d logo: len_logo=length(logo_res); len_cover=Mc*Nc; Step 6: Calculating the size of each sub domain decomposed cover image and reshaping them in to 1d: cover_HL_size_m=size(HLi,1); cover_HL_size_n=size(HLi,2); HL1=reshape(HLi,1,cover_HL_size_m*cover_HL_siz e_n); Step 7: Determining the maximum coefficient value of each of the 4 sub domains max_HL1=max(HL1); Step 8: Finding the position to hide the information logo into the transformed logo: The position for hiding the binary logo in each sub domain must be in between zero and the maximum coefficient value of that sub domain.
c=1; for i = 1: 1 : cover_HL_size_m*cover_HL_size_n if(HL1(i)<(max_ HL1) && HL1(i)>( 0)) pos_ HL1(c)=i; c=c+1; end end Step 9: Hiding a number of sets of the same information logo in hl and lh domain: More than one set of the same information is being hidden in HL and LH band or domain for easier and good quality recovery.The hiding process in each of these domains follows a specific formula.The formula is that the black dots in each set of 1d information logo is hidden in a position of information logo from where a constant value is subtracted.

Recovery of the Embedded Watermark
We have assumed that the cover image hiding the watermark is available at the receiving end.So again, in the process of recovery we first take the original image used to hide the information.Along with it we also send the receiver of the message, 3 keys which essentially act as private keys.These keys are required to decrypt and to the extract the encrypted or embedded messages.
Step 1: The watermarked and original images are taken as inputs.

Image Quality Metrics
To measure the amount of visual quality degradation between original and watermarked images, different types of image quality metrics are used.In the present work we have used peak signal-to-noise ratio (PSNR) and structural similarity index measure (SSIM).

Peak Signal-to-Noise Ratio (PSNR)
It is the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation.PSNR is usually expressed in terms of dB for a wide range of signals The PSNR is most commonly used as a measure of quality of reconstruction for lossy compression.The cover image in this case is the original data, and the information logo is the error introduced by watermarking.When comparing the deformed image with the original one an approximation to human perception of reconstruction quality is made.
Therefore in some cases one reconstruction may appear to be closer to the original than another, even though it has a lower PSNR.So a higher PSNR would normally indicate that the reconstruction is of higher quality.
It is most easily defined via the mean square error (MSE) which for two m × n monochrome images I and K, where one of the images is considered a noisy approximation of the other, is defined as: The PSNR is defined as: here, MAX 1 is the maximum possible pixel value of the image.When the pixels are represented using 8 bits per sample, this is 255.

Structural Similarity Index Measure (SSIM)
It is a method for measuring the similarity between two images.The SSIM index is a full reference metric, where the measure of the image quality is based on an initial distortion-free image as reference.SSIM is designed to improve on traditional methods like PSNR and MSE, which have proved to be inconsistent with human eye perception.The resultant SSIM index is a decimal value between -1 and 1.The value 1 is only reachable in the case of two identical sets of data.The SSIM metric is calculated on various windows of an image.The measure between two windows x and y of common size N × N is: In Section 4.4, eight different sets of the recovered logo and the final constructed logo using majority algorithm are given.
where μ x is the average of x; μ y the average of y; 2 x  the variance of x; 2 y  the variance of y; σ xy the covariance of x and y; c 1 = (k 1 L) 2 , c 2 = (k 2 L) 2 are two variables to stabilize the division with weak denominator; L the dynamic range of the pixel-values ( typically this is 2 # bits per pixel -1); k 1 = 0.01 and k 2 = 0.03 by default.

Embedding of Watermark into Cover Image and Quality Metrics
It can be observed from Table 1 that the results obtained from the quality metrics are very satisfactory and hence we can conclude from the obtained data that the watermarked image is not very much different from the original cover image that is being used.Also, the difference between the watermarked image and the original appears almost the same to the human eye.

Results and Discussions
In this section several experimental results are given to show the outcome of the proposed watermarking technique.
Higher PSNR value indicates good quality of picture.After embedding the information logo in the cover image for Lena, Tower and Fruit images we find that the PSNR value is quite high.
In Section 4.1 three sets of cover image along with three information logos are taken as input.The watermarked image is shown after embedding.The computed value of the quality metrics are also given to find the image quality.
Similarly SSIM is another measuring metric used for finding the similarity between the two images.Here we observe that after embedding the information logo the similarity between the cover image and watermarked image is 0.98 which describes a good structural similarity between these two images.
In Section 4.2, the watermarked images and the recovered information logos are given.
In Section 4.3, the outcome for the same recovery technique is shown but under two attacks known as salt and pepper noise and image compression.For salt and pepper noise the percentage is varied up to 40% and compression up to 5%.The required noisy watermarked images and the recovered logo from those images are presented.

Recovery of Watermark from Watermarked Image without Any Attack
Here the hidden watermarked image i.e. the information logo is successfully recovered from the un-attacked watermarked image which is given in Table 2. Primarily, we have considered the communication is ideal and hence no external interference or attack has been included.In practice, however, we have to consider noise, which is dealt with in the next section.

Recovery of Watermark from Watermarked Image under Attacks
In watermarking terminology, an attack is any processing that may impair detection of the watermark or communication of the information conveyed by the watermark.
The processed watermarked data is then called attacked data.There are two kinds of watermark attacks: Nonintentional attacks, such as compression of a legally obtained, watermarked image or video file, and intentional attacks, such as an attempt by a multimedia pirate to destroy the embedded information and prevent tracing of illegal copies of watermarked digital video.The present work describes the following two types of attack: (1) Salt and pepper noise.
(1) Salt and pepper noise: In this section we have demonstrated the proposed watermarking technique after using the salt and pepper noise to corrupt the watermarked images up to 40%.
From the above set of results in Table 3, it is clear that that the proposed algorithm can withstand 40% salt and  pepper attack with ease and the information logo that is derived from the watermarked image closely resembles the information logo that was embedded into the image.
Hence we can say that the proposed algorithm efficiently handles salt and pepper noise.Similarly in the next Table 4, the strength of the proposed algorithm is demonstrated against the salt and pepper attack with a different set of data. (

2) JPEG Compression:
The performance of the proposed algorithm is also demonstrated against JPEG compression attack in Table 5.This algorithm also demonstrates its strength against compression attack as well.mation is successfully recovered from the watermarked image by using the majority algorithm technique.We can conclude by stating that the proposed algorithm provides a method for secure data hiding.
Gray scale cover image (CI) and binary logo (information) taken as input Extracting the image size and reshaping both images to 1D form Determine min intensity of CI (threshold) and zero intensity positions of logo Pixel positions of CI within threshold range arranged in an array Encryption:( Random key) XOR (Zero intensity position of Logo) The positional values in the array are used to hide the encrypted information Decoding Technique: Extraction of position of hiding using Threshold value Extraction of the encrypted positional information Filtering by Majority Algorithm on the 8 retrieved sets to get the derived data set Decryption of the recovered data using first key Reconstruction of the message logo with the receiver keys Watermarked image Recovered final information logo/ watermark

4. 4 .
Construction of Different Recovered Logo Using Majority Algorithm TechniqueTables6 and 7describe the outcome of majority algorithm technique.Here final constructed S logo and K logo from 8 different recovered sets have been shown.It is clearly visible that the proposed majority algorithm technique is strong enough to construct the information logo from some distorted sets of recovered logo.