Abstract
Digital images are easily corrupted by attacks during transmission and most data hiding methods have limitations in resisting cropping and noise attacks. Aiming at this problem, we propose a robust image data hiding method based on multiple backups and pixel bit weight (PBW). Especially multiple backups of every pixel bit are pre-embedded into a cover image according to a reference matrix. Since different pixel bits have different weights, the most significant bits (MSBs) occupy more weights on the secret image than those of the least significant bits (LSBs). Accordingly, some backups of LSBs are substituted by the MSBs to increase the backups of MSBs so that the quality of the extracted secret image can be improved. Experimental results show that the proposed algorithm is robust to cropping and noise attacks for secret image.
Introduction
In the era of big data, multimedia data research has attracted considerable attention [1–5] and the transmission and exchange of multimedia data have become more convenient than before. But meanwhile, data security is confronted with more risks, including digital images. At present, there are two effective methods to protect image data, i.e., encryption and data hiding. Encryption converts the meaningful data into an unrecognized one to prevent information leakage [6], but make it easy to cause eavesdropper’s suspicion. Different from encryption, data hiding aims to embed secret data into a public cover by modifying its insignificant component imperceptibly, without attracting attacker’s interest [7, 8]. Digital images are widely adopted as the covers in the field of steganography since there is a large amount of redundant information in the digital images.
Data hiding can be mainly categorized into digital watermarking and steganography. Digital watermarks are mainly exploited for tampering recovery [9], authentication [10] and copyright protection [11]. Steganography [12] is mainly exploited for secret communication. Depending on whether the original cover image can be recovered nondestructively, steganography can be further categorized into reversible and irreversible steganography. Reversible steganography is required in some sensitive applications which can not permit permanent distortion for the cover images, such as military and medical [13]. The existing reversible steganography algorithms are mainly divided into three categories: lossless compression, difference expansion (DE) [14] and histogram shifting (HS) [8, 15]. It is noted that reversible steganography ensures reversibility and is mainly evaluated by embedding capacity and imperceptibility. Security and robustness are considered slightly in reversible steganography. Irreversible steganography allows that the cover image has less distortion and it is conducted in spatial or transform domain. The main advantages of spatial domain steganography are the high embedding capacity and good stego-image quality while transform domain methods do well in resisting a certain degree of attacks. The existing spatial domain steganography algorithms can be classified into three categories: The least significant bit (LSB) [16, 17], pixel-value differencing (PVD) [18, 19] and exploiting modification direction (EMD) [20, 21].
Transform domain methods embed secret data in the transformed coefficients of cover images and satisfy the criteria of imperceptibility and robustness [22]. It is well-known that there are three common signal transformations, namely, Discrete Cosine Transform (DCT) [23], Discrete Fourier Transform (DFT) [24], and Discrete Wavelet Transform (DWT) [25]. DWT transforms the cover image into 4 main sub bands (LL, HL, LH, and HH). Nag et al. [26] proposed a DWT hiding method in which three LSBs of wavelet coefficients in high-frequency sub-bands are accommodate for secret data. However, data hiding in the HH sub-band is not robust against attacks such as lossy compression. Hemalatha et al. [27] proposed a secure color image steganography integrating Discrete Wavelet Transform (DWT) with Integer Wavelet Transform (IWT). In this method, the cover and secret images are both transformed into DWT sub-bands. The LL sub-bands of both images are divided into disjointed 2×2 blocks. Then, they compared each block in the LL sub-band of the secret image with all blocks of the LL sub-band of the cover image to save the block with the lowest Root Mean Square Error (RMSE). All saved locations of blocks are then generated and embedded into the LSBs of the IWT coefficients of the cover image. Atawneh et al. [28] proposed an efficient embedding algorithm in the DWT domain based on the diamond encoding (DE) scheme. The secret image is first converted into a sequence of base-5 digits. Then, a cover image is transformed into the DWT domain and divided into 2×1 coefficient pairs. Secret based-5 digits are embedded into each coefficient pair by modifying at most one coefficient us DE scheme. In [29], a cover image is transformed into the IWT domain and a 3-dimensional chaotic is used to find the coordinates of pixels which are used for accommodate secret data. Kumar et al. [30] proposed a modified digital image steganography technique based on DWT. In their method, the cover and secret images are both decomposed into sub-images using DWT. These sub-images are partitioned into non-overlapping blocks. The blocks of sub-images of secret image are match with the blocks of sub-images of secret image using root mean square method. The best matched blocks are embedded into the other sub-images of cover image. Zhang et al. [31] present a data hiding method using multidirectional line encoding (MDLE) and (IWT). IWT is used to achieve accurate extraction of secret bits. The four sub-bands are divided into non-overlapping coefficient blocks sized 3×3. The center coefficient of the block is paired with surrounding coefficients in eight directions to embed n-bit secret data, respectively.
Although the above transform domain methods achieve the robustness for a certain degree of attacks, they are not good at resisting cropping with large area and noise with high density. In order to further improve data security, Lei et al. [32] exploited an anti-cropping data hiding algorithm with multiple backups, which used Latin square matrix [33] as a reference matrix for data hiding and data extraction. Zhang et al. [34] found a reference matrix which is constructed by four constraints to assist data hiding and data extraction. The proposed method aimed to extract exactly at least one backup of each group data so that the correct backups could construct the secret data well if the stego-image was corrupted. Their method achieved some robustness for cropping attack. Whereas, if secret data is a secret image, they do not consider pixel bit weight. In this paper, we propose a robust secret image hiding method based on multiple backups and pixel bit weight (PBW). We allocate reasonably backups of LSBs and MSBs of a secret pixel to improve the quality of extracted secret image according to PBW. The rest of the paper is organized as follows. Section 2 presents the relate work. Section 3 illustrates the proposed scheme in detail. Section4 provides experimental results and the robustness of the proposed method. Finally, we conclude this paper in Section 5.
Related work
In this section, Zhang et al.’s method [34] is briefly illustrated. Suppose that the cover image is an 8-bit depth gray-scale image sized l×w. And the h least significant bits (LSBs) of each pixel are used for accommodating secret data in their method. Consequently, the embedding capacity of the cover image is V = l×w×h. Namely, the cover image can accommodate V bits of data.
Assume that there are L bits of secret data to be embedded into cover image. Firstly, the secret data is divided into m groups and each group of data is copied to generate m backups, where m is the backup number. It is clear that m backups of every group of data are same. Assume that si,j is the j-th backup of the i-th group secret data, where 1≤i≤m, 1≤j≤m. For complete embedding, m must be satisfied with L×m≤V. Then a Latin square matrix sized m×m is selected as a reference matrix

