<?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 Shreyas Srivastava on Medium]]></title>
        <description><![CDATA[Stories by Shreyas Srivastava on Medium]]></description>
        <link>https://medium.com/@shreyas-srivastava?source=rss-7a210841bfaa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*j5-_m7ZjnNZBA4Uy.</url>
            <title>Stories by Shreyas Srivastava on Medium</title>
            <link>https://medium.com/@shreyas-srivastava?source=rss-7a210841bfaa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 19:32:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shreyas-srivastava/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[Guitar classifier using fast.ai library]]></title>
            <link>https://medium.com/analytics-vidhya/guitar-classifier-using-fast-ai-library-778e985123d9?source=rss-7a210841bfaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/778e985123d9</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[fastai]]></category>
            <dc:creator><![CDATA[Shreyas Srivastava]]></dc:creator>
            <pubDate>Sun, 04 Jul 2021 17:31:59 GMT</pubDate>
            <atom:updated>2021-07-20T05:49:00.816Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a starter project I created for fast-ai part 1 course. The classifier is able to learn to distinguish fender and gibson guitars with ~90% accuracy using only 200 example images. This project illustrates the power of out of box tools available in fast-ai library, and is a great way to get started with deep learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KE0EmVPEcEPZ5SNg" /><figcaption>Photo by <a href="https://unsplash.com/@toyamakanna?utm_source=medium&amp;utm_medium=referral">戸山 神奈</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Extract Guitar images</strong></p><p>Fast ai library makes this step incredibly easy. Open a google images tab, and search for the keyword of interest, for our case we can simply search for “fender guitar” and “gibson guitar”.</p><p>Run this javascript code provided by the fast-ai team to save the URL’s for all the images in google images tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MG9h1BsW4Uh5ZswQid59ig.png" /></figure><p>Once we get all the image URL’s, fast-ai library makes it straightforward to download images using the api <a href="https://docs.fast.ai/vision.utils.html#download_images">call</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*il5o5yp5FZvTUFO8J28ljQ.png" /></figure><p><strong>Load and preprocess the data</strong></p><p>In this step we use fast-ai vision library function <a href="https://docs.fast.ai/vision.data.html#ImageDataLoaders.from_folder"><em>ImageDataLoaders::from_folder </em></a>which loads the images and splits them into the train/test/validation set and batches the data. It also provides the option of doing transformations on the image data before loading the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*onR8rJpn-bwamjGCSVNgLA.png" /></figure><p>Verify that the data looks reasonable by previewing a batch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0rR9Dr9B8kb-dBeASTDXWA.png" /></figure><p>Check the training and test data — in our case we have 216 training examples and 53 validation set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOUtnKyl3zVpfjQTLq4MRQ.png" /></figure><p><strong>Train model</strong></p><p>Train the model using cnn-style resnet architecture. Use <a href="https://fastai1.fast.ai/vision.learner.html#cnn_learner">cnn_learner</a> fast-ai function for instantiating the learner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tTQXBfNYQGdmQfw59KP3LA.png" /></figure><p>Start training the model by using one cycle <a href="https://sgugger.github.io/the-1cycle-policy.html">scheduler</a>. Note the reduction in error rate through subsequent epochs, the model converges to 11% error rate after 7 epochs(1 epoch = one sweep through the training data).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYSMTev3867RkX1hb0rFog.png" /></figure><p>Check the result by plotting the confusion matrix. As can be seen from the matrix, model error rate = (5+1)/(5+1+18+29) = 11.3%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJUMFm_5-OTyQc4rtfvlmA.png" /></figure><p>Github repo code/data available at:</p><p><a href="https://github.com/shreyas88/gibson-or-fender">https://github.com/shreyas88/gibson-or-fender</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=778e985123d9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/guitar-classifier-using-fast-ai-library-778e985123d9">Guitar classifier using fast.ai library</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>