Modified Multiway Pixel-Value Differencing Methods Based on General Quantization Ranges for Image Steganography

A modified multiway pixel-value differencing method for image steganography using general quantization ranges of pixel pairs’ difference values is proposed, where the widths of the quantization ranges are not limited to be powers of two. The method can be employed to embed a secret message into a cover image with a higher embedding rate. The cover image is partitioned into non-overlapping complete or incomplete blocks using <inline-formula> <tex-math notation="LaTeX">$1 \times 3$ </tex-math></inline-formula>, <inline-formula> <tex-math notation="LaTeX">$2 \times 2$ </tex-math></inline-formula>, <inline-formula> <tex-math notation="LaTeX">$2 \times 3$ </tex-math></inline-formula>, or <inline-formula> <tex-math notation="LaTeX">$3 \times 3$ </tex-math></inline-formula> block templates. The message bitstream, whose bit positions are randomized in advance by use of a random number generator, can be embedded in the resulting blocks. More specifically, one pixel in each block is set as a shared pixel, and the least-significant-bit substitution method with the optimal pixel adjustment process is employed to embed message bits into the shared pixel. Next, the shared pixel in the block is combined with each remaining pixel to form a pixel pair, which is then utilized to embed message bits by a new pixel-value differencing method. Also, the use of non-power-of-two range widths is accomplished by a multiple-based number conversion mechanism, and the shared pixel in each block, as well as each related pixel pair whose two grayscale values pass a falling-off-boundary check, are used to embed the digits of the resulting multiple-based number. The experimental results show that the embedding rates yielded by the proposed method are higher than those yielded by existing multiway pixel-value differencing methods. The stego-images resulting from embedding secret messages retain good image quality, and the RS steganalysis process cannot detect the presence of the embedded secret messages.


I. INTRODUCTION
Steganography [1]- [4] and watermarking [5], [6] techniques are important research topics in the field of multimedia security. Watermarking is the technique of embedding copyrightrelated or authentication information into digital media to protect the copyright or verify the authenticity of the digital media. Steganography is the technique of concealing a secret message in a cover object in an undetectable manner to hide the existence of the message. Steganography should have the three characteristics of imperceptibility, high embedding capacity, and security. In the field of steganography, the leastsignificant-bit (LSB) substitution method [7] and the pixelvalue differencing (PVD) method [8] are both of the type of The associate editor coordinating the review of this manuscript and approving it for publication was Muhammad Imran Tariq . embedding messages in the spatial domains of images. The LSB substitution method [7] aims at embedding messages by replacing the LSBs [1] of image pixels. Chan and Cheng [9] proposed an LSB substitution method with an optimal pixel adjustment process (OPAP) to reduce pixel value changes to improve the resulting image quality. The PVD method [8] is based on the utilization of the characteristics of human vision, where a quantization range table is designed for adjusting the pixel-value differences of 1 × 2 blocks, with fewer bits of information embedded in the smooth blocks and more bits in the rough blocks. Wu et al. [10] used a hybrid technique of using the PVD and LSB substitution methods to increase the embedding capacity of the images. Wang et al. [11] used the PVD method and the modulus function to reduce the distortions of the images after embedding secret messages. Chang et al. [12] partitioned images into 2 × 2 non-overlapping blocks and used a tri-way PVD technique to increase the embedding capacity. Shukla et al. [13] used an arithmetic encoding technique to increase the embedding capacity of the PVD method. Khodaei and Faez [14] and Swain [15] enlarged the 1 × 2 block size used in the PVD method [8] and used a multiway PVD technique with the LSB substitution method together with the OPAP [9] to embed messages. Specifically, the central pixel of the block is first used to embed secret messages by the LSB substitution method with the OPAP [9]. Then, the central pixel and the surrounding pixels form multiple pixel pairs, which are employed to embed secret messages by PVD using a single-sided pixel-value adjustment technique. In the existing PVD methods [8], [10]- [15], the quantization range tables all consist of quantization ranges with widths of powers of two to facilitate direct embedding of bit data. Wu [16] proposed a general pixel-value differencing (GPVD) method based on the PVD method [8] but with the used quantization range widths not limited to be powers of two, and adopted the mechanism of multiple-based number conversion [17]- [21] to embed secret messages into the pixel pairs in images.
In this study, a modified multiway general pixel-value differencing (MMGPVD) method for image steganography with the widths of the quantization ranges not limited to be powers of two is proposed. The method is based on the multiway pixel-value differencing methods proposed in [14], [15], which allows the use of 1 × 3, 2 × 2, 2 × 3, and 3 × 3 block templates to partition images into non-overlapping blocks. Secret messages can be embedded into each partitioned block no matter whether the block is complete or not. The proposed method yields higher embedding rates than multiway PVD methods [14], [15], and maintains good stego-image quality. A random numbering scheme is used in the method to randomize the bit positions of secret messages before embedding them to prevent hackers from knowing about the contents of the hidden messages. Finally, it is demonstrated that it is impossible to use the RS steganalysis method [22] to detect the presence of the secret messages embedded in the stegoimages yielded by the proposed method.
The remainder of this paper is organized as follows. In Section 2, relevant techniques used in this paper are reviewed briefly. The process of the proposed MMGPVD method is described in Section 3. Experimental results and comparisons of them with those yielded by some existing methods are illustrated in Section 4. Finally, some concluding remarks and discussions are stated in Section 5.

II. RELATED TECHNIQUES
In this section, information hiding techniques related to the proposed method are reviewed, including the PVD method [8], the multiway PVD methods [14], [15], and the GPVD method [16].

