Skip to content

matin-ghorbani/Fashion-MNIST-training-TensorFlow-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fashion Mnist training TensorFlow JS

These tasks solved with this repo

  • Training a model on Fashion Mnist dataset using build_model.js
  • Testing the model on test images using test_model.js
  • Transfer learning on a new model using the last model with transfer_learning.js

Table of Contents

Introduction

Fashion MNIST is a dataset of Zalando's article images consisting of 70,000 28x28 grayscale images in 10 categories, with 7,000 images per category. The goal of this project is to classify these images into their respective categories using a neural network implemented in TensorFlow.js.

Setup

Prerequisites

  • Node.js (v12 or later)
  • npm (v6 or later)

Installation

  1. Clone the repository:

    git clone https://github.com/matin-ghorbani/Fashion-MNIST-training-TensorFlow-JS.git
    cd Fashion-MNIST-training-TensorFlow-JS
  2. Create a new package.json:

    npm init -y
  3. Install the dependencies:

    npm install @tensorflow/tfjs-node
    npm install jimp
  4. Place the Fashion MNIST dataset CSV files (fashion-mnist_train.csv and fashion-mnist_test.csv) in the data directory. You can download the dataset from here.

Usage

Training the Model

To train the model, run the following command:

node build_model.js

Testing the Model

To test the model, run the following command:

node test_model.js /path/to/image.jpg

Using transfer learning to train the Model

To train the model by transfer learning, run the following command:

node transfer_learning.js

Results

After training, the model achieves the following results on the test set:

  • Test-set loss: 0.0124
  • Test-set accuracy: 0.9979

You can download my model from here

Releases

No releases published

Packages

No packages published