CanopyGIS — Hybrid Tri-Engine Urban Tree Canopy & Centroid Extraction (SAM 3 + Weecology DeepForest 2.1.0 + Geodesic Watershed + RAG)
CanopyGIS (SAE-LIM Sub-Engine [D]: Geo-AI Canopy Segmentation v1.8.1) is an open-source urban forestry and geospatial canopy-analysis platform. It extracts continuous woody canopy coverage, individual tree-crown polygons, treetop centroids, and allometric attributes from georeferenced satellite/aerial imagery (Google VHR Satellite Zoom 19–22 at 3.6–29.6 cm/px or uploaded GeoTIFF/RGB files) without requiring airborne LiDAR—pairing a standalone pure zero-shot planar evaluator (SAM 3 (facebook/sam3) + Marker-Controlled Compact Geodesic Watershed + 3-Pass Region-Adjacency-Graph (RAG) Coalescing in src/canopygis_v18_eval.py) with an interactive web portal (src/canopy_v2.py) that adds optional Weecology DeepForest 2.1.0 (RetinaNet-ResNet50-FPN) nadir treetop seeding.
Full Hybrid Closed-Canopy View (On Nut 229.4 Acres (928,176 sqm) · 2,987 Crowns) |
Weecology DeepForest 2.1.0 Priority-1 Treetop Anchor Seeds (108 Core Seeds) |
|---|---|
![]() |
![]() |
- Two-Track Architecture (Pure Zero-Shot Benchmark vs. Interactive Web Portal): The standalone
v1.8.1evaluator (src/canopygis_v18_eval.py) runs pure zero-shotSAM 3+ Compact Geodesic Watershed + 3-Pass Region-Adjacency-Graph (RAG) Coalescing (0forestry training hours, no DeepForest dependency) forMillionTrees v0.25. The interactive web portal (src/canopy_v2.py) additionally supports optionalWeecology DeepForest 2.1.0(RetinaNet-ResNet50-FPN) nadir treetop seed anchoring across tiled rasters (1,050–8,698raw candidate boxes per site). - Zero-Install Pre-Loaded Interactive Demo: Ships with pre-computed GeoJSON sessions for
On Nut Waste Center(ON,229.4 Acres (928,176 sqm),2,987crowns),Nong Khaem Waste Center(NK,150.2 Acres (607,888 sqm),2,110crowns), andRamintra Sports Park(23.4 Acres (94,544 sqm),1,462crowns) so anyone launching the web UI (or visiting the Live GitHub Pages Demo) immediately sees segmented crowns on initial load, togglesSAM 3/DeepForest/Watershedlayers, and drags< 30 msreal-time physical filter sliders without waiting for GPU inference. - 3-Pass
RAGSmall-Basin Coalescing: Eliminates-100%of< 4.0 m²over-segmented watershed micro-shards (1,568 → 0onOn Nut) and-99.35%of< 8.0 m²shoulder shards (3,363 → 22). - Vectorized Shapely 2.0 Post-Processing: Profiling
CanopyGISon multi-thousand-crown rasters surfaced and resolved key geometry construction and distance bottlenecks (74×–421×speedup onformat_boxes,match_points, andconvert_to_sv_format, contributed upstream toWeecology/DeepForest#1447and#1440).
| Evaluation Dimension | Workflow / Engine Configuration | Visual Comparison Bar | Measured Result & Delta vs. Baseline |
|---|---|---|---|
1. Micro-Shard Elimination (< 4 m² Noise Reduction) ↑ |
CanopyGIS v1.8.1 (3-Pass RAG Coalescing) Unmerged Classical Watershed Baseline |
████████████████████ 100.0% Clean░░░░░░░░░░░░░░░░░░░░ 0.0% (1,568 Shards) |
0 Micro-Shards (1,568 → 0 on On Nut)1,568 Over-Segmented Shards |
2. Interactive Filter Latency (2,987 Crowns) ↓(Lower = Better) |
Client-Side Coupled Physical Sliders Server-Side Re-Segmentation Loop |
█░░░░░░░░░░░░░░░░░░░ < 30 ms████████████████████ 194,300 ms |
< 30 ms Real-Time UI (6,400× faster)194.3 s Full Pipeline Re-Run |
| 3. Multi-Site Crown Verification Confidence ↑ | Nong Khaem (150.2 Acres (607,888 sqm), 2,110 Crowns)Ramintra Park ( 23.4 Acres (94,544 sqm), 1,462 Crowns)On Nut ( 229.4 Acres (928,176 sqm), 2,987 Crowns) |
███████████████░░░░░ 73.4% Mean Conf██████████████░░░░░░ 70.6% Mean Conf██████████████░░░░░░ 68.4% Mean Conf |
100% Verified across 23 Visual Audit Regions Zoom 20 ( 14.5 cm/px VHR)Zoom 19 ( 29.6 cm/px Regional Campus) |
Status (2026-11-04): Accepted SAE-LIM Sub-Engine [D] CanopyGIS V1.0 Open-Source Self-Calibrating Hybrid Tri-Engine (Pillar 1: Scene-Normalized Physical Score Contract + 4-Way Symmetric Step 2C + Isotropic N-S/E-W Corridor Bridging + CUDA/MPS/CPU Device Resolution; Pillar 2: < 30 ms Real-Time Post-Processing Filter Sliders + Review Layer Toggles + Auto-Tune Override Persistence) production prototype. Runtime execution integrates Dual-Stream Radiometric Normalization (Stream A: CIELAB L-channel Shadow-Lift Gamma 0.78 + gentle CLAHE 1.4 + conditional UL-09 Rayleigh Path-Radiance Subtraction for AI perception; Stream B: Illumination-Invariant Raw RGB, 3D Woody Relief & UL-09 Haze-Compensated Chlorophyll Filter) + SAM 3 (SamGeo3 single-crown masks + Multi-Scale Woodland Promotion Step 2A/2B/2C + negative "car" vehicle veto) + Weecology DeepForest 2.1.0 (RetinaNet-ResNet50-FPN closed-canopy nadir treetop seeds) + Global Compact Geodesic Watershed (skimage.segmentation.watershed, compactness=0.005) with 3-Pass Region-Adjacency-Graph (RAG) Small-Basin Coalescing (< 13.5 m² shoulder shard absorption at GSD >= 0.22 m/px + single outer contour per basin) + Ornamental Courtyard & Nursery Grid Dome Extractor (1.0–6.0 m² patterned garden/nursery crowns) + Coupled [0.0–1.0] Physical Score Contract (foliage_prob, relief_3d_score, artificial_cyan_score) powering < 30 ms Client-Side Live Post-Processing Sliders (Min Confidence, Grass/Flat-Surface 3D Relief Filter, Cyan Roof/Vehicle Rejection, Min/Max Crown Area, and Source Engine Pills). See the unified architecture, anti-cheat benchmark protocol (Playbook 6 — Tier 2E), and multi-biome verification ledgers in docs/CANOPYGIS_EVOLUTION_AND_BENCHMARK_PROTOCOL.md (historical Wave 3–8 audit logs archived in docs/archive/ARCHIVE_CANOPY_V2_WAVE_LOGS.md).
%%{init: {'theme': 'neutral'}}%%
flowchart LR
subgraph Canvas [" "]
In["Input VHR GeoTIFF or RGB (Zoom 19 to 22)"] --> Norm["Dual-Stream Radiometric Normalization"]
subgraph Engines ["Hybrid Tri-Engine Segmentation (LIVE)"]
E1["Tier 1: SAM 3 Single-Crown Masks (LIVE)"]
E2["Tier 2: Weecology DeepForest 2.1 Seeds (LIVE)"]
E3["Tier 3: Compact Geodesic Watershed + 3-Pass RAG (LIVE)"]
end
Norm --> E1
Norm --> E2
E1 --> E3
E2 --> E3
E3 --> Score["Coupled Physical Score Contract (0.0 to 1.0)"]
Score --> Out["Interactive Map UI + GeoJSON / CSV / GIS Export"]
end
classDef default fill:#ffffff,stroke:#475569,color:#0f172a,stroke-width:1px
style Canvas fill:#ffffff,stroke:#cbd5e1,stroke-width:1.5px,color:#0f172a
style Engines fill:#f8fafc,stroke:#94a3b8,color:#0f172a
%%{init: {'theme': 'neutral'}}%%
flowchart LR
subgraph Canvas [" "]
subgraph Step1 ["1. Data Input"]
Preset["Select Site Preset or Draw Polygon ROI"]
Fetch["Fetch Google VHR Tiles or Upload GeoTIFF"]
end
subgraph Step2 ["2. Hybrid Detection"]
Run["Run SAM 3 + DeepForest 2.1 + Watershed"]
Filter["Adjust Real-Time Filter Sliders (under 30 ms)"]
end
subgraph Step3 ["3. GIS Deliverables"]
Out1["Crown Polygons + Treetop Centroids"]
Out2["GeoJSON / Shapefile / CSV Export"]
end
Preset --> Fetch
Fetch --> Run
Run --> Filter
Filter --> Out1
Filter --> Out2
end
classDef default fill:#ffffff,stroke:#475569,color:#0f172a,stroke-width:1px
style Canvas fill:#ffffff,stroke:#cbd5e1,stroke-width:1.5px,color:#0f172a
style Step1 fill:#f8fafc,stroke:#94a3b8,color:#0f172a
style Step2 fill:#f8fafc,stroke:#94a3b8,color:#0f172a
style Step3 fill:#f8fafc,stroke:#94a3b8,color:#0f172a
The web portal auto-loads the pre-computed On Nut campus session on startup (both in FastAPI mode and static GitHub Pages Interactive Demo Mode) and supports 1-click switching with automatic per-site polygon boundary and session restoration (canopygis_preset_boundaries_v1 + GET /latest_session?site_preset=... or static src/uploads/*.json fallback, supporting both short and canonical preset keys) across all three Bangkok benchmark sites:
Preset Key (UI / API Alias) |
Site Name | Center Coordinates (Lat, Lon) |
Default BBox & Official Polygon | Verified Crowns |
|---|---|---|---|---|
onnut / on_nut_waste_center (ON) |
On Nut Waste Center (Official 229.4 Acres (928,176 sqm) Campus Boundary) |
13.714447°N, 100.683989°E |
1,540 m × 1,440 m (Official ROI, 229.4 Acres (928,176 sqm)) |
2,987 (68.4% conf) |
nongkhaem / nong_khaem_waste_center (NK) |
Nong Khaem Waste Center (Official 150.2 Acres (607,888 sqm) BMA Boundary) |
13.718255°N, 100.358126°E |
1,260 m × 1,250 m (93-vertex ROI, 150.2 Acres (607,888 sqm)) |
2,110 (73.4% conf) |
ramintra / ramintra_sports_park |
Ramintra Sports Park (Archived Urban Park Benchmark · Bang Khen, Bangkok) | 13.879366°N, 100.619659°E |
710 m × 396 m (10-vertex ROI, 23.4 Acres (94,544 sqm)) |
1,462 (70.6% conf) |
- Unified VHR Provider (
Google VHR Satellite): Zero-token pooledThreadPoolExecutor(max_workers=8)fetcher requestingscale=2(512×512 px) tiles frommt0–mt3.google.com/vt/lyrs=swith automatic multi-zoom fallback (z22 → z21 → z20 → z19) and blank-tile variance verification (std < 2.0rejected). - Effective Ground Sample Distance (GSD at
13.88°N):Auto VHR(Zoom 21,scale=2):~0.072 m/px(7.2 cm/px) — default optimal scale for SAM 3 whole-crown context (≤ 380 mextents)Zoom 22 Ultra(scale=2):~0.036 m/px(3.6 cm/px) — selectable for maximum sub-crown visual detailZoom 20 Native(scale=2):~0.145 m/px(14.5 cm/px) — auto-selected for extents380–1,400 mZoom 19 Wide(scale=2):~0.296 m/px(29.6 cm/px) — auto-selected for large campus extents> 1,400 m(e.g.,ON1,540 m × 1,440 m)
- Dual-Stream Radiometric Normalization &
UL-09Rayleigh Atmospheric Path-Radiance Compensation (Stream Avs.Stream B):- Conditional Haze Sensor (
_compute_scene_haze_offset): Evaluatesscene_gray_p1(1stpercentile scene grayscale) and triggers strictly whenscene_gray_p1 > 32.0andp99 > 120.0(haze_offset = max(0.0, p1 - 10.0)), guaranteeing 100% bit-for-bit no-op parity on clear-sky scenes (vhr_1793704454.tif,haze_offset = 0.0); Stream A(enhance_shadow_luminance_cielab): Applies shadow-weightedCIELABL-channel Gamma0.78+ gentleCLAHE(clipLimit=1.4,a/bchromaticity locked) plus wavelength-dependent Rayleigh path-radiance subtraction ([0.72, 0.78, 0.85] × haze_offset) whenhaze_offset > 0to restore crown contrast forSAM 3andDeepForest 2.1.0;Stream B(Raw-RGB Physical, 3D Relief &UL-09Haze-Compensated Chlorophyll Filter): Evaluatescompute_strict_foliage_mask(),compute_woody_canopy_relief_mask(),rayleigh_olive_canopy,dusty_textured_canopy, anddeep_chlorophyll_reliefwhile keeping0.0%–4.36%pond/marsh false-positive rates;
- Conditional Haze Sensor (
- Tier 1 — Overlapping Native
SAM 3Single-Crown Anchor (Pass 1,1280 pxtiles,384 px/30%overlap) + Multi-Scale Woodland Promotion (Step 2A + Step 2B + Step 2C):Pass 1: Extracts verified single crowns (mask_px <= single_crown_max_px) with exact contour-mask evaluation, tile-seam buffer (32 px), and negative"car"vehicle veto;Step 2A(Non-Blocking Crown-Rim Expansion): ExpandsPass 1crowns into contiguous woody stands within12.5mgeodesic reach and passes remaining unpromoted forest pixels (cl_rem) toStep 2BandStep 2C;Step 2B(Closed-Canopy Woody Stand Promotion): Promotes medium multi-crown woody stands (cl_px <= 7.5 × single_crown_max_px) satisfying 3D woody relief and inter-crown shadow depth;Step 2C(Multi-Sided Woodland Interior Enclosure Fill — 4-Way Cardinal Rotational Symmetry): Recovers interior woodland pockets (U0–U5) inside continuous forest masks (cl_px > max_stand_px) when enclosed on at least 3 of the 4 cardinal sides ((int(has_n) + int(has_s) + int(has_w) + int(has_e)) >= 3);
- Tier 2 —
Weecology DeepForest 2.1.0Closed-Canopy Nadir Detector (deepforest_watershed): RunsDeepForest 2.1.0(RetinaNet-ResNet50-FPN) onStream A(df_model.predict_tile(...)insrc/canopy_v2.py) to detect interior nadir treetop centroids inside continuous closed-canopy forest stands (Seed Priority 1); - Tier 3 — Global Shadow-Crevice Geodesic Watershed with Vectorized
1D LUT(np.bincount) 3-PassRAGCoalescing,CF23D Relief Shadow Veto,CF3-ScopedSI Emergent Shield,CF4Polsby-Popper Roundness & Symmetric VoronoiEuler == 1Carving (watershed_forest_crown,CanopyGIS v1.8.1): FusesDeepForest 2.1.0treetop seeds (or pure zero-shotfacebook/sam3proposals in standalonecanopygis_v18_eval.py) with Morphological Black-Hat shadow-crevice relief,CF2All-Score 3D Micro-Relief & Radial Dome Convexity Veto (F-11),CF3-ScopedFrame-Invariant SI Emergent Allometry Shield (0.095 × H × W+20 mradius cap,F-12), andCF4Polsby-Popper Roundness (4πA/P² ≥ 0.22), Laba*Chlorophyll Seam Gate,≥ 2-Seam Corner Veto & Pre-Filter Recall Rescue (F-13), partitionsforest_footprint_maskglobally viaskimage.segmentation.watershed, executes vectorized1D LUT(np.bincount+scipy.ndimage.find_objects) 3-passRAGsmall-basin coalescing with a shadow-crevice merge barrier (< 4.0 m²shards reduced1,568 → 0[-100%],< 8.0 m²shards reduced3,363 → 22[-99.35%] onON), and applies Symmetric Voronoi Shoulder Partitioning + 4-Connected Hole-Free Closure (Euler == 1,overlap_px == 0) — verified on the full OfficialMillionTrees v0.25TreePolygonsBenchmark (5,815tile evaluations /458,851predicted crowns with0overlap pixels and0Euler ≠ 1violations):#1 OverallMaskAwarePrecision(0.936)  Overall / #1 Standardized Zero-Shot(F1 = 0.744,AP40 = 0.439,AP60 = 0.350[2.00×rawSAM 3]) on fullout-of-distribution(4,133tiles),#2 OverallMaskAwarePrecision(0.882)  Overall / #1 Pure Zero-Shot(F1 = 0.604) on fullwithin-distribution(1,623tiles), and#1 OverallunforgivingPlain Precision(0.506macro /0.528pooled),F1_plain(0.477/0.494), &Allen AP60(0.0628) on held-outTLS Complete-59validation (59tiles) with0forestry training hours and< 5 GBpeak GPU VRAM; - Polygon Color Modes (
Distinct CrownsDefault +Confidence TiersOptional) & Per-Site Persistent Polygon ROI:Distinct Crowns(Default):O(N log N)shapely.STRtree-accelerated DSatur planar graph coloring (assign_adjacent_distinct_colors,0color-parity diffs across6,559Bangkok crowns) guaranteeing touching polygons receive distinct colors;Confidence Tiers(Optional): 4-tier anti-cheat separation confidence (#059669High80–98%,#2563ebGood60–79%,#eab308Moderate45–59%,#dc2626Low<45%);- Per-Site Persistent Polygon ROI: Interactive multi-vertex polygon boundary and latest extraction GeoJSON automatically saved and restored per site preset (
canopy_roi_by_site_v1inlocalStorage+GET /latest_session?site_preset=...).
git clone https://github.com/napattan/CanopyGIS.git
cd CanopyGIS
pip install -r requirements.txtStandalone v1.8.1 Zero-Shot Planar Evaluator Package (canopygis_v18_eval):
pip install "canopygis @ git+https://github.com/napattan/[email protected]"from canopygis_v18_eval import CanopyGISv18Predictor
predictor = CanopyGISv18Predictor.from_pretrained(model_id="facebook/sam3", device="cuda")
pred = predictor.predict_tile(img_rgb_uint8, gsd_m=None, score_threshold=0.10)
# Returns {"y": uint8 Tensor[N, H, W] (overlap_px == 0, Euler == 1), "scores": float32 Tensor[N], "labels": int64 Tensor[N]}Option A — 1-Click Launcher (Windows / macOS / Linux):
# Windows (double-click or run in terminal):
./start_canopygis.bat
# macOS / Linux:
chmod +x start_canopygis.sh
./start_canopygis.shOption B — Direct Uvicorn Command:
cd src
python -m uvicorn main:app --host 127.0.0.1 --port 8000Then open http://127.0.0.1:8000 in your browser.
- Instant Pre-Loaded Demo: The repository includes pre-computed GeoJSON sessions for On Nut (
2,987crowns), Nong Khaem (2,110crowns), and Ramintra Sports Park (1,462crowns) insrc/uploads/. You can immediately toggleSAM 3/DeepForest/Watershedsource filters and drag the< 30 msreal-time physical sliders without waiting for GPU inference.
Option C — Share Live via Cloudflare Tunnel (Zero-Install for Collaborators):
cd src
./share_cloudflare.bat # Windows
./share_cloudflare.sh # macOS / Linuxpython scripts/test_canopy_v2.py
python scripts/qa_v2_m1.py
python scripts/benchmark_sam3_prompts.pySet CANOPY_V2_QA_MAX_TILES=0 before qa_v2_m1.py to run all 99 M1 tiles; the default is a four-tile smoke test.
3.1 Official MillionTrees v0.25 TreePolygons Full-Benchmark Results (CanopyGIS v1.8.1 Pure Zero-Shot)
Evaluated across all 3 official MillionTrees v0.25 TreePolygons splits (out-of-distribution 4,133 tiles, within-distribution 1,623 tiles, and held-out TLS Complete-59 validation 59 tiles = 5,815 tile evaluations / 458,851 predicted crowns) using a single frozen pure zero-shot configuration in src/canopygis_v18_eval.py (facebook/sam3 + Marker-Controlled Compact Geodesic Watershed + 3-Pass Region-Adjacency-Graph (RAG) Coalescing, image_size=1024, resolution_mode=direct, gsd_m=None, score_threshold=0.10, 0 forestry training hours, < 5 GB peak GPU VRAM on a single consumer workstation):
Engine Scope Distinction (
v1.8.1Benchmark vs. Interactive Web Portal): EveryMillionTrees v0.25result below is produced strictly by standalone pure zero-shotsrc/canopygis_v18_eval.py(SAM 3 + Watershed + 3-Pass Region-Adjacency-Graph (RAG)with zeroDeepForestcalls or forestry fine-tuning). OptionalWeecology DeepForest 2.1.0nadir treetop seeding (src/canopy_v2.py) is available only inside the interactive FastAPI web portal.
| Evaluation Dimension | Model Configuration | Visual Comparison Bar | Measured Score & Delta |
|---|---|---|---|
1. MaskAwarePrecision ↑ |
CanopyGIS v1.8.1 (Pure 0-Shot, thr 0.10)Mask R-CNN (Detectron2, MillionTrees FT, 0.15)CanopyRS DINO + SAM3 (SelvaMask, thr 0.30)SAM3 ( facebook/sam3 raw, thr 0.10)detectree2 ( 250312_flexi, thr 0.10) |
███████████████████░ 0.936 (#1)███████████████████░ 0.929██████████████████░░ 0.878█████████████░░░░░░░ 0.674█████████████░░░░░░░ 0.640 |
#1 Overall (+0.058 vs CanopyRS)0.007 behind CanopyGISForestry-pretrained + tuned 0.30+0.262 gain on same SAM3 weights+0.296 over forestry detectree2 |
2. Detection F1 ↑ |
CanopyRS DINO + SAM3 (SelvaMask, thr 0.30)CanopyGIS v1.8.1 (Pure 0-Shot, thr 0.10)detectree2 ( 250312_flexi, thr 0.10)SAM3 ( facebook/sam3 raw, thr 0.10)Mask R-CNN (Detectron2, MillionTrees FT, 0.15) |
█████████████████░░░ 0.839███████████████░░░░░ 0.744 (#2)█████████████░░░░░░░ 0.628████████████░░░░░░░░ 0.612████████████░░░░░░░░ 0.601 |
#1 (forestry-pretrained + tuned 0.30)#2 Overall / #1 Std Zero-Shot+0.116 gain over detectree2+0.132 gain over raw SAM3+0.143 gain over FT Mask R-CNN |
3. Strict Localization AP60 ↑ |
CanopyRS DINO + SAM3 (SelvaMask, thr 0.30)CanopyGIS v1.8.1 (Pure 0-Shot, thr 0.10)Mask R-CNN (Detectron2, MillionTrees FT, 0.15)detectree2 ( 250312_flexi, thr 0.10)SAM3 ( facebook/sam3 raw, thr 0.10) |
████████████████████ 0.415█████████████████░░░ 0.350 (#2)███████████░░░░░░░░░ 0.232███████████░░░░░░░░░ 0.222████████░░░░░░░░░░░░ 0.175 |
81.2% AP60/AP40 retention79.7% retention (2.00× raw SAM3)+0.118 gain over FT Mask R-CNN+0.128 gain over detectree2Same facebook/sam3 weights |
Split 1 — out-of-distribution Test (4,133 tiles, 6 held-out sources, 309,049 predicted / 124,786 GT crowns, 14h 37m):
| Rank | Model | Fine-tuned | Thresh | MaskRecall | MaskAwareP | F1 | MaskAcc | AP40 | AP60 |
|---|---|---|---|---|---|---|---|---|---|
| 1 | CanopyRS DINO + SAM3 (SelvaMask) |
✗ (forestry) | 0.30 |
0.803 |
0.878 |
0.839 |
0.322 |
0.511 |
0.415 |
| 2 | CanopyGIS v1.8.1 (planar 0-shot) |
✗ (0 forestry) |
0.10 |
0.617 |
0.936 (#1) |
0.744 |
0.314 |
0.439 |
0.350 |
| 3 | detectree2 (250312_flexi.pth) |
✗ (forestry) | 0.10 |
0.617 |
0.640 |
0.628 |
0.172 |
0.306 |
0.222 |
| 4 | SAM3 (facebook/sam3) |
✗ (0 forestry) |
0.10 |
0.561 |
0.674 |
0.612 |
0.169 |
0.256 |
0.175 |
| 5 | Mask R-CNN (Detectron2) |
✓ (MillionTrees) | 0.15 |
0.444 |
0.929 |
0.601 |
0.314 |
0.308 |
0.232 |
Split 2 — within-distribution Test (1,623 tiles, 24 sources, 146,168 predicted / 85,625 GT crowns, 5h 57m):
| Rank | Model | Fine-tuned | Thresh | MaskRecall | MaskAwareP | F1 | MaskAcc | AP40 | AP60 |
|---|---|---|---|---|---|---|---|---|---|
| 1 | CanopyRS DINO + SAM3 (SelvaMask) |
✗ (forestry) | 0.30 |
0.724 |
0.867 |
0.789 |
0.288 |
0.387 |
0.244 |
| 2 | Mask R-CNN (Detectron2) |
✓ (MillionTrees) | 0.15 |
0.641 |
0.910 |
0.752 |
0.406 |
0.479 |
0.319 |
| 3 | CanopyGIS v1.8.1 (planar 0-shot) |
✗ (0 forestry) |
0.10 |
0.459 |
0.882 (#2) |
0.604 |
0.208 |
0.243 |
0.156 |
| 4 | SAM3 (facebook/sam3) |
✗ (0 forestry) |
0.10 |
0.547 |
0.612 |
0.578 |
0.146 |
0.268 |
0.181 |
| 5 | detectree2 (250312_flexi.pth) |
✗ (forestry) | 0.10 |
0.554 |
0.586 |
0.570 |
0.151 |
0.263 |
0.175 |
Split 3 — Held-Out TLS Complete-59 Validation (24 Allen + 35 Frey = 59 tiles, 3,634 predicted / 3,655 GT crowns, 14m 04s):
- On matched
Complete-59tiles (rescored identically viaweecology/MillionTreesscripts/rescore_validation_ap.py --max-margin 0.025),CanopyGIS v1.8.1achieves#1 OverallunforgivingPlain Precision(0.5060macro /0.5275pooled),#1 OverallunforgivingF1_plain(0.4770macro /0.4939pooled, beatingMask R-CNN 0.4482 / 0.4410andCanopyRS 0.4343 / 0.4564),#1 OverallAllen AP60(0.0628), and#2 Overall / #1 Standardized Zero-Shoton officialF1(0.6268), MacroAP40(0.3544, pooled0.3295), MacroAP50(0.2541), and MacroAP60(0.1596, pooled0.1180). - Cumulative Planar Topology Guarantee (
5,815Tile Evaluations /458,851Predicted Crowns):overlap_px = 0(max_stack_depth = 1),empty_masks = 0,multi_comp = 0,holes = 0,Euler ≠ 1 = 0, andrect_fill > 0.915 = 0(max = 0.914778).
Click to expand Additional Visual Proof Panels & Per-Source OOD Breakdown
| Held-Out OOD Source | Tiles (n) |
MaskRecall | MaskAwareP | MaskAcc | AP40 | AP60 |
|---|---|---|---|---|---|---|
Lefebvre et al. 2024 |
1,322 | 0.693 | 0.860 | 0.351 | 0.501 | 0.464 |
Troles et al. 2024 |
2,453 | 0.593 | 0.971 | 0.320 | 0.490 | 0.375 |
Alejandro_Miranda |
13 | 0.586 | 0.976 | 0.315 | 0.307 | 0.219 |
Takeshige et al. 2025 |
176 | 0.619 | 0.979 | 0.177 | 0.212 | 0.134 |
Bohlman et al. 2008 |
18 | 0.168 | 1.000 | 0.138 | 0.121 | 0.061 |
NEON MultiTemporal |
151 | 0.391 | 0.953 | 0.073 | 0.064 | 0.035 |
Held-Out TLS Validation (Complete-59) |
Multi-Biome Blind OOD (Holdout_OOD_12) |
Dev-20 Biophysical Evolution Triad |
|---|---|---|
![]() |
![]() |
![]() |
Full mathematical proofs, C-CHEAT-01..09 rules, and C-GATE-1..5 receipts are documented in docs/CANOPYGIS_EVOLUTION_AND_BENCHMARK_PROTOCOL.md.
| Layer & Class | Clickable | Counted | Required Behavior & Meaning |
|---|---|---|---|
canopy_extent |
Yes | No | Continuous woody-canopy semantic mask maximizing pixel recall while suppressing grass, roofs, soil, and water |
individual_tree |
Yes | Provisional | SAM 3 / DeepForest / Watershed crown instances separable with confidence, boundary-quality attributes, and overlap QA |
dense_crown_candidate |
Yes | No | Marker-controlled watershed hypotheses inside fused canopy with centroids; never silently added to tree counts |
crown_group |
Yes | No | Unresolved vegetation/canopy review regions preserving coverage without inventing tree counts |
| Method & Track | Canopy Coverage | Individual Crowns | CanopyGIS v1.8.1 Role |
|---|---|---|---|
| RGB indices → binary mask | High recall, low specificity | No (maps stand only) | Coverage prior & QA baseline |
| Standalone DeepForest 2.1 + watershed | No coverage guarantee | Bounding boxes + heuristic split | Frozen legacy comparison baseline |
| SAM 2.1 with boxes/points | Only where prompted | Good boundary refinement | Annotation & boundary-refinement tool |
| Grounding DINO + SAM 2.1 | Concept boxes then masks | Moderate on overhead texture | Secondary zero-shot benchmark |
SAM 3 concept segmentation (tree) |
Strong union mask | Returns concept instances | Active Tier-1 single-crown engine (zero-shot + portal) |
Weecology DeepForest 2.1.0 (predict_tile) |
Nadir treetop boxes | Priority-1 closed-canopy seeds | Optional Tier-2 nadir treetop anchor (interactive web portal only) |
| Compact Geodesic Watershed + 3-Pass RAG | Full forest footprint | Coalesced non-overlapping crowns | Active Tier-3 closed-canopy splitter (zero-shot + portal) |
The accepted full-image run processed all 99 native tiles (1536 px, 192 px overlap) with 0 failed tiles:
- 34.23% semantic canopy coverage (
canopy_extent); - 1,222 provisional SAM 3 crowns (
individual_tree); - 3,204 clickable dense review candidates (
dense_crown_candidate); - 536 unresolved RGB review groups (
crown_group).
| Evaluation Criterion | Pilot Target |
|---|---|
| Canopy-pixel recall, overall | ≥ 0.95 |
| Canopy precision, overall | ≥ 0.90 |
| Uncovered canopy in dense test tiles | ≤ 5% |
| False-positive area over buildings/roads/water | ≤ 3% |
| Open-crown instance recall | ≥ 0.85 |
| Duplicate-instance rate | ≤ 3% |
| Tile-seam split/duplicate rate | ≤ 2% |
| Ambiguous dense canopy mislabeled as confident individuals | 0 by design |
Click to expand API Request & Response Contract (`JSON` & GeoJSON Schema)
{
"task": "both",
"backend": "sam3_zero_shot",
"gsd_m": 0.072,
"gsd_quality": "measured",
"tile_size": 1280,
"tile_overlap": 384,
"coverage_threshold": 0.43,
"instance_threshold": 0.18,
"include_crown_groups": true
}Per-instance GeoJSON properties: class (individual_tree | dense_crown_candidate | crown_group), confidence, confidence_pct, confidence_tier, boundary_quality, geometry_quality, source_model (sam3_concept | deepforest_2.1 | compact_watershed), foliage_prob, relief_3d_score, artificial_cyan_score, source_tile_count, edge_stitched, area_is_estimated, countable (boolean), and qa_flags.
- Weecology Lab (
DeepForest 2.1.0): DeepForest Documentation · GitHub Repository (weecology/DeepForest) - Meta AI (
SAM 3) & OpenGeos (SamGeo): Meta SAM 3 Research · Official SAM 3 Repository · Segment-Geospatial (opengeos/segment-geospatial) - Additional References:
License: Released under the MIT License.






