$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
This study exclusively utilized publicly available, de-identified CT and MRI imaging datasets. No live human or animal subjects were involved. Therefore, no institutional review board (IRB) or ethics committee approval was required.
Method overview
This protocol presents a reproducible pipeline for energy-efficient medical image denoising. It combines preprocessing techniques, including sharpening filters and K-means clustering, with a convolutional neural network (CNN)-based autoencoder to denoise images. This integrated method enhances image quality while reducing training time and hardware energy consumption, supporting sustainable medical diagnostics19,20,21,22,23. Figure 5 summarizes the end-to-end framework.

Figure 5: Proposed denoising framework architecture. This figure outlines the full pipeline: data acquisition, preprocessing (sharpening + K-means segmentation), followed by CNN-based autoencoder denoising. It emphasizes the hybrid approach aimed at reducing energy use while preserving structural fidelity. Please click here to view a larger version of this figure.
The complete workflow is summarized in Figure 5, which shows the sequence from dataset setup to preprocessing (sharpening and K-means) to CNN autoencoder denoising to Testing.
Software and environment setup
Option A - Google Colab (recommended for reproducibility): Go to colab.research.google.com, click New Notebook. Select Runtime > Change runtime type > Hardware accelerator: GPU > Save. Click File > Upload to upload the provided notebook and the dataset .zip (or connect Google Drive by clicking Files > Mount Drive). In the first code cell, install dependencies (already in notebook): pip install opencv-python scikit-image scikit-learn tensorflow matplotlib numpy pandas. Click Runtime > Run all. Confirm you see: (i) environment summary with package versions, (ii) GPU name (in cell output), and (iii) creation of an experiment folder runs/YYYY-MM-DD/.
Option B - Local (conda): Open Anaconda Prompt/Terminal and run:

Place your dataset under data/raw/ and scripts under code/. Run: python code/train_autoencoder.py --data_root data --img_size 256 --k_values 3 5 --epochs 100 --batch 32 --lr 0.001. Confirm to see: environment printout, detected GPU, and a log directory runs/YYYY-MM-DD/.
Dataset preparation
Publicly available datasets of CT and MRI scans were sourced from medical imaging repositories. These datasets contained noise typical of real-world clinical scans and were de-identified according to institutional and ethical standards8,9. Each image was resized to 256 x 256 pixels and stored in PNG or DICOM format for compatibility.The datasets were randomly split as follows: 70% for training, 15% for validation, and 15% for testing, ensuring a stratified distribution of imaging modalities and noise levels⁶. Noise statistics were measured using mean pixel variance prior to denoising.
Organize folders: Create a folder as described below:

To add images, copy de-identified CT/MRI images into data/raw/CT and data/raw/MRI (PNG, JPG, or DICOM). Standardize image size using Python (recommended): Run the notebook cell Resize & convert. It loads each image, converts grayscale if needed, and resizes to 256 x 256 .

An alternative is to use GUI (ImageJ/Fiji alternative) as described. Click on File > Import > Image Sequence (or single images), then Image > Type > 8-bit, Image > Adjust > Size… > 256 x 256, and then File > Save As > PNG into data/preproc/.
Create splits: Run the notebook cell Train/Val/Test split (70/15/15); it shuffles filenames and copies them into data/splits/train|val|test/. The console prints the counts (e.g., Train: 700, Val: 150, Test: 150). Checkpoint (observe): Open data/splits/train/ and verify images are 256 x 256 and grayscale (1 channel). Keep a small CSV manifest (splits.csv) that lists file path, modality, and split label.
Image preprocessing
Use the 3 x 3 sharpening kernel. Perform image enhancement using a sharpening kernel. A sharpening convolution kernel was used to enhance anatomical boundaries prior to segmentation:

This filter accentuates important structures by boosting high-frequency components4,5. Each image was convolved using Python's OpenCV library (cv2.filter2D()) to generate the enhanced image. Figure 6 illustrates before-and-after comparisons.

