Advancing Quantization Steps Estimation : A Two-Stream Network Approach for Enhancing Robustness

Authors: xin  cheng
hao  wang
jinwei  wang
xiangyang  luo
Venue: acmmm_org_ACMMM_2024_Conference
Published: 2024-04-02 10:11:53

Abstract: In Joint Photographic Experts Group (JPEG) image steganalysis and forensics, the quantization step can reveal the history of image operations. Several methods for estimating the quantization step have been proposed by researchers.  However, existing algorithms fail to account for robustness, which limits the application of these algorithms. To solve the above problems, we propose a two-stream network structure based on Swin Transformer. The spatial domain features of JPEG images exhibit strong robustness but low accuracy. Conversely, frequency domain features demonstrate high accuracy but weak robustness. 
Therefore, we design a two-stream network with the multi-scale feature of Swin Transformer to extract spatial domain features with high robustness and frequency domain features with high accuracy, respectively. 
Furthermore, to adaptively fuse features in both the frequency domain and spatial domain, we design a  Spatial-frequency Information Dynamic Fusion (SIDF) module to dynamically allocate weights.
Finally, we modify the network from a regression model to a classification model to speed up convergence and improve the accuracy of the algorithm. The experimental results show that the accuracy of the proposed method is higher than 98% on clean images. Meanwhile, in robust environments, the algorithm proposed maintains an average accuracy of over 81%.

Main paper: 
 introduction: 
 Images serve as an essential medium for conveying information in the lives of people. They have an irreplaceable role in communication, education, and entertainment. However, with the maturity of image editing software, the authenticity of an image cannot be determined solely by the naked eye. Tampered images are often used by unscrupulous individuals to mislead public perception, thereby generating negative impacts on society. Consequently, image forensics has attracted extensive attention from governments and judicial authorities. Due to its less storage space and faster transmission speed, the JPEG format is widely popular in real life [32] . Therefore, researchers have carried out many research works on JPEG images. Examples include JPEG steganography [5, 19, 36, 41] , JPEG steganalysis [12, 20, 26, 40] , double JPEG compression forensics [22, 30, 31] , and JPEG image quantization step estimation [3, 6, 9-11, 13-15, 17, 18, 21, 23, 25, 28, 29, 33-35, 37-39] .In the field of JPEG forensics, if we can accurately estimate the quantization step, we can then get the compression information of the original JPEG image. This serves as a crucial basis for determining whether an image has been tampered with or contains concealed information. For example, in image steganography, the quantization step can provide edge information to correct the steganographic cost and improve security. In steganalysis, existing algorithms tend to be trained for a specific quantization step, which leads to cover source mismatch easily. If researchers can accurately estimate the quantization step, they can design appropriate models for different quality factors (QF) to solve the above problem. In image forensics and localization, Niu et al. [24] segmented the image into several patches. Then, they determined the tampered regions by estimating the quantization step of each patch and attributed multiple tampered regions based on the inconsistency of the quantization matrix.Therefore, the quantization step has become an important parameter in image steganography and image forensics. For a single compressed JPEG image, we can obtain information such as the quantization step from the header file. However, once an image is tampered with, it will inevitably be re-saved. Whether stored in lossless BMP format or lossy JPEG format, the quantization step of the first compression will be overwritten. Therefore, specific algorithms need to be designed to estimate the quantization step. The existing methods for estimating the quantisation step can be divided into traditional methods and deep learning-based methods. Traditional methods estimate the quantization step based on the distribution characteristics of Discrete Cosine Transform (DCT) coefficients. However, in robust environments, noise can alter the distribution of DCT histograms, leading to lower accuracy in traditional algorithms.With the development of deep learning, researchers have proposed some neural network-based methods [6, 23, 29] to estimate the quantization step. Compared to traditional methods that use information from fixed locations to estimate the quantization step. The neural network-based methods use a convolutional kernel to mine the correlation between different locations as auxiliary information to estimate the quantization step. Therefore, these methods perform well on robust environment. The methods in [23] and [29] estimate the quantization step based on spatial domain information. However, the image information loss during JPEG compression is mainly due to quantization errors and truncation/rounding errors, which occur in the frequency domain [6] . Therefore, the frequency domain features tend to contain rich compression traces. The method in [6] estimates the quantization step by mining the information in the frequency domain, so its performance is better than [23] and [29] .However, current methods only consider robustness under double compression and do not take into account the interference of other noises, such as Gaussian filtering, rotation, cropping, triple compression, and so on. To address these issues, we conduct an analysis of spatial domain information and frequency domain information.Although the frequency domain contains more compression traces, this feature is more susceptible to noise interference. Therefore, it exhibits higher accuracy in clean samples, while its accuracy is lower in noisy images. The spatial domain information, on the other hand, is obtained by overlapping the frequency domain information, and thus it is a dispersed compression trace. Therefore, this compression trace is less vulnerable to noise interference, exhibiting stronger robustness. To balance the accuracy and robustness simultaneously, we propose a two-stream network model that allows the two branches of the network to extract compression traces of the image in both the frequency and spatial domains. Furthermore, considering the differences between spatial and frequency domain features, a simple superimposition may result in the omission and conflation of features. As a result, we propose the spatial-frequency domain information fusion module to assign weights to these two features adaptively. Finally, we analyze more deeply the impact of regression and classification models on the accuracy of estimating quantization steps in a robust environment. Compared to the regression model, the classification model has faster convergence and higher accuracy. Consequently, we design an end-to-end classification model and use the cross-entropy loss function to measure the difference between the estimated and true quantization steps.The main contributions of this paper can be summarized as:• We propose a two-stream network based on the Swin Transformer model. The frequency domain features represent deep-level characteristics but exhibit lower robustness. On the other hand, spatial domain features represent shallowlevel characteristics but possess stronger robustness. Therefore, we separately extract these two features to design a highly accurate and robust network. • We propose a Spatial-frequency Information Dynamic Fusion (SIDF) module based on the attention mechanism. By dynamically allocating weights to the characteristics of the frequency and spatial domains, the network can achieve a adaptive feature fusion effect. • We conduct a more in-depth analysis of the differences between classification and regression models in robust environments. Subsequently, we devise an end-to-end classification model to speed up the convergence of the network and further enhance its accuracy. 
