Skip to main content

Pneumoconiosis computer aided diagnosis system based on X-rays and deep learning



The objective of this study is to construct a computer aided diagnosis system for normal people and pneumoconiosis using X-raysand deep learning algorithms.

Materials and methods

1760 anonymous digital X-ray images of real patients between January 2017 and June 2020 were collected for this experiment. In order to concentrate the feature extraction ability of the model more on the lung region and restrain the influence of external background factors, a two-stage pipeline from coarse to fine was established. First, the U-Net model was used to extract the lung regions on each sides of the collection images. Second, the ResNet-34 model with transfer learning strategy was implemented to learn the image features extracted in the lung region to achieve accurate classification of pneumoconiosis patients and normal people.


Among the 1760 cases collected, the accuracy and the area under curve of the classification model were 92.46% and 89% respectively.


The successful application of deep learning in the diagnosis of pneumoconiosis further demonstrates the potential of medical artificial intelligence and proves the effectiveness of our proposed algorithm. However, when we further classified pneumoconiosis patients and normal subjects into four categories, we found that the overall accuracy decreased to 70.1%. We will use the CT modality in future studies to provide more details of lung regions.

Peer Review reports


Pneumoconiosis is an occupational lung disease where a typical pathological change is diffuse interstitial lung fibrosis. It is caused by the long-term exposure of workers to productive mining dust during their occupational activities [1]. According to statistics from the Chinese health department, as of 2018, more than 975,000 cases of occupational diseases have been reported nationwide, with occupational pneumoconiosis accounting for nearly 90% and more than 870,000 cases. In addition, pneumoconiosis caused by hazardous dust is a progressive disease, which can still occur after exposure ceases [2, 3]. As a result, it is foreseeable that many new cases of pneumoconiosis will continue to occur for a long time to come. However, currently there is no cure for pneumoconiosis. Hence, minimizing exposure to harmful dust particles and detecting the disease at an early stage are by far the most effective interventions [2].

The core of X-ray based pneumoconiosis diagnosis is the accurate interpretation of chest radiographs [4]. However, this is a relatively challenging task because the image features indicating pneumoconiosis on the digital chest radiographs are often difficult to capture and identify. In other words, there is a lack of pneumoconiosis diagnostic doctors relative to the heavy workload of pneumoconiosis detection. Recently, artificial intelligence (AI) has achieved great success in medical imaging tasks [5]. As a subset of AI, machine learning has been applied in radiomics analysis to build radiomics signatures and predictive models [6, 7]. In this thread of emerging literature, machine learning is used to evaluate early esophageal adenocarcinoma [8], classify focal liver lesion [9], predict the degree of histological tissue invasion and patient survival in lung cancer [10], classify lung nodules [8], diagnose and classify COVID-19 [11,12,13,14,15]. A number of scholars have also conducted a lot of research on the application of AI in the diagnosis of pneumoconiosis, including classification [16, 17], detection [18] and so on. However, most of them used a very limited number of cases. For instance, Okumura et al. [17] proposed to classify the pneumoconiosis as category 0 to category 3, but only a total of 55 images were used in their analyses. On the other hand, most studies [19, 20] considered data with an uneven distribution of pneumoconiosis cases across stages, so the data can only be divided into two categories, namely normal and pneumoconiosis, in which case, the model can only be used to determined whether if the patient has pneumoconiosis.

To overcome the limitations of the existing methods, in this paper, we extract the lung fields on both sides of the pneumoconiosis digital radiography (DR) chest radiographs using the U-Net model based on deep learning. We use ResNet to learn the image features to obtain an accurate classification of the pneumoconiosis grades and explore the application of artificial intelligence in pneumoconiosis detection. Our main contributions are as follows: We collect and create a new dataset of the largest number of pneumoconiosis data currently available. We present a new deep learning pipeline for the pneumoconiosis quadruple classification task, where focal loss is used for the first time for pneumoconiosis detection. In addition, we also use the model parameters trained in the public dataset for the region of interest extraction in this paper to help further improve the performance of our model for the classification task.

