<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajat Naik on Medium]]></title>
        <description><![CDATA[Stories by Rajat Naik on Medium]]></description>
        <link>https://medium.com/@rajatnaik93?source=rss-3abbf5ddac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*T5KuUSZGRDjGnKEu-di49g.jpeg</url>
            <title>Stories by Rajat Naik on Medium</title>
            <link>https://medium.com/@rajatnaik93?source=rss-3abbf5ddac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 17:13:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajatnaik93/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Abnormality Detection in Chest X-Rays]]></title>
            <link>https://medium.com/@rajatnaik93/abnormality-detection-in-chest-x-rays-2aa5fa53fe1?source=rss-3abbf5ddac------2</link>
            <guid isPermaLink="false">https://medium.com/p/2aa5fa53fe1</guid>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[inside-ai]]></category>
            <dc:creator><![CDATA[Rajat Naik]]></dc:creator>
            <pubDate>Sun, 11 Aug 2019 15:00:47 GMT</pubDate>
            <atom:updated>2019-08-11T15:00:47.341Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Deep Learning to identify presence of certain diseases…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqSNuo4FZVXHiwn7" /><figcaption>Photo by <a href="https://unsplash.com/@owenbeard?utm_source=medium&amp;utm_medium=referral">Owen Beard</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Automated Abnormality Detection utilizes the power of deep learning to help doctor’s in identifying disease using chest X-Ray. Motivation behind this kind of application is that radiologist expertise is scarce and equally expensive, which means that not all patients receive an accurate, timely diagnosis. This application uses deep learning to identify diseases using chest x-rays of the patients.</p><h3>Data…</h3><p>The data was obtained from <a href="https://nihcc.app.box.com/v/ChestXray-NIHCC">National Institute of Health</a>. The data-set contains approx. one lakh images of chest x-ray scans. Below is the distribution of labels for our data-set -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IYdLDjjhukCZAYbiIH-6kw.png" /></figure><h3>Data preparation…</h3><p>We first removed samples with labels as Consolidation, Edema, Emphysema, Fibrosis, Hernia, Pleural_Thickening as they had very less number of samples compared to the other labels..<br><br>Data augmentation was performed in order to help model generalize on unseen data.<br>In data augmentation, below are the steps which were performed-<br>o Resizing images to 224 x 224.<br>o Normalizing RGB images.<br>o Horizontally flipping the images.<br>o Rotating images by some degrees.<br>o Shifting the images in different direction.</p><h3>Handling imbalanced class…</h3><p>The following are some of the common ways of handling class imbalance-</p><p><strong>Random Under Sampling</strong><br>Random Under sampling aims to balance class distribution by randomly eliminating majority class examples. This is done until the majority and minority class instances are almost balanced.</p><p><strong>Under sampling with Over sampling</strong><br>Under sampling the majority class and over sampling the minority class so that both are almost balanced.</p><p><strong>Cost sensitive learning</strong><br>Applying different weights for all classes while calculating the loss by giving higher weightage to the minority class and lower weightage to the majority class. This technique helps the model focus more on the minority class.</p><p>The best and the most preferred approach used by us was using cost sensitive learning.</p><h3>Model building…</h3><p><strong>Chosen architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fl5p1Hh-ahxeaFL11YTzaw.png" /></figure><p>We have chosen DenseNet121 as our model architecture for training on our data. DenseNet offers a moderate complexity and its skip architecture provides a good gradient flow.</p><p>The last layer of the architecture was replaced by our Dense layer with 9 output nodes along<br>with Softmax non-linearity.</p><p>The first two blocks of the architecture were initialized with the ‘ImageNet’ weights as the first few layers of the architecture only learn the general features of the images like horizontal and vertical edges which are relevant for all kinds of images.</p><p><strong>Model training<br></strong>We have used two phase learning approach to train our model.</p><p><em>First Phase:</em> In the first phase, we took a small sample of the dataset with N=1000 and trained the network for few epochs.</p><p><em>Second Phase:</em> In the second phase, we took the first phase model and used as it as a pre-trained model and fine-tuned it using the entire dataset</p><p>The two phase learning approach has shown to give better results compared to simple under-sampling and oversampling techniques. It helps improve the performance of the minority classes without affecting the majority classes.</p><p>The entire model was trained using a custom weighted cross entropy loss function. Model checkpoint was used to save the model weights after each epoch when the validation metric had the highest value.</p><p>In the First phase of learning, the optimizer used was ‘Adam’ which is a momentum based variant of gradient descent and is comparatively faster than other optimization algorithms. However, momentum based optimizers can disrupt the previously learned weights when training on a new set of data. Hence, in Second phase of the training process, the ‘RMSprop’ optimizer is used which is suitable for fine-tuning the network when training with the entire dataset.</p><h3>Model Evaluation…</h3><p><strong>Dice Coefficient<br></strong>Dice coefficient or the F1-score was used as the evaluation metric during the training process for comparing the training and validation scores. The f1-score is the harmonic average of precision and recall and is the preferred metric to judge the performance of the model when you have imbalanced class problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*dC56SS2cGhrQruN1OSb2Nw.png" /></figure><p><strong>ROC Curve<br></strong>Receiver Operating Characteristic (ROC) summarizes the model’s performance by evaluating the trade-off between true positive rate (sensitivity) and false positive rate (1- specificity). The area under curve (AUC), referred to as index of accuracy (A) or concordance index, is a perfect<br>performance metric for ROC curve. Higher the area under curve, better the prediction power of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*151SSBRhBTMwbwcSbxkzIw.png" /><figcaption>Performance of our model on validation set.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*JIb1CnXXbr_kg__lVl1zwA.png" /><figcaption>Performance of our model on test set.</figcaption></figure><p>The ROC curves for all classes give an average AUC of 80.22% on validation set and 79.6% on the test set.</p><h3>Localization…</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qll3hYFn2BchoTil2drvmQ.png" /><figcaption>Grad-CAM</figcaption></figure><p>The available data only has image level labels but lacks pixel level annotations required for localization task. Bounding box ground truths have been provided only for a sample of images which is not good enough to perform localization. Hence, a technique called ‘Grad-CAM’ is used for performing the localization task. Grad-CAM (Gradient based Class Activation Maps) is a technique used to visualize the attention mechanism of a neural network (i.e. it helps to identify where our neural network is looking when classifying an image). This technique can also be utilized for performing localization when pixel level annotation ground truths are not available.<br>The class activation maps are generated by taking a sum of product of all the feature maps retrieved from the last convolution layer of the network and the respective class weights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*SJyPD8Pl0xPDdywIUyLl1A.png" /><figcaption>Localization results</figcaption></figure><h3>References…</h3><ol><li><a href="https://arxiv.org/abs/1711.05225">CheXNet: Radiologist-Level Pneumonia Detection on Chest X-Rays with Deep Learning</a></li><li><a href="https://arxiv.org/abs/1705.02315">ChestX-ray8: Hospital-scale Chest X-ray Database and Benchmarks on<br>Weakly-Supervised Classification and Localization of Common Thorax Diseases</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2aa5fa53fe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>