Deep brain stimulation (DBS) of Subthalamic nucleus (STN), using a permanent electrode has emerged as an effective treatment for Parkinson’s disease patients. However, accurately localizing STN region during DBS surgery remains a challenging task. Microelectrode recording (MER) is used to identify STN by neurosurgeons. Nevertheless, manual interpretation of STN functional activity might prompt false alarms. Although the existing technology based on deep learning (DL) can outline the STN anatomical borders, it suffers from computational complexity and skewed findings. An end-to-end attention-based lightweight model with residual connections and soft thresholding is designed specifically for STN region detection. Scalogram and spectrogram images are generated from MER to mimic the observation of neurosurgeons and gather contextual information in a more intuitive manner. Proposed model exhibits a simplified architecture with only 15 layers, distinguishing it from previous DL models that tend to be more complex. Spatial attention helped to focus on relevant patterns within the data, while residual connections enhanced the gradient flow throughout the developed network. Soft thresholding offered noise reduction and robustness to signal variability. This approach eliminated the requirement for excessively deep layers and the necessity for separate feature extraction and classification stages by integrating them into a single pipeline. Our model identified STN with an accuracy of 97.42%. Proposed model outperformed 15 existing cutting-edge techniques. Our findings highlight the effectiveness of lightweight DL framework to achieve precise STN localization. The proposed method has significant potential in improving the efficiency of DBS surgery by reducing reliance on the neurosurgeon experience.