Abstract
As one of the most important topics in image forensics, median filtering detection has developed rapidly in recent years. However, the robustness to JPEG compression is still challenging, especially for small image blocks and low quality compression. We find that when an image is undergone successively median filtering and JPEG compression operations, the median filtering residual (MFR) between the sequential two versions tends to converge. However, the convergence rate for the median filtered image is pretty faster than that for the original one. Based on this, in this paper, we present a JPEG image median filtering forensic method using both spatial and frequency domain residuals. To measure the convergence rate, the nonzero coefficients together with autoregressive coefficients of multiple MFRs are extracted in the spatial domain. Furthermore, a calibration strategy based on image sharpening is proposed in the frequency domain for capturing the convergence difference of MFRs between unaltered and median filtered images. Finally, the complementary features extracted in the two domains are concatenated for the detection task. Experimental results demonstrate the proposed approach is able to accurately detect median filtering and outperforms some state-of-the-art methods, especially in the scenario of small image blocks.









Similar content being viewed by others
Data availability
No datasets were generated or analyzed during the current study.
References
Horng S-J, Rosiyadi D, Fan P, Wang X, Khan MK (2014) An adaptive watermarking scheme for e-government document images. Multim Tools Appl 72(3):3085–3103
Horng S-J, Rosiyadi D, Li T, Takao T, Guo M, Khan MK (2013) A blind image copyright protection scheme for e-government. J Vis Commun Image Represent 24(7):1099–1105
Rosiyadi D, Horng S-J, Fan P, Wang X, Khan MK, Pan Y (2012) Copyright protection for e-government document images. IEEE Multim 19(03):62–73
Li J, Li X, Yang B, Sun X (2014) Segmentation-based image copy-move forgery detection scheme. IEEE Trans Inf Forensics Secur 10(3):507–518
Su Z, Li M, Zhang G, Wu Q, Wang Y (2023) Robust audio copy-move forgery detection on short forged slices using sliding window. J Inf Secur Appl 75:103507
Akdeniz F, Becerikli Y (2024) Recurrent neural network and long short-term memory models for audio copy-move forgery detection: a comprehensive study. J Supercomput 80:1–31
Bi X, Wei Y, Xiao B, Li W (2019) RRU-Net: the ringed residual U-Net for image splicing forgery detection. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops
Xu D, Shen X, Huang Y, Shi Z (2023) RB-Net: integrating region and boundary features for image manipulation localization. Multim Syst 29(5):3055–3067
Wu H, Zhou J (2021) IID-Net: image inpainting detection network via neural architecture search and attention. IEEE Trans Circuits Syst Video Technol 32(3):1172–1185
Xiao F, Zhang Z, Yao Y (2023) CTNet: hybrid architecture based on CNN and transformer for image inpainting detection. Multim Syst 29(6):3819–3832
Niu Y, Zhao Y, Ni R (2017) Robust median filtering detection based on local difference descriptor. Signal Process: Image Commun 53:65–72
Sharma S, Ravi H, Subramanyam AV, Emmanuel S (2020) Anti-forensics of median filtering and contrast enhancement. J Vis Commun Image Represent 66:102682
Barni M, Bondi L, Bonettini N, Bestagini P, Costanzo A, Maggini M, Tondi B, Tubaro S (2017) Aligned and non-aligned double JPEG detection using convolutional neural networks. J Vis Commun Image Represent 49:153–163
Billa NR, Das BP, Biswal M, Okade M (2024) CNN based image resizing forensics for double compressed jpeg images. J Inf Secur Appl 81:103693
Cheng X, Wang J, Wang H, Luo X, Ma B (2023) Quantization step estimation of color images based on Res2Net-C with frequency clustering prior knowledge. IEEE Trans Circuits Syst Video Technol 34:632–646
Shan W, Yi Y, Huang R, Xie Y (2019) Robust contrast enhancement forensics based on convolutional neural networks. Signal Process: Image Commun 71:138–146
Bi X, Shang Y, Liu B, Xiao B, Li W, Gao X (2022) A versatile detection method for various contrast enhancement manipulations. IEEE Trans Circuits Syst Video Technol 33(2):491–504
Peng L, Liao X, Chen M (2021) Resampling parameter estimation via dual-filtering based convolutional neural network. Multim Syst 27(3):363–370
Lu W, Zhang Q, Luo S, Zhou Y, Huang J, Shi Y-Q (2021) Robust estimation of upscaling factor on double JPEG compressed images. IEEE Trans Cybern 52(10):10814–10826
Kirchner M, Fridrich J (2010) On detection of median filtering in digital images. In: Media forensics and security II, vol 7541. SPIE, pp 371–382
Cao G, Zhao Y, Ni R, Yu L, Tian H (2010) Forensic detection of median filtering in digital images. In: 2010 IEEE international conference on multimedia and expo. IEEE, pp 89–94
Yuan H-D (2011) Blind forensics of median filtering in digital images. IEEE Trans Inf Forensics Secur 6(4):1335–1345
Chen C, Ni J, Huang J (2013) Blind detection of median filtering in digital images: a difference domain based approach. IEEE Trans Image Process 22(12):4699–4710
Kang X, Stamm MC, Peng A, Liu KR (2013) Robust median filtering forensics using an autoregressive model. IEEE Trans Inf Forensics Secur 8(9):1456–1468
Zhang Y, Li S, Wang S, Shi YQ (2014) Revealing the traces of median filtering using high-order local ternary patterns. IEEE Signal Process Lett 21(3):275–279
Gao H, Gao T, Cheng R (2020) Robust detection of median filtering based on data-pair histogram feature and local configuration pattern. J Inf Secur Appl 53:102506
Agarwal S, Jung K-H (2022) Median filtering forensics based on optimum thresholding for low-resolution compressed images. Multim Tools Appl 81(5):7047–7062
Agarwal S, Jung K-H (2023) Median filtering detection using optimal multi-direction threshold on higher-order difference pixels. Multim Tools Appl 82(20):30875–30893
Li W, Ni R, Li X, Zhao Y (2019) Robust median filtering detection based on the difference of frequency residuals. Multim Tools Appl 78:8363–8381
Gupta A, Singhal D (2019) A simplistic global median filtering forensics based on frequency domain analysis of image residuals. ACM Trans Multim Comput Commun Appl (TOMM) 15(3):1–23
Chen J, Kang X, Liu Y, Wang ZJ (2015) Median filtering forensics based on convolutional neural networks. IEEE Signal Process Lett 22(11):1849–1853
Tang H, Ni R, Zhao Y, Li X (2018) Median filtering detection of small-size image based on CNN. J Vis Commun Image Represent 51:162–168
Zhang J, Liao Y, Zhu X, Wang H, Ding J (2020) A deep learning approach in the discrete cosine transform domain to median filtering forensics. IEEE Signal Process Lett 27:276–280
Wendt P, Coyle E, Gallagher N (1986) Some convergence properties of median filters. IEEE Trans Circuits Syst 33(3):276–286
Nodes T, Gallagher N (1983) Two-dimensional root structures and convergence properties of the separable median filter. IEEE Trans Acoust Speech Signal Process 31(6):1350–1365
Schaefer G, Stich M (2003) UCID: an uncompressed color image database. In: Storage and retrieval methods and applications for multimedia 2004, vol 5307. SPIE, pp 472–480
Bas P, Filler T, Pevnỳ T (2011) "Break Our Steganographic System": the ins and outs of organizing boss. In: International workshop on information hiding. Springer, pp 59–70
Gloe T, Böhme R (2010) The ‘Dresden Image Database’ for benchmarking digital image forensics. In: Proceedings of the 2010 ACM symposium on applied computing, pp 1584–1590
Chang C-C, Lin C-J (2011) LIBSVM: a library for support vector machines. ACM Trans Intell Syst Technol (TIST) 2(3):1–27
Yang J, Xie J, Zhu G, Kwong S, Shi Y-Q (2014) An effective method for detecting double jpeg compression with the same quantization matrix. IEEE Trans Inf Forensics Secur 9(11):1933–1942
Niu Y, Li X, Zhao Y, Ni R (2021) Detection of double jpeg compression with the same quantization matrix via convergence analysis. IEEE Trans Circuits Syst Video Technol 32(5):3279–3290
Acknowledgements
This work was supported in part by the National Natural Science Foundation of China (Grant No. 62202141), the Science and Technology Research Project of Henan Province (Grant No. 242102210062), and the Science and Technology Project of State Administration for Market Regulation (Grant No. 2023MK082).
Author information
Authors and Affiliations
Contributions
Yakun Niu: Conceptualization, Methodology, Validation.Xiangru Chen: Investigation, Data curation. Hongjian Yin: Supervision, Conceptualization, Review.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix
Appendix
According to Eqs. (1) and (2), the median filtering detection task can be viewed as to distinguish between \(X_1\) and \(X_2\). Next, we will investigate Eq. (2) in the following three cases:
Case #1: \(Y_1=X_1\) (i.e., \(X_1=\text {med}_{w}\{X_{1}\}\)).
Thus we have:
where \(\varepsilon\) is the compression error. The median filtering detection is equivalent to double JPEG compression detection with the same quantization matrix [40, 41]. Thus, the proposed frequency domain features can play a key role in the detection task.
Case #2: \(Y_1=\text {JPG}\{Y_1\}\).
\(X_2\) can be given by:
The detection is only for uncompressed images and our spatial domain features are the solution.
Case #3: \(Y_1\ne X_1\), \(Y_1\ne \text {JPG}\{Y_1\}\).
We have that:
For this case, the spatial and frequency domain residuals concatenated features complement each other for median filtering detection.
Based on the above three cases analysis, our proposed detection features in both the spatial and frequency domains are more discriminative than those extracted only in the spatial or frequency domain.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Niu, Y., Chen, X. & Yin, H. Median filtering forensics using spatial and frequency domain residuals. J Supercomput 81, 586 (2025). https://doi.org/10.1007/s11227-025-07099-9
Accepted:
Published:
DOI: https://doi.org/10.1007/s11227-025-07099-9