Convolutional neural networks, inspired by the workings of biological neural networks, have proven highly successful in tasks like image data recognition, classification, and feature extraction. Yet, designing and implementing these networks pose certain challenges. One such challenge involves optimizing hyperparameters tailored to the specific model, dataset, and hardware. This study delved into how various hyperparameters impact the classification performance of convolutional neural network models. The investigation focused on parameters like the number of epochs, neurons, batch size, activation functions, optimization algorithms, and learning rate. Using the Keras library, experiments were conducted using NASNetMobile and DenseNet201 models—highlighted for their superior performance on the dataset. After running 65 different training sessions, accuracy rates saw a notable increase of 6.5% for NASNetMobile and 11.55% for DenseNet201 compared to their initial values.