title
Transfer Learning | Deep Learning Tutorial 27 (Tensorflow, Keras & Python)

description
📺 Transfer learning is a very important concept in the field of computer vision and natural language processing. Using transfer learning you can use pre trained model and customize it for your needs. This saves computation time and money. It has been a revolutionary break through in the field of deep learning and nowadays you see it being used widely in the industry. In this video we will go over some theory behind transfer learning and then use google's mobile net v2 pre trained model to train our flowers dataset #transferlearning #transferlearningdeeplearning #transferlearningkeras #transferlearningtensorflow #transferlearningmodels #deeplearningtutorial #transferlearningexample Code: https://github.com/codebasics/deep-learning-keras-tf-tutorial/blob/master/18_transfer_learning/cnn_transfer_learning.ipynb Do you want to learn technology from me? Check https://codebasics.io/?utm_source=description&utm_medium=yt&utm_campaign=description&utm_id=description for my affordable video courses. Deep learning playlist: https://www.youtube.com/playlist?list=PLeo1K3hjS3uu7CxAacxVndI4bE_o3BDtO Machine learning playlist : https://www.youtube.com/playlist?list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw   🌎 My Website For Video Courses: https://codebasics.io/?utm_source=description&utm_medium=yt&utm_campaign=description&utm_id=description Need help building software or data analytics and AI solutions? My company https://www.atliq.com/ can help. Click on the Contact button on that website. #️⃣ Social Medias #️⃣ 🔗 Discord: https://discord.gg/r42Kbuk 📸 Dhaval's Personal Instagram: https://www.instagram.com/dhavalsays/ 📸 Instagram: https://www.instagram.com/codebasicshub/ 🌎 Website: https://codebasics.io/ 🔊 Facebook: https://www.facebook.com/codebasicshub 📱 Twitter: https://twitter.com/codebasicshub 📝 Linkedin: https://www.linkedin.com/company/codebasics/ ❗❗ DISCLAIMER: All opinions expressed in this video are of my own and not that of my employers'.

