Image hiding method based on restricted Boltzmann machine and parallel compressed sensing

By introducing restricted Boltzmann machines and parallel compression perception technology in image encryption, ciphertext images with high randomness and attack resistance are generated and embedded in the carrier image, the low randomness in the prior art is solved. The problems of high computational complexity and poor attack resistance achieve efficient and secure image encryption and embedding.

CN119402600AActive Publication Date: 2025-02-07GUANGDONG OCEAN UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411531620.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The existing image encryption method based on compression perception has problems such as low randomness of chaotic sequences, high computational complexity, and poor attack resistance and robustness of encrypted images.

Method used

Using an image hiding method based on restricted Boltzmann machines and parallel compression perception, the restricted Boltzmann machines are initialized and iteratively updated by generating random sequences, combining sparse, mess, quantization and diffusion operations to generate high A ciphertext image of randomness and attack resistance and embed it in the carrier image.

Benefits of technology

It improves the randomness and efficiency of the image encryption process, realizes high-quality image reconstruction at a lower compression ratio, and enhances the attack resistance and robustness of the encrypted images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402600A_ABST
    Figure CN119402600A_ABST
Patent Text Reader

Abstract

The invention provides an image hiding method based on a restricted Boltzmann machine and parallel compressed sensing. The method comprises an encryption stage and an embedding stage. In the encryption stage, sparse decomposition, image scrambling and threshold processing are sequentially carried out on a plaintext image, then a measurement matrix is constructed by using a random sequence to carry out parallel compressed sensing, then quantization processing is carried out on the image, and further rotation scrambling and random diffusion are carried out to obtain a ciphertext image; in the embedding stage, ciphertext image information is embedded into different wavelet coefficients of a carrier image through lifting wavelet transformation, and the embedding depth is dynamically selected according to a random sequence, so that the concealment and the safety of the embedded information are improved; according to the method, the randomness of the sequence can be effectively improved, the image processing efficiency is greatly improved, and high-quality image reconstruction can be realized under a relatively low compression ratio; in addition, the encrypted image generated by the method is higher in anti-attack capability and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image encryption, and more specifically, to an image hiding method based on restricted Boltzmann machine and parallel compressed sensing. Background Art

[0002] With the rapid development of digital communication technology, multimedia technology and digital network technology, images, as a typical multimedia data, are widely used in information transmission and gradually become an important part of modern communication. Images are widely welcomed by people because of their strong visual expression and low storage requirements. However, images usually contain a large amount of potential sensitive information, which may involve confidential content. If they are directly transmitted in the public network, they are very vulnerable to illegal reading and may even cause serious information security incidents. Therefore, how to effectively protect the security and privacy of images has become a hot issue that current researchers are concerned about.

[0003] For existing image confidentiality schemes, encrypting images is the most direct and effective method. To improve image confidentiality, researchers have introduced chaos theory, DNA coding, quantum transformation, etc. into encryption methods. However, these methods mainly consider generating unreadable ciphertext images. If transmitted in a public channel, white noise ciphertext images are likely to arouse the curiosity of attackers, which may increase the probability of the image being attacked.

[0004] Currently, image encryption methods based on compressed sensing (CS) technology have received widespread attention. It encrypts the plaintext image into a ciphertext image, and then embeds the ciphertext image into the carrier image to generate a visually secure encrypted image. For example, an existing patent document discloses an image encryption method based on compressed sensing, including performing sparse and threshold processing on an input image to generate a coefficient matrix P2; using a two-dimensional discrete Standard chaotic system to generate a chaotic sequence; using the chaotic sequence to scramble the coefficient matrix P2 to obtain a sparse matrix P3; constructing a measurement matrix based on the Welch bound of size M×N; using a compressed sensing method, compressing and measuring the sparse matrix P3 through the measurement matrix to obtain a real number matrix P4; quantizing the real number matrix P4 to obtain an intermediate ciphertext image; performing dynamic DNA diffusion on the intermediate ciphertext image to obtain a final ciphertext image; however, most of the image encryption methods based on compressed sensing (CS) technology, including the above-mentioned prior art, need to reconstruct the image at the receiving end, and are dependent on the measurement matrix used, with high computational complexity; in addition, the existing embedding strategies mainly adopt a fixed embedding mechanism, and there is still much room for improvement in its robustness. Summary of the invention

[0005] In order to overcome the defects of low randomness and high computational complexity of the chaotic sequences generated in the above-mentioned prior art, as well as poor anti-attack ability and robustness of the encrypted image, the present invention provides an image hiding method based on restricted Boltzmann machine and parallel compressed sensing, which can effectively improve the randomness of the sequence, while greatly improving the image processing efficiency, and can also achieve high-quality image reconstruction at a lower compression ratio; in addition, the encrypted image generated by the present invention has higher anti-attack ability and robustness.

[0006] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0007] An image hiding method based on restricted Boltzmann machine and parallel compressed sensing includes the following steps:

[0008] S1: Obtain a plaintext image P and calculate a hash value hash of the plaintext image P, and generate two mixed sequences combine1 and combine2 based on the hash value hash;

[0009] S2: Initialize the restricted Boltzmann machine using the two mixed sequences combine1 and combine2, iteratively update the initialized restricted Boltzmann machine, and generate random sequences seqx, seqy and seqz;

[0010] S3: Sparse the plaintext image P to generate a sparse matrix P1, randomly scramble the sparse matrix P1 to generate a scrambled matrix P2, and perform threshold processing on the scrambled matrix P2 to obtain a matrix P3;

