Full text
MENDEL — Soft Computing Journal, Volume 23, No.gk, .2+2K#2` 202k, Brno, Czech RepublicX ISSN: 1803-3814 (Printed), 2571-3701 (Online) https://doi.org/10.13164/mendel.202k.k.049 Segmentation of Chest X-Ray Images Using U-Net Model Sahar A. Hashem1, Mohammed Y. Kamil1, 1College of Science, Mustansiriyah University, Baghdad, Iraq saha[email protected], [email protected] Abstract Medical imaging, such as chest X-rays, gives an acceptable image of lung functions. Manipulating these images by a radiologist is difficult, thus delaying the diagnosis. Coronavirus is a disease that affects the lung area. Lung segmentation has a significant function in assessing lung disorders. The process of segmentation has seen the widespread use of deep learning algorithms. The U-Net is one of the most significant semantic segmentation frameworks for a convolutional neural network. In this paper, the proposed U-Net architecture is evaluated on datasets of 565 X-ray images, divided into 500 training images and 65 validation images. The findings of the experiments demonstrated that the suggested strategy successfully achieved competitive outcomes with 91.47% and 89.18% accuracy, 0.7494 and 0.7480 IoU, 19.23% and 26.11% loss for training and validation images, respectively. Keywords: U-Net, Segmentation, Deep learning, Coronavirus, Lung, X-ray, CNN. Received: 26 August 2022 Accepted: 17 November 2022 Online: 28 November 2022 Published: 20 December 2022 1 Introduction COVID-19 is a novel kind of infectious respiratory illness that represents a significant risk to the continued existence of human beings in every region of the earth [24]. It is a prevalent disease that kills thousands of people every day. The enormous number of people infected with COVID-19 is putting a strain on the healthcare systems of many different nations [21]. COVID-19 commenced in Wuhan, China, in December 2019. Human-to-human transmission has caused 179,111 confirmed cases and 7,426 fatalities by 17 March 2020. After the virus has infected the cells lining the throat, trachea, and lung, they are transformed into ”coronavirus factories,” which are responsible for producing massive quantities of different viruses that infect more cells [2]. A few prominent imaging characteristics are diagnostic of the virus-like chest X-ray (CXR); due to the overlapping lung images caused by viral pneumonia, it is difficult for clinicians working alone to determine whether or not patients are infected with the virus. So, artificial intelligence (AI) technology was used [1]. In the field of medical image processing, several outstanding convolutional neural networks (CNNs) have been implemented, and as a result, the most advanced performance possible has been attained [7,11,15]. Researchers used the U-net model and its application to the lung segmentation process utilizing X-rays. X. Chen et al. (2020) [3] proposed U-NET with aggregated Resnet and locality-sensitive Hashing Attention modules to automatically divide multiple COVID-19 infection areas using the SIRM dataset, including 110 CT scans. The image had 512×512 pixels, but it was converted to 369×369 pixels and concluded that Dicecoefficient (DSC) of 94.0%, accuracy of 89.0%, and precision of 95.0%. Q. Yan et al. (2020) [22] presented encoder-decoder architecture with a feature variation block to improve a progressive atrous spatial pyramid pooling (ASPP) and feature representation. It firstly maintains a new CT scan for the chest of 861 patients on a private dataset. It consists of 21,658 images with a thickness of 0.62510 mm. All images were rebuilt using a medium-sharp method, so the total number of images for training was 731. The remaining 130 for the testing set came to be DSC of 72.6%, sensitivity of 75.1%, and precision of 72.6%. F. Munawar et al. (2020) [10] proposed a U-Net model on chest x-ray for lung segmentation using generative adversarial networks with numerous discriminators for comparative research and improved performance. The proposed model can get a DSC value of 97.4% and an Intersection-Over-Union (IoU) value of 0.943, according to tests on three different CXR datasets. Y.Li et al. (2021) [8] suggested a hybrid method for lung segmentation by integrating a conditional random field and dense-U-Net network. The method was implemented on the Japanese society of radiological technology dataset that consisted of 247 chest images with size of 2048×2048 pixels and compared with previous common methods. The method was shown a higher DSC of 97.8±0.8 and Jaccard index (JSC) of 95.6±1.9. M. F. Rahman et al. (2021) [14] proposed a framework by two-step based on U-Net to segment the lung. In the first step, they extracted CXR patches and trained a modified U-Net model to create an initial lung field segmentation. Image processing techniques were used in the second step to get a precise final segmentation, and it achieved 91.37% for JSC and 94.21% for DSC on 138 CXR image datasets. 49
MENDEL — Soft Computing Journal, Volume 23, No.gk, .2+2K#2` 202k, Brno, Czech RepublicX Figure 1: U-Net architecture X. Zhang et al. (2021) [23] presented a new explainable deep learning system (CXRNet) for reliable COVID-19 pneumonia identification using CXR images with increased pixel-level visual explanation. The system was implemented on private and public datasets, including 6499 CXR images of COVID-19 pneumonia, viral pneumonia, and healthy pneumonia. The system achieved of accuracy score of COVID-19 reached 87.9%. A. Saood and I. Hatem (2021) [18] proposed U-net and Seg-net models to compare the segmentation performance of the COVID-19 CT scan. Both networks were used to distinguish infected from healthy lung tissue. The images from the Italian Society of Medical and Interventional Radiology 100 CT scans were reduced to 512×512 pixels. The result showed that SegNet has a greater capacity in categorizing infected/noninfected tissues with 95% accuracy. In contrast, U-net exhibits better results with 0.91 mean accuracy. K. Furutani et al.(2022) [6] used the U-Net model to isolate whole lung areas using CRX images as a source; they used 80 CXR images consisting of 30 and 50 images divided into training and testing data. It showed that the DSC was used to evaluate the degree of similarity between the lung area that was retrieved by the suggested approach and the ground truth. The DSC for the sample data has 0.91±0.04. The objective of this study is to improve the segmentation of CXR images by enhancing the traditional U-Net structure. The rest of this paper is organized as follows: Section 2 presents detailed background information about U-Net architecture. Section 3 covers the dataset’s source and how it is organized. Section 4 provides the findings and analysis of the suggested model. In the last section, Section 5, we state the most critical conclusions that have been discovered. 2 Method U-Net is a widely used model for image segmentation that has previously shown exceptional segmentation performance on various image types and datasets [19]. It is a general deep-learning solution for common quantification problems in biomedical image data, such as cell recognition and shape measurements [4]. A fully convolutional network that has been improved needs fewer training sets and does a better job of segmenting than convolutional neural networks that came before it [9]. A U-Net architecture is divided into two paths: the contracting (encoder) and the expanding (decoder) path. The contracting has a modular structure that is made up of convolution blocks that are repeated over and again. Each block consists of two smaller blocks of transformations that are interconnected. It is used to get context information composed of a recurrent 3×3 convolution kernel and a 2×2 maximum pooling layer. The number of conventional channels would be doubled after each sample if ReLu were used. While the expanding path is utilized to achieve accurate location information where the number of normal channels is decreased by half with each deconvolution step. After that, the results are spliced with the feature graph associated with the contraction route; finally, the spliced feature graph is convolved twice by 3×3 to get the final result. When the expanding route reaches its final layer, the 1×1 convolution kernel is used in order to map each 2-bit eigenvector onto the network’s output layer, which is the final layer of the network. The Sigmoid function and the cross-entropy function are employed as the activation function of neurons and the cost function, respectively. These two functions may both boost the speed of weight updating, which will, in turn, improve the training speed of the network effectively [9]. Fig. 1 shows the proposed U-Net architecture. Each blue box indicates a multichannel feature map. On the top of the box, there is a channel number indication. At the bottom left corner of the box, the x-y size is displayed. White boxes represent copied feature maps. A series of arrows represent the various operations. 50
MENDEL — Soft Computing Journal, Volume 23, No.gk, .2+2K#2` 202k, Brno, Czech RepublicX Kamil-g2igHX,gS egmentation of Chest X-Ray Images Using U-Net Model 3 Dataset Description Coronavirus has been the most common disease for three years, and manually evaluating photographs is time-consuming. An algorithm might boost efficiency, improve performance, and minimize costs. The data were selected for the infected person, containing 565 images for the lung by CXR (chest x-ray), 500 trained images with its masks, and 65 images for testing; these images are taken from public sources for international hospitals. The datasets used during the present study are available in the Kaggle repository1. Fig. 2 shows a sample of x-ray images for the lung, with the mask specific to each one by doctor’s diagnosis. (a) Images (b) Masks Figure 2: A sample of images from the current dataset 4 Results and Discussion IoU (Jaccard Index) is a crucial parameter for evaluating our approach since it reflects the proportion of properly segmented lung pixels directly connected to our work’s purpose [12]. IoU is the region of overlap between the ground truth (Ptrue) and the predicted segmentation (PPredicted), divided by the union area between the two. The IoU is computed using the fol1https://www.kaggle.com/datasets/azkihimmawan/ chest-xray-masks-and-defect-detection lowing formula: IoU = Ptrue ∩Ppredicted Ptrue ∪Ppredicted IoU has a value between 0 and 1 (0-100%), where 0 denotes no overlap and 1 denotes perfectly overlapping segmentation [13]. Additionally, we assess our model on a validation dataset using accuracy. The accuracy measure evaluates the ratio of correctly predicted samples to the total number of samples [5]. It is measurable as: Accuracy =True Positive+True Negative True Positive+True Negative+False Positive The U-Net model was trained on the Google Colab framework using Python language via Keras and TensorFlow. All experiments were executed on GPU, with the training time being 52 sec. Adam was our preferred optimizer since it combines the advantages of RMSProp and AdaGrad. In this case, Adam scales the learning rate using square gradients, and Momentum is implemented by utilizing the moving average of the gradient rather than the gradient itself. We have a dropout layer, a convolution in two dimensions, and a padding layer for each layer. The dropout layer prevents the model from overfitting and increases its generalization ability. We randomly chose 565 training and validation images in this research to segment the lung region. The performance of the models was evaluated based on their accuracy, IOU, and loss function. Table 1 states the algorithm’s results based on accuracy, IOU, and loss values. Table 1: The evaluation that used in our segmentation for training and validation images No. of Accuracy % IoU Loss % images training 500 91.47 0.7494 19.23 validation 65 89.18 0.7480 26.11 The implementation was given a total of 25 epochs of training. The evaluation was performed on the validation set. Fig. 3 shows the model’s accuracy, with an apparent increase in the accuracy values. The accuracy value in training at 91.47%, while in validation at 89.18% for 25 epochs. Fig. 4 provides the experimental data for IOU. It is apparent that there were significant differences between training and validation values at 1-4 epochs, but there was a positive correlation development at epoch five onwards. IoU value in training at 0.7494, while in validation at 0.7480. The loss value consistently achieves the best results for all segmentation challenges. The differences in the values of the loss function are shown in Fig. 5. The loss value in training was 19.23%, while in validation, it was 26.11% for 25 epochs. Although the lung regions were extracted correctly in most cases, there were rare instances where the lung regions had been over-extracted or under-extracted. The less-extracted parts were seen 51
MENDEL — Soft Computing Journal, Volume 28, No. 2, December 2022, Brno, Czech RepublicX largely around the outside borders of lung regions and at the bifurcation of lung vessels. In contrast, the over-extracted regions were mostly found near the outer edges of the lung and stomach regions. These areas have the characteristics of having low contrast or being related to other low contrast regions via low contrast regions and having values that fall between those of lung regions and muscle regions. Given that the areas are smaller than other lung regions, the suggested approach may not have enough data to fully extract these regions. It may be necessary to expand the data further and add more CXR pictures to the training set to overcome this issue. Figure 3: Accuracy values for model Figure 4: IoU values for model Figure 5: Loss values for model Finally, Table 2 compares different studies executed on chest X-ray images. The comparison was evaluated on a score of accuracy and IoU. It should be noted that it is difficult to compare directly because of the discrepancy between the data sets (for example, the number of images). But, in general, our work performed better Table 2: Comparison of our proposed model with other studies Authors No. of Dataset Accuracy % IoU images source 247 Japanese 97.1 95.1 Rashid et society of al. [17] radiological technology Waiker et 138 Montgomery - 94.0 al. [20] Rahman et 138 Montgomery - 91.37 al. [14] Rajaraman et 326 Shenzhen - 61.6 al. [16] Our work 565 Shenzhen + 91.47 74.94 Montgomery than other works, indicating the reliability and robustness of the proposed model. 5 Conclusion Medical image analysis and processing significantly impact clinical applications and scientific research. The use of deep learning may provide novel concepts for medical image interpretation. The U-Net network structure is used to segment these images, and the results showed that its performance is high in medical image segmentation data sets, specifically in CXR. This lays the groundwork for future accurate pathologic diagnoses by physicians. In the future, we suggest examining the applicability of other image formats for lung segmentation. References [1] Alquran, H., Alsleti, M., Alsharif, R., Qasmieh, I. A., Alqudah, A. M., and Harun, N. H. B. Employing texture features of chest xray images and machine learning in covid-19 detection and classification. MENDEL Journal 27, 1 (2021), 9–17. [2] Amami, R., Al Saif, S. A., Amami, R., Eleraky, H. A., Melouli, F., and Baazaoui, M. The use of an incremental learning algorithm for diagnosing covid-19 from chest x-ray images. MENDEL Journal 28, 1 (2022), 1–7. [3] Chen, X., Yao, L., and Zhang, Y. Residual attention u-net for automated multi-class segmentation of covid-19 chest ct images. arXiv preprint arXiv:2004.05645 (2020). [4] Falk, T., Mai, D., Bensch, R., C¸ ic¸ek, ¨ O., Abdulkadir, A., Marrakchi, Y., B¨ ohm, A., Deubner, J., J¨ ackel, Z., Seiwald, K., et al. U-net: deep learning for cell counting, detection, and morphometry. Nature methods 16, 1 (2019), 67–70. [5] Fernandez-Moral, E., Martins, R., Wolf, D., and Rives, P. A new metric for evaluating semantic segmentation: leveraging global and contour accuracy. In 2018 IEEE intelligent vehicles symposium (iv) (2018), IEEE, pp. 1051–1056. 52
MENDEL — Soft Computing Journal, Volume 28, No. 2, December 2022, Brno, Czech RepublicX Kamil, et al.: S egmentation of Chest X-Ray Images Using U-Net Model [6] Furutani, K., Hirano, Y., and Kido, S. Segmentation of lung region from chest x-ray images using u-net. In International Forum on Medical Imaging in Asia 2019 (2019), vol. 11050, SPIE, pp. 165–169. [7] Kamil, M. Y. Morphological gradient in brain magnetic resonance imaging based on intuitionistic fuzzy approach. In 2016 Al-Sadeq International Conference on Multidisciplinary in IT and Communication Science and Applications (AICMITCSA) (2016), IEEE, pp. 1–3. [8] Li, Y., Dong, X., Shi, W., Miao, Y., Yang, H., and Jiang, Z. Lung fields segmentation in chest radiographs using dense-u-net and fully connected crf. In Twelfth International Conference on Graphics and Image Processing (ICGIP 2020) (2021), vol. 11720, SPIE, pp. 297–304. [9] Liu, X., Zhang, Y., Jing, H., Wang, L., and Zhao, S. Ore image segmentation method using u-net and res unet convolutional networks. RSC advances 10, 16 (2020), 9396–9406. [10] Munawar, F., Azmat, S., Iqbal, T., Gr¨ onlund, C., and Ali, H. Segmentation of lungs in chest x-ray image using generative adversarial networks. IEEE Access 8 (2020), 153535– 153545. [11] Park, J., Yun, J., Kim, N., Park, B., Cho, Y., Park, H. J., Song, M., Lee, M., and Seo, J. B. Fully automated lung lobe segmentation in volumetric chest ct with 3d u-net: validation with intra-and extra-datasets. Journal of digital imaging 33, 1 (2020), 221–230. [12] Radhi, E. A., and Kamil, M. Y. Breast tumor detection via active contour technique. International Journal of Intelligent Engineering and Systems 14, 4 (2021), 561–570. [13] Radhi, E. A., and Kamil, M. Y. Breast tumor segmentation in mammography image via chanvese technique. Indonesian Journal of Electrical Engineering and Computer Science 22, 2 (2021), 809–817. [14] Rahman, M. F., Tseng, T.-L. B., Pokojovy, M., Qian, W., Totada, B., and Xu, H. An automatic approach to lung region segmentation in chest x-ray images using adapted u-net architecture. In Medical Imaging 2021: Physics of Medical Imaging (2021), vol. 11595, SPIE, pp. 894–901. [15] Rajakumar, G., Leela, R. S. J., Darney, P. E., Narayanan, K. L., Krishnan, R. S., and Robinson, Y. H. Seg-net: Automatic lung infection segmentation of covid-19 from ct images. In 2021 5th International Conference on Trends in Electronics and Informatics (ICOEI) (2021), IEEE, pp. 739–744. [16] Rajaraman, S., Folio, L. R., Dimperio, J., Alderson, P. O., and Antani, S. K. Improved semantic segmentation of tuberculosis—consistent findings in chest x-rays using augmented training of modality-specific u-net models with weak localizations. Diagnostics 11, 4 (2021), 616. [17] Rashid, R., Akram, M. U., and Hassan, T. Fully convolutional neural network for lungs segmentation from chest x-rays. In International Conference Image Analysis and Recognition (2018), Springer, pp. 71–80. [18] Saood, A., and Hatem, I. Covid-19 lung ct image segmentation using deep learning methods: U-net versus segnet. BMC Medical Imaging 21, 1 (2021), 1–10. [19] Shamsolmoali, P., Zareapoor, M., Wang, R., Zhou, H., and Yang, J. A novel deep structure u-net for sea-land segmentation in remote sensing images. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing 12, 9 (2019), 3219–3232. [20] Waiker, D., Baghel, P. D., Varma, K. R., and Sahu, S. P. Effective semantic segmentation of lung x-ray images using u-net architecture. In 2020 Fourth International Conference on Computing Methodologies and Communication (ICCMC) (2020), IEEE, pp. 603–607. [21] Xie, F., Huang, Z., Shi, Z., Wang, T., Song, G., Wang, B., and Liu, Z. Duda-net: a double u-shaped dilated attention network for automatic infection area segmentation in covid-19 lung ct images. International Journal of Computer Assisted Radiology and Surgery 16, 9 (2021), 1425–1434. [22] Yan, Q., Wang, B., Gong, D., Luo, C., Zhao, W., Shen, J., Shi, Q., Jin, S., Zhang, L., and You, Z. Covid-19 chest ct image segmentation–a deep convolutional neural network solution. arXiv preprint arXiv:2004.10987 (2020). [23] Zhang, X., Han, L., Sobeih, T., Han, L., Dempsey, N., Lechareas, S., Tridente, A., Chen, H., and White, S. Cxr-net: An encoderdecoder-encoder multitask deep neural network for explainable and accurate diagnosis of covid19 pneumonia with chest x-ray images. arXiv preprint arXiv:2110.10813 (2021). [24] Zhang, X., Wang, G., and Zhao, S.-G. Covseg-net: A deep convolution neural network for covid-19 lung ct image segmentation. International Journal of Imaging Systems and Technology 31, 3 (2021), 1071–1086. 53