Kaggle Challenge (LIVE)
Key Takeaways
The video demonstrates a Kaggle Challenge, specifically the $100,000 TGS Salt Identification Challenge, using a combination of Google Colab, Conditional Random Fields, and neural networks, with a focus on exploratory data analysis, model building, and Q&A.
Full Transcript
alright we're about to go live I'm gonna start streaming and there we go okay here I come I'm gonna about to go live alright hello world it's Suraj and in this livestream we're going to be solving this Cagle competition this is a $100,000 salt identification challenge right on Kaggle as you can see right here there's a month to go still so there's still time to compete in this challenge and there are 2100 teams across the world that are competing for this 100k prize money and of those teams I am one of them and what I'm gonna do is I'm gonna try to win that prize money in this live stream because I'm crazy we'll see how far I can go right and I'm gonna do it with you what I want you to do both my livestream people in the house right now and my recorded viewers who are gonna later watch this video is I want you to fire up a Google collab notebook so just go to collab dot research google.com and I want you to fire up a notebook why am I saying this because you don't have to deal with the dependencies that's why we don't want to have to deal with that too locally and we can use collab to do that okay 100 K exactly so that's what we're gonna do in this livestream let's let's take a look at this data okay and you might be wondering what model are you gonna use for this right well I'm not gonna tell you because that's my secret no of course I am it's called a unit it's a unit it's a type of convolutional network we'll talk about that later but we've got to do some exploratory data analysis first okay hi everybody okay so that's what we're gonna do and let me just say ten names and then we're gonna get started Varun Satya Sun deep sigh Steve Omar and Rashad and Roger alright so sand smart sniper alright so and I'll do a Q&A later on but let me just get this get this thing started okay so they want to so they want to find they are oil and gas companies they want to find where salt deposits are in the earth and you might be wondering why because it turns out that where there is a lot of salt there's also there tends to be a lot of oil and gas and why do they want oil and gas because they can sell that right and so these companies make money by drilling under the earth finding oil and gas and selling that and so right now a lot of this is done by humans right geophysicists they're trying to predict where salt is going to be they have to use human vision to analyze these seismic images and see and try to discern whether or not salt is present and if it is present then it's a good idea to drill there but the problem is if a human wrongly classifies some piece of land as being salt rich then they have to waste company resources by drilling in that land right so they don't want to do that they want to be very efficient so we want to use machine vision to figure out which of these thousands of images have solved and once we find that then we can dedicate all of our time and resources and human capital towards that region of the earth to find the oil and gas how do we do this well well it turns out if we look at the data the data that they've given us what they've given us is a set of images inside of this test and Trank test and train file there's a train dot CSV there's a test that zip and this contains images ok so let me just join this competition real quick all right there we go so right I've accepted the rules there we go there we go so it's got an ID and it's got a mask and what we're gonna do is we're gonna visualize this inside of colab and then we're going to perform some exploratory data analysis and then build our model ok so that's a bit of our background let's just get right on into this ok so I want you to in collab with me start installing four dependencies that we're going to need that are not pre-installed here ok so the first one is going to be image IO because we want to deal with images right this is an image data set I'm also going to show you how to import a Kaggle data set into collab ok so we're going to do that as well so we're gonna we're gonna install image IO which is going to help us with image processing we're gonna also install PI torch to build our deep learning model ru net model why am I using hi torch all the cool kids are using pi torch I am one of them and so are you probably so let's just let's use some PI torch okay also tensorflow is cool I know Google is watching I know Cal goes out there I love you guys as well look I am so much less how do I say this religious about a specific framework I you know sometimes you got to use PI torch sometimes you got to use a little bit of tensor flow whatever works whatever if there is an existing implementation of whatever you want to build and it's already on github I don't care if it's in CUDA just use it write whatever is there build off of it and then switch it to whatever all right so we're gonna use PI torch what are you guys even saying that seriously disrupt my core with AI at Google Amsterdam you guys are like on something anyway so PI torch Kaggle as well of course that's how we're going to import the data set and then lastly PI widgets which is gonna be like a little graphical thing for to see how the model is you know training it's a little visual thing for us so it's called PI widgets so what I'm gonna do is I'm just gonna go ahead and install all of these with this that's it just for and now it's gonna do some dependency installs for us in the browser using a GPU this is a GPU runtime environment boom image i/o successfully installs to torch is gonna take a while for sure in the meantime while this is loading let me answer some questions here hi can you say some use cases for training on KL divergence loss function oh wow interesting yes for sure so neural style transfer is one example that so for those of you who don't know KL stands for I'm gonna mispronounce this callback Leibler divergence okay the Colback Leibler divergence it's also used in some adversarial models so generative adversarial networks it's used sometimes there but neural style transfer whenever you want to take the style of an image and put it on another one whenever you want to do an adversarial model that could be a good use loss function actually for adversarial models that's one of the hottest areas of research right now is figuring out what a good loss function for an adversarial Network would be those are two do you watch anime no I used to watch Dragonball Z but now I just make content and run the school of AI that's that's what I do hooray for pi torch how do you easily decide the ml algorithm to choose that is the that is the value that you bring as an AI researcher as an as a data scientist as a machine learning person figuring out what model to use right that's that's what you bring so how it's not it's not a simple process you just have to get a feel for what all these models are good for and when to use them it's an intuition that you have to build is Google collab faster than spider I have to say I haven't used spider before can you explain about active learning active learning is learning in real time it's adaptive I would say reinforcement learning is can be mostly categorized into that field of particularly uh relating to optimizing some network of say Internet of Things devices or a supply chain or some kind of real-time pipeline of delivery or whatever how to get better at EDA look at github repositories look at these Jupiter notebooks watch my live streams hit subscribe if you haven't yet that's how you get better please make awed mented reality models in videos augmented reality models of machine learning interesting when there is a good augmented reality device that's accessible to consumers I will do that not magic leap Apple will do it let's just be real Apple will be the one to do that in 20 I think it's 2022 or 2020 when Apple releases their AR device that is the moment that AR becomes mainstream give me motivation please okay I the fact that I'm even here should be enough motivation for you right I could totally mess this up right now but that's it mm or MGK mm okay okay great so this installed okay we don't even need pi pi widgets actually that's just a nice to have let's keep going here so now we're going to import our dependencies so we're gonna first import OS that's gonna be for our file input/output because we're gonna have to deal with files we're gonna import numpy to do some matrix math we do that every time we do machine learning of course we're gonna import image i/o like we just installed map plot lights so that we can do some exploratory data analysis pandas so we can do some data pre-processing torch which we already installed and then we need to just in case we need it like a backup dataset let's import the torches torches like backup data thing so that's that that's that's us importing our dependencies okay so now I'm gonna show you how to import data from Kaggle into Google collab all right so that's that's what I'm gonna do here so let me just compile this import great it worked and so here's what we have to do we're gonna say so from Google collab import files and we need to import a specific file here let me show you what I mean so we want to connect kaggle to Google collab so we're gonna run this and so this is going to give us an interface to upload a file to Google : so what we're going to do is we're going to go into our Kaggle account go under my account this is like a throwaway like super old account so I don't even care and then go to go to the API and create a new API token okay what it's gonna do is it's gonna download a file called Kaggle JSON okay i'm gonna rename this to Kaggle json because i already have one Kaggle json good and then we're gonna upload that file to google collab so I'm gonna say choose files on the desktop Kaggle JSON and I did that okay right cackled dot JSON there we go okay there we go upload it awesome it's there now so now that that's there let's check if it's there okay so what we can do is we can run a command line like a command here so we can say let's do an LS and let's ensure that the file that we just uploaded is indeed there it's it's right there perfect so now that the file is there we can were connected to the catechol api and the reason I did this is because we want to import that data set directly from Kaggle into collab and this is an important skill by the way you're gonna need this so pay attention here so what I'm gonna do now is yes all this script is gonna be uploaded right after the live stream guys there has to be some kind of pomp and circumstance here I can't just give you everything from the start right you got it it's got to be a journey so that that's how it goes so now let's do some configuration so the kaggle api client actually prefers that we store that we store it somewhere what's the Tildy Tildy mark it's like this thing right so we need to store it in the kaggle directory so it's that's where it's gonna expect it to be and then we can once we do that we're going to copy that file to that directory that we just created okay that's what we're doing right now we just created this directory this dot kaggle directory and once it's there we have to chmod it can anybody tell me what chmod does a little bit of UNIX quizzing for you hello we're all did Siraj so if somebody came here just for that so I thought I would so chmod 644 going to say just give it the permissions that it that it needs because we're gonna access this file in a second all right so that's it for our file configuration all right good and now check this out check this out we can download our data set directly from taggle good exactly yes unis unix permissions yeah exactly copy that I don't care you know so we're gonna download it exactly from from there so what we can do is you go here see here it is we can just copy this and paste it here okay and now we can download this data set directly into Cola yes good good mm-hmm yep that's that's how it should be that is how it should be now I'm gonna unzip it so I'm gonna say well what do we have here okay it's all here all of those files are now here within LS remember exclamation point before LS now once we have that we're going to want to unzip this trains it file right we because we want to see these images we can't just you know have it be a zip file so now it's going to unzip all of those images and there are quite a lot I think there's 1800 of these images when will the school of a I workshops start that is a great question we have a lot to do and look for midterms midterms so five weeks in midterms are when I'm gonna feel like we'll all be ready to do uh a little you know global hackathon kind of deal no promises but we're gonna do something big for sure guys there's way too much that's coming I don't want to say it I don't want to I don't want to say what's happened what's gonna happen like there's too much you guys aren't even gonna believe it so I don't even want to get to hype right now so there's a lot of stuff coming like in general that it's gonna be amazing so anyway so we downloaded all those images and where is it okay that's a lot right that's a lot of images oh my god hold on that's a lot am I really gonna scroll through all this what okay okay there we go so those are all of our images hello Germany okay all right so now we're going to create a class to represent our data set so we've downloaded our data set we connected it from Kaggle and now we are going to create a class for it okay so our class is going to be just see where we are right now cool cool cool everything's going well our class is going to be TGS salt data set that's what I'll call it and the input will be the data set that we have alright that's it so this is just a basic like pre-processing class you know simple stuff but we're gonna initialize it with the location of the data set and the list of files by that I mean the images now let me set that root path to remember this is the constructor function so there's just some basic initialization steps here and once we do that now we're going to create two getter methods the first getter method if this is really just for us to be able to access what's inside of this this inside of the data we're just gonna return the length of the number of images that we have so you know we just needed a function that will tell us how many images we have that's that's it and then we need another function that's going to get one of those images so we can actually process it and and do things with it so by the index so we'll give it a value an index value and we'll say somewhere at this index we want to we want to retrieve whatever you've got so the file ID is going to be we're gonna give it the index that's gonna be the place in the file list array that's gonna be our file ID and then we're gonna give it the image folder and this is where we use the OS command that I talked about earlier the operating system are not command the library and we're gonna join the root path with the images now it's not enough to just have the folders we're gonna have the path as well the image path okay so we're gonna do this not just for the image but for the the mask so let me talk about the mask as well we have a mask mm-hmm image folder file ID and plus dot PNG all right that's our image folder in our image path okay so file id image folder image path and that's good that's good for that now so this is let me just comment this so this is gonna be for our image folder plus path now we actually need another one for the the label folder plus path so what is our label here so let's let's let's I'm gonna visualize this and then it'll be much more interesting but right now I want to just say the the label is going to be I'm just going to copy this actually the label is gonna be the the masked image of the salt and I'll show you exactly what I mean by that but it's gonna call him it's gonna be called mask folder it's gonna be called mask path and we're gonna use the same operations except this is gonna be the root path that's gonna be called masks and then this is going to be called the mask folder okay mask folder plus file ID plus PNG that makes sense okay now we have both of those now we can read it read it and store it in memory so remember these are not formatted for a proper data pre-processing that's what we have to do so we're gonna convert these into byte arrays using the image IO library we're gonna read whatever that what that data directly and we're gonna convert it into a byte array right here and P dot u int 8 uh-huh D type I think that works I feel like this should be highlighted D type equals u int 8 right No uh-huh yeah that's fine so that's that and now we want one more and that's gonna be for the mask and that's gonna be an umpire array we're gonna read that one as well and that's gonna be the mask path that's path so now that we have both of those now we can return them both right so this is this is just that basic class we wanted to make data pre-processing step and now we can finally return both the image and the mask why I buy it array because that's that is what our neural network will fit will expect it's gonna need a vectorized format right it's gonna need a vectorized format now the number of dimensions that your input data should be will depend on your neural network for the unit in particular we're gonna do it this way and I'll tell you why when we build the unit okay we've got some people typing in Russian in the chat and all sorts of languages which is amazing it's amazing to see that we have a very global community here and yeah I just feel very honored to have everybody here both my lied and my recorded viewers thank you for being here okay so now that's it for that for that class Wow it did not it actually worked okay let's keep going I'm getting too good at this so now we created that now we're gonna initialize it we're gonna actually use that class that we just initialized so we'll read or use pandas to read that CSV file first right the Train of CSV which contains the IDS for the images as well as the mask and I'm about to visualize it so we can finally see what I'm talking about here there's also one more data point that is really interesting and that's the depth data and that's in its own CSV file now what we can do is we can think of that depth file as a feature that we're going to input into our model right so just well think of it as a feature and if we think of it as a feature then the idea of using a neural network where the network is just we don't have to do any feature engineering right we could just input all the features we need into our model and it's going to just figure out what the relevant features are right that's the idea so do we really know if it's going to be do we really know if it's going to be a relevant feature who knows we're gonna have to visualize it alright so now that I okay dot values all right lists mm-hmm good depth what's the deal here file B depth dot CSV really Oh depths with an S okay now let's visualize this okay so now that we've imported it we can we can visualize it so we're gonna say plot a two by two array this is gonna be an image using the image and the mass so we're going to plot them side by side so we can see what the difference is and we can also we can just analyze it alright so we're gonna create a plot here and image show the image okay so actually no no we're gonna say subplots we have we're gonna create a subplot and so for each of these accesses we're going to plot a different image so we have to plot our original image now next to it we're gonna plot our label what is our label our label is going to be our mask you might be thinking why is a mask considered a label well the reason is because we want to segment the salt and we want to say that it is different from the input image okay so set title and this is just for two firm eight to make it pretty a little bit image and then set the title the mask the mask the movie the mask all right that should work good now we can finally print it out all right just two lines and then we can finally see these images for for let's just do five images let's say and we're gonna print out both the images and the masks from our data set and which ones well let's just randomly pick one between zero and you know however big the data set is so the length of the data set and yeah and then we'll finally plot it using our function that we created earlier image mask what's the deal AXA are are is not defined oh okay MSHA is not defined oh oh right that's a that's a dot method gotcha how about now yes good good very good very good check this out so so supervised learning it's super easy we're gonna get into reinforcement learning next week don't even worry I have so much reinforcement learning content coming for you you won't even be prepared that's how much I have coming for you but right now let's focus on supervised learning right so salt identification what they've done here is they created a mask and what the mask does is it segments the salt in this seismic image so on the Left you're seeing the raw seismic image of the of the earth right the layer of the earth that it's that it's capturing right next to it is the mask and the mask is our label because what the mask does is the white area is where the salt is or no the black area is where the salt is so its segments out the salt for us so we can see that okay in the first image that's all white so there's no salt but in the second image yes there is some salt there in the third image not so much fourth fifth set so that's how we are that's the label that we're trying to learn there is a mapping so consider the input a matrix of numbers of pixel values right because it is it's a matrix of pixel values and we want to be able to map learn that mapping between that matrix of pixel values and the label matrix pixel values so just think of it as lines connecting all of them and there's this there's a there's one single function that we can learn and this is the perfect optimal function that exists somewhere out there in time and space on this hyperplane of curvature of optimization right the optimization landscape it's like a bunch of hills and valleys and we want to find the ideal parameters for our function write that function is going to be this beautiful black box where we input the image and it's going to output the mask which is going to tell us whether or not salt is there only problem is we have to learn this function we've got to learn those weights and the search space for those weights is massive they could be anything so what we're going to do is we're gonna use a very good model a very I don't want to say great but a very good model to learn this function okay so great so now we saw that okay let's just just for fun let's just also plot the distribution of depths so we can see cuz there's this other interesting statistic that we could use here called hello chill a Hello Pune and hello Paris we even have beans in the house guys Dean's our Dean's are here to help you write the the Dean's of school of AI and there are about 800 of them we're not accepting applications for new Dean's we still have to build the infrastructure that we've that we're working on right now but after a while we will start accepting you know new applications for Dean's give us maybe like two or three months but our Dean's are here to help you and they're 800 of them so definitely you know ask them questions they're here to help ya why so salty I was waiting for someone to say that good job truly truly a funny person all right so so now we're just gonna plot the distribution of depth depth just because it'd be interesting to see and then we might use that as a feature depending on what it looks like because we want to see if there's a correlation here we'll just call it depth distribution it could be interesting okay there we go so what this is showing us is a distribution of depths for all of those images so the depth is a number it's a scaler it's a single number between between 0 and 800 and as we can see here and what it's doing is its measure this graph shows us that hey most of the there it's most of the depth values that the the middle range of depth values is between four and six hundred it's about 500 H now what would be interesting is to see the correlation between these depth value and the the the occurrence of salt in the image so maybe we could even maybe we could even see what that looks like right so there is one thing I want to mention though is that is that okay so the image is actually so we look in the data file will notice the image is actually in this run length encoding mask it's an or le mask which is just a bunch of numbers so run length encoding by the way is I mean there there are many different types of encoding schemes out there right but this is one of them and it's a compression scheme and run length encoding is basically teal you are it's it's it's a lossless data compression technique that says you know remember images are matrices right they're matrices of pixel values and in a single row the same value could be repeated multiple times right so let's say that value for simplicity sake is just the letter B or it's the number 255 and if it's repeated eight times in a row well we can just say eight B or eight 255 as we see right here represents all those values and so if we just store it like that that's less space and it and then we can like we can decode it I was looking for the word we can decode it later so what we need to do is remember how we said we need to do some data pre-processing to input it into our model this is another data pre-processing step we have to do we have to convert that run length encoding scheme into an actual vector that we get input into our u net which I'm going to talk about before we build by the way we have to go over how units work so we have our width we have our height we have our number of rows and columns right just the width and height of our image okay so I'm gonna do a try block here because I want to because there could be an exception and what will catch the exception there but what we first want to do is get all of those numbers and then those pairs so by numbers remember I said 8b so eight is the number in that list so we want to get those numbers so get all of those numbers for the RL e string and the string is what is specifying what that RL e file you guys are all over the place in the chat by the way you guys need to not be talking about vgg okay we're talking about you nets ok vgg is not as good for this it is objectively worse that's I'm saying that right now a vgg is objectively worse for this problem than a unit why just pay attention and you'll see you'll see why okay all right I love you guys by the way so let's get back to this alright so that's are those are hourly numbers but that's not enough we also need our pair values remember those pairs there's just they're a bunch of these pairs so we're gonna retrieve both of those and it's going to be a numpy array we can reference it using those the numbers variable that we just created and we want to reshape it so that it fits into our network just like that now that we have that we can create our image we using this image variable and we're initializing it as empty but it's dimensions are the rows by the columns that we that we've already defined and you into 8 ok now now we've defined this empty image and now we can fill that image with the values that we've created here so we'll say for index length in RL e pairs get the pixel value and then store whatever we have defined right there ok steps in our for loop and now we can do some reshaping and we can say reshape that image by the rows and columns and then and then set it to its transpose because that's gonna flip the black and white so it's just easier to read because the screen is already white in the background and that's the end of our try loop and so we could say let's let's catch any exceptions if there is an empty image that's the exception then we'll just say okay it's just an empty image and we'll return that okay okay that's that I think this needs one more yep and at the very very end we'll return the image all right that's it for that that is it I'm your role model thank you very much I like I I I accept your responsibility okay I accept that role I accept the role of being your role model I will not let you down I will continue to teach AI and continue to inspire and educate for free that's the real deal here for free watch me develop deliver some quality education for free in a way nobody has done before watch just watch okay but I guess I'm doing it right now but it's this is the beginning there's a typo how many hours you study let me just take a one question how many hours do you study I know this is a valuable question so I'm gonna take it because I analyze all my data and I read you know what audience retention looks like what kind of content the audience likes I'm always analyzing data by the way and I know this is a very valuable question I study probably less than I did before because as you build knowledge you need to study less because you're just built it's a dependency graph of knowledge so I probably study like five to ten hours a week ten hours max most of it is output it's not even studying anymore most of it is output although with reinforcement learning I am studying more so then probably 9 to 10 hours that's it cool let me answer one more question what is the CAG goal challenge cheers from Italy cannot see I love Italy but we won't get into that thank you very much please do a video about how to get started in machine learning for beginners on Kaggle that's a great idea and I'll add it to my queue all right line 13 rows oh thank you very much see thank you for that good that was it now like I said we want to measure we want to see the proportion of like how much depth is it felt affecting the salt and so what we're going to do is we're going to write that out right here okay so salt okay I got a focus you guys you're very interesting the questions are very interesting here but I've got a focus here so this salt proportion is what we're looking at right now now we want to measure how salty and images what we want is a single metric to say how salty is an image how great would that be if it was like it's 20% salty well and then we can have some look you know some threshold value where this minimum amount of salt requires you know further eyes to look at this so we want to develop that metric so what we can say is let's see all the unique values that we have in our image right those unique numbers and we're gonna count how many unique numbers there are that's a very personal question my friend all right return counts 1 to a 1 dot okay mm-hmm and that's out of the total number of values that we could have that's it right yes all right now now that I've defined that file I'm going to create a training mask do we guys saying line 8 I'm fine train mask mask okay so I'm gonna I'm gonna merge the depth I'm going to take that value I'm going to merge it into the other data frame object that I have that's what I'm doing right here because I want to I want to use that perhaps probably yes I'll use it okay so that's what I'm doing here I'm going to merge that one more line the salt proportion train mask mask yeah I know about the typo I don't care as fun because we're already we were beyond that okay we are beyond proportion tax good all right I think that's train mask soul proportion okay I guess that and so now we can literally merge it and was saying let's merge using the merge function the depth and then we'll store it in this column right here and then we'll see what we have now let's see what we have good okay so we have our salt proportion that's its own column and we have our mask values we have our rlv values we have our ID we we have and we have our depth right here under Z so we have all of the values we need and what deep pointing is gonna do is gonna figure out the features that are important okay so there's one more exploratory data analysis step that I want to do here and that is comparing the depth to the salt ratio and seeing how they relate because that would be really useful to see that wouldn't it be it would be very useful I know salt proportion merged and then Z and now we want to see the what am I going to call this the proportion of salt versus depth hmm mm-hmm interesting cool all right let's see how correlated that is NPD uh let's see one more thing before we get into you let's get into units so yeah depth is one thing we have it in our we have it in our feature set it's one of the features let's keep going here so this is a computer vision problem like we're trying to learn the mapping between the input and the output data and so there are a bunch of models out there that we could use there's ResNet there's Inception there's Alex net there's vgg and this is a map of the accuracy to the amount of operations that requires this is a map so it's notice that vgg requires that a lot of operations but of the most accurate is if we go all the way up that's inception before but there's one model that's not on this list so let's see so this is the accuracy by the type of model and annete wins out all of them annette but of all of those models we're gonna use 0 we're gonna use a unit and you might be asking why are you using a unit because think about our specific problem we are not just trying to do a classification between different images we're trying to do a classification so we're trying to do classification multiple multi class classification inside of a single image right that here is salt here is not salt and it's been shown that unit is a sander architecture for computer vision when we need not to only segment the whole image by its class but also to segment areas of an image by class right so produce a mask that will separate images into several classes but the so there are downsides as there always are there are many layers so it takes a significant amount of time to Train okay but you know there's always an up and down side could we use auto-encoders we could we could use I mean the unit is essentially an auto encoder right let me talk about how that works so um but in contrast to a particular in contrast to a regular autoencoder it predicts a pixel wise segmentation map of the input image rather than classifying the input image as a whole okay so it's saying like here is the every pixel in the original image and it's asking a question to which class does this individual pixel belong okay and that kind of flexibility allows it to predict different parts of the seismic image salt not salt what it's doing is it's passing the feature map from each level of the contracting path over the analogous level to the expanding path so let me talk about how this works okay so here's an image of a unit okay so it's a it's an encoder decoder architecture and what it's specifically and here's another image actually is okay all right there's a lot of time clearly I'm excited right now to explain how this works so let's start about let's let's start with the first layer the encoding layer what it the first layer contains is a bunch of encoding blocks like convolutional blocks and what it's doing is its down sampling okay so that first part is we're applying convolutions followed by a max pool down sampling apple app technique to encode the input image into feature representations at multiple different levels so here is an example okay of what that looks like we're saying do a convolutional so a convolution is like a flashlight it's if we imagine an image as a matrix of pixels a convolutional operation says let's for every pixel value in that image let's do a matrix multiplication by our feature map that exists that that's a part of that convolutional filter and let's multiply it and we'll get a result and that result is a bunch of feature maps and we continually do we continually input those feature maps and there are more and more and more as we go down the list of blocks until we get to the output but it's continuously creating more and more feature Maps by applying a convolutional flashlight it's like a it's like a flashlight because it's it's going over every value in every row for every column until it does it for all the values in that convolutional image in for that image and once we've done the convolutional operation then we're gonna apply a pooling operation and what a pooling operation does is it saves us time right it saves the algorithm time because it only looks at the max value for max pooling inside of a specific region so it's saying what's the most relevant part of the image and let's get that forward and forget the rest and buy down sampling what down sampling is as is a fancy word for taking a high-resolution image and making it a low resolution image it's compressing that image now the there's a second part the decoder of the network that consists of up sampling and concatenation now I know a lot of people think oh I don't want to call this D convolutions I want to call this up sampling and so what up sampling is is it's taking a low resolution image and it's creating a high resolution image and so that it's it's doing the opposite and so we can see what that looks like right here it's still convolutions it's still an activation function real ooh look at my video act activation functions Siraj for more information on how which activation function you should use and then once it's done that it's going to output that now here's a really interesting part so if we look back at the image what makes a unit really interesting or these lines right here can anyone tell me what these lines mean and they're also here what do these lines mean in this unit what is that right the answer by the way it's a skip connection what it's saying is right so we check this out the data is propagating right from every convolutional block right but while it's doing that it's sending what it computed across the network to the to the other end of the network a to the decoder layer so it's passing info not just forward it's passing it to the side to the decoder and that's a skip connection and the reason it does that is that this improves accuracy apparently but it's a skip connection and we can see exactly what that looks like so rather than continuously just writing out a bunch of the same lines because it's just convolution max pooling convolution I've all right I've actually pre-written this this yes skip connections yeah that's what I said but yes exactly I'm actually pre-written in or out here so let me show you exactly what I mean so right we have our input that we input right here we have our feature map and then we input that directly into the first layer right we apply our activation function to it and then we continually say convolution pooling send it to the next layer convolution pooling sends the next level we do that for for convolutional blocks we join all of those we concatenate all those values okay into the and so P for features is going to be our our lowest level representation of the data and that's what we input into the decoder layer and so this is the let me just write that down this is the decoder layer okay and so once we have our decoder layer we do the exact opposite in that we're doing a an up sampling up operation here now here is where that skip connection is happening notice this concatenates skip connections million exclamation points though what are those how can being silly but it's connecting cu6 to see for where is C 4 s well C 4 is up here okay it's doing the same for you 7 2 C 3 well C 3 is up here it's doing the same thing for you 7 2 u 8 - see - whoa where C 2 it's up here so that is the stip connection operation that you're seeing programmatically happening right here okay so convolutions pooling activation function repeat convolutions pooling activation function repeat encode decode skip connections the unit good for multi-class classification inside of an image aka image segmentation aka our problem is what we're doing why four layers quite great question so Andre karpati and his blog post the unreasonable effectiveness of recurrent networks first stated that there is a diminishing return to the amount of layers that you can add to a network so the more layers you add doesn't necessarily mean that it's going to be better and there's a kind of sweet spot between three four or five six layers well inceptions like 30 layers but for computational sake that's that's what it is so when we compile that it's just going to show us Thank You Karros what that looks like the architecture okay and once we have that and then you know there's more just like data pre-processing but we have those images as byte arrays and we do one more pre-processing step or we just combine them into a giant vector one by one by one by one it's just an array of all those values and once we have that we're gonna use probably the most used part of scikit-learn I've ever used which is this training testing split module which lets us split the training and testing data and once we have that we have two callbacks one is early stopping these are just a flags for our network thank you free code camp I'm glad to see you guys here I did I did a medium blog post for them they're very cool great bread check them out model check points we're gonna save a model as this and then we fit the model okay so what I did was I actually started training and then I stopped it right here at the second epoch because the first epoch took 277 seconds which is 6 12 18 24 4 minutes and I had to do that for 50 epochs so 50 epochs times 4 minutes is 200 minutes which is 6 12 18 3 hours and 20 minutes that's some real time math for you matrix operations happening right here skip connections right and that is too long for a live stream and we're reaching an hour as well but that is the model okay now what else could we use here well it turns out that Kaggle has this great idea of having a discussion right on the website it's also got people doing the units it's got people trying out different things let's see what what's like the most uploaded right search by most votes this person wrote up a whole intro to seismic geophysics thank you very much look at this quality stuff people these people are sharing data they're sharing results even though it's $100,000 prize I just want to help out I just want to help that's that's the spirit that's the spirit right there right okay so what I'm gonna do is gonna end this with a with a QA and a wrap as well so let's just let's do a little rap okay just say it just say a topic did you try on GPU yes I trained on GPU you can do that by saying runtime and then change runtime type GPU just like that right obviously my gonna train a two hour model on a live stream right we don't have two hours but that's that's the idea and yes I'll do a video on on what implementing neural networks dude that's like all my videos okay instrumental beat I would love to present in Holland No Netherlands I love you seriously I'll come back India as well I'm coming back guys everywhere Africa I'm coming um South America as well I got to do a world trip before the year ends I'm saying too much where was I yeah exactly I don't know what this is man we're current huh Adam I'll try to use collab it's so bad I'm just kidding man it got me so mad I try to use it put all my dependencies I try to put different things man can't you see I got a demo over here I got convolutional blocks I got 48 lines man I've gotta wear some socks I'm not wearing anything right now I'm just trying to rap I'm trying to do it for you you're the crowd I see that you've got this concatenation in upsampling but I might do something else it's called down sampling when I'm done with this I'm gonna close my laptop and go because that's how I do man this is how I flow let me end it on that good note before I go to hype right now this has been a great livestream thank you everybody for joining and for now I've got to go work on school bi stuff so thanks for watching all right
Original Description
Let's attempt a Kaggle Challenge together! This time, we'll try to solve the $100,000 "TGS Salt Identification Challenge" using a combination of Google Colab, Conditional Random Fields, and neural networks! Expect some colorful exploratory data analysis, then model building and some Q&A. Get hype!
Code for this video:
https://github.com/llSourcell/Kaggle_Challenge_LIVE/
Please Subscribe! And like. And comment. That's what keeps me going.
Want more education? Connect with me here:
Twitter: https://twitter.com/sirajraval
Facebook: https://www.facebook.com/sirajology
instagram: https://www.instagram.com/sirajraval
More learning resources:
https://medium.com/@keremturgutlu/semantic-segmentation-u-net-part-1-d8d6f6005066
https://towardsdatascience.com/medical-image-segmentation-part-1-unet-convolutional-networks-with-interactive-code-70f0f17f46c6
https://spark-in.me/post/unet-adventures-part-one-getting-acquainted-with-unet
https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/
Join us in the Wizards Slack channel:
http://wizards.herokuapp.com/
Learn more about the School of AI:
https://www.theschool.ai
Challenge:
https://www.kaggle.com/c/tgs-salt-identification-challenge
And please support me on Patreon:
https://www.patreon.com/user?u=3191693
#SirajRaval #KaggleChallenge #GoogleColab
Signup for my newsletter for exciting updates in the field of AI:
https://goo.gl/FZzJ5w
Hit the Join button above to sign up to become a member of my channel for access to exclusive content! Join my AI community: http://chatgptschool.io/ Sign up for my AI Sports betting Bot, WagerGPT! (500 spots available):
https://www.wagergpt.co
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Siraj Raval · Siraj Raval · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
What is Bitcoin?
Siraj Raval
5 Ways to Use Bitcoin
Siraj Raval
BTC Fever - Siraj [Music Video]
Siraj Raval
5 Reasons to Build Decentralized Apps
Siraj Raval
The Interplanetary File System
Siraj Raval
How to Build a Dapp in 3 min
Siraj Raval
Life Before Smartphones
Siraj Raval
4 Ways to Use Smart Contracts
Siraj Raval
3 Dapps You HAVE to See
Siraj Raval
Char's Life as a BitTorrent Engineer
Siraj Raval
4 Reasons AlphaGo is a Huge Deal
Siraj Raval
Build a Neural Net in 4 Minutes
Siraj Raval
Sentiment Analysis in 4 Minutes
Siraj Raval
The Hackathon Life
Siraj Raval
Your First ML App - Machine Learning for Hackers #1
Siraj Raval
Build an AI Composer - Machine Learning for Hackers #2
Siraj Raval
Build a Game AI - Machine Learning for Hackers #3
Siraj Raval
Build a Movie Recommender - Machine Learning for Hackers #4
Siraj Raval
Build an AI Artist - Machine Learning for Hackers #5
Siraj Raval
Build a Chatbot - ML for Hackers #6
Siraj Raval
Build an AI Reader - Machine Learning for Hackers #7
Siraj Raval
Build an AI Writer - Machine Learning for Hackers #8
Siraj Raval
Build a Chatbot w/ an API - ML for Hackers #9
Siraj Raval
One-Shot Learning - Fresh Machine Learning #1
Siraj Raval
Generative Adversarial Nets - Fresh Machine Learning #2
Siraj Raval
Tone Analysis - Fresh Machine Learning #3
Siraj Raval
Generate Rap Lyrics - Fresh Machine Learning #4
Siraj Raval
Build an Autoencoder in 5 Min - Fresh Machine Learning #5
Siraj Raval
Build a Self Driving Car in 5 Min - Fresh Machine Learning #6
Siraj Raval
Build an Antivirus in 5 Min - Fresh Machine Learning #7
Siraj Raval
TensorFlow in 5 Minutes (tutorial)
Siraj Raval
Build a Recurrent Neural Net in 5 Min
Siraj Raval
Build a Simulation in 5 Min
Siraj Raval
Build a TensorFlow Image Classifier in 5 Min
Siraj Raval
Tensorboard Explained in 5 Min
Siraj Raval
Generate Music in TensorFlow
Siraj Raval
Build a Game Bot (LIVE)
Siraj Raval
Deep Learning Frameworks Compared
Siraj Raval
Introduction - Learn Python for Data Science #1
Siraj Raval
Build a Neural Network (LIVE)
Siraj Raval
Twitter Sentiment Analysis - Learn Python for Data Science #2
Siraj Raval
Recommendation Systems - Learn Python for Data Science #3
Siraj Raval
Predicting Stock Prices - Learn Python for Data Science #4
Siraj Raval
Pong Neural Network (LIVE)
Siraj Raval
Deep Dream in TensorFlow - Learn Python for Data Science #5
Siraj Raval
Visualizing Data with D3.js (LIVE)
Siraj Raval
Genetic Algorithms - Learn Python for Data Science #6
Siraj Raval
Enter Siraj [Music Video]
Siraj Raval
Build a Web Scraper (LIVE)
Siraj Raval
Why is P vs NP Important?
Siraj Raval
How to Make a Neural Network (LIVE)
Siraj Raval
How to Make an Amazing Tensorflow Chatbot Easily
Siraj Raval
How to Make an Amazing Video Game Bot Easily
Siraj Raval
How to Make a Tensorflow Neural Network (LIVE)
Siraj Raval
How to Make a Simple Tensorflow Speech Recognizer
Siraj Raval
Joel Shor - Really Quick Questions with an Awesome Google Engineer
Siraj Raval
How to Make a Path Planning Algorithm Easily (LIVE)
Siraj Raval
The Best Way to Prepare a Dataset Easily
Siraj Raval
Catherine Olsson - Really Quick Questions with an OpenAI Engineer
Siraj Raval
How to Make a Tic Tac Toe Neural Network Easily (LIVE)
Siraj Raval
More on: CV Basics
View skill →Related Reads
📰
📰
📰
📰
Understanding Deep Learning Through Four Interactive Experiments
Medium · Data Science
Understanding Deep Learning Through Four Interactive Experiments
Medium · Deep Learning
Optimizers in Deep Learning: From Gradient Descent to Adam
Medium · Deep Learning
The Meta-Architecture of Interface Fracture: High-Dimensional Logical Stress and Systemic Collapse…
Medium · Deep Learning
🎓
Tutor Explanation
DeepCamp AI