-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathgee-satellite-embedding.Rmd
More file actions
284 lines (180 loc) · 14.4 KB
/
gee-satellite-embedding.Rmd
File metadata and controls
284 lines (180 loc) · 14.4 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
---
title: "Satellite Embedding Deep Dive (Full Workshop)"
subtitle: "A hands-on workshop for working with the Satellite Embedding dataset in Google Earth Engine."
author: "Ujaval Gandhi"
fontsize: 12pt
output:
# pdf_document:
# latex_engine: xelatex
# toc: yes
# toc_depth: 3
# fig_caption: false
# word_document:
# toc: false
# fig_caption: false
html_document:
df_print: paged
highlight: pygments
includes:
#in_header: copy-code.html
after_body: comment.html
toc: yes
toc_depth: 2
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \renewcommand{\footrulewidth}{0.4pt}
- \fancyhead[LE,RO]{\thepage}
- \geometry{left=1in,top=0.75in,bottom=0.75in}
- \fancyfoot[CE,CO]{{\includegraphics[height=0.5cm]{images/cc-by-nc.png}} Ujaval Gandhi http://www.spatialthoughts.com}
---
\newpage
<!--- Install package vembedr to get YouTube videos rendered -->
```{r echo=FALSE}
suppressWarnings(library("vembedr"))
```
\newpage
# Introduction
Google [Satellite Embedding Dataset](https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_SATELLITE_EMBEDDING_V1_ANNUAL) is a global dataset of pre-computed, analysis-ready geospatial embeddings for each year from 2017 onwards. This dataset was produced by Google DeepMind's AlphaEarth Foundations model and presents a big leap in making remote sensing and climate datasets useful. Along with making existing remote sensing workflows more efficient, this dataset unlocks a range of new use cases. This workshop is designed to help you get started with the dataset in GEE and use it for a variety of applications.
[](https://www.youtube.com/watch?v=vDWjfW7pylM){target="_blank"}
[Watch the Video ↗](https://www.youtube.com/watch?v=vDWjfW7pylM){target="_blank"}
[Access the Presentation ↗](https://docs.google.com/presentation/d/1X0LodVyTO9ou68LiuRMAeUhPYaortMND2x-0Rb1LkzM/edit?usp=sharing){target="_blank"}
# Setting up the Environment
## Sign-up for Google Earth Engine
If you already have a Google Earth Engine account, you can skip this step.
Visit our [GEE Sign-Up Guide](gee-sign-up.html) for step-by-step instructions.
## Get the Workshop Materials
The workshop material and exercises are in the form of Earth Engine scripts shared via a code repository.
1. [Click this link](https://code.earthengine.google.co.in/?accept_repo=users/ujavalgandhi/GEE-Satellite-Embedding) to open Google Earth Engine code editor and add the repository to your account.
2. If successful, you will have a new repository named `users/ujavalgandhi/GEE-Satellite-Embedding` in the *Scripts* tab in the *Reader* section.
If you do not see the repository in the *Reader* section, click *Refresh repository cache* button in your *Scripts* tab and it will show up.
```{r echo=FALSE, fig.align='center', out.width='50%', fig.cap='Workshop Repository'}
knitr::include_graphics('images/gee_satellite_embedding/repository.png')
```
# Get the Workshop Video
The course is accompanied by a video covering the all the sections. This video is recorded from our live webinar class and is edited to make them easier to consume for self-study. We have 2 versions of the videos:
## YouTube
The video on YouTube is ideal for online learning and sharing. You may also turn on *Subtitles/closed-captions* and adjust the playback speed to suit your preference. [Access the YouTube Video ↗](https://youtu.be/vDWjfW7pylM){target="_blank"}
## Vimeo
We have also made full-length video available on Vimeo. This video can be downloaded for offline learning. [Access the Vimeo Video ↗](https://vimeo.com/1115765849?share=copy){target="_blank"}
\newpage
# Hands-on With Satellite Embedding Dataset
## 01. Visualizing Embeddings
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Visualizing a satellite embedding image with 3 clusters'}
knitr::include_graphics('images/gee_satellite_embedding/cluster_visualization.jpg')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F01b_Visualizing_Embeddings_(complete)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/01b_Visualizing_Embeddings_(complete)')}
```
### Exercise
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F01c_Visualizing_Embeddings_(exercise)){target="_blank"}
```
// Exercise
// Delete the geometry
// Draw a geometry for your region of interest
// Try visualizing the embeddings with different bands (A01, A02, A03...)
// Try changing the number of clusters to see different levels of detail
```
## 02. Crop Type Mapping
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Detected Crop Type Map using Unsupervised Classification'}
knitr::include_graphics('images/gee_satellite_embedding/crop_type_map.jpg')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F02b_Unsupervised_Classification_(complete)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/02b_Unsupervised_Classification_(complete)')}
```
### Exercise
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Crop Mapping Exercise with Satellite Embedding'}
knitr::include_graphics('images/gee_satellite_embedding/crop_mapping_exercise.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F02c_Unsupervised_Classification_(exercise)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/02c_Unsupervised_Classification_(exercise)')}
```
## 03. Mapping Mangroves
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Mangrove Classification with Satellite Embedding Dataset'}
knitr::include_graphics('images/gee_satellite_embedding/mangrove_classification.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F03b_Supervised_Classification_(complete)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/03b_Supervised_Classification_(complete)')[-(1:232)]}
```
### Exercise
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F03c_Supervised_Classification_(exercise)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/03c_Supervised_Classification_(exercise)')}
```
## 04. Object Detection with Similarity Search
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Detecting Brick Kilns with Similarity Search'}
knitr::include_graphics('images/gee_satellite_embedding/similarity_brick_kiln.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F04b_Similarity_Search_(complete)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/04b_Similarity_Search_(complete)')[-(1:18)]}
```
### Exercise
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Exercise to Map Solar Farms with Similarity Search'}
knitr::include_graphics('images/gee_satellite_embedding/similarity_solar_farms.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3AHands_On%2F04c_Similarity_Search_(exercise)){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Hands_On/04c_Similarity_Search_(exercise)')[-(1:13)]}
```
# Supplement
## Similarity Search with Area Filtering
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Similarity Search to Detect Farm Ponds'}
knitr::include_graphics('images/gee_satellite_embedding/similarity_farm_ponds.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?accept_repo=users%2Fujavalgandhi%2FEnd-to-End-GEE&scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3ASupplement%2FSimilarity_Search_with_Area_Filtering){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Supplement/Similarity_Search_with_Area_Filtering')[-(1:26)]}
```
## Similarity Search with Negative Examples
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Similarity Search to Map Open Plots'}
knitr::include_graphics('images/gee_satellite_embedding/similarity_open_plots.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?accept_repo=users%2Fujavalgandhi%2FEnd-to-End-GEE&scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3ASupplement%2FSimilarity_Search_with_Negative_Examples){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Supplement/Similarity_Search_with_Negative_Examples')[-(1:34)]}
```
## Mapping Surface Water with Unsupervised Classification
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Mapping Surface Water with Unsupervised Clustering'}
knitr::include_graphics('images/gee_satellite_embedding/surface_water_unsupervised.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3ASupplement%2FUnsupervised_Classification_Surface_Water){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Supplement/Unsupervised_Classification_Surface_Water')}
```
## Mapping Urban Tree Cover with Supervised Classification
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Mapping Different Types of Vegetation with Embeddings'}
knitr::include_graphics('images/gee_satellite_embedding/urban_tree_cover.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.com/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3ASupplement%2FSupervised_Classification_Urban_Tree_Cover){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Supplement/Supervised_Classification_Urban_Tree_Cover')[-(1:814)]}
```
## Clustering Polygons with Embeddings
We can calculate mean value of satellite embeddings within each polygon of a layer and cluster them based on similarity. This approach is useful to group regions by similarity. In the example below, we use the US Census Blocks dataset and cluster the blocks within a city based on satellite embeddings.
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Clustered Census Blocks by Mean Satellite Embeddings'}
knitr::include_graphics('images/gee_satellite_embedding/census_clusters.png')
```
[Open in Code Editor ↗](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Satellite-Embedding%3ASupplement%2FClustering_Census_Blocks){target="_blank"}
```{js eval=FALSE, code=readLines('code/gee_satellite_embedding/Supplement/Clustering_Census_Blocks')}
```
----
# Learning Resources
* Official Tutorials in Google Earth Engine User Guide
* [Introduction to the Satellite Embedding Dataset](https://developers.google.com/earth-engine/tutorials/community/satellite-embedding-01-introduction)
* [Unsupervised Classification with Satellite Embedding Dataset](https://developers.google.com/earth-engine/tutorials/community/satellite-embedding-02-unsupervised-classification)
* [Supervised Classification with Satellite Embedding Dataset](https://developers.google.com/earth-engine/tutorials/community/satellite-embedding-03-supervised-classification)
* [Regression with Satellite Embedding Dataset](https://developers.google.com/earth-engine/tutorials/community/satellite-embedding-04-regression)
* [Similarity Search with Satellite Embedding Dataset](https://developers.google.com/earth-engine/tutorials/community/satellite-embedding-05-similarity-search)
# Data Credits
* **Satellite Embedding V1**: The AlphaEarth Foundations Satellite Embedding dataset is produced by Google and Google DeepMind.
* **Sentinel-2 Level-1C, Level-2A**: Contains Copernicus Sentinel data.
* **FAO GAUL 500m: Global Administrative Unit Layers 2015, Second-Level Administrative Units**: Source of Administrative boundaries: The Global Administrative Unit Layers (GAUL) dataset, implemented by FAO within the CountrySTAT and Agricultural Market Information System
(AMIS) projects.
# References
* Brown, C. F., Kazmierski, M. R., Pasquarella, V J., Rucklidge, W. J., Samsikova, M., Zhang, C., Shelhamer, E., Lahera, E., Wiles, O., Ilyushchenko, S., Gorelick, N., Zhang, L. L., Alj, S., Schechter, E., Askay, S., Guinan, O., Moore, R., Boukouvalas, A., & Kohli, P.(2025). AlphaEarth Foundations: An embedding field model for accurate and efficient global mapping from sparse label data. arXiv preprint arXiv.2507.22291. https://arxiv.org/abs/2507.22291
* Sherrie Wang, George Azzari, David B. Lobell, Crop type mapping without field-level labels: Random forest transfer and unsupervised clustering techniques, Remote Sensing of Environment, Volume 222, 2019, Pages 303-317, ISSN 0034-4257, https://doi.org/10.1016/j.rse.2018.12.026.
* Houriez, L., Pilarski, S., Vahedi, B., Ahmadalipour, A., Scully, T. H., Aflitto, N., Andre, D., Jaffe, C., Wedner, M., Mazzola, R., Jeffery, J., Messinger, B., McGinley-Smith, S., & Russell, S. (2025, August). Scalable geospatial data generation using AlphaEarth foundations model (arXiv:2508.11739). arXiv. https://arxiv.org/abs/2508.11739
* Cordeiro, M. C. R.; Martinez, J.-M.; Peña-Luque, S. Automatic Water Detection from Multidimensional Hierarchical Clustering for Sentinel-2 Images and a Comparison with Level 2A Processors.Remote Sensing of Environment 2021, 253, 112209. https://doi.org/10.1016/j.rse.2020.112209.
# License
The course material (text, images, presentation, videos) is licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
The code (scripts, Jupyter notebooks etc.) is licensed under the MIT License. For a copy, see https://opensource.org/licenses/MIT
Kindly give appropriate credit to the original author as below:
Copyright © 2025 Ujaval Gandhi [www.spatialthoughts.com](https://spatialthoughts.com)
# Citing and Referencing
You can cite the course materials as follows
* Gandhi, Ujaval, 2025. *Satellite Embedding Deep Dive* workshop. Spatial Thoughts. https://courses.spatialthoughts.com/gee-satellite-embedding.html
***