COPD: Pneumonia and Pneumothorax Detection in Chest X-rays: Vision Transfer based on Deep Learning

preprint OA: closed
Full text JSON View at publisher
AI-generated deep summary by claude@2026-06, 2026-06-24 · read from full text

The paper studied how a vision transformer (ViT) model can classify chest X-rays as pneumonia versus pneumothorax, using labeled CXR images with advanced preprocessing and augmentation, along with sampling to address class imbalance. The authors report that ViT’s self-attention improved performance by capturing global dependencies associated with diffuse pneumonia opacities and pleural abnormalities in pneumothorax, and they used self-attention maps/gradient-based visualizations to increase interpretability aligned with expert radiological assessment. A stated caveat is that the work is a preprint and not yet peer reviewed, and it describes focus on binary classification rather than the multi-pathology overlap common in real-world imaging. Relevance to endometriosis: this paper does not discuss endometriosis or adenomyosis; it was included in the corpus via a keyword match related to the broader biomedical imaging/biomedical research index.

Read from the paper's body, not the abstract. Not a substitute for reading the paper. No clinical advice. How this works

Abstract

Abstract Recently, there has been a growing interest in the application of deep learning for the automated analysis of chest X-rays (CXRs) especially for the detection of pneumothorax. Conventional deep learning models such as convolutional neural networks (CNNs) have shown to perform well in CXR classification. However, CNN-based methods are limited by the local dependence of the feature extraction in their inherent form, which prevents them from capturing long-range dependencies in medical images. Furthermore, CNNs have a domain shift problem, which limits their flexibility in varying imaging conditions and are typically black box models that are difficult to interpret and incorporate into clinical decision-making processes. In this paper, we designed a novel Vision Transfer (ViT) based framework for the classification of pneumonia and pneumothorax from CXRs. In contrast to CNNs, ViTs use self-attention to model global dependencies and are thus well-placed to detect diffuse opacities in pneumonia, and pleural abnormalities in pneumothorax. The ViT model was fine-tuned on a dataset of CXRs, which were labelled with advanced preprocessing and augmentation of the data for better generalization. To improve clinical interpretability, we used self-attention maps to develop a more transparent and explainable AI based diagnostic system. In our approach, we showed that our model had superior classification performance with high sensitivity and specificity across both conditions. The self-attention maps provided intrinsic interpretability by highlighting clinically relevant regions in the X-rays, which aligned with expert radiological assessments. The model also had better generalization across datasets, reducing biases typical to CNN based architectures. The results show that ViTs can be a potential new approach for CNNs in the field of medical imaging, especially for the automated interpretation of chest X-rays. Through enhancing the classification accuracy, guaranteeing the domain generalization, and ensuring the clinical interpretability, ViTs can improve the AI-assisted diagnostics in radiology workflows and thus facilitate the fast and accurate decision making in the respiratory disease detection. Future work will include exploring multi-modal fusion approaches and real-world clinical validation to further enhance the effectiveness of transformer-based models in healthcare in practice.
Full text 96,594 characters · extracted from preprint-html · click to expand
COPD: Pneumonia and Pneumothorax Detection in Chest X-rays: Vision Transfer based on Deep Learning | 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 Article COPD: Pneumonia and Pneumothorax Detection in Chest X-rays: Vision Transfer based on Deep Learning Yousef Saad Aldabayan This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-6196034/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 Recently, there has been a growing interest in the application of deep learning for the automated analysis of chest X-rays (CXRs) especially for the detection of pneumothorax. Conventional deep learning models such as convolutional neural networks (CNNs) have shown to perform well in CXR classification. However, CNN-based methods are limited by the local dependence of the feature extraction in their inherent form, which prevents them from capturing long-range dependencies in medical images. Furthermore, CNNs have a domain shift problem, which limits their flexibility in varying imaging conditions and are typically black box models that are difficult to interpret and incorporate into clinical decision-making processes. In this paper, we designed a novel Vision Transfer (ViT) based framework for the classification of pneumonia and pneumothorax from CXRs. In contrast to CNNs, ViTs use self-attention to model global dependencies and are thus well-placed to detect diffuse opacities in pneumonia, and pleural abnormalities in pneumothorax. The ViT model was fine-tuned on a dataset of CXRs, which were labelled with advanced preprocessing and augmentation of the data for better generalization. To improve clinical interpretability, we used self-attention maps to develop a more transparent and explainable AI based diagnostic system. In our approach, we showed that our model had superior classification performance with high sensitivity and specificity across both conditions. The self-attention maps provided intrinsic interpretability by highlighting clinically relevant regions in the X-rays, which aligned with expert radiological assessments. The model also had better generalization across datasets, reducing biases typical to CNN based architectures. The results show that ViTs can be a potential new approach for CNNs in the field of medical imaging, especially for the automated interpretation of chest X-rays. Through enhancing the classification accuracy, guaranteeing the domain generalization, and ensuring the clinical interpretability, ViTs can improve the AI-assisted diagnostics in radiology workflows and thus facilitate the fast and accurate decision making in the respiratory disease detection. Future work will include exploring multi-modal fusion approaches and real-world clinical validation to further enhance the effectiveness of transformer-based models in healthcare in practice. Biological sciences/Physiology Biological sciences/Physiology/Cardiovascular biology Biological sciences/Physiology/Cardiovascular biology/Heart development COPD Pneumonia Pneumothorax Deep Learning Vision Transfer Detection Figures Figure 1 Figure 2 Figure 3 Figure 4 Introduction Chest X-ray (CXR) imaging is among the most frequent diagnostic modalities used for the detection of various thoracic pathologies including Pneumonia and Pneumothorax [ 1 ]. Because of its ease of access, low cost and short acquisition time it acts as a first line imaging tool and is useful in both high and low resource settings [ 2 ]. Pneumonia is an infectious disease of alveoli, whose complications are inflammatory exudates, consolidation and opacification of lung parenchyma [ 3 ]. It is caused by bacterial, viral or fungal pathogens and so it needs to be detected and classified early for the right clinical management. On the other hand, pneumothorax is a condition in which the presence of air in the pleural cavity is noted, which can lead to lung collapse, respiratory distress and even cardiovascular compromise if it is not promptly diagnosed and managed. This contrasts with the management of hemothorax. The management of patients with these conditions requires rapid and accurate diagnosis but the process remains challenging because of several limitations in current clinical workflows. Interpretation of chest X-rays is an expert job, and even experienced radiologists have interred reader variability which can cause discrepancies in diagnosis [ 4 ]. The presence of overt and subtle radiographic findings, variations in image quality, and overlapping pathologies are all factors that further complicate diagnostic accuracy [ 5 – 6 ]. This is however a real problem in many healthcare settings, particularly in the rural areas and developing countries since there are not enough trained radiologists to relieve some of the pressure on other medical professionals which may at times result in some form of delay in treatment [ 7 – 8 ]. These challenges make it necessary to have automated computer-aided diagnostic (CAD) systems that can support clinicians in making rapid and accurate predictions on the severity of the disease through deep learning techniques [ 9 – 10 ]. Over the last few years, Convolutional Neural Networks (CNNs) have been among the techniques that have found their application in medical imaging for disease classification and segmentation [ 11 ]. CNNs capture local signals from images in a hierarchical manner by performing convolution on spatial representations of anatomical structures. However, CNN based architectures such as ResNet, DenseNet and Inception have shown potential results in chest X-ray classification, but they are involved with several constraints that affect their effectiveness in real clinical practice. A primary limitation of CNN based models is localized feature extraction reliance, one of the primaries [ 12 – 14 ]. CNNs have a fixed receptive field that prevents them from learning long range dependencies in images [ 15 ]. In the case of chest X-rays, global contextual information is vital for identifying diffuse lung opacities in pneumonia or subtle pleural line abnormalities in pneumothorax [ 16 ]. CNNs are likely to pay attention to small scale spatial features and fail to learn important features that are more distributed across the different regions of the lung fields [ 17 ]. This limitation hinders the model's capacity to discriminate between diverse disease expressions which need not only a local but also a global spatial understanding. Another major problem is the so-called domain shift problem where CNNs trained on a certain dataset may fail to generalize across various imaging conditions [ 18 ], types of equipment, and populations of patients. Such as differences in imaging protocols, exposure levels, contrast settings and anatomical variations, which can cause discrepancies between the real images and model predictions. Most of the existing DL approaches do not include such variation tolerance and perform poorly when applied to a diverse set of real-world datasets. Furthermore, CNN-based models are generally black box algorithms–accurate, but unexplainable [ 19 ]. This raises a concern about clinical trust and adoption because clinical experts require intelligible models that are congruent with the way humans make decisions. However, one major limitation of their adoption in medical imaging up to this point has been the inability of CNNs to provide meaningful insights into their decision-making process. Without visual explanations for predictions, it is hard for clinicians to validate the model’s outputs and incorporate them into their diagnostic workflow. However, the existing models have limitations in explaining the multiple pathologies from a single chest X-ray image. Most of the deep learning approaches are designed for binary classification of normal and abnormal findings. However, real world clinical scenarios often have coexisting conditions where a patient may have features of Pneumonia as well as underlying lung diseases like chronic obstructive pulmonary disease (COPD) or pulmonary oedema. Current models are inadequate to comprehensively evaluate the overall radiographic presentations, resulting in misclassifications when multiple, overlapping features are present. Methodology Interpretation of chest X-rays is an important tool in the diagnosis of thoracic conditions like Pneumonia and Pneumothorax. These conditions must be recognized and localized correctly to ensure the best possible clinical management. In this study, a new DL approach based on ViT was proposed for the automation of the diagnosis of these conditions, together with dealing with class imbalance, variability in imaging conditions, and the need for model interpretability. The approach we propose is based on the use of an appropriately chosen dataset of chest X-ray images including Pneumonia and Pneumothorax cases, where the model was trained to distinguish between the two illnesses. To mitigate the bias in model predictions due to the imbalance of the class distribution, a sampling technique was used to ensure an equal number of instances of both conditions in the training set. It was done by sampling the majority class to increase the sensitivity to infrequent cases without compromising on accuracy for frequent cases. To this end, we further augment the training set to include more diverse and realistic transformations of the input images, thus enhancing the model's robustness against real-world distortions, e.g., arising from differences in imaging protocols, patient positioning, or equipment settings. ViT architecture was selected for its ability to capture global relationships in images via self-attention mechanisms. For the classification task, the ViT model was fine tuned to focus then the rest of layers of the model were enabled to do the binary classification of pneumonia and pneumothorax. Further, we enhanced the model by adding dropout layers and optimization techniques to avoid overfitting and find robust performance respectively. Finally, to account for the dynamic nature of the process to converge smoothly, we used a dynamic learning rate schedule to control the speed of the learning process. In addition, the loss function was added to avoid overfitting in the predictions, and to make the predictions more consistent with the clinical expectations. To ensure that the predictions are consistent with clinical reasoning, gradient-based techniques were employed to visually identify the regions of the chest X-rays that the model deemed relevant for the decision-making process. These settings gave further vital pointers regarding the decision-making process, and displayed areas of increased opacity for pneumonia, and sharp radiolucent edges for pneumothorax, as expected from the radiological appearances. In this paper, we show that our proposed architecture is suitable and effective for medical imaging and solves crucial problems in real world clinical settings. We further argue that by paying attention to issues of robustness, accuracy, and interpretability, we can provide a useful addition to clinical practice that may help decrease the clinical workload and timing of intervention, especially in resource limited settings. Model Specification Our proposed method adopts significant techniques, including class imbalance, variability in imaging conditions, and the requirement for transparent and interpretable decision making. We have applied this specification to the dataset preparation phase, which includes curating labeled X-ray images of both the diseases. A WeightedRandomSampler was employed to eradicate the class imbalance within the given dataset. This technique during training oversamples the minority class of data to ensure data balance. Therefore, we have achieved robust sensitivity for Pneumonia while maintaining specificity for Pneumothorax. We have also applied resizing of the images to a constant and uniform resolution 224x224 pixels and converting them to grayscale to focus on structural details critical to clinical diagnosis. Furthermore, robustness was achieved by the application of data augmentation techniques such as brightness and contrast adjustments, random rotations, and affine transformations. Therefore, these techniques implanted real-world variations in imaging conditions, such as differences in scanner settings and patient positioning. Traditional convolutional neural networks differ from ViT as they perform localized receptive field processing of X-ray images. It breaks up images into non-overlapping patches, flattens them to sequences, then embeds them in a latent space. The transformer’s multi-head self-attention mechanism enabled the model to analyze global relationships within the X-ray images, making it well-suited for detecting subtle and diffuse patterns in Pneumonia and the localized structural changes characteristic of Pneumothorax. A pretrained ViT Base Patch16 224 model was fine-tuned for binary classification. The original classification head was replaced with a fully connected layer and a dropout layer (rate = 0.5) to mitigate overfitting. The training process incorporated advanced optimization strategies to maximize performance. A CosineAnnealingWarmRestarts scheduler dynamically adjusted the learning rate, starting at an initial value of 1e-5, to maintain stability and facilitate convergence. The loss function included label smoothing, preventing the model from becoming overconfident in its predictions and ensuring well-calibrated outputs. Our proposed network was trained using the AdamW optimizer, this approach effectively balances weight decay and gradient for large-scale vision models. For pneumonia the model concentrates on regions of enhanced opacity which are usually companion of inflammation or consolidation. The emphasis was on sharp radiolucent boundaries and anatomical structure shifts for pneumothorax. These visualizations also helped in enhancing the trust of the clinicians in the model’s decisions by conforming to radiological expertise. Our ViT-based pipeline performs fairly accurate, robust and interpretable. This approach also performs well in dealing with domain-specific challenges like class imbalance and the need for transparent decision making to show the potential of transformers in medical imaging for transformation. Future extensions include multi class classification, covering more pathologies, and deploying them in real time clinical workflows especially in resource constrained environments where access to specialized radiological expertise is limited. Dataset The dataset used in this study was created by collecting chest X-ray images with the goal of detecting pneumonia and pneumothorax. The images were taken from the NIH Chest X-ray dataset [ 20 ], a famous collection of labeled radiographs, and were divided into training, validation and test sets for model training and testing purposes. To deal with the problem of class imbalance where pneumonia cases were underrepresented compared to Pneumothorax, WeightedRandomSampler was used during training to guarantee that both classes were equally likely to be included in a batch. This approach was significant in enhancing the sensitivity of the model to pneumonia without worsening the performance in detecting pneumothorax. Preprocessing of the dataset is carried out using a pipeline to possess uniformity and to optimize the model’s performance. All of the datasets were resized to a standard resolution of 224x224 pixels, to fit the input requirements of the Vision Transformer model. All the datasets were resized to a standard resolution of 224x224 pixels to fit the input requirements of the Vision Transformer model. Furthermore, for the purpose of highlighting the structural and anatomical features relevant for diagnosis, they were converted to grayscale. For enhancing the stability of the model, some augmentations were used during training, such as: brightness and contrast adjustment, rotation, affine transformations and finally, sharpness. To ensure the model's effectiveness in real-world conditions, these augmentations mimicked real-world imaging variations and patient positioning, thus enabling the model to perform consistently well across different clinical settings. Besides the dataset there was metadata, consisting of pneumonia and pneumothorax labels, patient demographics and imaging view positions; all of which were derived from the original NIH dataset. The posterior-anterior X-ray views were chosen for the diagnostic importance and the images with artifacts or incomplete annotations were removed from the dataset to avoid contaminated data. Results and Discussion Our study’s results show that the ViT model is efficient in identifying pneumonia and pneumothorax from chest X-ray images with high accuracy and clinical reliability. The model had strong generalization across validation and test datasets, such that it is safe to use it on unseen clinical cases. Using a WeightedRandomSampler has greatly enhanced the capacity of the model in identifying pneumonia, an initially underrepresented condition in the dataset. This is crucial in clinical practice, because missing pneumonia can result in delayed treatment and complications like respiratory failure or sepsis. With the improved sensitivity of the model in identifying pneumonia cases, it guarantees that as many instances as possible are not missed and thus treated on time. Also, the accuracy in pneumothorax classification is high, which is necessary as quick identification of this condition is essential, as tension pneumothorax has life-threatening complications and needs urgent treatment. The training and validation curves look good, there is no overfitting, and the loss is decreased steadily with number of epochs. To prevent overconfident predictions, especially in medical applications where a wrong decision can have serious implications, the implementation of dropout and label smoothing was important. The CosineAnnealingWarmRestarts scheduler was used to fine tune the model, meaning that it was used to ensure that the training converged properly. This suggests that the model successfully differentiates between these conditions in most scenarios but may require additional feature refinement for ambiguous cases as shown in Fig. 1 and Fig. 2 . As shown in Fig. 3 , the confusion matrix of the model shows a high true positive rate for both conditions and most of the errors happen in the borderline cases, where pneumonia and pneumothorax have similar radiographic features which include lung opacity in the lower lung fields or subtle pleural line abnormalities. The receiver operating characteristic (ROC) curve also verified the model performance, and the area under the curve (AUC) was high for both conditions as shown in Fig. 4 . AUC values close to one indicate excellent discriminatory ability, which means that the model is capable of distinguishing between normal and pathological lung features with high sensitivity and specificity. From a clinical perspective, high AUC values correspond to lower false negative rates which in turn means that there are fewer cases of a diagnosis going undetected. In contrast, for Pneumothorax, the model highlighted pleural edges and regions of increased radiolucency, which align with the radiographic findings of air accumulation in the pleural space. These results support the model’s alignment with human expert interpretation, reinforcing its potential as an assistive tool in clinical workflows. For pneumonia, the model always paid attention to the regions of increased lung opacity, which is in accordance with alveolar consolidation seen in bacterial and viral pneumonias. This model has great clinical implications. It can help radiologists and emergency physicians in diagnosing pneumonia and pneumothorax with rapid and accurate classification of chest X-ray images especially in high volume clinical settings. The ability of the model to pay attention to the key radiographic markers increases the possibility of using this model in computer-aided diagnosis (CAD) systems and, in turn, to reduce the diagnostic workload and improve the patient outcomes. Future work will also include the improvement of feature extraction techniques and the growth of the dataset to encompass other thoracic conditions to increase the sensitivity of the model. Comprehensive Literature Review on Vision Transformers for Chest X-ray Analysis This paper is an attempt to investigate how the recent developments in Deep Learning (DL) have changed the way medical imaging is handled especially in the automated classification of chest X-rays (CXRs) to identify complications such as pneumonia and pneumothorax. Despite the success of CNN architectures such as ResNet, DenseNet and Inception for radiographic analysis [ 21 – 23 ], these networks are nevertheless confined by the local receptive field that is inherent to them and, therefore, cannot learn dependencies in images [ 24 ]. The main limitations of CNN based approaches are because they perform localized feature extraction. Chest X rays can have widespread opacities, subtle changes in the pleural line, and overall changes in the structure of the lungs which means that global contextual information of different regions of the lung fields is crucial [ 25 ]. The constrained receptive fields of CNNs make them ineffective in capturing such global context effectively [ 26 ]. Moreover, it has been observed that CNNs perform poorly in generalizing across different datasets of patients from various hospitals because of differences in imaging protocols, exposure, and patient position resulting in domain shifts that reduce model performance [ 27 ]. Another major issue is the absence of interpretability in CNN based models. The DL models must be clinically transparent and able to explain the reasoning for the automated predictions to the radiologists. Nevertheless, most CNNs are black box models that give little or no insight into their decision-making processes. This is because they have not been incorporated into the real-world clinical workflows due to the non-transparency in the decision-making process of the AI systems, which radiologists need to be able aware of the significant radiographic features leading to a particular diagnosis [ 28 ]. Self-attention is embedded in ViTs models to equipped with long range dependencies across entire images [ 29 ], hence, not relying on convolutional layers to extract local features. Because disease patterns can be spread across large regions rather than localized to small patches, ViTs are thus well suited for analyzing, where X-ray images are believed to have distant regions. In the work of [ 30 ], it was observed that ViTs performs better than CNNs in CXR classification with an F1 score of 0.9532 and AUC of 0.97 for pneumonia detection. This shows that transformers are capable of learning optimally relevant features directly from medical images, thus improving diagnostic accuracy. Wollek et al. [ 31 ] also reported that ViTs provided better interpretability through self-attention maps which learned to pay attention to crucial regions in the X-rays that affected the model decision, overcoming one of the major weaknesses of CNNs. Seyyed-Kalantari et al.[ 28 ] examined the bias in the AI models and the result shows that the traditional DL models had significant variation in the performance across various demographic groups. These biases are also observed in ViT based architectures, but to a lesser extent, and hence, provide more equitable diagnostic performance across the patient populations. In addition, ViTs also excel at adapting to domain shifts. To be clinically useful, AI driven diagnostic tools must be easily integrated into the current radiology workflows. Research has been done on the use of Vision Transformers in automated triage systems, where AI models assist in identifying high risk cases such as suspected pneumothorax, so that the needy are directed to the appropriate level of care first [ 28 – 30 ]. This capability is most valuable in low-resource settings where there is limited access to expert radiologists, and AI enabled systems can bridge the gap in medical diagnostics [ 31 ]. In addition, self-attention in ViTs is understandable on its own, which is necessary for clinical practice. Grad-CAM is an external technique that depends on, for example, CNN-based models, but ViTs natively generate attention maps that highlight the relevant parts of the chest X-rays in harmony with the way of reading imaging data by radiologists [ 32 ]. This makes ViTs a good candidate to rely on for transparent AI-based diagnosis, boosting trust in model decisions and enhancing the interaction between human and AI in radiology. Although ViTs have many advantages, they need much larger datasets for training than CNNs. They implement self-attention over all image patches which is computationally expensive and leads to even higher complexity when training the model [ 33 ]. Future work should be directed towards hybrid models that incorporate CNN and transformer architectures to capture efficient CNN features together with long range spatial awareness of transformers while maintaining optimal computational performance [ 21 ]. Another important aspect that needs further attention is the bias mitigation in transformer-based models. However, studies have also revealed that ViTs perform well with respect to fairness across different demographic groups, but this needs further validation on more diverse datasets. It is crucial to eliminate racial, gender, and age biases in AI-based radiology models to make the automated diagnostic systems unbiased and accurate for all patients. The use of Vision Transformers for chest X-ray classification is a major contribution to medical image analysis, solving many of the problems of CNN based models. As a result, ViTs provide a better alternative to DL based diagnostics by encoding global contextual relationships, enhancing interpretability, and improving domain generalization in the presence of limited data. However, to achieve clinical feasibility, there are challenges with data efficiency, computational demands, and bias mitigation that must be overcome. Future work should include hybrid DL models, multi-modal transformer architectures, and real-world clinical validation to further establish the role of transformers in radiology. To deal with these restrictions, we are proposing a new approach based on the ViT architecture for Pneumonia and Pneumothorax classification. ViTs employ self-attention mechanisms to capture global dependencies across the entire image, thus rendering them particularly effective in analyzing chest X-rays where disease manifestations can be diffuse or subtle, different from traditional CNNs. ViTs break images down into non-overlapping patches, then transform those patches into a sequence of tokens which are then fed into a transformer encoder. Self-attention mechanisms with multiple heads in the transformer encoder help the model to learn dependencies between any region of the image. This enables ViTs to capture long range interactions between anatomical structures which is important for detecting opacities spread all over the image in Pneumonia or pleural line abnormalities in Pneumothorax. In contrast, CNNs are bound by the size of their receptive fields and thus cannot process entire images holistically, thereby lacking context in their understanding of radiographic features. Another major advantage of ViTs in medical imaging is their robustness to domain shifts. Transformers are less sensitive to variations in imaging conditions than CNNs because they learn representations from global feature aggregation. Therefore, they are more adaptable to different hospitals, imaging centers, and patient populations on which the datasets were collected, which further enhances the model generalization across diverse clinical environments. Furthermore, ViTs are designed to ease the natural integration of multi-pathology learning, able to identify various disease patterns from a single X-ray. Since self-attention mechanisms work on global relationships, ViTs can identify coexisting conditions, which are very relevant for real world use, where patients may have multiple abnormalities to identify. This is particularly important in distinguishing primary Pneumonia from secondary complications such as bacterial superinfection or fluid overload with similar radiographic appearances. Enhancing Interpretability in AI-Driven Diagnostics One of the major concerns with deep learning models in medical imaging is their lack of interpretability. Clinicians require transparent models that provide visual explanations for their predictions, ensuring that automated decisions align with human expertise. To address this, self-attention maps generated by ViTs offer a novel way to visualize the regions of interest the model focuses on during inference. Unlike CNN-based Grad-CAM methods that are limited to localized feature importance, self-attention maps inherently provide global explainability, helping clinicians understand the decision-making process of the model. An important aspect of interpretability is the ability to embed medical domain knowledge into the model’s feature representations. Traditional CNNs learn generic low-level features which might not always be relevant to radiological findings. Using transformers to leverage spatial and contextual relationships, the model can learn clinically meaningful representations that match those used in the diagnostic reasoning of radiologists. It enhances the trust in AI-based systems and their real-world adoptability potential. Clinical Integration and Real-World Applicability For the AIs to be effective in clinical practice, they must integrate seamlessly into the existing radiology workflows. Our proposed methodology has been an AI-enabled assistive diagnostic tool, providing real-time predictions alongside standard radiology reports. The model can be incorporated into Picture Archiving and Communication Systems (PACS) so that radiologists can appraise AI's suggestions when interpreting chest X-rays. This could greatly improve workload in settings with a high volume of imaging studies or limited access to specialized radiologists. Furthermore, the AI triage systems can select high risk cases like suspected Pneumothorax that needs urgent treatment. In a way, our approach can help in automating the flagging of abnormal findings and providing explainable visual overlays of the findings thus helping in improving the decision making in emergency settings. This is particularly useful in low-resource settings where there is limited access to expert radiologists and diagnostic delays can have detrimental effects on patient outcomes. The limitations of traditional CNN based models in chest Xray analysis, such as localized feature extraction, susceptibility to domain shift and lack of interpretability, mean that there is a need to move away from these simpler architectures. In our approach, by leveraging vision transformers, we can introduce a new standard for medical imaging, which includes global contextual learning, multi pathology detection and improved explainability. This model is thus able to leverage transformer-based feature representations with radiological insights to the model to try and bridge the gap between AI enabled automation and clinical decision making towards better and more reliable and interpretable diagnostic solutions. The focus of the future work will be on extending the transformer architectures for multi class classification, domain adaptation and integration with radiology AI workflows for clinical impact. Conclusion and Future Work This paper shows that our proposed method is successful in detecting pneumonia and pneumothorax from chest X-rays, while also highlighting the shortcomings of conventional convolutional neural networks (CNNs). In contrast to CNNs that rely on local feature extraction, ViTs use self-attention mechanisms to capture global dependencies and are thus more effective at detecting diffuse and complex radiographic patterns. Achieved high classification performance, strong generalization across datasets, and increased interpretability through self-attention maps, which are consistent with clinical reasoning, by the model. These findings indicate that ViTs are a robust, transparent AI-enabled diagnostic tool for radiology, which can assist healthcare professionals in making more accurate and timely diagnosis. Future work will build on the model by increasing the model’s scope to include multi-modal learning, which will use both CXR images and clinical text reports to make a more rounded evaluation. Furthermore, for generalization, bias mitigation strategies will be discussed to achieve equitable performance for a variety of patient populations. The real-world clinical validation will be conducted in hospital settings to determine the impact of the model on diagnostic workflows and the goal is deployment in AI assisted radiology systems. Declarations Author Contributions: All work, including conceptualization, methodology, investigation, writing—original draft preparation, review, and editing, was conducted by Yousef Saad Aldabayan (Y.S.D.). Acknowledgment: This work was supported by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia [Grant No. KFU251185]. Funding: This research received funding from the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia. Institutional Review Board Statement : Not applicable. This review article did not involve human or animal subjects and does not require ethical approval. Informed Consent Statement: Not applicable. No human participants were involved in this study. Data Availability Statement : Ches-Xray8 database is available at https://nihcc.app.box.com/v/ChestXray-NIHCC (accessed on 14 November 2023). Conflicts of Interest : The author declares no conflicts of interest. References Siddiqi, R. & Javaid, S. Deep learning for pneumonia detection in chest x-ray images: A comprehensive survey. Journal of imaging , 10 (8), p.176. (2024). Murali, S. et al. Bringing MRI to low-and middle‐income countries: directions, challenges and potential solutions. NMR Biomed. 37 (7), e4992 (2024). Wödlinger, M. G. Applications of Neural Attention for Modelling Long-Range Dependencies (Doctoral dissertation, Technische Universität Wien). (2025). Berner, E. S. & Graber, M. L. Overconfidence as a cause of diagnostic error in medicine. Am. J. Med. 121 (5), S2–S23 (2008). Eisenberg, R. L. & Johnson, N. M. Comprehensive Radiographic Pathology-E-Book: Comprehensive Radiographic Pathology-E-Book (Elsevier Health Sciences, 2015). Robinson, P. J. Radiology's Achilles' heel: error and variation in the interpretation of the Röntgen image. Br. J. Radiol. 70 (839), 1085–1098 (1997). Pinto, A. & Brunese, L. Spectrum of diagnostic errors in radiology. World journal of radiology , 2 (10), p.377. (2010). oganathan, N., Reis, D. & Serranheira, F. C.S. and Time constraints and workload in the computed tomography department. Journal of Medical Imaging and Radiation Sciences , 56 (2), p.101799. (2025). Kaur, R., GholamHosseini, H. & Lindén, M. Advanced Deep Learning Models for Melanoma Diagnosis in Computer-Aided Skin Cancer Detection. Sensors , 25 (3), p.594. (2025). Parikh, M. et al. Use of Artificial Intelligence in Lower Gastrointestinal and Small Bowel Disorders: An Update Beyond Polyp Detection. J. Clin. Gastroenterol. 59 (2), 121–128 (2025). Feng, Y. et al. Application of artificial intelligence-based computer vision methods in liver diseases: a bibliometric analysis (Intelligent Medicine, 2025). Zhao, B. et al. Diagnosis of Coronary Heart Disease through Deep Learning-Based Segmentation and Localization in Computed Tomography Angiography (IEEE Access, 2025). Gui, L. et al. Road Extraction from Remote Sensing Images Using a Skip-Connected Parallel CNN-Transformer Encoder-Decoder Model. Applied Sciences, 15(3), p.1427. (2025). Vishwakarma, A. K. & Deshmukh, M. CNNM-FDI: Novel Convolutional Neural Network Model for Fire Detection in Images pp.1–14 (IETE Journal of Research, 2025). Mohammadi, S. & Livani, M. A. Enhanced breast mass segmentation in mammograms using a hybrid transformer UNet model. Comput. Biol. Med. 184 , 109432 (2025). Tang, Y., Yuan, Y., Tao, F. & Tang, M. Cross-modal Augmented Transformer for Automated Medical Report Generation (IEEE Journal of Translational Engineering in Health and Medicine, 2025). Zhou, C. et al. An interpretable attention-based deep learning method for landslide prediction based on multi-temporal InSAR time series: A case study of Xinpu landslide in the TGRA 318p.114580 (Remote Sensing of Environment, 2025). Nolte, K. et al. Potentials and limitations in the application of Convolutional Neural Networks for mosquito species identification using wing images. bioRxiv, pp.2025-01. (2025). Tandel, G. S., Tiwari, A. & Kakde, O. G. Multi-Class Brain Tumor Grades Classification Using a Deep Learning-Based Majority Voting Algorithm and Its Validation Using Explainable-AI pp.1–38 (Journal of Imaging Informatics in Medicine, 2025). Wang, X. et al. ChestX-ray8: Hospital-scale Chest X-ray Database and Benchmarks on Weakly-Supervised Classification and Localization of Common Thorax Diseases. IEEE CVPR. (2017). He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770–778). (2016). Huang, G., Liu, Z., Van Der Maaten, L. & Weinberger, K. Q. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 4700–4708). (2017). Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J. & Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 2818–2826). (2016). Çallı, E., Sogancioglu, E., van Ginneken, B., van Leeuwen, K. G. & Murphy, K. Deep learning for chest X-ray analysis: A survey. Medical Image Analysis, 72, p.102125. (2021). XLSor, A. Robust and Accurate Lung Segmentor on Chest X-Rays Using Criss-Cross Attention and Customized Radiorealistic Abnormalities Generation. In Proceedings of The 2nd International Conference on Medical Imaging with Deep Learning (pp. 457–467). Dosovitskiy, A. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 . (2020). Nagendran, M. et al. Artificial intelligence versus clinicians: systematic review of design, reporting standards, and claims of deep learning studies. bmj , 368 . (2020). Seyyed-Kalantari, L., Zhang, H., McDermott, M. B., Chen, I. Y. & Ghassemi, M. Underdiagnosis bias of artificial intelligence algorithms applied to chest radiographs in under-served patient populations. Nat. Med. 27 (12), 2176–2182 (2021). Vaswani, A. et al. Attention is all you need. Advances in neural information processing systems. Advances in neural information processing systems , 30 (2017). (2017). Regmi, S., Subedi, A., Bagci, U. & Jha, D. Vision transformer for efficient chest X-ray and gastrointestinal image classification. arXiv preprint arXiv:2304.11529 . (2023). Wollek, A. et al. Attention-based saliency maps improve interpretability of pneumothorax classification. Radiology: Artif. Intell. 5 (2), e220187 (2023). Nagendran, M. et al. Artificial intelligence versus clinicians: systematic review of design, reporting standards, and claims of deep learning studies. bmj , 368 . (2020). Alexey, D. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv: 2010.11929 . (2020). 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-6196034","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Article","associatedPublications":[],"authors":[{"id":443113672,"identity":"f035460f-ac4e-4d23-8437-d0ec8db516ff","order_by":0,"name":"Yousef Saad Aldabayan","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA/0lEQVRIiWNgGAWjYFAC5gYJxgYw4zBDBYg+QFALI0wLWzLDGRK18BgTp8Xg+MHGGz932CX2z+75bHCwjUGO70YC84cf+LScSWy27D2TnDjjztnNCUAtxpI3Etgke/BpOZDYJsHbxpzYcCN38+GPbQyJG4BaGHjwaTn/sE3yb1t94vwbOY8PAG2pB2ph/vgHn5YbiW3SvG2HgYbnMIMclmBwI4FBGp8tkjceNlvLnjluvPFGmrHBgXMShjPPPGyTlsGjhe988sGbb3dUy867kfxY4kCZjTzf8eTDH9/g0aJwAEI7NkBoCQZQTOHRwMAgD5W2x6tqFIyCUTAKRjYAABLpXjEKNE8GAAAAAElFTkSuQmCC","orcid":"","institution":"King Faisal University","correspondingAuthor":true,"prefix":"","firstName":"Yousef","middleName":"Saad","lastName":"Aldabayan","suffix":""}],"badges":[],"createdAt":"2025-03-10 13:38:18","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-6196034/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-6196034/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":80807560,"identity":"678c57ab-1c3b-4ae4-a895-3abbf2dd2672","added_by":"auto","created_at":"2025-04-17 09:39:57","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":39434,"visible":true,"origin":"","legend":"\u003cp\u003eTraining and validation loss\u003c/p\u003e","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-6196034/v1/d3f69d645a31564e28a734ca.png"},{"id":80808384,"identity":"bb913599-b345-49f6-ac15-50b2b759cc78","added_by":"auto","created_at":"2025-04-17 09:47:56","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":44267,"visible":true,"origin":"","legend":"\u003cp\u003eTraining and validation accuracy\u003c/p\u003e","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-6196034/v1/a14b8a6f64d096e00dd3d7f6.png"},{"id":80807549,"identity":"45370767-47f5-4618-b99d-fb65d57a4ca2","added_by":"auto","created_at":"2025-04-17 09:39:56","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":20920,"visible":true,"origin":"","legend":"\u003cp\u003eConfusion Matrix\u003c/p\u003e","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-6196034/v1/b696aaa74b577d93f40e8d5c.png"},{"id":80807561,"identity":"16708dad-a499-4652-8d53-9390192934c1","added_by":"auto","created_at":"2025-04-17 09:39:58","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":48380,"visible":true,"origin":"","legend":"\u003cp\u003eROC curve\u003c/p\u003e","description":"","filename":"floatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-6196034/v1/1f663ee33031db0bf77a65b2.png"},{"id":81682387,"identity":"affe3379-610f-46f8-91cb-ccdc8800f4c6","added_by":"auto","created_at":"2025-04-30 09:23:44","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":627247,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-6196034/v1/0e7636c1-c348-49e5-9cac-075974fc9095.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"COPD: Pneumonia and Pneumothorax Detection in Chest X-rays: Vision Transfer based on Deep Learning","fulltext":[{"header":"Introduction","content":"\u003cp\u003eChest X-ray (CXR) imaging is among the most frequent diagnostic modalities used for the detection of various thoracic pathologies including Pneumonia and Pneumothorax [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e]. Because of its ease of access, low cost and short acquisition time it acts as a first line imaging tool and is useful in both high and low resource settings [\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e]. Pneumonia is an infectious disease of alveoli, whose complications are inflammatory exudates, consolidation and opacification of lung parenchyma [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e]. It is caused by bacterial, viral or fungal pathogens and so it needs to be detected and classified early for the right clinical management. On the other hand, pneumothorax is a condition in which the presence of air in the pleural cavity is noted, which can lead to lung collapse, respiratory distress and even cardiovascular compromise if it is not promptly diagnosed and managed. This contrasts with the management of hemothorax. The management of patients with these conditions requires rapid and accurate diagnosis but the process remains challenging because of several limitations in current clinical workflows. Interpretation of chest X-rays is an expert job, and even experienced radiologists have interred reader variability which can cause discrepancies in diagnosis [\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e]. The presence of overt and subtle radiographic findings, variations in image quality, and overlapping pathologies are all factors that further complicate diagnostic accuracy [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e]. This is however a real problem in many healthcare settings, particularly in the rural areas and developing countries since there are not enough trained radiologists to relieve some of the pressure on other medical professionals which may at times result in some form of delay in treatment [\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e]. These challenges make it necessary to have automated computer-aided diagnostic (CAD) systems that can support clinicians in making rapid and accurate predictions on the severity of the disease through deep learning techniques [\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e]. Over the last few years, Convolutional Neural Networks (CNNs) have been among the techniques that have found their application in medical imaging for disease classification and segmentation [\u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e11\u003c/span\u003e]. CNNs capture local signals from images in a hierarchical manner by performing convolution on spatial representations of anatomical structures. However, CNN based architectures such as ResNet, DenseNet and Inception have shown potential results in chest X-ray classification, but they are involved with several constraints that affect their effectiveness in real clinical practice.\u003c/p\u003e \u003cp\u003eA primary limitation of CNN based models is localized feature extraction reliance, one of the primaries [\u003cspan additionalcitationids=\"CR13\" citationid=\"CR12\" class=\"CitationRef\"\u003e12\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR14\" class=\"CitationRef\"\u003e14\u003c/span\u003e]. CNNs have a fixed receptive field that prevents them from learning long range dependencies in images [\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e]. In the case of chest X-rays, global contextual information is vital for identifying diffuse lung opacities in pneumonia or subtle pleural line abnormalities in pneumothorax [\u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e16\u003c/span\u003e]. CNNs are likely to pay attention to small scale spatial features and fail to learn important features that are more distributed across the different regions of the lung fields [\u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e17\u003c/span\u003e]. This limitation hinders the model's capacity to discriminate between diverse disease expressions which need not only a local but also a global spatial understanding.\u003c/p\u003e \u003cp\u003eAnother major problem is the so-called domain shift problem where CNNs trained on a certain dataset may fail to generalize across various imaging conditions [\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e18\u003c/span\u003e], types of equipment, and populations of patients. Such as differences in imaging protocols, exposure levels, contrast settings and anatomical variations, which can cause discrepancies between the real images and model predictions. Most of the existing DL approaches do not include such variation tolerance and perform poorly when applied to a diverse set of real-world datasets. Furthermore, CNN-based models are generally black box algorithms\u0026ndash;accurate, but unexplainable [\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e19\u003c/span\u003e]. This raises a concern about clinical trust and adoption because clinical experts require intelligible models that are congruent with the way humans make decisions. However, one major limitation of their adoption in medical imaging up to this point has been the inability of CNNs to provide meaningful insights into their decision-making process. Without visual explanations for predictions, it is hard for clinicians to validate the model\u0026rsquo;s outputs and incorporate them into their diagnostic workflow. However, the existing models have limitations in explaining the multiple pathologies from a single chest X-ray image. Most of the deep learning approaches are designed for binary classification of normal and abnormal findings. However, real world clinical scenarios often have coexisting conditions where a patient may have features of Pneumonia as well as underlying lung diseases like chronic obstructive pulmonary disease (COPD) or pulmonary oedema. Current models are inadequate to comprehensively evaluate the overall radiographic presentations, resulting in misclassifications when multiple, overlapping features are present.\u003c/p\u003e"},{"header":"Methodology","content":"\u003cp\u003eInterpretation of chest X-rays is an important tool in the diagnosis of thoracic conditions like Pneumonia and Pneumothorax. These conditions must be recognized and localized correctly to ensure the best possible clinical management. In this study, a new DL approach based on ViT was proposed for the automation of the diagnosis of these conditions, together with dealing with class imbalance, variability in imaging conditions, and the need for model interpretability. The approach we propose is based on the use of an appropriately chosen dataset of chest X-ray images including Pneumonia and Pneumothorax cases, where the model was trained to distinguish between the two illnesses. To mitigate the bias in model predictions due to the imbalance of the class distribution, a sampling technique was used to ensure an equal number of instances of both conditions in the training set. It was done by sampling the majority class to increase the sensitivity to infrequent cases without compromising on accuracy for frequent cases. To this end, we further augment the training set to include more diverse and realistic transformations of the input images, thus enhancing the model's robustness against real-world distortions, e.g., arising from differences in imaging protocols, patient positioning, or equipment settings. ViT architecture was selected for its ability to capture global relationships in images via self-attention mechanisms.\u003c/p\u003e \u003cp\u003eFor the classification task, the ViT model was fine tuned to focus then the rest of layers of the model were enabled to do the binary classification of pneumonia and pneumothorax. Further, we enhanced the model by adding dropout layers and optimization techniques to avoid overfitting and find robust performance respectively. Finally, to account for the dynamic nature of the process to converge smoothly, we used a dynamic learning rate schedule to control the speed of the learning process. In addition, the loss function was added to avoid overfitting in the predictions, and to make the predictions more consistent with the clinical expectations. To ensure that the predictions are consistent with clinical reasoning, gradient-based techniques were employed to visually identify the regions of the chest X-rays that the model deemed relevant for the decision-making process. These settings gave further vital pointers regarding the decision-making process, and displayed areas of increased opacity for pneumonia, and sharp radiolucent edges for pneumothorax, as expected from the radiological appearances.\u003c/p\u003e \u003cp\u003eIn this paper, we show that our proposed architecture is suitable and effective for medical imaging and solves crucial problems in real world clinical settings. We further argue that by paying attention to issues of robustness, accuracy, and interpretability, we can provide a useful addition to clinical practice that may help decrease the clinical workload and timing of intervention, especially in resource limited settings.\u003c/p\u003e \u003cdiv id=\"Sec3\" class=\"Section2\"\u003e \u003ch2\u003eModel Specification\u003c/h2\u003e \u003cp\u003eOur proposed method adopts significant techniques, including class imbalance, variability in imaging conditions, and the requirement for transparent and interpretable decision making. We have applied this specification to the dataset preparation phase, which includes curating labeled X-ray images of both the diseases. A WeightedRandomSampler was employed to eradicate the class imbalance within the given dataset. This technique during training oversamples the minority class of data to ensure data balance. Therefore, we have achieved robust sensitivity for Pneumonia while maintaining specificity for Pneumothorax. We have also applied resizing of the images to a constant and uniform resolution 224x224 pixels and converting them to grayscale to focus on structural details critical to clinical diagnosis. Furthermore, robustness was achieved by the application of data augmentation techniques such as brightness and contrast adjustments, random rotations, and affine transformations. Therefore, these techniques implanted real-world variations in imaging conditions, such as differences in scanner settings and patient positioning. Traditional convolutional neural networks differ from ViT as they perform localized receptive field processing of X-ray images. It breaks up images into non-overlapping patches, flattens them to sequences, then embeds them in a latent space. The transformer\u0026rsquo;s multi-head self-attention mechanism enabled the model to analyze global relationships within the X-ray images, making it well-suited for detecting subtle and diffuse patterns in Pneumonia and the localized structural changes characteristic of Pneumothorax. A pretrained ViT Base Patch16 224 model was fine-tuned for binary classification. The original classification head was replaced with a fully connected layer and a dropout layer (rate\u0026thinsp;=\u0026thinsp;0.5) to mitigate overfitting. The training process incorporated advanced optimization strategies to maximize performance. A CosineAnnealingWarmRestarts scheduler dynamically adjusted the learning rate, starting at an initial value of 1e-5, to maintain stability and facilitate convergence. The loss function included label smoothing, preventing the model from becoming overconfident in its predictions and ensuring well-calibrated outputs.\u003c/p\u003e \u003cp\u003eOur proposed network was trained using the AdamW optimizer, this approach effectively balances weight decay and gradient for large-scale vision models. For pneumonia the model concentrates on regions of enhanced opacity which are usually companion of inflammation or consolidation. The emphasis was on sharp radiolucent boundaries and anatomical structure shifts for pneumothorax.\u003c/p\u003e \u003cp\u003eThese visualizations also helped in enhancing the trust of the clinicians in the model\u0026rsquo;s decisions by conforming to radiological expertise. Our ViT-based pipeline performs fairly accurate, robust and interpretable. This approach also performs well in dealing with domain-specific challenges like class imbalance and the need for transparent decision making to show the potential of transformers in medical imaging for transformation. Future extensions include multi class classification, covering more pathologies, and deploying them in real time clinical workflows especially in resource constrained environments where access to specialized radiological expertise is limited.\u003c/p\u003e \u003c/div\u003e\n\u003ch3\u003eDataset\u003c/h3\u003e\n\u003cp\u003eThe dataset used in this study was created by collecting chest X-ray images with the goal of detecting pneumonia and pneumothorax. The images were taken from the NIH Chest X-ray dataset [\u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e20\u003c/span\u003e], a famous collection of labeled radiographs, and were divided into training, validation and test sets for model training and testing purposes. To deal with the problem of class imbalance where pneumonia cases were underrepresented compared to Pneumothorax, WeightedRandomSampler was used during training to guarantee that both classes were equally likely to be included in a batch. This approach was significant in enhancing the sensitivity of the model to pneumonia without worsening the performance in detecting pneumothorax.\u003c/p\u003e \u003cp\u003ePreprocessing of the dataset is carried out using a pipeline to possess uniformity and to optimize the model\u0026rsquo;s performance. All of the datasets were resized to a standard resolution of 224x224 pixels, to fit the input requirements of the Vision Transformer model. All the datasets were resized to a standard resolution of 224x224 pixels to fit the input requirements of the Vision Transformer model. Furthermore, for the purpose of highlighting the structural and anatomical features relevant for diagnosis, they were converted to grayscale. For enhancing the stability of the model, some augmentations were used during training, such as: brightness and contrast adjustment, rotation, affine transformations and finally, sharpness. To ensure the model's effectiveness in real-world conditions, these augmentations mimicked real-world imaging variations and patient positioning, thus enabling the model to perform consistently well across different clinical settings. Besides the dataset there was metadata, consisting of pneumonia and pneumothorax labels, patient demographics and imaging view positions; all of which were derived from the original NIH dataset. The posterior-anterior X-ray views were chosen for the diagnostic importance and the images with artifacts or incomplete annotations were removed from the dataset to avoid contaminated data.\u003c/p\u003e"},{"header":"Results and Discussion","content":"\u003cp\u003eOur study\u0026rsquo;s results show that the ViT model is efficient in identifying pneumonia and pneumothorax from chest X-ray images with high accuracy and clinical reliability. The model had strong generalization across validation and test datasets, such that it is safe to use it on unseen clinical cases. Using a WeightedRandomSampler has greatly enhanced the capacity of the model in identifying pneumonia, an initially underrepresented condition in the dataset. This is crucial in clinical practice, because missing pneumonia can result in delayed treatment and complications like respiratory failure or sepsis. With the improved sensitivity of the model in identifying pneumonia cases, it guarantees that as many instances as possible are not missed and thus treated on time. Also, the accuracy in pneumothorax classification is high, which is necessary as quick identification of this condition is essential, as tension pneumothorax has life-threatening complications and needs urgent treatment. The training and validation curves look good, there is no overfitting, and the loss is decreased steadily with number of epochs.\u003c/p\u003e \u003cp\u003eTo prevent overconfident predictions, especially in medical applications where a wrong decision can have serious implications, the implementation of dropout and label smoothing was important. The CosineAnnealingWarmRestarts scheduler was used to fine tune the model, meaning that it was used to ensure that the training converged properly. This suggests that the model successfully differentiates between these conditions in most scenarios but may require additional feature refinement for ambiguous cases as shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e and Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e. As shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e, the confusion matrix of the model shows a high true positive rate for both conditions and most of the errors happen in the borderline cases, where pneumonia and pneumothorax have similar radiographic features which include lung opacity in the lower lung fields or subtle pleural line abnormalities. The receiver operating characteristic (ROC) curve also verified the model performance, and the area under the curve (AUC) was high for both conditions as shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig4\" class=\"InternalRef\"\u003e4\u003c/span\u003e. AUC values close to one indicate excellent discriminatory ability, which means that the model is capable of distinguishing between normal and pathological lung features with high sensitivity and specificity. From a clinical perspective, high AUC values correspond to lower false negative rates which in turn means that there are fewer cases of a diagnosis going undetected.\u003c/p\u003e \u003cp\u003eIn contrast, for Pneumothorax, the model highlighted pleural edges and regions of increased radiolucency, which align with the radiographic findings of air accumulation in the pleural space. These results support the model\u0026rsquo;s alignment with human expert interpretation, reinforcing its potential as an assistive tool in clinical workflows. For pneumonia, the model always paid attention to the regions of increased lung opacity, which is in accordance with alveolar consolidation seen in bacterial and viral pneumonias. This model has great clinical implications. It can help radiologists and emergency physicians in diagnosing pneumonia and pneumothorax with rapid and accurate classification of chest X-ray images especially in high volume clinical settings. The ability of the model to pay attention to the key radiographic markers increases the possibility of using this model in computer-aided diagnosis (CAD) systems and, in turn, to reduce the diagnostic workload and improve the patient outcomes. Future work will also include the improvement of feature extraction techniques and the growth of the dataset to encompass other thoracic conditions to increase the sensitivity of the model.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003e \u003c/p\u003e\n\u003ch3\u003eComprehensive Literature Review on Vision Transformers for Chest X-ray Analysis\u003c/h3\u003e\n\u003cp\u003eThis paper is an attempt to investigate how the recent developments in Deep Learning (DL) have changed the way medical imaging is handled especially in the automated classification of chest X-rays (CXRs) to identify complications such as pneumonia and pneumothorax. Despite the success of CNN architectures such as ResNet, DenseNet and Inception for radiographic analysis [\u003cspan additionalcitationids=\"CR22\" citationid=\"CR21\" class=\"CitationRef\"\u003e21\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e23\u003c/span\u003e], these networks are nevertheless confined by the local receptive field that is inherent to them and, therefore, cannot learn dependencies in images [\u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e24\u003c/span\u003e]. The main limitations of CNN based approaches are because they perform localized feature extraction. Chest X rays can have widespread opacities, subtle changes in the pleural line, and overall changes in the structure of the lungs which means that global contextual information of different regions of the lung fields is crucial [\u003cspan citationid=\"CR25\" class=\"CitationRef\"\u003e25\u003c/span\u003e]. The constrained receptive fields of CNNs make them ineffective in capturing such global context effectively [\u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e26\u003c/span\u003e]. Moreover, it has been observed that CNNs perform poorly in generalizing across different datasets of patients from various hospitals because of differences in imaging protocols, exposure, and patient position resulting in domain shifts that reduce model performance [\u003cspan citationid=\"CR27\" class=\"CitationRef\"\u003e27\u003c/span\u003e]. Another major issue is the absence of interpretability in CNN based models. The DL models must be clinically transparent and able to explain the reasoning for the automated predictions to the radiologists. Nevertheless, most CNNs are black box models that give little or no insight into their decision-making processes. This is because they have not been incorporated into the real-world clinical workflows due to the non-transparency in the decision-making process of the AI systems, which radiologists need to be able aware of the significant radiographic features leading to a particular diagnosis [\u003cspan citationid=\"CR28\" class=\"CitationRef\"\u003e28\u003c/span\u003e]. Self-attention is embedded in ViTs models to equipped with long range dependencies across entire images [\u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e29\u003c/span\u003e], hence, not relying on convolutional layers to extract local features. Because disease patterns can be spread across large regions rather than localized to small patches, ViTs are thus well suited for analyzing, where X-ray images are believed to have distant regions. In the work of [\u003cspan citationid=\"CR30\" class=\"CitationRef\"\u003e30\u003c/span\u003e], it was observed that ViTs performs better than CNNs in CXR classification with an F1 score of 0.9532 and AUC of 0.97 for pneumonia detection.\u003c/p\u003e \u003cp\u003eThis shows that transformers are capable of learning optimally relevant features directly from medical images, thus improving diagnostic accuracy. Wollek et al. [\u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e31\u003c/span\u003e] also reported that ViTs provided better interpretability through self-attention maps which learned to pay attention to crucial regions in the X-rays that affected the model decision, overcoming one of the major weaknesses of CNNs. Seyyed-Kalantari et al.[\u003cspan citationid=\"CR28\" class=\"CitationRef\"\u003e28\u003c/span\u003e] examined the bias in the AI models and the result shows that the traditional DL models had significant variation in the performance across various demographic groups. These biases are also observed in ViT based architectures, but to a lesser extent, and hence, provide more equitable diagnostic performance across the patient populations. In addition, ViTs also excel at adapting to domain shifts. To be clinically useful, AI driven diagnostic tools must be easily integrated into the current radiology workflows.\u003c/p\u003e \u003cp\u003eResearch has been done on the use of Vision Transformers in automated triage systems, where AI models assist in identifying high risk cases such as suspected pneumothorax, so that the needy are directed to the appropriate level of care first [\u003cspan additionalcitationids=\"CR29\" citationid=\"CR28\" class=\"CitationRef\"\u003e28\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR30\" class=\"CitationRef\"\u003e30\u003c/span\u003e]. This capability is most valuable in low-resource settings where there is limited access to expert radiologists, and AI enabled systems can bridge the gap in medical diagnostics [\u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e31\u003c/span\u003e]. In addition, self-attention in ViTs is understandable on its own, which is necessary for clinical practice. Grad-CAM is an external technique that depends on, for example, CNN-based models, but ViTs natively generate attention maps that highlight the relevant parts of the chest X-rays in harmony with the way of reading imaging data by radiologists [\u003cspan citationid=\"CR32\" class=\"CitationRef\"\u003e32\u003c/span\u003e]. This makes ViTs a good candidate to rely on for transparent AI-based diagnosis, boosting trust in model decisions and enhancing the interaction between human and AI in radiology. Although ViTs have many advantages, they need much larger datasets for training than CNNs. They implement self-attention over all image patches which is computationally expensive and leads to even higher complexity when training the model [\u003cspan citationid=\"CR33\" class=\"CitationRef\"\u003e33\u003c/span\u003e]. Future work should be directed towards hybrid models that incorporate CNN and transformer architectures to capture efficient CNN features together with long range spatial awareness of transformers while maintaining optimal computational performance [\u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e21\u003c/span\u003e]. Another important aspect that needs further attention is the bias mitigation in transformer-based models. However, studies have also revealed that ViTs perform well with respect to fairness across different demographic groups, but this needs further validation on more diverse datasets. It is crucial to eliminate racial, gender, and age biases in AI-based radiology models to make the automated diagnostic systems unbiased and accurate for all patients.\u003c/p\u003e \u003cp\u003eThe use of Vision Transformers for chest X-ray classification is a major contribution to medical image analysis, solving many of the problems of CNN based models. As a result, ViTs provide a better alternative to DL based diagnostics by encoding global contextual relationships, enhancing interpretability, and improving domain generalization in the presence of limited data. However, to achieve clinical feasibility, there are challenges with data efficiency, computational demands, and bias mitigation that must be overcome. Future work should include hybrid DL models, multi-modal transformer architectures, and real-world clinical validation to further establish the role of transformers in radiology.\u003c/p\u003e \u003cp\u003eTo deal with these restrictions, we are proposing a new approach based on the ViT architecture for Pneumonia and Pneumothorax classification. ViTs employ self-attention mechanisms to capture global dependencies across the entire image, thus rendering them particularly effective in analyzing chest X-rays where disease manifestations can be diffuse or subtle, different from traditional CNNs. ViTs break images down into non-overlapping patches, then transform those patches into a sequence of tokens which are then fed into a transformer encoder. Self-attention mechanisms with multiple heads in the transformer encoder help the model to learn dependencies between any region of the image. This enables ViTs to capture long range interactions between anatomical structures which is important for detecting opacities spread all over the image in Pneumonia or pleural line abnormalities in Pneumothorax. In contrast, CNNs are bound by the size of their receptive fields and thus cannot process entire images holistically, thereby lacking context in their understanding of radiographic features. Another major advantage of ViTs in medical imaging is their robustness to domain shifts. Transformers are less sensitive to variations in imaging conditions than CNNs because they learn representations from global feature aggregation. Therefore, they are more adaptable to different hospitals, imaging centers, and patient populations on which the datasets were collected, which further enhances the model generalization across diverse clinical environments.\u003c/p\u003e \u003cp\u003eFurthermore, ViTs are designed to ease the natural integration of multi-pathology learning, able to identify various disease patterns from a single X-ray. Since self-attention mechanisms work on global relationships, ViTs can identify coexisting conditions, which are very relevant for real world use, where patients may have multiple abnormalities to identify. This is particularly important in distinguishing primary Pneumonia from secondary complications such as bacterial superinfection or fluid overload with similar radiographic appearances.\u003c/p\u003e\n\u003ch3\u003eEnhancing Interpretability in AI-Driven Diagnostics\u003c/h3\u003e\n\u003cp\u003eOne of the major concerns with deep learning models in medical imaging is their lack of interpretability. Clinicians require transparent models that provide visual explanations for their predictions, ensuring that automated decisions align with human expertise. To address this, self-attention maps generated by ViTs offer a novel way to visualize the regions of interest the model focuses on during inference. Unlike CNN-based Grad-CAM methods that are limited to localized feature importance, self-attention maps inherently provide global explainability, helping clinicians understand the decision-making process of the model. An important aspect of interpretability is the ability to embed medical domain knowledge into the model\u0026rsquo;s feature representations. Traditional CNNs learn generic low-level features which might not always be relevant to radiological findings. Using transformers to leverage spatial and contextual relationships, the model can learn clinically meaningful representations that match those used in the diagnostic reasoning of radiologists. It enhances the trust in AI-based systems and their real-world adoptability potential.\u003c/p\u003e \u003cdiv id=\"Sec8\" class=\"Section2\"\u003e \u003ch2\u003eClinical Integration and Real-World Applicability\u003c/h2\u003e \u003cp\u003eFor the AIs to be effective in clinical practice, they must integrate seamlessly into the existing radiology workflows. Our proposed methodology has been an AI-enabled assistive diagnostic tool, providing real-time predictions alongside standard radiology reports. The model can be incorporated into Picture Archiving and Communication Systems (PACS) so that radiologists can appraise AI's suggestions when interpreting chest X-rays. This could greatly improve workload in settings with a high volume of imaging studies or limited access to specialized radiologists. Furthermore, the AI triage systems can select high risk cases like suspected Pneumothorax that needs urgent treatment. In a way, our approach can help in automating the flagging of abnormal findings and providing explainable visual overlays of the findings thus helping in improving the decision making in emergency settings. This is particularly useful in low-resource settings where there is limited access to expert radiologists and diagnostic delays can have detrimental effects on patient outcomes.\u003c/p\u003e \u003cp\u003eThe limitations of traditional CNN based models in chest Xray analysis, such as localized feature extraction, susceptibility to domain shift and lack of interpretability, mean that there is a need to move away from these simpler architectures. In our approach, by leveraging vision transformers, we can introduce a new standard for medical imaging, which includes global contextual learning, multi pathology detection and improved explainability. This model is thus able to leverage transformer-based feature representations with radiological insights to the model to try and bridge the gap between AI enabled automation and clinical decision making towards better and more reliable and interpretable diagnostic solutions. The focus of the future work will be on extending the transformer architectures for multi class classification, domain adaptation and integration with radiology AI workflows for clinical impact.\u003c/p\u003e \u003c/div\u003e"},{"header":"Conclusion and Future Work","content":"\u003cp\u003eThis paper shows that our proposed method is successful in detecting pneumonia and pneumothorax from chest X-rays, while also highlighting the shortcomings of conventional convolutional neural networks (CNNs). In contrast to CNNs that rely on local feature extraction, ViTs use self-attention mechanisms to capture global dependencies and are thus more effective at detecting diffuse and complex radiographic patterns. Achieved high classification performance, strong generalization across datasets, and increased interpretability through self-attention maps, which are consistent with clinical reasoning, by the model. These findings indicate that ViTs are a robust, transparent AI-enabled diagnostic tool for radiology, which can assist healthcare professionals in making more accurate and timely diagnosis.\u003c/p\u003e \u003cp\u003eFuture work will build on the model by increasing the model\u0026rsquo;s scope to include multi-modal learning, which will use both CXR images and clinical text reports to make a more rounded evaluation. Furthermore, for generalization, bias mitigation strategies will be discussed to achieve equitable performance for a variety of patient populations. The real-world clinical validation will be conducted in hospital settings to determine the impact of the model on diagnostic workflows and the goal is deployment in AI assisted radiology systems.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eAuthor Contributions:\u003c/strong\u003e All work, including conceptualization, methodology, investigation, writing\u0026mdash;original draft preparation, review, and editing, was conducted by Yousef Saad Aldabayan (Y.S.D.).\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAcknowledgment:\u0026nbsp;\u003c/strong\u003eThis work was supported by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia [Grant\u0026nbsp;No.\u0026nbsp;KFU251185].\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFunding:\u003c/strong\u003e This research received funding from the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eInstitutional Review Board Statement\u003c/strong\u003e: Not applicable. This review article did not involve human or animal subjects and does not require ethical approval.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eInformed Consent Statement:\u003c/strong\u003e Not applicable. No human participants were involved in this study.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eData Availability Statement\u003c/strong\u003e: Ches-Xray8 database is available at https://nihcc.app.box.com/v/ChestXray-NIHCC (accessed on 14 November 2023).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eConflicts of Interest\u003c/strong\u003e: The author declares no conflicts of interest.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\u003cli\u003e\u003cspan\u003eSiddiqi, R. \u0026amp; Javaid, S. Deep learning for pneumonia detection in chest x-ray images: A comprehensive survey. \u003cem\u003eJournal of imaging\u003c/em\u003e, \u003cem\u003e10\u003c/em\u003e(8), p.176. (2024).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eMurali, S. et al. Bringing MRI to low-and middle‐income countries: directions, challenges and potential solutions. \u003cem\u003eNMR Biomed.\u003c/em\u003e \u003cb\u003e37\u003c/b\u003e (7), e4992 (2024).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eW\u0026ouml;dlinger, M. G. \u003cem\u003eApplications of Neural Attention for Modelling Long-Range Dependencies\u003c/em\u003e (Doctoral dissertation, Technische Universit\u0026auml;t Wien). (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eBerner, E. S. \u0026amp; Graber, M. L. Overconfidence as a cause of diagnostic error in medicine. \u003cem\u003eAm. J. Med.\u003c/em\u003e \u003cb\u003e121\u003c/b\u003e (5), S2\u0026ndash;S23 (2008).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eEisenberg, R. L. \u0026amp; Johnson, N. M. \u003cem\u003eComprehensive Radiographic Pathology-E-Book: Comprehensive Radiographic Pathology-E-Book\u003c/em\u003e (Elsevier Health Sciences, 2015).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eRobinson, P. J. Radiology's Achilles' heel: error and variation in the interpretation of the R\u0026ouml;ntgen image. \u003cem\u003eBr. J. Radiol.\u003c/em\u003e \u003cb\u003e70\u003c/b\u003e (839), 1085\u0026ndash;1098 (1997).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003ePinto, A. \u0026amp; Brunese, L. Spectrum of diagnostic errors in radiology. \u003cem\u003eWorld journal of radiology\u003c/em\u003e, \u003cem\u003e2\u003c/em\u003e(10), p.377. (2010).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eoganathan, N., Reis, D. \u0026amp; Serranheira, F. C.S. and Time constraints and workload in the computed tomography department. \u003cem\u003eJournal of Medical Imaging and Radiation Sciences\u003c/em\u003e, \u003cem\u003e56\u003c/em\u003e(2), p.101799. (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eKaur, R., GholamHosseini, H. \u0026amp; Lind\u0026eacute;n, M. Advanced Deep Learning Models for Melanoma Diagnosis in Computer-Aided Skin Cancer Detection. \u003cem\u003eSensors\u003c/em\u003e, \u003cem\u003e25\u003c/em\u003e(3), p.594. (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eParikh, M. et al. Use of Artificial Intelligence in Lower Gastrointestinal and Small Bowel Disorders: An Update Beyond Polyp Detection. \u003cem\u003eJ. Clin. Gastroenterol.\u003c/em\u003e \u003cb\u003e59\u003c/b\u003e (2), 121\u0026ndash;128 (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eFeng, Y. et al. \u003cem\u003eApplication of artificial intelligence-based computer vision methods in liver diseases: a bibliometric analysis\u003c/em\u003e (Intelligent Medicine, 2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eZhao, B. et al. \u003cem\u003eDiagnosis of Coronary Heart Disease through Deep Learning-Based Segmentation and Localization in Computed Tomography Angiography\u003c/em\u003e (IEEE Access, 2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eGui, L. et al. Road Extraction from Remote Sensing Images Using a Skip-Connected Parallel CNN-Transformer Encoder-Decoder Model. Applied Sciences, 15(3), p.1427. (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eVishwakarma, A. K. \u0026amp; Deshmukh, M. \u003cem\u003eCNNM-FDI: Novel Convolutional Neural Network Model for Fire Detection in Images\u003c/em\u003epp.1\u0026ndash;14 (IETE Journal of Research, 2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eMohammadi, S. \u0026amp; Livani, M. A. Enhanced breast mass segmentation in mammograms using a hybrid transformer UNet model. \u003cem\u003eComput. Biol. Med.\u003c/em\u003e \u003cb\u003e184\u003c/b\u003e, 109432 (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eTang, Y., Yuan, Y., Tao, F. \u0026amp; Tang, M. \u003cem\u003eCross-modal Augmented Transformer for Automated Medical Report Generation\u003c/em\u003e (IEEE Journal of Translational Engineering in Health and Medicine, 2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eZhou, C. et al. \u003cem\u003eAn interpretable attention-based deep learning method for landslide prediction based on multi-temporal InSAR time series: A case study of Xinpu landslide in the TGRA\u003c/em\u003e318p.114580 (Remote Sensing of Environment, 2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eNolte, K. et al. Potentials and limitations in the application of Convolutional Neural Networks for mosquito species identification using wing images. bioRxiv, pp.2025-01. (2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eTandel, G. S., Tiwari, A. \u0026amp; Kakde, O. G. \u003cem\u003eMulti-Class Brain Tumor Grades Classification Using a Deep Learning-Based Majority Voting Algorithm and Its Validation Using Explainable-AI\u003c/em\u003epp.1\u0026ndash;38 (Journal of Imaging Informatics in Medicine, 2025).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eWang, X. et al. ChestX-ray8: Hospital-scale Chest X-ray Database and Benchmarks on Weakly-Supervised Classification and Localization of Common Thorax Diseases. IEEE CVPR. (2017).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eHe, K., Zhang, X., Ren, S. \u0026amp; Sun, J. Deep residual learning for image recognition. In \u003cem\u003eProceedings of the IEEE conference on computer vision and pattern recognition\u003c/em\u003e (pp. 770\u0026ndash;778). (2016).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eHuang, G., Liu, Z., Van Der Maaten, L. \u0026amp; Weinberger, K. Q. Densely connected convolutional networks. In \u003cem\u003eProceedings of the IEEE conference on computer vision and pattern recognition\u003c/em\u003e (pp. 4700\u0026ndash;4708). (2017).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eSzegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J. \u0026amp; Wojna, Z. Rethinking the inception architecture for computer vision. In \u003cem\u003eProceedings of the IEEE conference on computer vision and pattern recognition\u003c/em\u003e (pp. 2818\u0026ndash;2826). (2016).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003e\u0026Ccedil;allı, E., Sogancioglu, E., van Ginneken, B., van Leeuwen, K. G. \u0026amp; Murphy, K. Deep learning for chest X-ray analysis: A survey. Medical Image Analysis, 72, p.102125. (2021).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eXLSor, A. \u003cem\u003eRobust and Accurate Lung Segmentor on Chest X-Rays Using Criss-Cross Attention and Customized Radiorealistic Abnormalities Generation.\u003c/em\u003e In \u003cem\u003eProceedings of The 2nd International Conference on Medical Imaging with Deep Learning\u003c/em\u003e (pp. 457\u0026ndash;467).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eDosovitskiy, A. An image is worth 16x16 words: Transformers for image recognition at scale. \u003cem\u003earXiv preprint arXiv:2010.11929\u003c/em\u003e. (2020).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eNagendran, M. et al. Artificial intelligence versus clinicians: systematic review of design, reporting standards, and claims of deep learning studies. \u003cem\u003ebmj\u003c/em\u003e, \u003cem\u003e368\u003c/em\u003e. (2020).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eSeyyed-Kalantari, L., Zhang, H., McDermott, M. B., Chen, I. Y. \u0026amp; Ghassemi, M. Underdiagnosis bias of artificial intelligence algorithms applied to chest radiographs in under-served patient populations. \u003cem\u003eNat. Med.\u003c/em\u003e \u003cb\u003e27\u003c/b\u003e (12), 2176\u0026ndash;2182 (2021).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eVaswani, A. et al. Attention is all you need. Advances in neural information processing systems. \u003cem\u003eAdvances in neural information processing systems\u003c/em\u003e, \u003cem\u003e30\u003c/em\u003e(2017). (2017).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eRegmi, S., Subedi, A., Bagci, U. \u0026amp; Jha, D. Vision transformer for efficient chest X-ray and gastrointestinal image classification. \u003cem\u003earXiv preprint arXiv:2304.11529\u003c/em\u003e. (2023).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eWollek, A. et al. Attention-based saliency maps improve interpretability of pneumothorax classification. \u003cem\u003eRadiology: Artif. Intell.\u003c/em\u003e \u003cb\u003e5\u003c/b\u003e (2), e220187 (2023).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eNagendran, M. et al. Artificial intelligence versus clinicians: systematic review of design, reporting standards, and claims of deep learning studies. \u003cem\u003ebmj\u003c/em\u003e, \u003cem\u003e368\u003c/em\u003e. (2020).\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eAlexey, D. An image is worth 16x16 words: Transformers for image recognition at scale. \u003cem\u003earXiv preprint arXiv: 2010.11929\u003c/em\u003e. (2020).\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e"}],"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":"COPD, Pneumonia, Pneumothorax, Deep Learning, Vision Transfer, Detection","lastPublishedDoi":"10.21203/rs.3.rs-6196034/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-6196034/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eRecently, there has been a growing interest in the application of deep learning for the automated analysis of chest X-rays (CXRs) especially for the detection of pneumothorax. Conventional deep learning models such as convolutional neural networks (CNNs) have shown to perform well in CXR classification. However, CNN-based methods are limited by the local dependence of the feature extraction in their inherent form, which prevents them from capturing long-range dependencies in medical images. Furthermore, CNNs have a domain shift problem, which limits their flexibility in varying imaging conditions and are typically black box models that are difficult to interpret and incorporate into clinical decision-making processes. In this paper, we designed a novel Vision Transfer (ViT) based framework for the classification of pneumonia and pneumothorax from CXRs. In contrast to CNNs, ViTs use self-attention to model global dependencies and are thus well-placed to detect diffuse opacities in pneumonia, and pleural abnormalities in pneumothorax. The ViT model was fine-tuned on a dataset of CXRs, which were labelled with advanced preprocessing and augmentation of the data for better generalization. To improve clinical interpretability, we used self-attention maps to develop a more transparent and explainable AI based diagnostic system. In our approach, we showed that our model had superior classification performance with high sensitivity and specificity across both conditions. The self-attention maps provided intrinsic interpretability by highlighting clinically relevant regions in the X-rays, which aligned with expert radiological assessments. The model also had better generalization across datasets, reducing biases typical to CNN based architectures. The results show that ViTs can be a potential new approach for CNNs in the field of medical imaging, especially for the automated interpretation of chest X-rays. Through enhancing the classification accuracy, guaranteeing the domain generalization, and ensuring the clinical interpretability, ViTs can improve the AI-assisted diagnostics in radiology workflows and thus facilitate the fast and accurate decision making in the respiratory disease detection. Future work will include exploring multi-modal fusion approaches and real-world clinical validation to further enhance the effectiveness of transformer-based models in healthcare in practice.\u003c/p\u003e","manuscriptTitle":"COPD: Pneumonia and Pneumothorax Detection in Chest X-rays: Vision Transfer based on Deep Learning","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-04-17 09:39:52","doi":"10.21203/rs.3.rs-6196034/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":"5447e177-a240-4126-97f4-596e7ee76b9d","owner":[],"postedDate":"April 17th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":47175350,"name":"Biological sciences/Physiology"},{"id":47175351,"name":"Biological sciences/Physiology/Cardiovascular biology"},{"id":47175352,"name":"Biological sciences/Physiology/Cardiovascular biology/Heart development"}],"tags":[],"updatedAt":"2025-04-30T09:23:28+00:00","versionOfRecord":[],"versionCreatedAt":"2025-04-17 09:39:52","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-6196034","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-6196034","identity":"rs-6196034","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.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00