Abstract
The embedding capacity and steganography quality are two important performance indicators of data hiding which has practical application value for copyright and intellectual property protection, public information protection and online elections. Many researches presented hiding methods to improve the performance. However, the existing data hiding methods have problems such as low embedding capacity or poor stego-image quality. This paper proposes a new method (Single Pixel Modification, SPM) to improve the performance further. The SPM (Single Pixel Modification) method embeds k secret bits into a cover-pixel with the idea that minimizing the change to cover-pixel and adopting modulus operation based on 2 k . The experimental results show that the proposed method has better performance than methods compared and the highest hiding capacity can reach 4 bits per pixel and the average PSNR of stego-images is 34.83 dB. The source code and related materials are made to public to make it easy for researchers to verify the work and stimulate further research.
Introduction
With the rapid development of the Internet, people enjoy the convenience brought by information technology but also suffer the threat of information leakage. Data hiding technology can ensure the safe storage and transmission of confidential information. The main method of data hiding is to embed secret messages into cover image and then generates the stego-image that prevents others from obtaining the secret data [1, 29].
Nowadays, many data hiding methods have been proposed. After extracting the embedded secret data, according to whether the cover image can be recovered, data hiding can be divided into reversible data hiding [2–5] and irreversible data hiding [12–15, 28]. In the reversible data hiding the cover can be recovered without any distortion, this method is suitable for some fields that require very high image accuracy, such as medical, military. In contrast, irreversible data hiding cannot restore the cover image, but it can embed more information and easy implementation. This paper studies irreversible data hiding. A commonly irreversible data hiding method is the least significant bit (LSB) replacement, which is the simplest and best known way of embedding secret data directly [6, 27]. Mielikainen’s LSB matching revisited method [19] overcomes the shortcomings of LSB [6] replacement, it can resist the steganographic attacks. However, it does not enhance the embedding capacity. For a cover image with M × N pixels, the maximum data hiding capacity of LSB steganography is M × N bits. In 2020, in order to improve the capacity of hidden secret data and provide imperceptible hidden image quality, [27] proposes a hybrid steganography method based on least significant bit (LSB) replacement and Hamming code(HLAH).
In 2006, Zhang et al. [28] used a modulus method modifying the directional characteristics and proposed efficient embedding method by EMD (Exploiting Modification the Direction). In EMD method, it used n cover pixels to cover one secret digit in a (2n+1)-ary notational system. Though EMD can achieve high embedding efficiency and maintain less changes in the cover image pixel, the highest embedding capacity achieved by this method was1.16 bpp when n = 2. In order to improve the embedding capacity, other studies proposed improved EMD-type methods [7, 30]. For example, in 2007, Lee et al. [17] proposed an improved EMD method(LWC) that the bits per pixel (bpp) was improved to 1.5 bpp. LWC method convert secret digits in an 8-ary notation system, each secret digit was embedded into a pixel group including 2 cover pixels. In this year, C Chang et al. [7] proposed a two-stage EMD embedding method to increase the embedding rate, this method achieved maximum rate of 2.32 bpp and lower bound for PSNR was still higher than 44 dB. In 2009, Jung et al. [8] proposed a data hiding method based on EMD, which used one pixel to carry a secret digit in (2n+1)-ary notational system and achieved maximum rate of 2 bpp. In 2013, Kuo et al. [13] proposed a new data hiding method based on generalized exploiting modification direction method (GEMD), this method was a general version of LWC. In 2019, another improved EMD method was proposed by Sairam et al. [23], it used k2 -ary notational system to carry a confidential data, this method achieved maximum rate of 4 bpp. In 2020, Y. Zhang et al. [30] proposed a novel information hiding method(MOPNA) based on modulo operation of prime numbers. The embedding capacity was improved to (2 k +1)/2 bpp (bits/pixel).
In recent years, many researchers have combined other methods to increase the embedding capacity. In 2020, Chin-Feng Lee et al. [16] proposed a data hiding method based on magic cube generated using magic matrix. In this method, they used 4 pixels secret keys to carry 9 bits of secret data, and achieved an embedding capacity of 2.25 bpp and an average PSNR of 44 dB. In 2020, Guo-Dong Su et al. [25] proposed a novel Tetris-based data hiding scheme to flexibly hide more secret messages. Before data embedding, they should construct the reference matrix based on Tetris, and the corresponding LUT. Then an LQ×LQ square lattice Q was selected to determine the maximum embedding capacity, the maximum ER 2.56 bpp was achieved. In 2021, Chin-Feng Lee et al. [15] proposed a data hiding scheme based on a double-layer octagon-shaped shell matrix, the method can carry 7-bit of data for each pair of cover pixels, the higher embedding capacity of 3.5 bpp.
Through the research and analysis of the above literatures, we found that the embedding capacity have room for improvement. With the aim of improving the embedding capacity, we propose a high capacity embedding method based on modular operation while still producing an acceptable stego image (with PSNR>30 dB). The contributions and innovations of SPM method are as follows: SPM is designed and implemented. With the method, the embedding capacity can reach 4 bpp while the quality of stego-image is still acceptable (PSNR>30); The performance and security of SPM are proved by experiments; All codes, images and other related materials are public available at https://github.com/wangsha1028/SPM. This lets other researchers verify our work easier.
The rest of the paper is organized as follows. Methods of related works from EMD, JY, KKWW, PAMO and SB are described in Section 2. The new method (SPM) is introduced and the example is given in Section3. Section 4 provides the experimental details and experimental results of SPM. The conclusion and major contributions are highlighted in Section 5.
Related works
EMD
In 2006, a data hiding method based on EMD was proposed by Zhang and Wang [28]. It has the characteristics of small change of pixel value and large amount of embedding capacity. EMD can embed a (2n + 1)-ary secret digit by modifying the value of one pixel in a set of pixels. The algorithm is as follows. Convert secret data into a (2n + 1)-ary notational system digit. Let the secret digit be s. The extraction function f as Equation (1).
Embed secret digit s in cover-image. The rules for modifying pixels are as follows: if s = f, then G′ = G. if s ≠ f and r = (s - f) mod (2n + 1) ⩽ n, then if s ≠ f and r = (s - f) mod (2n + 1) n, then . Use Eq. (1) to extract secret data from the stego-image. Embedding rate achieved by this method was 1.16 bpp.
In 2009, Jung et al. [8] proposed a high quality data hiding method. Through JY, each cover pixel can embed up to 2 bits of secret digit. The details of JY are as follows.
The inputs of JY are a cover-pixel and the secret digit data d which is transformed from k confidential bits, and the output is a stego-pixel pair . For a pixel g in cover-image, compute the extraction function f, given in (2).
Choose the x value in a specific Rangefor satisfying following equation. d = f if 0 ⩽ g ⩽ 1 then Rang = [0, (2k + 1)] else if 254 ⩽ g ⩽ 255, Rang = [- (2k + 1) , 0] else Rang = [- (2k + 1) , (2k + 1)] A new pixel value g’ is obtain by Equation (3).
Use the extraction function fto extract the secret data from the stego-pixel. The maximum embedding rate per pixel achieved by this method is 2 bpp.
In 2016, Wen-Chung Kuo et al. [14] presented a data hiding method based on multi-bit encoding function. The embedding capacity is (nk+1)/n bpp. The method predefined weight value c i and an extraction function. The embedding algorithm is as follows.
The inputs of KKWW are n adjacent pixels G and nk + 1 binary bits secret data (s
nk
, snk-1, . . . , s0). The output is n stego-pixels . Compute the extraction function using (4),
Transform confidential bits into secrete value S. The transformation is as follows.
Compute the difference D between f (G) and secret value S using the equation given below
Embed the secret data into cover-pixels as follows. i f D = 0 i f D = 2
nk
i f D2
nk
transform D → (dn-1 . . . d1d0) 2
k
for each i
, if i0 i f D2
nk
transform (2nk+1 - D ) → (dn-1 . . . d1d0) 2
k
for each i
, if i0
In 2019, T. D. Sairam et al. [23] proposed a data hiding method based on EMD, it can not only enhance the embedding capacity but also keep secrecy with low distortion. In this method, n is the number of binary digits, the secret data is converted to n2-ary notational system. More details of SB-2009 algorithm are shown as follows.
The inputs of SB are cover-pixel g and the secret digit data d, d is transformed from k confidential bits. The output of SB is stego-pixel . Convert the secret bits into a k2-ary notational system digit before applying the algorithm, and represent the secret digit as d. For cover-pixel value g and secret value d. x is selected satisfying the condition x ∈ [- ⌊ raise0.7exk2 / lower0.7ex2 ⌋ , ⌊ raise0.7exk2 / lower0.7ex2 ⌋], then use variable x to generate stego-pixel as follows, where the value is selected to satisfy the f = d condition.
In the extraction part, secret digit dis calculated by Equation (5). SB-achieved flexibility to scale down or scale up the modulo operator, and can embed maximum of 4 bppand PSNR of 48.11 dB.
In 2021, Teng Li et al. [18] proposed a method that used pixel value adjustment with modulus operation to hide secret data in cover-image. It took n as a secret group, and converted to a 2 n + n-ary notional system secret digit d. Details of PAMO Algorithm are shown as follows.
The inputs of PAMO are cover-pixelg and the secret digit data d, dis transformed from k confidential bits. The output of PAMO is stego-pixel . Divide the binary stream into groups of n. Convert each group into a 2
n
+ n-ary notational system digit before applying the algorithm, and represent the secret digit as d. For cover-pixel value g and secret value d, embed secret d into g as follows:
Where ⌊· ⌋ is the flooring operation. In the extraction part, secret digit d is calculated by Equation (6).
Recently, many EMD-type data hiding methods have been proposed to enhance the embedding capacity, not only the security of data hiding technology have been improved, but also maintains the good visual quality of stego-image. However, we found many data hiding method still have room for improvement. In this paper propose a high embedding capacity method (SPM Algorithm). The main idea of SPM Algorithm is using one cover pixel to carry the 2
n
-ary notational system secret digit. The maximum embedding rate is 4 while the PSNR of stego-image is maintained more than 30 dB. The embedding steps are presented as follows. Convert the secrete message to binary digits before embedding data. Choose nbinary bits as a group, then convert this group into n2-ary notational system secret digit d. After step 1, embed secret digit d into a cover pixel g by following algorithm.
If the range of value is not in [0, 255], then continue to search another x to satisfy the condition f = d. ⌊· ⌋ is the flooring operation. Secret digit d can be extracted by Equation (9).
The major advantage of SPM Algorithm is that the embedding capacity can be improved while the PSNR of stego-image is more than 30 dB. Otherwise, the parameter n can be scaled down to 1 and up to 4 to obtain different embedding capacity.
Binary stream (111001011011)2 can be divided into three groups, each group is 1110, 0101, 1011. And convert each group to a 16-ary notational system number, respectively are E, 5, D. Embed E, 9, 2 respectively into the pixel values of 255, 254, 5, x ∈ [- 8, 8]. In this case, f is calculated by f = (g + x) mod 2
n
= (255 + x) mod 16, and find the value x = -1 to satisfy the f = d condition as follows, a new pixel is obtained, and the value of the new pixel between 0 ⩽ g
i
⩽ 255.
Through the following calculations, f = d is satisfied when x = 7, and the stego-pixel is obtained. However, the value of the cover-pixel , so the new value of stego-pixel is . So far, the second secret group has been successfully embedded in the cover pixel. The specific calculation process is shown in Eq. (10). In this case, let n = 4, g3 = 5 and d = (D)h, f is calculated by f = (g + x) mod 2
n
= (5 + x) mod 16, 5 + (- 8) mod 16 = D. Then, since f is equal to d when x = -8, a new pixel value is obtained but the value . The new pixel value . In the extraction method, it can recover the embedded secret from those stego-pixels by using the extraction function , d1 = 254 mod 16 = 14, d2 = 245 mod 16 = 5, d2 = 13 mod 16 = 13 which represents the secret binary stream (111001011011)2.
In this section, the experiments are carried out to evaluate the performance of SPM method. Our proposed method and other referenced methods are implemented in Python and run in a PC with an Intel i5-1035G1 CPU @ 1.00 GHz and 16-GB RAM. The operating system is Windows 10 Professional 64-bit.
Analysis of experimental results
The proposed method was tested by 12 gray images such as Lena, Baboon, Airplane, Boat, etc. Figure 1 shows the test images, the size of all images is 512 × 512. Figure 2 shows the stego-images when the maximum embedding capacity was achieved 4 bpp. It is clear that the visual quality of the stego-image remains good even if the embedded secret messages are up to 1048576 bits. It is hard for the human eye to detect distortion caused in the images. Stego-image PSNR (Peak Signal to Noise Ratio) and capacity are shown in Table 1. Calculated the time complexity and space complexity are O (2 n ) and O (1) respectively.