A. THE PVD METHOD
The PVD data hiding method proposed by Wu and Tsai in 2003 [8] is reviewed at first here. The method begins with partitioning a given grayscale cover image into 1 × 2 nonoverlapping blocks, each block containing a pair of neighboring pixels. Let g 1 and g 2 be the pixel values of the two pixels in a pixel pair P in a block. Denote the pixel-value difference of P as δ, i.e., δ = g 2 − g 1 . (1) By dividing the grayscale range [0, 255] into six quantization ranges as shown in Table 1, the number of embeddable bits in P is decided by the width of the quantization range to which the absolute value |δ| of δ belongs. Denote the number of bits embeddable in P with |δ| in the k-th quantization range [l k , u k ] as n k where k = 1, 2, . . . , 6. Then, n k is computed as where · is the floor function. It can be figured out that the smaller the width of the quantization range is, the fewer the bits embeddable into the pixel pair P, and vice versa, according to Table 1. Furthermore, let M be a message bitstream with n k bits, which may be converted to be a decimal value b. Then, embedding of M into P is conducted by the following two steps.
(1) Compute a new pixel-value difference δ for P as (2) Adjust the original pixel values g 1 and g 2 of P to be g 1 and g 2 , respectively, in the following way: if δ mod 2 = 0; where the operation of mod yields the remainder of integer division, and · and · are the ceiling and floor functions, respectively. Because the adjusted pixel values g 1 and g 2 may be out of the pixel-value range [0, 255], creating black and white sesame seed-like noise in the resulting image, the method [8] performs a falling-off-boundary check on the pixel values g 1 and g 2 in P before embedding the data to determine whether message bits can be embedded into P without causing such noise. The checking scheme is mainly to simulate the embedding by using the maximum value of the quantization range corresponding to |δ| (i.e., the upper bound value u k of the range) to replace l k + b mentioned in Eq. (3) in the following way: The new pixel valuesĝ 1 andĝ 2 , after the simulated embedding process is completed, are computed according to Eqs. (4) VOLUME 10, 2022 and (5) above as well. Subsequently, to determine if g 1 and g 2 are likely to cause pixel values to be out of bounds, the following examination is conducted: false if 0 ≤ĝ 1 ≤ 255 and 0 ≤ĝ 2 ≤ 255; true otherwise.
If neitherĝ 1 norĝ 2 is out of bounds, the value of the function fall_off (g 1 , g 2 ) will be false. In this case, b can be embedded into the block by Eqs. (3) and (4); or, in other words, any message is embeddable into the pixel pair P. On the contrary, if the value of fall_off (g 1 , g 2 ) is true, it means that data embedded in g 1 or g 2 might exceed the boundary of 0 or 255, and no data are embedded in P in this case by the method [8].
When extracting an embedded secret message, at first the stego-image is partitioned into the same 1 × 2 nonoverlapping blocks as those obtained in the message embedding process with each block being a pixel pair. Let g * 1 and g * 2 be the values of two pixels in a pixel pair P. The pixel-value difference of the two pixels is denoted as δ * so that The absolute value of δ * is then used to determine the corresponding quantization range R of P in Table 1, and the pixel values g * 1 and g * 2 of the two pixels in P are taken to go through the falling-off-boundary check in the same way described by Eqs. (4), (5) and (6) as done in the embedding process to determine whether g * 1 or g * 2 is likely to be out of bounds when data embedding is performed. If it is judged that no possibility of out-of-bounds will result, it means that P has previously been used to embed a secret message b * , which can then be extracted from P to be b * = δ * − l k (8) where l k is the lower bound value of the quantization range R.

B. THE MULTIWAY PVD METHODS
Khodaei and Faez [14] extended the block size used in the PVD method [8] from 1 × 2 to 1 × 3. Table 2 shows the quantization range table used in the method. The central pixel in each block is chosen as a shared pixel denoted as p s , and the k-bit LSB substitution method [7] is applied to the pixel value g of p s to obtain a new pixel value g . The difference value δ between g and g is calculated as and the OPAP [9] is performed on g to obtain an adjusted value g of p s as described in the following: Subsequently, the shared pixel p s is combined with its left and right pixels, respectively, to form two pixel pairs, and message bits are embedded into each pixel pair P i by keeping the pixel value g of p s unchanged while modifying the pixel value g i of the other pixel p i in P i by the following steps.
(1) Compute the absolute difference value δ i of p s and p i as (2) Let the quantization range to which the value δ i belongs be [l k , u k ] whose embedding capacity is defined to be t k in advance as shown in the last row of Table 2. (3) Convert the bitstream of an input message M with t k bits into a decimal value b. (4) Create a new difference δ i between the two pixels in P i as (5) Compute two candidate pixel values g i1 and g i2 in terms of δ i for p i as follows: (6) Select one of g i1 and g i2 for use as the final pixel value g i of p i in P i by the following way to end the messagebit embedding process: and 0 ≤g i1 ≤ 255; g i2 otherwise.
Swain [15] modified the method proposed by Khodaei and Faez [14] by using 2 × 3 and 3 × 3 blocks, and used the shared pixel to form five and eight pixel pairs with the surrounding pixels for the two block types, respectively, to increase the embedding capacity. A problem that the pixel values yielded by Khodaei and Faez's method [14] after message embedding may exceed the boundaries of 0 or 255 is solved by modifying Eq. (11) described previously for selecting the pixel value g i for p i in P i to be and g i2 ≤ 255; g i2 otherwise. (12)

