# A Novel Image Data Hiding Scheme with Diamond Encoding

- Ruey-Ming Chao
^{1}, - Hsien-Chu Wu
^{2}Email author, - Chih-Chiang Lee
^{3}and - Yen-Ping Chu
^{4}

**2009**:658047

**DOI: **10.1155/2009/658047

© Ruey-Ming Chao et al. 2009

**Received: **1 August 2008

**Accepted: **20 March 2009

**Published: **4 May 2009

## Abstract

A novel data hiding scheme in digital images with the diamond encoding by pixel value adjustment is proposed. The proposed method is the extension of the exploiting modification direction (EMD) embedding scheme. First, the process of embedding partitions the cover image into nonoverlapping blocks of two consecutive pixels and transforms the secret messages to a series of -ary digits. For each block, the diamond encoding technique is applied to calculate the diamond characteristic value, and one secret -ary digit is concealed into the diamond characteristic value. The diamond characteristic value is modified to secret digit and it can be obtained by adjusting pixel values in a block. This scheme is designed in such a way that the distortion of each block after diamond encoding is never out of the embedding parameter , and the block capacity is equal to . The diamond encoding provides an easy way to produce a more perceptible result than those yielded by simple least-significant-bit substitution methods. The embedded secret data can be extracted without the original cover image. Experimental results have demonstrated that the proposed method is capable of hiding more secret data while keeping the stego-image quality degradation imperceptible.

## 1. Introduction

In recent years, communication security over the Internet is becoming more and more important because the multimedia and network are widely developed. Two fields of research have been proposed to enhance the communication security: cryptography and information hiding. Although they are both applied to the protection of secret message, the major difference is the appearance of the transmitted data. The cryptography methods, such as DES and RSA, referred almost exclusively to encryption which is the process of converting ordinary information (plaintext) into unintelligible gibberish (cipher-text). After data encryption, the secret data appears to be a total chaos of seemingly meaningless bits. However, the existence of the transmitted secret message can be detected. Because it does not conceal the fact that there is an important message, the encrypted message could motivate an unauthorized user to decrypt or destroy it. However, information/data hiding [1–3], referred to as a process to hiding secret data of various types (message, image, information, etc.) into another digital media (text, image, audio or video streams), can solve the intercepts problem. The concealing media is called "cover" or "host" media. If this cover media is a digital image, it is called a cover image, and the altered cover image containing the secret information is called a stego-image (or stego-media). The embedding capacity and invisibility are the major concerns in a data hiding scheme analysis. The capacity of a data hiding scheme refers to the quantity of the secret data that can be embedded into the cover image, and the term invisibility indicates how imperceptible the fact is to illegal users when the cover image has been manipulated and turned to be a stego-image. In order to keep the imperceptibility, the data hinging techniques only alter the most insignificant parts of the cover image. It attempts to establish covert communication between trusting parties and prevent malicious interceptors or attackers from discovering the existence of the hidden message in the stego-image.

Many approaches of information hiding have been proposed for different applications, such as copyright protection [4], secret transmission [5], tampering detection [6], and image authentication [7]. The most well-known data hiding scheme is the least significant bits (LSBs) substitution method. This method embeds fixed-length secret bits into the least significant bits of pixels by directly replacing the LSBs of cover image with the secret message bits. The LSBs approach assumes that the base of the hidden numerical data is a whole power of 2 (e.g., 1-bit LSB means the hidden number is treated as a binary number because
, 2-bit LSB means the hidden number is treated as a number of base
, etc.). Although this method is simple, it generally effects noticeable distortion when the number of embedded bits for each pixel exceeds three. Several methods have been proposed to reduce the distortion induced by LSBs substitution. OPAP [8] scheme searches the minimal distortion value which LSBs equal the embedded bits and replaces stego-pixel value with it. Another way of improving LSBs scheme is to reduce the amount of alterations necessary to be introduced into the cover image for data hiding when the number of secret bits is significantly less than that of available cover pixels. The method proposed by Tseng et al. [9] can conceal as many as
bits of data in a binary image block sized
by changing, at most, two bits in the block. Matrix encoding [10], on the other hand, uses less than one change of the least significant bit in average to embed *w* bits into
cover pixels. Recently, Wu and Tsai [11] proposed a "pixel value differencing" (PVD) method that computes the difference value between two neighboring pixels to determine how many secret bits should be embedded into a cover pixel. All difference values are classified into some ranges that contain different levels of the value. In order to embed secret bits, the difference value is changed but it cannot outside the range of original difference, and the pair of original cover pixels is modified according with the new difference value. In addition, Wang et al. [12] presented an improvement of pixel value differencing scheme where the secret data is hidden in pixel difference with a modulus function. So the alteration caused by the hiding of the secret data is greatly reduced. The proposed method is the extension of the exploiting modification direction (EMD) embedding scheme [13]. The EMD embedding scheme hides each
-ary notational secret digit into
cover pixels, and only one pixel value increases or decreases by 1 at most.

