To accurately identify microorganism species in the activated sludge of sewage treatment systems and modify the wastewater treatment process in real-time, using traditional machine learning methods is a challenge because of various complicated processes. In this study, a deep learning approach based on the integration of attention mechanism and transfer learning is proposed to accurately identify the species of microorganisms in sewage-activated sludge by overcoming the requirements of developing features manually, extracting features, designing classifiers, and other complicated processes. On the basis of transfer learning, the conventional VGG16 model is enhanced by including the attention module (SE-Net block) and modifying the output module, and the dataset is expanded using the data improvement approach. Experimental findings demonstrate that compared with the model before the enhancement, the enhanced model (T-SE-VGG16) can accurately recognize microorganisms in various types of sewage-activated sludge with a test accuracy of 98.21%, which enhances the recognition accuracy and reduces the training time. The model converges rapidly and has a strong generalization ability in terms of training time. Moreover, the T-SE-VGG16 model’s feasibility and reliability for the identification of microorganisms in sewage-activated sludge are verified.