[0011] S4: Generate a measurement matrix using a random sequence seqy, perform compressed sensing on the matrix P3 using the measurement matrix to generate a compressed matrix P4; quantize the compressed matrix P4 to generate a quantized matrix P5;

[0012] S5: Divide the quantization matrix P5 into a plurality of sub-block matrices, rotate and scramble each of the sub-block matrices and then reassemble them to obtain a spliced ​​matrix P6; rotate and scramble the spliced ​​matrix P6 as a whole to obtain a matrix P7;

[0013] S6: Rearrange the random sequence seqx to generate a rearrangement matrix Z, and use the rearrangement matrix Z to further generate an index matrix I Z , using the rearrangement matrix Z and the index matrix I Z Performing a diffusion operation on the matrix P7 to obtain a ciphertext image cipher;

[0014] S7: Introduce the carrier image Q, perform lifting wavelet transform on the carrier image Q to obtain the frequency coefficient, split the cipher image cipher, use the random sequence seqz to control the embedding depth, embed the split cipher image cipher into the frequency coefficient, perform inverse lifting wavelet transform on the embedded frequency coefficient, and obtain the final cipher image S.

[0015] Preferably, the step S1 comprises:

[0016] S1.1: Calculate the hash value hash of the plaintext image P using the hash function SHA-256, wherein the hash value hash format is 64-bit hexadecimal;

[0017] S1.2: Construct the following mathematical model, substitute the hash value hash into the mathematical model, and generate two initial values ​​s0 and s1:

[0018]

[0019] Among them, the hex2dec function is used to convert hexadecimal to decimal;

[0020] S1.3: Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v size h +size v +size h +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq1 and seq2. Merge sequences seq1 and seq2 to obtain a mixed sequence combined seq1 ;

[0021] Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq3 and seq4. Merge sequences seq3 and seq4 to obtain the mixed sequence combined seq2 ;

[0022] The merger is represented by:

[0023]

[0024] Among them, size v is the input layer dimension of the restricted Boltzmann machine, size h is the hidden layer dimension of the restricted Boltzmann machine.

[0025] Preferably, the step S2 comprises:

[0026] S2.1: Initialize the initial values ​​of the vector x, weight matrix w, visible layer offset v and hidden layer offset h of the restricted Boltzmann machine using the two mixing sequences combine1 and combine2, specifically:

[0027]

[0028] Among them, x0, w0, v0 and h0 are the initial values ​​of vector x, weight matrix w, visible layer offset v and hidden layer offset h respectively;

[0029] S2.2: Calculate the pixel values ​​of the plaintext image P and determine the number of iterations t of the restricted Boltzmann machine, and then calculate the keys key1 and key2, specifically:

[0030]

[0031] Where M and N are the number of rows and columns of pixels in the plaintext image P, respectively;

[0032] S2.3: Substitute the keys key1 and key2 into the Logistic map and Cubic map respectively, iteratively generate d1 and d2, and calculate the perturbation factor d to update the vector x, specifically:

[0033]

[0034] Among them, x′ is the vector x after iterative update;

[0035] S2.4: Use contrastive divergence to update the weight matrix w, visible layer offset v and hidden layer offset h of the initialized restricted Boltzmann machine; then combine forward propagation and backpropagation to update the vector x′ to obtain the vector x″;

[0036]

[0037] Among them, w′, h′ and v′ are the updated weight matrix w, visible layer offset v and hidden layer offset h respectively;

[0038] S2.5: Obtain random sequences seqx, seqy and seqz of length M*N from vector x″, specifically:

[0039]

[0040] Preferably, step S3 comprises:

[0041] S3.1: Sparse the plaintext image P to generate a sparse matrix P1 of size M×N:

[0042] P1=Ψ×P×ΨT

[0043] Where, Ψ is the orthogonal wavelet matrix of SWT;

[0044] S3.2: Use two-dimensional Cat mapping to randomly scramble the sparse matrix P1:

[0045]

[0046] Where (x1, y1) is the pixel position in the plaintext image after sparseness, (x2, y2) is the pixel position in the image after random scrambling, and a and b are the first and second hyperparameters;

[0047] After several consecutive iterations, the scrambled matrix P2 is generated;

[0048] S3.3: Perform threshold processing on the scrambled matrix P2 and set the sparsity of the scrambled matrix P2 columns to:

[0049]

[0050] Among them, CR is the compression rate; θ and α are the third and fourth hyperparameters determined by the reconstruction method; the threshold of each column of the scrambled matrix P2 is the absolute value of the Kth largest element in the column, and the elements in each column of the scrambled matrix P2 whose absolute values ​​are less than the corresponding threshold are set to zero to obtain the matrix P3.

[0051] Preferably, step S4 comprises:

[0052] S4.1: Generate N measurement matrices Φ using random sequence seqy i , using the i-th measurement matrix Φ i Sampling the i-th column of the matrix P3, obtaining a compressed matrix P4 of size V×N, where V=M×CR;

[0053] S4.2: Quantize the pixel values ​​of the compression matrix P4 into integers in the interval [0,255] to generate the quantization matrix P5:

[0054]

[0055] Among them, P max and P min are the maximum and minimum pixel values ​​of the compressed matrix P4 respectively.

[0056] Preferably, step S5 comprises:

[0057] S5.1: Divide the quantization matrix P5 into a plurality of sub-block matrices, each of which has a side length l of:

[0058]

[0059] Wherein, avg represents the pixel mean of the quantization matrix P5;

[0060] S5.2: Rotate and scramble each of the sub-block matrices and then re-join them to obtain a joined matrix P6; rotate and scramble the whole joined matrix P6 to obtain a matrix P7.

