The use of MRI analysis for BTD and tumor type detection has considerable importance within the domain of machine vision. Numerous methodologies have been proposed to address this issue, and significant progress has been achieved in this domain via the use of deep learning (DL) approaches. While the majority of offered approaches using artificial neural networks (ANNs) and deep neural networks (DNNs) demonstrate satisfactory performance in Bayesian Tree Descent (BTD), none of these research studies can ensure the optimality of the employed learning model structure. Put simply, there is room for improvement in the efficiency of these learning models in BTD. This research introduces a novel approach for optimizing the configuration of Convolutional Neural Networks (CNNs) and Artificial Neural Networks (ANNs) to address the BTD issue. The suggested approach employs Convolutional Neural Networks (CNN) for the purpose of segmenting brain MRIs. The model's configurable hyper-parameters are tuned using a genetic algorithm (GA). The Multi-Linear Principal Component Analysis (MPCA) is used to decrease the dimensionality of the segmented features in the pictures after they have been segmented. Ultimately, the segmentation procedure is executed using an Artificial Neural Network (ANN). In this artificial neural network (ANN), the genetic algorithm (GA) sets the ideal number of neurons in the hidden layer and the appropriate weight vector. The effectiveness of the suggested approach was assessed by utilizing the BRATS2014 and BTD20 databases. The results indicate that the proposed method can classify samples from these two databases with an average accuracy of 98.6 % and 99.1 %, respectively, which represents an accuracy improvement of at least 1.1 % over the preceding methods.