Figure 6: Validation accuracy plot for different values of k. Bar chart illustrating validation accuracy achieved for various values of K used in the K-means clustering step (K=2, 3, 4, 5). The accuracy peaks at K=3, indicating optimal separation between anatomical structures and noise regions. Scale: Normalized accuracy values (0-1). Please click here to view a larger version of this figure.
Apply (Python/OpenCV) using the code below.

Or use GUI alternative (ImageJ/Fiji) by clicking Process > Filters > Convolve. Paste the 3 x 3 matrix above and click OK > File > Save As > PNG into data/preproc/enhanced/. Observe the checkpoint as edges and organ boundaries appear crisper; if oversharpened halos are seen, reduce the kernel central weight from 5 to 4.5 and re-run. Figure 7 shows before-and-after denoising results. The before images clearly exhibit noise and blurring, while the after images display enhanced clarity, sharper anatomical boundaries, and improved contrast, demonstrating the effectiveness of the proposed denoising pipeline.

Figure 7: Convolution NAutoencoder network architecture. Illustrates the autoencoder architecture: input layer, encoder (Conv + Pool layers), bottleneck, decoder (Upsampling + Transposed Conv layers). Each layer is labeled with size and function. Please click here to view a larger version of this figure.
K-Means clustering for segmentation
Enhanced images were reshaped using NumPy (image.reshape(-1, 1)) and clustered using sklearn.cluster.KMeans(n_clusters=3 or 5). The segmented output was reshaped back to 2D (np.reshape(clustered_array, image.shape)) to visualize anatomical regions versus noise zones14. Table 1 lists segmentation settings.
| Sr No | Value of k | Accuracy |
| 1 | 3 | 0.761 |
| 2 | 5 | 0.869 |
| 3 | 7 | 0.75 |
Table 1: Values of k with respective validation accuracies. This table presents the validation accuracies obtained for different values of the clustering parameter k used in the K-means segmentation step of the denoising pipeline. The results demonstrate that k = 5 yields the highest accuracy, guiding optimal clustering parameter selection.
K-Means Segmentation: Reshape and cluster (Python/scikit-learn) using the code below.

Perform color preview (optional) and map labels to colors for visual QC and overlay edges from the sharpened image. Pick K by running with K=3 and K=5; compute validation accuracy downstream (Table 1 lists settings; Figure 6 shows accuracy versus K). This is a checkpoint; observe for noise-dominant pixels forming distinct clusters; anatomical regions should remain contiguous. If small speckles appear, apply anatomical boundaries.
Neural network-based denoising
Architecture description: See Figure 8 for the encoder-bottleneck-decoder schematic. A CNN-based autoencoder was developed using TensorFlow/Keras. The architecture included: input layer: 256 x 256 grayscale image, encoder with three convolutional layers (kernel: 3 x 3, stride: 1, ReLU activation), each followed by max-pooling; bottleneck as dense latent representation, decoder with three up-sampling layers with transposed convolutions, output as Sigmoid-activated layer producing a denoised image. Table 2 provides full layer-wise architectural parameters.

