End-to-end steganography method based on double-path attention mechanism and joint loss optimization

By constructing a dual-path attention hiding network and a lightweight recovery network, and combining axial attention mechanism and joint loss function, the challenge of balancing high hiding capacity, high visual quality and efficient computation in image steganography is solved, and an efficient and secure image steganography method is realized.

CN122372689APending Publication Date: 2026-07-10DALIAN MARITIME UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DALIAN MARITIME UNIVERSITY
Filing Date
2026-04-28
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing image steganography techniques struggle to simultaneously meet the demands of high hiding capacity, high visual quality, and efficient computation when processing full-size images. Furthermore, traditional methods leave obvious traces and have weak anti-detection capabilities, while the training stability and generalization ability of deep learning methods need further improvement.

Method used

An end-to-end steganography method based on dual-path attention mechanism and joint loss optimization is adopted. By constructing a dual-path attention hiding network and a lightweight recovery network, global contextual information and local fine features are captured in a coordinated manner. Combined with axial attention mechanism and joint loss function, high-capacity and high-visual-quality image steganography is achieved.

Benefits of technology

It achieves the generation of visually imperceptible steganases while maintaining high hiding capacity, and can recover secret images with high fidelity, reducing computational complexity and making it suitable for practical deployment applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372689A_ABST
    Figure CN122372689A_ABST
Patent Text Reader

Abstract

The application discloses an end-to-end steganography method based on a double-path attention mechanism and joint loss optimization, acquires a carrier image and a secret image to be steganographed, constructs a steganography recovery network model, is used for embedding a complete-size secret image into a carrier image of the same size to obtain a steganography image, and realizes visual imperceptibility of the steganography image and secret image recovery; the steganography recovery network architecture is optimized through end-to-end joint training, and a trained steganography recovery network model is obtained; the carrier image and the secret image to be steganographed are input into the trained steganography recovery network model, and steganography and recovery of the secret image are realized. The method can embed a complete-size secret image into a carrier image of the same size, and guarantees visual imperceptibility of the steganography image and high-fidelity recovery of the secret image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information security and computer vision technology, and relates to an end-to-end steganography method based on dual-path attention mechanism and joint loss optimization. Background Technology

[0002] Image steganography, as an important branch of information security, has evolved from traditional methods to deep learning. Early methods based on the spatial domain (such as LSB) and transform domain (such as DCT / DWT) achieved basic information hiding, but generally suffered from problems such as difficulty in balancing hiding capacity and security, and insufficient visual concealment. With the development of deep learning technology, steganography methods based on CNNs and GANs have improved performance to some extent, but still have the following core problems: insufficient collaborative optimization between the hiding and restoring networks, making it difficult to achieve global optimum; high computational complexity of traditional attention mechanisms, limiting their application in high-resolution images; and loss function design failing to effectively balance pixel-level accuracy and visual perception quality. These limitations severely restrict the effectiveness and applicability of image steganography in practical applications.

[0003] To address key issues in existing technologies, such as poor network coordination, low computational efficiency, and imbalanced visual quality, an innovative solution is proposed. Analysis reveals that current methods often fail to simultaneously meet the demands of high hiding capacity, high visual quality, and efficient computation when processing full-size image steganography. Particularly in complex scenarios, traditional methods exhibit noticeable hiding traces and weak anti-detection capabilities, while the training stability and generalization ability of deep learning methods also need improvement. These technical bottlenecks make the development of a new method capable of intelligently allocating encoding resources and achieving end-to-end collaborative optimization an urgent priority.

[0004] Traditional convolutional neural networks struggle to effectively capture long-range spatial dependencies and inter-channel correlations in images, limiting the model's ability to learn intelligent and distributed information encoding strategies, thereby reducing the robustness and anti-interference capabilities of steganography systems.

[0005] Existing methods rely too heavily on pixel-level error metrics (such as MSE) while neglecting perceptual quality metrics (such as SSIM), resulting in insufficient visual naturalness of stegographic images or distortion of the restored image structure, failing to achieve the optimal balance between concealment and reliability.

[0006] Especially in high-resolution image processing, advanced modules such as global attention mechanisms have high computational complexity (e.g., O(H²W²)), making them difficult to deploy in resource-constrained environments and limiting the practical application of the technology. Summary of the Invention

[0007] To address key issues in existing technologies such as poor network coordination, low computational efficiency, and imbalanced visual quality, and the fact that current methods often fail to simultaneously meet the demands of high hiding capacity, high visual quality, and efficient computation when processing full-size image steganography—especially in complex scenarios where traditional methods exhibit obvious hiding traces and weak anti-detection capabilities, while deep learning methods also require improvement in training stability and generalization ability—this invention adopts an end-to-end steganography method based on a dual-path attention mechanism and joint loss optimization, characterized by the following steps:

[0008] Obtain the carrier image and the secret image to be steganized; A steganalysis recovery network model is constructed to embed a full-size secret image into a carrier image of the same size to obtain a stegana, and to achieve visual imperceptibility of the stegana and recovery of the secret image. The steganalysis network architecture is jointly trained and optimized end-to-end to obtain a well-trained steganalysis network model. The carrier image and the secret image to be steganized are input into a trained steganalysis network model to achieve steganography and restoration of the secret image.

[0009] Furthermore: the steganalysis recovery network model includes: Dual-path attention hiding network: It is used to capture key global contextual information and local fine features by cooperating to capture the secret image to be steganized into a carrier image of the same size to obtain the steganographic image by employing global and local paths. Lightweight recovery network: used to decode and reconstruct the original secret image from the steganalyst transmitted by the dual-path attention hiding network.