In summary, we have proposed a new medical model for pneumoconiosis detection and validate it on the real data collected in practice. We present results that show the effectiveness of our proposed computer aided diagnosis system.

Methods and materials

Patient characteristics

In our study, all the procedures abided by the protocol of Affiliated Hospital of Southwest Medical University. Ethical approval was obtained from the Ethical Committee of the hospital (KY2020200). The institutional review board approved this retrospective study and waived the need to obtain informed consent from patients. A database of 1760 anonymized digital radiography (DR) posteroanterior chest radiographs (CXR) showing evidence of pneumoconiosis was generated from January 2017 to June 2020. Age 20–95, 259 cases are female, and the rest are male. Their duration of exposure to dust ranged from 2 to 29 years, with an average of 6.2 ± 5.6 years. There are 1248 positive cases and 512 negative cases. We present patient demographics information in Table 1.

Table 1 Data summarization

The inclusion criteria included: (1) All patients with a history of exposure to dust; (2) Patients with chest radiographs, which are of good, or at least acceptable quality according to the guidelines of the ILO; (3) All positive cases have Certificate of diagnosis by the unit with pneumoconiosis diagnosis qualification. The exclusion criteria included: Subjects with lung or pleural disease, which affect the diagnosis and the grading of pneumoconiosis, such as with those with pneumothoraxes, pleural effusions, or partial or total resection of lung tissue on one side.

Chest radiographs acquisition

Chest radiographs were obtained using different DR scanners, including SHIMADZU 0.6/1.2P324DK-85/UNITED IMAGING uDR 770i /WDM 1000MD, tube voltage of 100-125kVp, exposure time: < 100 ms; source image distance (DIC): 180 cm; Photography position: standard chest posteroanterior position, upright position. These images were calibrated to meet the Digital Imaging and Communications in Medicine (DICOM) standard.

Chest radiographs analysis

Following the guidelines of the ILO, an expert panel formed by a certified radiologist and four occupational physicians reviewed these images. They recorded features include small opacities, large opacities, and Pleural abnormalities. Small opacities are described by profusion, affected zones of the lung, shape (rounded or irregular) and size. In addition, asbestos exposure history, pleural abnormalities, including pleural plaques (localized pleural thickening), costophrenic angle obliteration and diffuse pleural thickening, are regarded as the most important evidence for classifying pneumoconiosis in diagnosis. Finally, all patients are classified into four categories, namely 0 (n = 512), 1 (n = 352), 2 (n = 478) and 3 (n = 418).

Method overview

The overview of the method used in this paper is shown in Fig. 1, which includes three main parts. The first part of the method is data pre-processing, which consists of segmenting our own chest X-ray images using parameters trained by U-Net [21] in a publicly relevant dataset to obtain segmentation labels and processing the dataset using ten different data enhancement methods to perform 10-fold crossover experiments. The second part is to use the state-of-the-art deep learning framework ResNet [22] and replace the original loss function with focal loss for classification. The third part shows the classification results, which we have improved to a quadruple classification compared to the previous ordinary binary classification model.

Fig. 1
figure 1

An overview of the method adopted in this work

Data preprocessing

U-Net [21], which is proposed for medical image segmentation, has achieved great success in many areas and has been shown to be effective for different types of medical images. The two main features of U-Net are the U-shape structure and the skip connection. U-Net's encoder down samples four times consecutively for feature extraction and size halving. Symmetrically, its decoder up samples four times accordingly to restore the high-level semantic feature map obtained by the encoder to the resolution of the original image. During the up-sampling process, the symmetric structure feature maps were stitched together by skipping connections to reduce the semantic divide.

In this work, the labels of our chest X-ray images only include diagnosis results. Accurate segmentations of the images would typically require intensive manual labor of professional doctors. To obtain the segmentation of the lung field in our datasets, we train a U-Net using a dataset of chest X-ray images on Kaggle dataset, with standard labels and lots of training data.

