A method for hiding information in a JPEG image based on direction correction
By grouping and correcting the orientation of the quantized DCT coefficients of JPEG images, and designing a quaternary reference matrix for data correction, the problems of insufficient embedding capacity and image quality in JPEG image information hiding are solved, and more efficient information hiding is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2023-03-28
- Publication Date
- 2026-05-01
AI Technical Summary
Existing JPEG image information hiding techniques are insufficient in terms of embedding capacity, image quality, and file size, and cannot meet the application requirements in the current environment.
A JPEG image information hiding method based on orientation correction is adopted. By grouping the quantized DCT coefficients and designing orientation correction rules, non-continuous zero AC coefficients are selected to embed secret information, and a quaternary reference matrix is used for data correction and entropy coding.
It significantly increases embedding capacity, improves image visual quality, and reduces file increment, achieving a more efficient information hiding effect.
Smart Images

Figure CN116405610B_ABST
Abstract
Description
A JPEG image information hiding method based on orientation correction Technical Field
[0001] This invention belongs to the field of information hiding technology, and in particular relates to a method for hiding information in JPEG images based on direction correction. Background Technology
[0002] With the development of the internet and portable digital products, multimedia data such as images and videos have become the main medium for information transmission on the network. More and more users are choosing to use public platforms on the network, such as Weibo, WeChat, and cloud storage, to store their personal data, which poses a certain security threat to users' privacy. Information hiding technology is an important data protection technology. It utilizes the insensitivity of the human visual system and the redundancy of images to embed the information to be protected into another public carrier. The carrier with embedded information is visually indistinguishable from the original carrier, thus ensuring the security of confidential information. The Joint Photographic Experts Group (JPEG) is one of the most widely used image formats on the network. However, JPEG images have problems such as low redundancy, limited embedding capacity, and the ease with which arbitrary modifications to data in the compressed domain can cause significant visual distortion. Therefore, information hiding on JPEG images is more challenging and has become one of the hot topics in the field of information hiding research.
[0003] In 2015, Huang et al. (Huang Fangjun, Qu Xiaochao, Kim H J, et al. Reversible data hiding in JPEG images[J]. IEEE Transactions on Circuits and Systems for Video Technology, 2015, 26(9):1610-1621.) proposed a JPEG information hiding method based on one-dimensional DCT coefficient histogram translation. This method embeds the secret information into AC coefficients with an absolute value of 1, while DC coefficients and zero coefficients remain unchanged. The remaining AC coefficients are translated to free up redundant space for the secret information. Simultaneously, this method proposes to prioritize embedding DCT blocks with more zero coefficients, thus increasing the embedding capacity while maintaining the file size. Subsequently, Hou et al. (Hou Dongdong, Wang Haoqian, Zhang Weiming, et al. Reversible data hiding in JPEG image based on DCT frequency and block selection[J]. Signal Processing, 2018, 148:41-47.) improved the above method by introducing a new block sorting and frequency selection strategy. This strategy prioritizes embedding AC coefficients at frequency positions with lower distortion within the DCT coefficient block to improve image visual quality. Li et al. proposed a JPEG information hiding algorithm based on the modification of a two-dimensional histogram of quantized DCT coefficients. First, two adjacent non-zero AC coefficients are paired to construct a two-dimensional histogram; then, the designed two-dimensional reversible mapping rule is used to modify the coefficient pairs to embed secret information. Although the algorithm improves image quality and reduces file increment, it does not consider the amplitude relationship between coefficients during coefficient pairing, thus failing to achieve optimal rate-distortion performance. Therefore, the adaptive JPEG information hiding algorithm based on coefficient pairing proposed by Wu et al. (WU Taoyu, HUANG Fangjun. Adaptive reversible datahiding in JPEG images based on coefficient pairing[J]. Journal of Software, 2022, 33(02):725+728-739.) utilizes small AC coefficients to construct two-dimensional reversible mapping rules through pairwise pairing, and combines an adaptive frequency strategy to select coefficients of different frequencies in each sub-block for embedding secret information. Experimental results show that compared with similar algorithms, this algorithm has significant advantages in both visual quality and file increment performance metrics.However, while these solutions have achieved good visual quality, they still cannot meet the application requirements in the current environment in terms of embedding capacity and file increment performance. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention proposes a JPEG image information hiding method based on orientation correction, which can effectively improve the performance of existing technologies in terms of embedding capacity, image quality, and file increment.
[0005] The technical solution protected by this invention is: a JPEG image information hiding method based on direction correction, characterized by the following steps:
[0006] (I) Preprocessing, which includes the following steps:
[0007] The first step is to read in a carrier image I of size M×L and divide it into non-overlapping image blocks of size 8×8;
[0008] The second step is to perform DCT transformation on each 8×8 image block using formula (1) to transform the original image from the spatial domain to the frequency domain:
[0009]
[0010] in, p(i,j) represents the pixel value of the original image, and P(a,b) represents the frequency domain coefficient value with a frequency of {a,b}.
[0011] The third step is to quantize the obtained DCT coefficients using an 8×8 quantization table to obtain the quantized DCT coefficients, as shown in formula (2):
[0012]
[0013] Where g(a,b) is the quantization step size at the corresponding frequency (a,b) in the quantization table, and h(a,b) is the quantization DCT coefficient;
[0014] The fourth step is to scan each 8×8 quantized DCT coefficient block in Zig-zag order to obtain the coefficient sequence. Where i represents the i-th quantized DCT block, These are DC coefficients, and the remaining 63 are AC coefficients;
[0015] Fifth step, select the first k non-contiguous zero AC coefficient sequences from each coefficient block, denoted as... Where k represents the number of non-continuous zero coefficients, then all quantized DCT block sequences can be represented as: Where N is the total number of image patches;
[0016] Step 6: Sort all quantized DCT blocks in ascending order of k value to form a new block sequence. Where γ: {1,2,...,N}→{1,2,...,N} is a one-to-one mapping, and k γ(1) ≤...≤k γ(N) When k γ(i) =k γ(j) And when i<j, γ(i)<γ(j);
[0017] Step 7, in the block sequence In the process, the embeddable coefficient pairs are obtained using formula (3):
[0018]
[0019] Where p is an odd number, It refers to the AC coefficient values at the same frequency position in two adjacent quantized DCT blocks after sorting, k γ(p) It is a coefficient block The number of discontinuous zero coefficients, C is the set of embeddable coefficient pairs;
[0020] (II) The process of embedding secret information includes the following steps:
[0021] The first step is to divide the coefficient pairs in the set C of embeddable coefficient pairs into three categories:
[0022] Type A:
[0023] Type B:
[0024] Type C:
[0025] The second step is to design direction correction rules for coefficient pairs for different types of coefficient pairs;
[0026] The third step is to fill a 3×3 quaternary reference matrix M, following the rules for filling:
[0027] (1) In the same row, the difference between two adjacent elements is 1 (mod 4);
[0028] (2) In the same column, the difference between two adjacent elements is 2 (mod 4).
[0029] The fourth step is to select the coefficient pairs to be embedded in set C, determine the type of the coefficient pairs, determine the position of the coefficient pairs in the reference matrix, and read the reference data.
[0030] Fifth step: Read the 2-bit secret data sequentially, convert it to quaternary number, compare the values of the reference data and the secret data, and consider the following two cases:
[0031] If the secret data equals the reference data, then the coefficients are not modified in any way;
[0032] If the secret data is not equal to the reference data, then the coefficient pair is modified according to the direction correction rule designed in the second step to make the secret data and the reference data equal;
[0033] Step 6: Repeat steps 4 and 5 above until all coefficient pairs are embedded with secret data.
[0034] The seventh step is to entropy encode the quantized DCT coefficients containing the secret data to obtain the secret-carrying JPEG image.
[0035] (III) The process of extracting secret information, which is the reverse of the embedding process, specifically includes the following steps:
[0036] The first step is to perform entropy decoding on the encrypted JPEG image to obtain the quantized DCT coefficient block;
[0037] The second step is to obtain the set of embedding coefficient pairs by following the fourth, fifth, sixth, and seventh steps in the preprocessing procedure;
[0038] The third step is to fill the reference matrix M in the same way as the third step in the embedding process;
[0039] The fourth step is to sequentially select the coefficient pairs in the set of embedded coefficient pairs and use them as the horizontal and vertical coordinates of the reference matrix. The corresponding reference data is the embedded quaternary secret information.
[0040] The fifth step is to convert the secret data into binary numbers;
[0041] Step six, repeat steps four and five until all the secret data has been extracted.
[0042] Compared with the prior art, the present invention has the following advantages:
[0043] 1. The information hiding scheme of this invention is simple, easy to implement, and highly secure.
[0044] 2. The solution of the present invention can effectively improve the performance of maximum embedding capacity.
[0045] 3. With the same embedding capacity, this solution can achieve better image visual quality and smaller file increment. Attached Figure Description
[0046] The present invention will now be described in further detail with reference to the accompanying drawings.
[0047] Figure 1 shows the direction correction rules for different types of coefficient pairs.
[0048] Figure 2 shows the maximum embedding capacity under different QFs, in bits.
[0049] Figure 3 shows the maximum embedding increment per unit under different QFs.
[0050] Figure 4 shows a comparison of PSNR and file increment for different algorithms under a fixed embedding capacity (QF=80).
[0051] Figure 5 shows the comparison of average PSNR of images in the test dataset under different embedding capacities.
[0052] Figure 6 shows a comparison of the average file increment of images in the test dataset under different embedding capacities. Detailed Implementation
[0053] To make the objectives, features, and advantages of the present invention readily apparent, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0054] We chose Matlab 2020b as the software platform to programmatically implement the design of this invention. During implementation, a standard 512×512 test image, "Lena," was selected as the carrier image.
[0055] The technical solution of the present invention consists of three parts: (I) preprocessing; (II) embedding of secret information; and (III) extraction of secret information.
[0056] I. Preprocessing, specifically including the following steps:
[0057] The first step is to read in a standard 512×512 test image "Lena" as carrier image I and divide it into non-overlapping 8×8 image blocks;
[0058] The second step is to perform DCT (discrete cosine transform) on each 8×8 image block using formula (1) to transform the original image from the spatial domain to the frequency domain:
[0059]
[0060] in, p(i,j) represents the pixel value of the original image, and P(a,b) represents the frequency domain coefficient value with a frequency of {a,b}.
[0061] The third step is to quantize the obtained DCT coefficients using an 8×8 quantization table to obtain the quantized DCT coefficients, as shown in formula (2):
[0062]
[0063] Where g(a,b) is the quantization step size at the corresponding frequency (a,b) in the quantization table, and h(a,b) is the quantization DCT coefficient;
[0064] The fourth step is to scan each 8×8 quantized DCT coefficient block in Zig-zag order to obtain the coefficient sequence. Where i represents the i-th quantized DCT block, These are DC coefficients, and the remaining 63 are AC coefficients;
[0065] Fifth step, select the first k non-contiguous zero AC coefficient sequences from each coefficient block, denoted as... Where k represents the number of discontinuous zero AC coefficients, then all quantized DCT block sequences can be represented as:
[0066] Step 6: Sort all quantized DCT blocks in ascending order of k value to form a new block sequence. Where γ: {1,2,...,4096}→{1,2,...,4096} is a one-to-one mapping, and k γ(1) ≤...≤k γ(4096) When k γ(i) =k γ(j) And when i<j, γ(i)<γ(j);
[0067] Step 7, in the block sequence In the process, the embeddable coefficient pairs are obtained using formula (3):
[0068]
[0069] Where p is an odd number, It is the AC coefficient value at the same frequency position in two adjacent quantized DCT blocks, k γ(p) It is a coefficient block The number of discontinuous zero coefficients, C is the set of embeddable coefficient pairs;
[0070] II. The process of embedding secret information specifically includes the following steps:
[0071] The first step is to divide the coefficient pairs in the set C of embeddable coefficient pairs into three categories:
[0072] Type A:
[0073] Type B:
[0074] Type C:
[0075] The second step is to design direction correction rules for coefficient pairs for different types of coefficient pairs, as shown in Figure 1.
[0076] The third step is to fill a 3×3 quaternary reference matrix M, following the rules for filling:
[0077] (1) In the same row, the difference between two adjacent elements is 1 (mod 4);
[0078] (2) In the same column, the difference between two adjacent elements is 2 (mod 4).
[0079] The fourth step is to select the coefficient pairs to be embedded in set C, determine the type of the coefficient pairs, determine the position of the coefficient pairs in the reference matrix, and read the reference data.
[0080] Fifth step: Read the 2-bit secret data sequentially, convert it to quaternary number, compare the values of the reference data and the secret data, and consider the following two cases:
[0081] If the secret data equals the reference data, then the coefficients are not modified in any way;
[0082] If the secret data is not equal to the reference data, then the coefficient pair is modified according to the direction correction rule designed in the second step to make the secret data and the reference data equal.
[0083] Step 6: Repeat steps 4 and 5 until all coefficient pairs are embedded with secret data.
[0084] The seventh step is to entropy encode the quantized DCT coefficients containing the secret data to obtain the secret-carrying JPEG image.
[0085] III. The process of extracting secret information, which is the inverse of the embedding process, specifically includes the following steps:
[0086] The first step is to perform entropy decoding on the encrypted JPEG image to obtain the quantized DCT coefficient block;
[0087] The second step involves obtaining the set of embedding coefficient pairs according to steps four, five, six, and seven of the preprocessing procedure.
[0088] The third step is to fill the reference matrix M in the same way as the third step in the embedding process;
[0089] The fourth step is to sequentially select the coefficient pairs in the set of embedded coefficient pairs and use them as the horizontal and vertical coordinates of the reference matrix. The corresponding reference data is the embedded quaternary secret information.
[0090] The fifth step is to convert the secret data into binary numbers;
[0091] Step six, repeat steps four and five until all the secret data has been extracted.
[0092] To demonstrate the superiority of this invention over other solutions, we conducted performance tests on five standard test images (512×512 pixels) from the selected USC-SIPI dataset under the same experimental conditions, comparing the proposed solution with other solutions. Simultaneously, the experiment also tested 1000 images selected from the BOSSbase image dataset. During the experiments, the secret information to be embedded was generated using a random generator. The performance of the algorithm was evaluated using three metrics: Peak Signal-to-Noise Ratio (PSNR), Embedding Capacity (EC), and Increased File Size (IFS).
[0093] Figure 2 shows the maximum embedding capacity of the algorithm of this invention and the comparison algorithms under different QFs. The data in the table shows that Huang et al.'s scheme and Hou et al.'s scheme have the same maximum embedding capacity. This is because Hou et al.'s scheme improves image quality and file increment performance based on Huang et al.'s scheme through block sorting and frequency selection strategies; however, the effect of these optimization strategies disappears when the embedding capacity reaches its maximum. Wu et al.'s coefficient pairing strategy reduces the use of small non-zero AC coefficients to some extent, thus the maximum embedding capacity is lower than that of Huang et al.'s scheme and Hou et al.'s scheme. The method of this invention selects the most frequent -1, 0, and 1 at the same frequency position in the quantized DCT block for pairing, obtaining more embeddable coefficient pairs for embedding secret information, thus significantly improving the maximum embedding capacity compared to other algorithms.
[0094] Taking a Baboon image with relatively complex texture as an example, when QF=80, the maximum embedding capacity of Huang et al.'s scheme and Hou et al.'s scheme is 50717 bits; the maximum embedding capacity of Wu et al.'s scheme decreases to 43611 bits; the maximum embedding capacity of the algorithm of this invention reaches 96156 bits, which is 98.6% and 120% higher than the above algorithms, respectively.
[0095] To compare the file increment under the maximum embedding capacity, this invention defines the maximum embedding increment per unit (UIFSmax), which is the ratio of the file increment to the maximum embedding capacity. Clearly, a smaller UIFSmax is better. Figure 3 shows the maximum embedding increment per unit for the algorithm of this invention and the comparison algorithms under different QFs. It can be seen that the algorithm of this invention significantly improves performance in terms of file increment. Taking a simple Lena image as an example, when QF=80, the maximum embedding increment per unit in the comparison literature is 1.56, 1.54, and 1.27, respectively, but the algorithm of this invention decreases to 0.38. This indicates that under the maximum embedding capacity, the algorithm of this invention achieves the minimum file increment.
[0096] Figure 4 shows the comparison results of PSNR and file increment for five test images with a fixed embedding capacity at QF=80. As can be seen from the table, compared to the schemes of Huang et al., Hou et al., and Wu et al., the algorithm of this invention achieves better image quality and smaller file increment at the same embedding capacity. Taking the complex textured Baboon image as an example, when the embedding capacity is 16000 bits, the PSNR value of the algorithm of this invention is improved by 1.7 dB, 1.49 dB, and 0.62 dB compared to the schemes of Huang et al., Hou et al., and Wu et al., respectively, and the file increment is reduced by 18248 bits, 18128 bits, and 12656 bits, respectively.
[0097] Meanwhile, the generality of the proposed algorithm was verified by embedding and extracting secret information from 1000 randomly selected images in the BOSSbase dataset. Figures 5 and 6 show the comparison of the average PSNR and average file increment of the test images under different embedding capacities when QF is 70, 80, and 90, respectively. As can be seen from the figures, the image visual quality of the algorithm of this invention is improved by an average of 1dB to 4dB compared with the algorithms of Huang et al., Hou et al., and Wu et al., and the maximum file increment is reduced to about 15% of the comparative algorithms.
[0098] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for hiding information in JPEG images based on direction correction, characterized in that, The following steps are performed: (I) Preprocessing, specifically including the following steps: First, read in a carrier image I of size M×L and divide it into non-overlapping 8×8 image blocks; Second, perform DCT transformation on each 8×8 image block using formula (1) to transform the original image from the spatial domain to the frequency domain: in, p(i,j) represents the original image pixel value, and P(a,b) represents the frequency domain coefficient value with a frequency of {a,b}. In the third step, the obtained DCT coefficients are quantized using an 8×8 quantization table to obtain the quantized DCT coefficients, as shown in formula (2). Where g(a,b) is the quantization step size at the corresponding frequency (a,b) in the quantization table, and h(a,b) are the quantized DCT coefficients; in the fourth step, each 8×8 quantized DCT coefficient block is scanned in Zig-zag order to obtain the coefficient sequence. Where i represents the i-th quantized DCT block, These are DC coefficients, and the remaining 63 are AC coefficients; the fifth step is to select the first k non-contiguous zero AC coefficient sequences from each coefficient block, denoted as... Where k represents the number of non-continuous zero coefficients, then all quantized DCT block sequences can be represented as: Where N is the total number of image blocks; in the sixth step, all quantized DCT blocks are arranged in ascending order according to the size of the k value to form a new block sequence. Where γ: {1,2,...,N}→{1,2,...,N} is a one-to-one mapping, and k γ(1) ≤...≤k γ(N) When k γ(i) =k γ(j) And when i < j, γ(i) < γ(j); Step 7, in the block sequence In the process, the embeddable coefficient pairs are obtained using formula (3): Where p is an odd number, It refers to the AC coefficient values at the same frequency position in two adjacent quantized DCT blocks after sorting, k γ(p) It is a coefficient block The number of discontinuous zero coefficients, C is the set of embeddable coefficient pairs; (II) The embedding process of secret information, specifically including the following steps: First, divide the coefficient pairs in the set of embeddable coefficient pairs C into three categories: Type A: Type B: Type C: The second step is to design direction correction rules for coefficient pairs of different types; (1) For coefficient pairs of type A: horizontal, vertical and diagonal corrections can be made according to the specific situation; (2) For coefficient pairs of type B (0, -1) and (0, 1), horizontal, vertical and diagonal corrections can be made; for coefficient pairs (-1, 0) and (1, 0), horizontal and vertical corrections can only be made; (3) For coefficient pairs of type C, upward, left and right corrections can be made according to the specific situation; The third step is to fill a 3×3 quaternary reference matrix. M, the filling rules are as follows: (1) In the same row, the difference between two adjacent elements is 1 (mod 4); (2) In the same column, the difference between two adjacent elements is 2 (mod 4); Fourth step, select the coefficient pair to be embedded in set C, determine the type of the coefficient pair, and determine the position of the coefficient pair in the reference matrix, and read the reference data; Fifth step, read 2 bits of secret data in sequence, convert them into quaternary numbers, compare the values of the reference data and the secret data, and consider the following two cases: if the secret data is equal to the reference data, then the coefficient pair No modifications are made; if the secret data is not equal to the reference data, the coefficient pairs are modified according to the direction correction rules designed in the second step to make the secret data and the reference data equal; in the sixth step, the fourth and fifth steps above are repeated until all coefficient pairs are embedded with the secret data; in the seventh step, the quantized DCT coefficients embedded with the secret data are entropy encoded to obtain the JPEG image with the secret data; (III) The extraction process of secret information is the inverse process of the embedding process, which specifically includes the following steps: in the first step, the JPEG image with the secret data is entropy decoded to obtain the quantized DCT coefficient block; in the second step, the set of embedded coefficient pairs is obtained according to the fourth, fifth, sixth and seventh steps in the preprocessing process; in the third step, the reference matrix M is filled in the same way as the third step in the embedding process; in the fourth step, the coefficient pairs in the set of embedded coefficient pairs are selected in turn, and they are used as the horizontal and vertical coordinates of the reference matrix. The corresponding reference data is the embedded quaternary secret information; in the fifth step, the secret data is converted into binary numbers; in the sixth step, the fourth and fifth steps are repeated until all the secret data is extracted.