Twelve 512 × 512 gray-scale images (Boat, Airplane, House, Lena, Peppers, Tiffany, Barbara, Baboon, Bridge, Cameraman, Living room, Pirate).

Stego-images with 1048576 bits secret data. Top row (left to right): Boat (34.81 dB), airplane (34.81 dB), House (34.81 dB), Lena(34.81 dB). Middle row: Peppers (34.81 dB), Tiffany (34.81 dB), Barbara(34.81 dB) and Baboon(34.81 dB). Bottom row: Bridge (34.72 dB), Cameraman (34.80 dB), Living room (34.79 dB), Pirate (34.79 dB).
PSNR and capacity
To further demonstrate the superior performance of our proposed SPM method, we compared the results provided by the proposed method with the results provided by other previous works [8, 28].
In this experiment, the embedded secret data is comprised of a random bit-stream that is generated from a random number generator beforehand, the number of secret digits is 49000 bits and 131077 bits. The stego-image of Baboon which is embedded 49000 bits secret digits are shown in Fig. 3 and the stego-image of Lena with 131077 bits secret data are shown in Fig. 4. In Figs. 4, it is difficult for us to see the difference between the original image and the stego-image with the naked eye. This is the characteristic of data hiding.

512 × 512 Stego-images of Baboon when the length of secret message is 49000 bits.

