Giter Site home page Giter Site logo

vermavinay982 / autoencoder-mnist-clustering Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 783 KB

Applied KMeans to Cluster MNIST features generated via Autoencoders. Unsupervised Learning.

Jupyter Notebook 100.00%
autoencoder python deep-learning machine-learning unsupervised unsupervised-learning supervised-learning artificial-intelligence encoder decoder mnist keras tensorflow

autoencoder-mnist-clustering's Introduction

Autoencoders on CIFAR and MNIST

Yes, N. Nets are used for Supervised Learning - we give them data and labels - they adjust weights to predict - But using autoencoders generate data and apply unsupervised learning to it - KMeans Clustering as applied here to make clusters of MNIST digits

Motivation

Using the Autoencoders and their power to generalize the images, convert the image into compressed form is very exciting. It enables numerous possibilites of saving the data and processing the data at very low cost.

Code style

js-standard-style

Screenshots

Sample 1 Sample 2
drawing drawing

Build status

The model architecture is ready to be used for development and deployment weights are released.

MNIST and CIFAR10 dataset was used to reduce the computation time and check the results.

http://www.cs.toronto.edu/~kriz/cifar.html

http://yann.lecun.com/exdb/mnist/

Trained for 3 epoch


Tech/framework used

Built with

  • Tensorflow 2.3.1
  • Keras
  • Numpy

Features

The visualization of the layers allow us to find what is present in compressed version and what is the difference in original and reconstructed version of the image

Code Example

This is done faster using Numpy.

# Creating the AutoEncoder Model - input and output same
# for MNIST
# 784 for 1 channel MNIST dataset of digits
model = Sequential()
model.add(Dense(128, activation='relu', input_shape=(784,)))
model.add(Dense( 32, activation='relu')) # symmetric centroid
model.add(Dense(128, activation='relu'))
model.add(Dense(784, activation='sigmoid'))

# for CIFAR10
# 1024 for 1 channel and 3072 for 3 channels
# input equal to output - and internal hidden layers can be the same
model = Sequential()
model.add(Dense(128, activation='relu', input_shape=(1024,) ))
model.add(Dense( 32, activation='relu'))
model.add(Dense(128, activation='relu'))
model.add(Dense(1024, activation='sigmoid'))

Installation

  • Install the requirements pip install -r requirements.txt
  • Train the model or Download pretrained weights
  • Run the evaluation on the image data by passing the path

How to use?

  • Download dataset and clean it - using CIFAR_autoencoder.ipynb or MNIST_autoencoder.ipynb notebook
  • Train the model which you are willing to use
  • Evaluation script of the same model is there to infer your models

Contribute

You can for the repository - create a pull request after making changes or can drop the issue by creating a new issue. It would be helpful for the community.

Last Updated on 4 Feb 2021

autoencoder-mnist-clustering's People

Contributors

vermavinay982 avatar

Stargazers

 avatar

Watchers

 avatar

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.