Image hiding method based on reversible neural network and similar pair matching
Through an image hiding method based on reversible neural network and similar pair matching, using wavelet transform and differential coding technology, the problems of high computational complexity and poor balance in the existing technology are solved, and high-quality image restoration and flexible embedding capacity are achieved. choose.
Patent Information
- Application Number
- CN202410257096.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2024-08-27
AI Technical Summary
Existing image hiding technology is difficult to improve the quality of restored images while reducing computational complexity, and cannot flexibly balance between ciphertext image quality and embedding capacity.
An image hiding method based on reversible neural network and similar pair matching is adopted, through sym2 integer wavelet transform and reversible scaling network for downsampling and differential coding, combined with a similar pair matching embedding algorithm, to embed the secret image into the high-frequency subband of the carrier image , and use inverse integer wavelet transform to generate visually secure ciphertext images.
It achieves high-quality image recovery while saving computing and storage resources, allowing users to flexibly choose the downsampling rate to balance ciphertext image quality and embedding capacity.
Smart Images

Figure CN118555344A
Abstract
Description
Technical field:
[0001] The invention belongs to image hiding technology in the field of information security, and in particular relates to an image hiding method based on reversible neural network and similarity pair matching. Background technology:
[0002] In recent years, the rise of digital media and the unprecedented surge in digital images have led to a sharp increase in the demand for secure transmission systems. Image hiding technology has a wide range of applications, among which secret communication and privacy protection are the most important applications. The main purpose of image hiding is to hide the secret image in the carrier image, so that only authorized personnel can access the retrieval of the secret image, while unauthorized recipients cannot retrieve the secret image. Compared with traditional image encryption, image hiding can generate visually secure ciphertext images that are very similar to normal images and will not arouse the suspicion of attackers. Capacity, invisibility and security are the three major challenges faced by image hiding.
[0003] According to different technologies, image hiding algorithms can be divided into two categories: image hiding algorithms based on compressed sensing and image hiding algorithms based on reversible neural networks. For lossy image hiding algorithms based on compressed sensing, the compressed secret image presents a noise-like feature with reduced size compared to the original image. This type of algorithm embeds the secret image generated by compressed sensing processing into the carrier image. For example, Chai et al. combined compression with zigzag confusion to compress and encrypt the original image, effectively improving the compression performance. The resulting ciphertext image is the same size as the original image, and no additional transmission bandwidth and storage space are required. The compressed image is then embedded in the frequency domain of the carrier image, and a visually secure ciphertext image is finally obtained. However, since the generation of the measurement matrix consumes a lot of storage resources and computational costs, Ping et al. proposed half-tensor product compressed sensing, which reduces the length and width of the measurement matrix to half, greatly saving storage resources and improving computational efficiency. In addition, Ping et al. divided the compressed secret image and the carrier image into blocks, and then replaced some blocks in the carrier image with blocks of the secret image according to the block matching strategy, and after a series of processing, the final ciphertext image was generated. In order to improve the quality of restored images, Hua et al. adjusted the global threshold of compressed sensing to an adaptive threshold. However, although scholars have continuously proposed improved solutions for compressed sensing, none of them can significantly improve the quality of restored images while reducing the computational complexity.
[0004] The second category is lossy image hiding algorithms based on reversible neural networks. With the development of convolutional neural networks (CNNs), many scholars have proposed image hiding methods using deep learning. Such algorithms model the hiding and recovery processes as a pair of inverse problems with the same parameters. The secret image and the carrier image are used as a pair of inputs and passed into the reversible neural network for training. The ciphertext image can be generated without the need for an embedding algorithm. For example, Guan et al. hid multiple secret images into the same cover image in a new way. The importance mapping module was introduced so that the hiding results of the previous image can assist the hiding of the current image to improve the overall hiding performance. In addition, Guan et al. proposed a new multi-stage training strategy and designed a stage loss to improve the stability of training. Jing et al. designed a large-capacity image hiding algorithm that used low-frequency wavelet loss to control the distribution of secret information in different frequency bands, significantly improving the security of hiding. However, since these algorithms model the image hiding and recovery processes as a pair of inverse problems that share the same parameters. Therefore, the secret image must be the same size as the carrier image. For users, it is not possible to flexibly balance between the quality of the ciphertext image and the embedding capacity. Summary of the invention:
[0005] In view of the deficiencies in the above-mentioned image hiding scheme, the present invention proposes an image hiding method based on a reversible neural network and similarity pair matching. First, the carrier image is converted into a low-frequency subband LL and three high-frequency subbands HL, LH and HH using the sym2 integer wavelet transform. Then, the secret image is downsampled using a reversible scaling network to obtain a downsampled image. The downsampled image is further differentially encoded and converted into a binary sequence, and then embedded into the HH, HL, LH, LL subbands of the carrier image using the proposed similarity pair matching encoding algorithm. Finally, the frequency domain is converted into the spatial domain using the inverse integer wavelet transform to obtain a visually secure ciphertext image. The recovery algorithm is the inverse algorithm of the hiding algorithm, and the original secret image can be obtained by the following steps: using integer wavelet transform, similarity pair matching decoding algorithm, and inverse differential encoding to obtain the downsampled image; using the upsampling algorithm to obtain the restored secret image.
[0006] The image hiding method based on reversible neural network and similarity pair matching described in the present invention comprises the following specific steps:
[0007] Step 1: Input the downsampling rate SR, use reversible image scaling to downsample the plaintext image X to obtain the downsampled image Y. The size of the plaintext image P is H×W, and the size of the downsampled image Y is H′×W′
[0008] Step 2: To further reduce the absolute value of the embedded pixels, differentially encode the downsampled image Y and adjust all pixel values in Y to around 0 to obtain a matrix F of size H′×W′.
[0009] Step 3: Generate an H′×W′ record matrix Q to record the positive and negative values of each pixel of the matrix F, where the number 1 represents that the pixel of F at the corresponding position is a positive number or a number 0, and the number -1 represents a negative number;
[0010] Step 4: Convert each negative pixel in the matrix F to its absolute value to obtain a positive matrix P, the size of which is H′×W′;
[0011] Step 5: Convert the matrix P into a one-dimensional vector as follows: P = {p1, p2, ..., P H′W′}; Convert each decimal pixel in P into an 8-bit binary pixel, and finally obtain a secret sequence Bs of length H′W′×8;
[0012] Step 6: In order to prevent the overflow of pixels in the carrier image T caused by the following operations, the pixels of the carrier image T are adjusted to [15, 240] to obtain the carrier matrix T′, and the sizes of T and T′ are both M×N;
[0013] Step 7: Perform integer wavelet transform on T′ to obtain four sub-bands LL, LH, HL, HH, and the size of each sub-band is M / 2×N / 2;
[0014] Step 8: Embed the secret sequence Bs into the subband of T′ in the order of HH, LH, HL and LL according to the similar pair matching embedding algorithm to obtain the modified four subbands HH′, LH′, HL′ and LL′;
[0015] Step 9: Use the inverse integer wavelet transform to transform the frequency domain into the spatial domain to obtain the final ciphertext image C, the size of C is M×N.
[0016] The expression of the differential encoding in step 2 is as follows:
[0017]
[0018] The expression of the record matrix Q in step 3 is as follows:
[0019]
[0020] The expression of the positive value matrix in step 4 is as follows:
[0021]
[0022] The correction process of the pixel overflow in step 6 is as follows:
[0023]
[0024] The steps of the similarity pair matching embedding algorithm in step 8 are as follows:
[0025] (1) Divide the secret data into several pairs, so that each pair consists of two bits.
[0026] (2) The 8th and 7th, 7th and 6th, and 6th and 5th bits of each carrier pixel are named as left pair P L , middle pair P M and right pair P R At the same time, the 3rd, 2nd and 1st bits are represented as the record pair R P , the second and first bits are named as the embedded pair E P .
[0027] (3) Read the first three pairs of secret data and compare them with the P of the current carrier pixel. L , P M and P R The comparison result is recorded in R P In. E P Used to embed unmatched pairs. All possibilities can be summarized into the following four cases.
[0028] a) If the three pairs of secret data are respectively L , P M and P R Pair matching (ie P1 = P L 、P2=P M 、P3=P R ), then the R of the current carrier pixel P is replaced by "111". In this case, 6 bits of secret data are embedded into one carrier pixel by changing only the 3 LSBs of that pixel.
[0029] b) If two secret pairs match, and one pair remains mismatched (i.e., P1 = P L , P2=P M , P3≠P R Or P1=P L 、P2≠P M , P3=P R Or P1≠P L , P2=P M , P3=P R ), then the R of the current pixel P is replaced by "110" or "101" or "011", and the E of the next pixel Pis replaced by a non-matching secret pair (i.e. P3 or P2 or P1). In this case, 6 bits of secret data are embedded into two carrier pixels by changing 5 bits.
[0030] c) If one secret pair matches, but both pairs do not match (i.e., P1 = P L , P2≠P M , P3≠P R Or P1≠P L , P2=P M , P3≠P R Or P1≠P L , P2≠P M , P3=P R ), then the R of the current pixel P is replaced by "100" or "010" or "001", and the E of the next two pixels P are replaced by unmatched secret pairs (ie P2 and P3 or P1 and P3 or P2 and P2). This embeds 6 bits of secret data into three carrier pixels by changing 7 bits.
[0031] d) If none of the three secret pairs matches P L , P M and P R Pair matching (ie P1≠P L 、P2≠P M 、P3≠P R ), then the R of the current pixel P is replaced by "000", and the next three pixels of E P are replaced by P1, P2 and P3 respectively. In this case, 6 bits of secret data are embedded into 4 carrier pixels by changing 9 bits.
[0032] (4) Take the next three secret data pairs and use the next unembedded carrier pixel as the current carrier pixel. Then, repeat step 3 until the number of secret pairs is less than three. The remaining secret pairs are directly embedded in the E of the remaining carrier pixels in turn. P middle.
[0033] Compared with the prior art, the present invention has the following advantages:
[0034] (1) The present invention adopts the reversible rescaling network (IRN) for image hiding for the first time. Due to the downsampling capability of IRN, the waste of computational resources caused by the generation of the measurement matrix is avoided. The downsampling and upsampling processes of the image use the same parameters, which not only saves storage resources but also avoids loose coupling of parameters. The present invention can hide the secret image into a carrier image of the same size. In addition, the upsampling capability of IRN enables the present invention to produce high-quality restored images.
[0035] (2) The present invention improves the embedding technology of the similar pair matching algorithm and combines it with differential coding to improve the quality of the ciphertext image. Compared with the image hiding algorithm based on the reversible neural network, the present invention allows the user to select two different downsampling rates as needed, ensuring the visual quality of the restored image while ensuring that the quality of the ciphertext image is high enough. Description of the drawings:
[0036] Figure 1 is the plaintext image;
[0037] Figure 2 It is a carrier image;
[0038] Figure 3 is the downsampled image;
[0039] Figure 4 is the generated ciphertext image;
[0040] Figure 5 is the restored result of the plaintext image;
[0041] Figure 6 It is the RS steganalysis graph of the ciphertext image; Specific implementation method:
[0042] The technical solution of the present invention is described in detail below, and examples of the implementation modes are shown in the accompanying drawings. However, the protection scope of the present invention is not limited to the embodiments.
[0043] This specific embodiment uses Matlab software for simulation. The original plaintext image uses the standard test color image Toucan with a size of 512×512. Each pixel of the image consists of 8 bits. Figure 1 As shown; the carrier image uses the standard test color image Grnpeace with a size of 512×512, as shown Figure 2 shown.
[0044] The present invention designs an image hiding method based on a reversible neural network and similarity pair matching. The method downsamples the plaintext image and embeds it through a similarity pair matching embedding algorithm, and finally generates a meaningful visual security ciphertext image. The specific implementation steps are as follows:
[0045] Step 1: Input the downsampling rate 1 / 4, use reversible image scaling to downsample the plaintext image X to obtain the downsampled image Y. The size of the plaintext image P is 512×512, and the size of the downsampled image Y is 256×256.
[0046] Step 2: To further reduce the absolute value of the embedded pixels, perform differential encoding on the downsampled image Y, adjust all pixel values in Y to around 0, and obtain a matrix F of size 256×256;
[0047] Step 3: Generate a 256×256 record matrix Q to record the positive and negative values of each pixel of the matrix F, where the number 1 represents that the pixel of F at the corresponding position is a positive number or a number 0, and the number -1 represents a negative number;
[0048] Step 4: Convert each negative pixel in the matrix F to its absolute value to obtain a positive matrix P, the size of which is 256×256;
[0049] Step 5: Convert the matrix P into a one-dimensional vector as follows: Convert each decimal pixel in P into an 8-bit binary pixel, and finally get a length of 256 2 ×8 secret sequence Bs;
[0050] Step 6: In order to prevent the overflow of pixels in the carrier image T caused by the following operations, the pixels of the carrier image T are adjusted to [15, 240] to obtain the carrier matrix T′, and the size of T and T′ are both 512×512;
[0051] Step 7: Perform integer wavelet transform on T′ to obtain four sub-bands LL, LH, HL, HH, and the size of each sub-band is 256×256;
[0052] Step 8: Embed the secret sequence Bs into the subband of T′ in the order of HH, LH, HL and LL according to the similar pair matching embedding algorithm to obtain the modified four subbands HH′, LH′, HL′ and LL′;
[0053] Step 9: Use inverse integer wavelet transform to transform the frequency domain into the spatial domain to obtain the final ciphertext image C, the size of C is 512×512;
[0054] Will Figure 4 The ciphertext image is decrypted and the restored image is as follows Figure 5 shown.
Claims
1. An image hiding method based on reversible neural network and similarity pair matching, characterized in that: The following steps are involved: Step 1: Input the downsampling rate SR, and use reversible image scaling to downsample the plaintext image X to obtain the downsampled image Y. The size of the plaintext image P is H×W, and the size of the downsampled image Y is Step 2: To further reduce the absolute value of the embedded pixels, differentially encode the downsampled image Y and adjust all pixel values in Y to around 0 to obtain a matrix F of size H′×W′. Step 3: Generate an H′×W′ record matrix Q to record the positive and negative values of each pixel of the matrix F, where the number 1 represents that the pixel of F at the corresponding position is a positive number or a number 0, and the number -1 represents a negative number; Step 4: Convert each negative pixel in the matrix F to its absolute value to obtain a positive matrix P, the size of which is H′×W′; Step 5: Convert the matrix P into a one-dimensional vector as follows: P = {p1, p2, ..., P H′W′ }; Convert each decimal pixel in P into an 8-bit binary pixel, and finally obtain a secret sequence Bs of length H′W′×8; Step 6: In order to prevent the overflow of pixels in the carrier image T caused by the following operations, the pixels of the carrier image T are adjusted to [15, 240] to obtain the carrier matrix T′, and the sizes of T and T′ are both M×N; Step 7: Perform integer wavelet transform on T′ to obtain four sub-bands LL, LH, HL, HH. The size of each sub-band is M / 2×N / 2. Step 8: Embed the secret sequence Bs into the subband of T′ in the order of HH, LH, HL and LL according to the similar pair matching embedding algorithm to obtain the modified four subbands HH′, LH′, HL′ and LL′; Step 9: Use the inverse integer wavelet transform to transform the frequency domain into the spatial domain to obtain the final ciphertext image C, the size of C is M×N.
2. The image hiding method based on reversible neural network and similarity pair matching as claimed in claim 1, characterized in that: The expression of differential encoding in step 2 is as follows:
3. The image hiding method based on reversible neural network and similarity pair matching as claimed in claim 1, characterized in that: The expression of the record matrix Q in step 3 is as follows:
4. The image hiding method based on reversible neural network and similarity pair matching as claimed in claim 1, characterized in that: The expression of the positive value matrix in step 4 is as follows:
5. The image hiding method based on reversible neural network and similarity pair matching as claimed in claim 1, characterized in that: The pixel overflow correction process in step 6 is as follows:
6. The image hiding method based on reversible neural network and similarity pair matching as claimed in claim 1, characterized in that: The steps of the similarity pair matching embedding algorithm in step 8 are as follows: (1) Divide the secret data into several pairs, so that each pair consists of two bits. (2) The 8th and 7th, 7th and 6th, and 6th and 5th bits of each carrier pixel are named as left pair P L , middle pair P M and right pair P R At the same time, the 3rd, 2nd and 1st bits are represented as the record pair R P , the second and first bits are named as the embedded pair E P . (3) Read the first three pairs of secret data and compare them with the P of the current carrier pixel. L , P M and P R The comparison result is recorded in R P In. E P Used to embed unmatched pairs. All possibilities can be summarized into the following four cases. a) If the three pairs of secret data are respectively L , P M and P R Pair matching (ie P1 = P L 、P2=P M 、P3=P R ), then the R of the current carrier pixel P is replaced by "111". In this case, 6 bits of secret data are embedded into one carrier pixel by changing only the 3 LSBs of that pixel. b) If two secret pairs match, and one pair remains mismatched (i.e., P1 = P L , P2=P M , P3≠P R Or P1=P L 、P2≠P M , P3=P R Or P1≠P L , P2=P M , P3=P R ), then the R of the current pixel P is replaced by "110" or "101" or "011", the E of the next pixel P is replaced by a non-matching secret pair (i.e. P3 or P2 or P1). In this case, 6 bits of secret data are embedded into two carrier pixels by changing 5 bits. c) If one secret pair matches, but both pairs do not match (i.e., P1 = P L , P2≠P M , P3≠P R Or P1≠P1, P2=P M , P3≠P R Or P1≠P L , P2≠P M , P3=P R ), then the R of the current pixel P is replaced by "100" or "010" or "001", and the E of the next two pixels P are replaced by unmatched secret pairs (ie P2 and P3 or P1 and P3 or P2 and P2). This embeds 6 bits of secret data into three carrier pixels by changing 7 bits. d) If none of the three secret pairs matches P L , P M and P R Pair matching (ie P1≠P L 、P2≠P M 、P3≠P R ), then the R of the current pixel P is replaced by "000", and the next three pixels of E P are replaced by P1, P2 and P3 respectively. In this case, 6 bits of secret data are embedded into 4 carrier pixels by changing 9 bits. (4) Take the next three secret data pairs and use the next unembedded carrier pixel as the current carrier pixel. Then, repeat step 3 until the number of secret pairs is less than three. The remaining secret pairs are directly embedded in the E of the remaining carrier pixels in turn. P middle.
