Abstract:[Purposes] Aiming at the irregular shape, blurred boundaries and hair artifacts of skin lesions in skin lesion images, it proposes a skin lesion segmentation algorithm combining CNN and Transformer. [Methods] Firstly, the skin lesion image was pre-treated for hair removal to reduce the influence of hair noise on the result, and then a segmentation model combining CNN and Transformer was constructed, using Resnet as the backbone feature extraction network to extract features, and the extracted feature map sequence was used as the input of Transformer, and a new structural boundary attention gate was added to the Transformer to extract enough local details to process the blurry boundary. Finally, The DeanseASPP enhanced feature is used to represent and process multi-scale information, and an improved loss function is proposed, the purpose of which is to make the model focus on the boundary region part when calculating the loss function. [Findings] The experimental results show that the dice value and JI value are 0.854 534 and 0.767 901 on the ISIC2017 dataset, and 0.908 548 and 0.843 689 on the ISIC2018 dataset, respectively, which achieves good results compared with other advanced models. [Conclusions] Its effectiveness is proved by comparing with different models and showing the effect.