Tuberculosis detection bars on VGG19 transfer learning and Zebra Optimization Algorithm

Tuberculosis (TB) remains a significant global health challenge, necessitating accurate and efficient diagnostic tools. This study introduces a novel approach combining VGG19, a deep convolutional neural network model, with a newly developed Zebra Optimization Algorithm (ZOA) to enhance the accuracy of TB detection from chest X-ray images. The Zebra Optimization Algorithm, inspired by the social behavior of zebras, was applied to optimize the hyperparameters of the VGG19 model, aiming to improve the model's generalizability and detection performance. Our method was evaluated using a well-defined metric system that included accuracy, sensitivity, and specificity. Results indicate that the combination of VGG19 and ZOA significantly outperforms traditional methods, achieving a high accuracy rate, which underscores the potential of hybrid approaches in TB image analysis.


Introduction
Tuberculosis (TB) continues to pose a serious global health threat, ranking as one of the top ten causes of death worldwide [1][2][3] and the leading cause from a single infectious agent, surpassing even HIV/AIDS.According to the World Health Organization, millions of people continue to fall ill with TB each year [4], with many cases occurring in developing countries where healthcare resources are often limited.The traditional methods for TB detection, which include sputum smear microscopy, culture tests, chest X-rays, and CTs, are either time-consuming or lack the sensitivity required for early and accurate diagnosis [5].This gap in diagnostic efficacy significantly hampers effective treatment and control efforts, emphasizing the urgent need for more precise and faster diagnostic technologies.
The integration of artificial intelligence (AI) in medical imaging has opened new avenues for enhancing diagnostic accuracy and speed [6] [7].Deep learning, particularly through the use of convolutional neural networks (CNNs), has demonstrated remarkable success in interpreting complex medical images.The VGG19 [8], a CNN known for its depth and robustness, has been applied in various fields such as image classification, object recognition, and image style transfer.For example, in the medical imaging field, the VGG19 model is essential for identifying the subtle manifestations of TB in chest X-rays.However, deploying such sophisticated models directly in clinical environments often presents challenges, primarily due to the vast amounts of data and computational resources required to train them effectively from scratch.
Transfer learning [9][10][11] addresses these challenges by leveraging pre-trained models on large, diverse datasets to perform new tasks with relatively fewer images, such as those pre-trained on large and diverse datasets like ImageNet or Tianzhi Le, Fanfeng Shi, Meng Ge, Ran Dong and Dan Shan 2 COCO, have learned rich hierarchical representations of visual features.This approach is particularly vital in medical imaging, where annotated data can be scarce and expensive to obtain.By leveraging a model pre-trained on ImageNet for TB detection, transfer learning enables the model to adapt effectively to identify TB-specific patterns with minimal further training.
The study [12] presents a computer-aided tool for detecting and analyzing tuberculosis cavities in lungs using CT scans.The method uses a novel algorithm combined with fuzzy connectedness to distinguish and measure cavities and airways.Tested on rabbit CT images, the tool accurately identified and quantified cavities, showing high agreement with expert radiologists' assessments.The study aims to develop a deep learning model for detecting tuberculosis, utilizing a novel algorithm named RAVG-FrFE-DSSAE [13].This model combines advanced feature extraction with classification techniques to prevent overfitting through an 18way multi-dimensional analysis.Testing across multiple trials demonstrated high effectiveness with an accuracy of 94.03% and area under the curve (AUC) of 0.9725, outperforming eight other advanced methods.The research [14] employs a specialized 3D deep learning network with added depth information to analyze CT lung scans for tuberculosis severity.It outperforms standard networks, showing 92.70% accuracy in severity prediction and up to 85.29% in assessing high severity probability.This paper [15] presents a deep learning-based system for detecting various tuberculosis lesions in chest radiographs.It uses a fully convolutional network to segment lung areas and integrates a scalable pyramid structure into Faster RCNN to improve detection of small lesions.The system achieves high accuracy and AUC on two public datasets A deep learning algorithm [16] was created to help diagnose TB from chest x-rays in HIV-positive patients, enhancing clinician accuracy and offering significant support in regions with radiologist shortages.The study [17] addresses diagnosing pulmonary diseases through chest x-rays using deep learning.Three deep learning multiple neural networks (DLMNNs) optimized with chicken swarm optimization (CSO) were developed, with transfer learning enhancing their performance.The DLMNN-CSO model showed promising results, with lower validation loss and fewer parameters than other models, proving effective and efficient on the Shenzhen and Montgomery lung datasets.This study [18] introduces a Hybrid Deep Learning Assisted Chest X-Ray Image Segmentation and Classification system (HDL-ISCTB) for Tuberculosis diagnosis.The system uses Otsu's thresholding to effectively segment the lung areas from the background in chest X-rays, reducing computational demands and noise.After segmentation, the images are analyzed using a CNN-LSTM architecture that combines the robust feature extraction of CNNs with the sequential pattern recognition capabilities of LSTMs.Extensive testing confirms the system's enhanced performance over current methods.
Despite the advantages of transfer learning with VGG19, optimizing these models to suit specific medical tasks remains a critical hurdle, necessitating innovative solutions to enhance their practical utility.The Zebra Optimization Algorithm (ZOA) [19] introduced in this study is inspired by the adaptive strategies of zebras in evading predators, which mimic the dynamic problem-solving required in hyperparameter tuning.ZOA helps in fine-tuning the VGG19 model specifically for TB detection, adjusting its parameters to improve both accuracy and processing time significantly.The new model demonstrates a high degree of consistency, with most metrics surpassing 90%, indicating its robust ability to accurately identify the condition being tested.The uniformity across various metrics suggests that the model is well-calibrated, enhancing its potential utility in clinical settings.
This novel approach not only promises to enhance the diagnostic capabilities for TB but also sets a precedent for applying similar methodologies to other diseases, potentially transforming the landscape of disease diagnosis and management across various health domains.Our study aims to bridge the gap between advanced AI technologies and realworld medical applications, ensuring that the benefits of these technologies can be realized in enhancing public health outcomes, especially in regions most burdened by tuberculosis.

