A Hybrid Decision-Making Adaptive Median Filtering Algorithm with Dual-Window Detection and PSO Co-Optimization
Abstract
1. Introduction
- (1)
- Aiming at the defects of the traditional fixed window for noise detection, a dual-window cooperative detection and dynamic adaptation strategy was proposed. A 3 × 3 small window was used to quickly screen noise, combined with a 5 × 5–35 × 35 dynamic large window to adaptively expand the detection range, enhance noise recognition accuracy in complex scenes, and balance detection efficiency and accuracy by cascading the large and small windows.
- (2)
- The particle swarm optimization algorithm was applied to address the problem of traditional filtering requiring manual parameter adjustment and having poor generalization. Taking PSNR as the target, the optimal parameters of 5 × 5–35 × 35 windows were searched automatically to realize the adaptive adjustment of different noise densities, which solved the limitation of traditional filtering relying on manual parameter adjustment.
- (3)
- Aiming at the problem that traditional filtering often blurs image edges, this study proposed a weighted averaging mechanism based on spatial distance. The weight model was constructed based on the Gaussian kernel; weights were assigned according to the inter-pixel distance, and high weights were given to near distances, which effectively preserved the image edges and texture details when removing pepper noise.
- (4)
- Aiming at the problem of a single traditional filtering strategy, this paper proposed a hybrid decision-making strategy. By analyzing the pixel characteristics of the double window and judging the degree of noise and texture complexity, the median filtering, weighted average, or original value retention strategy was adaptively selected to achieve accurate denoising and efficiency optimization in different scenarios.
2. Basic Principles
2.1. Adaptive Median Filtering (AMF)
Algorithm 1 Adaptive Median Filtering |
1: . |
2: of the image block. |
3: then |
4: go to step 11. |
5: |
6: end if |
7: then |
8: go to step 2. |
9: |
10: end if |
11: then |
12: |
13: |
14: end if |
2.2. Particle Swarm Optimization Algorithm (PSO)
3. Method
3.1. Dual-Window Layered Noise Detection Model
3.2. Hybrid Filtering Decision Model
3.3. PSO Dynamic Parameter Optimization Model
3.3.1. Optimization Objective
3.3.2. PSO Design and Implementation
4. Experimental Results and Analyses
4.1. Image Quality Evaluation Methods
4.2. Test Results
4.2.1. Grayscale Image Test
4.2.2. Color Image Testing
5. Conclusions and Outlook
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Azzeh, J.; Zahran, B.; Alqadi, Z. Salt and pepper noise: Effects and removal. JOIV Int. J. Inform. Vis. 2018, 2, 252–256. [Google Scholar] [CrossRef]
- Jin, Y.Y.; Han, X.W.; Zhou, S.N. A review of image enhancement algorithms. Comput. Syst. Appl. 2021, 30, 18–27. [Google Scholar]
- Chen, P.Y.; Lien, C.Y. An efficient edge-preserving algorithm for removal of salt-and-pepper noise. IEEE Signal Process. Lett. 2008, 15, 833–836. [Google Scholar] [CrossRef]
- Zhang, X.; Xiong, Y. Impulse noise removal using directional difference based noise detector and adaptive weighted mean filter. IEEE Signal Process. Lett. 2009, 16, 295–298. [Google Scholar] [CrossRef]
- Gupta, V.; Chaurasia, V.; Shandilya, M. Random-valued impulse noise removal using adaptive dual threshold median filter. J. Vis. Commun. Image Represent. 2015, 26, 296–304. [Google Scholar] [CrossRef]
- Chan, R.H.; Ho, C.-W.; Nikolova, M. Salt-and-pepper noise removal by median-type noise detectors and detail-preserving regularization. IEEE Trans. Image Process. 2005, 14, 1479–1485. [Google Scholar] [CrossRef]
- Tyan, S.G. Median filtering: Deterministic properties. In Two-Dimensional Digital Signal Prcessing II: Transforms and Median Filters; Springer: Berlin/Heidelberg, Germany, 2006; Volume 43, pp. 197–217. [Google Scholar]
- Yang, Z.W.; Zheng, L.L.; Qu, H.S. Research on noise reduction algorithm of joint mean filtering and Poisson kernel bilateral filtering. Comput. Simul. 2020, 37, 460–463. [Google Scholar]
- Goel, N.; Kaur, H.; Saxena, J. Modified decision-based unsymmetric adaptive neighborhood trimmed-mean filter for removal of very high-density salt and pepper noise. Multimed. Tools Appl. 2020, 79, 19739–19768. [Google Scholar] [CrossRef]
- Brownrigg, D.R. The weighted median filter. Commun. ACM 1984, 27, 807–818. [Google Scholar] [CrossRef]
- Wang, Y.; Wang, J.; Song, X.; Han, L. An efficient adaptive fuzzy switching weighted mean filter for salt-and-pepper noise removal. IEEE Signal Process. Lett. 2016, 23, 1582–1586. [Google Scholar] [CrossRef]
- Hwang, H.; Haddad, R.A. Adaptive median filters: New algorithms and results. IEEE Trans. Image Process. 1995, 4, 499–502. [Google Scholar] [CrossRef]
- Riji, R.; Pillai, K.A.S.; Nair, M.S.; Wilscy, M. Fuzzy-based directional weighted median filter for impulse noise detection and reduction. Fuzzy Inf. Eng. 2012, 4, 351–369. [Google Scholar]
- Wang, W.; Du, W.; Li, Y.; Jia, Z. Advanced Adaptive Median Filter for Reducing Salt-and-Pepper Noise in GPR Data. IEEE Geosci. Remote Sens. Lett. 2025, 22, 3532986. [Google Scholar] [CrossRef]
- Guo, H.J.; Bai, W.J. Adaptive iterative mean filtering algorithm for removing image pretzel noise. J. Taiyuan Coll. (Nat. Sci. Ed.) 2020, 38, 23–28. [Google Scholar]
- Zhang, J.S.; Chen, M.J.; Xiong, X.Z. An adaptive nonlocal mean filter for removing pretzel noise. J. Sichuan Univ. Sci. Eng. (Nat. Sci. Ed.) 2022, 35, 59–65. [Google Scholar]
- Li, Z.X.; Yang, Y.; Huang, S.S.; Zhao, X.H.; Dong, Y.Y. Research on the fusion algorithm of mean and fast median filtering with adaptive weights. Comput. Digit. Eng. 2024, 52, 700–704. [Google Scholar]
- Fu, B.; Zhao, X.; Li, Y.; Wang, X.; Ren, Y. A convolutional neural networks denoising approach for salt and pepper noise. Multimed. Tools Appl. 2019, 78, 30707–30721. [Google Scholar] [CrossRef]
- Putra, B.P.E.; Prasetyo, H.; Suryani, E. Residual Transformer Fusion Network for Salt and Pepper Image Denoising. arXiv 2025, arXiv:2502.09000. [Google Scholar]
- Rafiee, A.A.; Farhang, M. A deep convolutional neural network for salt-and-pepper noise removal using selective convolutional blocks. Appl. Soft Comput. 2023, 145, 110535. [Google Scholar] [CrossRef]
- Siddique, M.F.; Saleem, F.; Umar, M.; Kim, C.H.; Kim, J.-M. A Hybrid Deep Learning Approach for Bearing Fault Diagnosis Using Continuous Wavelet Transform and Attention-Enhanced Spatiotemporal Feature Extraction. Sensors 2025, 25, 2712. [Google Scholar] [CrossRef]
- Zhou, J.X.; Zhou, F.Q. Wavelet denoising analysis based on improved cooperative quantum particle swarm optimization. Electron. Opt. Control. 2022, 29, 47–50. [Google Scholar]
- Hassan, F.; Rahim, L.A.; Mahmood, A.K.; Abed, S.A. A hybrid particle swarm optimization-based wavelet threshold denoising algorithm for acoustic emission signals. Symmetry 2022, 14, 1253. [Google Scholar] [CrossRef]
- Jain, M.; Saihjpal, V.; Singh, N.; Singh, S.B. An Overview of Variants and Advancements of PSO Algorithm. Appl. Sci. 2022, 12, 8392. [Google Scholar] [CrossRef]
- Elsayed, E.K.; Salem, D.R.; Aly, M. A Fast Quantum Particle Swarm Optimization Algorithm for Image Denoising Problem. Int. J. Intell. Eng. Syst. 2020, 13, 98–112. [Google Scholar] [CrossRef]
- Wang, G.; Guo, S.; Han, L.; Cekderi, A.B.; Song, X.; Zhao, Z. Asymptomatic COVID-19 CT image denoising method based on wavelet transform combined with improved PSO. Biomed. Signal Process. Control. 2022, 76, 103707. [Google Scholar] [CrossRef]
- Garncarek, Ł.; Powalski, R.; Stanisławek, T. LAMBERT: Layout-aware language modeling for information extraction. In Proceedings of the International Conference on Document Analysis and Recognition, Lausanne, Switzerland, 5–10 September 2021; pp. 532–547. [Google Scholar]
- Loupas, T.; McDicken, W.N.; Allan, P.L. An adaptive weighted median filter for speckle suppression in medical ultrasonic images. IEEE Trans. Circuits Syst. 2002, 36, 129–135. [Google Scholar] [CrossRef]
Methods | 30% | 40% | 50% | 60% | 70% | 80% | 90% | 95% |
---|---|---|---|---|---|---|---|---|
MF | 23.49 | 22.18 | 20.45 | 19.27 | 17.52 | 15.59 | 13.01 | 11.96 |
WMF | 26.28 | 25.16 | 23.79 | 22.18 | 21.11 | 19.54 | 13.84 | 13.05 |
AMF | 28.99 | 27.36 | 25.93 | 24.52 | 22.99 | 21.32 | 19.11 | 17.22 |
AWMF | 29.18 | 27.62 | 26.37 | 24.96 | 23.57 | 22.19 | 19.96 | 18.34 |
Literature [16] | 29.22 | 27.96 | 26.39 | 25.21 | 23.72 | 23.01 | 21.49 | 20.27 |
Literature [17] | 29.47 | 28.12 | 26.94 | 25.47 | 24.16 | 23.47 | 22.06 | 20.67 |
Ours | 30.03 | 28.79 | 27.46 | 26.24 | 25.37 | 24.53 | 22.91 | 21.31 |
Methods | 30% | 40% | 50% | 60% | 70% | 80% | 90% | 95% |
---|---|---|---|---|---|---|---|---|
MF | 0.7478 | 0.7144 | 0.6557 | 0.6041 | 0.5342 | 0.5017 | 0.3795 | 0.3379 |
WMF | 0.8206 | 0.7958 | 0.7548 | 0.6704 | 0.6299 | 0.5751 | 0.4119 | 0.3692 |
AMF | 0.9181 | 0.8895 | 0.8548 | 0.8102 | 0.7483 | 0.6651 | 0.5368 | 0.427 |
AWMF | 0.9194 | 0.8907 | 0.8621 | 0.8197 | 0.7529 | 0.6725 | 0.5439 | 0.4317 |
Literature [16] | 0.9225 | 0.8986 | 0.8683 | 0.8297 | 0.7996 | 0.7694 | 0.7041 | 0.6337 |
Literature [17] | 0.9297 | 0.9001 | 0.8702 | 0.8341 | 0.8026 | 0.7726 | 0.7087 | 0.6397 |
Ours | 0.9389 | 0.9051 | 0.8779 | 0.8418 | 0.8141 | 0.7801 | 0.7137 | 0.6451 |
Image | Method | 50% | 60% | 70% | 80% | 90% | 95% |
---|---|---|---|---|---|---|---|
C.man | WMF | 21.53 | 20.73 | 18.60 | 16.68 | 13.74 | 12.96 |
AMF | 24.19 | 22.71 | 21.28 | 19.61 | 17.76 | 16.29 | |
AWMF | 24.33 | 23.06 | 22.07 | 20.37 | 18.12 | 16.94 | |
Literature [16] | 24.52 | 23.41 | 22.96 | 22.03 | 20.73 | 19.24 | |
Literature [17] | 24.67 | 23.62 | 23.02 | 22.11 | 20.86 | 19.73 | |
Ours | 24.94 | 23.74 | 23.11 | 22.27 | 20.97 | 19.99 | |
Lena | WMF | 27.42 | 25.43 | 23.94 | 21.12 | 19.37 | 18.11 |
AMF | 30.28 | 28.75 | 27.05 | 24.94 | 22.21 | 19.72 | |
AWMF | 30.41 | 28.99 | 27.88 | 25.27 | 22.67 | 20.17 | |
Literature [16] | 30.96 | 29.96 | 29.06 | 28.26 | 26.51 | 24.79 | |
Literature [17] | 31.14 | 30.07 | 29.18 | 28.31 | 26.58 | 24.89 | |
Ours | 31.25 | 30.21 | 29.41 | 28.54 | 26.81 | 25.08 | |
Boat | WMF | 24.41 | 22.67 | 20.96 | 18.03 | 16.25 | 15.77 |
AMF | 27.02 | 25.61 | 24.35 | 22.42 | 18.63 | 18.38 | |
AWMF | 27.21 | 25.92 | 24.61 | 23.37 | 19.59 | 19.23 | |
Literature [16] | 27.79 | 26.75 | 25.92 | 24.86 | 22.27 | 22.16 | |
Literature [17] | 27.86 | 26.82 | 26.07 | 25.12 | 22.42 | 22.37 | |
Ours | 27.92 | 26.97 | 26.30 | 25.39 | 22.69 | 22.65 |
Image | Method | 50% | 60% | 70% | 80% | 90% | 95% |
---|---|---|---|---|---|---|---|
C.man | WMF | 0.7093 | 0.6887 | 0.6135 | 0.5545 | 0.4792 | 0.4018 |
AMF | 0.8553 | 0.8124 | 0.7588 | 0.6852 | 0.5865 | 0.5104 | |
AWMF | 0.8582 | 0.8187 | 0.7673 | 0.6948 | 0.5961 | 0.5227 | |
Literature [16] | 0.8625 | 0.8192 | 0.7994 | 0.7512 | 0.6823 | 0.6317 | |
Literature [17] | 0.8681 | 0.8225 | 0.8001 | 0.7579 | 0.6910 | 0.6492 | |
Ours | 0.8731 | 0.8387 | 0.8085 | 0.7678 | 0.7092 | 0.6581 | |
Lena | WMF | 0.7976 | 0.7762 | 0.7358 | 0.6717 | 0.6238 | 0.4927 |
AMF | 0.8911 | 0.8568 | 0.8097 | 0.7396 | 0.6278 | 0.5170 | |
AWMF | 0.8922 | 0.8605 | 0.8221 | 0.7427 | 0.6693 | 0.5199 | |
Literature [16] | 0.8946 | 0.8714 | 0.8532 | 0.8226 | 0.6997 | 0.7314 | |
Literature [17] | 0.8994 | 0.8776 | 0.8555 | 0.8291 | 0.7902 | 0.7386 | |
Ours | 0.9061 | 0.8831 | 0.8609 | 0.8359 | 0.7981 | 0.7411 | |
Boat | WMF | 0.7060 | 0.6457 | 0.5713 | 0.4972 | 0.3692 | 0.3429 |
AMF | 0.8248 | 0.7753 | 0.7132 | 0.6190 | 0.3935 | 0.3921 | |
AWMF | 0.8283 | 0.7802 | 0.7211 | 0.6271 | 0.4037 | 0.4067 | |
Literature [16] | 0.8342 | 0.7996 | 0.7795 | 0.7182 | 0.5901 | 0.5814 | |
Literature [17] | 0.8401 | 0.8101 | 0.7721 | 0.7203 | 0.5973 | 0.5892 | |
Ours | 0.8477 | 0.8121 | 0.7784 | 0.7361 | 0.6004 | 0.5943 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mao, J.; Sun, L.; Chen, J. A Hybrid Decision-Making Adaptive Median Filtering Algorithm with Dual-Window Detection and PSO Co-Optimization. Modelling 2025, 6, 85. https://doi.org/10.3390/modelling6030085
Mao J, Sun L, Chen J. A Hybrid Decision-Making Adaptive Median Filtering Algorithm with Dual-Window Detection and PSO Co-Optimization. Modelling. 2025; 6(3):85. https://doi.org/10.3390/modelling6030085
Chicago/Turabian StyleMao, Jing, Lianming Sun, and Jie Chen. 2025. "A Hybrid Decision-Making Adaptive Median Filtering Algorithm with Dual-Window Detection and PSO Co-Optimization" Modelling 6, no. 3: 85. https://doi.org/10.3390/modelling6030085
APA StyleMao, J., Sun, L., & Chen, J. (2025). A Hybrid Decision-Making Adaptive Median Filtering Algorithm with Dual-Window Detection and PSO Co-Optimization. Modelling, 6(3), 85. https://doi.org/10.3390/modelling6030085