The novel coronavirus disease 2019, also known as COVID-19 outbreak first noted in Wuhan in the end of 2019, has been spreading rapidly worldwide [1] . As an infectious disease, COVID-19 is caused by severe acute respiratory syndrome coronavirus and presents with symptoms including fever, dry cough, shortness of breath, tiredness and so on. As the April 9th, over 1.5 million people around the world have been confirmed as COVID-19 infection with a case fatality rate of about 5.7 % according to the statistic of World Health Organization 1 .
So far, no specific treatment has proven effective for COVID-19. Therefore, accurate and rapid testing is extremely crucial for timely prevention of COVID-19 spread. Real-time reverse transcriptase polymerase chain reaction (RT-PCR) has been referred as the standard approach for testing COVID-19. However, RT-PCR testing is time-consuming and limited by the lack of supply test kits [2] , [3] . Moreover, RT-PCR X. Chen, L.Yao are with the School of Computer Science and Engineering at University of New South Wales, NSW 2052, Australia (e-mail: xiaocong.chen@unsw.edu.au, lina.yao@unsw.edu.au).
Y. Zhang is with the Department of Psychiatry and Behavioral Sciences at Stanford University, CA 94305, USA (email: yzhangsu@stanford.edu). 1 https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports has been reported to suffer from low sensitivity and repeated checking is typically needed for accurate confirmation of a COVID-19 case. This indicates that many patients will not be confirmed timely [4] , [5] , thereby resulting in a high risk of infecting a larger population.
In recent years, imaging technology has emerged as a promising tool for automatic quantification and diagnosis of various diseases. As a routine diagnostic tool for pneumonia, chest computed tomography (CT) imaging has been strongly recommended in suspected COVID-19 cases for both initial evaluation and follow-up. Chest CT scans were found very useful in detecting typical radiographic features of COVID-19 [6] . A systematic review [7] concluded that CT imaging of chest was found sensitive for checking COVID-19 even before some clinical symptoms were observed. Specifically, the imaging features including ground class opacification, consolidation, and pleural effusion have been frequently observed in the chest CT images scanned from COVID-19 patients [8]- [10] .
Accurate segmentation of these important radiographic features is crucial for a reliable quantification of COVID-19 infection in chest CT images. Segmentation of medical imaging needs to be manually annotated by well-trained expert radiologists. The rapidly increasing number of infected patients has caused tremendous burden for radiologists and slowed down the labeling of ground-truth mask. Thus, there is an urgent need for automated segmentation of infection regions, which is a basic but arduous task in the pipeline of computer-aided disease diagnosis [11] . However, automatically delineating the infection regions from the chest CT scans is considerably challenging because of the large variation in both position and shape across different patients and low contrast of the infection regions in CT images [2] .
Machine learning-based artificial intelligence provides a powerful technique for the design of data-driven methods in medical imaging analysis [10] . Developing advanced deep learning models would bring unique benefits to the rapid and automated segmentation of medical images [12] . So far, fully convolutional networks have proven superiority over other widely used registration-based approaches for segmentation [11] . In particular, U-Net models work decently well for most segmentation tasks in medical images [2] , [13] - [15] . However, several potential limitations of U-Net have not been effectively addressed yet. For example, the U-Net model is hard to capture the complex features such as multi-class image segmentation and recover the complex feature into the arXiv:2004.05645v1 [eess.IV] 12 Apr 2020 segmentation image [16] . There are also a few successful applications that adopt U-Net or its variants to implement the CT image segmentation, including heart segmentation [17] , liver segmentation [18] , or multi-organ segmentation [19] . However, segmentation of COVID-19 infection regions with deep learning remains under explored. The COVID-19 is a new disease but very similar with the common pneumonia in the medical imaging side, which makes its accurate quantification considerably challenging. Recent advancement of the deep learning method provide heaps of insightful ideas about improving the U-Net architecture. The most popular one is the deep residual network (ResNet) [20] . ResNet provided an elegant way to stacked CNN layers and demonstrate the strength when combined with U-Net [21] . On the other hand, attention was also applied to improve the U-Net and other deep learning models to boost the performance [16] , [22] .
Accordingly, we propose a novel deep learning model for rapid and accurate segmentation of COVID-19 infection regions in chest CT scans. Our developed model is based on the U-Net architecture, inspired with recent advancement in the deep learning field. We exploit both the residual network and attention mechanism to improve the efficacy of the U-Net. Experimental analysis is conducted with a public CT image dataset collected from patients infected with COVID-19 to assess the efficacy of the developed model. The outstanding performance demonstrates that our study provides a promising segmentation tool for the timely and reliable quantification of lung infection, toward to developing an effective pipeline for precious COVID-19 diagnosis.
The rest of the paper is summarized as follows. We first review some related work about existing deep learning methods for CT image segmentation in Section II Related Work. Our proposed new deep learning model is detailedly described in Section III Methodology, including the U-Net structure, the methods used to improve the encoder and decoder. The experimental study and performance assessment are described in Section IV, followed by discussion and summary of our study.
This section will introduce our proposed Residual Attention U-Net for the lung CT image segmentation in detail. We start by describing the overall structure of the developed deep learning model followed by explaining the two improved components including aggregated residual block and locality sensitive hashing attention, as well as the training strategy. The overall flowchart is illustrated in Fig. 1 .
U-Net was first proposed by Ronneberger et al. [13] , which was basically a variant of fully convolutional networks (FCN) [23] . The traditional U-Net is a type of artificial neural network (ANN) containing a set of convolutional layers and deconvolutional layers to perform the task of biomedical image segmentation. The structure of U-Net is symmetric with two parts: encoder and decoder. The encoder is designed to extract the spatial features from the original medical image.
The decoder is to construct the segmentation map from the extracted spatial features. The encoder follows the similar style like FCN with the combination of several convolutional layers. To be specific, the encoder consists of a sequence of blocks for down-sampling operations, with each block including two 3×3 convolution layers followed by a 2×2 max-pooling layers with stride of 2. The number of filters in the convolutional layers is doubled after each down-sampling operation. In the end, the encoder adopts two 3 × 3 convolutional layers as the bridge to connect with the decoder.
Differently, the decoder is designed for up-sampling and constructing the segmentation image. The decoder first utilizes the a 2×2 deconvolutional layer to up-sample the feature map generated by the encoder. The deconvolutional layer developed by Zeiler et al. [24] contains the transposed convolution operation and will half the number of filters in the output. It is followed by a sequence of up-sampling blocks which consist two 3 × 3 convolution layers and a deconvolutional layer. Then, a 1 × 1 convolutional layer is used as the final layer to generate the segmentation result. The final layer adopted Sigmoid function as the activation function while all other layers used ReLU function.The ReLU and the Sigmoid functions are defined as:
In addition, the U-Net concatenates part of the encoder features with the decoder. For each block in encoder, the result of the convolution before the max-pooling is transferred to decoder symmetrically. In decoder, each block receives the feature representation learned from encoder, and concatenates them with the output of deconvolutional layer. The concatenated result is then forwardly propagated to the consecutive block. This concatenation operation is useful for the decoder to capture the possible lost features by the max-pooling.
As mentioned in previous section, the U-Net only have four blocks of convolution layers to conduct the feature extraction. The conventional structure may not be sufficient for the complex medical image analysis such as multi-class image segmentation in lung, which is the aim for this study. Although U-Net can easily separate the lung in a CT image, it may have limited ability to distinguish the difference infection regions of the lung which infected by COVID-19. Based on this case, the deeper network is needed with more layers, especially for the encoding process. However, when deeper network converging, a problem will be exposed: with increasing of the network depth, accuracy gets very high and then decrease rapidly. This problem is be defined as degradation problem [25] , [26] . He et al. proposed the ResNet [20] to mitigate the effect of network degradation on model learning. ResNet utilizes a skip connection with residual learning to overcome the degradation and avoid estimating a large number parameters generated by the convolutional layer. The typical ResNet block is depicted as Fig. 2 Here the variable i is the D-dimension representation of the input image or features map. The skip connection is performed as the identity mapping, the output of the identity mapping will be added to the output of the stacked layers.
is the trainable weight for the weight layer. Different from the U-Net that concatenates the features map into decoding process, ResNet adopts the shortcut to add the identity into the output of each block. The stacked residual block is able to better learn the latent representation of the input CT image. However, the model comes more complex and hard to converge as the increase in the number of layers. Regarding this, Xie et al. proposed Aggregated Residual Network(ResNeXt) and showed that increasing the cardinality was more useful than increasing the depth or width [27] . The cardinality is defined as the set of the Aggregated Residual transformations with formulation as follows:
where C is the number of residual transformation to be aggregated and T j (i) can be any function. Considering a simple neuron, T j should be a transformation projecting i into an low-dimensional embedding ideally and then transforming it. Accordingly, we can extend it into the residual function:
where the y is the output. The ResNeXt block is visualized in Fig. 3 . Compared with the Fig. 2 , the ResNeXt has a slightly different structure. The weight layer's size is smaller than ResNet as ResNeXt use the cardinality to reduce the number of layers but keep the performance. One thing is wroth to mention that the three small blocks inside the ResNeXt block need to have the some topology, in the other words, they should be topologically equivalent. which captured by each step and is generally more robust than directly make the spatial transformation to the input. Mathematically, we can treat the global averaging pooling layer as a structural regularizer that are helpful for driving the desired feature maps [28] . Importantly, instead of using the encoder in the U-Net, our proposed deep learning model adopts the ResNeXt block (see Fig. 3 ) to conduct the features extraction. The ResNeXt provides a solution which can prevent the network goes very deeper but remain the performance. In addition, the training cost of ResNeXt is better than ResNet.
The decoder in U-Net is used to up-sampling the extracted feature map to generate the segmentation image. However, due to the capability of the convolutional neural network, it may not able to capture the complex features if the network structure is not deep enough. In recent years, transformers [29] have gained increasingly interest [30] . The key of the success is the attention mechanism [31] . Attention includes two different mechanisms: soft attention and hard attention. We adopt the soft attention to improve the model learning. Different the hard attention, the soft attention can let model focus on each pixel's relative position, but the hard attention only can focus on the absolute position. There are two different types of soft attention: Scaled Dot-Product Attention and Multi-Head Attention as shown in Fig. 4 . The scaled dot-product attention takes the inputs including a query Q, a key K n of the n-dimension and a value V m of the m-dimension. The dot-product attention is defined as follows:
where K T n represent to the transpose of the matrix K n and √ n is a scaling factor. The softmax function σ(z) with z = [z 1 , · · · , z n ] ∈ R n is given by:
for i = 1, · · · , n Vaswani et al. [31] mentioned that, perform different linearly project of the queries Q, keys K and values V in parallel h layers will benefit the attention score calculation. We can assume that Q, K and V have been linearly projected to d k , d k , d v dimensions, respectively. It is worth noting that these linear projections are different and learnable. On each projection p, we have a pair of query, key and value Q p , K p , V p to conduct the attention calculation in parallel, which results in a d v -dimensional output. The calculation can be formulated as: However, the multi-head attention is memory inefficient due to the size of Q, K and V . Assume that the Q, K, V have the shape [|batch|, length, d model ] where | · | represents the size of the variable. The term QK T will produce a tensor in shape [length, length, d model ]. Given the standard image size, the length × length will take most of the memory. Kitaev et al. [32] proposed a Locality Sensitive Hashing(LSH) based Attention to address this issue. Firstly, we rewire the basic attention formula into each query position i in the partition form:
where the function z is the partition function, P i is the set which query position i attends to. During model training, we normally conduct the batching and assume that there is a larger set P L i = {0, 1, · · · , l} ⊇ P i without considering elements not in P i :
Then, with a hash function h(·): h(q i ) = h(k j ), we can get P i as:
In order to guarantee that the number of keys can uniqually match with the number of quires, we need to ensure that h(q i ) = h(k i ) where k i = qi qi . During the hashing process, some similar items may fall in different buckets because of the hashing. The multi-round hashing provides an effective way to overcome this issue. Suppose there is n r round, and each round has different hash functions {h 1 , · · · , h nr }, so we have:
Considering the batching case, we need to get the P L i for each round g:
where m = 2l nr . The last step is to calculate the LSH attention score in parallel. With the formula (1) and (3), we can derive:
The task of the lung CT image segmentation is to predict if each pixel of the given image belongs to a predefined class or the background. Therefore, the traditional medical image segmentation problem comes to a binary pixel-wise classification problem. However, in this study, we are focusing on the multi-class image segmentation, which can be concluded as a multi-classes pixel-wise classification. Hence, we choose the multi-class cross entropy as the loss function:
where y o,c is a binary value which use to compare the correct class c and observation class o, p o,c is a probability of the observation o to correct class c and M is the number of classes.
We used COVID-19 CT images collected by Italian Society of Medical and Interventional Radiology (SIRM) 2 for our experimental study. The dataset included 110 axial CT images collected from 60 patients. These images were reversely intensity-normalized by taking RGB-values from the JPGimages from areas of air (either externally from the patient or in the trachea) and fat (subcutaneous fat from the chest wall or pericardial fat) and used to establish the unified Houndsfield Unit-scale (the air was normalized to -1000, fat to -100). The ground-truth segmentation was done by a trained radiologist using MedSeg 3 with three labels: 1 = ground class opacification, 2 = consolidations, and 3 = pleural effusions. A total of 100 samples that have both preprocessed CT images and masks were used for our experimental analysis. These data are publicly available 4 .
The original CT images have the size of 512 × 512. We use the opencv2 5 to convert the images into size of 369 × 369 and grey scale. This processing is helpful to automatically minimize the effects of the black frame in the images and some random noises (e.g., words) on the segmentation.
As our model is based on deep learning, the number of samples will affect the performance significantly. Consider about the size of the dataset, data augmentation is necessary for training the neural network to achieve high generalizability. Our study implements parameterized transformations to realize data augmentation in this study. We rotate the existing images 90 degrees, 180 degrees and 270 degrees to generate another 300 examples. We can easily generate the corresponding mask by rotating with the same degrees. Scaling have the some property with the rotation, so we just scale the image to 0.5 and 1.5 separately to generate another 200 images and its corresponding masks.
For the model training, we use the Adma [33] as the optimizer. For a fair comparison, we train our model and the U-Net with the default parameter in 100 epochs. Both models are trained under data augmentation and non-augmentation cases. We conducted the experimental analyses on our own server consisting of two 12-core/ 24-thread Intel(R) Xeon(R) CPU E5-2697 v2 CPUs, 6 NVIDIA TITAN X Pascal GPUs, 2 NVIDIA TITAN RTX, a total 768 GiB memory.
In a segmentation task, especially for the multi-class image segmentation, the target area of interest may take a trivial part of the whole image. Thus, we adopt the Dice Score, accuracy, and precision as the measure metrics. The dice score is defined as:
where X, Y are two sets, and | · | calculates the number of element in a set. Assume Y is the correct result of the test and X is the predicted result. We conduct the experimental comparison based on a 10-fold cross-validation for performance assessment.
The figure 5 provides two examples about the result images which have data augmentation. The table I shows the measure metric for our proposed model and the U-Net in with data augmentation case and no data augmentation case. Based on this table, we can easily find that our proposed method is outperformed than U-Net which the improvement is at least 10% in all three measure metrics. As shown in figure 2 (h), we find that the original U-Net almost failed to do the segmentation. The most possible reason is that, the range of interest is very small, and the U-Net do not have enough capability to distinguish those trivial difference. The images (b) and (f) are the ground-truth masks for these two scans, where the yellow represents the consolidation, blue represents pleural effusion and green corresponds to ground-glass opacities. The images (c) and (g) are the segmentation results generated by our model where the blue represents the consolidation and brown represents the pleural effusion and sky-blue for the ground-glass opacities. The images (d) and (h) are the outputs of the U-Net. In order to make the visualization clear, we choose the light gray as the color for the background segment.
In addition to the above-mentioned results, we are also interested in the effectiveness of each component in the proposed model. Accordingly, we conduct the ablation study about the ResNeXt and Attention separately to investigate how these components would affect the segmentation performance. To ensure a fair experimental comparison, we conduct the ablation study in the exactly same experiment environment with our main experiments presented in section III-C. We implement the ablation study on two variants of our model: Model without Attention and Model without ResNeXt. Our model without ResNeXt is similar with literature [16] . We just use the M-R to represent it. The results are summarized in Table II , where M-A represents the model without attention and M-R represents the model without ResNeXt block. We can observe that both the attention and ResNeXt blocks play important roles in our model and contribute to derive improved segmentation performance in comparison with U-Net.
Up to now, the most common screening tool for COVID-19 is the CT imaging. It can help community to accelerate the speed of diagnose and accurately evaluate the severity of COVID-19 [2] . In this paper, we presented a novel deep learning-based algorithm for automated segmentation of COVID-19 CT images, which is proved to be plausible and superior comparing to a series of baselines. We proposed a modified U-Net model by exploiting residual network to enhance the feature extraction. An efficient attention mechanism was further embedded into the decoding process to generate the high-quality multi-class segmentation results. Our method gained more than 10% improvement in multi-class segmentation when comparing against U-Net and a set of baselines.
Recent study shows that the early detection of the COVID-19 is very important [34] . If the infection in chest CT image can be detected at early stage, the patients would have the higher chance to survive [35] . Our study provides an effective tool for the radiologist to precisely determine the lung's infection percentage and diagnose the progression of COVID-19. It also shed some light on how deep learning can revolutionize the diagnosis and treatment in the midst of COVID-19.
Our future work would be generalizing the proposed model into a wider range of practical scenarios, such as facilitating with diagnosing more types of diseases from CT images. In particularly, in the case of a new disease, such as the coronavirus, the amount of ground truth data is usually limited given the difficulty of data acquisition and annotation. The model is capable of generalizing and adapting itself usingonly a few available ground-truth samples. A knowledge-based generative model [36] will be integrated to enhance the ability in handling new tasks. Another line of future work lies in the interpretability, which is specially critical for the medical domain applications. Although deep learning is widely accepted to its limitation in interpretability, the attention mechanism we proposed in this work can produce the interpretation of internal decision process at some levels. To gain deeper scientific insights, we will keep working along with this direction and explore the hybrid attention model for generating meaningfully semantic explanations.