<?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 Ahmet Toptas on Medium]]></title>
        <description><![CDATA[Stories by Ahmet Toptas on Medium]]></description>
        <link>https://medium.com/@ahmetktoptas97?source=rss-2e8190784b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xOcnH29gFK3rMKIUMbceWA.jpeg</url>
            <title>Stories by Ahmet Toptas on Medium</title>
            <link>https://medium.com/@ahmetktoptas97?source=rss-2e8190784b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:42:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahmetktoptas97/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[Music Genre Classification With Machine Learning — Week 6]]></title>
            <link>https://ahmetktoptas97.medium.com/music-genre-classification-with-machine-learning-week-6-264d350f5f10?source=rss-2e8190784b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/264d350f5f10</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[music-classification]]></category>
            <dc:creator><![CDATA[Ahmet Toptas]]></dc:creator>
            <pubDate>Sun, 23 May 2021 20:08:16 GMT</pubDate>
            <atom:updated>2021-05-23T20:08:16.317Z</atom:updated>
            <content:encoded><![CDATA[<h3>Music Genre Classification With Machine Learning — Week 6</h3><p>Hello friends. Today we are going to write the last blog of our project. I hope you enjoyed and learned while reading us.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FcE02lboc8JPO%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Ffallontonight-relatable-reaction-gif-cE02lboc8JPO&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2FcE02lboc8JPO%2Fgiphy.gif%3Fcid%3D790b7611fccef5c15421f3d7800acad4b0fd2817f0a376f0%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="290" frameborder="0" scrolling="no"><a href="https://medium.com/media/61fea4e3739d426fb1c24e77b47a250d/href">https://medium.com/media/61fea4e3739d426fb1c24e77b47a250d/href</a></iframe><p>This week, as we mentioned that last week’s blog, we divided the music into 3-second parts and extract 10 tracks from each music. We did this process this week and we came up with the spectrograms for every 3-second track. This is a bit of a long process and requires patience. At the end of this process, since we have 1000 tracks for each class and 10 classes in total, we have a dataset consisting of 10,000 tracks.</p><p>When we look at the pictures that come out as a result of the spectrogram extraction process, it is seen that there are white paddings on the outside of all pictures. Since these white spaces are common in all these pictures, we cropped the picture to make it easier to distinguish and clear the picture from the white paddings. As an example, the process is seen in the pictures below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/0*CyxEw5bdTFM9CEQw.png" /><figcaption>Cropped image of the first blues song’s first 3 second spectrogram</figcaption></figure><p>We have previously obtained accuracy values using traditional machine learning algorithms and the features we have. We had argued that we could increase these values even higher if we did feature extraction ourselves. Also we want to use our 3 second spectrograms in CNN with dense layer. So we want to get accuracy results from our CNN with dense layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*7Ag7K6KOWCr7BzE4KdHr1g.png" /><figcaption>CNN model with dense layers</figcaption></figure><p>It is our CNN model with dense layers. We use that model for feature extraction and classifying 3 second spectrograms. We got around 71% validation accuracy and test accuracy for that model.</p><p>But we have some problems with our 3 second spectrograms. If we put input as 3 second spectrograms, we would get prediction for 3 second spectrograms. So we got our accuracies for all of 3 second spectrograms. We thought if we merge features of 3 second spectrograms with ordered, we would get higher accuracy for 30 second song in feature extraction and CNN classification with dense layers.</p><p>In feature extraction we have to merge our features from 3 second spectrograms. Hence, we get 3 second spectrograms features with order(each song has ordered 3 second spectrograms total of 10 piece) for our train,validation,test sets. We added global average layer after our last MaxPooling layer so, we got 128 dimension feature for each 3 second spectrograms. We did it because of we want to get less features for each song. Thus, we have 128*10=1280 features for each song. In this way, we extracted features using the CNN model from the spectrograms, and we retrained the models using these new features. We got relatively better results than the old results except for KNN. The new accuracy value we have obtained with machine learning algorithms is in the below picture. But we have to tell that we used our training set as 800 songs and test set as 200 songs in our firstly basic machine learning models. On the other hand, we used 600 songs for training set and 200 song for test set. Because we dropped 200 songs for validation set in our CNN classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*u1ZKMihq462aHE12.png" /><figcaption>old vs new featured test data accuracies for our ML models</figcaption></figure><p>When making predictions in our CNN model, each music consists of 30 seconds, that is,3-second spectrograms of 10 piece. Therefore, we collected the probability values of every 10 spectrograms from the result of CNN with Dense Layers which use output activation function as Softmax activation function when predicting. Then we take the maximum of these total probability values and make a prediction out of every 10 spectrograms. Because each song has 10 spectrograms.</p><p>We obtained 100% accuracy for our training set, 96.5% accuracy for validation set and 96% accuracy for test set. Those accuracy values are higher than other works which we look.</p><p>That was our final work. Thank you for follow and read us. Stay healthy!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F8TIbelFjFXjIJ0Zg1l%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fcold-polar-vortex-8TIbelFjFXjIJ0Zg1l&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2F8TIbelFjFXjIJ0Zg1l%2Fgiphy.gif%3Fcid%3D790b7611b12afc01497aec5daa4ecbb4feef58cb1ec66c53%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="370" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbd81ff1ae1e0a4736ef2eaf59cc19a6/href">https://medium.com/media/cbd81ff1ae1e0a4736ef2eaf59cc19a6/href</a></iframe><p><strong>Related Blog:</strong></p><p><a href="https://atakanayyildiz28.medium.com/music-genre-classification-with-machine-learning-week-5-ae3ede2a3a8e">Music Genre Classification With Machine Learning — Week 5</a></p><p><strong>Writers</strong>:</p><ul><li><a href="https://ahmetktoptas97.medium.com/">Ahmet Toptas - Medium</a></li><li><a href="https://atakanayyildiz28.medium.com/">Atakanayyildiz - Medium</a></li><li><a href="https://g-candemir60.medium.com/">Göktuğ Candemir - Medium</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=264d350f5f10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Music Genre Classification With Machine Learning - Week 3]]></title>
            <link>https://medium.com/bbm406-spring-2021-projects/music-genre-classification-with-machine-learning-week-3-41a603b3434d?source=rss-2e8190784b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/41a603b3434d</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ahmet Toptas]]></dc:creator>
            <pubDate>Sun, 02 May 2021 23:57:45 GMT</pubDate>
            <atom:updated>2021-05-03T05:18:54.543Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone. This week, we did some features extraction on our dataset and performed some machine learning classifications.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FwD7BsjK5zqLew%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fchristmas-so-it-begins-seriously-were-only-just-in-november-wD7BsjK5zqLew&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2FwD7BsjK5zqLew%2F200.gif%3Fcid%3D790b761104210b1a4a88d77f521fd57191e138cf81292676%26rid%3D200.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="177" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd860ee481c803f8c4e26e0ad6e8da8d/href">https://medium.com/media/fd860ee481c803f8c4e26e0ad6e8da8d/href</a></iframe><p>This week, we performed the feature extraction process, which we mentioned in our previous blog. We made the classification process by putting the features that we think are distinctive and important for music into machine learning algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*00zpHDhLgX5xIoZZXQhbdw.png" /><figcaption>Some examples of features</figcaption></figure><p>We split our dataset into train and test sets. Test set’s ratio is 0,2. We used machine learning algorithms as SVM , Linear SVC, KNN (k-nearest neighbor), Random Forest and Logistic Regression, we trained the models and got the accuracy results. We applied standard scaling operation to our models except the Random Forest Classifier. Our accuracy results are shown in the below.</p><pre>KNN : 0.65<br>Random Forest : 0.685<br>SVC : 0.7<br>LinearSVC : 0.675<br>Logistic Regression : 0.695</pre><p>We will try to choose better features to increase these accuracy values. The features we use are largely similar to the features used in previous studies. We will also determine the optimum hyper parameters for the machine learning algorithms that we used.</p><p>Next week, we will perform the classification process using deep learning and test that we cannot get a better score than machine learning algorithms. Stay excited and follow us.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl1J3CbFgn5o7DGRuE%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fgoodbye-see-ya-you-l1J3CbFgn5o7DGRuE&amp;image=https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2Fl1J3CbFgn5o7DGRuE%2Fgiphy.gif%3Fcid%3D790b76112b09f726eacc48d041ccb00d1afe82125f0006bd%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="280" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c2ca37f8995e1483ed8d9ea782d33f9/href">https://medium.com/media/1c2ca37f8995e1483ed8d9ea782d33f9/href</a></iframe><h3>Related Blogs:</h3><p><a href="https://atakanayyildiz28.medium.com/music-genre-classification-with-machine-learning-week-2-e0d76f5aad1d">Music Genre Classification With Machine Learning- Week 2</a></p><h3>Writers:</h3><ul><li><a href="https://medium.com/@ahmetktoptas97">Ahmet Toptas - Medium</a></li><li><a href="https://g-candemir60.medium.com/">Göktuğ Candemir - Medium</a></li><li><a href="https://medium.com/@atakanayyildiz28">Atakanayyildiz - Medium</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41a603b3434d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bbm406-spring-2021-projects/music-genre-classification-with-machine-learning-week-3-41a603b3434d">Music Genre Classification With Machine Learning - Week 3</a> was originally published in <a href="https://medium.com/bbm406-spring-2021-projects">BBM406 Spring 2021 Projects</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>