A Novel Digital Image Watermarking Scheme for Data Security Using Bit Replacement and Majority Algorithm Technique

background and of to of The gamut of watermarking be used to encode The work also presents a wide array of algorithms ranging from intelligent bit replacement to more traditional methods like ICA. The current work is split into two books. Book one is more traditional in its approach dealing mostly with image watermarking applications. Book two deals with audio watermarking and describes an array of chapters on performance analysis of algorithms.

Confidentiality means that only the entitled persons have access to the images.
Reliability has two aspects, integrity: the image has not been modified by a non-authorized person; authentication proofs that the image belongs indeed to the correct person and is issued from the authorized source.
Lastly availability is the ability of an image to be used by the entitled persons in the normal conditions of access and exercise.
This chapter 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 chapter 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 nonoblivious 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.

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 (Ling Na Hu Ling Ge Jiang, 2002). Given the extraordinarily high channel capacity of using the entire cover for transmission in this method, a smaller object may be embedded multiple times (D. Osborne, D. Abbott, M. Sorell, and D. Rogers, 2004). Even if most of these are lost due to attacks, a single surviving watermark would be considered as a success. LSB substitution however despite of its simplicity brings a host of drawbacks. Although it may survive from all these transformations such as cropping, any addition of noise or lossy compression, 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 (P.W. Wong, 1998). The algorithm however would still be vulnerable to replace the LSB's with a constant. Even in 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 (Johnson, N. F., Duric, Z., and Jajodia, S., 2001), 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. Different types of alteration which is known as attack 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. Methods or a www.intechopen.com combination of methods considered unintentional are used intentionally as an attack on a watermarked document in order to render the watermark undetectable. Compression is a common attack as data transferred via network is often compressed using JPEG (most commonly). 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 some of the pixels of an image resulting 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.
In present chapter the section 2 contains proposed watermarking method for data authentication. Section 3 describes image quality matrices, section 4 presents the experimental results, section 5 explains flow diagram and section 6 discusses the conclusion of the work.

Proposed watermarking technique for data authentication
Our proposed methodology for data hiding does not follow the conventional LSB technique because of its inherent limitations. We have developed a new digital watermarking scheme that uses several bits of the cover image starting from lower order to higher order to hide the information logo. Here we generally hide several sets of the same data forming the information logo into the cover image. So if some of the information is lost due to attack, we can still collect the remaining information from the cover image and can reconstruct the hidden information very closer to the original one.
The detailed step wise algorithm along with the pseudo code written in MATLAB for both the embedding scheme and the recovery scheme is given here. The flow diagram of both the embedding and recovery process is also given in section 5 for better understanding.

Embedding the digital watermark
Step 1. Two images are taken as input: First of all, the cover image is taken as input. Then the message or information logo is taken as input. 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 and stored in to two variables..
Step 3. Normalize and reshape the logo: After normalizing the information logo it is being reshaped in one dimension.
Step 4. Transforming the cover image into wavelet domain using DWT: The cover image is transformed to wavelet domain using discrete wavelet transform. Here 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 different frequencies of the cover image.
Step 5. Calculate the length of transformed cover image and 1 D logo Step 6. Calculate the size of each sub domain decomposed cover image and reshape them in to 1D Step 7. Determine the maximum coefficient value of each of the 4 sub domain 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.
Step 9. Hiding a number of sets of same information logo in HL and LH domain: More than one set of 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 sets of 1D information logo is hidden in a position of information logo position from where a constant value is subtracted.
Step 10. Reshaping the decomposed image back to its normal dimension Step 11. Write the watermarked image to a file and display it.

Recovery of the embedded watermark
We have assumed that the cover image that is hiding the watermark is available at the receiving end. So again in the process of recovery we first take the original image that has been used to hide the information. Along with that 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, embedded messages.

