Hybrid Data Hiding Based on AMBTC Using Enhanced Hamming Code

: We present a method of effectively concealing data in two quantization levels representing blocks based on Absolute Moment Block Truncation Coding (AMBTC) using Hamming code. The reason for choosing AMBTC as the cover media is that AMBTC is not only easily compressible by simple arithmetic operations, but is also efﬁcient for exchanging data in small portable terminals, such as smart devices, because compression efﬁciency and image quality are satisfactory. AMBTC is expressed in the form of a trio ( a , b , BM ) , where a and b are quantization levels and BM is a bitmap. The quantization level is a pixel value used as a representative value when dividing an image into 4 × 4 blocks. Bai & Chang introduced a method of hiding data using Hamming code. However, this method presented a problem with efﬁciency compared to the existing methods. In this paper, in order to improve the problem of this method, we minimize the error that occurs when concealing the data using the optimized Hamming code lookup table. We veriﬁed that the performance of the proposed method is satisfactory in terms of embedding capacity and quality of the image through sufﬁcient experimental results.


Introduction
Recently, the Internet space is like a single trading world where almost all digital contents are distributed because every trading system is connected to high speed Internet like 5G. Many people distribute digital contents in this space and are constantly consuming digital contents. The problem with this digital space is that a copyright protection problem occurs because digital contents are easily redistributed, copied, and modified by illegal users. There are various solutions to this problem, but the commonly used method is digital watermarking [1][2][3], which is used to protect the integrity and reliability of digital media.
Besides the watermarking technology, the data hiding (DH) technology is the most commonly used method of concealing information in digital media. The DH [4][5][6] technique can be used to various fields, such as digital signatures, fingerprint recognition, authentication, and secret communication. It is proved various times that DH could be used for secret communication as well as protection of the copyright of digital contents. The people who use Internet communication know that Internet is not a fully protected communication channel due to a lot of attackers. But secret communication using DH can safely protect secret messages in digital cover media from incomplete Internet channel. 3 of 16 sub-divided less complex block and highly complex block. In 2016, Malik et al [27] introduced a DH based on AMBTC using 2-bit plane and 4 quantization levels. The merit of this method is high payload, and the demerit is to decrease the compression rates.
In this paper, we intend to propose a method to increase the image quality and DH capacity by minimizing the distortion of the cover image by improving the method of Bai and Chang (2016) [20]. Their DH method applies Hamming code to the codeword, where the 7-bit codeword is constructed by using two quantization levels. When the Hamming code method is used for the quantization level, image distortion can increase significantly compared to the existing methods. To solve this problem, we had studied Hamming code theories. As a result, we found an optimized method of the Hamming code to reduce errors using look up table. Our proposed method is to find the codeword with the smallest error in the code word list and applies the Hamming code to the both quantization levels. To this end, our method calculates the codeword corresponding to the minimum distance from the standard array of the (7,4) Hamming code table, and then extracts the corresponding code. The method has little effect on program performance and can be easily conducted. The minimum distance of our proposed Hamming coding may improve the performance of DH and is expected to be actively used in other studies. Experimental results show that the proposed method achieves higher payload and better image quality compared to the existing DH methods.
The rest of this paper is organized as follows. Section 2 gives the introduction of related works. The proposed method is described in detail in Section 3. The experimental results are analyzed in Section 4. Section 5 draws the conclusion.

AMBTC
Absolute Moment Block Truncation Coding(AMBTC) [15] efficiently improves the computation time of Block Truncation Coding (BTC) and improves the image quality over BTC. The basic configuration of one block in AMBTC is two quantization levels and one bitmap, while one block is compressed by preserving the moment. Here, the two quantization values are obtained by calculating the higher mean and the lower mean of each block. For AMBTC compression, the gray image is first divided into (k × k) blocks without overlapping, where k can determine the compression level by (4 × 4), (6 × 6), (8 × 8), etc. AMBTC adopts block-by-block operations. For each block, the average pixel value is calculated byx where x i represents the i th pixel value of this block with the size of k × k. All pixels in this block is quantized into a bitmap b i (0 or 1). That is, if the corresponding pixel x i is greater than or equal to the average (x), it is replaced with '1', otherwise it is replaced with '0'. Pixels in each block are divided into two groups of '1' and '0'. The symbol t and k 2 − t refer to the numbers of pixels in the '0' and '1' groups respectively. The means a and b of the two groups indicate the quantization levels of the groups '0' and '1'. The two quantization levels are calculated by Equations (2) and (3).
where a and b are also used to reconstruct AMBTC.
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 5 July 2020 doi:10.20944/preprints202007.0067.v1 The bitmap is obtained from Equation (4) and the compressed block is simply uncompressed by using Equation (5). That is, the compressed code unit, trio(a, b, BM), may be obtained by using Equations (2)- (5). The image block is compressed into two quantization levels a, b, and a bitmap BM, and can be represented as a trio(a, b, BM). A bitmap BM contains the bit-planes that represent the pixels, and the values a and b are used to decode the AMBTC compressed image by using equation (5).

