Text steganography method for digital media protection based on variational autoencoder

Through the variational automatic encoder and neural network model, combined with the bidirectional gating recurrent unit and attention mechanism, the problem of insufficient generation and diversity of generated and growing steganographic texts and achieving natural and safe texts Stereographing improves the concealment and security of stereographed text.

CN113987129BActive Publication Date: 2024-12-06JIANGXI JIE XUN ENTERPRISE MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111311802.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-08
Publication Date
2024-12-06
Estimated Expiration
2041-11-08

AI Technical Summary

Technical Problem

The existing text steganography technology is difficult to generate growing and diverse steganography text, and the generated text content is uncontrollable, resulting in limited use scenarios and the word vector model cannot effectively represent the text context features, affecting the concealment and security of steganography.

Method used

Using digital media-protected text steganography method based on variational automatic encoder, extract global keywords and group keywords through preprocessing, embed secret information into the carrier text generated by neural network model, and use encoding networks, Gaussian sampling and decoding networks. The conditional probability distribution of the text is obtained, combined with the bidirectional gating recurrent unit and the attention mechanism to extract the context characteristics between the word-word and short sentence-sentence, and used Huffman encoding to select words for steganography.

Benefits of technology

It realizes the generation and diverse steganographic text, improves the concealment and security of steganographic text, makes the visual indistinguishable, statistical indistinguishable and semantic indistinguishable, and can better carry secret information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113987129B_ABST
    Figure CN113987129B_ABST
Patent Text Reader

Abstract

The invention belongs to the field of information security, and particularly relates to a digital media protection text steganography method based on a variational autoencoder, comprising constructing a neural network model composed of an encoding network, Gaussian sampling and a decoding network to vectorize text; using the encoding network to respectively obtain features of global keywords and long sequences, and fusing the features of the global keywords and the long sequences to obtain global feature representation; using Gaussian sampling to perform Gaussian sampling on the global feature representation in the encoding network; using a decoding network to decode the sampling result of the Gaussian sampling to obtain the conditional probability distribution of the text; selecting K words with the largest conditional probabilities, and using Huffman coding to select a word corresponding to a secret bit stream to complete the steganography of a file; the invention can not only generate long and diverse steganographic texts, so that the steganographic texts can carry more secret information, but also realize visual indistinguishability, statistical indistinguishability and semantic indistinguishability between natural language and steganographic text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of information security, and in particular relates to a digital media protection text steganography method based on variational autoencoder. Background Art

[0002] The research on information hiding technology originated from abroad at first. After the successful convening of the National Information Hiding and Multimedia Information Security Academic Conference in 1999, it gradually flowed into China and became an emerging research field. In information hiding technology, steganography and digital watermarking are used to solve security problems such as covert communication, digital forensics and copyright protection. As one of the key technologies in information hiding, steganography is actually to embed secret information into the carrier data to hide the existence of communication, so that attackers cannot know whether the information contains secret information from the appearance. Digital watermarking refers to embedding specific digital information (such as identity information, serial number, text, etc.) into digital products such as images, audio or video, and is mostly used for copyright protection. Compared with digital watermarking technology, steganography can embed more secret information, and there is no regularity in the method of hiding information, which increases the difficulty of attack.

[0003] Steganography uses various multimedia information carriers to hide secret information, including public carriers such as text, images, videos and audio. As the most widely used information carrier for daily communication and expression of opinions, text processing has great research value and practical significance. Text steganography refers to hiding secret information in publicly transmitted files or documents to achieve covert transmission of secret information. Compared with information hiding technologies based on images, audio and video, text has higher coding efficiency and less modification redundancy, and any change in a bit may cause perceptible changes in the text. How to cleverly use text to carry secret information for secret information communication has been one of the hot issues in the field of information hiding in recent years.

[0004] Text is an important carrier of information exchange and information transmission, and is widely used in people's daily life and production, which has laid a good foundation for the development of text steganography. Traditional text steganography is mostly based on carrier methods, which mainly embeds secret information by modifying the text encoding method, arrangement format, font size and position, etc., to achieve text steganography. Although these traditional text steganography techniques can indeed solve the problem of transmitting secret information for us, for these traditional steganography techniques, no matter how to improve their hiding capacity and improve hiding and extraction algorithms, they ultimately need to modify the carrier, and inevitably leave traces of modification on the carrier, making it difficult for the text carrier to resist detection by various steganalysis tools, providing opportunities for attackers.