Dataset
To provide a comprehensive overview of the data used in our study titled "Tuberculosis Detection Based on VGG19 Transfer Learning and Zebra Optimization Algorithm," we utilized a carefully curated dataset of chest CT image from Ref. [13], named TB dataset in this paper.This dataset consists of images acquired using a Spiral CT scanner, a rapid imaging device that encircles the patient's body to swiftly produce images and detect lesions.The images were stored in both the Picture Archiving and Communication System (PACS) and the Digital Imaging and Communications in Medicine (DICOM) format.Radiologists annotated the images, noting the size, distribution, and morphology of any lesions found in the CT scans.A maximum of four slices per patient were meticulously chosen through a slice-level selection process for inclusion in the dataset.
Table 1 presents the composition of the dataset.'S' refers to the number of individuals, and 'T' indicates the total number of images per category.The dataset encompasses identical numbers of participants for the group under investigation for suspected pulmonary tuberculosis (PT) and the group without disease symptoms (ND), each with 68 subjects.The count of images stands at 144 in both categories.Within the PT group, the male to female ratio is 50 to 18, while the ND group contains 38 males and 28 females.3 Methodology

Dataset Preparation and Augmentation
Preprocessing of the dataset involved a series of systematic transformations to standardize the images for the VGG19 network.Each image was resized to 224×224 pixels to fit the input dimensions required by the network architecture.A grayscale conversion was applied to all images to maintain focus on structural patterns over color variance, followed by histogram equalization to enhance contrast, thereby accentuating pulmonary details crucial for TB identification.
To bolster the generalizability of our model, we implemented a multi-faceted data augmentation strategy, incorporating the hyperparameters of VGG19 optimized by the Zero-Order Optimization Algorithm (ZOA), with a learning rate of 0.001 and a batch size of 32.The dataset was split into training (80%), validation (10%), and test sets (10%).This approach aimed to mimic the variability encountered in clinical settings.We applied geometric transformations such as rotations (both clockwise and counterclockwise up to a certain degree), translations (mimicking patient positioning variations), and flips (horizontal and vertical).Additionally, we employed zoom operations to simulate variations in image scale, as well as random cropping to replicate the diversity in field-of-view encountered in different X-ray machines.These augmentation techniques were paramount in building a model that is resilient to overfitting and capable of maintaining high performance on real-world, heterogeneous data.

Figure 1. One TB image in TB dataset
This CT scan, Figure 1, from the dataset exhibits classic indicators of pulmonary tuberculosis, characterized by nodules, cavities, and infiltrates, primarily located in the upper lobes of the lungs.A prominent cavity is visible, indicative of tissue destruction due to infection.Cavities such as these are typically encased in dense tissue, which signifies the body's immunological reaction to the bacterial infection.A thick-walled cavity in the right upper portion of the lung is observed, commonly associated with post-primary tuberculosis.Surrounding the cavity, patchy opacities suggest extended lung involvement.

VGG19 Transfer Learning
Transfer learning, a machine learning technique where a model developed for one task is reused as the starting point for another task, is particularly beneficial in the field of medical imaging due to the typically limited datasets available for training.In our study, we capitalize on this method using the VGG19 architecture in Figure 2, a model renowned for its success in image recognition tasks, which includes an in-depth understanding of intricate image features.
VGG19 is an appealing choice for this study's objectives for several reasons.Its architecture, characterized by its depth-19 layers with weights-allows it to learn a hierarchy of features.Early layers capture basic image features such as edges and textures, while deeper layers can recognize more complex patterns that are often crucial in medical diagnostics.Additionally, VGG19's uniform architecture simplifies the optimization process compared to more complex models, making it a suitable candidate for transfer learning [20].
The transfer learning process began with freezing the early convolutional layers of the VGG19 network to retain the generic features they had learned from ImageNet.The subsequent layers were fine-tuned using TB Dataset, allowing the network to adapt its more complex feature detectors to the specific task of identifying TB-related abnormalities in chest X-rays.This strategy of freezing and fine-tuning is chosen to preserve the vast knowledge gained from ImageNet while adapting the model efficiently to the medical domain with limited TB-specific data.
By leveraging the VGG19 model through transfer learning, we aim to reduce the computational cost and time typically associated with training deep learning models from scratch.Furthermore, this method circumvents the need for large-scale medical datasets, which are often not available due to privacy concerns and the rarity of certain conditions.The adoption of VGG19 transfer learning is expected to yield a highly accurate and sensitive model capable of assisting radiologists in the early detection of tuberculosis, ultimately contributing to better patient outcomes and resource allocation in healthcare settings.

Zebra Optimization Algorithm
Optimization is a critical component in enhancing the performance of deep learning models.The Zebra Optimization Algorithm (ZOA) emerges as a novel method inspired by the behavior and social dynamics of zebras in the wild.The architecture is shown as Figure 3 Just as zebras move strategically within a herd to optimize their safety against predators, ZOA applies a similar principle to the process of hyperparameter tuning in neural networks.

Figure 3. Flowchart of ZOA
The ZOA mimics the zebras' herd dynamics, translating their survival patterns into an algorithmic search for the optimal hyperparameters that reduce loss functions and improve predictive accuracy.It initializes with a diverse set of potential solutions within the hyperparameter space, iteratively refining these candidates by evaluating their performance using a defined fitness function, akin to the accuracy metric of a model validated on a subset of data.
Iterative updates of potential solutions in the ZOA are guided by heuristic rules, mirroring the zebras' interactions and movements.Such updates involve aligning with neighboring promising candidates and incorporating stochastic elements to evade local optima, analogous to a zebra's evasion from predators, hence avoiding premature convergence to suboptimal solutions [21].
The ZOA was utilized to fine-tune key parameters, such as the learning rate, batch size, and number of training epochs, within the VGG19 architecture.The algorithm efficiently navigates the hyperparameter space, often achieving superior optimization as compared to conventional methods, as indicated by improved accuracy in tuberculosis detection from chest X-ray images.
The introduction of the Zebra Optimization Algorithm into hyperparameter optimization showcases the potential of biomimicry in computational tasks.By leveraging bioinspired algorithms, ZOA not only refines the VGG19's ability for medical diagnostics but also sets a precedent for developing innovative approaches in complex parameter space exploration across various deep learning applications.

K-fold Cross Validation
K-fold cross-validation is a model validation technique used to assess the predictive performance of machine learning models.It is particularly useful when dealing with limited datasets, a common scenario in specialized domains such as medical imaging.This method allows for the efficient use of available data by partitioning the dataset into 'k' equally sized folds or subsets.
In k-fold cross-validation, the data is randomly divided into 'k' subsets.During the validation process, one subset is retained as the validation data for testing the model, and the remaining 'k-1' subsets are used as training data.The crossvalidation process is then repeated 'k' times (the folds), with each of the 'k' subsets used exactly once as the validation data.This approach ensures that every observation from the original dataset has the chance to appear in the training and validation set, which is critical for models where every data point is valuable.
The results from the folds can then be averaged to produce a single estimation.The advantage of this method over a random train-test split is that it reduces the variance of a single trial of train-test split, providing a more accurate reflection of the model's ability to generalize to an independent dataset.The key benefit is that k-fold crossvalidation provides a robust way to evaluate models on a limited sample size, giving insights into how the model is expected to perform on unseen data.
In the context of medical diagnostics, where the VGG19 model is employed for detecting tuberculosis from X-ray images, k-fold cross-validation helps in mitigating overfitting and allows for a comprehensive evaluation of the model's performance.By utilizing all available data for both training and validation, this technique ensures that the assessment of the model's diagnostic capabilities is as accurate and generalizable as possible.
Figure 4 illustrates how K-Fold Cross-Validation with (K=10) partitions the dataset for model evaluation.The dataset is segmented into 'K' subsets, as depicted by the series of circles.In each of the 'K' iterations (trials), a different subset is utilized as the test set (indicated by the yellow portion of the circle), and the union of the remaining subsets is used as the training set (indicated by the blue portion of the circles).This systematic approach ensures that each subset is used exactly once as the test set, allowing for a comprehensive evaluation across the entire dataset.The process aims to yield a robust estimate of the model's performance by averaging the evaluation metrics from all 'K' iterations.

Evaluation Metrics
When developing a diagnostic model, it's essential to assess its performance comprehensively, which is where a carefully chosen set of metrics comes into play.Sensitivity, or the true positive rate, reveals the model's ability to correctly identify those with the disease, which is critical in preventing the oversight of treatable conditions.Conversely, specificity measures the model's precision in ruling out disease where it doesn't exist, thereby preventing unnecessary treatment interventions for healthy individuals.
Precision, sometimes referred to as the positive predictive value, indicates the likelihood that patients identified by the model actually have the disease, ensuring that medical resources are allocated efficiently.Accuracy gives an overarching view of the model's performance, combining the true positives and negatives; however, it can be misleading in skewed datasets where the prevalence of one class distorts the metric.
The F1 score comes into play when equal importance is placed on precision and sensitivity, typically in imbalanced datasets where overlooking either false positives or negatives could be costly.The Matthews Correlation Coefficient is another robust metric that evaluates the model's quality across all quadrants of the confusion matrix, making it reliable even when data is unevenly distributed.
Lastly, the Fowlkes-Mallows Index provides insights into the model's discriminative power, echoing how well the model differentiates between disease states, crucial for targeted treatments.Together, these metrics form a multifaceted evaluative framework that ensures the model's effectiveness in the nuanced realm of medical diagnosis, where accuracy is not just a measure of performance but a necessity for patient care.
Analyzing the model's performance, we see a high level of consistency, with most metrics exceeding 90%, reflecting the model's strong capability in accurately identifying the condition being tested for.The F1 Score, hovering around 93%, suggests a balanced detection rate of true positives and true negatives, indicating robustness against imbalanced datasets.
While the Matthews Correlation Coefficient shows a bit more fluctuation than other metrics, it still signifies a solid predictive performance, as it takes into account the entire confusion matrix, indicating a strong positive correlation.
The Fowlkes-Mallows Index's consistently high values indicate that the model maintains a desirable balance between precision and sensitivity.This reinforces the model's credibility in accurately classifying data across diverse test scenarios, ensuring its reliability in practical applications.
With the Mean Standard Deviation remaining low across all metrics, the data indicates little variability in the model's performance, suggesting that the model is reliable and stable across multiple runs.This level of performance is particularly important in medical diagnostics, where accurate and consistent predictions are crucial for patient care.The uniformity across these metrics further suggests that the model is well-calibrated, enhancing its potential utility in clinical settings.

K Trials
The Whole Dataset

Comparison to State-of-the-art Approaches
Upon examining Table 3, it is evident that the models exhibit commendable performance, with a majority attaining scores in excess of 90% across a multitude of evaluative criteria.Such results underscore the models' robustness and their adeptness at handling the specified task.The error margins, denoted by ±values, provide insight into the models' performance variability across diverse testing scenarios.This variability is indicative of the models' resilience and their capacity to maintain consistent performance despite fluctuations in testing conditions.The data presented in the table thus reflects not only the efficacy of the algorithms but also their reliability and stability within the scope of the task at hand.Regarding sensitivity, the DLMMN model has the highest score at 92.99%, suggesting it excels in identifying true positives.VGG-ZOA, while slightly lower in sensitivity, has a smaller error margin, implying more consistent performance.For specificity, VGG-ZOA leads with a score of 93.40%, showcasing its superiority in correctly identifying negatives.
In terms of precision and accuracy, VGG-ZOA has the highest precision at 93.50%, and it also leads in accuracy with a score of 93.89%, closely followed by DLMMN at 93.37%.The F1 score, a balanced metric of precision and recall, shows a small difference between VGG-ZOA and DLMMN, indicating that both models perform well in balancing these measures.VGG-ZOA again takes the lead in the Matthews correlation coefficient with 87.82%, suggesting optimal performance when considering all quadrants of the confusion matrix.
For the F-measure index, VGG-ZOA is again at the forefront with a score of 93.93%, highlighting its advantage in combining precision and recall.Overall, VGG-ZOA either leads or closely follows in most key performance metrics, indicating a significant overall performance advantage.This might position it as the preferred model for specific tasks, especially considering the relatively small error margins, which suggest stability across different test environments.

Conclusions
This investigation validates the efficacy of a VGG19 and Zebra Optimization Algorithm (ZOA) amalgamation for tuberculosis detection in chest radiographs.The empirical results delineate a notable augmentation in diagnostic precision when juxtaposed with traditional modalities, as evidenced by enhanced accuracy, sensitivity, and specificity metrics.This study's conclusion advocates for the utility of hybrid deep learning approaches in medical image diagnostics, setting a precedent for future computational methodologies.The ZOA's biologically-inspired optimization strategy emerges as a particularly potent innovation, meriting further exploration within this domain.Additionally, its application can be extended to various other medical imaging challenges, heralding a new era of precision diagnostics.

EAI
Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024

EAI
Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024
Training Test EAI Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024

Table 2 .
Performance of K-Fold Cross-Validation Across 10 Runs

Table 3 .
Results of comparison of State-of-the-art Approaches EAI Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024