[0061] Preferably, step S6 comprises:

[0062] S6.1: Rearrange the random sequence seqx to generate a rearrangement matrix Z with the same size as the matrix P7:

[0063]

[0064] Among them, seqx′ represents the rearranged random sequence seqx;

[0065] S6.2: Sort each column of the rearrangement matrix Z and further generate an index matrix I Z :

[0066]

[0067] S6.3: Using the rearrangement matrix Z and the index matrix I Z The matrix P7 is diffused to obtain the ciphertext image cipher:

[0068]

[0069] Preferably, step S7 comprises:

[0070] S7.1: Introduce the carrier image Q and perform preprocessing:

[0071] Q'=ceil(10+233 / 255*Q)

[0072] Among them, Q' is the preprocessed carrier image;

[0073] Perform lifting wavelet transform on the preprocessed carrier image Q' to obtain four frequency coefficient matrices CA, CH, CV and CD of the same size;

[0074] S7.2: Decompose the random sequence seqz into three subsequences and rearrange them into matrices sseq1, sseq2 and sseq3 of the same size as the frequency coefficient matrix;

[0075] S7.3: Split the cipher image to generate three matrices CH1, CV1 and CD1, expressed as:

[0076]

[0077] S7.4: Use matrices sseq1, sseq2, and sseq3 to control the embedding depth and calculate the embedded shift amounts CHshift, CVshift, and CDshift:

[0078]

[0079] S7.5: According to the embedded displacement, the matrices CH1, CV1 and CD1 are embedded into the corresponding frequency coefficient matrices to obtain three embedded frequency coefficient matrices CH2, CV2 and CD2:

[0080]

[0081] S7.6: Perform inverse lifting wavelet transform on matrices CA, CH2, CV2 and CD2 to obtain the final encrypted image S:

[0082] S=ilwt2(CA,CH2,CV2,CD2,LS)

[0083] Wherein, LS represents the wavelet lifting scheme object.

[0084] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.

[0085] The present invention also provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the above method are executed.

[0086] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0087] The present invention provides an image hiding method based on restricted Boltzmann machine and parallel compressed sensing, which includes two stages: encryption and embedding. In the encryption stage, sparse decomposition, image scrambling and threshold processing are sequentially performed on the plaintext image, and then a measurement matrix is ​​constructed using a random sequence for parallel compressed sensing, and then the image is quantized, and further rotation scrambling and random diffusion are performed to obtain a ciphertext image. In the embedding stage, the ciphertext image information is embedded into different wavelet coefficients of the carrier image through LWT, and the embedding depth is dynamically selected according to the random sequence to improve the concealment and security of the embedded information.

[0088] The present invention designs a pseudo-random sequence generation method based on restricted Boltzmann machine (RBM), which improves the randomness of the generated sequence; secondly, the present invention constructs a new parallel compressed sensing (CS) method, which can not only greatly improve the image processing efficiency but also achieve high-quality image reconstruction at a lower compression ratio by constructing an optimized measurement matrix; in addition, the present invention also adopts a dynamic embedding strategy, which enhances the anti-attack ability and robustness of the encrypted image by dynamically adjusting the embedding depth during the embedding process. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] Figure 1 This is a flow chart of an image hiding method based on restricted Boltzmann machine and parallel compressed sensing provided in Example 1.

[0090] Figure 2 This is a framework diagram of an image hiding method based on restricted Boltzmann machine and parallel compressed sensing provided in Example 2.

[0091] Figure 3 This is the structural diagram of the restricted Boltzmann machine provided in Example 2.

[0092] Figure 4 This is a schematic diagram of the rotation scrambling provided in Example 2.

[0093] Figure 5 Schematic diagram of the plaintext image Clock provided in Example 2.

[0094] Figure 6 This is a Goldhill schematic diagram of the carrier image provided in Example 2.

[0095] Figure 7 Schematic diagram of the ciphertext image Clock provided in Example 2.

[0096] Figure 8 This is a schematic diagram of the encrypted image Goldhill provided in Example 2.

[0097] Fig. 9 This is a schematic diagram of the decrypted image Clock provided in Example 2.

[0098] Fig.10 It is the histogram of the plaintext image Clock provided in Example 2.

[0099] Fig.11 This is the histogram of the carrier image Goldhill provided in Example 2.

[0100] Fig.12The histogram of the ciphertext image Clock provided in Example 2

[0101] Fig.13 This is the histogram of the encrypted image Goldhill provided in Example 2. DETAILED DESCRIPTION

[0102] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0103] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0104] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0105] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0106] Example 1

[0107] like Figure 1 As shown, this embodiment provides an image hiding method based on restricted Boltzmann machine and parallel compressed sensing, comprising the following steps:

[0108] S1: Obtain a plaintext image P and calculate a hash value hash of the plaintext image P, and generate two mixed sequences combine1 and combine2 based on the hash value hash;

[0109] S2: Initialize the restricted Boltzmann machine using the two mixed sequences combine1 and combine2, iteratively update the initialized restricted Boltzmann machine, and generate random sequences seqx, seqy and seqz;

[0110] S3: Sparse the plaintext image P to generate a sparse matrix P1, randomly scramble the sparse matrix P1 to generate a scrambled matrix P2, and perform threshold processing on the scrambled matrix P2 to obtain a matrix P3;

[0111] S4: Generate a measurement matrix using a random sequence seqy, perform compressed sensing on the matrix P3 using the measurement matrix to generate a compressed matrix P4; quantize the compressed matrix P4 to generate a quantized matrix P5;

