## 4 Experimental Results and Discussions
### Lung Segmentation  
The evaluation of lung segmentation was mainly based on the MC and SZ datasets. MC contained manually segmented masks, whereas the ground truth lung masks of the SZ dataset were acquired from [PERSON] et al. [61]. The SZ and MC datasets are randomly partitioned into training and testing in an 80:20 ratio. We used the training dataset for training the algorithm and the testing dataset for evaluating performance. Our DLabv3+X segmentation was a DeepLabv3+ model, where the XceptionNet model was embedded as the backbone network. To show the effectiveness and robustness of XceptionNet as a backbone network, three other networks, ResNet-18, ResNet-50, and MobileNet, were also embedded as the backbone network, labeled DLabv3+R18, DLabv3+R50, and DLabv3+M. All the segmentation models are trained using the Adam optimizer, which is a variant of the stochastic gradient optimization algorithm [62]. We used the default hyperparameters of Adam: an initial learning rate, \(\alpha=0.001\); decay rate of gradient moving average, \(\beta_{1}=0.9\); decay rate of squared gradient moving average, \(\beta_{2}=0.99\). Due to the limitation of GPU memory, the batch size was set to 4. To avoid overfitting in the networks, so that it does not become specific to some patterns in the training set and does not fail to generalize to the testing images, we used early stopping to save the networks after every epoch and to choose the saved network with the minimum loss. Once the segmentation models were trained, lung segmentation masks for the images were generated for use on the testing dataset. The models' performance was evaluated at the pixel level by comparing the predicted mask with the ground truth mask. In the literature, different methods have been evaluated with different evaluation metrics [4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18]. Here, we judged segmentation method performance using three common metrics: IoU or Jaccard Index, Dice Similarity Coefficient (DSC) score, and average accuracy, computed as  
\[\textit{Pixel Accuracy}=\frac{TP+TN}{TP+TN+FP+FN} \tag{5}\]  
\[\textit{IoU or Jacard Index}=\frac{(GT\bigcap Seg)}{(GT\bigcup Seg)}=\frac{TP}{ TP+FP+FN} \tag{6}\]  
\[DSC=\frac{2*\mid GT\bigcap Seg|}{\mid GT\mid+\mid Seg\mid}=\frac{2 TP}{2 TP+FP+ FN} \tag{7}\]  
where \(GT\) and Seg denote the ground truth mask and the segmented region, respectively. True Positive (\(TP\)) refers to lung pixels, which were correctly predicted as the lung. Similarly, True Negative (\(TN\)) stands for correctly classified non-lung pixels. On the other hand, False Positive (\(FP\)) represents non-lung pixels wrongly segmented as lung, and False Negative (\(FN\)) denotes pixels which should have been marked as lung pixels. Segmentation results for DLabv3+X, along with the alternatives: DLabv3+R18, DLabv3+R50, and DLabv3+M are listed in Table 2 for MC and Table 3 for the SZ dataset. The tables show that DLabV3+X segmentation performed better than the other three variants: this is because XceptionNet has the deepest depth among the embed backbone networks. The deeper DCNN model can produce deeper features and covers a wider area in the image, which delivers better segmentation results. Visualizations of DLabv3+X segmentations are in Figure 5.  
Even though FCN, SegNet, and U-Net have been used for lung segmentation and provided good results, they were mainly evaluated on the JSRT dataset [63]. Assessing lung segmentation algorithms on this dataset is flawed because the JSRT dataset contains a limited number of lung abnormalities: the only abnormalities found are nodules. The presence of nodules, in most cases, does not affect the lung shape, especially when the nodules are small or are not located in the peripheral lung zone. Therefore, most of thelung regions in the JSRT dataset can be considered normal. On the other hand, the MC and SZ datasets contain a variety of TB manifestations that severely affect the shape and intensity of lung regions.