Crack detection is a crucial task in assessing the condition of concrete structures. Herein, a novel deep learning method based on convolutional neural networks, referred to as R-FPANet, is proposed for crack detection. The R-FPANet performs automatic segmentation and quantification of crack morphology at the pixel level. In this methodology, the modularization concept based on the following three modules is adopted: ResNet-50 is chosen as the backbone to extract features from images, the Feature Pyramid Network with Dense Block is integrated to promote the fusion of both shallow and deep features as well as enhance feature reuse, and self-attention mechanisms such as Channel Attention Module and Position Attention Module are introduced to strengthen the dependency between features. Based on the crack segmentation results, a suitably established framework is developed for quantitative analysis of the major geometric parameters, including crack area, crack length, crack mean width and crack max-width at the pixel level. To verify the effectiveness of the proposed method, a large-scale concrete crack image dataset was produced and carefully labeled at the pixel level and then utilized to train the model. Finally, our experiments reveal that the proposed approach achieves an Intersection over Union of 83.07%, further indicating that the segmentation performance of the proposed method is better than the state-of-the-art models and also confirming that the crack quantification results are close to reality. Overall, the proposed method performs well, contributing to crack detection and quantification with great potential for practical use.