Abstract
In this study, a deep learning model based on transfer learning is proposed, which uses the pre-trained ResNet50 architecture to automatically classify X-ray images of normal, bacterial and viral pneumonia. In the experimental process, after 20 rounds of training, the accuracy of the model is close to 100% in both the verification set and the test set. The changes of loss function and accuracy curve show that the model learns and converges rapidly, and the performance of verification set is consistent with that of training set, and there is no obvious over-fitting phenomenon. In addition, the classification results are further verified by confusion matrix and classification report, which shows that the classification accuracy of the model on three types of pneumonia is extremely high, with an overall accuracy rate of 99.6%, and the accuracy rate, recall rate and F1 score are close to 1.00. Although there is slight misclassification in a small number of samples of bacterial and viral pneumonia, the overall results show that the model has strong robustness and generalization ability in medical image classification tasks. The research results show that the model performs well in pneumonia classification, which provides an important reference for future medical image analysis and automatic diagnosis.