[0005] In view of the shortcomings of traditional text information hiding that is easily detected by steganalysis tools, researchers have proposed a new carrier-free information hiding scheme to improve the anti-detection ability of information hiding. The carrier-free text steganography method aims to find a public secret carrier to transmit secret information, establish a mapping relationship between carrier information and secret information according to the characteristics of the carrier (not without the need for a carrier), so as to solve the problem that traditional information hiding technology is easily attacked by third parties due to the traces of carrier modification. With the development of natural language processing technology, researchers have combined the text automatic generation technology based on deep learning with information hiding, proposed an information hiding method for automatic generation of text steganography, and realized carrier-free text steganography technology. The text steganography method based on deep learning usually uses a large corpus to train the text relationship model. The sender of the secret information converts the secret information into a secret bit stream, and uses the secret bit stream to automatically select the text to be generated according to a coding rule to complete data hiding and realize data steganography. The receiver of the secret information uses the same language model or data set as the sender to extract the embedded secret information from the stegotext.

[0006] Although many scholars have conducted extensive research on steganographic text generation models and achieved quite good results, there are still some challenges:

[0007] 1. The difficulty of generating long stegotext. To generate long stegotext, we need to consider the contextual relevance of short sentences at the same time. By combining short sentences to construct the generation of long text, we need to consider not only the textual relevance between words, but also the contextual relevance between sentences.

[0008] 2. Diversity of steganographic text. Most text steganographic models are trained based on a corpus of a single attribute. It is an unsupervised steganographic text generation model, which makes the generated text content uncontrollable and the generated text has limited usage scenarios. Therefore, how to enrich the usage scenarios of steganographic text becomes a difficult problem.

[0009] 3. Text steganography word vector model. A good word vector model training method helps to generate more realistic and natural steganographic text, thereby achieving the concealment and security of text steganography. How to obtain a word vector model that can better represent the contextual features of the text becomes a challenge. Summary of the invention

[0010] In view of the above challenges, with the goal of increasing the length of the steganographic text and generating diverse steganographic text, the present invention proposes a digital media protection text steganography method based on variational autoencoder, which converts secret information into a secret bit stream and embeds the secret bit stream into the carrier text generated by the network model. Specifically, the method includes the following steps:

[0011] Preprocess the text, including extracting global keywords and group keywords of the training text, dividing the long text into multiple short sequences, each short sequence corresponds to a group of group keywords, and the global keyword is the union of all group keywords;

[0012] Build a neural network model consisting of an encoding network, Gaussian sampling, and a decoding network to vectorize the text;

[0013] The encoding network is used to obtain the features of global keywords and long sequences respectively, and the features of global keywords and long sequences are fused to obtain the global feature representation for fusion;

[0014] Gaussian sampling is used to perform Gaussian sampling on the global feature representation in the encoding network;

[0015] Use the decoding network to decode the sampling results of Gaussian sampling to obtain the conditional probability distribution of the text;

[0016] Select K words with the largest conditional probability, encode these K words using Huffman coding, and select a word corresponding to the Huffman coding according to the secret bit stream to be embedded to complete the steganography of the file.

[0017] Furthermore, the annoying features of global keywords are obtained, that is, the context features between words in the text are extracted. The context features between words in the text are extracted by combining a bidirectional gated recurrent unit and an attention mechanism, including the following steps:

[0018] Use the forward gated recurrent unit and the backward gated recurrent unit in the bidirectional gated recurrent unit to obtain the forward hidden state and the backward hidden state of the text;

[0019] Merge the states obtained by the current forward gated recurrent unit and the backward gated recurrent unit, and input the merged state into the attention layer;

[0020] In the attention layer, the proportion of the matching score between the hidden layer output of each bidirectional gated recurrent unit and the entire text representation vector in the overall score is calculated, and the output of the attention layer is obtained through linear transformation.

[0021] Furthermore, the input vector is processed using a bidirectional gated recurrent unit including:

[0022] z′ t =σ(W z' ·[h t-1 ,x t ]+b z' )

[0023] r t =σ(W r ·[h t-1 ,xt ]+b r )

[0024] n t =tanh(W n ·[r t *h t-1 ,x t ])

[0025] h t =(1-z′ t )*h t-1 +z′ t *n t

[0026]

[0027]

