Automated Lung Semantic Segmentation on X-Ray Using Convolutional Models

. Towards the culmination of 2019, an outburst of coronavirus disease 2019 (COVID-19) pandemic struck mankind, which was instigated due to severe acute respiratory syndrome (SARS) which originally transpired from Wuhan City, China. Myriad of people have acceded to this disease. The effects of the pandemic have been more severe on the populous nations of the world. In India, although over 1.5 billion vaccinations have been provided to the inhabitants, as of 21 February 2022, the pandemic has barely diminished, as seen in Figure 1.1. While restrictions are being somewhat relaxed, the chances of the ominous ’4th wave’ materialises large. In such scenarios, it is of supreme importance to have apparatus for rapid testing and diagnosis of the disease, to expedite a much faster process. This paper will give an insight of a model that can efficiently and precisely predict the presence of COVID-19 by using a CT scan of the lungs.


INTRODUCTION
The novel coronavirus baptised SARS-CoV-2 primarily broke out in Wuhan, China, in December 2019, and has since conquered most of the countries across the globe. By infiltrating the respiratory tracts, the virus produces respiratory syndromes. As of now, the pre-existing prognosis and diagnosis techniques are too tender-some, and are quite often, imprecise. Normally, the CT images are segmented physically but in case of Covid-19 contagion, the common assembly of the lung can be infected. Hence, manual semantic segmentation is not a feasible solution. Chest CT is evolving as a treasured diagnostic set-up for clinical administration of COVID-19 linked lung disease [10]. Lung CT image segmentation is a crucial step for lung semantic scrutiny, and is a preconditioned step to deliver a precise lung CT analysis. Therefore, in the proposed scheme we aim to employ CT (computer tomography) images. Our chief objective is to attain RGB images of the lungs of normal and affected patients, then perform necessary image analysis by applying segmentation, classification and regression to obtain the CT scan by means of DICOM images.  This paper is prearranged as follows: Section 1 deals with the pre-existing mechanisms, and the requirement for a technique to enhance the same. Section 2 deals with the overall principal locations to look out for within a CT scan. Section 3 is concerned with the overall operation of the proposed model followed by Section 4 which provides with analysis of the results obtained. Finally, Section 5 puts forth the conclusion and possible modifications and upgradations of this model.