related works: 
 Based on the characteristics of JPEG dequantization, the DCT coefficients, after dequantization, are distributed at integer multiples of the quantization step. Luo et al. [18] , after analyzing the quantization error as well as rounding/truncation errors in JPEG, deduced that the DCT coefficients do not align precisely at integer multiples of the quantization step. Instead, they exhibit a higher distribution probability within the range of [-1, +1] multiples of the quantization step. Based on the above findings, Luo et al. [18] deduced that the position where the DCT histogram reaches its peak corresponds to the quantization step. Building upon Luo et al. [18] work, Yang et al. [35] further decomposed the DCT coefficient histogram and devised statistical measures for a factor histogram. They selected the histogram block with the highest index from histograms, surpassing a certain threshold as the quantization step for each frequency. Ye et al. [38] estimated the quantization step by computing the power spectrum of the DCT coefficient histogram. Lin et al. [15] proposed a content-adaptive algorithm that estimates the quantization step based on the Energy Density Spectrum (EDS) of the DCT coefficient histogram and the Fourier transform of the EDS. When dealing with small-sized images, the accuracy of the quantization step estimate tends to degrade rapidly due to the insufficient DCT coefficients available. To address this issue, Yang et al. [34] proposed a clustering-based framework to enhance the accuracy of existing methods. The method involved merging frequency information with the same quantization step through clustering, and then estimating the quantization step using the merged DCT coefficients. Li et al. [14] , by observing the strong correlation between the unique shape of DCT coefficient distribution and quantization steps, designed a function that generates candidate step with similar shapes. They analyzed this function to estimate the quantization step based on this observation. For recompressed images, Bianchi and Piva [3] proposed modeling the distribution of DCT coefficients at a specific frequency as a mixture model of modified and unchanged components. They utilized the mixed model to construct a maximum likelihood estimation function, and then employed the expectation maximum (EM) algorithm to determine the first quantization step for each frequency. In response to the split noise and residual noise generated by secondary compression, Galvan et al. [11] devised a filtering strategy to alleviate the interference caused by these two types of errors. They also developed an error function to determine candidate quantization steps.0 0 0 0 1                             ( ) f x 1 ( ) f x 2 ( ) f x 3 ( ) f x 1 ( ) C N f x - ( ) C N f x 100 C N  ( ) i f x 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1                             ( ) f x 1 ( ) f x 2 ( ) f x 3 ( ) f x 1 ( ) C N f x - ( ) C N f x 100 C N  ( ) i f x Noise DCT Clean ImageWith the rise of deep learning, Niu et al. [23] were the first to introduce a method utilizing a convolutional neural network to estimate the first quantization step. They trained the network as a standard regression problem to estimate the quantization step. Building upon Niu et al. [23] work, Tondi et al. [29] simultaneously considered accuracy and mean squared error in constructing the loss function. Additionally, they introduced a network structure resembling classification methods. Cheng et al. [6] designed a preprocessing in the frequency domain to cluster DCT coefficients at the same frequency. Simultaneously, they introduced the Res2Net-C network architecture, which employs hierarchical connections within residual blocks to capture multi-scale features in images. 