[0112] S5: Divide the quantization matrix P5 into a plurality of sub-block matrices, rotate and scramble each of the sub-block matrices and then reassemble them to obtain a spliced ​​matrix P6; rotate and scramble the spliced ​​matrix P6 as a whole to obtain a matrix P7;

[0113] S6: Rearrange the random sequence seqx to generate a rearrangement matrix Z, and use the rearrangement matrix Z to further generate an index matrix I Z , using the rearrangement matrix Z and the index matrix I Z Performing a diffusion operation on the matrix P7 to obtain a ciphertext image cipher;

[0114] S7: Introduce the carrier image Q, perform lifting wavelet transform on the carrier image Q to obtain the frequency coefficient, split the cipher image cipher, use the random sequence seqz to control the embedding depth, embed the split cipher image cipher into the frequency coefficient, perform inverse lifting wavelet transform on the embedded frequency coefficient, and obtain the final cipher image S.

[0115] In the specific implementation process, firstly, the plaintext image P is obtained and the hash value hash of the plaintext image P is calculated, and two mixed sequences combine1 and combine2 are generated based on the hash value hash;

[0116] Use two mixed sequences combine1 and combine2 to initialize the restricted Boltzmann machine, iteratively update the initialized restricted Boltzmann machine, and generate random sequences seqx, seqy and seqz;

[0117] The plaintext image P is sparsely processed to generate a sparse matrix P1, the sparse matrix P1 is randomly scrambled to generate a scrambled matrix P2, and the scrambled matrix P2 is threshold processed to obtain a matrix P3;

[0118] A measurement matrix is ​​generated using a random sequence seqy, and a compressed sensing is performed on the matrix P3 using the measurement matrix to generate a compressed matrix P4; the compressed matrix P4 is quantized to generate a quantized matrix P5;

[0119] The quantization matrix P5 is divided into several sub-block matrices, each sub-block matrix is ​​rotated and scrambled respectively, and then re-joined to obtain a joint matrix P6; the joint matrix P6 is rotated and scrambled as a whole to obtain a matrix P7;

[0120] The random sequence seqx is rearranged to generate a rearrangement matrix Z, and the rearrangement matrix Z is used to further generate an index matrix I Z , using the rearrangement matrix Z and the index matrix I Z Perform diffusion operation on matrix P7 to obtain the ciphertext image cipher;

[0121] Finally, the carrier image Q is introduced, and the carrier image Q is subjected to lifting wavelet transform to obtain the frequency coefficients. The cipher image cipher is split, and the embedding depth is controlled by using the random sequence seqz. The split cipher image cipher is embedded into the frequency coefficients, and the embedded frequency coefficients are subjected to inverse lifting wavelet transform to obtain the final cipher image S.

[0122] This method can effectively improve the randomness of the sequence, while greatly improving the efficiency of image processing, and can also achieve high-quality image reconstruction at a lower compression ratio; in addition, the encrypted image generated by this method is more resistant to attacks and more robust.

[0123] Example 2

[0124] This embodiment provides an image hiding method based on restricted Boltzmann machine and parallel compressed sensing, comprising the following steps:

[0125] S1: Obtain a plaintext image P and calculate a hash value hash of the plaintext image P, and generate two mixed sequences combine1 and combine2 based on the hash value hash;

[0126] S2: Initialize the restricted Boltzmann machine using the two mixed sequences combine1 and combine2, iteratively update the initialized restricted Boltzmann machine, and generate random sequences seqx, seqy and seqz;

[0127] S3: Sparse the plaintext image P to generate a sparse matrix P1, randomly scramble the sparse matrix P1 to generate a scrambled matrix P2, and perform threshold processing on the scrambled matrix P2 to obtain a matrix P3;

[0128] S4: Generate a measurement matrix using a random sequence seqy, perform compressed sensing on the matrix P3 using the measurement matrix to generate a compressed matrix P4; quantize the compressed matrix P4 to generate a quantized matrix P5;

[0129] S5: Divide the quantization matrix P5 into a plurality of sub-block matrices, rotate and scramble each of the sub-block matrices and then reassemble them to obtain a spliced ​​matrix P6; rotate and scramble the spliced ​​matrix P6 as a whole to obtain a matrix P7;

[0130] S6: Rearrange the random sequence seqx to generate a rearrangement matrix Z, and use the rearrangement matrix Z to further generate an index matrix I Z , using the rearrangement matrix Z and the index matrix I Z Performing a diffusion operation on the matrix P7 to obtain a ciphertext image cipher;

[0131] S7: introduce the carrier image Q, perform lifting wavelet transform on the carrier image Q to obtain frequency coefficients, split the cipher image cipher, use the random sequence seqz to control the embedding depth, embed the split cipher image cipher into the frequency coefficients, perform inverse lifting wavelet transform on the embedded frequency coefficients, and obtain the final cipher image S;

[0132] The step S1 comprises:

[0133] S1.1: Calculate the hash value hash of the plaintext image P using the hash function SHA-256, wherein the hash value hash format is 64-bit hexadecimal. In this embodiment, other hash functions may also be used to calculate the hash value hash;

[0134] S1.2: Construct the following mathematical model, substitute the hash value hash into the mathematical model, and generate two initial values ​​s0 and s1:

[0135]

[0136] Among them, the hex2dec function is used to convert hexadecimal to decimal;

[0137] S1.3: Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v size h +size v +size h +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq1 and seq2. Merge sequences seq1 and seq2 to obtain a mixed sequence combined seq1 ;

