Data Embedding And Extracting Using Pixel Pair Matching With Potential Masking

This paper presents a new data-hiding method based on pixel pair matching (PPM). The basic idea of PPM is to use the values of pixel pair as a reference coordinate, and search a coordinate in the neighborhood set of this pixel pair according to a given message digit. The pixel pair is then replaced by the searched coordinate to conceal the digit.Here introduces a new term called potential masking. This is proposed to be done before the embedding process. Potential masking is done based on frequency of pixels in Wavelet domain. Exploiting modification direction (EMD) and diamond encoding (DE) are two datahiding method proposed recently based on PPM.The proposed method offers lower distortion and allowing embedded digits in any notational system. The proposed method always has lower distortion for various payloads and the experimental results reveal that it is secure under the detection of some well-known steganalysis techniques

The least significant bit substitution method, referred to as LSB in this paper, is a well-known data-hiding method. This method is easy to implement with low CPU cost, and has become one of the popular embedding techniques. However, in LSB embedding, the pixels with even values will be increased by one or kept unmodified. The pixels with odd values will be decreased by one or kept unmodified. Therefore, the imbalanced embedding distortion emerges and is vulnerable to steganalysis [5], [6]. Another method is a simple and efficient optimal pixel adjustment process (OPAP) method to reduce the distortion caused by LSB replacement. In this method, if message bits are embedded into the right-most r LSBs of an m -bit pixel, other m-r bits are adjusted by a simple evaluation. Namely, if the adjusted result offers a smaller distortion, these m-r bits are either replaced by the adjusted result or otherwise kept unmodified.
The LSB and OPAP methods employ one pixel as an embedding unit, and conceal data into the right-most r LSBs. Another group of data-hiding methods employs two pixels as an embedding unit to conceal a message digit s B in a B-ary notational system. We term these datahiding methods as pixel pair matching (PPM). This paper proposes a new data embedding method to reduce the embedding impact by providing a simple extraction function and a more compact neighborhood set. The proposed method embeds more messages per modification and thus increases the embedding efficiency.Moreover, the best notational system for data concealing can be determined and employed in this new method according to the given payload so that a lower image distortion can be achieved.

Adaptive Pixel Pair Matching (Appm)
The basic idea of the PPM-based data-hiding method is to use pixel pair (x,y) as the coordinate, and searching a coordinate (x',y') within a predefined neighborhood set ϕ(x,y) such that f(x',y')=s B ,where f is the extraction function and s B is the message digit in a Bary notational system to be concealed. Data embedding is done by replacing (x,y) with (x',y') . For a PPMbased method, suppose a digit s B is to be concealed.
The range of f(x,y) is between 0 and B-1 , and a coordinate (x',y') ϵ ϕ(x,y) has to be found such that f(x',y') =s B . Therefore, the range of f(x,y) must be integers between 0 and B-1, and each integer must I J E R T I J E R T occur at least once. In addition, to reduce the distortion, the number of coordinates in ϕ(x,y) should be as small as possible.
The best PPM method shall satisfy the following three requirements: 1) There are exactly B coordinates in ϕ(x,y) .
2) The values of extraction function in these coordinates are mutually exclusive.
3) The design of ϕ(x,y) and f(x,y) should be capable of embedding digits in any notational system so that the best B can be selected to achieve lower embedding distortion.

Proposed Method Block Diagram
Block Diagram Description

3.1). Extraction Function and Neighborhood Set
The definitions of Φ(x,y) and f(x,y) significantly affect the stego image quality. The designs of Φ(x,y) and f(x,y) have to fulfill the requirements: all values of f(x,y) in Φ(x,y) have to be mutually exclusive, and the summation of the squared distances between all coordinates in Φ(x,y) and f(x,y) has to be the smallest. This is because, during embedding,(x,y) is replaced by one of the coordinates in Φ(x,y) . Suppose there are B coordinates in Φ(x,y) , i.e., digits in a B -ary notational system are to be concealed, and the probability of replacing by one of the coordinates in Φ(x,y) is equivalent. The averaged MSE can be obtained by averaging the summation of the squred distance between (x,y) and other coordinates in Φ(x,y) . Thus, given a Φ(x,y) the expected MSE after embedding can be calculated by MSE Φ(x,y) = 1/2B ∑ i=0 B-1 ﴾(x i _ x) 2 +(y iy) 2 ). Here we will propose an adaptive pixel pair matching(APPM) data hiding method to explore better f(x,y) and Φ(x,y) so that MSE Φ(x,y) is minimized. Data is then embedded by using PPM based on these f(x,y) and Φ(x,y).Let F(x,y)=(x+c B ×Y)mod B. The solution of Φ(x,y) and f(x,y) is needed a discrete optimization problem Minimize: ∑﴾x i _ x) 2 +(y iy) 2 Subject to: f( x i ,y i ) ϵ{0,1,…..B-1} f( x i ,y i ) ≠ f( x j ,y j ) , if i≠ j for 0≤ I,j ≤ B-1……………………….(1) Given an integer B and an integer pair (x,y), (1) can be solved to obtain a constant c B and B pairs of ( x i ,y i ) .These B pairs of ( x i ,y i ) are denoted by Φ B (x,y) represents a neighborhood set of (x,y).

