Research Article

Image Preprocessing and Optimizer Sensitivity: Implications for Convolutional Neural Networks in Diagnosing Brain Tumors

DOI:

10.3791/69459

February 17th, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This study employs a controlled framework to evaluate preprocessing pipelines and optimizers within a fixed architecture, aiming to determine how classical preprocessing affects optimizers and Convolutional Neural Networks (CNNs) in brain tumor classification.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Brain tumor classification using magnetic resonance imaging (MRI) presents challenges due to variations in tumor size, shape, and texture. Although traditional image preprocessing methods are commonly employed to improve input quality, their impact on optimizer behavior and CNN performance has yet to be thoroughly investigated. This research examines the effect of preprocessing on convergence, generalization, and classification accuracy across various optimizers. We utilize a publicly available Kaggle dataset to create two preprocessing pipelines: a baseline pipeline that only resizes images and a traditional pipeline that converts images to grayscale, blurs them, and applies morphological filtering. We then test how these pipelines affect three optimizers: Adam, Root Mean Square Propagation (RMSProp), and Stochastic Gradient Descent (SGD). To separate protocol variables, a fixed CNN architecture is used throughout. Performance is assessed using accuracy, precision, recall, and F1-score, validated through five-fold cross-validation. Results show that baseline preprocessing consistently yields higher accuracy and more stable convergence across all optimizers, with RMSProp and SGD achieving the highest mean accuracy of 99.53% under five-fold cross-validation. The findings address the understudied effect of preprocessing on optimizer performance, emphasizing the need for preprocessing-aware training strategies to improve robustness and interpretability in medical image analysis.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Brain tumor classification using magnetic resonance imaging (MRI) is a crucial task in neuro-oncology, where early and accurate diagnosis directly influences treatment planning and patient outcomes1. CNNs have become the dominant approach for automating this process due to their ability to learn hierarchical spatial and textural features directly from raw image data2. However, the quality of input data remains a key determinant of model performance. Classical preprocessing techniques-such as grayscale conversion, Gaussian blurring, thresholding, and morphological operations-are routinely applied to reduce noise and emphasize structural boundaries3,4,5. Gangadharan et al. conducted a comparative analysis of deep learning models for brain tumor prediction, highlighting the variability in performance across architectures and the importance of dataset characteristics in shaping outcomes6. Qureshi et al. proposed an ultra-lightweight CNN for multi-class tumor detection, emphasizing computational efficiency and real-time applicability without compromising diagnostic accuracy7. Extending beyond structural imaging, Qureshi et al. explored radio-genomic classification using fused multi-omics features from multi-parametric MRI scans to predict methylguanine-DNA methyltransferase (MGMT) promoter methylation status, demonstrating the potential of integrated data modalities for non-invasive tumor profiling8. Despite their ubiquity, the downstream impact of these transformations on CNN training dynamics, optimizer behavior, and interpretability remains underexplored.

Recent advances in brain tumor classification have focused on architectural complexity, segmentation-classification hybrids, and transfer learning. MultiFeNet, for example, employs multi-scale feature fusion to enhance spatial representation9, while ensemble models and 3D CNNs offer high fidelity at the cost of increased computational overhead10,11. Recent studies on hybrid methods, such as wavelet transformation with Support Vector Machine (SVM) and cellular automata-based edge detection, typically require handcrafted features or multi-stage processing12,13. Comparative research on imbalanced datasets has highlighted the challenges in achieving class-wise generalization14. Transfer learning approaches using pre-trained networks, such as VGG and ResNet, have shown promise in MRI classification15,16,17; however, they often treat preprocessing as a fixed upstream step. These models rarely isolate how input transformations affect the convergence of the optimizer or semantic retention.

Preprocessing-aware studies have begun to highlight this gap. Ivanescu et al. demonstrated that excessive filtering can degrade CNN sensitivity to subtle tumor patterns3. Vu et al. demonstrated that grayscale conversion and resizing can discard contextual information, thereby affecting diagnostic accuracy4. Hooper et al. revealed that upstream Computed Tomography (CT) filtering induces performance variability, underscoring the fragility of CNNs to domain shifts5. Kundu et al. proposed Gaussian-based intensity transformations to improve segmentation18; however, they did not evaluate the sensitivity of the optimizer. Meanwhile, Asiri et al. and Aamir et al. optimized CNN hyperparameters for brain tumor detection16,17, noting Adam's superior performance without analyzing how it responds to preprocessing changes. Explainability tools such as Gradient-weighted Class Activation Mapping (Grad-CAM) and SHapley Additive exPlanations (SHAP) have advanced our understanding of CNN decision-making by visualizing class-discriminative regions19,20. These methods are essential for validating whether preprocessing improves or distorts semantic retention.

However, few studies have systematically examined how preprocessing affects optimizer convergence, generalization, and interpretability under a fixed architecture - matters that are both clinically and computationally significant. Clinically, excessive smoothing or intensity transforms can attenuate diagnostically relevant texture and spatial gradients, reducing localization fidelity and clinician trust. Computationally, optimizers react differently to changes in feature scale and gradient variance; mismatches between input complexity and optimizer dynamics can produce unstable convergence or poorer generalization.

To address this, we introduce a dual-path framework that systematically compares baseline (resize-only) and traditional preprocessing pipelines across three optimizers -- Adam, RMSProp, and SGD -- using a consistent CNN architecture and the BR35H Kaggle dataset21. We evaluate classification performance, convergence speed, and interpretability using Grad-CAM, validated through five-fold cross-validation. Unlike prior works that conflate architectural and preprocessing changes, this protocol isolates preprocessing as an independent variable, revealing that aggressive filtering can hinder the performance of the optimizer and spatial attention.

The framework presented here offers several advantages over existing models. First, it explicitly evaluates the interactions between preprocessing strategies and optimizers, a dimension often overlooked in ensemble and transfer learning studies15,16,17. Second, it maintains a fixed CNN architecture, thereby simulating real-world deployment constraints where reconfiguration is typically impractical22. Third, it integrates visual attribution methods to assess semantic retention, complementing prior work on radiomic and handcrafted feature studies23. Finally, the framework offers reproducible insights into preprocessing-aware training strategies, thereby enhancing both robustness and interpretability.

By synthesizing insights from preprocessing methods3,4,5, optimizer studies16,17, and explainability tools19,20, this work presents a practical and interpretable pipeline for brain tumor classification that balances accuracy, stability, and clinical relevance.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Figure 1 shows an overview of the Protocol workflow. This study examines the effect of classical image preprocessing on the performance of CNNs and the behavior of optimizers in brain tumor classification using MRI. The protocol encompasses dataset preparation, dual path preprocessing pipelines, model architecture, optimizer configuration, performance evaluation, and interpretability validation. All experiments were executed in Python 3.10.12 using Keras version 2.13.1 with TensorFlow backend, OpenCV version 4.8.0, and Matplotlib version 3.8.0.

Dataset preparation
The BR35H brain tumor MRI dataset from Kaggle21, consisting of 3,000 images equally divided into tumor-present ("yes") and tumor-absent ("no") classes, was used in this study. All images were resized to 128 × 128 pixels using OpenCV's cv2.resize function to standardize input dimensions across experiments. Stratified sampling with Scikit-learn's train_test_split ensured balanced representation across the training set (80%) and validation set (20%), thereby maintaining consistency in class distribution across each fold.