A reference matrix with m = 8, T1 = 1, T2 = 2.
The cover image is divided into m×m non-overlapping blocks in raster-scanning order. Each block is denoted by
For example, let m = 8 and secret data is divided into 8 groups and 8 backups of every group of data are generated. The cover image is divided into 8×8 non-overlapping blocks. Then the reference matrix in Fig. 1 is applied to embed secret data to generate the stego-image. The number of reference matrix elements is 8×8, the same as non-overlapping blocks in covered image. There are 8 different digits in reference matrix and each digit repeats 8 times, representing 8 different secret data groups and the number of backups for each group. At receiver side, the stego-image is divided into 8×8 non-overlapping blocks. To begin with, if any 7 rows of the stego-image are cropped, we can extract the secret data completely through the remained one row. Next, if any 7 columns of the stego-image are cropped, we can extract the secret data completely through the remained one column. Finally, if only the gray area shown in Fig. 1 remains in the stego-image, we can also extract the secret data completely.
Motivated by Zhang et al.’s method [34] and considering that most of secret data may be images and different pixel bits have different weights, we adopt an 8-bit gray-scale uncompressed image as secret image in our paper. PBW of secret image is introduced to further improve the quality of extracted secret image. Therefore, a robust image data hiding method based on multiple backups and PBW is proposed. The flow chart of the embedding algorithm is shown in Fig. 2, which consists of three steps. The first step is pre-embedding using Zhang et al.’s method [34]. The second step is block pairing in a pre-embedding image. The third step is to substitute some backups of LSBs with some backups of MSBs between different pairs of pre-embedding blocks to generate a final stego-image.