[0010] Furthermore: the dual-path attention hiding network includes: Global path encoder module: used for the image after the carrier image and secret image are stitched together, it adopts a hierarchical feature extraction strategy to capture the overall structure and long-range dependencies; The local path encoder module is used to perform in-depth optimization of local regions of the image using a divide-and-conquer strategy, mining and enhancing the local detail information of each image block; Feature fusion module: It is used to perform a series of upsampling and optimization operations on the high-level semantic features output by the global path encoder module, and to reorganize the local detail features output by the local path encoder module according to the original spatial position of the output features, and fuse and stitch them into a complete feature map; the output high-level features are mapped back to the image space, and finally a steganalyte image that is visually highly similar to the original carrier image is generated.

[0011] Further: The global path encoder module includes: Multi-stage convolution module: Feature extraction and downsampling are performed through 7×7 convolution, gradually processing the image from 256×256 to 64×64 resolution, increasing the number of channels to 256, and expanding the number of channels from 6 to 8; the output feature map is passed through two 3×3 convolution layers in sequence, where the first 3×3 convolution layer increases the number of channels from 8 to 128, and the second 3×3 convolution layer adjusts it back to 8, outputting the extracted feature map; First axial attention module: used for advanced feature optimization based on the feature map output by the multi-stage convolution module; The first fusion module is used to transform the optimized high-level features based on the output of the first axial attention module, and then upsample them to 128×128 through a convolutional layer. Subsequently, it is connected to the feature map of the same scale in the encoding process to incorporate shallow detail information. The sum is then processed by another convolutional layer and finally upsampled to 256×256 through bilinear interpolation. The global features are consistent in size with the detail enhancement feature map output by the local path.

[0012] Further: The local path encoder module includes: Preprocessing module: used to divide the complete input image into a 4×4 grid in space, thereby obtaining 16 non-overlapping local image patches, each patch having a size of 6×64×64; Convolutional layer: used for feature extraction based on the segmented local image patches output by the preprocessing module; The second axial attention module is used to optimize the feature extraction requirements within local blocks based on the extracted features from the convolutional layer output, so as to achieve in-depth optimization of intra-block features and mine and enhance the detailed information of each image block.

[0013] Furthermore: the first axial attention module includes multiple axial attention blocks connected in sequence to form a sequence; the first axial attention block increases the number of channels to 16 while maintaining the resolution; subsequent axial attention blocks perform downsampling by 2 times, increasing the number of channels to 256, and the output feature map size is 64×64; Each axial attention layer consists of the following sequentially connected layers: a 1×1 convolutional dimensionality reduction layer, a first batch of normalized layers, a ReLU activation function, a height-oriented attention module, a width-oriented attention module, a 1×1 convolutional dimensionality increase layer, and a second batch of normalized layers.

[0014] The axial attention block integrates a relative position encoding mechanism, providing an embedding vector for the spatial relative position of each pixel pair.

[0015] Furthermore, the second axial attention module includes multiple axial attention blocks connected in sequence to form a sequence. The axial attention includes the following connected in sequence: a 1×1 convolutional dimensionality reduction layer, a first batch of normalization layers, a ReLU activation function, a height direction attention module, a width direction attention module, a 1×1 convolutional dimensionality increase layer, and a second batch of normalization layers.

[0016] Furthermore, the height-direction attention module is used to focus only on the same column, i.e., fix the horizontal coordinate j, for each spatial location (i,j) in the feature map, and traverse all other locations at all heights i, thereby capturing the long-range dependencies of the image in the vertical direction.

[0017] The width axis attention module is used to focus on the same row (i, j) for each position (i, j) in the feature map, i.e., fix the vertical coordinate i, and traverse all positions on all widths j, capturing the long-range dependencies of the image in the horizontal direction.

[0018] Furthermore: the lightweight recovery network comprises five convolutional blocks connected in sequence; each convolutional block comprises a 3×3 convolutional layer, normalization processing, and an activation function.

[0019] This invention provides an end-to-end steganography method based on a dual-path attention mechanism and joint loss optimization. Existing spatial domain methods (such as LSB replacement) have a large hiding capacity, but modifications to pixel statistical characteristics are easily detected, resulting in poor security and robustness. Transform domain methods (such as DCT or DWT) improve concealment, but have high computational complexity, and there is an inherent contradiction between hiding capacity and robustness, making it difficult to achieve efficient embedding and lossless recovery at the same time.

[0020] In existing methods, the hidden network and the recovery network are often trained independently or loosely, failing to achieve global optimum through end-to-end joint optimization. This results in a mismatch between embedded features and decoding requirements, affecting the accuracy and efficiency of information recovery.

[0021] Architectural innovation: The dual-path design captures both global semantics and local details, while axial attention enables efficient long-range dependency modeling; Training innovation: The joint loss function balances concealment and recovery quality, and the weight configuration has been verified through extensive experiments; Efficiency innovation: computational complexity is significantly reduced, making it suitable for practical deployment applications; Innovative Results: Achieving breakthroughs in visual quality and restoration accuracy while maintaining high concealment capacity (1:1); This method provides a new technical solution for the field of image steganography, solving the problem of balancing capacity, quality and efficiency that is difficult to achieve with traditional methods.

