# An Improved Reversible Image Transformation Using K-Means Clustering and Block Patching
## 4 Experimental Results
### Parameter Settings  
In order to improve the safety, we firstly adopt the Huffman code to compress AI, and encrypt them using the secret key sk, then use the RDH method in [8] to embed the encrypted information. Figure 6 gives an example that reflects security of the algorithm. Figure 6a is the secret image, Figure 6c is the stego-image, which is similar to the target image Figure 6b. If the attacker has a wrong key, he only can obtain the messy image such as Figure 6d. Thus, only the receiver with the correct key can recover the secret image. We used MATLAB-R2014a to perform the experiments; our test machine was an Asus PC with 4200 CPU @2.80 GHz and 8.00 GB RAM. The test images shown in our experiments are listed in Figure 7, which are adopted by much computer or camera equipment in the PNG format. In this subsection, four typical combinations of secret and target images in Figure 7 are applied to discuss how to correctly set the parameters of the proposed method. Moreover, we can obtain different AI and transformed image qualities by setting different parameters for these test images. However, the ultimate stego-image quality can be improved when we have higher stego-image quality and lower AI. Therefore, the optimal parameters of the proposed method can be found by the relationship of AI and transformed image quality. Figure 6: An example that reflects security (**a**) Secret image. (**b**) Target image. (**c**) Stego-image. (**d**) Recovered image (wrong key). (**e**) Recovered image (correct key). Figure 7: Four typical combinations of secret and target images. In the traditional RIT method [19], they divide secret and target images into non-overlapping \(S\times S\) blocks, and classify these blocks into K classes for block matching. After block matching, the image blocks will be shifted by Equations (3)-(5) and (7) in order to be as similar as possible with the target image. In Equations (4) and (5), to solve the overflow/underflow problem, \(U\) is set as a parameter to control the balance between the number of overflow and underflow and mean's bias of target image. In Equation (6), to reduce the amount of AI, \(\lambda\) also is set as a parameter to make a trade-off between the amount of AI and the mean's bias of target image. Thus, \(K\), \(U\), \(\lambda\) and \(S\) are four parameters which can affect the AI and transformed image quality. However, the parameter \(K\), \(U\), \(\lambda\) and \(S\) are independent and are not affected by our improved algorithm. Therefore, we set \(K=10\), \(U=10\), \(\lambda=4\) and \(S=4\), which is same as the traditional RIT method, and adjust \(T\) and \(M\) to the optimal parameter. To verify that the original optimal parameters are also applicable to the improved algorithm, we take the block size parameter \(S\) as an example. As the block size \(S\) increases, the quality of transformed image will decrease because the mean of the secret block deviates from the target block, while the AI will decrease because the number of image blocks decreases. Therefore, in Table 1, we can see that when the block size is set to be \(3\times 3\), the amount of the AI will reach 0.852 bpp, which is quite large for RDH method. By increasing the block size, the amount of the AI (AI) will reduce, but the quality of the transformed image and stego-image will decrease. When the block size is larger than 4, the RMSE of the transformed image and stego-image will increase rapidly but the amount of the AI decreases slowly. Therefore, we still set \(S=4\). Next, since different \(T\) and \(M\) have effect on AI and transformed image quality, we can determine the appropriate \(T\) and \(M\) by measuring the amount of AI and the root of mean square error (RMSE) of the transformed image. The AI and RMSE of the transformed image with different parameters \(T\) and \(M\) for four examples are shown in Table 2.  
In our method, the parameter \(T\) is used to divide the original classes into two part.