Proposed robust image data hiding framework.
In this stage, we pre-embed an 8-bit secret image sized l1×w1 into a cover image sized l×w using Zhang et al.’s method [34]. Specifically, we transform the secret image to an one-dimensional pixel sequence denoted by {p1, p2, . . . , p
n
} in raster-order scanning, where n = l1×w1. Then, {p1, p2, . . . , p
n
} is divided into m groups and suppose the i-th group is P
i
(1≤i≤m) which contains L
i
pixels. The value of L
i
can be calculated as follows.
Where ⌊* ⌋ and mod denote rounding down operation and modulo operation, respectively.
For example, if n = 8 and m = 3, l = 2 and r = 2, accordingly, L1 = 3, L2 = 3, L3 = 2. Then each pixel of P
i
is transformed into 8 bits of binary sequence as following.
Where pi, j is the j-th pixel value of P i and bi, j, k is the k-th bit of pi, j. After transforming all the pixels of P i , the corresponding binary bits of P i can be obtained as S i = {bi,1,1, bi,1,2, . . . , bi,1,8, bi,2,1, bi, 2,2, . . . , bi,2,8, . . . , bi, L i ,1, bi, L i ,2, . . . , bi, L i ,8}.
By the same way, {S1, S2, . . . , S
m
} can be obtained and their sizes are {8L1, 8L2, . . . ,8L
m
}, respectively. Note that the 8 bits of a pixel are all contained in a group. According to Zhang et al.’s method [34], m backups of each group S
i
(1≤i≤m) are generated. A cover image is divided into m×m non-overlapping blocks. Referring to the reference matrix
According Section 3.1, m backups of S i are embedded into m blocks, respectively. These m pre-embedding blocks are taken as an example to illustrate block pairing and substitution between MSB backups and LSB backups will be conducted between a pair of blocks. These m blocks are divided into several block pairs as follows.
Let
The distance between
By the above method, the distances between any block and the other blocks are calculated. If D
s
,t is the maximum among these distances,
Note that PBW is not considered in the pre-embedding, the backup number of MSBs and LSBs are same in the pre-embedding image. Whereas, it is well-known that different pixel bits of a secret image have different weights and the weight of the j-th bit is 2
j
-1 in our paper. The MSBs have a great influence on the image, and the LSBs have little influence on the image. Consequently, it is possible to appropriately reduce the backups of LSBs and increase the backups of MSBs. Specifically, some extra backups of MSBs are generated to substitute some backups of LSBs in the pre-embedding image to reduce the corrupted possibility of MSBs if the stego-image is corrupted. It can be concluded that m backups of S
i
are embedded into m sub-blocks from Section 2. It means that m backups of an embedded pixel are embedded into m blocks. After block pairing, we take
Let k j (j = 1,2,3,4,5,6,7,8) be the backup number of j-th pixel bit in this pair of blocks. During pre-embedding, the weights of MSBs and LSBs are not considered, it is clear that k j = 2 (j = 1,2,3,4,5,6,7,8).
As we know the weights of different pixel bits are different, the weights of MSBs are higher than those of LSBs. In order to improve the quality of extracted secret image, MSB backups should be more than LSB backups. Therefore, the backup number of every pixel bit is subjected to k1≤k2≤k3≤k4≤ k5≤k6≤k7≤k8.
Since the weights of the 3 LSBs are low and their influence on the pixel value are smaller than the other bits. The backup number of 3 LSBs in these two blocks is adjusted as k1 = k2 = k3 = 1.
There is only one backup reversed for each of the 3 LSBs for two blocks. Note that if k7 and k8 are equal or greater than 5, the backup numbers of other bits will be small. If a stego-image is corrupted by low intensity noise or small cropping, the backups of the 7-th MSB or the 8-th MSB are so many and the backups of other bits are too few to resist noise or cropping. Consequently, in order to achieve outstanding robustness for noise or cropping, k7 and k8 should be smaller than 5 and k4, k5, k6, k7 and k8 are adjusted by
k j (j = 1,2,3,4,5,6,7,8) be the backup number of j-th pixel bit. Within the range of values of k4, k5, k6, k7 and k8, a set of values of k1, k2, k3, k4, k5, k6, k7 and k8 are selected as the backup number of every bit.
With the assistant of k1, k2, k3, k4, k5, k6, k7 and k8, we substitute some backups of LSBs with some backups of MSBs between two blocks. Suppose that two backups of 8 bits of a secret pixel are
If i is even,
For example, assume that k1 = k2 = k3 = 1, k4 = k5 = 2, k6 = k7 = k8 = 3 and the 8 pixel bits are {11010000}. So two backups of 8 pixel bits are
Based on the above discussion, for a given 8-bit secret image and backup number m, the secret image can be embedded into a cover image using Algorithm 1.
Data extraction is the inverse procedure of embedding procedure. If the stego image is corrupted by cropping or noise, the receiver can extract the uncorrupted backups of each secret pixel bit to construct the secret image according to the data-hiding key, which contains l1, w1, m,
The stego image is divided into m×m sub-blocks. m blocks with m backups of each group S
i
(1≤i≤m) can be obtained according to the reference matrix
M in Equation (10) represents a collection of the corrupted pixels and p in Equation (10) is a pixel of stego-image. Clearly, the backups of the pixel bits extracted from the corrupted pixels are unreliable and they cannot be used for secret image recovery. The backups of the pixel bits extracted from the uncorrupted pixels are used for recovering secret image. Generally, detection of the uncorrupted pixels is not perfect, such as noise detection. Although, by,z is extracted from an uncorrupted pixel or a corrupted pixel, it may be detected mistakenly. Since by,z has possibilities, namely, 0 or 1. Then, the backups with 0 or 1, which are extracted from the uncorrupted pixels, are marked as follows, respectively.
If cy,z = 1, it is clear that by,z is extracted from an uncorrupted pixel. sum1 and sum0 are occurrence number of 1 and 0 respectively, which are extracted from the uncorrupted pixels.
Consequently, by can be recovered by
In addition, if
In order to verify the robustness of proposed algorithm, a lot of experiments have been conducted. An 8-bit grayscale Elaine image sized 64×64 is selected as the secret image as shown in Fig. 3(a) and each pixel of the secret image is transformed into 8 bits of data to generate binary secret data sized 32768 bits. In this paper, the backup number is 8 and the selected reference matrix is shown in Fig. 2. The size of the payload is 262144 bits and the 1 LSB of the cover image pixel is used for embedding data. Consequently, an 8-bit grayscale Baboon image sized 512×512 is selected as a cover image, as shown in Fig. 3(b). With the changing of k1, k2, k3, k4, k5, k6, k7 and k8, extracted secret images have different image qualities. The 3 LSBs of each secret pixel have small weights, so k1 = k2 = k3 = 1. Generally, the larger the values of k8 and k7, the better ability of anti-noise and anti-cropping.

