Deep Learning Image Classification - Corn Kernels - Data Science Uncut

Rob Mulla · Beginner ·📐 ML Fundamentals ·3y ago
Skills: CV Basics80%

Key Takeaways

This video covers deep learning image classification using corn kernels as an example in a data science context

Full Transcript

hello everyone welcome it is Tuesday September 20th 2022 wild stuff going on we've got a kaggle competition underway that we're gonna check in on tonight I hope you're doing well wherever you are whoever you're with let's have some fun it's gonna be a quick little stream where we're gonna just talk about the it's corn competition maybe uh check out the chessboard stuff that we've been doing but probably not so if anyone's out there let me know in the chat Hey Thomas is in the chat how's it going good to see you let's have some fun tonight let's make sure that I'm also um paying attention to what's going on here you got in here quick Robert E is in the house Robert so Thomas and Robert E have you joined the kago competition yet because it's a corn classification and if anything will lend you a data science job it's being able to tell the interviewee I know how to classify corn and they're just gonna say you automatically get the job obviously you're probably gonna be executive level so we have to fire some people to to move you up the ranks and then they're going to say um not only that but we kind of we want to make sure that you have more than 50 of the stock in the company because you're so wise if you're able to identify corn with data science that you should probably be in charge of the company that's what will happen in every interview going forward if you take part in this competition odinson what's up in the chat yes stonks for sure remember when we did some stonks analysis on the stream let's look at this this is the leaderboard of our competition it's heated up odinson the legend in the chat right now is also in first place right here um I love it 0.83 I didn't think we would get that high that quickly but keep in mind only 13 days to go so this can be to your benefit let me adjust this a little bit it's got to be perfect adjust that a little bit um but it can be to your benefit that this is so quick it doesn't give the it kind of levels the playing field because if you don't have that big GPU and you're not going to train models for days and days this is your type of competition because you know I failed to mention this earlier but you're probably competing in this if you're trying to get a GPU because that is what's on the line back there the Nvidia TI 3080 you can win it if you get first place so right now if the competition was to end who knows what the private leader looks like have approximately 20 of the test data here on the public leaderboard but let's just pretend like the public leader is all there is and there's no shake-up Owens and give me your address because I'm sending you that GPU that's what's going to happen up to a hundred dollars in shipping costs handled by Yours Truly that's basically all the money I've gotten on Twitch and Subs going straight back into mailing it to you guys um but what else is up chat let me know I have been very very excited not only about this competition all the energy around it all the fun and learning experiences that we'll have with it but I've been excited about how engaged the community has been and it starts first with the discussion tab if you're new to Cargo competitions you always gotta hang out in the discussions tab I think you can I'm following this here but you can ring this little bell icon and then you will be emailed anytime that a new discussion is posted but people are asking questions we already had uh uh Korean asking about if we can use the 22k pre-trained imagenet models and I said sure why not the whole point behind not allowing pre-trained um pre-trained models is that we don't want you to have a pre-trained model that has some leak of the corn in it like if some for some reason you're training on a pre-trained Model that happened to see the corn in the test set then that would be no bueno so that's what we're trying to avoid there that's the whole reason hey clip thank you so much for saying good podcast last night it was fun to hang out with Nick Wan and learn from him and I was going over in my head and I was thinking man was I just like all over the place I hope that was actually fun and engaging but I had a great time I hope Nick I had a good time I think he did no bueno equals Malo yeah I think I learned that in Spanish no bueno I like say no bueno though oh look who it is this stallion yes [ __ ] man we are here we're hanging out data basics in the house how's it going I think David Jay is here how's it going some other streamers I hired a financial coach excited watch out though watch out chigga man those financial coaches are Financial uh they might be uh trying to up their own finances by getting you as a client okay I'm I'm always skeptical uh the corn gram this post they trained an efficient net by the way moth thanks for posting this currently in fifth place on the public leaderboard by the way uh make sure they're fiduciary yeah absolutely if they're not if if they don't have fiduciary or or whatever then they're not looking out for your best interests uh I'm running low in disk space apparently hey guys it's just rained that efficient at B zero on the data set and wanted to share some results so this is showing I think what moth is showing is that it's picking up mainly on the background which I'm not sure if it's that's a bad thing if it's like noticing how the edges are but um maybe augmentation would help with this yeah so Matt op says there's a couple ways to combat this I think some augmentations should definitely help I mean you could you could like replace the color of the background I don't know you could do a lot of change do you have to do anything sides win the contest to win the GPU um clipped yeah you need to win the com contest um and also solve 50 Mensa problems no we're not going to make it any harder than the competition you just have to win the competition and also if I didn't mention there are five deep learning Institute Nvidia deep learning Institute um vouchers on the line so second to third place you're going to win those vouchers so it's not all first place and or nothing best notebook and we're going to look at the notebooks here in a second but those will get you deep learning in The Institute um voucher and then we're just gonna give it out to a random twitch viewer so hang around I wish they gave me more than one GPU because then I would make it like a rando would also win it it would encourage more people but you know I did I did a Discord poll and I before we launched this then I said what would we prefer would we prefer to have um the winner of the competition get the GPU just a random participant of the competition get a GPU or just a random person in general get the GPU and and the votes were tied between random twitch viewer and uh oh sorry the person who won in a random participant in the competition and I feel like it gives a more incentive to try right yeah definitely if you didn't see that exclamation on on Discord uh on Twitch at least exclamation point Discord will get you to um the Discord Channel you should join and you could have given your Insight and next time maybe that's what we can do how's the music sound for everyone oh actually since then it looks like it looks like the random person who joined has started to win the poll but hey too late now when I checked it when I was making the decision it was tied seven to seven it would have been amazing if it's just a random viewer yeah hey if we get a lot of people involved in this maybe next time in video we'll give us four gpus and we can make that happen um so there's a lot of opportunities in the future make sure um by the way if you're trying to win this GPU right here you do need to register for the GT free c conference it doesn't have to be it's going on right now this week so you want to register ASAP but even if it's over already over as long as you register and watch one of the sessions the pre-recorded sessions you can check that out and you will count as as being eligible also check out my twitch oh wait you're already checking that out follow me on Twitch and check out my exclamation point YouTube channel where you need to subscribe um it's a good place to be anyways because we just hit 10 000 subscribers on YouTube so thank you all I appreciate it always a little confusing difference between subscriber on Twitch subscribe subscriber on YouTube it would be great I would would I be able to quit my job if I got 10 000 twitch subscribers I think I think that would would never happen but um I still appreciate all the YouTube subscribers that's been really fun um so happy when I see that Channel Growing but day by day thanks etsw I remember a couple people watching before yeah it was uh it was stagnant we can look over my stats if you guys want we can I could show you guys how much money I make and stuff or the lack of money that I make if it's tied it means you need to prepare it too right one win or one random I only have one GPU super LOL I wish I could 22k a month yeah maybe maybe wouldn't even be worth I could I would have a nice passive income coming in then give away my base that thing's not worth the shipping cost that's a squire base I don't think I I think I could just buy you a brand new Squire base and send it to you on Amazon it would uh it would be better so uh what else is going on okay so I want to take a look at some of the notebooks because I tried to do an exploratory data analysis notebook when we first launched I never actually made it pop public that was by accident but since then other people have made much better notebooks than I could have ever imagined and actually that's what I prefer so I'm glad I didn't make mine public we're going to take a look at some of these let's start with the most voted on um notebook and work our way down by the way I'm going to vote on all of these because they are all amazing and I think you all um I can't wait to see the uh it's corn question mark one from Mariella she always has some interesting notebooks out there some of the most unique let's say notebooks that I've ever seen on kaggle okay so starting out right out of the gate Matt op matopee responded in the discussion forum about there are ways you can combat the issues that the third place person was noticing with uh um the model they trained okay so what do we have here we have a distribution of the classes this is always good to know because this distribution isn't necessarily the distribution of the test set but it lets you know for the training set that it's in Balance we don't have a balanced uh each one of the four classes Silka is more rare pure is is the most common and whatever 22k month away what is 22k a month what does that mean um 22k a month is that Robert E what I would make if I would yeah it is it is a lot yeah that's a pretty penny uh I'm scrolling down here I missed some of the bottom depends on how much money you spend well I got I got kids so you gotta plan for the future the children are our future but there also are expenses in the future we're going to spend a lot of money on them to go to College hopefully can we use TPU absolutely not odinson no of course you that was a joke of course you can use a TPU why would you not be able to use a TPU TPU GPU I don't care what you train on um of course kaggle provides some free time of using a TPU oh shoot it just stopped my recording because I ran out of disk space on my computer I should have heeded the warnings that were coming in but you know what maybe it doesn't even matter because this is going straight up to YouTube um yeah so you can use a TPU to train that's fine it doesn't it doesn't matter to me if you're gonna pay for like TPU time on uh Google Cloud it's gonna be it's gonna cost you some money but if you use the TPU that's given to you for free on kaggle you can um train probably a pretty good model so I actually haven't trained that much using tpus other than just kind of rehashing out some other people's core code so it will be cool to see that okay so this is just a value counts of each uh oh if they're top or the bottom so keep in mind I don't even know that much about this data set other than yeah we do have the top and the bottom of the image that you're looking at could be the top of the kernel or the bottom of the kernel I don't know what the difference is technically I don't know the orientation that you make a kernel a corn kernel that is to make to determine what the top is but I think they scanned both sides or something so then the top just happened to be what was up okay train set image Dimension um I hadn't looked at the image Dimensions so they are they do range in dimensions that's one thing you're going to have to handle with your pre-processing they're not already formatted like the nist data set to clean uh Square sizes hey we got a new follower go go dude this welcome to the family we welcome every new follower to the family by the way if you subscribe this month on Twitch you get a discount I think because it's September um not that you need to but if you want to I'll do some I'll spin the wheel for you so welcome to the family let me know if in the chat how you found me uh someone in YouTube saying if you make a new Google account you get free 300 whoa I did not know that so that's cool all right so the height and the image and the width of these images are different here are some examples of uh pure corn seeds broken seeds these are discolored it's it's a nice thing to see them in actually being able as a human to visually determine like I can I can tell that these are discolored I can tell that these are broke broken I mean there's definitely some gray area there but but this uh this one like it's obviously a pure there's no pure currency than that and then silk cut so silk cut is something that um I think means that like the silk within the corn actually cause it to crack so that looks like makes sense so great notebook upvoted matte op good job I can't wait to see when you start doing more this one just blew me away so knee I hope I'm seeing that correctly knee notebook has just like a wonderful feel to it when you're scrolling through this notebook you're just greeted by these yummy looking and cute kernels corn kernels corn cobs I don't know um I like that there's a lot of uh anticipation in the the introduction talk about it and breaking down what we're trying to uh trying to predict as well as adding some humor like of course the pure corn is the best uh the best type cylinder what does cylinder star mean etsw e cylinder is that cylinder um so let's see what we have training path a test path here's a question for you all in chat how many people out there use pathlib when you're when you're referencing a file path in Python I tend to do it like this notebook does I like the autocomplete feature in Jupiter where I can just tab complete the location of the files and pathlib doesn't necessarily allow that but I know pathletic lib is a better way to do it lol imagine if the author of this notebook is an AI being tested by Google this notebook author is well um so what's this doing uh setting dark grid as the Seabourn Style making some subplots doing some count plots and these are basically bar charged with with I love the the numbers like there's some things that that I I think will never go out of style when analyzing data bar plots are so underrated I mean you can get so much across just by showing the bar plots of it you don't need those scatter not to say anything about the the plots in the last notebook but you don't necessarily always need to know like the standard deviation of each of these bars sometimes the bar will suffice but the touch the Added Touch is adding these the actual numbers to it because then it draws the the reader's eyes into exactly what the values are you don't have to look at the y-axis and be like what is this number so I like the touch on this notebook uh one suggestion I enjoy doing from time to time it's just moving these numbers down into the plot itself the bar itself and making it like a a lighter color it kind of makes it pop too I like pie more because it shows it shows bar data it also shows percentages no etsw E I was starting to like you as a chatter until you said you liked pie charts is that what you're saying and I'm just I'm just teasing you a little bit but friends don't let friends make pie charts there is nothing that a pie chart is good for Thomas why did you just randomly say seaboard so confusing I like etsw I am giving you a pass on that and I didn't want to call you out in a negative way because this stream is all about positivity but reconsider pie chart if you're gonna make one because there's no real good reason to know use a pie chart and your eye can't visually see the difference between a pie chart can I find example y Pi charts are bad I mean I I don't know if we should use this example but okay let's look at this look at look at this pie chart can we quickly tell the relationship in size between Reddit per se and Facebook quickly can you say like relative to Facebook what is the site I don't even know what this day is Mark market share in this back in 2017 so that's why Facebook's so big um and YouTube says well but I would like to see this nowadays but you can't tell relative right down here we can see Reddit here in Facebook you can you can quickly your eye can see the relative difference so this is why you should never use pie charts people there's one thing you've learned tonight it's steer clear of them I know they look cool the only good thing that a pie chart is for um I think it's XK kcd yeah this XKCD gives a good example of a good pie chart get a big advertisement fraction of this image which is white fraction of this image which is black that's like all right enough piling on I'm sorry I etsw I I want you to come back at me and and call me out on stuff I see an increase I like Sunburst chart mark sunbursts haven't used okay so this is good this all is good one thing I've I've learned too is uh matplotlib adding numbers in bar uh it used to be that the best way was to kind of enumerate over each bar and then add these these um these uh numbers right but there's a new matplotlib 3.4 version which makes it a little bit cleaner and it's this bar label method and it's a helper method to kind of add these automatically so I don't know if you use that here bar label you didn't manually or or this author did it manually which is fine it's just know that this exists and it can make your life a lot easier where's Waldo what are you talking about Robert E uh it's all about the corns we're seeing some images of each I do like I like you the fact that this author used a grid where you can kind of see a bunch of them at the same time another Pro tip here another Pro tip if you do take one of these axes every time that you iterate over them so this axis IJ and you do dot axis and then dot off you can actually remove the the grids here or the numbers here on the X and Y unless you care about those hey we got a new follower Prime welcome to the family are you subscribed using prime because you can do that on Twitch welcome to the family though yeah that would so access.off will will remove this x and y axis which sometimes can make it a little bit cleaner hey twizzers in sub month we're gonna spin the wheel for you this is our subscriber wheel we do this every time 10 push-ups let's go I got shorts thank you so much four the subscription twizards twizzards twizzies have you talked in chat much thank you so much for subscribing let me know in chat Twizzlers that's also a really nice name that you grab there are you a no yeah your crowns from 2013 so you got a good you got a good username nice enjoy your continent lurker here I love it twizzers thank you so much for subscribing that's nice of you um all right so this is this is good then talking about potential approach I I wrote a comment on this when I said keep going because this is great I want to see more uh from from this author quick start Eva and model sub this is Terps Terps who by the way I thought I clicked on terps's profile when I saw this thinking oh they're probably University of Maryland Terrapins right some sort of relation but no they're from Colorado so I was close same country corn starter using Jeremy Howard's first steps road to the top part one here's what I'll say okay so Jeremy Howard brilliant guy helps form kaggle also now works on fast.ai I had never bought into the whole fast.ai thing but I will tell you of something that should make you not make the make same mistake I did last kaggle competition that we launched first place winner used FAFSA AI I think second place use FAFSA AI a handful of other competitions I've been in winners used fast.ai it just works so and Jeremy Howard made it so definitely check that out if someone needs to get Jeremy Howard to tweet out a link to this competition and promote it because FAFSA AI is being represented big time okay this is okay right after I say that I get thrown in my face is the reason why I I was always turned off the fat to fast AI at the beginning and that's this import Star stuff what's fast that AI Robert E it's a library that it's kind of like is supposed to make it super easy for practitioners to just use deep learning but in associate or going along with the library itself uh Jeremy Howard actually has lectures and like a whole series where he goes through it and explains how to use it and it makes sense um so it's built on top of Pi torch it is and I think the newer version they were going to build on some top of something else it's like Jax or something but um yeah so the one thing I hate about fast Ai and it's like it would be so easy to fix is like don't do the import Star stuff but I actually like when I started taking the course I took a little bit of the fast AI course and I had to go through and try to clean up all the stars and then I just I don't know I still think I learned a lot from that course um so then we're looking at some of the images oh what are we doing here so is the model been trained so like I'm a little out of my element here because I don't know fast AI stuff that much but I don't think I saw a model trained yeah so here's a data loader most pie torture tensorflow whatever you do you need to make a data loader first you can just hijack one that's made public for this data set because then it saves you the time all it is is the the code that takes the images from the disk and feeds it to the model with the correct label for your eye FYI in case people are interested the fast AI course is free that's correct uh they're on YouTube right so check it out man I'm really promoting fast AI although I'm dogging on the dot star stuff import Star I don't know what's going on here learn show results where did learn did this actually train something make sure you know what what model weights these are that it's loading in here that's all I'll say about that you can ask it for clarification if the model weights are using are okay to use probably are but you just good thing to ask just to be sure hey look at this to do flip rotate proper labels for test more models think about it yeah there's a great notebook especially since it it ends on a positive note poggers now that we have a baseline let's do it this is awesome that's a great Baseline notebook too what does its score um this is there's multiple versions but I think this one had a pretty good score so Terps thanks for for making that notebook public I love it it's corn time so uh another fast AI notebook great this this notebook is using path flip this is what I was talking about before I know pathlib is is better so um better than just using strings to represent paths so do it this way if you're new new to python use pathlib but you can't see where the import a pathlib was because I think it's in this star just wanna is everyone understand why I don't like the star stuff it's quantastic data Insider says nice the reason why you use star is you're basically saying import everything from this module import everything and you and there's no way to back Trace what is in there that you're using so I think pathlib was imported here but you can't tell it very easily because there's star there little thing but when you're debugging it can be annoying get all sizes of all the images Heights and widths Min and Max okay distribution of the Heights and width this is a nice way to do it some more images um this is the cool thing about about um fast day AI good night uh so we have tapan Patel said why why do What tap on let me know what you mean and then Renato Smiles said good night and I hope that's like a good night like hello good night not a goodbye good night OS is the best uh clip says yeah OS is fine but pathlib I think is more so um backing up here when you're training a deep learning Model A lot of the times the hardest thing to do uh at first the the main thing you want to tune in your deep learning model is the learning rate and fast AI is like at least when I took the course three years ago the the biggest benefit of it is they have this building built-in learning rate finder where you can actually find what should be one of the optimum places to start your learning rate this always was tricky to me because you're not wanting to pick the valley you're wanting to pick this is showing like the loss at different learning rates you want to pick a loss that's that's on the peak of this Valley so if you start training here it's gonna find a nice tidy resting spot in this Valley here so there's also I guess a fine tuning now and then I this is I think a confusion Matrix we saw this in the other one so we can see where it's mislabeling a few of these yada yada yada great work I think this notebook scores pretty well on the leaderboard too 0.77 this will get you in the top ten um hey Rob first time seeing you in stream YouTube awesome hey pie Trader welcome pie Trader detective I know you all can't see the chat up there for YouTube people but if you're on YouTube come join us on Twitch too um I can send the link to to my account here and you can always join in both places hey give me more eyes on my stuff let me get these internet points of how many people are viewing my stuff great job um it's corn and then the fast AI Baseline is this another Baseline hey we got a new follower Telecaster Beck welcome to the family your family member now is it isn't it um what's the restaurant that's like when you're here it's family there are Bots you can set that easily which creates cross-platform chat yeah that's what I'm reading right here I'm reading the cross platform chat but it's not if you're in twitch you don't see both so I don't know abc123s in YouTube too not sure if we need the link over here yeah data Insider if you're in twitch you you don't need the link you'll just that's a repetitive that's called the infinite Loop if you just keep on clicking on that pure electric teas electric IDs welcome to the family glad to have you here let me know if you're new to to to joining how you found the stream and let us know uh by the way if you do exclamation point competition you will get a link competition if you spell it right you will get a link to the kaggle channel challenge that we've launched there is a GPU back there that's on the line we also have some uh deep learning Institute vouchers for those of you who want to join us let me know in chat how you're feeling if you have any questions ooh this is a nasty corn that's a nasty cord that's a broken corn um they're training using a convex Nano okay welcome to the family Leo the Amigo I like your username let us know in chat how you found the stream I would be interested to know where you found it submitting predictions so basically just making a test data loader that was made above and making submission nice clean and tidy nice notebook great job I've upvoted it you all should too uh corn Rob please attempt more CAG competitions live I like how the name of the notebook has a request for me great job Syed I like that uh calling me out here I so here's the deal why I don't necessarily attempt kaggle comp like really grind on kaggle like legit competitions on stream it's twofold number one usually when I'm grinding on a kaggle competition I'm not making progress and it's really boring so that's why I don't do it on Twitch as much uh and number two is once you get further into the kaggle competition like let's say you're a month into the a three month kaggle competition I think it's not really cool to share Solutions especially if they're getting people higher up the leaderboard because it's a learning process for everyone and you kind of Ruin everyone else's uh work that they've done if you just publicly share your solution so I mean obviously there are always um there are always exceptions to that and and I think usually after competition is a good place to uh go into detail but that's also why I haven't been doing too well on kaggle lately because I haven't spending a lot of time on it um it would be great if you make more reinforcement learning videos for stock prices prediction can you got any any plan for some reinforcement learning I we did some streams on reinforcement learning and it's all new to me so I'm probably not the best teacher of it but maybe I could share my learning process with um with you all if we can get into that that would be fun to work on I think with stock price prediction you can do a lot with the XG boost models that I've shown and I have YouTube tutorial on forecasting but then there's also just a lot of uncertainty that no matter what models you have unless you're using some external sources it's gonna be really hard to outbeat the market um usually like the day trader guys or the people who are making algorithms that are making these trades that make a lot of or make the hedge funds a lot of money they're making trades so fast and they're leveraging the the little dips and ups and downs in prices that go beyond what the data sources I have so keep that in mind if you're trying to make money on the stock market by making a model what's up what's going on right now it says lemon Escape welcome to the family we're just hanging out I'm drinking a a bubbly I love bubbly if your starting point is the valley where your random steep result in peripheral derivative that will never get back to Global minimum that's a good question I think the idea with that steepness is that as you train the model then the minimum actually can shift around you don't really know what the true Optimum place for your model to sit is until you're training it but that's just a good rule of thumb of where to start your learning rate and then obviously their learning rate schedulers where you're kind of manipulating the learning rate as you train your model and it kind of helps your model find a good a good Valley to sit in once it's fully trained easier to become a senator to reliably beat the market oh yeah yeah using uh Insider info is always a Surefire way to win Quant models are really if ever ever are successful yeah check out the um what was the competition that uh I want to say t-boon pick team but it's uh the competition that was put out for who could beat an index fund over 10 years and all these hedge funds tried and no one won Yo Rob what how are you Monique Snicket it's been hanging out and Leo welcome to the chat I'm so glad you're here so this isn't wait is this another fast Ai No this is just a tensorflow one uh but I answered the person's comment about wanting to wanted me to do more cargo competitions live we'll try to do it later when when we get a good one that launches right away I'll try to dive into it so this model uh is tensorflow I'm happy to see that I'm not the only one who has this number node zero issue when we're trying to code this up on Sunday it looks like it's an issue with the version of tensorflow and uh the configuration of the kaggle um notebooks so this is a convolutional 2d well this super simple model 2D Max pooling flatten that dense layer another dense layer it's getting smaller into your your last soft Max activation prediction output layer uh training with metrics accuracy and sparse categorical cross entropy that's it I didn't know about that loss function so um looks like the model I don't know if the model's training predicting a lot of pures what does this model get on the leaderboard I can't tell yeah so this is why typically this is a good way to learn to learn how to create your model by actually creating each layer itself but nowadays what most people do for image classification is they're like really smart researchers out there who have designed architectures that are proven to be really um well trained easy to train and also robust when doing image classification not only that but then people take those architectures they train them on imagenet which is a huge uh data set of of labels for images and then you kind of have a good starting weight to start with with your model but this is a great way to learn is actually make them from scratch uh inference POG Champs number three in the training so we got a split between the training and the inference notebook this notebook by bibosh bibashu I think I said that right umashu made this awesome notebook I was looking at this earlier very clean pie torch notebook first Pi torch one I saw I've seen pie torch is definitely cool really powerful more customizable I'd say deep learning library for training things like image recognition doesn't require it to be a little bit more robust uh verbose if you're gonna actually write out out all the loops for each validation and Epoch and and do backwards on your loss and all this stuff that that can be confusing to people when they're first learning deep learning but trust me if you understand everything going on in these Loops it kind of follows the same idea anytime you train a model and then you can actually add in a lot of Uh custom ways of training your model later on okay so um coding these targets into to numbers I don't know if there's actually one a hot encoding and this is the first one I don't know if other notebooks had this but first notebook I've seen with some augmentations augmentations are great way when training image classifiers to uh to really improve their performance because you do things like add random contrast uh Hue and saturation you normalize all your images and then you can even do things like um rotating the image flipping the image horizontally now normally you want to do that on your training data but not when you validate the model there is something called test time augmentation but we're not going to get into that unless you guys want to know let me know so this is training for five epochs I think it's cool all uh kind of hard-coded written all the steps to take to train a model uh it looks like the validation accuracies 0.81 so this should do pretty well on the leaderboard if that holds up it looks like there's five different folds trained one two three four five all in the 0.79 to low 8.8 range and here's the submission the public score here is a 0.65 so I don't know maybe there's a leak in the training I'm surprised I would think that it would do better on on the leaderboard but um you never know with these things keep trying still early and we are going to end actually this review um of the notebooks through this competition with none other than Mariella notebook called it's corn question mark code by Vince Vince oh so using um I like the reference uh the plant stress classification notebook using mobilenet which is a which is a pretty why only three submissions per day you shouldn't need more than three submissions per day odinson if you have good proper cross validation trust that cross validation if you notice the leaderboard consists only 20 percent the the public leaderboard of the data set so don't rely too heavily on that that leaderboard score rely more on your local validation and you'll be better off in the end yeah I think three is enough three is enough if you have a Max Team size of three that means you could potentially have each member of your team submitting once per day uh it is a short competition though we only have a few weeks left placing data into Data frame so this is like the data frame with the location and if it's trust or tester train pre-processing oh so this is using that tensorflow from what what's this flow from data frame where's the image generator imported from Keras okay so this is like a Keras version of the yesterday we're using the tensorflow Keras maybe it was an older version of creating a data set from uh folder of course this is what I was looking forward to some memes I need this card DZ gaming Force I'm not familiar with that that's awesome model evaluation uh there's always this always scares me a little bit when you see the training loss and the Val is kind of learning a lot validation does not look to be learning much so this is a sign that maybe we we don't have a good learning rate here keep in mind every data set is very different in image classifications and it kind of takes some intuition to know how to tune that um so we we have a confusion Matrix here so a lot of confusion going on here oh wait so is this just trying to predict train from test so this is like um adversarial notebook to try to see if the test is is different in any way oh and here we see some uh of the activation layers of where it's really learning what is this in video with an in Italian means Envy maybe Envy of their super talented cast two for I don't speak this language to PC uh uh that's great okay great notebook I've upvoted it uh clip to Cena have you been have you seen people iterate over random seeds in order to create some pseudo cross validation um iterate over random seeds in their train test split so there is something called um if you look in sklearn if you look in escaler and cross-validation there's a train Shuffle split so what this does is just like [Music] uh will Shuffle the data do a train test split I thought it was called train Shuffle split stratified Shuffle split there's a whole bunch of the these here be if you just did that shuffle split over and over again you basically have infinite folds that you could train on and validate on um with really small data that could be helpful um yeah yeah so check out that yeah this group Shuffle split I think is what I've used before it groups it shuffles and then you do your train test split and you can uh do it multiple times you can just do a ton of times you could I mean validation can be done all the way to the extent where you train a model holding out just one sample from the training set train as many models as you have samples and just do hold one out validation if you have the resources to do that sometimes it's helpful with big data like this a big well this is a big data set but with image data like this sometimes that's like Overkill and just getting a good cross validation is all you need uh any questions about the kaggle competition people are you is excited can I link The Notebook yeah it's a different contest yeah clip I'll take a look at it um I was gonna make this stream a little bit short tonight I hope that's cool um I hung out with Nick last night so got to bed a little later than I had hoped and I just wanted to check in on this competition because I'm super psyched about it and I hope you are too again this is running until let's look at the Timeline it's ending on October 3rd so you get so you don't have much time left to join but um there's plenty of time to learn I hope a lot of you do end up joining great corn petition data Insider with the with the comment of the day corn petition I like it search for seed and seeds just search in general oop I searched for corn petitioned for seed in seeds pumpkin seed data set no kernel puns yeah there could be a lot of those tky welcome to the family thanks for joining hope you're doing well new here using your Roberta Molotov video on some tweets for assignment I'm not using Roberta here but is that a question or are you saying that's what you're doing um I am I am oh you are doing it can you show me how you're doing that oh in that notebook search for seed and seeds which notebook oh you did link it okay for seed and seeds training on seed and then they have four random seeds to do yeah this is basically just bagging like training training multiple models multiple folds multiple seeds when you when you see like tabular competitions on kaggle back in the day had a ton of this stuff because the data was small enough that you could just like really um make sure you weren't overfitting by training more and more and more and more and more models than just stacking them I mean it's still true but um but you'll see this a lot when when you want to get that slight Boost from your model you want to make sure it's not just over fit to even those five folds in the data because remember if you check out my my YouTube channel I have a whole thing on why cross validation is so important um that's not mine what's my so I talk about in this video about cross-validation and um all you're basically doing is like more trained test splits on your train training data when you do cross validation you just just are you you're just splitting it more and more times here randomly splitting it more and more time so you're and then ensembling these models is basically just averaging all the predictions so you see here they're dividing by the number of Folds and uh if they're doing I don't see the um trend.k fold I don't see where they're actually changing the splits but I I believe that's what they're doing here is they're just training like four times as many models and they just added a bunch of random seeds in there uh just stacks on Stacks yeah this is kind of like stacking so stacking is a little bit more complicated than that stacking is training a bunch of models and then training models on the results of those models so it's as a really tricky thing to do and a really easy thing to mess up when you're working on a kaggle competition because um I think a lot of the top people say it's not necessary most of the time but another some other top caglers swear by it so take everything I say with a grain of salt the good stuff is a nice simple boost model like light GBM with the subtle hyper solid hyper perimeter tune yes but remember tky TK York when you're tuning parameters for a model how do you know they're the best if you only have the training set what is the best well the best would be a model that could perform with 100 precision and recall and accuracy and all that stuff but aside from that how do you determine what model is better than the other what parameters are better than the other this is always the question that you need to be asking yourself as you're training the models because it's dependent on how you validate the model that's why setting up a good cross validation is important because you can overtune your parameters to be good to just one train test split or you can overtune your parameters to be so tuned to the 5K folds that you have um anything's possible but this person is actually trying to uh tune to multiple seeds pick a parameter like AUC agree um AUC is the metric though how is stacking different than mice I don't what is mice mice is multiple imputation by chained equations oh basically missing data is predicted by observed data using sequential algorithm so this is like imputation techniques it seems like mice so that's another thing you can do um that's really powerful in competitions is it's not it's kind of different than all this but very similar um in the fact that you're just trying to tell the model more and more what to focus in on so when you stack your models you're kind of saying like here are the errors of my model now make these better and that's kind of what a boosted tree does anyways is it's building its next tree to minimize the loss of all the previous ones but the um the other trick is actually doing feature encoding or Target encoding it's called so I I one of the competitions I got my solo gold medal in that was a key to uh doing well in that competition was actually taking the raw values bucketing them into like certain buckets and then just straight up encoding what the most common Target is for that bucket mace is a package for R that's why I'm not familiar with it um so I I did on abhishek's channel did uh stream with him about filling in missing values let's see if it comes up if we just search on YouTube this is Incognito so kaggle missing values machine learning here we go this one I go through and I I talk about let's put this in here I talk about some of the approaches for missing values and you can do like drop those values you can just leave them alone you can impute um and then you can even use models that impute the values um like light use light GBM to impute those values so I'm going to put this in the chat check out subscribe to his channel too if you haven't already um okay do we do I have the energy to do some more stuff or we we could just talk about the corn competition tonight and ending here feel like I can open up a whole can of worms if uh if I go into some of this other stuff but take a break okay TK York you're right yeah I hope this stream was good short and sweet and we talked about the competition please join it if you haven't already just being on the leaderboard helps me out and really it does help me out a lot if you attend GTC oh one thing I wanted to talk about was uh with GTC uh they did announce some stuff today so yeah use this link guys I'm going to put it in chat please sign up using this link it helps me get prizes like this in future competitions and I I think it'll make the channel more exciting um yeah he's saying whatever exactly what my profs say what are your perf oh I'm saying what your professors say nice that's that's good it's good that I'm not saying the opposite of them I don't want to be setting you astray so uh yeah check out that let's check out Nvidia let's see what news came out of Nvidia today Nvidia delivers Quantum Leap in performance what introduces New Era of neural rendering with geoforce RTX 40 series so I'm sorry to say it but that GPU is going to be a little bit out of date but still you doing it for free it's not a 40 series um these look sweet it's my Christmas present I want one of these for Christmas not gonna get it but I want it I don't get that into the tech specs but I'd be interested to see how well these do on um like are they focused on gaming or are they do they have like actual deep learning uh gpus they're they're coming out with video Studios tries to soothe over investor angst I don't have angst uh 48 is 16 gigabytes I think that's pretty good oh is the price really high um let's do YouTube here's some of the highlights that looks pretty sweet turn the volume down on this Ray tracing to do direct illumination from millions of Lights casting Shadows from all lights rtxdi is used a lot of details on the light see we're not as too tired as a new frame focused on the the graphics results of it although I'm sure it's going to look awesome let's see let's see what the looks like I'm going to be straight up honest with you guys I don't game as much as I used to I have been playing a good bit of Elden ring the right does look better but they both look pretty good that looks amazing that looks absolutely amazing and granted we're we're watching like a stream 1080p version of what this probably looks like in 4k or whatever on your on your machine when you're running an actual GPU we created an Omniverse application so a lot of good announcements coming out of GTC register hangout check it out thanks who has time to game I know I I've actually been making time lately I've been making time for it with um it's like been my thing for relaxing I've been playing on my laptop in bed because my Linux machine can actually run Elder ring better than my Windows machine so love that love that can run Linux games nothing better than that that was like really the only thing holding me out from just completely abandoning using using Windows and I don't think I've logged in my windows version or drive or whatever in a long time so uh yeah thanks everyone for hanging out tonight again sign up for the competition if you haven't already let's get hyped I don't think I'm going to be streaming on Thursday um so because there is a football game I want to watch so probably on Sundays the next time you'll see me but hang around uh let's go ahead and raid Nick and and have a great night Nick had me on his channel his stream yesterday which was a lot of fun and we're going to raid him today give him hype hype hang around for him he ask him about corn well when we raid let's have a lot of positivity but also ask his ask how he feels about corn in general I know corn had some connotations a while ago and na then there was like the corn Kid meme where he's talking about how much he loves corn that's was really why I yeah etsws talk about some stuff so uh yeah we're talking about the the good stuff all right so let's raid Nick I'll see you all maybe on Thursday probably not probably on Sunday and uh hope you guys all stay positive love you all have a great rest