C. THE GPVD METHOD
A PVD method based on the use of general quantization ranges (GPVD) was proposed by Wu [16] in 2021. Similar to the original PVD method [8], this method was also proposed to partition the cover image into 1 × 2 non-overlapping blocks but removed the restriction of limiting the widths of the quantization ranges to be powers of two, as shown in Table 3. Also, the secret message bits are converted into a multiple-based number [17]- [21] and each digit in the number is embedded into a corresponding block in the image.
The so-called multiple-based number is one with the bases of the digits being not all identical. An n-digit multiple-based number N can be represented by

1) THE MESSAGE EMBEDDING PROCESS
Specifically, in Wu [16] a given B-bit message bitstream is transformed into a decimal value m at first. Then, the pixel pairs P i with i = 0, 1, 2, . . . of the cover image C, which can be utilized to embed data without causing noise as mentioned in Section II.A, are identified and used in order for embedding m in the message embedding process described by the following steps.
(1) Let P i be the i-th pixel pair in the cover image with pixel values (g i1 , g i2 ), which can be used to embedded data.
(2) Compute the pixel-value difference δ i of g i1 and g i2 according to Eq. (1). (3) Let the quantization range R corresponding to δ i in Table 3 be [l k , u k ]. (4) Define the base value b i of digit d i in the multiplebased number N described above, which corresponds to the pixel pair P i , to be the width of the quantization range R, namely, u k − l k + 1, as shown in Table 3.
where the operation of mod yields the remainder of integer division. (6) Compute a new pixel-value difference δ i for pixel pair P i in terms of the lower bound value l k in the quantization range R and the digit value of d i as (7) Adjust the two pixel values (g i1 , g i2 ) of pixel pair P i as follows to conduct the message embedding of the digit value d i in P i : where the operation of mod yields the remainder of integer division, and · and · are the ceiling and floor functions, respectively. (8) If the condition i b i ≥ 2 B is met, then end the message bitstream embedding process with the resulting image C as the output; otherwise, compute a new decimal value m as follows and continue: where the operation of div yields the quotient of integer division. (9) Repeat the previous steps with the new value of m to embed more digits of the multiple-based number N until done. As an illustration example, suppose that it is desired to embed a 10-bit secret bitstream 1011001000 2 = 712 10 into four pixel pairs whose pixel values are (90, 110), (73, 60), (100, 250), and (150, 153), respectively, as shown in Fig. 1. Firstly, all pixel-value differences are calculated according to Eq. (1). The resulting differences are 20, −13, 150, and 3 which correspond to respectively the quantization ranges [20,34], [9,19], [131,255], and [0,8] in Table 3. Then, each of the four pixel pairs are taken to go through the falling-off-boundary check using equations similarly to Eqs. (4) through (6). Among them, the pixel pair (100, 250) is found to be out of bounds, as shown by the following computations: pixel value difference δ = 250 − 100 = 150 by Eq. (1); δ ∈ [l 6 , u 6 ] = [131, 255] according to Table 3; (4); fall_off(100, 250) = true by Eq (6). Therefore, no data can be embedded into this pixel pair and the pixel values are kept unchanged. As to the pixel-value differences of the other three pixel pairs, the corresponding widths of the quantization ranges are 15, 11, and 9, respectively. By using Eq. (13), the corresponding digit values in the multiple-based number can be calculated to be 7, 3, and 4, respectively, as shown in the following: 712 mod 15 = 7 with quotient Q 1 = 47; 47 mod 11 = 3 with quotient Q 2 = 4; 4 mod 9 = 4 with quotient Q 3 = 0.
Finally, these digit values are embedded into the corresponding pixel pairs by use of Eqs. (14) and (15)

2) THE MESSAGE EXTRACTION PROCESS
To retrieve the secret message from a stego-image S, the same group of pixel pairs which were used to embed message data without causing noise as mentioned in the Section II.A are used in the message extraction process. Firstly, denote the message data to be extracted as m with its initial value set to be 0. Also, define a parameter c i and set its initial value c 0 to be 1. Then, the B-bit message bitstream M can be extracted from the pixel pairs in S in order for i = 0, 1, . . . by the following steps.
(1) Let P i denote the i-th pixel pair with pixel values (g * i1 , g * i2 ) in the stego-image S, which can be used for extracting data.
(2) Compute the pixel-value difference δ * i of g * i1 and g * i2 according to Eq. (1). (3) Let the quantization range R corresponding to δ * i in Table 3 be [l k , u k ]. (4) Define the base value b i of digit d i in the multiple-based number N described previously, which corresponds to the pixel pair P i , as the width of the quantization range R, namely, u k − l k + 1, as shown in Table 3.
(6) Create a new digit place value represented by d i in m by modifying m in the following way: (8) If the condition c i+1 ≥ 2 B is met, end the message extraction process and convert m to be a bit string of length B as output; otherwise, continue the processing of the next pixel pair by repeating the previous steps. As an illustrative example of message extraction, suppose that it is desired to extract the embedded 10-bit secret message from the four pixel pairs (87, 114), (72, 60), (100, 250), and (149, 153) mentioned in the previous example of message embedding. Firstly, the pixel-value differences of the pixel pairs are calculated to be 27, −12, 150, 4, respectively, using Eq. (1). From Table 3, these differences can be determined to belong to the quantization ranges [20,34], [9,19], [131,255], and [0, 8], respectively. Then, the four pixel pairs are taken to go through the falling-off-boundary checks with pixel pair (100, 250) being checked to be out of the bounds as described above in the message embedding process, showing that no secret message was embedded into the pixel pair previously. The range widths of the pixel-value differences for the remaining three pixel pairs are 15, 11, and 9, respectively. Accordingly, Eq. (17) is used to extract respectively from these three pixel pairs the values 7, 3, and 4 of the corresponding digits in the multiple-based number. Therefore, the resulting multiple-based number is 4 9 3 11 7 15 , which is then converted into the decimal value 712 10 , alternatively into the 10-digit bitstream 1011001000 2 , and finally taken to be the extracted secret message as the output.

