In humans, a brain abnormality is a serious illness. Cancer which is the greatest cause of mortality can develop from the tumour. Magnetic resonance imaging (MRI) is among a more extensively utilized medical imaging modalities in brain tumours, then it has become the primary diagnosing mechanism for the treatment and evaluation of brain tumours. Computer‐assisted diagnosis has become a requirement due to the exponential expansion in the quantity of MRIs acquired because of these programmes. Computer‐assisted diagnosis strategies created to increase detection without many systematized readings failed to produce significant improvements in performance measurements. In this regard, the usage of deep learning‐based automatic image processing algorithms appears to be a viable route for identifying brain cancer. In this research, introduce a Cat Swarm Optimization (CSO) algorithm based upon a convolutional neural network (CNN) model utilized to segmentation in a classification of brain tumour. Results of experiments on MRI images using the BRATS dataset show that the CSO algorithm‐CNN model achieved high‐performance in term of 98% of accuracy, precision, specificity, sensitivity and F‐score in the proposed classification task when compared to other classification approaches like support vector machines (SVM) as well as back propagation neural networks (BPNN).