detail
{'title': 'Transfer Learning | Deep Learning Tutorial 27 (Tensorflow, Keras & Python)', 'heatmap': [{'end': 655.128, 'start': 621.271, 'weight': 0.904}, {'end': 1432.861, 'start': 1414.539, 'weight': 0.81}], 'summary': "Tutorial explores transfer learning for image recognition and classification, utilizing pre-trained models like mobilenet and google's mobilenet v2 to achieve high accuracy, showcasing the potential of reusing knowledge and achieving 85% accuracy in just 5 epochs, saving significant computation power and electricity costs.", 'chapters': [{'end': 183.891, 'segs': [{'end': 79.408, 'src': 'embed', 'start': 0.455, 'weight': 0, 'content': [{'end': 6.862, 'text': 'Transfer learning has become quite popular in the field of image classification and natural language processing.', 'start': 0.455, 'duration': 6.407}, {'end': 14.089, 'text': 'Here we take a pre-trained model and then we try to retrain it for the new problem.', 'start': 7.663, 'duration': 6.426}, {'end': 22.954, 'text': 'So if you remember from our data augmentation tutorial, we had flowers data set where we are trying to classify five type of flowers.', 'start': 14.986, 'duration': 7.968}, {'end': 30.921, 'text': "So in this video, we will use a MobileNet pre-trained model from Google's TensorFlow Hub.", 'start': 23.414, 'duration': 7.507}, {'end': 37.868, 'text': 'And we will use that pre-trained model to classify our flowers data set.', 'start': 31.762, 'duration': 6.106}, {'end': 45.574, 'text': 'And you will see that previously it used to take many epochs to train the complete model and achieve high accuracy.', 'start': 38.408, 'duration': 7.166}, {'end': 53.82, 'text': 'In this case, using a pre-trained model, it takes only like two or five iteration or epochs to get a superb accuracy.', 'start': 46.214, 'duration': 7.606}, {'end': 59.645, 'text': 'So using transfer learning saves a lot of computation power.', 'start': 54.421, 'duration': 5.224}, {'end': 69.643, 'text': 'Because many times, these pre-trained models that you can get from places like TensorFlow Hub, they are trained on millions of images.', 'start': 60.618, 'duration': 9.025}, {'end': 74.905, 'text': 'If you try to train that model on your computer, it might take days or even months.', 'start': 70.203, 'duration': 4.702}, {'end': 79.408, 'text': "But all you're doing is you're taking that pre-trained model.", 'start': 75.526, 'duration': 3.882}], 'summary': 'Transfer learning retrained mobilenet model for flowers data set, achieving high accuracy in just 2-5 epochs, saving computation power.', 'duration': 78.953, 'max_score': 0.455, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY455.jpg'}, {'end': 156.325, 'src': 'embed', 'start': 104.128, 'weight': 1, 'content': [{'end': 111.33, 'text': 'which is you focus on storing knowledge gained while solving one problem and apply it to a different but related problem.', 'start': 104.128, 'duration': 7.202}, {'end': 121.292, 'text': 'For example, if you have a model that can recognize cars, it can be used to recognize trucks as well, because the basic features, For example,', 'start': 111.79, 'duration': 9.502}, {'end': 128.675, 'text': 'the tires, the steering wheel and some of the components between cars and trucks, will be still similar.', 'start': 121.292, 'duration': 7.383}, {'end': 136.639, 'text': 'So you can use this knowledge of this visual world to transfer that knowledge into solving a different problem.', 'start': 129.216, 'duration': 7.423}, {'end': 139.037, 'text': "In today's coding problem.", 'start': 137.836, 'duration': 1.201}, {'end': 150.882, 'text': "what we're going to do is we will take Google's trained mobile net V2 model, which is trained on 1.4 million images and total thousand classes.", 'start': 139.037, 'duration': 11.845}, {'end': 156.325, 'text': 'So this is a deep learning model that is trained at Google.', 'start': 152.323, 'duration': 4.002}], 'summary': "Transfer knowledge to solve related problems, e.g., using google's mobile net v2 trained on 1.4m images & 1000 classes.", 'duration': 52.197, 'max_score': 104.128, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY104128.jpg'}], 'start': 0.455, 'title': 'Transfer learning for image recognition and classification', 'summary': "Discusses the concept of transfer learning, utilizing pre-trained models such as mobilenet and google's trained mobile net v2 to achieve high accuracy in image classification and recognition tasks, saving significant computation power and showcasing the potential of reusing knowledge to solve related problems efficiently.", 'chapters': [{'end': 104.128, 'start': 0.455, 'title': 'Transfer learning for image classification', 'summary': 'Discusses the concept of transfer learning, using a pre-trained mobilenet model to classify a flowers data set, achieving high accuracy in only two to five epochs and saving significant computation power by leveraging pre-trained models trained on millions of images.', 'duration': 103.673, 'highlights': ['Using a pre-trained MobileNet model to classify a flowers data set achieves high accuracy in only two to five epochs, saving significant computation power.', 'Transfer learning involves taking a pre-trained model and retraining it for a new problem, leveraging pre-trained models trained on millions of images to achieve high accuracy with minimal computation power.', 'Pre-trained models from sources like TensorFlow Hub are beneficial for saving computation power, as training them on a local machine could take days or even months.']}, {'end': 183.891, 'start': 104.128, 'title': 'Transfer learning for image recognition', 'summary': "Discusses the concept of transfer learning, using google's trained mobile net v2 model, which is trained on 1.4 million images and a total of a thousand classes, to recognize different objects and animals, showcasing the potential of reusing knowledge acquired in solving one problem to solve a related problem more efficiently.", 'duration': 79.763, 'highlights': ["Google's trained mobile net V2 model is trained on 1.4 million images and a total of a thousand classes, showcasing the extensive data and diverse classes involved in the deep learning model.", 'The concept of transfer learning is highlighted, demonstrating the potential to apply knowledge gained from solving one problem to a related problem, as exemplified by using a model that can recognize cars to also recognize trucks.', 'The chapter emphasizes the efficiency of transfer learning by explaining how the knowledge of the visual world can be used to solve different problems, showcasing the practical application of reusing acquired knowledge.']}], 'duration': 183.436, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY455.jpg', 'highlights': ['Using a pre-trained MobileNet model achieves high accuracy in only two to five epochs', "Google's trained mobile net V2 model is trained on 1.4 million images and a total of a thousand classes", 'Transfer learning involves taking a pre-trained model and retraining it for a new problem', 'Leveraging pre-trained models trained on millions of images to achieve high accuracy with minimal computation power', 'Pre-trained models from sources like TensorFlow Hub are beneficial for saving computation power', 'The concept of transfer learning is highlighted, demonstrating the potential to apply knowledge gained from solving one problem to a related problem', 'The chapter emphasizes the efficiency of transfer learning by explaining how the knowledge of the visual world can be used to solve different problems']}, {'end': 456.634, 'segs': [{'end': 338.839, 'src': 'embed', 'start': 259.454, 'weight': 0, 'content': [{'end': 264.077, 'text': 'And then during using this weight, you will get a feature vector.', 'start': 259.454, 'duration': 4.623}, {'end': 266.237, 'text': "You're almost doing a feature engineering.", 'start': 264.357, 'duration': 1.88}, {'end': 273.88, 'text': 'and then you use softmax to classify into five classes instead of thousand.', 'start': 267.853, 'duration': 6.027}, {'end': 282.169, 'text': "so i hope you get an idea that you're almost generating the features feature vector using this frozen layers.", 'start': 273.88, 'duration': 8.289}, {'end': 285.273, 'text': 'so during the training none of the weights, nothing changes.', 'start': 282.169, 'duration': 3.104}, {'end': 290.876, 'text': 'okay, and omitting the last layer is a very common approach.', 'start': 285.273, 'duration': 5.603}, {'end': 300.881, 'text': "in some approaches they also freeze only, let's say, three layers or two layers, and remaining layers go to the usual neural network training.", 'start': 290.876, 'duration': 10.005}, {'end': 312.086, 'text': 'okay. so we are going to now do a python coding to use mobilenet v2 model and then use it to classify the flowers.', 'start': 300.881, 'duration': 11.205}, {'end': 318.057, 'text': 'We will download a pre-trained model from a place called TensorFlow Hub.', 'start': 313.652, 'duration': 4.405}, {'end': 327.207, 'text': 'So Google has come up with this TensorFlow Hub where you can get an access of different pre-trained models.', 'start': 318.718, 'duration': 8.489}, {'end': 330.791, 'text': 'So right now for text domain problems, they have all these models.', 'start': 327.968, 'duration': 2.823}, {'end': 332.573, 'text': 'For example, for embedding, they have 176 models.', 'start': 330.851, 'duration': 1.722}, {'end': 338.839, 'text': 'for image classification, they have 188 models.', 'start': 334.375, 'duration': 4.464}], 'summary': 'Using frozen layers to generate feature vector, classifying into five classes, accessing pre-trained models from tensorflow hub.', 'duration': 79.385, 'max_score': 259.454, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY259454.jpg'}, {'end': 426.018, 'src': 'embed', 'start': 362.423, 'weight': 2, 'content': [{'end': 376.002, 'text': 'so this model, as i said, is trained on 1.4 million images and 1000 different classes, and the image is like 224 by 224.', 'start': 362.423, 'duration': 13.579}, {'end': 379.386, 'text': 'know, um, it is that dimension.', 'start': 376.002, 'duration': 3.384}, {'end': 392.32, 'text': 'so now, here in my jupyter notebook, i have imported all essential libraries and the first thing i am going to do is create,', 'start': 379.386, 'duration': 12.934}, {'end': 398.805, 'text': 'is basically import that MobileNet V2 classification model.', 'start': 393.843, 'duration': 4.962}, {'end': 399.926, 'text': 'So this is how we import it.', 'start': 398.825, 'duration': 1.101}, {'end': 403.827, 'text': 'So I have imported TensorFlow Hub.', 'start': 400.406, 'duration': 3.421}, {'end': 408.55, 'text': "Now, this doesn't come with your regular TensorFlow installation.", 'start': 405.008, 'duration': 3.542}, {'end': 410.19, 'text': 'You have to install it separately.', 'start': 408.59, 'duration': 1.6}, {'end': 413.112, 'text': 'So make sure you run pip install TensorFlow Hub.', 'start': 410.65, 'duration': 2.462}, {'end': 416.393, 'text': 'Otherwise, it will give you module not found error.', 'start': 413.812, 'duration': 2.581}, {'end': 426.018, 'text': 'Here, I am creating a classifier directly using this particular mobile net.', 'start': 418.055, 'duration': 7.963}], 'summary': 'Model trained on 1.4m images, 1000 classes, 224x224 dimensions, using mobilenet v2.', 'duration': 63.595, 'max_score': 362.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY362423.jpg'}], 'start': 184.591, 'title': 'Transfer learning with mobilenet v2 and tensorflow hub', 'summary': 'Covers transfer learning using mobilenet v2 model to classify flowers into five categories and discusses tensorflow hub providing access to 176 text embedding models and 188 image classification models, including mobilenet v2 trained on 1.4 million images and 1000 classes.', 'chapters': [{'end': 318.057, 'start': 184.591, 'title': 'Transfer learning with mobilenet v2', 'summary': 'Discusses transfer learning using mobilenet v2 model, freezing layers except the last one, and using the model to classify flowers into five categories, generating feature vectors and performing training with frozen layers.', 'duration': 133.466, 'highlights': ['The chapter discusses transfer learning using Mobilenet v2 model', 'Freezing layers except the last one and using the model to classify flowers into five categories', 'Generating feature vectors and performing training with frozen layers']}, {'end': 456.634, 'start': 318.718, 'title': 'Tensorflow hub and pre-trained models', 'summary': 'Discusses tensorflow hub providing access to pre-trained models for text, image, video, and audio problems, including 176 models for text embedding and 188 models for image classification, with mobilenet v2 being one of them trained on 1.4 million images and 1000 different classes.', 'duration': 137.916, 'highlights': ["Google's TensorFlow Hub offers access to a variety of pre-trained models for text, image, video, and audio problems, including 176 models for text embedding and 188 models for image classification.", 'One of the pre-trained models for image classification available on TensorFlow Hub is MobileNet v2, which is trained on 1.4 million images and 1000 different classes.', "To use TensorFlow Hub, it needs to be installed separately using 'pip install TensorFlow Hub' as it does not come with the regular TensorFlow installation.", "The chapter author has simplified the code from TensorFlow's official tutorial for using MobileNet v2 by customizing it to omit unnecessary elements."]}], 'duration': 272.043, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY184591.jpg', 'highlights': ["Google's TensorFlow Hub offers 188 image classification models", 'TensorFlow Hub provides access to 176 text embedding models', 'MobileNet v2 is trained on 1.4 million images and 1000 classes', 'Transfer learning using Mobilenet v2 model for flower classification', 'Freezing layers except the last one for transfer learning', 'Generating feature vectors and training with frozen layers', "TensorFlow Hub needs to be installed separately using 'pip install TensorFlow Hub'"]}, {'end': 703.093, 'segs': [{'end': 533.753, 'src': 'embed', 'start': 500.009, 'weight': 0, 'content': [{'end': 503.831, 'text': 'And once you do that, see you have the the model ready already.', 'start': 500.009, 'duration': 3.822}, {'end': 514.378, 'text': 'So now, if you want to classify among those 1000 classes, okay, so let me open the file that I have.', 'start': 504.612, 'duration': 9.766}, {'end': 525.564, 'text': 'So here in my current project directory, i have downloaded the those thousand classes and if i open that file,', 'start': 515.739, 'duration': 9.825}, {'end': 529.208, 'text': 'these are the classes see total thousand classes.', 'start': 525.564, 'duration': 3.644}, {'end': 533.753, 'text': 'and um, goldfish is one of the class.', 'start': 529.208, 'duration': 4.545}], 'summary': 'Model ready to classify among 1000 classes, including goldfish.', 'duration': 33.744, 'max_score': 500.009, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY500009.jpg'}, {'end': 613.383, 'src': 'embed', 'start': 582.301, 'weight': 1, 'content': [{'end': 587.106, 'text': "OK, so it's a smaller image now and let me try to classify this image.", 'start': 582.301, 'duration': 4.805}, {'end': 593.052, 'text': 'So now before you classify it, you have to scale it.', 'start': 587.526, 'duration': 5.526}, {'end': 603.854, 'text': "You've seen in all of our previous tutorials that before giving it for classification or training, We always scale or normalize the image.", 'start': 593.532, 'duration': 10.322}, {'end': 607.477, 'text': 'And how do you do that? Well, the color scale is 0 to 255.', 'start': 603.934, 'duration': 3.543}, {'end': 609.76, 'text': 'So you divide it by 255.', 'start': 607.477, 'duration': 2.283}, {'end': 613.383, 'text': "So see here, I'm dividing it by 255.", 'start': 609.76, 'duration': 3.623}], 'summary': 'Image is scaled by dividing color scale by 255 before classification.', 'duration': 31.082, 'max_score': 582.301, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY582301.jpg'}, {'end': 655.128, 'src': 'heatmap', 'start': 621.271, 'weight': 0.904, 'content': [{'end': 623.593, 'text': 'See now these values are in between 0 and 1 range.', 'start': 621.271, 'duration': 2.322}, {'end': 635.435, 'text': "OK I'm going to do one more thing, which is see when you do something like this, what you're doing is you are changing.", 'start': 623.673, 'duration': 11.762}, {'end': 642.36, 'text': "You are adding one more dimension, which is one, and the reason I'm doing it is because when you do prediction,", 'start': 635.515, 'duration': 6.845}, {'end': 645.982, 'text': 'you know prediction accepts multiple images and input.', 'start': 642.36, 'duration': 3.622}, {'end': 650.045, 'text': "You cannot have like only one image as an input, so that is the only reason I'm doing it.", 'start': 646.303, 'duration': 3.742}, {'end': 653.247, 'text': 'So now I can do classifier predict like this.', 'start': 650.565, 'duration': 2.682}, {'end': 655.128, 'text': 'So now.', 'start': 654.828, 'duration': 0.3}], 'summary': 'Adding dimension to enable prediction of multiple images.', 'duration': 33.857, 'max_score': 621.271, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY621271.jpg'}, {'end': 703.093, 'src': 'embed', 'start': 668.63, 'weight': 3, 'content': [{'end': 673.451, 'text': 'so here i am going to store this in lesser result.', 'start': 668.63, 'duration': 4.821}, {'end': 674.892, 'text': "and let's look at result.", 'start': 673.451, 'duration': 1.441}, {'end': 676.792, 'text': 'dot shape.', 'start': 674.892, 'duration': 1.9}, {'end': 677.993, 'text': "it's thousand.", 'start': 676.792, 'duration': 1.201}, {'end': 683.83, 'text': 'okay, now i need to get the max.', 'start': 677.993, 'duration': 5.837}, {'end': 693.271, 'text': 'so when you do np.argmax from result, it will give you the value, the index which has a maximum value and if you notice previously,', 'start': 683.83, 'duration': 9.441}, {'end': 699.953, 'text': "say it's very apparent zero, one, two, see, this has a.", 'start': 693.271, 'duration': 6.682}, {'end': 703.093, 'text': 'this has a bigger value, at least in this view, nine.', 'start': 699.953, 'duration': 3.14}], 'summary': 'Using np.argmax on result will give the index with the maximum value, such as 9.', 'duration': 34.463, 'max_score': 668.63, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY668630.jpg'}], 'start': 458.376, 'title': 'Image classification process and goldfish classifier prediction', 'summary': 'Covers preparing and classifying images, resizing to 224x224x3, using a pre-trained model to classify a goldfish among 1000 classes, modifying arrays, making predictions, and finding the index with the maximum value using np.argmax.', 'chapters': [{'end': 613.383, 'start': 458.376, 'title': 'Image classification process', 'summary': 'Covers the process of preparing an image for classification, including resizing to 224 by 224 by 3 and scaling the image by dividing by 255, and using a pre-trained model to classify a goldfish image among 1000 classes.', 'duration': 155.007, 'highlights': ['The process involves resizing the image to 224 by 224 by 3 and then scaling the image by dividing it by 255 to prepare it for classification.', 'The model being used is capable of classifying among 1000 classes, with the example of classifying a goldfish image among the 1000 classes being demonstrated.', 'The specific steps for preparing and classifying an image, including resizing and scaling, are detailed in the transcript.']}, {'end': 703.093, 'start': 613.383, 'title': 'Goldfish classifier prediction', 'summary': 'Explains how to modify the array and make predictions for a goldfish classifier with a total of a thousand classes, and storing the results in lesser result with a shape of thousand, and finding the index with the maximum value using np.argmax.', 'duration': 89.71, 'highlights': ['The chapter explains the process of modifying the array and making predictions for a goldfish classifier with a total of a thousand classes (1000).', 'Storing the results in lesser result with a shape of thousand (1000).', 'Finding the index with the maximum value using np.argmax.']}], 'duration': 244.717, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY458376.jpg', 'highlights': ['The model can classify among 1000 classes, demonstrated with a goldfish image.', 'The process involves resizing the image to 224x224x3 and scaling it by dividing by 255.', 'Explains modifying the array and making predictions for a goldfish classifier with 1000 classes.', 'Storing the results in a lesser result with a shape of 1000.', 'Finding the index with the maximum value using np.argmax.']}, {'end': 1285.491, 'segs': [{'end': 797.357, 'src': 'embed', 'start': 703.093, 'weight': 0, 'content': [{'end': 704.733, 'text': "so that's what it is giving you.", 'start': 703.093, 'duration': 1.64}, {'end': 707.594, 'text': 'now, how do i know which class nine is?', 'start': 704.733, 'duration': 2.861}, {'end': 721.592, 'text': 'well, If you look at the just a second, if you look at our image labels, two classes, goldfish, okay?', 'start': 707.594, 'duration': 13.998}, {'end': 723.513, 'text': "So it's very clear.", 'start': 721.952, 'duration': 1.561}, {'end': 730.677, 'text': 'but just to make it proper here, what I will do is I will open this file.', 'start': 723.513, 'duration': 7.164}, {'end': 737.721, 'text': 'So I will just say with open, okay, with open what? Well, this particular file.', 'start': 730.717, 'duration': 7.004}, {'end': 749.908, 'text': 'as f and f dot read, will read the files and when you do split lines, it will split the lines.', 'start': 742.483, 'duration': 7.425}, {'end': 753.79, 'text': 'and you want to store this into an array called image labels.', 'start': 749.908, 'duration': 3.882}, {'end': 764.494, 'text': 'okay, so image label is nothing but a label array and if you look at these labels,', 'start': 753.79, 'duration': 10.704}, {'end': 775.678, 'text': "you will find that now you're having those thousand classification labels and if you supply your predicted label index, you get a goldfish here.", 'start': 764.494, 'duration': 11.184}, {'end': 777.459, 'text': 'so this looks good.', 'start': 775.678, 'duration': 1.781}, {'end': 783.901, 'text': 'so far we used pre-trained model and we just did classification straight away.', 'start': 777.459, 'duration': 6.442}, {'end': 790.491, 'text': 'this is, like you know, almost a loading of pickled model and doing a classification.', 'start': 783.901, 'duration': 6.59}, {'end': 797.357, 'text': 'now we want to do a classification for our flowers data set and you can download flowers data set by running this command.', 'start': 790.491, 'duration': 6.866}], 'summary': 'Using a pre-trained model for classification, achieving a 1000 classification labels and predicting a goldfish.', 'duration': 94.264, 'max_score': 703.093, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY703093.jpg'}, {'end': 1024.78, 'src': 'embed', 'start': 997.744, 'weight': 4, 'content': [{'end': 1003.23, 'text': "And I'm creating a label directory as well, because machine learning model doesn't understand text.", 'start': 997.744, 'duration': 5.486}, {'end': 1006.313, 'text': 'So you need to say, okay, roses is zero, daisies is one and so on.', 'start': 1003.59, 'duration': 2.723}, {'end': 1020.678, 'text': "Now if you look at let's say any particular file path, it looks something like this and this you can now read into OpenCV.", 'start': 1009.873, 'duration': 10.805}, {'end': 1024.78, 'text': 'So CV2 is OpenCV module which I have imported at the top.', 'start': 1020.859, 'duration': 3.921}], 'summary': 'Creating a label directory for machine learning model to understand text data and importing opencv module for reading file paths.', 'duration': 27.036, 'max_score': 997.744, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY997744.jpg'}], 'start': 703.093, 'title': 'Image label reading and flower classification', 'summary': "Covers the reading and storing of image labels, emphasizing 'goldfish' class identification, and demonstrates flower classification using a pre-trained model, achieving an 80% accuracy.", 'chapters': [{'end': 775.678, 'start': 703.093, 'title': 'Reading and storing image labels', 'summary': "Describes the process of reading and storing image labels into an array, with the labels covering a thousand classification labels, emphasizing the identification of the class 'goldfish'.", 'duration': 72.585, 'highlights': ["The chapter emphasizes the identification of the class 'goldfish' within the thousand classification labels.", 'It explains the process of reading the files and storing the image labels into an array called image labels after splitting the lines.', 'The transcript discusses the process of identifying and storing the class labels for the images.']}, {'end': 1285.491, 'start': 775.678, 'title': 'Flower classification with pre-trained model', 'summary': 'Demonstrates using a pre-trained model to classify a flower dataset, with a focus on data acquisition, image processing, model training, and prediction, achieving an accuracy of 80%.', 'duration': 509.813, 'highlights': ['The chapter demonstrates using a pre-trained model to classify a flower dataset', 'Achieving an accuracy of 80%', 'Data acquisition and image processing', 'Model training and prediction process']}], 'duration': 582.398, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY703093.jpg', 'highlights': ['Demonstrates flower classification using a pre-trained model, achieving an 80% accuracy', "The chapter emphasizes the identification of the class 'goldfish' within the thousand classification labels", 'Explains the process of reading the files and storing the image labels into an array called image labels after splitting the lines', 'The transcript discusses the process of identifying and storing the class labels for the images', 'Data acquisition and image processing', 'Model training and prediction process']}, {'end': 1553.696, 'segs': [{'end': 1525.051, 'src': 'heatmap', 'start': 1414.539, 'weight': 0, 'content': [{'end': 1417.86, 'text': 'The previous layers are already trained.', 'start': 1414.539, 'duration': 3.321}, {'end': 1423.762, 'text': 'And then I will run only five epochs, by the way.', 'start': 1420.561, 'duration': 3.201}, {'end': 1429.399, 'text': 'So these parameters are standard, ADAMS, PARSE, CATEGORY, COST, ENTROPY, etc.', 'start': 1424.775, 'duration': 4.624}, {'end': 1432.861, 'text': "And I'm now running only 5 epochs.", 'start': 1430.239, 'duration': 2.622}, {'end': 1447.753, 'text': 'Now, if you remember from our data augmentation tutorial, to train the same model with CNN previously, it took us, you know, 30 epochs.', 'start': 1436.184, 'duration': 11.569}, {'end': 1451.156, 'text': 'In 30 epochs, we got 85% accuracy.', 'start': 1448.354, 'duration': 2.802}, {'end': 1452.297, 'text': 'Now check this.', 'start': 1451.696, 'duration': 0.601}, {'end': 1456.632, 'text': 'In second epoch, you got 85% accuracy.', 'start': 1453.829, 'duration': 2.803}, {'end': 1462.359, 'text': 'So you can see that deep learning training is very expensive.', 'start': 1457.213, 'duration': 5.146}, {'end': 1470.088, 'text': 'When you run so many trainings, so many epochs, your GPU, CPU, your electricity power is burnt.', 'start': 1463.18, 'duration': 6.908}, {'end': 1472.891, 'text': 'You might get a big electricity bill.', 'start': 1470.709, 'duration': 2.182}, {'end': 1478.95, 'text': 'But with transfer learning, you can save all that computation time.', 'start': 1473.928, 'duration': 5.022}, {'end': 1480.61, 'text': 'It is not just the build.', 'start': 1479.55, 'duration': 1.06}, {'end': 1486.032, 'text': "Sometimes when you're building or training a big model, it might take you days, weeks, or months.", 'start': 1481.131, 'duration': 4.901}, {'end': 1494.896, 'text': 'But with pre-trained model, you can retrain it for your problem so much easily.', 'start': 1486.593, 'duration': 8.303}, {'end': 1500.798, 'text': "And let's look at the performance of our taste data set.", 'start': 1495.636, 'duration': 5.162}, {'end': 1506.042, 'text': 'That is also very good, 85%.', 'start': 1501.877, 'duration': 4.165}, {'end': 1513.31, 'text': 'So this is the reason why transfer learning is so popular in computer vision and natural language processing.', 'start': 1506.042, 'duration': 7.268}, {'end': 1519.607, 'text': "If you're solving any computer vision or NLP problem, try to see if you can use transfer learning.", 'start': 1514.342, 'duration': 5.265}, {'end': 1523.309, 'text': 'If you cannot, then only try to build the model from scratch.', 'start': 1520.427, 'duration': 2.882}, {'end': 1525.051, 'text': 'I hope you like this video.', 'start': 1523.95, 'duration': 1.101}], 'summary': 'Transfer learning reduces training time, achieving 85% accuracy in 5 epochs and saving computation time and electricity costs.', 'duration': 125.758, 'max_score': 1414.539, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY1414539.jpg'}], 'start': 1285.491, 'title': 'Transfer learning benefits', 'summary': 'Discusses the benefits of transfer learning, showcasing a reduction in training time from 30 to 5 epochs, achieving 85% accuracy in the second epoch, and saving computational resources and electricity costs, making it popular in computer vision and natural language processing.', 'chapters': [{'end': 1398.973, 'start': 1285.491, 'title': 'Retraining feature extractor model', 'summary': 'Discusses retraining a feature extractor model using tensorflow hub, creating a model with trainable layers and freezing the weights to perform training.', 'duration': 113.482, 'highlights': ['The model is retrained using a feature extractor model, different from the ready-made model, to include all four different flowers, making random guesses out of a thousand classes.', 'The process involves creating a model with trainable layers and freezing the weights using TensorFlow Hub, to perform training and have fixed weights for the layers.']}, {'end': 1553.696, 'start': 1399.293, 'title': 'Transfer learning benefits', 'summary': 'Highlights the benefits of transfer learning, demonstrating how it reduces training time from 30 to 5 epochs, achieving 85% accuracy in the second epoch, while also saving computational resources and electricity costs, making it popular in computer vision and natural language processing.', 'duration': 154.403, 'highlights': ['Transfer learning reduces training time from 30 to 5 epochs', 'Benefits of transfer learning in saving computational resources and electricity costs', 'Popular use of transfer learning in computer vision and natural language processing']}], 'duration': 268.205, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/LsdxvjLWkIY/pics/LsdxvjLWkIY1285491.jpg', 'highlights': ['Transfer learning reduces training time from 30 to 5 epochs', 'Achieves 85% accuracy in the second epoch', 'Benefits of transfer learning in saving computational resources and electricity costs', 'Popular use of transfer learning in computer vision and natural language processing', 'The model is retrained using a feature extractor model to include all four different flowers']}], 'highlights': ['Using a pre-trained MobileNet model achieves high accuracy in only two to five epochs', 'Transfer learning reduces training time from 30 to 5 epochs', 'Achieves 85% accuracy in the second epoch', "Google's trained mobile net V2 model is trained on 1.4 million images and a total of a thousand classes", 'Pre-trained models from sources like TensorFlow Hub are beneficial for saving computation power', 'Leveraging pre-trained models trained on millions of images to achieve high accuracy with minimal computation power', 'The concept of transfer learning is highlighted, demonstrating the potential to apply knowledge gained from solving one problem to a related problem', 'Benefits of transfer learning in saving computational resources and electricity costs', 'The model can classify among 1000 classes, demonstrated with a goldfish image', 'Demonstrates flower classification using a pre-trained model, achieving an 80% accuracy', "Google's TensorFlow Hub offers 188 image classification models", 'Transfer learning using Mobilenet v2 model for flower classification', 'Freezing layers except the last one for transfer learning', 'Popular use of transfer learning in computer vision and natural language processing', 'Explains modifying the array and making predictions for a goldfish classifier with 1000 classes']}