1. Introduction
Digital steganography, due to its unique advantages in covert communication and privacy protection, is increasingly emerging as a vital supplement to cryptography and has attracted significant research attention in recent years [
1]. Deep learning has profoundly transformed the field of computer vision, enabling breakthroughs in tasks ranging from image classification and object detection to sophisticated image generation and manipulation. Among these advancements, Neural Style Transfer (NST) [
2,
3,
4] has emerged as a particularly impactful and popular application, allowing for the creation of artistic images by merging the content of one image with the stylistic elements of another. The widespread sharing of such style-transferred images across social media platforms has made them a novel and prevalent form of digital media, presenting a unique opportunity for covert communication.
Traditional image steganography techniques typically modify selected pixel values in a cover image using predefined distortion functions governed by handcrafted heuristic rules. Early non-adaptive methods, such as LSB (Least Significant Bit) replacement and its variants, directly alter pixel bits to embed secrets [
5,
6]. However, these approaches introduce detectable artifacts, including value-pair effects and statistical inconsistencies, making them vulnerable to basic steganalysis like chi-square tests. To enhance security, adaptive steganography emerged, assigning varying embedding costs to pixels based on regional complexity. Algorithms like STC [
7] optimized distortion minimization and detection resistance by embedding secrets in noisy regions. Despite these advancements, traditional methods still rely on manual distortion rules and heuristic feature engineering to guide modifications. This dependence on human-crafted strategies limits their ability to fully conceal subtle embedding traces, leaving them susceptible to modern deep learning-based steganalysis tools that exploit imperceptible statistical patterns.
Deep steganography leverages neural networks to embed secret data into cover media while preserving perceptual imperceptibility. Using an encoder–decoder framework, the encoder merges secret data with a cover to produce a stego, while the decoder extracts hidden information [
8]. Adversarial training optimizes concealment and reconstruction accuracy, enabling adaptive embedding tailored to cover characteristics [
9]. Compared to traditional steganography, deep learning-based steganography has significantly improved in terms of hiding capacity and anti-detection capabilities. However, a critical issue remains unresolved: the masking effect of the steganographic act itself. To conduct covert communication, senders frequently transmit steganographic images to receivers. This pattern of behavior makes them vulnerable to detection by steganalysts, leading to communication failure.
Consequently, researchers have turned their attention to style transfer technology for implementing covert communication. Since social networks are flooded with stylized images, hiding messages within them and publishing these images on social media platforms allows receivers to download and extract the messages. This approach significantly enhances the concealment of steganographic communication. Wang et al. introduced STNet [
10], embedding secrets in style features via AdaIN and VGG for artistic steganography. Li et al. [
11] presented a GAN method inserting data post-first convolution for 1bpp capacity. Shi et al. [
12] developed a scheme with VGG19-based networks to embed secrets during style transfer. Zheng et al. [
13] proposed inserting secrets at the decoder’s upsampling layer with atrous convolution by optimizing latent space dimensions. However, these methods share critical limitations: (1) insufficient consideration of distortion risks in OSNs, which reduces message extraction accuracy; (2) low artistic quality in generated style images containing secrets, where repeated transmission of inferior stylized media raises suspicion; (3) failure to leverage existing deep learning-based steganalyzers for adversarial training, resulting in limited improvement in detection resistance.
Therefore, in order to solve the above problems of existing image steganography based on style transfer, this paper proposes robust steganography via style transfer in OSNs, called StegTransfer. The main contributions are summarized below:
This paper critically re-examines the practical limitations of style transfer-based steganography and proposes a novel algorithm to address these challenges.
The distortion patterns inherent in OSNs were systematically analyzed, and a forward noise stimulation module was developed to mitigate the insufficient simulation of non-differentiable distortions in training frameworks.
To enhance robustness against deep learning-based steganalyzers, a XuNet-based steganalysis discriminator was constructed and integrated into the unified framework for end-to-end adversarial training.
For the first time, a module capable of enhancing the aesthetic quality of steganographic images was introduced in style transfer-based steganography, and a quantitative evaluation was conducted during the experimental process.
The remainder of this paper is organized as follows:
Section 2 reviews related work in deep steganography and style transfer-based data hiding.
Section 3 details the architecture and training strategy of the proposed StegTransfer framework. Experimental setup, results, and comparative analyses are presented in
Section 4. Finally,
Section 5 concludes the paper and suggests future research directions.
3. Proposed Scheme
In this section, we describe the proposed StegTransfer model.
Figure 1 illustrates the overall framework, which consists of five components. The primary objective of our scheme is to train a generator and an extractor. The generator aims to produce stylized stegos that exhibit strong artistic effects while resisting detection by deep neural network-based steganalyzers. The extractor is trained to accurately recover hidden secret images from stegos after they undergo distortions in online social networks. To achieve these goals, our pipeline incorporates three key modules: an improved XuNet [
23] based pretrained steganalyzer, a distortion simulation module that mimics potential artifacts in OSNs, and a Style-Artistic Network [
28] (SANet) to enhance the artistic quality of stylized images. These modules can be trained end-to-end. Our proposed steganography framework is built upon existing deep learning-based style transfer architectures, with a prioritized focus on stylization quality. In covert communication scenarios, transmitting low-quality images tends to attract adversarial attention, significantly increasing the risk of detection. To address this, we incorporate the SANet as a core mechanism to enhance stylization quality. Specifically, SANet first performs deep feature fusion between the content and style images, generating high-fidelity stylized features. These fused features are then spatially aligned with the secret image to be embedded through upsampling operations. Finally, an adaptive superimposition strategy is applied to complete the steganographic embedding, ensuring that the stego image seamlessly conceals the secret information while preserving artistic style integrity.
The process is formalized as follows: Let
and
denote the content and style images, respectively. A pretrained VGG-19 encoder extracts multi-scale features from layers
{Relu_4_1, Relu_5_1} as Equations (
1) and (
2):
where
.
The style-attentional module computes learnable attention maps to align style and content features as in Equation (
3):
where
are
convolutions,
denotes mean-variance normalized features, and
is a cosine similarity. The fused feature
is computed by Equation (
4):
where
is another
convolution.
Features from two SANets (Relu_4_1 and Relu_5_1) are combined to balance local and global style patterns as Equations (
5)–(
7):
The secret image
is embedded into the stylized features
via masked superposition, where
and
. To align the spatial dimensions and channel numbers between the two tensors for element-wise addition, we employ a two-step projection process. First, the secret image
M undergoes a channel projection through a
convolutional layer
to match the channel dimension
d of
, yielding
. Second, the feature map
is upsampled to match the spatial dimensions of the projected secret image using bilinear interpolation, resulting in
. The weighted fusion is then performed as Equation (
8):
where
is a hyperparameter balancing artistic quality and secrecy. The fused feature map
is subsequently fed into the decoder to generate the
image as in Equation (
9):
where the structure of decoder follows [
28].
3.1. OSNs Distortions and Forward Simulation Model
Mainstream social media platforms such as WeChat, Twitter, and Meta impose multiple distortions on user-uploaded images to optimize storage and transmission efficiency. These distortions primarily include [
29]: (1) lossy compression using JPEG/WebP algorithms (quality factors 50–90), which introduce high-frequency detail loss and block artifacts; (2) resolution downsampling (e.g., limiting the longest edge to 1080 pixels), causing aliasing effects; (3) color space conversions (RGB-to-sRGB/YUV) that induce quantization errors; and (4) platform-specific filters such as Meta’s auto-contrast enhancement or Twitter’s sharpening operations, which apply non-linear transformations.
To address these challenges, we extend the forward distortion simulation framework from [
29]. The model operates in following stages:
Gradient truncation isolates the
from backward propagation interference by Equation (
10):
where
blocks gradient flow.
Composite distortions are injected sequentially through Equation (
11):
where
,
, and
represent JPEG-50 compression, resolution downsampling, and color quantization, respectively.
Distortion residual calculation by Equation (
12):
During training, the residual is added as a constant perturbation to the original image via Equation (
13):
which forces the model to learn robustness against hybrid distortions through forward propagation only.
3.2. Improved XuNet-Based Steganalyzer
To address the unique challenges of artistic steganography in style-transferred images, we propose three synergistic enhancements to the original XuNet steganalyzer. These modifications enable effective detection in RGB color space while maintaining computational efficiency for weak generative tasks.
The original XuNet was designed for grayscale images with a convolutional kernel. To accommodate RGB inputs of stylized stegos, we expand the input dimensionality to and introduce a cross-channel feature fusion layer. This adaptation preserves XuNet’s high-pass filtering prior while capturing inter-channel steganographic correlations.
Given that artistic stylization constitutes a weak generative problem where texture patterns interfere with steganographic features, we implement a two-phase training protocol. During pre-training, we construct a specialized dataset using VGG-19 features extracted from both clean style-transferred images and stego images. The pre-training follows a standard cross-entropy objective where the discriminator learns to distinguish between clean and stego-containing images. The pre-trained weights are then frozen during end-to-end optimization.
During generator training, the fixed XuNet outputs stego probability , which drives the adversarial loss following the cross-entropy formulation.
3.3. Secret Image Extraction Network
The secret extractor is designed to operate without requiring any knowledge of the style image used during stego generation. It decodes the secret information directly from the content structure and embedded patterns of the received stego image, a process independent of the image’s artistic style.
We design a convolutional neural network to directly reconstruct the original secret RGB image from the stego image. The extraction network follows an encoder–decoder architecture similar to SteganoGAN [
9] but optimized for image-to-image recovery rather than binary message extraction. The extraction process consists of three key operations:
The stego image first passes through a series of convolutional blocks to extract multi-scale features as Equations (
14)–(
16):
The features then pass through residual bottleneck blocks to learn the mapping between stego and secret image representations as Equation (
17):
Finally, transposed convolutions progressively upsample the features to reconstruct the RGB output as Equation (
18):
3.4. Loss Function Design
The StegTransfer model optimizes three core objectives through a unified loss framework.
Stylization loss is consisted of
and
computed by Equations (
19)–(
21), respectively.
where
denotes VGG-19 ReLU4_1 features and
is the content image.
where
computes the Gram matrix [
30],
represents VGG-19 features at layer
l (ReLU
),
is the style image, and
are layer weights.
where
and
balance content and style preservation.
Secret reconstruction loss is computed by Equation (
22)
where
M is the original secret image,
is the extracted image,
denotes L1-norm (mean absolute error), SSIM is the Structural Similarity Index Measure,
weights the SSIM term.
Steganalysis evasion loss is computed by Equation (
23)
where
is the XuNet’s detection probability (range [0, 1]),
D denotes the fixed XuNet steganalyzer, and
is the VGG feature extractor.
Total optimization objective is computed by Equation (
24)
where
prioritizes secret recovery accuracy, and
balances stealthiness against quality degradation.
4. Experimental Results and Analysis
4.1. Experimental Environment Setup
For the steganography framework, content-style pairs were sourced from the MS-COCO [
31] dataset (content images) and WikiArt [
32] dataset (style images), while secret images were uniformly sampled from the NWPU-RESISC45 [
33] remote sensing dataset. All images were center-cropped and resized to
pixels to ensure spatial alignment between content images and secret images.
For quantitative evaluation, we constructed a well-defined experimental dataset: 80,000 images were randomly selected from the MS-COCO dataset as the content set, and 5000 images were randomly chosen from the WikiArt dataset as the style set. The secret set consists of 10,000 images randomly sampled from the NWPU-RESISC45 dataset. During the training, validation, and testing phases, these sets were randomly partitioned to ensure no information leakage.
4.2. Fidelity
Fidelity is crucial for steganography evaluation. Traditionally, it measures the visual imperceptibility between stego and cover images. In our artistic style steganography context, fidelity refers specifically to the quality of the stego image’s stylized artistic effect: higher stylized quality equals higher fidelity.
We evaluated the fidelity of our scheme both qualitatively (
Figure 2) and quantitatively (
Table 1). When the training reaches 20,000 epochs, our method is capable of generating stego images with favorable visual quality on the test set, as illustrated in
Figure 2, which demonstrates vivid colors and precise brushstrokes. Moreover, the extracted secret images exhibit only minor residuals compared to the original secret images, indicating effective convergence of the model. In contrast, competing methods tend to introduce noticeable artifacts such as color bleeding and over-smoothing.
Table 1 presents quantitative results using the mean Sobel gradient magnitude measuring edge sharpness, CIEDE2000 [
34] measuring color fidelity, and the NIMA [
35] model predicting aesthetic quality based on human preferences. Testing 500 stego images per scheme, we report mean scores and standard deviations.
Combining
Figure 2 and
Table 1 results, our scheme shows significant artistic fidelity superiority. This improvement stems directly from SANet module, which uses style-aware feature fusion to align artistic patterns with content structure. Crucially, by establishing deep style-content correlations during embedding, SANet preserves high-frequency details. This mechanism suppresses style distortion and blending, ensuring highly faithful artistic style in the final stego image.
4.3. Robustness
Building upon the systematic analysis of social media distortions presented in [
29], we conducted specialized robustness tests covering four common distortion categories: JPEG compression (quality factor QF = 70), resolution downsampling (scale factor = 4/5), color space conversion (RGB to YCbCr), and hybrid distortions. The hybrid distortions were applied sequentially as: downsampling → color conversion → JPEG compression. Since the compared algorithms did not provide open-source implementations, we faithfully reimplemented them based on the descriptions in their respective papers to ensure a fair comparison. To quantitatively evaluate the fidelity of extracted secret images after transmission through lossy channels (e.g., online social networks), we used two standard metrics: Peak Signal-to-Noise Ratio (PSNR) [
36] and Structural Similarity Index (SSIM) [
37], both computed by comparing the extracted secret images against the original ones. Higher PSNR and SSIM values indicate better quality preservation. As shown in
Table 2, our approach, which integrates a dedicated distortion simulation module, demonstrates significantly enhanced resilience compared to the reimplemented baseline methods.
The PSNR is derived from the Mean Squared Error (MSE) between the original image
I and the processed image
K (both of size
pixels), as defined in Equations (
25) and (
26). The SSIM metric evaluates the similarity between local windows
x (from
I) and
y (from
K) by considering luminance, contrast, and structural cues, as defined in Equation (
27). Specifically, the MSE and PSNR are calculated as follows:
where
denotes the maximum possible pixel value (e.g., 255 for 8-bit images). The SSIM is defined as:
where
and
are the pixel means of windows
x and
y, respectively;
and
are their variances;
is their covariance. The constants
and
are used to ensure numerical stability. The overall SSIM value for the entire image is obtained by averaging the local SSIM values across all windows.
4.4. Security
To verify the security of StegTransfer, we conducted comprehensive safety tests using two widely adopted steganalysis methods: StegExpose [
38] and SiaStegNet [
39]. StegTransfer’s 15.5% detection rate under StegExpose is significantly lower than that of the comparative methods [
12]. For further evaluation, we employed the more recent SiaStegNet detector. Under this method, StegTransfer maintained a detection rate of 62.3%, which is 9.8% lower than that of the closest competitor [
12], as illustrated in
Figure 3.
4.5. Ablation Study
To validate the effectiveness of each key component in the StegTransfer framework, we conduct comprehensive ablation studies by systematically evaluating four configurations: the Full Model with all modules (SANet, distortion simulation, and improved XuNet discriminator); w/o Distortion Simulation, which removes the forward non-differentiable noisy module during training; w/o XuNet Discriminator, which excludes the adversarial steganalysis component from training; and w/o SANet, which replaces the Style-Attentional Network with a basic style transfer encoder–decoder. All configurations are trained with identical hyperparameters and evaluated on the same test set of 500 stego images. Quantitative results are presented in
Table 3,
Table 4 and
Table 5.
As shown in
Table 3, the full model achieves superior performance across all robustness metrics. Removing the distortion simulation module causes the most significant degradation, confirming that OSN distortion simulation is crucial for maintaining extraction accuracy after social media transmission. The absence of XuNet discriminator or SANet also reduces robustness, though to a lesser extent, indicating their complementary roles in preserving embedded information.
Table 4 demonstrates that SANet plays the most critical role in artistic quality enhancement. Removing SANet causes the largest drop in NIMA score (from 6.32 to 4.90), edge sharpness, and color fidelity. This confirms that style-attentional feature fusion is essential for generating high-quality stylized stego images. The distortion simulation and XuNet modules have minimal impact on aesthetic quality, as expected, since they primarily target robustness and security, respectively.
Security evaluation under state-of-the-art steganalyzers (
Table 5) reveals that the XuNet discriminator is vital for anti-detection capability. Without adversarial training, the detection rate increases by 12.5% under StegExpose and 15.2% under SiaStegNet. Interestingly, removing SANet also slightly increases detectability, suggesting that high-quality stylization helps conceal embedding traces. The distortion simulation module shows minimal impact on security, as it primarily affects post-transmission recovery rather than inherent detectability.
The ablation studies conclusively demonstrate that each component in StegTransfer addresses distinct challenges: the distortion simulation module is essential for robustness against OSN processing pipelines; the XuNet discriminator significantly enhances security against deep learning-based steganalysis; and the SANet critically improves aesthetic quality while marginally aiding security. The full integration of these components creates a synergistic effect, enabling StegTransfer to simultaneously achieve high robustness, security, and visual quality—addressing the three key limitations of existing style-transfer steganography methods.
5. Conclusions
This letter proposes StegTransfer, a robust image steganographic framework for online social networks. It integrates a non-differentiable distortion simulation module, an improved XuNet adversarial discriminator, and an aesthetic enhancement network. This trio addresses key limitations in existing style-transfer steganography: robustness to platform distortions, artistic quality, and detection resistance. The distortion module enhances embedded content recoverability after transmission, while adversarial training strengthens resistance to deep learning steganalysis. The style-attentional network ensures high-quality stego-images, preventing visual suspicion.