Secret image, cover image and stego image with P1.
However, if k8 and k7 are greater than 4, k5 and k6 will be too small. Therefore the quality of extracted secret image may be worse. Consequently, k4, k5, k6, k7 and k8 can be set up as follows. P1: k4 = 1, k5 = k6 = 2, k7 = k8 = 4; P2: k4 = k5 = 2, k6 = k7 = k8 = 3; P3: k4 = 1, k5 = k6 = k7 = k8 = 3; P4: k4 = 1, k5 = k6 = k7 = k8 = 3; P5: k4 = k5 = k6 = 2, k7 = 3, k8 = 4. For simplicity, the stego image with P1 is shown in Fig. 3(c). It can be seen Fig. 3(c) has superior image quality. It is observed that stego-image has superior image quality. Section 4.1 presents the performance of anti-cropping and comparison. Section 4.2 presents the performance of anti-noise and comparison.
In our experiments, peak signal-to-noise ratio (PSNR) is used to evaluate the distortion between the extracted secret image and original secret image. Its definition is shown in the following formula (17).
Generally, the cropping attacks are random. Due to page limitation, the cropping modes as shown in the Fig. 4 are selected to validate performance of anti-cropping. And each stego image with Pi (i = 1, 2, 3, 4, 5) is corrupted with cropping modes in the Fig. 4.

Cropping modes.
The percentages of the cropping areas of different cropping modes are shown in Table 1. It is observed the percentage of cropping area of each cropping mode is more than 75%. Furthermore, the percentages of cropping areas are even more than 90%in mode (g)∼mode (j) in Fig. 4. As are demonstrated in the Fig. 4 and Table 1, the cropping areas are extremely large. Figs. 5-12 show the extracted secret images using different methods.
Cropping modes and percentages of the cropping areas

Extracted secret images under mode (c) in Fig. 4.

Extracted secret images under mode (d) in Fig. 4.

Extracted secret images under mode (e) in Fig. 4.

Extracted secret images under mode (f) in Fig. 4.

Extracted secret images under mode (g) in Fig. 4.

Extracted secret images under mode (h) in Fig. 4.

Extracted secret images under mode (i) in Fig. 4.

