A PALETTE-BASED IMAGE STEGANOGRAPHIC METHOD USING COLOUR QUANTISATION Xuefeng Wang
Zhen Yao
Chang-Tsun Li
Dept. of Computer Science, University of Warwick Coventry, CV4 7AL, United Kingdom Email: {csubao, yao, ctli}@dcs.warwick.ac.uk ABSTRACT In this paper we propose an efficient data embedding algorithm for palette-based images by quantising similar colours in the palette. Unlike previous algorithms, this method’s rate-distortion behaviour is independent from the embedding message, so that given the length of the embedding message, the distortion on the host image can be determined before embedding. Experiments show that our method outperforms previous methods both in terms of PSNR and visual quality. 1. INTRODUCTION Motivated by growing concern about the protection of intellectual property on the Internet and by the threat of a ban for encryption technology, the interest in techniques for information hiding has been increasing over the recent years [6]. The modern formulation of steganography is often given in terms of the prisoner’s problem [9]. By embedding a secret message into a cover image, a stego-image is obtained. It is important that the stego-image does not contain any easily detectable by a warden. The undetectability is directly influenced by the size of the secret message and the format and content of the cover image. Obviously, the less information is embedded into the cover image, the smaller the probability of introducing detectable artifacts by the embedding process. For a more comprehensive review on the topic, see [1, 7]. Compressed image formats have been popular domain of research for steganographic applications [5, 4]. However, limited success has been achieved for palette-based image formats (GIF/PNG). EZ Stego, one of the most popular data hiding schemes for palette-based images proposed by Machado [8], is similar to the commonly used LSB method for 24 bit colour images (or 8 bit grayscale images). After the palette colours are sorted by luminance, it embeds the message into the LSB of indices pointing to the palette colours. Message recovery is simply achieved by selecting the same pixels and collecting the LSBs of all indices to the
ordered palette. Since it is based on the premise that close colours in the luminance-ordered palette palette are close in the colour space. However, occasionally colours with similar luminance values may be relatively far from each other, generating very noticeable artifact. Fridrich [2, 3] presented a steganographic method for hiding message bits into the parity bit of close colours. Although it will never replace a pixel colour by a completely different colour, which could occasionally happen in EZ Stego because ordering of the palette by luminance may introduce discontinuities in neighboring colours. However, the output stego-images generated by Fridrich’s method include false contouring and noise, especially when data is embedded in hand-drawn or cartoon pictures. The rest of the paper is organised as follows. In the next section, we will introduce a new data embedding technique by colour quantisation which significantly outperforms previous techniques. Then experimental results are presented in section 3 and the paper concludes with comments on the proposal and future directions of research. 2. THE PROPOSED METHOD The fundamental motivation for using palette-based image representation is based on the observation that natural images usually use only a small percentage of the available RGB colour space. While many researchers simplify the image model as “piecewisely smooth”, this also suggests that quantisation of colours can be done without severely degrading the image quality, evidently proved by the popularity of PNG format and its predecessor GIF. Such palettebased image formats usually limit the number of colours up to 256, keeping only a third of the colour image data. Although such limitation seems to be a cruel constrain, in most of the cases this is still high enough for a decent approximation of the original full-colour image. The proposed method is akin to the idea of palette-based image format by colour quantisation. However, unlike the quantisation in generating the colour palette, which requires cumbersome computation of centroids in the colour space,
the quantisation is done only by grouping two similar colour entries in the palette into the same colour. For example, if we select two colours a and b with a small distance by the L2 -norm in the colour map (palette), we will then assign a new colour to both of these entries so that they represent one identical colour. We can then assign for instance binary choice 0 to a and 1 to b to represent the stego message. It is apparent that the distortion on the cover image is independent on the embedded data stream, since the distortion is introduced when assigning entry a and b with the quantised colour. Since they are then identical, they can be used interchangably, without affecting the outlook of the image.
2.2. The Extraction Procedure The algorithm to extract the embedded message is relatively simple, as long as we can identify the colour grouping configuration. This is straightforward because palette entries in the same group are quantised into one colour. The procedure for extracting the message is as follows: 1. Initialise the colour table B with all 256 colour entry numbers. 2. Find two colours i, j ∈ B (i < j), which P(i) = P(j), and add the ordered-pair (i, j) into the configuration set A and remove i, j from B.
2.1. The Embedding Procedure
3. Iteratively repeat step 2 until no such pair can be found.
For a palette-based image X with the colour map, a set of RGB colour triplets P = {(r1 , g1 , b1 ), ..., (rn , gn , bn )} and the embedding binary secret message M , such that |M )| ≤ |X|, (|·| denotes the length) equal to the length of the image, the embedding algorithm works in 5 steps:
4. For every pair (i, j) ∈ A, we replace i on X with bit 0, and j with bit 1.
1. Initialise the colour table B with all 256 colour entry numbers. 2. Find two colour indices i, j ∈ B such that i < j, such that ∀x, y ∈ B, RISK(i, j) ≤ RISK(x, y), where the RISK(·, ·) is the risk function which represents certain tradeoff by quantising these two colours, and remove i, j from the set B. We add the ordered-pair (i, j) into the configuration set A and mark all positions on X with i and j as “embeddable”.
5. Read these bits out as the message M . 2.3. Choice of the Risk Function Since we group two colours at a time, in order to get the full capacity from the image X, we need to quantise the colour map into half of its original palette entries so that X is everywhere embeddable. Normally with a 256-colour image format, the choice of grouping them into 128 colours are really arbitrary. The total number of choices are 127 Y
(2n + 1) ≈ 6.537 × 10252 .
n=1
3. Calculate the new quantised colour by cˆij =
P(i)ξ(X, i) + P(j)ξ(X, j) . ξ(X, i) + ξ(X, j)
(1)
which is basically a weighted interpolation between P(i) and P(j), where ξ(X, c) denotes the number of occurrences of colour c on image X. We will then set P(i) = P(j) = cˆij . 4. The vacated capacity by quantising the two colours is the total number of those two colours on X, Ξij = ξ(X, i) + ξ(X, j). Then the total capacity for configuration A is X Ξij . (2) C= (i,j)∈A
This is prohibitively large for us to find an optimal solution which minimises the distortion. In our algorithm, as the reader have probably noticed, the solution is greedy, largely relying on the design of the risk function. A naive choice of the risk function would be the L2 -norm distance between two colours. However, since the algorithm is greedy, it may end up with having too many groups of colours with small distances but also small capacity Ξ. Having less choices of colour in the end, two very different colours might be grouped together while they occupy a significant portion on the image. While it is almost certain that significantly different colours will be grouped eventually, we need to make sure that they are scarse therefore the lowpass-property of the human visual system can suppress their negative effect. The risk function we use is defined as follows:
If C < |M |, go to step 2 to group more colour entries. RISK(i, j) = 5. For every embeddable position on X, the colour entry number is denoted as x. We look for the pair (i, j) ∈ A which either i = x or j = x. If the message bit to be embedded is 0, then replace x with i, or j if otherwise.
log(kP(i) − P(j)k)Ξij . |X|
(3)
The risk function defined in equation (3) tends to select the combination which has small distance as well and a large capacity. The log operator serves as an asymptotic term which decays rapidly so that it puts more weights on
smaller distances. The function is normalised so that it is always between [−1, 0].
65 lenna mandrill mushroom eagle
60
55
50
45
40
35
30
0
20
40
60 80 Number of groupings
100
120
140
(a) Distortion curve with different number of groupings. 5
3
x 10
2.5
Capacity (bit)
2
1.5
1 lenna mandrill 0.5
mushroom eagle
0
0
20
40
60 80 Number of groupings
100
120
140
(b) Curve for capacity by different number of groupings. 0.25
0.2
RMS
0.15
0.1
0.05
0
0
20
40
60
80
100
120
140
Group
(c) RMS measure within each groups for lenna. 8000
7000
6000
5000 Capacity (bit)
We performed our experiments on several palette-based colour images, lenna, mandrill, mushroom and eagle, all at size 512 × 512. One of the advantages of the proposed scheme is, given the length of the message, the distortion on the cover image is independent from the content of the message. Therefore the rate-distortion behavior for a certain image can be determined before embedding. Figure 1.(a) shows the PSNR curves for those four images with the number of colour groups progressively increases, and Figure 1.(b) are the capacity curves, showing how many bits are available at each grouping which eventually reaches the full capacity when all colours are being grouped. It is also interesting to see whether the chosen risk function is effective. This can be verified by looking at the L2 -norm distance kP(i) − P(j)k and Ξij between a group (i, j). As stated before, we want to find groups with large Ξij to have smaller distances and ultimately to have groups with larger distances with fewer number of occurrence. Figure 1 (c) and (d) are the plots of L2 -norm (RMS) and capacity for each of the colour groups chosen by the greedy algorithm with our proposed risk function on lenna. Evidently we see that the distances according to the error metric are relatively small for almost all groups, except the last grouping, since they are the only two colours left in B. The capacities of these chosen groups approximately follow an exponential decay with small fluctuations, while the first group has the largest population. Comparing with the EZ-stego and Fridrich’s method, the proposed algorithm outperforms them by quite a margin. Table 1 shows the PSNR values for these three different techniques when a 512 × 512 binary image is embedded as the message, ie. the full capacity of the cover image is being used. The advantage of the proposed method is significant, consistently produce PSNR values larger than 30 dB. Visually, the proposed algorithm has fewest artifact on the image. Even when full capacity is used, the output image still is visually identical to the original, while other two methods yield visible degradation, which may raise attackers’ suspicion. A comparative example of image mushroom can be found in Figure 2.
PSNR (dB)
3. EXPERIMENTAL RESULTS
4000
3000
2000
1000
0
4. CONCLUSIONS AND FUTURE WORK
0
20
40
60
80
100
120
140
Group
(d) Capacity for individual groups for lenna. In this paper we have described a novel algorithm for embedding data into palette-based images via grouping similar colours together and quantise them into one colour. The proposed method yields visually non-intrusive images even
Fig. 1. Rate-distortion behaviors for selected groups by the risk function.
(a)
(b)
(c)
(d)
Fig. 2. An example to illustrate the steganographic methods. (a) Original image mushroom of size 512 × 512 (b) stegoimage obtained using EZ Stego method. (c) stego-image obtained using Fridrich’s Stego method. (d) stego-image obtained using the proposed method.
Image mushroom mandrill eagle lenna
EZ-Stego 19.03 17.45 26.49 25.23
Fridirich’s 27.31 31.46 38.22 35.58
Proposed 36.07 32.58 41.25 37.51
Table 1. Comparative PSNR results for images with maximum capacity message.
maximum capacities of the host images are used, significantly improves previous proposed methods. Certainly, different choices of grouping for quantisation will have significantly different impacts on the resulting image’s quality, a systematic way of selecting those groups which can minimise the distortion is desirable. However, due to the large space of potential groupings, finding the optimal solution to the problem is not practical. Instead, here we used a greedy approach and with a carefully chosen risk function, the method can achieve near-optimal performance. Within this broad principle, this method certainly allows a variation of themes. First, instead of quantising two colours into one, we can “push” those two colours close enough to be visually indifferent, this can reduce the chance of raising suspicion in attackers’ inspection. Second, on the choice of risk function, we shall see if any other risk functions can generate better results and whether there is “optimal” risk function in certain sense. Third, when the embedding message’s length is smaller than the capacity of the host image, it leads to another interesting problem, that is, if the length of embedding message is only 1 bit, but the chosen group’s capacity is very large, since once the palette entries are changed, all pixels related to the palette entries are all affected which could be a waste for a short length of message. Therefore it is more appropriate to select another group with a suitable size of capacity. We are currently in-
vestigate these open questions. 5. REFERENCES [1] R.J Andersen and F.A.P Petitcolas. On the limits of steganography. IEEE Journal of Selected Areas in Communications, Special Issue on Copyright and Privacy Protection, 16(4):474–481, 1998. [2] Jiri Fridrich. A new steganographic method for palettebased images. In Proceedings of the IS&T PICS conference, pages 285–289, Savannah, Georgia, April 1998. [3] Jiri Fridrich and Du Rui. Secure steganographic methods for palette images. In Inter’l Workshop on Information Hiding, pages 47–60, 1999. [4] N.F. Johnson and S. Jajodia. Exploring steganography: seeing the unseen. In IEEE Comput., pages 26–34, February 1998. [5] N.F. Johnson and S. Jajodia. Steganalysis of images created using current steganography software. In Proc. the Second Inform. Hiding Workshop LNCS, volume 1525, pages 273–289. Springer-Verlag, 1998. [6] D. Kahn. The history of steganography. In R. Anderson, editor, 1st Information Hiding Workshop, Lecture Notes in Computer Science, volume 1174, pages 1–5. Springer-Verlag, 1996. [7] Mehdi Kharrazi, Husrev T. Sencar, and Nasir Memon. Image steganography: Concepts and practice. 2004. [8] R. Machado. Ez stego. http://www.stego.com. [9] Gustavus J. Simmons. The prisoners’ problem and the subliminal channel. In Advances in Cryptology: Proceedings of Crypto 83 (David Chaum, ed.), pages 51– 67. Plenum Press, 1984.