III. PROPOSED MMGPVD METHOD
In the proposed MMGPVD method, which is based on the GPVD technique [16], the adopted quantization range table is shown in Table 4. The method can be applied to block templates of various sizes, including 1 × 3, 2 × 2, 2 × 3, and 3 × 3, as shown in Fig. 2, where g 0 denotes the shared pixel of a given block and can be used to form multiple pixel pairs with other pixels in the block.   The proposed data embedding method partitions a cover image sequentially into non-overlapping blocks in a rasterscan order according to the sizes of the selected block templates as shown in Fig. 2. When partitioning the image in this way, it is possible that there will leave residual pixels to the right or on the bottom of the cover image. In this study, the same block templates are applied to these residual pixels to form as many incomplete blocks as possible in order to embed as many secret message bits as possible to raise the embedding rate. Fig. 3 is a schematic diagram of the partitioning of a 3 × 5 image using the 2 × 2 block template. Fig. 3(a) shows the first complete block in a raster-scan order, while Fig. 3(b) shows the first incomplete block. A total of two complete blocks and four incomplete blocks will be formed after the image partitioning is completed.

A. THE MESSAGE EMBEDDING PROCESS
Like the original PVD method [8], the proposed MMGPVD method performs a falling-off-boundary check on each pixel pair before embedding the secret message to avoid the problem that the new pixel values may be out of the grayscale range of 0 to 255 after message embedding. Because the proposed method only adjusts the pixel value of a single-pixel in the pixel pair when embedding data, unlike the traditional PVD method [8] which adjusts the pixel values of both pixels, the proposed method also performs a falling-off-boundary check in a way that only adjusts the pixel value of a single pixel in the pixel pair.

1) FALLING-OFF-BOUNDARY CHECK
In addition, the proposed method also performs the fallingoff-boundary checking on each pixel pair before extracting VOLUME 10, 2022 the secret message. If the checking result reveals that message embedding may cause the pixel values of a pixel pair to be out of the range of 0 to 255, it means that the pixel pair has not been used to embed message bits, and nothing should be extracted from it. Algorithm 1 below explains how the proposed MMGPVD steganographic method performs the falling-off-boundary check. Algorithm 1 will be called both in Algorithms 2 and 3 in the following.

Algorithm 1 (Falling-Off-Boundary Checking for Identifying Usable Pixel Pairs):
Input: a pixel pair P(g 0 , g 1 ). Output: checking result S (true or false), indicating whether the pixel values of the input pixel pair fall possibly outside the grayscale range of 0 to 255 when P is used to embed a secret message. Steps: Step 1. Calculate the pixel-value difference δ of the two pixels g 0 and g 1 of the pixel pair P as Step 2. Assume the quantization range corresponding to |δ| to be the k-th quantization range [l k , u k ] of the quantization range table, Table 4, with l k and u k satisfying the condition l k ≤ |δ| ≤ u k . Step 3. Use u k as the new pixel difference value for performing falling-off-boundary checks in the following way to determine whether the boundaries are likely to be exceeded after message embedding. 3.1 //Simulating message embedding by adjusting g 1 while keeping g 0 unchanged Compute a new pixel valueĝ 1 for g 1 aŝ 3.2 Determine ifĝ 1 is outside the pixel value range of 0 to 255 to obtain the checking result S as Step 4. Exit with S as the desired output.

2) THE MESSAGE EMBEDDING ALGORITHM
When using the proposed MMGPVD steganographic method to embed secret messages, the cover image is firstly partitioned sequentially in a raster-scan order into nonoverlapping blocks using a block template. Each block so obtained may be a complete block or an incomplete one. The message bits are firstly embedded in the block's shared pixel using the t-bit LSB substitution method and the OPAP [9]. Then, message bits are embedded in the pixel pairs in the block in order according to the concept of multiple-based number proposed in the GPVD method [16]. The proposed method can use block templates of the sizes of 1 × 3, 2 × 2, 2 × 3, or 3 × 3. In addition, the bit order of the secret message is randomized before message embedding using a random number generator controlled by a secret key. The secret key can be produced by any appropriate key generator. The same secret key should be used in the embedding and extraction processes. Algorithm 2 below includes the details of the message embedding process. It is noted that in the following algorithm, an n-digit multiple-based number N described in the following is assumed to be created with its digits being embedded in the pixels of the cover image:

Algorithm 2 (Message Data Embedding Based on the Concept of Multiple-Based Number):
Input: (1) a cover image C with size W × H ; (2) a block template T with size w × h and pixels p 0 , p 1 , . . . , p (w×h−1) ; (3) a secret message M with bit length ; (4) a secret key K and a random number generator G; and (5) a parameter t of the number of bits embedded in each shared pixel of the partitioned blocks. Output: stego-image S. Steps: Stage 1: Initialization.
Step 1. Use template T to partition C into n non-overlapping blocks in a raster-scan order with n = W /w × H /h with the resulting blocks either being complete or incomplete; let pixel p i,j be the j-th pixel in the i-th block B i , where j = 0, 1, . . . , (w × h − 1), and i = 1, 2, . . . , n; and let p i,0 be the selected shared pixel of B i , and P i,j (g i,0 , g i,j ) be the j-th pixel pair of B i with pixel values g i,0 and g i,j , where j = 1, 2, . . . , (w × h − 1), and i = 1, 2, . . . , n.
Step 2. Use the secret key K and the random number generator G to randomize the bit positions in M ; convert the resulting M into a big-integer m; and define a biginteger c with an initial value 1 for use in deciding whether message embedding into shared pixels and pixel pairs should be ended. Stage 2: Processing of the blocks one by one.
Step 3. Set r to be −1, and perform Step 3.1 through Step 3.8 for i = 1, 2, . . . , n in order. Stage 2.1 Processing of the shared pixel of each block.
3.1 If the shared pixel p i,0 of the i-th block B i is not within the scope of C, then regard B i as unusable for embedding messages, and skip to Step 3.8 to process the next block; otherwise, continue. 3.2 Set r = r +1; assign the value 2 t as the base b r of shared pixel p i,0 where t is a pre-selected parameter; and calculate the value d r of the r-th digit in the multiple-based number N as where the operation of mod yields the remainder of integer division. 3.3 Embed d r into shared pixel p i,0 with value g i,0 using the t-bit LSB substitution technique, resulting in a new pixel value g i,0 computed as follows for use as the new pixel value of p i,0 : where the operation of div yields the quotient of integer division. 3.4 Adjust the pixel value g i,0 of p i,0 by the OPAP method [9] according to the following formula, resulting in a new pixel value g i,0 of the shared pixel p i,0 : 3.5 Compute a new value for m by the following formula: where the operation of div yields the quotient of integer division. (a) If pixel p i,j of the j-th pixel in the i-th block B i is not within the scope of C, then regard pixel pair P i,j consisting of p i,0 and p i,j as unusable for embedding messages, and skip to Step 3.7(k) to process the next pixel pair; otherwise, continue. (b) Perform the falling-off-boundary check on pixel pair P i,j (g i,0 ,g i,j ) using Algorithm 1 where g i,0 is the adjusted pixel value of shared pixel p i,0 ; and if the checking result is true, then regard the boundary as likely to be exceeded so that pixel pair P i,j is unusable for message embedding and skip to Step 3.7(k); otherwise, continue. (c) Calculate the pixel-value difference δ i,j of the two pixel values g i,0 and g i,j of the pixel pair P i,j as (d) Assume that the quantization range corresponding to δ i,j is the k-th range [l k , u k ] in the difference quantization table, with l k and u k satisfying the condition l k ≤ |δ i,j | ≤ u k . (e) //If the width of [l k , u k ] is 1, the pixel pair is unusable for embedding.
If u k −l k + 1 = 1, then skip to Step 3.7(k); otherwise, continue. (f) Set r = r +1; assign the value u k −l k +1 as the base b r of the pixel pair P i,j ; and calculate the value d r of the r-th digit in the multiple-based number N as where the operation of mod yields the remainder of integer division. (g) Compute a new pixel-value difference δ as (h) //Embedding the digit d r by adjusting g i,j while keeping g i,0 unchanged Compute a new pixel value g i,j for g i,j of pixel p i,j as (i) Compute a new value for m by: where the operation of div yields the quotient of integer division. Step 4. Exit with the resulting image as the desired stego-image S. The block template T , bit length of the secret message, secret key K , and bit number parameter t are the required side information for use in the message embedding process of the proposed method as can be seen in Algorithm 2 above. All the information needs to be transmitted to the message extraction side for use in the message extraction process.

3) AN ILLUSTRATIVE EXAMPLE OF MESSAGE EMBEDDING
The following example illustrates the message embedding process described by Algorithm 2. Suppose that it is desired to embed an 18-bit secret message bitstream M = 101100100000101100 into a 2 × 3 cover image using the 2 × 2 block template shown in Fig. 2 Table 4. This bitstream M is equivalent to a decimal value m = 182316 after it is converted from binary to decimal. As shown in Fig. 4, the cover image C is partitioned into two non-overlapping blocks using the 2 × 2 block template.

a: PROCESSING OF THE FIRST BLOCK
Embedding of the decimal value m starts from dealing with the first block B 1 . The pixel value of the shared pixel p 10 of B 1 is g 10 = 96 = 01100000 2 . If the number t of bits to be embedded in p 10 by the LSB substitution method is 4, the proposed method treats p 10 as a pixel that provides a digit b 0 of the multiple-based number N , and sets the corresponding base to be b 0 = 2 4 = 16. Then, the value of m mod 16 is computed according to Eq. (23), resulting in the remainder 12 = 1100 2 . It means that the resulting least significant digit d 0 of the multiple-based number is 12 16 . The lowest four bits of the shared pixel p 10 are then replaced with 1100 2 , giving a new pixel value g 10 = 108 = 01101100 2 according to Eq. (24) as shown by the following computation: b 0 = 16; d 0 = 12; g 10 = 96; Then, the OPAP [9] is performed on the pixel value of p 10 according to Eq. (25) as shown in the following computation: The shared pixel p 10 and the other pixels in the first block form three pixel pairs, denoted in order as P 11 , P 12 , and P 13 with their respective pixel values being (92, 117), (92, 82), and (92, 228) where 92 is the new value g 10 of the shared pixel p 10 . The pixel-value differences of these pixel pairs are 25, −10, and 136, respectively, which correspond to respectively the quantization ranges of [20,34], [9,19], and [111,173] in Table 4. The falling-off-boundary check described by Algorithm 1 is then performed on the three pixel pairs P 11 , P 12 , and P 13 . One of the new values (92, 265) of the two pixels in P 13 resulting from applying Eq. (21) on the original values (92, 228), namely, 265 is found to be out of bounds; therefore, P 13 is not used for message embedding. The widths of the quantization ranges corresponding to the pixel-value differences δ 11 and δ 12 of the remaining two pixel pairs P 11 and P 12 are 15 and 11, respectively, according to Table 4. The proposed method treats each of P 11 and P 12 as a pixel pair that provides a digit of the multiple-based number N , and sets the corresponding bases to be b 1 = 15 and b 2 = 11, respectively. Accordingly, a digit d 1 = 9 15 of N is formed from the computation of m mod 15 with 9 as the remainder. The value 9 of the digit d 1 is then embedded into pixel pair P 11   Furthermore, it is noted that the second block is an incomplete block, so the shared pixel p 20 can only be used to form one pixel pair with the other pixel in B 2 , denoted as P 23 with pixel values (37, 45) where 37 is the previously-mentioned new value g 20 of p 20 . The pixel-value difference δ 23 of P 23 is 45 − 37 = 8, to which the corresponding quantization range in Table 4  After processing pixel pair P 23 , computation of div 9 on m yields 0. At this point, the product of all created bases which form the multi-based number N is It can be verified that 380160 ≥ 2 18 , meaning that the embedding of the 18-bit secret message is complete, and the resulting multiple-based number N is N = 4 9 5 16 0 11 9 15 12 16 = 182316 which is exactly the decimal value m = 182316 of the message M desired to be embedded, as expected.

