###### Abstract  
Preunonia is a life-threatening disease, which occurs in the lungs caused by either bacterial or viral infection. It can be life-endangering if not acted upon at the right time and thus the early diagnosis of pneumonia is vital. The paper aims to automatically detect bacterial and viral pneumonia using digital x-ray images. It provides a detailed report on advances in accurate detection of pneumonia and then presents the methodology adopted by the authors. Four different pre-trained deep Convolutional Neural Network (CNN): AlexNet, ResNet18, DenseNet201, and SqueezeNet were used for transfer learning. A total of 5247 chest X-ray images consisting of bacterial, viral, and normal chest x-rays images were preprocessed and trained for the transfer learning-based classification task. In this study, the authors have reported three schemes of classifications: normal vs. pneumonia, bacterial vs. viral pneumonia, and normal, bacterial, and viral pneumonia. The classification accuracy of normal and pneumonia images, bacterial and viral pneumonia images, and viral pneumonia were 98%, 95%, and 93.3%, respectively. This is the highest accuracy, in any scheme, of the accuracies reported in the literature. Therefore, the proposed study can be useful in more quickly diagnosing pneumonia by the radiologist and can help in the fast airport screening of pneumonia patients. pneumonia; bacterial and viral pneumonia; chest X-ray; deep learning; transfer learning; image processing +
Footnote †: journal: Medical  
Nevertheless, faster diagnosis of viral or bacterial pneumonia and the consequent application of correct medication can help significantly to prevent deterioration of a patient's condition, which eventually leads to death [2]. Chest X-rays are currently the best method for diagnosing pneumonia [3]. X-ray images of pneumonia are not very clear and are often misclassified to other diseases or other benign abnormalities. Moreover, the bacterial or viral pneumonia images are sometimes miss-classified by the experts, which leads to wrong medication being given to the patients and thereby worsening the condition of the patients [4; 5; 6]. There are considerable subjective inconsistencies in the decisions of radiologists reported in diagnosing pneumonia. There is also a lack of trained radiologists in low resource countries (LRC), especially in rural areas. Therefore, there is a pressing need for computer-aided diagnosis (CAD) systems, which can help the radiologists in detecting different types of pneumonia from the chest X-ray images immediately after the acquisition. Currently, many biomedical complications (e.g., brain tumor detection, breast cancer detection, etc.) are using Artificial Intelligence (AI)-based solutions [7; 8; 9; 10]. Among the deep learning techniques, convolutional neural networks (CNNs) have shown great promise in image classification and therefore widely adopted by the research community [11]. Deep Learning Machine learning techniques on chest X-rays are gaining popularity as they can be easily used with low-cost imaging techniques and there is an abundance of data available for training different machine-learning models. Several research groups [1; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25] have reported the use of deep machine learning algorithms in the detection of pneumonia; however, only one article [16] has reported the classification of bacterial and viral pneumonia. There are many works where the authors tried varying the parameters of deep layered CNN for pneumonia detection. The pattern of diffuse opacification in the lung radiograph due to pneumonia can be alveolar or interstitial. Patients with alveolar infiltration on the chest radiograph, especially those with lobar infiltrates, have laboratory evidence of a bacterial infection [26]. Again, interstitial infiltrations on radiograph may be linked with viral pneumonia [27]. These might be the distinctive features in the machine learning algorithms in differentiating viral and bacterial pneumonia.