Road surface condition (RSC) is an important indicator in road safety studies, enabling transportation departments to employ it for conducting surveys, inspections, cleaning, and maintenance, ultimately contributing to improved performance in road upkeep. However, traditional recognition methods can be easily affected when extreme weather frequently occurs such as winter seasonal changes. To achieve real-time and automatic RSC monitoring, this paper proposes an improved Mask-region-based convolutional neural network (RCNN) based on Swin Transformer-PAFPN and a dynamic head detection network. Meanwhile, transfer learning is used to reduce training time, and data enhancement and multiscale training are applied to achieve better performance. The experimental results show that the proposed model achieves an outstanding mean average precision at 0.5 (mAP@0.5) score of 89.8 under favorable weather conditions characterized by clear visibility, surpassing other popular methods. Notably, the proposed model exhibits lower parameters and GigaFLOPS (GFLOPs) (72.41 and 158.35, respectively) compared to other popular methods, thus demanding fewer computational resources. Furthermore, in challenging weather conditions characterized by poor visibility, such as foggy and nighttime scenarios, the proposed model achieves mAP@0.5 scores of 78.50 and 82.40, respectively. These scores not only outperform those of other popular methods but also underscore the robustness of the proposed model in extreme weather conditions. This exceptional performance demonstrates the proposed model's effectiveness in addressing complex road conditions under various meteorological circumstances, providing reliable technical support for practical traffic monitoring and road maintenance.