Coronavirus (COVID-19) Classification Using CT Images by Machine Learning Methods
Coronavirus (COVID-19) Classification Using CT Images by Machine Learning Methods
Coronavirus (COVID-19) Classification Using CT Images by Machine Learning Methods
Abstract: This study presents early phase detection of Coronavirus (COVID-19), which is named by World Health
Organization (WHO), by machine learning methods. The detection process was implemented on abdominal
Computed Tomography (CT) images. The expert radiologists detected from CT images that COVID-19 shows
different behaviours from other viral pneumonia. Therefore, the clinical experts specify that COVİD-19 virus needs
to be diagnosed in early phase. For detection of the COVID-19, four different datasets were formed by taking
patches sized as 16x16, 32x32, 48x48, 64x64 from 150 CT images. The feature extraction process was applied to
patches to increase the classification performance. Grey Level Co-occurrence Matrix (GLCM), Local Directional
Pattern (LDP), Grey Level Run Length Matrix (GLRLM), Grey-Level Size Zone Matrix (GLSZM), and Discrete
Wavelet Transform (DWT) algorithms were used as feature extraction methods. Support Vector Machines (SVM)
classified the extracted features. 2-fold, 5-fold and 10-fold cross-validations were implemented during the
classification process. Sensitivity, specificity, accuracy, precision, and F-score metrics were used to evaluate the
classification performance. The best classification accuracy was obtained as 99.68% with 10-fold cross-validation
and GLSZM feature extraction method.
1. INTRODUCTION
COVID-19 disease was occurred in the end of 2019 at Wuhan region of China. COVID-19 disease showed fever,
cough, fatigue, and myalgias in human body during early phases (1). The patients had abnormal situations in their
CT chest images. The respiratory problems, heart damages, and secondary infection situations were observed as
complications of the disease. The findings showed that COVID-19 virus spreads from person to person. The infected
person needs to be treated in intensive care unit. The infected people have serious respiratory problems. The CT
images of the infected people shows that COVID-19 disease has own characteristics. Therefore, the clinical experts
need lung CT images to diagnose the COVID-19 in early phase.
The development of computer vision systems supports the medical applications such as increasing the
image quality, organ segmentation, and organ texture classification. The analysis of time series and tumor
characteristics (2), the segmentation and detection (3) of tumor modules are some of the machine learning
application in biomedical image processing field.
In the literature, there is not a detailed study on coronavirus disease. Xu et al. (4) classified CT images of
COVID-19 into three class as COVID-19, Influenza-A viral pneumonia, and healthy cases. They obtained the
images from the hospitals in Zhejiang region of China. The dataset consisted of total 618 images, which includes
219 images from 110 patients with COVID-19, 224 images of 224 patients with Influenza-A viral pneumonia, and
175 images of 175 healthy people. They classified the images with 3D-dimensional deep learning model and
achieved an 87.6% overall classification accuracy. Shan et al. (5) developed a deep learning based system for
segmenting and quantification the infected regions as well as the entire lung on chest CT images. They used 249
COVID-19 patients and 300 new COVID-19 patients for validation in their study. They obtained Dice similarity
1
coefficient as 91.6%. The normal delineation system often takes 1 to 5 hours; however, their proposed system
reduced the delineation time to four minutes.
This study used 150 CT images for COVID-19 classification. Before classification process, the four
different datasets were created from 150 CT images and the samples of datasets were labelled as coronavirus / non-
coronavirus (infected / non-infected). Feature extraction methods and SVM are used during the classification of the
coronavirus images. The findings showed that the proposed method could be used to diagnose the COVID-19
disease as an assistant system.
This paper is organized as follows. Section 2 analyses the images statistically and visually. Section 3
briefly explains the feature extraction classification techniques. Section 4 presents the classification results. Section
5 discusses and concludes the results.
2. MATERIAL
2.1. Statistical Features of Dataset Used
The data consist of 150 CT abdominal images, which belong the 53 infected cases, from the Societa Italiana di
Radiologia Medica e Interventistica (6). The patch regions were cropped on 150 CT images. The patches were
extracted from the regions selected. Four different patch subsets were created and presented in Table 1.
2
As seen in Figure 1, the grey levels are different in different CT tools. This situation is a disadvantage for
classification. Figure 2 shows the patch regions and patch samples from four different subsets.
Figure 2. Sample images for infected and non-infected situations for all subsets
3. METHOD
This study performs a coronavirus classification in two stages. In the first stage, the classification process was
implemented on four different subsets without feature extraction process. The subsets were transformed into vector
and classified by SVM. In the second stage, five different feature extraction methods such as Grey Level Co-
occurrence Matrix (GLCM) (7-9), Local Directional Patterns (LDP) (10), Grey Level Run Length Matrix (GLRLM)
(11), Grey Level Size Zone Matrix (GLSZM) (12), and Discrete Wavelet Transform (DWT) (13) extracted the
features and the features were classified by SVM (14). During the classification process, 2-fold, 5-fold, and 10-fold
cross-validation methods were used. The mean classification results after cross-validations were obtained. Figure 3
shows the two stages of classification process.
3
3.1. The Feature Extraction Techniques
The feature sets formed by using GLCM, LDP, GLRLM, GLSZM and DWT were used for classification of
coronavirus. The SVM classifier was used to classify the extracted features, because the SVM is a strong binary
classifier. The feature extraction methods used in this study are as follows:
1 𝑤𝑤ℎ𝑒𝑒𝑒𝑒 𝑥𝑥 ≥ 0
𝑠𝑠(𝑥𝑥) = � (2)
0 𝑜𝑜𝑜𝑜ℎ𝑒𝑒𝑒𝑒
LDP method produces output matrix sized as input image. This matrix is transformed into a vector for
classifier input.
4
high grey-level run emphasis features from all subsets (11). GLRLM method produces 1x7 feature vector for
classifier input.
4. EXPERIMENTAL RESULTS
This study presents a coronavirus classification in two stages. Stage 1 classified subsets without feature extraction.
Stage 2 implemented feature extraction process on all subsets and classified the features extracted. Five different
evaluation metrics (Equations 3-7) were used to assess the proposed method. These metrics are sensitivity (SEN),
specificity (SPE), accuracy (ACC), precision (PRE), and F-score.
TP, TN, FP, and FN values are the number of true positives, true negatives, false positives, and false negatives,
respectively (15).
5
4.1. Classification Results of Subset 1
Subset 1 has 5912 non-infected and 6940 infected patches. These patches were classified by Stage 1 and Stage 2.
Table 2 presents the obtained classification results.
Table 2. The classification results for Subset 1
Feature Number of Cross- Evaluation Metrics (mean (%) ± std)
Stage
Extraction Features validation SEN SPE ACC PRE F-score
x 256 2-fold 83.97±2.1 76.99±1 80.2±0.4 75.67±0.4 79.6±0.7
Stage 1 x 256 5-fold 84.28±1.1 77.2±1.6 80.5±0.8 75.93±1.2 79.88±0.7
x 256 10-fold 84.23±1.6 77.25±1.5 80.46±1 75.94±1.2 79.86±1
GLCM 19 2-fold 97.56±0.4 98.82±0.3 98.19±0.2 98.48±0.3 98.02±0.2
GLCM 19 5-fold 98.41±0.3 99.12±0.3 98.79±0.3 98.96±0.4 98.69±0.4
GLCM 19 10-fold 98.52±0.3 99.23±0.4 98.91±0.2 99.1±0.4 98.81±0.2
LDP 256 2-fold 43.72±0.1 57.09±0.7 50.94±0.3 46.47±0.4 45.05±0.1
LDP 256 5-fold 41.58±2.7 58.49±2.3 50.71±0.9 46.03±1.1 43.66±1.8
LDP 256 10-fold 42.47±2.5 57.71±1.6 50.7±1.5 46.09±1.8 44.19±2.1
GLRLM 7 2-fold 98.6±0.1 93.67±0.2 95.93±0.1 92.99±0.2 95.71±0.1
Stage 2 GLRLM 7 5-fold 98.75±0.5 94.29±0.5 96.34±0.1 93.65±0.5 96.1±0.1
GLRLM 7 10-fold 98.78±0.5 94.38±1 96.41±0.6 93.75±1.1 96.2±0.6
GLSZM 13 2-fold 97.34±0.4 99.57±0.1 98.54±0.2 99.48±0.1 98.4±0.3
GLSZM 13 5-fold 97.56±0.7 99.68±0.4 98.71±0.3 99.62±0.1 98.58±0.4
GLSZM 13 10-fold 97.72±0.5 99.67±0.1 98.77±0.2 99.6±0.2 98.65±0.2
DWT 64 2-fold 96.21±0.1 98.6±0.3 97.5±0.1 98.33±0.3 97.26±0.1
DWT 64 5-fold 96.62±0.7 98.62±0.2 97.7±0.3 98.35±0.2 97.47±0.4
DWT 64 10-fold 96.8±0.6 98.66±0.4 97.81±0.3 98.4±0.5 97.6±0.4
As seen in Table 2, the best classification result was obtained as 99.68% in Stage 2 with 10-fold cross-
validation and GLSZM feature extraction method.
6
Table 3. The classification results for Subset 2
Feature Number of Cross- Evaluation Metrics (mean (%) ± std)
Stage
Extraction Features validation SEN SPE ACC PRE F-score
x 1024 2-fold 82.6±0.6 77.99±0.6 80.09±0.1 75.9±0.4 79.1±0.1
Stage 1 x 1024 5-fold 83.23±2.5 80.31±3.1 81.64±2.2 78.07±2.8 80.54±2.3
x 1024 10-fold 83.65±2.6 79.94±3.2 81.64±1.9 77.87±2.67 80.62±1.9
GLCM 19 2-fold 97.55±0.5 99.11 98.4±0.2 98.92 98.2±0.2
GLCM 19 5-fold 97.77±0.7 99.38±0.2 98.64±0.4 99.24±0.3 98.5±0.5
GLCM 19 10-fold 97.77±1.6 99.47±0.5 98.69±0.8 99.35±0.6 98.55±0.9
LDP 1024 2-fold 43.82±1.1 54.55±2.3 49.66±1.7 44.76±1.8 44.3±1.4
LDP 1024 5-fold 43.1±4.4 51.4±2.3 47.6±3.8 42.7±4.1 42.88±4.2
LDP 1024 10-fold 42.03±4.9 52.49±3.9 47.72±1.9 42.56±2.4 42.22±3.4
GLRLM 7 2-fold 54.77±1.2 78.7±2.1 67.78±0.6 68.38±1.7 60.81±0.1
Stage 2 GLRLM 7 5-fold 58.69±4.9 78.25±1.1 69.33±2.1 69.32±1.8 63.5±3.6
GLRLM 7 10-fold 60.29±5.4 77.99±2.5 69.91±2.8 69.65±3 64.57±4
GLSZM 13 2-fold 90.23±0.9 94.47±0.3 92.54±0.3 93.2±0.2 91.7±0.4
GLSZM 13 5-fold 90.77±2.6 94.48±1.8 92.78±1.1 93.29±1.9 91.98±1.3
GLSZM 13 10-fold 91.5±1.9 95.01±1.5 93.41±1.1 93.93±1.8 92.69±1.2
DWT 256 2-fold 98.72±0.3 99.55±0.1 99.18±0.2 99.47±0.2 99.09±0.7
DWT 256 5-fold 98.94±0.5 99.64±0.4 99.32±0.3 99.57±0.4 99.25±0.3
DWT 256 10-fold 99.15±1.1 99.55±0.8 99.37±0.6 99.47±0.9 99.31±0.7
Table 3 shows that the best classification result was obtained as 99.37% in Stage 2 with 10-fold cross-
validation and DWT feature extraction method.
7
Table 4 shows that the best classification result was obtained as 99.64% in Stage 2 with 10-fold cross-
validation and DWT feature extraction method.
Table 5 shows that the best classification result was obtained as 97.28% in Stage 2 with 10-fold cross-
validation and DWT feature extraction method.
Table 2, Table 3, Table 4 and Table 5 show that the best performance was obtained by extracting features on
patches. GLCM, GLSZM and DWT methods always had classification accuracy over 90% during 10-fold cross
validation. The best classification performance was achieved by using GLSZM method with 5-fold cross-validation.
The scheme of the best method is presented in Figure 4.
Figure 4. The optimum classifier structure for detection of the infected patches
As seen in Figure 4, the CT image was divided into 32x32 sized patches. GLSZM method extracts the features
of the patches and form feature vector. The vector is classified by five different SVM structures, which were
obtained during training phase. The mean classification performance is obtained by SVM classification.
8
5. DISCUSSION and CONCLUSION
COVID-19 was firstly encountered at Wuhan region in China and have been threatening the public health, trade and
world economy. The virus shows the partially similar behaviours with other viral pneumonia. Therefore, the
spreading rate of the virus made the situation difficult to be under control. CT imaging results of COVID-19 show
that different findings according to other clinical studies. Some situations such as the bronchiectasis, lesion swelling
symptoms, and different shadowiness in CT images provide to diagnose COVID-19, easily.
In this study, the coronavirus image set has different type of images, which were acquired with different CT
tools. Therefore, five feature extraction methods were utilized to find the feature set that separates the infected
patches with a high accuracy. The dataset in this study was formed manually and achieved 99.68% classification
accuracy. The proposed method should be tested on another coronavirus CT image dataset.
The literature studies are mostly medical studies. The classification, segmentation studies may increase on
COVID-19 in the literature. This study examined COVID-19 images in the classification field. There should be done
more classification and segmentation studies on COVID-19. For this aim, the dataset diversion needs to be
increased. The machine learning methods should be implemented more on CT abdominal images, X-ray chest
images, blood test results when these data were shared to literature.
REFERENCES
1. Huang C, Wang Y, Li X, Ren L, Zhao J, Hu Y, et al. Clinical features of patients infected with 2019 novel
coronavirus in Wuhan, China. The Lancet. 2020;395(10223):497-506.
2. Huang P, Park S, Yan R, Lee J, Chu LC, Lin CT, et al. Added value of computer-aided CT image features
for early lung cancer diagnosis with small pulmonary nodules: a matched case-control study. Radiology.
2018;286(1):286-95.
3. Esteva A, Kuprel B, Novoa RA, Ko J, Swetter SM, Blau HM, et al. Dermatologist-level classification of
skin cancer with deep neural networks. Nature. 2017;542(7639):115-8.
4. Xu X, Jiang X, Ma C, Du P, Li X, Lv S, et al. Deep Learning System to Screen Coronavirus Disease 2019
Pneumonia. arXiv preprint arXiv:200209334. 2020.
5. Shan+ F, Gao+ Y, Wang J, Shi W, Shi N, Han M, et al. Lung Infection Quantification of COVID-19 in CT
Images with Deep Learning. arXiv preprint arXiv:200304655. 2020.
6. : Societa Italiana di Radiologia Medica e Interventistica; 2020 [Available from: https://www.sirm.org/.
7. Clausi DA. An analysis of co-occurrence texture statistics as a function of grey level quantization.
Canadian Journal of remote sensing. 2002;28(1):45-62.
8. Haralick RM, Shanmugam K, Dinstein IH. Textural features for image classification. IEEE Transactions on
systems, man, and cybernetics. 1973(6):610-21.
9. Soh L-K, Tsatsoulis C. Texture analysis of SAR sea ice imagery using gray level co-occurrence matrices.
IEEE Transactions on geoscience and remote sensing. 1999;37(2):780-95.
10. Chakraborti T, McCane B, Mills S, Pal U. Loop descriptor: Local optimal-oriented pattern. IEEE Signal
Processing Letters. 2018;25(5):635-9.
11. Sohail ASM, Bhattacharya P, Mudur SP, Krishnamurthy S, editors. Local relative GLRLM-based texture
feature extraction for classifying ultrasound medical images. 2011 24th Canadian Conference on Electrical and
Computer Engineering (CCECE); 2011: IEEE.
12. Thibault G, Angulo J, Meyer F. Advanced statistical matrices for texture characterization: application to
cell classification. IEEE Transactions on Biomedical Engineering. 2013;61(3):630-7.
13. Shensa MJ. The discrete wavelet transform: wedding the a trous and Mallat algorithms. IEEE Transactions
on signal processing. 1992;40(10):2464-82.
14. Kulkarni SR, Harman G. Statistical learning theory: a tutorial. Wiley Interdisciplinary Reviews:
Computational Statistics. 2011;3(6):543-56.
9
15. Ruuska S, Hämäläinen W, Kajava S, Mughal M, Matilainen P, Mononen J. Evaluation of the confusion
matrix method in the validation of an automated system for measuring feeding behaviour of cattle. Behavioural
processes. 2018;148:56-62.
10