3.2) Embedding Procedure
Suppose the cover image is of size M×M, S is the message bits to be concealed and the size of S is |S|. First we calculate the minimum B such that all the message bits can be embedded. Then, message digits are sequentially concealed into pairs of pixels. The detailed procedure is listed as follows. Input: Cover image of size M×M, secret bit stream S, and key k r . Output: Stego image I',c B ,ϕ B (x,y) , and k r . 1. Find the minimum B satisfying └ M×M/2┘≥|s B |,and convert S into a list of digits with a B ary notational system s B 2. Solve the discrete optimization problem tofind c B and ϕ B (x,y) 3. In the region defined ϕ B (0,0) , record the coordinate (x i˜, yi˜) such that f(xi,yi)=i,0 ≤ i ≤ B-1 , . 4. Construct a non repeat random embedding sequence Q using a key k r . 5. To embed a message digit s B , two pixels (x,y) in the cover image are selected according to the embedding sequence Q , and calculate the modulus distance d= s B -f(x,y) mod b between s B and f(x,y),then replace (x,y) with( x˜+xd,y˜+yd) .

Repeat
Step 5 until all the message digits are embedded.
In real applications, we can solve all c B and ϕ B (x,y) at once. With the knowledge of c B and ϕ B (x,y) , there is no need to perform Step 2 in the embedding phase. Let x' =x + x d ˄ and y ' =y + y d ˄ .
If an overflow or underflow problem occurs, that is, (x' ,y') < 0 or (x',y') > 255, then in the neighborhood of (x, y) find a nearest (x" ,y") such that f (x",y") = s B . This can be done by solving the optimization problem Minimize (x -x " ) 2 + (y -y " ) 2 Subject to f (x " , y " ) = s B , 0 ≤ x " ,y " ≤ 255 We use a simple example to illustrate the embedding proce-dure. Suppose a cover image of size 512x512with embedding requirement of 520000 bits. The minimum B satisfying (512x512xlog2B)/2 >= 520000 is 16; therefore, we choose the 16-ary notational system as the embedding base.
But, if the pixels at position (10,11) equal to the pixels at position (9,12), the interchange will not make any difference. This makes it difficult for the extraction process to find out what bit is embedded. Here comes the importance of potential masking.
Before embedding the bits, we need to find out whether the pixel pairs are potential for the process of extraction. This process shall be called potential masking. This is proposed to be done before the embedding process. The variance of pixel amplitudes of each blocks are to be analyzed to find the potential blocks among all. The data shall be embedded only on those potential blocks.
Potential masking is done based on frequency of pixels in Wavelet domain.

1)The wavelet transform of each block is done. 2)Variance of wavelet coefficients of each block is measured separately.
3)Only those blocks with variance greater than a threshold shall be selected. 4)The index of these blocks shall be saved in the key. 5)Only those blocks shall be taken during the extraction process as well.

3.3) Extraction Procedure
To extract the embedded message digits, pixel pairs are scanned in the same order as in the embedding procedure. The embedded message digits are the values of extraction function of the scanned pixel pairs. Input : Stego image I', c B ,ϕ (x,y) , and key k r Output : Secret bit stream S 1. Construct the embedding sequence Q using a key k r 2. Select two pixels (x',y') according to the embedding sequence Q

I J E R T I J E R T
3. Calculate f(x',y'), the result is the embedded digit. 4. Repeat steps 2 and 3 until all the message digits are extracted. 5. Finally the message bits S obtained by converting the extracted message digits in to a binary bit stream.
Continue from the previous example. Let the scanned pixel pair be (x',y') =(9,12). The embedded digit in a 16-ary notational system can be extracted by calculating f (9,12)

Perceptual Masking for Multiwavelet Transform
Here to develop an adaptive perceptual masking on the basis of the utilization of HVS (human visual system) characteristics [7], [8]. We found the errors caused by using fewer levels can be considered as a noise source, and visual psychophysics states that a number of factors affect the noise sensitivity of the eye: the background luminance, the proximity to an edge, the spatial frequency band, and texture masking. To determine level of the weighting based on how the eye perceives changes in an image, Barni propose the following considerations: • The eye is less sensitive to noise in the high resolution bands and in those bands having orientation of 45 . • The eye is less sensitive to noise in those areas of the image where brightness is high or low. • The eye is less sensitive to noise in highly textured areas, but, among these, more sensitive near the edges. The above considerations basically outline sensitivity of human eye to noise changes. Lewis and Knowles [9]combined band sensitivity, background luminance, and texture masking information to provide a perceptual threshold for each sub band coefficient. In our algorithm we use a similar calculation to estimate the just perceptual weight (JPW). In this work, three visual phenomena are model to the JPW: spatial frequency masking, luminance masking,and texture masking.