B. THE MESSAGE EXTRACTION PROCESS
When using the proposed MMGPVD steganographic method to extract secret messages, the stego-image is first partitioned into non-overlapping blocks in a raster-scan order using the same block template as that specified in the side information. The image is sequentially partitioned, creating both complete blocks and incomplete ones identical to those obtained in the embedding process. The message bitstream is first extracted for the shared pixel in each block using the multi-bit LSB substitution method [7]; then, the multiple pixel pairs in the block are processed according to the GPVD concept [16] in order. Finally, the bit positions of the extracted data are de-randomized using the same secret key and the same random number generator as used in the embedding process. Algorithm 3 below shows how to extract a secret message bitstream from a stego-image using the proposed method, where the input items (2) through (4) are the side information used in the message embedding process (Algorithm 2).

Algorithm 3 (Message Data Extraction): Input:
(1) a stego-image S with size W × H ; (2) the block template T with size w × h and pixels p 0 , p 1 , . . . p (w×h−1) ; (3) the secret key K , and the random number generator G; (4) the parameter t of the number of bits embedded in each shared pixel of the partitioned blocks Output: Secret message M with bit length . Steps: Stage 1: Initialization.
Step 1. Use template T to partition S into n non-overlapping blocks in a raster-scan order with n = W /w × H /h where the resulting blocks contain both complete and incomplete blocks; let pixel p i,j be the j-th pixel in the i-th block B i , where j = 0, 1, . . . , (w × h − 1), and i = 1, 2, . . . , n; and let p i,0 be the shared pixel of the i-th block, and P i,j (g i,0 , g i,j ) be the j-th pixel pair of the i-th block with pixel values g i,0 and g i,j , where j = 1, 2, . . . , (w×h − 1), and i = 1, 2, . . . , n.
Step 2. Set a big-integer m to be 0 and define a big-integer c with an initial value 1 for use in deciding whether message extraction from the shared pixels and pixel pairs is completed. VOLUME 10, 2022 Stage 2: Processing of the blocks one by one.

Stage 2.1 Processing of the shared pixel of each block.
3.1 If the shared pixel p i,0 of the i-th block B i is not within the scope of S, then regard B i as unusable for message extraction, and skip to Step 3.6; otherwise, continue. 3.2 Set r = r +1, extract the value d r of the r-th digit in the multiple-based number N from the t LSBs of shared pixel p i,0 as where the operation of mod yields the remainder of integer division. If the checking result is true, which means that the pixel pair has not used for embedding secret messages previously in the embedding process, then skip to Step 3.5(i) accordingly; otherwise, continue. (c) Calculate the pixel-value difference δ i,j of the two pixels g i,0 and g i,j of pixel pair P i,j as (d) Assume that the quantization range corresponding to δ i,j is the k-th range [l k , u k ] in the quantization range table, with l k and u k satisfying the condition l k ≤ |δ i,j | ≤u k . (e) //If the width of [l k , u k ] is 1, the pixel pair cannot be used to embed secret messages, and no information can be retrieved from it. If u k −l k + 1 = 1, then skip to Step 3.5(i); otherwise, continue. (f) Add 1 to r, and extract the value d r of the r-th digit in the multiple-based number N , which corresponds to the pixel pair P i,j (g i,0 ,g i,j ), as Step 4. Convert m into an -bit bitstream, and de-randomize the bit positions using secret key K and random number generator G. Exit with the resulting bitstream as the desired secret message M .

2) AN ILLUSTRATIVE EXAMPLE OF MESSAGE EXTRACTION
The following is an example to illustrate the message extraction process of the proposed MMGPVD method. As depicted by Fig. 5, it is assumed that a secret message bitstream M of 18 bits is to be extracted from the resulting stego-image of the previous example. Above all, the 2 × 3 stego-image is partitioned into two non-overlapping blocks B 1 and B 2 using the same 2 × 2 block template as that used in the message embedding process.  table in Table 4.

