Bulletin of Electrical Engineering and Informatics Vol. 14, No. 2, April 2025, pp. 1241~1250 ISSN: 2302-9285, DOI: 10.11591/eei.v14i2.8706 1241 Journal homepage: http://beei.org Accurate brain tumor classification with STN-NAM in ResNet50 using MRI Preeti Sadanand Topannavar 1 , Varsha Sachin Bendre 2 , Deepti Khurge 2 1 School of Electrical and Communication Engineering, Faculty of Science and Technology, JSPM University, Pune, India 2 Department of Electronics and Telecommunication, Pimpri Chinchwad College of Engineering, Pune, India Article Info ABSTRACT Article history: Received May 17, 2024 Revised Oct 8, 2024 Accepted Nov 19, 2024 Brain tumor is an abnormal cell growth that contains malignant and benign cells emerging from numerous cell types within brain. Magnetic resonance imaging (MRI) is utilized for brain tumor classification which provides high- resolution images. However, tumors exhibit different characteristics like shape, location, and size which make it challenging to accurately distinguish among different tumor types and accurately classify them. In this research, spatial transformer network and non-local attention mechanism (STN-NAM) is proposed in ResNet50 to accurately classify tumors. STN transforms spatial information while NAM identifies relationships among normal and lesion areas, which together accurately classify tumors. Initially, images are obtained from Figshare, Brats 2019, and Brats 2020 datasets. These images are pre-processed using a normalized median filter (NMF) to reduce salt and pepper noise. Then, normalization is performed to resize original image to a standard size which assists uniformity in image dimension. U-Net is employed to segment tumor regions and STN-NAM is performed to accurately classify tumors. In comparison to the existing techniques namely, multi-level attention network (MANet), mathematical model with 3D attention U-Net, and convolutional neural network (CNN), the STN-NAM achieves superior accuracy of 98.06%, 99.05%, and 98.66% in Figshare, Brats 2019, and Brats 2020 datasets, respectively. Keywords: Magnetic resonance imaging Non-local attention mechanism Normalized median filter Spatial transformer network U-Net This is an open access article under the CC BY-SA license. Corresponding Author: Preeti Sadanand Topannavar School of Electrical and Communication Engineering, Faculty of Science and Technology JSPM University Pune, Maharashtra, India Email: topannavarp@gmail.com 1. INTRODUCTION Recently, brain tumors have become one of the most aggressive diseases which results in a very short life span if not detected at an advanced stage [1]. It is split into two common types: primary and secondary tumors. The primary tumors are typically non-cancerous and formed from the cells of human brain. The secondary tumors spread to the brain along the blood flow from other body parts [2]. Brain tumors are categorized into gliomas, pituitary, and meningiomas. Glioma is established in brain tissues, rather than blood vessels and nerve cells [3], [4]. Meningioma grows on the surface of membrane which covers the brain and surrounds the central nervous system, and pituitary form within the skull [5], [6]. Arising primarily in the spinal cord or brain, gliomas are classified into two grades, containing high-grade gliomas (HGG) and low- grade glioma (LGG). HGG is regarded as more penetrative and destructive and is connected with a life expectancy of nearly two years after diagnosis [7]. Brain tumors are determined by using numerous tests that contain computer tomography (CT) scans, biopsies, magnetic resonance imaging (MRI), and positron