1. Introduction
Tuberculosis (TB) is an infectious disease and one of the top 10 causes of death worldwide [
1,
2]. Despite major advances in tuberculosis control methods, such as improved vaccines and novel treatments, there are still difficulties in the development of quick and accurate TB testing procedures [
3]. Multidrug-resistant tuberculosis (MDR TB) has emerged as the most difficult disease to treat, and it is spreading fast, demonstrating the pathogen’s adaptability [
4]. Around 23% of the world’s population has latent tuberculosis [
4,
5]. In the developing world, tuberculosis is still a major, life-threatening disease, particularly in countries with high population density and poor sanitation. Tuberculosis elimination has become a major public health concern, and the urgency of the effort has been compounded by the advent of new tuberculosis bacillus strains that are resistant to standard medicines [
6]. Extrapulmonary tuberculosis (EPTB) occurs when tuberculosis spreads outside of the lungs. Tuberculosis of the lungs (PTB) and EPTB may coexist. Asymptomatic people account for 15 to 20% of the population [
7].
Sarcoidosis is a multisystemic granulomatous disease characterized by lumps in the lungs, skin, or lymph nodes produced by an abnormal inflammatory cell accumulation [
8]. Sarcoidosis can often be cured without medication. Sarcoidosis is a clinically similar disease to tuberculosis with an unknown cause [
9]. Sarcoidosis and PTB are both granulomatous diseases with comparable clinical-radiological presentations, making differentiation challenging in regions where they occur often [
6].
These two diseases were long assumed to be the same because of their similar symptoms and histology. Although tuberculosis can be a side effect of sarcoidosis treatment, the two diseases rarely coexist. Despite this, there have been cases of tuberculosis and sarcoidosis coexisting, with symptoms ranging from pulmonary [
10] to extrapulmonary [
5] and presenting in a variety of ways. In several studies, MTB deoxyribonucleic acid (DNA) was associated with a large proportion of tissue and bronchoalveolar lavage samples from sarcoidosis patients. There have, however, been reports of deleterious consequences [
2,
11]. Differentiating tuberculosis and sarcoidosis can be difficult, especially in cases of mediastinal lymphadenopathy, because both diseases have similar clinical presentations and histopathologically identical granulomatous inflammation [
12]. Tuberculosis diagnoses are now based mostly on microbiological confirmation, which is only attainable in 50% of cases [
9]. As a result, better diagnostic approaches are needed to reduce morbidity as a result of delayed or inefficient treatment [
13].
To diagnose and screen for pulmonary tuberculosis and sarcoidosis, chest X-rays (CXR) are widely employed [
14,
15,
16]. Competent clinicians use chest radiography to diagnose tuberculosis and sarcoidosis in clinical practice. This is, however, a lengthy and subjective procedure. Low-resource countries (LRCs) also have a shortage of radiologists, especially in rural areas [
17]. As a result, by analyzing chest X-ray images, computer-aided diagnostic tools can play an essential role in mass screening for pulmonary tuberculosis and sarcoidosis. Artificial intelligence-based solutions for a variety of medical applications, such as the identification of tumors, lung nodules, physiological monitoring, breast cancer, pneumonia, and social sensing, have recently been proposed [
6,
18].
2. Related Work
Convolutional neural networks (CNNs) are types of deep machine learning techniques that have shown a lot of promise in image classification and hence have a lot of support from the scientific community [
6,
19,
20]. Deep learning techniques have become popular for diagnosing lung diseases based on chest radiographs since X-ray radiography is a low-cost imaging modality with many data for training machine learning algorithms. Traditional machine learning algorithms were used by several research groups [
12,
21,
22] to distinguish normal patients from those with tuberculosis using CXR images. By adjusting CNN settings, deep machine learning techniques were applied to classify patients with tuberculosis [
23,
24,
25]; using pre-trained models, transfer learning was used to detect patients with tuberculosis [
26,
27,
28]. Hooda et al. [
29] presented a deep learning method that properly identified CXR images as tuberculosis or normal cases with 82.09 % accuracy. Evalgelista et al. [
26] reported an 88.76% accuracy rate for TB detection from chest X-ray images using CNNs. With an accuracy of 86.82%, Pasa et al. [
27] suggested a deep network architecture for tuberculosis monitoring. A method for interactively monitoring TB instances was also mentioned. Nguyen et al. [
28] used a DenseNet to categorize normal and TB images from the Montgomery County and Shenzhen datasets [
30] and obtained AUC values of 0.82 and 0.94, respectively. Hernandez et al. [
13] proposed an automated tuberculosis classification system based on X-ray images that used CNN and archival data (with an accuracy of 86%). Various pre-trained CNN architectures were used to classify chest radiographs into two categories, namely positive or negative for tuberculosis infection, according to Lopes et al. [
31]. The system’s accuracy was determined to be 81% using two publicly available chest X-ray databases. Using four CNN models (GoogLeNet, RestNet50, VGG-16, and VGG-19), Meraj et al. [
32] examined the accuracy limits for small- and large-scale CNN models in the classification of tuberculosis from chest X-rays. Ahsan et al. [
33] presented a pre-trained CNN model for tuberculosis detection that had an 80% sensitivity. With an accuracy rate of 94.89%, Yadav et al. [
34] used the transfer learning model to identify tuberculosis. Abbas et al. [
35] presented a CNN model to improve the performance of ImageNet pre-trained CNN models and achieved high TB classification accuracy using the Japanese Society of Radiological Technology (JSRT) database. It should be mentioned that transfer learning techniques were also employed to classify TB culture test images. On labeled tuberculosis culture images, Chang et al. [
12] employed the transfer learning method and achieved sensitivity and precision rates of 98 and 99%, respectively. Mahalakshmi et al. [
11] used an Artificial Neural Network (ANN) to identify tuberculosis and sarcoidosis based on gene expression. Several machine learning algorithms were compared by Chen et al. [
36]. They employed Decision Tree, Support Vector Machine, and Naive Bayes to classify TB and sarcoidosis. Kong et al. [
37] established tuberculosis and sarcoidosis detection techniques based on Decision Trees.
Based on past literature reviews, a few different approaches to distinguishing between patients with sarcoidosis and those with tuberculosis have been presented. Furthermore, the number of research datasets is limited, making it difficult to employ machine learning models in the real world. To our knowledge, no other research using deep learning to distinguish pulmonary tuberculosis from sarcoidosis using chest X-ray images has been published. Using different deep learning algorithms, adjusting existing algorithms, or integrating several outperforming techniques into an ensemble model can improve classification performance. Because of the increasing availability of computational power, CNNs have become viable. Techniques for segmentation and feature extraction can be designed without expert topic knowledge; however, for a CNN to produce improved results, the dataset must be annotated. These networks can locate and extract critical information for image classification.
This research distinguishes between pulmonary tuberculosis and sarcoidosis using a CNN transfer-learning-based approach. Transfer learning allows pre-trained models to be reused for better diagnostic results. EfficientNet, AlexNet, ResNet50, VGG-16, and Inception V3 are some of the transfer learning models used in ensemble learning. The use of EfficientNets for X-ray image classification, according to the findings of this study, is a simple and basic technique that saves training time while keeping the same accuracy as previously proposed computationally expensive algorithms.
5. Results and Discussion
The primary goal of this study is to obtain the best classification technique that classifies normal, sarcoidosis-infected, and TB-infected images with the highest precision to help physicians distinguish sarcoidosis from TB using X-ray images. To achieve this goal, the classification abilities of the EfficientNet deep learning architecture were evaluated with respect to chest X-ray images, and we compared the EfficientNet architecture’s performance to that of the most recent CNN models in the literature. All deep learning architectures used in this study were trained via transfer learning, as stated in
Section 4.2.2.
To acquire a better understanding of the impact of Reinhard’s and Macenko’s normalization approaches on the classification performance of the deep learning architecture, all X-ray images were stain-normalized by these algorithms in the first stage. In addition, investigations with non-normalized images were carried out. The outcomes of the stain-normalization approaches employed in this study are shown in
Figure 8.
The second stage of this research involved data augmentation; there were 1010 normal samples in the datasets. This value was almost four times higher than the number of sarcoidosis-infected images and 1.5 times higher than the number of TB-infected images. As a result, it was essential to augment the dataset symmetry for the sarcoidosis- and TB-infected images. Furthermore, studies [
48,
50] reveal that data augmentation obtains new datasets and increases the classification accuracy of deep learning systems by enriching the original datasets. As illustrated in
Figure 9, two image augmentation techniques (rotation and translation) were used to generate additional X-ray images of sarcoidosis- and TB-infected lungs. Augmentation techniques were adopted to ensure that X-ray images were not unduly distorted and to prevent the loss of important image features. Images were turned clockwise and counterclockwise to achieve image augmentation (images were rotated with an angle of 5 and 10 degrees in each direction). Images were translated by shifting them vertically (height shift), horizontally (width shift), or both vertically and horizontally (images were translated by 10% and 15%).
In the third stage, we investigated whether normalization approaches could help classification models be more accurate. For sarcoidosis, TB, and normal X-ray classification, seven EfficientNet architectures were trained on non-normalized and normalized X-ray images. With 10-fold cross-validation, the X-ray images were separated into two groups: 80% for training and 20% for testing. The hyper-parameter settings for the EfficientNet models during the training phase are as outlined in
Table 4.
Figure 10 shows each EfficientNet architecture performance in terms of its accuracy using stain-normalization techniques and non-normalized images. In general, the EfficientNet models performed better on normalized X-ray images than on non-normalized images, according to the results of the experiments. It’s worth noting that the average gain in accuracy for EfficientNets-1, B2, B3, B4, B5, and B6 appears to have shifted slightly. While EfficientNet-B4 saw a consistent increase, the larger EfficientNet models 5 and B6 saw a slight decrease. The EfficientNet-B0 model has the smallest number of parameters, and it performs poorly and has the lowest accuracy. This may be due to the fact that EfficientNet-B0 uses a very small input size. The image structures may be affected by resizing the X-ray images to 224 × 224, preventing the model from extracting the features. This could be due to over-parameterization, as opposed to the larger dataset size for the larger EfficientNet models, which did not appear to perform as well. For EfficientNets-B4 and B5, the Reinhard approach outperforms the Macenko approach. For EfficientNet-B4, the Macenko method and non-normalized images scored best. The Macenko and Reinhard approaches had the same results for EfficientNets-B1, B3, and B6.
In comparison to the other six models, the EfficientNet-B4 model achieved outstanding results. This model’s accuracy (98.56%, 96.9%, and 94.56% for Reinhard, Macenko, and non-normalized images, respectively) is impressive. The results show that this approach was the most effective at learning and identifying important features from training data. This approach also has the advantage of being simpler and having fewer trainable parameters than previous EfficientNets B5 and B6, implying faster training.
Classification accuracy alone can be deceiving. The sensitivity and precision rates, which are shown in
Table 5, were calculated as a consequence. The sensitivity of the EfficientNet-B4 model is consistently high across all models. The best sensitivity (98.36%) and precision (98.67%) for this model came from using images normalized with the Reinhard approach. The Macenko approach achieved close results with a sensitivity of 96.9% and a precision of 97.11%.
While training the images adjusted with the Reinhard and Macenko methods, the EfficientNets-B1 and B2 generated comparable results, with sensitivities and precisions of around 95.00% and 93.00%, respectively. Even though EfficientNets B1 and B2 have different numbers of parameters, they both accept the same input size. For extracting essential features from X-ray images in the database, input sizes of 240 × 240 and 260 × 260 are sufficient. This comparison clearly shows that EfficientNet-B4 outperforms all other EfficientNet models.
To further evaluate the performance of the EfficientNet models, the results were compared to similar deep learning approaches. The classification performance of pre-trained designs employed in earlier approaches is shown in
Figure 11. This demonstrates that the EfficientNet-B4 model produces superior accuracy (98.56%), precision (98.67%), and sensitivity (98.56%) for distinguishing between chest X-ray images for normal, TB-infected and sarcoidosis-infected cases. Furthermore, when compared to all comparable models, EfficientNet-B4 has the fewest parameters (about 17.9 million) and hence is computationally cheaper than the others due to its lightweight nature. It also has the shortest training time per epoch.
For further evaluation of the proposed approach, it was compared to conventional diagnostic tests that are reported in several research studies [
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63], as shown in
Table 6. From the table, it can be seen that sarcoidosis and tuberculosis are disorders that closely resemble each other. For distinguishing sarcoidosis from TB, physicians usually employ physical examinations, biopsy tissue, blood analysis, urine tests, and a tuberculin skin test; this approach is painful for patients, time-consuming, expensive, and uses techniques prone to human error. In contrast, the proposed approach requires only a chest X-ray image to differentiate between TB and sarcoidosis.
Finally, the results of the proposed system were compared to the assessments of the consultant committees for the same 10 patients categorized by the recommended system. The number of patients in each class (normal, tuberculosis-infected, and sarcoidosis-infected), as well as the number of accurate EfficientNet-B4 and consultant committee classifications, are shown in
Table 7.
All normal chest X-ray images were correctly diagnosed by the EfficientNet-B4 and consultant committees. EfficientNet-B4 misclassified one TB image, resulting in a lower number of inaccurate predictions than the consultant committees, which were unable to diagnose two out of three TB cases. Although the consultant committees failed to diagnose all five cases of sarcoidosis (0% true prediction), the proposed method correctly identified three of the five cases of sarcoidosis. The advisory committees in our study attributed their inability to diagnose sarcoidosis using X-ray images alone to the fact that physicians can recognize anomalies from X-ray images, but they require further blood tests in addition to chest swabs to distinguish sarcoidosis from tuberculosis. It could be concluded that the proposed method has a considerable benefit in detecting sarcoidosis using X-ray images without requiring the patient to undertake costly laboratory tests or lung smears, which are often painful for the patient and take a long time to obtain results. The proposed framework to detect sarcoidosis in patients using chest X-ray images may be employed clinically after more examination.
6. Conclusions
In this study, seven EfficientNet versions with transfer learning were utilized to classify chest X-ray images into three categories: normal, TB-infected, and sarcoidosis-infected. The EfficientNet-B4 model, which has around 17106 parameters, was the best of the seven models and achieved remarkable results, with accuracy, sensitivity, and precision rates of 98.56%, 98.36%, and 98.67%, respectively. Experiments have shown that this architecture, using X-ray images of the chest, can extract and learn global information. Additionally, the impacts of two alternative stain-normalization procedures were evaluated and compared to images that were not normalized. The B4 model had better performance when using the Reinhard technique, according to the results of this study. When compared to existing deep learning architectures (AlexNet, ResNet50, VGG16, and Inception V3) utilized to analyze chest X-ray images in the literature, as well as three special advisory committees, the proposed EfficientNet-B4 model was more successful. The results demonstrate that the EfficientNet architecture’s B4 model delivered the best outcomes. The proposed method offers a competitive improvement in terms of detecting sarcoidosis utilizing X-rays without requiring the patient to undergo expensive laboratory tests or lung smears, which are typically painful for the patient and take a long time to produce results. Based on our proposed methodology, we expect that the medical community will accept our proposed framework for classifying patients with sarcoidosis and tuberculosis using chest X-ray images.
In the future, it would be impressive to augment the capacity of the EfficientNet-B4 architecture to detect stages of pulmonary sarcoidosis and to increase the number of cases diagnosed by consultant committees for comparison. In addition, the performance of the proposed model will be investigated using MRI images. This is a challenging path worth pursuing. Finally, the suitability of the proposed model for accumulative learning will be evaluated.