## 5 Limitations and Future Works  
Although our cascade algorithm achieved excellent performance in detecting TB, there are still some limitations in this work and the field in general. The fundamental limitations  
Figure 6: Visualization of correct TB lesions localization by our cascade algorithm using OS and Grad-CAM. The captions for each image match the clinical report in the MC dataset. The colors of the heatmap: red = very high lesion, orange = high lesion, yellow = moderate lesion, cyan = low lesion, and blue = no lesion. (**a**) Patient with pleural effusion in right lung. Both methods correctly detected the lesion. (**b**) Patient with TB scars in RUL. Both methods correctly identified the scars. (**c**) Patient with infiltrate and cavity in LUL. Both methods correctly localized the lesion. (**d**) Patient with cavitary nodular infiltrate in RUL. Both methods correctly localized the reported lesions. (**e**) Patient with right lung apical dense fibrosis, calcification in RLL, and pleural angle blunting. Both methods correctly detected the dense fibrosis and focused on the RLL to label calcification and pleural angle blunting. (**f**) Patient with apical fibrotic disease with some calcifications in RUL and extensive infiltrates with a large cavitation in left lung. The Grad-CAM map correctly identified the lesions in both lungs. Figure 7: Visualizations of partially correct pathologies located by our cascade algorithm using OS and Grad-CAM. The model correctly predicts TB but misses some lesions and overcounts some. The captions for each image match the clinical report in the MC dataset. The colors of the heatmap: red = very high lesion, orange = high lesion, yellow = moderate lesion, cyan = low lesion, and blue = no lesion. (**a**) Patient with bilateral infiltrates and large cavity in RUL and pleural effusion in left lung. The algorithm correctly detected infiltrates but missed the pleural effusion in left lung. (**b**) Patient with improved infiltrates on both lungs and a visible cavitation in lingua. The algorithm correctly detected left lung lesions but missed right lung infiltrates. (**c**) Patient with apical fibrotic disease with some calcifications in RUL and extensive infiltrates with a large cavitation in left lung. The Grad-CAM map correctly identified the lesions in both lungs. arise from the datasets, which may limit their clinical applicability or performance in a real-world clinical practice. First, [PERSON] et al. [64] noted that up to 15% of accurate diagnoses using chest X-rays needed a side or lateral view. Radiologists often use X-rays acquired in both frontal and lateral projections, which aids both disease classification and localization. In this study, we only had available frontal projections, and the lack of lateral views may hinder the detection of some TB manifestations. Future work should use both frontal and lateral chest X-rays, when available, for diagnosis and automated system development. Secondly, clinical information is often necessary for a radiologist to render a specific diagnosis, or at least provide a reasonable differential diagnosis. Due to the lack of sufficient clinical information and pathological findings, our algorithm could not include patient history and other clinical information, which has been shown to improve diagnosis accuracy [65]. Therefore, new datasets, with both frontal and lateral images, clinical reports, and annotated lesions, are urgently needed. For lung segmentation, images with severe TB manifestations, for instance, severe pleural effusion, resulted in poor segmentation, because pleural effusion regions resemble the background. For these images, our DLabv3+X segmentation method did not generate the correct lung shape, which indicates that the segmentation alone did not capture sufficient intrinsic information about the lung shape for plausible structures. The incorporation of additional shape priors may lead to more correct segmentations. Although potentially beneficial, this will be our future work.