[0028] Among them, z′ t is the update gate; W z' is the training weight of the update gate; h t-1 is the hidden state of the previous layer; x t is the vector of the bidirectional gated recurrent unit input at time t; b z' is the bias value of the update gate; r t is the reset gate; W r is the training weight of the reset gate; b r is the bias value of the reset gate; n t is a candidate activation function; W n is the weight of the candidate activation function; h t is the hidden layer output result at time t; σ(x) is the Sigmoid activation function; h t 'Output state of the hidden layer; is the forward hidden state; is the backward hidden state; Indicates h t The forward hidden layer result is: Indicates h t The backward hidden layer result of .

[0029] Furthermore, the attention layer processes the output state of the hidden layer by:

[0030] u t =tanh(W attn h′ t +b attn )

[0031]

[0032] s t =∑t a t h t

[0033] output t =W o s t +b o

[0034] Among them, W attn 、b attn are the weight and bias value of the attention layer respectively; u attn represents the randomly initialized attention matrix; W o 、b o are the weight coefficient and bias value of the output layer respectively.

[0035] Furthermore, when extracting the features of long sequences, we obtain the vector representation of each short sentence, and then use the bidirectional GRU to obtain the correlation features between short sentences. Represents the tth short sentence s t The hidden layer features.

[0036] Furthermore, Gaussian sampling of global features in the encoding network includes a model training phase and a generation phase for operating on real-time data. In the training phase, the approximate posterior distribution of global keyword vectors and global keyword latent variables is obtained by sampling them, and when processing real-time data, the approximate prior distribution of global keyword vectors is obtained by sampling them.

[0037] Furthermore, the decoding network decodes the sampling result including:

[0038] Group keyword latent variable decoding, that is, by sampling the global latent variable z, the group keyword latent variable generated by each clause is obtained;

[0039] The decoded group keyword latent variables are subjected to feature fusion with the global latent variables to obtain the local latent variables that guide the generation of the current group clause;

[0040] By decoding the features of the local latent variables of each group, the conditional probability prediction of the words in each group clause is completed.

[0041] Furthermore, the group keyword latent variable decoding process includes:

[0042] In each layer of the neural network model, there is a set of keywords and a set of clauses constrained by the set of keywords. Each set of keywords is a subset of the text vector input into the neural network.

[0043] By sampling the text vector of the input neural network, a global keyword latent variable z is obtained; each group of keywords is obtained by sampling the text vector of the neural network and z;

[0044] Obtain the prior distribution or posterior distribution through Gaussian sampling, and select the group keywords corresponding to each layer;

[0045] At each time step t, the keyword decoder takes the text vector of the neural network, the global keyword latent variable z and the group before time t as input, calculates the probability of each input item at time t, and takes the group keyword latent variable of the group at time t whose probability value exceeds the threshold.

[0046] Furthermore, feature decoding is performed on the local latent variables of each group. The purpose of decoding is to map the sampled feature codes into the conditional probabilities corresponding to the words, including:

[0047]

[0048]

[0049] Among them, GRU s GRU unit representing the sentence decoder; It is GRU g The last hidden state encoding the keyword result g; is the local latent variable of each short sentence; W s is the weight of the initial hidden layer vector, b s is the bias value of the initial hidden layer vector; and The forward and backward feature vectors representing the word-word contextual relationship.

[0050] Furthermore, the process of feature embedding includes:

[0051] Each time step generates a word, and the tth w time step to generate the tth w words;

[0052] Before use w -1 conditional probability of generating words, based on the calculation of prior probability or posterior probability of each word in the tth w The probability of a time step being selected and sorted in descending order;

[0053] Select the top 2 n words, use Huffman coding for the first 2 n The conditional probability of each word is encoded;

[0054] According to the secret information bit stream to be embedded B = {b1, b2, ..., b o}Select the corresponding word as the carrier word of the secret information to complete the steganography of the text;

[0055] Among them, b o It represents the oth bit in the secret information bit stream, where o is the length of the bit stream; n is the width of the embedded secret information.

[0056] The present invention can not only generate long and diverse stegotexts so that the stegotexts can carry more secret information, but also achieve visual indistinguishability, statistical indistinguishability and semantic indistinguishability between natural language and stegotext. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A model structure of a digital media protection text steganography method based on a variational autoencoder of the present invention;

[0058] Figure 2 Schematic diagram of bidirectional GRU and attention mechanism feature extraction used in the present invention;

[0059] Figure 3 Schematic diagram of the secret embedding process in the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] The present invention proposes a digital media protection text steganography method based on variational autoencoder, comprising:

[0062] Preprocess the text, including extracting global keywords and group keywords of the training text, dividing the long text into multiple short sequences, each short sequence corresponds to a group of group keywords, and the global keyword is the union of all group keywords;

[0063] Build a neural network model consisting of an encoding network, Gaussian sampling, and a decoding network to vectorize the text;

[0064] The encoding network is used to obtain the features of global keywords and long sequences respectively, and the features of global keywords and long sequences are fused to obtain the global feature representation;

[0065] Gaussian sampling is used to perform Gaussian sampling on the global feature representation in the encoding network;

[0066] Use the decoding network to decode the sampling results of Gaussian sampling to obtain the conditional probability distribution of the text;

[0067] Select the K words with the largest conditional probability, use Huffman coding to select a word corresponding to the secret bit stream, and complete the steganography of the file.

[0068] Example 1

[0069] In this embodiment, the digital media protection text steganography method based on variational autoencoder is as follows: Figure 1 , taking global keywords, long sequences and secret information to be hidden as input data packets, the output after the steganalysis text generation model is the steganalysis text embedded with secret information. It includes the following four steps:

[0070] S1: Data preprocessing. In the data preprocessing part, the global keywords and group keywords of the training text need to be extracted, and a long sequence needs to be divided into multiple short sequences, and each short sequence corresponds to a group of group keywords. The global keyword is the union of all group keywords. If you want to embed secret information in ordinary text, you also need to encode the secret information into a bit stream.

[0071] S2: Extracting the relevance of text context. First, the text needs to be processed into a feature representation that can be identified by the computer, and then the text needs to be vectorized using a vectorization tool; secondly, it is necessary to obtain not only the context features between words in the text, but also the context features between each short sentence; finally, the obtained features are encoded using a model.

[0072] S3: Build the model. The model building is mainly divided into three parts: encoding network, Gaussian sampling, and decoding network. The encoding network is mainly used to fuse global keywords and long sequences to obtain their global feature representation; Gaussian sampling is mainly used to perform Gaussian sampling on the global features in the encoding network, and the sampling results obey the isotropic Gaussian distribution; the decoding network is mainly used to decode the sampling results, and then complete the generation of text according to the conditional probability distribution of the text.

[0073] S4: Embedding and extraction of secret information: Embedding mainly involves converting the bit stream of secret information into a word conditional probability calculated by the model, and selecting the largest few conditional probabilities using Huffman coding to select a word corresponding to the secret bit stream, so as to embed the secret information; the extraction process uses the same model as the embedding, and uses Huffman coding according to the predicted conditional probability to reversely obtain the text bit stream.

[0074] Example 2

[0075] This embodiment further explains the data preprocessing in step S1 of embodiment 1, which is mainly divided into the following four steps:

[0076] S11: Sequence segmentation. Usually, keywords cannot be directly obtained from the original sequence. Words irrelevant to the part of speech usually affect the accuracy of keywords. Stop words are removed from the segmentation results.

[0077] S12: Acquisition of global keywords and group keywords. Group keywords are mainly used for local control of text generation content, and usually mature keyword extraction tools are used to obtain keywords of the text; global keywords are the union of group keywords.

[0078] S13: Long sequence division. When using long sequences to generate text, relevant context features are usually lost in the second half of the text, and the generated text content may be uncontrollable. Therefore, it is necessary to divide the long text into multiple short sequences, and then globally and locally control the short sequences to ensure that the context features of the text are not lost and the text content is controllable.

[0079] S14: Convert secret information into bit stream. Usually, due to the redundancy of text, secret information cannot be directly carried, and mature cryptographic tools or binary conversion tools are needed to convert secret information into binary bit stream.

[0080] In the process of natural language processing - text generation, the quality of the text generation model is usually affected by many factors, especially the generation of long texts, such as: word vector model, word-to-word correlation, sentence-to-sentence correlation, etc. Based on this, this paper starts from the word vector model, word-to-word and sentence-to-sentence correlation to obtain text features of different dimensions. This embodiment further explains the extraction of text context correlation features in step S2 of embodiment 1, which is mainly divided into the following three steps:

[0081] S21: Text vectorization.

[0082] Input x={x1,x2,...,x M} is the keyword or topic that guides the generation of stegotext. We use the mature vectorization algorithm Word2Vec to vectorize the input x into k={k1,k2,...,k M}.

[0083] S22: word-to-word correlation features