[0022] This invention relates to an end-to-end image steganography method and system based on deep learning. The core innovation lies in constructing an architecture where a dual-path attention hiding network and a lightweight recovery network work collaboratively. Through axial attention mechanisms and joint loss optimization, high-capacity, high-visual-quality image steganography is achieved. This method can embed a full-size secret image into a carrier image of the same size, ensuring that the steganographic image is visually imperceptible and the secret image can be recovered with high fidelity. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a diagram of a steganography recovery network model; Figure 2 It is a dual-path structure diagram; Figure 3 This is a diagram of the axial attention mechanism; Figure 4 It is a histogram of pixel error distribution, where (a) is the error distribution between the original secret image and the restored image, and (b) is the error distribution between the carrier image and the secret image. Figure 5 The diagram shows the channel sensitivity analysis, where rows represent the target channels that are perturbed in the secret image and columns represent the channels whose quality is to be evaluated in the recovered secret image. (a) is the experimental result diagram of single-channel perturbation of the secret image; (b) is the experimental result diagram of single-channel perturbation of the recovered secret image. Detailed Implementation

[0025] It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] An end-to-end steganography method based on dual-path attention mechanism and joint loss optimization includes the following steps: S1: Obtain the carrier image and the secret image to be steganized; S2: Construct a steganalysis recovery network model to embed a full-size secret image into a carrier image of the same size to obtain a stegana, and achieve visual imperceptibility of the stegana and recovery of the secret image; S3: Perform end-to-end joint training and optimization on the steganalysis network architecture to obtain a trained steganalysis network model; S4: Input the carrier image and the secret image to be steganized into the trained steganalysis network model to achieve steganography and restoration of the secret image.

[0028] This framework aims to achieve a complete process of embedding a full-size secret image into a carrier image of the same size, and efficiently and with high quality recovering the secret information from the generated steganalyte. This system employs a unique dual-network collaborative design, transforming the traditional image steganography task into a deep feature learning and reconstruction problem.

[0029] This method can embed a full-size secret image into a carrier image of the same size, ensuring that the steganographic image is visually imperceptible and the secret image can be recovered with high fidelity.

[0030] Figure 1 This is a diagram of a steganography recovery network model; The core stage of this method is the hiding stage: Preprocessed secret features and the carrier image are input into a hiding network. This network is responsible for deeply fusing the secret information into the carrier image, generating a visually highly realistic and imperceptible stego image. This process aims to minimize interference with the visual quality of the carrier image.

[0031] Recovery Phase: The generated steganalysis image is fed separately into the recovery network. This network is responsible for decoding and reconstructing the original steganalysis image from the steganalysis image, striving for high fidelity.

[0032] The hiding and restoration networks are optimized through an end-to-end joint training strategy. This training method ensures close functional synergy between the two networks: the hiding network needs to fully consider the requirements of the restoration network's successful decoding when embedding information, thereby maximizing the accuracy of the restored information while ensuring the visual quality of the stegana. It should be noted that due to the inherent information compression and nonlinear transformation characteristics of deep learning models, the restoration of secret images is essentially a lossy reconstruction process. The goal of this application is not to pursue mathematically lossless restoration, but to achieve a better balance between visual fidelity and information restoration accuracy through an innovative network architecture and a carefully designed loss function, ultimately achieving high-quality reconstruction results that are satisfactory in both subjective visual perception and objective metrics.

[0033] Furthermore: the steganalysis recovery network model includes: Dual-path attention hiding network: It is used to capture key global contextual information and local fine features by cooperating to capture the secret image to be steganized into a carrier image of the same size to obtain the steganographic image by employing global and local paths. Figure 2 It is a dual-path structure diagram; Lightweight recovery network: used to decode and reconstruct the original secret image from the steganalyst transmitted by the dual-path attention hiding network.

[0034] The network adopts an overall architecture of encoder-attention mechanism-decoder, and innovatively introduces a dual-path processing strategy and axial attention mechanism to achieve large-capacity information hiding while maintaining visual quality.

[0035] The dual-path attention hiding network, as the core component of this steganography system, undertakes the crucial task of embedding secret image information into the carrier image. The core design concept of this network is to transform the original secret image into a compact feature representation suitable for hiding through deep feature learning and spatial attention mechanisms.

[0036] Traditional sequencer networks struggle to balance global structural consistency and local texture realism when handling image steganography tasks. To effectively address this issue, this study innovatively designs a parallel dual-path processing mechanism within the hidden network. This mechanism is crucial for the model to collaboratively capture global contextual information and fine-grained local features. Unlike sequencer processing, the global encoding path and the local enhancement path process the complete input image independently. Finally, the outputs of the two paths are integrated through a feature fusion module, achieving multi-scale feature extraction from macroscopic scene structure to microscopic details.

[0037] Furthermore: the dual-path attention hiding network includes: Global path encoder module: used for the image after the carrier image and secret image are stitched together, it adopts a hierarchical feature extraction strategy to capture the overall structure and long-range dependencies; The local path encoder module is used to perform in-depth optimization of local regions of the image using a divide-and-conquer strategy, mining and enhancing the local detail information of each image block; Feature fusion module: It is used to perform a series of upsampling and optimization operations on the high-level semantic features output by the global path encoder module, and to reorganize the local detail features output by the local path encoder module according to the original spatial position of the output features, and fuse and stitch them into a complete feature map; the output high-level features are mapped back to the image space, and finally a steganalyte image that is visually highly similar to the original carrier image is generated.

[0038] As the backbone of the network, the global path undertakes the important tasks of processing the complete input image, capturing the overall structure, and long-range dependencies.