4.1) Spatial Frequency Masking:
In order to take into account how sensitivity to noise changes depending on spatial frequency band (in particular depending on the orientation and level of detail), the spatial frequency masking is described by the following expression: θ) where is the contrast sensitivity function (CSF) which describes our sensitivity to spatial frequencies . A widely used model for the CSF for gray scale images, originally proposed by Mannose and Sakrison is given by H(f)=2.6(0.0192+0.114f) e [-0.114f)1.1] where the spatial frequency f=(fx 2 +fy 2 ) .5 is with units of cycles/degree( and are the spatial frequencies in the horizontal and vertical directions respectively). In a HVS-based compression scheme composed by Beegan , coefficients in the wavelet decomposition are weighted by the peak of the CSF curve in the corresponding sub band. . Each sub band weight is computed as the peak of the CSF curve in its corresponding frequency band. The weights are normalized such that smallest weight is unity. In our paper, we define as just perceptual weighting depending on spatial frequency, which describes minimally noticeable sensitivity.

4.2) Luminance Masking:
Human visual perception is sensitive to luminance contrast rather than absolute luminance value. As indicated by Webers law, if the luminance of a test stimulus is just noticeable from the surrounding luminance, then the ratio of just noticeable luminance difference to stimulus difference, known as Weber fraction, is constant.

4.3) Texture Masking:
Another factor that will affect the just perceptual weighting is texture masking which takes into account the local image sub band properties. Texture masking is based on the computation of a Noise Visibility Function (NVF) that characterizes the local image properties identifying textured and edge regions.

Wavelet Transform
Wavelet domain techniques are becoming very popular because of the developments in the wavelet stream in the recent years .Wavelet transform is used to convert a spatial domain into frequency domain. The use of wavelet in image stenographic model lies in the fact that the wavelet transform clearly separates the high frequency and low frequency information on a pixel by pixel basis [10]. The wavelet transform can provide us with the frequency of the signals and the time associated to those frequencies, making it very convenient for its application in numerous fields Discrete Wavelet Transform (DWT) is preferred over Discrete Cosine Transforms (DCT) because image in low frequency at various levels can offer corresponding resolution needed. A one dimensional DWT is a repeated filter bank algorithm, and the input is convolved with high pass filter and a low pass filter. The result of latter convolution is smoothed version of the input, while the high frequency part is captured by the first convolution. The reconstruction involves a convolution with the synthesis filter and the results of this convolution are added. In two dimensional transform, first apply one step of the one dimensional transform to all rows and then repeat to all columns. This decomposition results into four classes or band coefficients. The Haar Wavelet Transform is the simplest of all wavelet transform. In this the low frequency wavelet coefficient are generated by averaging the two pixel values and high frequency coefficients are generated by taking half of the difference of the same two pixels. The four bands obtained are approximate band (LL), Vertical Band (LH), Horizontal band (HL), and diagonal detail band (HH). The approximation band consists of low frequency wavelet coefficients, which contain significant part of the spatial domain image. The other bands also called as detail bands consists of high frequency coefficients, which contain the edge details of the spatial domain image. This DWT decomposition of the signal continues until the desired scale is achieved .Two-dimensional signals, such as images, are transformed using the two dimensional DWT. The two-dimensional DWT operates in a similar manner, with only slight variations from the one-dimensional transform. Given a two-dimensional array of samples, the rows of the array are processed first with only one level of decomposition. This essentially divides the array into two vertical halves, with the first half storing the average coefficients, while the second vertical half stores the detail coefficients. This process is repeated again with the columns, resulting in four sub bands within the array defined by filter output.

Quality Analysis & Experimental Results
Image distortion occurs when data are embedded because pixel values are modified. We use MSE to measure the image quality MSE= 1 ̸ M×M ∑ M i=0 ∑ M j=0 (p I,j -p I,j ' ) 2 where M×M denotes the image size, and p I,j , p I,j ' denote the pixel values of the original image and the stego image, respectively. MSE represents the mean square error between the cover image and stego image. A smaller MSE indicates that the stego image has better image quality.
In this section to present the experimental results of the proposed method. Figure (1) shows the MSE comparison of various PPM-based methods less than 2 bpp. The payload-MSE relationship of APPM is denoted by circles. TheB -ary digits used for a given payload are marked beside the circle. It can be seen that the MSEs of APPM are always smaller or equal to other PPM based methods. For example, when digits in a 4-ary notational system are embedded, the MSEs of APPM and LSB matching are the same. When embedding digits in a 13-ary notational system, APPM and DE have the same MSE. However, when embedding 16-ary digits, APPM outperforms OPAP. APPM not only greatly increases the payload of EMD, but also enable users to freely select the desired notational system for data embedding so that a better image quality can be obtained.
In the figure(2) Discrete wavelet transform of the image is taken; it gives four coefficients of approximate, horizontal, vertical and diagonal respectively. Analyzing these coefficients and thresholdong of the Coefficients to find the most suitable position. Those positions which remain after thresholding can be used for embedding the data. Figure (3) shows cover image and stego image of camera man after embedding "I love my country"

Conclusion
This paper presented a simple and efficient data embedding method based on pixel pair matching. Two pixels are scanned as an embedding unit. Proposed method allows users to select digits in any notational system for data embedding, and thus achieves a better image quality. It produces no artifacts in stego images and the steganalysis results are similar to those of the cover images, it offers a secure communication under adjustable embedding capacity.