Original Description

In this live stream we talk about the Third PogChamp Competition - corn classification. Join for your chance to win a brand new GPU. We review some of the notebooks posted by viewers like you. - Link to the competition: https://www.kaggle.com/competitions/kaggle-pog-series-s01e03 - Register and join NVIDIA's GTC using this link to qualify: https://nvda.ws/3Qb0b9x Follow me on twitch for live coding streams: https://www.twitch.tv/medallionstallion_ My other videos: Speed Up Your Pandas Code: https://www.youtube.com/watch?v=SAFmrTnEHLg Speed up Pandas Code: https://www.youtube.com/watch?v=SAFmrTnEHLg Intro to Pandas video: https://www.youtube.com/watch?v=_Eb0utIRdkw Exploratory Data Analysis Video: https://www.youtube.com/watch?v=xi0vhXFPegw Working with Audio data in Python: https://www.youtube.com/watch?v=ZqpSb5p1xQo Efficient Pandas Dataframes: https://www.youtube.com/watch?v=u4_c2LDi4b8 * Youtube: https://www.youtube.com/channel/UCxladMszXan-jfgzyeIMyvw * Twitch: https://www.twitch.tv/medallionstallion_ * Twitter: https://twitter.com/MedallionData * Kaggle: https://www.kaggle.com/robikscube #kaggle #python #livestream
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Rob Mulla · Rob Mulla · 37 of 60

