
Learn how transfer learning leverages pre trained CNN architectures to improve image classification, from dataset preparation and feature extraction to training, evaluation, and model deployment.
Discover how the instructor approaches transfer learning projects within deep learning practice II in this course.
Delve into transfer learning through practical world classification projects using convolutional neural networks. The course unfolds in two parts, practical development and theoretical foundations, guiding beginners and enabling hands-on learners.
Learn to classify vehicle types with transfer learning on a seven-class dataset including car, motorcycle, and bicycle subtypes, using 603 training images, 75 validation, and 76 test images, all 224 by 224 by 3.
Explore why transfer learning helps mitigate overfitting when training CNNs from scratch on a dataset of different vehicle types, by reusing well-designed networks from literature.
Address overfitting by using transfer learning with pre-trained classifiers to optimize training. Reuse pre-trained weights from ImageNet and fine-tune on a new data set for faster convergence and higher accuracy.
Understand the typical convolutional neural network structure: a base model for feature extraction and a head model for classification, using max pooling, activation, and a softmax output.
Load a base model with pre-trained weights, remove the top, extract features, and build a dense head with average pooling, flattening, batch normalization, dropout, and softmax.
explore transfer learning by freezing the base model and training only the head on small datasets, or unfreeze all layers to train all parameters when data is plentiful.
Apply transfer learning in practice using two ready-to-use notebooks for classification projects; adjust data paths and model, train in the first notebook, then automatically evaluate in the second.
Document experiment configurations in a training notebook, including dataset details (603 images, seven classes), batch size 64, learning rate, optimizer, categorical entropy, and transfer learning with Mobile Nedved V2.
Import libraries for this training project and adjust them for your goals; train a custom dataset on mobile rather than a classifier, and explore importing classifiers from Tancer floor.
Set up and configure the project paths for a mobile net v2-based image classification experiment, including dataset, model, user, iteration, and logging, with automatic folder creation and Google Drive mounting.
Load datasets from the SDF I file, organizing images into train, validation, and test sets with corresponding data and label arrays, and visualize sample data to verify shapes.
Define the transfer learning model with a base pre-trained feature extractor and a dense classification head; set trainable parameters, add a best-validation checkpoint, and train to evaluate loss and accuracy.
Compare two transfer learning strategies by tuning all parameters versus freezing feature extraction layers, and analyze 2.4 million versus 173 thousand trainable parameters and their impact.
Load a pre-trained model on the same custom dataset using a cloud model method to specify terrain classification, then fine-tune with different hyperparameters to improve performance.
Define callback functions to save the best model by monitoring validation accuracy, using a checkpoint named SEPI one, and log history to CSV with a vlogger in a callback list.
Set hyperparameters carefully; start with a learning rate around 1e-4 to 1e-3 for convergence. Choose epochs and budget size based on data complexity and gpu memory, using powers of two.
Identify the optimizer as a crucial hyperparameter and favor the Adam optimizer for its momentum. If training underperforms, try other optimizers through trial and error.
Compile the transfer learning model by selecting the loss function, such as categorical cross entropy, the optimizer, and metrics like accuracy for multi-class classification in the classification layers.
Compile and train the transfer learning model using an optimizer, accuracy metrics, and categorical cross entropy for multi-class classification, with data augmentation using random rotations and monitoring validation accuracy.
Monitor training progress when fine-tuning a pre-trained model with ImageNet weights, tracking training and validation accuracy, loss, and saving the best checkpoint at peak validation.
Perform a quick post-training evaluation by reviewing training and validation accuracy, plotting loss and accuracy, and examining the callback log file and the checkpoint with the highest validation accuracy.
Learn how to evaluate transfer learning models for vehicle type classification using two evaluation notebooks, and configure paths, import libraries, and mount Google Drive in Colab.
Load the validation and test datasets from the SDF file, avoiding the training data to save memory, and verify shapes and samples with the provided visualization tool.
Load the trained h5 model for evaluation, compare load time, highlight a lightweight 28 megabyte model with 2.5 million parameters, and use latest checkpoint with the highest validation accuracy.
Evaluate the model using the validation dataset to obtain validation loss and accuracy, compare with training results, then test on the test dataset to assess generalization and potential overfitting.
Build a class dictionary to map seven one-hot encoded labels to human-readable names, define get guards' classes dict, and convert model predictions to class labels for clear visualization of results.
Test a single image by preprocessing and reshaping to 24 by 24 by 3, then predict its class with the trained model via a class dictionary.
Fetch images from the internet or a mobile device, resize to 24x24x3, normalize to 0-1, and predict the class with the trained model's highest probability.
Display the top five predictions and the classification report to measure per-class metrics such as precision, recall, and F1, identify sedan and SUV misclassifications, and guide data improvements.
Plot misclassified images from the test and validation sets to evaluate the trained model, compare models like inceptions, and discuss production deployment constraints such as real-time processing and memory usage.
Introduce the convolution operation and the pulling operation, and familiarize you with the vocabulary used in convolutional networks, such as putting stright and filter, to learn image multiclass classification.
Explore computer vision applications powered by convolutional networks, including image classification, face recognition, and object detection with bounding boxes and labels.
Explain how convolutional networks handle large image inputs, reduce parameter count and memory usage, prevent overfitting, and enable effective feature extraction for classification.
Apply the convolution operator to an input image with multiple channels using kernels to extract features and produce feature maps, revealing vertical edges and other orientations.
Explore horizontal and vertical edge filters to reveal image edges and demonstrate how convolutional features are learned during training, replacing manual feature design.
Learn how common image filters extract features for learning, revealing edges that define image classes. See software filters that emphasize the center to highlight key features.
Learn how convolution uses learnable 3x3 filters trained via forward and backward propagation to minimize loss, with random or other initializations, and explore detection, sharpening, and noise-reduction filters.
Apply padding to convolution to preserve input size and enhance border contributions, using zero padding with pad=1 so a 6x6 input stays 6x6 in the feature map.
Explore the two main convolution types, valid and same, and how padding (F-1)/2 keeps input and output sizes equal for common filter sizes like 3, 5, and 7.
Explore strided convolutions and how increasing the stride reduces feature map size while focusing on different features, and learn the size formula (input + 2 - F)/S + 1, floor.
Learn how convolution uses filters, padding and stride to shape feature maps, extract hierarchical image features across layers, and feed them into a fully connected classifier in deep networks.
Apply three-dimensional convolution on RGB images using a 3x3x3 filter across red, green, and blue channels to produce a 4x4 feature map.
Explain how a single convolutional layer turns a 6x6x3 input into 4x4 feature maps using 10 three-dimensional filters, with learned weights via forward and backward propagation and gradient descent.
Illustrates a convolutional neural network on a 39x39x3 image using 3x3 filters, stride 1, producing 37x37x10 maps, a 5x5 stride-2 conv to 17x17x20, and a 7x7x40 output for classification.
Learn pooling in convolutional networks by comparing max pooling and average pooling with 4x4 to 2x2 examples, noting that pooling has no learnable parameters.
Explore case studies and state-of-the-art CNN architectures, building on basic blocks from the previous lecture, to show how researchers combine concepts to tailor networks for image classification performance.
Review convolution with filters 3x3, 5x5, and 7x7, padding with zeros, and how stride and filter count shape feature maps and parameter totals.
Trace the evolution of computer vision classification models from traditional techniques to deep neural networks, highlighting key architectures from 2012 to recent breakthroughs and comparing state-of-the-art methods.
Discover the lenet architecture (1998), a compact convolutional network for handwritten digits. Process 32x32 grayscale inputs with two conv layers using average pooling, a fully connected layer, and softmax.
AlexNet (2012) introduces an eight-layer convolutional network with about 60 million parameters, powered by ReLU, trained on ImageNet with data augmentation and overlapping pooling, achieving a top-5 error of 15.3%.
Zeiler and Fergus introduced ZFNet in 2013, a minor architectural tweak that improved results, achieving a top five error rate of fourteen point eight percent on ImageNet.
VGG-16 is a 16-layer convolutional network with a uniform conv-block architecture that grows filters from 64 to 512 while halving spatial dimensions and ending with three fully connected layers.
Google net, later called Inception networks (2014), achieved near human-level top-5 error around six to seven percent, using a CNN inspired by LeNet and image distortions.
Show how a 1x1 convolution reduces dimensions and computation, lowering operations from about 12.9 million to 5.3 million for a 14x14x480 map with a 5x5 filter.
The Inception module performs parallel convolutions with 1x1, 3x3, and 5x5 (plus max pooling) and concatenates outputs, using 1x1 reductions to improve efficiency.
Explore global average pooling in GoogleNet, replacing the final fully connected layer by averaging 7×7 feature maps to 1×1, reducing parameters and overfitting, in a 22-layer inception architecture.
Explore how residual neural networks address vanishing and exploding gradients through identity shortcut connections, enabling deeper models like up to 152 layers while improving training and performance.
Compare neural network architectures from ElectraNet to Inception variants, highlighting top-1 accuracy and computational cost to guide selections based on accuracy versus speed requirements.
Explore EfficientNet, a state-of-the-art image classification model that uses compound scaling of depth, width, and resolution, optimized via neural architecture search for accuracy and efficiency.
You want to start developing deep learning solutions, but you do not want to lose time in mathematics and theory?
You want to conduct deep learning projects, but do not like the hassle of tedious programming tasks?
Do you want an automated process for developing deep learning solutions?
This course is then designed for you! Welcome to Deep Learning in Practice, with NO PAIN!
This course is the second course on a series of Deep Learning in Practice Courses of Anis Koubaa, namely
Deep Learning in Practice I: Basics and Dataset Design: the student will learn the basics of conducting a classification project using deep neural networks, then he learns about how to design a dataset for industrial-level professional deep learning projects.
Deep Learning in Practice II: Transfer Learning and Models Evaluation: the student will learn how to manage complex deep learning projects and develop models using transfer learning using several state-of-the-art CNN algorithms. He will learn how to develop reusable projects and how to compare the results of different deep learning models in an automated manner.
Deep Learning in Practice III: Deployment of Deep Learning Models: the student will learn how to deploy deep learning models in a production environment. We will present the deployment techniques used in industry such as Flask, Docker, Tensorflow Serving, Tensorflow JavaScript, and Tensorflow Lite, for deployment in a different environment. Despite important, this topic has little coverage in tutorials and documentations.
Deep Learning in Practice II: Transfer Learning Projects
This course introduces you to transfer learning and demonstrate to you how to use transfer learning in real-world projects.
In this course, I demonstrate how to conduct training of a deep learning classification model using transfer learning.
Besides, you will learn how to evaluate the performance of a model with some pre-configured libraries that makes it easy to obtain the results and interpret them.
I also provide ready-to-use Google Colab Notebooks with all codes used in this course.
The same code can be easily adapted and reused for any classification project in an automated way.