# A Transfer Learning Method for Pneumonia Classification and Visualization
## 2 Related Works
### Transfer Learning and Chest Diseases  
Training a deep CNN model such as ResNet, Xception, or DenseNet from scratch requires a lot of data because they contain millions of trainable parameters, in which a small dataset would be insufficient to get a good generalization of the model. On the contrary, the mentioned baseline models have been used to compete in the ILSVRC through the years. Moreover, these models can be reused using their pre-trained weights employing a TL technique. TL has been a useful ML method in which a pre-trained model of CNN is reused to take advantage of its weights to take them into account as initialization for a new CNN model for a different purpose [24]. There exist two primary ways to use TL from a model: reuse a model as a feature extractor and use a new totally different classifier; or reuse the model to perform Fine-Tuning (FT). FT is a technique that uses some unfrozen layers of a full model to slightly adjust both the new Fully Connected (FC) layers of the classifier and specific layers of the CNN like convolutional layers [25]. CNN applications for chest diseases began to popularize after [PERSON] et al. [26] released the Chest-Xray14 dataset (CX14) in 2017, containing 108,948 posterior-anterior (PA) CXRAYs. Since then, multiple approaches of CNN for classification and segmentation tasks have been presented. One of the first was presented by [PERSON] et al. [27], in which a pre-trained DenseNet called _CheXNet_ was used in the CX14 dataset to classify the 14 diseases but used a new test set of CXRAY of pneumonia, achieving a radiologist-level diagnosis compared with board-members doctors from the Stanford University. [PERSON], [PERSON], and [PERSON] presented a CNN for Pneumothorax detection using CXRAY images [28]. [PERSON] et al. presented an automated method for cardiomegaly detection using two different architectures, one for segmentation, then a new one for classification [29]. Apart from CX14 dataset, in 2019 [PERSON] et al. published a new large dataset of CXRAY images, the CheXpert dataset [30], in which they provided 224,316 CXRAYs. They established a baseline result for the classification task of 14 different classes. [PERSON] and [PERSON], presented a novel CNN [31] that achieved better performance in both, CX14 and CheXpert datasets, surpassing the baseline established by [PERSON] et al. Therefore, due to the popularity of CX14 dataset, we can find several works that use CX14 dataset and present novel results almost every two or three months, examples of these works are found in [32; 33; 34; 35]. Works that have used the CX14 or CheXpert datasets commonly train from scratch a specific model of CNN due to the high availability of data, more than 100,000 images. On the other hand, there exist some relevant datasets focused on chest diseases that are not big enough to train such big networks. For example, [PERSON] et al. [36], presented the Pneumonia dataset that only contains 5232 CXRAYs. For [PERSON]'s dataset, there exist several classification works, like the one presented by [PERSON] et al. [34]. One of the most recent top results was by [PERSON] and [PERSON] using an individual CNNmodel [37] and the most recent work by [PERSON] et al. [38], that used an ensemble model. We will refer to [PERSON] and [PERSON] network as LZNet2019 and to [PERSON] et al. ensemble as Cho2020 for further comparisons. In both works, they used a TL technique to reuse a pre-trained baseline model of CNN to classify and visualize the CXRAYs with pneumonia. Moreover, there exists efficient full-custom CNN as presented by [PERSON] et al. [39]. In this work, the proposed CNN is compared with some of the state-of-the-art methods that use TL techniques [40; 41; 42] to obtain better results. Our proposal uses a TL method in conjunction with the Xception network as pre-trained model on ImageNet. This is due to the Xception model allows to develop CV applications without having datasets of tens of thousands of images available which is the common scenario in developing countries.