Training models using Satellite imagery on Amazon Rekognition Custom Labels

Satellite imagery is becoming a more and more important source of insights about changes that happen worldwide. There are multiple satellites that provide publicly available data with almost full earth coverage and almost weekly frequency.

One of the main challenges with satellite imagery is to deal with getting insights from the large dataset which gets continuous updates. In this blog post, I want to showcase how you can use Amazon Rekognition custom labels to train a model that will produce insights based on Sentinel-2 satellite imagery which is publicly available on AWS.

The Sentinel-2 mission is a land monitoring constellation of two satellites that provide high-resolution optical imagery. It has around a 5-day frequency and 10-meter resolution. In our example, we will use satellite imagery to detect and classify agricultural fields.

How to access Sentinel-2 imagery

  • Use one of the browsers mentioned on the page https://registry.opendata.aws/sentinel-2/
  • Download imagery from the Amazon S3 bucket directly. Amazon S3 is a storage service that provides scalable and secure access for downloading and uploading data.

Browser is the best option for finding single images for specific dates and places. Amazon S3 is a better option if you want to automate a workflow or develop an application using satellite imagery. I want to showcase the usage of Sentinel-2 Amazon S3 storage as it’s the best way to use imagery if you need to organize a pipeline for its processing.

Find Sentinel-2 scene

Download image bands

Prepare False Color Sentinel-2 image

We will get the following result:

Once we have this False Color Vegetation image we can actually crop it in multiple areas to use some of them as examples and some of them for the training and test datasets.

How to train and run Amazon Rekognition model

Create and label Dataset

  1. Choose “Upload images from your computer”
  2. On the dataset page click “Add images”
  3. On the pop-up window, click Choose Files and choose files from your computer. Then click “Upload images”
  4. Create labels “active field”, “semi-active field”, “non-active field”
  5. Click “Start labeling”, choose images, and then click “Draw bounding box”
  6. On the new page, you can now choose labels and then draw rectangles for each label. After you’ve finished labeling you can switch to a different image or click “Done”.

Train and run the model

  1. On the project page choose “Train new model”
  2. Choose the dataset which we just created and then choose “Split training dataset” for the test dataset. Then click “Train”.
  3. Once the model is trained you can start making predictions.

You can evaluate the model using one of the crops from the image which we’ve processed before. Rekognition will return the json results with predicted regions that we can visualize.

Visualize the result

Here is how the output will look like:

Conclusion

Feel free to check the code in the following repo:

https://github.com/ryfeus/amazon-rekognition-custom-labels-satellite-imagery