- 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
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.
- Node.js (v12 or later)
- npm (v6 or later)
-
Clone the repository:
git clone https://github.com/matin-ghorbani/Fashion-MNIST-training-TensorFlow-JS.git cd Fashion-MNIST-training-TensorFlow-JS
-
Create a new package.json:
npm init -y
-
Install the dependencies:
npm install @tensorflow/tfjs-node npm install jimp
-
Place the Fashion MNIST dataset CSV files (
fashion-mnist_train.csv
andfashion-mnist_test.csv
) in thedata
directory. You can download the dataset from here.
To train the model, run the following command:
node build_model.js
To test the model, run the following command:
node test_model.js /path/to/image.jpg
To train the model by transfer learning, run the following command:
node transfer_learning.js
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