Pulmonary Embolism (PE) is the obstruction of blood arteries in the lungs by a blood clot. The mortality risk for PE is approximately 30%. Detecting pulmonary embolism in the segmental arteries of the lung is more challenging than in the main arteries and is very prone to being missed. A computer-based approach was created in this work to automatically identify pulmonary embolism in the segmental arteries using computed tomography images. The system's infrastructure includes an enhanced Mask R-CNN deep neural network that has been trained with images containing PE. The network accurately identifies the location of the pulmonary embolism on the computed tomography picture and successfully extracts its borders. The investigation was conducted by generating a local dataset. The study's performance was evaluated using pulmonary embolisms identified manually by the expert radiologist. The sensitivity, specificity, accuracy, dice coefficient, and Jaccard index values for 2130 pictures were 96.4%, 93.5%, 96.1%, 0.96, and 0.90, respectively. The improved Mask R-CNN model has demonstrated superior performance when compared to the traditional Mask R-CNN and U-Net models. This high-performance technology is designed to identify pulmonary embolism and will aid professionals in assessing the size of the embolism.