In this paper, an efficient data hiding method is proposed for gray-scale images by utilizing the diamond encoding concept. We first transform the secret data into a sequence of digits, and the cover image is partitioned into nonoverlapping blocks of two consecutive pixels. The diamond encoding method produces a diamond characteristic value (DCV) of the pixel-pair block, and the DCV is revised as the embedded secret digit after data embedding procedure. For each block, the diamond encoding technique addresses the minimal changes of two pixel values under the embedding parameter . In other words, the difference between the cover-block and the stego-block is never more than , and the embedding capacity of a block equals . The diamond encoding technique minimizes the distortion after the DCV alteration to perform better visual quality. Experimental results have demonstrated that the proposed method is capable of hiding more secret data while maintaining imperceptible stego-image quality degradation.

The remainder of this paper is organized as in the following sections. We will describe the exploiting modification direction scheme first in Section 2. Section 3 will present the concept of diamond encoding method. In Section 4, the framework of the proposed scheme will be shown in detail. In Section 5, we will analyze the new scheme and compare it with some well-celebrated schemes in terms of payload and stego-image quality, respectively. Finally, a brief conclusion will be given in Section 6.

## 2. Review of the Exploiting Modification Direction Embedding Scheme

The proposed method is the extension of the exploiting modification direction (EMD) embedding scheme [13]. The main idea of the EMD embedding scheme is that each -ary notational secret digit is carried by cover pixels, and only one pixel value increases or decreases by 1 at most. For each block of cover pixels, there are possible states of only one pixel value plus 1 or minus 1. The states of alteration plus the case in which no pixel is modified form different cases. Therefore, the -ary notational secret digit is embedded into the cover pixels by changing the state. Before the data embedding procedure, the preprocess can convert the secret data into sequences of digits with -ary notational representation. For the simplest case of , the secret data stream can be expressed as where denotes the -ary notational system representation of secret data stream . Thus, the 5-ary digits can conceal into blocks of two cover pixels by modifying at most one pixel value. Denote the gray values of a block of two cover pixels as and , and the extraction function is defined as a weighted sum modulo 5:

Suppose that the transformed 5-ary secret digit *s* desired to be embedded into the cover pixels
and
. According to the secret digit, the embedding process can be classified into 5 conditions.

Condition 1

If :

No modification is needed because the extraction function can decrypt the correct secret data.

Condition 2

If :

Increase the pixel value by 1.

Condition 3

If :

Increase the pixel value by 1.

Condition 4

If :

Decrease the pixel value by 1.

Condition 5

If :

Decrease the pixel value by 1.

By the above operations, the stego-pixel value of the block is obtained. The extraction function is equal to the secret digit . For example, the secret data stream can be expressed as . Consider an original pixel group , and the extraction functions and are calculated by (1). We compute, above equation . Then, the first pixel pair located into Condition 4, and the pixel value 57 must decrease by 1. Similarly, the second pixel pair located into Condition 3 by the equation . The fourth pixel value must increase by 1. Finally, we can get the stego-group by modifying at most one value of two pixel values. In the extraction phase, the extraction function and can be extracted directly, and data stream is decrypted by transforming the secret digit .

