A robust text steganography method based on feature space and its application
Through the text robust steganography method based on feature space, the preset text is converted into a black and white image and the autoencoder and latent diffusion model are used to generate the carrier of encrypted steganographic information, which solves the problems of small steganographic capacity and low robustness in the existing technology and realizes efficient information hiding and noise resistance in the chat scenario.
Patent Information
- Application Number
- CN202411935735.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Existing information steganography methods have problems such as small steganographic capacity, low robustness and poor anti-detection ability. Especially in chat scenarios, it is difficult to hide large amounts of information and they are easily affected by image processing operations.
A text robust steganography method based on feature space is adopted. The preset text is converted into a black and white image. The autoencoder and decoder are combined in the feature space to generate a carrier of encrypted stego information. The preset text is extracted using an extractor, and the latent diffusion model and autoencoder framework are applied for training to improve the stegoscopy capacity and robustness.
It achieves larger steganographic capacity, faster generation speed and better image generation quality, has good robustness, can resist a certain degree of noise influence and carrier image changes, and is suitable for information steganography in online chat scenarios.
Smart Images

Figure CN119358010B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a feature space-based robust text steganography method for data privacy protection and information steganography and its application. Background Art
[0002] Steganography, meaning information hiding, refers to the practice of concealing the transmission or content of information from anyone other than the intended recipient. In recent years, steganography has become a focal point in information security. Steganography allows secret information to be embedded in digital media without compromising the quality of the carrier, rendering the secret information invisible to third parties. This allows for the secure transmission of keys, digital signatures, and private information in open environments.
[0003] Traditional information steganography methods primarily hide secret information in various media types, such as images, audio, and video, by converting it into binary bit streams. In the field of image steganography, many researchers, both domestically and internationally, have proposed various methods, including those based on transform domains (such as DCT and DWT) and those based on pixel value manipulation (such as LSB replacement and LSB matching). In recent years, researchers have begun applying deep learning techniques to information steganography, using deep neural network models to achieve even better information hiding results.
[0004] However, information steganography still faces challenges. First, its capacity is small, making it difficult to hide large amounts of chat information, especially in scenarios like chat. Second, its robustness is low, and the steganographic information is easily affected by operations such as image processing and compression during transmission, resulting in loss or inability to extract it. Furthermore, information steganography suffers from poor anti-detection capabilities, and typical information steganography cannot evade attackers' stego-detection efforts. Summary of the Invention
[0005] The present invention solves the problems existing in the prior art and provides a text robust steganography method based on feature space and its application, which hides text in images for transmission and provides a privacy protection method for scenarios involving large-scale information steganography needs 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 then combines it in the feature space, and then uses a decoder to obtain a carrier with encrypted steganographic information; after the carrier with encrypted steganographic information is transmitted to the receiver through a channel, an extractor is used to obtain the current image 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 Original carrier Encode and get the encoding vector ;
[0010] S3 training encoder Black and white pictures Encode and obtain the encoding vector of the preset text , fused encoding vector and 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 transmission is transmitted to the receiver through the channel, and the receiver obtains ;
[0012] S5 Training Extractor from Extract black and white pictures containing preset text information ;
[0013] S6 from black and white pictures Extract the steganographic preset text.
[0014] Preferably, in S1, import the Chinese font library into the tool, set the text size and text position, and generate the corresponding black and white picture ; 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 , ; Make the text centered 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 the original carrier 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 extractor is trained When the black and white picture 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, Black and white picture Middle The true label of each pixel, Black and white picture 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 steganographic image and the recovery rate of the secret information. The initial value is 0.1. Black and white images Compared with black and white pictures The recovery accuracy of The value increases linearly.
[0027] Preferably, the encoder is trained and extractors When 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. A decoder is then used to obtain a carrier with encrypted steganographic information. After the carrier with encrypted steganographic 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. 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 the 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 Experimental diagram showing the effects of different noises and noise intensities on information steganography. DETAILED DESCRIPTION
[0038] The present invention is further described in detail below with reference to the 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. A decoder is then used to obtain a carrier with encrypted steganographic information. After the carrier with encrypted steganographic 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, generally the coding of the picture, in the coding space. By designing a loss function optimization model, 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 anti-noise training are realized.
[0041] The method is described below with reference to specific steps, which include the following steps:
[0042] S1 Convert preset text to black and white image ;
[0043] In S1, import the Chinese font library into the tool, set the text size and 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 an image does not have ideal 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 image; the tool here is the Pillow library, which automatically converts the text into a black and white image after importing the font library, setting the font size and text position, and completing the text-to-image operation without changing the word order.
[0045] To facilitate comparison with the decoder-generated image 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 the image side length unified as ,like , calculate and set the font to , ; Make the text centered 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 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 Black and white pictures Encode and obtain the encoding vector of the preset text , fused encoding vector and encoding vector ,get .
[0050] In the present invention, black and white pictures Through the encoder that needs to be trained Encode and obtain the encoding vector of the preset text , the original carrier The encoder in the pre-trained autoencoder Encode and get the encoding vector , ; Fusion coding vector and 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 transmission is transmitted to the receiver through the channel, and the receiver obtains ;
[0054] S5 Training Extractor from Extract black and white pictures containing preset text information , ;
[0055] S6 uses OCR technology, including but not limited to, 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 pre-trained as image autoencoders. In addition, the secret information encoder needs to be trained by optimizing the loss function. and extractors , the encoder E and decoder D remain frozen during the following training process.
[0057] Training the encoder When the decoded image With the original carrier 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 pixel and perceptual perspectives.
[0061] Training the Extractor When the black and white picture 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, Black and white picture Middle The true label of each pixel, Black and white picture The corresponding The predicted probability of each pixel.
[0065] In the present invention, Extracted black and white image representing 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 by gradient descent training and ,
[0067]
[0068] in, Used to balance the quality of the steganographic image and the recovery rate of the secret information. The initial value is 0.1. Black and white images Compared with 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 ) exceeds 0.9, The value increases linearly up to 10.
[0070] Training the encoder and extractors When 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 transmission, the image containing secret information A series of operations are performed on the RGB-D 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. To achieve better text recognition results, the images generated by the decoder are used as samples, and individual texts are segmented to create a training data set, and a simple neural network is designed for training.
[0073] The dataset is divided into two parts. The first part, accounting for about 90%, is generated by the pillow library. Different font files are used, and some of them are enhanced (such as text distortion and stroke breakage) to generate a dataset of 3755 printed Chinese characters. The second part is an image generated by the decoder, in which individual characters are segmented and annotated 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. The training is performed with epoch=500, batch_size=512, and learning_rate=0.1. This training is separate from the overall model and is used only as the OCR part.
[0074] 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 Adam optimizer is used as the optimizer, the MIRFlickR dataset is used as the training set, 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 steganographic recovery performance is affected to a certain extent with the increase in the number of characters. This model has a certain degree of 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.
[0076] The overall network uses an autoencoder VQGAN. When the carrier image is imported by the user, a pre-trained autoencoder VQGAN is used. Otherwise, a pre-trained latent diffusion model (LDM) with text-to-image is used to automatically generate 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 as z through 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. Output As a small offset is added to z, satisfying ;
[0078] Encode the secret information into a vector and the carrier image encoding vector Fusion, .
[0079] Through 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 image feature representations, then calculates the Euclidean distance or cosine similarity between two image features as their similarity measure. Finally, the similarity measure is converted into a loss value. This loss calculation can be implemented using the LPIPS dependency library.
[0084] Images with hidden secret messages It is transmitted through the channel and is affected by noise during the process. When it reaches the receiver, ;
[0085] Then through the secret extractor right The secret information in is output and the recovery loss between the recovered secret and the original secret is calculated using MSE.
[0086] encoder With Extractor The total loss function is calculated as follows:
[0087]
[0088] in Used to balance the quality of steganographic 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, and a 10-fold increase in 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 ,Right now .
[0090] Finally, OCR technology is used to extract the hidden text information from the black and white image.
[0091] During the implementation process, the following conclusions can be obtained:
[0092] (1) By increasing the number of steganographic 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 steganographic recovery performance is affected to a certain extent as the number of characters increases;
[0093] (2) Noise generation is achieved 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. Experiments show that this model has a certain degree of robustness. Most low-intensity noise has little effect on the model accuracy, while the superposition of multiple low-intensity noises has a certain impact on the model accuracy.
[0094] The experimental results of this model under different noise and noise intensity 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 Noise variance is less than 0.1 Noise variance is greater than 0.1 Jpeg compression Compression quality parameter greater than 30 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 image quality Movie Light and Shadow 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 its application, 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 containerization 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 flag is configured on the side of the input box 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 achieved.
[0105] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, 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 magnetic 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 flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 flowcharts and / or block diagrams. 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 that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The 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 operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional 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 may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
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 then combines it in the feature space. A decoder is then used to obtain a carrier with encrypted stego information. 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. The method includes the following steps: S1 imports the Chinese font library into the tool, sets the text size and position, and converts the preset text into a black and white image. ; Adjust the positioning of text in the image; S2 pre-trains an autoencoder suitable for the carrier type, including an encoder and a decoder , with encoder Original carrier Encode and get the encoding vector ; S3 training encoder Black and white pictures Encode and obtain the encoding vector of the preset text , fused encoding vector and encoding vector ,get ; 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 transmission is transmitted to the receiver through the channel, and the receiver obtains ; Train the encoder and extractors When the image One or more noises are added to simulate the carrier with certain loss obtained through the real transmission channel. ; S5 Training Extractor from Extract black and white pictures containing preset text information ; S6 from black and white pictures Extract the steganographic preset text; Encoder in the model and decoder Pre-training is completed, and the secret information encoder and extractor are trained through loss function optimization. and decoder Stay frozen during training; Training the encoder When the decoded image With the original carrier 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; Training the Extractor When the black and white picture 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, Black and white picture Middle The true label of each pixel, Black and white picture The corresponding The predicted probability of pixels; The method is applied to online chat scenarios. After entering the content and clicking send, the encoder and latent diffusion model of the information steganography model are called to generate an image and send the encrypted image containing the chat information to the selected user. After the user who receives the encrypted image clicks the conversion sign, the system calls the decoder of the information steganography model to obtain the chat information and display the information next to the image.
2. The text robust steganography method based on feature space according to claim 1, 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 , ; Make the text centered as a whole.
3. The text robust steganography method based on feature space according to claim 1, characterized in that: In S2, the input and output of the pre-trained autoencoder are RGB images.
4. The text robust steganography method based on feature space according to claim 1, characterized in that: Minimize the total loss L by gradient descent training and , , in, Used to balance the quality of the steganographic 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.
5. An application of the feature space-based text robust steganography method according to any one of claims 1 to 4, characterized in that: Applicable to online chat scenarios.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and storage medium
CN117495646A