[0039] Further: The global path encoder module includes: Multi-stage convolutional module: Feature extraction and downsampling are performed using 7×7 convolutions with a stride of 2 and padding of 3. This design can quickly expand the receptive field and downsample the input; it progressively processes the image from 256×256 to 64×64 resolution, increasing the number of channels to 256, while simultaneously expanding the number of channels from 6 to 8; the feature maps output from the convolutional layers are sequentially passed through batch normalization layers and the ReLU activation function. This combination ensures the stability of the training process while introducing the necessary non-linear transformation capability to the network. The output feature map is passed through two 3×3 convolutional layers (stride 1, padding 1). The first 3×3 convolutional layer increases the number of channels from 8 to 128, and the second 3×3 convolutional layer adjusts it back to 8, outputting the extracted feature map. Both layers maintain the same spatial resolution (128×128) and are equipped with batch normalization and ReLU activation functions, respectively, forming the basic module for feature extraction.

[0040] Figure 3 This is a diagram of the axial attention mechanism; First axial attention module: used for advanced feature optimization based on the feature map output by the multi-stage convolution module; The first fusion module is used to transform the optimized high-level features based on the output of the first axial attention module, and then upsample them to 128×128 through a convolutional layer. Subsequently, it is connected to the feature map of the same scale in the encoding process to incorporate shallow detail information. The sum is then processed by another convolutional layer and finally upsampled to 256×256 through bilinear interpolation. The global features are consistent in size with the detail enhancement feature map output by the local path.

[0041] To compensate for the shortcomings of the global path in processing fine textures, a local enhancement path is introduced into the hidden network. This path uses a divide-and-conquer strategy to perform depth optimization on local regions of the image.

[0042] To integrate the complementary features captured by the two paths, this work designs an efficient feature fusion strategy. First, a series of upsampling and optimization operations are performed on the high-level semantic features (size 256×64×64) output by the global path: first, the features are transformed through a convolutional layer (decoder4), and then upsampled to 128×128 through bilinear interpolation; subsequently, a skip connection (element-wise addition) is made with the feature map of the same scale in the encoding process (from layer1) to incorporate shallow detail information; the addition result is then processed by another convolutional layer (decoder5), and finally upsampled to 256×256 through bilinear interpolation. After this process, the global features are consistent in size with the detail-enhanced feature map (16×256×256) output by the local path.

[0043] Finally, the feature maps generated by the two paths are fused element-wise. This direct addition method has low computational cost, requires no additional parameters, and can directly integrate the macroscopic scene layout provided by the global path with the subtle texture patterns preserved by the local path, achieving efficient feature complementarity. The fused feature map (16×256×256) provides a complete feature representation for the subsequent output layer, which is an important foundation for the entire model to achieve high-quality information hiding.

[0044] The image reconstruction stage of the hidden network maps the high-level features fused from the two paths back to the image space, ultimately generating a steganalyte that is visually highly similar to the original carrier image. This process begins with the high-level features (256×64×64) output from the global path. These features are first passed through a decoding convolutional layer (decoder4) and upsampled to 128×128 via bilinear interpolation. They are then skip-connected with feature maps of the same scale from the encoding process to fuse information from different levels. This result is then processed by another decoding convolutional layer (decoder5) and upsampled to 256×256, resulting in a feature map (16×256×256) with the same size as the local path output. The feature maps from the two paths are fused element-wise to obtain the fused feature (16×256×256). This feature is then refined by a 3×3 convolutional layer (decoderf), and finally mapped to 3 channels by a 1×1 convolutional layer (adjust), and output as the final steganalyte image via a sigmoid activation function.

[0045] During reconstruction, the network fuses shallow features from the encoder with features from corresponding levels of the decoder via skip connections. This design ensures that information from different levels of abstraction (such as texture details provided by shallow layers and semantic context contributed by deeper layers) can be effectively passed to the output layer. Through this direct feature fusion strategy, the network can better maintain the visual realism of the carrier image in complex texture regions during the embedding of secret information, thereby effectively mitigating the visual anomalies caused by information hiding.

[0046] Further: The local path encoder module includes: Preprocessing module: used to divide the complete input image (6×256×256) into a 4×4 grid in space, thereby obtaining 16 non-overlapping local image patches, each patch having a size of 6×64×64; Convolutional layer: used for feature extraction based on the segmented local image patches output by the preprocessing module; The second axial attention module is used to optimize the feature extraction requirements within local blocks based on the extracted features from the convolutional layer output, so as to achieve in-depth optimization of intra-block features and mine and enhance the detailed information of each image block.

[0047] Each local image patch is independently fed into a dedicated sub-network for processing. This sub-network itself is also a mini-encoder, containing convolutional layers and multiple axial attention blocks. Notably, the AxialBlock module used in the local path differs in design from that in the global path. The former is optimized for feature extraction within local blocks, featuring a deeper network structure to achieve in-depth feature optimization within blocks; and for computational efficiency and handling of small block spatial structures, its design simplifies the explicit positional encoding mechanism. This differentiated design allows the local path to focus on mining and enhancing the detailed information of each image patch, effectively complementing the macroscopic context framework formed by the global path, enabling the network to simultaneously consider global semantics and local details. After all 16 local blocks are processed independently, their output feature maps are reassembled according to their original spatial locations, forming a complete, depth-optimized feature map. This design ensures that the hidden network not only focuses on the global semantic consistency of the image but also enhances the details of local regions, which is particularly beneficial for improving the hiding effect of small objects or complex textured regions. The two paths are processed in parallel, and the information is finally integrated through a feature fusion strategy to jointly generate a high-quality steganalysis image.