In addition to the BR35H public dataset, we validated this protocol using an independent dataset collected from the Ultralytics Brain Tumor Dataset (https://docs.ultralytics.com/datasets/detect/brain-tumor/). This dataset consists of a valid training set of 878 images and a testing set of 223 images, with two clearly defined classes: Negative (images without brain tumors) and Positive (images with brain tumors). The inclusion of this independent dataset allowed us to assess further the generalizability and robustness of the framework beyond the original source data. 

Preprocessing pipelines
Two distinct preprocessing pipelines were implemented to evaluate the impact of classical image preprocessing. The Baseline Preprocessing (BP) pipeline simply resized images to 128 × 128 pixels without any further transformations, thereby preserving the raw pixel intensity and structural features as a control condition. The Traditional Preprocessing (TP) pipeline applied a sequence of classical image processing steps using OpenCV functions: grayscale conversion (cv2.cvtColor) to reduce channel dimensionality, Gaussian blurring (cv2.GaussianBlur) to suppress noise and enhance contrast24, thresholding (cv2.threshold) to segment high-intensity structures25, morphological operations (cv2.erode, cv2.dilate) to refine edges and reduce artifacts26, and contour detection (cv2.findContours) to identify regions of interest. This pipeline enhanced contrast and reduced visual clutter, though it risked suppressing diagnostically relevant texture.

Model architecture
A custom CNN was implemented and kept constant across all experiments to isolate the effects of preprocessing and optimizer choice. The architecture consisted of an input layer (128 × 128 × 1), three convolutional layers (the first with 32 filters and the next two with 64 filters, all using 2 × 2 kernels and Rectified Linear Unit (ReLU) activation), each followed by 2 × 2 max pooling. The output was flattened and passed through a dense layer of 128 units with ReLU activation, followed by a dropout layer (rate = 0.5), and finally a single sigmoid unit for binary classification. This design strikes a balance between interpretability and computational efficiency, making it suitable for resource-constrained clinical hardware.

Optimizer configuration
Three optimizers were evaluated with fixed hyperparameters: Adam (learning rate = 0.001, β1 = 0.9, β2 = 0.999, epsilon = 1e−07), RMSProp (learning rate = 0.001, rho = 0.9, epsilon = 1e−07), and SGD (learning rate = 0.005, momentum = 0.9, Nesterov disabled). Training parameters were kept constant across experiments, with a batch size of 32, 50 epochs, and early stopping (patience = 10) implemented via Keras callbacks to prevent overfitting.

Performance evaluation
Performance was assessed using accuracy, precision, recall, and F1-score, calculated with Scikit-learn's classification_report. Training and validation loss curves were plotted with Matplotlib to evaluate convergence speed and detect overfitting. Results were tabulated and visualized to compare the sensitivity of the optimizer under different preprocessing conditions.

Interpretability validation
Interpretability was validated using Grad-CAM visualizations generated from the final convolutional layer. Heatmaps were generated using Keras and TensorFlow functions and then overlaid on the original MRI images using Matplotlib. This step ensured that the CNN's spatial attention aligned with clinically relevant tumor regions, thereby supporting transparency and diagnostic trust.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Adam optimizer - Baseline preprocessing:
Figure 2 illustrates the performance of a brain tumor classification model using the Adam optimizer with baseline preprocessing. The confusion matrix shows near-perfect separation between tumorous and non-tumorous cases, with only 8 misclassifications out of 600 samples. The accompanying classification report confirms this with precision, recall, and F1-scores all at or above 0.98 for both classes.

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The success of CNN-based brain tumor classification in this study was primarily driven by two protocol components: preprocessing design and optimizer selection. Baseline preprocessing -- consisting solely of image resizing -- preserved native pixel intensity and spatial structure, enabling the model to learn clinically relevant features. In contrast, traditional preprocessing methods (such as grayscale conversion, Gaussian blur, thresholding, and morphological operations) introduced feature abstraction, which often suppr...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have nothing to disclose.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors extend their appreciation and heartfelt thanks to GITAM University, the Leadership team, the Dean, and the Head of the Department of Computer Science and Engineering, Visakhapatnam campus, for their continued support and encouragement of research and development.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
API WrapperKeras2.13.1(RRID:SCR_016345)High-level API for CNN architecture and training
Attribution ToolGrad-CAM ImplementationCustom (via Keras)Visual explanation of CNN attention
BR35H Brain Tumor MRI Dataset Kagglehttps://www.kaggle.com/ahmedhamada0/brain-tumor-detectionSource of labeled MRI images for classification 
Brain Tumor Dataset Ultralyticshttps://docs.ultralytics.com/datasets/detect/brain-tumor/
Deep Learning LibraryTensorFlow2.15.0 (RRID:SCR_018345)Backend for CNN model implementation
Image ProcessingOpenCV4.8.0 (RRID:SCR_015526)Preprocessing: grayscale, blur, threshold, morphology
Programming LanguagePython3.10.12 (RRID:SCR_008394)Execution environment for all experiments
VisualizationMatplotlib3.8.0 (RRID:SCR_008624)Plotting loss curves and Grad-CAM overlays

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Devkota, B., et al. Image segmentation for early stage brain tumor detection using mathematical morphological reconstruction. Procedia Comput Sci. 125, 115-123 (2018).
  2. Antony, A., Minla, K. S. Brain tumor detection from MRI images using CNN. Int J Creat Res Thoughts. 10 (4), 95-100 (2022).
  3. Ivanescu, R. C. A statistical evaluation of the preprocessing medical images impact on a deep learning network's performance. Ann Univ Craiova Math Comput Sci Ser. 49 (2), 411-421 (2022).
  4. Vu, H. A. Integrating preprocessing methods and convolutional neural networks for effective tumor detection in medical imaging. arXiv. , (2024).
  5. Hooper, S. M., et al. Impact of upstream medical image processing on downstream performance of a head CT triage neural network. Radiol Artif Intell. 3 (4), e200229(2021).
  6. Comparative analysis of deep learning-based brain tumor prediction models using MRI scan. Gangadharan, S. M. P., et al. 2023 3rd International Conference on Innovative Sustainable Computational Technologies (CISCT), Dehradun, India, , (2023).
  7. Qureshi, S. A., et al. Intelligent ultra-light deep learning model for multi-class brain tumor detection. Appl Sci. 12 (8), 1-22 (2022).
  8. Qureshi, S. A., et al. Radiogenomic classification for MGMT promoter methylation status using multi-omics fused feature space for least invasive diagnosis through mpMRI scans. Sci Rep. 13, 3291(2023).
  9. Agrawal, T., et al. MultiFeNet: multi-scale feature scaling in deep neural network for the brain tumour classification in MRI images. Int J Imaging Syst Technol. 34 (1), 1-15 (2023).
  10. Brain tumor detection using U-Net and 3D CNN architecture. Ghanshala, A., et al. 2022 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS), Greater Noida, India, , (2022).
  11. Medical image denoising and brain tumor detection using CNN and U-Net. Shivahare, B. D., et al. 2023 3rd International Conference on Innovative Sustainable Computational Technologies (CISCT), , Dehradun, India. (2023).
  12. Kumar, S., et al. Enhancing brain tumor segmentation using Berkeley wavelet transformation and improved SVM. Open Bioinform J. 18, e18750362358232(2025).
  13. Cellular automata based edge-detection for brain tumor. Diwakar, M., Patel, P. K., Gupta, K. 2013 International Conference on Advances in Computing, Communications and Informatics (ICACCI, Mysore, India, , (2013).
  14. Agrawal, T., et al. A comparative study of brain tumor classification on unbalanced dataset using deep neural networks. Biomed Signal Process Control. 94, 106256(2024).
  15. Khan, M. A., et al. Transfer learning for accurate brain tumor classification in MRI: a step forward in medical diagnostics. Discov Onc. 16, 1040(2025).
  16. Asiri, A. A., et al. Enhancing brain tumor diagnosis: an optimized CNN hyperparameter model for improved accuracy and reliability. PeerJ Comput Sci. 10, e1878(2024).
  17. Aamir, M., et al. Brain tumor detection and classification using an optimized convolutional neural network. Diagnostics. 14 (16), 1714(2024).
  18. Kundu, S., Das, B., Balas, V. E. Data conditioning to improve segmentation of brain MRI using CNN. Computer Vision and Image Processing. CVIP 2024. Communications in Computer and Information Science. , Springer. Cham. (2025).
  19. Grad-CAM: visual explanations from deep networks via gradient-based localization. Selvaraju, R. R., et al. 2017 IEEE International Conference on Computer Vision (ICCV), Venice, Italy, , (2017).
  20. Iftikhar, S., et al. Explainable CNN for brain tumor detection and classification through XAI based key features identification. Brain Inform. 12, 10(2025).
  21. BR35H: brain tumor detection 2020. , Kaggle Dataset. https://www.kaggle.com/ahmedhamada0/brain-tumor-detection (2021).
  22. Zhang, D., et al. Neural networks-based fixed-time control for a robot with uncertainties and input dead zone. Neurocomputing. 390, 139-147 (2020).
  23. Tabassum, M., et al. Radiomics and machine learning in brain tumors and their habitat: a systematic review. Cancers. 15 (15), 3845(2023).
  24. Gonzalez, R. C., Woods, R. E. Digital Image Processing. , Pearson. Upper Saddle River, NJ. (2008).
  25. Otsu, N. A threshold selection method from gray-level histograms. IEEE Trans Syst Man Cybern. 9 (1), 62-66 (1979).
  26. Haralick, R. M., et al. Image analysis using mathematical morphology. IEEE Trans Pattern Anal Mach Intell. 9 (4), 532-550 (1987).
  27. Esteva, A., et al. Dermatologist-level classification of skin cancer with deep neural networks. Nature. 542, 115-118 (2017).
  28. Tjoa, E., Guan, C. A survey on explainable artificial intelligence (XAI): toward medical XAI. IEEE Trans Neural Netw Learn Syst. 32 (11), 4793-4813 (2021).
  29. Maier-Hein, L., et al. Metrics reloaded: recommendations for image analysis validation. Nat Methods. 21 (2), 195-212 (2024).
  30. Pineau, J., et al. Improving reproducibility in machine learning research. J Mach Learn Res. 22 (164), 1-20 (2021).
  31. Yaqub, M., et al. State-of-the-art CNN optimizer for brain tumor segmentation in magnetic resonance images. Brain Sci. 10 (7), 1-20 (2020).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Brain Tumor ClassificationImage PreprocessingConvolutional Neural NetworksMRI Brain TumorsOptimizer SensitivityCNN PerformanceRMSProp OptimizerStochastic Gradient DescentFive Fold Cross ValidationMedical Image Analysis

Related Articles