Step 1. take input the watermarked and original image
Step 2. Find 1 st level decomposition of both the two inputs using DWT Step 3. Find the size of each sub domain of both the two decomposed input image Step 4. reshape each of the decomposition of both watermarked and original cover image into 1 D Step 5. take two input keys equal to the dimension of logo to find the size of 4 decompositions of logo Step 6. Determining maximum coefficient values of original cover image Step 7. Finding positions that were used to hide logo for each decomposition Step 8. Extracting positional sets for different sets of logo from each decomposition Step 9. Recovery of different sets of logo from each of the sub bands using majority algorithm and construction of final logo from the different recovered sets Step 10. after reshaping display each of the recovered sets of logo and the final constructed logo

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 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 www.intechopen.com for wide range signals The PSNR is most commonly used as a measure of quality of reconstruction of lossy compression. The cover image in this case is the original data, and the information logo is the error introduced by watermarking. When comparing 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 is for two m×n monochrome images I and K where one of the images is considered a noisy approximation of the other and is defined as: The PSNR is defined as: Here, MAX I 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, in other words, the measuring of image quality 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, and 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: L the dynamic range of the pixel-values (typically this is # 21 bits per pixel  ); k 1 =0.01 and k 2 =0.03 by default. www.intechopen.com

Results and discussions
In this section several experimental results are given to show the outcomes of the proposed watermarking technique.
In section 4.1. three sets of cover image along with three information logo are taken as input and watermarked image as result of embedding technique. The computed value of quality matrices are also given to find the image quality.
In section 4.2. watermarked images and recovered information logos are given.
In section 4.3. outcomes of same recovery technique has 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 recovered logo from those images are presented.
In this section eight different sets of recovered logo and the final constructed logo using majority algorithm are also given for two different examples.

Embedding of watermark into cover image
From table 1 we can see that the results obtained from the quality metric 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 we can observe that the difference between the watermarked image and the original is appearing all most same to human visual system to detect.
Higher PSNR value indicates good quality of picture. After embedding the information logo in the cover image like Lina, Tower, Fruits etc. we have found a quite higher PSNR value.
Similarly SSIM is another measuring metric used for finding the similarity between the two images. Here we found that after embedding the information logo the similarity between cover image and watermarked image is almost close to 1 as 0.98 which describes a good structural similarity between these two images

Recovery of watermark from watermarked image without any attack
From table 2 we can see that the hidden watermark image i.e. the logo or information is successfully recovered from the watermarked image. Primarily we have considered the communication is ideal and hence no external interference has been included. In practice in the real world scenario we have to consider the noise and which are being incorporated in present experiment into the sent watermarked image. There are chances of unauthorized users in reality where the watermarked image can also be easily altered by unauthorized access from unwanted users.

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.   Table 4. Constructed S logo from recovered 8 sets using Majority Algorithm Technique

Salt and pepper noise
Salt and pepper noise is a form of noise typically seen on images. It represents itself as randomly occurring white and black pixels. An effective noise reduction method for this type of noise involves the usage of a median filter, morphological filter or a contra harmonic mean filter. Salt and pepper noise creeps into images in situations where quick transients, such as faulty switching, take place.
In this section we have demonstrated proposed technique after using the salt and pepper noise to corrupt the images up to 40 %. This algorithm can recover embedded information from the tempered watermarked image after this attack using majority algorithm.  Table 5. Watermarked image, attacked image and recovered logo using majority algorithm technique From the above set of results it is clear that the proposed algorithm can withstand even 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.

Reconstructed message image or logo from 8 different recovered sets (dimension 16X16)
Hence we can say that the proposed algorithm efficiently handles salt and pepper noise.
Similarly in the next table the strength of the proposed algorithm is demonstrated against the salt and pepper attack with some different sets of data.

Image compression
The objective of image compression is to reduce irrelevance and redundancy of the image data in order to be able to store or transmit data in an efficient form. Image compression may be lossy or lossless. Lossless compression is preferred for medical imaging.
The proposed algorithm also demonstrates its strength against the compression attack as well.

Applying the proposed technique on medical images
Medical images are very special as they are very informative. They need more care when we use them. Every medical image contains much more information which may be needed in future. So we have to keep the information of these images intact. The proposed algorithm c a n a l s o b e u s e d o n m e d i c a l i m a g e s l i k e X r a y , M R I , C T S c a n f o r d a t a h i d i n g a n d authentication.
Here we use some medical images as cover image, some trade mark logo as information, and salt and pepper noise and image compression as attack. Here we can see the proposed algorithm can recover embedded information logo from both types of attacked image up to

Conclusion
Digital Watermarking has emerged as an important area of research. It mainly deals with the addition of hidden messages or copyright notices into digital media. There are many algorithms available for watermarking and it can be done for different media. They can also be attacked in different ways. Digital Watermarking has many applications in the digital world today. The digital watermarking can be thought as digital communication scheme where an auxiliary message is embedded in digital multimedia signals and is available wherever the later signals move. Therefore the detection reliability is significantly enhanced by embedding rather than by transmitting the same watermark through different sub channels (bands). Thus, this diversity technique can give very good results in detecting the watermark, considering the fact that many watermark attacks are more prone to fading.
The proposed algorithm aims at obtaining a solution to the several problems of digital communication and also for data hiding. It has been seen that the proposed algorithm is robust against compression and 'salt and pepper' noise attack and also utilizes a private key which is required for the recovery of the hidden information and hence lending security to the algorithm. The results obtained show satisfying statistics of the performance of the proposed algorithm. The obtained PSNR and SSIM value supports the quality of the encryption method. It is also seen that the embedded information is successfully recovered from the watermarked image by using majority algorithm technique. The majority algorithm technique is very much efficient and a newer approach which is very unique and easy to understand.
Hence we can conclude by stating the fact that the proposed algorithm provides a method for secure communication and data hiding.

Acknowledgement
It is my pleasure to express my heartiest thank to all the faculty members of Institute of Radio physics and Electronics, University of Calcutta, Kolkata for their heartiest cooperation.
I am also thankful to all the faculty members of Electronics and communication Engineering Department of Guru Nanak Institute of Technology, sodepore, Kolkata for their ungrudging support.