Example 1:
Here, we describe the encoding and decoding procedure of one block of a grayscale image using an example. Figure 1(a) is a grayscale block and the mean value of pixels is 106. By applying Equations (2),(3) and (4) on (a), we can obtain the bitmap as shown in (b) and two quantization levels (a = 102; b = 107). The basic unit of each block is trio(a, b, BM) = (102, 107, 0101111111011001). Using the information of the trio and Equation (5), the decoded grayscale block in (c) is reconstructed.

Hamming code
Hamming code (HC) [28] is a single error-correcting linear block code with a minimum distance of 3 for all the codewords. In HC(n, k), n is the length of the codeword, k is the number of information bits and (n − k) is the number of parity bits. Let x be a k bit information word. The n-bit codeword y is created by using y = xG, where G is the k × n generator matrix. Let e = y −ỹ be the error vector that determines whether an error occurred while sending y. If e = 0, no error occur andỹ = y.
Otherwise, the weight of e represents the number of errors. Let H be a (n − k) × n parity matrix with the relation of G · H T = [0] k×(n−k) . Let we assume that the codewordỹ has an error like e = (y −ỹ). In this case, we could correct 1-error (e = y ⊕ỹ) from the codewordỹ by using the syndrome S =ỹ · H T , where the syndrome denotes the position of the error in the codeword. As show in Equation (6), the error e can be obtained.
Consider HC (7,4) code with the following parity matrix. For example, assuming that one error bit occurred in y (e.g., the second bit from the left in e = (e 1 , e 2 , . . . , e 7 ) = (0100000), we may obtain the error position and recover the 1-bit error from the codeword y by using calculation of syndrome S(= y · H T = (010)).

Bai and Chang's method
For DH, AMBTC algorithm is applied to the original cover image to obtain a low mean, a high mean and a bitmap for every block. Then, the secret message is concealed into the AMBTC compressed trio(a, b, BM). The merit of AMBTC is to achieve a higher payload compared to other data hiding schemes performed on the compression domain. Here, it is performing AMBTC DH as two phases . The method proposed by Bai and Chang is composed of two stages. One of them is to embed 3-bit in two quantization levels in trio(a, b, BM) by using HC (7,4). The detailed process of this method is as follows.
Step 1: Column vector y = (y 7 , y 6 , y 5 , y 4 , y 3 , y 2 , y 1 ) is constructed by extracting 4 LSBs of the low mean a and 3 LSBs of the high mean b. Three secret message bits (m = (m 1 , m 2 , m 3 )) are read from the secret bit set M.
Step 2: Compute the syndrome S(= Hy ⊕ m) of the codeword y and then the value is changed into decimal value and assigned to the variable i. For obtaining the stego codewordŷ = (y 1 , y 2 , y 3 , y 4 , y 5 , y 6 , y 7 ), flip i th bit of the codeword y.
Step 3: To reconstruct two quantization levels with the codeword y, (y 7 , y 6 , y 5 , y 4 ) is replaced with 4 LSBs of the low-mean value a and (y 3 , y 2 , y 1 ) is replaced with 3 LSBs of the high-mean value b. Step 4: It is possible to hide additional 1-bit by using the order of two quantization levels and the difference between them. In this case, it may be accepted to embed additional 1-bit when the criterion (b − a ≥ 8) is satisfied. Otherwise, it is not accepted to embed additional 1-bit. If the bit to be embedded is '1', swap the order of two quantization levels as (trio(b, a, BM)), otherwise none change is conducted.
In Step 4, it is possible to embed additional 1-bit only under the given condition (b − a ≥ 8). The reason for the condition is necessary, if the difference between the values of a and b is small, the order of the two values may be reversed as a result of the computation of the Hamming code. It is able to happen ambiguous result in the decoding procedure.

The Proposed Scheme
In this section, we introduce a DH to embed secret data in bitmaps and quantization levels of AMBTC using optimized Hamming code and DBS method. First, compressed blocks, trios, are classified into smooth blocks and complex blocks. Then, DBS is applied to the bitmaps of the smooth blocks, meanwhile Hamming code may be applied to the quantization levels regardless of the block characteristics. The method proposed by Bai and Chang has very large distortion of the cover image. In Section 3.1, we introduce the way to solve this problem.

Embedding Procedure
We introduce a way of DH using Hamming code, DBS, and OTQL based on AMBTC, and explain the detail procedure step by step as follows. Additionally, the flowchart of the embedding process is described in Figure 2.
Input: Original grayscale image G with a size of N × N, threshold T and secret data M = (m 1 , m 2 , . . . , m n ). Output: Stego AMBTC trios Step 1: The original image G is divided into 4 × 4 non-overlapping image blocks.
Step 2: The trio(a, b, BM) of the AMBTC, i.e. the compressed codes, is obtained according to Equations (1)-(4), where a and b are the lower and the higher quantization levels, respectively, and BM is the bitmap.
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 5 July 2020 doi:10.20944/preprints202007.0067.v1 Step 3: The quantization levels are a = (a 8 a 7 . . . a 1 ) and b = (b 8 b 7 . . . b 1 ), where a 8 is the most significant bit (MSB) of a and a 1 is the LSB of a. Similarly, b 8 is the MSB of b and b 1 is the LSB of b. The rearranged 7-bit codeword is obtained by where symbol || denotes concatenation. Note that, a 4 and b 1 are the MSB and LSB of the rearranged pixel y, respectively.
Step 4: Codewords matching m i+2 i bits can be obtained from the lookup table (LUT) by comparing in order (see Figure 3). In other words, it may get the codeword by converting m to decimal d and then searching for the coset reader that matches d in Figure 4 To compute minimum distance between two codewords, y and searched codewords, Equation (9) may be used. When a codeword matched minimum distance is obtained, new codeword h is constructed like (a ||b ). After then, two quantization levels, a and b are constructed as follows: Before next step, 3 is added to the index variable i.

Extraction and Reconstruction Method
The procedure of extracting the hidden secret bits shows in Figure 5. The detailed process is explained in detail according to the following procedure. Step 1: Read one block of trio(a, b, BM) from a set of trio as a defined order, where the trio consists of two quantization levels and one bitmap. Here, one codeword may be obtained from two quantization levels by Equation 8.  (a 4 a 3 a 1 a 1 ||b 3 b 2 b 1 ). Note that, a 4 and b 1 are the MSB and LSB of the rearranged pixel y, respectively. Step 3: Obtain the syndrome S = y · H T . Then, assign S into the m i+2 i , and add 3 to i. Step 4: If |a − b| ≤ T, it is a smooth block trio. In this case, it means that the hidden bits were embedded in BM as a form of pixels. Therefore, by assigning the pixels of BM to m in order, all the values concealed in the BM can be obtained. That is, m i+15 i = BM 16 1 and i = i + 15. If |a − b| > T and |a − b| ≥ 8, one bit was hidden in trio by using the order of two quantization levels. If the order of two quantization levels is trio(b, a, BM), it means that m i i = 1, otherwise m i i = 0.
Step 5: Repeat Steps 1 ∼ 4 until all the trios are completely processed, and the extracted bit sequence constitutes the secret data m.

Examples
The detailed procedure of our proposed DH is explained by the instance shown in Figure 6. trio(103, 109, 0000010001110111) and secret bits, m = (1011010111100001100). Since b − a = 109 − 103 = 6 ≤ T(7), the trio is classified as a smooth block. Here, we will show how to minimize errors in the encoding process through an optimized method than the existing method.
First, a codeword is constructed by using two quantization levels, a and b. That is, the codeword y(= (0111101) is made by 4LSB of a and 3LSB of b, where a and b are equals to 103 = (01100111) 2 and 109 = (01101101) 2 respectively. The constructed codeword is possible to hide 3-bits in two quantization levels. The 3 secret bits of m is (101) 2 (d = 5 in decimal). The value d is searched in the coset leader of standard array of HC (7,4) to find the matching index of the array. Then, using Equation Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 5 July 2020 doi:10.20944/preprints202007.0067.v1 (9), as shown in the example in Figure 6, the codeword with the smallest distance from ([a 1 b 1 ] = [7 5]) is found, so the codeword is (h = (7||4) = (0111||100) 2 = (0111100). Two quantization levels to embed 3 secret bits are recovered by using the codeword h. That is, the recovered codewords are a = 103 and b = 108. This block is a smooth block, because the difference (|a − b|) between two quantization levels is less than or equal to T. Thus, it is acceptable to hide 16 bits in the BM by DBS. That is, the pixels of the BM is replaced with the secret 16 bits, m = (1010 1111 0000 1100), and the bits concealed at the BM. In this example, for hiding additional 1 bit, the method based on OTQL is not used because the criterion of |a − b| > T is not satisfied. For decoding of two quantization levels, the codeword y should be constructed like decoding procedure. Here, we obtain the hidden secret bits, m = (101), by using the equation, S = y · H T , to the codeword. The decoding of the secret bits in the BM extracts the hidden bits by moving all pixels in the BM into a variable m of array directly.

Experimental Results
In this section, we prove the performance of our proposed scheme by comparing with the existing methods, such as Bai and Chang [20] , W Hong [23], and Chuang et al. [18] As shown in Figure 7, six grayscale images sized 512 × 512 are used for our experiments. In addition, the block size of AMBTC is set to 4 × 4 and the secret bits are generated by pseudo-random number generator. Embedding Capacity (EC) and Peak Signal-to-Noise Ratio (PSNR) are typically widely used as objective image evaluation indices. The relatively high PSNR value means that the quality of the stego image is good. The DH capacity is the size of the secret bit which is embedded in the cover image. The quality of the image is measured by PSNR defined as: The MSE used in PSNR denotes the average intensity difference between the stego and reference images. The lower the MSE value of a stego image, the better the quality of the image. MSE is calculated using the reference image p and the distorted image p as follows.

Preprints
The error value = p ij − p ij , indicates the difference between the original and the distorted pixels. The 255 2 means the allowable pixel intensity in Equation (11). A typical value for PSNR in lossy image is from 30dB to 50dB for 8-bit depth, the higher the better. Structural SIMilarity (SSIM) [29] estimates the impact that changes image brightness, photo contrast, and other residual errors are identified as structural changes. The SSIM values is limited to a range between 0 and 1. If the SSIM value is close to 1, it means that the stego-image is similar to the cover image and high quality. The equation of SSIM is as follows: where, µ x , µ y are mean values of cover image (x) and stego-image (y), σ x , σ y , σ 2 x , σ 2 y , and σ xy are standard deviation, variances and covariance of cover image and stego image, c 1 , c 2 , c 3 are constant values to avoid division by zero problem.  Table 1 represents the comparison of EC and PSNR between the proposed scheme and existing methods, i.e., Ou and Sun [19], Bai and Chang [20], and W Hong et al [23]. Especially, we compare the performance between our scheme and the existing methods using 6 images when the threshold value T(= b − a) is 5, 10, and 20. Evaluation of EC and PSNR based on threshold values is necessary for objectivity and fairness for comparative evaluation of performance. That is, the data measured under the same threshold value may be evaluated as a more meaningful comparison. One important point for EC and PSNR is that there is a trade-off between the two assessments. That is, if EC is higher, the PSNR is reduced, and vice versa. But, in case the proposed method has very good performance, the deviation of trade-off may be not large. The EC of our proposed method is efficient in respect of EC as 151173 bits when T = 5.
In Table 1, Bai & Chang's PSNR (= 33.0656dB) is measured higher than that (= 32.6911dB) of our proposed method. Here, the EC of Bai & Chang [20] is 55407 bits, and the EC of our method is 151173 bits. In the end, our proposed method shows the capability to conceal about 95000 bits more than the Bai & Chang.
If the threshold T and EC are given for faithfull measurement, the PSNR of our the proposed method may show highest. This is because the size of hidden bits affects PSNR. Apparently, a relative good method has high values both of PSNR and EC. When T = 10, we can see that our method's EC (= 219847 bits) is largest. Both W Hong [23] and our proposed method have the same PSNR (31.7dB), which is 0.1dB lower than that of Ou & Sun's method [19]. However, in this case as well, when considering the amount of EC, our method outperforms the other two methods.
When T = 20, the PSNR of the proposed method is higher than the previous two methods (Ou & Sun [19], and W Hong [23]) and EC of our method has the highest performance. It can be seen from the Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 5 July 2020 doi:10.20944/preprints202007.0067.v1 simulation results in Table 1 that the proposed method has 140000 bits higher than Bai & Chang [20] in terms of EC.  We proposed a way to improve the performance of Bai & Chang's method [20], and as shown in Figure 8, it is enough confirmed that our proposed method is superior to existing methods. On the other hand, our proposed method shows almost the same performance as W Hong's method [23], but it can be confirmed that the performance of our proposed scheme is slightly better. Ou & Sun's method [19] is superior to Bai & Chang's method [20], but the performance is not as high as that of our proposed method.
AMBTC has a difficulty in hiding enough data, because it is a compressed code, and unlike conventional grayscale images, it is not easy to exploit high embedding capacity by the constraint of compressed pixels. It is difficult to improve DH performance for images with many complex blocks, and if we exploit many pixels for high data concealment, the image quality may deteriorate.
In Figure 8, we can see that the EC of Bai & Chang's method [20] is very low. That is because this method is possible to hide only 6 bits of data while inverting up to 2 pixels in each bitmap. Thus, there Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 5 July 2020 doi:10.20944/preprints202007.0067.v1 is a limit to embed enough data in the trio's bitmaps. Since this method could not allow to conceal many secret bits for the threshold T of the same condition, it shows a relatively high PSNR . After all, that's why it can't mean that this method is superior to other methods. If we would like to increase the number of secret bits even at the expense of PSNR, it is able to use a way of increasing the size of the threshold T. However, it may be often the case that the PSNR gets worse without increasing enough the number of hidden bits than expected. For example, when T ≤ 4, the three methods except Bai & Chang's method can hide about 130,000 bits, while PSNRs are slightly reduced. For such a large data to embed, they exploited the DBS method in respect of bitmap BM equally.
Bai & Chang's method must increase the T value in order to conceal 130000 bits of data, and as a result, the errors are accumulated rapidly. Since Bai & Chang's method [20] uses up to 4LSB for data concealment, the size of the error is inevitably increased. Since our proposed method uses up to 3LSB and the frequent count of 3LSB is also not very high, the negative effect on image quality is less than that of Bai & Chang's method [20]. In the end, we proved that the proposed method has a better optimization performance than Bai & Chang's method [20].  Table 2 shows an experiment to compare PSNR and SSIM after concealing the same amount of data (120000 bits) in the cover image for a more objective performance check and reliable comparison. The SSIM of the proposed method shows the highest value. On the other hand, in the case of PSNR, W Hong's method [23] shows a high average. In fact, PSNR only quantifies the quality of reconstructed or damaged images in relation to facts. it is not compared to HVS. A better evaluation criterion would be SSIM, which evaluates the structure of the image. The SSIM of the reconstructed image for the ground image is always 1, and if the value is close to 1, you can see that the image quality is excellent. Therefore, we can see that our proposed method is superior to the existing methods in terms of SSIM. Our proposed method is able to obtain better performance by creating a look up table in order to obtain more optimal values than W Hong's method [23] .

Conclusion
In this paper, we introduced a DH method that applies DBS and optimized HC (7,4) to AMBTC compressed grayscale images. The basic unit of AMBTC is trio, which consists of two quantization levels and one bitmap, and is represented by trio(a, b, bitmap). Therefore, AMBTC is a trio set, and the proposed DH method is applied to each block of an image. The proposed method may have different final performance results depending on the characteristics of each block. Therefore, we divide every block into two groups (smooth blocks and complex blocks) and apply the proposed method. The distinction whether a block is a smooth block or a complex block is determined by the difference between the two quantization levels of the block. That is, if a difference (|a − b|) between two quantization levels is smaller than or equal to the threshold T, it is categorized as a smooth block. When hiding data in a complex block with a difference higher than threshold T, a relatively higher MSE errors increase compared to a smooth block. Therefore, it is important in terms of DH to distinguish the block. In other words, the smoother the blocks are, the more they help to maintain the image quality while concealed more data. In this paper, our proposed method achieved optimization level by HC (7,4 ) based on look up table. As a result, it was shown through experiments that our proposed scheme surpasses the performance of Hong's method. Experimental results show that the proposed scheme provides high EC while suppress the loss of quality of the cover image.