## 5 Simulation and Results
### COVID-19 Classification  
The results of the proposed model were compared with those of VGG16 [54] and YOLOv4. VGG16 comprises 13 convolutional layers and 3 fully connected layers. To train VGG16 using the COVID-19 dataset, the output of the last fully connected layer was modified to four and retrained using pre-trained weights with the ImageNet dataset. Flip, exposure, shift, and scale augmentation were applied to VGG16. YOLOv4 with default augmentation, except for hue and saturation, and the maximum class sum, were applied to classify the results. In both the models, additional data augmentation was not applied; the datasets used for training and testing are listed in Table 3.  
The results of the proposed two-step learning model were classified into two datasets: imbalanced and balanced. First, the two-step learning model was trained using the original imbalanced dataset shown in Table 3 without external augmentation. Subsequently, the two-step learning model was trained using the balanced dataset via 3D rotational augmentation. In a balanced dataset, the number of training images in each class is matched. As shown in Table 4, the ratio of normal to disease was 1:1, and the ratio of COVID-19, lung opacity, and viral pneumonia was 1:1:1. The imbalanced two-step learning model uses the default augmentation of YOLOv4, and the balanced two-step learning model applies 3D rotational augmentation instead of flipping and exposure augmentation. Figure 10 shows the charts of training loss and mean average precision (mAP) for two- and three-class models. The average loss and mAP for the two-class model is 0.5886 and 100.0% and those of three-class model are 0.6586 and 99.5%. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class** & **Training Image** & **Validation Image** & **Test Image** \\ \hline Normal & 24,000 & 6000 & 1600 \\ COVID-19 & 8000 & 2000 & 1600 \\ Lung Opacity & 8000 & 2000 & 1600 \\ Viral Pneumonia & 8000 & 2000 & 200 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Details of balanced dataset used for training, validation, and test. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Lung Detection Model**} & \multicolumn{4}{c}{**Number of Bounding Boxes**} & \multirow{2}{*}{**Errors**} & \multirow{2}{*}{**Error Rate**} \\ \cline{2-2} \cline{4-6}  & **Ground Truth** & & **Detection Results** & & \\ \cline{2-2} \cline{4-6}  & **2** & **0** & **1** & **2** & **3** & \\ \hline \
\begin{tabular}{c} First model \\ (Using 100 training images) \\ \end{tabular} & 21,165 & 8 & 158 & 21,007 & 103 & 158 & 0.747\% \\ \hline
\begin{tabular}{c} Second model \\ (Using 200 training images) \\ \end{tabular} & 21,165 & 0 & 35 & 21,130 & 32 & 35 & 0.165\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison results between first and second lung detection models. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class** & **Training Image** & **Validation Image** & **Test Image** \\ \hline Normal & 8392 & 200 & 1600 \\ COVID-19 & 1816 & 200 & 1600 \\ Lung Opacity & 4212 & 200 & 1600 \\ Viral Pneumonia & 945 & 200 & 200 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Details of imbalanced dataset used for training, validation, and test. Table 5 and Figure 11 show the performance of each model. When classifying four simple classes, the accuracy of VGG16 was 83.42%, and that of YOLOv4 was 88.26%, thus confirming the excellent performance of YOLOv4. The accuracy of the imbalanced two-step learning model for the same dataset was 91.26%, which was higher than that of YOLOv4. The overall accuracy, weighted precision, weighted recall, weighted F1 score, weighted AUC, and weighted MCC of the balanced two-step learning model using 3D rotational augmentation were the highest at 95.4, 95.72, 95.40, 95.49, 96.71, and 93.46%, respectively. Therefore, the proposed two-step learning  
Figure 11: Metric scores for each method.