## 3. The Diamond Encoding

In this section, we shall introduce the general operation of the diamond encoding technique. The EMD scheme embeds -ary digit into cover pixels, but the diamond encoding scheme can conceal -ary digit into a cover pixel pair where is the embedding parameter. The detail of this scheme is described as follows.

Assume that , , , and are pixel values, and is a positive integer. The neighborhood set represents the set that contains all the vectors ( ) with the distance to vector ( ) smaller than , and is defined as the following form:

The proposed diamond encoding method uses a diamond function to compute the diamond characteristic value (DCV) in embedding and extraction procedures. The DCV of two pixel values and can be defined as follows:

The diamond encoding scheme promises that the distortion of vector
is no more than *k* after embedding a secret digit
. Therefore, this minimal distortion scheme can be employed to embed large amount of data.

## 4. The Proposed Method

*k*is determined firstly, and the diamond encoding with parameter

*k*can conceal secret data into the cover image. The detailed steps of the proposed scheme are discussed in the following subsections.

### 4.1. Embedding Procedure

Step 1.

*k*is selected, and we transform secret data into diamond encoding digits. Assume that the secret data size is

*s*, and then the embedding parameter

*k*is determined by finding the minimal positive integer that satisfies the following inequality:

Set the embedding base
. Then, the secret message is regarded as a sequence of digits in *l*-ary notational system.

Step 2.

*I*is the cover image sized , and

*t*is the block index. The block construction of the proposed scheme is illustrated by Figure 5. The embedded secret data bit stream is transformed into

*l*-ary digit sequence. Moreover, the embedded secret digit is obtained from the th index of the sequence of

*l*-ary digits.

Step 3.

*x*and

*y*by (4)

Step 4.

The symbol shows the modulus distance between the and . By applying the distance , the stego-pixel values and can be found in such that the DCV is replaced with . However, in this step, the overflow or underflow problems might be occurred; that is, the stego-pixel value or might go beyond 255 or below 0. If it happens, the next step, namely Step 5, has to be processed; otherwise, Step 5 has to be skipped, and the data embedding procedure is finished.

Step 5.

When one stego-pixel value has the overflow or underflow problem, the critical vector has to be adjusted to the appropriate value. The adjustment rules are defined as follows:

(1)if , ;

(2)if , ;

(3)if , ;

(4)if ,

From the above rules, it can be observed that the overflow/underflow problem is solved and the DCV also has the same value. After all, we take the next pixel pair from the cover image and repeat Steps 2–5. Repeat until all the secret data have been concealed. Then we collect all stego-pixel values to form the stego-image
. The embedding parameter *k* has to transmit to the receiver in order to extract data.

### 4.2. Extraction Procedure

Here are the steps to extract the secret data from the stego-image and the detailed secret data extraction is described as follows.

Step 1.

To begin with, in the data extraction procedure, the original image is segmented into a number of nonoverlapping two-pixel blocks. Then, we can select each block from top-down and left-right in turn for data extraction process. The block vector is defined as and . The block construction of the proposed scheme is illustrated by Figure 2.

Step 2.

*k*, set the embedding base . For each stego-pixel pair and , the DCV of is obtained from (5):

Therefore, the secret digit is obtained by the DCV of .

Step 3.

Take the next pixel pair from the stego-image and repeat Steps 1 and 2. The same thing goes on and on until all secret digits have been extracted for each block with index *t*.

Step 4.

Finally, the secret data can be obtained by transforming the secret symbols to binary bits with base 2.

Here is an example to describe how the proposed algorithm actually works. Assume that the embedding parameter and . Suppose we have pixel pairs and and we use (4) to calculate DCV by computing . Now let us take as the embedded secret digit, and we can obtain the modulus distance by computing (8). Then, we search which is shown in Figure 2 and obtain the neighboring vector ( ) locating in set and . Therefore, the values of pixel pair ( ) are replaced with ( ). In the secret data extraction phase, the stego-pixel pairs and can be used to compute the DCV by . Finally, the secret digit is obtained.

