Supervised Classification with Sentinel 2 Satellite Images | Earth Engine | Machine Learning

Learn more: spatialelearning.com
Enroll in the full course: bit.ly/earth-engine-mega-course
Subscribe to our channel for more tutorials: / spatialelearning
In this tutorial, we will discuss how to apply supervised machine learning classification with Sentinel 2 images in Google Earth Engine.
In this tutorial, you will learn how to:
1. Import Sentinel 2 data from the Google Earth Engine data library
2. Create the best cloud-free image
3. Create land cover training data
4. Apply CART (Classification and Regression Tree) supervised classification algorithm
5. Calculate the confusion matrix and overall accuracy
6. Display and visualize classification result
7. Download the classification result
Blog: spatialelearning.com
Courses: courses.spatialelearning.com/
KZread: / spatialelearning
Facebook: / spatialelearning
Twitter: / spatialelearn
#earthengine #remotesensing #sentinel2

Пікірлер: 57

  • @spatialelearning
    @spatialelearning3 жыл бұрын

    Visit our website to learn more: spatialelearning.com Hope this video was useful to you. What video topic would you like to see next?

  • @ishanweerakoon9838

    @ishanweerakoon9838

    3 жыл бұрын

    Please do a video about Parallelepiped classifier

  • @harshelsuares3194

    @harshelsuares3194

    2 жыл бұрын

    It's a wonderful recording. But I have a query related to ROI. So if I want the shapefile of British Columbia or Vancouver what will be the FeatureCollection code ?

  • @spatialelearning

    @spatialelearning

    Жыл бұрын

    @@ishanweerakoon9838 Ok, will do.

  • @spatialelearning

    @spatialelearning

    Жыл бұрын

    @@harshelsuares3194 You can upload a shape file to asset manager.

  • @asmaaalzahrani6387

    @asmaaalzahrani6387

    Жыл бұрын

    Please can you share the code link

  • @donaldandrade2037
    @donaldandrade2037 Жыл бұрын

    Great work! So informative and detailed thank you so much for this!!!

  • @allkindofknowledge1400
    @allkindofknowledge14002 жыл бұрын

    Best tutorial so far with detailed working. Sometimes people hide some of the steps in the video, and that's create confusion when you try to implement the same thing. I have one question why you have choose band b4, b3, b2, b8 for classification? Is it true for all kindof classification using sentinel images. Which bands we can use in case of landsat8 data

  • @spatialelearning

    @spatialelearning

    Жыл бұрын

    Thanks. I chose bands 4, 3, 2 and 8 since they are the highest resolution (10 meter). You can apply similar band combinations for Landsat 8.

  • @theforester_
    @theforester_2 жыл бұрын

    awesome video. i got a question, i've got an preprocessed shape with possible areas of pine plantation in brazil, i just i'd like to run a classification to verify inside these polygons wethers it's pine or not. Is there a way to transform a shapefile in FeatureCollection for then use it as my ROI? thanks again

  • @leidycastro9519
    @leidycastro9519 Жыл бұрын

    Gracias!! :)

  • @aarizahmed2422
    @aarizahmed24223 жыл бұрын

    Very nice video! I an having some query I want to extract only urban class but while creating the different classes the Urban class mixed with the Barren class.kindly help me for the same.

  • @surabhisoni3460
    @surabhisoni34602 жыл бұрын

    Great video sir, how to export confusion matrix?

  • @rahelsintayehu9070
    @rahelsintayehu9070 Жыл бұрын

    Thank you again for wonderful tutorial. I have one question is it possible to get the satellite map in Google earth engine in historic period like google earth pro?

  • @Bev16
    @Bev16 Жыл бұрын

    This is great!! Can you please share the code in the comments?

  • @user-kp6jn7cp4h
    @user-kp6jn7cp4h Жыл бұрын

    Hi dear admin, Please may I ask you: when I zoom the google earth engine interface imagery, the ground fearures look like pretty clear and visible, but when I use your algorithm to make true color composite imagery to download, but at that time the ground fearures could not clearly visible? What is this problem and how to solve it ? I will be thankful for your valuable guidance about it.

  • @sanjanadutt2941
    @sanjanadutt2941 Жыл бұрын

    Hi, can someone please help me with this code error: Cannot read property 'sampleRegions' of undefined. 34th minute of the video. I tried exactly as it was given but its not working.

  • @user-kp6jn7cp4h
    @user-kp6jn7cp4h Жыл бұрын

    Hi dear Admin. When I run this code: //Overlay the point on the imagery to get trainingDataset var trainImage = imput.sampleRegion({ collcetion : training, properties: [lable], scale: 30 }); then this error appeared: "Line 90: imput is not defined" Please tell me how to handle this issue?

  • @fatematuzzohora3154
    @fatematuzzohora31542 жыл бұрын

    Could you please explain the reason for using only Band 2, 3, 4 and 8 for classification?. It's on line 22, under the comment //Creating Training Data.

  • @rajithanuwantha3313

    @rajithanuwantha3313

    Жыл бұрын

    They are the ones having spatial resolution of 10m .. Using other bands may reduce the resolution..

  • @sandigis8147
    @sandigis81472 жыл бұрын

    WOULD YOU LIKE TO SHARE THE SCRIPT?

  • @salamander5969
    @salamander5969 Жыл бұрын

    I CANT BELIEVE THAT THIS IS WORKKKKKKKK, CAN I ASK YOU QUESTION WHY YOU USE ONLY 4 BANDS, MEANWHILE MAYBE THER IS SOME CLASSIFICATION THAT THE OTHER BAND

  • @UlukbekBurganakov

    @UlukbekBurganakov

    4 ай бұрын

    Hi! Can you share me with your codes

  • @gaaty1954
    @gaaty1954 Жыл бұрын

    Why when i use "Sentinel-2: Cloud Probability" to mask the clouds, my overall accuracy went down from 0.7 to 0.578. 1) How to improve overall accuracy 2) How many Geometry Imports per class is need/best/sufficient

  • @ounassabdelaziz7349
    @ounassabdelaziz73492 жыл бұрын

    i try to do the same but i have this message ! (Jsloader error (code #1): Timeout reached for loading script /javascript/acorn.js) please can some one help me to fix this ?

  • @leonardoscarpa8784
    @leonardoscarpa87842 жыл бұрын

    Very good video. Congratulations! Just one doubt, I can't get the confusion matrix scrip to work, it doesn't give me any error, only that both the confusion matrix and the Overall Accuracy give me 0 value. What can it be?

  • @binyamhailu1771

    @binyamhailu1771

    2 жыл бұрын

    I am having the same problem.

  • @sanabasheer7650

    @sanabasheer7650

    2 жыл бұрын

    Hi... I'm having the same problem. have you find any solution related to that?

  • @sanabasheer7650

    @sanabasheer7650

    2 жыл бұрын

    @@binyamhailu1771 Have you find any solution?

  • @rahelsintayehu9070

    @rahelsintayehu9070

    Жыл бұрын

    @@sanabasheer7650 you edit the script actual: 'Class' then you will get the result

  • @rahelsintayehu9070

    @rahelsintayehu9070

    Жыл бұрын

    @@binyamhailu1771 Hey edit the script actual: 'Class" then you will get the result

  • @HarishPandey-py3iz
    @HarishPandey-py3iz Жыл бұрын

    My classification is appearing very decent with 85% accuracy; However, the area is very large and while exporting, in task a multiple run options are appearing, can anyone help its urgent, Thanking you, I want to export in a single frame.

  • @fatimaezzahraallam438
    @fatimaezzahraallam438 Жыл бұрын

    I can't get the confusion matrix scrip to work, it doesn't give me any error, only that both the confusion matrix and the Overall Accuracy give me 0 value. What can it be?

  • @gaaty1954
    @gaaty1954 Жыл бұрын

    var trainImage = input.sampleRegions({ collection: training, properties: [label], scale:30 }); Why is it at the trainImage, the scale is selected to be 30 instead of 10?

  • @gaaty1954

    @gaaty1954

    Жыл бұрын

    hmmm, when i adjust scale to 10, the water classification output seems a bit off, using 30 then. Using the scale of 30, also improved the overall accuracy from 0.7 to 0.75

  • @amenechelias3858
    @amenechelias38582 жыл бұрын

    Please can you help me, I followed all steps and worked. But Finally it shows ''Classification_CART: Layer error: Property 'class' of feature '1_1_1_1_1_0_0' is missing''. How can I fix this problem . I am binger

  • @Google_Earth_Engine

    @Google_Earth_Engine

    2 жыл бұрын

    check featureCollection of your landcover

  • @atuldiwaker8597

    @atuldiwaker8597

    Жыл бұрын

    @@Google_Earth_Engine facing same problem, please help me out

  • @michaire5999
    @michaire5999 Жыл бұрын

    is it possible to convert the result in shp?

  • @spatialelearning

    @spatialelearning

    Жыл бұрын

    Yes. You can use raster to vector function.

  • @asimrizwan3960
    @asimrizwan39602 жыл бұрын

    Share this video code please...

  • @mattiabarsanti9336
    @mattiabarsanti9336 Жыл бұрын

    I have an error: line 14, Map.addLayer(image.clip(roi), visParamsTrue, 'Sentinel 2020'); -> Error: image.clip is not a function Someone can help me? Thanks in advance

  • @spatialelearning

    @spatialelearning

    Жыл бұрын

    Check the roi if it matches to image coverage.

  • @mattiabarsanti9336

    @mattiabarsanti9336

    Жыл бұрын

    @@spatialelearning solved. thank you.

  • @frevaboy298

    @frevaboy298

    Жыл бұрын

    ​@@mattiabarsanti9336 sorry can you share to me the code you Used

  • @muhammadrahim4399
    @muhammadrahim4399 Жыл бұрын

    Please share code of this video.

  • @SyedAhmedRaza_0
    @SyedAhmedRaza_0 Жыл бұрын

    Please anyone answer my query. Why this person has only used 4 bands? Can we use all the 20 m bands along with these 4 bands?

  • @batconservationpakistan4645

    @batconservationpakistan4645

    Жыл бұрын

    He is only using blue, green, red and NIR because of higher spatial resolution of these bands (10m). Using 20m bands is of no use.

  • @christy_v_7394
    @christy_v_7394 Жыл бұрын

    Error: Image.clipToBoundsAndScale, argument 'input': Invalid type. Expected type: Image. Actual type: ImageCollection. (Error code: 3) This is the error that occured to me

  • @alexmurphy5015
    @alexmurphy50152 жыл бұрын

    ERROR - I got this error right at the end (heartbreaking!)😭 can anyone help?????? "Layer error: Property 'Class' of feature '2_0_0': Invalid type. Expected type: Float. Actual type: String. Actual value: C"

  • @spatialelearning

    @spatialelearning

    Жыл бұрын

    Can you share the ee code link?

  • @hima2207
    @hima2207Ай бұрын

    Why confusion matrix showing zero. And also accuracy assessment showing zero Could you tell me how to solve it?pls😑

  • @jonathankouassi3026
    @jonathankouassi30262 жыл бұрын

    Hello please i got this error : " Unexpected token (3:63) "when i ran the code by following step by step the tutorial i want to know what happened?

  • @leonardoscarpa8784

    @leonardoscarpa8784

    2 жыл бұрын

    try reloading the page, it happened to me but I had left it unused from one day to the next. Maybe it is a protocol... Good luck!

  • @moibon2264
    @moibon2264 Жыл бұрын

    This is great!! Can you please share the code in the comments?