the proposed method: 
 In this section, we will detail the specific aspects of estimating the quantization step through a two-stream network. As depicted in Fig. 1 , we first introduce the two-stream network model designed based on the Swin Transformer architecture. Subsequently, an attention mechanism-based space-frequency information dynamic fusion module is proposed. Finally, an end-to-end classification structure network is proposed to speed up the convergence of the network and improve the accuracy of the algorithm.By analyzing the compression process of JPEG, it can be observed that the image information loss during JPEG compression is mainly due to quantization errors and truncation/rounding errors, which occur in the frequency domain [6] . Therefore, compared to spatial domain information, compression artifacts in the frequency domain are more pronounced and more accessible to acquire. However, when an image is subjected to noise interference, compression artifacts in the frequency domain are also more susceptible to disruption. Therefore, using frequency domain information for feature extraction achieves excellent performance on clean images, but its effectiveness is poor on noisy images. On the other hand, the information in the spatial domain is a stacking of the information in the frequency domain, which contains insignificant traces of compression. Hence, algorithms relying on spatial domain information exhibit lower accuracy on clean images than those utilizing frequency domain information. However, due to the more concealed nature of its compression artifacts, this results in a lesser degree of disruption caused by noise, thereby contributing to the stronger robustness of these algorithms. To balance the robustness and accuracy of the algorithm, we design a two-stream network. The two-streams of the network extract information from the spatial and frequency domains of the image, respectively.In addition, the network models of existing methods are based on traditional CNN [6, 23, 29] . Recently, the Transformer model has achieved significant success in directions such as image classification [8, 16] and object detection [4] . We first attempt to design a network model based on the Transformer model. Cheng et al. [6] have pointed out that multi-scale features in images contribute to extracting compression artifacts. Swin Transformer introduces a hierarchical pathway mechanism that enables information propagation across different levels, thereby obtaining multi-scale information from images. Therefore, we design the network for estimating the quantization step based on the Swin Transformer network.As shown in Fig. 1 , each stream utilizes two Swin Transformer blocks, and each block consists of two submodules. Each submodule comprises a LayerNorm (LN) layer, an attention module, followed by another LN layer, and a multi-layer perceptron (MLP) layer. The first submodule employs the window multi-head selfattention (W-MSA) module, while the second submodule utilizes the shifted window multi-head self-attention (SW-MSA) module. The shift operation between these two submodules facilitates information exchange among windows. For estimating quantization steps, the MSA module allows the network to simultaneously focus on compression artifacts across different dimensions. Additionally, employing self-attention within each head enables the network to allocate varying weights based on the complexity of image textures. This capability allows the network to extract more compression artifacts from regions with high texture complexity. Moreover, the hierarchical architecture within the network enables it to learn multi-scale information from images. The compression process in JPEG typically introduces compression traces and block artifacts, which become more pronounced at different scales. By extracting multi-scale features, the model can better capture these artifacts. Finally, local shifts are allowed between windows in Swin transformer, which allows the network to capture both local and global information. The performance of the algorithm is improved by combining local and global compression traces.FC ean eLU FC E  1 E  S E  F X Mean R X Mean M X ReLU ReLU Mean Mean FC FC FC FC ReLU ReLU Max Max FC FC FC FC s X F X Concatenate C X 2S E  S E  2 1 S  2 1 S R  2 1 S R  2 1 S R  Mean M X Mean R X Max M X Max R X Sigmoid Sigmoid C X SF XWe have obtained image spatial domain and frequency domain features using two-stream network, respectively. However, the frequency domain features are easily extracted shallow features, while the spatial domain represents deep features that are harder to extract. Therefore, a simple superimposition may result in the omission and conflation of features.We propose a SIDF-Module to solve the above problem. This module combines the attention mechanism to dynamically allocate weights to the spatial and frequency domain features. As shown in Fig. 2 , the input of the two-stream network is a spatial domain feature map 𝑋 𝑆 and a frequency domain feature map 𝑋 𝐹 . The size of the feature map is 𝑆 × 𝐸, where 𝑆 represents the spatial dimensions of the feature map, and 𝐸 represents the feature dimension at each spatial position. The process of generating an attention mechanism for the feature map is as follows:First, we perform dimension expansion by merging the feature maps 𝑋 𝑆 and 𝑋 𝐹 into 𝑋 𝐶 .EQUATIONThen, we employ two functions, computing the average and the maximum values, to squeeze the spatial positional feature dimension 𝐸.EQUATION0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1                             ( ) f x 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1                             y 1 ( ) f x 2 ( ) f x 3 ( ) f x 1 ( ) C N f x - ( ) C N f x 1 ( ) y x 2 ( ) y x 3 ( ) y x 1 ( ) C N y x - ( ) C N y x 100 C N  100 C N  ( ) i f x ( ) i y xResize Two-stream Network EQUATIONFollowing that, we employ two Fully Connected (FC) layers to reduce and expand the spatial dimensions, applying the ReLU function directly for non-linear mapping in both operations. Furthermore, the features from the two branches are summed element-wise and then passed through a Sigmoid activation function.𝑋 𝑆𝐹 = Sigmoid 𝑋 Max 𝑅 + 𝑋 Mean 𝑅 (4)Finally, we use residual connection to obtain the fused feature map X𝐶 and assign weights to the spatial features.EQUATIONMost traditional methods for estimating the quantization step are based on the distributional characteristics for the histogram of the DCT coefficients. However, if the image undergoes noise processing, the distribution of DCT coefficients will be altered. This implies that traditional methods have poor robustness. By adding noise to the inputs of the network, it helps the network learn more robust and generalized features. This approach helps to reduce overfitting to the training data and increases the ability of the network to resist interference.The existing neural network-based methods for estimating the quantization step can be divided into regression model-based methods [6, 23] and classification model-based methods [29] . The papers [2, 29] pointed out that for the estimation of discrete numbers, the commonly used approach involves employing the softmax function followed by the cross-entropy function, which aids in the process of backpropagation. Therefore, we further explore the network structure for classification in the environment of adding noise.As shown in Fig. 3 , we design a neural network model with a classification structure. In this architecture, each quantization step 𝑞 𝑖 is encoded as a one-hot vector. We use the more common quantization step for compression, i.e., 𝑞 𝑖 ≤ 100. Therefore, for a given quantization step, the length of its one-hot code is set to 1 × 100. As shown in Fig. 3 , the output of the network after crossentropy is resized to a matrix 𝑓 (𝑥) of size 𝑁 𝐶 × 100. Here, 𝑁 𝐶 represents the number of expected estimated quantization steps. The row vector 𝑓 𝑖 (𝑥) represents the one-hot encoded estimated EQUATIONEQUATIONHere, 𝑞 𝑖 represents the estimated quantization steps and 𝑞 𝑖 represents the true quantization steps. We set the loss function as the cross entropy loss, formulated as follows:EQUATIONIn this formulation, we first calculate the cross-entropy loss for each quantization step and then average all the losses. 
