GAN-based image steganography method, related method and device
Through the GAN-based image steganography method, a multi-level feature fusion architecture and an adaptive embedding mechanism are used to generate visually imperceptible secret images, which solves the problems of limited information volume and easy detection in existing technologies, achieves efficient information embedding and extraction, and improves anti-analysis capabilities and transmission reliability.
Patent Information
- Application Number
- CN202510769321.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-10-21
AI Technical Summary
Existing image steganography methods have limited information volume, low image quality and secret information extraction accuracy, are easily detected by steganalysis, and have insufficient anti-steganography capabilities.
A GAN-based image steganography method is adopted. The secret information matrix and the carrier image are adaptively embedded through the multi-level feature fusion architecture in the generator. The preset MECS module and ASPP module are used to optimize feature fusion to generate visually imperceptible secret images. The network is trained through the discriminator and extractor to improve the anti-analysis capability.
The comprehensive performance of image steganography has been significantly improved. The encrypted image is visually imperceptible and statistically invisible, effectively avoiding steganalysis detection, ensuring the extraction accuracy and transmission reliability of high-density information embedding, and providing secure communication protection.
Smart Images

Figure CN120825550A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image steganography technology, and in particular to a GAN-based image steganography method, related methods, and devices. Background Art
[0002] Image steganography is an information hiding method that uses digital images as a carrier to embed secret information by modifying their pixel values or other characteristics while maintaining the image's visual quality and imperceptibility. Its core goal is to achieve covert communication without arousing suspicion from observers or steganalysis systems. Traditional image steganography methods can be divided into three main categories: spatial domain methods (such as least significant bit replacement (LSB) and its variants, which directly modify the least significant bit of a pixel), transform domain methods (such as discrete cosine transform (DCT) and discrete wavelet transform (DWT), which modify transform domain coefficients), and adaptive (model-driven) methods (based on strategies such as content adaptation and distortion minimization, adaptively selecting embedding location and strength based on local image content characteristics).
[0003] Early spatial domain methods were simple to implement but had fixed modification patterns, while transform domain methods offered more dispersed modifications but often had globally fixed strategies. Both methods were prone to introducing statistically detectable traces. To address increasing security demands, research in this area has shifted to adaptive methods, which dynamically adjust embedding strategies to ensure that modification behavior is more consistent with the inherent characteristics of the carrier, significantly enhancing resistance to steganalysis. Summary of the Invention
[0004] In order to obtain a confidential image with higher concealment and anti-analysis capabilities, an embodiment of the present invention provides a GAN-based image steganography method, related methods, and devices.
[0005] In a first aspect, an embodiment of the present invention provides a GAN-based image steganography method, which may include: Obtain secret information matrix and carrier image; Inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image; the generator includes a first generation module, a second generation module, and a third generation module connected together; the first generation module and the second generation module both include a preset MECS module and a convolution block connected together; the third generation module includes a preset MECS module, a convolution layer, and an ASPP module connected together; The step of inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image includes: Performing a convolution operation on the carrier image to obtain a first hidden feature; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain a second hidden feature; Inputting the secret information matrix, the first hidden feature, and the second hidden feature into the second generation module to obtain a third hidden feature; Inputting the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into the third generation module to obtain a fourth hidden feature; A pixel-by-pixel addition is performed based on the fourth hidden feature and the carrier image to obtain a hidden image.
[0006] In one or some optional implementations of the embodiments of the present application, the preset MECS module includes a preset channel attention module and a preset spatial attention module; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain the second hidden feature includes: Concatenating the secret information matrix and the first hidden feature to obtain a first intermediate feature; Inputting the first intermediate feature into the preset channel attention module to obtain a channel attention optimized feature; Inputting the channel attention optimization feature into the preset spatial attention module to obtain the spatial attention optimization feature; the preset spatial attention module includes a parallel multi-scale dilated convolution layer; Performing element-by-element multiplication on the channel attention optimization feature and the spatial attention optimization feature to obtain a second intermediate feature; The second intermediate feature is input into the convolution block to obtain a second hidden feature.
[0007] In one or some optional implementations of the embodiment of the present application, the preset image steganographic network is obtained by: Obtaining an initial image steganography network and a training set; the initial image steganography network includes a generator, a discriminator, and an extractor; Inputting the secret information matrix and the carrier image in the training set into the generator to obtain a predicted image; Inputting the predicted image into the discriminator to obtain a discrimination result; Inputting the predicted image into the extractor to obtain an extraction result; According to the secret information matrix, the carrier image, the predicted image, the discrimination result and the extraction result, based on a preset joint loss function, the generator, the discriminator and the extractor in the initial image steganography network are updated to obtain an updated image steganography network; Repeat the above network training process until the preset stopping condition is reached to obtain the preset image steganography network.
[0008] In one or some optional implementations of the embodiment of the present application, the extractor includes a first extraction module, a second extraction module, a third extraction module and a convolution block connected; the first extraction module, the second extraction module and the third extraction module each include a connected convolution block and a preset MECS module; The step of inputting the predicted image into the extractor to obtain an extraction result comprises: Inputting the predicted image into the first extraction module to obtain a fifth hidden feature; Inputting the fifth hidden feature into the second extraction module to obtain a sixth hidden feature; Inputting the fifth hidden feature and the sixth hidden feature into the third extraction module to obtain a seventh hidden feature; The fifth hidden feature, the sixth hidden feature, and the seventh hidden feature are input into the convolution block to obtain an extraction result.
[0009] In one or some optional implementations of the embodiment of the present application, obtaining the secret information matrix and the carrier image includes: The obtained secret information bit stream is stacked and repeated according to a preset length to obtain a secret information matrix; The randomly acquired original image is center-cropped according to the preset length to obtain a carrier image.
[0010] In a second aspect, an embodiment of the present invention provides a GAN-based image steganographic extraction method. The secret image and the preset image steganographic network obtained using the above-mentioned GAN-based image steganographic method may include: The secret image is input into the discriminator in the preset image steganography network, and the discriminator determines whether the secret image is secret based on the output of the discriminator: If yes, input the secret image into the extractor in the preset image steganography network to obtain a secret information matrix, and restore the secret information matrix to obtain a secret information bit stream; If not, the encrypted image is discarded.
[0011] In a third aspect, an embodiment of the present invention provides a GAN-based image steganography device, which may include: A first acquisition module is used to obtain the secret information matrix and the carrier image; An image steganography module is configured to input the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image; the generator includes a first generation module, a second generation module, and a third generation module connected together; the first generation module and the second generation module both include a preset MECS module and a convolution block connected together; the third generation module includes a preset MECS module, a convolution layer, and an ASPP module connected together; The step of inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image includes: Performing a convolution operation on the carrier image to obtain a first hidden feature; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain a second hidden feature; Inputting the secret information matrix, the first hidden feature, and the second hidden feature into the second generation module to obtain a third hidden feature; Inputting the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into the third generation module to obtain a fourth hidden feature; A pixel-by-pixel addition is performed based on the fourth hidden feature and the carrier image to obtain a hidden image.
[0012] In a fourth aspect, an embodiment of the present invention provides a GAN-based image steganographic extraction device, which may include: The second acquisition module is used to obtain the secret image and the preset image steganographic network; The discriminant extraction module is configured to input the secret image into a discriminator in the preset image steganography network, and determine whether the secret image is secret based on the output of the discriminator. If so, the secret image is input into an extractor in the preset image steganography network to obtain a secret information matrix, and the secret information matrix is restored to obtain a secret information bit stream. If not, the secret image is discarded.
[0013] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the GAN-based image steganography method and / or the GAN-based image steganography extraction method as described above.
[0014] In a sixth aspect, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the GAN-based image steganography method and / or the GAN-based image steganography extraction method as described above. In a seventh aspect, an embodiment of the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the GAN-based image steganography method and / or the GAN-based image steganography extraction method as described above. The beneficial effects of the above technical solutions provided by the embodiments of the present invention include at least: An embodiment of the present invention provides a GAN-based image steganography method. The method obtains an output secret image by inputting a secret information matrix and a carrier image into a generator in a preset image steganography network. Specifically, a first hidden feature is extracted based on a convolution operation. Subsequently, the secret information matrix is gradually fused with each level of previous hidden features through multiple groups of generation modules including preset MECS modules, convolution blocks or ASPP modules, and finally a fourth hidden feature is obtained. The fourth hidden feature is then added pixel by pixel to the carrier image to obtain the secret image. This method significantly improves the comprehensive performance of image steganography through an innovative network architecture. It implements an adaptive embedding mechanism for image steganography through a generator, allowing secret information to be integrated into the visual redundancy of the carrier image in a highly diffuse state. At the same time, the generator's multi-level feature fusion architecture simultaneously achieves collaborative optimization of high load and high fidelity, breaking through the traditional capacity bottleneck while significantly eliminating visual distortion, ensuring the visual imperceptibility and statistical invisibility of the secret image, and effectively circumventing deep learning-based steganalysis detection, greatly improving the anti-steganography analysis capability and transmission reliability of the secret image, ensuring that even in the case of high-density information embedding, a high extraction accuracy can be maintained, providing effective protection for secure communications.
[0015] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0016] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 A schematic diagram of the process of the GAN-based image steganography method provided in an embodiment of the present invention; Figure 2 A structural diagram of a preset image steganography network provided by an embodiment of the present invention; Figure 3 An architectural diagram of a preset MECS module provided in an embodiment of the present invention; Figure 4 A schematic diagram of the process of a GAN-based image steganographic extraction method provided in an embodiment of the present invention; Figure 5 A schematic diagram of the structure of a GAN-based image steganography device provided in an embodiment of the present application; Figure 6A schematic diagram of the structure of a GAN-based image steganographic extraction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0019] The inventors discovered that existing image steganography methods process multimedia data to embed secret information into images, thereby enabling the transmission of secret information over public channels. However, due to inherent limitations, these methods typically can only carry a limited amount of information, and the quality of the encrypted image and the accuracy of secret information extraction are low, often resulting in noticeable image distortion visible to the naked eye. Furthermore, researchers in the field of steganalysis have proposed numerous image steganalysis algorithms that detect abnormal statistical characteristics of image data to uncover secret information, but these algorithms also face significant challenges in resisting steganography. Based on this, the inventors, through further research and development, developed the present invention, which provides a GAN-based image steganography method, related methods, and apparatus.
[0020] Example 1 In the first embodiment of the present invention, a GAN-based image steganography method is provided. Figure 1 As shown, the method may include the following steps S101-S102: S101: Obtain secret information matrix and carrier image.
[0021] S102: Input the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image; the generator includes a first generation module, a second generation module, and a third generation module connected together; the first generation module and the second generation module both include a preset MECS module and a convolution block connected together; the third generation module includes a preset MECS module, a convolution layer, and an ASPP module connected together; the above step S102 specifically includes the following steps S1021-S1025: S1021: Perform a convolution operation on the carrier image to obtain a first hidden feature.
[0022] S1022: Input the secret information matrix and the first hidden feature into the first generation module to obtain the second hidden feature.
[0023] S1023: Input the secret information matrix, the first hidden feature, and the second hidden feature into a second generation module to obtain a third hidden feature.
[0024] S1024: Input the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into a third generation module to obtain a fourth hidden feature.
[0025] S1025: Perform pixel-by-pixel addition based on the fourth hidden feature and the carrier image to obtain a hidden image.
[0026] An embodiment of the present invention provides a GAN-based image steganography method. The method obtains an output secret image by inputting a secret information matrix and a carrier image into a generator in a preset image steganography network. Specifically, a first hidden feature is extracted based on a convolution operation. Subsequently, the secret information matrix is gradually fused with each level of previous hidden features through multiple groups of generation modules including preset MECS modules, convolution blocks or ASPP modules, and finally a fourth hidden feature is obtained. The fourth hidden feature is then added pixel by pixel to the carrier image to obtain the secret image. This method significantly improves the comprehensive performance of image steganography through an innovative network architecture. It implements an adaptive embedding mechanism for image steganography through a generator, allowing secret information to be integrated into the visual redundancy of the carrier image in a highly diffuse state. At the same time, the generator's multi-level feature fusion architecture simultaneously achieves collaborative optimization of high load and high fidelity, breaking through the traditional capacity bottleneck while significantly eliminating visual distortion, ensuring the visual imperceptibility and statistical invisibility of the secret image, and effectively circumventing deep learning-based steganalysis detection, greatly improving the anti-steganography analysis capability and transmission reliability of the secret image, ensuring that even in the case of high-density information embedding, a high extraction accuracy can be maintained, providing effective protection for secure communications.
[0027] In the above step S101, the secret information matrix and the carrier image are obtained.
[0028] Specifically, the secret information string to be hidden can be converted to a specific encoding (such as ASCII encoding) to obtain a string of '0's and '1's. This string is then stacked and repeated to form a secret information matrix with a shape of Depth × preset length × preset length. The preset length can be set to 256, and the Depth is set accordingly based on the length of the secret information string.
[0029] A random original image is selected and the center of the original image is cropped according to the preset length to obtain the carrier image. If the preset length is set to 256, the pixel size of the carrier image is 256×256.
[0030] In the above step S102, the obtained secret information matrix and the carrier image are input into the generator of the preset image steganography network to obtain the secret image. The above step S102 specifically includes the following steps S1021-S1025: In order to facilitate those skilled in the art to understand this solution, the following will briefly introduce the structure of the preset image steganographic network. The structure of the preset image steganographic network is as follows: Figure 2 As shown, it includes generator G, extractor E and discriminator D.
[0031] The generator G includes a first generation module, a second generation module and a third generation module connected, wherein the first generation module and the second generation module both include a connected preset MECS module and a convolution block, and the third generation module includes a connected preset MECS module, a convolution layer and an ASPP module.
[0032] The extractor E includes a first extraction module, a second extraction module, a third extraction module and a convolution block that are connected, wherein the first extraction module, the second extraction module and the third extraction module all include a connected convolution block and a preset MECS module.
[0033] The discriminator D can be designed as a convolutional neural network or SRNet, XuNet and YeNet that can be used for steganalysis, which is not specifically limited here.
[0034] S1021: Perform a convolution operation on the carrier image to obtain a first hidden feature.
[0035] Specifically, the carrier image can be subjected to a convolution operation to generate a high-channel feature map, which is called the first hidden feature, that is, Figure 2 The convolution operation can be implemented based on the basic convolution layer or an open source network (such as VGG), without any specific limitation here.
[0036] S1022: Input the secret information matrix and the first hidden feature into the first generation module to obtain the second hidden feature. The first generation module includes a connected preset MECS module and a convolution block. Step S1022 specifically includes the following steps S10221-10125: In order to facilitate those skilled in the art to understand this solution, the following briefly introduces the structure of the preset MECS module with reference to the illustrations. The structure diagram of the preset MECS module is as follows: Figure 3 As shown, it includes a preset channel attention module and a preset spatial attention module, namely Figure 3The Channel Attention and Spatial Attention in the CNN are: the preset channel attention module includes parallel average pooling (AvgPool) layer, maximum pooling (MaxPool) layer, median enhanced pooling (MedianPool) layer, and connected convolutional layer, ReLU activation layer, convolutional layer and sigmoid activation layer; the preset spatial attention module includes connected convolutional layer and parallel multi-scale void convolution layer (Multi-depthconv).
[0037] S10221: Concatenate the secret information matrix and the first hidden feature to obtain a first intermediate feature.
[0038] Specifically, the secret information matrix and the first hidden feature are concatenated to obtain the first intermediate feature as the input of the preset MECS module, that is, Figure 3 Input Feature in .
[0039] S10222: Input the first intermediate feature into a preset channel attention module to obtain a channel attention optimization feature.
[0040] Specifically, the intermediate features can be simultaneously input into the average pooling layer, the maximum pooling layer, and the median enhanced pooling layer in the preset channel attention module, and the outputs of the three pooling layers are respectively passed through a preset convolution module, and the three outputs are element-wise added (Pixel-wise Addition) to obtain the channel attention weight, that is, Figure 3 The Channel-wiseAttention in , multiplies the channel attention weight by the first intermediate feature element by element (Pixel-wise Product), and obtains the channel attention optimization feature, that is Figure 3 RefinedChannel Features in .
[0041] Among them, the preset convolution module includes a connected convolution layer, a ReLU activation layer, a convolution layer and a sigmoid activation layer.
[0042] S10223: Input the channel attention optimization feature into the preset spatial attention module to obtain the spatial attention optimization feature.
[0043] Specifically, the channel attention optimization feature is input into the convolution layer in the preset spatial attention module to obtain the output third intermediate feature, the third intermediate feature is input into the parallel multi-scale void convolution layer, and the feature output by the parallel multi-scale void convolution layer is added to the third intermediate feature element by element to obtain the spatial attention optimization feature.
[0044] S10224: Perform element-by-element multiplication based on the channel attention optimization feature and the spatial attention optimization feature to obtain the second intermediate feature.
[0045] Specifically, the spatial attention optimization feature is calculated by 1D convolution and then multiplied element-by-element with the channel attention optimization feature to obtain the second intermediate feature, that is, Figure 3 Output Feature in .
[0046] S10225: Input the second intermediate feature into the convolution block to obtain the second hidden feature.
[0047] Specifically, the second intermediate feature output by the preset MECS module can be input into the convolution block to obtain the second hidden feature. The convolution block in this step is Figure 2 ConvBlock in the orange block of the generator. The convolution block includes a series of ordered operation layers, including but not limited to convolution layers, batch normalization layers, activation function layers, and pooling layers.
[0048] In the embodiment of the present application, the above-mentioned preset MECS module can significantly optimize the feature fusion efficiency through the dual attention mechanism. The channel attention module integrates average pooling, maximum pooling and median enhanced pooling to comprehensively capture the feature distribution and suppress the interference of outliers. The generated channel weights accurately strengthen the key information area. The spatial attention module adopts a multi-scale hole convolution layer to enhance the adaptive adjustment ability of local areas while retaining feature details. The two work together to make the fusion process of the secret information matrix and image features deeply fit the statistical characteristics of the carrier, effectively avoid the statistical anomaly traces caused by traditional methods, significantly improve the concealment and anti-analysis robustness of the steganographic operation, and provide core support for high-security communications.
[0049] S1023: Input the secret information matrix, the first hidden feature, and the second hidden feature into a second generation module to obtain a third hidden feature.
[0050] Among them, the second generation module is Figure 2 Green square in the generator.
[0051] S1024: Input the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into a third generation module to obtain a fourth hidden feature.
[0052] Among them, the third generation module is Figure 2 The blue block in the generator.
[0053] In this embodiment, the multi-scale dilated convolution in the ASPP module enhances the environmental adaptability of stegoscopy image generation, enabling precise capture of multi-scale contextual features and effectively addressing the limitations of feature representation caused by a single scale. This design allows the information embedding process to deeply align with the natural structural characteristics of the image, significantly improving the spatial consistency of the stegoscopy region, avoiding local distortion, and enhancing statistical invisibility, providing key support for high-fidelity steganography.
[0054] S1025: Perform pixel-by-pixel addition based on the fourth hidden feature and the carrier image to obtain a hidden image.
[0055] In the embodiment of the present application, the generator in the present method achieves a breakthrough improvement in steganographic performance through a multi-level adaptive fusion architecture. The multi-scale basic features of the carrier image, namely the first hidden feature, are extracted through convolution operations, and then multiple generation modules are designed based on the preset MECS module and convolution block to form a progressive fusion path: the preset MECS module uses a channel-space dual attention mechanism to fuse median enhancement pooling and multi-scale dilated convolution, dynamically optimizes the fusion weights of secret information and image features, and makes the embedding behavior deeply fit the statistical characteristics of the carrier, significantly avoiding the statistical anomalies caused by traditional fixed patterns. The terminal ASPP module uses multi-scale dilated convolution to simultaneously enhance the local detail retention and global context perception capabilities, combined with the pixel-by-pixel residual connection of the fourth hidden feature and the original carrier, to achieve high-capacity embedding while ensuring that the secret image is visually lossless and has strong spatial consistency, and comprehensively optimizes the concealment and anti-analysis properties.
[0056] In the embodiment of the present application, the preset image steganographic network is obtained through the following step S103, which specifically includes steps S1031-S1036: S1031: Obtain an initial image steganography network and training set.
[0057] The initial image steganography network includes a generator, a discriminator, and an extractor. The training set includes multiple carrier images and multiple secret information matrices.
[0058] S1032: Input the secret information matrix and carrier image in the training set into the generator to obtain a predicted image.
[0059] In the embodiment of the present application, step S1032 of inputting the secret information matrix and the carrier image in the training set into the generator to obtain the predicted image is consistent with the above-mentioned step S102 of inputting the secret information matrix and the carrier image into the generator in the preset image steganography network to obtain the secret image, and will not be repeated here.
[0060] S1033: Input the predicted image into the discriminator to obtain the discrimination result.
[0061] Among them, the discriminator is used to evaluate the authenticity and quality of the predicted image. The output discrimination result is a value between 0 and 1. The larger the value, the more realistic the predicted image is and the higher the quality.
[0062] S1034: Input the predicted image into the extractor to obtain an extraction result. The extractor includes a first extraction module, a second extraction module, a third extraction module, and a convolution block. The first extraction module, the second extraction module, and the third extraction module all include a convolution block and a preset MECS module. Step S1034 specifically includes the following steps S10341-S10344: S10341: Input the predicted image into the first extraction module to obtain the fifth hidden feature. Figure 2 The orange block in the extractor.
[0063] Specifically, the predicted image may be input into the convolution block in the first extraction module to obtain the fourth intermediate feature, and then the fourth intermediate feature may be input into the preset MECS module in the first extraction module to obtain the fifth hidden feature. The step of inputting the fourth intermediate feature into the preset MECS module to obtain the fifth hidden feature is consistent with the step of inputting the first intermediate feature into the preset MECS module to obtain the second intermediate feature described in steps S10222-S10224 above, and is not further described here.
[0064] S10342: Input the fifth hidden feature into the second extraction module to obtain the sixth hidden feature. Figure 2 Green blocks in the extractor.
[0065] S10343: Input the fifth hidden feature and the sixth hidden feature into the third extraction module to obtain the seventh hidden feature. Figure 2 ConvBlock and MECS in the blue square of the extractor.
[0066] S10344: Input the fifth hidden feature, the sixth hidden feature, and the seventh hidden feature into the convolution block to obtain an extraction result.
[0067] Among them, the convolution block is Figure 2 The ConvBlock on the rightmost side of the blue block in the extractor includes a series of ordered operation layers, including but not limited to convolutional layers, batch normalization layers, activation function layers, and pooling layers.
[0068] S1035: According to the secret information matrix, the carrier image, the predicted image, the discrimination result and the extraction result, based on the preset joint loss function, the generator, the discriminator and the extractor in the initial image steganography network are updated to obtain an updated image steganography network.
[0069] Specifically, it can be that based on the secret information matrix, the carrier image, the predicted image output by the generator, the judgment result output by the discriminator and the restoration result restored by the extractor, based on the preset joint loss function, the parameters in the generator, discriminator and extractor are synchronously updated through back propagation, so that the generator and extractor minimize the preset joint loss function, and the discriminator maximizes the difference in the discrimination results.
[0070] To effectively train the initial image steganalysis network, this method designs four loss terms for the generator and extractor: embedding loss, recovery loss, adversarial loss, and perceptual loss, as well as a discriminator loss for the discriminator. Each loss term will be explained in detail below.
[0071] Embedding loss is used to train the generator by embedding the secret information matrix into the carrier image, generating a predicted image that is virtually indistinguishable from the carrier image to the naked eye. Because it is almost impossible to distinguish between the carrier image and the predicted image, this method uses image distortion loss as the embedding loss. The embedding loss is expressed as follows: Where, represents the embedding loss, MSE is the mean square error, X is the carrier image, S To predict the image, C is the number of channels of the carrier image, H is the height of the carrier image, W is the width of the carrier image, Calculated as the square of the L2 norm.
[0072] Recovery Loss is used to train the extractor to extract secret information from the predicted image. The recovered secret information should be close to the secret information matrix. Recovery loss is shown in Formula 2 below: Where, Recovering losses, Depth 、 H and W are the depth, height and width of the secret information matrix respectively, is the first i values, The first secret information extracted by the extractor i values, is the logarithm operation with base 2. After the training is completed, Needs to be rounded to 0 or 1 to construct the extracted secret information.
[0073] The purpose of the adversarial loss is to train the generator, so that it updates in the direction of producing high-quality predicted images that the discriminator identifies as high-quality. Therefore, this method uses the discriminator's judgment of the predicted image as the adversarial loss of the generator. The adversarial loss is shown in the following formula 3: Where, Represents resistance to loss, D is the discriminator, To predict the image, is the discriminator's judgment result on the predicted image output.
[0074] Perceptual loss is used to train the generator. In this method, the generator's role is not only to produce an image that is almost indistinguishable from the carrier image to the naked eye, but also to maintain a very low detection rate when facing hidden analysis. Therefore, this method inputs the predicted image into an open-source pre-trained VGG16 (Visual Geometry Group 16-layer) network and minimizes the difference between the characteristics of the carrier image and the predicted image at multiple depths. Perceptual loss is shown in the following formula 4: Where, represents the perceived loss, MSE is the mean square error, X is the carrier image, S To predict the image, VGG It is an open source pre-trained VGG16 network.
[0075] Combining the above embedding loss, recovery loss, adversarial loss and perceptual loss, the preset joint loss function corresponding to the generator and extractor can be obtained as shown in the following formula 5: Where, represents the preset joint loss function corresponding to the generator and extractor, represents the embedding loss, Recovering losses, Represents resistance to loss, represents the perceived loss, 、 、 and are the weights corresponding to embedding loss, recovery loss, adversarial loss and perceptual loss respectively. 、 、 and They can be exemplarily set to 1, 1, 100 and 1 respectively.
[0076] The discriminator loss is used to train the discriminator. The discriminator outputs a result close to 0 when it encounters a carrier image and a result close to 1 when it encounters a secret image. The perceptual loss is shown in the following formula 6: Where, represents the discriminator loss, D is the discriminator, X is the carrier image, To predict the image, is the discriminator’s discriminant result for the carrier image output, is the discriminator's judgment result on the predicted image output.
[0077] In the embodiment of the present application, the preset joint loss function significantly improves the overall performance of the steganography system through multi-objective collaborative optimization. Among them, the embedding loss ensures the visual consistency of the secret image and the original carrier, the recovery loss ensures the complete extraction of the secret information, the adversarial loss enhances the ability of the generated image to resist detection, and the perceptual loss further optimizes the concealment through deep feature matching. The four losses are combined through a weighted combination to form a joint optimization goal, so that the generator can achieve strong anti-analysis capabilities while maintaining high fidelity, and ultimately build an image steganography system with excellent concealment, robustness, and security.
[0078] S1036: Repeat the above network training process until the preset stopping condition is reached to obtain a preset image steganography network.
[0079] The preset stopping condition may be reaching a fixed number of iterations or the accuracy of the generator reaching a threshold, etc., which is not specifically limited here.
[0080] Example 2 Based on the same inventive concept, the embodiment of the present invention also provides an image steganographic extraction method based on GAN, referring to Figure 4 As shown, the method includes: S201: Obtaining a secret image and a preset image steganographic network; S202: Input the secret image into the discriminator in the preset image steganography network, and determine whether the secret image is secret based on the output of the discriminator: if so, execute step S203; if not, execute step S204; S203: Inputting the secret image into the extractor in the preset image steganography network to obtain a secret information matrix, and restoring the secret information matrix to obtain a secret information bit stream; S204: Discard the secret image.
[0081] Example 3 Based on the same inventive concept, the embodiment of the present invention also provides an image steganography device based on GAN, referring to Figure 5 As shown, the device includes: A first acquisition module 101 is used to acquire a secret information matrix and a carrier image; The image steganography module 102 is configured to input the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image; the generator includes a first generation module, a second generation module, and a third generation module connected together; the first generation module and the second generation module both include a preset MECS module and a convolution block connected together; the third generation module includes a preset MECS module, a convolution layer, and an ASPP module connected together; The step of inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image includes: Performing a convolution operation on the carrier image to obtain a first hidden feature; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain a second hidden feature; Inputting the secret information matrix, the first hidden feature, and the second hidden feature into the second generation module to obtain a third hidden feature; Inputting the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into the third generation module to obtain a fourth hidden feature; A pixel-by-pixel addition is performed based on the fourth hidden feature and the carrier image to obtain a hidden image.
[0082] Example 4 Based on the same inventive concept, the embodiment of the present invention also provides an image steganographic extraction device based on GAN, referring to Figure 6 As shown, the device includes: The second acquisition module 201 is used to acquire the encrypted image and the preset image steganographic network; The discriminant extraction module 202 is configured to input the secret image into the discriminator in the preset image steganography network, and determine whether the secret image is secret based on the output of the discriminator. If so, the secret image is input into the extractor in the preset image steganography network to obtain a secret information matrix, and then restore the secret information matrix to obtain a secret information bit stream. If not, the secret image is discarded.
[0083] Example 5 Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the GAN-based image steganography method described in the first embodiment and / or the GAN-based image steganographic extraction method described in the second embodiment are implemented.
[0084] Example 6 Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the GAN-based image steganography method described in the above embodiment 1 and / or the GAN-based image steganographic extraction method described in the above embodiment 2.
[0085] Example 7 Based on the same inventive concept, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the GAN-based image steganography method described in the above embodiment 1 and / or the GAN-based image steganographic extraction method described in the above embodiment 2.
[0086] Those skilled in the art will appreciate 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 aspects. 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 and optical storage) containing computer-usable program code.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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 GAN-based image steganography method, characterized in that: include: Obtain secret information matrix and carrier image; Inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image; the generator includes a first generation module, a second generation module, and a third generation module connected together; the first generation module and the second generation module both include a preset MECS module and a convolution block connected together; the third generation module includes a preset MECS module, a convolution layer, and an ASPP module connected together; The step of inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image includes: Performing a convolution operation on the carrier image to obtain a first hidden feature; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain a second hidden feature; Inputting the secret information matrix, the first hidden feature, and the second hidden feature into the second generation module to obtain a third hidden feature; Inputting the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into the third generation module to obtain a fourth hidden feature; A pixel-by-pixel addition is performed based on the fourth hidden feature and the carrier image to obtain a hidden image.
2. The method according to claim 1, characterized in that The preset MECS module includes a preset channel attention module and a preset spatial attention module; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain the second hidden feature includes: Concatenating the secret information matrix and the first hidden feature to obtain a first intermediate feature; Inputting the first intermediate feature into the preset channel attention module to obtain a channel attention optimized feature; Inputting the channel attention optimization feature into the preset spatial attention module to obtain the spatial attention optimization feature; the preset spatial attention module includes a parallel multi-scale dilated convolution layer; Performing element-by-element multiplication on the channel attention optimization feature and the spatial attention optimization feature to obtain a second intermediate feature; The second intermediate feature is input into the convolution block to obtain a second hidden feature.
3. The method according to claim 1, characterized in that The preset image steganography network is obtained by the following method: Obtaining an initial image steganography network and a training set; the initial image steganography network includes a generator, a discriminator, and an extractor; Inputting the secret information matrix and the carrier image in the training set into the generator to obtain a predicted image; Inputting the predicted image into the discriminator to obtain a discrimination result; Inputting the predicted image into the extractor to obtain an extraction result; According to the secret information matrix, the carrier image, the predicted image, the discrimination result and the extraction result, based on a preset joint loss function, the generator, the discriminator and the extractor in the initial image steganography network are updated to obtain an updated image steganography network; Repeat the above network training process until the preset stopping condition is reached to obtain the preset image steganography network.
4. The method according to claim 3, characterized in that The extractor includes a first extraction module, a second extraction module, a third extraction module and a convolution block connected; the first extraction module, the second extraction module and the third extraction module each include a connected convolution block and a preset MECS module; The step of inputting the predicted image into the extractor to obtain an extraction result comprises: Inputting the predicted image into the first extraction module to obtain a fifth hidden feature; Inputting the fifth hidden feature into the second extraction module to obtain a sixth hidden feature; Inputting the fifth hidden feature and the sixth hidden feature into the third extraction module to obtain a seventh hidden feature; The fifth hidden feature, the sixth hidden feature, and the seventh hidden feature are input into the convolution block to obtain an extraction result.
5. The method according to claim 1, wherein The obtaining of the secret information matrix and the carrier image comprises: The obtained secret information bit stream is stacked and repeated according to a preset length to obtain a secret information matrix; The randomly acquired original image is center-cropped according to the preset length to obtain a carrier image.
6. A GAN-based image steganographic extraction method, characterized in that: include: Obtain the secret image and the preset image steganographic network; The secret image is input into the discriminator in the preset image steganography network, and the discriminator determines whether the secret image is secret based on the output of the discriminator: If yes, input the secret image into the extractor in the preset image steganography network to obtain a secret information matrix, and restore the secret information matrix to obtain a secret information bit stream; If not, the encrypted image is discarded.
7. A GAN-based image steganography device, characterized in that: include: A first acquisition module is used to obtain the secret information matrix and the carrier image; An image steganography module is configured to input the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image; the generator includes a first generation module, a second generation module, and a third generation module connected together; the first generation module and the second generation module both include a preset MECS module and a convolution block connected together; the third generation module includes a preset MECS module, a convolution layer, and an ASPP module connected together; The step of inputting the secret information matrix and the carrier image into a generator in a preset image steganography network to obtain a secret image includes: Performing a convolution operation on the carrier image to obtain a first hidden feature; Inputting the secret information matrix and the first hidden feature into the first generation module to obtain a second hidden feature; Inputting the secret information matrix, the first hidden feature, and the second hidden feature into the second generation module to obtain a third hidden feature; Inputting the secret information matrix, the first hidden feature, the second hidden feature, and the third hidden feature into the third generation module to obtain a fourth hidden feature; A pixel-by-pixel addition is performed based on the fourth hidden feature and the carrier image to obtain a hidden image.
8. A GAN-based image steganographic extraction device, characterized in that: include: The second acquisition module is used to obtain the secret image and the preset image steganographic network; The discriminant extraction module is configured to input the secret image into a discriminator in the preset image steganography network, and determine whether the secret image is secret based on the output of the discriminator. If so, the secret image is input into an extractor in the preset image steganography network to obtain a secret information matrix, and the secret information matrix is restored to obtain a secret information bit stream. If not, the secret image is discarded.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the GAN-based image steganography method according to any one of claims 1 to 5 and / or the GAN-based image steganography extraction method according to claim 6 are implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the GAN-based image steganography method according to any one of claims 1 to 5, and / or the GAN-based image steganography extraction method according to claim 6.