Complete workflow for image classification in Pytorch.
- Import dataset and load it as batches
- CNN model
- Training, testing and save the model
- Load model weights and predict
- Visualize filter weights and feature maps in each layer
- Save feature maps and input image
- 32 GB RAM
- RTX 2080 GPU
- torch 1.2.0
- torchvision 0.2.1
- json 0.8.4
- matplotlib 3.1.0
- numpy 1.16.4
MNIST - Image classification, 1x28x28 px.
- Conv2d * 2 + RELU
- Maxpool2d * 2
- Fully connected layer * 2
Trained in 3 epochs with 128 batch size and the training accuracy is 0.9827.
The testing accuracy is 0.9854.
Trained filters and the output feature maps each layer are plotted to see in the black box.
The model is referred to >> https://xmfbit.github.io/2017/03/04/pytorch-mnist-example/.