experiments 4.1 experimental settings: 
 Datasets: To evaluate our method, we conducted experiments on three challenging datasets: Uncompressed Color Image Database (UCID) [27] , Raw Images Dataset (RAISE) [7] and Natural Resources Conservation Service (NRCS) [1] . We selected 900 uncompressed images from database. Considering the realistic applications of quantization step in tamper detection and localization, we randomly cropped each image into 10 patches of size 64 × 64. Consequently, we obtained a total of 9, 000 patches. Subsequently, we compressed these patches using quality factors 𝑄𝐹 1 = {60, 65, 70, 75, 80, 85, 90, 95} and stored them in JPEG format. After a single compression 9, 000 × 8 patches were obtained. We divided the training set, validation set, and testing set in a ratio of 6 : 2 : 2. Therefore, a total of 4.32 × 10 4 patches were used for training, 1.44 × 10 4 patches were used for validation and 1.44 × 10 4 patches were used for testing. Finally, we employ MATLAB for random processing of images. These operations include the following five: Gaussian noise with a mean value of 0 and variance ranging from 1 to 8 at intervals of 1. Gaussian filtering with filter kernel of 3 and variance ranging from 0.1 to 0.8 at intervals of 0.1. Double compression with 𝑄𝐹 2 from 65 to 100 at intervals of 5. Triple compression with 𝑄𝐹 2 and 𝑄𝐹 3 from 80 to 100 at intervals of 10.Rotation attacks with angle from 90 to 360 at intervals of 90. Implementation details: We use Adam optimizer with a learning rate of 10 -3 . The batch size for training and testing is set to 80.we train 80 epochs on the network and select the minimum loss epochs from the validation set as the best network.To investigate the ideal performance of the proposed algorithm in the absence of noise attacks, we perform comparative experiments on a single compressed image. As shown in Table 1 shows that the proposed method has the best performance, and the accuracy on the UCID dataset is more than 98% in all cases. Compared with the traditional method, the proposed method is 28% higher than the method in [14] , 36% higher than the method in [35] , and 39% higher than the method in [18] . The reason is that the methods in [18] and [35] estimate the quantization step based on the distributional properties of DCT coefficients histograms. However, the method in [35] further decomposes the DCT coefficients to construct the factor histograms, and thus its accuracy is higher than the method in [18] on high-quality images. The method in [14] represents the distribution of DCT coefficients using mathematical functions, exhibiting higher accuracy on highquality images. However, in small-sized low-quality images, where the DCT coefficients of the image are compressed within the [-1, 1] range, the effective information decreases. Consequently, its accuracy is low under conditions of low-quality images.Several neural network-based methods have been proposed to improve the accuracy of low-quality images. These methods extract traces of the compression process to estimate the quantization step, using convolutional kernels to extract relationships between different frequencies as auxiliary information. Therefore, they can address the issue of insufficient effective information in low-quality images that traditional algorithms encounter. In these neural network-based methods, the proposed method is 1% higher than the method in [6] , 2% higher than the method in [29] , and 47% higher than the method in [23] . The reason is that the methods in [23] and [29] estimate the quantization step by extracting the spatial domain information. However, JPEG information loss occurs mainly in the frequency domain, so information in the spatial domain contains fewer compression traces. Therefore, the accuracy of the spatial domain-based method is lower than that of the frequency domain-based method [6] . The method in [29] Q F 2 O u r s N i u [ 2 3 ] T o n d i [ 2 9 ] C h e n g [ 6 ] L u o [ 1 8 ] Y a n g [ 3 5 ] L i [ 1 4 ](e) UCID Double compression Q F 2 O u r s N i u [ 2 3 ] T o n d i [ 2 9 ] C h e n g [ 6 ] L u o [ 1 8 ] Y a n g [ 3 5 ] L i [ 1 4 ](f) RAISE Double compression [ Q F 2 , Q F 3 ] O u r s N i u [ 2 3 ] T o n d i [ 2 9 ] C h e n g [ 6 ] L u o [ 1 8 ] Y a n g [ 3 5 ] L i [ 1 4 ](g) UCID Triple compression [ Q F 2 , Q F 3 ] O u r s N i u [ 2 3 ] T o n d i [ 2 9 ] C h e n g [ 6 ] L u o [ 1 8 ] Y a n g [ 3 5 ] L i [ 1 4 ] (h) RAISE Triple compressionFigure 4 : Robustness against different noise attacks compared with [6, 14, 18, 23, 29, 35] .the loss function based on the method in [23] and further improves the ability to extract features, so its accuracy is higher than that of [23] .The proposed method extracts information in both spatial and frequency domains and further optimizes the loss function.Therefore, it has the highest accuracy rate.For robustness testing, we add a noise layer to the proposed method and the deep learning-based algorithms [6, 23, 29] during training to ensure experimental fairness. Robustness of the Proposed Method Against Image Gaussian Noise Attacks: Gaussian noise and Gaussian filtering are commonly used methods for assessing robustness. In Fig. 4a and Fig. 4b , as the variance increases, the accuracy of all algorithms decreases. This is due to higher variance leading to increased noise intensity, which has a more significant impact on the image. Consequently, the accuracy of the algorithms shows a declining trend. The accuracy of all three traditional methods in the case of Gaussian noise is less than 10%, which indicates that the traditional methods are unable to resist the Gaussian noise attack. The reason is that the traditional algorithm mainly estimates the quantization step based on the distribution characteristics of the image DCT coefficient histogram. If Gaussian filtering or Gaussian noise is applied to the image, it will affect the distribution of DCT, thus impacting the accuracy of the algorithm.On the other hand, deep learning-based methods extract the compression trace of a whole image, which is less affected by Gaussian filtering and Gaussian noise. Among the three neural network based algorithms, the method in [6] based on frequency domain features is higher than the methods in [23, 29] based on spatial domain features. This indicates that the frequency domain features are more useful for the network to extract compression traces. However, the proposed two-stream network architecture of this approach integrates spatial domain information as auxiliary features on the basis of frequency domain information. It leverages the SIDF-module to harmonize information from both domains. Consequently, the proposed method exhibits the best performance.Robustness of the Proposed Method Against Image Gaussian Filtering Attacks: As shown in Fig. 4c and Fig. 4d , similar to Gaussian noise, the accuracy of these algorithms decreases as the intensity of the noise filtering increases. The proposed method has the highest accuracy and is still greater than 60% when the intensity of Gaussian filtering is highest. It is worth noting that the traditional algorithm still has good performance at 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 ≤ 0.3. However, when 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 > 0.3, the accuracy of the traditional algorithm drops to 20%. The reason for this is that when 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 ≤ 0.3, the Gaussian filtering fails to affect the distribution of the histogram of the DCT coefficients, thus the algorithms remain effective. However, when 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 > 0.3, the Gaussian filtering causes the histogram of the DCT distribution to be severely shifted, thus making these algorithms ineffective.Robustness of the Proposed Method Against Image JPEG compression Attacks: As shown in Fig. 4e and Fig. 4f , we conduct a second compression using 𝑄𝐹 2 = [65, 70, 75, 80, 85, 90, 95, 100] to test the robustness of the algorithm against JPEG compression attacks. As can be seen in Fig. 4e and Fig. 4f , the accuracy of these algorithms increases as the quality factor increases. The reason for this is that the second compression will cover the traces of the first compression. The larger the quality factor, the lesser the compression of the image, the more features are available to estimate the quantization step of the first compression. Consequently, this leads to an increase in accuracy. To further explore the robustness of the algorithm under multiple compression scenarios, as depicted in In this scenario, not only does the second compression cover the traces of the first compression, but the third compression also masks the traces of the first compression, thereby significantly increasing the difficulty in estimating quantization steps. As can be seen in Fig. 4g and Fig. 4h , the accuracy is lower after triple compression than after secondary compression. However, the proposed method achieves the highest accuracy for both secondary compression and triple compression. Robustness of the Proposed Method Against Image Rotation Attacks: Image rotation is a common geometric attack. As shown in Fig. 5 , we rotate the image with 𝑎𝑛𝑔𝑙𝑒 = [90, 180, 270, 360].From Fig. 5 , it can be observed that traditional algorithms fail at rotation angles of [90, 270] degrees while remaining effective at angles of [180, 360] . It is strongly influenced by the angle of rotation. However, the deep learning based methods have good performance for different rotation angles. In which, the accuracy of the proposed method is greater than 90%, which is 10% higher than the method in [6] , 17% higher than the method in [29] , and 72% higher than the method in [23] .To test the generalizability of the algorithm, Table 2 shows the results of training with the UCID and testing with RAISE and NRCS . From Table 2 , it can be seen that the proposed method achieves the best performance in all cases. Taking the RAISE dataset as an example and comparing Fig. 4 with Table 2 , we observe that the proposed algorithm exhibits no significant decrease in accuracy when applied across different databases. In fact, in certain instances of noise attacks, its accuracy even improves. The reason for this is that although the information in the spatial domain varies from different databases. However, the frequency domain is an enriched information of the spatial domain, so the difference of information in the frequency domain between different databases is not significant. The proposed method simultaneously extracts the information in the frequency and spatial domains, and then uses a SIDF-module to dynamically fuse the space-frequency domain features. Therefore, the proposed algorithm is also less affected by database differences and has good generalization.The number of Swin Transformer blocks: We choose one, two and three Swin Transformer blocks for the experiments respectively, and the experiment results are shown in Table 3 . From Table 3 , it can be seen that the accuracy is highest using two blocks, and the accuracy of three blocks is lower than that of two blocks, and one block has the lowest accuracy. The reason is that the network can learn deeper features as the number of blocks increases. Therefore, the accuracy of two blocks is higher than one layer block. However, downsampling in the Swin Transformer network architecture is performed before each Patch Merging to reduce resolution. This results in a fourfold reduction in the size of the feature map. Our proposed network takes an input size of 64 × 64. After one block, the feature map size becomes 32 × 32. After two blocks, the feature map size becomes 16 × 16. After three blocks, the feature map size becomes 8 × 8. Excessively small feature map sizes can cause the neural network to lose crucial compressed information, resulting in lower accuracy for three blocks than two blocks.SIDF module: To test the performance of the SIDF module, we train the network with and without the SIDF module, respectively. As can be seen in Table 3 , we compare the performance of the proposed SIDF module for different databases. The use of the SIDF module results in the best performance in all cases and an average accuracy of at least 2% higher than without the SIDF module. The reason is that spatial domain information represents a relatively shallow yet robust feature, while frequency domain information constitutes a deeper and less robust feature. The SIDF module dynamically integrates spatial and frequency domain information, The !represents the use of the SIDF module, while the ✕ indicates the non-use of the SIDF module.EQUATIONachieving optimal fusion effects. Therefore, the accuracy of the SIDF module is higher than that of the non-SIDF module. The number of branches in the network: As shown in Table 4 , we test the performance of using spatial domain stream, using frequency domain stream and fusing spatial frequency domain stream, respectively. Where, Sp represents the use of the space stream, Fre represents the use of the frequency stream and Sp&Fre represents the use of the space and frequency stream. From the Table 4 , it can be seen that the frequency domain stream performs better than the spatial domain stream on clean images, but worse than the spatial domain stream on noisy images. This indicates that the frequency domain information is more suitable for estimating the quantisation step for clean images. However, for noisy images, the introduction of noise interferes with the distribution of the DCT. Therefore, frequency domain information performs poorly on noisy images. The proposed method fuses the spatial and frequency domain information through the SIDF module, which improves the robustness while taking into account the high accuracy. As a result, the accuracy of the two stream network is the highest on both clean and noisy images.The performance of classification and regression models: As shown in Table 5 , we demonstrate the performance of the classification and regression models at the quantization steps. Where, Clas represents classification models and Reg represents regression models. The methods in [2, 29] pointed out that for the estimation of discrete numbers, the commonly used approach involves employing the softmax function followed by the cross-entropy function, which aids in the process of backpropagation. Quantisation steps are typically discrete numbers, so the classification model helps the network to dig out deeper compression traces into improving the accuracy. As shown in the Table 5 , the average accuracy using the classification model is 6%-8% higher than regression. In this paper, we propose a two-branch network structure based on Swin Transformer. This two-branch network structure can extract the information in the spatial domain information with high robustness and frequency domain information with high accuracy, respectively. Moreover, we propose the SIDF-module to adaptively assign the weights of spatial domain features and frequency domain features. To further improve the performance of the algorithm on noisy images, we design a network with a classification structure to speed up the convergence of the network and improve the accuracy of the algorithm. Experiment results show that our method performs best on clean or noisy images. 
 
 Appendix:  


