Crack detection plays a crucial role in evaluating the safety and durability of civil infrastructure. However, detecting cracks of uneven intensity in complex backgrounds is challenging. To overcome this problem, we propose a dual decoder network (CSMT) based on a multi-branch aggregation Transformer, which uses residual atrous spatial pyramid pooling (RASPP) and Transformer dual decoding branches to extract local and global features of different structures. To enhance global feature extraction, we designed a multi-branch aggregation Transformer (MAT) that adaptively weights the features of two attention heads from spatial and channel dimensions to achieve intra block feature aggregation between dimensions. Meanwhile, to obtain multi-scale semantic information, we constructed a new decoding branch, RASPP, which embeds a squeeze-and-excitation (SE) module and residual structures into standard ASPP. Finally, we propose a feature adaptive fusion module (FAM) to enhance feature fusion between adjacent layers and codec layers. Many experiments on three benchmark datasets have shown that the proposed CSMT segmentation network provides excellent performance in a variety of complex scenarios.