The segmentation of pancreas and pancreatic tumor remain a persistent challenge for radiologists. Consequently, it is essential to develop automated segmentation methods to address this task. U-Net based models are most often used among various deep learning-based techniques in tumor segmentation. This paper introduces an innovative hybrid two-stage U-Net model for segmenting both the pancreas and pancreatic tumors. The optimization technique, used in this approach, involves a combination of meta-heuristic optimization algorithms namely, Grey Wolf Border Collie Optimization (GWBCO) technique, combining the Grey Wolf Optimization algorithm and the Border Collie Optimization algorithm. Our approach is evaluated using key parameters, such as Dice Similarity Coefficient (DSC), Jaccard Index (JI), sensitivity, specificity and precision to assess its effectiveness and achieves a DSC of 93.33 % for pancreas segmentation. Additionally, the model also achieves high DSC of 91.46 % for pancreatic tumor segmentation. This method helps in improving the diagnostic accuracy and assists medical professionals to provide treatment at an early stage with precise intervention. The method offers•Two-stage U-Net model addresses both pancreas and tumor segmentation.•Combination of two metaheuristic optimization algorithms, Grey Wolf and Border Collie for enhanced performance.•High dice similarity coefficient for pancreas and tumor segmentation.