512 × 512 Stego-images of Lena when the length of secret message is 131077 bits.
In [14, 28], when computing the extraction function, the variable n represents number of pixels in a set of cover image. But in [8, 23] and our proposed method the variable n used to represent number binary digits can be embedded in a single pixel. For unification, in this section, n represents the number of pixels and k represents the number of binary bits embedded each time.
We have analyzed the characteristics of EMD [28], JY [8], KKWW [14] SB [23] and PAMO [18] methods. We used PSNRto analysis the performance of proposed method and compare performance with [8, 28]. The peak signal-to-noise ratio (PSNR) is employed to evaluate the stego-image quality, if the PSNR of the stego-image is higher than the standard measurement of 30 dB the differences between cover image and stego-image is imperceptible to human vision. The higher the PSNR, the better the visual quality of the image.
Where M and N represent the length and width of the image, g
ij
and
In Fig. 5, it shows the embedding rate of the compared methods. It’s easy to see the embedding

Embedding capacity comparing.
capacity of our approach is the same as that of methods [18, 23] and is higher than methods [8, 28] with differences of 2, 0.5, 2.5, 2.84, 0.5, 1.75, 1.44 bpp, respectively. The embedding capacity can reach 1.16 bpp of EMD when n = 2; LWC [17] and JY can embed up to 1.5 bits and 2 bits respectively; for method KKWW, the embedding capacity can reach 3.5bpp when n = 4 and k = 3; and for method PAMO, When enough information is embedded, in order to keep the PSNR above 30 dB, the maximum embedding capacity is 4 bpp. By changing k, our proposed method has been improved in terms of embedding capacity, the highest hiding capacity of SPM can reach 4 bits per pixel. Of course, as the embedding capacity increases, the image quality will also be reduced, in our method, k values were chosen to maintain PSNR to be above 30 dB.
To ensure the accuracy of the results, embed 49,000 bits of secret digits into nine cover images by five algorithms, then calculate their PSNR respectively and obtain the average PSNR. The results are shown in Table 2. For SPM method, when embedding rate is 3, the PSNRis greater than 40 dB, the stego-image has a very ideal visual quality. When embedding capacity is 4bpp, PSNR is greater than 30 dB, the stego-image quality is still within the acceptable range. From Table 2, it can clearly see that even though the achievable embedding capacity of [18, 23] is the same as ours, the SPM method has the highest PSNR value when compared to methods [18, 23].
The results of comparison with four methods
In Fig. 6, the stego-image quality is compared for JY, SB, KKWW, PAMO and our proposed method SPM. The KKWW method uses a pixel pair n = 2. Note that PSNR decreases with higher values of k. In the same value of k, the proposed method is maintained the better visual quality of stego-image than other methods. And we find that a larger value of k represents that the method has better embedding performance, that is, a pixel in the cover-image can carry more confidential bits. On the contrary, a smaller value of k means a worse embedding performance.

