Medical image analysis for pancreatic cancer (PC) classification and recognition is a vital domain of research and medical practices. PC is challenging to diagnose and treat; medical imaging approaches aid early diagnosis to analyse and treat, and employ of medical imaging approaches are support early diagnosis, correct analysis, and treatment planning. Computed Tomography (CT) scans are generally utilized to detect and classify PCs. Deep learning (DL) approaches have demonstrated the ability to support the diagnosis and detection of several medical conditions, containing PC. Convolutional Neural Networks (CNNs) are a kind of DL approach generally employed for image analysis that is trained to automatically learn and extract features in medical images. So, this study purposes a new Sparrow Search Algorithm with Stacked Deep Learning based Medical Image Analysis for Pancreatic Cancer Detection and Classification (SSASDL-PCDC) technique on CT images. The purpose of the study is to design an SSASDL-PCDC technique to achieve improved pancreatic cancer detection performance. In addition, the SSASDL-PCDC technique applies Harris Hawks Optimization (HHO) with a densely connected networks (DenseNet) model for the feature extraction process. Moreover, convolutional neural network with bi-directional long shortterm memory (CNN-BiLSTM) approach was utilized for PC detection and classification. Furthermore, Sparrow Search Algorithm (SSA) is used to adjust the hyperparameter values of the CNN-BiLSTM technique. To evaluate the effectiveness of the SSASDL-PCDC technique, extensive experiments were executed on a comprehensive database of pancreatic CT images. The simulation outcome value depicted that the SSASDL-PCDC technique with maximum sensitivity of 99.26%, specificity of 99.26%, and accuracy of 99.26%.INDEX TERMS Pancreatic cancer, computed tomography images, sparrow search algorithm, medical image analysis, cancer diagnosis.The associate editor coordinating the review of this manuscript and approving it for publication was Eduardo Rosa-Molinar .