127 - Data augmentation using keras

  Рет қаралды 70,918

DigitalSreeni

4 жыл бұрын

Code generated in the video can be downloaded from here: github.com/bnsreenu/python_for_microscopists

Пікірлер: 123
@RyanAngeloDagale
@RyanAngeloDagale 8 ай бұрын
Its a twenty minutes video and yet feels like five minutes, it is one of the KZbin tutorial that you don't get bored and stay focus.
@sajansudhir1859
@sajansudhir1859 3 жыл бұрын
Can't move to next video without appreciate your commitment and hard work towards beginner level coders.
@ALFER38
@ALFER38 2 жыл бұрын
Watching this video clarified how data augmentation is used. Very good job!
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
Glad it was helpful!
@baibhavchakraborty1560
@baibhavchakraborty1560 Жыл бұрын
I have to do a college project on GAN image augmentation. Couldn't understand how to do. You came to my rescue. Thank you, Sir
@marydayanaa9130
@marydayanaa9130 4 жыл бұрын
Thank you so much sir. Very good explanation. I have just started watching all your videos.
@harishgoud3628
@harishgoud3628 3 жыл бұрын
most underrated channel , love ur work
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
I appreciate that. Please help spread the word to your buddies.
@souravjha2146
@souravjha2146 3 жыл бұрын
Man your explanation is reallly good....thanks
@fadilyassin4661
@fadilyassin4661 3 жыл бұрын
you said you hope we learn some thing new , hell yes your so good in explaining , I did not see all of your tutorials i hope I can to me they are a refrence to many thhings in machine learning unless you understand the building blocks of ML you can't do any real work you and some few others are doing this amazingly big thank you
@ademyoussef409
@ademyoussef409 2 жыл бұрын
clear and smooth explanation! Thank you!
@mehrnazmrz4703
@mehrnazmrz4703 3 жыл бұрын
That was awesome. Thank you very much for such a good tutorial.
@cuthbertruseruka4461
@cuthbertruseruka4461 2 жыл бұрын
Thank you for the training. You are amazing.
@user-nj2vi4pz5z
@user-nj2vi4pz5z 11 ай бұрын
The best learning tensorflow Thank you
@vimalshrivastava5951
@vimalshrivastava5951 2 жыл бұрын
Very informative video with clear explanation....!!!!
@limzisin26
@limzisin26 2 жыл бұрын
Thanks Sir. This video helped me a lot in my final year project!
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
Great to hear!
@darasingh8937
@darasingh8937 2 жыл бұрын
Dude, you just became my guru! Thank you!
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
Glad to hear it!
@saeedag4468
@saeedag4468 3 жыл бұрын
You are an amazing teacher.. subscribed!
@Thoughts_of_a_900_ELO
@Thoughts_of_a_900_ELO 2 жыл бұрын
Greatest youtube lecturer I have ever witnessed 🌝👌
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
Glad you think so!
@saikrishnavadali05
@saikrishnavadali05 3 жыл бұрын
Amazing video!!! Sreeni is the best in AI!!! Very very helpful video..
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Glad it was helpful!
@saranbdsravi
@saranbdsravi Жыл бұрын
thank you for covering the various class label options namely single class, multi class within their respective folders. what if i had all the image classes within the same folder? grateful if you could give me pointers on how i can apply augmentation to the image of the weaker class. does the algorithm differentiate between weaker and dominant classes? my setting is all images in one folder and labels within a csv.
@nguyenhai5455
@nguyenhai5455 3 жыл бұрын
A greate video ! But I have a question. When you augmented the input images, What about the mask of those images, Did you also augment the masks base on those augmented images ? My project is semantic segmentation.
@toninehme
@toninehme 3 жыл бұрын
Thanks for this videos my dear!!! Can you explain which methods are used for NUMERICALS data augmentation?
@yogeshrohit3147
@yogeshrohit3147 3 жыл бұрын
Omg 🔥🔥 this is it , what I wanted 💖
@muhammadroshan7315
@muhammadroshan7315 4 жыл бұрын
sir should which fill_mode should we apply to segmentation mask of image (consisting of each pixel value corresponding to class with no background)
@ashilshah3376
@ashilshah3376 10 ай бұрын
Thank you so much, helped a lot !!!!
@liwensong8037
@liwensong8037 3 жыл бұрын
thank you so much, this is amazing!
@saimahaider1783
@saimahaider1783 3 жыл бұрын
It was really helpful. Keep going.
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Glad to hear that
@EkaterinaGolubeva-pr9ih
@EkaterinaGolubeva-pr9ih Жыл бұрын
Thanks ! What if we have a later version of tensorflow and keras, should we downgrade our version to run your code ? How would we do that ? Otherwise, is there another way to have the same result ?
@niladrichakraborti5443
@niladrichakraborti5443 Жыл бұрын
Very Helpful !!
@asif1963
@asif1963 3 жыл бұрын
I am new in DCNN. Moreover, I am working on image data augmentation and I have been writing code of augmentation. Moreover, I have 5 classes in the dataset i.e. Grass, Flower, Fruits, Dust, and Leaves Thus, the train set in is also consist of 8 classes. However, after augmentation, all of the augmented data has been store in the train folder but it does not store in their individual class. Besides that, I have been applied the directory manually for example: directory = ('/content/dataset/train/Grass'), save_to_dir = ('/content/dataset/train/Grass') Unfortunately, it does not work, and augmented images, not generated. Therefore, it is possible to store the augmented data in a similar folder where before augmented data exist (raw data folder)? if it can be possible individually (one by one class) that will be also very helpful for me.
@MARTIN-101
@MARTIN-101 Жыл бұрын
yes it can be stored. you are maybe saving the augmented data with the same names.
@mamoon72
@mamoon72 2 жыл бұрын
first of all thankyou sir for another great video..❤ 2nd of all i have a question if we are augmenting a multi class problem how can we save augmented images in different class/folders because i saw you save augmented images from to folders in a single folder which will be very difficult to separate manually if i am working with a big dataset ? Thankyou in advance.
@ShubhamKumar-xy6kj
@ShubhamKumar-xy6kj Жыл бұрын
you got solution for mentioned query?
@swathimenon2345
@swathimenon2345 3 жыл бұрын
Thank you for this video. Can you please help to know how to augment images that have multiple label classes already labelled. e.g. one image with different labels like traffic signal, speakers, traffic signs and lights. how to augment image with multiple labels?
@mahalekshmianil2691
@mahalekshmianil2691 2 жыл бұрын
Best Explanation,sir
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
Thanks and welcome
@truongminh8571
@truongminh8571 3 жыл бұрын
best tutorial ever! great!
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Glad you think so!
@sabaal-jalal3710
@sabaal-jalal3710 3 жыл бұрын
Thanks Sir... very useful
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Always welcome
@mihretdesta9153
@mihretdesta9153 Жыл бұрын
hey sir how do you balance imbalanced image datasets for multi-class image classification using deep learning
@wabisabi6680
@wabisabi6680 Жыл бұрын
i have this Problem how can i do this after Augmentation with image generator save the image to his labels in the main Dataset (Multiclass dog-car-..) besucs wen i save the imags after use the function ImageDataGenerator I saw in the folder where the pictures are saved all the pictures are mixed together, because here I don't have a folder where cat alone and cars alone ... but was befor Augmentation all in his class thanks for your answer
@_ishraqaldagamseh7664
@_ishraqaldagamseh7664 2 жыл бұрын
Great job but how can use this data in deep learning algorithms, or how can distinguish between the two classes to these data
@ankitagrawal1046
@ankitagrawal1046 3 жыл бұрын
Sir, In last you have taken two folders of image and then augmented it but after augmentation if I want to save the augmented images in two different folders, how can we do that?
@zakirshah7895
@zakirshah7895 3 жыл бұрын
hello teacher. I hope so you are doing well, Sir i just applied data augmentation on my dataset (just some simple augmentation) but when i see the output images it also changes the contrast and brightness of the images too i don't know why can you help me
@adamt7367
@adamt7367 2 жыл бұрын
Hi! This is the best tutorial I have come across, I have 1 small issue I was hoping you could help me with! When I am training a folder of images, instead of augmenting and saving 64 photos, its saving over 500 photos, its saving each image 5 times over. Any ideas? Thanks!
@helimehuseynova6631
@helimehuseynova6631 2 жыл бұрын
Hello, I am working with pytorch and I use resnet18 model for my dataset. I increased number of images for my dataset. I still get lower accuracy. What can i do for increasing accuracy of model?
@mohammadmaaz731
@mohammadmaaz731 3 жыл бұрын
I am doing image augmentation in google colab, so do i need to save images in my google drive?
@zakirshah7895
@zakirshah7895 3 жыл бұрын
Sir can you please make video on Test time augmentation for trained model
@naveenfernando1852
@naveenfernando1852 3 жыл бұрын
Hi Sir, How can we perform data augmentation when the dataset contains with imbalance data. Class A : 2000 images, Class B: 5000, Class C: 1000 images .. When we use flow_from_directly it augment all these images without any weight balancing Also in cases like this(multi class imbalance data) how can we customize the number of augmented images per class.. Because at the end, to create a accurate ml model we should input equal number of samples from each class right. Thanks and best regards.
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Please watch my video on the topic of imbalanced data. kzbin.info/www/bejne/rIClk36ErM5pfdE kzbin.info/www/bejne/jILYe6l9id91ndk
@tutankamon31
@tutankamon31 2 жыл бұрын
Thank you.
@ShubhamKumar-xy6kj
@ShubhamKumar-xy6kj Жыл бұрын
when generated from the folder,how to retrieve the labels of each image
@mehrnazmrz4703
@mehrnazmrz4703 3 жыл бұрын
That was what exactly I wanted
@gauravjha8986
@gauravjha8986 4 жыл бұрын
that is very good explanation
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Thank you.
@skullgaming5961
@skullgaming5961 3 ай бұрын
I want to the augmented images to be saved in their respective class folders, how can i do that.
@FanFanlanguageworld1707
@FanFanlanguageworld1707 2 жыл бұрын
Hello, it's little confusing with the batch_size and i>20, which one defines the nb of image augmented? what's the role of batch_size ?
@AlexDerBar
@AlexDerBar Жыл бұрын
I know I'm like a year late to this comment but if anyone still sees this, batch size inside the flow method is used when passing the generator directly to the model.fit() method when training a model. In that case the generator makes the decision on how many images it should generate per epoch/batch. That's my understanding at least.
@ashilshah3376
@ashilshah3376 10 ай бұрын
@@AlexDerBar thank you it helped :)
@refreshyourlife3099
@refreshyourlife3099 Жыл бұрын
Hi sir, please i have question, how i can saved augmented images with a specify named?
@ravinirala9990
@ravinirala9990 2 жыл бұрын
what is use of batch_size = 16, it created 21 augmented image
@govtjobs7063
@govtjobs7063 Жыл бұрын
Sir please make vedio for augmentation of mri dataset....
@reegee8321
@reegee8321 3 жыл бұрын
Hello, thanks for this video, quite helpful. I would like to perform augmentation on my target(labels). This are not images but different classes of my images. How can that work. Or can my newly generated images automatically create classes on their own?
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Doesn't make any difference if your input is images or non-images. For images you have the luxury of generating new data just by rotation and other operations. For non-image data you think of what makes sense and apply that transformation. For example, you can randomly copy some data or drop some data.
@reegee8321
@reegee8321 3 жыл бұрын
@@DigitalSreeni Thanks for the prompt response. But how do I perform augmentation on this type of data? It's a csv file (labels)
@alamintalukder1691
@alamintalukder1691 2 жыл бұрын
Thanks a lot
@aomo5293
@aomo5293 Жыл бұрын
Have y made a video showing how to work local images ?
@zhannalopuliak8782
@zhannalopuliak8782 3 жыл бұрын
Thank you!
@lilianetalba4732
@lilianetalba4732 Жыл бұрын
Thanks God this Channel😭, i'm a health data scientist and i really need to learn how to programming better
@DigitalSreeni
@DigitalSreeni Жыл бұрын
Learning to code is fun and it is not difficult, if you put in some initial effort. Good luck.
@lilianetalba4732
@lilianetalba4732 Жыл бұрын
@@DigitalSreeni thanks sir
@iftiyarkhan7310
@iftiyarkhan7310 3 жыл бұрын
great explanation
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Glad it was helpful!
@iftiyarkhan7310
@iftiyarkhan7310 3 жыл бұрын
@@DigitalSreeni Hope to get more real-life projects examples with your great explanation. glad to be a part of your channel.
@lilianetalba4732
@lilianetalba4732 Жыл бұрын
Thanks sir
@divyaramesh1146
@divyaramesh1146 Жыл бұрын
I am getting value error when i am doing for directory. It is telling, i must have rank 4 and passed an array with shape. What should i do sir
@sabaal-jalal3710
@sabaal-jalal3710 3 жыл бұрын
I am working in a project with around 9k MRI images(including augmented images), my question is can I still use my MacBook Air normal CPU for deep learning image classification, or should I buy GPU? please advice... Thanks
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
MacBook Air CPU and resources is not enough for deep learning. I am not aware of Nvidia GPU that just fits into a MacBook which means you need a new system with GPU and this can be expensive. The best way is to try Google Colab and work with their free GPU.
@sabaal-jalal3710
@sabaal-jalal3710 3 жыл бұрын
@@DigitalSreeni Thank you... I will try that.
@blblist
@blblist 3 жыл бұрын
First of all, thanks! Secondly, should not we expect the augmented data to be organised in two folders (one for each class as the original data is)? I mean, the augmentation aims to have more training data and how this will be possible if the generated samples are not labelled?
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
This video shows how augmentation is done and please do watch my video 150 where I warned about issues with keras for semantic segmentation. In that video I showed how you can save images and labels separately. In general, you define augmentation method and augment images of multiple classes along with labels based on the application.
@blblist
@blblist 3 жыл бұрын
@@DigitalSreeni Thank you so much, that's kind of you!
@ewananmo2404
@ewananmo2404 3 жыл бұрын
@DigitalSreeni Sir, I am trying to augment video data. I have extracted the frames from the video. In order for my data to make sense, I have to apply the same augmentation to all of the frames of a video. Can you please tell me how can I achieve that with ImageDataGenerator?
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Fix the seed for augmentation, it performs same operations on each image/frame.
@revanthkurakula9530
@revanthkurakula9530 Жыл бұрын
thanks a lot
@guidolippolis5436
@guidolippolis5436 2 жыл бұрын
Hi Sreenivas, I'm creating a segmentation model using traditional machine learning and my dataset is composed by 53 images. Since I think I have to use half of the dataset as train dataset and the other half as test dataset, how can I improve the performance of the model? I can't use data augmentation because I have few images, according to what you said in the video. Thanks in advance
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
It depends on what size these 53 images are, if they are 256x256 then the dataset size is too small for deep learning. If they are 1024x1024 and if the size of your objects are relatively small and you have many of them, then you can divide each image into 256x256. I assume you are referring to semantic segmentation. You may get decent results with traditional machine learning (e.g., Random Forest, XGBoost, etc.). Do not forget to consider using pretrained networks as feature extractors. I did videos on these topics, for example, videos 194 and 195.
@guidolippolis5436
@guidolippolis5436 2 жыл бұрын
@@DigitalSreeni Yes, I'm referring to semantic segmentation. I have 53 images of people's eyes, they were captured by a medical device and they are 952x940 (or vice versa, I don't remember). My task is to create a segmentation model of the 3 regions: pupil, iris and infrared rays (which are projected to the pupil by the eye tracking device). Then, I have to calculate the pupil, iris and infrared diameters
@muhammad529
@muhammad529 Жыл бұрын
i have a folder in google drive which contains subfolders of images. I want to augment all these subfolders to the count of that folder which contain maximum images. i want to store all these augmented images in separate folder
@poojithpoosa2109
@poojithpoosa2109 2 жыл бұрын
Can we use data augmentation for transfer learning and extract feature from the data then use it to classify using other ml model?
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
Data augmentation just transforms your input images. Therefore, you can treat them like any other regular image and use same approaches that you used for un-augmented images.
@sajidhussain3618
@sajidhussain3618 10 ай бұрын
@nur__bijoy
@nur__bijoy 3 жыл бұрын
well explained. Instead of saving all augmented images within a directory, I want to save augmented images into respective classes. How can I do that?
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Not sure what you mean, to your hard drive as different classes in various directories?
@wi71630
@wi71630 2 жыл бұрын
hi, when i run this code for multiple images i = 0 for batch in datagen.flow(x, batch_size=16, save_to_dir='augmented', save_prefix='aug', save_format='png'): i += 1 if i > 20: break i received an error ValueError: ('Input data in `NumpyArrayIterator` should have rank 4. You passed an array with shape', (0,))
@NisarAhmad-ch3kc
@NisarAhmad-ch3kc Жыл бұрын
It means your program in not reading images from folder. You can also read images using cv2.
@archimittal3810
@archimittal3810 Жыл бұрын
Hii,I am facing the same issue...Could you please tell me how did you rectify this error?
@exploringMyself998
@exploringMyself998 3 жыл бұрын
Can you explain the significance of using batch_size in flow?
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Please watch this video: kzbin.info/www/bejne/j17dpKqma76rnJI
@neiltripathi3680
@neiltripathi3680 4 жыл бұрын
Thanks sir ❤️
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
You are welcome!
@LimLiYih
@LimLiYih 3 жыл бұрын
Hey sir, really need your help. What if I want to do data augmentation together with PCA? Hope will get your reply!!!!! Thanks a lot
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
I never tried it as I never felt the need. But if you would like to perform augmentation with PCA then just do your PCA analysis first and redefine your X based on PCA. Then you can just augment the normal way using SMOTE or ADASYN. The keras way of augmentation is applicable to images but for structured data you can use one of the above to synthetically create new data.
@hcmftm7862
@hcmftm7862 2 жыл бұрын
dear i cant load my image any help please
@RiaD505
@RiaD505 3 жыл бұрын
not working on large dataset ..
@chouchou2445
@chouchou2445 3 жыл бұрын
hello! am i the only one who found not image and mask matching it does not pick the right mask befor augmenting please help !!!!!!!!!!!!!
@chouchou2445
@chouchou2445 3 жыл бұрын
found it ^_^ take a look on your augmented file if ever you had the same issue i can share with y what i changed
@jagilamkumarchandra2419
@jagilamkumarchandra2419 Жыл бұрын
good
@DigitalSreeni
@DigitalSreeni Жыл бұрын
Thanks
@nadeemnadeemakhtar4852
@nadeemnadeemakhtar4852 3 жыл бұрын
Hello Sir.. Sir I am using ur code for my augmentation task.. But my images are grayscale.. And hence it is creating an error on SIZE..
@nadeemnadeemakhtar4852
@nadeemnadeemakhtar4852 3 жыл бұрын
If u can help me.. It would be a great pleasure
@nadeemnadeemakhtar4852
@nadeemnadeemakhtar4852 3 жыл бұрын
When I read images from my dataset.. It always generates an erro on rank 4..and doesn't dusplay channel dimension... How to resolve this.. Kindly help me
@markcuello5
@markcuello5 2 жыл бұрын
PLEASE HELP ME
@mihretdesta9153
@mihretdesta9153 Жыл бұрын
Please reply to me, sir ...
@fatemehahmadpour711
@fatemehahmadpour711 Жыл бұрын
How convert Keras ImageDataGenerator into Numpy Array? image and label
@DigitalSreeni
@DigitalSreeni Жыл бұрын
Image data generator object give you a batch of images each time you call it. To walk through these batches of images you can use .__next__
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 108 МЛН
1 or 2?🐄
00:12
Kan Andrey
Рет қаралды 28 МЛН
бесит старшая сестра!? #роблокс #анимация #мем
00:58
КРУТОЙ ПАПА на
Рет қаралды 3,2 МЛН
💅🏻Айфон vs Андроид🤮
0:20
Бутылочка
Рет қаралды 742 М.
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 37 МЛН
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 55 МЛН
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 296 М.