Chapter 4 is dedicated to influential CNN architectures like VGG, Inception, ResNet, etc., detailing their contributions to computer vision and machine learning in general. Introducing more complex classification tasks, we also explain how CNNs can benefit from knowledge acquired on different datasets (transfer learning). Therefore, the following notebooks contain the detailed implementation of some of these influential models, and present how to efficiently reuse pre-implemented and pre-trained models shared on various platforms.
(Reminder: Notebooks are better visualized with nbviewer
: click here to continue on nbviewer.jupyter.org
.)
- 4.1 - Implementing ResNet from Scratch
- Implement block by block the very-deep ResNet architecture (ResNet-18, ResNet-50, ResNet-152) and apply to the classification of a large dataset (CIFAR-100) obtained through
tensorflow-datasets
.
- Implement block by block the very-deep ResNet architecture (ResNet-18, ResNet-50, ResNet-152) and apply to the classification of a large dataset (CIFAR-100) obtained through
- 4.2 - Reusing Models from Keras Applications
- Discover how to reuse pre-implemented models available in
keras.applications
, training another version of ResNet-50.
- Discover how to reuse pre-implemented models available in
- 4.3 - Fetching Models from TensorFlow Hub
- Navigate tfhub.dev, the online catalog of pre-trained models, and use the module
tensorflow-hub
to fetch and instantiate them (experimenting with ready-to-use Inception and MobileNet models).
- Navigate tfhub.dev, the online catalog of pre-trained models, and use the module
- 4.4 - Applying Transfer Learning
- Experiment with transfer learning, freezing or fine-tuning layers of models pre-trained on different datasets.
- 4.5 - (Appendix) Exploring ImageNet and Tiny-ImageNet
- Learn more about ImageNet and Tiny-ImageNet, and how to train models on these more complex datasets.
- cifar_utils.py: utility functions for the CIFAR dataset, using
tensorflow-datasets
(code presented in notebook 4.1). - classification_utils.py: utility functions for classification tasks, e.g., to load images or to display predictions (code presented in notebook 4.1).
- keras_custom_callbacks.py: custom Keras callbacks to monitor the trainings of models (code presented in notebook 4.1).
- resnet_functional.py: implementation of ResNet using Keras Functional API (code presented in notebook 4.1).
- resnet_objectoriented.py: another implementation of ResNet using Keras Functional API, following the object-orietend paradigm (code presented in notebook 4.1).
- tiny_imagenet_utils.py: utility functions for the Tiny-ImageNet dataset (code presented in notebook 4.5).