In order to understand the embedding situation more clearly, we use all black and white pictures with size 512 × 512 to test [8, 28] algorithms and our proposed method. In this experiment, 98000 bits of secret data was embedded in the all
black and white pictures. Embedding secret data in all black picture can hardly see any difference from the original picture, the results can be seen in Fig. 7. From Fig. 8, When embedding information in all white picture, our algorithm also performs well. When k = 1, it is almost impossible to see that the secret data is embedded. As the k value increases, the quality of the picture decreases.

All-black picture test.

All-white picture test.
Anti-Steganalysis is also an important indicator of the security performance of information hiding algorithms. According to different information hiding algorithms, scholars have also proposed various information hiding analysis algorithms. It can detect whether the image contains secret data, even can extract secret information roughly.
Bit plane attack is a visual attack method. It can construct the corresponding plane image by extracting and analyzing the corresponding bit of each pixel in stego-image. It is also a method that can directly extract meaningful information. So this attack method is applied to demonstrate the security of our proposed method. Two 8-bit grayscale “Barbara” image (512 × 512 . png) are selected for bit plane attack experiments, one is cover image “Barbara”, another one is its stego-image when the length of secret message is 49000 bits and bpp is 2 (PSNR is 56.61 dB). The plane images are shown in Fig. 9, Fig. 10. By comparing Figs. 9 10, there is no significant difference between each corresponding bit-plane image, so the bit-plane attack cannot analyze the secret digits in the stego-image.

