To reduce the AI, we designed an improved RIT method by patching image blocks according to the secret segment. The proposed framework of image embedding is shown in
Figure 2. We transformed the image in the last (K-T)-classes using traditional RIT firstly. Secondly, the partial AI from the last (K-T)-classes is represented as the secret segment; it will be hidden in the composite image by patching the blocks in the first-T classes. Then, the pixel values of these image blocks will be shifted to generate the transformed image. Thirdly, the remaining AI is processed and embedded by an RDH method. Finally, the process of image embedding is completed, and the stego-image is generated. Note that the secret image extraction is the symmetrical process of image embedding, which is not described in detail here. Since the proposed method mainly improves image block matching, we will focus on this step.
Before image block matching, we firstly classify the blocks according to their SD values. In fact, Zhang et al. [
20] counted the distribution of SDs of
block for various sizes of 10,000 natural images from a BossBass image database, and found that the SD values of most blocks concentrate on a small range close to zero, and the frequency quickly drops down with the increase of the SD value. Thus, it will be more efficient for the blocking transformation using SD classification.
In addition, we divided these images into K classes using a K-means clustering method, and calculated the number of each class when
, as in
Figure 3. Then, we can find that when
is larger, the number of image blocks will decrease and SDs are increased. Therefore, we divide the K classes’ blocks into two parts with unequal proportions: the first T-classes for blocks with smaller SDs, and the last (K-T)-classes for blocks with larger SDs. Thus, blocks in the last (K-T)-classes can be transformed by a traditional RIT method to maintain the transformed image quality, and blocks in the first T-classes can be patched according to the secret segment for reducing AI.
3.1. Image Blocks Matching of the Last (K-T)-Classes
The image blocks matching for the last (K-T)-classes is described as follows:
Firstly, cluster all of secret blocks into K classes by a traditional clustering method such as K-means, and sort the last (K-T)-classes in ascending order for .
Secondly, classify the target blocks with the classes’ volumes of secret image, so that each target class has a same volume with the corresponding secret class. Suppose the secret class contains image blocks, where . Then, the first target blocks are divided into the first class, the subsequent target blocks are divided into the second class, and so on, until the Kth class.
Finally, distribute a class index to each block, where is the block of the class and . And the secret blocks should be replaced to target blocks, and the initial composite image is generated.
In order to explain the process of the last (K-T)-classes, suppose
and
, a simple example of block matching in last 2-classes are shown in
Figure 4.
The secret tiles are divided into three classes here:
(1) belong to the class 1, they are labeled as “white”;
(2) belong to the class 2, they are labeled as “gray”;
(3) belong to class 3, they are labeled as “black”.
Next, cluster target blocks based on the classes’ volumes of secret images, then the class index of block can be obtained by scanning classes in the raster order.
For example, in secret image A, the second secret block is the first of class 1 that is assigned as
, the seven block is the second of class 1 that is assigned as
,…, and so on, a one-to-one map between secret and target blocks will be created. The
secret blocks in last 2-classes can be transformed to
target blocks and replace them, while the pixel values of the class 1 are changed to 0, and they will be patched in
Section 3.2. Finally, the composite image SC is generated.
The SC has a similar texture pattern with the target image because it has pretty big SDs with the secret image, which results in the SC having a similar appearance to the target image while hiding the secret image. Moreover, the secret image can be recovered using the SC.
To recover the secret image from the composite image, the receiver only needs to know the class index A. According to the table in
Figure 4, the receiver will know how to rearrange the composite blocks to restore the secret blocks. For example, the first block of the composite image should be put back to position 4, and the fifth block should be put back to position 1, as indicated in the table.
3.2. Image Blocks Patching of the First T-Classes
To embed the AI from the last (K-T)-classes transformation, the AI should be represented as a secret segment, and the image blocks in the first T-classes can be patched according to the secret segment. Before that, the AI can be compressed by the Huffman code method, and is denoted as . However, the number of image blocks in the first T-classes is not sufficient to hide through patching image blocks because the length of is very large. Therefore, will be divided into two parts called and , in which can be hidden by patching blocks, and can be embeded by final RDH. But determining the length of remains a challenge.
Suppose the length of secret segment is , and each block in the first T-classes can be divided into categories (). We use each block to represent different secret segments. For example, if , the block may be represented secret segments “00”, “01”, “10” or “11”.
The total number of image blocks in the first T-classes is , where is the number of each classes’ blocks, respectively. Thus, the length of is , and should be divided into secret segments and each segment contains l bits. We calculate the decimal values () for all segments, and count the frequency of each . Then, we divide the secret blocks in the first T-classes into new categories by the frequency , and the secret blocks in each class have the same volume as the corresponding frequency.
Suppose the image class contains blocks, where . The first secret blocks with the smallest , the second secret blocks with second-smallest , and so on, until the unmatched secret blocks are divided. Next, distribute a compound index to each secret block, where is the block of the class and . Then, the blank blocks of composite image can be divided into new categories by the scanning order of , in which the blocks will be distributed a class index accordding to the decimal values of each secret segment. Finally, the unmatched secret blocks can be patched into composite image, in which the secret block should be replaced to the blank block, and the final transformed image is generated.
To explain the process of image blocks patching in the first T-classes, based on the example of
Figure 4, block patching in the first class are shown in
Figure 5. Assuming
and
, the secret image blocks should be patched to composite image blocks in the first class, which are labeled as “white”. Firstly,
can be divided into the secret segment “0” and “1”, and we can count that the number of “0” is three, and the number of “1” is five. Then, according to the number of “0” and “1”, the secret blocks of the first T-classes can be sorted by SDs, and divided into two new categories:
- (1)
The first-3 image blocks of the ascending sequence belong to class 1; they are labeled as “red”;
- (2)
The last-5 image blocks of the ascending sequence belong to class 2; they are labeled as “yellow”.
Next, the blank blocks in the composite image can be divided by the scanning order of . For example, the first bit in the is 0. Thus, the first position of unmatched blocks in the composite image belongs to class 1; they are labeled as “red”. The second bit is 1. Thus the second position of unmatched blocks belongs to class 2; they are labeled as “yellow”. Then, the new class index for the unmatched block can be defined. Finally, the secret blocks should be replaced to the blank block, and the final transformed image is generated.
To recover
and the composite image, the receiver only needs to know the class index A. Note that the class index A is different from
Section 3.1. We can combine these two class indexes to record the final class index to reduce the amount of additional information. Firstly, the total number
and different classes’ volume of transformed image in the first T-classes can be obtained by the class index A. In the example of
Figure 5,
, the volume of image block belonging to class 1 is 3, and the volume of image block belonging to class 2 is 5. Next, we select the transformed image blocks in the first
by ascending SD, in which image blocks in the top 3 by ascending SD belong to class 1, and image blocks in the last 5 by ascending SD belong to class 2. Therefore,
and the class index SC can be restored. In fact, by the class index A and the class index SC, the receiver can reconstruct the table in
Figure 5 completely, and according to the table, the secret blocks can be recovered by rearranging the transformed blocks. For example, the second block of the transformed image should be put back to position 7, and the third block should be put back to position 2, as indicated in the table.