key: cord-0447954-3evhjv7k authors: Peng, Chengtao; Long, Yunfei; Zhu, Senhua; Tu, Dandan; Li, Bin title: DuCN: Dual-children Network for Medical Diagnosis and Similar Case Recommendation towards COVID-19 date: 2021-08-03 journal: nan DOI: nan sha: cd99918782ce38de314e7ac6732687d7c6da6ce3 doc_id: 447954 cord_uid: 3evhjv7k Early detection of the coronavirus disease 2019 (COVID-19) helps to treat patients timely and increase the cure rate, thus further suppressing the spread of the disease. In this study, we propose a novel deep learning based detection and similar case recommendation network to help control the epidemic. Our proposed network contains two stages: the first one is a lung region segmentation step and is used to exclude irrelevant factors, and the second is a detection and recommendation stage. Under this framework, in the second stage, we develop a dual-children network (DuCN) based on a pre-trained ResNet-18 to simultaneously realize the disease diagnosis and similar case recommendation. Besides, we employ triplet loss and intrapulmonary distance maps to assist the detection, which helps incorporate tiny differences between two images and is conducive to improving the diagnostic accuracy. For each confirmed COVID-19 case, we give similar cases to provide radiologists with diagnosis and treatment references. We conduct experiments on a large publicly available dataset (CC-CCII) and compare the proposed model with state-of-the-art COVID-19 detection methods. The results show that our proposed model achieves a promising clinical performance. Up to the present, the coronavirus disease 2019 (COVID-19) has caused massive infections and deaths over the world, and is still mutating rapidly. To contain the pandemic, it is urgently demanded to find an efficient way for COVID-19 detection and symptom analysis. In the clinical practice, the accurate detection of COVID-19 mainly relies on manual diagnosis using chest X-ray computed tomography (CT) images since they can show early infected lesions. Woefully, manual detection calls for highly-professional experiences and intensive labours, which makes it difficult for radiologists to screen for the disease. Therefore, developing an automated computer-aided COVID-19 detection system could effectively alleviate radiologists' burden and assist the disease detection. In recent years, deep learning (DL) based methods has made great achievements in lung disease analysis [4, 17, 24, 18] . Also, many excellent works were proposed for COVID-19 detection [1, 8, 12, 25] since 2019. The common DL-based COVID-19 detection methods usually employed a convolutional neural network (CNN) to extract image features and yielded predictions. For example, Jin et al. [13] designed a deep CNN detection system to diagnose COVID-19. Gao et al. [3] developed a dual-branch combination network, which combined the related lesion attention maps to assist the detection. Zhang et al. [28] proposed a diagnosis framework, which detected COVID-19 from other common pneumonias (CP) and normal healthy cases based on segmented lesion regions and achieved satisfactory results. Minaee et al. [19] used four pretrained models (ResNet18 [6] , ResNet50 [6] , SqueezeNet [11] and DenseNet-121 [10] ) and deep transfer learning technique to do the detection. Ter-Sarkisov [23] introduced a lightweight Mask R-CNN [5] model to reduce the number of network parameters in COVID-19 detection. Hu et al. [9] developed a weakly supervised multi-scale learning framework, which assimilates different scales of lesion information for COVID-19 detection. The above-mentioned methods were demonstrated to be effective and contributed a lot to combat COVID-19. However, the methods were proposed based on 2D images, which may omit important inter-slice information. To better extract representative features of COVID-19 lesions, several works [15, 16, 20, 26, 29] proposed to diagnose the disease using 3D images. Among these approaches, Ouyang et al. [20] proposed to focus on the infection regions inside lungs, and then conducted the detection; while other works directly extracted features from entire images and make predictions. 3D methods usually outperforms 2D models since they incorporated more spatial features (e.g., inter-slice information) from 3D images. However, known 3D models were usually trained using the common cross-entropy loss, which may be strenuous to extract tiny differences between the novel coronary pneumonia (NCP) and CP. Moreover, none of the existing works provides similar cases for confirmed COVID-19 case, while similar cases may provide radiologists with significant treatment references. In view of this, in this paper, we propose a dual-children network (DuCN) to simultaneously detect COVID-19 and provide similar cases for the confirmed case. In the proposed model, lung regions are segmented at first to exclude irrelevant regions (see Fig 1 (a) , the COVID-19 infection regions are mainly inside the lungs), hence eliminating the interference of irrelevant factors. Then, the segmented lung images are used for detection and recommendation. Meanwhile, the corresponding original full CT images and Euclidean distance maps in the lung regions are also integrated for providing abundant information. For COVID-19 detection process, we apply the triplet loss [22] to extract slight differences between NCP and CP. At last, once a case is confirmed with COVID-19, we bestow radiologists with similar cases, providing the diagnostic evidence and treatment references. Verified on a large clinical publicly available dataset (CC-CCII [28] ) and compared with state-of-the-art methods, our new method yields promising results for COVID-19 detection and similar case recommendation. Compared with previous COVID-19 detection works, our work makes the following contributions: (1) We develop a DuCN, which could give similar cases at the same time of diagnosis. To our best knowledge, this is the first work to provide COVID-19 similar cases; (2) We propose to use a triplet loss to supervise network to extract tiny differences between different type of images in COVID-19 detection; (3) We propose to use intrapulmonary Euclidean distance maps to assist incorporate more spatial information of infected lesions. Our code is made publicly available at GitHub (Anonymous Information). Generally, the infection of the novel coronavirus is mainly occurs in the lung area, and has little effect on areas outside lungs. Hence, we divide the detection and recommendation process into two stages: lung segmentation and detection/recommendation. Fig. 2 gives an overview of our proposed model. In the framework, firstly the original CT images are resized from 512 × 512 to 224 × 224 and input into a lung segmentation network, which is constructed by the common U-Net [21] , and used to produce lung masks. The segmented lung masks are then combined with the corresponding original CT images to produce lung images. Besides, Euclidean distance maps in the lung regions are computed based on the segmented masks as in the previous work [17] . Finally, the dual-children network takes the original CT images, lung images and intrapulmonary Euclidean distance maps as inputs, and yields the probability of being infected with COVID-19. If a case is confirmed with COVID-19, the image-level similar cases are further provided. Below we present more details of our proposed model. Someone may be conscious that our network has two more inputs (original CT images and intrapulmonary Euclidean distance maps) than previous works (e.g., [26] ), which advocated using lung images to detect COVID-19. In general, if patients are infected with the novel coronary pneumonia, especially for critical patients, their liver will also be damaged [2] . Thus, the liver morphology in original CT images may promote the detection of the COVID-19. In this situation, using the full original CT images may be help make up for the information loss caused by probable inaccurate lung segmentation. For the extra input of intrapulmonary Euclidean distance maps, they are conducive to extracting more spatial information of infected lesions and improving the diagnosis/recommendation accuracy. The existing detection networks usually directly output the possibility of infection, without providing relevant diagnostic evidence or similar cases. However, in clinical practice, the reference of similar cases is of great significance to the treatment of diseases, especially for a new disease such as COVID-19. With this in mind, in this study, we develop a dual-children network (DuCN) to simultaneously detect COVID-19 and provide similar cases for confirmed patients. Fig. 2 (C) shows the proposed DuCN. As shown, the DuCN has two paths: the red path is designed for disease detection and the blue one is developed for similar case recommendation. For each path, we employ a pretrained ResNet18 [6] as backbone except that the output digits (1000) is replaced by 128. The two paths share network parameters in coarse feature extraction phase (the first three levels in ResNet18), and work independently in feature specialization phase (see Fig. 2 (C)). The reason for this design is that the shallow features of a network mainly contain high-frequency information such as gray scale, which are universal for both detection and recommendation. While the deep-level features of a network mainly contain low-frequency information (e.g., semantic details), which is desired differently for various tasks. Therefore, when the DuCN goes deep, the paths for different tasks work separately and do not share parameters. Please note that in the training and testing phases, the DuCN works differently. Below we elucidate the details for two different tasks respectively. For COVID-19 detection, the previous works tended to use the common CrossEntropy loss to guide feature extraction. However, the CrossEntropy loss may be not adept at picking up tiny differences between different types (some NCP and CP cases have very similar lesions). Triple loss [22] , which was exploited for face recognition, could explore delicate changes between different cases due to the more comprehensive comparison between different type of cases. In this work, except for the CrossEntropy loss, to improve the detection sensitivity of the network, we employ the triplet loss to guide the delicate feature extraction. The triplet loss is defined as: where d represents the Euclidean distance; f is a feature extractor; a means an anchor sample, which is randomly selected from COVID-19 cases; p is an image (positive sample) of the same type as a, and is also randomly selected from COVID-19 cases, but from a different patient from a; n is a different type of negative sample from a, randomly selected from non-COVID-19 cases (including CP and normal cases in this study); margin is the distance between positive and negative samples after training, we set it is to 1.2 according to our numerical experiments. The network for COVID-19 detection is presented in Fig. 2 (C) (the red path). In the training phase, the input for this task is triplet images (a, p and n), each of which contains three channels: lung image, full original CT image, and intrapulmonary Euclidean distance map. Each image in triplet images is processed by a ResNet18 (the red path in Fig. 2 (C)) in turn and outputs 128-bits one-dimensional features (3*128-bits in total). The extracted features are further normalized by an L 2 regularization and used for computing triplet loss. Then the features are transferred in 2-bits representations by a linear layer and used to compute CrossEntropy loss. After training, in the testing phase, the image to be detected (contains 3-channels) is input into the network and generate two scores that represent the probability of different diseases. In clinical practice, doctors usually consult related similar confirmed cases to diagnose and treat existing cases, especially for some emerging or intractable diseases (e.g., COVID-19). Thus, devising an automated system to provide similar confirmed cases would be helpful for treating diseases. In this study, we develop a network to provide similar confirmed COVID-19 cases to help control the epidemic. The network is shown in Fig. 2 (C) (the blue path). In the training phase, the input is triplet images as in the detection path, the differences for the recommendation test are that p is randomly selected from the same patient as a, and n is randomly selected from a different patient but with the same disease (COVID-19) as a. This path is supervised by triplet loss only. After training, all images in the dataset are transferred into a 128-bit representations and saved as an index database. When an image is confirmed as COVID-19, it would be transferred into a 128-bit representations though the trained model and compared with samples in the library one by one using the Euclidean distance. The one with the smallest distance is the most similar case. Our proposed full network model has two sub-networks: U-Net and DuCN. The two sub-networks are trained separately, the segmentation network (U-Net) is trained using the common Dice loss, and DuCN is trained via the loss: where L SCR = L triplet is the similar case recommendation loss, and L D is the COVID-19 detection loss, which is defined as: where L CrossEntropy represents the common CrossEntropy loss. The scale factors in loss functions are set based on our experience and numerical experiments. For lung segmentation, we use a public dataset [14] , which was collected for COVID-19 lung and lesion segmentation, to train the network. The dataset is split into 70% and 30% for training and testing, respectively. For COVID-19 detection and similar case recommendation, we employ a large dataset (CC-CCII [28] ) to evaluate the proposed DuCN. We use data augmentation (flip left and right, and rotate ±2 • ) to expand the number of NCP images to a level equivalent to the number of non-NCP images. We split the dataset in patientlevel (prevent CT images of the same patient from appearing simultaneously in training and testing sets) into 70% and 30% for training and testing, respectively. The quantitative evaluation for this study includes: dice score (for segmentation); sensitivity, specificity, precision, accuracy, F-1 score and AUC (for detection); and subjective judgments (for segmentation and similar case recommendation). In our experiments, the two networks (U-Net and DuCN) are both implemented by PyTorch (V1.2.0) and trained separately on four NVIDIA K80 GPUs (12GB) with a batch size of 256. We adopt the Adam optimizer to train the networks with an initial learning rate of 1 × 10 −3 , divided by 2 every 20 epochs. Lung Segmentation Lung segmentation plays a critical role in the following step for COVID-19 detection and similar case recommendation. In the first stage, our segmentation network produces results with a dice score of 0.9669 on the entire testing dataset. However, since the dataset used for training segmentation network is different from the dataset in the second stage, a high dice score does not mean that the segmentation model will perform well in the second stage. Therefore, we apply the trained segmentation network in CC-CCII and evaluate the performance. Fig. 3 shows some representative visual segmentation results. Subjectively, the trained segmentation network performs very well, even for critical patients (e.g., see Figs. 3 (e-f)). The accurate segmentation of lung regions provides accurate and comprehensive lesion information for the subsequent step, and further promotes the accurate diagnosis of the disease. In this work, we devise a DuCN to do COVID-19 detection and similar case recommendation. In this section, to verify the performance of the detection, we compare the results with five state-of-the-arts [7, 13, 27, 28] , among which [7] developed two models (CovidNet-S and CovidNet-L). The comparison methods were all conducted on the same publicly dataset: CC-CCII. Table 1 shows the values of various metrics for different methods, to ensure the fairness, we refer to the values reported in the original papers (N/A means that the original works did not use this indicator). From the comparison, it is clear that our new model produces promising results for COVID-19 detection. Similar Case Recommendation For confirmed cases, it is of great significance for treatment if doctors are provided relevant case references. Thus, our proposed DuCN gives similar cases at the same time of diagnosis. Since it is hard to evaluate such function quantitatively, we only assess it subjectively. Fig. 4 presents a confirmed COVID-19 patient and its top-5 relevant cases. The top 1 is the patient itself, and for other three recommendations, the cases are related to the confirmed patient, implying that our similar case recommendation system is effective. Effectiveness of Raw Images, Lung masks and Distance Maps For each slice of image that input into DuCN, it has 3-channels (a raw image, a lung image and a intrapulmonary distance map). To show the effectiveness of the 3-channels, we remove one of them from input. To ensure the input still contains 3 channels, if raw image or distance map removed (indicated as DuCN-RIR/DuCN-DMR), we replaced it with the corresponding lung image; if lung mask removed (indicated as DuCN-LMR), lung image and distance map are both replaced by the corresponding raw image. The results are illustrated in Table 1 , from the results, all the three revisions has negative effect, suggesting that raw images, lung images and intrapulmonary Euclidean distance maps are all useful. Does Pretrained Network Help? In this study, we use a pretrained ResNet-18 to construct DuCN. To test if the pretrained model help, we replace it in the full network with an untrained ResNet-18. The results is listed in Table 1 (DuCN-UP), one may observe that the pretrained network achieves a higher performance than the untrained one. Thus, it is reasonable to choose the pretrained ResNet18 to construct our DuCN. In this paper, we proposed a new DuCN to provide similar cases for confirmed COVID-19 patients at the same time of diagnosis. To exclude the interference of irrelevant factors outside lungs, we used a segmentation network to segment lung regions. Besides, the original CT images were incorporated to extract lesion related features (e.g., liver information). Further, intrepulmonary distance maps and triplet loss were introduced to help extract tiny differences. Validated on a large public dataset, our proposed network exhibits a promising performance in clinical application. Our proposed DuCN can be generically used in other disease screening applications. Still, our method has some shortcomings. For instance, for similar case recommendation, we selected positive samples from the same patient as anchor images for network training, which was not religious. Strictly, patients with similar infected lesions and symptoms should be regarded as similar cases. In future work, we will make effort to improve this. Artificial intelligence augmentation of radiologist performance in distinguishing covid-19 from pneumonia of other origin at chest CT Clinical features of COVID-19-related liver functional abnormality Dual-branch combination network (dcn): Towards accurate diagnosis and lesion segmentation of covid-19 using ct images Thorax disease classification with attention guided convolutional neural network Mask r-cnn Deep residual learning for image recognition Automated model design and benchmarking of 3d deep learning models for covid-19 detection with chest ct scans Covidx-net: A framework of deep learning classifiers to diagnose covid-19 in x-ray images Weakly supervised deep learning for covid-19 infection detection and classification from ct images Densely connected convolutional networks Squeezenet: Alexnet-level accuracy with 50x fewer parameters and¡ 0.5 mb model size Covidctnet: An open-source deep learning approach to identify covid-19 using ct image Development and evaluation of an artificial intelligence system for covid-19 diagnosis COVID-19 CT Lung and Infection Segmentation Dataset Using artificial intelligence to detect COVID-19 and communityacquired pneumonia based on pulmonary CT: evaluation of the diagnostic accuracy Efficient and effective training of covid-19 classification networks with self-supervised dual-track learning to rank Dense networks with relative location awareness for thorax disease identification Kiseg: A three-stage segmentation framework for multi-level acceleration of chest CT scans from COVID-19 patients Deep-covid: Predicting covid-19 from chest x-ray images using deep transfer learning Dual-sampling attention network for diagnosis of covid-19 from community acquired pneumonia U-net: Convolutional networks for biomedical image segmentation Facenet: A unified embedding for face recognition and clustering Lightweight model for the prediction of COVID-19 through the detection and segmentation of lesions in chest ct scans Thorax-net: An attention regularized deep neural network for classification of thoracic diseases on chest radiography Covid-net: A tailored deep convolutional neural network design for detection of covid-19 cases from chest x-ray images A weakly-supervised framework for covid-19 classification and lesion localization from chest CT Covid-al: The diagnosis of covid-19 with deep active learning Clinically applicable AI system for accurate diagnosis, quantitative measurements, and prognosis of covid-19 pneumonia using computed tomography Deep learningbased detection for covid-19 from chest ct using weak label