# Deep Learning System for COVID-19 Diagnosis Aid Using X-ray Pulmonary Images
## 3 Results and Discussion
### Effectiveness Results  
We compared the effectiveness using different metrics, distinguishing between micro and macro metrics. Macro metrics average the unweighted mean per label. They include accuracy, sensitivity (also named macro recall), specificity, macro precision and macro F1-score. \[Specificity=\sum_{c}\frac{TN_{c}}{TN_{c}+FP_{c}},c\in classes, \tag{1}\]  
\[Precision_{m}=\sum_{c}\frac{TP_{c}}{TP_{c}+FP_{c}},c\in classes, \tag{2}\]  
\[Recall_{m}(sensitivity)=\sum_{c}\frac{TP_{c}}{TP_{c}+FN_{c}},c\in classes, \tag{3}\]  
\[F1-score_{m}=2\times\frac{precision_{m}\times recall_{m}}{precision_{m}+recall_{m }}, \tag{4}\]  
where \(m\) index refers to macro metric and \(classes=\{COVID-19,healthy, pneumonia\}\). The term \(TP_{c}\) refers to the number of samples with class \(c\) that were classified correctly as \(c\). The term \(FP_{c}\) means the set of samples with different class of \(c\) that were classified as \(c\) by the model. \(FN_{c}\) refers to the set of  
Figure 2: Pre-processing results. samples with class \(c\) that were classified as other different class. \(TN_{c}\) indicates the number of samples with a class other than \(c\) that were not classified as \(c\). The results obtained for macro metrics are shown in Table 2. Both models presents effectiveness values over 0.85 for each metric. The higher results are the specificity values, which implies that in general the model has a low probability of generating false positives. The rest of the metrics, however, also present high values, denoting a good performance of the models identifying both true positives and negatives. As opposed to macro metrics, micro metrics shows the results averaging the total true positives, false negatives and false positives. The results for each class and model are shown in Tables 3 and 4. Overall, both models obtain a high effectiveness in relation to COVID-19. The metrics reveal that the model is quite sensitive to the identification of this disease with this type of images, with a low rate of false negatives. In contrast, the model is less sensitive identifying cases of pneumonia. Macro metric results indicate that on average the first model has a slightly better performance. However, the micro average metrics values and the confusion matrices (Figure 3) reveal that the model using images without preprocessing achieves a higher hit rate in healthy individuals. On the other hand, the model that uses equalized images has a higher hit rate in the other two classes. The first model distinguishes better between patients with or without one of the pathologies considered, but it is not as effective as the second model distinguishing between pneumonia and COVID-19 disease. This fact could, in principle, be expected as contrast enhancement increases details in the X-ray image and, in this way, increases the deferential characteristics between different deceases but may create some unexpected details in healthy images that may led to their classification as pathological. Several authors have use adaptive equalization on chest X-ray images (e.g., Reference [23] but they use it a preprocessing step before segmentation and do not try to directly classify the enhanced images. Given the purpose of the detection system, as a diagnostic support tool, the second model can be considered more suitable, since it is more sensitive to disease identification, with few false negatives for these two classes. False positives could be discarded by a specialist doctor. Although the numerical results obtained reflect the goodness of the implemented system, it is very interesting to observe the X-ray images that have been used on it to appreciate the similarities and differences between patients with COVID-19, patients with pneumonia and healthy patients. Some of the images used in this work and the classification results of the system can be seen in Figure 4.