[0084] In order to better capture the relational representation of text in the semantic space, we combine the bidirectional gated recurrent unit (BiGRU) and the attention mechanism to extract text semantic features. For input x, we use a bidirectional GRU to encode it, and x can be represented by the concatenation of the last hidden layer state of the forward GRU and the backward GRU, that is, It is k iAs for the encoding process of group clauses, in order to better extract the representation of text in the semantic space, BiGRU and attention mechanism are used to encode between clauses and words, such as Figure 2 As shown. The gated recurrent unit (GRU) can be expressed by the following formula:

[0085] z′ t =σ(W z' ·[h t-1 ,x t ]+b z' ) (1)

[0086] r t =σ(W r ·[h t-1 ,x t ]+b r ) (2)

[0087] n t =tanh(W n ·[r t *h t-1 ,x t ]) (3)

[0088] h t =(1-z′ t )*h t-1 +z′ t *n t (4)

[0089] where x t is the input vector at time t, h t is the output result of time step t, [h t-1 ,x t ] indicates matrix connection, * indicates the multiplication of corresponding elements between vectors, and σ indicates the sigmoid function:

[0090]

[0091] For the BiGRU at time t, the hidden layer output state h t 'Divided into forward hidden state and the backward hidden state Right now:

[0092]

[0093] The output of the BiGRU layer h'={h'1,h'2,...,h' r} is sent to the attention layer, where r represents the length of the input sequence. In the attention layer, the attention mechanism is mainly used to enhance the semantic vector representation of the target word in the context, which allows our model to focus on more critical parts and ignore irrelevant parts. The input of the attention layer is the output vector h' processed by BiGRU calculation in the previous layer. The idea is to calculate the proportion of the matching score between the hidden layer output of each BiGRU time step and the entire text representation vector in the overall score. The weight coefficient of the attention layer is calculated specifically by the following formulas:

[0094] u t =tanh(W attn h′ t +b attn ) (7)

[0095]

[0096] s t =∑ t a t h t (9)

[0097] Among them, W attn and b attn is the weight and bias value of Attention; u attn represents the randomly initialized attention matrix, a t Similar to the softmax function, it mainly calculates all After obtaining the attention probability distribution value at each moment, calculate the feature vector s containing text information. The output vector obtained by the Attention layer can be further obtained through linear transformation:

[0098] output t =W o s t +b o (10)

[0099] Where W o and b o As the weight coefficient and bias value of the output layer. Finally, the encoding vector output at each moment is obtained attn ={output1,output2,...,output r}.

[0100] S23: Correlation characteristics between short sentences

[0101] For sentence-level generation tasks, we need to consider not only group keywords at layer t At the same time, it is also necessary to combine the state s of the upper sentence t'<t , that is, its generation can be expressed by the following formula:

[0102]

[0103] Here we also need to combine the control of global hidden variables, through the global variable z and the local variable Let’s guide the generation of hierarchical sentences. For each layer of sentence s t The generation of will get its sentence representation Example 3

[0104] This embodiment further illustrates the neural network model constructed by the present invention. The model is mainly divided into three stages: encoding network, Gaussian sampling, and decoding network. The first stage encoding network mainly fuses global keywords and long sequences to obtain their global feature representation; the second stage Gaussian sampling is mainly used to perform Gaussian sampling on the global features in the encoding network, and the sampling results obey the isotropic Gaussian distribution; the third stage decoding network mainly decodes the sampling results, and then realizes the steganography of the text according to the conditional probability distribution of the text and combined with the corresponding encoding algorithm. The encoding network, Gaussian sampling, and decoding network specifically include the following steps:

[0105] S31: Encoding Network

[0106] The encoding network is divided into three steps: the first step is to pass the vectorized global keyword representation through the neural network to obtain its corresponding feature representation; the second step is to pass the vectorized long sequence representation through the neural network to obtain its corresponding feature representation; the third step is to fuse the keyword features and the long sequence features.

[0107] S311: Global keyword features

[0108] By encoding the vector representation k of the input x using a bidirectional GRU, x can be represented by concatenating the last hidden layer state of the forward GRU and the backward GRU, that is, It is k i The context-aware representation of GRU is shown in (1)(2)(3)(4) of S22 above.

[0109] S312: Long sentence context features