[0048] Furthermore, the first axial attention module comprises multiple axial attention blocks connected sequentially to form a sequence; this sequence is the core of high-level feature optimization for the global path. This module employs a residual structure, ensuring effective gradient propagation while gradually improving feature representation capabilities; the first axial attention block (layer 1) increases the number of channels to 16 while maintaining the resolution (128×128); subsequent axial attention blocks (layer 2) perform a 2x downsampling, increasing the number of channels to 256, and outputting a feature map size of 64×6. Each axial attention layer consists of the following sequentially connected layers: a 1×1 convolutional dimensionality reduction layer, a first batch of normalized layers, a ReLU activation function, a height-oriented attention module, a width-oriented attention module, a 1×1 convolutional dimensionality increase layer, and a second batch of normalized layers.

[0049] This design significantly reduces computational complexity by decomposing the two-dimensional global attention computation into two sequentially executed one-dimensional attention processes: height and width. Notably, this module also integrates a relative position encoding mechanism, providing an embedding vector of the spatial relative position for each pixel pair. Furthermore, by adaptively adjusting the contribution of positional information through learnable gating parameters, the model can learn optimal prior positional knowledge according to the requirements of the steganography task.

[0050] Furthermore, the second axial attention module includes multiple axial attention blocks connected in sequence to form a sequence. The axial attention includes the following connected in sequence: a 1×1 convolutional dimensionality reduction layer, a first batch of normalization layers, a ReLU activation function, a height direction attention module, a width direction attention module, a 1×1 convolutional dimensionality increase layer, and a second batch of normalization layers.

[0051] Furthermore, axial attention is a revolutionary self-attention computational paradigm. Its core design goal is to effectively address the explosive growth in computational complexity of traditional self-attention mechanisms when processing two-dimensional image data. In image processing tasks, traditional self-attention mechanisms flatten two-dimensional image feature maps into one-dimensional sequences for computation, resulting in a complexity proportional to the square of the image size (H×W) (O(H²W²)), which severely limits its feasibility in processing high-resolution images. Axial attention, through a structural decomposition strategy, achieves an order-of-magnitude improvement in computational efficiency without significantly sacrificing the model's representational capabilities.

[0052] The core innovation of the axial attention mechanism lies in its decomposition of complex two-dimensional global attention calculation into two sequentially executed one-dimensional attention processes.

[0053] Height-Axis Attention: For each spatial location (i, j) in the feature map, this mechanism focuses only on all other locations in the same column (i.e., with a fixed x-coordinate j, iterating through all heights i). This captures the long-range dependencies of the image in the vertical direction.

[0054] Width-Axis Attention: This mechanism then focuses on all positions in the same row (i,j) at each location (i,j) (i.e., with a fixed ordinate i, iterating through all widths j). This captures the long-range dependencies of the image in the horizontal direction.

[0055] By employing this column-first-row (or row-first-column) sequential processing method, axial attention significantly reduces the computational complexity from O(H²W²) of traditional global attention to O(HW(H+W)). This means that for a 256x256 input feature map, the computational cost can be reduced by several orders of magnitude. This allows the model to establish the relationship between any two pixels in the image (each pixel is "indirectly" connected to global pixels through its row and column) without incurring a huge computational burden, thus obtaining a de facto global receptive field and effectively capturing long-range contextual information in the image. Another key enhancement of this mechanism is the introduction of a position-sensitive self-attention design. This position-sensitive design enables it to better model spatial relationships and structural information in the image, improving the model's performance in dense prediction tasks (such as segmentation and detection). In the hidden network of this study, the above-mentioned axial attention mechanism is encapsulated as a reusable core module: the AxialBlock, and integrated into the network's global encoding path for high-level feature optimization after convolutional feature extraction.

[0056] Furthermore: the lightweight recovery network comprises five convolutional blocks connected in sequence; each convolutional block comprises a 3×3 convolutional layer, normalization processing, and an activation function.

[0057] Example 1: An end-to-end steganography method based on dual-path attention mechanism and joint loss optimization includes the following steps: S1: Obtain the carrier image and the secret image to be steganized; S2: Construct a steganalysis recovery network model to embed a full-size secret image into a carrier image of the same size to obtain a stegana, and achieve visual imperceptibility of the stegana and recovery of the secret image; S3: Perform end-to-end joint training and optimization on the steganalysis network architecture to obtain a trained steganalysis network model; S4: Input the carrier image and the secret image to be steganized into the trained steganalysis network model to achieve steganography and restoration of the secret image.

[0058] Furthermore: the steganalysis recovery network model includes: Dual-path attention hiding network: It is used to capture key global contextual information and local fine features by cooperating to capture the secret image to be steganized into a carrier image of the same size to obtain the steganographic image by employing global and local paths. Lightweight recovery network: used to decode and reconstruct the original secret image from the steganalyst transmitted by the dual-path attention hiding network.

[0059] The hidden network employs a dual-path encoding structure. The global path uses 7×7 convolutions for feature extraction and downsampling, progressively processing the image from 256×256 to 64×64 resolution, increasing the number of channels to 256. The local path divides the input image into a 4×4 grid, extracting features independently from each 64×64 local block, and finally reassembling them into a complete feature map. The features from the two paths are fused through skip connections and element-wise addition.

[0060] The dual-path attention hiding network includes: Global path encoder module: used for the image after the carrier image and secret image are stitched together, it adopts a hierarchical feature extraction strategy to capture the overall structure and long-range dependencies; The local path encoder module is used to perform in-depth optimization of local regions of the image using a divide-and-conquer strategy, mining and enhancing the local detail information of each image block; Feature fusion module: It is used to perform a series of upsampling and optimization operations on the high-level semantic features output by the global path encoder module, and to reorganize the local detail features output by the local path encoder module according to the original spatial position of the output features, and fuse and stitch them into a complete feature map; the output high-level features are mapped back to the image space, and finally a steganalyte image that is visually highly similar to the original carrier image is generated.

