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

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

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

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

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

  • @samueladoun2989
    @samueladoun2989 5 лет назад +8

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

  • @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 4 года назад

      yes, keras documentation clearly explains this

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

      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?

  • @AmanKumarSharma-de7ft
    @AmanKumarSharma-de7ft 5 лет назад +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

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

    U are the reason to succeed in my scholarship year thanx

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

    You are the best keep doing

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

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

    Thank u sir for this wonderful video😊

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

    It was so clear. Thank you.

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

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

    You make it look so doable👍

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

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

    Great explanation 👏👏👏

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

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

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

    very useful tutorials sir

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

    very useful video. Thank yo sir!

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

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

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

    Thank you for the excellent video Prof

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

    very nice sir, thank you

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

    Very simple and helpful

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

    Thanks Krish

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

    thank you sir
    huge respect from pakistan

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

    a very helpful video sir..Stay blessed

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

    Great video.Thanks

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

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

    Great video. Thanks 👍

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

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

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

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

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

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

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

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

    What about including a confusion matrix?

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

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

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

    Awesome 💞

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

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

    Really helpful video. Thank you!

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

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

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

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

    Fantastic

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

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

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

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

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

    very thanks for you

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

    very good information....thank you

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

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

  • @lakshmitejaswi7832
    @lakshmitejaswi7832 5 лет назад +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 .

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

    Is transfer function in Ann diffrent from activation function

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

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

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

    Where have you provided labels for your images?

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

    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?

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

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

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

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

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

    how to print classification report for the above code?

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

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

    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.

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

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

    can keras be imported in pytorch model?

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

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

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

    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

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

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

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

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

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

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

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

    can you make a video on skin cancer classification ISIC2019.

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

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

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

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

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

    You have to load models and make the prediction too sir

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

    From where you get dataset

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

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

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

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

    How do we get the dataset?

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

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

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

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

    Sir
    How can we apply transfer learning for numerical data?

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

    Thank you so much

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

    Can we use these models for text polarity classification??

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

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

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

    As I increase the data my accuracy decreases for ResNet50 ...any suggestions

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

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

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

    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?

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

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

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

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

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

    Hi Sir, can I use same code for classification for WISDM dataset for human activity recognition?

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

    Please can you suggest articles or papers for this topic

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

    sir how to load the dataset if it is not available already in the Keras or TensorFlow library.

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

      First Upload the dataset in your google drive and then copypath

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

      @@monikasethi1768 thanks for the help. I got it..😀

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

    Hi, how do I create a confusion matrix from here?

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

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

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

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

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

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

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

    good content

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

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

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

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

    Where are FC1 and FC2 layers as they present in VGG16 ?

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

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

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

    Where is the dataset???

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

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

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

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

    How to fuse features from multiple deep learning model