Two-in-One Image Steganography Using Error Di ﬀ usion

: Image steganography is a technique for concealing a secret message in a cover image unobtrusively. The resultant images are called the stego images. In this paper, we propose a method for concealing a secret image into a cover image of the same size, where the most signiﬁcant bits (MSBs) of the secret image are embedded in the least signiﬁcant bits (LSBs) of the cover image after the reversal of the order of the bit sequences. Such a symmetric relationship between MSBs and LSBs derives a complementary between the stego and extracted secret images. We also propose a method for improving the image quality of both stego and extracted secret images by using an error di ﬀ usion technique. Experimental results show that the proposed method works well for both grayscale and color images, and the proposed error di ﬀ usion method can suppress the noises like false contours caused in the embedding process visually and quantitatively.


Introduction
The developments of information technology in recent years have demanded secure communication among the information technology equipments and the users. Hiding information, such as copyright messages and serial numbers, is a promising technique for information security, and has recently become important in a number of application areas [1]. Information hiding techniques include two subdisciplines: watermarking and steganography [2]. In watermarking, hidden information in a carrier signal should have a relationship with the carrier signal, e.g., watermarking can be applied to ownership assertion, transaction tracking and content authentication of the carrier signal [3]. On the other hand, in steganography, hidden information has no relationship with the carrier signal generally, and the presence of the hidden information is hidden [4].
Steganalysis is a counterpart of steganography, and has been extensively studied in the last decade [5]. Xia et al. proposed an improved version of Gabor filter residual (GFR) steganalysis [6]. Qian et al. proposed a paradigm for steganalysis to learn features automatically via deep learning models [5]. Agarwal and Farid detected manipulations such as insertion, removal, rotation and airbrushing from JPEG dimples [7].
Digital images are one of the potential candidates for the carrier signal in information hiding, because digital images have high redundancy, where we can embed secret messages, and pervasive applications in daily life [8]. Therefore, image steganography has lately attracted much attentions from researchers, and a number of standard methods for image steganography have been presented thus far [9]. Among spatial domain steganography [2], the least significant bit (LSB) steganography [10] is a well-known approach, and has a number of its variants such as the enhanced LSB steganography [11] and the modified LSB algorithm [12]. Hadidi and Ibrahim proposed a 4-LSB method which uses 4 LSBs of 24-bit true color image for hiding text message [13]. Baluja proposed the deep steganography which attempts to place a full size color image within another image of the same size with deep neural networks [14].
The above image steganography methods conceal secret messages including images to produce stego images. As a result, the produced stego images are changed from the original cover images, i.e., the cover images are corrupted in the process of embedding secret messages. This observation motivated us to alleviate the error in the stego images using an image processing technique.
In this paper, we propose a two-in-one image steganography method which conceals a secret image into a cover image of the same size in an LSB steganography approach, where 4 most significant bits (MSBs) of the secret image are embedded in the corresponding 4 LSBs of the cover image after the reversal of the order of the bit sequence of the 4 MSBs. Such a bitwise operations cause the change of pixel values, which may be noticeable visually. To alleviate the noticeable error between the original and the changed pixel values, we introduce an error diffusion technique, which improves the image quality of the stego and extracted secret images. Experimental results show that the proposed method can conceal a secret image into a cover image for both grayscale and color images, and the image quality of the stego and extracted secret images is improved by the proposed error diffusion method.
The rest of this paper is organized as follows: Section 2 proposes a two-in-one image steganography method for grayscale and color images. Section 3 shows experimental results. Section 4 discusses the results. Finally, Section 5 concludes this paper.

Proposed Two-in-One Image Steganography
In this section, we first describe our two-in-one image steganography method for grayscale images, and then describe that for color images.