a: PROCESSING OF THE FIRST BLOCK
Extraction of the decimal value m of the stego-message M starts from dealing with the first block B 1 . The value of m is set to be 0 initially. The pixel value of the shared pixel p 10 of B 1 is 92 = 01011100 2 . Presumably, the number t of bits to be extracted from p 10 by the LSB substitution method is known to be 4. Also, p 10 is treated as a pixel that provides a digit d 0 of the multiple-based number N , and the corresponding base is taken to be b 0 = 2 4 = 16. Therefore, according to Eq. (32), the value 92 mod 2 4 = 12 is computed, which means that the extracted least significant digit d 0 of the multiple-based number is d 0 = 12 16 . After processing the shared pixel p 10 , the place value of d 0 of the multiple-based number N is added to m according to Eq. (33), resulting in the new value m = 12.
The shared pixel p 10 and the other pixels in the first block form three pixel pairs, denoted in order as P 11 , P 12 , and P 13 with their respective pixel values being (92, 121), (92, 83), and (92, 228). The pixel-value differences of these pixel pairs are δ 11 = 29, δ 12 = −9, and δ 13 = 136, respectively, which correspond to respectively the quantization ranges of [l 3 , u 3 ] = [20,34], [l 2 , u 2 ] = [9,19], and [l 6 , u 6 ] = [111, 173] in Table 4. The falling-off-boundary check described by Algorithm 1 is then performed on the three pixel pairs P 11 , P 12 , and P 13 . One of the values (92, 265) of the two pixels in P 13 resulting from applying Eq. (21) on the original values (92, 228), namely, 265 is found to be out of bounds; therefore, P 13 is decided to be unused previously in the message embedding process, and no information should be extracted from it. The quantization ranges corresponding to the values of the pixel-value differences δ 11 and δ 12 of the remaining two pixel pairs P 11 After processing pixel pairs P 11 and P 12 , the place value of each of d 1  Furthermore, it is noted that the second block is an incomplete block, so the shared pixel p 20 can only be used to form one pixel pair with the other pixel in B 2 , denoted as P 23 with pixel values (37, 41). The pixel-value difference δ 23 of P 23 is 41 − 37 = 4, to which the corresponding quantization range in Table 4  Finally, the decimal value 182316 is converted to be an 18-bit bitstream 101100100000101100, which is the extracted secret message M , as expected.

IV. EXPERIMENTAL RESULTS AND COMPARISION WITH OTHER METHODS
In this section, some experimental results yielded by the proposed method are described, followed by a comparison of the results with those yielded by four other related methods.

A. EXPERIMENTAL RESULTS
In the experiments conducted in this study, six cover images named Baboon, Jet, Peppers, Boat, Tree, and House were used, as shown in Fig. 6, all of which are 512 × 512 grayscale images. Experiments were proceeded by using the computer language C# with the BigInteger class for big-integer processing. As shown in Table 5, the experiment began with partitioning the 512 × 512 images by 1 × 3, 2 × 2, 2 × 3, and 3 × 3 block templates, and then compared the results in the aspects of the numbers of complete and incomplete blocks, the number of shared pixels, and the number of pixel pairs obtained. Some incomplete blocks were formed when using the 1 × 3, 2 × 3, and 3 × 3 block templates. The use of the 1 × 3 block template yields the largest number of shared pixels, with the rest being 2 × 2, 2 × 3, and 3 × 3 block templates in order. The use of the 3 × 3 block template yields the largest number of pixel pairs, with the rest being 2 × 3, 2 × 2, and 1 × 3 block templates in order.
In Table 6, the embedding rate and the resulting image quality of the stego-images for each image of Fig. 6 after message embedding using the proposed method are shown. The embedding rate is defined as the number of embedded bits per pixel in the image. The value of the peak signalto-noise ratio (PSNR) is used to assess the quality of each resulting image. The higher the PSNR value of a resulting image, the lower the difference of the image from the original one and the less likely the human eye will detect the embedded information.
The quantization range table used in the experiments is presented in Table 4. The 4-bit LSB substitution method [7] with VOLUME 10, 2022 the OPAP [9] was employed. The embedded secret messages are random bitstreams. In Table 6, it can be observed that except for the Baboon image, the highest embedding rate was obtained by use of the 1 × 3 block template, followed by the uses of the block templates of sizes 2 × 2, 2 × 3, and finally 3 × 3 in order. The reason for this can be seen from Table 5. The number of blocks obtained by using the 1 × 3 block template is the largest, with the shared pixel in each block being usable for embedding data in the four LSBs; therefore, the amount of message embedding is also larger.  In addition, the image Baboon includes rougher texture, and the pixel-value differences of the adjacent pixels in the image are larger. Therefore, by the proposed method more message bits can be embedded in Baboon than in the other images with smoother texture. Also, the embedding amount using this image is the highest by the use of the 2 × 2 block template and the lowest by the use of the 1 × 3 block template, unlike the other images. In Table 6, the PSNR values of all the stego-images are above 30 dB, which means that the changes to the images are not easily detectable by the human eye, demonstrating the imperceptibility of the hidden data embedded by the proposed method.
Figs. 7 and 8 show some resulting stego-images after using the proposed method with 1 × 3, 2 × 2, 2 × 3, and 3 × 3 block templates for embedding secret messages. Fig. 7 shows the stego-images of Fig. 6(a), and Fig. 8 shows the stegoimages of Fig. 6(c). As can be seen from the images in the two figures, the differences between the stego-images and the original ones are invisible to the human eye. The resulting image quality remains good after embedding the secret messages. The stego-images after embedding using various block templates for Fig. 6(a). (a) using the 1 × 3 block template; (b) using the 2 × 2 block template; (c) using the 2 × 3 block template; (d) using the 3 × 3 block template.
Also, the RS steganalysis method [22] was used to check whether the hidden secret messages in the stego-images can be detected. In the diagrams of the results yielded by this method [22], there are four curves of R M , R −M , S M , and S −M , respectively. If the RS steganalysis method detects the presence of hidden information in the stego-image, the R M and R −M curves will be clearly separated, as will the S M and S −M curves. If the RS steganalysis method does not detect the hidden information, the two curves R M and R −M will be very close to each other, as will the two curves S M and S −M . Figs. 9 and 10 show some resulting diagrams of the RS steganalysis for the stego-images. Specifically, Fig. 9 shows the results for stego-images in Fig. 7, and Fig. 10 shows the results for stego-images in Fig. 8. It can be observed in all these results that R M and R −M almost overlap, and S M and S −M also appear to be so. It means that the RS steganalysis does not detect the hidden secret messages in the stegoimages yielded by the proposed MMGPVD method using the four different sizes of block templates. These observations prove that the proposed method is secure from the viewpoint of RS steganalysis [22].

