Neural Networks and Convolutional Architectures for Earth Observation
Anefelo
Duration: 2.5 hours
Type: Theory + Interactive Demos
Goal: Bridge traditional ML → deep learning for EO
You will learn: - ML → DL transition and when to use each - Neural network fundamentals (perceptron, activations) - CNN building blocks and intuition - Popular architectures (LeNet, VGG, ResNet, U‑Net) - Practicalities: data, compute, transfer learning - Philippine EO applications (DENR, DRRM, LGUs)
Prerequisites: - Sessions 1–2 completed (Random Forest) - Basics of Python/NumPy - Colab (CPU is enough for this session)
Resources: - Notebook: session3_theory_interactive.ipynb
Traditional ML (Sessions 1–2) - Manual features: NDVI, NDWI, NDBI - Texture (GLCM), temporal, topographic - Pros: Interpretable, data‑efficient - Cons: Limited by manual design
Deep Learning (Sessions 3–4) - Learns features from raw pixels - Hierarchical representations - Pros: SOTA accuracy, rich spatial context - Cons: Needs more data/compute
When to use which?
Perceptron: \[ y = f\!\left(\sum_{i=1}^{n} w_i x_i + b\right) \]
Activation functions: - Sigmoid: \(\sigma(z) = \frac{1}{1 + e^{-z}}\) (probabilities) - ReLU: \(\max(0, z)\) (hidden layers) - Softmax: \(\text{softmax}(z_i) = \frac{e^{z_i}}{\sum_j e^{z_j}}\) (multi‑class)
Training loop: 1. Forward pass → predictions
2. Compute loss (e.g., cross‑entropy)
3. Backprop gradients
4. Update weights
Key hyperparameters: learning rate, batch size, epochs
Convolution: \[(I * K)(i,j) = \sum_{m}\sum_{n} I(i+m, j+n)\,K(m,n)\]
Pooling (MaxPool 2×2): reduces spatial size, adds invariance
LeNet‑5: classic, small; education & prototypes
VGG‑16: many 3×3 convs; simple but heavy
ResNet‑50: residual blocks; deep & efficient
U‑Net: encoder‑decoder + skip connections
- Semantic segmentation (flood, buildings)
- Preserves detail via skips
| Task | Output | Typical CNN |
|---|---|---|
| Scene classification | One label per chip | ResNet, EfficientNet |
| Semantic segmentation | Pixel‑wise labels | U‑Net, DeepLabv3+ |
| Object detection | Boxes + classes | YOLO, Faster R‑CNN |
| Change detection | Change mask | Siamese/U‑Net variants |
Philippine use cases: - Land cover, cloud detection, floods, buildings, mining, DRM
Data‑centric AI
Quality > quantity; representative sampling; balanced classes; solid validation split
from tensorflow.keras.applications import ResNet50
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, Dropout
base = ResNet50(include_top=False, weights='imagenet', pooling='avg', input_shape=(64,64,3))
base.trainable = False # feature extractor
model = Sequential([
base,
Dense(256, activation='relu'),
Dropout(0.5),
Dense(10, activation='softmax')
])When: limited labels, need quick/strong baseline
# Keras 3 preprocessing layers (ImageDataGenerator is deprecated)
from tensorflow import keras
from tensorflow.keras import layers
aug = keras.Sequential([
layers.RandomFlip('horizontal_and_vertical'),
layers.RandomRotation(0.25),
layers.RandomBrightness(0.1, value_range=(0, 1)),
layers.RandomZoom(0.1)])| Model | Time (GPU) | Memory |
|---|---|---|
| Small CNN (EuroSAT) | 5–15 min | < 4 GB |
| ResNet50 fine‑tune (224 px) | 15–45 min | ~8 GB |
| U‑Net (Day 3) | 30 min – hours | 8–16 GB |
Indicative, single Colab T4‑class GPU
Tips: mixed precision, batch size tuning, smaller chips
Potential users: PhilSA, DENR, DA, NDRRMC, LGUs
Notebooks: - session3_theory_interactive.ipynb
Docs: Keras guides · CNN Explainer · EuroSAT
EO AI/ML Training · Day 2 · Session 3 | Deep Learning & CNNs