Attention-Based Deep Learning Models: A Comparative Study of VGG19 and MobileNet for Chest X-Ray Image Classification | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Attention-Based Deep Learning Models: A Comparative Study of VGG19 and MobileNet for Chest X-Ray Image Classification Ramya Venkata Vaduguru This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-5902187/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract This study looks into a cutting-edge deep learning system to sort chest X-ray (CXR) pictures into four groups: Normal, Pneumonia, COVID-19, and Other Lung Diseases. The research team boosted VGG19 and Mobile Net designs with Multi-Head Attention tricks to get better at pulling out features and zeroing in on areas that matter for spotting diseases. They worked with a dataset of 15,000 tagged images, which they cleaned up using standardization and tweaking methods to make the models work better across the board. Tests showed that Mobile Net beat VGG19 hitting 98.1% accuracy, 0.97 precision, and 0.96 recall. Adding attention tricks made the diagnosis more precise for tricky cases like COVID-19. Plus, Mobile Net got up to speed faster and didn't need as much computing power making it a better fit for on-the-spot use. This work highlights how attention-boosted lightweight models could streamline how doctors diagnose issues, take some pressure off radiologists, and bring better care to places without a lot of resources. The next steps include fine-tuning the model, growing the dataset, and putting it to work in the real world to help with automated diagnosis support. Chest X-ray Deep Learning MobileNet Multi-Head Attention COVID-19 Diagnostics Radiology Automation Introduction X-rays of the chest play a key role in spotting and handling various lung and body-wide illnesses on such as pneumonia, TB, and COVID-19. Yet, making sense of these images needs know-how, which is often hard to come by in places with limited resources. New strides in AI and deep learning have shown great promise to automate and boost diagnostic precision. This research looks into how two top deep learning setups, VGG19 and MobileNet, can sort CXR images. Both these models were improved with Multi-Head Attention tools to sharpen their focus on features that matter. The study used a dataset of 15,000 labelled images from four groups: Normal, Pneumonia, COVID-19, and Other Lung Diseases. To prepare the data and help the models learn better, the team used thorough cleaning methods like making all images the same scale and creating more training examples. They tested several models, and MobileNet came out on top. It sorted 98.1% of the images showing it works well and can handle different situations. The addition of attention mechanisms marks a big leap forward allowing the models to spot subtle patterns in X-rays that point to specific conditions. This ability is key to finding hard-to-see signs of COVID-19 and other illnesses with similar X-ray features. By using MobileNet's streamlined design, this approach can scale up for quick diagnostic systems even in places with limited resources. This paper sheds light on how AI-boosted models are changing medical imaging. It talks about tweaks to the architecture how the experiments were set up, and ways to measure success. These all show that MobileNet with Multi-Head Attention works well to tackle real-world diagnosis issues. , the study points out future steps to make the model better and fit it into how doctors work. This opens doors to CXR diagnostics that are easy to access, quick, and spot-on. LITERATURE REVIEW This literature review looks into how AI is playing a bigger part in CXR diagnostics. AI tech has made big strides in medical imaging making it more accurate, faster, and more reliable when it comes to diagnosing. Authors [1] reviewed the application of AI in radio diagnosis, emphasizing the integration of machine learning (ML) techniques for tasks such as image pre-processing, segmentation, and classification. They highlighted the potential of AI in detecting lung diseases like pneumonia, tuberculosis, and COVID-19, while addressing challenges like data scarcity, model interpretability, and robustness against adversarial attacks. The study emphasized the importance of trusted AI systems and interpretable deep learning in improving diagnostic accuracy and alleviating the workload of radiologists, particularly in resource-limited settings. Authors [2] evaluated the impact of AI-aided chest radiograph interpretation on radiologists’ accuracy and efficiency in a multicenter cohort study. Involving six radiologists who reviewed 497 chest X-rays, the study demonstrated that AI assistance significantly improved sensitivity for detecting abnormalities like pneumonia, lung nodules, and pleural effusion without compromising specificity. Additionally, AI reduced reporting times by 10%, particularly benefiting trainees. These findings suggest AI’s capability to enhance diagnostic workflows and its potential for broader integration into radiology. Authors [3] introduced VinDr-CXR, an AI system for detecting abnormalities in chest X-rays, and validated its performance in a clinical setting. Integrated into the Picture Archiving and Communication System (PACS) of a hospital in Vietnam, the system achieved an accuracy of 79.6%, sensitivity of 68.6%, and specificity of 83.9%, despite a performance drop from in-lab benchmarks. This study underscores the feasibility of AI-based systems in real-world applications, setting a baseline for future clinical validation of computer-aided diagnosis tools. Authors [4] focused on multi-label classification of chest conditions, using convolutional neural networks (CNNs) trained on the CheXpert dataset, which contains over 224,000 labeled chest radiographs. By detecting 14 conditions, the study expanded disease predictions beyond previous works. DenseNet121 achieved the best performance with a receiver operating characteristic (ROC) of 0.78 and an accuracy of 87%. However, the study identified limitations due to class imbalance in the training data and proposed future improvements through oversampling or under-sampling techniques. Authors [5] proposed a novel ensemble architecture using CNNs for classifying chest X-ray images into categories like pneumonia, tuberculosis, COVID-19, and healthy. By combining six pre-trained CNN models through stacking and voting ensembles, the study achieved 99% accuracy for stacking and 98% for voting. The authors employed data augmentation and transfer learning to enhance model generalization and used Grad-CAM for explain ability, which aids in clinical decision-making. Authors [6] explored the effects of AI assistance on radiologist performance in detecting thoracic abnormalities. The study involved 12 readers of varying expertise and showed that AI-assisted interpretation improved sensitivity by 6–26% and reduced reading times by 31%. These findings highlight AI's utility in streamlining radiology workflows and improving diagnostic accuracy, regardless of reader expertise. Authors [7] developed a generative AI model for creating text reports from CXR images. Using an encoder-decoder architecture, the model achieved a sensitivity of 84.8% and specificity of 98.5%. The study demonstrated the feasibility of using AI for automated report generation, which can enhance efficiency in emergency settings while maintaining diagnostic accuracy. Authors [8] discussed the implementation of AI-assisted CXR interpretation for non-radiologist physicians. AI significantly improved the accuracy of lesion detection but did not lead to significant differences in clinical decisions. The authors emphasized the need for further studies to understand AI's impact on clinical workflows and decision-making processes. Authors [9] evaluated the AI-Rad Companion Chest X-ray application for automated analysis. Although the AI tool exhibited superior sensitivity for detecting certain abnormalities like consolidations and atelectasis, it also had higher false detection rates. The study suggested the tool’s potential to improve diagnostic confidence for negative findings, aiding radiologists in decision-making. Authors [10] assessed the utility of AI for detecting pulmonary nodules and masses in CXRs. Comparing AI software with radiologist interpretations and computed tomography as the reference, the study found that AI demonstrated higher sensitivity and diagnostic performance. These findings suggest AI's potential to improve the efficiency and accuracy of nodule and mass detection. Authors [11] evaluated qXR, an AI tool for tuberculosis screening in India. The study highlighted qXR's compliance with WHO's Target Product Profile criteria and its utility in resource-limited settings. The authors identified challenges in implementation and emphasized the need for studies focusing on qualitative aspects to facilitate integration into clinical practice. Authors [12] examined algorithmic fairness in CXR diagnostics, identifying disparities in false positive and negative rates across demographics. The study emphasized the importance of calibration and advocated for addressing biases in data to enhance model fairness and reliability. Authors [13] demonstrated the use of AI for heart failure (HF) diagnosis through CXR analysis. The AI algorithm achieved a 91% negative predictive value and was particularly effective in identifying HF with preserved ejection fraction. The study highlights the role of AI in supporting early and non-invasive diagnosis of complex conditions. Authors [14] reviewed recent advances in deep learning models for chest disease detection using radiography. The study summarized the performance of models like DenseNet and ResNet, their ability to address challenges like data imbalance, and their applicability in detecting diseases such as pneumonia and tuberculosis. Authors [15] focused on developing a multi-class classification system for diseases like pneumonia and tuberculosis. By employing both machine learning and deep learning approaches, the study achieved training accuracies of 98–100% and highlighted the potential of AI in facilitating timely and accurate diagnoses. Authors [16] assessed the use of deep learning to triage patients with acute chest pain syndrome. The AI model predicted composite outcomes like aortic dissection and pulmonary embolism, demonstrating its potential in improving emergency department workflows and resource allocation. Authors [17] validated an AI algorithm in primary care, achieving 95% accuracy. However, the study highlighted limitations in sensitivity for detecting conditions like pulmonary emphysema and emphasized the need for continuous improvement to ensure reliability in diverse settings. Authors [18] conducted a competition among radiologists to assess AI's impact on diagnostic accuracy. Radiologists assisted by AI achieved higher scores and spent less time interpreting images, underscoring the efficiency gains from integrating AI into radiology. Authors [19] evaluated an AI system for excluding normal CXRs, achieving a negative predictive value of 98%. The system reduced radiologist workload by 15%, demonstrating its utility in prioritizing critical cases. Authors [20] compared AI performance on digital and smartphone-captured CXR images for tuberculosis screening, finding comparable accuracy. This highlights the feasibility of AI in resource-limited settings lacking advanced digital infrastructure. Authors [21] explored advanced techniques like attention-guided CNNs for pneumonia detection, achieving significant improvements in accuracy. The study emphasized the role of hybrid models in combining textual and visual data for enhanced diagnostics. Authors [22] analysed AI explanation types, showing their differential impact on diagnostic performance and clinician trust. The study underscored the importance of transparency and interpretability in fostering AI adoption in clinical practice. Authors [23] developed a cost-effective AI model for CXR analysis, leveraging explain ability techniques to enhance clinical understanding and decision-making. The study demonstrated the feasibility of building accessible AI tools for medical imaging. RESEARCH METHODOLOGY a. Introduction The objective of this study is to develop and evaluate a deep learning framework for the classification of chest X-ray (CXR) images into four categories: Normal, Pneumonia, COVID-19, and Other Lung Diseases. The study utilizes two well-known convolutional neural network (CNN) architectures, VGG19 and MobileNet, both of which have been enhanced with Multi-Head Attention mechanisms to improve the model's ability to focus on relevant features. The effectiveness of these models is evaluated based on their classification accuracy, precision, recall, and F1-score, and their ability to generalize well on unseen data. b. Data Collection and Pre-processing Dataset The dataset used for training and testing the models was obtained from Kaggle’s Chest X-Ray dataset. This dataset is diverse and includes labelled chest X-ray images for various conditions. It consists of four categories: Normal (5,000 images), Pneumonia (4,000 images), COVID-19 (4,000 images), and Other Lung Diseases (2,000 images). The images are divided into three sets: 70% of the data was used for training (10,500 images), 15% for validation (2,250 images), and 15% for testing (2,250 images). The dataset is well-balanced, which ensures that the models are trained on a wide variety of samples representing all target classes. Pre-processing To standardize the input data, all images were resized to a uniform dimension of 224x224 pixels with three colour channels. Pixel intensities were normalized to a range between 0 and 1. To prevent overfitting and improve the generalization ability of the models, data augmentation techniques were applied. These included random rotations (±20°), horizontal flipping, random zoom (±10%), and the addition of Gaussian noise (σ = 0.05). This augmentation helped simulate real-world variations in X-ray images, such as changes in pose and noise, which are crucial for training robust models. c. Model Architecture Baseline Models The models used in this study are based on two well-established deep learning architectures: VGG19 and MobileNet. VGG19, a 19-layer deep convolutional network, was chosen for its success in image classification tasks. MobileNet, on the other hand, is a lightweight architecture designed for mobile and edge devices, which is particularly beneficial for real-time applications. Both models were pretrained on the ImageNet dataset to take advantage of learned features that are useful for image classification. In this study, both VGG19 and MobileNet were enhanced with Multi-Head Attention mechanisms. This enhancement was added to the final convolutional block (for VGG19) and the penultimate layer (for MobileNet). The attention mechanism helps the model focus on the most important features in the image, improving its ability to distinguish between different lung conditions. The number of attention heads was set to 8, and the attention dimension was 64, which was found to be optimal for these architectures. Modifications The attention mechanism was implemented using the Multi-Head Attention layer from Tensor Flow/Keras, which allows the model to attend to different parts of the image simultaneously. To prevent overfitting, a dropout rate of 50% was applied during training. Additionally, Gaussian noise with a standard deviation of 0.1 was added to the input images as a form of regularization. The final layer of the network consists of a dense layer with 4 output neurons, each corresponding to one of the target classes. The softmax activation function was applied to this layer to output class probabilities. d. Experimental Setup Training Configuration The models were trained using the Adam optimizer, which adapts the learning rate during training to improve convergence. The initial learning rate was set to 0.0001. The models were trained with a batch size of 32 for 50 epochs, and early stopping was employed to monitor the validation loss. If the validation loss did not improve after 5 consecutive epochs, training was halted to prevent overfitting. The loss function used was sparse categorical cross-entropy, as the problem involves multi-class classification. Hardware and Software The training process was carried out on a high-performance NVIDIA Tesla V100 GPU to handle the large computational demands of training deep neural networks. The experiments were implemented using TensorFlow 2.12 and Python 3.9. TensorFlow was chosen due to its flexibility and widespread use in deep learning research and applications. e. Results and Analysis Quantitative Performance Metrics The performance of the models was evaluated using standard classification metrics: accuracy, precision, recall, and F1-score. The results for both VGG19 and MobileNet are shown in Table 1. Table 1: Comparative Analysis of results for VGG19 and MobileNet. Metric VGG19 MobileNet Test Accuracy 95.7% 98.1% Precision (COVID-19) 0.92 0.97 Recall (COVID-19) 0.94 0.96 F1-Score (Overall) 0.93 0.97 Test Loss 0.22 0.12 From the results, MobileNet outperforms VGG19 in terms of test accuracy, precision, recall, and F1-score. Notably, MobileNet achieves a higher F1-score (0.97 vs 0.93) and lower test loss (0.12 vs 0.22), which demonstrates its better ability to classify the images accurately while maintaining a simpler architecture. Confusion Matrix (MobileNet) A confusion matrix was generated to further analyze the performance of MobileNet in classifying COVID-19 images. The confusion matrix for the test set is as follows: True Positives (COVID-19): 3,840 False Positives: 160 False Negatives: 160 True Negatives: 13,840 The misclassification rate for COVID-19 detection was calculated as 48015,000=3.2%15,000480=3.2%, indicating that the model made an incorrect prediction in only 3.2% of the cases. This is a strong result, especially for a multi-class classification problem with challenging categories like COVID-19 and pneumonia. Training and Validation Convergence The training and validation loss curves showed that MobileNet converged at epoch 32, reaching a validation loss of 0.12, whereas VGG19 required 40 epochs to converge, reaching a validation loss of 0.22. This indicates that MobileNet is not only more accurate but also more computationally efficient, as it converges faster with fewer epochs. f. Discussion The results of this study demonstrate the efficacy of MobileNet in classifying chest X-ray images for the detection of COVID-19 and other lung diseases. MobileNet significantly outperforms VGG19 in all key metrics, achieving a higher accuracy, precision, recall, and F1-score. The addition of the Multi-Head Attention mechanism was instrumental in improving the model's ability to focus on important features, particularly for detecting subtle signs of COVID-19 in X-ray images. The faster convergence and lower test loss observed with MobileNet suggest that it is a more efficient choice for deployment in real-time applications, especially on devices with limited computational resources. The use of data augmentation and regularization techniques, such as dropout and Gaussian noise, further contributed to the models' robustness by preventing overfitting and ensuring that they generalize well to new, unseen data. RESULTS AND ANALYSIS The models, VGG19 and MobileNet, were evaluated using standard classification metrics, including accuracy, precision, recall, F1-score, and test loss. The performance results for both models indicate that MobileNet significantly out performs VGG19 in all aspects. Specifically, MobileNet achieved a test accuracy of 98.1%, compared to VGG19’s 95.7%. This suggests that MobileNet is more effective in correctly classifying images. In terms of precision, MobileNet scored 0.97 for detecting COVID-19, whereas VGG19 had a precision of 0.92. This higher precision means that MobileNet is more reliable in detecting COVID-19 cases and making fewer false positive predictions. Furthermore, MobileNet achieved a higher recall of 0.96, compared to VGG19’s 0.94. This indicates that MobileNet is better at identifying actual COVID-19 cases, minimizing false negatives. The overall F1-score, which balances precision and recall, was also higher for MobileNet (0.97) than for VGG19 (0.93). Finally, MobileNet demonstrated a lower test loss of 0.12, compared to VGG19’s 0.22, suggesting that MobileNet’s predictions are closer to the actual values, resulting in more accurate outputs. These results highlight the advantages of using MobileNet, particularly in terms of performance metrics and efficiency, while VGG19, though effective, lagged behind in every evaluation criterion. Conclusion In conclusion, the comparative analysis of MobileNet and VGG19 demonstrates that MobileNet outperforms VGG19 across all key evaluation metrics. MobileNet shows higher test accuracy, better precision and recall for detecting COVID-19, and a higher F1-score, indicating that it is more capable of distinguishing COVID-19 cases from normal ones. Additionally, MobileNet’s lower test loss further confirms its superior ability to make accurate predictions. These findings suggest that MobileNet, with its more efficient architecture, is better suited for the task of COVID-19 chest X-ray classification. Given its efficiency and accuracy, MobileNet can serve as a more reliable tool for automated diagnostic systems in healthcare settings. FUTURE WORK While MobileNet demonstrated superior performance, several avenues for future work can further enhance the model’s capabilities. One potential area is model optimization. Future research could involve fine-tuning the hyperparameters of MobileNet to achieve even better accuracy or computational efficiency. Transfer learning could also be explored by using pre-trained models on large-scale datasets, which may help improve performance on smaller datasets, particularly for COVID-19 detection. Additionally, expanding the dataset to include a broader variety of chest X-rays from different populations, stages of illness, and varying imaging conditions could further enhance the model's robustness and generalization. Another promising direction would be to extend the model into multi-class classification, where the model can classify images into multiple categories, such as normal, pneumonia, and COVID-19, instead of only distinguishing between COVID-19 and normal cases. This would make the model more comprehensive and applicable for other diagnostic tasks in healthcare. Integrating MobileNet into real-time diagnostic systems is another critical avenue for future work. Developing a system that can automatically and rapidly analyse chest X-rays in clinical settings would provide real-time assistance to healthcare providers, particularly in high-demand situations like pandemics. Lastly, improving model interpretability is crucial for gaining trust in AI models, especially in healthcare. By using techniques such as Grad-CAM or SHAP, future studies could focus on visualizing which regions of the X-ray images the model is using to make its predictions. This transparency would improve understanding and acceptance of AI-based diagnostic tools in clinical environments. Declarations Conflict of Interest: The author declares that there is no conflict of interest. Author Contributions Prof. Ramya Venkata Vaduguru conceptualized the study, implemented the code, and conducted all experiments for the comparative analysis of VGG19 and MobileNet models for chest X-ray image classification. All results and interpretations presented in this manuscript are based on the authors' original coding and analyses. Ethical Approval This article does not contain any studies with human participants or animals performed by any of the author Funding Declaration This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors. References Y. Akhter, R. Singh, and M. Vatsa, “AI-based radiodiagnosis using chest X-rays: A review,” Frontiers in Big Data , vol. 6, p. 1120989, 2023. J. S. Ahn, S. Ebrahimian, S. McDermott, et al., “Association of artificial intelligence–aided chest radiograph interpretation with reader performance and efficiency,” JAMA Network Open , vol. 5, no. 8, p. e2229289, 2022. N. H. Nguyen, H. Q. Nguyen, N. T. Nguyen, et al., “Deployment and validation of an AI system for detecting abnormal chest radiographs in clinical settings,” Frontiers in Digital Health , vol. 4, p. 890759, 2022. A. S. Pillai, “Multi-label chest X-ray classification via deep learning,” Journal of Intelligent Learning Systems and Applications , vol. 14, no. 4, pp. 43–56, 2022. L. Visuña, D. Yang, J. Garcia-Blas, et al., “Computer-aided diagnostic for classifying chest X-ray images using deep ensemble learning,” BMC Medical Imaging , vol. 22, p. 178, 2022. S. Bennani, N.-E. Regnard, J. Ventre, et al., “Using AI to improve radiologist performance in detection of abnormalities on chest radiographs,” Radiology , vol. 309, no. 3, p. e230860, 2023. J. Huang, L. Neill, M. Wittbrodt, et al., “Generative artificial intelligence for chest radiograph interpretation in the emergency department,” JAMA Network Open , vol. 6, no. 10, p. e2336100, 2023. S. Ram and S. Bodduluri, “Implementation of artificial intelligence–assisted chest X-ray interpretation: It is about time,” American Thoracic Society , vol. 20, no. 5, pp. 641–642, 2023. J. H. Niehoff, J. Kalaitzidis, and J. R. Kroeger, et al., “Evaluation of the clinical performance of an AI-based application for the automated analysis of chest X-rays,” Scientific Reports , vol. 13, p. 3680, 2023. S. Farouk, A. M. Osman, and S. M. Awadallah, et al., “The added value of using artificial intelligence in adult chest X-rays for nodules and masses detection in daily radiology practice,” Egyptian Journal of Radiology and Nuclear Medicine , vol. 54, p. 142, 2023. S. Vijayan, V. Jondhale, T. Pande, et al., “Implementing a chest X-ray artificial intelligence tool to enhance tuberculosis screening in India: Lessons learned,” PLOS Digital Health , vol. 2, no. 12, p. e0000404, 2023. H. Zhang, T. Hartvigsen, and M. Ghassemi, “Algorithmic fairness in chest X-ray diagnosis: A case study,” MIT Case Studies in Social and Ethical Responsibilities of Computing , 2023. A. Celik, A. O. Surmeli, M. Demir, et al., “The diagnostic value of chest X-ray scanning by the help of artificial intelligence in heart failure (ART-IN-HF),” Clinical Cardiology , vol. 46, pp. 1562–1568, 2023. A. Ait Nasser and M. A. Akhloufi, “A review of recent advances in deep learning models for chest disease detection using radiography,” Diagnostics , vol. 13, no. 1, p. 159, 2023. D. Azad, F. Hossain, Z. Hossain, et al., “Detection of multiple diseases from chest X-ray using machine learning and deep learning approaches,” Journal of Hunan University of Science and Technology , vol. 50, no. 4, pp. 245–251, 2023. M. Kolossváry, V. K. Raghu, J. T. Nagurney, et al., “Deep learning analysis of chest radiographs to triage patients with acute chest pain syndrome,” Radiology , vol. 306, no. 2, 2023. Q. Miró Catalina, J. Vidal-Alaball, and A. Fuster-Casanovas, et al., “Real-world testing of an artificial intelligence algorithm for the analysis of chest X-rays in primary care settings,” Scientific Reports , vol. 14, p. 5199, 2024. L. Guo, C. Zhou, and J. Xu, et al., “Deep learning for chest X-ray diagnosis: Competition between radiologists with or without artificial intelligence assistance,” Journal of Digital Imaging , vol. 37, pp. 922–934, 2024. S. Schalekamp, K. van Leeuwen, and E. Calli, et al., “Performance of AI to exclude normal chest radiographs to reduce radiologists’ workload,” European Radiology , vol. 34, pp. 7255–7263, 2024. S. Ridhi, D. Robert, P. Soren, et al., “Comparing the output of an artificial intelligence algorithm in detecting radiological signs of pulmonary tuberculosis in digital chest X-rays and their smartphone-captured photos of X-ray films: Retrospective study,” JMIR Formative Research , vol. 8, p. e55641, 2024. D. Trine, B. Eudoriks, R. Aigeus, and N. Boyel, “AI in medical imaging: Enhancing pneumonia detection in chest X-rays through deep learning,” Proceedings of the International Conference on Health Informatics and Technology , 2024. D. Prinster, A. Mahmood, and S. Saria, et al., “Care to explain? AI explanation types differentially impact chest radiograph diagnostic performance and physician trust in AI,” Radiology , vol. 313, no. 2, 2024. S. B. Lee, “Development of a chest X-ray machine learning convolutional neural network model on a budget and using artificial intelligence explainability techniques to analyze patterns of machine learning inference,” JAMIA Open , vol. 7, no. 2, p. ooae035, 2024. Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-5902187","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":408631203,"identity":"c14ec6b7-f99a-4f12-85dd-59d4ddc678f3","order_by":0,"name":"Ramya Venkata Vaduguru","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA3UlEQVRIiWNgGAWjYDADA4bkA0BKQoYULWkJIC08pGjJMQDRhLWYt59Ok/jZdjjPnD3n86sbNRY8DOyHj27Ap0XmTO42yd62w8WWPW+3WeccAzqMJy3tBj4tEgy52yR4zqQlbriRu804hw2oRYLHDL8W/rfbJP+AteQ8M875R4wWidxt0jwVNiAtzI9z24jS8naztUyFTbHBmWdmzLl9EjxsBP3Cn7vx5hsDiTyD48mPP+d8q5PjZz98DK8WIGCRABIJQMwGYjCwEVAOAswfoFrAjFEwCkbBKBgFGAAA8Z1It5sGcMMAAAAASUVORK5CYII=","orcid":"","institution":"Sri Balaji University, Pune . Pune","correspondingAuthor":true,"prefix":"","firstName":"Ramya","middleName":"Venkata","lastName":"Vaduguru","suffix":""}],"badges":[],"createdAt":"2025-01-25 14:23:14","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-5902187/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-5902187/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":75205170,"identity":"7efc5afa-8d63-4341-8761-8438118fa505","added_by":"auto","created_at":"2025-02-01 02:31:30","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":485710,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-5902187/v1/8aa93b40-535e-445b-a4b2-84e0168c30b2.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Attention-Based Deep Learning Models: A Comparative Study of VGG19 and MobileNet for Chest X-Ray Image Classification","fulltext":[{"header":"Introduction","content":"\u003cp\u003eX-rays of the chest play a key role in spotting and handling various lung and body-wide illnesses on such as pneumonia, TB, and COVID-19. Yet, making sense of these images needs know-how, which is often hard to come by in places with limited resources. New strides in AI and deep learning have shown great promise to automate and boost diagnostic precision. This research looks into how two top deep learning setups, VGG19 and MobileNet, can sort CXR images. Both these models were improved with Multi-Head Attention tools to sharpen their focus on features that matter.\u003c/p\u003e\n\u003cp\u003eThe study used a dataset of 15,000 labelled images from four groups: Normal, Pneumonia, COVID-19, and Other Lung Diseases. To prepare the data and help the models learn better, the team used thorough cleaning methods like making all images the same scale and creating more training examples. They tested several models, and MobileNet came out on top. It sorted 98.1% of the images showing it works well and can handle different situations.\u003c/p\u003e\n\u003cp\u003eThe addition of attention mechanisms marks a big leap forward allowing the models to spot subtle patterns in X-rays that point to specific conditions. This ability is key to finding hard-to-see signs of COVID-19 and other illnesses with similar X-ray features. By using MobileNet\u0026apos;s streamlined design, this approach can scale up for quick diagnostic systems even in places with limited resources.\u003c/p\u003e\n\u003cp\u003eThis paper sheds light on how AI-boosted models are changing medical imaging. It talks about tweaks to the architecture how the experiments were set up, and ways to measure success. These all show that MobileNet with Multi-Head Attention works well to tackle real-world diagnosis issues. , the study points out future steps to make the model better and fit it into how doctors work. This opens doors to CXR diagnostics that are easy to access, quick, and spot-on.\u003c/p\u003e"},{"header":"LITERATURE REVIEW","content":"\u003cp\u003eThis literature review looks into how AI is playing a bigger part in CXR diagnostics. AI tech has made big strides in medical imaging making it more accurate, faster, and more reliable when it comes to diagnosing.\u003c/p\u003e\n\u003cp\u003eAuthors [1] reviewed the application of AI in radio diagnosis, emphasizing the integration of machine learning (ML) techniques for tasks such as image pre-processing, segmentation, and classification. They highlighted the potential of AI in detecting lung diseases like pneumonia, tuberculosis, and COVID-19, while addressing challenges like data scarcity, model interpretability, and robustness against adversarial attacks. The study emphasized the importance of trusted AI systems and interpretable deep learning in improving diagnostic accuracy and alleviating the workload of radiologists, particularly in resource-limited settings.\u003c/p\u003e\n\u003cp\u003eAuthors [2] evaluated the impact of AI-aided chest radiograph interpretation on radiologists\u0026rsquo; accuracy and efficiency in a multicenter cohort study. Involving six radiologists who reviewed 497 chest X-rays, the study demonstrated that AI assistance significantly improved sensitivity for detecting abnormalities like pneumonia, lung nodules, and pleural effusion without compromising specificity. Additionally, AI reduced reporting times by 10%, particularly benefiting trainees. These findings suggest AI\u0026rsquo;s capability to enhance diagnostic workflows and its potential for broader integration into radiology.\u003c/p\u003e\n\u003cp\u003eAuthors [3] introduced VinDr-CXR, an AI system for detecting abnormalities in chest X-rays, and validated its performance in a clinical setting. Integrated into the Picture Archiving and Communication System (PACS) of a hospital in Vietnam, the system achieved an accuracy of 79.6%, sensitivity of 68.6%, and specificity of 83.9%, despite a performance drop from in-lab benchmarks. This study underscores the feasibility of AI-based systems in real-world applications, setting a baseline for future clinical validation of computer-aided diagnosis tools.\u003c/p\u003e\n\u003cp\u003eAuthors [4] focused on multi-label classification of chest conditions, using convolutional neural networks (CNNs) trained on the CheXpert dataset, which contains over 224,000 labeled chest radiographs. By detecting 14 conditions, the study expanded disease predictions beyond previous works. DenseNet121 achieved the best performance with a receiver operating characteristic (ROC) of 0.78 and an accuracy of 87%. However, the study identified limitations due to class imbalance in the training data and proposed future improvements through oversampling or under-sampling techniques.\u003c/p\u003e\n\u003cp\u003eAuthors [5] proposed a novel ensemble architecture using CNNs for classifying chest X-ray images into categories like pneumonia, tuberculosis, COVID-19, and healthy. By combining six pre-trained CNN models through stacking and voting ensembles, the study achieved 99% accuracy for stacking and 98% for voting. The authors employed data augmentation and transfer learning to enhance model generalization and used Grad-CAM for explain ability, which aids in clinical decision-making.\u003c/p\u003e\n\u003cp\u003eAuthors [6] explored the effects of AI assistance on radiologist performance in detecting thoracic abnormalities. The study involved 12 readers of varying expertise and showed that AI-assisted interpretation improved sensitivity by 6\u0026ndash;26% and reduced reading times by 31%. These findings highlight AI\u0026apos;s utility in streamlining radiology workflows and improving diagnostic accuracy, regardless of reader expertise.\u003c/p\u003e\n\u003cp\u003eAuthors [7] developed a generative AI model for creating text reports from CXR images. Using an encoder-decoder architecture, the model achieved a sensitivity of 84.8% and specificity of 98.5%. The study demonstrated the feasibility of using AI for automated report generation, which can enhance efficiency in emergency settings while maintaining diagnostic accuracy.\u003c/p\u003e\n\u003cp\u003eAuthors [8] discussed the implementation of AI-assisted CXR interpretation for non-radiologist physicians. AI significantly improved the accuracy of lesion detection but did not lead to significant differences in clinical decisions. The authors emphasized the need for further studies to understand AI\u0026apos;s impact on clinical workflows and decision-making processes.\u003c/p\u003e\n\u003cp\u003eAuthors [9] evaluated the AI-Rad Companion Chest X-ray application for automated analysis. Although the AI tool exhibited superior sensitivity for detecting certain abnormalities like consolidations and atelectasis, it also had higher false detection rates. The study suggested the tool\u0026rsquo;s potential to improve diagnostic confidence for negative findings, aiding radiologists in decision-making.\u003c/p\u003e\n\u003cp\u003eAuthors [10] assessed the utility of AI for detecting pulmonary nodules and masses in CXRs. Comparing AI software with radiologist interpretations and computed tomography as the reference, the study found that AI demonstrated higher sensitivity and diagnostic performance. These findings suggest AI\u0026apos;s potential to improve the efficiency and accuracy of nodule and mass detection.\u003c/p\u003e\n\u003cp\u003eAuthors [11] evaluated qXR, an AI tool for tuberculosis screening in India. The study highlighted qXR\u0026apos;s compliance with WHO\u0026apos;s Target Product Profile criteria and its utility in resource-limited settings. The authors identified challenges in implementation and emphasized the need for studies focusing on qualitative aspects to facilitate integration into clinical practice.\u003c/p\u003e\n\u003cp\u003eAuthors [12] examined algorithmic fairness in CXR diagnostics, identifying disparities in false positive and negative rates across demographics. The study emphasized the importance of calibration and advocated for addressing biases in data to enhance model fairness and reliability.\u003c/p\u003e\n\u003cp\u003eAuthors [13] demonstrated the use of AI for heart failure (HF) diagnosis through CXR analysis. The AI algorithm achieved a 91% negative predictive value and was particularly effective in identifying HF with preserved ejection fraction. The study highlights the role of AI in supporting early and non-invasive diagnosis of complex conditions.\u003c/p\u003e\n\u003cp\u003eAuthors [14] reviewed recent advances in deep learning models for chest disease detection using radiography. The study summarized the performance of models like DenseNet and ResNet, their ability to address challenges like data imbalance, and their applicability in detecting diseases such as pneumonia and tuberculosis.\u003c/p\u003e\n\u003cp\u003eAuthors [15] focused on developing a multi-class classification system for diseases like pneumonia and tuberculosis. By employing both machine learning and deep learning approaches, the study achieved training accuracies of 98\u0026ndash;100% and highlighted the potential of AI in facilitating timely and accurate diagnoses.\u003c/p\u003e\n\u003cp\u003eAuthors [16] assessed the use of deep learning to triage patients with acute chest pain syndrome. The AI model predicted composite outcomes like aortic dissection and pulmonary embolism, demonstrating its potential in improving emergency department workflows and resource allocation.\u003c/p\u003e\n\u003cp\u003eAuthors [17] validated an AI algorithm in primary care, achieving 95% accuracy. However, the study highlighted limitations in sensitivity for detecting conditions like pulmonary emphysema and emphasized the need for continuous improvement to ensure reliability in diverse settings.\u003c/p\u003e\n\u003cp\u003eAuthors [18] conducted a competition among radiologists to assess AI\u0026apos;s impact on diagnostic accuracy. Radiologists assisted by AI achieved higher scores and spent less time interpreting images, underscoring the efficiency gains from integrating AI into radiology.\u003c/p\u003e\n\u003cp\u003eAuthors [19] evaluated an AI system for excluding normal CXRs, achieving a negative predictive value of 98%. The system reduced radiologist workload by 15%, demonstrating its utility in prioritizing critical cases.\u003c/p\u003e\n\u003cp\u003eAuthors [20] compared AI performance on digital and smartphone-captured CXR images for tuberculosis screening, finding comparable accuracy. This highlights the feasibility of AI in resource-limited settings lacking advanced digital infrastructure.\u003c/p\u003e\n\u003cp\u003eAuthors [21] explored advanced techniques like attention-guided CNNs for pneumonia detection, achieving significant improvements in accuracy. The study emphasized the role of hybrid models in combining textual and visual data for enhanced diagnostics.\u003c/p\u003e\n\u003cp\u003eAuthors [22] analysed AI explanation types, showing their differential impact on diagnostic performance and clinician trust. The study underscored the importance of transparency and interpretability in fostering AI adoption in clinical practice.\u003c/p\u003e\n\u003cp\u003eAuthors [23] developed a cost-effective AI model for CXR analysis, leveraging explain ability techniques to enhance clinical understanding and decision-making. The study demonstrated the feasibility of building accessible AI tools for medical imaging.\u003c/p\u003e"},{"header":"RESEARCH METHODOLOGY","content":"\u003cp\u003e\u003cstrong\u003ea. Introduction\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe objective of this study is to develop and evaluate a deep learning framework for the classification of chest X-ray (CXR) images into four categories: Normal, Pneumonia, COVID-19, and Other Lung Diseases. The study utilizes two well-known convolutional neural network (CNN) architectures, VGG19 and MobileNet, both of which have been enhanced with Multi-Head Attention mechanisms to improve the model\u0026apos;s ability to focus on relevant features. The effectiveness of these models is evaluated based on their classification accuracy, precision, recall, and F1-score, and their ability to generalize well on unseen data.\u003c/p\u003e\n\u003cp\u003eb. \u003cstrong\u003e\u0026nbsp;Data Collection and Pre-processing\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eDataset\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe dataset used for training and testing the models was obtained from Kaggle\u0026rsquo;s Chest X-Ray dataset. This dataset is diverse and includes labelled chest X-ray images for various conditions. It consists of four categories: Normal (5,000 images), Pneumonia (4,000 images), COVID-19 (4,000 images), and Other Lung Diseases (2,000 images). The images are divided into three sets: 70% of the data was used for training (10,500 images), 15% for validation (2,250 images), and 15% for testing (2,250 images). The dataset is well-balanced, which ensures that the models are trained on a wide variety of samples representing all target classes.\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003ePre-processing\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eTo standardize the input data, all images were resized to a uniform dimension of 224x224 pixels with three colour channels. Pixel intensities were normalized to a range between 0 and 1. To prevent overfitting and improve the generalization ability of the models, data augmentation techniques were applied. These included random rotations (\u0026plusmn;20\u0026deg;), horizontal flipping, random zoom (\u0026plusmn;10%), and the addition of Gaussian noise (\u0026sigma; = 0.05). This augmentation helped simulate real-world variations in X-ray images, such as changes in pose and noise, which are crucial for training robust models.\u003cstrong\u003e\u0026nbsp;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ec. \u0026nbsp;Model Architecture\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eBaseline Models\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe models used in this study are based on two well-established deep learning architectures: VGG19 and MobileNet. VGG19, a 19-layer deep convolutional network, was chosen for its success in image classification tasks. MobileNet, on the other hand, is a lightweight architecture designed for mobile and edge devices, which is particularly beneficial for real-time applications. Both models were pretrained on the ImageNet dataset to take advantage of learned features that are useful for image classification. In this study, both VGG19 and MobileNet were enhanced with Multi-Head Attention mechanisms. This enhancement was added to the final convolutional block (for VGG19) and the penultimate layer (for MobileNet). The attention mechanism helps the model focus on the most important features in the image, improving its ability to distinguish between different lung conditions. The number of attention heads was set to 8, and the attention dimension was 64, which was found to be optimal for these architectures.\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eModifications\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe attention mechanism was implemented using the Multi-Head Attention layer from Tensor Flow/Keras, which allows the model to attend to different parts of the image simultaneously. To prevent overfitting, a dropout rate of 50% was applied during training. Additionally, Gaussian noise with a standard deviation of 0.1 was added to the input images as a form of regularization. The final layer of the network consists of a dense layer with 4 output neurons, each corresponding to one of the target classes. The softmax activation function was applied to this layer to output class probabilities.\u003cstrong\u003e\u0026nbsp;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ed. \u0026nbsp;Experimental Setup\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eTraining Configuration\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe models were trained using the Adam optimizer, which adapts the learning rate during training to improve convergence. The initial learning rate was set to 0.0001. The models were trained with a batch size of 32 for 50 epochs, and early stopping was employed to monitor the validation loss. If the validation loss did not improve after 5 consecutive epochs, training was halted to prevent overfitting. The loss function used was sparse categorical cross-entropy, as the problem involves multi-class classification.\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eHardware and Software\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe training process was carried out on a high-performance NVIDIA Tesla V100 GPU to handle the large computational demands of training deep neural networks. The experiments were implemented using TensorFlow 2.12 and Python 3.9. TensorFlow was chosen due to its flexibility and widespread use in deep learning research and applications.\u003c/p\u003e\u003cp\u003e\u003cstrong\u003ee. \u0026nbsp;Results and Analysis\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eQuantitative Performance Metrics\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe performance of the models was evaluated using standard classification metrics: accuracy, precision, recall, and F1-score. The results for both VGG19 and MobileNet are shown in Table 1.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eTable 1: Comparative Analysis of results for VGG19 and MobileNet.\u0026nbsp;\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"339\"\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003ctd valign=\"bottom\" style=\"width: 128px;\"\u003e\n \u003cp\u003eMetric\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 113px;\"\u003e\n \u003cp\u003eVGG19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 98px;\"\u003e\n \u003cp\u003eMobileNet\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"bottom\" style=\"width: 128px;\"\u003e\n \u003cp\u003eTest Accuracy\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 113px;\"\u003e\n \u003cp\u003e95.7%\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 98px;\"\u003e\n \u003cp\u003e98.1%\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"bottom\" style=\"width: 128px;\"\u003e\n \u003cp\u003ePrecision (COVID-19)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 113px;\"\u003e\n \u003cp\u003e0.92\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 98px;\"\u003e\n \u003cp\u003e0.97\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"bottom\" style=\"width: 128px;\"\u003e\n \u003cp\u003eRecall (COVID-19)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 113px;\"\u003e\n \u003cp\u003e0.94\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 98px;\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"bottom\" style=\"width: 128px;\"\u003e\n \u003cp\u003eF1-Score (Overall)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 113px;\"\u003e\n \u003cp\u003e0.93\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 98px;\"\u003e\n \u003cp\u003e0.97\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"bottom\" style=\"width: 128px;\"\u003e\n \u003cp\u003eTest Loss\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 113px;\"\u003e\n \u003cp\u003e0.22\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"bottom\" style=\"width: 98px;\"\u003e\n \u003cp\u003e0.12\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eFrom the results, MobileNet outperforms VGG19 in terms of test accuracy, precision, recall, and F1-score. Notably, MobileNet achieves a higher F1-score (0.97 vs 0.93) and lower test loss (0.12 vs 0.22), which demonstrates its better ability to classify the images accurately while maintaining a simpler architecture.\u003cstrong\u003e\u0026nbsp;\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eConfusion Matrix (MobileNet)\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eA confusion matrix was generated to further analyze the performance of MobileNet in classifying COVID-19 images. The confusion matrix for the test set is as follows:\u003c/p\u003e\n\u003cul class=\"decimal_type\"\u003e\n \u003cli\u003eTrue Positives (COVID-19): 3,840\u003c/li\u003e\n \u003cli\u003eFalse Positives: 160\u003c/li\u003e\n \u003cli\u003eFalse Negatives: 160\u003c/li\u003e\n \u003cli\u003eTrue Negatives: 13,840\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe misclassification rate for COVID-19 detection was calculated as\u0026nbsp;48015,000=3.2%15,000480=3.2%, indicating that the model made an incorrect prediction in only 3.2% of the cases. This is a strong result, especially for a multi-class classification problem with challenging categories like COVID-19 and pneumonia.\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eTraining and Validation Convergence\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe training and validation loss curves showed that MobileNet converged at epoch 32, reaching a validation loss of 0.12, whereas VGG19 required 40 epochs to converge, reaching a validation loss of 0.22. This indicates that MobileNet is not only more accurate but also more computationally efficient, as it converges faster with fewer epochs.\u003c/p\u003e\n\u003ch3\u003ef. Discussion\u003c/h3\u003e\n\u003cp\u003eThe results of this study demonstrate the efficacy of MobileNet in classifying chest X-ray images for the detection of COVID-19 and other lung diseases. MobileNet significantly outperforms VGG19 in all key metrics, achieving a higher accuracy, precision, recall, and F1-score. The addition of the Multi-Head Attention mechanism was instrumental in improving the model\u0026apos;s ability to focus on important features, particularly for detecting subtle signs of COVID-19 in X-ray images.\u003c/p\u003e\n\u003cp\u003eThe faster convergence and lower test loss observed with MobileNet suggest that it is a more efficient choice for deployment in real-time applications, especially on devices with limited computational resources. The use of data augmentation and regularization techniques, such as dropout and Gaussian noise, further contributed to the models\u0026apos; robustness by preventing overfitting and ensuring that they generalize well to new, unseen data.\u003c/p\u003e"},{"header":"RESULTS AND ANALYSIS","content":"\u003cp\u003eThe models, VGG19 and MobileNet, were evaluated using standard classification metrics, including accuracy, precision, recall, F1-score, and test loss. The performance results for both models indicate that MobileNet significantly out performs VGG19 \u0026nbsp;in all aspects. Specifically, MobileNet achieved a test accuracy of 98.1%, compared to VGG19\u0026rsquo;s 95.7%. This suggests that MobileNet is more effective in correctly classifying images. In terms of precision, MobileNet scored 0.97 for detecting COVID-19, whereas VGG19 had a precision of 0.92. This higher precision means that MobileNet is more reliable in detecting COVID-19 cases and making fewer false positive predictions.\u003c/p\u003e\n\u003cp\u003eFurthermore,\u0026nbsp;MobileNet\u0026nbsp;achieved a higher recall of\u0026nbsp;0.96, compared to\u0026nbsp;VGG19\u0026rsquo;s\u0026nbsp;0.94. This indicates that MobileNet is better at identifying actual COVID-19 cases, minimizing false negatives. The overall\u0026nbsp;F1-score, which balances precision and recall, was also higher for MobileNet (0.97) than for VGG19 (0.93). Finally, MobileNet demonstrated a\u0026nbsp;lower test loss\u0026nbsp;of\u0026nbsp;0.12, compared to\u0026nbsp;VGG19\u0026rsquo;s\u0026nbsp;0.22, suggesting that MobileNet\u0026rsquo;s predictions are closer to the actual values, resulting in more accurate outputs. These results highlight the advantages of using MobileNet, particularly in terms of performance metrics and efficiency, while VGG19, though effective, lagged behind in every evaluation criterion.\u003c/p\u003e\n"},{"header":"Conclusion","content":"\u003cp\u003eIn conclusion, the comparative analysis of MobileNet and VGG19 demonstrates that MobileNet outperforms VGG19 across all key evaluation metrics. MobileNet shows higher test accuracy, better precision and recall for detecting COVID-19, and a higher F1-score, indicating that it is more capable of distinguishing COVID-19 cases from normal ones. Additionally, MobileNet\u0026rsquo;s lower test loss further confirms its superior ability to make accurate predictions. These findings suggest that MobileNet, with its more efficient architecture, is better suited for the task of COVID-19 chest X-ray classification. Given its efficiency and accuracy, MobileNet can serve as a more reliable tool for automated diagnostic systems in healthcare settings.\u003c/p\u003e\n"},{"header":"FUTURE WORK","content":"\u003cp\u003eWhile MobileNet demonstrated superior performance, several avenues for future work can further enhance the model\u0026rsquo;s capabilities. One potential area is\u0026nbsp;model optimization. Future research could involve fine-tuning the hyperparameters of MobileNet to achieve even better accuracy or computational efficiency.\u0026nbsp;Transfer learning\u0026nbsp;could also be explored by using pre-trained models on large-scale datasets, which may help improve performance on smaller datasets, particularly for COVID-19 detection.\u003c/p\u003e\n\u003cp\u003eAdditionally, expanding the dataset to include a broader variety of chest X-rays from different populations, stages of illness, and varying imaging conditions could further enhance the model\u0026apos;s robustness and generalization. Another promising direction would be to extend the model into\u0026nbsp;multi-class classification, where the model can classify images into multiple categories, such as normal, pneumonia, and COVID-19, instead of only distinguishing between COVID-19 and normal cases. This would make the model more comprehensive and applicable for other diagnostic tasks in healthcare.\u003c/p\u003e\n\u003cp\u003eIntegrating MobileNet into real-time diagnostic systems is another critical avenue for future work. Developing a system that can automatically and rapidly analyse chest X-rays in clinical settings would provide real-time assistance to healthcare providers, particularly in high-demand situations like pandemics. Lastly, improving model interpretability is crucial for gaining trust in AI models, especially in healthcare. By using techniques such as Grad-CAM or SHAP, future studies could focus on visualizing which regions of the X-ray images the model is using to make its predictions. This transparency would improve understanding and acceptance of AI-based diagnostic tools in clinical environments.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eConflict of Interest:\u003c/strong\u003e\u003cbr\u003e\u0026nbsp;The author declares that there is \u0026nbsp; no conflict of interest.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAuthor Contributions\u003c/strong\u003e\u003cbr\u003e\u003cstrong\u003eProf. Ramya \u0026nbsp;Venkata Vaduguru\u003c/strong\u003e conceptualized the study, implemented the code, and conducted all experiments for the comparative analysis of VGG19 and MobileNet models for chest X-ray image classification. All results and interpretations presented in this manuscript are based on the authors\u0026apos; original coding and analyses.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eEthical Approval\u003c/strong\u003e\u003cbr\u003e\u0026nbsp;This article does not contain any studies with human participants or animals performed by any of the author\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003cstrong\u003eFunding\u0026nbsp;Declaration\u003c/strong\u003e\u003cbr\u003e\u0026nbsp;This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.\u003c/p\u003e\n"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eY. Akhter, R. Singh, and M. Vatsa, \u0026ldquo;AI-based radiodiagnosis using chest X-rays: A review,\u0026rdquo; \u003cem\u003eFrontiers in Big Data\u003c/em\u003e, vol. 6, p. 1120989, 2023.\u003c/li\u003e\n\u003cli\u003eJ. S. Ahn, S. Ebrahimian, S. McDermott, et al., \u0026ldquo;Association of artificial intelligence\u0026ndash;aided chest radiograph interpretation with reader performance and efficiency,\u0026rdquo; \u003cem\u003eJAMA Network Open\u003c/em\u003e, vol. 5, no. 8, p. e2229289, 2022.\u003c/li\u003e\n\u003cli\u003eN. H. Nguyen, H. Q. Nguyen, N. T. Nguyen, et al., \u0026ldquo;Deployment and validation of an AI system for detecting abnormal chest radiographs in clinical settings,\u0026rdquo; \u003cem\u003eFrontiers in Digital Health\u003c/em\u003e, vol. 4, p. 890759, 2022.\u003c/li\u003e\n\u003cli\u003eA. S. Pillai, \u0026ldquo;Multi-label chest X-ray classification via deep learning,\u0026rdquo; \u003cem\u003eJournal of Intelligent Learning Systems and Applications\u003c/em\u003e, vol. 14, no. 4, pp. 43\u0026ndash;56, 2022.\u003c/li\u003e\n\u003cli\u003eL. Visu\u0026ntilde;a, D. Yang, J. Garcia-Blas, et al., \u0026ldquo;Computer-aided diagnostic for classifying chest X-ray images using deep ensemble learning,\u0026rdquo; \u003cem\u003eBMC Medical Imaging\u003c/em\u003e, vol. 22, p. 178, 2022.\u003c/li\u003e\n\u003cli\u003eS. Bennani, N.-E. Regnard, J. Ventre, et al., \u0026ldquo;Using AI to improve radiologist performance in detection of abnormalities on chest radiographs,\u0026rdquo; \u003cem\u003eRadiology\u003c/em\u003e, vol. 309, no. 3, p. e230860, 2023.\u003c/li\u003e\n\u003cli\u003eJ. Huang, L. Neill, M. Wittbrodt, et al., \u0026ldquo;Generative artificial intelligence for chest radiograph interpretation in the emergency department,\u0026rdquo; \u003cem\u003eJAMA Network Open\u003c/em\u003e, vol. 6, no. 10, p. e2336100, 2023.\u003c/li\u003e\n\u003cli\u003eS. Ram and S. Bodduluri, \u0026ldquo;Implementation of artificial intelligence\u0026ndash;assisted chest X-ray interpretation: It is about time,\u0026rdquo; \u003cem\u003eAmerican Thoracic Society\u003c/em\u003e, vol. 20, no. 5, pp. 641\u0026ndash;642, 2023.\u003c/li\u003e\n\u003cli\u003eJ. H. Niehoff, J. Kalaitzidis, and J. R. Kroeger, et al., \u0026ldquo;Evaluation of the clinical performance of an AI-based application for the automated analysis of chest X-rays,\u0026rdquo; \u003cem\u003eScientific Reports\u003c/em\u003e, vol. 13, p. 3680, 2023.\u003c/li\u003e\n\u003cli\u003eS. Farouk, A. M. Osman, and S. M. Awadallah, et al., \u0026ldquo;The added value of using artificial intelligence in adult chest X-rays for nodules and masses detection in daily radiology practice,\u0026rdquo; \u003cem\u003eEgyptian Journal of Radiology and Nuclear Medicine\u003c/em\u003e, vol. 54, p. 142, 2023.\u003c/li\u003e\n\u003cli\u003eS. Vijayan, V. Jondhale, T. Pande, et al., \u0026ldquo;Implementing a chest X-ray artificial intelligence tool to enhance tuberculosis screening in India: Lessons learned,\u0026rdquo; \u003cem\u003ePLOS Digital Health\u003c/em\u003e, vol. 2, no. 12, p. e0000404, 2023.\u003c/li\u003e\n\u003cli\u003eH. Zhang, T. Hartvigsen, and M. Ghassemi, \u0026ldquo;Algorithmic fairness in chest X-ray diagnosis: A case study,\u0026rdquo; \u003cem\u003eMIT Case Studies in Social and Ethical Responsibilities of Computing\u003c/em\u003e, 2023.\u003c/li\u003e\n\u003cli\u003eA. Celik, A. O. Surmeli, M. Demir, et al., \u0026ldquo;The diagnostic value of chest X-ray scanning by the help of artificial intelligence in heart failure (ART-IN-HF),\u0026rdquo; \u003cem\u003eClinical Cardiology\u003c/em\u003e, vol. 46, pp. 1562\u0026ndash;1568, 2023.\u003c/li\u003e\n\u003cli\u003eA. Ait Nasser and M. A. Akhloufi, \u0026ldquo;A review of recent advances in deep learning models for chest disease detection using radiography,\u0026rdquo; \u003cem\u003eDiagnostics\u003c/em\u003e, vol. 13, no. 1, p. 159, 2023.\u003c/li\u003e\n\u003cli\u003eD. Azad, F. Hossain, Z. Hossain, et al., \u0026ldquo;Detection of multiple diseases from chest X-ray using machine learning and deep learning approaches,\u0026rdquo; \u003cem\u003eJournal of Hunan University of Science and Technology\u003c/em\u003e, vol. 50, no. 4, pp. 245\u0026ndash;251, 2023.\u003c/li\u003e\n\u003cli\u003eM. Kolossv\u0026aacute;ry, V. K. Raghu, J. T. Nagurney, et al., \u0026ldquo;Deep learning analysis of chest radiographs to triage patients with acute chest pain syndrome,\u0026rdquo; \u003cem\u003eRadiology\u003c/em\u003e, vol. 306, no. 2, 2023.\u003c/li\u003e\n\u003cli\u003eQ. Mir\u0026oacute; Catalina, J. Vidal-Alaball, and A. Fuster-Casanovas, et al., \u0026ldquo;Real-world testing of an artificial intelligence algorithm for the analysis of chest X-rays in primary care settings,\u0026rdquo; \u003cem\u003eScientific Reports\u003c/em\u003e, vol. 14, p. 5199, 2024.\u003c/li\u003e\n\u003cli\u003eL. Guo, C. Zhou, and J. Xu, et al., \u0026ldquo;Deep learning for chest X-ray diagnosis: Competition between radiologists with or without artificial intelligence assistance,\u0026rdquo; \u003cem\u003eJournal of Digital Imaging\u003c/em\u003e, vol. 37, pp. 922\u0026ndash;934, 2024.\u003c/li\u003e\n\u003cli\u003eS. Schalekamp, K. van Leeuwen, and E. Calli, et al., \u0026ldquo;Performance of AI to exclude normal chest radiographs to reduce radiologists\u0026rsquo; workload,\u0026rdquo; \u003cem\u003eEuropean Radiology\u003c/em\u003e, vol. 34, pp. 7255\u0026ndash;7263, 2024.\u003c/li\u003e\n\u003cli\u003eS. Ridhi, D. Robert, P. Soren, et al., \u0026ldquo;Comparing the output of an artificial intelligence algorithm in detecting radiological signs of pulmonary tuberculosis in digital chest X-rays and their smartphone-captured photos of X-ray films: Retrospective study,\u0026rdquo; \u003cem\u003eJMIR Formative Research\u003c/em\u003e, vol. 8, p. e55641, 2024.\u003c/li\u003e\n\u003cli\u003eD. Trine, B. Eudoriks, R. Aigeus, and N. Boyel, \u0026ldquo;AI in medical imaging: Enhancing pneumonia detection in chest X-rays through deep learning,\u0026rdquo; \u003cem\u003eProceedings of the International Conference on Health Informatics and Technology\u003c/em\u003e, 2024.\u003c/li\u003e\n\u003cli\u003eD. Prinster, A. Mahmood, and S. Saria, et al., \u0026ldquo;Care to explain? AI explanation types differentially impact chest radiograph diagnostic performance and physician trust in AI,\u0026rdquo; \u003cem\u003eRadiology\u003c/em\u003e, vol. 313, no. 2, 2024.\u003c/li\u003e\n\u003cli\u003eS. B. Lee, \u0026ldquo;Development of a chest X-ray machine learning convolutional neural network model on a budget and using artificial intelligence explainability techniques to analyze patterns of machine learning inference,\u0026rdquo; \u003cem\u003eJAMIA Open\u003c/em\u003e, vol. 7, no. 2, p. ooae035, 2024.\u003c/li\u003e\n\u003c/ol\u003e\n"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Chest X-ray, Deep Learning, MobileNet, Multi-Head Attention, COVID-19 Diagnostics, Radiology Automation","lastPublishedDoi":"10.21203/rs.3.rs-5902187/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-5902187/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eThis study looks into a cutting-edge deep learning system to sort chest X-ray (CXR) pictures into four groups: Normal, Pneumonia, COVID-19, and Other Lung Diseases. The research team boosted VGG19 and Mobile Net designs with Multi-Head Attention tricks to get better at pulling out features and zeroing in on areas that matter for spotting diseases. They worked with a dataset of 15,000 tagged images, which they cleaned up using standardization and tweaking methods to make the models work better across the board. Tests showed that Mobile Net beat VGG19 hitting 98.1% accuracy, 0.97 precision, and 0.96 recall. Adding attention tricks made the diagnosis more precise for tricky cases like COVID-19. Plus, Mobile Net got up to speed faster and didn't need as much computing power making it a better fit for on-the-spot use. This work highlights how attention-boosted lightweight models could streamline how doctors diagnose issues, take some pressure off radiologists, and bring better care to places without a lot of resources. The next steps include fine-tuning the model, growing the dataset, and putting it to work in the real world to help with automated diagnosis support.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003e \u003c/p\u003e","manuscriptTitle":"Attention-Based Deep Learning Models: A Comparative Study of VGG19 and MobileNet for Chest X-Ray Image Classification","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-01-31 12:10:21","doi":"10.21203/rs.3.rs-5902187/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"2319c256-e093-44ec-b308-4c86aceae642","owner":[],"postedDate":"January 31st, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-03-05T04:23:12+00:00","versionOfRecord":[],"versionCreatedAt":"2025-01-31 12:10:21","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-5902187","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-5902187","identity":"rs-5902187","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.