[0138] Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq3 and seq4. Merge sequences seq3 and seq4 to obtain the mixed sequence combined seq2 ;

[0139] It should be noted that, in this embodiment, the number of iterations is just enough to generate the number of random numbers required for encryption. The first 100 are discarded to eliminate the influence of the initial value and achieve a stable chaotic state. Discarding more times is also feasible, but the encryption time will increase.

[0140] The merger is represented by:

[0141]

[0142] Among them, size v is the input layer dimension of the restricted Boltzmann machine, size h is the hidden layer dimension of the restricted Boltzmann machine;

[0143] The step S2 comprises:

[0144] S2.1: Initialize the initial values ​​of the vector x, weight matrix w, visible layer offset v and hidden layer offset h of the restricted Boltzmann machine using the two mixing sequences combine1 and combine2, specifically:

[0145]

[0146] Among them, x0, w0, v0 and h0 are the initial values ​​of vector x, weight matrix w, visible layer offset v and hidden layer offset h respectively;

[0147] S2.2: Calculate the pixel values ​​of the plaintext image P and determine the number of iterations t of the restricted Boltzmann machine, and then calculate the keys key1 and key2, specifically:

[0148]

[0149] Where M and N are the number of rows and columns of pixels in the plaintext image P, respectively;

[0150] S2.3: Substitute the keys key1 and key2 into the Logistic map and Cubic map respectively, iteratively generate d1 and d2, and calculate the perturbation factor d to update the vector x, specifically:

[0151]

[0152] Among them, x′ is the vector x after iterative update;

[0153] S2.4: Use contrastive divergence to update the weight matrix w, visible layer offset v and hidden layer offset h of the initialized restricted Boltzmann machine; then update the vector x′ through forward propagation and back propagation to obtain the vector x”;

[0154]

[0155] Among them, w′, h′ and v′ are the updated weight matrix w, visible layer offset v and hidden layer offset h respectively;

[0156] S2.5: Obtain random sequences seqx, seqy and seqz of length M*N from vector x″, specifically:

[0157]

[0158] The step S3 comprises:

[0159] S3.1: Sparse the plaintext image P to generate a sparse matrix P1 of size M×N:

[0160] P1=Ψ×P×Ψ T

[0161] Where, Ψ is the orthogonal wavelet matrix of SWT;

[0162] S3.2: Use two-dimensional Cat mapping to randomly scramble the sparse matrix P1:

[0163]

[0164] Where (x1, y1) is the pixel position in the plaintext image after sparseness, (x2, y2) is the pixel position in the image after random scrambling, and a and b are the first and second hyperparameters;

[0165] After several consecutive iterations, the scrambled matrix P2 is generated;

[0166] S3.3: Perform threshold processing on the scrambled matrix P2 and set the sparsity of the scrambled matrix P2 columns to:

[0167]

[0168] Wherein, CR is the compression ratio; θ and α are the third and fourth hyperparameters determined by the reconstruction method; the threshold of each column of the scrambled matrix P2 is the absolute value of the Kth largest element in the column, and the elements in each column of the scrambled matrix P2 whose absolute values ​​are less than the corresponding threshold are set to zero to obtain the matrix P3;

[0169] The step S4 comprises:

[0170] S4.1: Generate N measurement matrices Φ using random sequence seqy i , using the i-th measurement matrix Φ i Sampling the i-th column of the matrix P3, obtaining a compressed matrix P4 of size V×N, where V=M×CR;

[0171] S4.2: Quantize the pixel values ​​of the compression matrix P4 into integers in the interval [0,255] to generate the quantization matrix P5:

[0172]

[0173] Among them, P max and P min are the maximum and minimum values ​​of the pixel values ​​of the compression matrix P4 respectively;

[0174] The step S5 comprises:

[0175] S5.1: Divide the quantization matrix P5 into a plurality of sub-block matrices, each of which has a side length l of:

[0176]

[0177] Wherein, avg represents the pixel mean of the quantization matrix P5;

[0178] S5.2: rotating and scrambling each of the sub-block matrices respectively and then rejoining them to obtain a joint matrix P6; rotating and scrambling the entire joint matrix P6 to obtain a matrix P7;

[0179] The step S6 comprises:

[0180] S6.1: Rearrange the random sequence seqx to generate a rearrangement matrix Z with the same size as the matrix P7:

[0181]

[0182] Among them, seqx′ represents the rearranged random sequence seqx;

[0183] S6.2: Sort each column of the rearrangement matrix Z and further generate an index matrix I Z :

[0184]

[0185] S6.3: Using the rearrangement matrix Z and the index matrix I Z The matrix P7 is diffused to obtain the ciphertext image cipher:

[0186]

[0187] The step S7 comprises:

[0188] S7.1: Introduce the carrier image Q and perform preprocessing:

[0189] Q'=ceil(10+233 / 255*Q)

[0190] Among them, Q' is the preprocessed carrier image;

[0191] Perform lifting wavelet transform on the preprocessed carrier image Q' to obtain four frequency coefficient matrices CA, CH, CV and CD of the same size;

[0192] S7.2: Decompose the random sequence seqz into three subsequences and rearrange them into matrices sseq1, sseq2 and sseq3 of the same size as the frequency coefficient matrix;

[0193] S7.3: Split the cipher image to generate three matrices CH1, CV1 and CD1, expressed as:

[0194]

[0195] S7.4: Use matrices sseq1, sseq2, and sseq3 to control the embedding depth and calculate the embedded shift amounts CHshift, CVshift, and CDshift:

[0196]