Decision: This paper received overall positive review comments. AC agrees with the reviewers to accept this paper. Congratulations! Please add the rebuttal contents to the final camera-ready version.

Reviews: review: paper_summary: paper_summary: This paper presents a novel approach to JPEG image forensics, focusing on the estimation of quantization steps, which are critical for detecting image tampering and compression history. The authors propose a two-stream network structure utilizing the Swin Transformer to enhance robustness and accuracy. The spatial domain stream captures robust but less accurate features, while the frequency domain stream captures accurate but less robust features. They introduce a Spatial-frequency Information Dynamic Fusion (SIDF) module to dynamically fuse these features, and convert the network from a regression to a classification model to improve performance.
strength_weakness: strength_weakness: Innovative Network: The combination of spatial and frequency domain features using the Swin Transformer is a novel approach that leverages the strengths of both feature types to enhance the robustness and accuracy of quantization step estimation.
Comprehensive Experiments: The authors provide extensive experiments, demonstrating that their method achieves over 98% accuracy on clean images and maintains over 81% accuracy in robust environments.
The motivation for the model is clearly described: an analysis of the characteristics of existing models is provided, including the reasons for the low accuracy of spatial-domain features and the low robustness of frequency-domain features. The rationale for combining time-domain and frequency-domain features is well-explained.
limitations: limitations: 1. Lack of interpretability in the model classification module: The authors design a neural network model with a classification structure instead of a regression structure to estimate the model's quantization step size, but they do not delve into the reasons for this design.
2. Complexity of the Model: The proposed two-stream network, while innovative, adds significant complexity compared to traditional methods. This might hinder its practical application.
3. End-to-End Training Complexity: The transition to an end-to-end classification model introduces additional training complexity. More discussion on the training process and computational requirements would be beneficial for readers considering practical implementations.
4. Limited Robustness Scenarios: Although the method shows robustness in some scenarios, the experiments do not cover all possible types of noise and distortions that can affect JPEG images. Further testing under a wider range of conditions would strengthen the claims of robustness.
paper_summary: paper_summary: This paper proposes a two-stream network classification model based on Swin Transformer architecture for estimating the quantization step of JPEG images. The proposal extracts features from both spatial and frequency domains and introduces a Spatial-frequency Information Dynamic Fusion (SIDF) module.
strength_weakness: strength_weakness: This paper presents a learned approach to quantization step estimation, which is a crucial aspect of image forensics. The two-stream network model can extract features from spatial and frequency domains, potentially leading to more accurate and robust estimations. The Spatial-frequency Information Dynamic Fusion (SIDF) module allows feature fusion. It has comprehensive discussions for evaluation, considering various noise conditions and comparing them with existing methods.
limitations: limitations: The novelty of the research method in this paper is insufficient and there are several problems. 
The paper proposes a two-stream network with feature fusion, but feature fusion is a commonly used trick in the CV field.
In the ablation study,  the basic Swin Transformer block seems to bring more improvements than feature fusion. In addition, in Table 3 and Table 4, the experimental settings do not seem clear. Also, it seems that the accuracy of the proposed method (the accuracy of two blocks with SIDF module) cannot correspond to the above.
The paper does not discuss in detail the computational complexity of the proposed method, which could be a concern for practical applications. 
It also does not provide a clear explanation of how the proposed method would perform on images of different sizes. 
While the paper mentions the differences between classification and regression models, it does not delve into the specific details of the comparison.
paper_summary: paper_summary: This paper proposes a two-stream network approach for estimating the quantization step of JPEG images, aiming to improve robustness against various noise attacks. The network consists of two parallel streams: one for extracting spatial domain features and the other for frequency domain features. A SIDF module is introduced to dynamically assign weights to the two feature domains.
strength_weakness: strength_weakness: 1. This paper introduces a novel network method for quantization step estimation in JPEG images, aimed at enhancing estimation robustness. This motivation is promising.

