## 1 Introduction
[16] proposed the COVID-CAPS that comprises four convolutional layers and three capsule layers; it afforded accuracy, sensitivity, and specificity of 95.7%, 90%, and 95.8%, respectively. [PERSON] et al. [17] proposed a model for classifying normal lung opacity, COVID-19, and viral pneumonia using 21,165 CXR images. The authors applied data augmentation such as rotation and flip to solve imbalance in the amount of data for each class. The head section of the existing pre-trained CNN model was redesigned with batch normalization, a dropout layer, and two dense layers to achieve an accuracy of 96.13%. Contrary to the use of original CXR images in existing methods, images obtained by segmenting only the lung region among CXR images have been used in a few studies [18; 19]. When the results of a CNN model are interpreted using visualization methods such as Score-CAM [20], most of the regions contributing to the decision of the CNN model are not the lung region. Although the segmentation of the lung region may not improve the model performance, the reliability of the model results must be improved. [PERSON] et al. [19] compared the performance of a CNN model based on various data augmentation and lung segmentation methods using the COVQU-20 dataset that comprises 18,479 normal, non-COVID-19 lung opacity, and COVID-19 CXR images. Data augmentation uses gamma correction, complement, histogram equalization, contrast-limited adaptive histogram equalization, and balanced contrast enhancement techniques that vary the brightness and contrast of images. Meanwhile, Resnet18, Resnet50, Resnet101, CheXNet [21], and DenseNet201 were used as CNN models. U-Net [22] was used to segment the lung region in the image. In the plain CXR dataset, gamma correction and CheXNet performed the best, whereas in the lung-segmented dataset, gamma correction and DenseNet201 performed the best. The accuracy, precision, and recall achieved were 96.29%, 96.28%, and 96.28%, respectively, in the non-segmented case, and 95.11%, 94.55%, and 94.56%, respectively, in the segmented case. [PERSON] at el. [23; 24] used 2905 CXR images to classify normal, COVID-19, and viral pneumonia. Artificial neural networks (ANN)-based segmentation model is used to crop the lung region from raw CXR, obtain robust features, and improve classification accuracy. The ANN model consists of a single hidden layers with 100 neurons and output with 6 neurons. The output consists of x and y coordinates of three points that are converted to lung region. In [23], they proposed CNN-based transfer learning bidirectional long short-term memories model with an accuracy 98.70%. In article [24], they compared five pre-trained CNN models to extract the features and four machine learning (ML) algorithms to classify the CXR images. To improve the accuracy, Bayesian optimization was applied the ML algorithms. They achieved the highest accuracy 96.29% with DenseNet201 model and support vector machine algorithm. The sensitivity, precision, specificity, F1 score, and Matthews correlation coefficient (MCC) of this model are 0.9642, 0.9642, 0.9812, 0.9641, and 0.9453, respectively. Herein, we propose a deep learning model that can effectively classify normal, COVID-19, lung opacity, and viral pneumonia from a COVID-19 dataset and reduce false-negative COVID-19 diagnoses to prevent the spread of infection in the surroundings. Our goal is to propose a new data augmentation method to overcome the problem due to imbalanced datasets, and a two-step learning model for effective separation of normal and disease CXR images and the classification of diseases from each disease CXR image. The proposed method involves a lung detection model, 3D rotational augmentation, and a two-step learning model. The lung detection and two-step learning models are designed based on you only look once (YOLO)-v4 algorithm [25]. The training image and coordinates of the bounding box corresponding to each image are required to train YOLOv4.