B. COMPARISONS WITH OTHER METHODS ABOUT EMBEDDING RATES
In Table 7, a comparison of the embedding rates and the PSNR values yielded by the proposed method with those yielded by the methods proposed by Wu and Tsai [8], Wu [16], Khodaei and Faez [14], and Swain [15] are shown. The embedding rates of the proposed method using 1 × 3   [14], and Swain [15].  [14], and Swain [15] using the quantization rage table shown in Table 4.
block template and the 3 × 3 block template are higher respectively than those yielded by the methods of [14] and [15] which use block templates of the same sizes. There are two possible reasons for this comparison result. The first reason is that the pixel-value differences of adjacent pixels in a general image are primarily distributed in quantization ranges near the value zero. The quantization range table used in the proposed method is designed to have a larger range width in the two ranges near zero, when compared with the quantization range table used in the methods proposed by FIGURE 8. The stego-images after embedding using various block templates for Fig. 6(c). (a) using the 1 × 3 block template; (b) using the 2 × 2 block template; (c) using the 2 × 3 block template; (d) using the 3 × 3 block template.
[14] and [15], so that the embedding rates yielded by the proposed method are higher. The second reason is that the embedding is performed regardless of whether the block is complete or incomplete in the proposed method; however, the methods proposed by [14] and [15] seem to embed messages only in partitioned complete blocks. Therefore, the embedding rates yielded by the proposed method are higher. The proposed method also has higher PSNR values when using the 1 × 3 and 3 × 3 block templates than those respective PSNR values resulting from the methods proposed by [14] and [15]. This is probably because the proposed method performs the falling-off-boundary checks on the pixel pairs before message embedding, and only embeds messages into pixel pairs that do not exceed the boundaries. In contrast, the method proposed by [14] and [15] embeds messages in all pixel pairs, causing the gray-value differences between the selected pixel values by Eqs. (11) and (12) and the original pixel values too large and affecting the overall resulting image quality.  Table 8 shows another comparison of the embedding rates and the PSNR values yielded by the embedding processes according to the quantization rage table shown in Table 4 using five methods, including the one proposed in this paper and four ones proposed respectively by Wu and Tsai [8], Wu [16], Khodaei and Faez [14], and Swain [15]. Note that the widths of the quantization ranges used by the proposed method and those proposed by Wu [16] are not limited to powers of two while the three methods of [8], [14], [15] on the contrary use quantization range tables with power-of-two ranges originally. Therefore, as a unification of the used range widths, the experiment conducted for this comparison has used Table 4 as the quantization range table for all the three methods of [8], [14], [15] where the range widths used in Table 4 are not limited to be powers of two. As shown in Table 8, the embedding rates of the method proposed in this paper are higher than those yielded by the methods proposed in [8], [14]- [16]. When comparing the results coming from using block templates of the same size, the proposed method has 5% to 8% higher embedding rates than the method proposed by [14] and 8% to 13% higher embedding rates than the method proposed by [15]. For example, for the 1 × 3 block template, the proposed method yields the embedding rate of 3.715 with the image of Baboon as the input and the method by Khodaei and Faez [14] yields the embedding rate of 3.413, leading to a promotion of 8.8% created by the proposed method as shown in the following: In addition, the PSNR values of the stego-images yielded by the proposed method are all above 30.8dB, indicating that the difference of the stego-images from the input images cannot be easily perceived by the human eye.

V. CONCLUSION AND DISCUSSIONS
A modified multiway general pixel-value differencing (MMGPVD) method has been proposed in this study, which improves the MPVD methods of Khodaei and Faez [14], and Swain [15]. The main improvements include: (1) the block templates include more versions, namely, 1 × 3, 2 × 2, 2 × 3, and 3 × 3, which are more diverse and can be employed to raise possibly message embedding rates; (2) the partitioned image blocks can be used to embed message bits regardless of whether they are complete or incomplete blocks, allowing more embedding space; (3) a falling-off-boundary check is performed on the pixel pairs before using them to embed secret data, in order to prevent the grayscale values of the pixel pairs from getting out of bounds after message embedding, so that the resulting stego-image qualities are better than those of the results yielded by the methods of [14] and [15]; (4) the widths of the adopted quantization ranges are not limited to be powers of two, which are more flexible than those used by the methods of [14] and [15] which utilize quantization ranges with power-of-two widths. In addition, the proposed method uses a secret key and a random number generator to randomize the bit positions of the secret message bitstream to enhance the security of the hidden message. The experimental results show that the proposed MMGPVD method yields better stego-images than the existing multiway pixel-value differencing methods in the aspects of embedding rate and image quality.