Tips Tricks 20 - Understanding transfer learning for different size and channel inputs

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ม.ค. 2025

ความคิดเห็น • 113

  • @mariovrpereira
    @mariovrpereira 2 ปีที่แล้ว +3

    your content is fantastic and puts together some pieces that sometimes get scattered during learning. thank you so much for all your videos

  • @kennethm.4998
    @kennethm.4998 2 หลายเดือนก่อน

    Dude... you're a phenomenal teacher. Superb kind sir!

    • @DigitalSreeni
      @DigitalSreeni  หลายเดือนก่อน

      Thank you so much!

  • @climbscience4813
    @climbscience4813 ปีที่แล้ว

    The thorough explanation is much appreciated! I think that this is not only for those with gaps in the basics, but also for people really trying to understand the details. Thumbs up!

  • @manuelsteele7755
    @manuelsteele7755 4 หลายเดือนก่อน

    I have taken a couple of college courses in deep learning, and the course material goes so fast that details like this are missed. This video is excellent for truly understanding those parameters of deep learning present in the many layers of CNN. I am studying for a PhD in AI/ML at Arizona State. Thank you.

  • @falolayusuf9684
    @falolayusuf9684 ปีที่แล้ว

    Excellent video. You are doing great! Starting from the basics really helped with understanding.

  • @wasiurrahaman7242
    @wasiurrahaman7242 ปีที่แล้ว

    Allah may bless you sir. I having watching your videos last 6 months, your teaching methode is so beautiful and very simple. Please make such video where we can learn from you.

  • @nagabilwanth5969
    @nagabilwanth5969 2 ปีที่แล้ว

    Thanks for sharing the example to calculate the weights for 9 channels. This shows, you're sharing all your experience by making the video. I really appreciate it. Thank you.

  • @theping1920
    @theping1920 3 ปีที่แล้ว

    this channel is underrated thanks sir for helping me through rough exams of my university. lots of love from Germany

  • @Sehmiconductor
    @Sehmiconductor 2 ปีที่แล้ว

    Thank you for these videos. Currently I am in PGDBDA program by CDAC, Bangalore and was facing doubts in image processing section of deep learning. These videos helped me alot.

  • @vivek-159-icd
    @vivek-159-icd 2 ปีที่แล้ว

    Such a nice video, sir, even if the longer videos we are ready to see because the content is so beautiful.
    Thanks

  • @jacobusstrydom7017
    @jacobusstrydom7017 3 ปีที่แล้ว

    Thanks!

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว

      Thank you Jacobus for your contribution, really appreciate it. Please keep watching.

  • @HashanDananjaya
    @HashanDananjaya 2 หลายเดือนก่อน

    Thank you very much! Learned a lot from this! Really with this had a PyTorch version!

  • @chitti9974
    @chitti9974 2 ปีที่แล้ว

    very informative, best explanation with code execution. Thanks a lot Mr. Sreeni

  • @maddybharathi
    @maddybharathi 3 ปีที่แล้ว +1

    Thank you very much. Beautifully explained.

  • @oroszgabi
    @oroszgabi 2 ปีที่แล้ว +1

    Dear Dr. Sreeni! Excellent, as always! Could You explain how this methos works with other keras.apllications (e.g. ResNet, Inception, Xception, Mobilenet)? Are there any extra steps? Thanks for You kind answer!

  • @Omar_Deepvision
    @Omar_Deepvision หลายเดือนก่อน

    You are the one. I wish you all good.
    I hope I can find a video of you about swin transform , transfer learning. while weights are represented in pytorch and the network is also are not in tensorflow applications. Also, it could not be used in TPU unless the weights format is converted into tensorflow weights.

  • @kyawnaingwin8300
    @kyawnaingwin8300 3 ปีที่แล้ว

    Thanks you. It enlightens me how I can control transfer learning according to my needs.

  • @ksa2011kify
    @ksa2011kify 2 ปีที่แล้ว

    Thank you for sharing this informative video. Well done for getting to the point.🙏

  • @feeham
    @feeham 3 ปีที่แล้ว

    Really appreciate your effort to explain this all. Thanks a lot.

  • @hemasowjanyamamidi6123
    @hemasowjanyamamidi6123 3 ปีที่แล้ว

    Thank you so much for the detailed explanation Sir. I look forward to more such videos in future.

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว

      Keep watching

    • @hemasowjanyamamidi6123
      @hemasowjanyamamidi6123 3 ปีที่แล้ว

      @@DigitalSreeni Sure..! Suppose I am using mnist dataset whose image size is 28x28 then the updated vgg16 model for 1 channel is giving error
      #
      Negative dimension size caused by subtracting 2 from 1 for '{{node block5_pool/MaxPool}} = MaxPool[T=DT_FLOAT, data_format="NHWC", explicit_paddings=[], ksize=[1, 2, 2, 1], padding="VALID", strides=[1, 2, 2, 1]](Placeholder)' with input shapes: [?,1,1,512].
      #
      Is there any way to resolve this without changing the congiguration of layers in the model?

  • @jacobusstrydom7017
    @jacobusstrydom7017 3 ปีที่แล้ว

    Great explanation. Thanks for the hard work you put in to the videos.

  • @plyap3872
    @plyap3872 3 ปีที่แล้ว +1

    Thanks Sreeni for a very timely tutorial. I was figuring out how to use VGGNet to train my audio melspectrograms which has only a single layer.

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว

      Great to hear!

    • @idrisseahamadiabdallah7669
      @idrisseahamadiabdallah7669 2 ปีที่แล้ว

      did it work for you ?

    • @plyap3872
      @plyap3872 2 ปีที่แล้ว +1

      @@idrisseahamadiabdallah7669 The features extracted from VGGNet not very good for audio spectrograms. Not good results.

  • @PerryBattles
    @PerryBattles 5 หลายเดือนก่อน

    Brilliant video! Question: why do we not need to update the parameter count/shape of the subsequent convolution layers if we reconfigure for a 1-channel image? Wouldn't those other convolution layers also have separate kernels for the different channels of input they receive? Do the subsequent convolution layers not have separate kernels for separate channels?

  • @somalifairytales9365
    @somalifairytales9365 11 หลายเดือนก่อน

    well explained sir, thanks for your time

  • @NutSorting
    @NutSorting ปีที่แล้ว

    very helpful video, sir what if we have train and test data set with different image dimensions?

  • @amritasingh8953
    @amritasingh8953 2 ปีที่แล้ว

    Thank you so much Sir...can I add new layer in the middle of network which takes previous layers weight . i am using pytorch

  • @Mohomedbarakat
    @Mohomedbarakat 3 ปีที่แล้ว

    A wonderful video as usual!. Thanks a lot

  • @jamescallanan6370
    @jamescallanan6370 2 ปีที่แล้ว

    Thank you. Unreal tutorial :)

  • @KashifShaheed
    @KashifShaheed 3 ปีที่แล้ว

    Great informative video , Thank You.
    Sir, I have a question
    If we only change the input layer shape to a single Channel. Could we used the same weight of pre-trained model for single channel or do we must update the weight for our modified model? Please, Sir clear my doubt.

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว

      If your question is going from 3 channel to single channel image, you can pick a single channel from the original model or average the 3 channels.

    • @KashifShaheed
      @KashifShaheed 3 ปีที่แล้ว

      @@DigitalSreeni yes. Sir. I mean to take the average of 3 channels and used as a single channel in new modified model. So that we can use for grayscale (single channel images). But, I think going from 3 to 1 channel directly using original model may be we will got error input size not matched.

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว +1

      Please watch this video, this is exactly what I covered.

  • @Travellogy110
    @Travellogy110 4 หลายเดือนก่อน

    Also i want to use two image pairs for camera pose estimation so i want to combine both image channels i mean 3 channel from one and 3 channel from other image ..is it will work as you demonstrate for 9 channel

  • @nelbn
    @nelbn 2 ปีที่แล้ว

    Great video! Very useful!

  • @RanjitKumarMahto-s9f
    @RanjitKumarMahto-s9f ปีที่แล้ว

    Thanks for such a great video. I tried to achieve the same for ResNet101 by updating the weights of 3rd layer(which is the first convolutional layer). But it doesn't seem to work as the updated model is giving some weird accuracy. Can someone please point out what I am missing here

  • @LAKXx
    @LAKXx 3 ปีที่แล้ว

    Very helpful ! Thank you good sir

  • @idrisseahamadiabdallah7669
    @idrisseahamadiabdallah7669 2 ปีที่แล้ว

    nice video, thanks for sharing. By using the technique I can implement Resnet, AlexNet, ect... . right ?

  • @leonatay248
    @leonatay248 2 ปีที่แล้ว

    Thank you sir. How do we preprocess it before feeding it to transfer learning models?

  • @zohaibrafique987
    @zohaibrafique987 2 ปีที่แล้ว

    Great Video, Can you please add a video for video classification using transfer learning?

  • @mwurzer123
    @mwurzer123 2 ปีที่แล้ว

    great work, thank you for taking the time to make a 47 mins video instead of 15, while keeping up the quality! did you publish any papers concerning satellite imagery? greetings from hamburg

  • @azamatjonmalikov9553
    @azamatjonmalikov9553 3 ปีที่แล้ว

    Amazing content as usual, well done :)

  • @sophiez7952
    @sophiez7952 ปีที่แล้ว

    thanks! if I have a css file and I have 15 rows by 24 columns, which means 15*24*1, one channel, can I still apply vgg16 model without making width and height equal ? thanks!

  • @akashmahale7659
    @akashmahale7659 ปีที่แล้ว

    hello sir, I have a numeric dataset of a crop and i want to perform transfer learning and do prediction can please guide me through it
    thank you sir, waiting for your reply

  • @oluwaseyibello5647
    @oluwaseyibello5647 2 ปีที่แล้ว

    Thanks for the video. This is great video with simple explanation. In a case you encounter unable to allocate 7.8Gib with shape (224, 224, 3). How do we solve it?

  • @liou8493
    @liou8493 2 ปีที่แล้ว

    Hey Sreeni! Great videos as always! Your video on the VGG+XGBoost was a lifesaver for me! I was wondering how this would work if I had a sequence of say 9 grayscale images as input for the VGG16 model? Thank you so much!

  • @Kpop11144
    @Kpop11144 9 หลายเดือนก่อน

    sir i'm using densenet201 for training my model . my input images of size 224x224x1 but the input layer accept only of size 224x224x3 . how to solve this issue and suggest some solution

  • @falahfakhri2729
    @falahfakhri2729 3 ปีที่แล้ว

    Tremendous thanks, My question is, Is it possible to take the average of pretrained model to the UNet model?, Or this works only for the same pretrained model with the updated weights according to our input data, channels in this case?

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว +1

      You can transfer weights from anywhere as long as the shapes match.

  • @aarifansari9097
    @aarifansari9097 2 ปีที่แล้ว

    thank u, sir. very helpful video

  • @bijulijin812
    @bijulijin812 3 ปีที่แล้ว

    Is it possible to add more channels VGG model? If possible what could be the weights of new channel? may be we need to manually add random weights

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว

      This video exactly addresses your question.

  • @jorgefelipegaviriafierro705
    @jorgefelipegaviriafierro705 3 ปีที่แล้ว

    I did this for 4 channels based on CWT (continous wavelet transformed) data obtained of several sensor measurements, but the performance of resnet50 and vgg16 has been quite poor :/ .... any ideas of why? maybe the features that the pretrained model stracted from imagenet are not good for cwt... seems unlikely right? I will keep trying to change the lr and the optimizer. I even removed one channel and leave the resnet as it is, with no great results.
    Great video btw, thanks.

  • @MuhammadKhan-zu6fx
    @MuhammadKhan-zu6fx ปีที่แล้ว

    I like your great explanation. One request, can you please give number to all your videos. it will help to watch all videos in a sequence. Thanks

  • @minhajulhoque2113
    @minhajulhoque2113 2 ปีที่แล้ว

    Great video!

  • @chaitanyasharma6270
    @chaitanyasharma6270 2 ปีที่แล้ว

    what changes would i have to make for resnet50?works fine for xception

  • @mohammadmasum4483
    @mohammadmasum4483 3 ปีที่แล้ว

    amazing tutorial. Just to the point. You use square shape images (i.e. 1024 * 1024), however, can we use the same technique for non-square images, for instance, 3500 * 1500?

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว +2

      Can be any shape, not just square.

  • @SoulfulConnections9514
    @SoulfulConnections9514 ปีที่แล้ว

    Please sir I want your reply it's really important
    If we change the model architecture just by adding layers which also have learnable weights then how can we use the original model weights in this modified model

  • @giussepi
    @giussepi 3 ปีที่แล้ว

    Amazing content! thanks a lot for sharing :)

  • @hemanshshridhar
    @hemanshshridhar ปีที่แล้ว

    Great content Sir but i have a doubt whenever i use the vgg_updated as base_model i get the graph execution error sayingCudnn graph failed to build: UNKNOWN: CUDNN_STATUS_BAD_PARAM in tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc(3760): 'conv_op' CUDNN_BACKEND_OPERATION: cudnnFinalize Failed [[{{node sequential/vgg16/block1_conv1/Relu}}]] [Op:__inference_train_function_2696] .......... how to fix this any ideas ?

  • @konstantinossardelis6023
    @konstantinossardelis6023 ปีที่แล้ว

    to input a 9 channel image, can't you just add a convolutional layer with 3 filters on top of the pretrained model ?

  • @shanthisundar7773
    @shanthisundar7773 ปีที่แล้ว

    Excellent

  • @samiulbasirrajib3038
    @samiulbasirrajib3038 2 ปีที่แล้ว

    How the output shape changes to 224*224 from 224*224?

  • @fraoney
    @fraoney 3 ปีที่แล้ว

    great videos. i hope you can make a video on object detection using CNN with HOG and linear SVM classifier

  • @LAKXx
    @LAKXx 3 ปีที่แล้ว

    This is probably a dumb question, but why did you use flatten instead of gavaragepooling before the dense layers ?

  • @kamaleshkarthi8586
    @kamaleshkarthi8586 3 ปีที่แล้ว

    Really nice video.....can we do it in yolo v4 model?

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว

      Probably, I haven't done it myself.

    • @kamaleshkarthi8586
      @kamaleshkarthi8586 3 ปีที่แล้ว

      @@DigitalSreeni one more question if you're free answer me without fail....
      Case 1: I trained a yolo v4 model with two classes. Now i has to train same model with adding another two classes. Train the model without losses of previous two classes weight...is this possible.
      My answer : reserving extra node in output layer. Can i do this?
      Your answer for case1 :
      Case 2 :
      Dataset description: 4k images with two classes and balanced classes. Using this data set i trained two model using tiny-yolov4.
      My question is:
      Model 1 : trained all 4k images. 20k max_batches . getting 84% accuracy avg loss 0.12xxx
      Model 2:
      Cycle 1 :i trained 3k images with 20k max_batch getting 94% accuracy.
      Cycle 2 : i trained 1k images with 20k max batch using last weight of cycle 1. After completion i am getting 94% accuracy. And avg loss 0.0xx.
      My question is both the model i trained same set of images why result is different. Training small set of image is good?
      Even though i increased model 20k+20k max batch thare is no improvement.
      Note: cfg file are same for both model.
      Thanks and regards,
      Kamalesh
      kamaleshkarthi14@gmail.com

  • @learnopticalandmicrowavere7647
    @learnopticalandmicrowavere7647 3 ปีที่แล้ว

    Amazing content

  • @kashifqurashi9384
    @kashifqurashi9384 3 ปีที่แล้ว

    mri image feature extraction..?

  • @tapansharma460
    @tapansharma460 3 ปีที่แล้ว

    Sir it’s a request that if you can elaborate 3D images like brats

  • @tetengious
    @tetengious 3 ปีที่แล้ว +1

    What a nice video but sir, how can we enhance medical images without losing the properties

    • @DigitalSreeni
      @DigitalSreeni  3 ปีที่แล้ว +1

      I am not sure what you mean by enhance medical images without losing properties. May be you are looking for super resolution applications?

    • @tetengious
      @tetengious 3 ปีที่แล้ว

      @@DigitalSreeni I am working on skin lesion disease classification (ISIC 2019 precisely). I am using histogram equalizer to enhance the images, which have to convert to gray, then to color. My question is: won't I loss the image properties doing that?

  • @hadjerbch830
    @hadjerbch830 ปีที่แล้ว

    most helpful as laways !!

  • @martingosnell2937
    @martingosnell2937 2 ปีที่แล้ว

    brilliant

  • @karamabdullah7867
    @karamabdullah7867 3 ปีที่แล้ว

    Best wishes

  • @maitrysinha8947
    @maitrysinha8947 3 ปีที่แล้ว

    nice learning

  • @maanu1094
    @maanu1094 2 ปีที่แล้ว

    by what name the file is uploaded in github

  • @rubyli6109
    @rubyli6109 3 ปีที่แล้ว

    really a nice tutorial. Could you help me about how to use it, such as refining the vgg model or use the parameters learned directly? Thanks

  • @davidsling
    @davidsling 7 หลายเดือนก่อน

    24:50

  • @OpeLeke
    @OpeLeke 2 ปีที่แล้ว

    this videos attempted to communicate an idea but you were all over the place, this video could be so much better with some structure

  • @Travellogy110
    @Travellogy110 4 หลายเดือนก่อน

    @DigitalSreeni
    vgg_model = VGG16(include_top=False, weights='imagenet')
    vgg_config = vgg_model.get_config()
    # Change the input shape to new desired shape
    h, w, c = 1024, 1024, 1
    vgg_config["layers"][0]["config"]["batch_input_shape"] = (None, h, w, c)
    #Create new model with the updated configuration
    vgg_updated = Model.from_config(vgg_config)
    ----
    Error-ValueError: Input 0 of layer "block1_conv1" is incompatible with the layer: expected axis -1 of input shape to have value 3, but received input with shape (None, 1024, 1024, 1)
    please it sound working for you but i am facing this error...

    • @Manisha-kp1ln
      @Manisha-kp1ln 3 หลายเดือนก่อน +1

      i m also facing same problem

    • @Travellogy110
      @Travellogy110 3 หลายเดือนก่อน

      @@Manisha-kp1ln please use keras 2.2 it worked for me.

  • @khaikit1232
    @khaikit1232 2 ปีที่แล้ว

    Hi may I ask what is the rationale behind averaging the 3 channels? I can understand that it is definitely better than just taking the weights of a single channel, but how did you determine that averaging was an appropriate method?
    After much googling on my own, I have heard of others introducing methods such as creating 2 additional channels for the greyscale image before feeding into the VGG16 model. What do you think of this?

    • @DigitalSreeni
      @DigitalSreeni  2 ปีที่แล้ว

      What other options do we have other than averaging the three channels? I do not recommend picking one channel out of three as you will lose information. That leaves averaging the channel as a viable option.
      VGG16 expects a 3 channel image so the normal way of handling it for grey images is by copying the grey image into additional two channels. This is better than any other alternative.

  • @yurcchello
    @yurcchello 3 ปีที่แล้ว

    don't average conv matrix

  • @vincente_z6139
    @vincente_z6139 2 ปีที่แล้ว

    Thanks!

    • @DigitalSreeni
      @DigitalSreeni  2 ปีที่แล้ว

      Thank you very much for your kind contribution Vincente.

  • @vineetdave7323
    @vineetdave7323 ปีที่แล้ว

    This is amazing content. Your concepts are super clear. Great help.

  • @azamatjonmalikov9553
    @azamatjonmalikov9553 3 ปีที่แล้ว

    Amazing content as usual, well done :)