 welcome to today's class. So, we are in second lecture of module 3 and we are trying to learn about image classification. So, in the last lecture we learnt that image classification involves two steps. Number one is recognition of real world objects or targets and number two is labeling them, designing numerical labels to pixels using some decision making process. Now what exactly is the decision making process? We shall see shortly. Also in the previous lecture we learnt that broadly there are two methods available in literature for labeling pixels. One is supervised classification and the second is unsupervised classification. Of course we shall also learn about fuzzy classification but for now let us begin our understanding about each classification type. So, the schematic in front of you shows an image data in four channels four bands of image and the ultimate aim is that from a image data single channel or multi-channel image we need to classify and then result in a classified image that looks something like this wherein each pixel is designed a label according to the feature that it represents. So, here the features are forest, river, urban area three features. Now decision rules are required to be generated using sample pixels. We are going to understand about the first type of classification that is supervised classification as the name suggests some sort of supervision is required, is not it? Supervised classification. So, in supervised classification there is a requirement, there is a necessity to collect training data. Training data is the first and foremost step in supervised classification. So, number one is some sort of decision rules are required to generate sample pixels which means some these decision rules are required to be generated from sample pixels. We need to collect training data samples for each class and a step two the pixels are classified using a decision system developed. Now by training data collection we mean that some sort of prior information needs to be with us and this information is for understanding about the statistical characteristics of the classes. A priori knowledge regarding the pixels of each feature are necessary and training data for each class involves assembling statistics which closely describe the spectral response pattern of each land class type and they can be collected using training polygons or seed pixels. Again in supervised classification the very first step is you need to collect training data which are representative of each class. Now let us try to see what training data collection looks like. So, here what you see is an image, a false color composite of an image. Let us not worry about what this image is. It has been created using synthetic aperture radar images, but in this image my aim is to collect training data and I am trying to do this in snap toolbox using the method of training polygons. So, every time say I want to extract the pixels that correspond to water body I am going to use the inbuilt tool in this toolbox to create a polygon to extract all the pixels that belong to water body class. Now training data must be representative of the class, very important. Training data must be representative of the class and training data collection using polygons is seen here. The location of training area in an image is established by viewing windows in an enlarged format on an interactive color display device. And in the case of training data collection using seed pixels here we just use the display cursor which is placed within a prospective training area and a single seed pixel is chosen that is thought to be representative of the surrounding area. Then according to various statistically based criteria pixels with similar spectral characteristics that are contiguous to the seed pixel are highlighted on the display and they become the training samples for the training area. So, here you can see that I am continuously trying to draw polygons using the tool available in snap toolbox and by some means I am extracting the pixels of this image corresponding to every class and I am accordingly naming it as class 1, class 2 and so on. Every time I am creating a vector data container I am trying to use the polygon tools to extract the pixels corresponding to one particular class and then I am extracting it and then putting it in that particular class which means I am trying to use the visual system. The eyes and brain are combining to tell me that wherever there is difference in color it has to mean a different feature. So, what I am trying to do is I am trying to look at the image and wherever there is a difference even a slight difference in color I am assuming that it is going to represent a different feature. Here water body is prominent, urban area is prominent. By the way this image is for the Maharashtra region, Mumbai region. So, there will be some wetlands which is being selected now. So, if you know the area feature selection becomes easy, training area data collection becomes easy. But please remember that even if you do not know the area you can zoom into the particular locations of the image and then click use some tools say using the polygon training polygon based tools or seed pixels you need to select some representative pixels for each class which means if you know that the satellite image being given to you has three classes. Urban area, vegetation, water body then you need to create or you need to extract the training data for these three features, these three classes that is urban area, vegetation, water body. Now please remember that bigger the better does not apply to training data as the representativeness of the sample is very important. So, usually as a thumb rule a sample size of 30 is considered sufficient for a class and also at this point let me mention that training samples are usually collected by field survey or by using photographs. So, training data can be collected for all the classes that we want to classify and training statistics like the mean or median or variance it should be representative of the class concerned. Theoretically the lower limit of number of pixels that should be contained in a training data set is n plus 1 where n is the number of spectral bands of course practically it is 10n to 100n pixels and then please make sure that when you are selecting training data from an image all the training sites should be well distributed within an image. You should then zoom into one particular location and then pick all the training data from that particular location. You should zoom to different areas of the image to collect the training data it should be well distributed within the image also the classes should be pure that is if your intention is to select the training data for a water body I will avoid the coastlines which is a mix of sand and water body. So, you know water gradually transitions to land in the coastal areas, isn't it? There is not an abrupt transition happening. So, I will select the pixels corresponding to water body leaving the coastal area where there is a higher chance of getting mixed classes in one pixel. All right. Now let us try to understand some simple algorithms for supervised classification. I will start with something known as a minimum distance to mean classifier. This is a decision rule for which we need training data which is why it is known as supervised classification method and as the name suggests this decision rule is computationally simple and it is commonly used. For example, from the training data the mean vector can be calculated to perform the minimum distance to mean classification the program must first calculate the distance to each mean vector from each unknown pixel and shown here is the computation of Euclidean distance that we have covered earlier when we discussed about the geometrical basis of classification you know. The computation of Euclidean distance can be performed using the relation in front of you. So, here dn refers to digital numbers or pixel values or backscatter values it can be anything, c refers to the class. By class I mean urban area is one class, vegetation is one class, water body is another class, k refers to the band, l refers to the band. So, every time I pick a pixel value I am going to find the distance of that pixel value from the mean vectors of each class. Now, we will try to understand this through a numerical I think that would be better. So, given here are the training data for class 1 and class 2 in two bands band 1 and band 2. So, given here are the training data for class 1 and class 2 in two bands. Now, I am going to give the training data and ask you to classify the following pixels into either class 1 or class 2. The pixel values are given as corresponding to band 1 and band 2. Now, technically this is a low sample you know the sample size is less than 30 but just for representation purposes I am going to use this numerical example just for your understanding. So, once again whenever I show you a table like this think of the example that we discussed when we covered the geometrical basis of classification wherein there were two axes x axis and y axis and then you were given two pairs of points and you are representing it as a single dot on the scatter plot. Now, remember that in this example you have multiple values and then you can use the same example and then plot it on the x and y axis except that in this case the x and y axis are the bands band 1 can be x axis band 2 can be y axis and you have multiple pairs of points corresponding to each pixel. So, to estimate the Euclidean distance the first step is we need to calculate the mean the mean value isn't it? So, from the question I am calculating the mean of band 1 corresponding to class 1 the value is given something like 9.5 you can do the computations and similarly for each band of each class I am going to compute the mean value that is the first step isn't it? Remember my aim is I need to understand whether this belongs to class 1 or class 2. Similarly, each pixel I need to understand whether they belong to class 1 or class 2 from the training data that is being given towards the left side of your screen alright. So, once we have estimated the mean value let us try to use the minimum distance to means classifier. You know I can consider band 1 and band 2 as I mentioned earlier as x and y axis and a simple scatter plot will graphically display the training data points that is the digital numbers of all pixels in the 2D Euclidean space and to classify each of the new pixels using minimum distance to means classifier I need to calculate the distance from mean of class 1, class 2 to each of these new pixels and the pixel will be assigned to the class to which it is closest in distance. So, which means the mean of class 1 I am going to use the notation mu c 1 we have estimated it as 9.5 and 11.3. Similarly, the mean of class 2 we have estimated as 15.3, 5.8 and the first pixel to be classified first pixel to be classified let me write that down first pixel to be classified is 10, 11 and say I want to estimate whether this first pixel belongs to class 1 or class 2. So, distance of or distance from mean of class 1 to first pixel it is going to be root of 9.5 minus 10 square plus 11.3 minus 11 square, is not it? First pixel to be classified and the distance of first pixel from the mean of class 1 you will get the value somewhere around 0.58. Similarly, let us compute the distance from mean of class 2 to first pixel. This time I am going to compute the distance of the first pixel from the mean of class 2 which is going to be root of 15.3 minus 10 square plus 5.8 minus 11 square the value you are going to get is somewhere around 7.42. How do we interpret this? We have single pixel its values in two bands band 1 and band 2 from the training data you have computed the mean of class 1 and the mean of class 2 the values given are in two bands band 1 and band 2 and using Euclidean distance measure you are going to estimate the distance of the first pixel from mean of class 1 and the distance of the same pixel from mean of class 2. So, this pixel is going to be assigned to class 1 because it is closest to class 1 minimum distance to means classifier. Similarly, all the pixels can be classified in this manner is not it? So, in the table that I have shown all the pixels can be classified in this manner to either class 1 or class 2 depending upon what is the distance between each of the pixels to the mean of class 1 and mean of class 2. Now, if you think about it what is the drawback of this method? You know what is the drawback? It is just considering the mean value of a cluster but then it is insensitive to different degrees of variance in the spectral response data isn't it? Is sigma being considered anywhere? No, sigma is not considered only mean is being considered which means the minimum distance to mean classifier is insensitive to different degrees of variance in the spectral response data. So, whatever I have discussed is written here in this slide. So, at any point of time feel free to pause the screen and have a look. All right. So, moving forward let us try to understand one more type of classification supervised classification as part of this lecture that is Parallelopiped classifier. Parallelopiped a Parallelopiped is nothing but a solid body for which each face is a parallelogram each face is a parallelogram and the decision rule for a Parallelopiped classifier is based upon simple Boolean and or logic. So, here also because it is a supervised classification approach we need training data yes representative data set for each class is required absolutely. So, this training data of each class are used to generate the mean and standard deviation of each class. So, let me re-itrate the training data of each class in Parallelopiped classification is used to generate the mean and standard deviation of each class. So, here I have used the expression sigma ck where c refers to the class and k refers to the band out of m possible bands. Say I have a multi-spectral data say I have multiple bands of SAR intensity images. k refers to the band band 1, band 2, band 3 and so on and c refers to the class urban areas one class vegetation other class water body third class and so on. So, let me show you the expressions first using a one standard deviation threshold a Parallelopiped algorithm classifies a pixel into a particular class shown here are the lower boundary and the higher boundary. So, every time you are going to compute the mean value for each class the standard deviation for each class and you are going to estimate whether the digital number it lies between the lower boundary or higher boundary. Lower boundary is mu ck minus sigma ck remember c refers to the class and k refers to the band and higher boundary is mu ck plus sigma ck. As written here c is the number of classes and k is the number of bands you know Parallelopiped classifier and if the pixel values lie above the lower threshold and below the higher threshold for all the n bands that are evaluated it is assigned to that particular class. Now, when an unknown pixel say it does not satisfy any of the Boolean logic criteria it is automatically assigned to an unclassified category, unclassified category. Although it is only possible to analyze visually up to three dimensions it is possible to create an n-dimensional Parallelopiped for classification purposes. Up to three dimension we can visually create a picture but then it is also possible to create an n-dimensional Parallelopiped for classification purposes and the Parallelopiped algorithm it is computationally efficient method of classifying remote sensor data. Unfortunately, you know in sometimes the Parallelopipeds can overlap in certain situations, sometimes they can overlap shown here is the same example in 2D space and in 3D space wherein the set of points that belong to group 1 cluster 1 or group 2 cluster 2 they are enclosed by a Parallelopiped which is defined using the mean and standard deviation. And I am telling you that this is a computationally efficient method but sometimes the Parallelopipeds can overlap in certain situations. Then it is possible that an unknown candidate pixel might satisfy the criteria of more than one class. In such cases it is usually assigned to the first class which meets all criteria. Now, let us consider the example wherein you have a set of closely knit points not the points that you see in front of you. In the presence of covariance the rectangular decision regions using a Parallelopiped classifier it tends to fit the training data very poorly. That is in the presence of covariance. So, just to summarize what we learnt as part of this lecture we understood two different classification algorithms that belong to supervised classification category that is minimum distance to mean classifier and Parallelopiped classifier. And we even solved a small numerical to understand how minimum distance to mean classification works. And then I mentioned that in the presence of covariance the rectangular decision regions using a Parallelopiped classifier it tends to fit the training data very poorly. And there must be a solution to tackle that as well, is not it? We will deal about that in the next lecture. So, I hope you understood whatever was discussed as part of today's class and I will meet you in the next class. Thank you.