Abstract:[Purposes] Earthquake-induced cracks seriously affect the safety of masonry structures. During the post-earthquake emergency response, crack detection in various components is crucial for the safety assessment of the structures. To enhance detection efficiency, an improved dual attention U-Net (DA U-Net) based on a multi-target semantic segmentation algorithm was proposed. [Methods] For effective model training, a manually labeled dataset was created, and data augmentation strategies were utilized to make the network learn about more crack details. Furthermore, VGG16 was employed to replace the backbone feature extraction network of U-Net. Additionally, convolutional block attention modules and non-local attention (NA) mechanisms were embedded into the skip connections. As a result, the problems of incomplete crack edge segmentation and inadequate utilization of global feature information were ameliorated. Shallow feature information was effectively utilized, and feature representation was strengthened. Finally, sub-pixel convolution replaced the original up-sampling operation, supplementing semantic information loss in low-resolution pixels. [Findings] The improved DA U-Net achieves optimal performance in both classification accuracy and segmentation precision, with the precision evaluation metrics of F1 score([EF1]), mean pixel accuracy ([EMPA]), and mean intersection over union ([EMIOU]) reaching 84.66%, 91.57%, and 81.50%, respectively. This represents an improvement of over 5.00% in segmentation accuracy compared to the original U-Net. Selecting an appropriate backbone network enables better capture and representation of complex features in the data, with a heightened focus on global spatial location information. [Conclusions] The improved algorithm significantly enhances the accuracy of crack recognition and localization, as well as the completeness of segmentation for the overall morphology, direction, and intersection of cracks. It strengthens the precision of segmenting multi-combined cracks, providing an effective detection method for post-earthquake safety assessment of masonry structures.