[0110] For the encoding process of long texts, in order to better extract the representation of text in semantic space, we use BiGRU and attention mechanism to encode between clauses and words, such as Figure 2The expression of GRU is shown in (1)(2)(3)(4) of S22 above. Then the output result of BiGRU layer h'={h'1,h'2,...,h' r} is sent to the attention mechanism layer, where r represents the length of the input sequence. In the attention layer, we mainly use the attention mechanism to enhance the semantic vector representation of the target word in the context. The input of the attention layer is the output vector h' processed by BiGRU calculation in the previous layer. The idea is to calculate the proportion of the matching score between the hidden layer output of each BiGRU time step and the entire text representation vector in the overall score. The weight coefficient of the attention layer can be referred to as shown in equations (7), (8), and (9) of S22. Finally, we use linear transformation to obtain the result of equation (10) of S22 for the output vector s obtained by the attention layer.

[0111] S313: Feature Fusion

[0112] The feature fusion in the training phase mainly combines keyword features and long sequence features. Its main purpose is to obtain global latent variables and local latent variables that control the overall generated content of the text. The fusion process mainly combines the results calculated by S311 and S312. As shown in the following formula:

[0113] h k =[enc(x),output attn ] (12)

[0114] where h k represents the global feature representation, enc(x) represents the keyword feature, and output attn Represents the long text features through the attention layer, where h k From enc(x) and output attn Stitched together.

[0115] In the text test generation stage, we only need to input the keyword group x of the text to get its corresponding enc(x), and at this time h k =enc(x).

[0116] S32: Gaussian sampling

[0117] In the model, h calculated by S313 k Sampling is performed to obtain a global keyword latent variable z, and the diversity of reasonable planning can be simulated through the global keyword latent variable z. Here, sampling mainly includes two stages, namely the training stage and the test generation stage.

[0118] S321: Training phase

[0119] By sampling x and z to obtain their approximate posterior distribution, this process can be expressed by the following formula:

[0120]

[0121] where q θ' represents the posterior distribution of the sampling, q θ' Obey isotropic Gaussian distribution μ z' and Gaussian distribution , x and y represent the input global keywords and long sequence text respectively, and (x, y) is the h in the training phase mentioned in S313. k , z is the global keyword latent variable obtained by sampling.

[0122] S322: Test generation phase

[0123] By sampling x to obtain its approximate prior distribution, this process can be expressed by the following formula:

[0124]

[0125] where p θ Represents the prior distribution of sampling, same as above, p θ Also obeys isotropic Gaussian distribution μ z and Gaussian distribution Parameters, x represents the global keyword input in the test generation phase, and x is the h in the test generation phase mentioned in S313 k , z is the global keyword latent variable sampled from this process.

[0126] During the training process, sentences and labels are added to ensure that the labels and sentences are relevant; during testing (real-time data processing), only labels are needed, that is, sentences are generated based on the labels and secret information.

[0127] S33: Decoding Network

[0128] The decoding network part mainly includes three stages: the first stage is the decoding of the group keyword latent variable, by sampling the global latent variable z, the group latent variable generated by each clause, that is, the group keyword latent variable; the second stage is to fuse the decoded group keyword latent variable with the global latent variable to obtain the local latent variable that guides the generation of the current group clause; the third stage is the local latent variable feature decoding, by decoding the local latent variables of each group, the conditional probability prediction of the words in each group clause is completed.

[0129] S331: Group keyword latent variable decoding

[0130] In the present invention, the generation diversity of text is mainly controlled in a fine-grained manner through hierarchical keywords. Each layer has a set of keywords and group clauses constrained by the set of keywords. Each group of keywords is a subset of the input x, so that the generation of long text can be decomposed into hierarchical group clause generation subtasks. In the model, a global keyword latent variable z is obtained by sampling the input x, and the diversity of reasonable planning is simulated by the global keyword latent variable z. Each group of keywords is obtained by sampling x and z. These processes can be expressed by the following formula:

[0131]

[0132] in is the sequence of all groups, each is a subset of the input x. N represents the length of the group sequence, and can also represent the number of group clauses or the number of levels. The group clause s used to constrain each time step t t To generate, we use a group keyword decoder (a GRU) to calculate

[0133] In the present invention, the group keyword corresponding to each layer needs to be selected by probability value. At each time step t, the keyword decoder uses the input item x, the global latent variable z and the group before time t as input to calculate the probability of each input item at time t, and takes the group keyword latent variable of the group at time t whose probability value exceeds the threshold, that is,

[0134]

[0135] in is the input item k i The vector representation of is the vector encoded by BiGRU and attention mechanism. is the hidden state of the keyword decoder, W p and b p are the weights and bias values ​​of the keyword decoder.

[0136] In order to make Conscious judgment input item k i Has it been selected? At time t, Sent to the keyword encoder. The group keyword level constraint process ends until the end probability at the next moment exceeds the threshold:

[0137]

[0138] S332: Latent variable feature fusion

[0139] After calculating the group latent variable, it needs to be fused with the global latent variable so that the steganographic text related to the global keyword and the group keyword can be generated. The fused local latent variables can be used to calculate the contextual relationship representation between the short sentences in the group clause, which can be shown by the following formula:

[0140]

[0141] where s t'<t Indicates the current sentence s t The relation representation of the first t-1 short sentences.

[0142] S333: Local latent variable feature decoding

[0143] Local latent variable feature decoding is mainly used to generate each group clause, which mainly corresponds to sentence decoding. t The generation of And local variables Assume it follows an isotropic Gaussian distribution. At time step t, during inference, the sentence decoder will extract the sentence from the prior distribution Medium Sampling During training, the approximate posterior distribution Medium Sampling Sentence Representation and The distribution of can be expressed by the following formula:

[0144]

[0145]

[0146]

[0147] in is the word decoder for the upper sentence s t-1 The last hidden state of the GRU when decoding the word s Represents the GRU unit of the sentence decoder. We encode the input x, the global keyword latent variable z and the group keyword g z To initialize the hidden state

[0148]

[0149]

[0150] in, It is GRU gThe last hidden state of the encoding keyword result g. For word-level generation, a GRU is still used as a word decoder.

[0151] Example 4

[0152] This embodiment completes the steganography of the file according to the output of the neural network model, including the following steps:

[0153] S41: Embedding of Secret Information

[0154] Statistical text features usually obey conditional probability distribution, where each word in a sentence has a certain contextual relevance to other words in the context, i.e. We denote the time step t w -1 conditional probability of the next word Sort in reverse order, and then select the first 2 according to the number of bits n to be embedded in the secret information. n words, and then use Huffman coding to encode the first 2 n The conditional probability of the words is encoded, and finally the secret information bit stream B = {b1, b2, ..., b o}Select the corresponding words as the carrier words of the secret information to complete the information hiding, and finally realize the text steganography technology based on variational autoencoder. Figure 3 The selection process of a word in a certain layer is shown. For the first word of each layer of the hierarchical word decoding structure, it is selected based on the context relevance of the hierarchical sentence decoding and the group keywords. The embedding process can be expressed as follows:

[0155]

[0156] in Indicates the currently selected word, fun B It is a secret information embedding function (Huffman coding), which automatically selects the words to be generated through the secret information.

[0157] exist Figure 3 In the example, after the first word "I" is selected, the GRU unit is used to select the 2 with the largest conditional probability. n words, and Huffman encoding from 2 n A word is selected from the words as the next word, where n is the breadth of embedded secret information, which indicates how much secret information is embedded in a word, and is set by those skilled in the art based on experience.

[0158] S42: Extraction of secret information

[0159] When obtaining a steganographic text with secret information, the same steganographic model as the embedded one can be used to extract the secret information. The global keywords and group keywords input remain unchanged. The same method is used to sort the words to be generated in reverse order according to the conditional probability, and the embedded secret bit streams are obtained one by one according to the word order of the steganographic text until the text generation process is completed. At this point, all the embedded secret information can be completely obtained.

[0160] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A digital media protection text steganography method based on variational autoencoder, characterized in that: The secret information is converted into a secret bit stream, and the secret bit stream is embedded into the carrier text generated by the network model, which specifically includes the following steps: Preprocess the text, including extracting global keywords and group keywords of the training text, dividing the long text into multiple short sequences, each short sequence corresponds to a group of group keywords, and the global keyword is the union of all group keywords; Obtaining global keyword features, that is, extracting context features between words in the text, uses a combination of bidirectional gated recurrent units and an attention mechanism to extract context features between words in the text, including the following steps: The forward gated recurrent unit and the backward gated recurrent unit in the bidirectional gated recurrent unit are used to obtain the forward hidden state and the backward hidden state of the text; the input vector is processed using the bidirectional gated recurrent unit including: z' t =σ(W z' ·[h t-1 ,x t ]+b z' ) r t =σ(W r ·[h t-1 ,x t ]+b r ) n t =tanh(W n ·[r t *h t-1 ,x t ]) h t =(1-z' t )*h t-1 +z' t *n t Among them, z t ' is the update gate; W z' is the training weight of the update gate; h t-1 is the hidden state of the previous layer; x t is the vector of the bidirectional gated recurrent unit input at time t; b z' is the bias value of the update gate; r t is the reset gate; W r is the training weight of the reset gate; b r is the bias value of the reset gate; n t is a candidate activation function; W n is the weight of the candidate activation function; h t is the hidden layer output result at time t; σ(x) is the Sigmoid activation function; h' t Output state for the hidden layer; is the forward hidden state; is the backward hidden state; Indicates h t The forward hidden layer result is: Indicates h t The backward hidden layer result of ; Merge the states obtained by the current forward gated recurrent unit and the backward gated recurrent unit, and input the merged state into the attention layer; In the attention layer, the proportion of the matching score between the hidden layer output of each bidirectional gated recurrent unit and the entire text representation vector in the total score is calculated, and the output of the attention layer is obtained through linear transformation; the processing of the hidden layer output state by the attention layer includes: u t =tanh(W attn h t '+b attn ) s t =∑ t a t h t output t =W o s t +b o Among them, W attn , b attn are the weight and bias value of the attention layer respectively; u attn represents the randomly initialized attention matrix; W o , b o are the weight coefficient and bias value of the output layer respectively; When extracting features from long sequences, we obtain the vector representation of each short sentence, and then use the bidirectional GRU to obtain the correlation features between short sentences. Represents the tth short sentence s t The hidden layer features of Build a neural network model consisting of an encoding network, Gaussian sampling, and a decoding network to vectorize the text; The encoding network is used to obtain the features of global keywords and long sequences respectively, and the features of global keywords and long sequences are fused to obtain the global feature representation for fusion; Gaussian sampling is used to perform Gaussian sampling on the global feature representation in the encoding network, including the model training stage and the generation stage of operating on real-time data. In the training stage, the global keyword vector and the global keyword latent variable are sampled to obtain their approximate posterior distribution. When processing real-time data, the global keyword vector is sampled to obtain its approximate prior distribution. The decoding network is used to decode the sampling results of Gaussian sampling to obtain the conditional probability distribution of the text; the decoding network decodes the sampling results including: The group keyword latent variable decoding is to obtain the group keyword latent variable generated by each clause by sampling the global latent variable z, including: In each layer of the neural network model, there is a set of keywords and a set of clauses constrained by the set of keywords. Each set of keywords is a subset of the text vector input into the neural network. By sampling the text vector of the input neural network, a global keyword latent variable z is obtained; each group of keywords is obtained by sampling the text vector of the neural network and z; Obtain the prior distribution or posterior distribution through Gaussian sampling, and select the group keywords corresponding to each layer; At each time step t, the keyword decoder takes the text vector of the neural network, the global keyword latent variable z and the group before time t as input, calculates the probability of each input item at time t, and takes the group keyword latent variable of the group at time t whose probability value exceeds the threshold; The decoded group keyword latent variables are subjected to feature fusion with the global latent variables to obtain the local latent variables that guide the generation of the current group clause; By decoding the features of the local latent variables of each group, the conditional probability prediction of the words in each group clause is completed, including: Among them, GRU s GRU unit representing the sentence decoder; It is GRU g The last hidden state encoding the keyword result g; is the local latent variable of each short sentence; W s is the weight of the initial hidden layer vector, b s is the bias value of the initial hidden layer vector; and Forward and backward feature vectors representing word-word contextual relationships; Represents the initial hidden state; Select K words with the largest conditional probability, encode these K words using Huffman coding, and select a word corresponding to the Huffman coding according to the secret bit stream to be embedded to complete the steganography of the file.

2. According to claim 1, the digital media protection text steganography method based on variational autoencoder is characterized in that: The process of feature embedding includes: Each time step generates a word, and the tth w time step to generate the tth w words; Before use w -1 conditional probability of generating words, based on the calculation of prior probability or posterior probability of each word in the tth w The probability of a time step being selected and sorted in descending order; Select the top 2 n words, use Huffman coding for the first 2 n The conditional probability of each word is encoded; According to the secret information bit stream to be embedded B = {b1, b2, ..., b o }Select the corresponding word as the carrier word of the secret information to complete the steganography of the text; Among them, b o It represents the oth bit in the secret information bit stream, where o is the length of the bit stream; n is the width of the embedded secret information.