# Attention-Based Two-Branch Hybrid Fusion Network for Medical Image Segmentation
## 1 Introduction
There is some work that attempts to describe long-range dependencies of convolution, including attention mechanisms [15; 16; 17] However, these methods still have a lot of drawbacks in terms of global context modeling since they are not tailored to the segmentation of medical images, but Transformer can solve these issues. The Transformer architecture [18], originally designed sequence tasks in Natural Language Process originally designed for sequence-to-sequence tasks in Natural Language Processing (NLP), has sparked widespread interest within the Computer Vision (CV) community. [PERSON] et al. [19] first introduced a vision transformer (Vision Transformer, ViT) in the realm of computer vision, which reimagined image classification as a sequence modeling challenge, achieving superior segmentation outcomes through pre-training on extensive external datasets. [PERSON] et al. [20] introduced the Segmentation Transformer (SETR), demonstrating that replacing the traditional encoder in encoder-decoder networks with the Transformer achieves exceptional performance in segmentation tasks. The Swin Transformer [21] later integrated a local receptive field through a sliding window self-attention mechanism, which optimized computational complexity and enhanced both efficiency and precision, surpassing former state-of-the-art methods in dense prediction tasks such as image classification, object detection, and semantic segmentation. TransNnet [22] proposed a U-shaped architecture with a CNN-Transformer hybrid encoder and a multi-stage up-sampling decoder, advancing the model's performance in these domains. In order to capture multi-range interactions, [PERSON] et al. [23] combined detailed features derived by CNNs with discriminative maps of varying resolutions using a Transformer pyramid. They then accessed several receptive domains using an adaptive method to get the best segmentation results. Nonetheless, the majority of the current research is on using Transformer layers in place of convolution or stacking the two consecutively without taking into account the connection between their channels and locations, which has some drawbacks when it comes to obtaining fine-grained data. To address these issues, this research presents a dual-branch hybrid network model (GLFUnet) built upon the U-Net framework, which effectively integrates fine and coarse features across various scales within the CNN and Transformer modules, leveraging attention mechanisms. First, hierarchical features are generated in parallel by ConvNeXt and Swin Transformer encoders. Initially, ConvNeXt's lowest-level features are enhanced with spatial attention. Subsequently, the Global Attention Up-Sampling (GAU) module extracts high-level features' global contextual information, leveraging channel attention to incorporate Swin Transformer's global insights. The AtFF module then employs hierarchical up-sampling with skip connections to effectively capture both low-level spatial details and high-level semantic context. Lastly, the blended features are stepwise restored to the input image's original resolution for pixel-level prediction. The workflow of the suggested GLFUnet method is presented in Figure 1. To begin with, the gastric and liver cancer dataset undergoes data augmentation by applying various geometric manipulations such as vertical and horizontal flipping, random rotation within a \(-90^{\circ}\) to \(90^{\circ}\) range, and color dithering. Following this, the images are fed into the GLFUnet model for feature extraction and subsequent network training. Subsequently, we utilize unseen test images for the segmentation process. Ultimately, we assess the proposed model's performance and precision using evaluation metrics like Dice, mIOU, and Accuracy. The following are the main contributions of this paper:  
* The advantages of extracting global and local information combined with different deep learning models are discussed.