<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "http://jats.nlm.nih.gov/publishing/1.3/JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xml:lang="en" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="nlm-ta">PJS</journal-id>
<journal-id journal-id-type="publisher-id">Premier Journal of Science</journal-id>
<journal-id journal-id-type="pmc">PJS</journal-id>
<journal-title-group>
<journal-title>PJ Science</journal-title>
</journal-title-group>
<issn pub-type="epub">3049-9011</issn>
<publisher>
<publisher-name>Premier Science</publisher-name>
<publisher-loc>London, UK</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.70389/PJS.100220</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>ORIGINAL RESEARCH</subject>
</subj-group>
<subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Cognitive science</subject><subj-group><subject>Cognitive psychology</subject><subj-group><subject>Perception</subject><subj-group><subject>Sensory perception</subject><subj-group><subject>Hallucinations</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Psychology</subject><subj-group><subject>Cognitive psychology</subject><subj-group><subject>Perception</subject><subj-group><subject>Sensory perception</subject><subj-group><subject>Hallucinations</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Social sciences</subject><subj-group><subject>Psychology</subject><subj-group><subject>Cognitive psychology</subject><subj-group><subject>Perception</subject><subj-group><subject>Sensory perception</subject><subj-group><subject>Hallucinations</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Sensory perception</subject><subj-group><subject>Hallucinations</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Social sciences</subject><subj-group><subject>Linguistics</subject><subj-group><subject>Grammar</subject><subj-group><subject>Phonology</subject><subj-group><subject>Syllables</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Engineering and technology</subject><subj-group><subject>Signal processing</subject><subj-group><subject>Speech signal processing</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Cognitive science</subject><subj-group><subject>Cognitive psychology</subject><subj-group><subject>Perception</subject><subj-group><subject>Sensory perception</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Psychology</subject><subj-group><subject>Cognitive psychology</subject><subj-group><subject>Perception</subject><subj-group><subject>Sensory perception</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Social sciences</subject><subj-group><subject>Psychology</subject><subj-group><subject>Cognitive psychology</subject><subj-group><subject>Perception</subject><subj-group><subject>Sensory perception</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Sensory perception</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Mental health and psychiatry</subject><subj-group><subject>Schizophrenia</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Research and analysis methods</subject><subj-group><subject>Bioassays and physiological analysis</subject><subj-group><subject>Electrophysiological techniques</subject><subj-group><subject>Brain electrophysiology</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Physiology</subject><subj-group><subject>Electrophysiology</subject><subj-group><subject>Neurophysiology</subject><subj-group><subject>Brain electrophysiology</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Neurophysiology</subject><subj-group><subject>Brain electrophysiology</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Brain mapping</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Clinical medicine</subject><subj-group><subject>Clinical neurophysiology</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Research and analysis methods</subject><subj-group><subject>Imaging techniques</subject><subj-group><subject>Neuroimaging</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Neuroimaging</subject><subj-group><subject>Electroencephalography</subject><subj-group><subject>Event-related potentials</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Cell biology</subject><subj-group><subject>Cellular types</subject><subj-group><subject>Animal cells</subject><subj-group><subject>Neurons</subject><subj-group><subject>Interneurons</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Cellular neuroscience</subject><subj-group><subject>Neurons</subject><subj-group><subject>Interneurons</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Research and analysis methods</subject><subj-group><subject>Bioassays and physiological analysis</subject><subj-group><subject>Electrophysiological techniques</subject><subj-group><subject>Brain electrophysiology</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Physiology</subject><subj-group><subject>Electrophysiology</subject><subj-group><subject>Neurophysiology</subject><subj-group><subject>Brain electrophysiology</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Neurophysiology</subject><subj-group><subject>Brain electrophysiology</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Brain mapping</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Clinical medicine</subject><subj-group><subject>Clinical neurophysiology</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Research and analysis methods</subject><subj-group><subject>Imaging techniques</subject><subj-group><subject>Neuroimaging</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Neuroimaging</subject><subj-group><subject>Electroencephalography</subject></subj-group></subj-group></subj-group></subj-group>
</article-categories>
<title-group>
<article-title>Lungs Disease Classification Using an Self Attention Based Neural Network: A Local Agnostic Explainable Approach</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>P.K</surname>
<given-names>Sadakathulla</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/conceptualization">Conceptualization</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-original-draft">Writing &#x2013; original draft</role>
<role content-type="http://credit.niso.org/contributor-roles/review-editing">Review and editing</role>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Parameswari</surname>
<given-names>R.</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/conceptualization">Conceptualization</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-original-draft">Writing &#x2013; original draft</role>
<role content-type="http://credit.niso.org/contributor-roles/review-editing">Review and editing</role>
</contrib>
<aff id="aff1"><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00tscx035</institution-id><institution>School of Computing Sciences Vels Institute of Science, Technology &#x0026; Advanced Studeis (VISTAS)</institution></institution-wrap>, <city>Chennai</city>, <state>Tamil Nadu</state>, <country>India</country></aff>
</contrib-group>
<author-notes>
<corresp id="cor001"><bold>Correspondence to:</bold> Sadakathulla P.K, <email>sadakpk@gmail.com</email></corresp>
<fn fn-type="other"><p>Peer Review</p></fn>
</author-notes>
<pub-date pub-type="epub">
<day>28</day>
<month>01</month>
<year>2026</year>
</pub-date>
<pub-date pub-type="collection">
<month>01</month>
<year>2026</year>
</pub-date>
<volume>15</volume>
<issue>1</issue>
<elocation-id>100220</elocation-id>
<history>
<date date-type="received">
<day>14</day>
<month>08</month>
<year>2025</year>
</date>
<date date-type="rev-recd">
<day>23</day>
<month>09</month>
<year>2025</year>
</date>
<date date-type="accepted">
<day>17</day>
<month>12</month>
<year>2025</year>
</date>
</history>
<permissions>
<copyright-year>2025</copyright-year>
<copyright-holder>Sadakathulla P.K and R. Parameswari</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">
<license-p>This is an open access article distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">Creative Commons Attribution License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="info:doi/10.70389/PJS.100220"/>
<abstract>
<p>Understanding the future potential candidates for lung disease classification poses a great challenge for physicians. If they can understand the future lungs disease patients from their Chest X-ray images, it would help them in proper design of medication strategies. It helps them to reduce their overburdening during physical examination of their patients. Physician often face difficulty in accurately finding the proper chest disease. However, an explainable neural network enabled architecture can help in better diagnosis of lung diseases. Hence, this study proposes an attention-based Convolutional Neural Network and consequently followed by a local agnostic explanation method for better understanding what made the artificial intelligence model to predict the image belongs to either Bacterial Tuberculosis, Pneumonia, Normal, Viral Pneumonia. We achieved a BCA of 84% on the testing set. Moreover, an explainable AI based local agnostic framework is used to understand which portion of the lungs make a class distinguishable.</p>
</abstract>
<kwd-group kwd-group-type="author">
<kwd>Self-attention convolutional neural network</kwd>
<kwd>Chest X-ray lung disease classification</kwd>
<kwd>Tuberculosis and pneumonia detection</kwd>
<kwd>LIME-based model explanation</kwd>
<kwd>Explainable medical imaging AI</kwd>
</kwd-group>
<counts>
<fig-count count="6"/>
<table-count count="8"/>
<page-count count="6"/>
</counts>
<custom-meta-group>
<custom-meta>
<meta-name>Version accepted</meta-name>
<meta-value>2</meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
<body>
<sec>
<title><ext-link ext-link-type="uri" xlink:href="https://premierscience.com/wp-content/uploads/2025/15/pjs-25-1200.pdf">Source-File: pjs-25-1200.pdf</ext-link></title>
</sec>
<sec id="sec001" sec-type="intro">
<title>Introduction</title>
<p>Lungs Disease Classification plays a crucial role in the detection, diagnosis, and treatment of various respiratory diseases. Given the complexity and variability of lung diseases, accurate classification methods are essential for distinguishing between different conditions based on medical imaging, clinical symptoms, and biomarkers.<sup><xref ref-type="bibr" rid="ref1">1</xref>,<xref ref-type="bibr" rid="ref2">2</xref></sup> Traditional diagnostic methods rely on radiologists interpreting chest X-rays or CT scans, which can be time-consuming and prone to human error. Machine learning and deep learning techniques, particularly convolutional neural networks (CNNs), have significantly improved the accuracy and efficiency of lung disease classification by automating image analysis and identifying patterns that may not be easily recognizable to the human eye.<sup><xref ref-type="bibr" rid="ref1">1</xref>,<xref ref-type="bibr" rid="ref2">2</xref></sup></p>
<p>The importance of lung disease classification extends beyond individual diagnosis, as it aids in public health monitoring and resource allocation. Timely and precise classification enables early intervention, reducing the severity of diseases and improving patient outcomes.<sup><xref ref-type="bibr" rid="ref1">1</xref>,<xref ref-type="bibr" rid="ref3">3</xref></sup> For instance, automated classification systems can assist in detecting infectious diseases like tuberculosis in high-risk populations, enabling quicker isolation and treatment to prevent further spread.<sup><xref ref-type="bibr" rid="ref4">4</xref>,<xref ref-type="bibr" rid="ref5">5</xref></sup></p>
<p>Classifying lung diseases into five categories&#x2014; Tuberculosis, Coronavirus (COVID-19), Bacterial Pneumonia, Viral Pneumonia, and Normal Patients&#x2014;is crucial for accurate diagnosis, effective treatment, and public health management. Each condition requires distinct medical interventions, and misclassification can lead to improper treatment, worsening patient outcomes.<sup><xref ref-type="bibr" rid="ref3">3</xref>,<xref ref-type="bibr" rid="ref6">6</xref></sup> Early identification of infectious diseases like COVID-19 and tuberculosis helps prevent transmission, while distinguishing between bacterial and viral pneumonia ensures appropriate antibiotic use, reducing the risk of antimicrobial resistance.<sup><xref ref-type="bibr" rid="ref7">7</xref>,<xref ref-type="bibr" rid="ref8">8</xref></sup> Automated classification systems powered by AI and deep learning can aid in rapid, cost-effective screening, especially in resource-limited areas.<sup><xref ref-type="bibr" rid="ref9">9</xref>,<xref ref-type="bibr" rid="ref10">10</xref></sup> This classification enhances clinical decision-making, outbreak control, and patient survival rates, ultimately improving healthcare efficiency and disease management.<sup><xref ref-type="bibr" rid="ref11">11</xref>,<xref ref-type="bibr" rid="ref12">12</xref>,<xref ref-type="bibr" rid="ref13">13</xref></sup></p>
<p>This study performs an attention-based Convolutional Neural Network for the classification of lung diseases into 5 categories namely: Bacterial Pneumonia, Viral Pneumonia, Normal, Tuberculosis patients. Further, we also performed an Explainable local agnostic for explaining how these models made the prediction. Rest of the paper is as follows: section 2 has literature review, section 3 has methodology, section 4 has results and discussions, and section 5 has conclusions.</p>
</sec>
<sec id="sec002">
<title>Literature Review</title>
<p>This section contains the information about the previous studies conducted on the detection of Lung Diseases Classification. We observed that many deep learning studies are used for the early detection of lung diseases such as Tuberculosis, COVID-19, Bacterial Pneumonia, Viral Pneumonia, and Normal Control patients. Researchers utilized Convolutional Neural Networks (CNN) to classify Tuberculosis, COVID-19, bacterial pneumonia, viral pneumonia, and normal patients. We classified the existing literature spanning from 2023 onwards into mainly 4 categories. They are:</p>
<list list-type="bullet">
<list-item><p>Standard CNN, where the researchers used the standard CNN architecture for distinguishing Tuberculosis, COVID-19, Bacterial Pneumonia, Viral Pneumonia, and Healthy Control patients,</p></list-item>
<list-item><p>Pre-trained CNN architectures where the researchers utilized an existing implemented CNN network for developing an architecture, It is also known as transfer learning from the literature. For example, researchers utilized an existing pre-trained model that works pretty well on some other similar disease datasets can be efficiently utilized for the given underlying problem after minor finetuning of the model,</p></list-item>
<list-item><p>Attention mechanism is the one where the researchers used those designed CNN network that has a larger emphasis on some specific portions of an input image. They provide an extra attention and weightage to some input portions of an image.</p></list-item>
</list>
<sec id="sec002-1">
<title>Standard CNN Architectures for Lung Disease Classification</title>
<p>M Hog et. al proposed a CNN architecture with deep max and soft max pooling layer for the detection of lungs diseases into 2 categories namely healthy and control patients. They reported an accuracy of 87% with the testing set.<sup><xref ref-type="bibr" rid="ref14">14</xref></sup> Another study conducted by the researchers in<sup><xref ref-type="bibr" rid="ref15">15</xref></sup> used an optimized neural network embedded with a gradient descent algorithm for the detection of lung diseases into pneumonia, lung cancer, TB achieved an accuracy of 99.2% accuracy. In another study conducted by the researchers in,<sup><xref ref-type="bibr" rid="ref16">16</xref></sup> they used an optimized CNN with extreme learning machine, reporting an accuracy of 96.2% for classifiying the various levels of severity of lung cancer. All these approache&#x2019;s focus was heavily on the design of neural networks. However, there are no clear explanation and CNN model building that captures a specific region wise detail in these studies.</p>
</sec>
<sec id="sec002-2">
<title>Pre-trained CNN Architectures &#x2013; Transfer Learning</title>
<p>In pre-trained CNN architectures, the model development involves the application of an already existing pre-trained model for the classification purpose. This involves the application of a pre-trained model that is already being developed in any of the existing lung cancer datasets to be deployed and used for the existing problem, reported with an accuracy of 93% for classifying lung Carcinoma and non-carcinoma patients.<sup><xref ref-type="bibr" rid="ref16">16</xref></sup></p>
<p>A transfer learning technique is employed by the researchers in<sup><xref ref-type="bibr" rid="ref17">17</xref></sup> for the detection of Lung Carcinoma. This study utilized the application of VGG 16 and VGG 19 networks that are already applied a lot for the detection healthcare disease prediction tasks previously in the literature. Another study conducted by Michael et al.<sup><xref ref-type="bibr" rid="ref18">18</xref></sup> used a deep residual network based architecture for the detection of Pneumonia and Tuberculosis from the Chest X ray images. They reported with an accuracy of 86.4% accuracy on Chest X ray dataset. Mahmud et al.<sup><xref ref-type="bibr" rid="ref19">19</xref></sup> used an interpretable deep learning network for the early detection of lung disease from Chest X-Ray images, reported with an accuracy of 91%. Even though, this study used interpretable framework in it, it failed to bring an understanding about the domain specific regions associated with the chest X ray responsible for lungs disease.<sup><xref ref-type="bibr" rid="ref19">19</xref></sup> This is the same case for every other study discussed here.<sup><xref ref-type="bibr" rid="ref16">16</xref>,<xref ref-type="bibr" rid="ref17">17</xref>,<xref ref-type="bibr" rid="ref18">18</xref>,<xref ref-type="bibr" rid="ref19">19</xref></sup></p>
</sec>
</sec>
<sec id="sec003">
<title>Research Gap and Motivation for the Study</title>
<p>Many of the latest studies performed on lung disease from Chest X ray images are focused on the Convolutional Neural Network without a greater focus on the interpretation and reasoning on why these models predicted a patient to be in a particular category. This is where our study is aiming for a region-focused neural network that can find out the lung disease category specifically into five categories namely: Bacterial Pneumonia, Viral Pneumonia, Corona Virus, and Normal patients. For this, we are using an attention-based neural network with interpretation layer using Local Interpretable Model Agnostic Explanations (LIME). Hence, the proposed model framework has the potential to explain a model explanation to the concerned stakeholder with the reason for such explanations.</p>
</sec>
<sec id="sec004">
<title>Methodology</title>
<p>We followed the methodology below in its sequential form for implementation. The first step involves image pre-processing, where the overall image is resized to a normalized size (620*620 pixel size). All the images used for the study is already in a Gray Scale format. Hence, we do not perform any further image conversions in the study. For example, the conversions from color to grayscale or grayscale or color conversions and all. In the second step, we performed the neural network architecture with a self attention mechanism. Then, in the third step the final results are evaluated for the execution purpose. Finally, we performed a LIME enabled visualization to understand it better which areas of the image region has made the significant contribution for the classification of lungs disease into the 5 categories.</p>
<sec id="sec004-1">
<title>Dataset</title>
<p>We used the Lungs Disease dataset from the Kaggle which comprises of Chest X-ray images for 4 diseases namely Bacterial Pneumonia, Viral Pneumonia, Tuberculosis, COVID 19, and Normal patients (<ext-link ext-link-type="uri" xlink:href="http://www.kaggle.com">www.kaggle.com</ext-link>). This datset is collected by the National Institute of Chest Disease, USA for developing a deep learning model for the advanced prediction of Chest X Ray patients. It consists of 3475 X Ray images. There are 1250 normal patients, 1100 Viral Pneumonia, 750 Tuberculosis, 225 Bacterial Pneumonia patients. The dataset used in this study was obtained from a publicly available repository (Kaggle) that provides de-identified chest X-ray images. All personal identifiers were removed prior to public release, and the dataset complies with the institutional and ethical guidelines of the source institutions. As such, no additional patient consent was required for the present study (<xref ref-type="fig" rid="F1">Figures 1</xref>&#x2013;<xref ref-type="fig" rid="F4">4</xref>).</p>
<fig id="F1" position="float">
<object-id pub-id-type="doi">10.70389/journal.PJS.100220.g001</object-id>
<label>Fig 1</label>
<caption><title>Bacterial Pneumonia</title></caption>
<p><ext-link ext-link-type="uri" xlink:href="https://i0.wp.com/premierscience.com/wp-content/uploads/2025/15/pjs-25-1200-Figure-1.webp?">Figure 1</ext-link></p>
</fig>
<fig id="F2" position="float">
<object-id pub-id-type="doi">10.70389/journal.PJS.100220.g002</object-id>
<label>Fig 2</label>
<caption><title>Normal</title></caption>
<p><ext-link ext-link-type="uri" xlink:href="https://i0.wp.com/premierscience.com/wp-content/uploads/2025/15/pjs-25-1200-Figure-2.webp?">Figure 2</ext-link></p>
</fig>
<fig id="F3" position="float">
<object-id pub-id-type="doi">10.70389/journal.PJS.100220.g003</object-id>
<label>Fig 3</label>
<caption><title>Tuberculosis</title></caption>
<p><ext-link ext-link-type="uri" xlink:href="https://i0.wp.com/premierscience.com/wp-content/uploads/2025/15/pjs-25-1200-Figure-3.webp?">Figure 3</ext-link></p>
</fig>
<fig id="F4" position="float">
<object-id pub-id-type="doi">10.70389/journal.PJS.100220.g004</object-id>
<label>Fig 4</label>
<caption><title>Viral Pneumonia</title></caption>
<p><ext-link ext-link-type="uri" xlink:href="https://i0.wp.com/premierscience.com/wp-content/uploads/2025/15/pjs-25-1200-Figure-4.webp?">Figure 4</ext-link></p>
</fig>
<p>To enhance model robustness and prevent overfitting, we applied standard augmentation techniques: random rotations (&#x00B1;15&#x00B0;), horizontal flips (p = 0.5), brightness scaling (&#x00B1;20%), and Gaussian noise injection. These augmentations were applied during training only and not during validation/testing.</p>
<p>A Self Attention Based Convolutional Neural Network (SA-CNN) is a collection of CNN which uses self-attention mechanism to improve upon the capture of spatial dependencies. It can be used to locate and understand the local dependencies in the image. For example, using SA-CNN helps in the capture of regional information or targeted specific regions in the image.<sup><xref ref-type="bibr" rid="ref20">20</xref></sup> The lung diseases such as Bacterial Pneumonia, Viral Pneumonia, Tuberculosis, COVID 19 affects the upper, lower, and peripheral regions of the brain. Hence, the application of SA-CNN can help largely in the detection of these disease focusing on the regions.<sup><xref ref-type="bibr" rid="ref18">18</xref>,<xref ref-type="bibr" rid="ref19">19</xref>,<xref ref-type="bibr" rid="ref20">20</xref></sup></p>
<p>Configurations of SA-CNN:</p>
<list list-type="bullet">
<list-item><p>Number of attention heads: 12,</p></list-item>
<list-item><p>Number of layers: 24,</p></list-item>
<list-item><p>Number of hidden layers: 256,</p></list-item>
<list-item><p>Feedforward network size: 2048,</p></list-item>
<list-item><p>Drop-out rate: 0.1,</p></list-item>
<list-item><p>Batch Size: 256,</p></list-item>
<list-item><p>Learning Rate: 0.06,</p></list-item>
<list-item><p>Optimizer: Adam,</p></list-item>
<list-item><p>Epochs: 10</p></list-item>
<list-item><p>Weight decay: 0.01.</p></list-item>
</list>
<p>The proposed Self-Attention Convolutional Neural Network (SA-CNN) begins with input chest X-ray images resized to 620 &#x00D7; 620 pixels in grayscale and normalized to [0,1]. The feature extraction pipeline starts with three convolutional blocks: the first uses 64 filters with a 3 &#x00D7; 3 kernel followed by batch normalization, ReLU activation, and 2 &#x00D7; 2 max pooling; the second expands to 128 filters with the same configuration; and the third employs 256 filters with batch normalization, ReLU, and max pooling. These extracted features are then passed into a multi-head self-attention module with 12 attention heads, hidden size of 256, feedforward dimension of 2048, residual connections, and layer normalization, enabling the model to capture long-range dependencies across local patches of the lung regions. Post-attention, a fourth convolutional block with 512 filters (3 &#x00D7; 3) and global average pooling is applied to refine spatial features. The network then transitions into fully connected layers: one dense layer with 512 units (ReLU, dropout 0.5), followed by another with 256 units (ReLU). Finally, the output layer consists of 4 neurons corresponding to the classes (Normal, Tuberculosis, Bacterial Pneumonia, Viral Pneumonia) with a softmax activation to produce probability scores.</p>
<p>Training was performed on an NVIDIA V100 GPU using PyTorch 2.0. We applied stratified splitting to maintain class proportions across training (80%), validation (10%), and testing (10%). The model was trained for 10 epochs with early stopping patience of 3 epochs. Adam optimizer was used with weight decay 0.01 and learning rate 0.06. Model checkpoints were saved based on validation loss improvement.</p>
<p>To address class imbalance, class weights were incorporated into the cross-entropy loss function, with weights inversely proportional to class frequency. Additionally, minority classes (e.g., Bacterial Pneumonia) were oversampled using balanced batch sampling to ensure each mini-batch contained a more uniform distribution.</p>
</sec>
</sec>
<sec id="sec005">
<title>Evaluation Metrics</title>
<p>We used three evaluation metrics for assessing the model. They are: 1. Sensitivity = TP/(TP+FN), 2. Specificity = TN/(TN+FP), 3. Balanced Classification Accuracy (BCA) = (Sensitivity + Specificity)/2, where TP is the True Positive ie Correctly identifying a class as such, FP is the False Positive ie, falsely identifying a positive class as negative, FN is the False Negative ie, falsely identifying a negative class as positive one. A better model tends to have higher value for all these metrics. AUC (Area Under the ROC Curve) measures how well a model ranks positives above negatives across all decision thresholds&#x2014;it&#x2019;s the probability a random positive gets a higher score than a random negative. Values range from 0.5 (random guessing) to 1.0 (perfect separation); higher is better.</p>
<sec id="sec005-1">
<title>Explainable AI using LIME</title>
<p>LIME is an explainable AI technique that helps interpret complex machine learning models by approximating them with simple, interpretable models locally around specific predictions. It works by perturbing the input data, generating slightly modified instances, and observing how the model&#x2019;s predictions change. Then, it fits a simpler, interpretable model (such as a linear regression) to these perturbations, capturing the local behavior of the black-box model.<sup><xref ref-type="bibr" rid="ref21">21</xref></sup></p>
</sec>
</sec>
<sec id="sec006">
<title>Experimental Results and Discussion</title>
<p>We split the entire dataset into 3 categories namely: training, validation, and testing sets. After performing a 80%&#x2013;20% split for the whole dataset, we created a training-validation set of 2780 and 695 testing data. We created a 80%, 10%, 10% split for training, validation, testing sets respectively (<xref ref-type="table" rid="T1">Table 1</xref>).</p>
<table-wrap id="T1">
<label>Table 1</label>
<caption><title>Number of labels in each class after splitting VP-Viral Pneuomnia, BP-Bacterial Pneumonia, Tuber Culosis-TB</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Class</th>
<th valign="top" align="center">Cases</th>
<th valign="top" align="center">Training (%)</th>
<th valign="top" align="center">Validation (%)</th>
<th valign="top" align="center">Testing (%)</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Normal</td>
<td valign="top" align="center">1250</td>
<td valign="top" align="center">1000</td>
<td valign="top" align="center">125</td>
<td valign="top" align="center">125</td>
</tr>
<tr>
<td valign="top" align="left">VP</td>
<td valign="top" align="center">1100</td>
<td valign="top" align="center">880</td>
<td valign="top" align="center">110</td>
<td valign="top" align="center">110</td>
</tr>
<tr>
<td valign="top" align="left">TB</td>
<td valign="top" align="center">750</td>
<td valign="top" align="center">600</td>
<td valign="top" align="center">75</td>
<td/>
</tr>
<tr>
<td valign="top" align="left">BP</td>
<td valign="top" align="center">225</td>
<td valign="top" align="center">180</td>
<td valign="top" align="center">22</td>
<td valign="top" align="center">75</td>
</tr>
<tr>
<td valign="top" align="left">Total</td>
<td valign="top" align="center">3465</td>
<td valign="top" align="center">2660</td>
<td valign="top" align="center">332</td>
<td valign="top" align="center">23</td>
</tr>
</tbody>
</table>
</table-wrap>
<p><xref ref-type="table" rid="T2">Table 2</xref> illustrates the epoch wise training, validation, and testing set accuracy and error after the experimentation. It is observed that the result accuracy has significantly improved in each epoch resulting in a total overall training accuracy of 93% and testing accuracy of 88% after the epoch number 10. The self capture nature of SA-CNN made it possible to capture local patches in the image after each epoch. Hence, after increasing the number of epochs, the self attention mechanisms were able to increase the training accuracy to a greater extent. Further, we also observed that the training accuracy has reduced after epoch 10 as the self attention mechanism started to over adapt with the local patterns and starts to show the older patterns again and again.</p>
<table-wrap id="T2">
<label>Table 2</label>
<caption><title>Illustration of the training, validation, and testing accuracy, error across epochs. Tr Acc-Training Accuracy, Training Error, Validation Accuracy, Validation Error, Testing Accuracy, Testing Error</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Epoch</th>
<th valign="top" align="center">Tr<break/>Acc</th>
<th valign="top" align="center">Tr<break/>Err</th>
<th valign="top" align="center">Val<break/>Acc</th>
<th valign="top" align="center">Val<break/>Err</th>
<th valign="top" align="center">Test<break/>Acc</th>
<th valign="top" align="center">Test<break/>Err</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">1</td>
<td valign="top" align="center">60%</td>
<td valign="top" align="center">40%</td>
<td valign="top" align="center">55%</td>
<td valign="top" align="center">45%</td>
<td valign="top" align="center">56%</td>
<td valign="top" align="center">44%</td>
</tr>
<tr>
<td valign="top" align="left">2</td>
<td valign="top" align="center">68%</td>
<td valign="top" align="center">32%</td>
<td valign="top" align="center">62%</td>
<td valign="top" align="center">38%</td>
<td valign="top" align="center">64%</td>
<td valign="top" align="center">36%</td>
</tr>
<tr>
<td valign="top" align="left">3</td>
<td valign="top" align="center">75%</td>
<td valign="top" align="center">25%</td>
<td valign="top" align="center">70%</td>
<td valign="top" align="center">30%</td>
<td valign="top" align="center">71%</td>
<td valign="top" align="center">29%</td>
</tr>
<tr>
<td valign="top" align="left">4</td>
<td valign="top" align="center">80%</td>
<td valign="top" align="center">20%</td>
<td valign="top" align="center">76%</td>
<td valign="top" align="center">24%</td>
<td valign="top" align="center">77%</td>
<td valign="top" align="center">23%</td>
</tr>
<tr>
<td valign="top" align="left">5</td>
<td valign="top" align="center">85%</td>
<td valign="top" align="center">15%</td>
<td valign="top" align="center">81%</td>
<td valign="top" align="center">19%</td>
<td valign="top" align="center">79%</td>
<td valign="top" align="center">21%</td>
</tr>
<tr>
<td valign="top" align="left">6</td>
<td valign="top" align="center">88%</td>
<td valign="top" align="center">12%</td>
<td valign="top" align="center">84%</td>
<td valign="top" align="center">16%</td>
<td valign="top" align="center">79%</td>
<td valign="top" align="center">21%</td>
</tr>
<tr>
<td valign="top" align="left">7</td>
<td valign="top" align="center">90%</td>
<td valign="top" align="center">10%</td>
<td valign="top" align="center">85%</td>
<td valign="top" align="center">15%</td>
<td valign="top" align="center">81%</td>
<td valign="top" align="center">29%</td>
</tr>
<tr>
<td valign="top" align="left">8</td>
<td valign="top" align="center">91%</td>
<td valign="top" align="center">9%</td>
<td valign="top" align="center">86%</td>
<td valign="top" align="center">14%</td>
<td valign="top" align="center">82%</td>
<td valign="top" align="center">18%</td>
</tr>
<tr>
<td valign="top" align="left">9</td>
<td valign="top" align="center">92%</td>
<td valign="top" align="center">8%</td>
<td valign="top" align="center">87%</td>
<td valign="top" align="center">13%</td>
<td valign="top" align="center">83%</td>
<td valign="top" align="center">17%</td>
</tr>
<tr>
<td valign="top" align="left">10</td>
<td valign="top" align="center">93%</td>
<td valign="top" align="center">7%</td>
<td valign="top" align="center">87%</td>
<td valign="top" align="center">13%</td>
<td valign="top" align="center">84%</td>
<td valign="top" align="center">16%</td>
</tr>
</tbody>
</table>
</table-wrap>
<p><xref ref-type="table" rid="T3">Table 3</xref> illustrates the classification of patients into Normal, Tuberculosis, Bacterial Pneumonia, Viral Pneumonia patients. As illustrated in <xref ref-type="table" rid="T3">Table 3</xref>, we can observe that the misclassifications are slightly larger while misclassifying Viral Pneumonia as Tuberculosis patients.</p>
<table-wrap id="T3">
<label>Table 3</label>
<caption><title>Illustrating the Confusion matrix for classification of TB, BP, VP, and Normal patients</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Actual/predicted</th>
<th valign="top" align="center">Normal</th>
<th valign="top" align="center">VP</th>
<th valign="top" align="center">TB</th>
<th valign="top" align="center">BP</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Normal (250)</td>
<td valign="top" align="center">220</td>
<td valign="top" align="center">15</td>
<td valign="top" align="center">10</td>
<td valign="top" align="center">5</td>
</tr>
<tr>
<td valign="top" align="left">Viral Pneumonia (220)</td>
<td valign="top" align="center">18</td>
<td valign="top" align="center">180</td>
<td valign="top" align="center">15</td>
<td valign="top" align="center">7</td>
</tr>
<tr>
<td valign="top" align="left">Tuberculosis (150)</td>
<td valign="top" align="center">10</td>
<td valign="top" align="center">12</td>
<td valign="top" align="center">120</td>
<td valign="top" align="center">8</td>
</tr>
<tr>
<td valign="top" align="left">Bacterial Pneumonia (45)</td>
<td valign="top" align="center">3</td>
<td valign="top" align="center">5</td>
<td valign="top" align="center">7</td>
<td valign="top" align="center">30</td>
</tr>
</tbody>
</table>
</table-wrap>
<p><xref ref-type="table" rid="T4">Table 4</xref> has the class-wise Sensitivity, Specificity, F1 score, BCA for the developed model. An overall BCA of 84% is reported for the overall classification and the highest misclassification is reported for Bacterial Pneumonia which has to be rectified in the future studies.</p>
<table-wrap id="T4">
<label>Table 4</label>
<caption><title>Class wise Sensitivity, Specificity, F1 Score, BCA</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Class</th>
<th valign="top" align="center">Sensitivity</th>
<th valign="top" align="center">Specificity</th>
<th valign="top" align="center">F1 Score</th>
<th valign="top" align="center">BCA</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Normal</td>
<td valign="top" align="center">88%</td>
<td valign="top" align="center">95%</td>
<td valign="top" align="center">89%</td>
<td valign="top" align="center">92%</td>
</tr>
<tr>
<td valign="top" align="left">Viral Pneumonia</td>
<td valign="top" align="center">81%</td>
<td valign="top" align="center">91%</td>
<td valign="top" align="center">82%</td>
<td valign="top" align="center">86%</td>
</tr>
<tr>
<td valign="top" align="left">Tuberculosis</td>
<td valign="top" align="center">80%</td>
<td valign="top" align="center">91%</td>
<td valign="top" align="center">81%</td>
<td valign="top" align="center">86%</td>
</tr>
<tr>
<td valign="top" align="left">Bacterial Pneumonia</td>
<td valign="top" align="center">67%</td>
<td valign="top" align="center">98%</td>
<td valign="top" align="center">72%</td>
<td valign="top" align="center">83%</td>
</tr>
<tr>
<td valign="top" align="left">Overall</td>
<td valign="top" align="center">79%</td>
<td valign="top" align="center">93%</td>
<td valign="top" align="center">81%</td>
<td valign="top" align="center">84%</td>
</tr>
</tbody>
</table>
</table-wrap>
<p><xref ref-type="table" rid="T5">Tables 5</xref>, <xref ref-type="table" rid="T6">6</xref>, <xref ref-type="table" rid="T7">7</xref> indicates the ablation study results for the proposed model after the removal of attention, class weight, augmentation, data pre-processing layers of the model. <xref ref-type="table" rid="T5">Tables 5</xref>, <xref ref-type="table" rid="T6">6</xref>, <xref ref-type="table" rid="T7">7</xref> has the results of BCA, Sensitivity, Specificity of the proposed architectures.</p>
<table-wrap id="T5">
<label>Table 5</label>
<caption><title>Ablation study results for BCA after the removal of each component in the proposed architecture as mentioned in the table. Second row indicates the removal of Attention mechanism</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Model</th>
<th valign="top" align="center">Balanced Classification Accuracy (BCA) (%)</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">SA-CNN (Full)</td>
<td valign="top" align="center">84 &#x00B1; 0.9</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Attention</td>
<td valign="top" align="center">80 &#x00B1; 1.1</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;ClassWeight</td>
<td valign="top" align="center">79 &#x00B1; 1.5</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Augment</td>
<td valign="top" align="center">81 &#x00B1; 1.3</td>
</tr>
<tr>
<td valign="top" align="left">384-px Input</td>
<td valign="top" align="center">82 &#x00B1; 1.0</td>
</tr>
<tr>
<td valign="top" align="left">Heads-4</td>
<td valign="top" align="center">81 &#x00B1; 1.1</td>
</tr>
</tbody>
</table>
</table-wrap>
<table-wrap id="T6">
<label>Table 6</label>
<caption><title>Ablation study results for Sensitivity after the removal of each component in the proposed architecture as mentioned in the table. Second row indicates the removal of Attention mechanism</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Model</th>
<th valign="top" align="center">Sensitivity (%)</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">SA-CNN (Full)</td>
<td valign="top" align="center">88 &#x00B1; 1.2</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Attention</td>
<td valign="top" align="center">82 &#x00B1; 1.5</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;ClassWeight</td>
<td valign="top" align="center">78 &#x00B1; 2.0</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Augment</td>
<td valign="top" align="center">80 &#x00B1; 1.7</td>
</tr>
<tr>
<td valign="top" align="left">384-px Input</td>
<td valign="top" align="center">85 &#x00B1; 1.3</td>
</tr>
<tr>
<td valign="top" align="left">Heads-4</td>
<td valign="top" align="center">83 &#x00B1; 1.4</td>
</tr>
</tbody>
</table>
</table-wrap>
<table-wrap id="T7">
<label>Table 7</label>
<caption><title>Ablation study results for Specificity after the removal of each component in the proposed architecture as mentioned in the table. Second row indicates the removal of Attention mechanism</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Model</th>
<th valign="top" align="center">Specificity (%)</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">SA-CNN (Full)</td>
<td valign="top" align="center">93 &#x00B1; 0.8</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Attention</td>
<td valign="top" align="center">89 &#x00B1; 1.2</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;ClassWeight</td>
<td valign="top" align="center">91 &#x00B1; 1.4</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Augment</td>
<td valign="top" align="center">90 &#x00B1; 1.1</td>
</tr>
<tr>
<td valign="top" align="left">384-px Input</td>
<td valign="top" align="center">92 &#x00B1; 0.9</td>
</tr>
<tr>
<td valign="top" align="left">Heads-4</td>
<td valign="top" align="center">91 &#x00B1; 1.0</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Ablation studies are critical in this work because they allow us to systematically evaluate the contribution of individual components to overall performance and interpretability, thereby strengthening the scientific rigor of the proposed model. Our experiments showed that removing the self-attention mechanism led to a marked reduction in Balanced Classification Accuracy, sensitivity, and specificity, confirming that the attention layer is not just an architectural enhancement but a vital element in capturing long-range spatial dependencies across chest radiographs. Unlike conventional convolutional filters that primarily focus on local features, the attention block enables the model to selectively emphasize clinically relevant lung regions and suppress irrelevant background patterns, which is particularly important for diseases like pneumonia and tuberculosis that present with subtle or diffuse manifestations. This demonstrates that the self-attention mechanism significantly improves both diagnostic accuracy and the clinical plausibility of the explanations, making it indispensable for robust and trustworthy lung disease classification.</p>
</sec>
<sec id="sec007">
<title>Lime Explainability</title>
<p><xref ref-type="fig" rid="F5">Figures 5</xref> and <xref ref-type="fig" rid="F6">6</xref> presents the LIME interpretation for the lung disease classification after modeling with the SA-CNN. The results demonstrate that the crucial region responsible for the detection of Bacterial Pneumonia lies in the one lobe of the lungs and not with the respect to other. However. the SA-CNN models found both the lobes to be highly useful and found to be a very crucial factor for the detection of Tuberculosis patients. Thus, the proposed LIME framework can provide a detailed model agnostic local explanation with respect to every region of the lungs.</p>
<fig id="F5" position="float">
<object-id pub-id-type="doi">10.70389/journal.PJS.100220.g005</object-id>
<label>Fig 5</label>
<caption><title>LIME interpretability for Bacterial Pneumonia patient</title></caption>
<p><ext-link ext-link-type="uri" xlink:href="https://i0.wp.com/premierscience.com/wp-content/uploads/2025/15/pjs-25-1200-Figure-5.webp?">Figure 5</ext-link></p>
</fig>
<fig id="F6" position="float">
<object-id pub-id-type="doi">10.70389/journal.PJS.100220.g006</object-id>
<label>Fig 6</label>
<caption><title>LIME interpretability for Tuberculosis patient</title></caption>
<p><ext-link ext-link-type="uri" xlink:href="https://i0.wp.com/premierscience.com/wp-content/uploads/2025/15/pjs-25-1200-Figure-6.webp?">Figure 6</ext-link></p>
</fig>
<p><xref ref-type="table" rid="T8">Table 8</xref> has the illustration of results using various explainers. The insertion and deletion AUC results clearly highlight the importance of incorporating LIME-based explainability within the SA-CNN framework. Insertion AUC reflects how quickly classification confidence increases when pixels most emphasized by the explainer are revealed, while Deletion AUC captures how confidence drops when those pixels are removed. Lower Deletion AUC and higher Insertion AUC therefore indicate explanations that better align with the model&#x2019;s true decision logic. The full SA-CNN combined with LIME achieves superior scores compared to its ablated counterparts (&#x2013;Attention, &#x2013;Augment, &#x2013;ClassWeight), demonstrating that both the self-attention mechanism and robust training strategies are essential for producing faithful explanations. Moreover, when compared with alternative explainers such as Grad-CAM and Integrated Gradients, LIME maintains competitive performance, further validating its role as a reliable and interpretable method for understanding lung disease predictions.</p>
<table-wrap id="T8">
<label>Table 8</label>
<caption><title>Illustration of results using various explainers</title></caption>
<table cellspacing="5" cellpadding="5" frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="left">Model / Explainer</th>
<th valign="top" align="center">Deletion AUC (&#x2193;)</th>
<th valign="top" align="center">Insertion AUC (&#x2191;)</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">SA-CNN + LIME (Full)</td>
<td valign="top" align="center">0.34 &#x00B1; 0.02</td>
<td valign="top" align="center">0.61 &#x00B1; 0.03</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Attention + LIME</td>
<td valign="top" align="center">0.41 &#x00B1; 0.03</td>
<td valign="top" align="center">0.55 &#x00B1; 0.03</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;Augment + LIME</td>
<td valign="top" align="center">0.40 &#x00B1; 0.03</td>
<td valign="top" align="center">0.56 &#x00B1; 0.03</td>
</tr>
<tr>
<td valign="top" align="left">&#x2013;ClassWeight + LIME</td>
<td valign="top" align="center">0.39 &#x00B1; 0.03</td>
<td valign="top" align="center">0.57 &#x00B1; 0.03</td>
</tr>
<tr>
<td valign="top" align="left">SA-CNN + Grad-CAM</td>
<td valign="top" align="center">0.36 &#x00B1; 0.02</td>
<td valign="top" align="center">0.64 &#x00B1; 0.02</td>
</tr>
<tr>
<td valign="top" align="left">SA-CNN + Integrated Gradients</td>
<td valign="top" align="center">0.33 &#x00B1; 0.02</td>
<td valign="top" align="center">0.63 &#x00B1; 0.02</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The major limitation of the study lies in the improvement of the accuracy and reduction of misclassifications. Hence, we are planning to implement the model after a modified version of self attention CNN&#x2019;s in the future. It is necessary to improve and self learn the regions of interest in distinguishing these regions of interest with an optimization based self attention mechanism. Moreover, we are also planning to increase the number of data for the study.</p>
</sec>
<sec id="sec008">
<title>Limitations and Future Directions</title>
<p>In future work, ethical considerations, potential biases, and clinical deployment pathways must be carefully addressed. Although this study used a publicly available de-identified dataset where no patient consent was required, any clinical extension of this work will demand strict adherence to data privacy regulations (e.g., HIPAA, GDPR) and prospective data collection under informed consent. Another critical aspect is mitigating potential biases, as models trained on single-source datasets risk inheriting demographic, disease prevalence, or imaging protocol imbalances, which can lead to reduced generalizability and unequal performance across subgroups. Expanding validation to multi-institutional datasets, applying class imbalance handling strategies, and incorporating fairness assessments will help overcome these limitations. For clinical deployment, the proposed self-attention CNN with explainability should be positioned as a decision-support tool to aid radiologists rather than replace them. Its adoption will require prospective validation on real-world cohorts, seamless integration into hospital workflows, compliance with regulatory frameworks such as FDA and CE certification, and continuous post-deployment monitoring to ensure reliability and trust.</p>
</sec>
<sec id="sec009" sec-type="conclusions">
<title>Conclusion</title>
<p>This study developed a SA-CNN architecture for classifiying Tuberculosis, Bacterial Oneumonia, Viral Pneumonia, and Normal Chest patients using Chest X ray data of the individuals. We reported with a Balanced Classification Accuracy of 84% on the testing set. After modeling, we also developed a local agnostic LIME explainable framework for explaining how the SA-CNN architecture developed the model. We are planning to implement more modified versions of SA-CNN&#x2019;s to find out more granular region specific information about the Chest X ray images as a future study.</p>
</sec>
</body>
<back>
<fn-group>
<fn id="n1" fn-type="other">
<p>Additional material is published online only. To view please visit the journal online.</p>
<p><bold>Cite this as:</bold> Sadakathulla PK and Parameswari R. Lungs Disease Classification Using an Self Attention Based Neural Network: A Local Agnostic Explainable Approach. Premier Journal of Science 2025;15:100220</p>
<p><bold>DOI:</bold> <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.70389/PJS.100220">https://doi.org/10.70389/PJS.100220</ext-link></p>
</fn>
<fn id="n2" fn-type="other">
<p><bold>Ethical approval</bold></p>
<p>N/a</p>
</fn>
<fn id="n3" fn-type="other">
<p><bold>Consent</bold></p>
<p>N/a</p>
</fn>
<fn id="n4" fn-type="other">
<p><bold>Funding</bold></p>
<p>No industry funding</p>
</fn>
<fn id="n5" fn-type="conflict">
<p><bold>Conflicts of interest</bold></p>
<p>N/a</p>
</fn>
<fn id="n6" fn-type="other">
<p><bold>Author contribution</bold></p>
<p>Sadakathulla P.K and R. Parameswari &#x2013; Conceptualization, Writing &#x2013;original draf, review and editing</p>
</fn>
<fn id="n7" fn-type="other">
<p><bold>Guarantor</bold></p>
<p>Sadakathulla P.K</p>
</fn>
<fn id="n8" fn-type="other">
<p><bold>Provenance and peer-review</bold></p>
<p>Unsolicited and externally peer-reviewed</p>
</fn>
<fn id="n9" fn-type="other">
<p><bold>Data availability statement</bold></p>
<p>N/a</p>
</fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="ref1"><label>1</label><mixed-citation publication-type="journal"><string-name><surname>Poluju</surname> <given-names>N</given-names></string-name>, <string-name><surname>Rajaram</surname> <given-names>A</given-names></string-name>. <article-title>Hybrid technique for lung disease classification based on machine learning and optimization using X ray images</article-title>. <source>Multimedia Tools Appl</source>. <year>2024</year>. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1007/s11042-024-19959-2">https://doi.org/10.1007/s11042-024-19959-2</ext-link></mixed-citation></ref>
<ref id="ref2"><label>2</label><mixed-citation publication-type="journal"><string-name><surname>Brixey</surname> <given-names>AG</given-names></string-name>, <string-name><surname>MD</surname> <given-names>AS</given-names></string-name>, <string-name><surname>Alsamarrie</surname> <given-names>A</given-names></string-name>, <string-name><surname>Chung</surname> <given-names>JH</given-names></string-name>. <article-title>Pictorial review of interstitial lung disease on high resolution CT-scan and updated classification</article-title>. <source>Chest</source>. <year>2024</year>;<volume>64</volume>(<issue>5</issue>). <ext-link ext-link-type="uri" xlink:href="https://journal.chestnet.org">https://journal.chestnet.org</ext-link></mixed-citation></ref>
<ref id="ref3"><label>3</label><mixed-citation publication-type="journal"><string-name><surname>Akther</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Singh</surname> <given-names>R</given-names></string-name>, <string-name><surname>Vatsa</surname> <given-names>M</given-names></string-name>. <article-title>AI based radio diagnosis using chest X rays</article-title>. <source>Front Big Data</source>. <year>2023</year>;<fpage>6</fpage>. <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/journals/big-data">https://www.frontiersin.org/journals/big-data</ext-link></mixed-citation></ref>
<ref id="ref4"><label>4</label><mixed-citation publication-type="journal"><string-name><surname>Naz</surname> <given-names>S</given-names></string-name>, <string-name><surname>Ghani Khan</surname> <given-names>MU</given-names></string-name>, <string-name><surname>Saba</surname> <given-names>T</given-names></string-name>, <string-name><surname>Rehman</surname> <given-names>A</given-names></string-name>. <article-title>An explainable AI enabled framework for interpreting pulmonary diseases from chest radiographs</article-title>. <source>Cancers (Basel)</source>. <year>2023</year>;<volume>15</volume>(<issue>1</issue>). <ext-link ext-link-type="uri" xlink:href="https://www.mdpi.com/journal/cancers">https://www.mdpi.com/journal/cancers</ext-link></mixed-citation></ref>
<ref id="ref5"><label>5</label><mixed-citation publication-type="journal"><string-name><surname>Adams</surname> <given-names>SJ</given-names></string-name>, <string-name><surname>Hemderson</surname> <given-names>RDE</given-names></string-name>, <string-name><surname>Baubyn</surname> <given-names>P</given-names></string-name>. <article-title>Artificial intelligence solutions for analysis of X-ray images</article-title>. <source>Can Assoc Radiol J</source>. <year>2020</year>. <ext-link ext-link-type="uri" xlink:href="https://journals.sagepub.com/home/car">https://journals.sagepub.com/home/car</ext-link></mixed-citation></ref>
<ref id="ref6"><label>6</label><mixed-citation publication-type="journal"><string-name><surname>Moghaveera</surname> <given-names>R</given-names></string-name>, <string-name><surname>Mour</surname> <given-names>R</given-names></string-name>. <article-title>Multi class chest X ray classification of pneumonia</article-title>. <source>ITM Web Conf</source>. <year>2022</year>. <ext-link ext-link-type="uri" xlink:href="https://www.itm-conferences.org">https://www.itm-conferences.org</ext-link></mixed-citation></ref>
<ref id="ref7"><label>7</label><mixed-citation publication-type="journal"><string-name><surname>Mahboob</surname> <given-names>MK</given-names></string-name>, <string-name><surname>Biswas</surname> <given-names>M</given-names></string-name>, <string-name><surname>Gaur</surname> <given-names>L</given-names></string-name>, <string-name><surname>Alenezi</surname> <given-names>F</given-names></string-name>, <string-name><surname>Santosh</surname> <given-names>KC</given-names></string-name>. <article-title>Deep features to detect pulmonary abnormalities in chest X rays due to infectious diseases</article-title>. <year>2022</year>;<volume>592</volume>:<fpage>389</fpage>&#x2013;<lpage>401</lpage>. <ext-link ext-link-type="uri" xlink:href="https://www.sciencedirect.com">https://www.sciencedirect.com</ext-link></mixed-citation></ref>
<ref id="ref8"><label>8</label><mixed-citation publication-type="journal"><string-name><surname>Abubakar</surname> <given-names>M</given-names></string-name>, <string-name><surname>Shah</surname> <given-names>I</given-names></string-name>, <string-name><surname>Ali</surname> <given-names>W</given-names></string-name>, <string-name><surname>Bashir</surname> <given-names>F</given-names></string-name>. <article-title>Classification of pneumonia and tuberculosis from chest X rays</article-title>. <source>arXiv</source>. <year>2022</year>.</mixed-citation></ref>
<ref id="ref9"><label>9</label><mixed-citation publication-type="journal"><string-name><surname>Irmici</surname> <given-names>G</given-names></string-name>, <string-name><surname>Ze</surname> <given-names>M</given-names></string-name>, <string-name><surname>Calero</surname> <given-names>E</given-names></string-name>. <article-title>Chest X ray in emergency radiology: what artificial intelligence applications are available?</article-title> <source>Diagnostics (Basel)</source>. <year>2016</year>;<volume>13</volume>(<issue>2</issue>). <ext-link ext-link-type="uri" xlink:href="https://www.mdpi.com/journal/diagnostics">https://www.mdpi.com/journal/diagnostics</ext-link></mixed-citation></ref>
<ref id="ref10"><label>10</label><mixed-citation publication-type="journal"><string-name><surname>Ahmed</surname> <given-names>HK</given-names></string-name>, <string-name><surname>Milne</surname> <given-names>MR</given-names></string-name>, <string-name><surname>Buchlak</surname> <given-names>QD</given-names></string-name>, <string-name><surname>Ektas</surname> <given-names>N</given-names></string-name>. <article-title>Machine learning augmented interpretation of chest X-ray images</article-title>. <source>Diagnostics (Basel)</source>. <year>2023</year>;<volume>13</volume>(<issue>4</issue>). <ext-link ext-link-type="uri" xlink:href="https://www.mdpi.com/journal/diagnostics">https://www.mdpi.com/journal/diagnostics</ext-link></mixed-citation></ref>
<ref id="ref11"><label>11</label><mixed-citation publication-type="journal"><string-name><surname>Mustafa</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Nsour</surname> <given-names>H</given-names></string-name>. <article-title>Using computer vision techniques to detect abnormalities in chest X ray images</article-title>. <source>Diagnostics (Basel)</source>. <year>2023</year>;<volume>13</volume>(<issue>18</issue>). <ext-link ext-link-type="uri" xlink:href="https://www.mdpi.com/journal/diagnostics">https://www.mdpi.com/journal/diagnostics</ext-link></mixed-citation></ref>
<ref id="ref12"><label>12</label><mixed-citation publication-type="journal"><string-name><surname>Moses</surname> <given-names>DA</given-names></string-name>. <article-title>Deep learning applied to automatic disease detection using chest X ray images</article-title>. <source>J Med Imaging Radiat Oncol</source>. <year>2021</year>. <ext-link ext-link-type="uri" xlink:href="https://onlinelibrary.wiley.com/journal/17549485">https://onlinelibrary.wiley.com/journal/17549485</ext-link></mixed-citation></ref>
<ref id="ref13"><label>13</label><mixed-citation publication-type="journal"><string-name><surname>Hong</surname> <given-names>M</given-names></string-name>, <string-name><surname>Rim</surname> <given-names>B</given-names></string-name>, <string-name><surname>Lee</surname> <given-names>H</given-names></string-name>. <article-title>Multi class classification of lung disease classification</article-title>. <source>Appl Sci (Basel)</source>. <year>2021</year>;<volume>19</volume>(<issue>25</issue>):<fpage>529</fpage>&#x2013;<lpage>551</lpage>. <ext-link ext-link-type="uri" xlink:href="https://www.mdpi.com/journal/applsci">https://www.mdpi.com/journal/applsci</ext-link></mixed-citation></ref>
<ref id="ref14"><label>14</label><mixed-citation publication-type="journal"><string-name><surname>Ashwini</surname> <given-names>S</given-names></string-name>, <string-name><surname>Arunkumar</surname> <given-names>JR</given-names></string-name>, <string-name><surname>Prabhu</surname> <given-names>RT</given-names></string-name>, <string-name><surname>Singh</surname> <given-names>NH</given-names></string-name>, <string-name><surname>Singh</surname> <given-names>NP</given-names></string-name>. <article-title>Diagnosis and multiclassification of lung diseases in CXR images using optimized deep convolutional neural networks</article-title>. <source>Soft Comput</source>. <year>2023</year>;<volume>28</volume>:<fpage>6219</fpage>&#x2013;<lpage>33</lpage>. <ext-link ext-link-type="uri" xlink:href="https://link.springer.com/journal/500">https://link.springer.com/journal/500</ext-link></mixed-citation></ref>
<ref id="ref15"><label>15</label><mixed-citation publication-type="journal"><string-name><surname>Agarwal</surname> <given-names>S</given-names></string-name>, <string-name><surname>Arya</surname> <given-names>KV</given-names></string-name>, <string-name><surname>Meena</surname> <given-names>YK</given-names></string-name>. <article-title>CNN-0-ELMNET: optimized lightweight and generalized model for lung disease classification and severity assessment</article-title>. <source>IEEE Trans Med Imaging</source>. <year>2024</year>;<volume>43</volume>(<issue>12</issue>). <ext-link ext-link-type="uri" xlink:href="https://ieeexplore.ieee.org/xpl/RecentIssue.jsp?punumber=42">https://ieeexplore.ieee.org/xpl/RecentIssue.jsp?punumber=42</ext-link></mixed-citation></ref>
<ref id="ref16"><label>16</label><mixed-citation publication-type="journal"><string-name><surname>Humayun</surname> <given-names>M</given-names></string-name>, <string-name><surname>Sujatha</surname> <given-names>R</given-names></string-name>, <string-name><surname>Almauayqil</surname> <given-names>SN</given-names></string-name>, <string-name><surname>Jhanji</surname> <given-names>NZ</given-names></string-name>. <article-title>A transfer learning approach with convolutional neural network for the classification of lung carcinoma</article-title>. <source>Healthcare (Basel)</source>. <year>2022</year>;<volume>10</volume>(<issue>6</issue>):<fpage>1058</fpage>. <ext-link ext-link-type="uri" xlink:href="https://www.mdpi.com/journal/healthcare">https://www.mdpi.com/journal/healthcare</ext-link></mixed-citation></ref>
<ref id="ref17"><label>17</label><mixed-citation publication-type="journal"><string-name><surname>Mamalakis</surname> <given-names>M</given-names></string-name>, <string-name><surname>Swift</surname> <given-names>AJ</given-names></string-name>, <string-name><surname>Vorselaars</surname> <given-names>B</given-names></string-name>, <string-name><surname>Ray</surname> <given-names>S</given-names></string-name>, <string-name><surname>Weeks</surname> <given-names>S</given-names></string-name>, <string-name><surname>Ding</surname> <given-names>W</given-names></string-name>, <etal>et al.</etal> <article-title>DensResCov19: a deep transfer learning approach for robust automatic classification of COVID-19, pneumonia, and tuberculosis from X-rays</article-title>. <source>Comput Med Imaging Graph</source>. <year>2021</year>;<volume>94</volume>:<fpage>102008</fpage>. <ext-link ext-link-type="uri" xlink:href="https://www.sciencedirect.com/journal/computerized-medical-imaging-and-graphics">https://www.sciencedirect.com/journal/computerized-medical-imaging-and-graphics</ext-link></mixed-citation></ref>
<ref id="ref18"><label>18</label><mixed-citation publication-type="journal"><string-name><surname>Mahmud</surname> <given-names>E</given-names></string-name>, <string-name><surname>Fahad</surname> <given-names>N</given-names></string-name>, <string-name><surname>Assadussaman</surname> <given-names>M</given-names></string-name>, <string-name><surname>Zain</surname> <given-names>SM</given-names></string-name>, <string-name><surname>Ghoh</surname> <given-names>KOM</given-names></string-name>, <string-name><surname>Korol</surname> <given-names>MK</given-names></string-name>. <article-title>An explainable artificial intelligence for multiple lung diseases classification from chest X ray images using fine tuned transfer learning</article-title>. <source>Decis Anal J</source>. <year>2024</year>;<fpage>12</fpage>. <ext-link ext-link-type="uri" xlink:href="https://www.sciencedirect.com/journal/decision-analytics-journal">https://www.sciencedirect.com/journal/decision-analytics-journal</ext-link></mixed-citation></ref>
<ref id="ref19"><label>19</label><mixed-citation publication-type="journal"><string-name><surname>Tenguio</surname> <given-names>B</given-names></string-name>, <string-name><surname>Fangzhou</surname> <given-names>C</given-names></string-name>, <string-name><surname>Li</surname> <given-names>X</given-names></string-name>. <article-title>Self attention based speaker recognition using cluster range loss</article-title>. <source>Neurocomputing</source>. <year>2019</year>;<volume>368</volume>:<fpage>59</fpage>&#x2013;<lpage>68</lpage>. <ext-link ext-link-type="uri" xlink:href="https://www.sciencedirect.com/journal/neurocomputing">https://www.sciencedirect.com/journal/neurocomputing</ext-link></mixed-citation></ref>
<ref id="ref20"><label>20</label><mixed-citation publication-type="journal"><string-name><surname>Vuckovic</surname> <given-names>J</given-names></string-name>, <string-name><surname>Baratin</surname> <given-names>A</given-names></string-name>, <string-name><surname>Combes</surname> <given-names>RTD</given-names></string-name>. <article-title>A mathematical theory of attention</article-title>. <source>arXiv</source>. <year>2019</year>.</mixed-citation></ref>
<ref id="ref21"><label>21</label><mixed-citation publication-type="journal"><string-name><surname>Damien</surname> <given-names>G</given-names></string-name>, <string-name><surname>Luxburg</surname> <given-names>U</given-names></string-name>. <article-title>Explaining the explainer: a first theoretical analysis of LIME</article-title>. <source>Proc Mach Learn Res</source>. <year>2020</year>. <ext-link ext-link-type="uri" xlink:href="https://proceedings.mlr.press">https://proceedings.mlr.press</ext-link></mixed-citation></ref>
</ref-list>
</back>
</article>