2. The two-stream network architecture extracts both spatial and frequency domain features, leveraging their respective strengths in robustness and accuracy.
limitations: limitations: 1. In Section 1, this paper states that spatial domain features exhibit stronger robustness. However, the experiments detailed in Section 4.3 reveal that spatial domain methods do not demonstrate superior robustness when compared to frequency domain methods. This raise questions about the correctness of the initial statement.

2. In Section 1, the paper discusses how quantization step estimation can assist in identifying tampered or concealed information. However, it lacks experimental content related to image steganalysis for addressing these steganography methods, such as [a] and [b].

3. In Section 4.3, the selection of noise types utilized in the robustness experiments warrants further consideration. Including a broader range of noise types, such as Crop, Resize, Salt & Pepper, Style Transfer, and Superimpose Noise, could provide a more comprehensive evaluation of robustness.

4. In Section 4.5, the ablation study should not solely focus on accuracy evaluation but should also encompass robustness evaluation.

[a] Kaimeng Chen, Qingxiao Guan, Weiming Zhang, and Nenghai Yu. Reversible data hiding in encrypted images based on binary symmetric channel model and polar code. TDSC. 2023.
[a] Zijin Yang, Kejiang Chen, Kai Zeng, Weiming Zhang, and Nenghai Yu. 2024. Provably Secure Robust Image Steganography. TMM. 2024.
paper_summary: paper_summary: This paper proposes a two-stream network to robustly and accurately estimate the quantization step of JPEG images. The Swin Transformer is employed to build a two-branch network to extract compression traces of the image in both the frequency and spatial domains. The features from the two domains are then merged and classified to attain the quantization step. The experimental results show the average accuracy of the proposed method for both clean and noisy images.
strength_weakness: strength_weakness: 1. The two-stream network takes advantage of the frequency domain features with deep-level characteristics and the spatial domain features with stronger robustness to allow highly accurate estimation.
2. Based on the attention mechanism, a Spatial-frequency Information Dynamic Fusion (SIDF) module is developed to adaptively fuse the features in two domains.
3. The network is constructed as a classification model in replace of a regression model.
limitations: limitations: 1. There are some irregularities in the writing of the paper. In line 744, the grammar is incorrect. In Table 2, the results of the proposed method are bolded even where it performs worse. The conclusion is not presented as a separate section.
2. Data augmentation is applied during training, which improves the robustness. However, the comparative methods did not introduce data augmentation, so the performance improvement of the proposed method may be attributed to data augmentation.
3. There is no comparison with other methods in terms of computational complexity in the experiments.
4. There is no analysis of the differences between classification models and regression models.