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

Комментарии • 194

  • @karmawangchuk283
    @karmawangchuk283 4 года назад +17

    Sir, I salute for your comprehensive tutorial. You are a source of inspiration. Hats off to you.

  • @abutareqrony4513
    @abutareqrony4513 Год назад +1

    You man are seriously legend. You deserve lot lot appreciation krish. Great fan of u.

  • @luq2337
    @luq2337 4 года назад +41

    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!

  • @samueladoun2989
    @samueladoun2989 4 года назад +8

    You are doing a great work here. Keep it up.

  • @AmanKumarSharma-de7ft
    @AmanKumarSharma-de7ft 4 года назад +9

    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

  • @caiohenrique-bg1pp
    @caiohenrique-bg1pp 2 года назад

    Thank you so much for this tutorial! I think this is the best one on youtube so far!
    Congratulations!

  • @luq2337
    @luq2337 4 года назад +23

    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.

    • @subithamohanps
      @subithamohanps 3 года назад

      yes, keras documentation clearly explains this

    • @zunairanaseem4088
      @zunairanaseem4088 4 месяца назад

      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?

  • @carlosfotsing6779
    @carlosfotsing6779 4 года назад +2

    You are the best keep doing

  • @bigghostshadowchannel3955
    @bigghostshadowchannel3955 Год назад +2

    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?

  • @varunraj5543
    @varunraj5543 Год назад +1

    this solved my entire problem . Really really helpful . sir how can we write code for predicting the outputs

  • @EverlastingsSlave
    @EverlastingsSlave 3 года назад

    Thanks man done my assignment, I pray that Allah give u guidance to Islam and bless u

  • @matcarpes
    @matcarpes Год назад

    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')

  • @andrestiti9698
    @andrestiti9698 3 года назад

    U are the reason to succeed in my scholarship year thanx

  • @sandipansarkar9211
    @sandipansarkar9211 4 года назад +1

    Great video.Thanks

  • @RahulKumar-qo2ce
    @RahulKumar-qo2ce 2 года назад +3

    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"

    • @FanaticAuthorship
      @FanaticAuthorship Год назад

      thanks a lot bro

    • @ahmedchammam6797
      @ahmedchammam6797 Год назад

      hello bro is this script isn't outdated?

    • @RahulKumar-qo2ce
      @RahulKumar-qo2ce Год назад

      @@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

  • @ayushminanayak5352
    @ayushminanayak5352 4 года назад +2

    Can I know what data set are you using??? Great video

  • @japeshmethuku9223
    @japeshmethuku9223 4 года назад +1

    Krish Naik, I think you missed out on changing 'preprocess_input' function while explaining ResNet50 implementation.

  • @alirezaparsay8518
    @alirezaparsay8518 Год назад

    It was so clear. Thank you.

  • @jaikishank
    @jaikishank 3 года назад

    Very useful video and well explained. Thanks Krish for the same.

  • @stephentidi7320
    @stephentidi7320 3 года назад

    Thank you for the excellent video Prof

  • @Raj-sz9pg
    @Raj-sz9pg 2 года назад

    You make it look so doable👍

  • @subrinanaureen399
    @subrinanaureen399 Год назад

    Thank you so much

  • @shivangbhardwaj51
    @shivangbhardwaj51 Год назад

    Thank u sir for this wonderful video😊

  • @mh1630
    @mh1630 2 года назад

    very thanks for you

  • @syedrehman5755
    @syedrehman5755 3 года назад

    thank you sir
    huge respect from pakistan

  • @bhupendrasingh59
    @bhupendrasingh59 3 года назад

    Very simple and helpful

  • @sohailahmaddes
    @sohailahmaddes 2 года назад

    very useful tutorials sir

  • @djibrildassebe4327
    @djibrildassebe4327 2 года назад

    Great explanation 👏👏👏

  • @achintya-7
    @achintya-7 3 года назад +2

    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

  • @hashamfaridy8152
    @hashamfaridy8152 4 года назад +2

    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.

  • @HashanDananjaya
    @HashanDananjaya 3 года назад

    Really helpful video. Thank you!

  • @syedmuhammadusmanghani9220
    @syedmuhammadusmanghani9220 4 года назад

    a very helpful video sir..Stay blessed

  • @sapnilpatel1645
    @sapnilpatel1645 Год назад

    very useful video. Thank yo sir!

  • @vibesnovibes6320
    @vibesnovibes6320 3 года назад

    Great video. Thanks 👍

  • @shreearmygirl9878
    @shreearmygirl9878 2 года назад

    Hello Krish, Fantastic videos fro beginners, please can u send any videos for creating our own dataset for satellite images.

  • @learn2know927
    @learn2know927 2 года назад

    very nice sir, thank you

  • @raghavkandhari1838
    @raghavkandhari1838 3 года назад +1

    What about including a confusion matrix?

  • @layallayal2761
    @layallayal2761 4 года назад +2

    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?!

  • @tilkesh
    @tilkesh 2 года назад

    Thanks

  • @thevivekmathema
    @thevivekmathema 4 года назад

    very good information....thank you

  • @taruarora7500
    @taruarora7500 2 месяца назад

    Hi Krish, wuld have been better if you would have provided us with your dataset also. basically the whole github repo

  • @FaczutMon
    @FaczutMon 4 года назад +2

    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.

  • @venkateshsurampally8915
    @venkateshsurampally8915 3 года назад

    Fantastic

  • @unemployedcse3514
    @unemployedcse3514 3 года назад

    Awesome 💞

  • @mele1314
    @mele1314 3 года назад

    Thank you ! it is fantastic and important tutorial !! but can you show the confusion matrix ?

  • @swatimishra1555
    @swatimishra1555 Год назад +1

    can you make a video on skin cancer classification ISIC2019.

  • @anshikachoudhary4134
    @anshikachoudhary4134 3 года назад

    @Krish Naik sir pls explain Google Net as well as Squeezenet

  • @lotfimerad658
    @lotfimerad658 2 года назад

    in 13:38 s you have to change the line 17 to form keras.application.resnet50 import preprocess_input

  • @louerleseigneur4532
    @louerleseigneur4532 3 года назад

    Thanks Krish

  • @parimalakhenia9528
    @parimalakhenia9528 4 года назад +2

    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

    • @prabhatale1135
      @prabhatale1135 4 года назад +2

      have you fixed that error ... I am causing that error too

    • @vasusharma1773
      @vasusharma1773 4 года назад

      Same error, do you have a solution?

    • @UsamaChishti
      @UsamaChishti 4 года назад +2

      change your tensorflow version

  • @sahajrajmalla
    @sahajrajmalla 2 года назад

    You have to load models and make the prediction too sir

  • @lakshmitejaswi7832
    @lakshmitejaswi7832 4 года назад +2

    why kernel size is always odd?
    how backpropagation takes place in max-pooling?

    • @hardikkamboj3528
      @hardikkamboj3528 4 года назад

      There are no parameters in max pooling, so, i guess there is no effect of backpropagation on maxpooling layers.

    • @jagdishjazzy
      @jagdishjazzy 4 года назад

      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 .

  • @alexomelak4200
    @alexomelak4200 6 месяцев назад

    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

  • @priyankapradhan4539
    @priyankapradhan4539 4 года назад

    very knowledgable video...
    can we use more than one pretrained model like vgg16 with reset etc...???

  • @lavanyamaddisetty
    @lavanyamaddisetty 4 года назад

    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.

  • @poonamanand9011
    @poonamanand9011 4 года назад

    Hi Krish, Pls make a video on Local Response Normalization used in Alexnet.

  • @global4069
    @global4069 2 года назад

    A great tutorial. Is it possible to use an independent model in Transfer Learning , other than the documented set from keras library?

  • @Alphaz-db8vc
    @Alphaz-db8vc Месяц назад

    Sir any guide video for using transfer learing in case of ViT

  • @navjiwanhira3888
    @navjiwanhira3888 3 года назад

    Thank you!!!

  • @tulsichopade
    @tulsichopade 2 года назад

    If we want to predict the class for a particular image then how to do it?

  • @nikolaostziokas6847
    @nikolaostziokas6847 3 года назад

    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

    • @subratsaxena9767
      @subratsaxena9767 2 года назад +1

      Hi Nikolaos
      The target size parameter in flow_from_directory handles it for you and standardizes all inputs to the required dimensions

  • @purushothamkothakota4327
    @purushothamkothakota4327 2 года назад

    Is transfer function in Ann diffrent from activation function

  • @ladiharish7843
    @ladiharish7843 3 года назад

    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?

  • @dr.d.vetrithangam5787
    @dr.d.vetrithangam5787 2 года назад

    Great content sir , kindly provide the code with explanation for computing confusion matrix for resnet models

  • @SIMHADRICHINNAGOPIPHD
    @SIMHADRICHINNAGOPIPHD Год назад

    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.

  • @yasminekhemiri6221
    @yasminekhemiri6221 4 года назад

    THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @SurajVerma-rh9xi
    @SurajVerma-rh9xi 4 года назад

    Thank u Sir !!

  • @bhavukthakur9501
    @bhavukthakur9501 2 года назад

    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?

  • @segundojaramilloromero9909
    @segundojaramilloromero9909 4 года назад +1

    Could you make an example of segmentation?

  • @karthikarumugam9905
    @karthikarumugam9905 9 месяцев назад

    how to write a test func to load the saved model and test on new images?
    Please help

  • @akhilsharma4004
    @akhilsharma4004 4 года назад +1

    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

  • @sharatchandra2045
    @sharatchandra2045 4 года назад

    good content

  • @RAZZKIRAN
    @RAZZKIRAN Год назад

    how to print classification report for the above code?

  • @sahajrajmalla
    @sahajrajmalla 2 года назад

    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

  • @mrmystery-jz2ev
    @mrmystery-jz2ev 3 года назад

    I have question, what if we want to use Alexnet for transer learning? what should write?

  • @sumagopan8730
    @sumagopan8730 Год назад

    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?

  • @tirthadatta7368
    @tirthadatta7368 2 года назад

    Sir, how can I use stratified cross validation and label encoding in the vgg16 model given in video??

  • @anantgoyal7297
    @anantgoyal7297 3 года назад

    Hello sir , Can you please make a video about GAN,s ,its implementation

  • @tejaswinicode
    @tejaswinicode Год назад

    can please add confusion matrix and ROC curve after transfer learning CNN model

  • @manalisingh1128
    @manalisingh1128 2 года назад

    Should we create 4 sub-folders under "test" folder as well?

  • @amruthgadag4813
    @amruthgadag4813 Год назад

    can keras be imported in pytorch model?

  • @punkster36
    @punkster36 4 года назад

    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?

  • @babaabba9348
    @babaabba9348 3 года назад

    how to covert picture from fashion mnist size 28x28 to 32x32x3

  • @mapytekh
    @mapytekh 3 года назад

    how many images have you taken in your train and test set??? and how many folders are there in your test folder???

  • @randyansyah1851
    @randyansyah1851 Год назад

    sir, i want to ask. how to use this model after we save?

  • @seanrodrigues1842
    @seanrodrigues1842 Год назад

    setting image size+ [1] does not work for black and white images ! how do I solve that?

  • @divyarajvs8890
    @divyarajvs8890 3 года назад

    why are we removing the last layer 3 of vgg16 that is include_top=False

  • @sweeten5878
    @sweeten5878 4 года назад

    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?

  • @surajpatil4815
    @surajpatil4815 2 года назад

    How to fuse features from multiple deep learning model

  • @MithileshDSCS
    @MithileshDSCS 4 года назад

    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!!

    • @vasusharma1773
      @vasusharma1773 4 года назад

      It is not that hard, You just watch his video 'ruclips.net/video/Gvwuyx_F-28/видео.html'

  • @enquiryadmin8326
    @enquiryadmin8326 4 года назад +1

    can you explain soaftmax?

  • @DIYGUY999
    @DIYGUY999 4 года назад

    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?

  • @zahidrasheed5273
    @zahidrasheed5273 4 года назад

    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

  • @Twilight2595
    @Twilight2595 4 года назад

    the Train set has images but what is inside the Test set?? how did u divide it?

  • @PranavKumar-yn1sw
    @PranavKumar-yn1sw 2 года назад

    Sir, is it possible to use transfer learning for recommendation system?

  • @yepnah3514
    @yepnah3514 3 года назад

    my professor wants me to extract the weight values is there a way to do that? IM pretty new to this.

  • @ameentendolkar4430
    @ameentendolkar4430 3 года назад

    Please post a video with pretrained AlexNet

  • @artificialintelligenceengi6125
    @artificialintelligenceengi6125 3 года назад

    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'

  • @muhammadafzaalkhan9277
    @muhammadafzaalkhan9277 3 года назад

    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.

  • @dkishore599
    @dkishore599 4 года назад

    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 ?

    • @Roodyculous
      @Roodyculous 4 года назад

      Yes, you can do Classification by MobileNet. It requires less computational power for giving outputs.