Skip to content

Commit 1ae0a3f

Browse files
upload latest slides
1 parent 0c48d6f commit 1ae0a3f

8 files changed

Lines changed: 368 additions & 123 deletions

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,7 @@ data/
158158
# Exclude not needed notebooks files
159159
notebooks/exploration.ipynb
160160
notebooks/class_template.ipynb
161-
notebooks/few_shot_approaches_setup.ipynb
161+
notebooks/few_shot_approaches_setup.ipynb
162+
163+
presentation/tutorial-new-tutorial-group-1-NARRATIVE.html
164+
presentation/figures/tutorial-new-tutorial-group-1-NARRATIVE.ipynb

presentation/dimmery.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ $presentation-h3-font-size: 1.3em;
357357

358358
/* Make references tiny */
359359
.refs-super-small {
360-
font-size: 0.6em !important;
360+
font-size: 0.5em !important;
361361
line-height: 1.1em !important;
362362
}
363363

26.2 KB
Loading
1.28 MB
Loading

presentation/tutorial-new-tutorial-group-1-NARRATIVE.html

Lines changed: 77 additions & 15 deletions
Large diffs are not rendered by default.

presentation/tutorial-new-tutorial-group-1-NARRATIVE.qmd

Lines changed: 88 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Few-Shot Learning for Rooftop Detection in Satellite Imagery"
33
subtitle: "Deep Learning Tutorial"
4-
author: "Giorgio Coppala, Nadine Daum, Elena Dreyer, Nico Reichardt"
4+
author: "Giorgio Coppola, Nadine Daum, Elena Dreyer, Nico Reichardt"
55
bibliography: refs.bib
66

77

@@ -31,17 +31,17 @@ format:
3131
## Policy Relevance
3232

3333
- Many public auhorities face the problem of **limited labeled data**
34-
(annotation is expensive, slow, or requires domain expertise)
34+
- Annotation is expensive, slow, or requires domain expertise
3535

3636
- **Applications:**
37-
- medical sector: **rare disease detection**
38-
- emergency management: **flood extent mapping**
39-
- climate & energy: **solar PV rooftop assessment**
40-
- urban planning: **building footprints & infrastructure mapping**
37+
- Medical sector: **rare disease detection**
38+
- Emergency management: **flood extent mapping**
39+
- Climate & energy: **solar PV rooftop assessment**
40+
- Urban planning: **building footprints & infrastructure mapping**
4141

4242
- **Few-shot learning (FSL)** can help:
4343
- Learns to **generalize** from *1–5 labeled support examples per class*
44-
- (in our case) learns a **feature embedding** and constructs **class prototypes**
44+
- (In our case) learns **feature embeddings** and constructs **class prototypes**
4545
- Enables segmentation in a **new city** with *minimal additional annotation*
4646

4747

@@ -63,16 +63,15 @@ rooftop shapes and textures from a small Geneva subset
6363
:::
6464

6565
::: {.column width="45%"}
66-
![](figures/picture_use_case.png){width="100%" style="margin-top: 1rem;"}
6766

68-
<div style="font-size: 0.75rem; color:#666; text-align:center; margin-top:0.2rem;">
69-
Demonstration use case (self-made visualization)
70-
</div>
67+
![](figures/picture_use_case.png){width=90% style="margin-left: 30%;"}
68+
7169
:::
7270

7371
:::
7472

7573

74+
7675
## Dataset: [Roofs of Geneva](https://huggingface.co/datasets/raphaelattias/overfitteam-geneva-satellite-images)
7776

7877
- **Size**: 1,050 labeled image-mask pairs
@@ -97,6 +96,84 @@ Geneva Animation: raw image → overlay rooftop → binary mask
9796
</div>
9897

9998

