import marimo
__generated_with = "0.25.2"
app = marimo.App(
width="full",
app_title="hyperFVC | Paper methods and results",
css_file="viewer.css",
)
@app.cell
async def _():
from pathlib import Path
import marimo as mo
from paper import FIGURES, TABLES, image_or_note, load_paper
from paper_sections import DISCUSSION, METHODS, RESULTS
from reuse import MODULES, checkpoint_families, load_reuse, module_ids, source_bytes
from reuse_guides import example_code, figure_modules, visual_example
root = Path(__file__).resolve().parent
paper = await load_paper(root)
reuse = await load_reuse(root)
return (
DISCUSSION, FIGURES, METHODS, MODULES, RESULTS, TABLES, checkpoint_families,
example_code, figure_modules, image_or_note, mo, module_ids, paper, reuse,
root, source_bytes, visual_example,
)
@app.cell
def _(mo):
section = mo.ui.radio(
{
"π Overview": "Overview",
"π§ͺ Methods": "Methods",
"π Results": "Results",
"π¬ Discussion": "Discussion",
"π Reproduce": "Reproduce",
},
value="π Overview",
)
return (section,)
@app.cell
def _(mo):
# Persistent tab bar: content is rendered below so its selection survives reruns.
view_tabs = mo.ui.tabs({"π Paper": "", "π§© Reuse code & checkpoints": ""})
return (view_tabs,)
@app.cell
def _(DISCUSSION, METHODS, RESULTS, mo, section):
_topics = (
METHODS if section.value == "Methods"
else RESULTS if section.value == "Results"
else DISCUSSION if section.value == "Discussion"
else {}
)
topic_picker = mo.ui.radio(list(_topics), value=next(iter(_topics), None))
return (topic_picker,)
@app.cell
def _(FIGURES, MODULES, TABLES, mo, paper, reuse):
_sha = paper["manifest"]["tex_sha256"]
mo.Html(f"""
""")
return
@app.cell
def _(mo, section, topic_picker):
_nav = [
mo.Html('
πΏ hyperFVC
'),
mo.Html('Section
'),
section,
]
if section.value in ("Methods", "Results", "Discussion"):
_nav += [mo.Html(f'{section.value} topics
'), topic_picker]
_nav += [
mo.Html("""
Classes
PV photosynthetic vegetation
NPV non-photosynthetic vegetation
BE bare earth
Reading tips
New here? Start at Overview β Methods β Results β
Discussion in order; Discussion is where the paper explains what
the Results numbers actually mean and where the evidence stops. Use the
Paper tab for text, tables and figures, and Reuse code for
notebook-style module guides. Nothing is trained or recomputed by this
viewer.
Live analysis
For interactive ENVI tiles, spectra, indices and ONNX
inference run marimo run analysis.py
(or marimo edit analysis.py to add your own cells).
"""),
]
mo.sidebar(_nav)
return
@app.cell
async def _(
DISCUSSION, FIGURES, METHODS, MODULES, RESULTS, TABLES, figure_modules,
image_or_note, mo, paper, root, section, topic_picker,
):
_blocks = []
if section.value == "Overview":
def _chart(bars, wide=False):
_cols = "".join(
f''
f'
{_v:.3f}'
f'
'
f'
{_l}'
f'
'
for _l, _v, _c in bars
)
_cls = "fvc-chart wide" if wide else "fvc-chart"
return f'{_cols}
'
_grey, _ltblue, _medblue, _purple, _navy, _green = (
"#c9ccd1", "#9fc4ec", "#4f82c9", "#7d4fd9", "#1f3b6e", "#2f8f5b",
)
_model_legend = """
PCA-3 + U-Net
PCA-10 + U-Net
Full-band U-Net (M1)
SS3FCN
Random Forest
CNN M5 (proposed)
"""
_blocks = [
mo.Html(f"""
Sections{len(METHODS)} methods Β· {len(RESULTS)} results Β· {len(DISCUSSION)} discussion
Manuscript tables{len(TABLES)}
Manuscript figures{len(FIGURES)}
ClassesBE Β· NPV Β· PV
"""),
mo.md("""
## Start with the study
**Methods** explains the study site, inputs, FVC labels, model versions,
training and evaluation protocols. **Results** presents the paper's
ablation, baseline, spatial, external-site, spectral and edge-deployment
evidence. **Discussion** explains what those results mean, where they
disagree with a simple "bigger model wins" story, and where the evidence
stops (limitations, future work, conclusions).
The visual explorer distinguishes internal held-out tests from external
zero-shot evaluation and preserves the averaging unit of each table.
"""),
mo.md("""
## Why this study
Fractional vegetation cover β bare earth (**BE**), non-photosynthetic
vegetation (**NPV**: dry/senescent material, litter, woody debris) and
photosynthetic vegetation (**PV**) β is an ecologically meaningful
descriptor of dryland condition, but **NPV is the hardest component to
separate**: its spectral and spatial signature overlaps shadow, exposed
substrate and mixed vegetationβsoil pixels. This study benchmarks a
spectral-channel-adapted CNN against five baselines, characterises *why*
NPV stays ambiguous post-inference, and tests edge-GPU deployment β
see **Methods β Study context and objectives** for the full framing.
"""),
mo.hstack([
mo.vstack([
mo.md("#### Study sites, Calperum Station, South Australia"),
await image_or_note(
mo, root, root / "paper" / paper["manifest"]["figures"]["study_area"]["path"],
"Site locations at Calperum Station and the UAS platforms used.", "100%",
),
]),
mo.vstack([
mo.md("#### Training site (medium density) vs. zero-shot site (low density)"),
await image_or_note(
mo, root, root / "paper" / paper["manifest"]["figures"]["study_sites"]["path"],
"Multi-sensor imagery contrast between the medium (training) and low (inference) vegetation sites.", "100%",
),
]),
], widths="equal", gap=1),
mo.md("""
| Site | Role | Vegetation | Area |
|---|---|---|---|
| **SASMDD0001** (medium) | Training / internal evaluation | Regenerating multi-stemmed mallee *Eucalyptus* spp. over sparse *Triodia* hummock grassland | β15 ha |
| **SASMDD0013** (low) | Zero-shot external evaluation only | Low open *Eucalyptus largiflorens* woodland, sparse chenopod shrubs | β2.8 ha |
SASMDD0013 never contributes training data β it is used exclusively for
frozen, zero-shot cross-site testing.
"""),
mo.Html("""
From spectra to vegetation maps
How data, models and evaluation design fit
together β numbers below are this manuscript's, not a different
study's; see Discussion β Limitations, future work & conclusions
for the full table and caveats.
1
Data & task
Classify BE / NPV / PV at Calperum Station, SA
- MicaSense: native 5 cm + a 10 cm matched-resolution control
- Specim FX10+FX17 fused: 10 cm, 296 combined bands (VNIRβSWIR)
- 15 annotated tiles; 1 cm manual masks, majority-vote downsampled
2
Models compared
Common U-Net backbone + 5 external baselines
- M1 plain U-Net β M5 spectral adapter + cross-channel attention + NPV-weighted loss
- Baselines (296-band benchmark): Random Forest, PCA-3, PCA-10, SS3FCN
- Same architecture family throughout the M1βM5 ablation
3
Evaluation design
Same labels, folds and metrics for every model
- 3-fold spatial block CV (8 train / 3 val / 4 test tiles), within-site
- 5-tile zero-shot cross-site transfer (SASMDD0013, frozen checkpoints)
- BE/NPV/PV F1, macro F1, mIoU, 50-pass MC-dropout uncertainty
4
Results β four questions, four answers
Each links to a Discussion topic for the full caveats
A Β· NPV-weighting
Does it help?
NPV F1 0.496
M5 vs plain U-Net M1, +0.148 β the single largest driver of
NPV gain in the ablation.
B Β· Baselines
Does M5 beat them all?
NPV F1 0.461
M5 vs Random Forest (0.688 mean F1) and SS3FCN (0.685) β M5's
edge is specifically NPV, not every class.
C Β· Resolution
Does fine detail matter?
+0.094 mIoU
Matched at 10 cm, MICA still beats FX10βFX17 by this
margin β resolution helps, but doesn't explain everything.
D Β· Cross-site transfer
Does it hold at a new site?
NPV F1 β€ 0.120
Zero-shot at SASMDD0013, every model tested β BE/PV
transferred better than NPV.
1 Β· Weighting, not architecture
NPV-weighted loss drove the FVC-mapping gain; spectral adaptation
and attention were supporting components.
2 Β· Compression costs NPV
PCA underperformed the full 296-band input despite keeping
>99% of spectral variance.
3 Β· Resolution helps, unevenly
Fine detail improved metrics, but not identically across
sensors or patch scales.
4 Β· Within-site β cross-site
Strong source-site numbers did not guarantee NPV transfer to
a new site.
"""),
mo.Html(f"""
Model & resolution comparison, MICA within-site
Recreated in code from the author's own conference
poster ("Mapping Vegetation Functional States", companion to this manuscript β
see Reproduce β Poster). This is a MICA-native-resolution benchmark, a
different cut of the same study to the FX10βFX17 296-band tables above;
numbers are transcribed from the poster graphic, not re-parsed from the
captured TeX, so treat exact decimals as approximate.
1
Spatial resolution matters
CNN benefits from fine spatial detail (5 cm)
Macro F1 by resolution
{_chart([
("RF 5cm", 0.822, _navy), ("M5 5cm", 0.886, _green),
("RF 10cm", 0.773, _navy), ("M5 10cm", 0.772, _green),
])}
NPV F1 by resolution
{_chart([
("RF 5cm", 0.600, _navy), ("M5 5cm", 0.725, _green),
("RF 10cm", 0.528, _navy), ("M5 10cm", 0.539, _green),
])}
2
Spectral dimensionality
PCA reduction removes useful information
NPV F1 (hyperspectral, within-site)
{_chart([
("PCA-3", 0.320, _grey), ("PCA-10", 0.367, _ltblue),
("Full-band (M1)", 0.461, _medblue),
])}
3
NPV weighting
Same architecture β helps the difficult NPV class
NPV F1 (within-site, 5 cm)
{_chart([("M4, no weighting", 0.661, _grey), ("M5, NPV-weighted", 0.725, _green)])}
4
Model comparison (5 cm, within-site)
CNN M5 outperforms traditional and other baselines
{_model_legend}
Macro F1
{_chart([
("PCA-3", 0.603, _grey), ("PCA-10", 0.641, _ltblue),
("M1", 0.669, _medblue), ("SS3FCN", 0.688, _purple),
("RF", 0.822, _navy), ("M5", 0.886, _green),
], wide=True)}
mIoU
{_chart([
("PCA-3", 0.520, _grey), ("PCA-10", 0.550, _ltblue),
("M1", 0.571, _medblue), ("SS3FCN", 0.579, _purple),
("RF", 0.700, _navy), ("M5", 0.750, _green),
], wide=True)}
NPV F1
{_chart([
("PCA-3", 0.320, _grey), ("PCA-10", 0.367, _ltblue),
("M1", 0.461, _medblue), ("SS3FCN", 0.452, _purple),
("RF", 0.600, _navy), ("M5", 0.725, _green),
], wide=True)}
5
Cross-site generalisation
Useful overall at 5 cm, but NPV remains challenging
External site (5 tiles, MICA)
{_chart([
("Macro F1 5cm", 0.648, _green), ("Macro F1 10cm", 0.609, _navy),
])}
{_chart([
("mIoU 5cm", 0.602, _green), ("mIoU 10cm", 0.519, _navy),
])}
{_chart([
("NPV F1 5cm", 0.415, _green), ("NPV F1 10cm", 0.347, _navy),
])}
1 Β· Fine spatial detail matters
At 5 cm, CNN M5 improves overall and NPV classification vs
Random Forest; at 10 cm the two are similar.
2 Β· Spectral dimensionality matters
PCA-reduced inputs lower NPV performance even at high explained
variance; full spectral information works better.
3 Β· NPV weighting helps
Weighting the NPV class within the same CNN improves detection
of this difficult, under-represented class.
4 Β· CNNs reduce feature engineering
CNNs learn spectralβspatial patterns directly; traditional ML
needs manual features and is more sensitive to shadow.
"""),
mo.callout(mo.md(
"**Source of truth:** the captured `elsarticle-template-harv.tex`. "
"The accompanying PDF has an older modification time and has not been "
"verified to match the TeX; consult the TeX for exact wording and citations. "
"This is a manuscript snapshot, not a live publication."
), kind="warn"),
mo.md(
"### How to read the results\n"
"- **BE**, **NPV**, **PV** are the three segmentation classes.\n"
"- F1 and mIoU summarise segmentation; uncertainty is not error probability.\n"
"- Spectral importance is model sensitivity, not a measured plant trait.\n"
"- Deployment agreement is parity against PyTorch, not ground-truth accuracy.\n"
"- The five external tiles are not established as representative of the site."
),
]
elif section.value == "Reproduce":
_manifest = paper["manifest"]
_blocks = [
mo.md(f"""
## Manuscript snapshot and workflow
- Captured TeX: `paper/elsarticle-template-harv.tex`
(source modified **{_manifest['tex_modified_utc']}**).
- Captured PDF: `paper/elsarticle-template-harv.pdf`
(source modified **{_manifest['pdf_modified_utc']}**).
- The PDF is older and may not reflect the TeX. They were **not**
regenerated or checked for equivalence.
- `paper/manifest.json` records SHA-256 hashes for the TeX, PDF and
every figure. The displayed tables are parsed from the captured TeX.
The source snapshot under `workflow/` retains the three original
pipeline phases and scripts. See `README.md` for environment and
external data mapping; raw imagery, masks and checkpoints are not
bundled. Training and inference have not been rerun for this viewer.
The former broad notebook/CSV explorer is preserved as
`archive_app.py`; its historical outputs are **not** paper results.
"""),
mo.md(f"**TeX SHA-256:** `{_manifest['tex_sha256']}` \n"
f"**PDF SHA-256:** `{_manifest['pdf_sha256']}`"),
mo.callout(mo.md("""
**Companion poster**
`paper/1400_Wednesday_Centurion1_lauraSotomayor.pptx` is the conference
talk for "Mapping Vegetation Functional States" β the same study's
MICA-native-resolution benchmark, summarised as `paper/diagram_1.png`
(results panels, recreated on the Overview tab) and `paper/diagram_2.png`
("From spectra to vegetation maps", recreated as the Overview's first
diagram). It is a different cut of the data to the FX10βFX17 296-band
tables captured from the manuscript TeX elsewhere in this viewer β not
parsed/hash-verified the way the TeX tables are, so treat its numbers as
the author's own reporting rather than this viewer's verified source of
truth. The full A0 poster lives at the repository root as
`README_POSTER.md` / `vegetation_functional_states_A0_portrait.pdf`.
"""), kind="neutral"),
mo.md("""
## Reproduction walkthrough
From the full `workflow/` tree, in the **modelling** environment
(`environment.yml`), not this viewer's small environment:
```bash
mamba env create -f environment.yml
mamba activate fvc_function
python utils/fvc_paths.py --check # confirm data roots resolve before anything else
```
`configs/paths.yaml` holds every machine-specific location; override a
root per run with `FVC_DATA_ROOT=/mnt/disk/calperumResearch bash scripts/