Nicholas Renotte
Get the Code https://github.com/nicknochnack/ImageClassification
So…you wanna build your own image classifier eh? Well in this tutorial you’re going to learn how to do exactly that…FROM SCRATCH using Python, Tensorflow and Keras. But best yet, you can do it on virtually any dataset. Go on, give it a go!
Links
Sigmoid Activation: https://en.wikipedia.org/wiki/Sigmoid_function
Relu Activation: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
Image Downloader Extension: https://chrome.google.com/webstore/detail/download-all-images/ifipmflagepipjokmbdecpmjbibjnakm?hl=en
Conv2D Layer: https://www.tensorflow.org/api_docs/python/tf/keras/layers/Conv2D
MaxPooling Layer: https://keras.io/api/layers/pooling_layers/max_pooling2d/
Chapters
0:00 – Start
0:28 – Explainer
1:19 – PART 1: Building a Data Pipeline
3:08 – Installing Dependencies
8:30 – Getting Data from Google Images
23:12 – Load Data using Keras Utils
33:22 – PART 2: Preprocessing Data
35:56 – Scaling Images
42:23 – Partitioning the Dataset
47:34 – PART 3: Building the Deep Neural Network
48:21 – Build the Network
1:02:32 – Training the DNN
1:06:37 – Plotting Model Performance
1:09:50 – PART 4: Evaluating Perofmrnace
1:10:38 – Evaluating on the Test Partition
1:13:59 – Testing on New Data
1:20:39 – PART 5: Saving the Model
1:21:08 – Saving the model as h5 file
1:24:43 – Wrap Up
Oh, and don’t forget to connect with me!
LinkedIn: https://bit.ly/324Epgo
Facebook: https://bit.ly/3mB1sZD
GitHub: https://bit.ly/3mDJllD
Patreon: https://bit.ly/2OCn3UW
Join the Discussion on Discord: https://bit.ly/3dQiZsV
Happy coding!
Nick
P.s. Let me know how you go and drop a comment if you need a hand!
#deeplearning #python
Source
very useful and explanation is also just awesome..Thanks for the tutorial..
Thx
thank u sm
That weird colouring at 1:17:19 is because cv2 is expecting `uint8` and we're giving it `int`… so yeah… this works too but just saying… it was bugging me lol…
Other than that, AMAZING tutorial! Life saver!
If you guys are getting a Unicode error with the "data = tf.keras.utils.image_dataset_from_directory('data')" line, make sure to remove all spaces and unsupported characters from your folder and image names.
anazing video . easy to understand and pedagogically Correct, . You are Gifted trainer, you have this wired within your Genes.
Thank you .
what an amazing video! Exactly what I was looking for and your sense of humour makes it so much fun to watch. I had one question though, if i try to run data = tf.keras.utils.image_dataset_from_directory('data'), I get an error. Apparently google colab can't access my local directory. How can I fix this?
Lifesaver
Amazing tutorial !! Just diving into deep learning and your example came in handy.
Sir can you help me if CNN usable for IOT cameras and suggest me some IOT cameras for the CNN project image classification
45:50 – I am confused.
What do you mean by "shuffle" ?
I have the data just like yours : Data folder containing a folder for each class.
Also another question that I have is : if my Data folder contains class A (50% of parent folder), class B (50% of parent folder), and I make the training set 70% of the data folder just like your code does, will it be 70% of each child folder or 70% of the entire Data folder?
Hi Nicholas, I have an issue with saving my pretrained EfficientNet model. Essentially, when I saved the model and imported to test it, I got a completely different result from the original model. Theoretically, the saved model should have the same, if not, similar accuracy to the original model. I tried to debunk this problem but could not figure it out. Does anyone here encounter this problem? If so, please let me know how to resolve this. I thought this would be a great content to cover for you, Nicholas. Keep it up with the good work. You've helped me a lot with my portfolio projects. Thanks
Thank you for working through your mistakes! <3
I don't know if you would see my comment. You have done a great job with your video!! I have a question on len(data) since my data length was 71, and if I have added one in val_size and test_size, the sum of them will be more significant than 71, and it becomes 72. Did it affect anything in the following? or is it essential for the next step? should I add one in val_size and test_size??
So im using a M2 chip Macbook pro where the CPU and GPU are integrated. Whenever I run the length of GPUs it states 0 and then the set_memory_growth() function is useless. When I check for CPU, it states 1, so will that still create an OOM error in the future?
I have a question. If the accuracy is about 99%, then does it means that the data is overfitting?
Thanks Alot Man !!
hoq to install imghdr module in pyhton
My model can now identify but some images it still struggle to identify in 100epoch ill try to make it 500 epoch
I have watched this tutorial in one shot … Your teaching is awesome, useful. . thank you. ..
I just want to ask, why didn't YOU use train-test-split instead manualy splitting ?
ur code in github wont open, pls help
thank you soooo much you saved my life
I would like to apply AI in visual inspection process ( PCB manufacturing). Assume that the image isn't completed. Is there any way to archive 100% accuracy ?
Whatever I learned in theory, now learned in practical just because of you, it's really fun and put lots of efforts to make us understand in easier terms, thanks a lot. ✨
Nich, Why use tensorflow pipeline for just training and testing of so less pictures. Due to this your model is getting over fitted as the accuracy, precision and recall all are equals to one.. i think the model will ambiguous result for any outside data.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 45: invalid start byteCell Execution Error , i m getting this error for keras.utils , what to do
Hi Nicholas, I am trying your code for four categories but at the time of testing yhat is not correct. it is not coming in vector form. Do you have any tutorial for the same ?
why music ?
Where can i find the video of creating the image classification folder?
This is awesome! Can you also make a video to classify more than 3 things?
How would that work when using binary system (0 = sad, 1 = happy)? what if you have angry as third variant? Thank you.
hey Guys i need some help , i used dataset from github and same model almost same accuracy scores but test picture is coming out to be sad why??? please help
Could you please give me a report on this project as a reference???
Thank you, great video. Can you make a video for vision transformer method?
Bro, I just wanted to thank you for making this video cause it helped me a lot. I'm doing my research right now and your videos helped me to progress on it. Even tho this vid was posted years ago, it significantly helped me, bro.
God blessed you! I'll make an update on my research after the defense. 🫶🏻
if you had more than 2 classes what loss function would you use ?
Hello in google colab, where data containing happy and sad folders is uploaded?
hi Please confirm can this project be done using Google Colab ?
This was excellent. And so if I reopen this, do I need to compile everything from the beginning?