Tutorial 28- Create CNN Model Using Transfer Learning using Vgg 16, Resnet
HTML-код
- Опубликовано: 28 дек 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!
Thank you so much for this tutorial! I think this is the best one on youtube so far!
Congratulations!
You are doing a great work here. Keep it up.
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?
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
U are the reason to succeed in my scholarship year thanx
You are the best keep doing
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
Thank u sir for this wonderful video😊
It was so clear. Thank you.
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?
You make it look so doable👍
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')
Great explanation 👏👏👏
Very useful video and well explained. Thanks Krish for the same.
very useful tutorials sir
very useful video. Thank yo sir!
in 13:38 s you have to change the line 17 to form keras.application.resnet50 import preprocess_input
Thank you for the excellent video Prof
very nice sir, thank you
Very simple and helpful
Thanks Krish
thank you sir
huge respect from pakistan
a very helpful video sir..Stay blessed
Great video.Thanks
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
Great video. Thanks 👍
Krish Naik, I think you missed out on changing 'preprocess_input' function while explaining ResNet50 implementation.
Hello Krish, Fantastic videos fro beginners, please can u send any videos for creating our own dataset for satellite images.
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.
Can I know what data set are you using??? Great video
What about including a confusion matrix?
If we want to predict the class for a particular image then how to do it?
Awesome 💞
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
Really helpful video. Thank you!
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.
Should we create 4 sub-folders under "test" folder as well?
Fantastic
Hi Krish, wuld have been better if you would have provided us with your dataset also. basically the whole github repo
A great tutorial. Is it possible to use an independent model in Transfer Learning , other than the documented set from keras library?
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?
very thanks for you
very good information....thank you
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.
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?
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 .
Is transfer function in Ann diffrent from activation function
very knowledgable video...
can we use more than one pretrained model like vgg16 with reset etc...???
Where have you provided labels for your images?
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?
I have question, what if we want to use Alexnet for transer learning? what should write?
@Krish Naik sir pls explain Google Net as well as Squeezenet
how to print classification report for the above code?
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
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.
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?
can keras be imported in pytorch model?
how to write a test func to load the saved model and test on new images?
Please help
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
how many images have you taken in your train and test set??? and how many folders are there in your test folder???
the Train set has images but what is inside the Test set?? how did u divide it?
sir, i want to ask. how to use this model after we save?
can you make a video on skin cancer classification ISIC2019.
Thank you ! it is fantastic and important tutorial !! but can you show the confusion matrix ?
Sir any guide video for using transfer learing in case of ViT
You have to load models and make the prediction too sir
From where you get dataset
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
Sir, how can I use stratified cross validation and label encoding in the vgg16 model given in video??
How do we get the dataset?
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
why are we removing the last layer 3 of vgg16 that is include_top=False
Sir
How can we apply transfer learning for numerical data?
Thank you so much
Can we use these models for text polarity classification??
my professor wants me to extract the weight values is there a way to do that? IM pretty new to this.
As I increase the data my accuracy decreases for ResNet50 ...any suggestions
Hi Krish, Pls make a video on Local Response Normalization used in Alexnet.
I had a query that if we are using Transfer learning technique then what is the need of data augmentation... I mean the model is already trained.. Why are we training again?
Data augmentation works on your custom data ie your input-images to create a larger dataset by flipping/translation etc. DA does not alter the architecture or hyperparameters of the model. Also, we are not doing any training here...
@@ananthasrao7600 So if we are not training anything what is the point of having a large train data set... infact why do we need a train data set . I am new to DL, please answer this query
Hi Sir, can I use same code for classification for WISDM dataset for human activity recognition?
Please can you suggest articles or papers for this topic
sir how to load the dataset if it is not available already in the Keras or TensorFlow library.
First Upload the dataset in your google drive and then copypath
@@monikasethi1768 thanks for the help. I got it..😀
Hi, how do I create a confusion matrix from here?
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?
setting image size+ [1] does not work for black and white images ! how do I solve that?
directly give -> (224,224,1)
Great content sir , kindly provide the code with explanation for computing confusion matrix for resnet models
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.
good content
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.
can please add confusion matrix and ROC curve after transfer learning CNN model
Where are FC1 and FC2 layers as they present in VGG16 ?
how to covert picture from fashion mnist size 28x28 to 32x32x3
Where is the dataset???
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!!!
Hello sir , Can you please make a video about GAN,s ,its implementation
How to fuse features from multiple deep learning model