- Keras - Discussion
- Keras - Useful Resources
- Keras - Quick Guide
- Keras - Pre-Trained Models
- Keras - Real Time Prediction using ResNet Model
- Keras - Applications
- Keras - Time Series Prediction using LSTM RNN
- Keras - Regression Prediction using MPL
- Keras - Convolution Neural Network
- Keras - Model Evaluation and Prediction
- Keras - Model Compilation
- Keras - Models
- Keras - Customized Layer
- Keras - Layers
- Keras - Modules
- Keras - Deep learning
- Keras - Overview of Deep learning
- Keras - Backend Configuration
- Keras - Installation
- Keras - Introduction
- Keras - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Keras - Pre-Trained Models
In this chapter, we will learn about the pre-trained models in Keras. Let us begin with VGG16.
VGG16
VGG16 is another pre-trained model. It is also trained using ImageNet. The syntax to load the model is as follows −
keras.apppcations.vgg16.VGG16( include_top = True, weights = imagenet , input_tensor = None, input_shape = None, poopng = None, classes = 1000 )
The default input size for this model is 224x224.
MobileNetV2
MobileNetV2 is another pre-trained model. It is also trained uing ImageNet.
The syntax to load the model is as follows −
keras.apppcations.mobilenet_v2.MobileNetV2 ( input_shape = None, alpha = 1.0, include_top = True, weights = imagenet , input_tensor = None, poopng = None, classes = 1000 )
Here,
alpha controls the width of the network. If the value is below 1, decreases the number of filters in each layer. If the value is above 1, increases the number of filters in each layer. If alpha = 1, default number of filters from the paper are used at each layer.
The default input size for this model is 224x224.
InceptionResNetV2
InceptionResNetV2 is another pre-trained model. It is also trained using ImageNet. The syntax to load the model is as follows −
keras.apppcations.inception_resnet_v2.InceptionResNetV2 ( include_top = True, weights = imagenet , input_tensor = None, input_shape = None, poopng = None, classes = 1000)
This model and can be built both with ‘channels_first’ data format (channels, height, width) or ‘channels_last’ data format (height, width, channels).
The default input size for this model is 299x299.
InceptionV3
InceptionV3 is another pre-trained model. It is also trained uing ImageNet. The syntax to load the model is as follows −
keras.apppcations.inception_v3.InceptionV3 ( include_top = True, weights = imagenet , input_tensor = None, input_shape = None, poopng = None, classes = 1000 )
Here,
The default input size for this model is 299x299.
Conclusion
Keras is very simple, extensible and easy to implement neural network API, which can be used to build deep learning apppcations with high level abstraction. Keras is an optimal choice for deep leaning models.
Advertisements