Abstract: Medical image segmentation often suffers from the challenges of class imbalance, blurred target boundaries, and small data. How to establish a framework to automatically segment medical images with these problems is an important task. Although there have been some studies on the issue, there is still a large room for improving the efficiency and quality of medical service. This paper utilizes the powerful ability of deep learning to extract features, and develops a two-stage decoding network with boundary attention (TSD-BA), which can locate the regions of interest in the target locating stage and obtain more spatial structure features in the detail refinement stage. Specifically, a deep fusion model (DFM) is used to aggregate high-level semantic features for accurately capturing the position of targets. Subsequently, a boundary attention module (BAM) is applied to further excavate the boundary features. Moreover, data augmentation and transfer learning are employed to avoid overfitting caused by small datasets. Finally, a pixel position aware (PPA) loss is introduced to focus on hard pixels and mitigate the class imbalance issues. Numerous experimental results indicate that the proposed TSD-BA achieves the best performance compared with state-of-the-art approaches.