[0061] The specific parameter configuration for the lightweight hiding network is as follows: Input layer: 6-channel stitched image (3-channel carrier + 3-channel secret image), resolution 256×256; The global path encoder module includes: A 7×7 convolutional layer (stride 2, padding 3) outputs a 128×128×8 feature map. Two 3×3 convolutional blocks (channel count 8→128→8), each followed by batch normalization and ReLU activation. Four axial attention block sequences, the first block outputs 128×128×16, the second block is downsampled to 64×64×256; The global path features are processed in the following steps: Input features (256, 64, 64), decoder4 (3×3 convolution), upsampled to 128×128, skip connection with layer1 features, decoder5 (3×3 convolution), upsampled to 256×256, element-wise addition with local path features; Local path encoder module: The input image is divided into a 4×4 grid, with each local block measuring 64×64×6. Each local block is independently processed by a micro-encoder (3 3×3 convolutional layers + 2 axial attention blocks); The output feature map is reassembled into a 256×256×16; The axial attention mechanism is implemented using the following algorithm: class AxialAttention(nn.Module): def __init__(self, dim=256, heads=8, max_height=256): super().__init__() self.heads = heads self.dim_head = dim / / heads self.qkv_proj = nn.Linear(dim, dim 3)# Query-key-value projection self.rel_pos_bias = nn.Parameter(torch.randn(2 max_height-1, heads)) When calculating the height axis attention, the feature map is first dimensionally permuted (B,C,H,W→B,W,H,C), and then the relative position encoding is calculated. This design reduces the computational complexity from O(H²W²) to O(HW(H+W)).

[0062] The lightweight recovery network employs a lightweight fully convolutional architecture: Input: 3×256×256 (steganographic image); First convolutional block: 3 channels to 64 channels, 3×3 convolution + BN + ReLU; Second convolutional block: 64 channels to 128 channels, 3×3 convolution + BN + ReLU; Third convolutional block: 128 channels to 256 channels, 3×3 convolution + BN + ReLU; Fourth convolutional block: 256 channels to 128 channels, 3×3 convolution + BN + ReLU; Fifth convolutional block: 128 channels to 64 channels, 3×3 convolution + BN + ReLU; Output layer: 64 channels to 3 channels, 1×1 convolution + Sigmoid; The first, second, third, fourth, and fifth convolutional blocks are connected sequentially; Both the dual-path attention hiding network and the lightweight recovery network introduce axial attention modules, decomposing the traditional global self-attention into two sequential one-dimensional attention calculations. The width-direction attention calculation is similar.

[0063] This design reduces the computational complexity from O(H²W²) to O(HW(H+W)), and with an input of 256×256, the computational cost of a single forward propagation is only 11.8 GFLOPs.

[0064] As the decoding terminal of a steganography system, the lightweight recovery network undertakes the crucial task of reconstructing secret information from steganalytical images with high precision. Unlike the "encoding" goal of the hiding network, which aims to embed secret information invisiblely into the carrier, the core mission of the recovery network is to perform precise "decoding," and its design orientation is to efficiently and accurately reverse the embedding process of the hiding network. It is worth noting that the recovery network does not adopt the complex dual-path encoder-decoder structure commensurate with the hiding network, but instead ingeniously chooses a lightweight fully convolutional encoder architecture. This design decision is based on two main considerations: First, the input of the recovery network is a single steganalytical image, and its task is to separate and reconstruct the secret information from it, rather than fusing two types of information; therefore, the complex multi-scale feature fusion mechanism of the hiding network is unnecessary. Second, the lightweight design helps reduce the overall computational overhead of the steganography system, facilitating practical application deployment. This network does not contain pooling or convolution operations with a stride greater than 1, thus ensuring that the spatial resolution of the input and output remains constant at 256×256.

[0065] In deep steganography systems, the loss function is the core mechanism guiding the model to learn hidden and recovered information. To improve the visual quality of the generated images, this study's loss function mainly combines pixel-level mean squared error loss and perceptual structural similarity loss. Mean squared error loss ensures that the generated image maintains a high degree of consistency with the target image at the pixel level, but focusing only on point-to-point differences can lead to overly smooth results lacking texture details. Structural similarity loss assesses the similarity between two images in terms of brightness, contrast, and structure, better preserving the structural information and texture of the image, which is more in line with the perceptual methods of the human visual system. Mean squared error loss ensures correct "color," while structural similarity loss ensures realistic "structure and texture." The two losses are combined in a weighted manner to guide the model in generating high-quality steganographic images that are both accurate and realistic.

[0066] The mean squared error loss function provides the basic optimization objective through pixel-level difference calculation, and its formula is as follows:

[0067] H , W , CThese represent the image's height, width, and number of channels, respectively. X ijk and Y ijk These represent the input image pairs at positions ( i , j , k The pixel value of ).

[0068] Structural similarity loss evaluates image quality from the perspective of human visual perception, and its formula is as follows:

[0069] μ X , μ Y These represent the local means of the two images, respectively. σ X 2 , σ Y 2 They represent the local variances, σ XY Describing covariance, c 1, c 2 is a stability constant to avoid division by zero errors.

[0070] The joint loss function used to train the hidden network and the recovery network is a composite function, and its formula is as follows: Total loss:

[0071] Carrier loss:

[0072] Recovering losses:

[0073] Wherein, the carrier loss Lco comprises MSE loss (weight 1.2) and SSIM loss (weight 0.1), and the recovery loss Lre uses the same weight configuration. End-to-end training enables the hidden and recovery networks to be co-optimized. MSE is the mean squared error loss, and SSIM is the structural similarity loss; the weight coefficients are determined through grid search, achieving an optimal balance on the ImageNet validation set. C represents the original carrier image, S represents the generated stego image, O represents the original secret image, and R represents the recovered secret image.

[0074] The loss function is the core mechanism guiding the model to learn hidden and recovered information. To improve the visual quality of the generated images, this study's loss function mainly combines pixel-level mean squared error loss and perceptual structural similarity loss. Mean squared error loss ensures that the generated image maintains a high degree of consistency with the target image at the pixel level, but focusing only on point-to-point differences can lead to overly smooth results lacking texture details. Structural similarity loss evaluates the similarity between two images in terms of brightness, contrast, and structure, better preserving the structural information and texture of the image, which is more in line with the perceptual methods of the human visual system. Mean squared error loss ensures correct "color," while structural similarity loss ensures realistic "structure and texture." The two losses are combined in a weighted manner to guide the model in generating high-quality stegographic images that are both accurate and realistic.

[0075] The loss function design transcends the traditional role of a supervisory signal; it is a multi-objective optimization system that directly guides and co-optimizes the training of the hidden and recovery networks. Its design aims to find the optimal balance between the inherent contradiction between the visual concealment of the stegana and the integrity of the recovered secret information. The loss function, through gradient backpropagation, becomes the "command stick" for the entire system's training. L represents the total loss to be minimized during training. Lco is the steganalytic loss, measuring the difference between the generated stegana and the original carrier image. Lre is the recovery loss, measuring the difference between the recovered secret image and the original secret image. Lco directly constrains the output of the hidden network. Its goal is to ensure that the generated stegana and the original carrier image are visually highly consistent, thus resisting human visual and statistical detection. MSE provides a strong constraint on pixel-level fidelity. The high weights (1.2 > 1.0) indicate that visual security is considered the primary objective in this study. It severely punishes every pixel deviation between the stegana and the carrier image, forming the cornerstone of ensuring that the generated image does not suffer from low-level visual defects such as color distortion and abnormal brightness. SSIM enhances the visual naturalness of the stegana. SSIM is more in line with the human visual system (HVS), effectively preventing the problem of overly smooth images and loss of texture details caused by over-optimization of MSE, ensuring that the generated steganalysis image "looks natural" in structure and texture. Lre simultaneously constrains the hiding network and the recovery network, forming a closed-loop optimization. For the recovery network, it is the direct optimization target, driving the network to learn to accurately decode the secret information from the steganalysis image. For the hiding network, it is an implicit constraint. While optimizing Lco, the hiding network must adopt an information embedding method that the recovery network can decode. This means that it cannot "write randomly" information for the sake of extreme concealment, but must retain sufficient redundancy and separability. MSE guarantees high fidelity of the recovered image in terms of pixel values. SSIM guarantees high fidelity of the recovered image in terms of semantic content. Even if there are slight deviations in pixel values, as long as the main structure, contours, and textures of the image are preserved, the semantic information it carries is complete and usable. The weight coefficients (1.2 and 0.1, and the total weights 1.0 and 0.75) are not arbitrarily set, but are empirically optimal solutions derived from a large number of ablation experiments. The weights of MSE (1.2) and SSIM (0.1) are prioritized to clarify the training priorities. The model prioritizes pixel-level accurate matching, which is fundamental; then, SSIM is used to further improve visual quality. If the SSIM weights are too high, convergence will be difficult in the early stages of training. The total weight of Lre (0.75) is less than the weight of Lco (1), reflecting a strategic trade-off. This indicates that the system is appropriately "biased" towards stealth. This is because in a steganalysis system, once the stegana image is detected, the entire communication fails. Therefore, ensuring stealth is the top priority.However, the weight of Lre is much greater than 0, which ensures that the quality of recovery is not sacrificed, and finds a balance between "concealment" and "recoverability".

[0076] The steganalysis recovery network model was trained with the following hyperparameters: optimizer: AdamW (learning rate 0.001, weight decay 0.01); batch size: 16; training epochs: 100 epochs, with a learning rate decay of 0.1 in epochs 50 and 75. The experiments were conducted on the ImageNet dataset, using 150 pairs of test images. The results show that the average PSNR of the stegana image compared to the original carrier image reaches 40.69 dB, with an SSIM of 0.990; the PSNR of the recovered secret image compared to the original secret image is 37.65 dB, with an SSIM of 0.982. Regarding computational efficiency, 256... The computational cost for a 256-color image is reduced by approximately 3.4 times compared to traditional self-attention mechanisms.

[0077] Experimental implementation details: The evaluation indicators are set as follows: PSNR calculation, SSIM calculation, computational complexity (using the fvcore library to count FLOPs).

[0078] Comparison of this application's method with five mainstream methods: LSB-based method: Implements 4-bit substitution; DCT-based method: JPEG quality factor 75; GAN-based method: using the PatchGAN discriminator; CNN-based methods: Xception architecture; Attention-based methods: standard self-attention mechanism; The system deployment plan includes: 1. Inference optimization strategy; Use TensorRT to quantize the trained model (FP16 precision). Cross-platform deployment is achieved using the ONNX format; When deploying on mobile devices, use adaptive computing allocation (GPU for large images, CPU for small images). 2. Practical Application Scenarios: This solution can be specifically applied to: Secure communication: Embedding private images in instant messaging applications; Digital watermarking: embedding authentication information in copyright protection; Medical data security: Embedding patient privacy information in medical images.

