Image steganography method and system based on NICE model
By using the NICE model to train the generator and extractor, we achieved high steganographic capacity and high extraction rate for carrier-synthetic image steganography. The generated images are highly natural, solving the problems of small steganographic capacity and low extraction rate in the existing technology and improving the security and efficiency of steganography.
Patent Information
- Application Number
- CN202111469742.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-12-03
AI Technical Summary
The existing carrier synthesis image steganography method has the problems of small steganographic capacity and low extraction accuracy, and the generated images cannot be natural and realistic, which can easily arouse suspicion from the enemy.
The NICE model is used for training to construct a generator and extractor. The reversible property of the model is used to directly generate and extract secret messages. Through the bidirectional mapping between secret messages and latent variables, natural and realistic secret images are generated, and the secret messages can be fully recovered.
The generated image is difficult to be detected by steganalysis tools, has a large steganalysis capacity, a 100% secret message extraction rate, and a high degree of naturalness, thus improving the security and efficiency of steganalysis.
Smart Images

Figure CN114140309B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image steganography algorithms, and in particular relates to an image steganography method and system based on the NICE model. Background Art
[0002] Image steganography is the art of concealing secret messages within digital images without third-party detection. Steganography techniques can be categorized into three types based on different strategies for processing the secret message carrier: cover modification, cover selection, and cover synthesis. Cover modification image steganography embeds a secret message into the image by modifying the original carrier image, making it invisible to the adversary while ensuring that the message can be retrieved by the receiver. This steganography method, characterized by its comprehensive theoretical framework, large embedding capacity, and high operability, is the most mainstream approach in traditional image steganography research. Currently, mainstream modification steganography methods primarily follow a fixed technical framework of "setting a stego-distortion index" and then employing an encoding method to minimize the distortion index, resulting in few breakthroughs. Cover selection steganography conveys information by selecting natural images from a natural image library that correspond to the secret message. This is equivalent to hiding data by establishing a correspondence between the natural image and the secret message. However, this method's low embedding capacity limits its practical value. The goal of carrier synthesis steganography, on the other hand, is to directly synthesize an image containing a secret message using a computer. Because carrier synthesis steganography allows for the free creation of images, it offers greater flexibility in concealing secret messages. In principle, if a sufficiently realistic and natural stegoimage can be directly synthesized, statistical steganalyzers will be unable to detect it. Therefore, this method is theoretically more secure than carrier modification image steganography.
[0003] Traditional carrier-synthetic image steganography mostly uses heuristic methods. The main idea is to map secret messages into basic graphics elements through simple design methods, and then use graphics element overlay, splicing or deformation methods to generate large artificial images. However, the images synthesized by these methods can only be simple texture images, deformed images or mosaic images, which cannot achieve natural and realistic image effects and can easily arouse visual suspicion from the enemy. This has also become a major drawback of traditional carrier-synthetic steganography methods.
[0004] In recent years, with the continuous advancement of computer hardware, deep learning technology has emerged rapidly. Research on deep generative models, in particular, has addressed the need for generative modeling in many application fields. Currently, the technical conditions for using deep generative models for synthetic image steganography are in place. Scholars both domestically and internationally have begun exploring the application of deep generative models in synthetic steganography. However, this research is still in its infancy, with relatively few proposed models and algorithms, and they generally suffer from limited steganographic capacity and low extraction accuracy. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that, by utilizing the reversible property of the NICE model, the model can be directly used for hiding and extracting secret messages after a single training, thus avoiding the step of specially training a message extractor in GAN-based steganography schemes. A method for bidirectional mapping between the model's latent variables and the secret message is cleverly designed, which can achieve complete recovery of the secret message in the synthesized secret image, overcoming the significant drawback of current methods of this type that the message cannot be fully recovered, and the steganographic capacity is far greater than that of existing technical methods.
[0006] On the one hand, to achieve the above-mentioned object, the present invention provides an image steganography method based on the NICE model, comprising the following steps:
[0007] Build a NICE model and obtain an image dataset to train the NICE model;
[0008] After training, the generator in the NICE model is reversed to obtain the extractor;
[0009] Generate a secret image from the secret message based on the generator;
[0010] The secret message is separated from the encrypted image based on the extractor to obtain the secret message.
[0011] Optionally, the process of building a NICE model and obtaining an image dataset to train the NICE model includes:
[0012] The NICE model is trained based on the image data to obtain a mapping relationship between the real image data and the latent variable space data distribution.
[0013] Optionally, after training, the generator in the NICE model is reverse-built to obtain the extractor, including:
[0014] The parameters of the trained model remain unchanged, and the generator is built in reverse to obtain the extractor and the reversible mapping method between the secret message and the latent variable.
[0015] Optionally, the process of generating a secret image from a secret message based on the generator includes:
[0016] Based on the mapping relationship between the secret message and the hidden variable, mapping the secret message to be hidden into a floating-point array;
[0017] Based on the mapping relationship between the data distribution of the real image and the reference distribution of the latent variable space, the floating-point array is input into the generator to obtain a encrypted image.
[0018] Optionally, the process of separating the secret message from the encrypted image based on the extractor and obtaining the secret message includes:
[0019] Extracting a floating-point array from the encrypted image based on the extractor;
[0020] Based on the mapping relationship between the secret message and the hidden variable, the obtained floating-point array is reversely mapped to restore the original information.
[0021] On the other hand, to achieve the above-mentioned object, the present invention provides an image steganography system based on the NICE model, comprising:
[0022] Generator, used to generate a secret image;
[0023] Extractor, used to extract the original information from the encrypted image.
[0024] Optionally, the generator is constructed based on the NICE model, including six forward cross-linear superposition coupling layers and a first neural network module.
[0025] Optionally, the extractor is constructed based on the NICE model, including six reverse cross-linear superposition coupling layers and a second neural network module.
[0026] Optionally, the first neural network module and the second neural network module both use 6 fully connected networks, and the activation function uses the Relu function.
[0027] The technical effects of the present invention are:
[0028] The advantages of the image steganography method and system based on the NICE model of the present invention are:
[0029] (1) Carrier-synthetic image steganography based on the NICE model directly generates a secret image based on the secret message. In principle, the generated image fully fits the data distribution of the real image, making it difficult for machines and humans to verify its authenticity. Therefore, the secret image generated by the model cannot be detected by steganalysis tools based on probability statistics, and is theoretically more secure.
[0030] (2) The generated image is reversed through the NICE model, and then the secret message is extracted from the secret image according to the formula. The secret message can be completely reversibly recovered, making this method achieve a 100% message extraction rate.
[0031] (3) According to the characteristics of the NICE model, the original input data of the model z The dimensions must be the same as the output data x For multi-channel images, the image size is w × h × c ( w × h is the image size, c is the number of channels of the image), model input data z The dimension of should be equal to the size of the generated image, i.e. w × h × c dimensional vector. z The dimension of determines the number of bits that can hide the secret message. Theoretically, a w × h × c The image corresponds to w × h × c floating point numbers, and each floating point number corresponds to n According to our proposed method (setting n = 13, a = 4444, c = 5555), one pixel corresponds to one floating-point number, and one floating-point number corresponds to a 13-bit binary secret message. In other words, the steganographic capacity of this method is 13 bits per page (using the float32 data format in Numpy for calculations, and the image storage format is a single-channel *.tiff image).
[0032] It can be seen that the carrier synthesis image steganography based on NICE has considerable steganographic capacity, while the traditional rewriting-based steganography method cannot use multiple bits in a pixel to hide messages without changing the visual effect of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0034] Figure 1 Schematic diagram of an image steganography framework based on a stream model according to the first embodiment of the present invention;
[0035] Figure 2 Schematic diagram of the flow of the image steganography method based on the NICE model according to the second embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of the improved NICE model structure according to the third embodiment of the present invention;
[0037] Figure 4 This is a schematic diagram of the network structure of the fourth embodiment of the present invention;
[0038] Figure 5 Schematic diagram of a mapping method between secret message segments and floating-point numbers according to a fifth embodiment of the present invention. DETAILED DESCRIPTION
[0039] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0040] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0041] Example 1
[0042] like Figure 1 As shown, this embodiment provides an image steganography method and system based on the NICE model, including an image steganography framework based on the NICE model. Unlike the GAN model, the generator G of the stream model is reversible. By reversing the structure of G and keeping the network parameters unchanged, its inverse model G can be obtained. -1 , G -1 The complex distribution of data samples can be mapped to latent space variables that satisfy the benchmark distribution. This feature is very suitable for the construction of carrier synthesis steganography system. Its basic framework is as follows Figure 1 shown.
[0043] First, design and build a NICE model, and then train the model on the selected image dataset. In this way, the model can learn the real image data distribution. and the benchmark distribution of the latent variable space The mapping relationship between them. At this time, the output data of the model's generator G , z is a latent space variable, Since the carrier synthesis image steganography based on the generative model is to generate the hidden variable directly into the secret image s by the generator, Then, by establishing a mapping relationship between the secret message m and the hidden variable z, the secret message m to be hidden is mapped to the corresponding hidden variable z, and the generator G of the input model can generate the corresponding secret image s. Since the model is reversible, the message extraction only needs to input the secret image into the inverse model G. -1 , we get the initial hidden variable z that generates this image, and then reversely map z through the mapping relationship to get the original message m. The carrier synthesis image steganography process based on the flow model can be formulated as:
[0044]
[0045]
[0046]
[0047] Among them, in formula (1) represents a one-to-one mapping from secret message m to latent variable z. The sender uses formula (1) to map secret message m to latent variable z, and then inputs z into the trained stream model generator G to obtain the secret image s, as shown in formula (2). The receiver inputs the secret image s into the inverse model G-1 to obtain the latent variable z, as shown in formula (3). Finally, formula (1) is used to recover the secret message m.
[0048] Example 2
[0049] like Figure 2 As shown, this embodiment provides an image steganography method and system based on the NICE model, including an image steganography method flow based on the NICE model.
[0050] The process is divided into two stages:
[0051] The first stage: build and train the NICE model on a given image dataset, so that the model can learn the mapping relationship between the real image data distribution and the latent variable space data distribution. After the training is completed, the reverse generator G of the model can be obtained. -1 , G -1 By building it in reverse (keeping the trained model parameters unchanged), we can get the forward generator G of the model. Then, design the secret message m and latent variables z The reversible mapping method between the generator G and the mapping method is distributed to the sender through a secret channel for the generation of the secret image; -1 The mapping method is distributed to the receiver through a secret channel for recovery of the secret message.
[0052] The second stage: The sender converts the secret message into m Mapped to a floating point arrayz , and then z Input G to generate a secret image s The receiver receives s Then, use G -1 Calculate the secret image s Floating point array in , and then reversely map the floating-point array according to the mapping method between message and hidden variable to restore the original message .
[0053] Example 3
[0054] like Figure 3 As shown, this embodiment provides an image steganography method and system based on the NICE model, including the NICE model.
[0055] 1) Model design
[0056] The core of the NICE model is its ingeniously designed coupling layer (Coupling Layer) reversible mapping structure. The following first introduces the design and improvement details of the model structure, and then introduces the model's loss function and training method.
[0057] Model structure
[0058] The NICE model is the core of this algorithm, and its basic structure mainly refers to the original NICE text, such as Figure 3 shown.
[0059] Where CL stands for Coupling Layer, M is a neural network. x1, x2 are the average divisions of the real image x data. , , D is the data dimension of x. In fact, the coupling layer defines a reversible mapping with the help of the neural network , which can complete the conversion from x to z. Figure 3 Each coupling layer in the subtraction operation rule is used, and a single coupling layer Defined as:
[0060]
[0061] Its inverse mapping Using the addition operation, each coupling layer is defined as:
[0062]
[0063] In order to enable the model to represent more complex data distribution and obtain higher image quality, this paper increases the number of coupling layers in the original paper (from 4 to 6) and adopts a cross-linear superposition of 6 coupling layers. The superposition of It constitutes the reverse generator of the NICE model. Its forward generator is 6 The superposition of .
[0064] Example 4
[0065] like Figure 4 As shown, this embodiment provides an image steganography method and system based on the NICE model, including a network structure of M.
[0066] Among them, FC stands for fully connected layer and the activation function is Relu.
[0067] In order to fully mix the information, each CL layer needs to exchange y1 and y2 as the input of the next CL layer (equivalent to splitting the output data of the CL layer in half and swapping them). To optimize the generated results, a scaling layer s is added to the last layer of the model, where s is a vector of the same dimension as the input vector. , D is the dimension of the input vector, and its parameters need to be trained simultaneously with the M parameters. The main function of the scaling layer is to identify the importance of information of different dimensions. The scaling layer operation can be defined as:
[0068]
[0069] Among them, y represents the output of the last CL, represents the Kronecker product.
[0070] Loss function and training method
[0071] The NICE model hopes to map Z-space samples that conform to a certain basic distribution (easy to sample and evaluate density function) into complex X-space (such as natural image sets) samples through an invertible mapping g. Naturally, X-space samples can be mapped through g -1 Mapped to Z space samples, that is:
[0072]
[0073] Usually neural network G is used to replace mapping g, then:
[0074]
[0075] in, ,and , Represents the data distribution in Z space; , , Represents the data distribution in X space.
[0076] The following change in variables formula describes how to evaluate the probability distribution of a random sample x, namely:
[0077]
[0078] in, is the data distribution of the real sample, z is the basic distribution The sampling in For mapping The Jacobian of
[0079] .
[0080] at this time, The log-likelihood function can be calculated using the following formula:
[0081]
[0082] By maximizing this log-likelihood function, Can be optimized and trained to obtain It is easy to get G, which is the generator that needs to be obtained in the end.
[0083] Since the benchmark distribution used in this paper is a standard normal distribution because:
[0084]
[0085] According to the design principle of the coupling layer, ,at this time:
[0086]
[0087] Substitute formula (11) and formula (12) into formula (9), so the objective function of the final model is:
[0088]
[0089] in, is the parameter that participates in the training in the last scaling layer s. According to this objective function, iterative sampling is performed from real image data. By maximizing this objective function, the training model can be gradually optimized. After the training is completed, the reverse generator of the model is first obtained. , and reversely build it (keeping the training network parameters unchanged) to obtain its forward generator G, G and They will serve as the secret image generator and secret message extractor in the steganography algorithm respectively.
[0090] Example 5
[0091] like Figure 5As shown, this embodiment provides an image steganography method and system based on the NICE model, including a mapping method between secret message segments and floating-point numbers.
[0092] In reality, different data types on computers have different precisions when representing data. When the actual data exceeds the representation range of the corresponding data type, errors will occur. In order for the model to accurately restore a piece of image data back to the floating-point number z, we must limit the effective calculation range of the mapped floating-point number so that the next step can accurately recover the secret message.
[0093] The basic idea is: given a secret message m, its binary data is divided into segments, assuming each n-bit segment is directly mapped to a decimal value. This segment then serves as the high-order portion of a (-1, 1) floating-point number, while the low-order portion is manually padded based on the model's computational precision. This ensures that even if numerical errors occur during the model's computation, the low-order portion of the floating-point data can be accurately mapped back to the binary message segment if the model's computational precision is carefully controlled so that the errors do not affect the high-order floating-point number.
[0094] The specific operation rules are as follows:
[0095] First, we need to calculate the secret message bit segment The corresponding decimal value:
[0096]
[0097] In formula (14), n is the length of the corresponding bit of the secret message segment, is the first j The value of bits, That is The decimal value of .
[0098] Then set the parameters a and c , use the following formula to get a random positive integer as the low-order part of the floating-point number:
[0099]
[0100] In formula (15) It means to take a random integer. .
[0101] Then according to formula (16), we can calculate the two parameters p , qThese two values actually control the division of high-order floating-point numbers and low-order floating-point numbers.
[0102]
[0103] in the formula It means to take an integer.
[0104] Finally, the mapped floating point number is calculated according to formula (17) :
[0105]
[0106] In formula (17) It is the high-order value of the floating-point number after binary data mapping. The low-order value of the floating-point number added manually. Provides random positive and negative signs for floating point numbers. is the floating point value after final mapping. This mapping method is equivalent to n Each binary bit is mapped to a floating-point number (-1, 1). Since the basic distribution of the NICE model is the standard normal distribution and the (-1, 1) interval is the area where the standard normal distribution data is most concentrated, the mapped data generally meets the numerical distribution requirements of the model's latent space variables and will not affect the quality of the generated image.
[0107] When reverse mapping, the receiver receives According to formulas (14)-(17), we can calculate and extract , and then After calculation according to formula (18), the secret message bit segment can be obtained .
[0108]
[0109] in, Indicates a binary value. The above mapping method can remove the calculation error when the hidden variable is calculated in reverse from the secret image, ensuring the accuracy of the model in extracting the secret message. It should be noted that in actual use, n 、 a 、 c The setting of parameters is the key, which needs to be set according to the results of model testing.
[0110] The above description is merely a preferred embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An image steganography method based on the NICE model, characterized in that: The following steps are involved: Build a NICE model and obtain an image dataset to train the NICE model; After training, the generator in the NICE model is reversed to obtain the extractor; Generate a secret image from the secret message based on the generator; Separating the secret message from the encrypted image based on the extractor to obtain the secret message; The process of building a NICE model and obtaining an image dataset to train the NICE model includes: Training the NICE model based on the image data to obtain a mapping relationship between the real image data and the latent variable space data distribution; After training, the generator in the NICE model is reverse-built to obtain the extractor, which includes: The parameters of the trained model remain unchanged, and the generator is reversed to obtain the extractor and the reversible mapping method between the secret message and the latent variable; The process of generating a secret image from a secret message based on the generator includes: Based on the mapping relationship between the secret message and the hidden variable, mapping the secret message to be hidden into a floating-point array; Based on the mapping relationship between the data distribution of the real image and the reference distribution of the latent variable space, the floating-point array is input into the generator to obtain a secret image; The process of extracting the secret message from the encrypted image based on the extractor and obtaining the secret message includes: Extracting a floating-point array from the encrypted image based on the extractor; Based on the mapping relationship between the secret message and the hidden variable, the obtained floating-point array is reversely mapped to restore the original information.
2. An image steganography system based on the NICE model, characterized in that: For implementing the image steganography method based on the NICE model as claimed in claim 1, the system comprises: Generator, used to generate a secret image; Extractor, used to extract the original information from the encrypted image.
3. The image steganography system based on the NICE model as claimed in claim 2, characterized in that: The generator is constructed based on the NICE model, including six forward cross-linear superposition coupling layers and a first neural network module.
4. The image steganography system based on the NICE model as claimed in claim 3, characterized in that: The extractor is constructed based on the NICE model, including six reverse cross-linear superposition coupling layers and a second neural network module.
5. The image steganography system based on the NICE model as claimed in claim 4, characterized in that: The first neural network module and the second neural network module both use 6 fully connected networks, and the activation function uses the Relu function.