99+
100+
## Few Shot Learning in General
101+
102+
#### Few-Shot Learning (FSL)
103+
- Learning new **tasks, labels, or segmentations** from very few labeled examples
104+
*(N-way, K-shot)*
105+
106+
#### Few-Shot Semantic Segmentation (FSSS)
107+
- **Goal**: Segment novel object classes using only a few annotated examples
108+
- Assigning a class label to **every pixel**
109+
110+
111+
---
112+
113+
## Prototypical Networks (ProtNets)
114+
115+
* Learn a shared **embedding space** via a backbone model
116+
* Pixels belonging to the same class are **close in feature space**
117+
* Class representations are formed as **prototypes**
118+
* Training follows an **episodic framework**
119+
* Each episode consists of:
120+
- **Support set**:
121+
Few images with **pixel-level masks**
122+
Defines the target classes
123+
- **Query image**:
124+
Image where the model must segment the target classes
125+
126+
## Prototypical Network Overview
127+
128+
#### Workflow
129+
* Support Image → Prototype → Similarity → Query Segmentation
130+
131+
132+
#### Feature Extraction
133+
* **Backbone:** ResNet-18 CNN, pretrained on ImageNet
134+
* **Projection:** feature maps → embedding dimension (256 channels)
135+
136+
137+
#### Evaluation Metric
138+
$$
139+
\mathrm{IoU} = \frac{|A \cap B|}{|A \cup B|}
140+
$$
141+
142+
143+
---
144+
145+
## Prototypical Network Overview
146+
147+
![](figures/illustration_prototypical_network.png){width=100% fig-align="center"}
148+
149+
<div style="font-size:0.75rem; text-align:center; color:#666; margin-top:0.5rem;">
150+
Modified figure from <a href="https://arxiv.org/abs/2210.16829">(Ding et al. 2022)</a>
151+
</div>
152+
153+
154+
---
155+
156+
## (Preliminary) Results
157+
158+
#### (1) Meta training loss
159+
160+
The “avg episode loss” at each epoch is the average cross-entropy error over all support–query tasks in that epoch. The encoder is successfully learning a feature space where prototype-based segmentation works increasingly well.
161+
162+
![](figures/meta_training_loss.png){width="50%" fig-align="center"}
163+
164+
165+
---
166+
167+
## (Preliminary) Results
168+
169+
#### (2) Predicted masks
170+
171+
With 5-shot learning, the predicted masks have a mean IoU over 102 test samples of 0.485.
172+
173+
Here an example:
174+
175+
![](figures/predicted_mask.png){width=80% fig-align="center"}
176+
100177
## Discussion
101178

102179
**Room for improvement:**
@@ -128,7 +205,6 @@ Geneva Animation: raw image → overlay rooftop → binary mask
128205
</div>
129206

130207

131-
132208
## References
133209

134210
::: {.refs-super-small}

presentation/tutorial-new-tutorial-group-1.html

Lines changed: 95 additions & 47 deletions
Large diffs are not rendered by default.

presentation/tutorial-new-tutorial-group-1.qmd

Lines changed: 103 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
title: "Few-Shot Learning for Rooftop Detection in Satellite Imagery"
33
subtitle: "Deep Learning Tutorial"
4-
author: "Giorgio Coppala, Nadine Daum, Elena Dreyer, Nico Reichardt"
4+
author: "Giorgio Coppola, Nadine Daum, Elena Dreyer, Nico Reichardt"
55
bibliography: refs.bib
66

77

