You are on page 1of 14

www.nature.

com/scientificreports

OPEN Early diagnosis and meta‑agnostic


model visualization of tuberculosis
based on radiography images
Sasikaladevi Natarajan 1, Pradeepa Sampath 2, Revathi Arunachalam 3,
Vimal Shanmuganathan 4*, Gaurav Dhiman 5,6,7,8,9,10, Prasun Chakrabarti 11,
Tulika Chakrabarti 11 & Martin Margala 12
Despite being treatable and preventable, tuberculosis (TB) affected one-fourth of the world
population in 2019, and it took the lives of 1.4 million people in 2019. It affected 1.2 million children
around the world in the same year. As it is an infectious bacterial disease, the early diagnosis of
TB prevents further transmission and increases the survival rate of the affected person. One of the
standard diagnosis methods is the sputum culture test. Diagnosing and rapid sputum test results
usually take one to eight weeks in 24 h. Using posterior-anterior chest radiographs (CXR) facilitates
a rapid and more cost-effective early diagnosis of tuberculosis. Due to intraclass variations and
interclass similarities in the images, TB prognosis from CXR is difficult. We proposed an early TB
diagnosis system (tbXpert) based on deep learning methods. Deep Fused Linear Triangulation (FLT) is
considered for CXR images to reconcile intraclass variation and interclass similarities. To improve the
robustness of the prognosis approach, deep information must be obtained from the minimal radiation
and uneven quality CXR images. The advanced FLT method accurately visualizes the infected region
in the CXR without segmentation. Deep fused images are trained by the Deep learning network (DLN)
with residual connections. The largest standard database, comprised of 3500 TB CXR images and
3500 normal CXR images, is utilized for training and validating the recommended model. Specificity,
sensitivity, Accuracy, and AUC are estimated to determine the performance of the proposed systems.
The proposed system demonstrates a maximum testing accuracy of 99.2%, a sensitivity of 98.9%,
a specificity of 99.6%, a precision of 99.6%, and an AUC of 99.4%, all of which are pretty high when
compared to current state-of-the-art deep learning approaches for the prognosis of tuberculosis.
To lessen the radiologist’s time, effort, and reliance on the level of competence of the specialist,
the suggested system named tbXpert can be deployed as a computer-aided diagnosis technique for
tuberculosis.

The emitted airborne microdroplets enable the tuberculosis-causing bacteria to spread from one person to
another. Patient with TB infection is usually asymptomatic and requires a long medical course for complete
treatment. Tuberculosis is the most prevalent infectious disease in the world despite being wholly preventable
and ­treatable1. In the National Tuberculosis Elimination Program, the government gathers most of the TB sta-
tistics for India (previously called the RNTCP), and the World Health Organization (WHO) receives this data.

1
Department of Computer Science and Engineering, School of Computing, SASTRA Deemed University,
Thanjavur, Tamil Nadu 613401, India. 2Department of Information Technology, School of Computing, SASTRA
Deemed University, Thanjavur, Tamil Nadu 613401, India. 3Department of Electronics and Communications
Engineering, School of EEE, SASTRA Deemed University, Thanjavur, Tamil Nadu 613401, India. 4Deep Learning
Lab, Department of Artificial Intelligence and Data Science, Ramco Institute of Technology, Rajapalayam,
Tamil Nadu, India. 5School of Sciences and Emerging Technologies, Jagat Guru Nanak Dev Punjab State Open
University, Patiala 147001, India. 6Department of Electrical and Computer Engineering, Lebanese American
University, Byblos, Lebanon. 7Department of Computer Science and Engineering, University Centre for Research
and Development, Chandigarh University, Gharuan, Mohali 140413, India. 8Department of Computer Science
and Engineering, Graphic Era Deemed to be University, Dehradun 248002, India. 9Division of Research and
Development, Lovely Professional University, Phagwara 144411, India. 10Centre of Research Impact and Outreach,
Chitkara University Institute of Engineering and Technology, Chitkara University, Punjab, India. 11Sir Padampat
Singhania University, Udaipur, Rajasthan, India. 12University of Louisiana at Lafayette, Lafayette, USA. *email:
svimalphd@gmail.com

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 1


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
www.nature.com/scientificreports/

According to WHO TB statistics, there will likely be 2,590,000 million cases of TB in India in 2021, and it afflicts
6 percent of children aged 0 to 14 years, 36 percent of women, and 58% of men. This translates to a rate of 188
per 100,000 p ­ eople2. Figure 1 portrays the Indian states’ TB statistics reported by Medindia.
Early diagnosis of TB reduces the mortality rate and prevents infection from spreading to ­others4. Frequent
screening is required for high-risk groups to prevent ­infection5.
The sputum culture test, which takes a long time and is frequently unreliable, is one of the conventional TB
diagnosis ­methods6. Rapid TB tests can produce results in as little as 24 h, while other lung disorders might take
up to 8 weeks to produce results. The main challenging task of a test is to produce a sample size large enough
for it to be tested. For this test, saliva from the upper airways is useless. Posterior-anterior (PA) view of chest
radiographs (CXR) is an affordable and fast method for screening T ­ B7. However, using CXR for TB diagnosis is
tedious due to interclass similarity and intraclass variation in the low-radiation CXR images.
Moreover, the availability of radiologists for CXR annotations is also less in developing countries like India.
Hence, there is a demand for including artificial intelligence (AI) for TB’s accurate and fast prognosis in CXR
­images8. The WHO has suggested CXR screening as a method of TB case detection. It can determine the location,
type, and severity of lesions and check for any lesions that might be TB-related right away. Previous research
revealed that case finding based on CXR testing was more accurate than case finding based on symptoms.
In addition to using computer-aided detection (CAD) systems to read medical images, several CAD software
solutions have been developed to analyze digital CXRs for anomalies suggestive of TB. Deep learning methods
are playing a vital role in medical image-based diagnostic systems. Deep learning approaches are constructed
on Convolutional Neural Networks (CNN), which comprise deep feature extractors. When the CAD system is
developed to diagnose TB, that system should be trained by a large dataset, including noisy images. The primary
goal of the diagnostic system is to interpret chest X-ray images with high accuracy compared to radiologists.
There needs to be more radiologists in a densely populated country like India. Therefore, developing an AI-based
tool for TB prognosis from chest X-ray images that accurately replicate the radiologist is necessary.
The contributions of this article are highlighted below:

• The linear interpolation method is proposed to decrease intra-class variation and inter-class similarity for
minimal misclassification error.
• Enhances the quality of the low-radiation chest X-ray images by fusing the original image with the interpola-
tion overlay map.
• Fine-tuned the layers of deep inception residual neural network, and then Adam optimizer is used to train
the network.
• Attained the highest accuracy, sensitivity, and specificity for the benchmark datasets.

The rest of the paper is organized as follows. The related works are discussed in Sect. “Related work”. The
proposed framework for accurately diagnosing tuberculosis from radiographic pictures based on fused linear
triangular interpolation is shown in Sect. “Proposed framework”, and the experiments, data collecting, data
analysis, and experimental findings and discussion are shown in Sect. “Results”. Section “Conclusion” concludes
and discusses the future direction. In the domain of deep learning-based image classification, many methods are
proposed by researchers in the form of transfer learning, reinforcement learning, and meta-learning. A signifi-
cant challenge in this domain is reducing the misclassification error. Only a few researchers addressed this. In
this paper, we have proposed the linear interpolation-based technique to resolve the misclassification error by
reducing the inter-class similarities and intra-class variation. This is a novel approach in the classification domain.

Figure 1.  Indian states’ TB statistics reported by ­Medindia3.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 2


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol:.(1234567890)
www.nature.com/scientificreports/

Related work
Medical image analysis is essential in diagnosis, severity analysis, and treatment processes in the medical field.
For decades, the researcher has used chest X-ray images to diagnose tuberculosis (TB). Deep learning-based
image analysis is the paradigm shift in the computer vision and pattern recognition problem. Since the deep
learning ­algorithm9–30 is more precise, it can effectively train medical images.
Recently, there have been many more commercially accessible CAD systems with Deep Learning technology.
They have been demonstrated to be extremely sensitive and potentially prevent the need for many of the ensu-
ing confirmation procedures. However, TB’s prevalence may significantly impact Deep Learning (DL) system
performance at similar thresholds. This section analyses the deep learning-based diagnosis methods of TB alone
for better comparison with other component algorithms in this domain. To diagnose TB using chest X-ray
images, the researchers proposed several deep-learning and machine-learning techniquestabulated in Table 1.
As shown in Table 1, different deep-learning methods have been applied to various datasets to diagnose
tuberculosis. Only a few techniques, such as feature extraction and classification, are based on a two-phase
paradigm. In Ref.11,24, signal processing-based feature extraction methods are applied, including the Gabor fil-
ter, Speeded Up Robust Features(SURF), and Local binary patterns (LBP). Pre-trained deep learning networks
extract deep features in Ref.14,26. Support Vector Machine (SVM) and Bayesian optimization-based classifiers
are used in Ref.9,11,25,28,31,32.
Deep convolutional neural networks (DCNN) trained by the Imagenet dataset are used to retrain the network
with the TB dataset. For TB diagnosis, pre-trained neural networks such as GoogleNet, VGG16, ResNet, Incep-
tion V3, Resnet-Inception V2, DenseNet, SqueezeNet, and M ­ obileNet17–19,23,33. In machine learning algorithms,
transfer learning allows the use of feature representations from a model that has already been trained rather than
having to create a new model from the beginning. For the classification of TB, the transfer learning-enhanced
pre-trained AlexNet model is c­ onsidered12.

Ref Classification Dataset Accuracy


