Generative steganography method based on reversible conditional flow model
By introducing a reversible conditional flow model and conditional attention coupling layer in the generative steganography, the problems of uncontrollable and low extraction accuracy in the prior art are solved, and reversible information hiding and high security are achieved.
Patent Information
- Application Number
- CN202510562496.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
When the hidden capacity of the existing generative steganography method increases, the accuracy of extracting secret information decreases, and it is difficult to control the content of the dense images. The steganography process is irreversible and the security is insufficient.
A reversible conditional flow model is adopted, a conditional attention coupling layer and a prior module are introduced, and image features are processed through conditional variables to generate controllable dense images, and the accurate extraction of secret information is realized at the receiving end.
It realizes that the content of dense images is controllable, and the steganography process is reversible, which improves the information hiding capacity and extraction accuracy, and improves the security of steganography.
Smart Images

Figure CN120499327A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image steganography, and more specifically, relates to a generative steganography method based on a reversible conditional flow model. Background Art
[0002] In recent years, generative steganography has become a hot topic of research. Unlike traditional steganography, which hides secret information by modifying a carrier image, generative steganography directly synthesizes secret information into a cryptic image. Images synthesized by generative models can be divided into two categories: unencrypted images synthesized when no secret information is input; and encrypted images synthesized when secret information is input. To correspond to traditional steganography, the synthesized unencrypted images are referred to as carrier images, and the synthesized images containing secret information are referred to as cryptic images. Existing generative steganography methods synthesize indistinguishable unencrypted and cryptic images to resist detection by steganalysis algorithms and ensure security. Currently, researchers commonly use generative adversarial networks (GANs) to synthesize cryptic images. This requires training a neural network to extract the secret information from the cryptic image. The accuracy of hidden information extraction typically ranges from 80% to 95%. However, as the hidden capacity increases, the accuracy of secret information extraction decreases rapidly. Summary of the Invention
[0003] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a generative steganography method based on a reversible conditional flow model. A reversible conditional flow model is proposed to achieve controllable content of the secret image and reversible steganography process, thereby improving the information hiding capacity, extraction accuracy and security.
[0004] In order to achieve the above-mentioned object of the invention, the generative steganography method based on the reversible conditional flow model of the present invention includes the following steps:
[0005] S1: Construct a reversible conditional flow model, including stacked L-1 flow components, a flow model compression module, a flow model flow block, and a priori modules. The value of L is determined as needed, where:
[0006] L-1 flow components are used to process the floating-point image X to generate latent variables z i′ , i′=1,2,…,L-1; each stream component consists of a stacked stream component compression module, K stream blocks, and a splitting layer. The value of K is determined as needed. Each stream block includes an activation normalization layer, a stream block 1×1 convolution layer, and a conditional attention coupling layer, where:
[0007] The activation normalization layer is used to perform activation normalization on the input features and send the obtained features to the stream block 1×1 convolution layer;
[0008] The stream block 1×1 convolution layer is used to perform 1×1 convolution on the input features and send the obtained features to the conditional attention coupling layer;
[0009] The conditional attention coupling layer is used to receive the features sent by the 1×1 convolutional layer of the stream block, and output them after conditional attention coupling processing according to the conditional variables; the conditional attention coupling layer includes input splitting layer, linear layer, first feature addition layer, first 1×1 convolutional layer, multi-head attention layer, second 1×1 convolutional layer, first 3×3 convolutional layer, second feature addition layer, third 1×1 convolutional layer, third feature addition layer, second 3×3 convolutional layer, weighted layer, splitting layer, sigmoid layer, point product layer, fourth feature addition layer and feature splicing layer, where:
[0010] The input split layer is used to couple the input feature data of the conditional attention layer in Split into feature in1 and feature in2, send feature in1 to the first feature addition layer, the first 3×3 convolution layer and the feature splicing layer, and send feature in2 to the dot product layer;
[0011] The linear layer is used to linearly map the conditional variable y to obtain the feature linear(y) and send it to the first feature addition layer and the second feature addition layer;
[0012] The first feature addition layer is used to add the feature linear(y) as position information to the feature in1, and send the obtained feature to the first 1×1 convolutional layer;
[0013] The first 1×1 convolution layer is used to perform 1×1 convolution on the received features and send the obtained features to the multi-head attention layer;
[0014] The multi-head attention layer is used to process the received features using the multi-head attention mechanism and send the obtained features to the second 1×1 convolutional layer;
[0015] The second 1×1 convolution layer is used to perform 1×1 convolution processing on the received features and send the obtained features to the third feature addition layer;
[0016] The first 3×3 convolution layer is used to perform 3×3 convolution processing on the feature in1, and the obtained feature Send to the second feature addition layer;
[0017] The second feature addition layer is used to add the feature linear(y) as position information to the feature In , the obtained features are sent to the third 1×1 convolutional layer;
[0018] The third 1×1 convolution layer is used to perform 1×1 convolution processing on the received features and send the obtained features to the third feature addition layer;
[0019] The third feature addition layer is used to superimpose the two received features and send the obtained features to the second 3×3 convolutional layer;
[0020] The second 3×3 convolutional layer is used to perform 3×3 convolution processing on the received features and send the obtained features f to the weighted layer;
[0021] The weighted layer is used to multiply the feature f by the learnable weight parameter p along the channel direction and output the obtained feature to the splitting layer;
[0022] The splitting layer is used to split the received features into two features a and b of the same size along the channel, sending feature a to the sigmoid layer and feature b to the fourth feature addition layer;
[0023] The Sigmoid layer is used to process feature a using the sigmoid function to obtain feature And send it to the dot product layer;
[0024] The dot product layer is used to combine feature in2 and feature Perform point multiplication and send the obtained feature c to the fourth feature addition layer;
[0025] The fourth feature addition layer is used to superimpose feature b and feature c, and send the obtained feature d to the feature splicing layer;
[0026] The feature concatenation layer is used to concatenate feature in1 and feature d to obtain feature data out And output;
[0027] The flow model compression module is used to compress the latent variable z L-1 Perform compression processing to obtain compression features
[0028] The flow block of the flow model adopts the same structure as the flow block in the flow component, which is used to compress features. Processing is performed to obtain the initial latent variables
[0029] The prior module is used to initialize latent variables Processing is performed to obtain the final latent variable z L The prior module includes a linear layer, a convolutional layer, a feature addition layer, a splitting layer, and an affine transformation layer, where:
[0030] The linear layer is used to linearly map the conditional variable y to obtain the feature y cond Send to the feature addition layer;
[0031] The initial value of the convolution layer is 0, which is used to initialize the latent variables. Perform convolution operation and send the obtained feature C to the feature addition layer;
[0032] The feature addition layer is used to add the feature y cond Superimpose it with feature C and output the obtained feature h to the splitting layer;
[0033] The splitting layer is used to split the received feature h into two features of the same size along the channel, which are used as the mean γ and the log value of the standard deviation log(δ), and then sent to the affine transformation layer;
[0034] The affine transformation layer is used to transform the initial latent variables according to the log value of the mean γ and the standard deviation log(δ) Perform affine transformation to obtain the final latent variable z L , the normalization formula is as follows:
[0035]
[0036] S2: Obtain a training sample set based on actual needs to train the reversible conditional flow model, and deploy the trained reversible conditional flow model to the sender and receiver;
[0037] S3: The sender binarizes the secret information to obtain the binary secret information d, and sets L latent variable matrices according to the actual situation of the reversible conditional flow model type and image size i=1,2,…,L, thus obtaining the latent variable Embed the binary secret information d into the latent variable In the above example, we generate hidden variables Z={z1,z2,…,z L Then determine the conditional variable y, input the secret latent variable Z and the conditional variable y into the trained reversible conditional flow model, perform a quantization operation on the image generated by the reversible conditional flow model, convert the pixel values to [0, 255], and thus obtain the secret image X, which is sent together with the conditional variable y to the receiver;
[0038] S4: After receiving the encrypted image X′ and the conditional variable y′, the receiver converts the encrypted image X′ into a floating-point image X′ float , the floating point image X′ float and conditional variables y′ are input into the trained reversible conditional flow model to obtain the hidden variables Z′={z1′,z′2,…,z′ L}, and then the binary secret information d′ is extracted according to the inverse operation of embedding the sender's binary secret signal into the hidden variable.
[0039] The present invention is based on a generative steganography method of a reversible conditional flow model. A conditional attention coupling layer is introduced into the flow component of the reversible conditional flow model, and conditional attention coupling processing is performed on image features according to conditional variables. A priori module is added at the end of the reversible conditional flow model to process the initial latent variables of the Lth layer according to the conditional variables to obtain the final latent variables of the Lth layer. After training, the reversible conditional flow model is deployed to the sender and receiver. The sender hides the secret information in the latent variables and then inputs them into the reversible conditional flow model to generate a secret image. The secret image and the conditional variables are sent together to the receiver. The receiver inputs the received secret image and conditional variables into the reversible conditional flow model to obtain the latent variables, and then extracts the secret information from them.
[0040] The present invention has the following beneficial effects:
[0041] 1) The encrypted image generation process of the present invention is reversible. After the encrypted image is generated from the secret information, the hidden information can be accurately recovered from the encrypted image;
[0042] 2) The present invention introduces conditional variables to make the content of the generated encrypted image controllable. The sender can simply change the conditional variables to guide the content of the encrypted image, which brings more convenience to secret communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flowchart of a specific implementation of the generative steganography method based on the reversible conditional flow model of the present invention;
[0044] Figure 2 It is a structural diagram of the reversible conditional flow model in the present invention;
[0045] Figure 3 is a structural diagram of the conditional attention coupling layer in the present invention;
[0046] Figure 4 It is a structural diagram of the a priori module in the present invention;
[0047] Figure 5 is an example diagram of secret information hiding and secret information extraction in the present invention;
[0048] Figure 6 is the encrypted image generated by the present invention when the category label of the Fashion-Mnist dataset is used as the conditional variable in this embodiment;
[0049] Figure 7 is the encrypted image generated by the present invention when the attribute labels of the CelebA dataset are used as conditional variables in this embodiment;
[0050] Figure 8 This is a comparison diagram of encrypted images generated by the C-GlowGS method of the present invention under the same condition variables in this embodiment. DETAILED DESCRIPTION
[0051] The following describes the specific embodiments of the present invention in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when detailed descriptions of known functions and designs may dilute the main content of the present invention, such descriptions will be omitted here.
[0052] Example
[0053] Figure 1 This is a flow chart of a specific implementation of the generative steganography method based on the reversible conditional flow model of the present invention. Figure 1 As shown, the specific steps of the generative steganography method based on the reversible conditional flow model of the present invention include:
[0054] S101: Constructing a reversible conditional flow model:
[0055] In order to achieve controllable content of the secret image and reversible steganography process, the present invention constructs a reversible conditional flow (C-Flow) model. Figure 2 It is the structural diagram of the reversible conditional flow model in the present invention. Figure 2 As shown, the reversible conditional flow model in the present invention includes stacked L-1 flow components 1, a flow model compression module 2 (Squeeze), a flow model flow block 3 and a priori module 4 (Prior). The value of LK is determined as needed, where:
[0056] L-1 stream components 1 are used to process the floating-point image X and generate latent variables z i′ , i′=1,2,…,L-1. Similar to the conventional generative flow model, each flow component 1 includes a flow component compression module 11, K flow blocks (Flow Step) 12 and a split layer 13 (Split). The difference is that the flow block 12 in the present invention takes conditional variables into consideration and adopts the Conditional Attention-based Affine Coupling (CAAC) layer. Figure 2 As shown, each stream block 12 in the present invention includes an activation normalization (Actnorm) layer 121, a stream block 1×1 convolution layer 122, and a conditional attention coupling layer 123, wherein:
[0057] The activation normalization layer 121 is used to perform activation normalization on the input features and send the obtained features to the stream block 1×1 convolution layer 122.
[0058] The stream block 1×1 convolution layer 122 is used to perform 1×1 convolution processing on the input features and send the obtained features to the conditional attention coupling layer 123.
[0059] The conditional attention coupling layer 123 is used to receive the features sent by the stream block 1×1 convolution layer 122, and output them after performing conditional attention coupling processing according to the conditional variables. Figure 3 This is the structural diagram of the conditional attention coupling layer in the present invention. Figure 3 As shown, the conditional attention coupling layer 123 of the present invention includes an input splitting layer 12301, a linear layer 12302, a first feature addition layer 12303, a first 1×1 convolutional layer 12304, a multi-head attention layer 12305, a second 1×1 convolutional layer 12306, a first 3×3 convolutional layer 12307, a second feature addition layer 12308, a third 1×1 convolutional layer 12309, a third feature addition layer 12310, a second 3×3 convolutional layer 12311, a weighted layer 12312, a splitting layer 12313, a sigmoid layer 12314, a dot product layer 12315, a fourth feature addition layer 12316 and a feature splicing layer 12317, wherein:
[0060] The input split layer 12301 is used to couple the input feature data of the conditional attention layer in Split into feature in1 and feature in2, send feature in1 to the first feature addition layer 12303, the first 3×3 convolution layer 12307 and the feature splicing layer 12317, and send feature in2 to the dot product layer 12315.
[0061] The linear layer 12302 is used to perform linear mapping on the conditional variable y to obtain the feature linear(y) and send it to the first feature addition layer 12303 and the second feature addition layer 12308.
[0062] The first feature addition layer 12303 is used to superimpose the feature linear(y) as position information onto the feature in1, and send the obtained feature to the first 1×1 convolutional layer 12304.
[0063] The first 1×1 convolutional layer 12304 is used to perform 1×1 convolution processing on the received features and send the obtained features to the multi-head attention layer 12305.
[0064] The multi-head attention layer 12305 is used to process the received features using a multi-head attention mechanism and send the obtained features to the second 1×1 convolutional layer 12306. The multi-head attention mechanism is a commonly used feature processing method, and its specific process is not repeated here.
[0065] The second 1×1 convolution layer 12306 is used to perform 1×1 convolution processing on the received features and send the obtained features to the third feature addition layer 12310.
[0066] The first 3×3 convolution layer 12307 is used to perform 3×3 convolution processing on the feature in1, and the obtained feature Send to the second feature addition layer 12308.
[0067] The second feature addition layer 12308 is used to superimpose the feature linear(y) as position information to the feature In , the obtained features are sent to the third 1×1 convolutional layer 12309.
[0068] The third 1×1 convolution layer 12309 is used to perform 1×1 convolution processing on the received features and send the obtained features to the third feature addition layer 12310.
[0069] The third feature addition layer 12310 is used to superimpose the two received features and send the obtained features to the second 3×3 convolutional layer 12311.
[0070] The second 3×3 convolutional layer 12311 is used to perform 3×3 convolution processing on the received features and send the obtained features f to the weighted layer 12312.
[0071] The weighted layer 12312 is used to multiply the feature f by the learnable weight parameter p along the channel direction and output the obtained feature to the splitting layer 12313.
[0072] The splitting layer 12313 is used to split the received features into two features a and b of the same size along the channel, send feature a to the sigmoid layer 12314, and send feature b to the fourth feature addition layer 12316.
[0073] The sigmoid layer 12314 is used to process feature a using the sigmoid function to obtain feature And send it to the point multiplication layer 12315.
[0074] The dot product layer 12315 is used to combine feature in2 and feature Perform dot multiplication and send the obtained feature c to the fourth feature addition layer 12316.
[0075] The fourth feature addition layer 12316 is used to superimpose feature b and feature c, and send the obtained feature d to the feature splicing layer 12317.
[0076] Feature concatenation layer 12317 is used to concatenate feature in1 and feature d to obtain feature data out And output.
[0077] According to the above description, the input feature data in the conditional attention coupling layer 123 of the present invention is in The processing is divided into 4 branches. Feature in1 is processed by branches 1, 2, and 3. In branch 1, feature in1 does not undergo any transformation and directly reaches the feature concatenation layer 12317. The features processed by multi-head attention in branch 2 are superimposed with the features processed by convolution in branch 3 and then processed. The obtained features are segmented and interact with feature in2. Feature in2 is processed by branch 4, that is, the two features obtained by processing feature in1 are The weighted sum of α and β is added together to obtain the feature output to the feature concatenation layer 12317. The forward function of the four branches can be expressed as follows:
[0078] in1,in2=split(data in )
[0079] out1=in1
[0080] a,b=NN(in1,y)
[0081]
[0082] data out =concat(out1,out2)
[0083] The inverse function can be expressed as follows:
[0084] out1,out2=split(data out )
[0085] a,b=NN(out1,y)
[0086]
[0087] in1=out1
[0088] data in =concat(in1,in2)
[0089] The flow model compression module 2 is used to compress the latent variable z L-1 Perform compression processing to obtain compression features
[0090] The flow model flow block 3 uses the same structure as the flow block 12 in the flow component, which is used to compress the features. Processing is performed to obtain the initial latent variables
[0091] Prior module 4 is used to initialize latent variables Processing is performed to obtain the final latent variable z L . Figure 4 This is the structural diagram of the a priori module in the present invention. Figure 4 As shown, the prior module 4 in the present invention includes a linear layer 41, a convolutional layer 42, a feature addition layer 43, a splitting layer 44 and an affine transformation layer 45, wherein:
[0092] The linear layer 41 is used to perform linear mapping on the conditional variable y, and the obtained feature y cond Send to the feature addition layer 43.
[0093] The initial value of the convolution layer 42 is 0, which is used to initialize the latent variable A convolution operation is performed and the obtained feature C is sent to the feature addition layer 43.
[0094] The feature addition layer 43 is used to add the feature y cond It is superimposed with feature C and the obtained feature h is output to the splitting layer 44.
[0095] The splitting layer 44 is used to split the received feature h into two features of the same size along the channel, which are respectively used as the mean γ and the log value of the standard deviation log(δ), and then sent to the affine transformation layer 45.
[0096] The affine transformation layer 45 is used to transform the initial latent variables according to the mean γ and the log value log(δ) of the standard deviation Perform affine transformation to obtain the final latent variable z L , the affine transformation formula is as follows:
[0097]
[0098] The a priori module in the present invention can accurately control the image content through the conditional variable y, while improving the image quality. The forward function of the a priori module can be expressed as follows:
[0099] y cond =linear(y)
[0100]
[0101] γ,log(δ)=split(h)
[0102]
[0103] The inverse function can be expressed as follows:
[0104] y cond =linear(y)
[0105] h=conv(zero′(z L ))+ycond
[0106] γ,log(δ)=split(h)
[0107]
[0108] S102: Train and deploy a reversible conditional flow model:
[0109] According to actual needs, a training sample set is obtained to train the reversible conditional flow model, and the trained reversible conditional flow model is deployed to the sender and receiver.
[0110] The purpose of training the reversible conditional flow model is to learn the mapping between images and Gaussian-distributed latent variables, achieving reversible transformation between images and latent variables. This is independent of whether the image contains secret information, so non-secret ordinary images can be used for training. However, since the input images of the reversible conditional flow model are floating-point images, dequantization is required for regular images. Therefore, the specific method for obtaining the training sample set in this embodiment is as follows:
[0111] Randomly obtain several images and normalize them to the input image size of the reversible conditional flow model, and then perform a dequantization operation on each image. The specific formula for the dequantization operation is:
[0112]
[0113] Among them, X0 represents the original image, X represents the image after dequantization operation, Indicates rounding down, α indicates the scale factor, β indicates the dequantization level, and u is the noise that obeys the uniform distribution. In a digital image that can be represented by 8 bits, α and β can be determined by the hyperparameter φ, that is, α = 2 8-φ , β=2 φ .
[0114] A randomly sampled noise image is generated for each dequantized image to form a training sample, thereby obtaining a training sample set.
[0115] The loss function used in the reversible conditional flow model training in this embodiment is as follows:
[0116]
[0117] Among them, M represents the number of samples in the training sample set, X m 、Y m Represent the image and noise image in the mth training sample, H×W represents the height and width of the image, logp(X m |Y m) represents the logarithmic conditional probability density of the reversible conditional flow model for the mth training sample. In this embodiment, the logarithmic conditional probability density logp(X m |Y m ) is calculated as:
[0118]
[0119] Among them, Z m Represents image X m The corresponding hidden variables, || means to find the absolute value, det[] means to find the value of the determinant, represents the Jacobian matrix, p(Z m |Y m ) represents the conditional probability of the latent variable, and its calculation formula is:
[0120]
[0121] in, represents the preset mean, Indicates the preset standard deviation.
[0122] S103: Secret information is hidden and sent:
[0123] The sender binarizes the secret information to obtain the binary secret information d, and sets L latent variable matrices according to the actual situation of the reversible conditional flow model type and image size. i=1,2,…,L, thus obtaining the latent variable Embed the binary secret information d into the latent variable In the above example, we generate hidden variables Z={z1,z2,…,z L The conditional variable y is then determined, and the secret latent variable Z and the conditional variable y are fed into the trained reversible conditional flow model. The image generated by the reversible conditional flow model is quantized, converting the pixel values to [0, 255] to obtain the secret image X. This secret image X and the conditional variable y are then sent to the receiver. The quantization operation is performed because the pixel values of the secret image generated by the reversible conditional flow model are floating-point data. However, real electronic devices cannot store floating-point images, so the pixel values must be quantized to the range of regular image pixels.
[0124] In this embodiment, each latent variable matrix is random noise that satisfies Gaussian distribution, Embed the binary secret information d into the hidden variable The specific method can be set according to actual needs. In this embodiment, two-dimensional DCT / IDCT transformation is used to embed binary secret information. The specific method is:
[0125] The latent variable matrix is transformed by discrete cosine transform (DCT) Convert to the frequency domain to obtain its DCT coefficient Then calculate the replacement DCT coefficient Coeff according to the following formula s :
[0126] Coeff s =τ⊙reshape(2d-1)
[0127] Among them, reshape() means according to the latent variable matrix The size of reconstructs the vector into a two-dimensional matrix of corresponding size, ⊙ represents the dot product, and τ is an adjustable parameter.
[0128] As can be seen, the above formula can be used to embed binary secret information into DCT coefficients, and each DCT coefficient can hide one bit of secret information. Depending on the value of the secret information, the corresponding DCT coefficient is modified to +τ or -τ.
[0129] Then replace the DCT coefficient Coeff s Instead of the latent variable matrix DCT coefficients Use Inverse Discrete Cosine Transformation (IDCT) to get the hidden variable z i :
[0130] z i =IDCT(Coeff s )
[0131] Among them, IDCT() is inverse discrete cosine transform.
[0132] Embedding secret information into the frequency domain DCT coefficients of latent variables can reduce the loss of secret information caused by image quantization operations and improve the accuracy of extracting hidden information.
[0133] The conditional variable y can be a multi-class image label represented by one-hot encoding, such as a class in a multi-class image; or it can be a multi-label condition represented by a random binary sequence, such as multiple attributes of an image. It can be determined according to actual needs.
[0134] S104: Secret Information Extraction:
[0135] After receiving the encrypted image X′ and the conditional variable y′, the receiver converts the encrypted image X′ into a floating-point image X′ float , the floating point image X′ floatand conditional variables y′ are input into the trained reversible conditional flow model to obtain the hidden variables Z′={z1′,z′2,…,z′ L}, and then the binary secret information d′ is extracted according to the inverse operation of embedding the sender's binary secret signal into the hidden variable.
[0136] The specific method of the inverse operation of embedding the sender's binary secret signal into the hidden variable adopted by the receiver in this embodiment is as follows:
[0137] Use DCT transform to transform the hidden variables Z′={z1′,z′2,…,z′ L}Convert to the frequency domain to get the DCT coefficient Coeff r , and then extract the secret information according to the following formula:
[0138]
[0139] Among them, reshape′() means restoring the matrix to a vector. Indicates rounding up, and sign() indicates the sign function.
[0140] Figure 5 This is an example diagram of secret information hiding and secret information extraction in the present invention. Figure 5 As shown, the sender's binary secret information d is hidden in the input hidden variable After that, the secret latent variable Z and the conditional variable y are fed into the reversible conditional flow model C-Flow. The output result is quantized to obtain the secret image X. When the receiver extracts the information, the secret image is converted into a floating-point image and fed into the C-Flow model together with the conditional variable y. The secret latent variable Z′ can be recovered and the hidden secret information can be extracted from the secret latent variable Z′ according to the preset rules.
[0141] In order to better illustrate the technical effect of the present invention, a specific example is used to experimentally verify the present invention. In this embodiment, nine indicators are used to evaluate the performance of the model, including the accuracy of secret information extraction (Acc), information hiding capacity (Bpp), classification error rate (R error ), generated image quality (Fid), image quality difference (Fid-diff), visual quality (Lpips), bits per dimension (Bpd), parameter quantity (Para.), and steganalytic security (Pe). This example tests different parameter combinations based on the Fashion-Minist dataset. To achieve excellent anti-steganographic capabilities, in the performance demonstration experiment, the mean σ of the Gaussian noise distribution of the latent variable is set equal to the adjustable parameter τ.
[0142] First, an experiment was conducted on the setting of the conditional variables of the present invention. In this embodiment, two conditional variables were set, the first being a category label representing multiple classifications of an image, and the second being an attribute label representing multiple attributes of an image. Figure 6 This is the encrypted image generated by the present invention when the category label of the Fashion-Mnist dataset is used as the conditional variable in this embodiment. Figure 7 This is the encrypted image generated by the present invention when the attribute labels of the CelebA dataset are used as conditional variables. Figure 6 and Figure 7 It can be seen from FIG that no matter whether the input conditional variable is a category label or an attribute label, the present invention can accurately control the content of the generated image.
[0143] Table 1 is a statistical table of performance indicators of the present invention on four different data sets.
[0144]
[0145] Table 1
[0146] As shown in Table 1, the secret information extraction accuracy Acc of the present invention reaches 100% on CelebA, Cifar10, and Lsun, and is close to 100% on Mnist. This proves that the present invention can effectively overcome the secret information loss caused by the quantization operation when storing images and achieves complete and accurate extraction of secret information from quantized secret images.
[0147] Furthermore, this example uses two well-known steganalysis algorithms, SCRMQ1 and SRMQ1, to test the Pe value of the present invention, demonstrating its steganographic security performance. The results show that the Pe values of the present invention all approach the optimal value of 0.5, indicating that the steganalysis algorithms are unable to distinguish whether the images generated by the present invention contain secret information, thus demonstrating the high steganographic security performance of the present invention.
[0148] Next, we compare our invention with the most advanced generative steganography methods. The GAN-based methods include Liu and Hu. The Glow-based methods include GSF and C-GlowGS. C-GlowGS is an improved generative steganography method based on C-Glow. In this method, secret information is hidden in latent variables using the following method:
[0149]
[0150] In addition, in order to reflect the impact of the DCT / IDCT secret information hiding / extraction method on the performance of the present invention, this embodiment attempts to remove the DCT transform in the information hiding process. The secret information is hidden in the hidden variable by replacing the method shown in the above formula, while the other parts remain unchanged, thus generating a new generative steganography method CGSFnew Table 2 is a performance comparison table of the present invention and various comparative methods in this embodiment.
[0151]
[0152] Table 2
[0153] As shown in Table 2, GAN-based methods generally achieve lower Fid values, indicating better image quality. However, these methods cannot control the content of the secret image, and the steganographic process is irreversible. Furthermore, their information capacity (Bpp) is significantly lower than that of Flow-based methods. The secret information extraction accuracy Acc of the present invention shown in the table is equal to or close to 100%. By incorporating error correction coding, the present invention can overcome information distortion caused by image quantization and achieve reversible information hiding.
[0154] In order to more intuitively demonstrate the effect of conditional control, the present invention compares the images generated by the C-GlowGS method with those of the present invention, wherein the conditional variables use category labels, i.e., category labels of the numbers 0-9. Figure 8 This is a comparison diagram of encrypted images generated by the C-GlowGS method of the present invention under the same condition variables. Figure 8 As shown, the content of the image generated by the C-GlowGS method is inconsistent with the category label, indicating that the C-GlowGS method cannot accurately control the content of the generated encrypted image. However, the content of the encrypted image generated by the present invention is completely consistent with the conditional variable, demonstrating the accuracy of the conditional control of the present invention.
[0155] Although the above describes the illustrative specific embodiments of the present invention to facilitate understanding of the present invention by those skilled in the art, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concepts of the present invention are protected.
Claims
1. A generative steganography method based on a reversible conditional flow model, characterized in that: The following steps are involved: S1: Construct a reversible conditional flow model, including stacked L-1 flow components, a flow model compression module, a flow model flow block, and a priori modules. The value of L is determined as needed, where: L-1 flow components are used to process the floating-point image X to generate latent variables z i′ , i′=1,2,…,L-1; each stream component consists of a stacked stream component compression module, K stream blocks, and a splitting layer. The value of K is determined as needed. Each stream block includes an activation normalization layer, a stream block 1×1 convolution layer, and a conditional attention coupling layer, where: The activation normalization layer is used to perform activation normalization on the input features and send the obtained features to the stream block 1×1 convolution layer; The stream block 1×1 convolution layer is used to perform 1×1 convolution on the input features and send the obtained features to the conditional attention coupling layer; The conditional attention coupling layer is used to receive the features sent by the 1×1 convolutional layer of the stream block, and output them after conditional attention coupling processing according to the conditional variables; the conditional attention coupling layer includes input splitting layer, linear layer, first feature addition layer, first 1×1 convolutional layer, multi-head attention layer, second 1×1 convolutional layer, first 3×3 convolutional layer, second feature addition layer, third 1×1 convolutional layer, third feature addition layer, second 3×3 convolutional layer, weighted layer, splitting layer, sigmoid layer, point product layer, fourth feature addition layer and feature splicing layer, where: The input split layer is used to couple the input feature data of the conditional attention layer in Split into feature in1 and feature in2, send feature in1 to the first feature addition layer, the first 3×3 convolution layer and the feature splicing layer, and send feature in2 to the dot product layer; The linear layer is used to linearly map the conditional variable y to obtain the feature linear(y) and send it to the first feature addition layer and the second feature addition layer; The first feature addition layer is used to add the feature linear(y) as position information to the feature in1, and send the obtained feature to the first 1×1 convolutional layer; The first 1×1 convolution layer is used to perform 1×1 convolution on the received features and send the obtained features to the multi-head attention layer; The multi-head attention layer is used to process the received features using the multi-head attention mechanism and send the obtained features to the second 1×1 convolutional layer; The second 1×1 convolution layer is used to perform 1×1 convolution processing on the received features and send the obtained features to the third feature addition layer; The first 3×3 convolution layer is used to perform 3×3 convolution processing on the feature in1, and the obtained feature Send to the second feature addition layer; The second feature addition layer is used to add the feature linear(y) as position information to the feature In the , the obtained features are sent to the third 1×1 convolutional layer; The third 1×1 convolution layer is used to perform 1×1 convolution processing on the received features and send the obtained features to the third feature addition layer; The third feature addition layer is used to superimpose the two received features and send the obtained features to the second 3×3 convolutional layer; The second 3×3 convolutional layer is used to perform 3×3 convolution processing on the received features and send the obtained features f to the weighted layer; The weighted layer is used to multiply the feature f by the learnable weight parameter p along the channel direction and output the obtained feature to the splitting layer; The splitting layer is used to split the received features into two features a and b of the same size along the channel, sending feature a to the sigmoid layer and feature b to the fourth feature addition layer; The sigmoid layer is used to process feature a using the sigmoid function to obtain feature And send it to the dot product layer; The dot product layer is used to combine feature in2 and feature Perform point multiplication and send the obtained feature c to the fourth feature addition layer; The fourth feature addition layer is used to superimpose feature b and feature c, and send the obtained feature d to the feature splicing layer; The feature concatenation layer is used to concatenate feature in1 and feature d to obtain feature data out And output; The flow model compression module is used to compress the latent variable z L-1 Perform compression processing to obtain compression features The flow block of the flow model adopts the same structure as the flow block in the flow component, which is used to compress features. Processing to obtain the initial latent variables The prior module is used to initialize latent variables Processing is performed to obtain the final latent variable z L The prior module includes a linear layer, a convolutional layer, a feature addition layer, a splitting layer, and an affine transformation layer, where: The linear layer is used to linearly map the conditional variable y to obtain the feature y cond Send to the feature addition layer; The initial value of the convolution layer is 0, which is used to initialize the latent variables. Perform convolution operation and send the obtained feature C to the feature addition layer; The feature addition layer is used to add the feature y cond Superimpose it with feature C and output the obtained feature h to the splitting layer; The splitting layer is used to split the received feature h into two features of the same size along the channel, which are used as the mean γ and the log value of the standard deviation log(δ), and then sent to the affine transformation layer; The affine transformation layer is used to transform the initial latent variables according to the log value of the mean γ and the standard deviation log(δ) Perform affine transformation to obtain the final latent variable z L , the normalization formula is as follows: S2: Obtain a training sample set based on actual needs to train the reversible conditional flow model, and deploy the trained reversible conditional flow model to the sender and receiver; S3: The sender binarizes the secret information to obtain the binary secret information d, and sets L latent variable matrices according to the actual situation of the reversible conditional flow model type and image size Thus, we get the hidden variable Embed the binary secret information d into the latent variable In the above example, we generate hidden variables Z={z1,z2,…,z L Then determine the conditional variable y, input the secret latent variable Z and the conditional variable y into the trained reversible conditional flow model, perform a quantization operation on the image generated by the reversible conditional flow model, convert the pixel values to [0, 255], and thus obtain the secret image X, which is sent together with the conditional variable y to the receiver; S4: After receiving the encrypted image X′ and the conditional variable y′, the receiver converts the encrypted image X′ into a floating-point image X′ float , the floating point image X′ float and conditional variables y′ are input into the trained reversible conditional flow model to obtain the hidden variables Z′={z1′,z′2,…,z′ L }, and then the binary secret information d′ is extracted according to the inverse operation of embedding the sender's binary secret signal into the hidden variable.
2. The generative steganography method according to claim 1, characterized in that: The conditional variables are multi-class image labels represented by one-hot encoding or multi-label conditions represented by random binary sequences.
3. The generative steganography method according to claim 1, characterized in that: The specific method for obtaining the training sample set in step S2 is: Randomly obtain several images and normalize them to the input image size of the reversible conditional flow model, and then perform a dequantization operation on each image. The specific formula for the dequantization operation is: Among them, X0 represents the original image, X represents the image after dequantization operation, Indicates rounding down, α indicates the scale factor, β indicates the dequantization level, and u is the noise that obeys the uniform distribution. A randomly sampled noise image is generated for each dequantized image to form a training sample, thereby obtaining a training sample set.
4. The generative steganography method according to claim 1, characterized in that: The loss function used in the reversible conditional flow model training in step S2 is as follows: Among them, M represents the number of samples in the training sample set, X m 、Y m Represent the image and noise image in the mth training sample, H×W represents the height and width of the image, logp(X m |Y m ) represents the logarithmic conditional probability density of the reversible conditional flow model for the mth training sample.
5. The generative steganography method according to claim 4, characterized in that: The logarithmic conditional probability density logp(X m |Y m ) is calculated as: Among them, Z m Represents image X m The corresponding hidden variables, || means to find the absolute value, det[] means to find the value of the determinant, represents the Jacobian matrix, p(Z m |Y m ) represents the conditional probability of the latent variable, and its calculation formula is: in, represents the preset mean, Indicates the preset standard deviation.
6. The generative steganography method according to claim 1, characterized in that Each latent variable matrix in step S3 is random noise that satisfies Gaussian distribution, 7. The generative steganography method according to claim 1, characterized in that: The specific method for the sender to embed the binary secret information d into the hidden variable Z in step S3 is as follows: The latent variable matrix is transformed into Convert to the frequency domain to obtain its DCT coefficient Then calculate the replacement DCT coefficient Coeff according to the following formula s : Coeff s =τ⊙reshape(2d-1) Among them, reshape() means according to the latent variable matrix The size of the vector is reconstructed into a two-dimensional matrix of the corresponding size, ⊙ represents the dot product, and τ is an adjustable parameter; Then replace the DCT coefficient Coeff s Instead of the latent variable matrix DCT coefficients Use the inverse discrete cosine transform to get the secret latent variable z i : from i =IDCT(Coeff s ) Among them, IDCT() is inverse discrete cosine transform; The inverse operation method used by the receiver is: Use DCT transform to transform the hidden variables Z′={z1′,z′2,…,z′ L }Convert to the frequency domain to get the DCT coefficient Coeff r , and then extract the secret information according to the following formula: Among them, reshape′() means restoring the matrix to a vector. Indicates rounding up, and sign() indicates the sign function.