## 5. Experimental Results and Analysis

*k*was set to be 6. The generated stego-images show that they contain no artifacts that can be identified by human eyes.

*k.*However, the parameter

*k*plays a dominant role in deciding the payload and the stego-image quality for each image. We have also designed experiments, where the "Lenna" test image was used to investigate how the proposed scheme would perform at different parameter

*k*and the results are shown in Table 1. The embedding capacity or payload size is measured by the number of embedded bits per pixel (bpp). In the proposed method, an embedded secret digit is an

*l*-ary data which represents bits and the payload

*P*can be computed by the following equation:

Results of the proposed scheme with different parameter *k.*

Parameter |
| Overflow/underflow | Payload | PSNR |
---|---|---|---|---|

(number of pixels) | (bpp) | (dB) | ||

1 | 5 | 0 | 1.16 | 52.1 |

2 | 13 | 0 | 1.85 | 47.8 |

3 | 25 | 0 | 2.32 | 45.0 |

4 | 41 | 0 | 2.68 | 42.9 |

In our experiments, the quality of the stego-image is measured by the peak signal-to-noise ratio (PSNR). The PSNR is the most popular criterion to measure the distortion between the cover image and stego-image. It is defined as follows:

where MSE is the mean square error between the cover image and stego-image:

Here, the symbols
and
represent the pixel values of the cover image and stego-image in the position
, respectively, and *m* and *n* are the width and height of the original image.

From Table 1, smaller *k* means low capacity and less distortion whereas larger *k* means high capacity and increased distortion. As expected, Table 1 shows that the growth of payload did depend on the value *k*. The third column of Table 1 indicates that the numbers of pixels with overflow or underflow conditions. The payload and PSNR value are listed in fourth and fifth columns of Table 1 by (10)–(12). Therefore, human eyes cannot discover the difference between cover image and stego-image.

Comparison results of PSNR among LSB, OPAP, PVD, M-PVD and our scheme on various test images with embedding payload = 300 000 bits (1.14 bpp).

Test images | LSB | OPAP | PVD | M-PVD | Our scheme |
---|---|---|---|---|---|

| |||||

Lenna | 49.5 | 50.1 | 46.2 | 49.6 | 52.1 |

Airplane | 49.5 | 50.0 | 46.1 | 49.5 | 52.0 |

Boat | 49.5 | 50.1 | 46.1 | 49.4 | 52.1 |

Baboon | 49.5 | 50.1 | 46.2 | 49.4 | 52.0 |

Barbara | 49.5 | 50.1 | 46.1 | 49.5 | 52.1 |

Pepper | 49.5 | 50.1 | 46.2 | 49.6 | 52.0 |

Tiffany | 49.4 | 50.0 | 46.1 | 49.7 | 52.1 |

Zelda | 49.4 | 50.1 | 46.2 | 49.5 | 52.1 |

Comparison results of PSNR of LSB, OPAP, PVD, M-PVD and our scheme on various test images with embedding payload = 600 000 bits (2.28 bpp).

Test images | LSB | OPAP | PVD | M-PVD | Our scheme |
---|---|---|---|---|---|

Lenna | 42.3 | 45.7 | 37.5 | 40.6 | 46.3 |

Airplane | 42.4 | 45.3 | 37.4 | 40.4 | 46.7 |

Boat | 42.3 | 45.4 | 37.0 | 40.2 | 46.3 |

Baboon | 42.5 | 45.3 | 37.1 | 40.3 | 46.3 |

Barbara | 42.4 | 45.6 | 37.7 | 40.5 | 46.2 |

Pepper | 42.3 | 45.4 | 37.8 | 40.2 | 46.4 |

Tiffany | 42.5 | 45.6 | 37.2 | 40.3 | 46.6 |

Zelda | 42.4 | 45.4 | 37.1 | 40.5 | 46.2 |

*RS*detection attack [14] or PVD histogram analysis [15]. The

