Categorizing brain cancers, including glioma, meningioma, and pituitary tumors, based on magnetic resonance imaging (MRI) images presents a significant challenge. Deep learning and machine learning techniques have shown promise in enhancing image categorization. To address this challenge, we leverage the power of the optimized ResNet50 model. Our approach involves classifying medical images using Convolutional Neural Network (CNN) features, which are then compared with the ResNet50 model. The primary goal is to detect brain tumors at an early stage using an advanced deep-learning model. We utilize an accessible dataset from Figshare, containing MRI images of the three distinct categories of brain tumors. Existing brain tumor models face limitations in handling multi-class problems and early-stage diagnosis. Therefore, we propose a fully automated approach employing Convolutional Neural Networks (CNN) to extract diverse properties from brain MRI scans. This method aims to provide accurate tumor diagnosis, even with a high number of classes and limited information in MRI data. Our proposed model involves the creation of identification blocks within a four-layered primary architecture, followed by testing and assessment of the interconnected layers. The results demonstrate that our model outperforms existing methods, achieving an impressive overall classification accuracy of 99.03%,