<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: outOfBounds</title>
    <description>The latest articles on DEV Community by outOfBounds (@shanecandoit).</description>
    <link>https://dev.to/shanecandoit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F290562%2F76bd552e-dae7-449f-9c66-c9e3334869cc.png</url>
      <title>DEV Community: outOfBounds</title>
      <link>https://dev.to/shanecandoit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shanecandoit"/>
    <language>en</language>
    <item>
      <title>Let's fight Pneumonia with free compute from Kaggle</title>
      <dc:creator>outOfBounds</dc:creator>
      <pubDate>Fri, 17 Jan 2020 03:44:04 +0000</pubDate>
      <link>https://dev.to/shanecandoit/let-s-fight-pneumonia-with-free-compute-from-kaggle-3ebk</link>
      <guid>https://dev.to/shanecandoit/let-s-fight-pneumonia-with-free-compute-from-kaggle-3ebk</guid>
      <description>&lt;h1&gt;
  
  
  Pneumonia xray detector
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0xcu7fxz2i5djx9l2q3z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0xcu7fxz2i5djx9l2q3z.png" alt="xray"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's use the power of machine learning to fight back against pneumonia.&lt;/p&gt;

&lt;p&gt;We will fight pneumonia using 2 resources&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kaggle.com&lt;/li&gt;
&lt;li&gt;"Deep Learning with Python" by Cholet&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Kaggle
&lt;/h3&gt;

&lt;p&gt;Let's use the awesome resources that Kaggle.com can provide us. We can use their GPU power, data sets, and awesome community support.&lt;/p&gt;

&lt;p&gt;Check the code out &lt;a href="https://www.kaggle.com/shanecandoit/pneumonia-chest-xray" rel="noopener noreferrer"&gt;here&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Deep Learning with Python
&lt;/h3&gt;

&lt;p&gt;I was able to do all this with just the examples from "Deep Learning with Python" by Francois Cholet,(the author of the Keras framework).&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 Find a dataset to use
&lt;/h2&gt;

&lt;p&gt;I went to kaggle and then to &lt;a href="https://www.kaggle.com/datasets" rel="noopener noreferrer"&gt;datasets&lt;/a&gt; and searched for &lt;a href="https://www.kaggle.com/search?q=pneumonia" rel="noopener noreferrer"&gt;pneumonia&lt;/a&gt; and picked &lt;a href="https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia" rel="noopener noreferrer"&gt;this dataset&lt;/a&gt;. There are other better ones, but that's the one I started with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 Write a classifier
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5oaw3gpcp3b8czwaj0yj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5oaw3gpcp3b8czwaj0yj.png" alt="accuracy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I went to page 132 in the book which has a cats-vs-dogs classifier. I basically the same code. (I actually moved some training images into the validation set because there were so few validation images).&lt;/p&gt;

&lt;p&gt;I had this working and labelling healthy lungs as 0 and xrays with pneumonia with a 1. These are both classification problems (not "which of 10 categories is this" like MNIST).&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 A score helps, a heat map helps more
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdgze1vk6rfknz35hwkv9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdgze1vk6rfknz35hwkv9.png" alt="heatmap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A score is not good enough, we can do better. Let's have the model make a heatmap so a human can see which part of the xray is more likely to be diseased. That is a much better diagnostic tool, I think.&lt;/p&gt;

&lt;p&gt;I used the code on pages 174 and 175 to create a heatmap. This could tell a physician were to look in the xray for problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now what?
&lt;/h2&gt;

&lt;p&gt;Try to learn machine learning too! Use the high quality &lt;a href="//kaggle.com"&gt;Kaggle&lt;/a&gt; datasets and their competitions to make it fun. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Doing this pneumonia classifier felt way more meaningful than another lame MNIST or dog-vs-cat classifier.&lt;/li&gt;
&lt;li&gt;Creating more people with skills like this may lead to better medical outcomes and cheaper healthcare.&lt;/li&gt;
&lt;li&gt;Show me what you got ML leaners!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
    </item>
  </channel>
</rss>
