Implementing original U-Net from scratch using PyTorch

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • In this video, I show you how to implement original UNet paper using PyTorch. UNet paper can be found here: arxiv.org/abs/...
    Please subscribe and like the video to help me keep motivated to make awesome videos like this one. :)
    To buy my book, Approaching (Almost) Any Machine Learning problem, please visit: bit.ly/buyaaml
    #DeepLearning #PyTorch #UNet
    Follow me on:
    Twitter: / abhi1thakur
    LinkedIn: / abhi1thakur
    Kaggle: kaggle.com/abh...

КОМЕНТАРІ • 178

  • @souhamghosh8714
    @souhamghosh8714 4 роки тому +47

    YESSS!! finally a paper implementation demo!! THANK YOU SO MUCH!!

    • @abhishekkrthakur
      @abhishekkrthakur  4 роки тому +3

      Hope you like it!

    • @souhamghosh8714
      @souhamghosh8714 4 роки тому

      @@abhishekkrthakur For any queries related to your videos and work, may I reach you over your linkedin?

  • @its_me7363
    @its_me7363 4 роки тому +1

    I don't understand why people don't like the videos. So much information for beginners.

    • @abhishekkrthakur
      @abhishekkrthakur  4 роки тому

      Its okay. Its not possible to make everyone happy everytime :)

  • @abhishtsingh6073
    @abhishtsingh6073 4 роки тому +8

    This is just amazing stuff. I would be implementing this tomorrow. The fact that someone is going through a paper and doing it all is quite motivating in the sense that it pushes me to implement some paper on my own, rather than using the github code/ model zoo. Keep it up sir.

  • @rahuljana7197
    @rahuljana7197 3 роки тому +3

    Awesome. Loved it. I am pursuing my graduation in AI & ML. To be honest, for the past 6 months I have enjoyed your content more than anything on UA-cam. Looking forward to more this type of research paper implementation. Thanks a lot for this amazing content.

  • @yummychen6540
    @yummychen6540 3 роки тому +18

    please do a completed Unet implement which includes the dataset step and training step, the training strategy really confused me.

  • @adiMallya
    @adiMallya 4 роки тому +4

    Need more of this. I want to understand by implementing stuff just by reading papers. You get better insights like this.

  • @TheAravindppadman
    @TheAravindppadman 4 роки тому +3

    I am recreating your "melanoma-detection" kernel my own. Your ML framework is awesome.It made my life much easier. Next I will implement U-net.

  • @morancium
    @morancium 26 днів тому

    BRO, honestly speaking, YOU ARE THE ONLY ONE WHO IS IMPLEMENTING ACTUAL PAPER OF UNET

    • @morancium
      @morancium 26 днів тому

      Everyone is just bypassing the cropping function you wrote

    • @morancium
      @morancium 26 днів тому

      But I have a question, will it be a big difference?

    • @abhishekkrthakur
      @abhishekkrthakur  26 днів тому

      @morancium to answer your question, ill have to look at the paper and video again as i dont remember everything 🙂 if you think something doesnt make a difference, train a basic model with and without and see what happens :)

    • @morancium
      @morancium 26 днів тому

      @@abhishekkrthakur cool man, appreciate your fast reply on a 4 year old video ❤️

    • @abhishekkrthakur
      @abhishekkrthakur  26 днів тому

      @morancium appreciate you still appreciating it even after 4 years 🙏🏽

  • @HimothyOHooligan
    @HimothyOHooligan 4 роки тому +2

    I found your channel through this video. These type of live implementation videos are super useful.

  • @vinithageorgee7122
    @vinithageorgee7122 3 роки тому

    Thank You so much. After a wild google search for nearly a week, I finally tumbled upon this wonderful video. Good detailed explanation. Hats off to you !!!!

  • @MrGeomTech
    @MrGeomTech 3 роки тому +1

    Thank you, for the first time a I found some one speak behind the scene for deep learning, and going step by step

  • @sanchitahuja12
    @sanchitahuja12 4 роки тому +10

    How should a beginner actually implement a paper? I am quite confident with the concepts and I am able to use pre-existing code to use it on my dataset. But I get scared while implementing a paper on my own without referring to the original code for that paper. I try reproducing the notebooks on my own by referring to the implementation and typing each and everything by understanding on my own. Is this the correct way? You're doing great work. Thanks a lot!

  • @AbdulRehman-hi7xk
    @AbdulRehman-hi7xk 4 роки тому

    A great teacher.... i was searching but i found a real teacher... Huge Respect from Pakistan SIR.

  • @anandpawara4048
    @anandpawara4048 4 роки тому +8

    Awesome tutorial, please do more videos like this paper implementation from scratch!

  • @stanislawcronberg3271
    @stanislawcronberg3271 Рік тому

    It's really nice that you don't cut out the parts where you make some typos. Also helpful to see you printing the shapes along the way instead of just writing it and it magically working at the end :)

  • @DiegoJimenez-ic8by
    @DiegoJimenez-ic8by 4 роки тому +2

    God Bless you man!, I pre-ordered your book, looking forward to read it!!

  • @TheJing2__
    @TheJing2__ 3 роки тому +1

    Thank you so much sir. This video inspired me a lot to implement the state of the art CNN architecture by myself.

  • @swarajnanda7874
    @swarajnanda7874 4 роки тому

    Brother, you've hit the jackpot with this kind of content. Thanks for your help! Now that I see the deep details of this machine learning model, I can understand it better.

  • @mayukh_
    @mayukh_ 4 роки тому +12

    Please do a wavenet. Also I always get confused how the data flows in wavenet. Please do wavenet or fast wavenet

  • @ramchandracheke
    @ramchandracheke 4 роки тому

    So addictive! Watching this at 4.00 am!
    You are the best 🙏

  • @psoma2744
    @psoma2744 3 роки тому

    Thank you very much, Abhishek... Your videos are really helpful and the explanation is awesome... You just make it look so interesting and easy to follow ...

  • @ibrexg
    @ibrexg 4 роки тому

    Great video, thanks for sharing. It would be nice if this is a part of complete colab/kaggle tutorial e.g. add the training and the testing part on some public dataset.

  • @dilrajbhinder4337
    @dilrajbhinder4337 2 роки тому

    Great Job. Crisp and clear.

  • @era_ali
    @era_ali 3 роки тому +1

    Awesome loved it, wish you would see how to train and evaluate this model

  • @karthiramachandran1257
    @karthiramachandran1257 3 роки тому

    Abhishek , thank you very much for implementing this paper ....

  • @self-made-datascientist1181
    @self-made-datascientist1181 4 роки тому +1

    Great video as always Abhishek! Just one question, for doing the training in this model how do you implement the backpropagation and the compiler? Im new to pytorch but I learned so much from this video about the model structuring!

  • @garesothmen2101
    @garesothmen2101 2 роки тому

    I liked the video and subscribed before you even ask !!! Thank you so much .

  • @doraadventurer9933
    @doraadventurer9933 3 роки тому

    Thanks for sharing!!!!!!! Do you also have the training and testing part and demo Unet for a real example? Again, thank for sharing

  • @Анна-щ5с8р
    @Анна-щ5с8р 3 роки тому +2

    Thank you so much!!!
    I have a question : isn't it a mistake that you concateneted (x,y) instead of (y,x) which is in the paper? Or it doesn't matter ?

    • @jonasp1641
      @jonasp1641 2 роки тому

      I was wondering the same thing...

  • @prakashupadhyay9529
    @prakashupadhyay9529 4 роки тому

    This was helpful Abhishek.. I'm new to Python paradigm and struggle. Seeing you code through helps understand the approach. Next I'd wish to see some Hyper Parameter tuning implementation in PyTorch, like OneCycle policy for LR, and some performance optimization tutorial during Data load in GPU (Pre-fetching Data in GPU).
    Thanks for this Video! :)

  • @talha_anwar
    @talha_anwar 3 роки тому

    thank you for implementing in simple way to make it clear

  • @javlontursunov6527
    @javlontursunov6527 2 роки тому +1

    Please make another video on how to train custom built U-net from scratch.

  • @rohitupadhyay4665
    @rohitupadhyay4665 4 роки тому +1

    Great video, best way is not just to read but to implement what you read! @abhishek would you make a video on training and serving inference pytorch model on Sagemaker..

  • @massive_d
    @massive_d 4 роки тому +3

    Hey I was thinking of starting with applied data science and your content seems perfect.
    Can I use the playlists ( are they updated) I was thinking of starting with the
    1) framework
    2) bert
    3) bengali
    Is this order correct?

  • @mihirgajjar8488
    @mihirgajjar8488 3 роки тому

    Great tutorial Abhishek, thanks for the video. In the Decoder part where we are concatenating the output of up transpose (ConvTranspose2d) and the cropped image from the encoder, should it be torch.cat([y, x], 1) instead of torch.cat([x, y], 1)? or the order does not really matter? It's great to see such "from scratch" implementations and the end part of the video explaining how various modifications are made (Resnets) to the basic architecture. Thanks :) :)

  • @endurirahul9550
    @endurirahul9550 2 роки тому +1

    is it possible to combine U-net and bilstm and to use for ECG signals for automatic detection of qrs complexes

  • @gauravsharmahsetsrhu4139
    @gauravsharmahsetsrhu4139 2 роки тому

    Wow. Explained it so well. Can I train this model using my own dataset? If yes please explain.

  • @31aish
    @31aish 6 місяців тому

    You missed to add relu before double conv in expansive block. But great explanation, thankyou!

  • @shalini286r9
    @shalini286r9 3 роки тому

    Nice Explanation.Please do a implementaion of improved Attention U Net .

  • @amineleking9898
    @amineleking9898 3 роки тому

    Very clear explanation.
    Thank you mate

  • @manuelh7576
    @manuelh7576 3 роки тому

    Great video - thank you! One thing I don't understand is why the input image tile is 572 x 572 and the output segmentation map is 388 x 388. Wouldn't we need a segmentation map of the same size? Grateful for any pointers to resources that explain this further.

    • @abhishekswain2502
      @abhishekswain2502 2 роки тому

      It's like a zoomed in version of the orginal image

  • @roymercan
    @roymercan 4 роки тому +2

    Thank you for another amazing video, coding side by side with you helped me understand how to dissect an architecture presented in a paper.
    I would love to see the implementation of an attention model from scratch, do you think it is possible?

  • @jamesferrarelli7448
    @jamesferrarelli7448 4 роки тому

    Thank you so much for this! It has been very helpful in clarifying how this works.
    One question for you: Your model takes in a grayscale image. If I wanted this to take in an RGB image (so starting with 3 channels instead of 1), would I multiply each layers' in_channels and out_channels by 3?
    For example, you have `self.down_conv1 = double_conv(1, 64)`
    Would I change it to ` self.down_conv1 = double_conv(3, 192)`

    • @treelight1707
      @treelight1707 3 роки тому

      I was thinking the same question. Did you happen to find the answer to it?

  • @hejarshahabi114
    @hejarshahabi114 3 роки тому

    Thank you for your video, but I have a question regarding the data creation for training,
    I do research in the field of remote sensing, I mainly work with satellite data for classification and feature detection, so I have to manually digitize some sample as levels for my training processes, so I want you to make such video on how to prepare satellite data for using in U-net. many regards

  • @deepexplorationcode9456
    @deepexplorationcode9456 4 роки тому

    Thank you very much for explaining UNET. I have a better understanding UNET of what is on the paper and how to code it.
    Can you please show step-by-step how to use it (UNET) for image denoising, super resolution, inpainting, image segmentation always with pytorch.
    Can you also please explain yolact++ or mask rcnn just like you did with unet (step by step).

  • @shashankshekhar7052
    @shashankshekhar7052 4 роки тому

    Thanks, please do paper implementations more often it's really helpful. For decider, shouldn't we use classical interpolation like nearest, bilinear as transposed convolution will cause artifacts patters.

  • @mengop
    @mengop 4 роки тому

    Thank you for the wonderful video to understand the original paper implementation. This video is Easy to follow and implement. Can you cover in another session ,the alternate part of using pretrained as encoder network which you have mentioned at the end. Also pls cover the 3D image data handling along with its meta data in model building. Thank you

  • @aatiqaghazali7850
    @aatiqaghazali7850 3 роки тому

    Thank You so much Sir! Love and respect from Pakistan

  • @ahmedhusham7728
    @ahmedhusham7728 4 роки тому

    Awesome. Can I use UNet to segment weeds plant in a grassland images?
    - Can I send you sample of these dataset to segment it?

  • @jeevankumar3527
    @jeevankumar3527 4 роки тому

    @abhishek we can go for resize right instead of crop, Can you throw insight on this

  • @adeebshahzad7893
    @adeebshahzad7893 3 роки тому

    One word. Amazing!!!

  • @varadthikekar464
    @varadthikekar464 3 роки тому

    Awesome tutorial. got a good understanding of the code

  • @WeeeAffandi
    @WeeeAffandi 2 роки тому

    Do i need to add a flatten layer in the end in order for it to perform classifications?

  • @margretazuma5462
    @margretazuma5462 3 роки тому

    Thank you soo much, this really helped for my thesis

  • @WBMangaka1
    @WBMangaka1 2 роки тому

    Sir, you saved my day. Great video!

  • @ashishjith7096
    @ashishjith7096 4 роки тому

    Simple & effective explanation. Can you help to upload more videos on implementing GAN's using Pytorch?

  • @edoardograsso3391
    @edoardograsso3391 Рік тому

    unbelievably helpful

  • @017_itmohamedmufassalsulta8
    @017_itmohamedmufassalsulta8 3 роки тому

    Sir, this is a great tutorial. I found it very helpful. then just how u approached U-Net, I tried it for 3D Unet . I don't know whether i got the correct result. It would be great if you show us to how to implement it.

  • @PardeepKumar-th2oj
    @PardeepKumar-th2oj 3 роки тому

    hi, this was great work, can you also implement the original loss used in the paper in which changes are done

  • @varuntirupati2566
    @varuntirupati2566 4 роки тому

    Sir, a very nice explanation! I want to change the final 1*1 convolution layer to have out_channels=3 because my output is colour(rgb) and also I want to make the final activation layer as linear to output the float values. how can I do this

  • @prakhargoyal8160
    @prakhargoyal8160 4 роки тому +1

    Really amazing work, sir.

  • @rushirajparmar9602
    @rushirajparmar9602 3 роки тому +1

    I dont know why I am getting this weird error while croping the tensor:
    *TypeError: 'builtin_function_or_method' object is not subscriptable*
    *_return tensor[:, :, delta : tensor_size-delta, delta : tensor_size-delta]_*
    Has anyone faced this issue!??

  • @pheiroijamprishika6414
    @pheiroijamprishika6414 2 роки тому

    Sir Can you do a video on Deep Boltzmann machine

  • @vihalkaviyarau9044
    @vihalkaviyarau9044 7 місяців тому

    Sir i need a video on how to train the code with dataset and if we give an image it should return the segmented one, how to do so with this UNet? Please do a video on it as soon as possible. Or if there is anyother video and if anyone knows which one is better kindly reply for this message with the link of the video.

  • @surbhikhushu2394
    @surbhikhushu2394 4 роки тому

    Please give a tutorial for cycle GANS as well if possible .Thanks

  • @digvijayyadav3633
    @digvijayyadav3633 4 роки тому +2

    Can you teach GAN implementations as well?

  • @cipherxen2
    @cipherxen2 3 роки тому

    What about loss function and optimizer? Without them we can't train anything.

  • @ripleylee5726
    @ripleylee5726 4 роки тому

    thank you for this video! Just wondering if i were to implement a resnet34 model inside, how do i implement it into unet?

  • @pawanbhandarkar4199
    @pawanbhandarkar4199 3 роки тому

    Hi Abhishek. I was reading the paper while trying to implement this and I could not find the "stride" for the up-sampling section which you have written as stride=2. Can you please help me understnd how you calculated it?

  • @joepearson6111
    @joepearson6111 4 роки тому

    sorry if i'm being stupid... but how come you have created the 'double_conv' outside of the unet class. I'm fairly new to this sort of stuff and I've only ever seen the whole model be created within said class.

  • @BiranchiNarayanNayak
    @BiranchiNarayanNayak 4 роки тому +1

    Superb.... i love this.

  • @manishkumarmishra194
    @manishkumarmishra194 4 роки тому

    Great work! could you do a implementation video on Style-GAN in pytorch.

  • @ninansajeethphilip4656
    @ninansajeethphilip4656 10 місяців тому

    Very nice presentation

  • @shayo6251
    @shayo6251 3 роки тому

    So I am trying to make a unet model using pytorch for depth estimation. However, I am kind of confused on how to use this as a basis for depth estimation

  • @daneshaslam412
    @daneshaslam412 4 роки тому

    Hey nice video! I am struggling to implement deformable convolution into U-Net. I am using source code from pytorch master version for torchvision.

  • @elirhm5926
    @elirhm5926 4 роки тому

    awesome, thanks a million :)
    please please please, make more video like this

  • @florianhofstetter6859
    @florianhofstetter6859 3 роки тому

    How would i get the original resolution of the image back?

  • @avinashpaul2221
    @avinashpaul2221 4 роки тому +1

    Hi Abhishek when can we expect the hard copy of your book in indian market?

  • @lakshmivallala947
    @lakshmivallala947 4 роки тому

    Why are we using [2] while finding the size of tensors?
    Also, what are the final tensors in the output?

    • @abhishekkrthakur
      @abhishekkrthakur  4 роки тому

      We are using 2 because shape is bs, c, h, w. So, you can use 2 or 3. h and w are the same. For final tensor size, i would ask if you can tell me by printing it? :)

  • @funadda7338
    @funadda7338 4 роки тому

    Hello Abhishek, I am trying to implement U-Net on Fashion-MNIST dataset using pytorch, any reference material that can help?

  • @lonapat
    @lonapat 3 роки тому

    Please i want to implement UNET for segmentation of mammographics images

  • @SUGATORAY
    @SUGATORAY 4 роки тому

    @Abhishek: I already purchased the book on Amazon. How do I get a pdf copy of it?

  • @thangnguyen1677
    @thangnguyen1677 4 роки тому

    Nice content, we need more of this

  • @lv8707
    @lv8707 4 роки тому

    If we want to include some dataset to this model and check the accuracy, how can we possibly do that? I am a beginner!

  • @indavarapuaneesh2871
    @indavarapuaneesh2871 4 роки тому

    Abhishek Bhai , you are beyond beautiful!!

  • @mohammedy.salemalihorbi1210
    @mohammedy.salemalihorbi1210 4 роки тому

    This was great!
    Thank you so much

  • @miltonborges7356
    @miltonborges7356 11 місяців тому

    Amazing. Thanks a lot

  • @needsomeminjeongpower1987
    @needsomeminjeongpower1987 2 роки тому

    thank you!! that helps a lot

  • @knowledge_Theory
    @knowledge_Theory 4 роки тому

    Wow
    Just great
    Can u share the name of your book/ Amazon link

  • @raghavavinay8660
    @raghavavinay8660 4 роки тому

    if i wanted to put a pixelshuffle function where should i put that. can you just give small syntax for that

  • @rs9130
    @rs9130 3 роки тому

    great tutorial. can you please make video on how to use backbones for unet encoder part like vgg, resnet. please please. thank you
    edit: also fcn implementation

  • @PaAGadirajuSanjayVarma
    @PaAGadirajuSanjayVarma 4 роки тому

    sir i want to build face recognition using convolution autoencoder. So can I use unet for this purpose?I tried but the results are bad. When we are doing concatenation of layers i made a copy of them and keep autograd false for those.Is this implementation correct?

  • @pradoshthakur2799
    @pradoshthakur2799 4 роки тому +1

    Which video of yours has info about WTFML? I could not find it.

    • @abhishekkrthakur
      @abhishekkrthakur  4 роки тому +1

      skin cancer detection: ua-cam.com/video/WaCFd-vL4HA/v-deo.html

  • @anujgodase1865
    @anujgodase1865 4 роки тому

    I wanted to make a unet using resnet.
    This was helpful.

    • @abhishekkrthakur
      @abhishekkrthakur  4 роки тому +1

      Feel free to share how you did it. It will be useful to many :)

  • @rashasalim1259
    @rashasalim1259 3 роки тому

    Thank you so much! A lot to learn here :)

  • @porzo2964
    @porzo2964 3 роки тому

    Thank you very much!

  • @puyncharasr6963
    @puyncharasr6963 4 роки тому

    Could you implement Faster - RCNN Please

  • @anastasiabutskova9324
    @anastasiabutskova9324 4 роки тому

    great work, thank you!

  • @sachinkondal4417
    @sachinkondal4417 3 роки тому

    Complete ERFNet training and testing

  • @arunmohan1211
    @arunmohan1211 3 роки тому

    how can we represent a binary image (for eg size 225x225x1) to image with foreground and background channels(eg 225x225x2). Please someone help.