Grayscale Image Steganography
Let F = [ f i j ] and G = [g i j ] be two grayscale images, where f i j and g i j denote the pixel values at the position (i, j) in F and G, respectively, for (i, j) ∈ Ω where Ω = {1, 2, . . . , m} × {1, 2, . . . , n} where × denotes the Cartesian product of two sets, and m and n denote the numbers of rows and columns, respectively. The procedure of the proposed grayscale image steganography is divided into two parts: bitwise operations and error diffusion as follows.

Bitwise Operations
Assume that F and G are cover and secret images, respectively, and f i j and g i j are expressed in the decimal system, i.e., f i j ∈ {0, 1, . . . , 255} and g i j ∈ {0, 1, . . . , 255} for 8-bit images. To show explicitly that f i j is a decimal number, we use the expression ( f i j ) 10 . Then we convert ( f i j ) 10 into the corresponding bi- For notational convenience, we introduce an abbreviation as follows: b F 1: We also convert (g i j ) 10 , and combine it with b F 1:4 as (b F 1:4 b G 4:1 ) 2 which is converted into the decimal number as (h F i j ) 10 = (b F 1:4 b G 4:1 ) 2 as shown in Figure 1. This procedure is performed for all pixels. As a result, we obtain the stego image H F = [h F i j ] which appears to be similar to F, but conceals a partial information of G in it. The procedure for extracting the concealed secret image from the stego image H F is as follows: First, we convert the decimal pixel value (h F i j ) 10 of H F into the binary number (b F 1:4 b G 4:1 ) 2 , and then reverse the order of the bit sequence to obtain the decimal number (h G i j ) 10 = (b G 1:4 b F 4:1 ) 2 . Performing this procedure for all pixels, we obtain the extracted secret image H G = [h G i j ] as shown in Figure 1. In this method, the relationship between the stego and the extracted secret images, H F and H G , is complementary to each other, i.e., when we view the stego image, the secret image is concealed in the stego image, on the other hand, when we view the extracted secret image, the stego image, which looks like the cover image, is concealed in the extracted secret image. Therefore, it is sufficient to save either H F or H G , because the one of them can be produced from the other by reversing the order of every bit sequence. The algorithm for reversing the order of a bit sequence is summarized in Appendix A.

Error Diffusion
The above bitwise operations embed 4 MSBs of a secret image in 4 LSBs of a cover image to produce a stego image. Therefore, the information in 4 LSBs of both cover and secret images is lost, that causes the deterioration of image quality in both cover and secret images. In this section, we propose a method for improving the image quality by using an error diffusion technique, which is a well-known technique in digital halftoning [15].
The proposed error diffusion method processes every pixel in a left-to-right raster scan order. Figure 2 illustrates a moment when the pixel (i, j) colored in green is now being processed, where the shaded portion denotes that the pixels have already been processed, and white pixels denote unprocessed ones. In this situation, if the green pixel is on the border of an image, then a portion of the 3 × 3 mask illustrated in Figure 2 will go outside of the image region. In such cases, we would like to discard the errors going outside of the image region for computational simplicity and efficiency. Assume that the pixel value f i j at the position (i, j) in F is changed into h F i j by the above bitwise operations. Then we define the error between f i j and h F i j by which can be interpreted as an error between the cover and stego images. Similarly, we define the error between g i j and h G i j by which can be interpreted as an error between the original secret and extracted secret images. These errors in (1) and (2) are diffused into the unprocessed neighboring pixels in F and G, respectively, where we would like to use the error diffusion coefficients presented by Floyd and Steinberg [16] as shown in Table 1, where '-' and '#' denote the processed and current pixels, respectively, and only unprocessed pixels have the positive values: w 0,1 , w 1,−1 , w 1,0 and w 1,1 . The pixel values of unprocessed pixels are updated as follows: where k and l are the indices in w k,l given by (k, l) ∈ D, where D is a set of pairs of two indices defined by D = {(0, 1), (1, −1), (1, 0), (1, 1)}, for indexing the unprocessed neighboring pixels at any position (i, j) in F or G, and w k,l denotes the error diffusion coefficients given in Table 1. - After the update of the pixel values by (3) and (4), we proceed to the next pixel, where the bitwise operations are executed for the updated pixel values of f i j and g i j . Such a procedure is applied to all pixels in F and G in the raster scan order. We summarize this error diffusion procedure for grayscale images in Algorithm 1, which is the proposed encoding algorithm, and the decoding algorithm is given by Algorithm 5 in Appendix A.