MEANS OF COVID-19 DETECTION IN LUNGS
Computed tomography (CT) of the chest uses premier xray devices to figure out flaws found persistent with other imaging scans, and to help diagnose the motive behind remote, chest pain, fever, shortness of breath, coughs, and other chest related symptoms. CT scanning is instantaneous, non-invasive, effortless and accurate.
Since it can detect infinitesimal nodes in the lung, chest CT is especially competent for pinpointing lung cancer at its earliest, most curable stage. A CT scan generates images that can be reinvigorated across multiple dimensions and planes [3]. It can also produce ndimensional images, which is the rudimentary qualification. Chest CT scans have a very crucial aspect in the prognosis, diagnosis, and detection of complications in COVID-19. The following principle arraignments are intermittently realized in the chest CT scans of COVID-19 patients :  Ground-glass opacities (GGO) (bilateral, multifocal, subpleural, peripheral, posterior, medial and basal).  Bronchovascular thickening (in the lesion).  Traction bronchiectasis.  Air space consolidation. Ground glass opacities, i.e., GGO and consolidations are most regularly visualized in CT presentations, not enclosed to bilateral middle and lower lobe predominance and peripheral circulation (76-85 percent). The disease is broadly multifocal, although single lesions can be visualized on preliminary imaging. This is sometimes seen about 4 days post infection. In a active patient's CT scan, the heart takes up the center (in white) and is enclosed by darker shades, which is the lung. But in a COVID-19 infected lung, the scan shows whitish regions over the lungs, which are injuries/scars subordinated on the "alveoli" because of the COVID virus. Around 4-8 days post infection, there will be expulsion.
In Figure 2.1, one can observe the GGO designated by white arrow(s), chiefly in the lower-left lobe, but sometimes also in the right-middle lobe. Lower right lobe consolidation with air bronchogram is labelled with a black arrow [3] of crazy paving with septal thickening on top of a background of GGO. There are also bilateral infiltrates that are predominantly posterior. A reverse halo is also visualized in the CT scans of patients diagnosed with COVID-19 with lower attenuation centrally, as seen in Figure 2.3. It is normally observed in patients who have COVID-19 with organizing pneumonia. Crazy paving and GGO is also observed. About 13-14 days after the spread of the infection, a fullblown consolidation is realized. It is an infiltrate where vessels are not conspicuous. A reverse halo can also be visualized. It may be unilateral as well. When patients get really sick and get ARDS, Diffused Alveolar Damage (DAD) is detected and the trademark of DAD in pathology is surfactant annihilation. CT scans can aid in examination of COVID-19 in the appropriated ambience, and set a reference line for patients who are at risk for exposure, may benefit from suggesting alternate diagnosis and comorbidities in the vulnerable patients with COVID-19. Employing a CT scan is more preferred for our model, as they do not influence the contrast of the images, which can critically hinder with the precision of the proposed system. Since the images will be in .dcm file format, we will employ Micro-DICOM viewer for siphoning the same.  In this section, we will give a comprehensive interpretation of how our model will operate and an indepth reasoning of the technical aspects. Firstly, we are recommending the application of CT scans as a CT scan administers much more specific images with the acclimatization of tissues, bones and organs very well defined. This will be beneficial in training the model. The dataset used is LIDC (Lung Image Database Consortium), which consists of tomographic images (in DICOM format) with designated lesions. This is readily accessible on the internet, and is effective in lung segmentation as well as diagnosis. The dataset accommodates CT scans with 20 '. nii' files, each possessing around 180 images. It is a public access consortium founded by NCI and further advanced by FNIH [16]. It incorporates a sum total of 1018 reported cases. However, given that the dataset size aggregates to almost 125GB, an substitute dataset must be used. In this case, there is another dataset that can also be used to similar effects. This dataset contains chest CT scans of over 1000 patients diagnosed with COVID-19. It is an open repository base. It encompasses data of patients from March 2020 to January 2022 till date. The dataset subsists of grayscale images of size 512x512 pixels stored in DICOM form, i.e., with an extension of '.dcm'. Figure 3.1 maintains an instance of an image from the dataset as seen using MicroDICOM Viewer Software. The patient's confidentiality is abetted, while only revealing the enforced particulars compulsory to launch that this is the CT scan of a patient diagnosed with COVID-19. The CT scan evidently demonstrates the presence of GGOs, and reverse halo, signifying that the patient has been detected with Covid-19.

Image Segmentation Using Otsu's Binary Thresholding
For segmentation, we can employ marker-based Watershed Algorithm using "Otsu's Binary Thresholding". For this methodology, a greyscale input is needed, which implies we shall proselyte the DICOM image into grayscale [4]. Both these methods will develop a threshold automatically which curtails the demand for human interface. These trchniques will assist in retaining the essential lineaments, while cloaking the gratituous minutiae in the image. Otsu's approach desires to develop the image histogram and segment an image by diminishing the variation on each of the accessible classes. The histogram composed by these images accommodates two clear crests, characterising fluctuating intensity. The essential principle is separating the image histogram into a couple of clusters with a threshold defined as a result of minimization of the weighted variance of these classes. In Otsu's Binary Thresholding method, the general algorithm is as follows:  Process Input Image.  Obtain the pixel distribution in the image, i.e., obtain histogram.  Evaluate a threshold value.
If saturation is higher than the threshold value, convert the pixels into white regions, else convert the pixels into black regions.