9
Support vector machine, deep convolutional neural network, Dr. Peinado –Peruvian: 453-Normal, 4248- TB 89
10
Random forest and extremely randomized trees Private:73 –TB, 319-Normal 84
11 Support vector machine + multilayer perceptron neural networks (SVNN), back
Private:1278-TB, 259-Normal 92.5
propagation neural networks
12
Transfer learning: AlexNet Dr. Peinado –Peruvian: 453-Normal, 4248- TB 85.68
9
Deep convolutional neural network Dr. Peinado –Peruvian: 453-Normal, 4248- TB 89.6
13
Ensemble:AlexNet and GoogleNet HIPAA-compliant datasets: 707-Normal, 300-TB 95.3
14 Pre-trained Network: ResNet – Feature extraction Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
83.4
Classification—Support Vector Machine 336-TB
15 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Artificial neural networks with Adam optimizer 82.09
336-TB
16
SegNet Private: 73 –TB, 319-Normal 84.3
17 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Pre-trained network: GoogleNet 90
336-TB
18 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Pre-trained neural network: VGG16, DenseNet and ResNet 85
336-TB
19 Pre-trained neural network: VGG16, Inception v4, ResNet and Resnet-Incep- Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
96.1
tion v2 336-TB
20 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Ensemble: ResNet, Inception-ResNet and DenseNet 90.5
336-TB
21 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Ensemble: AlexNet, GoogleNet and ResNet 88.24
336-TB
22
Probabilistic neural network Private:105-Normal, 105-TB 96
23 Pre-trained deep learning CNN: ResNet18, ResNet50, ResNet101, Datasets from the NLM, Belarus, NIAID, and RSNA: 3500—Normal, 3500 –
98.6
DenseNet201, InceptionV3, VGG19, ChexNet, SqueezeNet, and ResNet50 TB
24 Feature extraction: Gabor filter &inception v3 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
83.23
Classification: logistic regression 336-TB
25 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Segmentation, support vector machine classifier 98
336-TB
26 Feature extraction: MobileNet Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
94.1
Classification: Convolutional neural network 336-TB
27 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Ensemble- deep convolutional neural network 92.8
336-TB
28 MIMIC: 370-Normal, 0-TB, Montgomery dataset: 80-Normal, 58-TB, Shenz-
SegmentationEnsemble transfer learning-VGG, inception v3 97.1
hen dataset: 326-Normal, 336-TB, Generated: 1000-TB, 0-Normal
29 High-frequency emphasis filtering, Unsharp masking (UM), Pre-Trained Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
93.81
ResNet, and EfficientNet (HEF) 336-TB
30 Montgomery dataset: 80-Normal, 58-TB, Shenzhen dataset: 326-Normal,
Deep convolutional neural network 91
336-TB

Table 1.  Existing methods of AI-based solutions for the interpretation of digital CXRs.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 3


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
www.nature.com/scientificreports/

For TB diagnosis, a variety of ensemble techniques are utilized. The images extract features using Alexnet
and ­Google12. ResNet, Inception-Resnet, and DenseNet are used for c­ lassification20. An ensemble of ResNet,
GoogleNet, and AlexNet is used in Ref.21. An ensemble of VGG and Inception V3 is used in Ref.28. The most
challenging task of X-ray-based diagnosis is the quality of the image. As it is based on low and varying radiation,
there is a variation in the quality of the image.
Moreover, it is also challenging to handle interclass similarity and intraclass variation in the images. There
is a demand to customize the X-ray images to provide better prediction performance. Segmenting the infected
region and applying a deep learning model will perform better than normal images. Nevertheless, segmenta-
tion requires ground truth images unavailable for benchmark TB datasets. Another drawback of segmentation
is the additional overhead. Enhancing the Region of Interest (ROI) will improve feature extraction from the TB
chest X-ray images.

Proposed framework
The proposed diagnosis system named tbXpert is designed following the three significant steps: data augmenta-
tion, creating deeply fused X-ray images using Linear Triangular Interpolation (FLT), and deep transfer learning.
All this processing was realized in MATLAB 2020b with image processing and deep learning toolboxes. Figure 2
portrays the tbXpert system with different steps.

Data augmentation
The four benchmark available datasets for TB—include the National Library of Medicine (NLM)34, ­Belarus35, the
National Institute of Allergy and Infectious Disease (NIAID)35, and the Radiological Society of North America
(RSNA)36—are used to train and test the suggested diagnosis system. The total number of images from four
benchmark datasets is displayed in Table 2.

Belarus
306 chest X-ray images of 169 patients with a resolution of 2248 × 2248 pixels were published in a dataset by the
Ministry of Health, Republic of Belarus. It has only TB-infected X-ray images.

NLM
It published two chest X-ray datasets for TB, such as Montgomery and Shenzhen. The 58 chest X-ray images in
the Montgomery dataset have the label "TB" and the remaining 80 have the label "normal”. The resolution of the
images is 4020 × 4892.

Figure 2.  tbXpert architecture.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 4


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol:.(1234567890)
www.nature.com/scientificreports/

Data set CXR with TB-positive Normal CXR images


Montgomery 58 80
Shenzhen 336 326
Belarus 306 –
NIAID 2800 –
RSNA – 3094
Total 3500 3500

Table 2.  CXR dataset summary.

Shenzhen
It contains 662 posterior-anterior chest X-ray images, where 336 images with the label TB and the remaining
326 images are labeled normal. The resolution of the images is 3000 × 3000.

RSNA
It published the Chest X-ray images for the detection of pneumonia. The 3094 typical chest X-ray images are
used from that database.

NIAID
It released a dataset of 2800 chest X-ray pictures showing TB positivity. These data were collected from seven
different countries around the world.
The original X-ray images can be downloaded in both grayscale and Dicom formats. The gathered images
from different sources are preprocessed, and the images are downsized to 299 × 299 pixels.

Formation of High‑resolution from low radiation CXR using linear triangular interpolation
method
Since tbXpert is designed for use globally, it is trained and validated using a variety of datasets. The variation
in quality, intensity, contrast, and radiological characteristics is the fundamental problem with using different
datasets. Different radiological settings cause intraclass variations and interclass similarity. Reduced intraclass
variation improves the performance of the tbXpert system. Here, scattered interpolation points are created based
on the Region of Interest using the LTI m ­ ethod37,38. The original CXR images are overlaid with the scattered
interpolated points to enhance the image.
The region of interest for the TB infection in the chest is displayed on the CXR image based on the reference
point in Fig. 3. A piecewise triangular surface is formed from the triangulation of this 2D (x, y) plane, with the
points (x,i) (y,i) and (z,i). A triangle-shaped asymmetric network is created when edges connect these triangle-
shaped pieces.
P1 = x1 , y1 , z1 , P2 = x2 , y2 , z2 and P3 = x3 , y3 , z3 are the three triangular points.Each triangle is inter-
     
polated using the bivariate linear interpolation (BLI) method, as shown in Fig. 4.
Obtain linear equations such as
z1 = ax1 + by1 + c, (1)

Figure 3.  Reference points for CXR.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 5


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
www.nature.com/scientificreports/

Figure 4.  Interpolated point P from P1, P2, and P3.

z2 = ax2 + by2 + c, (2)

z3 = ax3 + by3 + c, (3)


Undefined co-efficient (a, b, c) are calculated by solving this linear formula. Then, we can calculate any subjec-
tive point with the coordinate as (xand) inside the triangle.
The points from the (x, y) plane must be projected onto the (u, v) plane to interpolate image pixels. Consider
the triangle’s interpolated point P using the three points P1, P2, and P3 in the affine coordinate system (x, y).
X1 = (x1 , y1 ), X2 = (x2 , y2 ), and X3 = (x3 , y3 ) are the affine coordinates of these points.
X = X1 + (X2 − X1 )a2 + (X3 − X1 )a3 . (4)
The affine system’s representation of the interpolated point coordinates is as follows:

(5)
   
x = x1 + (x2 − x1 )a2 + (x3 − x1 )a3 and y = y1 + y2 − y1 a2 + y3 − y1 a3 .

Henceforth, the matrix form,


      
x x1 x2 − x1 x3 − x1 a2
= +
y2 − y1 y3 − y1
, (6)
y y1 a3

   −1  
a2 x2 − x1 x3 − x1 x − x1
= . (7)
a3 y2 − y1 y3 − y1 y − y1
Consider the three-point (u, v) coordinates mapping. P1 , P2 , and P3. The coordinates of these points are
represented as U1 = (x1 , y1 ), U2 = (x2 , y2 ), and U3 = (x3 , y3 ). The point X = (x, y) is mapped onto the point
U = (u, ) by using linear DT interpolation (u,v)
U = U1 + (U2 − U1 )a2 + (U3 − U1 )a3 . (8)
According to the affine system, the interpolated point coordinates are shown as,
u = u1 + (u2 − u1 )a2 + (u3 − u1 )a3 and v = v1 + (v2 − v1 )a2 + (v3 − v1 )a3 . (9)
Hence, the matrix form,
u     
u1 u2 − u1 u3 − u1 a2
= +
v2 − v1 v3 − v1
. (10)
v v1 a3
In the (u,v), the new interpolated picture pixel is calculated by deducting (a2, a3) from (10).
u u    −1  
1 u2 − u1 u3 − u1 x2 − x1 x3 − x1 x − x1
= + . (11)
v v1 v2 − v1 v3 − v1 y2 − y1 y3 − y1 y − y1
The overlay image created utilizing the DT interpolated point from the reference points in Fig. 3 is shown in
Fig. 5. Figure 6 shows the result of deep fusion. BLT interpolation’s primary goal is to reduce intra-class variation
in CXR images from various data sources.

Design of deep transfer learning neural network


The section explains the deep transfer learning model used to identify TB from an X-ray image of the chest.
It is divided into two stages: choosing a Pre-Trained Model (PTM) for the provided dataset and updating the
learnable layers in the chosen PTM. This section describes the three steps in designing a deep transfer learning
neural network.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 6


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol:.(1234567890)
www.nature.com/scientificreports/

Figure 5.  Overlay image based on DT Interpolated points (a) Mesh plot and (b) 2D plot.

Figure 6.  (a) CXR image. (b) DT Overlay image. (c) Fused CXR image.

Phase 1: identification of pre‑trained model for the tbXpert


The most effective PTM is chosen for tbXpert transfer learning. Two existing concepts are combined to choose
the best PTM, such as revised Inception architecture and residual connections. To train deep neural networks,
residual connections must be present. Employing residual connections to swap out the Inception network’s filter
concatenation stage is an excellent idea. As a result, residual architecture can be used while maintaining the
computational effectiveness of the Inception network.
The PTM is chosen based on combining two intellectual structures: Residual connections and updated Incep-
tion architecture. Deep neural networks require residual connections to be trained. The residual connections are
used to replace the filter concatenation stage of the Inception network, and it is possible to achieve the benefits
of residual architecture while keeping the computational efficiency of the Inception design. To compensate for
the dimensionality reduction imposed by the Inception block, the filter layer that follows each one raises the
dimensionality of the filter bank. The performance of recognition has been significantly improved in the hybrid
Inception-ResNet-v2 version of Inception. This PTM is used to increase accuracy for the tbXpert network.

Phase 2: transfer learning for tbXpert


Transferring learning (TL) uses a pre-trained model (PTM) to transfer knowledge to a similarly complex task
that requires fewer data points. With 1000 image categories, the ImageNet dataset is used to train the network.
A triplet is used to represent the source domain knowledge S.
S = {Is , Gs , Os }, (12)
where Is stands for the Image Net dataset, Os for the PTM’s objective prediction function, and Gs for the dataset’s
ground truth or label.
The target domain knowledge is signified as a triplet,
TPA = {IPA , GPA , OPA }. (13)
GPA stands for the dataset’s ground truths, OPA for the classifiers, and IPA for the PA view on the binary class
source X-ray images.
The classifier for TL is described as,

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 7


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
www.nature.com/scientificreports/


OPA (IPA , GPA |S) = OPA (IPA , GPA |Is , Gs , Os ), with TL
OPA =
OPA (IPA , GPA ), without TL (14)

An appropriate TL classifier reduces the prediction error,


[OPA (IPA , GPA )(I), G] < err[OPA (IPA , GPA |S)(I), G]. (15)
The foundation of transfer learning is that low-level features will be derived from the PTM’s earliest levels.
The target network will only be retrained for the problematic prediction task in the final layers simultaneously.
The proposed methodology recognizes and removes the learnable layers while fully convolutional layers are
added for accurate prediction.
Algorithm 1.  tbXpert transfer learning.

Phase 3: Adam classifier (adaptive movement estimation)


The appropriate optimizer to be used is to train the transfer learning neural network. Stochastic gradient descent,
sometimes known as SGD, is an iterative machine learning technique that optimizes the gradient descent
throughout each search after selecting a random weight vector. It is a viable solution for noisy workloads.
AdaGrad and RMSPop are the most common first-order SGD algorithms. The advantages of these two methods
are combined in adaptive moment estimation (Adam)39.

Algorithm 2.  Adam optimizer algorithm for weight adjustment.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 8


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol:.(1234567890)
www.nature.com/scientificreports/

The optimized training parameter trains the proposed deep transfer learning algorithm in Algorithm 2. The
model is trained to attain 100% training accuracy.

Results
This section shows the experimental setup for implementing the proposed model tbXpert and includes the
validation procedure to verify the correctness of the proposed scheme. Lastly, the recommended deep learning
system named tbXpert is compared to existing cutting-edge deep learning models for diagnosing tuberculosis.

Experimental design and analysis


The tbXpert framework was created in MATLAB 2020b using a workstation with 16 GB RAM and NVIDIA
GPU. The proposed model is trained and tested with publicly available data sources such as NLM, Belarus, and
NIAID, as mentioned in Sect. “Data augmentation”. The transfer learning model’s hyper-parameters are adjusted
for greater accuracy. Furthermore, the recommended schemes’ performance is confirmed. A confusion matrix
with accuracy, sensitivity, specificity, and precision is the standard metric for assessing the proposed model.
Figure 7 depicts the confusion matrix with 30% of hold-out and 20% of hold-out samples.
The deep learning framework is recommended for TB prognosis. As a result, the suggested prognostic tool
can be used to test for TB. The screening test can be validated by predictive power or predictive validity, a gold
standard. According to the gold standard, the pediatric patient’s status is positive or negative. The positive pre-
dictive value (PPV), sensitivity, negative predictive value (NPV), and specificity of screening test performance
measures are estimated based on Fig. 7a. The proposed method achieves a sensitivity of 98.9%, specificity of
99.6%, precision/PPV of 99.6%, and NPV of 98.9%.
The Receiver Operating Characteristic (ROC) curve is a graphical technique for showing the deep learning
model’s performance. It is also employed to strengthen the suggested model’s validity. Plotting True Positive Rate
(TRP) versus False Positive Rate results in this curve (FPR). Area under the curve evaluates the general quality
of the model. According to this infectious illness model, some infected cases must be appropriately identified to
require prompt antibiotic treatment. Figure 8 displays the 99.2 AUC.

Figure 7.  (a) Confusion plot with 30% of the validation dataset. (b) Confusion plot with 20% of the validation
dataset.

Figure 8.  (a) ROC Plot with 30% validation dataset. (b) ROC plot with 20% validation dataset.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 9


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
www.nature.com/scientificreports/

The suggested model is built on the Inception network. However, it is a deep transfer learning network with
residual connections. Improved training and validation results result from the residual connection’s integration.
Figure 9a and c illustrates that the proposed model’s trianing accuracy and validation accuracy in each iterations
and attained hihest validation accuracy of 99.2% after 1000 iterations, its maximum training accuracy is 100 in
the first 50 iterations. Figure 9b and d display the proposed model’s training loss.

Meta‑agnostic model visualization of tuberculosis


In order to provide visual explanations for the prediction results of the proposed deep neural network, Gradient-
weighted Class Activation Mapping (Grad-CAM) is explored. It uses the final fully connected convolutional
layer to extract a localization map with the regions for predicting the result. Grad-CAM is combined with fine-
grained visualizations to construct high-resolution label-discriminative images. Figure 10 shows the Grad-CAM
visualizations of the CXR images based on the constructed deep neural architecture.
The proposed deep neural network explores local Interpretable Model-Agnostic Explanations (LIME) to vali-
date the prediction results, as shown in Fig. 10. LIME is an instance-based explainer, which generates simulated
data points around an instance through random perturbation and provides explanations by fitting a weighted
sparse linear model over predicted responses from the perturbed points. The explanations of LIME are locally
faithful to an instance regardless of the type.

Comparison with other models


This section compares the suggested model’s performance to existing cutting-edge methods for diagnosing tuber-
culosis. Researchers have recently suggested several additional techniques to identify juvenile pneumonia using
chest X-ray pictures. The suggested neural network is compared to all other deep learning models for TB with
the same initial data set. Table 3 displays the comparison results of the proposed model based on performance
metrics such as precision, accuracy, sensitivity, and specificity.
Figure 11 shows that the suggested deep transfer learning method provides the highest validation accuracy
of 99.2%, equating to all other TB diagnosis models. The suggested tbXpert provides the highest precision value
of 99.6. It demonstrates that the proposed method outperforms all currently available deep-learning models for
the prognosis of tuberculosis.

Conclusion
A robust early TB diagnostic technique based on deep learning is suggested. In CXR images, the Linear Trian-
gulation Interpolation reduces intraclass variation and interclass similarities. Usually, radiology images need to
be more balanced in quality; therefore, the image’s visual appearance must be improved to make the prognosis

Figure 9.  (a) tbXpert training accuracy plot. (b) tbXpert training loss plot. (c) tbXpert validation accuracy plot.
(d) tbXpert validation loss plot.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 10


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol:.(1234567890)
www.nature.com/scientificreports/

Figure 10.  Meta agnostic model visualization of the images.

Deep convolutional neural networks Sensitivity Specificity Accuracy Precision


VGG19 95.80 95.85 95.80 95.95
ResNet18 93.85 93.91 93.85 94.08
ResNet50 93.11 93.16 93.11 93.40
ResNet101 94.55 94.59 94.55 94.74
DenseNet201 95.07 95.12 96.07 95.27
SqueezeNet 94.18 94.21 94.18 94.31
MobileNet 94.33 94.39 94.33 94.65
InceptionV3 95.73 96.51 95.72 95.92
tbXpert 98.90 99.60 99.20 99.60

Table 3.  Comparison of tbXpert with other deep learning networks for TB diagnosis with the four benchmark
datasets (NLM, Belarus, NIAID TB, and RSNA).

Proposed Model 99.2

[31] 92

[30] 94.5

[29] 95.5

[28] 93

[27] 94

[26] 96

[25] 84

75 80 85 90 95 100
VALIDATION ACCURACY

Figure 11.  Performance comparison of the recommended model with other TB prognosis models.

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 11


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
www.nature.com/scientificreports/

process more accurate. The recommended LT algorithm accurately visualizes the infected region in the image
without segmentation. Inception neural network with residual connection is used to train on deep fused images.
The most extensive benchmark datasets, 3500 TB CXR images and 3500 regular CXR images are used to train
and evaluate the proposed tbXpert Model. Compared to other component deep learning algorithms for TB
diagnosis, the designed scheme achieves validation with a sensitivity of 98.9%, specificity of 99.6%, precision of
99.6%, accuracy of 99.2%, and AUC of 99.4%, all of which are very high. To decrease the radiologist’s effort and
reliance on the acceptable level of competence of the specialist, the proposed tbXpert is employed as a computer-
aided diagnosis approach for tuberculosis.

Data availability
The datasets used and/or analysed during the current study available from the corresponding author on reason-
able request.

Received: 17 October 2023; Accepted: 5 December 2023

References
1. WHO. Global tuberculosis report. (Accessed 2021) (2016).
2. WHO. Tuberculosis. https://​www.​who.​int/​teams/​global-​tuber​culos​is-​progr​amme/​tb-​repor​ts/​global-​tuber​culos​is-​report-​2020
(Accessed 2021) (2020).
3. https://​www.​medin​dia.​net/​health_​stati​stics/​disea​ses/​pulmo​nary-​tuber​culos​is-​india.​asp.
4. Zeng, J. et al. MRI evaluation of pulmonary lesions and lung tissue changes induced by tuberculosis. Int. J. Infect. Dis. 82, 138–146
(2019).
5. Rastoder, E. et al. Chest X-ray findings in tuberculosis patients identified by passive and active case finding: A retrospective study.
J. Clin. Tuberc. Mycobact. Dis. 14, 26–30 (2019).
6. Jaeger, S. et al. Automatic tuberculosis screening using chest radiographs. IEEE Trans. Med. Imaging 33(2), 233–245 (2013).
7. Bamrah, S. et al. Tuberculosis among the homeless, United States, 1994–2010. Int. J. Tuberc. Lung Dis. 17(11), 1414–1419 (2013).
8. Qin, C., Yao, D., Shi, Y. & Song, Z. Computer-aided detection in chest radiography based on artificial intelligence: A survey. Biomed.
Eng. Online 17(1), 1–23 (2018).
9. Alcantara, M. F. et al. Improving tuberculosis diagnostics using deep learning and mobile health technologies among resource-
poor communities in Perú. Smart Health 1, 66–76 (2017).
10. Melendez, J. et al. An automated tuberculosis screening strategy combining X-ray-based computer-aided detection and clinical
information. Sci. Rep. 6(1), 1–8 (2016).
11. Priya, E. & Srinivasan, S. Automated object and image-level classification of TB images using support vector neural network clas-
sifier. Biocybern. Biomed. Eng. 36(4), 670–678 (2016).
12. Liu, C. et al. TX-CNN: Detecting tuberculosis in chest X-ray images using convolutional neural network. In 2017 IEEE International
Conference on Image Processing (ICIP) 2314–2318 (IEEE, 2017).
13. Lakhani, P. & Sundaram, B. Deep learning at chest radiography: Automated classification of pulmonary tuberculosis by using
convolutional neural networks. Radiology 284(2), 574–582 (2017).
14 Lopes, U. K. & Valiati, J. F. Pre-trained convolutional neural networks as feature extractors for tuberculosis detection. Comput.
Biol. Med. 89, 135–143 (2017).
15. Hooda, R., Sofat, S., Kaur, S., Mittal, A. & Meriaudeau, F. Deep-learning: A potential method for tuberculosis detection using chest
radiography. In 2017 IEEE International Conference on Signal and Image Processing Applications (ICSIPA) 497–502 (IEEE, 2017).
16. Lee, J. H., Ahn, H. S., Choi, D. H. & Tae, K. S. Evaluation on the usefulness of X-ray computer-aided detection (CAD) system for
pulmonary tuberculosis (PTB) using SegNet. J. Biomed. Eng. Res. 38(1), 25–31 (2017).
17. Yadav, O., Passi, K. & Jain, C. K. Using deep learning to classify X-ray images of potential tuberculosis patients. In 2018 IEEE
International Conference on Bioinformatics and Biomedicine (BIBM) 2368–2375 (IEEE, 2018).
18. Stirenko, S. et al. Chest X-ray analysis of tuberculosis by deep learning with segmentation and augmentation. In 2018 IEEE 38th
International Conference on Electronics and Nanotechnology (NANO) 422–428 (IEEE, 2018).
19. Liu, J. et al. An original neural network for pulmonary tuberculosis diagnosis in radiographs. In International Conference on
Artificial Neural Networks (eds Kůrková, V. et al.) 158–166 (Springer, 2018).
20. Rashid, R., Khawaja, S.G., Akram, M.U. and Khan, A.M. Hybrid RID network for efficient diagnosis of tuberculosis from chest
X-rays. In 2018 9th Cairo International Biomedical Engineering Conference (CIBEC), 167–170 (IEEE, 2018).
21. Hooda, R., Mittal, A. & Sofat, S. Automated TB classification using an ensemble of deep architectures. Multimed. Tools Appl. 78(22),
31515–31532 (2019).
22. Andayani, U. et al. Identification of the tuberculosis (TB) disease based on XRay images using probabilistic neural network (PNN).
J. Phys. Conf. Ser. 1235(1), 012056 (2019).
23. Rahman, T. et al. Reliable tuberculosis detection using chest X-ray with deep learning, segmentation, and visualization. IEEE Access
8, 191586–191601 (2020).
24. Ayaz, M., Shaukat, F. & Raja, G. Ensemble learning-based automatic detection of tuberculosis in chest X-ray images using hybrid
feature descriptors. Phys. Eng. Sci. Med. 44(1), 183–194 (2021).
25. Chandra, T. B., Verma, K., Singh, B. K., Jain, D. & Netam, S. S. Automatic detection of tuberculosis-related abnormalities in Chest
X-ray images using hierarchical feature extraction scheme. Expert Syst. Appl. 158, 113514 (2020).
26. Sahlol, A. T., Elaziz, M. A., Jamal, A. T., Damaševičius, R. & Hassan, O. F. A novel method for detecting tuberculosis in chest
radiographs using artificial ecosystem-based optimization of deep neural network features. Symmetry 12(7), 1146 (2020).
27 Owais, M., Arsalan, M., Mahmood, T., Kim, Y. H. & Park, K. R. Comprehensive computer-aided decision support framework to
diagnose tuberculosis from chest X-ray images: Data mining study. JMIR Med. Inform. 8(12), e21790 (2020).
28 Dasanayaka, C. & Dissanayake, M. B. Deep learning methods for screening pulmonary tuberculosis using chest X-rays. Comput.
Methods Biomech. Biomed. Eng. Imaging Vis. 9, 1–11 (2020).
29. Munadi, K., Muchtar, K., Maulina, N. & Pradhan, B. Image enhancement for tuberculosis detection using deep learning. IEEE
Access 8, 217897–217907 (2020).
30 Kim, T. K., Yi, P. H., Hager, G. D. & Lin, C. T. Refining dataset curation methods for deep learning-based automated tuberculosis
screening. J. Thorac. Dis. 12(9), 5078 (2020).
31 Uçar, M. Deep neural network model with Bayesian optimization for tuberculosis detection from X-Ray images. Multimed. Tools
Appl. 82, 1–22 (2023).
32. Iqbal, A., Usman, M. & Ahmed, Z. Tuberculosis chest X-ray detection using CNN-based hybrid segmentation and classification
approach. Biomed. Signal Process. Control 84, 104667 (2023).

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 12


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol:.(1234567890)
www.nature.com/scientificreports/

