Abstract
Hyperparameter optimization is a critical determinant of the performance and generalizability of convolutional neural networks (CNNs), yet selecting optimal configurations remains a complex challenge due to the large, non-linear search space. While numerous optimization techniques have been explored in the literature, most comparative studies have relied on benchmark datasets, limiting insights into their practical effectiveness under real-world constraints. This study evaluates four widely used hyperparameter optimization methods (i.e., Grid Search, Optuna, Hyperopt, and DEAP) across five CNN architectures (i.e., AlexNet, GoogLeNet, LeNet, MobileNet, and ResNet18) under two distinct data regimes: the Modified National Institute of Standards and Technology (MNIST) benchmark and a custom SkinCancer image dataset. On MNIST, all configurations achieved strong classification performance, with test accuracies ranging from 95.45% to 97.61%, led by ResNet18 optimized via Grid Search (97.61%). In this simpler setting, DEAP provided the shortest optimization runtimes, while Optuna and Hyperopt offered an effective balance between performance and computational cost. In contrast, the SkinCancer dataset exhibited substantially greater variability in performance, highlighting the stronger influence of both model architecture and optimization strategy. ResNet18 achieved the highest overall test accuracy (81.50%) when optimized with Hyperopt. Although no single optimization method consistently outperformed all others, adaptive approaches frequently achieved competitive or superior predictive performance while requiring considerably less computation than exhaustive search. These findings demonstrate that hyperparameter optimization dynamics depend heavily on dataset complexity, where computational efficiency is the primary differentiator for simpler classification tasks, but optimization architecture selection becomes critical for navigating challenging medical imaging applications.
1. Introduction
Deep learning models, particularly convolutional neural networks (CNNs), have become the cornerstone of modern real-world applications including handwriting recognition [1,2,3] and medical image analysis [4,5,6]. Despite their remarkable success, the performance of CNNs is highly dependent on the appropriate selection of hyperparameters such as learning rate, batch size, optimizer type, and network-specific configurations [7]. This task, commonly referred to as the hyperparameter optimization problem, poses a considerable challenge due to the vast search space and the non-linear interactions between hyperparameters. Effective hyperparameter tuning is therefore crucial, as suboptimal configurations can significantly degrade model performance, limit generalizability, and hinder deployment in real-world applications [8]. Effective hyperparameter optimization involves several key elements: the choice of hyperparameters to tune, the definition of the search space, the optimization strategy, the evaluation criteria, and computational considerations. Understanding these components is essential for selecting appropriate optimization methods and interpreting their performance across different datasets and architectures [9,10,11].
A variety of strategies have been proposed in the literature to address this problem. Traditional approaches such as Grid Search [12,13] and Random Search [13] remain popular due to their simplicity and ease of implementation, though they are often computationally inefficient. To overcome the limitations of Grid Search and traditional exploration, hybrid and evolutionary variants have emerged to navigate discrete and continuous search spaces more efficiently. For instance, researchers have combined evolutionary search mechanics with numerical optimization to handle strict distortion constraints in medical imaging [14], while others have integrated Deep-Differential-Evolutionary algorithms with unsupervised transfer learning to optimize clustering in high-dimensional genomics [15].
More advanced methods, including Bayesian optimization frameworks like Hyperopt [16], adaptive search strategies such as Optuna [17], and evolutionary algorithms like DEAP [18], have emerged as more efficient alternatives. These methods leverage probabilistic modeling, heuristic search, or evolutionary principles to explore the hyperparameter space more effectively, striking a balance between accuracy and computational cost. Within Automated Machine Learning (AutoML) approaches, these principles have led to self-tuning architectures that eliminate manual trial-and-error altogether. This is evident in advanced multi-population architectures like the Co-Evolutionary Genetic Algorithm (CEGA), which was paired with pre-trained networks (EfficientNetB3 and DenseNet121) to automate hyperparameter discovery for brain tumor classification [19]. Similarly, meta-heuristic deep tuning techniques, such as integrating the Chimp Optimizer Algorithm (COA) for automated feature extraction [20] and employing Mutual Learning-based Artificial Bee Colony (ML-ABC) optimization within semi-supervised GAN architectures [21], have shown remarkable success in stabilizing network weights and maximizing diagnostic accuracy without heavy data augmentation.
Adaptive frameworks like Optuna and multi-fidelity pruning frameworks focus heavily on accelerating search speeds by combining intelligent sampling with early-stopping mechanisms. Demonstrating the efficacy of this paradigm, a recent two-stage multi-fidelity framework (DE-MFO-BO) utilized rapid, low-fidelity evolutionary exploration to isolate high-performing hyperparameter regions before executing deep refinement [22]. This approach yielded drastic enhancements in precision and recall for complex object detection tasks without requiring any modifications to the core deep learning architecture [22].
Meanwhile, sequential model-based optimization methods, particularly Hyperopt and Bayesian Optimization, have become the gold standard for tuning highly sensitive downstream tasks. In medical segmentation, a Gaussian-process-driven Bayesian framework (BO-UNet) successfully automated encoder–decoder structural tuning to achieve state-of-the-art segmentation maps [23], while a separate dual-optimization pipeline implemented a Bayesian Optimization Algorithm (BOA) to refine ensemble networks for hemorrhage detection [20]. Furthermore, addressing the severe dataset-specific volatility of massive biological foundation models, the adoption of a TPE-based Bayesian framework for fine-tuning scGPT consistently stabilized validation loss and preserved vital biological metrics across highly heterogeneous datasets [24].
Deep learning architectures that benefit from such optimization include standard CNNs and more complex networks such as super-resolution generative adversarial network (SRGAN) [25] and GridFormer for high-resolution image generation [26]. These architectures achieve state-of-the-art performance but are highly sensitive to hyperparameter settings, demonstrating the practical importance of systematic hyperparameter optimization studies.
While prior studies have extensively compared these optimization methods, the majority of research relies heavily on benchmark datasets such as Modified National Institute of Standards and Technology (MNIST), CIFAR-10, or ImageNet [3,27,28,29]. Aszemi and Dominic [27] addressed the challenges of hyperparameter optimization in CNNs, emphasizing that manual tuning and Grid Search are often impractical for large search spaces. Initial experiments employed Random Search, achieving moderate performance (~80% accuracy on CIFAR-10), while proposing the future use of hybrid genetic algorithms combined with local search to optimize both network architecture and training parameters. Additionally, alternative methods such as Bayesian and evolutionary algorithms have been discussed as efficient strategies for hyperparameter selection. Chowdhury et al. [28] evaluated the performance and efficiency of multiple hyperparameter optimization algorithms for deep learning models, including Grid Search, Random Search, Bayesian optimization [16,17], Genetic Algorithms (GA) [30], Hyperband [31], and Particle Swarm Optimization [32]. Experiments on VGG16 [33] and ResNet50 [34] architectures using CIFAR-10 and Intel Image Classification datasets showed that while all algorithms achieve similar optimization times, their performance varied across datasets and architectures, and no single method consistently outperformed the others. The study concluded that selecting an appropriate optimization strategy depends on the specific dataset and model. Ying [29] proposed a novel space-adjusted Bayesian optimization algorithm that selected the top percent points at each iteration to focus the search on promising regions of the hyperparameter space. When applied to test functions and datasets including MNIST and CIFAR-10, the algorithm achieved 36% and 18% improvement over canonical Efficient Global Optimization (EGO) [35], respectively. The approach adapted to variable importance and allowed sensitivity analysis for its hyperparameter, though challenges remained with local optima and theoretical convergence guarantees. The methodology is flexible and could potentially enhance other Bayesian optimization frameworks in future research. Meissner et al. [36] presented the Optimized Particle Swarm Optimization (OPSO) method, which meta-optimizes the free parameters of PSO by employing swarms within a swarm. The approach was evaluated on five artificial fitness functions and compared to two standard PSO implementations, showing improved optimization speed and quality. When applied to neural network training for predicting blood–brain barrier permeation of small molecules, OPSO reduced training time by factors of four and two relative to the other methods, producing a predictive model with good correlation across training, test, and validation data. The study concluded that meta-optimizing PSO parameters can significantly enhance overall performance and is straightforward to implement. Eberhart and Kennedy [37] described the use of PSO for non-linear function optimization and compared different paradigms, including the globally informed GBEST and locally informed LBEST models. Benchmark testing and applications, such as neural network training and robot task learning, demonstrated that GBEST converged fastest on average, while LBEST with a small neighborhood was more resistant to local minima. PSO was highlighted as a simple, robust, and memory-enabled algorithm bridging evolutionary computation and artificial life, with stochastic search and momentum effects allowing thorough exploration of solution spaces. The study concluded that PSO’s conceptual simplicity and effectiveness make it a versatile optimization method requiring minimal parameter specification. Nematzadeh et al. [38] proposed a method for hyperparameter tuning of machine learning algorithms using Gray Wolf Optimization (GWO) [39] and GA metaheuristics. Eleven algorithms, including classical models and deep neural networks with multiple architectures, were evaluated on 33 benchmark functions. The results showed that hyperparameter optimization improved training performance in all trials, with GWO demonstrating significantly better performance and faster convergence than Exhaustive Grid Search. The method automatically recommended the best algorithm and parameter configuration for a given dataset, making it suitable for datasets with unknown distributions, complex algorithm behavior, or users lacking deep expertise in data science.
Although benchmark datasets offer a controlled and consistent environment, they fail to capture the complexities of real-world datasets, which are often small, noisy, imbalanced, and heterogeneous. This reliance on benchmarks may limit the practical insights of hyperparameter optimization research, as models tuned on ideal datasets may not generalize effectively in applied domains such as medical imaging, environmental monitoring, and embedded AI systems. In these contexts, optimization strategies must balance accuracy, stability, and computational efficiency, particularly when operating under constraints of limited data, energy, or hardware resources.
Several studies have investigated hyperparameter optimization for deep learning; however, prior work often evaluates a limited set of optimization methods or focuses on single architectures and datasets. Although custom datasets are used in the literature, they are commonly employed to demonstrate newly proposed optimization techniques and are compared against only a small number of baselines. In contrast, this study provides a systematic, multidimensional evaluation by comprehensively comparing multiple optimization strategies across a diverse matrix of CNN architectures and heterogeneous datasets. The research question for the study is “How do different hyperparameter optimization techniques compare in terms of performance, stability, and computational efficiency across multiple CNN architectures under both benchmark and real-world data conditions?”
In this context, this study undertakes a comparative analysis of four hyperparameter optimization techniques (i.e., Grid Search, Optuna, Hyperopt, DEAP) across five CNN architectures (i.e., AlexNet [40], GoogLeNet [41], LeNet [42], MobileNet [43], ResNet18 [34]). CNNs were selected as the baseline architecture to ensure fair and reproducible comparison across optimization algorithms, given their well-established training dynamics and standardized evaluation protocols. This choice isolates the impact of hyperparameter optimization from architectural variability, enabling clearer attribution of performance differences to the optimization methods themselves. The evaluation is structured into two complementary experiments: one using the MNIST benchmark dataset [3] to examine optimization performance under ideal conditions, and the other using a custom SkinCancer dataset [44] to reflect the constraints of real-world medical imaging, including challenging conditions, limited data samples, and data diversity. This dual-experiment design enables a holistic assessment of the suitability of different optimization strategies across both controlled and practical contexts. Moreover, we provide statistical pairwise validation of optimization outcomes, offering rigorous evidence of method effectiveness. In addition to systematically comparing hyperparameter optimization strategies, this study provides recommendations helping practitioners choose effective optimization approaches for both benchmark and real-world applications.
The key contributions of this study are threefold. First, it provides a systematic comparison of common hyperparameter optimization methods across a diverse set of CNN models, thereby offering insights into their relative strengths and weaknesses. Second, by incorporating both a benchmark dataset and a real-world medical dataset, it highlights how optimization strategies behave under contrasting data regimes. Third, statistical pairwise tests were conducted on both datasets to complement conventional performance metrics and to better understand the impact of different hyperparameter optimization methods.
2. Materials and Methods
2.1. Datasets
- (1)
- Modified National Institute of Standards and Technology (MNIST) Dataset
The MNIST dataset is a benchmark dataset widely used for evaluating image classification and handwritten digit recognition algorithms [3]. It comprises a total of 70,000 labeled grayscale images of handwritten digits ranging from 0 to 9, with 60,000 images allocated for training and 10,000 for testing. Each image is a pixel square. The digits were originally collected from a broader set in the MNIST dataset, then centered and normalized to improve uniformity. The dataset is balanced across classes, with approximately 7000 examples per digit. Due to its simplicity, consistency, and relatively small size, MNIST is commonly used for prototyping and benchmarking machine learning algorithms, particularly in the early stages of deep learning research. Figure 1 illustrates one representative image from each of the ten digit classes (0–9), highlighting the variation in handwriting styles captured within the dataset. Despite being considered a “solved” problem in recent years, MNIST continues to serve as a fundamental entry point for experimentation in image classification and neural network design.
Figure 1.
A sample from each class of the MNIST dataset [3].
- (2)
- SkinCancer Dataset
The SkinCancer dataset utilized in this study represents a real-world medical imaging resource sampled directly from the International Skin Imaging Collaboration (ISIC) Archive via a curated public repository [44,45]. The dataset comprises 3600 balanced dermoscopic images, with exactly 1800 benign and 1800 malignant cases, all standardized to a resolution of pixels [44]. Per the established ISIC Archive data provenance standards [45,46], the ground truth annotations follow a strict clinical validation hierarchy. Malignant cohorts were verified strictly through histopathological examination (biopsy) to ensure absolute diagnostic accuracy. Benign cohorts were verified either via histopathology, in vivo confocal microscopy, or the formal clinical consensus of multiple expert dermatologists. This rigorous tracking guarantees the integrity and reliability of the classification labels used throughout our benchmarking pipeline. Unlike synthetic or simulated datasets, it reflects the variability and complexity of actual clinical cases, making it highly relevant for training and evaluating machine learning models intended for medical application. Its balanced design helps mitigate class imbalance issues frequently encountered in clinical datasets, enabling robust model development and fair performance assessment. Figure 2 shows some sample images from each class of the dataset. This dataset is particularly valuable because it incorporates the nuances of real-world data, such as variations in lighting, skin tones, and mole characteristics, which are critical for developing robust models that can generalize well to unseen clinical scenarios. Therefore, leveraging this dataset allows for a more reliable evaluation of model performance in a context that closely resembles actual clinical practice.
Figure 2.
A few samples from each class of the SkinCancer dataset [44].
2.2. CNN Architectures
- (1)
- LeNet
LeNet, developed by Yann LeCun [42] in the late 1980s and widely known as LeNet-5, is one of the earliest CNN architectures and was originally designed for handwritten digit recognition, such as classifying digits from the MNIST dataset. It introduced the foundational components of modern CNNs, including convolutional layers for feature extraction, subsampling (pooling) layers for dimensionality reduction, and fully connected layers for classification. LeNet is relatively shallow and consists of only seven layers, making it computationally efficient and suitable for small-scale image tasks. Its simplicity and modular design laid the groundwork for deeper and more complex CNNs, and while it lacks advanced features like Rectifying Linear Unit (ReLU) activations or batch normalization, it remains an essential historical milestone in the evolution of deep learning.
- (2)
- AlexNet
AlexNet, proposed by Alex Krizhevsky et al. [40] in 2017, represented a breakthrough in CNN architecture that won the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) by a significant margin, reigniting global interest in deep learning. It consists of eight learned layers (five convolutional and three fully connected), and introduced several key innovations: the use of ReLU for faster training, dropout layers to prevent overfitting, and overlapping max-pooling layers. Notably, AlexNet leverages GPU acceleration to train on large-scale datasets, a technique that became standard practice thereafter. Compared to LeNet, AlexNet is significantly deeper and more computationally intensive, and is designed to handle complex, high-resolution images from large datasets like ImageNet rather than small, simple inputs.
- (3)
- GoogLeNet
GoogLeNet, introduced by Szegedy et al. [41] in 2015 as the winner of ILSVRC 2014, is notable for its deep architecture (22 layers) and the introduction of the Inception module, a novel approach to improving efficiency and depth. The Inception module applies multiple convolution filters (1 1, 3 3, 5 5) and a pooling operation in parallel, concatenating their outputs to capture features at multiple scales without excessively increasing computational cost. This design reduces the number of parameters compared to fully connected layers while maintaining high accuracy. Unlike traditional sequential CNNs like AlexNet, GoogLeNet emphasizes computational efficiency and structural diversity within each layer, setting the stage for future modular and scalable architectures.
- (4)
- ResNet18
ResNet18 is a variant of the Residual Network (ResNet) architecture introduced by He et al. [34] in 2016, designed to address the degradation problem in deep neural networks, where increasing depth leads to worse performance due to vanishing gradients. The key innovation in ResNet is the use of residual connections, which are shortcut paths that allow the network to learn residual functions instead of direct mappings. These identity shortcuts enable efficient gradient flow during backpropagation, allowing networks to be trained with hundreds of layers without performance degradation. ResNet18, with 18 layers, serves as a lightweight yet powerful model that balances depth and computational efficiency. Unlike earlier models like AlexNet or GoogLeNet, which focus on architectural width or multi-scale filtering, ResNet emphasizes depth with structural support to ensure trainability and performance stability.
- (5)
- MobileNet
MobileNet, developed by Howard et al. [43] in 2017, is a lightweight CNN architecture optimized for mobile and embedded vision applications where computational resources are limited. Its core innovation is the use of depthwise separable convolutions, which decompose standard convolutions into a depthwise convolution (per-channel spatial filtering) followed by a pointwise convolution (1 1 convolution across channels). This reduces the model size and computational cost dramatically, while maintaining competitive accuracy on tasks like image classification and object detection. MobileNet also allows customization via width and resolution multipliers, enabling trade-offs between accuracy and efficiency. Compared to heavier models like AlexNet or GoogLeNet, MobileNet is specifically designed to run efficiently on low-power devices with limited memory.
2.3. Hyperparameter Optimization Techniques
- (1)
- Grid Search
Grid Search is a brute force hyperparameter optimization technique that systematically evaluates all possible combinations of a predefined set of hyperparameter values [12,13]. For each hyperparameter, the user specifies a discrete set of values, and the model is trained and evaluated for every combination across the Cartesian product of these values. While simple and exhaustive, Grid Search becomes computationally expensive as the number of hyperparameters or their candidate values increases, making it less suitable for high-dimensional search spaces. Its main advantage is reproducibility and thoroughness, but its rigid grid structure can lead to wasted resources on uninformative regions of the hyperparameter space, especially when only a few hyperparameters have a strong influence on performance.
- (2)
- Distributed Evolutionary Algorithms in Python (DEAP)
DEAP is a flexible evolutionary computation framework that supports a wide range of bio-inspired optimization algorithms, including genetic algorithms (GAs) [47] for hyperparameter tuning [48]. In this approach, a population of candidate solutions (i.e., sets of hyperparameters) evolves over multiple generations using operators such as selection, crossover, and mutation. DEAP is particularly powerful for navigating complex, non-differentiable, or highly non-convex search spaces where gradient-based or probabilistic methods may struggle [18,49]. Its flexibility and extensibility allow researchers to implement custom fitness functions and hybrid strategies. Unlike Bayesian approaches like Hyperopt or Optuna, DEAP is population-based and does not rely on probabilistic models, making it well-suited for global optimization at the cost of higher computational demands.
- (3)
- Optuna
Optuna is a modern, open-source hyperparameter optimization framework that employs automated, adaptive search strategies using techniques like Tree-structured Parzen Estimators (TPE) [50] and pruning to efficiently explore hyperparameter spaces [17]. Unlike Grid Search, Optuna is designed to be dynamic and feedback-driven as it constructs a search space programmatically, performs intelligent sampling based on past trial outcomes, and prunes unpromising trials early to reduce computation time. Optuna also supports parallel execution and visualization tools, making it scalable and user-friendly. Its performance-oriented and model-agnostic design makes it highly suitable for tuning complex models like deep neural networks.
- (4)
- Hyperopt
Hyperopt is a Python library for serial and parallel hyperparameter optimization using Bayesian optimization algorithms, most notably the TPE [16]. It allows users to define search spaces that include real, integer, categorical, and conditional parameters, and it explores these using probabilistic models to predict which configurations are likely to perform well. Compared to Grid Search, Hyperopt uses prior results to inform future trials, significantly reducing the number of evaluations needed. While similar in principle to Optuna, Hyperopt is slightly older and is often used in research environments requiring custom search space definitions. However, it lacks some of the dynamic features and user interface improvements found in newer frameworks like Optuna.
2.4. Experimental Design
This study is designed to investigate the effectiveness of various hyperparameter optimization techniques when applied to CNNs spanning different generations of deep learning architectures. The primary objective is to perform a comparative analysis of how these optimization approaches perform across both ideal benchmark datasets and more practical, limited-data scenarios. This dual focus enables a comprehensive evaluation of tuning strategies, offering insights into their suitability depending on model complexity, data availability, and application context. To achieve this, we have structured our investigation into two experiments, each targeting a different data context while maintaining consistent model and optimization technique configurations:
- Experiment A: This experiment evaluated four hyperparameter optimization methods (i.e., Grid Search, Optuna, Hyperopt, DEAP) across five CNN models (i.e., AlexNet, GoogLeNet, LeNet, MobileNet, ResNet18). The experiments were conducted using the MNIST dataset, a widely used benchmark consisting of grayscale images of handwritten digits. This dataset was chosen due to its clean, balanced, and structured nature, which allows for controlled, large-scale experimentation in an ideal environment where data is plentiful and consistent.
- Experiment B: This experiment mirrors the setup of Experiment A but was conducted using a small-scale, custom SkinCancer image dataset. Unlike MNIST, this dataset reflects a more realistic medical imaging scenario characterized by limited data and increased variability. The goal here was to observe how each optimization method copes with practical constraints such as data scarcity and class heterogeneity, which are common challenges in real-world deep learning applications.
The selected models represent key milestones in CNN development. LeNet reflects the early stages of CNN design with a simple, shallow architecture; AlexNet introduced deeper layers, ReLU activation, and Graphics Processing Unit (GPU) acceleration, catalyzing the deep learning revolution; GoogLeNet contributed the Inception module, allowing multi-scale feature extraction with reduced computational cost; ResNet-18 demonstrated the power of residual connections to facilitate the training of deeper networks; and MobileNet offers a modern, efficient design optimized for mobile and embedded applications using depthwise separable convolutions. By choosing architectures from different generations, we ensure that our evaluation spans a range of design principles, network depths, and computational footprints.
Similarly, the four hyperparameter optimization techniques selected for this study represent a broad methodological spectrum. Grid Search serves as a baseline through exhaustive combinatorial exploration. Hyperopt and Optuna both leverage Bayesian optimization via TPE, allowing for adaptive and guided exploration of the hyperparameter space based on prior trial performance. DEAP, by contrast, adopts an evolutionary algorithm approach using population-based optimization through genetic operations such as mutation and crossover. This diversity in optimization strategies allows us to assess each method not only in terms of performance but also in efficiency, adaptability, and suitability for different model and data complexities.
2.5. Experimental Protocols and Evaluation Measures
All experiments in this study were implemented using Python 3.12.11 and PyTorch 2.8.0. Model development and training were conducted on Google Colab Pro+ with an A100 GPU (80 GB VRAM). The CNN architectures were trained from scratch for 10 epochs with a batch size of 64, using the Adam optimizer and cross-entropy loss. Single-channel images were up-sampled to pixels, normalized, and processed without spatial data augmentation. Accordingly, the first layer of each network was modified to accept a single input channel, while the final layer was mapped to match the target classes of each dataset using the optimized dropout rate.
To ensure strict test-set isolation and prevent data leakage during hyperparameter optimization (HPO) for both Experiment A and Experiment B, the datasets were partitioned into an 80:10:10 train-validation-test split. The HPO algorithms explored the search space using validation set accuracy as the sole performance metric. Following the completion of the 64-trial HPO budget, the optimal hyperparameter configuration was selected. Using this optimal configuration, a brand-new model instance was initialized and completely retrained from scratch to ensure no parameter states or weight histories carried over from the tuning trials. During this final retraining stage, the train subset was utilized within the epoch loop to update the network weights, while the validation subset was evaluated at the end of each epoch to continuously monitor validation loss and accuracy.
Once the fixed training duration was complete, the live model weights from the very last epoch (Epoch 10) were evaluated exactly once on the isolated test set to record the final test accuracy. Due to the high computational overhead of the multi-architecture, multi-seed evaluation matrix, nested cross-validation and early stopping were not utilized; all models were trained for a fixed epoch duration. To maintain the integrity of the experiments, the same data split was used for all hyperparameter optimization methods and model runs within each dataset. Data preprocessing steps such as normalization and resizing (where required) were uniformly applied across all samples to ensure comparability.
Each model was trained using four different hyperparameter optimization techniques: Grid Search, Optuna, Hyperopt, and DEAP. For the Bayesian optimization frameworks, both toolkits were evaluated over a total budget of 64 trials without pruning mechanisms. Hyperparameter sampling was driven by the Tree-structured Parzen Estimator algorithm, configured to maximize classification accuracy. The DEAP framework utilized a genetic algorithm with a population size of 16 over 3 generations. Optimization employed tournament selection (size = 3), uniform crossover with a crossover probability of 0.5, and a discrete random resetting mutation with an individual-level rate of 0.3 and a per-gene mutation probability of 0.3. The optimal hyperparameters were extracted from the best individual across all evaluated trials.
These optimizers were tasked with tuning key hyperparameters including learning rate, dropout rate and weight decay. The hyperparameter search space was set as follows: learning rate weight decay ; and dropout rate The optimization process was constrained by a fixed budget of evaluations (64 trials) per technique to ensure a fair comparison in terms of computational cost and time. Bayesian methods are inherently sample-efficient and are commonly applied under limited evaluation budgets when training deep networks [16,17,51]. Although evolutionary approaches may benefit from larger populations or longer runs, constrained budgets are frequently used to assess their relative performance and stability rather than asymptotic convergence [18]. This design isolates optimizer behavior under identical and realistic computational constraints.
To assess model performance, we employed a combination of standard classification metrics and computational efficiency measures. Specifically, the following evaluation metrics were used:
- Accuracy: Training accuracy measures how well the model fits the training data, providing insight into its learning capacity. Testing accuracy evaluates the model’s generalization performance on unseen data, which is critical for assessing real-world applicability. Equation (1) presents the mathematical expression for accuracy as a function of True Positives (), False Positives (), True Negatives (), and False Negatives ().
- Precision: Calculates the proportion of correctly predicted positive samples among all samples predicted as positive. This is especially relevant in datasets with class imbalance. The mathematical expression used to calculate precision is given in Equation (2).
- Recall: Measures the proportion of correctly predicted positive samples among all actual positive samples, indicating the model’s sensitivity. The mathematical expression used to calculate recall is given in Equation (3).
- F1 Score: The harmonic mean of precision and recall, offering a balanced view of the model’s predictive power when both false positives and false negatives are of concern. Equation (4) shows the mathematical expression for calculating F1 score.
- Time Taken: Captures the total runtime required for each optimization technique to complete its search and training process, serving as a practical measure of computational efficiency.
- Receiver Operating Characteristic (ROC) curve: a graphical representation of a classifier’s ability to distinguish between classes, plotting the true positive rate against the false positive rate at various threshold settings. The Area Under the Curve (AUC) quantifies this performance as a single scalar value, where an AUC of 1.0 indicates perfect classification and 0.5 represents random guessing.
Rather than relying on a standard computer-vision classification threshold of 0.5, we established a clinical operational threshold policy for the skin cancer dataset, calibrated to prioritize sensitivity over specificity and approach the 95% target for malignancies, aligning our evaluation framework with safety-first benchmarks in recent literature [52,53]. To determine this threshold, we iteratively reduced the decision threshold below 0.5 on the validation set and evaluated multiple discrete values until obtaining a classification recall reasonably close to the 95% target. Crucially, this threshold-selection procedure serves strictly as a computational HPO benchmarking framework for algorithmic comparison, and the interpretation of these results remains limited to computational performance rather than clinical validation.
Algorithmic variance and stochastic initialization bias were strictly controlled by executing 20 independent runs with 20 distinct random seeds for each of the four optimizers across all five architectures and two datasets. To satisfy the structural assumptions of paired statistical analysis, a shared, fixed pool of 20 random initialization seeds was consistently applied across all optimization conditions within each comparison. Consequently, identical seeds governed the data splits and network initializations, directly pairing the performance samples across the HPO methods and generating independent performance samples per configuration. A two-step non-parametric statistical framework was subsequently employed at a significance level () to assess the performance differences among the competing optimization algorithms for each dataset using the obtained test accuracy values as the metric for all statistical evaluations. First, a global Friedman test was conducted for each dataset and CNN architecture configuration to evaluate the overall statistical significance of performance differences across the optimization methods. Following a significant Friedman test result, post hoc pairwise comparisons were executed using the Wilcoxon signed-rank test to isolate the specific variations between the four optimization methods (comprising six distinct pairs per architecture within each dataset). To quantify precision and stability, final classification accuracy values are reported as the mean performance with its corresponding 95% Confidence Interval (CI) via a Student’s distribution [54]. Furthermore, to evaluate the practical magnitude of improvement beyond binary p-values, the Matched-Pairs Rank-Biserial Correlation was computed as the native non-parametric effect size for statistically significant pairwise Wilcoxon signed-rank tests to directly quantify optimization superiority [55]. To strictly control the family-wise error rate and mitigate the risk of Type I errors (false positives) arising from these multiple comparisons, the Holm-Bonferroni correction was applied to all post hoc -values.
The final classification results are reported as the mean accuracy standard deviation across the 20 runs. The learning curves presented correspond to the mean values across the 20 independent runs.
3. Results
3.1. Experiment A Results
The experiments on the MNIST dataset demonstrated strong classification performance across all CNN architectures and hyperparameter optimization methods, reflecting the relative simplicity of the benchmark. As summarized in Table 1, test accuracies ranged from 95.45% to 97.61%, with the highest performance achieved by ResNet18 using Grid Search (0.9761 ± 0.0019), followed closely by GoogLeNet with Grid Search (0.9747 ± 0.0017). Among the shallower networks, LeNet attained a maximum test accuracy of 0.9658 ± 0.0008 using Optuna, while AlexNet achieved 0.9717 ± 0.0008 under Optuna. MobileNet exhibited the lowest overall performance, with test accuracies varying between 0.9545 and 0.9643 across optimization approaches. The exceptionally narrow 95% confidence intervals across all evaluations (with margins of error strictly bounded within ) underscore the high precision and statistical stability of these classification metrics. Precision, recall, F1-score, and specificity closely mirrored test accuracy for all models, indicating balanced classification performance without notable class bias. Furthermore, all architectures achieved exceptionally high AUC-ROC and AUC-PR values (>0.993), confirming robust discriminative capability despite differences in classification accuracy.
Table 1.
Summary of Quantitative Results for the MNIST Dataset. Test accuracies are reported alongside their 95% confidence intervals [95% CI], and algorithmic search time is reported in seconds (s).
With regard to the optimization frameworks, no single method consistently achieved the best results across all architectures. Optuna produced the highest test accuracy for both LeNet (0.9658) and AlexNet (0.9717), whereas Grid Search yielded the strongest performance for GoogLeNet (0.9747), ResNet18 (0.9761), and MobileNet (0.9643). Hyperopt generally achieved competitive results but rarely outperformed the leading methods, while DEAP consistently produced accuracies comparable to those of Hyperopt and Optuna. The optimized hyperparameters shown in Table 2 indicate that learning rates of either 10−3 or 10−4 were most frequently selected, whereas optimal dropout values varied considerably across architectures and optimization techniques. For example, Optuna favored a low dropout rate of 0.1 for AlexNet and MobileNet but selected higher values for GoogLeNet and ResNet18, highlighting the architecture-dependent nature of hyperparameter selection.
Table 2.
Summary of Optimized Hyperparameters for MNIST Dataset.
A more pronounced distinction among the optimization methods was observed in computational efficiency. Across all architectures, Grid Search required the greatest runtime, ranging from approximately 8230 s for LeNet to over 16,620 s for GoogLeNet. In contrast, DEAP consistently achieved the shortest execution times, reducing optimization time by approximately 32% relative to Grid Search while maintaining similar predictive performance. Optuna and Hyperopt offered an intermediate balance between runtime and accuracy, generally requiring substantially less computation than Grid Search while achieving comparable or superior classification results. Notably, for the deep architectures GoogLeNet and ResNet18, DEAP reduced runtime to approximately 11,242 s and 10,858 s, respectively, compared with 16,620 s and 15,883 s obtained through Grid Search. These findings suggest that evolutionary optimization approaches can provide considerable computational savings without substantial degradation in predictive performance.
The learning curves presented in Figure 3 and Figure 4 indicate stable training behavior across all models and optimization techniques. Training and validation accuracies increased rapidly during the early epochs and subsequently plateaued, while training and validation losses consistently declined, demonstrating effective convergence. Although deeper architectures generally attained higher final accuracies, the gaps between training and validation performance remained small, suggesting limited overfitting.
Figure 3.
Training and validation accuracy curves for the CNN models trained using multiple hyperparameter optimization techniques on the MNIST dataset.
Figure 4.
Training and validation loss curves for the CNN models trained using multiple hyperparameter optimization techniques on MNIST dataset.
The ROC curves shown in Figure 5 further support these observations, with all models achieving AUC values exceeding 0.99 regardless of the optimization strategy employed. Overall, for the MNIST dataset, the choice of optimization method primarily influenced training efficiency rather than final accuracy, with Optuna and Hyperopt offering a favorable balance between performance and runtime, and DEAP excelling in computational speed.
Figure 5.
Cumulative ROC curves for the CNN models trained using multiple hyperparameter optimization techniques on MNIST dataset.
The Holm Corrected Wilcoxon Test and Friedman Test from Table 3 and Table 4, respectively, confirmed that the choice of hyperparameter optimization method significantly influenced performance across all architectures, as evidenced by the Friedman test results for LeNet (), AlexNet (), GoogLeNet ), ResNet18 (), and MobileNet (), all indicating significant differences among optimization strategies (). Pairwise comparisons showed that these differences were not uniformly distributed across methods. For LeNet, Grid Search, Hyperopt, and Optuna did not differ significantly from one another, whereas DEAP exhibited highly significant differences relative to all three competing methods with strong effect sizes against Grid Search Hyperopt and Optuna A similar pattern was observed for AlexNet, GoogLeNet, and ResNet18, where Grid Search, Optuna, and Hyperopt were often statistically comparable (), while DEAP frequently showed significant differences from the other approaches, yielding rank-biserial effect sizes ranging from to across these three architectures. MobileNet displayed the greatest degree of statistical separation, with multiple significant pairwise differences involving Hyperopt, DEAP, and Optuna. However, despite the statistical significance identified by both the Friedman and pairwise tests, the practical performance differences remained relatively small, with test accuracies typically differing by less than 2% across optimization methods. These findings suggest that the observed significance arises primarily from consistent performance variations across repeated trials rather than substantial disparities in predictive capability, indicating that optimization strategy has a measurable but limited impact on MNIST classification performance.
Table 3.
Summary of Holm Corrected Wilcoxon Test Results and Rank-Biserial Effect Sizes for the MNIST Dataset. Active cells report post hoc pairwise p-values along with their corresponding non-parametric effect sizes in parentheses.
Table 4.
Friedman Test Results for the MNIST Dataset.
The violin plots in Figure 6 further illustrate the distribution of model performance across optimization strategies. Optuna generally exhibited narrow distributions and consistently strong median performance, particularly for LeNet and AlexNet, whereas Grid Search displayed mixed behavior on deeper models, showing a wide spread and lower median on ResNet18 but remaining top-heavy on MobileNet. DEAP displayed competitive but slightly lower median accuracies in several cases, accompanied by relatively stable distributions. Hyperopt demonstrated balanced behavior, typically producing performance distributions similar to those of Optuna and Grid Search. Collectively, the visual and statistical evidence indicates that although optimization strategy exerts a measurable influence on performance, the resulting accuracy differences are comparatively small relative to the substantial differences in computational cost. Therefore, for the MNIST dataset, the choice of optimization technique is better guided by efficiency considerations than by absolute performance gains. Optuna appears to offer the most favorable balance between accuracy and runtime, whereas DEAP provides the greatest computational efficiency, particularly for deeper architectures. Overall, these findings suggest that on relatively simple image-classification tasks such as MNIST, most modern hyperparameter optimization methods are capable of identifying near-optimal solutions, making runtime efficiency the primary distinguishing factor among competing approaches.
Figure 6.
Violin plots for the CNN models trained using multiple hyperparameter optimization techniques on the MNIST dataset.
3.2. Experiment B Results
The SkinCancer dataset, unlike MNIST, exhibited substantially greater variability in both training dynamics and classification performance, reflecting the increased complexity and heterogeneity of dermoscopic images. Quantitative results presented in Table 5 show that classification performance varied considerably across architectures and optimization methods. Overall, the highest test accuracy was achieved by ResNet18 using Hyperopt (0.8150), closely followed by DEAP (0.8125) and Optuna (0.8075). Among the remaining architectures, GoogLeNet demonstrated strong and consistent performance, achieving test accuracies between 0.7910 and 0.8120, with Grid Search producing the best result. AlexNet achieved moderate performance, with test accuracies ranging from 0.7685 to 0.7954, while MobileNet exhibited mixed outcomes, attaining accuracies between 0.7395 and 0.7955 depending on the optimization strategy. LeNet produced the weakest classification results overall, although Hyperopt improved its test accuracy to 0.7650, noticeably outperforming the other optimization approaches. Crucially, the narrow 95% confidence intervals across all evaluations, with margins of error consistently restricted to or less, demonstrate high precision and stability in the reported test accuracies. Across precision, recall, F1-score, specificity, AUC-ROC, and AUC-PR metrics, ResNet18 and GoogLeNet consistently delivered the most balanced performance, whereas LeNet generally exhibited weaker generalization despite maintaining relatively high recall values. Table 6 summarizes the corresponding optimized hyperparameter configurations, including learning rate, dropout rate, and weight decay selected by each optimization method.
Table 5.
Summary of Quantitative Results for the SkinCancer Dataset. Test accuracies are reported alongside their 95% confidence intervals [95% CI], and algorithmic search time is reported in seconds (s).
Table 6.
Summary of Optimized Hyperparameters for SkinCancer Dataset.
The choice of hyperparameter optimization strategy had a pronounced effect on model performance. For several architectures, adaptive search techniques outperformed exhaustive approaches. Hyperopt delivered the highest test accuracy for both LeNet (0.7650) and ResNet18 (0.8150), while Optuna achieved the best result for AlexNet (0.7954) and MobileNet (0.7955). In contrast, Grid Search produced the strongest performance for GoogLeNet (0.8120) but required substantially longer training times. Bayesian optimization approaches, particularly Optuna and Hyperopt, frequently achieved competitive or superior performance while maintaining lower computational costs than Grid Search. For example, ResNet18 trained with Hyperopt required approximately 10,039 s compared with 13,057 s for Grid Search, while simultaneously improving test accuracy from 0.8050 to 0.8150. Similarly, LeNet optimized by Hyperopt achieved notable gains in accuracy and AUC metrics relative to Grid Search and Optuna. DEAP also demonstrated strong computational efficiency, consistently requiring the shortest training time among the methods for most architectures while maintaining competitive predictive performance. For example, DEAP reduced training time for ResNet18 to 8676 s while achieving a test accuracy of 0.8125, only marginally below the best-performing Hyperopt configuration.
The training accuracy and loss curves shown in Figure 7 and Figure 8 further support these observations. Simpler architectures such as LeNet frequently displayed larger gaps between training and validation performance, indicating increased susceptibility to overfitting. AlexNet also exhibited greater performance fluctuations across optimization techniques. In contrast, deeper architectures, particularly ResNet18 and GoogLeNet, demonstrated more stable convergence behavior and superior generalization across validation and test sets. The performance advantages of these deeper networks are also reflected in their higher AUC-ROC values, which exceeded 0.90 for the best-performing configurations. Specifically, ResNet18 achieved an AUC-ROC of 0.9150 under Hyperopt, while GoogLeNet reached 0.9092 under Grid Search. These results indicate strong discriminative capability despite the challenges associated with the SkinCancer dataset. Figure 9 similarly illustrates clear separation among optimization methods, with AUC-ROC values ranging from approximately 0.82 for LeNet to over 0.91 for ResNet18.
Figure 7.
Training and validation accuracy curves for the CNN models trained using multiple hyperparameter optimization techniques on the SkinCancer dataset.
Figure 8.
Training and validation loss curves for the CNN models trained using multiple hyperparameter optimization techniques on the SkinCancer dataset.
Figure 9.
Cumulative ROC curves for the CNN models trained using multiple hyperparameter optimization techniques on the SkinCancer dataset.
The Holm Corrected Wilcoxon Test and Friedman Test results presented in Table 7 and Table 8, respectively, provide further evidence of the influence of optimization strategy on classification performance. The Friedman test revealed statistically significant differences among hyperparameter optimization methods for all evaluated architectures. The strongest evidence was observed for AlexNet () and GoogLeNet (), while significant differences were also identified for LeNet (), ResNet18 (), and MobileNet (). These findings indicate that optimization method selection significantly affects model performance across the entire set of CNN architectures. Pairwise post hoc comparisons revealed highly architecture-dependent statistical differences between optimization approaches. For LeNet, DEAP significantly differed from Grid Search and Optuna, yielding substantial rank-biserial effect sizes and ., respectively), but matched Hyperopt, while no other methods diverged. On AlexNet and ResNet18, DEAP consistently demonstrated significant performance deviations from all three alternative frameworks, marked by prominent effect sizes peaking at . Conversely, GoogLeNet showed unique variations where Optuna differed significantly from both Grid Search and DEAP, though the most pronounced effect size in this architecture occurred between DEAP and Grid Search ). Finally, MobileNet exhibited the least separation, with a significant difference emerging uniquely between DEAP and Hyperopt , , demonstrating that optimization impacts vary greatly by network architecture.
Table 7.
Summary of Holm Corrected Wilcoxon Test Results and Rank-Biserial Effect Sizes for the SkinCancer Dataset. Active cells report post hoc pairwise p-values along with their corresponding non-parametric effect sizes in parentheses.
Table 8.
Friedman Test Results for the SkinCancer Dataset.
The violin plots in Figure 10 summarize performance distributions on the SkinCancer dataset. High overall volatility is evident across almost all architectures and optimization approaches. On LeNet, Optuna stands out with a highly concentrated, low-variability distribution. Conversely, on GoogLeNet and ResNet18, adaptive methods display high dispersion with long lower tails. MobileNet reveals a reversal, where Grid Search achieves a concentrated, top-heavy profile. On this same model, DEAP and Hyperopt show heavily downward-skewed performance. Visually, no single optimizer consistently guarantees tight stability across all network types. Overall, the combination of quantitative metrics, statistical significance testing, and visual analysis suggests that adaptive optimization approaches, particularly Hyperopt, Optuna, and DEAP, offer a more effective balance between predictive accuracy, robustness, and computational efficiency than traditional exhaustive search methods for the SkinCancer dataset.
Figure 10.
Violin plots for the CNN models trained using multiple hyperparameter optimization techniques on the SkinCancer dataset.
3.3. Discussion on Results
The experimental results demonstrate that the effectiveness of hyperparameter optimization is strongly influenced by dataset complexity, affecting both predictive performance and computational efficiency. Across both experiments, all optimization methods were capable of identifying competitive hyperparameter configurations; however, their relative advantages varied substantially between the simple MNIST benchmark and the more challenging SkinCancer dataset. These findings emphasize that the selection of a hyperparameter optimization strategy should be informed not only by predictive performance but also by the complexity of the learning task and available computational resources.
For the MNIST dataset, all CNN architectures achieved high classification performance regardless of the optimization technique employed. Test accuracies ranged from 95.45% to 97.61%, with ResNet18 optimized using Grid Search producing the highest accuracy (97.61%), closely followed by GoogLeNet (97.47%). Similarly, precision, recall, F1-score, specificity, AUC-ROC, and AUC-PR values remained consistently high across all models, with AUC values generally exceeding 0.99. These results indicate that MNIST represents a relatively straightforward classification task in which the underlying class distributions are well separated and can be effectively learned by a wide range of network architectures. Consequently, the influence of hyperparameter optimization on final predictive performance was limited, with differences in test accuracy typically below 2% across optimization methods.
Although performance differences were relatively small, noticeable differences emerged in computational efficiency. Grid Search consistently required the longest optimization time, particularly for deeper architectures such as GoogLeNet and ResNet18, where runtimes exceeded 15,000 s. In contrast, DEAP achieved the shortest execution times across all models, reducing optimization time by approximately 25–35% relative to Grid Search while maintaining comparable predictive performance. Optuna and Hyperopt provided an effective compromise between runtime and classification accuracy, often requiring substantially less computation than Grid Search while achieving similar or superior results. The training and validation curves further confirmed stable convergence behavior, with only minor gaps between training and validation performance, suggesting limited overfitting. Statistical testing revealed significant differences among optimization methods for all architectures according to the Friedman test; however, the practical magnitude of these differences remained small. Therefore, for a relatively simple benchmark such as MNIST, computational efficiency appears to be a more important consideration than marginal improvements in predictive performance.
A markedly different pattern emerged for the SkinCancer dataset. Compared with MNIST, classification performance was substantially lower and more variable across architectures and optimization methods, reflecting the increased complexity, heterogeneity, and visual variability of dermoscopic images. In this setting, deeper architectures consistently outperformed shallower models. ResNet18 achieved the highest overall test accuracy (81.50%) when optimized using Hyperopt, followed closely by DEAP (81.25%) and Optuna (80.75%). GoogLeNet also demonstrated strong performance, achieving test accuracies between 79.10% and 81.20%. In contrast, LeNet and MobileNet generally produced lower classification accuracy and weaker overall generalization performance. These findings suggest that deeper architectures were better able to capture the complex hierarchical features required for accurate skin lesion classification.
Unlike MNIST, the choice of hyperparameter optimization method exerted a more substantial influence on predictive performance for the SkinCancer dataset. Hyperopt achieved the highest accuracy for both LeNet and ResNet18, while Optuna produced the strongest results for AlexNet and MobileNet. Grid Search yielded the best performance for GoogLeNet but required considerably longer computational time. Overall, adaptive optimization approaches, particularly Hyperopt and Optuna, frequently matched or exceeded the performance of Grid Search while substantially reducing optimization costs. For example, Hyperopt improved ResNet18 test accuracy from 80.50% under Grid Search to 81.50% while simultaneously reducing runtime by approximately 23%. These findings suggest that Bayesian optimization techniques are particularly effective when navigating the more complex hyperparameter landscapes associated with high-dimensional medical imaging problems.
DEAP exhibited a different but equally important advantage. Although it did not consistently achieve the highest classification accuracy, it was the most computationally efficient optimization strategy across nearly all architectures. In several cases, DEAP produced predictive performance comparable to the best-performing methods while requiring substantially less optimization time. For example, DEAP optimized ResNet18 in 8676 s while achieving a test accuracy of 81.25%, only marginally below the best Hyperopt configuration. Similar trends were observed for GoogLeNet, AlexNet, and MobileNet. These results demonstrate that evolutionary optimization approaches can provide attractive trade-offs between predictive performance and computational cost, particularly when rapid model development or limited computational resources are important considerations.
The variations in total optimization runtime across methods—despite an identical budget of 64 trials—stem from the specific hyperparameter configurations selected for evaluation. Suboptimal parameter combinations can lead to significantly longer training times per trial, which impacts the aggregate runtime of exhaustive methods like Grid Search.
The statistical analyses further support these observations. For both datasets, Friedman tests identified significant differences among optimization strategies across all evaluated architectures. However, the interpretation of these results differs between datasets. On MNIST, statistically significant differences were associated with very small absolute performance variations, suggesting limited practical impact despite consistent ranking differences among methods. On the SkinCancer dataset, significant differences were accompanied by more substantial performance variations, indicating that optimization strategy plays a more meaningful role when learning complex image representations. Pairwise Holm Corrected Wilcoxon test revealed that DEAP often differed significantly from the other methods, while Grid Search, Optuna, and Hyperopt were frequently statistically comparable. These findings suggest that although all methods can produce effective models, their behavior and relative advantages vary according to the characteristics of the underlying dataset.
The results indicate that dataset complexity is a key factor governing the value of hyperparameter optimization. For relatively simple image-classification tasks such as MNIST, most modern optimization methods are capable of identifying near-optimal solutions, making computational efficiency the primary criterion for method selection. In contrast, for more complex medical imaging tasks, adaptive optimization strategies become increasingly important, as they can improve classification performance while maintaining reasonable computational requirements. Among the evaluated approaches, Optuna and Hyperopt provided the most favorable overall balance between predictive accuracy and computational efficiency, whereas DEAP offered the greatest reductions in optimization time. Consequently, the choice of optimization strategy should be guided by the desired balance between performance and computational cost rather than by predictive accuracy alone.
4. Study Limitations
While this study provides valuable insights into the comparative performance of hyperparameter optimization methods, several limitations should be acknowledged. First, the experiments were restricted to two datasets, which may not fully capture the diversity and complexity of real-world image classification problems. Although the MNIST and SkinCancer datasets provide useful representations of low-complexity and medically relevant classification tasks, respectively, future investigations should include a broader range of datasets and extend the evaluation to more challenging domains such as multi-class and three-dimensional (3D) medical imaging. Second, the analysis primarily focused on classification performance metrics and training time, without a detailed assessment of additional computational factors such as energy consumption, memory utilization, hardware efficiency, batch-size sensitivity, or optimization scalability. Third, the study considered only four optimization methods and did not investigate hybrid or ensemble optimization frameworks, which may potentially combine the strengths of Bayesian and evolutionary search strategies to achieve further improvements in performance and robustness.
An additional limitation relates to the metadata constraints of the SkinCancer dataset. Because the dataset was obtained from a public repository and did not provide patient-level or lesion-level identifiers, the implementation of grouped data-partitioning strategies was not possible. Consequently, the possibility of data leakage arising from multiple lesions belonging to the same patient being distributed across training, validation, and testing sets cannot be completely excluded. To mitigate this limitation, an automated visual audit was conducted using the imagededup and OpenCV libraries to identify potential redundancies within the dataset. This analysis confirmed the absence of exact and near-duplicate images, ensuring that the benchmark was not affected by explicit image replication artifacts. Furthermore, as the primary objective of this work was to provide a computational benchmark for evaluating hyperparameter optimization strategies rather than a clinical diagnostic study, advanced medical imaging validation procedures, including external clinical validation, model calibration, diagnostic error analysis, and acquisition-source harmonization, were beyond the scope of the current investigation. Future studies should utilize datasets containing comprehensive patient metadata to enable stricter partition isolation and more rigorous clinical evaluation protocols.
5. Conclusions
This study systematically compared four hyperparameter optimization strategies (i.e., Grid Search, Optuna, Hyperopt, and DEAP) across five CNN architectures spanning multiple generations of deep learning. By conducting experiments on both the MNIST benchmark and a custom SkinCancer dataset, we assessed the methods under contrasting data regimes: an idealized, abundant dataset and a realistic, data-constrained medical imaging scenario. The results consistently highlight the dataset-dependent impact and sensitivity of optimization methods. On MNIST dataset, all architectures achieved near-saturated accuracy. Optuna and Hyperopt matched or exceeded Grid Search’s predictive performance while significantly reducing runtime. DEAP consistently proved to be the fastest optimization method across all architectures without suffering from increased variance. Conversely, the high-dimensional SkinCancer dataset revealed greater optimization sensitivity. Hyperopt and Optuna offered strong trade-offs between accuracy and time across most architectures, though Grid Search retained a slight accuracy advantage on deeper models like GoogLeNet. DEAP maintained its position as the most computationally efficient method while remaining highly competitive, particularly on ResNet18.
The findings suggest that modern hyperparameter optimization approaches are capable of identifying near-optimal solutions for relatively simple classification tasks, where computational efficiency becomes the primary deciding factor. For more challenging applications such as medical image analysis, adaptive optimization methods offer greater benefits by improving predictive performance while maintaining reasonable computational requirements. Among the evaluated approaches, Optuna and Hyperopt provided the most favorable balance between accuracy and efficiency, whereas DEAP offered the strongest computational advantages.
Future work should extend these analyses to more diverse and large-scale datasets, including 3D medical imaging, while incorporating additional evaluation metrics such as energy efficiency, batch size sensitivity, and optimization runtime. Moreover, exploring hybrid or ensemble optimization frameworks could further enhance robustness and adaptability across varying data complexities and deployment environments.
Author Contributions
Conceptualization: A.R.K.; methodology: A.R.K. and S.A.; software: A.R.K.; writing—original draft preparation: S.A.; writing—review and editing: S.A. and A.R.K.; visualization: S.A.; analysis: S.A. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Ongoing Research Funding program, King Saud University, Riyadh, Saudi Arabia under grant No. ORF-2026-2189.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The datasets used in this study are publicly available and can be accessed as follows: the MNIST dataset is available at https://www.kaggle.com/datasets/hojjatk/mnist-dataset (accessed on 1 May 2026); and the Skin Cancer dataset is available at https://www.kaggle.com/datasets/fanconic/skin-cancer-malignant-vs-benign (accessed on 2 July 2026). The code and related resources for this study are available at GitHub: https://github.com/Data-Dominator/Hyperparameter-Optimization-Techniques (accessed on 1 August 2026).
Acknowledgments
The authors would like to thank the reviewers for their valuable insights and constructive comments.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Kadam, S.S.; Adamuthe, A.C.; Patil, A.B. CNN model for image classification on MNIST and fashion-MNIST dataset. J. Sci. Res. 2020, 64, 374–384. [Google Scholar] [CrossRef] [Scilit]
- Alvear-Sandoval, R.F.; Sancho-Gómez, J.L.; Figueiras-Vidal, A.R. On improving CNNs performance: The case of MNIST. Inf. Fusion 2019, 52, 106–109. [Google Scholar] [CrossRef] [Scilit]
- Shao, H.; Ma, E.; Zhu, M.; Deng, X.; Zhai, S. MNIST handwritten digit classification based on convolutional neural network with hyperparameter optimization. Intell. Autom. Soft Comput. 2023, 36, 3595–3606. [Google Scholar] [CrossRef] [Scilit]
- Yadav, S.S.; Jadhav, S.M. Deep convolutional neural network based medical image classification for disease diagnosis. J. Big Data 2019, 6, 113. [Google Scholar] [CrossRef] [Scilit]
- Chen, C.; Isa, N.A.M.; Liu, X. A review of convolutional neural network based methods for medical image classification. Comput. Biol. Med. 2025, 185, 109507. [Google Scholar] [CrossRef] [Scilit]
- Wang, W.; Liang, D.; Chen, Q.; Iwamoto, Y.; Han, X.; Zhang, Q.; Hu, H.; Lin, L.; Chen, Y. Medical image classification using deep learning. In Deep Learning in Healthcare: Paradigms and Applications; Springer: Berlin/Heidelberg, Germany, 2019; pp. 33–51. [Google Scholar]
- Chauhan, V.K.; Zhou, J.; Lu, P.; Molaei, S.; Clifton, D.A. A brief review of hypernetworks in deep learning. Artif. Intell. Rev. 2024, 57, 250. [Google Scholar] [CrossRef] [Scilit]
- Liao, L.; Li, H.; Shang, W.; Ma, L. An empirical study of the impact of hyperparameter tuning and model optimization on the performance properties of deep neural networks. ACM Trans. f. Eng. Methodol. (TOSEM) 2022, 31, 1–40. [Google Scholar] [CrossRef] [Scilit]
- Raiaan, M.A.K.; Sakib, S.; Fahad, N.M.; Mamun, A.A.; Rahman, M.A.; Shatabda, S.; Mukta, M.S.H. A systematic review of hyperparameter optimization techniques in Convolutional Neural Networks. Decis. Anal. J. 2024, 11, 100470. [Google Scholar] [CrossRef] [Scilit]
- Tuba, E.; Bačanin, N.; Strumberger, I.; Tuba, M. Convolutional neural networks hyperparameters tuning. In Artificial Intelligence: Theory and Applications; Springer: Berlin/Heidelberg, Germany, 2021; pp. 65–84. [Google Scholar]
- Yu, T.; Zhu, H. Hyper-parameter optimization: A review of algorithms and applications. arXiv 2020, arXiv:2003.05689. [Google Scholar] [CrossRef] [Scilit]
- Alibrahim, H.; Ludwig, S.A. Hyperparameter optimization: Comparing genetic algorithm against grid search and bayesian optimization. In Congress on Evolutionary Computation (CEC); IEEE: Krakow, Poland, 2021; pp. 1551–1559. [Google Scholar] [CrossRef] [Scilit]
- Dhilsath, F.M.; Samuel, S.J. Hyperparameter tuning of ensemble classifiers using grid search and random search for prediction of heart disease. Comput. Intell. Healthc. Inform. 2021, 139–158. [Google Scholar] [CrossRef] [Scilit]
- Molina-Pérez, D.; Rojas-López, A.G.; Coello, C.A.C. Efficient Hybrid Evolutionary–Numerical Algorithms for Contrast Enhancement Under Distortion Constraints in Medical Imaging. Math. Comput. Appl. 2026, 31, 110. [Google Scholar] [CrossRef] [Scilit]
- Gikera, R.; Maina, E.; Mambo, S.M.; Mwaura, J. K-hyperparameter tuning in high-dimensional genomics using joint optimization of deep differential evolutionary algorithm and unsupervised transfer learning from intelligent GenoUMAP embeddings. Int. J. Inf. Technol. 2025, 17, 1679–1701. [Google Scholar] [CrossRef] [Scilit]
- Bergstra, J.; Komer, B.; Eliasmith, C.; Yamins, D.; Cox, D.D. Hyperopt: A python library for model selection and hyperparameter optimization. Comput. Sci. Discov. 2015, 8, 014008. [Google Scholar] [CrossRef] [Scilit]
- Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A next-generation hyperparameter optimization framework. In 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining; Association for Computing Machinery: Anchorage, AK, USA, 2019; pp. 2623–2631. [Google Scholar] [CrossRef] [Scilit]
- Fortin, F.-A.; De Rainville, F.-M.; Gardner, M.-A.G.; Parizeau, M.; Gagné, C. DEAP: Evolutionary algorithms made easy. J. Mach. Learn. Res. 2012, 13, 2171–2175. [Google Scholar]
- Ali, A.A.; Hammad, M.T.; Hassan, H.S. A co-evolutionary genetic algorithm approach to optimizing deep learning for brain tumor classification. IEEE Access 2025, 13, 21229–21248. [Google Scholar] [CrossRef] [Scilit]
- Almakayeel, N.; Lydia, E.L.; Razzhivin, O.; Sree, S.R.; Ahmed, M.A.; Dash, B.B.; Ibrahim, S.P.S. Hyperparameter tuned deep learning-driven medical image analysis for intracranial hemorrhage detection. PLoS ONE 2025, 20, e0326255. [Google Scholar] [CrossRef] [Scilit]
- Golkarieh, A.; Razmara, P.; Lagzian, A.; Dolatabadi, A.; Mousavirad, S.J. Semi-supervised GAN with hybrid regularization and evolutionary hyperparameter tuning for accurate melanoma detection. Sci. Rep. 2025, 15, 31977. [Google Scholar] [CrossRef] [Scilit]
- Gill, M.U.; Rajendran, P. Hyperparameter optimization of YOLO using differential evolution, multi-fidelity optimization, and Bayesian optimization. Sci. Rep. 2026. [Google Scholar] [CrossRef] [Scilit]
- Saifullah, S.; Dreżewski, R. Bayesian optimization-driven U-Net architecture tuning for brain tumor segmentation. Eng. Proc. 2026, 124, 22. [Google Scholar] [CrossRef] [Scilit]
- Tay, D.Y.J.; Le, N.Q.K.; Chua, M.C.H. Bayesian hyperparameter optimization improves scGPT fine-tuning for single-cell multi-omics integration. Bioinformatics 2026, 42, btag374. [Google Scholar] [CrossRef] [Scilit]
- Ledig, C.; Theis, L.; Huszár, F.; Caballero, J.; Cunningham, A.; Acosta, A.; Aitken, A.; Tejani, A.; Totz, J.; Wang, Z.; et al. Photo-realistic single image super-resolution using a generative adversarial network. In Conference on Computer Vision and Pattern Recognition; IEEE: Honolulu, HI, USA, 2017; pp. 4681–4690. [Google Scholar] [CrossRef] [Scilit]
- Wang, T.; Zhang, K.; Shao, Z.; Luo, W.; Stenger, B.; Lu, T.; Kim, T.-K.; Liu, W.; Li, H. Gridformer: Residual dense transformer with grid structure for image restoration in adverse weather conditions. Int. J. Comput. Vis. 2024, 132, 4541–4563. [Google Scholar] [CrossRef] [Scilit]
- Aszemi, N.M.; Dominic, P.D.D. Hyperparameter optimization in convolutional neural network using genetic algorithms. Int. J. Adv. Comput. Sci. Appl. 2019, 10. [Google Scholar] [CrossRef] [Scilit]
- Chowdhury, A.A.; Das, A.; Hoque, K.K.S.; Karmaker, D. A comparative study of hyperparameter optimization techniques for deep learning. In International Joint Conference on Advances in Computational Intelligence; Springer: Singapore, 2022; pp. 509–521. [Google Scholar] [CrossRef] [Scilit]
- Ying, D. Hyperparameter Optimization for Machine Learning Algorithms with Application to the MNIST and CIFAR-10 Datasets. Master’s Thesis, University of California, Los Angeles, CA, USA, 2023. [Google Scholar]
- Holland, J.H. Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence; The MIT Press: Cambridge, MA, USA, 1992. [Google Scholar]
- Li, L.; Jamieson, K.; DeSalvo, G.; Rostamizadeh, A.; Talwalkar, A. Hyperband: A novel bandit-based approach to hyperparameter optimization. J. Mach. Learn. Res. 2017, 18, 6765–6816. [Google Scholar]
- Kennedy, J.; Eberhart, R. Particle swarm optimization. Presented at the Icnn’95-International Conference on Neural Networks, Perth, WA, Australia, 27 November–1 December 1995. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. Presented at the 3rd International Conference on Learning Representations (ICLR 2015), San Diego, CA, USA, 7–9 May 2015. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition; IEEE: Las Vegas, NV, USA, 2016; pp. 770–778. [Google Scholar] [CrossRef] [Scilit]
- Jeong, S.; Obayashi, S. Efficient global optimization (EGO) for multi-objective problem and data mining. In Congress on Evolutionary Computation, Edinburgh, UK, 2–5 September 2005; IEEE: Piscataway, NJ, USA, 2005; Volume 3, pp. 2138–2145. [Google Scholar] [CrossRef] [Scilit]
- Meissner, M.; Schmuker, M.; Schneider, G. Optimized particle swarm optimization (OPSO) and its application to artificial neural network training. BMC Bioinform. 2006, 7, 125. [Google Scholar] [CrossRef] [Scilit]
- Eberhart, R.; Kennedy, J. A new optimizer using particle swarm theory. In Sixth International Symposium on Micro Machine and Human Science; IEEE: Nagoya, Japan, 1995; pp. 39–43. [Google Scholar] [CrossRef] [Scilit]
- Nematzadeh, S.; Kiani, F.; Torkamanian-Afshar, M.; Aydin, N. Tuning hyperparameters of machine learning algorithms and deep neural networks using metaheuristics: A bioinformatics study on biomedical and biological cases. Comput. Biol. Chem. 2022, 97, 107619. [Google Scholar] [CrossRef] [Scilit]
- Seyyedabbasi, A.; Kiani, F. I-GWO and Ex-GWO: Improved algorithms of the Grey Wolf Optimizer to solve global optimization problems. Eng. Comput. 2021, 37, 509–532. [Google Scholar] [CrossRef] [Scilit]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet Classification with Deep Convolutional Neural Networks. Commun. ACM 2017, 60, 84–90. [Google Scholar] [CrossRef] [Scilit]
- Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. Going deeper with convolutions. In Conference on Computer Vision and Pattern Recognition; IEEE: Boston, MA, USA, 2015; pp. 1–9. [Google Scholar] [CrossRef] [Scilit]
- Michalski, B.; Plechawska-Wójcik, M. Comparison of LeNet-5, AlexNet and GoogLeNet models in handwriting recognition. J. Comput. Sci. Inst. 2022, 23, 145–151. [Google Scholar] [CrossRef] [Scilit]
- Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv 2017, arXiv:1704.04861. [Google Scholar] [CrossRef] [Scilit]
- Fanconi, C. SkinCancer: Malignant vs. Benign. Available online: https://www.kaggle.com/datasets/fanconic/skin-cancer-malignant-vs-benign (accessed on 2 July 2026).
- Tschandl, P.; Rosendahl, C.; Kittler, H. The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Sci. Data 2018, 5, 180161. [Google Scholar] [CrossRef] [Scilit]
- Alfalahi, M.A.; Karan, O.; Kurnaz, S.; Türkben, A.K. Federated learning for privacy-preserving skin cancer classification using deep neural networks. Front. Oncol. 2026, 16, 1720748. [Google Scholar] [CrossRef] [Scilit]
- Deb, K. An introduction to genetic algorithms. Sadhana 1999, 24, 293–315. [Google Scholar] [CrossRef] [Scilit]
- Silva, P.C.; Lucas, P.D.O.E.; Sadaei, H.J.; Guimaraes, F.G. Distributed evolutionary hyperparameter optimization for fuzzy time series. IEEE Trans. Netw. Serv. Manag. 2020, 17, 1309–1321. [Google Scholar] [CrossRef] [Scilit]
- Ibrahim, M.Q.; Hussein, N.K.; Guinovart, D.; Qaraad, M. Optimizing convolutional neural networks: A comprehensive review of hyperparameter tuning through metaheuristic algorithms. Arch. Comput. Methods Eng. 2025, 32, 5123–5160. [Google Scholar] [CrossRef] [Scilit]
- Watanabe, S. Tree-structured parzen estimator: Understanding its algorithm components and their roles for better empirical performance. arXiv 2023, arXiv:2304.11127. [Google Scholar] [CrossRef] [Scilit]
- Bergstra, J.; Bardenet, R.; Bengio, Y.; Kégl, B. Algorithms for hyper-parameter optimization. In 25th International Conference on Neural Information Processing Systems; Curran Associates Inc.: Granada, Spain, 2011; Volume 24, pp. 2546–2554. [Google Scholar]
- Phillips, M.; Marsden, H.; Jaffe, W.; Matin, R.N.; Wali, G.N.; Greenhalgh, J.; McGrath, E.; James, R.; Ladoyanni, E.; Bewley, A.; et al. Assessment of accuracy of an artificial intelligence algorithm to detect melanoma in images of skin lesions. JAMA Netw. Open 2019, 2, e1913436. [Google Scholar] [CrossRef] [Scilit]
- Marchetti, M.A.; Cowen, E.A.; Kurtansky, N.R.; Weber, J.; Dauscher, M.; DeFazio, J.; Deng, L.; Dusza, S.W.; Haliasos, H.; Halpern, A.C.; et al. Prospective validation of dermoscopy-based open-source artificial intelligence for melanoma diagnosis (PROVE-AI study). npj Digit. Med. 2023, 6, 127. [Google Scholar] [CrossRef] [Scilit]
- Cumming, G.; Finch, S. Inference by eye: Confidence intervals and how to read pictures of data. Am. Psychol. 2005, 60, 170. [Google Scholar] [CrossRef] [Scilit]
- Kerby, D.S. The simple difference formula: An approach to teaching nonparametric correlation. Compr. Psychol. 2014, 3, 11. [Google Scholar] [CrossRef] [Scilit]
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. |
© 2026 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.



















