Image classification using CNN (CIFAR10 dataset) | Deep Learning Tutorial 24 (Tensorflow & Python)




[ad_1]

In this video we will do small image classification using CIFAR10 dataset in tensorflow. We will use convolutional neural network for this image classification problem. First we will train a model using simple artificial neural network and then check how the performance looks like and then we will train a CNN and see how the model accuracy improves. This tutorial will help you understand why CNN is preferred over ANN for image classification.

Code: https://github.com/codebasics/py/blob/master/DeepLearningML/16_cnn_cifar10_small_image_classification/cnn_cifar10_dataset.ipynb
Exercise: Scroll to the very end of above notebook. You will find exercise description and solution link

Deep learning playlist: https://www.youtube.com/playlist?list=PLeo1K3hjS3uu7CxAacxVndI4bE_o3BDtO
Machine learning playlist : https://www.youtube.com/playlist?list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw  

Website: http://codebasicshub.com/
Facebook: https://www.facebook.com/codebasicshub
Twitter: https://twitter.com/codebasicshub
Linkedin: https://www.linkedin.com/company/codebasics/
Discord: https://discord.gg/r42Kbuk
Patreon: https://www.patreon.com/codebasics

DISCLAIMER: All opinions expressed in this video are of my own and not that of my employers’.

Source


[ad_2]

Comment List

  • codebasics
    December 19, 2020

    I really enjoyed your tutorial. I have a doubt, at the first conv layer you selected 32 filters but in the second one 64 filters, why?.is there any method to select the ideal number of filters?

  • codebasics
    December 19, 2020

    great tutorial and I enjoyed it! However, what if I want to classify new images which not in CIFAR dataset, for an instance, I want to classify a butterfly breed. Any suggestion?

  • codebasics
    December 19, 2020

    How can we use train_test_split on images dataset,because in any video you don't used it.

  • codebasics
    December 19, 2020

    sir how i convert the prediction into csv file with column names (filname and label)

  • codebasics
    December 19, 2020

    How can u extract the label of a classified image when working with a large dataset? I would like to classify food image and recommend recipes based on the label identified but I am not understanding how to do this. I WOULD kindly ask a tutorial on this matter. There is barely information on food related projects plz

  • codebasics
    December 19, 2020

    Sir…how can I contact you…I need your help for my PhD…. No professor/teacher/guide can explain matters like you do…am blessed to have found your tutorial in youtube….kindly help me …

  • codebasics
    December 19, 2020

    great job sir…..keep making videos love to watch and learn from your videos

  • codebasics
    December 19, 2020

    Hello sir can you share your ppt please in the description it would be useful

  • codebasics
    December 19, 2020

    Hi Thank you for all your tremendous work you make fall in love with Machine learning. don't you dare to stop;) Thank you so so so much.

  • codebasics
    December 19, 2020

    I implemented same code but when I am trying predict my unknown data(a truck's photo taken from internet), it is predicting first class every time i.e. 'airplane'. Someone please help me out!!

  • codebasics
    December 19, 2020

    How do we get lung cancer data set ?

  • codebasics
    December 19, 2020

    Sir, one small doubt.. you said that we can use categorical_crossentropy when there is one hot encoded output pattern.. but in this example we used sparse_categorical_crossentropy , but still we used 10 output neurons and output was considered as max of that…which is like one hot encoding only right..

  • codebasics
    December 19, 2020

    I also got approx 0.46 with ANN on cifar10… Max accuracy for cifar 100 on ANN?

  • codebasics
    December 19, 2020

    thank you very much sir

  • codebasics
    December 19, 2020

    thanks a lot sir for your explanation. i got accuracy of 98.97% using cnn model

  • codebasics
    December 19, 2020

    Thank you so much for detailed tutorial. Can you please make a video on Object detection? Specially Faster RCNN and Yolo models.

  • codebasics
    December 19, 2020

    Sir…just one request…can you make a video of a project which is done right from downloading the data, saving it in device ,uploading it on notebook and pre processing the data and training a model…it will be very helpful…😊

  • codebasics
    December 19, 2020

    Hi codebasics, would it be possible for you to go through how to save and load a tensorflow/keras model? 
    I know you covered pickle and joblib applied to sklearn models but I'm not sure if that works for tensorflow/keras models.

    I have tried pickle and joblib and both faced the same errors: 
    ————————————————————–
    import pickle
    with open('cnn_pickle','wb') as f:
    pickle.dump(cnn,f)
    ————————————————————–
    >>> TypeError: can't pickle _thread.RLock objects

    I also tried the native keras model.save() and model.load_model() as per tensorflow's documentation:
    https://www.tensorflow.org/guide/keras/save_and_serialize

    I managed to save and load the model successfully by running this following code:
    ————————————————————–

    cnn.save('cifar_cnn')
    cnn2 = keras.models.load_model('cifar_cnn')
    ————————————————————–

    My cnn.evaluate(X_test,y_test) accuracy is 70% but cnn2.evaluate(X_test,y_test) accuracy is only 9.5%

  • codebasics
    December 19, 2020

    it is important to make a algorithm of problem on paper before writing code

  • codebasics
    December 19, 2020

    sir suppose i downloaded the 60000 images then how can i classify them and how can i gave the name to images

  • codebasics
    December 19, 2020

    Your approach is very well. You can explain the topics so well and easy to understand the complex topic.

  • codebasics
    December 19, 2020

    Hi Dhaval, I have a small doubt, while training on CNN the no of training data per epoch run in your system shows 1563 but I am having 50000. Can you please let me know the difference?

  • codebasics
    December 19, 2020

    Tq so munch sir for continuing this series amazing content supreb nice explantion

  • codebasics
    December 19, 2020

    No one in universe can teach like this

  • codebasics
    December 19, 2020

    Your classes are really beginner friendly and I have a doubt will adding more layers improves the accuracy

  • codebasics
    December 19, 2020

    Sir plz continue codebasics hindi channel.

  • codebasics
    December 19, 2020

    Such a Good Content.
    I am really exciting for upcoming videos.

  • codebasics
    December 19, 2020

    Sometimes i have thoughts in my mind that is this really happening or is this valuable( i am not judging or not even assuming) as this type of course are paid and with huge amount of money with high demand but how you can give this for freeee ???????
    How sir how ???
    Hats off👍👍👍👍👍and big thanks 👌👌👌
    🙏🙏🙏🙏
    I think this learning won't be stopped ever from you.

  • codebasics
    December 19, 2020

    I started to learn ml after getting inspirations from your videos. Thank you !

  • codebasics
    December 19, 2020

    Exciting Times!! May this series long continue😁

  • codebasics
    December 19, 2020

    From Brazil, you are the best ML teacher!!! Thank you.

Write a comment