Fine-Tuning a TorchVision Model using Keras
A comprehensive guide to fine-tuning a pre-trained model from TorchVision using Keras.
Created on September 17|Last edited on September 19
Comment
🎬 Introduction
TorchVision is a library part of the PyTorch project that consists of popular datasets, model architectures, and common image transformations for computer vision. In this report, we'll learn how we can fine-tune a pre-trained backbone model from TorchVision on the Imagenette dataset using KerasCore for image classification. We will also demonstrate the compatibility of KerasCore with an input system consisting of Torch Datasets and Dataloaders.
If you'd like to follow along with interactive code, just click the Colab link below and we've got you covered.
Let's get started.
Table of Contents
🎬 Introduction🎥 Initial Setup💿 Creating the Input Pipeline🤖 The Image Classification Model🏋️♀️ Training the Image Classification Model🦾 Evaluation and Inference🏁 Conclusion
🎥 Initial Setup
Setup
0
💿 Creating the Input Pipeline
Creating the input pipeline
0
🤖 The Image Classification Model
The Image Classification Model
0
🏋️♀️ Training the Image Classification Model
Training the Image Classification Model
1
🦾 Evaluation and Inference
Evaluation and Inference
12
🏁 Conclusion
In this report, we explore the following...
- We explore how we can use an input pipeline consisting of torch datasets and dataloaders for a training workflow in KerasCore.
- We explore how we can fine-tune a pre-trained TorchVision module using KerasCore with the Torch backend.
- We explore how we can manage and track our experiments using the backend-agnostic Keras callbacks from wandb-addons.
- We explore how we can fetch the best weights from Weights & Biases artifacts and use them for evaluation and inference.
- We also explore how we can visualize and explore model predictions using WandB Tables.
This report uses the following resources as reference:
XLA Compatibility of Vision Models in Keras
A set of comprehensive benchmarks around XLA compatibility of computer vision models implemented in Keras.
Low-Light Image Enhancement: Lighting up Images in the Deep Learning Era
In this article, we explore some deep learning techniques for low-light image enhancement, so that you can enhance images taken under sub-optimal conditions.
Fine-Tuning Stable Diffusion Using Dreambooth in Keras
In this article, we quickly teach Stable Diffusion new visual concepts using Dreambooth in Keras, to produce fully-novel photorealistic images of a given subject.
Image Classification Using Vision Transformer and KerasCV
In this article, we'll learn how to use KerasCV to fine-tune a vision transformer (ViT) on our custom dataset. We also provide code so that you can follow along.
How to Use Cosine Decay Learning Rate Scheduler in Keras
In this article, we'll learn how to use cosine decay in Keras, providing you with code and interactive visualizations so you can give it a try it for yourself.
How to Use a Learning Rate Scheduler in Keras
This article provides a short tutorial on how you can use Learning Rate Scheduler's in Keras with code and interactive visualizations, using Weights & Biases.
Add a comment
Iterate on AI agents and models faster. Try Weights & Biases today.