Recently, convolutional neural networks (CNNs) have shown promising achievements in various computer vision tasks. However, designing a CNN model architecture necessitates a high-domain knowledge expert, which can be difficult for new researchers while solving real-world problems like medical image diagnosis. Neural architecture search (NAS) is an approach to reduce the human intervention by automatically designing CNN architecture. This study proposes a two-phase evolutionary framework to design a suitable CNN model for medical image classification named TPEvo-CNN. The proposed framework mainly focuses on architectural depth search and hyper-parameter settings of the layered architecture for the CNN model. In the first phase, differential evolution (DE) is applied to determine the optimal number of layers for a CNN architecture, which enhances faster convergence to achieve CNN model architectures. In the second phase, the genetic algorithm (GA) is used to fine-tune the hyper-parameter settings of the generated CNN layer architecture in the first phase. Crossover and mutation operations of GA are devised to explore the hyper-parameter search space. Also, an elitism selection strategy is introduced to select the potential hyper-parameters of the CNN architecture for the next generation. The suggested approach is experimented on six medical image datasets, including pneumonia, skin cancer, and four COVID-19 datasets, which are categorized based on image types and class numbers. The experimental findings demonstrate the superiority of the proposed TPEvo-CNN model compared to existing hand-crafted, pre-trained, and NAS-based CNN models in terms of classification metrics, confusion matrix, radar plots, and statistical analysis.INDEX TERMS Convolutional neural network, differential evolution, genetic algorithm, medical imaging, neural architecture search.