Extracted secret images under mode (j) in Fig. 4.
The secret images with P1, P2, P3, P4 or P5 extracted from the corrupted images under different cropping modes are shown in Figs. 5 (c-g)∼12 (c-g). Note that the secret images can be extracted losslessly from the corrupted images under model (a) and model (b) in Fig. 4 whatever method is used. Thus, we do not show these extracted secret images. Also, the secret images, which are extracted using Lei et al.’s method [32], are shown as Figs. 5(a)∼12(a). And, the secret images, which are extracted using Zhang et al.’s method [34], are shown as Figs. 5(b)∼12(b). Each PSNR of extracted secret image is shown in the Table 2. It is observed that the PSNRs are inf whether using our method or the methods [32, 34] under cropping with Mode (a) and cropping with Mode (b). It indicates that the secret images can be extracted perfectly using whether our method or the methods [32, 34] under cropping with Mode (a) and cropping with Mode (b). It is because one backup of each pixel bit at least is uncorrupted under these two cropping modes. But the PSNRs of our extracted secret images are superior to those of methods [32, 34] under other cropping modes. Since Lei et al. and Zhang et al. did not consider the weights of different pixel bits and the numbers of different pixel bits are same, the backups of MSBs are not enough to resist large area cropping. While the weights of different pixel bits are introduced in our paper and MSBs occupy more backups than LSBs to improve the quality of extracted secret image. Besides, there are optimal Pi (i = 1, 2, 3, 4, 5) for different cropping modes. In Table 2, the texts in bold are the maximum PSNRs under different cropping modes.
Results of PSNR for Elaine
If the stego-image is corrupted by pepper and salt noises, we can also extract the secret image. Figs. 13∼20 show that extracted secret images and Table 3 illustrates the PNSRs of extracted secret images. If noise intensity is 0.1, the secret images can be extracted perfectly whether using our method or the methods [32, 34]. If noise intensity is 0.2, the secret images can be extracted perfectly using the methods [32, 34]. Although, the secret images cannot be extracted perfectly using our method, but have excellent image qualities. It is because those backups of LSBs of embedded pixels are decreased and all the backups of some LSBs are corrupted in our method. If noise intensity is greater than or equal with 0.4, the secret images cannot be extracted perfectly using our method and the methods [32, 34]. However, if noise intensity is less than 0.7, the PSNRs and visual qualities of the extracted secret images are satisfactory. With noise intensity increasing, the recovered secret images using the methods [32, 34] obtain more distortion than the recovered secret images using our method. It is observed that when noise intensities are 0.4, 0.5, 0.6, 0.7, 0.8 and 0.9, the optimal PSNRs of extracted secret images using our method are 51.8614 dB, 42.5182 dB, 34.8542 dB, 29.1974 dB, 21.7867 dB and 13.2407 dB, respectively. The PSNRs of extracted secret images using the method [32] are 39.4623 dB, 33.4697 dB, 25.8798 dB, 19.6908 dB, 14.7408 dB and 9.9063 dB, respectively. The PSNRs of extracted secret images using the method [34] are 38.2386 dB, 31.7002 dB, 25.6929 dB, 19.3585 dB, 14.436 dB and 9.8059 dB, respectively. Compared with the methods [32, 34], the gains using our method in PSNR exceed 9 dB if noise intensities are 0.4, 0.5, 0.6, 0.7 and 0.8. Our method achieves a great improvement on anti-noise performance.

Extracted secret images with 0.2 density noise.

Extracted secret images with 0.3 density noise.

Extracted secret images with 0.4 density noise.

Extracted secret images with 0.5 density noise.

Extracted secret images with 0.6 density noise.

Extracted secret images with 0.7 density noise.

Extracted secret images with 0.8 density noise.

Extracted secret images with 0.9 density noise.
Results of PSNR for secret image Elaine (Uint:dB)
The limitation of this method is that it is difficult to restore the secret image losslessly when the secret image is damaged to a small extent. But it can be concluded that PBW introduction brings about outstanding quality of extracted secret image when the stego-image is corrupted by cropping with large area or noise with high density in our paper. Since cropping or noise attack is unpredictable, we can select any Pi for image data hiding.
In this paper, a robust data hiding method for secret image based on multiple backups and PBW has been proposed. It is considered that different pixel bits have different weights, the backup number of for MSBs and LSBs are calculated according to PBW. Obviously, backups of MSBs are more than those of LSBs. If the stego image is corrupted by noise or cropping, MSBs can be recovered with high probability. Therefore the robustness performances of the proposed method are excellent in our paper. Experimental results demonstrate that the proposed algorithm is more robust than compared algorithm.
Data availability
The images used to support the findings of this study are included within the article.
Conflicts of interest
The authors declare that there is no conflict of interest regarding the publication of this paper.
Footnotes
Acknowledgments
This work was supported by the National Natural Science Foundation of China (62162006, 61962008, 62062013, 61762017, 71862003), the Guangxi Natural Science Foundation (2021GXNSFBA196058), and the Natural Science Projectof Guangxi Universities (2021KY0051).
