Tutorial 28- Create CNN Model Using Transfer Learning using Vgg 16, Resnet
HTML-код
- Опубликовано: 18 сен 2024
- Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
/ @krishnaik06
Github url: github.com/kri...
Please do subscribe my other channel too
/ @krishnaikhindi
Take the best online course on Data Science
www.appliedaic...
Connect with me here:
Twitter: / krishnaik06
facebook: / krishnaik06
Instagram: / krishnaik06
Sir, I salute for your comprehensive tutorial. You are a source of inspiration. Hats off to you.
You man are seriously legend. You deserve lot lot appreciation krish. Great fan of u.
That's true. My professor: Do it, I won't teach you!!! Give me the results next week!!! Some smart India guys on youtube: do this, do this ..... and then you get it!
You are doing a great work here. Keep it up.
Great content sir ....and wonderful explaination!!......can you please upload more videos on deployment of machine learning models as these are the areas nobody have such extensive tutorial about
Thank you so much for this tutorial! I think this is the best one on youtube so far!
Congratulations!
There is one mistake I made when doing my homework. And I wish you guys who see this comment will not make the same mistakes as I did. Be careful with function flow_from_directory(...), you need to make subdirectories for the files under your training folder or testing folder. For example, if you have three classes under the training folder, you need to make three folders. training/calss1/; training/class2/;training/class3/; If you put all files in one folder(like training/... or testing/...), it will return 0 classes. And your program will not work.
yes, keras documentation clearly explains this
But If our all dataset in one folder and folder contains image files and each image file has 3 labels names age, gender and ethnicity then what will do in that case?
You are the best keep doing
Hi Krish, I have watched some of your videos recently. I was amazed at your teaching techniques. You deserved a big thank you from me. However, I wonder if you have made any videos regarding Transfer learning using CNN (VGG16, VGG50, Alexnet, Resnet, Etc.) as a feature extractor and Classifiers (Random Forest, Decision tree, SVM, KNN, Naive Bayes, etc.) as a classifier for a multiclass classification problem and compare their performance in terms of Accuracy, Recall, F1 score, and precision?
this solved my entire problem . Really really helpful . sir how can we write code for predicting the outputs
Thanks man done my assignment, I pray that Allah give u guidance to Islam and bless u
If you get an error trying to plot the "accuracies" step near the end it is probably because there was a change in Keras release 2.3.0.
“Metrics and losses are now reported under the exact name specified by the user (e.g. if you pass metrics=[‘acc’], your metric will be reported under the string “acc”, not “accuracy”, and inversely metrics=[‘accuracy’] will be reported under the string “accuracy”.”
Just change:
plt.plot(r.history['acc'], label='train acc')
plt.plot(r.history['val_acc'], label='val acc')
for this:
plt.plot(r.history['accuracy'], label='train acc')
plt.plot(r.history['val_accuracy'], label='val_acc')
U are the reason to succeed in my scholarship year thanx
Great video.Thanks
For anyone having an issue in executing model.fit_generator() and it says shape value error: "shape incompatible", please check the "loss" attribute in model.compile and make it "sparse_categorical_crossentropy"
thanks a lot bro
hello bro is this script isn't outdated?
@@ahmedchammam6797 yep a bit as you can see my comment above for correction but I think Krish can’t help with that 😅 deprication of function is like aging of code with time
Can I know what data set are you using??? Great video
Krish Naik, I think you missed out on changing 'preprocess_input' function while explaining ResNet50 implementation.
It was so clear. Thank you.
Very useful video and well explained. Thanks Krish for the same.
Thank you for the excellent video Prof
You make it look so doable👍
Thank you so much
Thank u sir for this wonderful video😊
very thanks for you
thank you sir
huge respect from pakistan
Very simple and helpful
very useful tutorials sir
Great explanation 👏👏👏
Sir, I have a question
If our image size is small like 32, 32, 3
What would happen to the image if we are resizing it to 224, 224
Thank you so much 💗 i have successfully trained and integrate my cnn model with my django app locally on my system. i have a question how can i deploy my trained cnn model with django app on heroku do i need to make an API of model to serve django app on heroku? it will be really helpful if you can answer my question.
Really helpful video. Thank you!
a very helpful video sir..Stay blessed
very useful video. Thank yo sir!
Great video. Thanks 👍
Hello Krish, Fantastic videos fro beginners, please can u send any videos for creating our own dataset for satellite images.
very nice sir, thank you
What about including a confusion matrix?
I am a beginner to deep learning I want to ask you for example if I took alexnet as my pre-trained model and I only kept the first 2 conv without any modification, but the rest of the layers I did change it dose this consider transfer learning?!
changing rest layers means?? removing or changing weight?
Thanks
very good information....thank you
Hi Krish, wuld have been better if you would have provided us with your dataset also. basically the whole github repo
Thank you for your video but may I ask how to use this model? Like load some random image and see if the model is correct or not.
Fantastic
Awesome 💞
Thank you ! it is fantastic and important tutorial !! but can you show the confusion matrix ?
can you make a video on skin cancer classification ISIC2019.
@Krish Naik sir pls explain Google Net as well as Squeezenet
in 13:38 s you have to change the line 17 to form keras.application.resnet50 import preprocess_input
Thanks Krish
r = model.fit_generator(
training_set,
validation_data=test_set,
epochs=5,
steps_per_epoch=len(training_set),
validation_steps=len(test_set)
)
when it fit
'Tensor' object has no attribute 'assign' this is error
have you fixed that error ... I am causing that error too
Same error, do you have a solution?
change your tensorflow version
You have to load models and make the prediction too sir
why kernel size is always odd?
how backpropagation takes place in max-pooling?
There are no parameters in max pooling, so, i guess there is no effect of backpropagation on maxpooling layers.
In back propagation the value of the filters are updated in each epoch to minimize the loss. Hence if the weight are updated so is the output image of convolution layer. If the convolution image changes every epoch so is the max pooling .
Sir ,help me please? I was doing gray scale image classification using VGG16. their is an error when I update the code from
vgg = VGG16(input_shape=IMAGE_SIZE + [3], weights='imagenet', include_top=False) to
vgg = VGG16(input_shape=IMAGE_SIZE + [1], weights='imagenet', include_top=False). help me please
very knowledgable video...
can we use more than one pretrained model like vgg16 with reset etc...???
I have designed a multiplier and output is obtained for it. How to use this multiplier in CNN(the multiplication operation takes place between the inputs and filters in CNN), where to place the designed multiplier architecture in CNN.
Hi Krish, Pls make a video on Local Response Normalization used in Alexnet.
A great tutorial. Is it possible to use an independent model in Transfer Learning , other than the documented set from keras library?
Sir any guide video for using transfer learing in case of ViT
Thank you!!!
If we want to predict the class for a particular image then how to do it?
Great video. I have only one question to the community here. What the dimensions of the training and test images should be? Do they have to be 224*224 before the import into the algorithm or the user can set them (the dimensions) afterwards? Many thanks
Hi Nikolaos
The target size parameter in flow_from_directory handles it for you and standardizes all inputs to the required dimensions
Is transfer function in Ann diffrent from activation function
Without training the new data with VGG16 or ResNet how come the features got extracted simple using softmax function at the end of the previously trained neural network?
Great content sir , kindly provide the code with explanation for computing confusion matrix for resnet models
Hai krish sir..Thanks to share your knowledge and your videos are very helpfull to my research work ... and i have small doubt can please help me... for the above transfer learning code i run and save the diff models..,after saving the model in .h5 format is it possible to calculate performance metrics like precision, recall, f1-score, sensitivity and cf. If possible Please help me regarding this.
THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank u Sir !!
sir, could you help me out with image augmentation part. After applying image augmentation in train data do we get 4 times the number of image or just one augmented image?
Could you make an example of segmentation?
how to write a test func to load the saved model and test on new images?
Please help
I really like the way you explain your concepts but to be honest i amm really disappointed the way you have hurried up in video number 28 which is using vgg16 , firstly it took me a while to understand that i need to create a folder named dataset and i need to upload some images into it ,,, as you didnt mentioned that part also i am getting an error :'ProgbarLogger' object has no attribute 'log_values' when i am trying to run the model.fit_generator code cell and then i somehow googled that i need to set verbose=0 in that part and then i am getting a keyerror:'loss' , i would have really appreciated your much efforts if you could have run the code and shown us the output it really difficult for those who are really trying their hands on Deep Learning for the 1st time
good content
how to print classification report for the above code?
I have trained the model using this technique and while predicting it showing this error:
ValueError: `decode_predictions` expects a batch of predictions (i.e. a 2D array of shape (samples, 1000)). Found array with shape: (1, 31)
Please help
I have question, what if we want to use Alexnet for transer learning? what should write?
Sir
I have a 1000 classes to train the VGG16 network, but I am not able to train it in a single attempt. I want to train the image with 100 classes and aging using the new weight I need to train again. What shall I do?
Sir, how can I use stratified cross validation and label encoding in the vgg16 model given in video??
Hello sir , Can you please make a video about GAN,s ,its implementation
can please add confusion matrix and ROC curve after transfer learning CNN model
Should we create 4 sub-folders under "test" folder as well?
can keras be imported in pytorch model?
What if the input images are not of size [224,224] and are [32,32]. How can I change the input image size to fit this model?
how to covert picture from fashion mnist size 28x28 to 32x32x3
how many images have you taken in your train and test set??? and how many folders are there in your test folder???
sir, i want to ask. how to use this model after we save?
setting image size+ [1] does not work for black and white images ! how do I solve that?
directly give -> (224,224,1)
why are we removing the last layer 3 of vgg16 that is include_top=False
is their any video lecture how to use transfer learning in mask rcnn? Or any video lecture how to develop mask rcnn from scratch using images?
How to fuse features from multiple deep learning model
hey Krish could you like maybe post a video as to how to import and use data sets used for cnns and image classification in Colab? Because it is not a simple csv file and has different folders so accessing and using them is hard. Would really help as other tutorials only use cifar and mnist which are already pre loaded into keras. So yeah!!
It is not that hard, You just watch his video 'ruclips.net/video/Gvwuyx_F-28/видео.html'
can you explain soaftmax?
Hi Krish,
A small query, if we were to train VGG16 from scratch for whatsoever reason, then the line layer.trainable should be True, right?
They are true by default.
Hello Sir, I am doing experiment by using this model and datasets is (cats and dogs) downloaded from kaggle all things are same... but i am not getting accuracy more than 50% on VGG16 model please give me some suggestion thanks
the Train set has images but what is inside the Test set?? how did u divide it?
Sir, is it possible to use transfer learning for recommendation system?
my professor wants me to extract the weight values is there a way to do that? IM pretty new to this.
Please post a video with pretrained AlexNet
Sir, I am getting the following error:-
File "C:\Users\Ammu\TL\face_Recognition.py", line 91, in
plt.plot(r.history['val_loss'], label='val loss')
KeyError: 'val_loss'
Same!!!
Plz share the predicted source code that show predicted image as output based on classification.I am working on the Diabetic retinopathy detection project i need only prediction code.Plz help me out.
it is great explanation, i just wondering about one thing here i seen some videos they used MobileNet of Keras on image classification , so
what is the difference b/w CNN code and MobileNet code ?
can we do Dog & cat classification by using MobileNet ?
Yes, you can do Classification by MobileNet. It requires less computational power for giving outputs.