The clinical diagnosis results based on lung X-rays provide important evidence in the COVID-19 pneumonia diagnosis process and for some other disease. However, due to the similarity of the lesions among many types of pneumonia displayed by X-rays, and due to the huge amount of X-ray readings of a doctor’s daily work, traditional reading and identification method purely by human have problems of diagnosis mistakes, missed diagnosis and huge time consumption. Therefore, an intelligent detection model of pneumonia with multi-scale-input Focal Transformer integrated with SPD module is proposed to automatically identify various types of pneumonia including COVID-19 pneumonia. The method can pay attention to the multi-scale characteristic features of pneumonia lesions, and then make improved classification among COVID-19 pneumonia, cases with lung opacity, viral pneumonia and normal cases, providing stronger support for radiologists in medical diagnosis. The experiment results show that the proposed model has advantages in comparison to the traditional network models ResNet-50 and Swin Transformer in aspects of accuracy, recall, F1-Measure and other indicators.