Aiming at the problem of inaccurate segmentation of hand edge detail information and missed detection of small-area hand,a multi-scale hand segmentation method based on attention mechanism is proposed.Firstly,the Transformer module is redesigned and optimized,and the window self-attention structure and D-FFN mechanism are proposed.The window self-attention mechanism integrates global and local dependent information,and D-FFN suppresses the interference of background information.Then,a multi-scale feature extraction module combining strip pooling and cascade network is proposed to increase the receptive field and improve the accuracy and robustness of the hand segmentation model.Finally,an up-sampling decoder module based on Triplet Attention mechanism is proposed.By adjusting the attention weight of channel dimension and spatial dimension,the redundant features of target features and background are distinguished.The proposed algorithm is tested on public datasets GTEA(Georgia Tech Egocentric Activity)and EYTH(EgoYouTubeHands).Experimental results show that average MIoU values of the algorithm on the two datasets reach 95.8%and 90.2%,respectively,which is 2.5%and 2.1%higher than the TransUnet algorithm.It meets the requirements of stable and reliable,high precision and strong anti-interference ability of hand image segmentation.