The global environmental changes have led to frequent occurrences of extreme rainfall, causing urban waterlogging. It is essential to quickly and accurately identify flooding as well as the depth levels. Therefore, Convolutional block attention module (CBAM)-improved ResNet50 is proposed for training to obtain flood depth levels (FDLs) recognition AI models. In this model, CBAM helps the model focus on important features for classifying FDLs, improving accuracy. It also streamlines the fully connected layers, reducing parameters, cutting computational costs, and preventing overfitting. A total of 6294 images related to urban waterlogging were collected for deep learning. The CBAM-improved ResNet50 algorithm achieved the highest test set accuracy at 92.45%, outperforming other algorithms including AlexNet (62.25%), MobileNet-V2 (64.67%), GoogleNet (75.5%), and ResNet50 (79.2%). It also demonstrates good predictive performance and generalization capabilities for urban waterlogging situations against various backgrounds. The computer vision recognition of the FDLs was explained through Gradient-weighted Class Activation Mapping in visualized images. Finally, through the established WeChat mini-program and AI model, the public can access the current FDLs at any time and place. This study provides information on the FDLs, offering a comprehensive overview of the severity of floods in the early stages of emergency response.