Abstract
Melanoma is one of the most aggressive forms of skin cancer, with a high mortality rate when not detected early. This public health challenge underscores the need for accurate and efficient diagnostic tools. Convolutional Neural Networks have shown strong performance in medical image analysis. However, their effectiveness relies heavily on optimal architectural and hyperparameter configurations, which are often designed without alignment to the target domain or transferred from unrelated domains, limiting adaptability to specific medical datasets. Existing hybrid CNN-metaheuristic approaches typically optimize only fixed network parameters. They often fail to explore how metaheuristics can adaptively shape the CNN architectures themselves.In this study, a comprehensive hybrid optimization framework is proposed that integrates CNNs with six nature-inspired metaheuristic algorithms that mimic biological or physical phenomena to solve complex problems. These include Cuckoo Search, Firefly Algorithm, Whale Optimization Algorithm, Particle Swarm Optimization, Grey Wolf Optimizer, and Crow Search Algorithm. Rather than tuning a predefined architecture, each optimizer searches the architectural and training space to identify high-performing CNN configurations, enabling emergent and data-driven network design. This unified framework allows a systematic cross-algorithm comparison under identical conditions, providing new insights into convergence stability, exploration-exploitation dynamics, and generalization behavior. A robust preprocessing and data augmentation pipeline, including brightness normalization, hair artifact removal, and geometric transformations, is incorporated to improve model generalization and enhance the optimizer's search landscape. Experiments on the HAM10000 dataset demonstrate that the metaheuristic-optimized CNNs outperform the baseline, achieving accuracies up to 91.25%. These findings confirm that population-based optimization is an efficient and reliable mechanism for guiding CNN architecture design. This approach achieves superior performance compared to traditional manual or other optimization-based strategies.