Figure 8: Visual results of the denoising process. Presents original noisy image, preprocessed image, and final denoised output side-by-side for qualitative evaluation. Demonstrates edge preservation and artifact reduction. Please click here to view a larger version of this figure.
| Sr No | Compilation attributes | Values of compilation attributes |
| 1 | Optimizer | Adam |
| 2 | Loss | Categorical Cross-entropy |
| 3 | Metrics | Accuracy |
Table 2: Compilation attributes of the neural network. This table details the key compilation parameters used to train the convolutional autoencoder model. These settings were implemented in TensorFlow and include the optimizer, loss function, evaluation metric, number of epochs, and batch size.
Training configuration: The training parameters included: loss function as Mean Squared Error (MSE), optimizer as Adam (learning rate = 0.001), batch size of 32, and epochs as 100 with early stopping (patience = 10).
A brief overview of the training is as follows. Launch training by going to Colab and clicking Runtime > Run all; confirm GPU is listed (e.g., Tesla T4). Use python code/train_autoencoder.py --data_root data --epochs 100 --batch 32 --lr 0.001 --early_stop 10. Monitor by using the console prints epoch, train_loss, val_loss, and time/epoch. Early stopping triggers after patience=10 epochs without improvement. Best model is saved to runs/.../checkpoints/best.h5. This is a checkpoint, observe by using the model.summary() which shows the layer stack; parameter count should match Table 2. If you get OOM errors, reduce the batch to 16 or set the input size to 224 x 224.
Intermediate checkpoints and troubleshooting
After sharpening and segmentation, preview three images per split and confirm (i) edges are enhanced, (ii) cluster masks align with anatomy. During training, ensure validation loss decreases and does not diverge. If the denoised output appears over-smoothed, reduce the kernel center (4.5), or increase training epochs by 10 with a lower learning rate (e.g., 5e-4).
Performance evaluation: The following quantitative metrics were used: Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index Measure (SSIM), and Validation Accuracy of denoised image classification.
The proposed method improved PSNR from 21.52 to 28.14 dB and SSIM from 0.76 to 0.86 compared to baseline models presented in7,16. Energy efficiency was recorded by monitoring GPU usage (NVIDIA-SMI logs) and training time. Table 3 summarizes denoising outcomes.
| Sr No | Metric | Baseline Model |
| 1 | Average Epoch Time (sec) | 25.8 |
| 2 | Total Training Energy (kWh) | 0.52 |
| 3 | GPU Utilization (%) | 85% |
| 4 | Inference Time per Image (ms) | 18.7 |
| 5 | Validation Accuracy (%) | 76.19% |
| 6 | PSNR (dB) | 21.52 |
| 7 | SSIM | 0.7619 |
Table 3: Performance evaluation metrics of the baseline versus the proposed method. This table compares the proposed denoising pipeline against a baseline model across several performance metrics, including training time, GPU utilization, and quality measures (PSNR, SSIM, and validation accuracy). The results indicate improved energy efficiency and image quality with the proposed method.
Compute PSNR/SSIM and energy usage. For PSNR/SSIM (scikit-image), use the code below.

For computing energy/GPU use, Run the cell that logs nvidia-smi --query-gpu=power.draw,utilization.gpu --format=csv -l 1 to runs/.../gpu_log.csv during training (provided in notebook). In a second terminal, run the following code:

Parse CSV to compute average power (W) and integrate over training time for estimated energy (Wh = kWh). The notebook aggregates PSNR, SSIM, validation accuracy, epoch time, and energy into results_table3.csv for direct inclusion.
Sustainability evaluation and telemedicine simulation
To assess device hardware sustainability, we applied Gaussian and Poisson noise to simulate image degradation from aging devices. The model restored these degraded inputs to near-diagnostic quality, validating its robustness27,28,29. In telemedicine simulations, denoised images were transmitted by simulated 256 Kbps bandwidth using Python sockets. Visual clarity was retained, supporting remote diagnostics30,31,32.
For device-aging simulation, apply Gaussian noise (σ=10-30) and Poisson noise to clean images (cell Aging simulation) and save to data/simulated/aged/. Run the trained model on aged/ inputs; save outputs in results/aged_denoised/. Observe that the visual quality should reach near-diagnostic fidelity; compare PSNR/SSIM with baseline.
For telemedicine bandwidth test, compress denoised images to PNG/JPEG at 85%-95% and send over a simulated 256 kbps link using the provided Python socket test (telemed_sim.py). Measure round-trip time and file integrity hash; verify no diagnostic artifacts are introduced. Observe that the visual clarity is preserved and file sizes suitable for low-bandwidth workflows.
Protocol endpoint
At completion, you should have: (i) sharpened images in preproc/enhanced/, (ii) segmented images in preproc/segmented/, (iii) a trained autoencoder with best.h5 in runs/.../checkpoints/, (iv) denoised outputs for test and aged images in results/, (v) a compiled metrics file (results_table3.csv) summarizing PSNR, SSIM, validation accuracy, epoch time, and estimated energy.