An example of the segmentation is shown in Fig. 2, where (a) is an original image and (b) is the segmentedlung field. After lung field segmentation, a data augment process is presented to obtain more images for training. First, 10-fold cross-validation is adopted for dividing the original dataset into training and validation dataset. There are a total of 1760 patients, among which, 176 patients are used for validation. In addition, to augment the training dataset (1584 patients each time), we vary the brightness of each training image and present eight levels of different brightness of training images. This results in a total of 12,672 training images obtained each time.

Fig. 2
figure 2

An example of a original image and b that after lung region segmentation


As a powerful technology in image processing and computer vision, deep learning has been applied in many different areas, such as e-diagnosis of brain intracranial hemorrhage using CT images [23], detection and classification of multi-class skin lesion [24, 25], prediction of COVID-19-pneumonia [26], and Classification of positive COVID-19 CT scans [27]. In this work, ResNet-34 [22],which has 34 layers in total, is adopted for classification tasks. ResNet uses residual learning methods to extract more information from its deep structure. Some layers with residual function rather than no-referenced functions are presented, using a shortcut connection to add the last one or several layers with this layer. The shortcut connection in the residual module allows ResNet, which is one of the landmarks in the deep learning field, to achieve an improved classification accuracy with considerably increased depth. Besides, the number of training images in two different classes, normal and pneumoconiosis, has a considerable gap, which is also described as the class imbalance problem in the artificial intelligence field and always leads to bad performance. In traditional binary classification tasks, the cross-entropy loss is commonly applied, which will give the same weights for each training sample. However, due to the class imbalance problems in two categories, the cross-entropy loss will ignore a small number of difficult samples. To solve this issue, a focal loss [28] is adopted as the loss function of the deep learning framework, which can promote the weights of categories with smaller samples effectively. In addition, the focal loss can help to de-weight the well-classified samples in the loss function of the entire learning systems. Through some parameters in focal loss, a balance between two categories can be obtained, which can efficiently improve the binary classification accuracy. Its mathematical form is shown below:

$$\begin{array}{*{20}c} {Loss_{Focal} = \left\{ {\begin{array}{*{20}l} { - \partial \left( {1 - y^{\prime}} \right)^{\gamma } logy^{\prime}, } \hfill & {y = 1} \hfill \\ { - \left( {1 - \partial } \right)y^{^{\prime}\gamma } log(1 - y^{^{\prime}} ),} \hfill & {y = 0} \hfill \\ \end{array} } \right.} \\ \end{array}$$

Furthermore, the 10-fold cross validation is adopted in this study, where there are a total of 1760 patients and 176 patients are used for validation in each round. After data augmentation mentioned in the above section, a total of 12,672 training images are obtained during each round. For the implementation details, both training and validation processes are carried out by Pytorch in one RTX 2080Ti GPU. Training batch size is 32, the learning rate is 0.0001, the number of training epoch is set to 50, and the output number of classes is 2.


To better evaluate the classification performance on pneumoconiosis, several evaluation metrics are used in this work. Classification accuracy on training and validation sets with training epochs is adopted, while the loss with training epochs is also given to show the training details of deep learning. Receiver operating characteristic curve (ROC) is a tool used to measure unevenness in classification. Area under curve (AUC) is defined as the area under the ROC Curve. They are often used to evaluate the merits of a classifier. The abscissa of ROC curve is false positive rate (FPR), and the ordinate is true positive rate (TPR). Their mathematical formulas and meanings are shown as follows:

$$\begin{array}{*{20}c} {TPR = \frac{TP}{{TP + FN}}} \\ \end{array}$$
$$\begin{array}{*{20}c} {TPR = \frac{{{\text{FP}}}}{{{\text{FP }} + {\text{ TN}}}}} \\ \end{array}$$


The training and validation accuracy with epochs are shown in Fig. 3, and the loss curves are shown in Fig. 4. It can be seen from Fig. 4 that the validation loss curve reaches its lowest point after epoch 20. Hence, the validation accuracy curve is also stable after epoch 20. If we take the average accuracy between epoch 21 and epoch 50, we can get a validation accuracy of 92.46%. Specifically, the highest accuracy obtained is 96.14% and the lowest is 84.66%, where the confidence interval of accuracy is 92.46 ± 7.8%. The ROC curve of validation and its AUC is shown in Fig. 5, which shows the AUC is 0.89.

Fig. 3
figure 3

The training and validation accuracy with epochs

Fig. 4
figure 4

The training and validation losses with epochs

Fig. 5
figure 5

The ROC curve


Machine learning plays an important role in the detection of lesions, especially when the number of patients is rising and the doctors are unable to provide adequate support in which case, it is particularly important to build a reliable identification and detection model. Although the use of deep learning algorithms for pneumoconiosis diagnosis is not new, the number of cases considered in most studies has been limited. For instance, X Wang et al. [19] used a total of 1881 DR images in their analyses. They compared the performance of two experienced radiologists in interpreting pneumoconiosis, who respectively had more than five- and ten-years’ experience. They had an AUC of 0.668 and 0.772, respectively. The more experienced radiologist had a relatively better performance. Their studies involved DR examinations collected from a single institution using the same DR imaging machine. In this study, the dataset of 1760 DR chest radiographs comes from multiple centers and multiple devices, and the research results are more comprehensive. Besides, to our knowledge, our dataset is larger than those considered in the past investigations [16, 17, 20, 29].

In addition, a comparison with state-of-the-art works is given in Table 2, where 11 different algorithms are adopted for pneumoconiosis diagnosis [30]. The binary classification results of our proposed method significantly outperform those found in the aforementioned works, where the second-best result in these works, obtained from a general neural network classifier, is only 83%.

Table 2 Comparison of accuracy in pneumoconiosis diagnosis with different algorithms

There are also some limitations in this study. First, the dataset in this study is relatively small for deep learning. However, as shown by our statistical analysis on the independent test set (p < 0.01), this dataset is sufficient to verify the feasibility of deep learning in pneumoconiosis assessment. Second, the current dataset only contains chest radiographs. Although chest radiographs are the standard method for the diagnosis of pneumoconiosis, they cannot provide more details of the opacities regions in the lungs. This limitation can be overcome by the images of Computed Tomography (CT). Therefore, CT of pneumoconiosis should be considered in future studies, especially for the pneumoconiosis grading. Third, the experiments on the four-category classification of pneumoconiosis s are also conducted in Fig. 6 where a confusion matrix is given. It can be seen from Fig. 6 that the classification performance on categories 1, 2 and 3 is not ideal, with the entire accuracy being only 70.1%. We can observe that the X-ray modality does not provide sufficient details of features that reveal different grades of pneumoconiosis. To resolve this issue, CT modality will be considered in our future research.

Fig. 6
figure 6

Confusion matrix of pneumoconiosis classification into four categories


In this study, the automatic pneumoconiosis screening system has been developed. We propose a new preprocessing pipeline with the ResNet classification model, and show that the model achieves satisfactory performance. Compared to many existing studies, a larger test dataset is used in our study. While this pipeline is capable of reducing the workload of radiologists, we are aware of its current limitations in the actual application of pneumoconiosis diagnosis. We aim to explore models that can yield more accurate grading of pneumoconiosis in our future work.

Availability of data and materials

The datasets generated and analyzed during the current study are not publicly available dueto patient privacy and ethical requirements but are available from the corresponding author on reasonable request.


  1. Wang T, Sun W, Wu H, Cheng Y, Li Y, Meng F, Ni C. Respiratory traits and coal workers’ pneumoconiosis: Mendelian randomisation and association analysis. Occup Environ Med. 2021;78(2):137.

    Article  Google Scholar 

  2. Hall NB, Blackley DJ, Halldin CN, Laney AS. Current review of pneumoconiosis among US coal miners. Curr Environ Health Rep. 2019;6(3):137–47.

    Article  CAS  Google Scholar 

  3. Blackley DJ, Halldin CN, Laney AS. Continued increase in prevalence of coal workers’ pneumoconiosis in the United States, 1970–2017. Am J Public Health. 2018;108(9):1220–2.

    Article  Google Scholar 


  5. LeCun Y, Bengio Y, Hinton G. Deep learning. Nature. 2015;521(7553):436–44.

    Article  CAS  Google Scholar 

  6. Zhou M, Scott J, Chaudhury B, Hall L, Goldgof D, Yeom KW, Iv M, Ou Y, Kalpathy-Cramer J, Napel S. Radiomics in brain tumor: image assessment, quantitative feature descriptors, and machine-learning approaches. Am J Neuroradiol. 2018;39(2):208–16.

    Article  CAS  Google Scholar 

  7. Wang J, Wu C-J, Bao M-L, Zhang J, Wang X-N, Zhang Y-D. Machine learning-based analysis of MR radiomics can help to improve the diagnostic performance of PI-RADS v2 in clinically relevant prostate cancer. Eur Radiol. 2017;27(10):4082–90.

    Article  Google Scholar 

  8. Ebigbo A, Mendel R, Probst A, Manzeneder J, de Souza Jr LA, Papa JP, Palm C, Messmann H. Computer-aided diagnosis using deep learning in the evaluation of early oesophageal adenocarcinoma. Gut. 2019;68(7):1143–5.

    Article  Google Scholar 

  9. Balagourouchetty L, Pragatheeswaran JK, Pottakkat B, Ramkumar G. GoogLeNet-based ensemble FCNet classifier for focal liver lesion diagnosis. IEEE J Biomed Health Inform. 2019;24(6):1686–94.

    Article  Google Scholar 

  10. Varghese C, Rajagopalan S, Karwoski RA, Bartholmai BJ, Maldonado F, Boland JM, Peikert T. Computed tomography-based score indicative of lung cancer aggression (SILA) predicts the degree of histologic tissue invasion and patient survival in lung adenocarcinoma spectrum. J Thorac Oncol. 2019;14(8):1419–29.

    Article  Google Scholar 

  11. Li L, Qin L, Xu Z, Yin Y, Wang X, Kong B, Bai J, Lu Y, Fang Z, Song Q. Using artificial intelligence to detect COVID-19 and community-acquired pneumonia based on pulmonary CT: evaluation of the diagnostic accuracy. Radiology. 2020;296(2):E65–71.

    Article  Google Scholar 

  12. Zhang Y-D, Attique Khan M, Zhu Z, Wang S-H. Pseudo zernike moment and deep stacked sparse autoencoder for COVID-19 diagnosis. Comput Mater Contin. 2021;69(3):3145–62.

    Article  Google Scholar 

  13. Attique Khan M, Majid A, Akram T, Hussain N, Nam Y, Kadry S, Wang S-H, Alhaisoni M. Classification of COVID-19 CT scans via extreme learning machine. Comput Mater Contin. 2021;68(1):1003–19.

    Article  Google Scholar 

  14. Majid A, Khan MA, Nam Y, Tariq U, Sakr RH. COVID19 classification using CT images via ensembles of deep learning models. Comput Mater Contin. 2021;69(1):319–37.

    Article  Google Scholar 

  15. Wang S-H, Attique Khan M, Govindaraj V, Fernandes SL, Zhu Z, Zhang Y-D. Deep rank-based average pooling network for Covid-19 recognition. Comput Mater Contin. 2022;70(2):2797–813.

    Article  Google Scholar 

  16. Okumura E, Kawashita I, Ishida T. Computerized analysis of pneumoconiosis in digital chest radiography: effect of artificial neural network trained with power spectra. J Digit Imaging. 2011;24(6):1126–32.

    Article  Google Scholar 

  17. Okumura E, Kawashita I, Ishida T. Computerized classification of pneumoconiosis on digital chest radiography artificial neural network with three stages. J Digit Imaging. 2017;30(4):413–26.

    Article  Google Scholar 

  18. Yu P, Xu H, Zhu Y, Yang C, Sun X, Zhao J. An automatic computer-aided detection scheme for pneumoconiosis on digital chest radiographs. J Digit Imaging. 2011;24(3):382–93.

    Article  Google Scholar 

  19. Wang X, Yu J, Zhu Q, Li S, Zhao Z, Yang B, Pu J. Potential of deep learning in assessing pneumoconiosis depicted on digital chest radiography. Occup Environ Med. 2020;77(9):597–602.

    Article  Google Scholar 

  20. Zheng R, Deng K, Jin H, Liu H, Zhang L. An improved CNN-based pneumoconiosis diagnosis method on X-ray chest film. In: International conference on human centered computing: 2019. Springer; 2019, pp 647–58.

  21. Ronneberger O, Fischer P, Brox T. U-net: convolutional networks for biomedical image segmentation. In: International Conference on Medical image computing and computer-assisted intervention: 2015. Springer; 2015, pp. 234–41.

  22. He K, Zhang X, Ren S, Sun J: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition: 2016; 2016, pp. 770–8.

  23. Mansour RF, Escorcia-Gutierrez J, Gamarra M, Díaz VG, Gupta D, Kumar S. Artificial intelligence with big data analytics-based brain intracranial hemorrhage e-diagnosis using CT images. Neural Comput Appl 2021.

  24. Khan MA, Muhammad K, Sharif M, Akram T, Albuquerque VHC. Multi-class skin lesion detection and classification via teledermatology. IEEE J Biomed Health Inform. 2021;25(12):4267–75.

    Article  Google Scholar 

  25. Khan MA, Muhammad K, Sharif M, Akram T, Kadry S. Intelligent fusion-assisted skin lesion localization and classification for smart healthcare. Neural Comput Appl 2021.

  26. Khan MA, Kadry S, Zhang YD, Akram T, Sharif M, Rehman A, Saba T. Prediction of COVID-19—pneumonia based on selected deep features and one class kernel extreme learning machine. Comput Electr Eng. 2021;90:106960.

    Article  Google Scholar 

  27. Khan MA, Hussain N, Majid A, Alhaisoni MM, Zhang YDJC-TSP. Classification of positive COVID-19 CT scans using deep learning. 2020;66(3):1–15.

  28. Lin T, Goyal P, Girshick R, He K, Dollár P. Focal loss for dense object detection. In: Proceedings of the IEEE international conference on computer vision. 2017.

  29. Zhang L, Rong R, Li Q, Yang DM, Yao B, Luo D, Zhang X, Zhu X, Luo J, Liu Y, et al. A deep learning-based model for screening and staging pneumoconiosis. Sci Rep. 2021;11(1):2201.

    Article  CAS  Google Scholar 

  30. Devnath L, Luo S, Summons P, et al. Automated detection of pneumoconiosis with multilevel deep features learned from chest X-ray radiographs. Comput Biol Med. 2021;129:104125.

    Article  Google Scholar 

Download references


This study was supported by Independent Research fund of Key Laboratory of Industrial Dust Prevention and Control and Occupational Health and Safety, Ministry of Education (Anhui University of Science and Technology) (NO. EK20201003). This study was supported by Guangxi Key Laboratory of Automatic Detecting Technology and Instruments (YQ21208). This study was supported by Fudan Medical Device project (20275, DGF501021-01).

Author information

Authors and Affiliations



FY, JC, MT and WQ collected all the images needed for this paper and constructed the dataset. ZRT and ZY completed the experiments in this study and wrote the paper. SW, CY, YY and YG improved the experiment and paper in this paper. ZY edited the manuscript. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Zekuan Yu.

Ethics declarations

Ethics approval and consent to participate

This paper is carried out in accordance with the Declaration of Helsinki and has been approved by the Ethics Committee.In our study, all procedures abided by the protocol of Affiliated Hospital of Southwest Medical University. Ethical approval was obtained from the Ethical Committee of the hospital (KY2020200). The institutional review board approved this retrospective study and waived the need to obtain informed consent from patients.

Consent for publication

Not applicable.

Competing interests

The authors declares that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated in a credit line to the data.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Yang, F., Tang, ZR., Chen, J. et al. Pneumoconiosis computer aided diagnosis system based on X-rays and deep learning. BMC Med Imaging 21, 189 (2021).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: