Abstract
World-Health-Organization (WHO) has listed Tuberculosis (TB) as one among the top 10 reasons for death and an early diagnosis will help to cure the patient by giving suitable treatment. TB usually affects the lungs and an accurate bio-imaging scheme will be apt to diagnose the infection. This research aims to implement an automated scheme to detect TB infection in chest radiographs (X-ray) using a chosen Deep-Learning (DL) approach. The primary objective of the proposed scheme is to attain better classification accuracy while detecting TB in X-ray images. The proposed scheme consists of the following phases namely, (1) image collection and pre-processing, (2) feature extraction with pre-trained VGG16 and VGG19, (3) Mayfly-algorithm (MA) based optimal feature selection, (4) serial feature concatenation and (5) binary classification with a 5-fold cross validation. In this work, the performance of the proposed DL scheme is separately validated for (1) VGG16 with conventional features, (2) VGG19 with conventional features, (3) VGG16 with optimal features, (4) VGG19 with optimal features and (5) concatenated dual-deep-features (DDF). All experimental investigations are conducted and achieved using MATLAB® program. Experimental outcome confirms that the proposed system with DDF yields a classification accuracy of 97.8%using a K Nearest-Neighbor (KNN) classifier.
Introduction
In the current scenario, people are prone to be infected by diseases which are progressively increasing due to various causes, including weakness in immune systems. The weaker immune system will not provide necessary protection when an infectious disease occurs due to bacteria/virus and may cause moderate to severe disease in humans which can be treated with recommended medication [1–3].
Tuberculosis (TB) is an infectious disease caused by Mycobacterium-Tuberculosis and early detection and treatment will help to recover the patient from the impact. The 2019 report of World-Health-Organization (WHO) confirmed that 10 million people (56%men, 32%women and 12%children) were affected globally due to TB [4]. Usually, the TB infects the lungs and the germs can spread through air from the infected person. The WHO report also confirms that the disease occurrence rate is gradually rising in low- and middle-income countries. Further, the TB is listed in top 10 reasons of death and due to various causes; its occurrence is regularly rising in various countries, including India.
The TB infection in humans is caused mainly due to the weaker immune system and the accurate detection of TB will help to control the spread of disease. In the literature, a number of TB detection procedures are discussed in which the bio-image based methods are widely adopted by most of the researchers. During this process, the lung section of the infected person is recorded using a chosen imaging scheme (Computed Tomography or Chest radiographs) and then a personal or computer assisted diagnosis is performed to evaluate the infection and its rate to confirm the disease and its severity [5–8].
Compared to the CT scan, chest X-rays are widely preferred to detect the TB in lungs due to its simplicity and reputation. In the literature, a considerable number of chest X-ray supported lung condition monitoring schemes are proposed and implemented to detect various diseases [5–8]. In the proposed research, the detection of TB using chest X-ray is discussed with a pre-trained deep-learning (DL) system. The necessary X-ray images are collected from the benchmark database and then the detection of TB is achieved with VGG16 and VGG19 architecture. The different phases of this research are as follows; image collection and resizing, implementation of DL and extraction of features, optimal feature selection, classification and validation.
This research aims to develop an approach, which help to get better TB diagnosis using the chest X-ray and to achieve this; dual-deep-features (DDF) approach is employed. Initially, the necessary disease features are extorted using VGG16 and VGG19 and then the optimal values are identified with the Mayfly-Algorithm (MA). Finally, these features are then serially concatenated to get the feature subset of chosen dimension and then the classification task is implemented with a 5-fold cross validation. This research helped a classification accuracy of 97.80%and then the attained outcome is then compared and validated with the results attained with traditional VGG16, VGG19 and other related methods in literature [9]. This result confirms that the classification result achieved with DDF is better compared to other methods.
Thus, the goal of this research is to achieve the improved disease detection accuracy while evaluating the chest X-ray images. Further, this scheme must offer an improved result compared to other existing methods and it must be clinically significant. The major merit of the proposed scheme is; it considered existing VGG16 and VGG19 architectures; which is one of the simple schemes compared to other existing pre-trained schemes in the literature and provides finest result [10]. To achieve this, this work employed a deep-learning technique and the major involvement of this research includes; Implementation of a dual-deep-learning scheme using pre-trained VGG16 and VGG19. MA supported feature selection and feature concatenation. Confirming the performance of the proposed scheme with earlier works in the literature.
The other sections of this research are as follows; Section 2 presents the related work, Section 3 presents the methodology and Section 4 and 5 demonstrates the experimental results and conclusion of this work.
Related work
TB is one of the harsh lung infections and the untreated TB will lead to various sicknesses including death. Bio-image based detection of the TB is a clinically approved procedure and hence, several chest X-ray based disease detection methods are widely proposed by the researchers [11–14]. The summary of X-ray supported TB detection existing in the earlier works are presented in Table 1.
Summary of recent methods for TB detection using chest X-ray
Summary of recent methods for TB detection using chest X-ray
The recent work by Rahman et al. [24] presents a joint segmentation and classification approach using a chosen CNN scheme and achieved a TB detection accuracy > 98%. This work also confirmed that the DL based methods helps to get a better result from X-ray images. Implementation of CNN segmentation and classification needs more computational effort and hence, the proposed research work employed a dual-deep-feature (DDF) technique by combining the optimal features of VGG16 and VGG19. Further, compared to DenseNet201, the implementation of the proposed DDF scheme is simple and requires lesser computational effort.
This part of the work presents the scheme implemented to detect the TB from the X-ray images. The test images (X-ray) are collected from the benchmark dataset and then all the images are resized to 224×224×1 pixels. Initially, all these test images are examined using the pre-trained VGG16 scheme; which helps to get a feature dimension of 1×1×4096. These features are then reduced using 3 numbers of fully-connected (FC) layers assigned with a dropout rate of 50%and this process help obtain a feature with dimension 1×1×1024. These features are then considered to confirm the performance of the binary classifier employed in this work. Similar procedure is then repeated using the VGG19 and the attained results are noted.
After assessing the TB detection performance of traditional VGG16 and VGG19 schemes, the FC layers are then removed and then Mayfly-Algorithm (MA) based feature reduction is implemented to reduce the feature dimension from 1×1×4096 to a lower value. The performance of the implemented scheme is then tested and validated using the reduced features by MA. Finally, a serial concatenation among the reduced features of VGG16 and VGG19 are performed to get the DDF and the performance of the proposed scheme is confirmed.
X-ray database
The performance of the developed disease detection system must be tested using the clinical images or clinical grade benchmark images. In this work, the necessary X-ray images are collected from the dataset provided by Rahman et al. [24] and this dataset can be accessed from [25]. For the experimental investigation, 4000 images (2000 healthy + 2000 TB) are considered and every image is resized into 224×224×1 pixels (recommended dimension for VGG16/VGG19). The number of images considered for training and testing the DL scheme is depicted in Table 2 and the sample trial pictures are presented in Fig. 2.
Test images considered for experimental investigation
Test images considered for experimental investigation

Sample images from the considered X-ray image database.
Due to its significance and flexibility, a number of works adopted the pre-trained DL models. The main merit of using the pre-trained models include; (1) Simple and approved structure, (2) Work well on a class of images (Gray/RGB scale), (3) Requires only a fewer retuning procedures compared to the customized DL methods and (4) Every layers are already fixed and hence requires very less computation efforts.
Due to these merits, this work employs the most simple and efficient pre-trained DL schemes known as the VGG16 and VGG19 and the other information regarding these schemes can be accessed from [10, 26–28]. Structure wise VGG16 and VGG19 is approximately similar in first two convolutional-layers (Conv1 and Conv2). In VGG19, one additional layer is added in other convolutional-layers (Conv3, Conv4 and Conv5) as shown in Fig. 1. The Conv5 provides a one-dimension (1D) feature vector with dimension 1×1×4096 and which is then reduced to 1×1×1024 using the FC layers. Other essential information regarding these schemes can be found in [29, 30]. The literature also confirms that the considered DL schemes are efficient in detecting the disease in medical images [9, 31–34, 9, 31–34].

The scheme proposed in this research to detect the TB from chest X-ray.
Heuristic algorithm supported feature selection is one of the proven procedures and in this work; the MA based feature reduction is employed to reduce the deep-feature (DF) value of both the VGG16 and VGG19. The MA is a recently developed nature inspired optimization algorithm and includes the benefit of the Firefly-Algorithm [35], Particle-Swarm-Optimization and Genetic-Algorithm [36]. The earlier works on MA clearly depicts the working principle and the mathematical expression of this approach.
Let MA consist equivalent male (M) and female (F) flies arbitrarily located in a D-dimensional investigate space and each fly is represented as follows; i = 1, 2 … , N (with a chosen N = 20). During exploration phase, every fly is allowed to unite near the finest position (G
best
). Later, M is allowed to converge at (G
best
) by changing its position and speed. The convergence of M near the best location will be observed by the Cartesian-Distance (CD) with increase based on iteration. This process is shown in Equations (1) and (2);
where
The velocity update during this process can be defined as;
where nuptial-dance (d) = 5 and R = random numeral [–1,1].
When the search by M is over, each F is allowed find a M converged at G
best
. The expression for position and velocity update for the F is depicted below.
where O = maximized objective value.
Figure 3 depicts the flow-chart of the MA and its implementation to the chosen problem. When the iteration improves, every F will reach the M and the offspring generation take place and other information on MA can be found in [37, 38].

Flow chart of Mayfly-Algorithm.
In this work, the selection of the optimal DF is achieved with the MA and this process is depicted in Fig. 4. The role of the MA is to find the optimal features by maximizing the CD. The reduced features are then considered to confirm the performance of the classifiers.

Mayfly based optimal feature selection.
The performance of the proposed scheme is confirmed using an experimental investigation and during this investigation the binary classifiers, such as SoftMax, Naïve-Bayes (NB), Random-Forest (RF), K Nearest-Neighbor (KNN), Support-Vector-Machine with linear (SVM-L) and RBF kernels (SVM-RBF) are considered [13, 39–42].
SoftMax is one of the widely considered classifier during deep-feature supported disease diagnosis. If the performance of the SoftMax is not as per the required value, then other conventional classifiers can also be employed to improve the accuracy during the binary classification.
Naïve-Bayes
NB is categorized under probabilistic classifiers and it is one of the simple and efficient classifiers widely adopted in machine and deep-learning schemes. For NB, the following initial parameters are assigned in this work; Maximum number of observations = 1024, K-fold = 5, partition = 1×1 CV partition, class names = Healthy and TB, Score transform = none and error rate < 5%. In this work, the existing NB classifiers in MATLAB software is used and the binary classification result is verified with the considered features [24, 39].
Random-Forest
RF is an ensemble learning based classifier and it works based on the random subspace approach as discussed in [24, 39]. In this work, the parameters of RF are assigned as; number of estimators = 150, random states = 75, maximum features = auto select, minimum samples = 50, K-fold = 5 and number of iterations = minimal error (i.e., error rate < 5%). Other essential information can be found in [24, 26].
K Nearest-Neighbor
KNN is also a widely implemented classifiers and the basic KNN existing in the literature is adopted in this work. The necessary values for KNN is as follows; number of observations = 1024, K-fold = 5, number of neighbors = 3, class names = Healthy and TB, Score transform = none and error rate < 5%. The implementation of KNN can be found in [26, 43].
SVM-Linear
SVM is a commonly adopted classifier and in this work, the SVM associated with linear kernel is considered to achieve a binary classification. The parameters for SVM is assigned as; kernel = linear, K-fold = 5, total function assessment = 1024, stopping criteria = min objectives. The other information can be accessed from [24, 39].
Performance validation
During this investigation, the necessary measures, such as True-Positive (TP), False-Negative (FN), True-Negative (TN) and False-Positive (FP) are initially computed and from these values, other values, such as Accuracy (ACC), Precision (PRE), Sensitivity (SEN), Specificity (SPE) and Negative-Predictive-Value (NPV) are achieved. The expression for these values can be found in Eqns. (6) to (10) [42–45]:
This section of work demonstrates the results attained using the workstation; Intel i7 2.9 GHz processor with 12 GB RAM and 4GB VRAM equipped with MATLAB®. Initially, the pre-trained VGG16 and VGG19 schemes are employed to classify the image datasets into healthy/TB class using a 5-fold cross validation and the best result achieved in this validation is adopted as the final value. Similar procedure is then repeated with the considered approach using the MA selected features and finally, a serial concatenation is then implemented to combine the optimal features of VGG16 and VGG19 to get dual-deep-features (DDF).
Figure 5 depicts the outcome of the VGG16 for a chosen image, in which Fig. 4(a) and (b) denotes the results of convolutional-layer (Conv1) and max-pool-layer, respectively. During this operation, the FC layers are considered to convert 1×1×4096 into 1×1×1024 features using a 50%dropout rate and these features are then considered to train and test the performance of the SoftMax classifier. During this task, the following values are assigned; number of epochs = 50, iteration value = 2500 and the error value = 1e-5. The classification task is repeated 5 times and the best value among the trial is chosen as the final outcome.

Results achieved with VGG16 for a chosen trial image.
In this research, a 5-fold cross validation is employed to get better TB diagnosis using X-ray images and during the cross validation process, the image dataset is separated and grouped to form 5-different image group and every group is separately tested with the proposed approach. In this work, trial 2 helps yield better overall performance compared to other trials. Table 3 presents the result achieved during all the 5 trials and the result by Trial 2 is superior compared to other methods. Figures 6, 7 and 8 depicts the convergence of classification task, confusion matrix and Receiver-Operating-Characteristic (ROC) curve achieved with the VGG16 + SoftMax. Similar procedure is then repeated with other classifiers, such as NB, RF, KNN, SVM-L and SVM-RBF considered in this work and the best results are recorded as depicted in Table 4.
Performance values achieved during 5-fold cross validation

Training and testing values achieved with VGG16 + SoftMax.

Confusion matrix achieved with VGG16 + SoftMax.

ROC achieved for VGG16 + SoftMax.
Performance values obtained with various DL scheme with a chosen binary classifier
The classification performance of the VGG19 was also tested using the procedure followed in VGG16 and the attained best results with various classifiers are depicted in Table 4. Later, the MA based feature selection is then implemented separately on VGG16 and VGG19 and this work helps to get a reduce deep-features. The MA based feature optimization helps achieve a 1D feature vector with dimension 1×1×704 for the VGG16 and 1×1×631 for VGG19 and the classification task is separately repeated with these features using the considered binary classifiers and the results attained are presented in Table 4. Finally, the MA optimized features are then serially concatenated to get the DDF and this work helps achieve a feature vector of dimension 1×1×1335. This feature (VGG16 + VGG19) is then considered to train and validate the classifier and the attained result is depicted in Table 4. From this table, it can be confirmed that the MA optimized features help obtain a better TB detection accuracy compared to the FC selected features for both the VGG16 and VGG19 case. The overall performance achieved using DDF (VGG16 + VGG19) is better compared to other results achieved in this research work. Results in Table 4 confirm that the DDF helps achieve a classification accuracy of 97.80%with the KNN classifier.
The best performance achieved with various DL schemes considered in this research is graphically compared using the Glyph-plot. In the automated disease detection task, the attainment of better overall performance is always necessary and representing this outcome using appropriate graphical procedure is necessary. The commonly using line-plot and bar-plot are used to compare one variable against the similar variable and this process evaluates only the merit/demerit of a single variable. To get the overall performance (considering all variables), it is necessary to consider the special plot called Glyph-Plot. In Table 4, the number of measures considered are 5 (ACC, PRE, SEN, SPE and NPV) and every variable will act as a connecting line in this plot and the total area covered by this plot decides its merit. If the dimension of the image is large, then the corresponding performance is superior. The image with lesser dimension shows that the result is poorer. The Glyph-plot presents the overall performance of the classifier and the outcome of Fig. 9 confirms that the overall performance attained with the DDF with KNN is better compared to other results available in the table. Further, the outcome of VGG16 + MA and VGG19 + MA is better compared to the results by traditional VGG16 and VGG19. This result confirms that the proposed research helps to get a better TB detection using the considered chest radiographs.

Glyph-plot for the best performance achieved with chosen classifiers.
The performance of the proposed system is then compared with the TB detection performance achieved by Rahman et al. [24] and this comparison is shown in Fig. 10. This result confirms that, the outcome of poposed scheme is better compared to other state of art DL schemes.

Comparison of TB detection accuracy between proposed work and the work of Rahman et al. [24].
In future, the result of the proposed scheme can be improved further by considering; (1) CNN based segmentation and DDF supported classification and (2) Combining the DDF with the handcrafted features, such as Local-Binary-Pattern (LBP) and entropy values of the Figure.
Tuberculosis is one of a severe infectious disease that normally affects the lungs and the untreated TB will lead to severe illness. TB is normally diagnosed using chest X-ray and hence, this work proposes a DDF based TB detection scheme. In this work, the pre-trained DL methods, such as VGG16 and VGG19 are considered to detect the TB with improved accuracy. This work also employed the MA based optimal feature selection procedure, which replaces the traditional FC layers existing in the considered DL system. The employed MA helps to reduce the deep-features to a lower value (1×1×704 for the VGG16 and 1×1×631 for VGG19). TB detection with these features help obtain better disease detection accuracy compared to the traditional features. Finally, these two reduced features are serially concatenated to get the DDF and this feature helps yield a disease detection accuracy of 97.80%with KNN classifier. The experimental outcome of this research confirms that the overall result of this method is superior compared to the traditional schemes considered in this research work.
