Text robust steganography method based on feature space and application thereof
By converting text into pictures and combining them with carriers in feature space, the problem of small steganography capacity and low robustness in the existing technology is solved, and more efficient information steganography and better noise immunity are achieved.
Patent Information
- Application Number
- CN202411935735.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The prior art has problems in information steganography with small steganography capacity, low robustness and poor detection resistance. Especially in chat scenarios, it is difficult to hide a large amount of information, and steganography information is easily affected by image processing and compression operations.
A text robust steganography method based on feature space is used to convert the preset text into a specified image format, and then combine it with the original carrier in the feature space after being encoded by an autoencoder to generate a carrier with encrypted steganographic information. The receiver extracts the picture of the preset text through the extractor and restores the preset text through the decoder.
The steganography capacity is increased, the robustness is enhanced, and it can resist a certain degree of noise influence and carrier image changes, achieving better image generation quality and steganography effects.
Smart Images

Figure CN119358010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a text robust steganography method based on feature space in the direction of data privacy protection and information steganography and its application. Background Art
[0002] Steganography means information hiding, which refers to not letting anyone other than the intended recipient know the transmission event or content of the information. In recent years, steganography has become the focus of information security. Steganography can embed secret information into digital media without damaging the quality of its carrier, and third parties cannot detect the existence of secret information, which allows keys, digital signatures and private information to be securely transmitted in an open environment.
[0003] Traditional information steganography methods mainly hide secret information in various types of carriers such as images, audio and video by converting it into binary bit streams. In the field of image steganography, many researchers at home and abroad have proposed various methods, mainly including steganography methods based on transform domains (such as DCT, DWT, etc.) and steganography methods based on changing pixel values (such as LSB replacement, LSB matching, etc.). In recent years, researchers have begun to apply deep learning technology to the field of information steganography, using deep neural network models to achieve better information hiding effects.
[0004] However, information steganography still faces challenges. First, the steganographic capacity is small, especially in chat scenarios, it is difficult to hide a large amount of chat information; second, the robustness is low, and the steganographic information is easily affected by operations such as image processing and compression during transmission, and then lost or cannot be extracted; in addition, information steganography also has the problem of poor anti-detection, and general information steganography cannot avoid the attacker's steganographic detection. Summary of the invention
[0005] The present invention solves the problems existing in the prior art, provides a text robust steganography method based on feature space and its application, hides text in an image for transmission, and provides a privacy protection means for scenarios involving large-scale information steganography requirements such as online chat users.
[0006] The technical solution adopted by the present invention is a text robust steganography method based on feature space. The method converts a preset text into a specified image format, encodes it with the original carrier through respective encoders and combines it in the feature space, and then obtains the carrier with encrypted stego information with a decoder; after the carrier with encrypted stego information is transmitted to the receiver through a channel, an extractor is used to obtain the image currently corresponding to the preset text, and the preset text is obtained through conversion.
[0007] Preferably, the method comprises the following steps:
[0008] S1 Convert preset text to black and white image ;
[0009] S2 pre-trains an autoencoder suitable for the carrier type, including an encoder and a decoder , with encoder For the original carrier Encode and get the encoding vector ;
[0010] S3 training encoder For black and white pictures Encode and get the encoding vector of the preset text , fused encoding vector and the encoding vector ,get ;
[0011] S4 uses a pre-trained decoder Pair Vector Decode and obtain the encrypted steganographic information, which is the carrier for hiding the preset text information ;Will The receiver receives the data transmitted through the channel. ;
[0012] S5 Training Extractor from Extract black and white images containing preset text information ;
[0013] S6 from black and white pictures Extract the steganographic preset text.
[0014] Preferably, in S1, a Chinese font library is imported into the tool, the text size and text position are set, and a corresponding black and white picture is generated. ; Adjust the positioning of text in the image.
[0015] Preferably, for Character-length text, arranged in rows and columns Number of characters, , the unified image side length is , calculate and set the font to , ; This will center the text as a whole.
[0016] Preferably, in S2, the input and output of the pre-trained autoencoder are RGB images.
[0017] Preferably, the encoder is trained When the decoded image With original vector The difference loss between satisfy,
[0018]
[0019] in, , is the mean square error of the corresponding pixel, is the adjustment coefficient, which is generally a fixed constant of 0.2. is the loss function used to measure perceptual similarity.
[0020] Preferably, the training extractor When the black and white image is extracted With the original black and white picture The difference loss between satisfy,
[0021] (b, )
[0022] =
[0023] in, is the binary cross entropy loss corresponding to the two pictures, is the number of pixels, For black and white pictures Middle The true label of each pixel, For black and white pictures The corresponding The predicted probability of each pixel.
[0024] Preferably, the total loss L is minimized by gradient descent. and ,
[0025]
[0026] in, Used to balance the quality of the stego image and the recovery rate of the secret information. The initial value is 0.1. Black and white images Compared to black and white pictures The recovery accuracy of The value increases linearly.
[0027] Preferably, the encoder is trained and extractor When in the image One or more noises are added to simulate the carrier with certain loss obtained through the real transmission channel. .
[0028] A text robust steganography method based on feature space and its application are applied to online chat scenarios.
[0029] The present invention relates to a text robust steganography method based on feature space and its application. The method converts a preset text into a specified image format, encodes it with an original carrier through respective encoders and then combines it in the feature space, and then obtains the carrier with encrypted stego information through a decoder; after the carrier with encrypted stego information is transmitted to a receiver through a channel, an extractor is used to obtain the image currently corresponding to the preset text, and the preset text is obtained through conversion; and the method is applied to online chat scenarios.
[0030] The beneficial effects of the present invention are:
[0031] (1) Combining the latest information steganography framework, a text-to-image steganography framework based on latent diffusion model (LDM) and autoencoder (AE) is proposed. Compared with the existing technology, it has a larger steganographic capacity, thus meeting the purpose of text steganography, with faster generation speed and better image generation quality;
[0032] (2) The encoder and extractor of the information steganography subject are trained while freezing the potential diffusion model, which greatly reduces the pressure of model training and reduces the computing power requirements;
[0033] (3) The proposed method is compared with other methods in terms of steganographic effect and restoration accuracy under various settings, such as channel noise difference, carrier image difference, and the amount of text to be steganographic. The performance and applicability of the proposed method are fully evaluated. The method has good robustness and can resist a certain degree of noise influence and carrier image influence.
[0034] (4) Based on the proposed text steganography model and algorithm, a chat system with information hiding function was designed and implemented, which is conducive to further commercial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flow chart of the method of the present invention;
[0036] Figure 2 It is a model block diagram of the present invention;
[0037] Figure 3 This is an experimental diagram of the impact of different noises and noise intensities on information steganography. DETAILED DESCRIPTION
[0038] The present invention is further described in detail below in conjunction with embodiments, but the protection scope of the present invention is not limited thereto.
[0039] The present invention relates to a text robust steganography method based on feature space. The method converts a preset text into a specified image format, encodes it with an original carrier through respective encoders and then combines it in the feature space, and then obtains the carrier with encrypted stego information through a decoder; after the carrier with encrypted stego information is transmitted to a receiver through a channel, an extractor is used to obtain the image currently corresponding to the preset text, and the preset text is obtained through conversion.
[0040] In the present invention, the preset text is the secret text, which is converted into a specified format, such as a black and white picture, and then fused with the original carrier in the coding space, generally the coding of the picture. The loss function optimization model is designed to realize the encoding of the secret information, i.e. the black and white picture and the carrier picture, the embedding and extraction of the secret information, and the anti-noise training.
[0041] The method is described below in conjunction with specific steps, and the method includes the following steps:
[0042] S1 Convert preset text to black and white image ;
[0043] In S1, import the Chinese font library in the tool, set the text size and text position, and generate the corresponding black and white image ; Adjust the positioning of text in the image.
[0044] In the present invention, considering that the technical solution of converting secret information into a bit stream and steganographically writing it into a picture is not ideal in terms of steganographic effect, restoration effect and noise resistance in the case of a large amount of text, the secret text is first converted into a black and white picture; the tool here is the Pillow library, which will automatically convert the text into a black and white picture after importing the font library, setting the font size and text position, and the word order remains unchanged, thereby completing the operation of converting the text into a picture.
[0045] In order to compare with the image generated by the decoder and calculate the loss, the following methods are used to locate the text in the image:
[0046] for Character-length text, arranged in rows and columns Number of characters, , arranged in a matrix, with a uniform image side length of ,like , calculate and set the font to , ; Center the text as a whole; specifically, Set to , .
[0047] S2 pre-trains an autoencoder suitable for the carrier type, including an encoder and a decoder , with encoder For the original carrier Encode and get the encoding vector ;
[0048] In S2, the input and output of the pre-trained autoencoder are RGB images.
[0049] S3 training encoder For black and white pictures Encode and get the encoding vector of the preset text , fused encoding vector and the encoding vector ,get .
[0050] In the present invention, black and white pictures Through the encoder that needs to be trained Encode and get the encoding vector of the preset text , the original vector The encoder in the pre-trained autoencoder Encode and get the encoding vector , ; Fusion coding vector and the encoding vector ,get , the fusion here uses vector addition, ;
[0051] The original carrier image can be imported by the user or automatically generated. When the carrier image is imported by the user, the pre-trained autoencoder VQGAN is used. Otherwise, the pre-trained latent diffusion model (LDM) with text-to-image is used to automatically generate the carrier image.
[0052] S4 uses a pre-trained decoder Pair Vector Decode and obtain the encrypted steganographic information, which is the carrier for hiding the preset text information , ;
[0053] Will The receiver receives the data transmitted through the channel. ;
[0054] S5 Training Extractor from Extract black and white images containing preset text information , ;
[0055] S6 uses OCR technology to convert black and white images Extract the steganographic preset text.
[0056] In the present invention, the encoder E and decoder D in the model are used as image autoencoders and are pre-trained. In addition, the secret information encoder needs to be trained by optimizing the loss function. and extractor , the encoder E and decoder D remain frozen during the following training process.
[0057] Training the encoder When the decoded image With original vector The difference loss between satisfy,
[0058]
[0059] in, , is the mean square error of the corresponding pixel, is the adjustment coefficient, is the loss function used to measure perceptual similarity, This can be achieved by calling lpips.LPIPS of the lpips python dependency library.
[0060] In the present invention, the decoder D obtains an image containing secret information With the original carrier image The difference between represents the steganographic quality, and by minimizing the difference To improve the quality of steganography, generally speaking, Measured from both a pixel and a perceptual perspective.
[0061] Training the Extractor When the black and white image is extracted With the original black and white picture The difference loss between satisfy,
[0062] (b, )
[0063] =
[0064] in, is the binary cross entropy loss corresponding to the two pictures, is the number of pixels, For black and white pictures Middle The true label of each pixel, For black and white pictures The corresponding The predicted probability of each pixel.
[0065] In the present invention, from The extracted black and white image representing the secret information The difference between the original black and white image b represents the extraction performance of the secret information.
[0066] Minimize the total loss L through gradient descent training and ,
[0067]
[0068] in, Used to balance the quality of the stego image and the recovery rate of the secret information. The initial value is 0.1. Black and white images Compared to black and white pictures The recovery accuracy of The value increases linearly.
[0069] Specifically, by adjusting the loss weight , at the beginning , when the recovery accuracy ( and The number of pixels with the same value at corresponding positions / When the size of The value increases linearly to 10.
[0070] Training the encoder and extractor When in the image One or more noises are added to simulate the carrier with certain loss obtained through the real transmission channel. .
[0071] In the present invention, in order to improve the noise resistance during the transmission process, the image containing the secret information A series of operations are performed on the RGB image to simulate various noises in the channel, including but not limited to Gaussian noise with a variance of 0.1, JPEG compression with a compression quality parameter of 30, brightness gain less than 0.2, and blur kernel size less than Gaussian blur processing.
[0072] The following is an embodiment of the present invention. In order to achieve a better text recognition effect, the pictures generated by the decoder are taken as samples, and the single texts therein are segmented to make a training data set, and a simple neural network is designed for training.
[0073] The dataset is divided into two parts. The first part accounts for about 90% and is generated through the pillow library. Different font files are used, and some of them are data enhanced (text distortion, stroke breakage, etc.) to generate a dataset of 3755 printed Chinese characters. The second part is a picture generated by the decoder, in which individual characters are segmented and labeled to supplement the dataset. During the training process, 80% of the dataset is used as the training set and 20% of the dataset is used as the validation set. epoch=500, batch_size=512, and learning_rate=0.1 are set for training. This training is separated from the overall model and is only used as the OCR part.
[0074] For the obtained black and white picture containing text information Through the encoder Encode and obtain the encoding vector of the secret information ;
[0075] The model training parameters used in the experiment are epoch=18, global_steps=450000, the optimizer uses Adam optimizer, the training set uses MIRFlickR dataset, and only its image part is used as the carrier image. The steganographic performance of the model is tested by increasing the number of steganographic characters. As the number of characters increases, the image quality is still guaranteed, but the steganalysis recovery performance is affected to a certain extent with the increase in the number of characters. This model has a certain degree of robustness, and most low-intensity noises have little effect on the model accuracy. The superposition of multiple low-intensity noises has a certain impact on the model accuracy.
[0076] The overall network uses the autoencoder VQGAN. When the carrier image is imported by the user, the pre-trained autoencoder VQGAN is used. Otherwise, the pre-trained latent diffusion model (LDM) with text to image is used to realize the automatic generation of the carrier image. The encoder is a relatively small neural network, which is presented as a combination of fully connected layers and SiLU. It is mainly used to map secret information to the latent layer of the image. The extractor uses ResNet50 for feature extraction of secret information. The latent diffusion model used to generate the carrier image is pre-trained and frozen. Now we need to train a secret encoder. , the secret Mapping to images for latent embedding;
[0077] The carrier image is Pictures , encoded into z by the CNN encoder (pre-trained encoder) of the latent diffusion model, and the secret image passes through the encoder After encoding, reshape and rescale to match the dimension of z and then perform convolution operation. The encoder Output As a small offset is added to z, satisfying ;
[0078] Encode the secret information vector and the carrier image encoding vector Fusion, .
[0079] Through the pre-trained decoder Pair Vector Decode and get the image containing secret information , , stego-image is reconstructed and adjusted using a combination of pixel and perceptual losses. The loss function is as follows:
[0080]
[0081]
[0082] in, It is a differentiable non-parametric mapping function from RGB to YUV space. The vision in YUV space has better perceptual consistency.
[0083] LPIPS is a loss function used to measure image quality and perceptual similarity. It uses a pre-trained deep learning model to extract the feature representation of the image, and then calculates the Euclidean distance or cosine similarity between the features of two images as their similarity measure. Finally, the similarity measure is converted into a loss value. This loss calculation can be implemented through the LPIPS dependency library.
[0084] Images with secret messages It is transmitted through the channel and is affected by noise during the process. When it reaches the receiver, ;
[0085] Then via the secret extractor right The secret information in is output, and the recovery loss between the recovered secret and the original secret is calculated by using MSE.
[0086] Encoder With Extractor The total loss function is calculated as follows:
[0087]
[0088] in Used to balance the quality of stego images and the recovery rate of secret information by adjusting the loss weight It is found that there is a trade-off between steganographic quality and recovery accuracy. It can improve the SSIM score by about 8% while reducing the recovery accuracy by about 6%.
[0089] Via Secret Extractor from Extract black and white images containing secret text information from ,Right now .
[0090] Finally, the hidden text information is extracted from the black and white image using OCR technology.
[0091] During the implementation process, the following conclusions can be obtained:
[0092] (1) By increasing the number of stego characters to test the steganographic performance of the model, it is found that as the number of characters increases, the image quality is still guaranteed, but the stego-recovery performance is affected to a certain extent as the number of characters increases;
[0093] (2) The noise generation is realized with the help of the ImageNet-c dataset, and a threshold is set in advance for the noise intensity to distinguish low-intensity noise from high-intensity noise. Through experiments, it can be found that this model has a certain robustness. Most low-intensity noise has little effect on the model accuracy, and the superposition of multiple low-intensity noises has a certain impact on the model accuracy.
[0094] The experimental results of this model under different noises and noise intensities in the experiment shown in Table 1 are as follows: Figure 3 As shown;
[0095] Table 1 Different noises and noise intensities involved in the experiment
[0096] Noise Type Low intensity noise High intensity noise Gaussian noise The noise variance is less than 0.1 Noise variance is greater than 0.1 Jpeg compression Compression quality parameter greater than 30 The compression quality parameter is less than or equal to 30 Brightness Brightness gain is less than or equal to 0.2 Brightness gain greater than 0.2 Spatter The number of spots is less than 0.5 and the size of spots is less than 0.3 The number of spots is greater than 0.5 and the size of spots is greater than 0.3 Gaussian blur Blur kernel size is smaller than 5x5 Blur kernel size is larger than 5x5 Defocus blur Blur kernel size is smaller than 5x5 Blur kernel size is larger than 5x5
[0097] (3) In order to study the impact of different styles of in-transit images on this model, we used different prompts to generate carrier images of different styles in the diffusion model for testing, as shown in Table 2;
[0098] Table 2 Carrier images of different styles
[0099] Style performance parameters Realistic picture quality Movie Lights Photographic Sense Abstract Art Anime style Line Art PSNR 32.64 31.97 32.51 32.86 32.79 30.12 SSIM 0.93 0.88 0.92 0.94 0.93 0.84 ACC 0.97 0.96 0.96 0.98 0.97 0.96
[0100] The experimental results show that different carrier image styles have almost no effect on the model results, and the model has good robustness.
[0101] The present invention also relates to a text robust steganography method based on feature space and an application thereof, which is applied to online chat scenarios.
[0102] Specifically, the application of the present invention uses the Ubuntu operating system as the development and operation environment, uses Pycharm for integrated development of algorithms and systems, uses the Remote SSH tool to connect to the remote server, uses the open source container platform Docker image to create container forces, uses the React.js framework for the front end, the Django framework for the back end, and uses MySQL for database development;
[0103] After successfully entering the system account and password verification, the system will jump to the chat room homepage, which is configured with a user list for selecting any user to chat. It also has a dialogue bar and an input bar. After entering the content and clicking Send, the encoder and potential diffusion model of the information steganography model will be called to generate an image and send an encrypted image loaded with chat information to the selected user; a conversion mark is configured on the input box side to obtain the information carried by the image, that is, after the user who receives the encrypted image clicks it, the system calls the decoder of the information steganography model to obtain the chat information and display the information next to the image.
[0104] Based on this method, the development of computer media, programs and equipment can be realized.
[0105] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0107] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0110] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A text robust steganography method based on feature space, characterized by: The method converts a preset text into a specified image format, encodes it with the original carrier through respective encoders and combines it in the feature space, and then obtains the carrier with encrypted stego information through a decoder; after the carrier with encrypted stego information is transmitted to the receiver through a channel, an extractor is used to obtain the image currently corresponding to the preset text, and the preset text is obtained through conversion.
2. According to the feature space-based text robust steganography method of claim 1, it is characterized by: The method comprises the following steps: S1, convert the preset text into black and white pictures ; S2, a pre-trained autoencoder suitable for the carrier type, including an encoder and a decoder , with encoder For the original carrier Encode and get the encoding vector ; S3, train encoder For black and white pictures Encode and get the encoding vector of the preset text , fused encoding vector and the encoding vector ,get ; S4, with pre-trained decoder Pair Vector Decode and obtain the encrypted steganographic information, which is the carrier for hiding the preset text information ;Will The receiver receives the data transmitted through the channel. ; S5, training extractor from Extract black and white images containing preset text information ; S6, from black and white pictures Extract the steganographic preset text.
3. According to the feature space-based text robust steganography method of claim 2, it is characterized by: In S1, import the Chinese font library in the tool, set the text size and text position, and generate the corresponding black and white image ; Adjust the positioning of text within the image.
4. The text robust steganography method based on feature space according to claim 3, characterized in that: for Character-length text, arranged in rows and columns Number of characters, , the unified image side length is , calculate and set the font to , ; This centers the text as a whole.
5. The text robust steganography method based on feature space according to claim 2, characterized in that: In S2, the input and output of the pre-trained autoencoder are RGB images.
6. The text robust steganography method based on feature space according to claim 2, characterized in that: Training the encoder When the decoded image With original vector The difference loss between satisfy, , in, , is the mean square error of the corresponding pixel, is the adjustment coefficient, is the loss function used to measure perceptual similarity.
7. The text robust steganography method based on feature space according to claim 6, characterized in that: Training the Extractor When the black and white image is extracted With the original black and white picture The difference loss between satisfy, (b, ) = , in, is the binary cross entropy loss corresponding to the two pictures, is the number of pixels, For black and white pictures Middle The true label of each pixel, For black and white pictures The corresponding The predicted probability of each pixel.
8. The text robust steganography method based on feature space according to claim 7, characterized in that: Minimize the total loss L through gradient descent training and , , in, Used to balance the quality of the stego image and the recovery rate of the secret information. The initial value is 0.
1. Black and white images Compared to black and white pictures The recovery accuracy of The value increases linearly.
9. The text robust steganography method based on feature space according to claim 2, characterized in that: Training the encoder and extractor When in the image One or more noises are added to simulate the carrier with certain loss obtained through the real transmission channel. .
10. An application of the text robust steganography method based on feature space according to any one of claims 1 to 9, characterized in that: Applicable to online chat scenarios.
Citation Information
Patent Citations
End-to-end JPEG domain image steganography method based on generative adversarial network
CN112634117A
Large-capacity image information hiding method based on adversarial training
CN113284033A
Robust image watermarking method based on generative adversarial network
CN115131188A
Steganographic image generation method, steganographic information extraction method and related devices
CN116156072A
Data processing method and device, electronic equipment and storage medium
CN117495646A