Atom Indonesia
1A Comparative Study of Median and Mean Filters for
2Noise Reduction in Digital Radiographic Imaging
3
6
7A RTICLE INFO ABSTRACT
8
AIJ use only:
Received date This study investigates the effectiveness of median and mean filtering techniques
Revised date in reducing noise in digital radiographic images. Four noise levels (20%, 40%,
Accepted date 60%, and 80%) were added to thoracic X-ray images to simulate degradation. Each
noisy image was processed using mean and median filters with kernel sizes of 5×5,
7×7, and 11×11. The filtered outputs were evaluated subjectively and objectively
Keywords:
using Peak Signal to Noise Ratio (PSNR) and Mean Squared Error (MSE). Results
Digital Radiography showed that the median filter consistently produced better image quality,
Noise Reduction particularly at higher noise levels, with higher PSNR and lower MSE values. The
Median Filter 5×5 kernel was optimal for low noise levels, while the 11×11 kernel performed
Mean Filter better at higher noise levels. Conversely, the mean filter was more sensitive to
Peak Signal to Noise Ratio (PSNR) kernel size, often producing blurrier results as the kernel size increased. These
Mean Squared Error (MSE) findings provide valuable insights for selecting effective denoising methods in
radiographic imaging.
© 2021 Atom Indonesia. All rights reserved
9
10
11 33interference, and scattered radiation, can severely
12INTRODUCTION 34degrade image clarity, reducing both contrast and
35edge sharpness [7]. The presence of noise not only
13 Digital radiography has emerged as a pivotal 36impairs visual perception but also introduces
14imaging technology with broad applications in both 37uncertainty in both qualitative and quantitative
15medical diagnostics and industrial non-destructive 38analyses, potentially leading to misinterpretation or
16testing (NDT) [1]. Its rapid adoption over 39diagnostic errors [8].
17conventional radiography is largely attributed to its 40 To address these issues, digital image
18superior image quality, enhanced workflow 41processing plays a crucial role in enhancing image
19efficiency, and the capacity for real-time image 42quality by reducing noise while preserving
20processing and analysis [2,3]. In the medical field, 43diagnostically relevant information [9,10]. Among
21digital radiography facilitates high-resolution 44various image enhancement techniques, filtering is
22visualization of internal anatomical structures, 45one of the most fundamental and widely employed
23significantly aiding in early detection and 46approaches. In the context of radiographic imaging,
24diagnosis [4]. Meanwhile, in industrial settings, it 47two of the most commonly employed spatial filters
25serves as a critical tool for internal defect detection 48are the median filter and the mean filter [11]. Each
26and quality assurance without compromising the 49offers distinct advantages and limitations. The
27integrity of the examined materials [5]. 50median filter, a non-linear technique, is particularly
28 Despite these advantages, digital radiography 51effective in removing impulsive noise (e.g., salt-and-
29is not without its limitations. One of the most 52pepper noise) while preserving edge detail, which is
30persistent challenges is the presence of noise in the 53critical in retaining structural information [12]. On
31acquired images [6]. This noise, originating from 54the other hand, the mean filter, a linear convolution-
32sources such as quantum mottle, electronic 55based approach, smooths random noise by averaging
E-mail address: type your email address here
Corresponding author.
DOI: provided by AIJ
Atom Indonesia
56pixel values in a neighborhood [13], but at the cost
57of blurring fine details and weakening object
58boundaries.
59 Given the trade-offs inherent in these filtering
60techniques, the selection of an appropriate method is
61crucial for achieving optimal image enhancement in
62radiographic applications. This study aims to conduct
63a comparative evaluation of median and mean filters
101
64in improving the quality of radiographic images. The 102
65comparison is based on both objective metrics, such 103 Figure 1. Schematic of the Image Processing Workflow
66as Peak Signal-to-Noise Ratio (PSNR) and Mean 104 Using Median and Mean Filters in This Study.
105
67Squared Error (MSE), and subjective assessments
106Determination of MSE and PSNR Values
68based on visual perception [7,14,15]. By 107
69systematically analyzing the performance of these 108 Mean Squared Error (MSE) is a metric that
70filters, this research seeks to offer evidence-based 109quantifies the average of the squared differences
71recommendations for practitioners in medical and 110between the pixel intensities of the original image
72industrial radiography, as well as for researchers in 111and the filtered image [14,16–18]. Peak Signal-to-
73the field of image processing. The outcomes are 112Noise Ratio (PSNR), on the other hand, measures the
74expected to contribute to more accurate diagnostics, 113quality of the processed image relative to the original,
75improved inspection reliability, and overall enhanced 114indicating how much the filtering process preserves
76decision-making in radiographic applications. 115the original signal [15,19–21]. In this study, the
77 116"original" image refers to the radiographic image that
78METHODOLOGY
117has been artificially degraded with varying levels of
79Radiographic Image Samples and Processing 118noise. The analysis of MSE and PSNR was
80 119conducted using the Python programming language.
81 This study employed 8-bit thoracic digital 120In general, the MSE value of an image can be
82radiographic images with dimensions of 1024 × 1024 121calculated using the following equation (1).
83pixels, obtained from the Kaggle dataset. To simulate 122
84varying levels of image degradation, artificial noise 1
123 𝑀𝑆𝐸 = [ 𝐼(𝑖, 𝑗) − 𝐾(𝑖, 𝑗)] (1)
85was added at intensities of 20%, 40%, 60%, and 80%. 𝑀𝑁
86These noisy images were processed using median
124
87and mean filtering techniques, as illustrated in Figure
881, with kernel sizes of 5×5, 7×7, and 11×11, utilizing 125 Here, 𝑀 and 𝑁 represent the number of rows
89ImageJ software. The primary objective of the 126and columns in the image, respectively.
90filtering process was to evaluate the effectiveness of 127𝐼(𝑖, 𝑗) denotes the pixel intensity at position (𝑖, 𝑗) in
91median and mean filters in reducing noise across 128the original image, dan 𝐾(𝑖, 𝑗) denotes the
92different contamination levels and kernel 129corresponding pixel intensity in the filtered
93dimensions. We specifically applied the variation in 130image [22,23]. In essence, the MSE is computed by
94kernel size to investigate the correlation between 131comparing each pixel in the original image to its
95noise reduction performance and kernel dimensions 132counterpart in the filtered image. The intensity
96for each filtering method. The filtered images were 133difference for each pixel pair is squared both to
97then assessed in terms of image quality using two 134eliminate negative values and to emphasize larger
98quantitative metrics: Peak Signal to Noise Ratio 135discrepancies. These squared differences are then
99(PSNR) and Mean Squared Error (MSE). 136summed across all pixels and divided by the total
100 137number of pixels in the image, yielding the
138MSE [24]. The PSNR value can subsequently be
139calculated using the following equation (2).
140
Atom Indonesia
𝑀𝐴𝑋 175not significantly obscure critical visual details.
141 𝑃𝑆𝑁𝑅 = 10. log (2)
𝑀𝑆𝐸 176However, when the noise level is increased to 40%, a
177noticeable decline in image quality becomes evident,
142𝑀𝐴𝑋 denotes the maximum possible pixel intensity 178marked by increased blurring in some anatomical
143value, which is 255 for 8-bit grayscale images. The 179features. At 60% noise, the image appears
144computation of PSNR begins by calculating the MSE 180increasingly degraded, with many important details
145between the original and filtered images. The squared 181starting to disappear. By the time the noise reaches
146value of 𝑀𝐴𝑋 s then divided by the MSE, and the 18280%, internal structures such as the sternum become
147result is converted into a decibel (dB) scale using a 183barely recognizable, and a significant amount of
148base-10 logarithm. In general, a higher PSNR value 184visual information is lost. Overall, higher noise levels
149indicates better image quality, as it reflects a closer 185correlate with more severe degradation in image
150similarity between the filtered image and the original 186quality.
151reference. 187 To address this issue, the study implements
152 188image enhancement techniques using mean filtering
153Data Analysis 189with three kernel variations. A kernel is a fixed-size
190matrix used to modify pixel values during the
154The MSE and PSNR analysis results obtained in this
191filtering process. In this study, three kernel sizes,
155study were visualized in tabular form and as
1925×5, 7×7, and 11×11, were applied. The following
156graphical plots using Origin software. These
193tables summarize the results of image processing
157visualizations were then interpreted and discussed in
194using both median and mean filters at various noise
158detail in the subsequent subsection.
195levels.
159
160RESULTS AND DISCUSSION 196 Tables 1 and 2 show the results of image
161 197processing using median and mean filters,
162 This study investigates the effectiveness of 198respectively. It is evident that the two filtering
163mean and median filters in reducing noise levels in 199methods produce distinct image quality
164radiographic images through PSNR and MSE 200characteristics. The results shown in Table 1 indicate
165analysis, based on variations in kernel size. Four 201that at a noise level of 20%, all three kernel sizes
166different noise levels 20%, 40%, 60%, and 80% were 202(5×5, 7×7, and 11×11) are effective in smoothing
167applied to the images, as illustrated in Figure 2. 203noise while preserving important image details.
204However, as the noise level increases to 40%, larger
205kernel sizes such as 7×7 and 11×11 yield smoother
206images compared to 5×5, although some anatomical
207details begin to appear blurred. At higher noise
208levels, 60% and 80%, the smoothing effect of larger
209kernels becomes more pronounced. The 11×11
210kernel is the most effective in reducing noise at these
211levels, but it also causes a noticeable loss of
212sharpness and a significant decline in visual detail.
213 Similar visual outcomes were observed with
214the mean filter (Table 2). At 20% noise, all kernels
215effectively reduced noise. At 40%, 7×7 and 11×11
216performed better than 5×5 but blurred fine details. At
21760–80% noise, 11×11 showed strong smoothing,
168
169 Figure 2. Radiographic images with simulated noise 218suppressing noise but significantly reducing image
170 levels of 20%, 40%, 60%, and 80%. 219sharpness and detail.
171As shown in Figure 2, the image with 20% noise still
172clearlydisplays anatomical structures such as bones
173and lungs. At this noise level, the degradation of
174image quality is minimal, and the added noise does
Atom Indonesia
220Table 1. Filtered radiographic images using median filter with varying kernel sizes.
Kernel Sizes
Noise Level
5x5 7x7 11x11
20%
40%
60%
80%
221
222
223
224
225
226
Atom Indonesia
227Table 2. Filtered radiographic images using mean filter with varying kernel sizes.
Kernel Sizes
Noise Level
5x5 7x7 11x11
20%
40%
60%
80%
228
229Nevertheless, visual assessment alone is insufficient to 236demonstrating that the filtering process effectively reduced
230fully validate image quality. Therefore, this study also 237noise and improved overall image quality. Furthermore,
231conducted a quantitative evaluation of the filtering results 238Table 3 shows that the median filter consistently
232using SNR, PSNR, and MSE metrics, as presented in Table 239outperformed the mean filter in enhancing the quality of
2333. Table 3 shows the measured MSE and PSNR values of 240noise-degraded images. This is evident from the lower
234the processed images. The results indicate that after 241MSE and higher PSNR values across all noise levels (20%
235filtering, the MSE values decreased significantly, 242to 80%). At noise levels of 20% and 40%, the median filter
Atom Indonesia
243with a 5×5 kernel yielded the highest image quality, with 246kernel size of 11×11 produced better results, with PSNR
244PSNR values of 31.03 dB and 29.59 dB, respectively. 247values of 28.96 dB and 28.62 dB.
245However, at higher noise levels 60% and 80% a larger
248 Table 3. Measured MSE and PSNR Values of Images Processed with Median and Mean Filters.
MSE Value PSNR Value
Kernel Sizes Filter Type
20% 40% 60% 80% 20% 40% 60% 80%
Reference (Noisy Image) 98.65 102.62 103.75 104.09 28.19 28.02 27.97 27.96
5x5 51.31 71.53 84.62 91.31 31.03 29.59 28.86 28.53
7x7 Median 52.83 68.82 82.74 89.87 30.90 29.75 28.95 28.59
11x11 54.38 69.14 82.64 89.37 30.78 29.73 28.96 28.62
5x5 57.01 79.54 91.56 98.52 30.57 29.12 28.51 28.20
7x7 Mean 58.24 80.96 92.28 98.85 30.48 29.05 28.48 28.18
11x11 61.33 83.53 93.71 100.17 30.25 28.91 28.41 28.12
249
250
251This phenomenon can be explained by the 281value [28–30]. When a large kernel size, such as
252fundamental differences in the working principles of 28211×11, is used, the number of pixels being averaged
253the two filtering techniques. The median filter 283becomes substantial. As a result, fine details within
254operates by replacing the central pixel within the 284the image tend to be lost due to excessive smoothing.
255kernel with the median value of all the pixels in the 285This leads to overly blurred images, with diminished
256kernel matrix [25–27]. Noise only affects a small 286edge sharpness and faded texture, ultimately
257portion of the image pixels at lower noise levels (20% 287degrading overall image quality. Conversely, a
258and 40%). In such cases, a small kernel size is still 288smaller kernel, such as 5×5, covers a more limited
259effective in producing a median value close to the 289area, enabling effective noise reduction while
260original pixel intensity, as most of the values within 290preserving essential image details. This produces
261the filtering window remain uncorrupted. As a result, 291more optimal results, reflected in higher PSNR
262the filtered image retains high quality without 292values compared to larger kernel sizes. In general, the
263compromising essential details, which corresponds to 293mean filter is more suitable for mild noise conditions,
264higher PSNR values. 294providing uniform smoothing but at the expense of
265 However, at higher noise levels (60% and 295blurring fine structural information. The median
26680%), a significant portion of the image pixels are 296filter, on the other hand, is more effective for
267already contaminated. If a small kernel is used under 297handling impulsive noise, as it better preserves edges
268these conditions, it is likely that most of the pixels 298and retains critical image details.
269within it will also be affected by noise. Consequently, 299The charts in Figures 3(a) and 3(b) clearly show how
270the computed median no longer accurately represents 300kernel size affects PSNR, supporting the numbers in
271the original image information, leading to less 301Table 3. Figure 3(a) illustrates the performance of the
272effective noise suppression. In contrast, using a larger 302median filter in reducing noise across various levels
273kernel provides a broader sampling area, increasing 303of contamination. The graph compares the PSNR
274the probability of including more uncorrupted pixels 304values of noisy images before and after the filtering
275in the median computation. This allows the filter to 305process. The PSNR value corresponding to a kernel
276operate more effectively at higher noise levels, 306size of 0×0 represents the unfiltered, noisy image. As
277although it may result in reduced image sharpness. 307expected, these values are significantly lower than
278 In contrast, the mean filter operates by 308those of the filtered images. Additionally, the graph
279calculating the average value of all pixels within the 309reveals that at lower noise levels (20% and 40%), the
280kernel and replacing the central pixel with this mean 3105×5 kernel yields the highest PSNR values 31.03 dB
Atom Indonesia
311and 29.59 dB, respectively. These results support 319The larger kernel provides a broader sampling area,
312earlier explanations that small kernels can still 320increasing the likelihood of incorporating more
313provide a good average value because most pixels in 321uncorrupted pixels into the median calculation.
314the filter window are not affected by noise.
315Consequently, image details are well preserved, 322The result allows for more effective noise
316resulting in improved image quality. In contrast, at 323suppression, albeit with a trade-off of slightly
317higher noise levels (60% and 80%), the highest 324reduced image sharpness.
318PSNR values are achieved using the 11×11 kernel.
325
326
327 Figure 3. PSNR values as a function of kernel size: (a) for median filtering, (b) for mean filtering.
328Meanwhile, Figure 3(b) shows the performance 354greater discrepancies between the filtered image and
329graph of the mean filter, revealing a different trend. 355the reference image, making image restoration
330The 5×5 kernel consistently produces the highest 356increasingly challenging. The upward trend in MSE
331PSNR values across all noise levels. However, as the 357across all filters and kernel configurations
332kernel size increases, the PSNR values gradually 358underscores the direct impact of noise intensity on
333decline, particularly at higher noise levels. The 359image degradation. Therefore, the effectiveness of
334evidence indicates that large kernels, such as 11×11, 360any filtering method is heavily influenced by the
335introduce excessive smoothing, leading to the loss of 361initial level of noise present in the image.
336fine image details and a blurring of essential
337structural information. Unlike the median filter,
338which remains effective even with larger kernels, the
339mean filter loses its ability to preserve image quality
340under high-noise conditions. This contrast reinforces
341the observation that the median filter is more adaptive
342to increasing noise levels, whereas the mean filter is
343more suitable for low-noise scenarios and limited
344kernel sizes. The superior performance of the median
345filter is further supported by Figure 4, which
346visualizes MSE values across various kernel sizes
347and noise levels. Along with the PSNR analysis in
348Figures 3(a) and 3(b), Figure 4 shows a clear trend
349where MSE values go up as noise levels increase 362
350from 20% to 80%. In general, the median filter 363Figure 4. MSE values as a function of noise percentage in
351consistently yields lower MSE values than the mean 364radiographic images
352filter across all kernel sizes and noise levels. This
365
353trend confirms that higher noise levels result in
366 367
Atom Indonesia
368CONCLUSION 416 (2023).
369 This study concludes that the median filter 417[9] N. Nazir, A. Sarwar, dan B. S. Saini, Micron
370outperforms the mean filter in reducing noise in
418 103615 (2024).
371digital radiographic images, particularly as noise 419[10] M. M. Weli dan O. M. Abdullah, Indones. J.
372levels increase. Median filters effectively suppress
420 Comput. Sci. 13, (2024).
373impulsive noise while preserving important structural 421[11] S. Nirmaladevi dan S. Jagatheswari, in 2023
374details, especially when appropriate kernel sizes are
422 12th International Conference on Advanced
423 Computing (ICoAC) (IEEE, 2023), hal. 1–6.
375used. At lower noise levels, smaller kernels such as
424[12] G. George, R. M. Oommen, S. Shelly, S. S.
3765×5 are sufficient, while higher noise levels benefit
425 Philipose, dan A. M. Varghese, in 2018
377from larger kernels like 11×11. In contrast, the mean
426 Conference on Emerging Devices and Smart
378filter tends to blur image details as kernel size
427 Systems (ICEDSS) (2018), hal. 235–238.
379increases, making it less suitable for high-noise
428[13] B. R. Jana, H. Thotakura, A. Baliyan, M.
380conditions. These findings suggest that median
429 Sankararao, R. G. Deshmukh, dan S. R.
381filtering is a more robust approach for enhancing 430 Karanam, Appl. Nanosci. 13, 1017 (2023).
382image quality in noisy radiographic data. The results
431[14] Y. Al Najjar, Int. J. Sci. Res. 13, 110 (2024).
383are expected to aid practitioners in selecting
432[15] U. Sara, M. Akter, dan M. S. Uddin, J.
384appropriate denoising techniques to ensure accurate
433 Comput. Commun. 7, 8 (2019).
385analysis and diagnosis in medical and industrial
434[16] I. Kouadra, T. Bekkouche, L. Ziet, I. Mehidi,
386applications.
435 S. Alshathri, dan W. El-Shafai, IEEE Access
387 436 (2025).
388ACKNOWLEDGMENT
437[17] D. Sharma, in 2024 Second International
389 438 Conference Computational and
390 439 Characterization Techniques in Engineering
391 440 & Sciences (IC3TES) (IEEE, 2024), hal. 1–5.
392 441[18] K. Gu, S. Wang, G. Zhai, S. Ma, X. Yang, dan
393AUTHOR CONTRIBUTION 442 W. Zhang, Signal, Image Video Process. 10,
443 803 (2016).
394
444[19] F. Ullah, K. Kumar, T. Rahim, J. Khan, dan
395
396
445 Y. Jung, Sci. Rep. 15, 8971 (2025).
397REFERENCES 446[20] L. Mei, Imaging Sci. J. 1 (2025).
398[1] M. I. Silva, E. Malitckii, T. G. Santos, dan P. 447[21] T. Ö. Onur, Comput. Biol. Med. 185, 109527
399 Vilaça, Prog. Mater. Sci. 138, 101155 (2023). 448 (2025).
400[2] S. Anand dan R. K. Roshan, Optik (Stuttg). 449[22] T. O. Hodson, T. M. Over, dan S. S. Foks, J.
401 279, 170751 (2023). 450 Adv. Model. Earth Syst. 13, 1 (2021).
402[3] X. Ou, X. Chen, X. Xu, L. Xie, X. Chen, Z. 451[23] S. Rahman, J. uddin, H. Hussain, S. Shah, A.
403 Hong, H. Bai, X. Liu, Q. Chen, L. Li, dan H. 452 Salam, F. Amin, I. de la Torre Díez, D. L. R.
404 Yang, Research (2021). 453 Vargas, dan J. C. M. Espinosa, Sci. Rep. 15, 1
454 (2025).
405[4] N. Sasikaladevi dan A. Revathi, Biomed.
406 Signal Process. Control 88, 105632 (2024). 455[24] R. G. Deshpande, L. L. Ragha, dan S. K.
456 Sharma, Indones. J. Electr. Eng. Comput. Sci.
407[5] P. Charalampous, I. Kostavelis, dan D. 457 11, 918 (2018).
408 Tzovaras, Rapid Prototyp. J. 26, 777 (2020).
458[25] A. Desiani, D. P. Rini, dan L. I. Kesuma, Int.
409[6] R. Jacobs, R. C. Fontenele, P. Lahoud, S. 459 J. Intell. Eng. Syst. 18, (2025).
410 Shujaat, dan M. M. Bornstein, Periodontol.
411 2000 95, 51 (2024). 460[26] S. Basu dan A. Bandyopadhyay, J. Inst. Eng.
461 Ser. B 1 (2025).
412[7] H. Lee, M. Lee, H. Lim, J. Lee, dan H. Cho,
413 Nucl. Eng. Technol. 57, 103482 (2025). 462[27] L. Liang, J. Chen, J. Shi, K. Zhang, dan X.
463 Zheng, PLoS One 20, e0319852 (2025).
414[8] L. Zhang, X. Wen, J.-W. Li, X. Jiang, X.-F.
415 Yang, dan M. Li, Insights Imaging 14, 163 464[28] S. Fatnassi, M. Yahia, T. Ali, dan R.
465 Abdelfattah, in International Conference on
Atom Indonesia
466 Advanced Information Networking and
467 Applications (Springer, 2025), hal. 301–313.
468[29] M. A. W. Mohammed dan A. G. Jaber, in AIP
469 Conference Proceedings, Vol. 3264 (AIP
470 Publishing LLC, 2025), hal. 50061.
471[30] H. S. Saeed dan M. H. Fares, J. Eng. Sustain.
472 Dev. 29, 127 (2025).
473