Git Product home page Git Product logo

clustering-mnist's Introduction

Clusterin MNIST digits

In this repository, we will be clustering MNIST digits dataset using KMeans algorithm. I did not take trouble to cluster using DBScan or Agglomerative algorithms, as it would require lot of analysis in setting parameters( epsilon and min_samples in DBScan and height in agglomerative) but i do have a place holder for anyone to try it out.

I am able to achieve ~98.5% clustering accuracy with KMeans from the features extracted from CNN model. Following are the steps followed

  1. Trained CNN model(8 layers) using model mentioned in Keras page with 99.2% accuracy
  2. Extracted features(neuron values for each image) from 7th layer which best desribe digit images.
  3. Clustered using KMeans algorithm from 128 dimension feature vector extracted from CNN model

For step 1 & 2, execute

python Clustering/MNIST/SimpleNet/feature_extraction.py

and For step 3, execute

python Clustering/MNIST/SimpleNet/MNISTClustering.py

Feature vector representing each image is of 128 dimension, and in order to visualize the image cluster i used PCA(Principal component analysis) to reduce the dimentionality to 2 for plotting purpose

MNIST digit clusters:

Evaluated clustering results by comparing original label of digit images and clustered image label and calculated accuracy which turns out to be ~98.5%.

Considered label of cluster by finding the highest occuring digit image and rest other images to be miss clustered.

Following are the representation of 2 clusters by taking random 100 images from each of those clusters.

Cluster havingg images of dgit 7:

Cluster having images of digit 7

Cluster having images of digit 6:

Cluster having images of digit 6

You can also check all 10 cluster dumps @ Clustering-MNIST/Clustering/MNIST/SimpleNet/output/kmeans/

clustering-mnist's People

Contributors

mahanteshambi avatar

Stargazers

羲和 avatar  avatar  avatar  avatar Jack avatar  avatar  avatar

Watchers

 avatar Joshua Chism avatar

Forkers

niransx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.