Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Adapting segmentation workflows to multispectral and sensor-specific inputs

1. Motivation

The previous page used three-channel aerial imagery to segment buildings. The same segmentation architecture can be used with very different forms of imagery, but the input configuration needs to match the sensor. The source material illustrates this with surface-water mapping from:

  1. standard RGB imagery,

  2. six-band Sentinel-2 imagery,

  3. four-band NAIP imagery.

The central lesson is not that one sensor is universally better. It is that the model can only learn from information contained in the selected image channels at the available Spatial Resolution.


2. Core idea

The segmentation workflow itself barely changes across sensors: the same train_segmentation_model() and semantic_segmentation() calls work whether your input has 3, 4, or 6 bands. The one parameter that must match your data is num_channels. Everything else, tiling, training loop, evaluation, stays the same, which is what makes comparing sensors and band counts a matter of changing one setting rather than rebuilding a pipeline.


3. Three configurations, one workflow

A. RGB imagery: the baseline

Standard three-band RGB imagery (JPG or PNG, without embedded geographic coordinates) is a natural starting point: it isolates the core computer-vision problem from any geospatial complexity, and techniques learned on it transfer directly once you move to georeferenced data.

The model configuration contains:

num_channels = 3
num_classes  = 2

A typical training call is:

On a global waterbody dataset of RGB image-mask pairs, this configuration reaches a best validation IoU around 0.71. RGB alone captures spectral and textural contrasts between water and land, which works reasonably well but leaves useful information on the table.

B. Sentinel-2 multispectral imagery

The Sentinel-2 provides multispectral imagery in 13 spectral bands including these six major bands:

BandApproximate wavelengthRelevance to water
Blue490 nmVisible-water and atmospheric information
Green560 nmVisible contrast and water appearance
Red665 nmLand-water contrast
NIR842 nmStrong water absorption
SWIR11610 nmStrong separation of water from many land surfaces
SWIR22190 nmAdditional separation from wet soil and vegetation

Water absorbs strongly in the near-infrared (NIR) and shortwave infrared (SWIR), producing very low reflectance in these bands compared to vegetation and soil. Including them as extra input channels lets the model exploit a physical property of water that is simply invisible in RGB alone.

The only change from the RGB configuration is num_channels=6, corresponding to blue, green, red, NIR, SWIR1, and SWIR2 bands. On the Earth Surface Water Dataset, this configuration reaches a best validation IoU around 0.90, a marked improvement, largely attributable to the additional spectral information rather than to anything else in the pipeline.

Select three bands to create an RGB Composite. The source Sentinel-2 example uses:

C. NAIP aerial imagery

NAIP provides 4-band (red, green, blue, NIR) aerial imagery at 1-meter resolution. At this resolution, the model can resolve narrow streams, small ponds, and detailed shoreline geometry invisible at Sentinel-2’s 10-to-20-meter resolution.

On a NAIP water-mapping dataset, this configuration reaches a best validation IoU around 0.97. Note the higher learning_rate=0.005 here, a more aggressive setting that requires watching the training curves carefully to confirm the model is converging smoothly rather than overshooting, exactly the kind of check introduced two pages ago.

D. What explains the differences

Two separate factors are at play across these examples: additional spectral bands (particularly NIR and SWIR) give the model physically meaningful signal that plain RGB lacks, while higher spatial resolution reveals finer geometric detail regardless of band count. A real project should reason about which of these two factors, or both, actually matters for its specific target class before assuming “more bands” or “higher resolution” alone will fix a segmentation problem.


4. Common pitfalls


5. Mini task

Your project needs to map small farm ponds (roughly 10 to 30 meters across) using either freely available Sentinel-2 imagery (6 usable bands, 10 to 20 meter resolution) or NAIP imagery (4 bands, 1 meter resolution, limited geographic coverage). Which would you choose, and why?

Sample solution

For ponds only 10 to 30 meters across, NAIP’s 1-meter resolution is likely decisive: at Sentinel-2’s 10-to-20-meter pixel size, a 15-meter pond might span only one or two pixels, which is far too coarse for reliable boundary delineation. This assumes NAIP coverage is available for the study area, which is the main caveat, since NAIP is limited to the United States; if the study area falls outside NAIP’s coverage, Sentinel-2 would be the only option despite its coarser resolution.


6. Key takeaways

Further reading