This paper proposes a novel hybrid model for polyp segmentation using a combination of residual networks and transformers, along with a hybrid loss function to improve segmentation performance. The model utilizes both high-level semantic features and low-level spatial features to achieve accurate and efficient segmentation. The hybrid loss function combines focal Tversky loss, binary cross-entropy, and Jaccard index to reduce image-wise and pixel-wise differences and improve regional consistency. The proposed method was evaluated on ten publicly available datasets, including images with varying resolutions and polyp sizes. The results showed that the proposed method achieved high performance metrics, including a dice similarity of 0.9048, recall of 0.9041, precision of 0.9057, and F2 score of 0.8993. The method outperformed state-of-the-art approaches in terms of segmentation accuracy and generalization. The hybrid model and loss function were found to be more effective than traditional methods, particularly in handling small and large polyps. The proposed architecture also demonstrated robustness and efficiency in processing medical images. The study highlights the potential of combining residual networks and transformers for polyp segmentation, and the hybrid loss function provides a more effective way to improve segmentation performance. The results indicate that the proposed method is a promising approach for improving the accuracy and efficiency of polyp segmentation in medical imaging.This paper proposes a novel hybrid model for polyp segmentation using a combination of residual networks and transformers, along with a hybrid loss function to improve segmentation performance. The model utilizes both high-level semantic features and low-level spatial features to achieve accurate and efficient segmentation. The hybrid loss function combines focal Tversky loss, binary cross-entropy, and Jaccard index to reduce image-wise and pixel-wise differences and improve regional consistency. The proposed method was evaluated on ten publicly available datasets, including images with varying resolutions and polyp sizes. The results showed that the proposed method achieved high performance metrics, including a dice similarity of 0.9048, recall of 0.9041, precision of 0.9057, and F2 score of 0.8993. The method outperformed state-of-the-art approaches in terms of segmentation accuracy and generalization. The hybrid model and loss function were found to be more effective than traditional methods, particularly in handling small and large polyps. The proposed architecture also demonstrated robustness and efficiency in processing medical images. The study highlights the potential of combining residual networks and transformers for polyp segmentation, and the hybrid loss function provides a more effective way to improve segmentation performance. The results indicate that the proposed method is a promising approach for improving the accuracy and efficiency of polyp segmentation in medical imaging.