# Enhancing 3D Lung Infection Segmentation with 2D U-Shaped Deep Learning Variants
## 3 Material and Methods
### Metrics Evaluation  
In this study, the performance of the five architectures is assessed using two types of metrics: similarity metrics and classification metrics. The similarity metrics used are the Intersection over Union (IoU) score and the dice score. These metrics are widely used in image segmentation studies and are recommended for evaluating segmentation models [9; 56]. The IoU score and dice score measure the similarity between the predicted segmentation and the ground truth by comparing the overlapping area and the overall area of the segmentations.  
The IoU score, also known as the Jaccard Index, is calculated as the intersection of the predicted and ground truth segmentations divided by the union of the two. It is represented by the formula:  
\[\text{IoU}=\frac{|A_{1}\cap A_{2}|}{|A_{1}\cup A_{2}|} \tag{2}\]  
The dice score is calculated as twice the intersection of the predicted and ground truth segmentations divided by the sum of the sizes of the predicted and ground truth segmentations. It is represented by the formula:  
\[\text{Dsc}=\frac{2|A_{1}\cap A_{2}|}{|A_{1}|+|A_{2}|} \tag{3}\]  
In addition to similarity metrics, this study also uses three classification metrics: accuracy, F1 score, and specificity. These classification metrics are used in this segmentation case because image segmentation is sometimes called, or also known as, pixel-level classification tasks. Although these metrics may not capture the full complexity of segmentation evaluation, they provide valuable insights into the classification performance.  
The accuracy measures the overall correctness of the segmentation by calculating the ratio of correctly classified pixels to the total number of pixels. It is represented by the formula:  
\[\text{Acc}=\frac{TP+TN}{TP+FP+TN+FN} \tag{4}\]  
The F1 score is the harmonic mean of precision and recall, where precision represents the proportion of true positive predictions among all positive predictions, and recall represents the proportion of true positive predictions among all actual positive samples. It is represented by the formula:  
\[\text{F1 score}=\frac{2 TP}{2 TP+FP+FN} \tag{5}\]  
The sensitivity, also known as recall or the true positive rate (TPR), assesses the model's capability to correctly identify all positive instances within the dataset. In the context of image segmentation, sensitivity is crucial for recognizing and not missing relevant regions. It quantifies the proportion of true positive predictions, which are the instances correctly identified as positive, among all actual positive samples. Sensitivity is represented by the formula:  
\[\text{Sensitivity}=\frac{TP}{TP+FN} \tag{6}\]  
Lastly, the specificity measures the model's ability to correctly identify the true negative cases. It is calculated as the ratio of true negative predictions to the sum of true negative and false positive predictions. It is represented by the formula:  
\[\text{Specificity}=\frac{TN}{TN+FP} \tag{7}\]  
From the five equations above, it is necessary to know that \(A_{1}\) represents the ground truth area and \(A_{2}\) represents the area of the model's prediction results. \(TP\), \(TN\), \(FP\), and \(FN\) represent the number of classification results for each pixel.