Optimizing algorithms is crucial for categorizing CT brain images for conditions like tumors, cancer and aneurysm. In Machine learning model training, optimizers guide convergence, impacting accuracy and efficiency. This research evaluates the performance of various optimizers, including SGD, Adam, Nadam, Adadelta, Adagrad and RMSprop in classifying brain CT images of diverse optimizers focuses on the evaluation of performance. Our primary objective is to enhance the accuracy of image diagnosis for urgent medical conditions like tumors, cancers, and aneurysms. Using Python and Keras, we systematically explored the efficacy of these optimizers in training Convolutional Neural Networks (CNNs). A Convolutional Neural Network (CNN) execution relies upon factors like weight introduction, improvement techniques, cluster size, learning rate, initiation and misfortune capabilities, network design, and information quality. Specifically it delves into using these optimizers, representing distinct approaches to training Convolutional Neural networks (CNN’s). Our comparative analysis revealed that Adagrad achieved the highest accuracy, with a diagnostic classification accuracy of 99.11%, a loss of 0.0341, a validation loss of 0.0025, and a validation accuracy of 1.00. These results suggest that Adagrad is the best choice for classifying aneurysm, tumor, and cancer patients, positioning it as a potential candidate for future research. Our research mapped sustainable development goal number 3 which is Good health and wellbeing.