[0197] S7.5: According to the embedded displacement, the matrices CH1, CV1 and CD1 are embedded into the corresponding frequency coefficient matrices to obtain three embedded frequency coefficient matrices CH2, CV2 and CD2:

[0198]

[0199] S7.6: Perform inverse lifting wavelet transform on matrices CA, CH2, CV2 and CD2 to obtain the final encrypted image S:

[0200]

[0201] Among them, LS represents the wavelet lifting scheme object (Lifting Scheme Object), which stores the lifting structure information of the Haar wavelet and includes the wavelet transform method and parameters for performing integer-to-integer conversion.

[0202] In the specific implementation process, Figure 2 As shown, firstly, a plaintext image P is obtained and a hash value hash of the plaintext image P is calculated, and two mixed sequences combine1 and combine2 are generated based on the hash value hash;

[0203] Specifically, the hash value hash of the plaintext image P is calculated using the hash function SHA-256, wherein the hash value hash format is 64-bit hexadecimal;

[0204] Construct the following mathematical model, substitute the hash value hash into the mathematical model, and generate two initial values ​​s0 and s1:

[0205]

[0206] Among them, the hex2dec function is used to convert hexadecimal to decimal;

[0207] Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v size h +size v +size h+100 iterations, and discard the results of the first 100 iterations to obtain sequences seq1 and seq2. Merge sequences seq1 and seq2 to obtain a mixed sequence combined seq1 ;

[0208] Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq3 and seq4. Merge sequences seq3 and seq4 to obtain the mixed sequence combined seq2 ;

[0209] The merger is represented by:

[0210]

[0211] Among them, size v is the input layer dimension of the restricted Boltzmann machine, size h is the hidden layer dimension of the restricted Boltzmann machine;

[0212] Initialize the restricted Boltzmann machine using the two mixed sequences combine1 and combine2, iteratively update the initialized restricted Boltzmann machine, and generate random sequences seqx, seqy, and seqz;

[0213] Specifically, the two mixing sequences combine1 and combine2 are used to initialize the initial values ​​of the vector x, weight matrix w, visible layer offset v, and hidden layer offset h of the restricted Boltzmann machine, such as Figure 3 The structure diagram of the restricted Boltzmann machine is shown as follows:

[0214]

[0215] Among them, x0, w0, v0 and h0 are the initial values ​​of vector x, weight matrix w, visible layer offset v and hidden layer offset h respectively;

[0216] Calculate the pixel value of the plaintext image P and determine the number of iterations t of the restricted Boltzmann machine, and then calculate the keys key1 and key2, specifically:

[0217]

[0218] Where M and N are the number of rows and columns of pixels in the plaintext image P, respectively;

[0219] Substitute the keys key1 and key2 into the Logistic map and Cubic map respectively, iteratively generate d1 and d2, and calculate the disturbance factor d to update the vector x, specifically:

[0220]

[0221] Among them, x′ is the vector x after iterative update;

[0222] Use contrastive divergence to update the weight matrix w, visible layer offset v and hidden layer offset h of the initialized restricted Boltzmann machine; then combine forward propagation and backpropagation to update the vector x′ to obtain the vector x”;

[0223]

[0224] Among them, w′, h′ and v′ are the updated weight matrix w, visible layer offset v and hidden layer offset h respectively;

[0225] The random sequences seqx, seqy and seqz with length M*N are obtained from the vector x″, specifically:

[0226]

[0227] Then the plaintext image P is sparsely constructed to generate a sparse matrix P1 of size M×N:

[0228] P1=Ψ×P×Ψ T

[0229] Where, Ψ is the orthogonal wavelet matrix of SWT;

[0230] Use two-dimensional Cat mapping to randomly scramble the sparse matrix P1:

[0231]

[0232] Where (x1, y1) is the pixel position in the plaintext image after sparseness, (x2, y2) is the pixel position in the image after random scrambling, and a and b are the first and second hyperparameters;

[0233] After several consecutive iterations, the scrambled matrix P2 is generated;

[0234] Perform threshold processing on the scrambled matrix P2 and set the sparsity of the scrambled matrix P2 columns to:

[0235]

[0236] Wherein, CR is the compression ratio; θ and α are the third and fourth hyperparameters determined by the reconstruction method; the threshold of each column of the scrambled matrix P2 is the absolute value of the Kth largest element in the column, and the elements in each column of the scrambled matrix P2 whose absolute values ​​are less than the corresponding threshold are set to zero to obtain the matrix P3;

[0237] Then use the random sequence seqy to generate N measurement matrices Φ i , using the i-th measurement matrix Φ i Sampling the i-th column of the matrix P3, obtaining a compressed matrix P4 of size V×N, where V=M×CR;

[0238] Quantize the pixel values ​​of the compressed matrix P4 into integers in the range [0,255] to generate the quantization matrix P5:

[0239]

[0240] Among them, P max and P min are the maximum and minimum values ​​of the pixel values ​​of the compression matrix P4 respectively;

[0241] Then the quantization matrix P5 is divided into several sub-block matrices, and the side length l of each sub-block matrix is:

[0242]

[0243] Wherein, avg represents the pixel mean of the quantization matrix P5;

[0244] Each of the sub-block matrices is rotated and scrambled respectively and then reassembled to obtain a spliced ​​matrix P6; the spliced ​​matrix P6 is rotated and scrambled as a whole to obtain a matrix P7; Figure 4 Shown is a schematic diagram of rotation scrambling;

[0245] Then the random sequence seqx is rearranged to generate a rearrangement matrix Z of the same size as the matrix P7:

[0246]

[0247] Among them, seqx′ represents the rearranged random sequence seqx;

[0248] Sort each column of the rearrangement matrix Z and further generate the index matrix I Z :

[0249]

[0250] Using the rearrangement matrix Z and the index matrix I Z The matrix P7 is diffused to obtain the ciphertext image cipher:

[0251]

[0252] Finally, the carrier image Q is introduced and preprocessed:

[0253] Q'=ceil(10+233 / 255*Q)

[0254] Among them, Q' is the preprocessed carrier image;

[0255] Perform lifting wavelet transform on the preprocessed carrier image Q' to obtain four frequency coefficient matrices CA, CH, CV and CD of the same size;

[0256] Decompose the random sequence seqz into three subsequences and rearrange them into matrices sseq1, sseq2 and sseq3 of the same size as the frequency coefficient matrix;

[0257] Split the cipher image to generate three matrices CH1, CV1 and CD1, expressed as:

[0258]

[0259] The matrices sseq1, sseq2, and sseq3 are used to dynamically control the embedding depth of each coefficient and calculate the embedded shifts CHshift, CVshift, and CDshift:

[0260]

[0261] According to the embedded displacement, the matrices CH1, CV1 and CD1 are embedded into the corresponding frequency coefficient matrices to obtain three embedded frequency coefficient matrices CH2, CV2 and CD2:

[0262]

[0263] Perform inverse lifting wavelet transform on matrices CA, CH2, CV2 and CD2 to obtain the final encrypted image S:

[0264]

[0265] Among them, LS represents the wavelet lifting scheme object, which stores the lifting structure information of the Haar wavelet and contains the wavelet transform method and parameters for performing integer-to-integer conversion;

[0266] This embodiment also provides a simulation experiment. Figure 5 The plaintext image Clock is shown as Figure 6 The carrier image Goldhill is shown; Figure 5 The plaintext image Clock is encrypted to obtain Figure 7 The ciphertext image shown in Figure 7 The ciphertext image shown is embedded in Figure 6 In the carrier image of Figure 8 The classified image shown; Figure 8 Decrypt the encrypted image and get Fig. 9 The decrypted image shown; it can be seen that this method can achieve high-quality image hiding;

[0267] This embodiment also counts Figures 5 to 8 The grayscale histogram of Figures 10 to 13 As shown in the figure, they are the histogram of the plaintext image Clock, the histogram of the carrier image Goldhill, the histogram of the ciphertext image, and the histogram of the carrier image. Figures 10 to 13 It can be seen that this method has high security and strong robustness;

[0268] This method can effectively improve the randomness of the sequence, while greatly improving the efficiency of image processing, and can also achieve high-quality image reconstruction at a lower compression ratio; in addition, the encrypted image generated by this method is more resistant to attacks and more robust.

[0269] The same or similar reference numerals correspond to the same or similar components;

[0270] The terms used in the drawings to describe positional relationships are only used for illustrative purposes and should not be construed as limiting this patent;

[0271] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. An image hiding method based on restricted Boltzmann machine and parallel compressed sensing, characterized in that: The following steps are involved: S1: Obtain a plaintext image P and calculate a hash value hash of the plaintext image P, and generate two mixed sequences combine1 and combine2 based on the hash value hash; S2: Initialize the restricted Boltzmann machine using the two mixed sequences combine1 and combine2, iteratively update the initialized restricted Boltzmann machine, and generate random sequences seqx, seqy and seqz; S3: Sparse the plaintext image P to generate a sparse matrix P1, randomly scramble the sparse matrix P1 to generate a scrambled matrix P2, and perform threshold processing on the scrambled matrix P2 to obtain a matrix P3; S4: Generate a measurement matrix using a random sequence seqy, perform compressed sensing on the matrix P3 using the measurement matrix to generate a compressed matrix P4; quantize the compressed matrix P4 to generate a quantized matrix P5; S5: Divide the quantization matrix P5 into a plurality of sub-block matrices, rotate and scramble each of the sub-block matrices and then reassemble them to obtain a spliced ​​matrix P6; rotate and scramble the spliced ​​matrix P6 as a whole to obtain a matrix P7; S6: Rearrange the random sequence seqx to generate a rearrangement matrix Z, and use the rearrangement matrix Z to further generate an index matrix I Z , using the rearrangement matrix Z and the index matrix I Z Performing a diffusion operation on the matrix P7 to obtain a ciphertext image cipher; S7: Introduce the carrier image Q, perform lifting wavelet transform on the carrier image Q to obtain the frequency coefficient, split the cipher image cipher, use the random sequence seqz to control the embedding depth, embed the split cipher image cipher into the frequency coefficient, perform inverse lifting wavelet transform on the embedded frequency coefficient, and obtain the final cipher image S.

2. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 1, characterized in that: The step S1 comprises: S1.1: Calculate the hash value hash of the plaintext image P using the hash function SHA-256, wherein the hash value hash format is 64-bit hexadecimal; S1.2: Construct the following mathematical model, substitute the hash value hash into the mathematical model, and generate two initial values ​​s0 and s1: Among them, the hex2dec function is used to convert hexadecimal to decimal; S1.3: Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v size h +size v +size h +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq1 and seq2. Merge sequences seq1 and seq2 to obtain a mixed sequence combined seq1 ; Substitute the initial values ​​s0 and s1 into the Logistic map and Cubic map respectively to perform size v +100 iterations, and discard the results of the first 100 iterations to obtain sequences seq3 and seq4. Merge sequences seq3 and seq4 to obtain the mixed sequence combined seq2 ; The merger is represented by: Among them, size v is the input layer dimension of the restricted Boltzmann machine, size h is the hidden layer dimension of the restricted Boltzmann machine.

3. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 2, characterized in that: The step S2 comprises: S2.1: Initialize the initial values ​​of the vector x, weight matrix w, visible layer offset v and hidden layer offset h of the restricted Boltzmann machine using the two mixing sequences combine1 and combine2, specifically: Among them, x0, w0, v0 and h0 are the initial values ​​of vector x, weight matrix w, visible layer offset v and hidden layer offset h respectively; S2.2: Calculate the pixel values ​​of the plaintext image P and determine the number of iterations t of the restricted Boltzmann machine, and then calculate the keys key1 and key2, specifically: Where M and N are the number of rows and columns of pixels in the plaintext image P, respectively; S2.3: Substitute the keys key1 and key2 into the Logistic map and Cubic map respectively, iteratively generate d1 and d2, and calculate the perturbation factor d to update the vector x, specifically: Among them, x′ is the vector x after iterative update; S2.4: Use contrastive divergence to update the weight matrix w, visible layer offset v and hidden layer offset h of the initialized restricted Boltzmann machine; then combine forward propagation and backpropagation to update the vector x′ to obtain the vector x″; Among them, w′, h′ and v′ are the updated weight matrix w, visible layer offset v and hidden layer offset h respectively; S2.5: Obtain random sequences seqx, seqy and seqz of length M*N from vector x″, specifically:

4. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 3 is characterized in that: The step S3 comprises: S3.1: Sparse the plaintext image P to generate a sparse matrix P1 of size M×N: P1=Ψ×P×Ψ T Where, Ψ is the orthogonal wavelet matrix of SWT; S3.2: Use two-dimensional Cat mapping to randomly scramble the sparse matrix P1: Where (x1, y1) is the pixel position in the plaintext image after sparseness, (x2, y2) is the pixel position in the image after random scrambling, and a and b are the first and second hyperparameters; After several consecutive iterations, the scrambled matrix P2 is generated; S3.3: Perform threshold processing on the scrambled matrix P2 and set the sparsity of the scrambled matrix P2 columns to: Among them, CR is the compression rate; θ and α are the third and fourth hyperparameters determined by the reconstruction method; the threshold of each column of the scrambled matrix P2 is the absolute value of the Kth largest element in the column, and the elements in each column of the scrambled matrix P2 whose absolute values ​​are less than the corresponding threshold are set to zero to obtain the matrix P3.

5. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 4, characterized in that: The step S4 comprises: S4.1: Generate N measurement matrices Φ using random sequence seqy i , using the i-th measurement matrix Φ i Sampling the i-th column of the matrix P3, obtaining a compressed matrix P4 of size V×N, where V=M×CR; S4.2: Quantize the pixel values ​​of the compression matrix P4 into integers in the range [0,255] to generate the quantization matrix P5: Among them, P max and P min are the maximum and minimum pixel values ​​of the compressed matrix P4 respectively.

6. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 5, characterized in that: The step S5 comprises: S5.1: Divide the quantization matrix P5 into a plurality of sub-block matrices, each of which has a side length l of: Wherein, avg represents the pixel mean of the quantization matrix P5; S5.2: Rotate and scramble each of the sub-block matrices and then re-join them to obtain a joined matrix P6; rotate and scramble the whole joined matrix P6 to obtain a matrix P7.

7. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 6, characterized in that: The step S6 comprises: S6.1: Rearrange the random sequence seqx to generate a rearrangement matrix Z with the same size as the matrix P7: Among them, seqx′ represents the rearranged random sequence seqx; S6.2: Sort each column of the rearrangement matrix Z and further generate an index matrix I Z : S6.3: Using the Rearrangement Matrix Z and the Index Matrix I Z The matrix P7 is diffused to obtain the ciphertext image cipher:

8. The image hiding method based on restricted Boltzmann machine and parallel compressed sensing according to claim 7, characterized in that: The step S7 comprises: S7.1: Introduce the carrier image Q and perform preprocessing: Q'=ceil(10+233 / 255*Q) Among them, Q' is the preprocessed carrier image; Perform lifting wavelet transform on the preprocessed carrier image Q' to obtain four frequency coefficient matrices CA, CH, CV and CD of the same size; S7.2: Decompose the random sequence seqz into three subsequences and rearrange them into matrices sseq1, sseq2 and sseq3 of the same size as the frequency coefficient matrix; S7.3: Split the cipher image cipher to generate three matrices CH1, CV1 and CD1, expressed as: S7.4: Use matrices sseq1, sseq2, and sseq3 to control the embedding depth and calculate the embedded shift amounts CHshift, CVshift, and CDshift: S7.5: According to the embedded displacement, the matrices CH1, CV1 and CD1 are embedded into the corresponding frequency coefficient matrices to obtain three embedded frequency coefficient matrices CH2, CV2 and CD2: S7.6: Perform inverse lifting wavelet transform on matrices CA, CH2, CV2 and CD2 to obtain the final encrypted image S: S=ilwt2(CA,CH2,CV2,CD2,LS) Wherein, LS represents the wavelet lifting scheme object.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 8 are implemented.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 8 are executed.

Citation Information

Patent Citations

  • Image encryption method based on integer wavelet transform and compressed sensing

    CN113115053A

  • Image hiding method, system and equipment based on compressed sensing and self-adaptive embedding and medium

    CN115941853A

  • Apparatus and method for predicting compression quality of image in electronic device

    US20230102895A1