The coronavirus disease 2019 , caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), is an ongoing pandemic. By August 27, more than 24 million confirmed cases, and more than 830,000 deaths cases were reported in the world [1] . This has led to great public health concerns, and World Health Organization (WHO) declared the outbreak to be a Public Health Emergency of International Concern (PHEIC) on January 30, 2020 and recognized it as a pandemic on March 11, 2020 [2] , [3] .
For diagnosis of COVID-19, real-time reverse transcription polymerase chain reaction (RT-PCR) is regarded as the reference standard; however, recent studies addressed the importance of chest computed tomography (CT) examination in COVID-19 patients with false negative RT-PCR results [4] . In initial stages of COVID-19, bilateral multilobar ground-glass opacification (GGO) are common with a peripheral or posterior distribution, mainly in the lower lobes. In intermediate stage of disease, an increase in the number and size of GGOs and progressive transformation of GGO into multifocal consolidative opacities are visible day 10 after the symptom onset [5] . Imaging patterns corresponding to clinical improvement of COVID-19 usually occur after week 2 of the disease and include gradual resolution of consolidative opacities and decrease in the number of lesions and involved lobes [5] . Chest CT shows a low rate of missed diagnosis of COVID-19 (3.9%, 2/51) and may be useful as a standard method for the rapid diagnosis of COVID-19 [6] . We also provide the manually detected infected regions by a board-certified radiologist. As we can see the attention maps are mostly active around the infected regions.
Artificial Intelligence can help COVID-19 community by accurate segmentation of infections and automatic diagnosis and classification of X-ray and CT images. A number of studies aimed to separate COVID-19 patients from non-COVID-19 subjects (that include common pneumonia subjects and nonpneumonia subjects) [7] . Chen et al. [8] used CT images from 51 COVID-19 patients and 55 patients with other diseases to train a UNet++ based segmentation model for segmenting COVID-19 related lesions. They finally labeled each image based on the segmented lesions and reached 95.2% (Accuracy), 100% (Sensitivity), and 93.6% (Specificity). Jin et al. [9] used chest CT images from 496 COVID-19 patients with 1385 negative cases. They first segmented the lung using a 2D CNN based model and then found slices related to COVID-19. The model achieved sensitivity of 94.1%, specificity of 95.5%, and AUC of 0.979. In [10] , a similar strategy was taken in 3D format using U-Net+3D CNN based model (DeCoVNet) for segmentation and 3D CNN for classification. The model achieved a sensitivity of 90.7%, specificity of 91.1%, and AUC of 0.959. DeepPneumonia [11] was proposed using ResNet50 to detect patients with COVID-19 (88 patients) from bacteria pneumonia patients (101 patients) and 86 healthy people. They reached an accuracy of 86.0% for pneumonia classification (COVID-19 or bacterial pneumonia), and an accuracy of 94.0% for pneumonia diagnosis (COVID-19 or healthy).
In this work, we propose a deep learning framework to predict COVID-19 from the chest CT images directly. We propose to use an attentional residual convolutional network, which can better focus on the infected areas, leading to an accurate classification of COVID-19 cases. We train our model on a public dataset of COVID-19 CT images. Through experimental results, we show that the attention maps of this model are mostly active around the infected regions, which is really encouraging. This is shown for three sample COVID-19 images in Figure 1 .
We also perform a thorough experimental study, providing both quantitative and qualitative analysis. In terms of quantitative study, we report the model's sensitivity, specificity, receiver operating characteristic, precision-recall curve, as well as the distribution of predicted scores for both healthy and COVID-19 images. In terms of qualitative results, we visualize the attention maps of the trained model on some of the COVID-19 test image, and also provide the potentially infected regions by a visualization technique based on sliding window on the model predictions, and show that our model is mostly sensitive to the infected regions.
Here are the contribution of this paper:
• We proposed a framework based on attentional convolutional network, to predict COVID-19 from CT images.
• We provided a detailed analysis of the model, by looking at various qualitative and quantitative metrics, as well as comparison with baselines.
• We provide the visualization of the attention maps in the trained model, and show that the model is mostly sensitive to the infected areas.
• We also annotate the infected regions for a subset of COVID-19 images in this dataset with the help of a board-certified radiologist, and make them available publicly for other researchers to use them.
The structure of the rest of this paper is as follows. Section II provides the details of the proposed framework. In III, we provide an overview of the dataset used in this work, and its characteristics. Section IV provides the experimental studies and comparison with previous works. And finally the paper is concluded in Section V.
Deep learning based models have achieved promising results in various computer vision and medical image analysis problems in the past few years and have shown to beat classical statistical models based on hand-crafted features with a large margin in several studies [12] - [17] . They have also been used by several research groups recently, to detect and segment COVID-19 from medical images [18] - [21] . In this work we focused on a predictive model based on attentional covnolutional networks, to detect COVID-19 from CT images. Given the fact that COVID-19 infects local regions of Lung, we used a CNN model with attention mechanism to better focus on the infected areas, resulting in higher accuracy. Our model architecture is similar to residual attentional convolutional network, and its details is provided in the next part.
We adopt a residual attention model as our model architecture, which is a combination of multiple stacked residual modules empowered with attention-aware units. Each attention module is composed of two branches: trunk branch and mask branch. The trunk branch which is the upper branch of attention module is supposed to do the feature extraction and it can be based on a single block of any convolutional neural network [22] . The architecture of our model is shown in Figure  2 .
In this work, we use a single block of ResNet-56 as our attention module basic unit. Considering input x the output of trunk branch T(x) can be weighed using mask branch with the output of M(x), which is based on a encoder-decoder architecture. Therefore, the output of each attention module can be obtained as in Eq 1:
where i ranges over all spatial positions and c ∈ {1, . . . , C} is the index of the channel.
However, naive stacking of attention modules can lead to performance drop because dot production with mask range from zero to one will decrease the value of features in deep layers. The ability to train a complex neural network such as the aforementioned model that uses an stacking architecture is the intuition behind using a residual attention learning. Thus, the modified attention module output H can be written as follows:
where M(x) ranges from [0,1], and if M(x) is set to 0 we can obtain the original features F(x).
Additionally, the difference between the original ResNet and ours lies on the way residual learning is used. In the former one, residual learning is written as
where F i,c (x) estimates the residual function, and in the latter one, F i,c (x) is the features generated by our baseline CNN.
Soft mask branch is consisted of a bottom-up top-down fully convolutional network. In the bottom-up approach, it first extracts the global features of the whole image, and then it combines the extracted global features with the original feature maps using the top-down architecture. First, max pooling is performed to down sample the input image, following that several number of residual units are used. For the top-down part, the same number of linear interpolation (as max pooling) is used to not only keep the output size the same as input feature map but also to downsample them. Finally, following two consecutive 1x1 convolution layers, a Sigmoid activation function is applied to normalize the output between [0, 1]. A more understandable diagram of the identical mapping between the trunk branch and the mask branch is shown in Figure 3 . 
This study is performed on the publicly available SARS-CoV-2 CT scan dataset, which has been collected from real patients in the hospitals from Sao Paulo, Brazil [23]. It contains 2482 CT scan images in total, out of wchich 1252 are labeled as COVID-19, and 1230 belong to the people not infected by SARS-CoV-2. This data is divided into the training and test sets, with the exact number of samples provided in Table I . Eight sampels images from this dataset are shown in Figure  4 , from which four of them belong to COVID-19 patients, and the other four to the none-COVID cases. 
In this section we provide a detailed analysis of experimental studies performed for evaluating our classification framework. We present both qualitative and quantitative results, and also compare our results with some baseline. Before getting into the result details, we will provide a brief overview of popular metrics used for evaluating classification models, and also discuss about the hyper-parameters choice in our study.
We used two widely adopted metrics, for evaluating the performance of medical image classification models, sensitivity and specificity, as defined below:
where, TP (True Positive) is the number of correctly classified images of a class, FP (False Positive) is the number of the wrong classified images of a class, FN (False Negative) is the number of images of a class that have been detected as another class, and TN (True Negative) is the number of images that do not belong to a class and were not classified as belonging to that class. In a more medical-friendly language, test sensitivity is the ability of a test to correctly identify those with the disease (true positive rate), whereas test specificity is the ability of the test to correctly identify those without the disease (true negative rate).
Besides these metrics, we also look at the model performance in terms of ROC-curve, precision-recall curve, an histogram of predicted scores. The receiver operating characteristic curve (ROC curve ) shows the trade-off between the true positive rate (TPR) and the false positive rate (FPR) at various threshold settings. The true-positive rate is also known as sensitivity, recall, or probability of detection in machine learning. The false-positive rate is also known as the probability of false alarm and can be calculated as (1 specificity). The area under the ROC curve is AUC. The precision-recall curve is created by plotting precision against Recall for different threshold. A high area under the curve represents both high recall and high precision, where high precision relates to a low false positive rate, and high recall relates to a low false negative rate. High scores for both show that the classifier is returning accurate results (high precision), as well as returning a majority of all positive results (high recall).
Hyper-parameters play an important role in the performance of machine learning models, specially deep neural networks, and need to be tuned carefully. Hyper-parameter tuning can be done both automatically and manually. In our work, we manually tried several combinations of different hyper-parameters so that we can select the best option. We fixed the number of epochs to 100 and batch size to 16, and varied the other hyper-parameters. Form optimizer, RMSProp has shown to give us the best result, and for learning rate we achieved the best validation accuracy with a rate of 0.01. It is worth mentioning that although momentum-based nesterov accelerated stochastic gradient descent reaches an acceptable accuracy of 0.907, takes a long time to converge in comparison to other below optimisers. Our entire implementation is done in Keras with Tensorflow backend. 
As mentioned earlier, our model predicts a probability score which shows the likelihood of a sample belonging to COVID-19 class. The higher this score, the more likely the image to have COVID-19 infection. In this section we present the distribution of the predicted scores on the test set. Ideally we expect the model to predict a very high likelihood score (close to 1) for COVID-19 patients, while predicting low scores (close to 0) for healthy people. Figures 5 and 6 show the histogram of the predicted probabilities of both COVID-19 and Non-COVID cases on the test set. As it can be seen from these figures, our model does a good job of separating the scores of samples from each class. 
As it is clear, in order to decide if a sample is COVID-19, we can compare its predicted score with a cut-off threshold and if it is larger than threshold it will be labeled as COVID-19. Therefore, different cut-off thresholds can result on a different set of samples being considered as COVID-19, and this can lead to a trade-off between false positives and false negatives rates. The default cut-off threshold is usually set to 0.5, but that does not guarantee to achieve the best results. In order to find the best threshold value, we try different thresholds ranging from 0.1 to 0.9, and provide their performance in table III. Evaluating a model only by sensitivity and specificity metrics is difficult because these metrics are highly dependent on the threshold value that is used to tune the model performance. When we are dealing with a binary classification problem, we are concerned with two types of errors, false positive rate, and false negative rate. A better way to evaluate a model is to use some metrics which combines FPR and FNR, and gives us a global picture of the model. A common way to do so is the Receiver operating characteristic (ROC), which shows the true positive rate (y-axis) as a function of the false positive rate (x-axis) for various thresholds ranging from zero to one. The ROC curve of our model can be seen in Figure 7 . Another way to compare the performance of a model for all possible thresholds is through the precision-recall curve. Precision is defined as a ratio of the number of true positives divided by the sum of the positives. Recall or sensitivity is also calculated as a ratio of the number of true positive images divided by the sum of the total number of images regarded as true positive and false negative. The precision-recall curve of our model is illustrated in Figure 8 .
Furthermore, the exact number of images labeled either as COVID-19 cases or Non-COVID-19 cases in the test set can be seen in the confusion matrix provided in Figure 9 . 
To visualize the attention maps, we make use of Grad-CAM and also its generalized version called Grad-CAM++. Both of these methods are used as a visualization technique to calculate which of the spatial locations in convolutional layers are more important than others. This is done through computing the gradient of the output class prediction with respect to the feature maps of the desired convolutional layer. Grad-CAM++ makes use of a different derivation to address the shortcoming of the popularly used Grad-CAM, such as multiple occurrences of a class in an image [25] , [26] .
The visual generated by Grad-CAM and Grad-CAM++ of the third attention block layer of our model, for five sample images are shown in Figure 10 . With the help of a boardcertified radiologist, we also provide the manual regions which are likely to be infected with COVID-19 in these images two, and show them here. As we can see our model is very active around the infected areas, which is really encouraging. Fig. 10 . Visualization of the third attention block. The left-most column represents the original image, the second and third columns denote the attention maps using Grad-CAM method, and Grad-CAM++ respectively, and the last column shows the the annotated image by our radiologist.
We also used another simple technique (inspired by the work of Zeiler and Fergus [27] ) to show the potentially infected regions of each image, with a sliding window technique on the model predictions. This approach works by zeroing out an NxN patch in the original image, finding its impact on the model's prediction and seeing if that lead the model to make a mistake. If by occluding that region our model incorrectly classifies a COVID-19 image as Non-COVID, that region should be regarded as a potentially infected region in our CT images. On the other hand, if this is not the case and the model performance is not affected by occluding a region, then we treat that region as not infected. Once we repeat this process for various sliding windows of size NxN (by shifting them with a stride of S each time), we can plot a saliency map of the potentially infected regions for COVID-19. Here we provide the detected regions for 5 sample images from our test set in Figure 11 . As we can see the model mostly contains the manually detected infected regions.
To see the model convergence during training, we provide the recall (sensitivity), and specificity of the model on different epochs in Figure 12 and Figure 13 respectively. Its worth Fig. 11 . The heatmap of the potentially infected regions, starting from the left, the first image is the original in the dataset and following that the heatmap of infected regions can be seen and the top most right one is the annotated image by our radiologist. mentioning that, the default threshold value of 0.5 is used in these figures. In this work, we proposed a deep learning framework for COVID-19 prediction from chest CT images. To enable our model to better attend to the infected parts of the images, we used attention convolutional network. We train our model one of the largest publicly available (so far) covid-19 CT image datasets, and provide a detailed experimental study, by looking on model performance in terms of sensitivity, specificity, precision-recall curve, and ROC curve. In addition to the quantitative analysis, we also provide a visualization of the model attention maps and show how similar they are with the manually detected infected regions by our boardcertified radiologist. As a part of this work, we also make the manually detected infected regions publicly available, for the future research use by the community.