88
resources:
99
- img/**
10-
- figures/**
1110

1211
format:
1312
revealjs:
@@ -29,86 +28,151 @@ format:
2928
---
3029

3130

31+
## Policy Relevance
32+
33+
- Many public auhorities face the problem of **limited labeled data**
34+
- Annotation is expensive, slow, or requires domain expertise
35+
36+
- **Applications:**
37+
- Medical sector: **rare disease detection**
38+
- Emergency management: **flood extent mapping**
39+
- Climate & energy: **solar PV rooftop assessment**
40+
- Urban planning: **building footprints & infrastructure mapping**
41+
42+
- **Few-shot learning (FSL)** can help:
43+
- Learns to **generalize** from *1–5 labeled support examples per class*
44+
- (In our case) learns **feature embeddings** and constructs **class prototypes**
45+
- Enables segmentation in a **new city** with *minimal additional annotation*
46+
47+
3248

3349
## Problem Setting
3450

35-
::: columns
36-
::: column
37-
- Cities need accurate rooftop maps to plan and scale **solar PV installations**
51+
::: {.columns}
3852

39-
- Manual rooftop labeling is **slow** and **costly**
53+
::: {.column width="55%"}
4054

41-
- Every city looks different → traditional models do not **generalize** well
55+
- Goal of the tutorial: apply **Prototypical Networks** to
56+
rooftop segmentation using only a few labeled tiles
4257

43-
### Idea:
58+
- **Few-shot segmentation** allows the model to learn characteristic
59+
rooftop shapes and textures from a small Geneva subset
4460

45-
- **Few-shot learning** makes segmentation possible with only a handful of labeled examples
61+
- Demonstrates how rooftop maps can be produced for solar potential estimation in a **new geographic setting** with limited labels
4662

4763
:::
4864

49-
::: column
65+
::: {.column width="45%"}
66+
5067
![](figures/picture_use_case.png){width=90% style="margin-left: 30%;"}
68+
5169
:::
70+
5271
:::
5372

5473

55-
## Dataset: [Rooftops of Geneva](https://huggingface.co/datasets/raphaelattias/overfitteam-geneva-satellite-images)
5674

57-
::: {.two-col-60-40}
58-
::: {.col-left}
75+
## Dataset: [Roofs of Geneva](https://huggingface.co/datasets/raphaelattias/overfitteam-geneva-satellite-images)
5976

60-
- **Satellite Images**: High-resolution RGB satellite images of Geneva available on Huggingface
6177
- **Size**: 1,050 labeled image-mask pairs
78+
6279
- **Task**: Binary segmentation masks (rooftop vs background)
80+
6381
- **Geographic splits**: 3 grids/ neighborhoods (North, Center, South)
82+
6483
- **Image size**: 250x250 pixels
84+
6585
- **Categories**: Industrial, Residential
6686

67-
:::
6887

69-
::: {.col-right}
88+
## Inside the dataset
7089

71-
![](figures/grids_animation.gif){width=80%}
72-
![](figures/geneva-map-gif.gif){width=80%}
90+
<div style="text-align:center;">
91+
![](figures/grids_animation.gif){width="50%"}
92+
</div>
93+
94+
<div style="font-size:0.75rem; text-align:center; color:#666; margin-top:0.5rem;">
95+
Geneva Animation: raw image → overlay rooftop → binary mask
96+
</div>
7397

74-
:::
75-
:::
7698

7799

78100
## Few Shot Learning in General
79101

80-
tbd
102+
#### Few-Shot Learning (FSL)
103+
- Learning new **tasks, labels, or segmentations** from very few labeled examples
104+
*(N-way, K-shot)*
81105

106+
#### Few-Shot Semantic Segmentation (FSSS)
107+
- **Goal**: Segment novel object classes using only a few annotated examples
108+
- Assigning a class label to **every pixel**
82109

83-
## Prototypical Network
84110

85-
::: {.two-col-80-20}
86-
::: {.col-left}
87-
![](figures/illustration_prototypical_network.png){width=100%}
111+
---
88112

89-
*(modified from)* [SRPNet](https://arxiv.org/abs/2210.16829)
113+
## Prototypical Networks (ProtNets)
90114

91-
:::
115+
* Learn a shared **embedding space** via a backbone model
116+
* Pixels belonging to the same class are **close in feature space**
117+
* Class representations are formed as **prototypes**
118+
* Training follows an **episodic framework**
119+
* Each episode consists of:
120+
- **Support set**:
121+
Few images with **pixel-level masks**
122+
Defines the target classes
123+
- **Query image**:
124+
Image where the model must segment the target classes
92125

93-
::: {.col-right}
94-
- high-level schematic (support → prototype → similarity → segmentation)
95-
- 1-way-1-shot → explain what it means
96-
- Data preprocessing (augmentation, geographic splits)
97-
- Model architecture (feature extraction, CNN layers, backbone)
98-
- Training strategy
99-
- Loss function
100-
- Evaluation metrics
126+
## Prototypical Network Overview
101127

102-
:::
103-
:::
128+
#### Workflow
129+
* Support Image → Prototype → Similarity → Query Segmentation
130+
131+
132+
#### Feature Extraction
133+
* **Backbone:** ResNet-18 CNN, pretrained on ImageNet
134+
* **Projection:** feature maps → embedding dimension (256 channels)
135+
136+
137+
#### Evaluation Metric
138+
$$
139+
\mathrm{IoU} = \frac{|A \cap B|}{|A \cup B|}
140+
$$
141+
142+
143+
---
144+
145+
## Prototypical Network Overview
146+
147+
![](figures/illustration_prototypical_network.png){width=100% fig-align="center"}
148+
149+
<div style="font-size:0.75rem; text-align:center; color:#666; margin-top:0.5rem;">
150+
Modified figure from <a href="https://arxiv.org/abs/2210.16829">(Ding et al. 2022)</a>
151+
</div>
152+
153+
154+
---
155+
156+
## (Preliminary) Results
157+
158+
#### (1) Meta training loss
159+
160+
The “avg episode loss” at each epoch is the average cross-entropy error over all support–query tasks in that epoch. The encoder is successfully learning a feature space where prototype-based segmentation works increasingly well.
161+
162+
![](figures/meta_training_loss.png){width="50%" fig-align="center"}
163+
164+
165+
---
104166

105167
## (Preliminary) Results
106168

107-
- Show performance for 1-shot / 5-shot / full-data comparison
169+
#### (2) Predicted masks
108170

109-
- Show predicted masks
171+
With 5-shot learning, the predicted masks have a mean IoU over 102 test samples of 0.485.
110172

173+
Here an example:
111174

175+
![](figures/predicted_mask.png){width=80% fig-align="center"}
112176

113177
## Discussion
114178

@@ -141,7 +205,6 @@ tbd
141205
</div>
142206

143207

144-
145208
## References
146209

147210
::: {.refs-super-small}
@@ -174,10 +237,3 @@ tbd
174237
:::
175238

176239

177-
178-
179-
180-
181-
182-
183-

0 commit comments

Comments
 (0)