*RS*detection method which is proposed by Fridrich et al. can directly detect the existence of hidden data in a stego-image without perceptual analysis. By a flipping function and the mask

*M*, they use the statistical method to classify each pixel into three groups: the regular group , the singular group , and the unusable group . Similarly, the statistical method also can classify each pixel into three groups with the inverse mask –

*M*: , and . The stego-image will pass the RS detection method when and . On the contrary, the stego-image will be considered as a suspicious image which contains secret data. The

*RS*detection results of our scheme are shown in Figure 8, where the

*x*-axis represents the embedding rate and the

*y*-axis represents the percentage of the , , and with masks and . Moreover, we have also tested the other stego-images proposed by our scheme and the results are the same as Figure 8. As expected, the RS attack, which is targeting LSB steganography, fails to detect the proposed scheme. In Figure 9, we can see the PVD histogram results of original image and stego-image. If the histogram does not display a smooth curve, the image will be judged as a suspicious image. According to the analysis, we can make a conclusion that the proposed scheme is secure against the RS detection attack and PVD histogram analysis.

In addition, the blind attack of steganography [16, 17] is presented in 2006 to detect hidden messages in images and uses a wavelet decomposition to build higher-order statistical model of natural images by support vector machine (SVM). We have collected 1000 gray-scale natural images (all natural images were downloaded from http://dud.inf.tu-dresden.de/~westfeld/rsp/rsp.html.). These images include decades of digital and traditional photography and consist of a range of indoor and outdoor scenes with
pixels in size. The wavelet transform decomposes the image into subbands. The *j* th order horizontal, vertical, and diagonal subbands are denoted as
,
, and
, respectively. In this experiment, we use
,
,
,
,
,
,
,
, and
as the decomposition subbands. Given this image decomposition, the statistical model is composed of the mean, variance, skewness, and kurtosis of the subband coefficients, to yield 36-dimensional statistical features.

Next, 1000 stego-images were generated by embedding messages of varying parameter into 1000 cover images. We implemented the classification procedure into an LIBSVM [18] for linear and nonlinear (radial basis) kernel types. Next, 800 clean and stego-images were used to train an SVM model and the remaining 200 images were used in testing. All SVM parameters were optimized by a grid search that optimized the SVM training and testing accuracy. The classification accuracy means the correctness of classifying results. If the stego-image is judged to be a clean image, it is classified into False set; otherwise, it belongs to True set. Similarly, if the clean image can be detected by SVM as a stego-image, it is also in False set. For each test set, the accuracy formula is shown as follows:

*k*in testing results is shown in Table 4. According to the steganalysis result, our scheme is hardly detected for

*k*≤ 4. Finally, we select the estimated embedding rate as the decision threshold and generate the receiver operating characteristic (ROC) curves shown in Figure 10.

Classification accuracy (percentage) for varying parameter *k* with linear SVM and nonlinear SVM as classification kernel.

Parameter | Linear SVM | Nonlinear SVM | ||
---|---|---|---|---|

| Stego-image | Clean image | Stego-image | Clean image |

1 | 11.3 | 89.4 | 13.1 | 90.5 |

2 | 22.7 | 83.6 | 26.3 | 87.3 |

3 | 30.2 | 79.5 | 35.2 | 85.2 |

4 | 32.7 | 76.8 | 41.3 | 80.5 |

## 6. Conclusions

In this paper, we have presented a novel data hiding scheme based on the diamond encoding technique. The diamond encoding method has been used to alleviate distortions after hiding a secret digit into two cover pixels. It not only keeps high stego-image quality but also conceals large amount of data into cover images for secret communication. The performance of the proposed scheme proves to be better than the simple LSB method and other existing schemes in terms of payload and stego-image quality.

## Authors’ Affiliations

## References

- Hartung F, Kutter M: Multimedia watermarking techniques.
*Proceedings of the IEEE*1999, 87(7):1079-1107. 10.1109/5.771066View ArticleGoogle Scholar - Marvel LM, Boncelet CG Jr., Retter CT: Spread spectrum image steganography.
*IEEE Transactions on Image Processing*1999, 8(8):1075-1083. 10.1109/83.777088View ArticleGoogle Scholar - Zhang X, Wang S: Steganography using multiple-base notational system and human vision sensitivity.
*IEEE Signal Processing Letters*2005, 12(1):67-70. 10.1109/LSP.2004.838214View ArticleGoogle Scholar - Wang S-H, Lin Y-P: Wavelet tree quantization for copyright protection watermarking.
*IEEE Transactions on Image Processing*2004, 13(2):154-165. 10.1109/TIP.2004.823822View ArticleGoogle Scholar - Lou D-C, Liu J-L: Steganographic method for secure communications.
*Computers and Security*2002, 21(5):449-460. 10.1016/S0167-4048(02)00515-1View ArticleGoogle Scholar - Lin PL, Hsieh C-K, Huang P-W: A hierarchical digital watermarking method for image tamper detection and recovery.
*Pattern Recognition*2005, 38(12):2519-2529. 10.1016/j.patcog.2005.02.007View ArticleGoogle Scholar - Wong PW, Memon N: Secret and public key image watermarking schemes for image authentication and ownership verification.
*IEEE Transactions on Image Processing*2001, 10(10):1593-1601. 10.1109/83.951543View ArticleMATHGoogle Scholar - Chan C-K, Cheng LM: Hiding data in images by simple LSB substitution.
*Pattern Recognition*2004, 37(3):469-474. 10.1016/j.patcog.2003.08.007View ArticleMATHGoogle Scholar - Tseng Y-C, Chen Y-Y, Pan H-K: A secure data hiding scheme for binary images.
*IEEE Transactions on Communications*2002, 50(8):1227-1231. 10.1109/TCOMM.2002.801488View ArticleGoogle Scholar - Westfeld A: F5—a steganographic algorithm.
*Proceedings of the 4th International Workshop on Information Hiding (IH '01), April 2001, Pittsburgh, Pa, USA, Lecture Notes in Computer Science*2137: 289-302.View ArticleMATHGoogle Scholar - Wu D-C, Tsai W-H: A steganographic method for images by pixel-value differencing.
*Pattern Recognition Letters*2003, 24(9-10):1613-1626. 10.1016/S0167-8655(02)00402-6View ArticleMATHGoogle Scholar - Wang C-M, Wu N-I, Tsai C-S, Hwang M-S: A high quality steganographic method with pixel-value differencing and modulus function.
*The Journal of Systems and Software*2008, 81(1):150-158. 10.1016/j.jss.2007.01.049View ArticleGoogle Scholar - Zhang X, Wang S: Efficient steganographic embedding by exploiting modification direction.
*IEEE Communications Letters*2006, 10(11):781-783. 10.1109/LCOMM.2006.060863View ArticleGoogle Scholar - Fridrich J, Goljan M, Du R: Reliable detection of LSB steganography in color and grayscale images.
*Proceedings of the International Workshop on Multimedia and Security, October 2001, Ottawa, Canada*27-30.Google Scholar - Zhang X, Wang S: Vulnerability of pixel-value differencing steganography to histogram analysis and modification for enhanced security.
*Pattern Recognition Letters*2004, 25(3):331-339. 10.1016/j.patrec.2003.10.014View ArticleGoogle Scholar - Lyu S, Farid H: Steganalysis using higher-order image statistics.
*IEEE Transactions on Information Forensics and Security*2006, 1(1):111-119. 10.1109/TIFS.2005.863485View ArticleGoogle Scholar - Lyu S, Farid H: Detecting hidden messages using higher-order statistics and support vector machines.
*Proceedings of the 5th International Workshop on Information Hiding (IH '02), October 2002, Noordwijkerhout, The Netherlands, Lecture Notes in Computer Science*2578: 340-354.View ArticleMATHGoogle Scholar - Chang C, Lin C: LIBSVM: a library for support vector machines. 2001, http://www.csie.ntu.edu.tw/~cjlin/libsvm/Google Scholar

## Copyright

This article is published under license to BioMed Central Ltd. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.