Image Segmentation Using Otsu's Binary Thresholding
After the segmentation is done, we plan to detect the presence of COVID-19 in the lungs, by using CLAHE equalization. We plan to use this technique as it increases the contrast in images, making the detected locations more prominent, thereby improving the visibility of the same. As seen from Figure 3.3, we must first analyze the images, i.e., we must obtain the images from the dataset and perform segmentation in order to mask the unnecessary regions in the image. After this, we shall normalize the pixel values to a range within 0 and 1. This is a mandatory step before inputting the image to the deep learning model. Normalizing the pixel intensity will help avoid the effect of high frequency and very low frequency noise. It also ensures that the image is normally distributed. This will improve the convergence of the neural model. This is then subjected to CLAHE Equalization in conjunction with Interpolation. The equalized model is then sent to the ResNet50 deep learning model, where it undergoes MaxPooling, Filtering, Feature extraction, and so on. For the Deep Learning model, the ReLU activation function is the most preferred option as it is easy to train, and it is a high-performance function. The GRAD-CAM algorithm is used to generate a heat-map, which makes it easier to understand the strike points of the COVID-19 virus. This data is fed onto a ResNet50 model on the UNET base. Usually, a neural network model is trained via a stochastic gradient descent optimization algorithm while the weights are updated using the backpropagation of the perceptron error algorithm. For our model, either MSE or Cross-Entropy method can be employed. After this is done, then boundary loss segmentation is done as a finishing touch to help the model Figure 3.4: CNN Layered Classification [5] in recognizing the signs of Covid-19 easily. The model can then be compiled, trained and tested, to check if it's working as per expectations.

SIMULATION
For the implementation of our project, we will use TensorFlow 2.0, which supports both high-level and low-level APIs, and is written in python language. It runs effortlessly on both CPU and GPU. Our model is tested on an Intel i7-10750H CPU 12GB RAM with a GPU processor NVIDIA GeForce GTX 1650 with 6GB memory to run the huge dataset being employed without any issues. The Otsu's thresholding is carried out first, and is compared with other thresholding schemes to check which method is more appropriate, and this is seen in Figure 4.1. From this, it can be deduced that the Otsu's method provides a much clearer image with the contrasts clearly visible.

CONCLUSION AND FUTURE SCOPE
Radiological imaging provides a unique perspective in addition to the assessments done for the early prognosis and remedy of the disorder. Chest radiography or CT experiment can be subjected to certain irregularities withinside the lung related to disorders in comparison to a healthy patient's lung. Deep studying version or the CNN fashions are well-equipped in detecting COVID-19 lung segmentation and therefore the diagnostic accuracy price is pretty exorbitant. The version is a hit-to-hit upon consolidation areas and nodular opacities, which can be pathogenic findings of patients suffering from COVID-19, on X-ray radiography. In COVID-19, bilateral, decrease lobe, and peripheral involvement is observed, and the proposed version can identify localization of the lesion. These fashions are especially critical in figuring out early presence of COVID-19 victims. Early prognosis of the disorder is critical to offer on-the-spot remedy, and to prevent disorder transmission. The model can also can play a vital role in victims missing early symptoms. The medical and radiological pictures of higher-degree patients are more vulnerable. The function of deep studying models are more distinguished in screening and prognosis while the contamination is in its early stages. Technological advances have resulted in excellent image quality and reliability, and by turning to universal use in clinical medicine. Temporary repair improvements can be expected, with short rotation periods of less than 200 milliseconds, 80millisecond scan times in single-source systems and 40 milliseconds of dual-source systems, as well as additional protection from residual movement using integrated reconstruction methods. the movement of the remaining object in the calculation. The use of repetitive updates will continue to increase significantly as the algorithms become more robust and the rebuilding times become shorter. If X-ray detectors with the best holes and photon counters are readily available, they are likely to be introduced first for the intended purpose. It can be expected that they will produce significant improvements in the landscape, as well as in the capacity of detectives, especially among high frequencies. Low radiation exposure will be achieved by using these highly efficient detectors and advanced reconstruction algorithms. CT tools with a special purpose have been developed in recent years, mainly for research purposes but marketing has begun. If this trend continues, there will be an increased variety of CT scans that are still distributed in the clinic. Each of these may lead to new clinical use as other adjustments occur.