Building an image classification model
The recipe focuses on building an image classification model using Transfer Learning. It will utilize the dataset prepared in the previous recipes and use the Inception-BN architecture. The BN in Inception-BN stands for batch normalization. Details of the Inception model in computer vision can be found in Szegedy et al. (2015).
Getting ready
The section cover's the prerequisite to set-up a classification model using INCEPTION-BN pretrained model.
- Convert images into
.rec
file for train and validation. - Download the Inception-BN architecture from http://data.dmlc.ml/models/imagenet/inception-bn/.
- Install R and the
mxnet
package in R.
How to do it...
- Load the
.rec
file as iterators. The following is the function to load the.rec
data as iterators:
# Function to load data as iterators data.iterator <- function(data.shape, train.data, val.data, BATCHSIZE = 128) { # Load training data as iterator train <- mx.io.ImageRecordIter( path.imgrec ...