[0079] Figure 4It is a histogram of pixel error distribution, where (a) is the error distribution between the original secret image and the restored image, and (b) is the error distribution between the carrier image and the secret image. Figure 5 This is a channel sensitivity analysis diagram, where rows represent the target channels that are perturbed in the secret image, and columns represent the channels whose quality is to be evaluated in the recovered secret image. (a) is the experimental result diagram of single-channel perturbation of the secret image; (b) is the experimental result diagram of single-channel perturbation of the recovered secret image.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An end-to-end steganography method based on dual-path attention mechanism and joint loss optimization, characterized in that: Includes the following steps: Obtain the carrier image and the secret image to be steganized; A steganalysis recovery network model is constructed to embed a full-size secret image into a carrier image of the same size to obtain a stegana, and to achieve visual imperceptibility of the stegana and recovery of the secret image. The steganalysis network architecture is jointly trained and optimized end-to-end to obtain a well-trained steganalysis network model. The carrier image and the secret image to be steganized are input into a trained steganalysis network model to achieve steganography and restoration of the secret image.

2. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 1, characterized in that: The stegume recovery network model includes: Dual-path attention hiding network: It is used to capture key global contextual information and local fine features by cooperating to capture the secret image to be steganized into a carrier image of the same size to obtain the steganographic image by employing global and local paths. Lightweight recovery network: used to decode and reconstruct the original secret image from the steganalyte image transmitted by the dual-path attention hiding network.

3. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 2, characterized in that: The dual-path attention hiding network includes: Global path encoder module: used for the image after the carrier image and secret image are stitched together, it adopts a hierarchical feature extraction strategy to capture the overall structure and long-range dependencies; The local path encoder module is used to perform in-depth optimization of local regions of the image using a divide-and-conquer strategy, mining and enhancing the local detail information of each image block; Feature fusion module: It is used to perform a series of upsampling and optimization operations on the high-level semantic features output by the global path encoder module, and to reorganize the local detail features output by the local path encoder module according to the original spatial position of the output features, and fuse and stitch them into a complete feature map; the output high-level features are mapped back to the image space, and finally a steganalyte image that is visually highly similar to the original carrier image is generated.

4. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 3, characterized in that: The global path encoder module includes: Multi-stage convolution module: Feature extraction and downsampling are performed through 7×7 convolution, gradually processing the image from 256×256 to 64×64 resolution, increasing the number of channels to 256, and expanding the number of channels from 6 to 8; the output feature map is passed through two 3×3 convolution layers in sequence, where the first 3×3 convolution layer increases the number of channels from 8 to 128, and the second 3×3 convolution layer adjusts it back to 8, outputting the extracted feature map; First axial attention module: used for advanced feature optimization based on the feature map output by the multi-stage convolution module; The first fusion module is used to transform the optimized high-level features based on the output of the first axial attention module, and then upsample them to 128×128 through a convolutional layer. Subsequently, it is connected to the feature map of the same scale in the encoding process to incorporate shallow detail information. The sum is then processed by another convolutional layer and finally upsampled to 256×256 through bilinear interpolation. The global features are consistent in size with the detail enhancement feature map output by the local path.

5. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 3, characterized in that: The local path encoder module includes: Preprocessing module: used to divide the complete input image into a 4×4 grid in space, thereby obtaining 16 non-overlapping local image patches, each patch having a size of 6×64×64; Convolutional layer: used for feature extraction based on the segmented local image patches output by the preprocessing module; The second axial attention module is used to optimize the feature extraction requirements within local blocks based on the extracted features from the convolutional layer output, so as to achieve in-depth optimization of intra-block features and mine and enhance the detailed information of each image block.

6. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 4, characterized in that: The first axial attention module includes multiple axial attention blocks connected in sequence to form a sequence; the first axial attention block increases the number of channels to 16 while maintaining the resolution; subsequent axial attention blocks perform downsampling by 2 times, increasing the number of channels to 256, and the output feature map size is 64×64; Each axial attention layer consists of the following sequentially connected layers: a 1×1 convolutional dimensionality reduction layer, a first batch of normalized layers, a ReLU activation function, a height-oriented attention module, a width-oriented attention module, a 1×1 convolutional dimensionality increase layer, and a second batch of normalized layers. The axial attention block integrates a relative position encoding mechanism, providing an embedding vector for the spatial relative position of each pixel pair.

7. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 5, characterized in that: The second axial attention module includes multiple axial attention blocks connected in sequence to form a sequence. The axial attention includes the following connected in sequence: a 1×1 convolutional dimensionality reduction layer, a first batch of normalization layers, a ReLU activation function, a height direction attention module, a width direction attention module, a 1×1 convolutional dimensionality increase layer, and a second batch of normalization layers.

8. The end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 6, characterized in that: The height-direction attention module is used to focus only on the same column (i, j) for each spatial location (i, j) in the feature map, i.e., fix the horizontal coordinate j, and traverse all other locations at all heights i, thereby capturing the long-range dependencies of the image in the vertical direction. The width axis attention module is used to focus on the same row (i, j) for each position (i, j) in the feature map, i.e., fix the vertical coordinate i, and traverse all positions on all widths j, capturing the long-range dependencies of the image in the horizontal direction.

9. An end-to-end steganography method based on dual-path attention mechanism and joint loss optimization according to claim 2, characterized in that: The lightweight recovery network comprises five convolutional blocks connected in sequence; each convolutional block includes a 3×3 convolutional layer, normalization processing, and an activation function.