33 Huy, V. T. Q. & Lin, C.-M. An improved densenet deep neural network model for tuberculosis detection using chest X-Ray images.
IEEE Access https://​doi.​org/​10.​1109/​ACCESS.​2023.​32707​74 (2023).
34. Jaeger, S. et al. Two public chest X-ray datasets for computer-aided screening of pulmonary diseases. Quant. Imaging Med. Surg.
4(6), 475 (2014).
35. Rahman, T., Khandakar, A., Chowdhury, M.E.H. Tuberculosis (TB) chest X-ray Database. https://​doi.​org/​10.​21227/​mps8-​kb56
36 Shih, G. et al. Augmenting the national institutes of health chest radiograph dataset with expert annotations of possible pneumonia.
Radiol. Artif. Intell. 1(1), e180041 (2019).
37. Amidror, I. Scattered data interpolation methods for electronic imaging systems: A survey. J. Electron. Imaging 11(2), 157–176
(2002).
38. Lertrattanapanich, S. & Bose, N. K. High-resolution image formation from low-resolution frames using Delaunay triangulation.
IEEE Trans. Image Process. 11(12), 1427–1441 (2002).
39. Kingma, D.P. and Ba, J. Adam: A method for stochastic optimization. Preprint at https://​arXiv.​org/​arXiv:​1412.​6980 (2014).
40. https://​www.​niaid.​nih.​gov/​disea​ses-​condi​tions/​tuber​culos​is

Author contributions
N.S. Writing—original draft, Writing—review & editing Conceptualization, Data curation, Validation. S.P. Writ-
ing—original draft, Writing—review & editing, Conceptualization, Formal analysis, Supervision. A.R. Con-
ceptualization, Writing—original draft, Formal analysis, Supervision, V.S. Conceptualization, Formal analysis,
Writing—review & editing, Supervision. G.D. Conceptualization, Formal analysis, Writing—review & editing,
Supervision. P.C. Conceptualization, Formal analysis, Supervision. T.C. Conceptualization, Formal analysis,
Supervision. M.M. Conceptualization, Formal analysis, Supervision and Funding.

Competing interests
The authors declare no competing interests.

Additional information
Correspondence and requests for materials should be addressed to V.S.
Reprints and permissions information is available at www.nature.com/reprints.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and
institutional affiliations.
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 http://​creat​iveco​mmons.​org/​licen​ses/​by/4.​0/.

© The Author(s) 2023

Scientific Reports | (2023) 13:22803 | https://doi.org/10.1038/s41598-023-49195-x 13


Content courtesy of Springer Nature, terms of use apply. Rights reserved
Vol.:(0123456789)
Terms and Conditions
Springer Nature journal content, brought to you courtesy of Springer Nature Customer Service Center GmbH (“Springer Nature”).
Springer Nature supports a reasonable amount of sharing of research papers by authors, subscribers and authorised users (“Users”), for small-
scale personal, non-commercial use provided that all copyright, trade and service marks and other proprietary notices are maintained. By
accessing, sharing, receiving or otherwise using the Springer Nature journal content you agree to these terms of use (“Terms”). For these
purposes, Springer Nature considers academic use (by researchers and students) to be non-commercial.
These Terms are supplementary and will apply in addition to any applicable website terms and conditions, a relevant site licence or a personal
subscription. These Terms will prevail over any conflict or ambiguity with regards to the relevant terms, a site licence or a personal subscription
(to the extent of the conflict or ambiguity only). For Creative Commons-licensed articles, the terms of the Creative Commons license used will
apply.
We collect and use personal data to provide access to the Springer Nature journal content. We may also use these personal data internally within
ResearchGate and Springer Nature and as agreed share it, in an anonymised way, for purposes of tracking, analysis and reporting. We will not
otherwise disclose your personal data outside the ResearchGate or the Springer Nature group of companies unless we have your permission as
detailed in the Privacy Policy.
While Users may use the Springer Nature journal content for small scale, personal non-commercial use, it is important to note that Users may
not:

1. use such content for the purpose of providing other users with access on a regular or large scale basis or as a means to circumvent access
control;
2. use such content where to do so would be considered a criminal or statutory offence in any jurisdiction, or gives rise to civil liability, or is
otherwise unlawful;
3. falsely or misleadingly imply or suggest endorsement, approval , sponsorship, or association unless explicitly agreed to by Springer Nature in
writing;
4. use bots or other automated methods to access the content or redirect messages
5. override any security feature or exclusionary protocol; or
6. share the content in order to create substitute for Springer Nature products or services or a systematic database of Springer Nature journal
content.
In line with the restriction against commercial use, Springer Nature does not permit the creation of a product or service that creates revenue,
royalties, rent or income from our content or its inclusion as part of a paid for service or for other commercial gain. Springer Nature journal
content cannot be used for inter-library loans and librarians may not upload Springer Nature journal content on a large scale into their, or any
other, institutional repository.
These terms of use are reviewed regularly and may be amended at any time. Springer Nature is not obligated to publish any information or
content on this website and may remove it or features or functionality at our sole discretion, at any time with or without notice. Springer Nature
may revoke this licence to you at any time and remove access to any copies of the Springer Nature journal content which have been saved.
To the fullest extent permitted by law, Springer Nature makes no warranties, representations or guarantees to Users, either express or implied
with respect to the Springer nature journal content and all parties disclaim and waive any implied warranties or warranties imposed by law,
including merchantability or fitness for any particular purpose.
Please note that these rights do not automatically extend to content, data or other material published by Springer Nature that may be licensed
from third parties.
If you would like to use or distribute our Springer Nature journal content to a wider audience or on a regular basis or in any other manner not
expressly permitted by these Terms, please contact Springer Nature at

onlineservice@springernature.com

You might also like