Before we proceed, let's load three packages that we'll need in this section:
# Libraries used
library(keras)
library(EBImage)
library(tensorflow)
The Keras and TensorFlow libraries will be used for developing the pretrained image classification model, while the EBImage library will be used for processing and visualizing image data.
In Keras, the following pretrained image classification models are available:
- Xception
- VGG16
- VGG19
- ResNet50
- InceptionV3
- InceptionResNetV2
- MobileNet
- MobileNetV2
- DenseNet
- NASNet
These pretrained models are trained on images from ImageNet (http://www.image-net.org/). ImageNet is a huge image database that contains several million images.
We will start by using a pretrained model known as resnet50 to identify an image. The following is the code we can use to utilize...