Tutorial 27- Create CNN Model and Optimize using Keras Tuner- Deep Learning

Sdílet
Vložit
  • čas přidán 21. 12. 2019
  • 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
    Keras Tuner blog: keras-team.github.io/keras-tu...
    Google Colab Code Link: colab.research.google.com/dri...
    Please do subscribe my other channel too
    / @krishnaikhindi
    Connect with me here:
    Twitter: / krishnaik06
    facebook: / krishnaik06
    Instagram: / krishnaik06

Komentáře • 140

  • @neeleshjaiswal4922
    @neeleshjaiswal4922 Před 4 lety +5

    Thanks for this video. Yesterday only I saw your video 26. You said you will be completing the code explaintion in the next video. I am waiting for the second part of video -26 to come.😁

  • @smewara
    @smewara Před měsícem

    Saved my day! Thank you for the awesome video.

  • @samhrmujawar
    @samhrmujawar Před 4 lety +35

    Out of 309 videos 285 videos you created in 2019 itself. great work man! Keep going.

  • @divyanshuyadav1566
    @divyanshuyadav1566 Před 3 lety +4

    Bro🔥🔥 You saved my time. I was thinking this from last day that how can i choose parameters for my cnn model .. in this Computer world how can someone leave things to do manually by Programmer .... See Its KerasTuner here ❤️.. thanks Bhaiya You are awesome i always check you videos. 🔥🔥

  • @badcode8037
    @badcode8037 Před 2 lety +5

    Pooling layer should be given after convolutional layer. Its a must to reduce the computation and it also effects the accuracy, so you have to also use it in keras tuner as well. The results you got from keras tuner wont be the same, when you will actually be bulding the final model with pooling layer

  • @MohamedAshraf-zs6nv
    @MohamedAshraf-zs6nv Před 3 lety +2

    Thanks for the great effort, I wish if you enhance the audio quality so I can follow the tutorial without struggling to catch the steps
    even videos on 6/2020 have low audio quality.
    And thanks again Krish for the valuable tutorials.

  • @bhavyachhabra1600
    @bhavyachhabra1600 Před 4 lety

    Great explaination like always sir! Thankyou!

  • @enquiryadmin8326
    @enquiryadmin8326 Před 4 lety

    hi, i wanted to ask can we use pretrained models for facial emotion classification problem?

  • @alam_tapia
    @alam_tapia Před 2 lety

    Thank you! Amazing help!

  • @GauravSharma-ui4yd
    @GauravSharma-ui4yd Před 4 lety +2

    Thanks for these video sir. Please also continue the ml deployment series

  • @aniketgokarn3941
    @aniketgokarn3941 Před 3 lety +5

    Thank you for the video :) I have a small doubt, umm, the accuracy was increasing, but the validation loss (val_loss) at the end during training was also increasing, does not that mean , the model is over fitting?

  • @vikashchandramaurya1168

    Very helpful tutorial, thanks a lot

  • @patrickduhirwenzivugira4729

    Thank you for the great video. How can I also tune the optimizers (let's say ['Adam, RMSprop]) with dynamic learning rates? Many tutorials keep it fixed. Thank you

  • @StepbyStepDataScience
    @StepbyStepDataScience Před 3 lety

    Thank you. This was awesome

  • @bhupendrapal9176
    @bhupendrapal9176 Před 4 lety +1

    I am getting beow error while executing this code. Please help me to figure this out.
    Objective value missing in metrics reported to the Oracle, expected: ['val_accuracy'], found: dict_keys(['loss', 'acc', 'val_loss', 'val_acc'])

  • @manujkumarjoshi9342
    @manujkumarjoshi9342 Před rokem

    It is an amazing add-on while building models.

  • @avb9697
    @avb9697 Před rokem

    hello sir ! can we apply this method for CNNS that deal with Image Classification as well? by images I mean set of JPg images which are directly used as Input Training data?

  • @bhavyachhabra1600
    @bhavyachhabra1600 Před 4 lety +6

    Sir, how can we use keras tuner alongside transfer learning?

  • @sakshitattri4882
    @sakshitattri4882 Před rokem +5

    hii Krish... thanks for such an amazing tutorial but i have a doubt why you haven't used pooling and data augmentation for more accurate prediction?

  • @faisalshehzad9504
    @faisalshehzad9504 Před 4 lety

    sir, can we use CNN rather then images datasets like software defect prediction dataset of NASA repository

  • @akashchatterjee5409
    @akashchatterjee5409 Před 3 lety +1

    Sir can you plz tell how to reshape train set & test set if the datasets are RGB images becoz that reshape thing is not working even after giving reshape(len(img_train),50,50,3).Here 50x50 is my pixel size

  • @user-cc3eu4ng7f
    @user-cc3eu4ng7f Před rokem +1

    Hi,so i build a model for 1 dim cnn regression problem using keras and i did the preprocessing and reshape the data and so on, the thing is the loss for train and valid very big about number with 9 digits for both of them and the model shows accurcy equal to 1 from the first epoch .so what can i do to solve it i tried to use keras tunner but there is no difference ,any help please

  • @prasantas2195
    @prasantas2195 Před 4 lety

    Hey Krish, didn't find the code in the description (as you mentioned in the video tutorial).

  • @mukeshchoudhary_1038
    @mukeshchoudhary_1038 Před 3 lety

    thank you so much for really helped

  • @bilalayubi419
    @bilalayubi419 Před 4 lety +1

    Dear sir i am confusing how i will give input image and how get output.

  • @mukund198526
    @mukund198526 Před 3 lety

    Hi Krish - when i tried to follow you and gave -
    tuner_search=RandomSearch(build_model,objective='val_accuracy',max_trials=5,directory='output',project_name="Mnist Fashion")
    so seems for me it is giving error like -
    Traceback (most recent call last):
    File "/usr/local/lib/python3.7/dist-packages/kerastuner/engine/hypermodel.py", line 104, in build
    model = self.hypermodel.build(hp)
    File "", line 7, in build_model
    input_shape=(28,28,1)
    TypeError: __init__() missing 1 required positional argument: 'filters'
    is there any changes

  • @zartashiamehak562
    @zartashiamehak562 Před 2 lety

    Sir kindly guide me, can we use this code to perform binary classification on text dataset?

  • @viplovethakran1505
    @viplovethakran1505 Před rokem

    ohh my god its very amazing really

  • @psw1
    @psw1 Před 4 lety +2

    What's new in keras-tuner ? Earlier also it was possible by using scikit wrapper class for the keras model and then perforrming gridsearch or random_search for finding the best parameters.

    • @nikhildixit5167
      @nikhildixit5167 Před 3 lety +1

      Kerastuner gives you flexibility to tune the number of layers as well. Apart from randomsearch there are tuners in keras which can use bayesian approach to narrow down the parameter search space.

  • @programerahmed4470
    @programerahmed4470 Před rokem

    Great video: How can I force Keras Tuner to use default hyperparameter values for the first optimization iteration

  • @surehdau672
    @surehdau672 Před 3 lety

    Sir in kernal do we have predefined dataset for face detection like fashion_mnist dataset ?

  • @AdarshMahabubnagar
    @AdarshMahabubnagar Před 3 lety +1

    Hi, very good explanation. but i found that the model is overfitted as the percentage of training loss and validation loss is more. kindly explain

  • @OrionEx88
    @OrionEx88 Před 4 lety +12

    Great video! I have a question, it seems you already chose 2 conv2d layers, and you only searched for filters, kernel size, dense layers and learning rate. Can we also search for how many conv2d layers, pooling, dropout, etc.?

    • @pranav.shetty
      @pranav.shetty Před 3 lety +1

      Yes, you can loop over the number of layers, check the sub-topic "The search space may contain conditional hyperparameters" in this link --> "keras-team.github.io/keras-tuner/"

    • @pawanagrawal7653
      @pawanagrawal7653 Před 3 lety +1

      @@pranav.shetty hey, in the tutorial, 99% accuracy is on training data, how to check accuracy on test data.

  • @ryuk9204
    @ryuk9204 Před 4 lety

    Great tutorial, Can you update the code where "no. of epoch, choice of optimizers, batch size " as a hyperparameter for keras tuner. Thanks in advance.

  • @siddheshmirjankar910
    @siddheshmirjankar910 Před 3 měsíci

    Hi Krish! Do you have a video explaining how one can use the Keras tuner with a pre-trained model? I am currently working on a drug classification project using MobileNet. I am not able to go above a test accuracy of 85%. Also, when I try to predict an image that is input by the user, the prediction is incorrect a lot of the times. Hence, I was wondering if I can use the keras tuner to fine tune the MobileNet to get a better accuracy. Is it possible?

  • @upasanabhardwaj6140
    @upasanabhardwaj6140 Před 3 lety

    Thank you sir for this video.. Please upload video for the explanation of CNN for text classification.

  • @kavitabhosale2397
    @kavitabhosale2397 Před 3 lety

    please can you tell me? ...what happen if we decrease number of filters in CNN like 64 ,32 ,16? because generally we increase number of filters in cnn

  • @rakshiths3220
    @rakshiths3220 Před 3 lety +1

    how do you use maxpooling in it?

  • @ammaraikram7291
    @ammaraikram7291 Před 4 lety +1

    run time error to many failed attempts to build model if anyone knows, please answer

  • @louerleseigneur4532
    @louerleseigneur4532 Před 3 lety

    Thanks Krish

  • @JaiSreeRam466
    @JaiSreeRam466 Před 4 lety +1

    thanks alot sir

  • @surajpatil4815
    @surajpatil4815 Před 2 lety

    I HAVE QUESTION ON TEST ACCURACY OF FIGSHARE DATASET of brain tumor classification. My model train accuracy and validation accuracy is above 90 but for test sample the accuracy is not so good. It is showing lot of miss classification . Data augmentation has been done but no improvement

  • @Abhishekpandey-dl7me
    @Abhishekpandey-dl7me Před 4 lety +13

    can you plz make a video on Adam optimizer as you have made for gradient descent, coz we r unable to understand how this adam works

    • @jermainereece1881
      @jermainereece1881 Před 3 lety

      A tip : watch series on instaflixxer. Been using them for watching all kinds of movies lately.

    • @emilioreign6391
      @emilioreign6391 Před 3 lety

      @Jermaine Reece yea, have been watching on InstaFlixxer for years myself :)

  • @thevivekmathema
    @thevivekmathema Před 4 lety

    hello, can you show thsi using custom jpgs image folder and data (e.g ./Train (./cat ../dog ../panda ) ) & Test (.simlar)

  • @chaitanyaravi4482
    @chaitanyaravi4482 Před 3 lety

    Hi krish
    how to reslove this error
    TypeError: __init__() missing 1 required positional argument: 'kernel_size'
    in googlecolab

  • @mohinitambade2477
    @mohinitambade2477 Před 4 lety

    InvalidArgumentError: Incompatible shapes: [32,1] vs. [32,22,22] error is shown at line tuner_search.search(train_images,train_labels,epochs=3, validation_split = 0.1)

  • @raghubetageri5378
    @raghubetageri5378 Před 4 lety +1

    make a video for creating our own dataset and classification......which wil be very helpful

  • @ramaswamikv
    @ramaswamikv Před 2 lety

    after model gets trained, there is no test? lines of code missing at end in Colab Code?

  • @aashishyasinha8078
    @aashishyasinha8078 Před 4 lety +1

    Sir what is mobile net and vgn architecture ??

  • @skmusic_2022
    @skmusic_2022 Před 4 lety

    I came across a term called pilot code. Can you tell me what is a AI pilot code?

  • @eranfeit
    @eranfeit Před rokem

    Great video , Why did you skip the Max pooling layer ?

  • @kanhasinghal8053
    @kanhasinghal8053 Před 3 lety

    In line 11 I get error..tuner_search =RandomSearch(build_model,objective='val_accuracy' max_trails) in this line..error flatten is not defined..please help me

  • @rhiteshkumarsingh4401
    @rhiteshkumarsingh4401 Před 3 lety

    i am facing an error "INFO:tensorflow:Oracle triggered exit" after running tuner_search.search. Pls help how to resolve this error.

  • @priyeshgautam668
    @priyeshgautam668 Před 3 lety

    Can we use this for CNN pretrained models ?

  • @anaghadeshpande4873
    @anaghadeshpande4873 Před 3 lety

    Is this technique works for video data set or 3D CNN?

  • @yashmistry61
    @yashmistry61 Před 3 lety

    what is step size in hp.Int()?? How does it affect?

  • @shivanisood1562
    @shivanisood1562 Před 4 lety +1

    how to predict the hyperparameters for own dataset

  • @rahulpalivela1449
    @rahulpalivela1449 Před 9 měsíci

    at the last line of code when you used model = tuner_search.get_best_models(numb_models=1)[0]
    and got the best params with epoch = 3 , how can you use these params and then use it to test your model , and you didnt mention in the video how to test the model.

  • @harshvivek14
    @harshvivek14 Před 4 lety +1

    Why reshaping is required?

  • @sudeepnellur
    @sudeepnellur Před 4 lety

    thank you sir

  • @premranjan4440
    @premranjan4440 Před 2 lety

    while training in your system it is showing out of 54000 but in mine, it is showing 1688! Why?

  • @tirthadatta2072
    @tirthadatta2072 Před rokem

    Can anyone tell me is there any function for maintaining imbalance data in tensorflow?

  • @michaelvm2404
    @michaelvm2404 Před 6 měsíci

    Keras and Tensorflow: two tools with some of the highest numbers of installation issues that you can get.

  • @pallabidas3064
    @pallabidas3064 Před 4 lety

    can anyone tell me how to save this final output?

  • @syedzoofa8711
    @syedzoofa8711 Před 2 lety

    It's showing me the error build_model not defined??

  • @rohithvarma2454
    @rohithvarma2454 Před 4 lety

    What about the pooling layer??

  • @ramsiromanidixit7322
    @ramsiromanidixit7322 Před 3 lety

    How to use keras-tuner in functional api model ??

  • @AdityaYadav-pn7yb
    @AdityaYadav-pn7yb Před 4 lety

    @krish I'm getting RuntimeEroor:-Too many failed attempts to build model and TypeError: __init__() missing 1 required positional argument: 'fiters"

  • @enquiryadmin8326
    @enquiryadmin8326 Před 4 lety

    hi, can we use pretrained models for image classification problem?

  • @devloper_hs
    @devloper_hs Před 3 lety

    Awsome Library , But How To Use It For Dropout layer?

  • @arjunpukale3310
    @arjunpukale3310 Před 4 lety +2

    Sir please make video using keras tuner for cat dog classifier

  • @rakeshsahoo7316
    @rakeshsahoo7316 Před rokem

    Sir, how to adjust the parameters of CNN... like no. of convolution layer.. Pooling layer... Fully connected layer

  • @yerriswamyv1910
    @yerriswamyv1910 Před 4 lety

    How to check the accuracy on test data ? here it's multi class data.

  • @tirthadatta7368
    @tirthadatta7368 Před 3 lety

    Sir, when I run this code in Colab,
    tuner_search = RandomSearch(build_model,
    objective='val_accuracy',
    max_trials=5, executions_per_trial=3, directory='output', project_name="Mnist Fashion")
    I have got this error given below:
    RuntimeError: Too many failed attempts to build model.
    Can anyone help how to solve it??

  • @paraslaul3307
    @paraslaul3307 Před 4 lety

    how to predict images based on labels

  • @spicytuna08
    @spicytuna08 Před 2 lety

    can you create several env in colab?

  • @forever-fz1hk
    @forever-fz1hk Před 4 lety

    sir just one question how to decide the output nodes in dense layer..you have taken 10 but how to decide that...or how you came with 10..please answer sir

    • @vimalshrivastava6586
      @vimalshrivastava6586 Před 4 lety +2

      The output node is equal to the number of classes present in dataset.

  • @gamerdog5585
    @gamerdog5585 Před 10 měsíci

    Hi can you do the project aqi prediction based on image based deep learning algorithm

  • @abhishekpurohit3442
    @abhishekpurohit3442 Před 3 lety +1

    Sir, why are we adding dense layers after adding the Convolution layers? You didn't explain this in the lectures..

    • @pran6663
      @pran6663 Před 3 lety +1

      the final dense layer is to classify the object

  • @yerriswamyv1910
    @yerriswamyv1910 Před 4 lety

    aren't filter and kernal same ? if same, why we are giving two separate names conv_1_filter and conv_1_kernal ?

    • @KapilSharma-co8xq
      @KapilSharma-co8xq Před 4 lety

      Filter means no. Of filters
      And kernel means size of filter

  • @user-wl6km8vr9d
    @user-wl6km8vr9d Před rokem

    sir will you please upload video about GANs

  • @vikasrajput1957
    @vikasrajput1957 Před 4 lety

    why didnt you use pooling here?

  • @AyushGupta-kp9xf
    @AyushGupta-kp9xf Před 4 lety +2

    Please explain the reshaping part, I didn't get that

    • @ashithjake2778
      @ashithjake2778 Před 3 lety +3

      Reshape input images to following - [batch size , height, width, channel]. For greyscale images channel=1

  • @manikosuru5712
    @manikosuru5712 Před 4 lety +1

    Hi sir
    It's really amazing video..
    Can u perform CNN on own data like cats/dogs in google colab like how to read our data to perform simple CNN classification model.Can u pls...

    • @vasusharma1773
      @vasusharma1773 Před 4 lety +1

      Yes, there is a video on this channel only which shows the step by step procedure of loading the data for cnn in google colab

  • @mamtagupta4-yearb.tech.mec203

    How to solve this error?
    ValueError: attempt to get argmin of an empty sequence

  • @joe8ones
    @joe8ones Před 4 lety +1

    i followed the exact sane steps, but my output is 0.09

  • @lakshit-khanna
    @lakshit-khanna Před 3 lety

    Hi sir can you please make a video on what is the right mindset a person should have before he starts building something with deep learning. I was a Django developer till now following your videos to enter in this domain. thank you sir

  • @smurtiranjansahu5657
    @smurtiranjansahu5657 Před 4 lety

    Sir pls make a project video of RNN using karas

  • @kryptoskaggle7031
    @kryptoskaggle7031 Před 4 lety +1

    what is that "step=16" in each conv2d??

  • @dipanwitamallick8793
    @dipanwitamallick8793 Před 4 lety +3

    the validation accuracy is less than training accuracy ......so it is clearly overfitting ...any suggestions for that ????
    great video :)

    • @saicharan8376
      @saicharan8376 Před 4 lety

      if u found the answer could you please post it mam

    • @SAINIVEDH
      @SAINIVEDH Před 3 lety +1

      It's normal that val acc. < train acc. But if you want to improve it try Dropout, Bagging, Early Stopping, Regularization etc.. (techniques to reduce variance of the model)

  • @prachigopalani5399
    @prachigopalani5399 Před 3 lety

    Plzz show how to run flask on Google colab

  • @sayantansinha4545
    @sayantansinha4545 Před 4 lety

    Why did we reshape the image arrays at 9:26 ??

  • @pec8377
    @pec8377 Před 11 měsíci

    I love your videos, and I realized something, your epochs are running damn fast.. So I looked at my code, and copied the same model.. 4 minutes on a Titan.. mmm ..After hours of searching for the cause, I discovered it was coming from the ImageDataGenerator that is slow as hell !
    If I don't use a flow from dataframe.. hard to get an epoch of more than 30s. If I put a simple shear, or any transformation in an ImageDatagenerator: 4minutes !
    But then how can I do transfer learning, like VGG16 that has a preprocess function (so my epochs are of 4minutes !) If I remove the preprocess ? few secs per epoch

  • @sandipansarkar9211
    @sandipansarkar9211 Před 4 lety +1

    Great video but no value if we do not practice.Thanks

  • @tanvishinde805
    @tanvishinde805 Před 3 lety

    what is flatten layer?

    • @tanvishinde805
      @tanvishinde805 Před 3 lety

      From 24:48 I think it just flattens the multi-dimension input into single dimension

  • @tanvishinde805
    @tanvishinde805 Před 3 lety

    waiting for adam optimizer video

  • @carlosfotsing6779
    @carlosfotsing6779 Před 4 lety

    sir can you kindly upload the code of this tutorial?. it was so interesting

  • @unscript09
    @unscript09 Před 2 lety

    Sir please make a simple cnn video without using any tuners, its confusing

  • @saimaheshparuchuri9826

    Why don't you teach in pytorch sir???

  • @totalengineer9740
    @totalengineer9740 Před 2 lety

    Path ka error ata hai😢😢😢