1 A Gentle Introduction to Pandas Data Analysis (on Kaggle)
A Gentle Introduction to Pandas Data Analysis (on Kaggle)
Rob Mulla
2 Exploratory Data Analysis with Pandas Python
Exploratory Data Analysis with Pandas Python
Rob Mulla
3 7 Python Data Visualization Libraries in 15 minutes
7 Python Data Visualization Libraries in 15 minutes
Rob Mulla
4 Kaggle competition starter notebook walkthrough
Kaggle competition starter notebook walkthrough
Rob Mulla
5 Kaggle Competitions: A Beginner's Guide to Winning
Kaggle Competitions: A Beginner's Guide to Winning
Rob Mulla
6 Jupyter Notebook Complete Beginner Guide - From Jupyter to Jupyterlab, Google Colab and Kaggle!
Jupyter Notebook Complete Beginner Guide - From Jupyter to Jupyterlab, Google Colab and Kaggle!
Rob Mulla
7 Audio Data Processing in Python
Audio Data Processing in Python
Rob Mulla
8 Complete Data Science Project!
Complete Data Science Project!
Rob Mulla
9 Make Your Pandas Code Lightning Fast
Make Your Pandas Code Lightning Fast
Rob Mulla
10 Image Processing with OpenCV and Python
Image Processing with OpenCV and Python
Rob Mulla
11 Speed Up Your Pandas Dataframes
Speed Up Your Pandas Dataframes
Rob Mulla
12 This INCREDIBLE trick will speed up your data processes.
This INCREDIBLE trick will speed up your data processes.
Rob Mulla
13 Complete Guide to Cross Validation
Complete Guide to Cross Validation
Rob Mulla
14 Easy Python Progress Bars with tqdm
Easy Python Progress Bars with tqdm
Rob Mulla
15 Economic Data Analysis Project with Python Pandas - Data scraping, cleaning and exploration!
Economic Data Analysis Project with Python Pandas - Data scraping, cleaning and exploration!
Rob Mulla
16 Python Sentiment Analysis Project with NLTK and 🤗 Transformers. Classify Amazon Reviews!!
Python Sentiment Analysis Project with NLTK and 🤗 Transformers. Classify Amazon Reviews!!
Rob Mulla
17 Get Started with Machine Learning and AI in 2023
Get Started with Machine Learning and AI in 2023
Rob Mulla
18 The Trick to Get Unlimited Datasets
The Trick to Get Unlimited Datasets
Rob Mulla
19 Video Data Processing with Python and OpenCV
Video Data Processing with Python and OpenCV
Rob Mulla
20 Object Detection in 10 minutes with YOLOv5 & Python!
Object Detection in 10 minutes with YOLOv5 & Python!
Rob Mulla
21 Pandas for Data Science #shorts
Pandas for Data Science #shorts
Rob Mulla
22 Object Detection in 60 Seconds using Python and YOLOv5 #shorts
Object Detection in 60 Seconds using Python and YOLOv5 #shorts
Rob Mulla
23 Machine Learning for Facial Recognition in Python in 60 Seconds #shorts
Machine Learning for Facial Recognition in Python in 60 Seconds #shorts
Rob Mulla
24 Time Series Forecasting with XGBoost - Use python and machine learning to predict energy consumption
Time Series Forecasting with XGBoost - Use python and machine learning to predict energy consumption
Rob Mulla
25 Detect Text in Images with Python - pytesseract vs. easyocr vs keras_ocr
Detect Text in Images with Python - pytesseract vs. easyocr vs keras_ocr
Rob Mulla
26 Solving an Impossible Riddle with Code
Solving an Impossible Riddle with Code
Rob Mulla
27 Do these Pandas Alternatives actually work?
Do these Pandas Alternatives actually work?
Rob Mulla
28 Time Series Forecasting with XGBoost - Advanced Methods
Time Series Forecasting with XGBoost - Advanced Methods
Rob Mulla
29 Data Science Uncut - Data Shootout Kaggle Competition (Aug 1 2022 Stream)
Data Science Uncut - Data Shootout Kaggle Competition (Aug 1 2022 Stream)
Rob Mulla
30 Kaggle Dataset Creation from Scratch- Data Science Uncut (Aug 10 2022)
Kaggle Dataset Creation from Scratch- Data Science Uncut (Aug 10 2022)
Rob Mulla
31 Chess Board Computer Vision AI - Data Science Uncut (Sep 7, 2022)
Chess Board Computer Vision AI - Data Science Uncut (Sep 7, 2022)
Rob Mulla
32 25 Nooby Pandas Coding Mistakes You Should NEVER make.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
Rob Mulla
33 DEFCON Hacking AI CTF Solution on Kaggle - Data Science Uncut Sep 11, 2022
DEFCON Hacking AI CTF Solution on Kaggle - Data Science Uncut Sep 11, 2022
Rob Mulla
34 More Chessboard Computer Vision AI - Data Science Uncut - Sep 13
More Chessboard Computer Vision AI - Data Science Uncut - Sep 13
Rob Mulla
35 Medallion Data Science Live Stream
Medallion Data Science Live Stream
Rob Mulla
36 Community Kaggle Competition Overview - Corn Classification (
Community Kaggle Competition Overview - Corn Classification (
Rob Mulla
Deep Learning Image Classification - Corn Kernels - Data Science Uncut
Deep Learning Image Classification - Corn Kernels - Data Science Uncut
Rob Mulla
38 OpenAI Whisper Demo: Convert Speech to Text in Python
OpenAI Whisper Demo: Convert Speech to Text in Python
Rob Mulla
39 Yolov7 Custom Object Detection in Python Tutorial  - Chess Piece Detection
Yolov7 Custom Object Detection in Python Tutorial - Chess Piece Detection
Rob Mulla
40 Live Kaggle Coding - Enzyme Stability Prediction - Data Science Uncut Sep, 27 2022
Live Kaggle Coding - Enzyme Stability Prediction - Data Science Uncut Sep, 27 2022
Rob Mulla
41 Finding Chess Cheaters with Python! - Data Science Uncut Livestream
Finding Chess Cheaters with Python! - Data Science Uncut Livestream
Rob Mulla
42 Data Science Uncut - Kaggle Community Competition & Chess Data Analysis - Oct 4, 2022
Data Science Uncut - Kaggle Community Competition & Chess Data Analysis - Oct 4, 2022
Rob Mulla
43 Flight Delay Dataset Creation (Data Science Uncut)
Flight Delay Dataset Creation (Data Science Uncut)
Rob Mulla
44 5 Reasons to Kaggle #shorts
5 Reasons to Kaggle #shorts
Rob Mulla
45 ♟️ Data Science - Chess Data Analysis
♟️ Data Science - Chess Data Analysis
Rob Mulla
46 EXTREME PYTHON & DATA SCIENCE LIVE STREAM
EXTREME PYTHON & DATA SCIENCE LIVE STREAM
Rob Mulla
47 What is Clustering in ML?
What is Clustering in ML?
Rob Mulla
48 What is K-Nearest Neighbors?
What is K-Nearest Neighbors?
Rob Mulla
49 LIVE CODING: Flight Data Exploration with Pandas & Python
LIVE CODING: Flight Data Exploration with Pandas & Python
Rob Mulla
50 Kaggle Survey vs. Twitter Sentiment
Kaggle Survey vs. Twitter Sentiment
Rob Mulla
51 If Top Chess.com Players were STOCKS - Live Coding Data Anaylsis Stream
If Top Chess.com Players were STOCKS - Live Coding Data Anaylsis Stream
Rob Mulla
52 Data Visualization BATTLE!
Data Visualization BATTLE!
Rob Mulla
53 LIVE CODING: Stocks & Sentiment Analysis
LIVE CODING: Stocks & Sentiment Analysis
Rob Mulla
54 Progress Bar in Python with TQDM
Progress Bar in Python with TQDM
Rob Mulla
55 Flight Cancellation Data Analysis
Flight Cancellation Data Analysis
Rob Mulla
56 Synthetic Dataset Creation for Machine Learning - Blender and Python
Synthetic Dataset Creation for Machine Learning - Blender and Python
Rob Mulla
57 The Ultimate Coding Setup for Data Science
The Ultimate Coding Setup for Data Science
Rob Mulla
58 Dataset Creation SPEED RUN - Live Coding With Python & Pandas
Dataset Creation SPEED RUN - Live Coding With Python & Pandas
Rob Mulla
59 Data Wrangling with Python and Pandas LIVE
Data Wrangling with Python and Pandas LIVE
Rob Mulla
60 Forecasting with the FB Prophet Model
Forecasting with the FB Prophet Model
Rob Mulla

Related Reads

Up next
Arrays vs Lists: What AI Actually Prefers | Common Tech Interview Questions
SCALER
Watch →