Algorithm 1
Input: two grayscale images F = [ f i j ] and G = [g i j ] for cover and secret images for j ← 1 to n do 3.
Round f i j to 8-bit integer.
Compute the error between f i j and h F i j by Compute the error between g i j and h G i j by In this algorithm, the output stego The procedure for extracting the concealed secret imagẽ i j ] from the stego imageH F is the same as that for extracting H G from H F , and is summarized as follows: For every pixel value (h F i j ) 10 ofH F , the order of the bit sequence Reverse the order of (b F 1: The above simple operation for reversing the order of the bit sequence at each pixel can extract the concealed secret image successfully, because the proposed error diffusion procedure in Algorithm 1 takes into account both the stego and concealed secret images simultaneously and equally.

Color Image Steganography
The adaptation of the above grayscale image steganography method to color images is straightforward; R, G and B channels are processed in parallel by Algorithm 1. After that, the processed three channels are combined into a color image. However, such parallel processing requires three times of implementation of the error diffusion procedure for each color image. Alternatively, it may be useful that the procedure is described with vectors for array programming such as MAT-LAB and Python. In this section, we would like to describe the proposed color image steganography method with vectors in detail, where the error diffusion procedure is implemented only once.
Let F = [ f i j ] and G = [g i j ] be two color images, where f i j and g i j denote the color pixel values at the position (i, j) in F and G, respectively, and have the following expressions: denote the red (R), green (G) and blue (B) values of the pixel in F (G), respectively. The procedure of the proposed color image steganography is also divided into two parts: bitwise operations and error diffusion as follows.

Bitwise Operations
Assume that F and G are cover and secret images, respectively, and the elements of f i j and g i j are expressed in the decimal system, i.e., f X i j ∈ {0, 1, . . . , 255} and g X i j ∈ {0, 1, . . . , 255} for X ∈ {R, G, B} for 24-bit color images. We first convert each element ( f X i j ) 10 of f i j into the corresponding binary num- Similarly, we also convert (g X i j ) 10  This procedure is performed for all pixels. As a results, we obtain the color , which appears to be similar to F, but conceals a partial information of G in it.
The procedure for extracting the concealed secret image from the stego image H F is as follows: For each X ∈ {R, G, B}, we convert the decimal pixel value (h FX i j ) 10 of H F into the binary number (b FX 1:4 b GX 4:1 ) 2 , and then reverse the order of the bit sequence to obtain the decimal number (h GX i j ) 10 = (b GX 1:4 b FX 4:1 ) 2 . Performing this procedure for all pixels, we obtain the extracted secret image In this method, the relationship between the color stego and the extracted color secret images, H F and H G , is also complementary to each other, i.e., when we view the color stego image, the color secret image is concealed in the color stego image, on the other hand, when we view the extracted color secret image, the color stego image, which looks like the color cover image, is concealed in the extracted color secret image. Therefore, it is enough to save either H F or H G , because the one of them can be produced from the other by reversing the order of every bit sequence.

Error Diffusion
We also improve the image quality of the above color stego image H F = [h F i j ] and extracted secret image H G = [h G i j ] by using an error diffusion method as well as the grayscale version.
Assume that the color pixel value f i j at the position (i, j) in F is changed into h F i j by the above bitwise operations. Then we define the error between f i j and h F i j by which can be interpreted as an error between the color cover and stego images. Similarly, we define the error between g i j and h G i j by which can be interpreted as an error between the original color secret and extracted secret images. These errors in (5) and (6) are diffused into the unprocessed neighboring pixels as well as the above error diffusion procedure for grayscale images as follows: g i+k, j+l ← g i+k, j+l + w k,l e G i j , where w k,l for (k, j) ∈ {(0, 1), (1, −1), (1, 0), (1, 1)} denotes the error diffusion coefficients in Table 1.
After the update of the color pixel values by (7) and (8), we proceed to the next pixel, where the bitwise operations are executed for the updated color pixel values of f i j and g i j . Such a procedure is applied to all color pixels in F and G in the raster scan order. We summarize this error diffusion procedure for color images in Algorithm 3.

Algorithm 3
Input: two color images F = [ f i j ] and G = [g i j ] for cover and secret images for j ← 1 to n do 3.
Round f X i j to 8-bit integer.

5.
Round g X i j to 8-bit integer. 6.
Compute the error between Compute the error between In this algorithm, the output stego imageH , which is computed without error diffusion, by '˜' (tilde).
The procedure for extracting the concealed secret imagẽ H G from the stego imageH F produced by Algorithm 3 is the same as that for extracting H G from H F , and is summarized as follows: For every color pixel value (h FX i j ) 10 ofH F for X ∈ {R, G, B}, the order of the bit sequence (b FX 1:4 b GX 4:1 ) 2 converted from (h FX i j ) 10 is reversed to obtain the corresponding color pixel value (h GX i j ) 10 = (b GX 1:4 b FX 4:1 ) 2 ofH G for X ∈ {R, G, B}. This procedure is described in Algorithm 4.

Algorithm 4
Input: for j ← 1 to n do 3. for Reverse the order of (b FX 1:4 b GX 4:1 ) 2 as (b GX 1:4 b FX 4:1 ) 2 by Algorithm 5; 6. Convert As well as Algorithm 2, the above simple operation for reversing the order of the bit sequence at each pixel and color channel can also extract the concealed secret color image successfully, because the proposed error diffusion procedure in Algorithm 3 takes into account both the stego and concealed secret color images simultaneously and equally.

Experimental Results
In this section, we show experimental results on the standard image database, SIDBA [17] (it can be downloaded from http://www.ess.ic.kanagawa-it.ac.jp/app_ images_j.html), in which the number of pixels in each image is 256 × 256 for both grayscale and color images. We first show the results of grayscale image steganography, and then show the results of color image steganography.  Figure 3(b) without error diffusion. From the stego image H F in Figure 3(b), we can extract the concealed secret image H G as shown in Figure 3(e) by reversing the order of bit sequences. On the other hand, if we feed the input images F and G into Algorithm 1, then we obtain the stego imageH F in Figure 3(c), from which we can extract the concealed secret imageH G in Figure 3(f) by Algorithm 2. The stego and the extracted secret images H F and H G produced without error diffusion procedure in Figures 3(b) and (e) have conspicuous noise like false contours [18]. On the other hand, using error diffusion procedure, we have visually preferable results in Figures 3(c) and (f), where the noises are suppressed well.

Grayscale Image Steganography
In order to show this effect of the error diffusion procedure more clearly, we zoomed the parts of Figures 3(a), ( Figure 5 shows an example of the proposed two-in-one color image steganography, where Figures 5(a) and (d) show the input cover and secret images, which are combined into the stego image H F in Figure 5(b) without error diffusion. From the stego image H F in Figure 5(b), we can extract the concealed secret image as shown in Figure 5(e) by reversing the order of bit sequences. On the other hand, if we feed the input images in Figures 5(a) and (d) into Algorithm 3, then we obtain the stego imageH F in Figure 5(c), from which we can extract the concealed secret imageH G in Figure 5(f) by Algorithm 4. The stego and the extracted secret images H F and H G produced without error diffusion procedure in Figures 5(b) and (e) have conspicuous noise like false contours [18] as well as the above results for grayscale images. On the other hand, using error diffusion procedure, we have visually preferable results in Figures 5(c) and (f), where the noises are suppressed well.

Color Image Steganography
In order to show this effect of the error diffusion proce- Next, we show the results of quantitative evaluation of image quality using the structural similarity (SSIM) index [19], the mean squared error (MSE) and the signalto-noise ratio (SNR) in Figure 7 including the results in Figures 3 and 5, in the left part of which, six pairs of the original color and grayscale images are selected from the SIDBA image database [17] as cover and secret images. The resultant stego and extracted images by the proposed algorithm without error diffusion and that with error diffusion are shown in the middle and right parts of Figure 7, respectively, with the corresponding SSIM, MSE and SNR values shown on the right sides of the images. For computing those values in Figure 7, we first smoothed the input and output images by Gaussian filter with the standard deviation 1.5, and then computed the SSIM, MSE and SNR values between the smoothed images. The smoothing by Gaussian filer is necessary for valid evaluation of image quality, which agrees with the evaluation based on human visual system. For all pairs in Figure 7, the evaluated values are improved (SSIM and SNR are increased, and MSE is decreased) by the proposed error diffusion method, which demonstrates the effectiveness of the proposed method.
Next, we show the results with other image dataset selected from the Image Processing Toolbox for MATLAB in Figure 8, where six pairs of the original color and grayscale images are shown in the left part, and the middle and right parts show the corresponding stego and extracted secret images with their quantitative evaluation results. As well as the results in Figure 7, we also observed in Figure 8 that the proposed error diffusion method improved the image quality for both the stego and extracted secret images.

Discussion
In the above experimental results, we have demonstrated the function of the proposed image steganography method for grayscale and color images. As well as Hadidi and Ibrahim's method [13], we used 4 LSBs for embedding secret information, which is an image of the same size as a cover image in our setting. That is, the proposed method maximally utilizes 4 LSBs of a cover image for embedding 4 MSBs of a secret image, which brings about a complementary between the stego and extracted secret images. In other words, two images, cover and secret images, are combined into one image, stego or extracted secret image, in which the one is given by reversing the order of the bit sequences of the other. Therefore, it is sufficient for users to save either the stego or the extracted secret image. In our future work, we would like to compare the proposed method with other image steganography methods which hide a fullsize image into a carrier image as well as Baluja's deep steganography [14].
Furthermore, we improved the image quality of the stego and extracted secret images by using an error diffusion method. For a typical instance of existing error diffusion methods, we used the error diffusion coefficients proposed by Floyd and Steinberg [16] in Table 1. However, the other error diffusion coefficients may suitable for the proposed two-in-one image steganography. Our future research will include the optimization of the error diffusion coefficients for the proposed two-in-one image steganography. Moreover, the steganalysis for the proposed steganography method will also be our future work, where structural steganalysis methods [20] including RS [21] and WS [22] may be applicable.
The limitation of the proposed method is the robustness to lossy image compression such as JPEG, which will mainly distort the secret image embedded in the stego image by the proposed method. To alleviate this kind of distortion, we are planning to improve the proposed method to more robust one by reordering the bit sequence. The proposed error diffusion method can also be used in the improved version of the proposed method.

Conclusions
In this paper, we proposed an image steganography method for concealing a secret image into a cover image of the same size. The proposed method is based on a least significant bit (LSB) approach, where the most significant bits (MSBs) of the secret image are embedded in the LSBs of the cover image after the reversal of the order of the bit sequences. The concealed secret image can be extracted by reversing the order of every bit sequence converted from each pixel value of the stego image. That is, the reversal of the order of bit sequences switches the role of LSBs and MSBs in the proposed image steganography method. Furthermore, we proposed a method for improving the image quality of both stego and concealed secret images by using an error diffusion method. Experimental results revealed that the proposed method can be used for both grayscale and color image steganography, and the proposed error diffusion method improves the image quality of both stego and extracted secret images visually and quantitatively.