The precise location of the brain tumor can be found and diagnosed with great accuracy using brain tumor detection and classification. A brain tumor patient's life is prolonged by a few years if it is found and diagnosed early. Medical professionals frequently use magnetic resonance imaging (MRI), one of many imaging modalities, because it can offer contrast information about brain tumors. Exponential deer hunting optimization-based Shepard convolutional neural network (ExpDHO-based ShCNN) is a successful detection method, and ExpDHO-based Deep convolutional neural network (ExpDHO-based Deep CNN) is a successful classification technique, both of which are introduced for the detection and classification of brain tumors, respectively. The noise is removed from the MRI brain images during pre-processing. Following segmentation of the previously processed pictures, augmentation is carried out. ShCNN, which was trained using the created optimization technique known as ExpDHO, is also used for tumor detection. Finally, the created ExpDHO algorithm-a mix of the Exponential weighted moving average (EWMA) and Deer hunting optimization algorithm-is used for tumor categorization (DHOA). Additionally, the created technique delivered beneficial results based on performance metrics, such as accuracy, sensitivity, and specificity, with higher values of 0.929, 0.934, and 0.939 for brain tumor detection and 0.917, 0.918, and 0.919 for brain tumor classification, respectively.