Bit plane attack for cover image.

Bit plane attack for our method (k = 2).
In order to further prove the safety of SPM, we perform bit-plane analysis on LSB replacement data hiding and SPM algorithms. For example, using 8-bit
grayscale “Barbara” image (512×512.png) as the cover image and 8-bit “hide” image (128×128.png) as the secret data. Eight planes can be constructed according to the bit placement of each pixel, the “Barbara” image and “hide” image are shown in Fig. 11. The results of bit-plane analysis LSB is shown in Fig. 12. The attacker can easy to find secret data from the 1st bit-plane directly. We use bit plane analysis against our proposed method and result is shown as Fig. 13. From the eight-bit planes, there is no difference from the original image, because the relationship of every bit in the original data has been changed by our proposed method, it is shown the SPM method can resist bit plane attacks.

The cover image(a) and secret data(b) for bit-plane analysis.

Bit-plane (Barbara, used LSB replacement).

Bit-plane attack for our method.
Many EMD-type data hiding methods with high embedding rate capacity and good stego image quality have been proposed, such as EMD [28], JY [8], KKWW [14], SB [23], PAMO [18] and other algorithms. In this paper proposed a method for improving the embedding capacity, it could embed the secret number in a 2 n -ary notational system on each pixel of the cover image. The secret pixel bits of embedded data are adjusted by ′x′ to achieve high embedding rate and improve image quality at the same time. The experimental results show that for a 512 × 512 grayscale image, SPM achieves a maximum embedding capacity of 1048576 bits, and the average PSNR is 34.83 dB. SB and PAMO can reach an embedding capacity of 4 bpp. But the range of SB embedding is 2 bpp to 4 bpp, and the stego-image quality of the picture is lower than that of SPM. When PAMO embeds 1048576 bits of secret data, its average PSNR is 32.90 dB. And through bit-plane analysis and black-and-white image testing, it is proved that the algorithm proposed by us has better security. Therefore, the SPM algorithm has a good performance. In the future, we will try to combine other methods, such as Hamming codes and cellular automata, to increase the embedding capacity of data hiding and maintain better stego-image quality. In addition, we will try to study more applications by using the proposed algorithm, such as watermarking, image authentication and hiding information in encrypted images.
Footnotes
Acknowledgments
This work was sponsored in part by Chongqing Industrial Control System Security Situational Awareness Platform, 2019 Industrial Internet Innovation and Development Project - Provincial Industrial Control System Security Situational Awareness Platform, Center for Research and Innovation in Software Engineering, School of Computer and Information Science (Southwest University, Chongqing 400715, China), and Chongqing Graduate Education Teaching Reform Research Project (yjg203032).
