Instructions to use CopyleftCultivars/agri-vision-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use CopyleftCultivars/agri-vision-detector with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf CopyleftCultivars/agri-vision-detector:F16 # Run inference directly in the terminal: llama cli -hf CopyleftCultivars/agri-vision-detector:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf CopyleftCultivars/agri-vision-detector:F16 # Run inference directly in the terminal: llama cli -hf CopyleftCultivars/agri-vision-detector:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf CopyleftCultivars/agri-vision-detector:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf CopyleftCultivars/agri-vision-detector:F16
Use Docker
docker model run hf.co/CopyleftCultivars/agri-vision-detector:F16
- Llama new
- LM Studio
- Jan
- Ollama
How to use CopyleftCultivars/agri-vision-detector with Ollama:
ollama run hf.co/CopyleftCultivars/agri-vision-detector:F16
- Unsloth Desktop
- Docker Model Runner
How to use CopyleftCultivars/agri-vision-detector with Docker Model Runner:
docker model run hf.co/CopyleftCultivars/agri-vision-detector:F16
- Lemonade
How to use CopyleftCultivars/agri-vision-detector with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull CopyleftCultivars/agri-vision-detector:F16
Run and chat with the model
lemonade run user.agri-vision-detector-F16
List all available models
lemonade list
- Atomic Chat
Download LAB_NOTEBOOK.md from CopyleftCultivars/agri-vision-detector: direct link, hf CLI and curl.
- Browser
- Download file 144 kB
-
https://huggingface.co/CopyleftCultivars/agri-vision-detector/resolve/main/LAB_NOTEBOOK.md
- Command line
-
hf download hf://CopyleftCultivars/agri-vision-detector/LAB_NOTEBOOK.md
-
curl -L -o LAB_NOTEBOOK.md https://huggingface.co/CopyleftCultivars/agri-vision-detector/resolve/main/LAB_NOTEBOOK.md
LAB NOTEBOOK — on-device agricultural crop/disease/pest vision (d1-omni-600M + Artemis/Image Safari)
Conventions (read first).
- Append-only. Never edit a past entry's numbers. A wrong claim gets a dated Correction block (section 7) naming what was wrong and how it was caught. Superseded text is marked inline with
[SUPERSEDED, see C#]. - Every number has a source (log file, JSON, or commit). Tags:
VERIFIED(re-checked against the primary artifact),LOGGED(printed by our own scripts; not independently re-derived),AGENT-REPORTED(a research sub-agent's claim; not yet checked at the primary source),UNVERIFIED. - Rates are given with Wilson 95% intervals where n is small. "n" is always stated. Single seed unless stated.
- Labels checked "by eye" were checked by Claude (an AI assistant) on thumbnails/contact sheets, not by an agronomist or plant pathologist. This must be stated in any publication.
- Repo:
~/agri-vision-detector(local git, no remote). Data/models/runs:/mnt/store1/agri/(not in git). Git history is the timeline of record (section 10).
0. Research questions (as they emerged)
- RQ1. Can LiquidAI
d1-omni-600M(a typed decision model: yes/no, multiple-choice, score; no text generation; 587M params; SigLIP2 vision tower) identify crops and disease zero-shot on smallholder field photos? - RQ2. If not, can a small head on d1's frozen trunk features do it, and does that transfer across sources/campaigns/domains?
- RQ3. How far does a tiny (2.6M-param) detector get on crop-plant localisation in Artemis/Image Safari field photos, and what does it miss?
- RQ4. How reliable are the public plant-disease datasets as training/evaluation sources (duplicates, label noise, photographic-style confounds)?
- RQ5. What additional data is needed to make a field-usable system (see section 8)?
- Target deployment: Android phone, offline. (Not yet measured on a device; see section 6.)
1. Environment and provenance (VERIFIED 2026-10-08/09)
- Hardware: Dell T7610, dual-socket, 2x Tesla M40 24 GB (sm_52), driver 580.173.02, Ubuntu (kernel 7.0.0-31-generic); GPU1 power-capped 180 W; ECC on. 8 CPU cores. Root disk and
/mnt/store1both ~97% full during the work. - Detector training env: torch 1.13.1+cu117 (shared, not modified), torchvision 0.14.1+cu117, ultralytics 8.3.0, onnxruntime 1.23.2, numpy 1.26.4, Python 3.10.20. Training:
amp=False(no fast fp16 on sm_52). - d1 serving: upstream llama.cpp commit
de7fa0a(2026-10-08) + local patchpatches/d1-trunk-export.patch(17 added lines; sha2561762655d...13535; verified to apply cleanly tode7fa0a). CUDA build-DCMAKE_CUDA_ARCHITECTURES=52; CPU-only build (no CUDA linkage); Android arm64 cross-build with NDK r27c (builds only; never executed on a device). - Models:
d1-omni-600M-{Q8_0 (407,207,584 B), F16 (764,049,056 B)}.gguf+mmproj-d1-omni-600M-{F16 (441,262,144 B), Q8_0 (262,791,232 B)}.gguffromLiquidAI/d1-omni-600M-GGUF(curl-L -C -, sizes checked, not hashed). License: LFM Open License v1.0 (copy at/mnt/store1/agri/models/LICENSE). - Key artifact hashes:
artifacts/yolo11n_v1/best.onnxsha2564ee74a60...2c73;best.ptea16ce6b...eef8; heads and features haveSHA256SUMSfiles. Copies re-hashed byte-identical (detector); feature backup~/agri_feats_backup_20261008.tarrestore-verified 51/51 files. - Compute-safety rules followed: every GPU job under a
gpuschedreservation, pinned withgpu0run, thermal guard scoped to the job's own PID (limit 90–91 °C; peaks seen: 86 °C d1 inference, 83 °C detector training). No transformersgenerate()anywhere. GPU PAUSE from 2026-10-09 by the PI: no GPU work until told.
2. Data (what was used; provenance; known problems)
2.1 Artemis / Image Safari (CIAT / Alliance of Bioversity & CIAT; AWS Open Data s3://alliance-artemis-imagesafari, us-west-2, anonymous) — VERIFIED
- Registry page claims ~7.47M images, 18 crops, CC BY-SA 4.0, 40,558 annotated (organ-level). Cite: Mutuvi S. et al., agriRxiv 2026.00491 (as listed on the registry page; paper itself not read).
- Layout differs from the README:
<crop>/annotations/<variety>/standard/<task>/<set>/(Safari) andArtemis/<crop>/annotations/<variety>/<task>/<set>/. Index of all annotation JSONs:annotation_index.json. - Only bean, cowpea, sorghum have true box-detection sets; other crops have point/semantic/instance(pseudo-instance)/scribble labels (
fetch_coco.pyclass summaries in README log). - Duplicated annotation sets: Safari bush-bean plant-stand == Artemis bush-bean plant-stand (1,432 shared image stems); two Artemis cowpea JSONs identical (2,132 shared); two Artemis sorghum JSONs overlap (3,363 shared).
- Annotation noise seen on overlays:
cowpea_plantclass has tiny boxes on bare soil; sorghum has tiny soil-crack boxes and duplicate overlapping boxes; boxes around overlapping plants in close-ups are subjective; visible plants/weeds are unlabelled in places. Weed classes exist only in cowpea/sorghum sets (not bean). - Safari image paths encode site and date:
ImageSafari/<crop>/images/<site>/<date>/<id>.jpg(sites/dates per crop insafari_sites_dates.json, e.g. maize 5 sites/84 dates, sorghum 6/290, cowpea 3/169, sweet potato 3/207). Artemis paths:Artemis/<crop>/images/<site>/<project>/<season>/<date>/<plot>/<id>.jpg(bean: 6 sites incl. Arusha TZ, Kawanda & Namulonge UG, Palmira CO, Fort Collins US, Maruku TZ). - Artemis cowpea and sorghum images are 98% Colorado State University (US) (cowpea 59,614/60,134; sorghum 58,765/59,413 metadata rows), i.e. not African field photos. This reframes the "cross-campaign" failure in 4.3 (see C8).
- Artemis bean ground truth (metadata parquet, 1,267,786 rows, 111,469 image-linked):
open_flower_presence73,801;pod_count26,002;open_flower_count8,857;plant_stand1,235;disease_score1,144 (two scales mixed: values 2–6 and 20–95);cbb364 (values 3–7, 1–9 scale);disease_presence64;als2. All disease labels from Arusha (+15 Maruku); 30 plots, 13 dates, 3 varieties; median ~55 images/plot; no healthy class in the scored traits; plot-level labels so images within a plot are not independent. Cowpea/sorghum/soybean metadata have no ground-truth traits.
2.2 Detector dataset v1 (/mnt/store1/agri/ds_v1, build_dataset.py, resplit.py) — LOGGED/VERIFIED counts
- Sources used: Artemis bush-bean plant-stand (1,686 images), Safari climbing-bean plant-stand (987), Artemis cowpea plant-stand (2,132), Artemis sorghum plant-stand (3,358) → 8,160 images after 3 file-name collisions (8,163 listed).
- Classes:
common_bean,cowpea,sorghum(weed classes dropped: 8,195 weed boxes; cowpeacowpeaandcowpea_plantmerged). 2,237 boxes dropped as tiny (min side < 6 px or area < 0.01% of image). - Images re-saved from raw pixels, longest side ≤ 1280, EXIF stripped (all 8,163 had orientation tag 1; JSON width/height equal pixel size for all → boxes are in raw-pixel space).
- Split: per crop-set, by capture date (parsed from filename epoch) or source batch; 70/15/15. Train 5,687 / val 1,227 / test 1,246 images. Boxes train 43,609 bean / 18,324 cowpea / 29,384 sorghum; val 6,929/6,881/9,069; test 6,225/5,588/8,675. The 987 climbing-bean images have no recoverable date (one group) → train only, so bean val/test are bush beans only. (First greedy split was class-skewed — see C3.)
- The Artemis cowpea/sorghum images in this set come from the same (largely US) Artemis campaign; the detector's test set is therefore same-campaign, held-out-by-date/batch, not cross-site.
2.3 d1 zero-shot probe set (make_probe_set.py; /mnt/store1/agri/probe)
- 204 images = 12 crops × 17, random (seed 20261008) from Safari point/plant-part (bean: plant-stand OD) annotated image dirs; downscaled to ≤896 px. Crop label = folder label, checked on numbered contact sheets by an AI (
probe_flags.json): 13 flagged ambiguous (crop not clearly visible or label doubtful: cassava 2,5; cowpea 7; groundnut 0,11; maize 0; potato 4,8,11,15; sorghum 3,9,16). Several "healthy-looking" images show mostly bare soil or tubers (sweet potato 1,2,5,8,9 are harvested tubers). - Probe limitation: sampled from the same annotated sets as the head-training crop set → same campaigns/dates → likely same-day neighbours (see 4.3).
2.4 Disease / pest sources (manifest disease_manifest.jsonl; images downscaled to ≤640 px; raw archives deleted after checks)
| source | access (VERIFIED where marked) | used | licence as published | notes |
|---|---|---|---|---|
| PlantDoc | GitHub zip (original authors' repo) | 2,578 (train 2,342 / test 236 as provided) | CC BY 4.0 (repo; not re-read) | healthy classes are mostly white-background stock/cut-out leaves → style confound (C-audit 2026-10-08) |
| PlantWild (orig. release) | HF uqtwei2/PlantWild plantwild.zip, 18,637 zip entries, testzip clean |
18,542 in manifest; 3,560 sampled for features | CC BY-NC-ND 4.0 (HF API, VERIFIED) | web-scraped; noisy (e.g. cannabis leaf under "maple healthy"); official split 0 test/1 train/2 val |
| PlantSeg | Zenodo 16665770, MD5 23385d87... matched record |
11,458 (all diseased) in manifest; 2,792 sampled | CC BY 4.0 (Zenodo record, VERIFIED) — a web-search snippet said NC-ND; primary record says CC BY 4.0 (C9) | includes some fruit images |
| IP102 (Zenodo COCO re-upload by a third party) | Zenodo 15546419 | 18,969 images / 102 species in annotations; 3,466 in manifest (30 train + 10 test per species); 2,308 featurised | CC BY 4.0 on re-upload (original: academic use) | web images; majority box category used as image label |
| Cassava Leaf Disease | HF mirror Engineer101/cassava-leaf-disease-classification (21,403 files) |
2,000 (400/class × 5; random 70/15/15, no groups) | HF card: MIT (original competition terms may differ) | Uganda field photos; labelled by experts (per competition description) |
| Safari crop-ID set | S3 | 1,653 after cleaning | CC BY-SA 4.0 | 17 crops, ≤100/crop |
- Not obtained: CCMT (Mendeley bwh3zbpkpv; scripted access blocked — 3 API attempts), DLCPD-25 (Baidu only), AgriPest (repo 404; "will be released" in paper), INSECT204.
- Coarse condition mapping (
canon.py): 74 raw condition strings → 12 d1 concept options by ordered keyword rules (author's judgement; documented decisions: moulds→mildew; canker/scab/anthracnose→leaf spots; smut/pocket→fruit/pod damage; cassava brown streak & green mottle→virus; plain "leaf curl" dropped as ambiguous (417 images)). No sensitivity analysis yet.
3. Methods
3.1 d1 zero-shot probe (probe_run.py, probe_analyze.py)
- llama.cpp server
/v1/systemonewith the image as a data URL; questions:crop(choice: 12 crops + "none or unclear"),plant_visibleanddiseased(noul = P(true) per the server README),part(choice). GPU0 (F16 and Q8_0),--image-max-tokens 1024, ≤896 px (≈2,550 input tokens/image; 1.75 s/image). CPU-only: 188.5 s for one 1080p image (7,023 tokens). - Controls: reversed option order + per-option descriptions, "none" option removed (60-image subset).
3.2 Trunk-feature extraction (local llama.cpp patch)
- Decision head output has only 3 columns (one per question type). Patch (env
D1_EXPORT_TRUNK=1) concatenates the 1,024-d post-output_normtrunk state at each output row (n_embd_out 3→1027);D1_DUMP_PATHappends[n_markers, n_embd_out, floats]per request (single-slot server only). - Per image: 3 fixed questions (crop: 24 options; condition concept: 12; plant part: 6). Feature = concat of the mean trunk vector over each question's option markers (3 × 1024 = 3,072-d, stored float16) + the 42 raw choice logits. Images ≤448 px,
--image-max-tokens 256, F16 weights, GPU0, ~0.45–0.5 s/image. - In-script assertions: record count = 3, marker counts = (24,12,6), and for the first 5 images softmax(dumped logits) reproduces the server's returned probabilities (max diff < 0.02).
- Reproducibility check (2026-10-09): CPU-only server (different build, different hardware) vs stored GPU features on 3 probe images: cosine 1.00000, relative L2 0.0008–0.0011.
- Total extracted: 15,395 images in 8 lists (probe 204; artemis_det 300; safari_crop 1,653; plantdoc 2,578; cassava 2,000; plantwild 3,560; plantseg 2,792; ip102 2,308). Run log
/mnt/store1/agri/feats/extract_pipeline.log(21:11–23:36 on 2026-10-08).
3.3 Heads (train_head.py, export_heads.py)
- Linear (softmax) head on standardised 3,072-d features, AdamW (lr 3e-3), dropout 0.2, 120 epochs, batch 512, class-balanced loss weights, weight decay chosen from {1e-3,1e-2,1e-1} on a validation split; final heads refit on train+val. Plain PyTorch on CPU (4 threads). Four feature variants reported:
style(control),logit(42-d),feat(3,072-d),feat+logit. - Style-only control: 37-d image statistics (3×3 grid mean RGB, global std, white-pixel fraction, saturation mean/std, edge density, aspect, log area). No semantics.
- Baselines: d1 zero-shot argmax restricted to the same label set (from the cached option logits at the extraction setting), majority class.
- Near-duplicate removal (
flagdups): any evaluation image whose max cosine (centered, L2-normalised d1 trunk features) to the training pool ≥ 0.95 is excluded from evaluation only. - Tasks: T1 crop ID (17 classes; train: Safari crop set; test: held-out probe + Artemis detection images); T2 healthy-vs-diseased (train PlantWild; test PlantWild test, PlantDoc cross-source, PlantSeg diseased-recall); T3 9-way coarse condition (train PlantWild+PlantSeg; test PlantWild, PlantSeg, PlantDoc); T4 102-way pest species (IP102 official split sample).
3.4 Detector (train_detector.py, run_train.sh, eval_detector.py)
- YOLO11n (2.59M params; COCO-pretrained, 448/499 tensors transferred), imgsz 640, batch 16,
amp=False, mosaic 1.0, flips, patience 15, seed 0. Evaluation on CPU at conf 0.001 / IoU 0.6, torch weights and exported ONNX (opset 12, 10.57 MB) separately.
4. Results (all tagged with their logs)
4.1 d1 zero-shot crop identification — probe_results_{f16,q8}.jsonl, PROBE_RESULTS.md (LOGGED, scoring reproduced by probe_analyze.py)
| setting | correct | rate | Wilson 95% |
|---|---|---|---|
| F16, 896 px, all 204 | 40/204 | 19.6% | [14.7, 25.6] |
| F16, 896 px, excl. 13 ambiguous | 40/191 | 20.9% | [15.8, 27.3] |
| Q8_0, 896 px, excl. ambiguous | 39/191 | 20.4% | [15.3, 26.7] |
| F16, 448 px / 256 tokens, excl. ambiguous | 40/191 | 20.9% | — |
| reversed options + descriptions, no "none" (subset) | 8/60 | 13.3% | — |
- Per crop (F16, excl. ambiguous): banana 17/17, maize 15/16, rice 3/17, wheat 3/17, sweet potato 2/17; cassava, chickpea, common bean, cowpea, groundnut, potato, sorghum 0/13–17.
- 164 wrong answers, 96 with confidence > 0.9; nearly all errors predict "maize" (or banana). Not option order. F16 vs Q8_0 crop argmax agreement 199/204; mean |ΔP(diseased)| = 0.025.
- Disease: P(diseased) median 0.14, 90th percentile 0.51. Top-12 hand audit (AI): 2 plausible symptoms, 5 ambiguous (4 banana with dead pseudostem/leaf litter; 1 maize), 5 healthy-looking. No disease ground truth exists in this dataset → no accuracy claimed.
plant_visiblereturned 0.01 on obvious banana plants (ill-posed question; not interpreted). - Latency: 1.75 s/image mean on one M40 (2,547 tokens); CPU 188.5 s (7,023 tokens).
4.2 Detector — detector_eval_yolo11n_v1.json, eval_detector_yolo11n_v1.log, DETECTOR_RESULTS.md (LOGGED)
| model / split | n imgs | mAP50 | mAP50-95 | P | R |
|---|---|---|---|---|---|
| torch val | 1,227 | 0.581 | 0.294 | 0.648 | 0.558 |
| torch test | 1,246 | 0.644 | 0.349 | 0.681 | 0.580 |
| ONNX test | 1,246 | 0.641 | 0.346 | 0.675 | 0.575 |
- Per-class test AP50-95: bean 0.328 / cowpea 0.366 / sorghum 0.352 (ONNX 0.329/0.361/0.348). Training: 55 epochs (early stop; best epoch 40), 1.924 h, ~2.2 min/epoch; val mAP50-95 oscillated 0.20–0.29 across epochs.
- Qualitative (6 test images, GT green vs prediction red): good agreement on medium plants; one drip-row photo with 22 labelled ~15-px plants got 1 detection (tiny/distant recall failure); crowded close-ups disagree on box boundaries (label ambiguity). No box-size-stratified metric yet.
- Standalone ONNX script vs Ultralytics predictor on 12 test images: top confidences equal (e.g. 0.92 vs 0.92); counts within ±1 on 10/12 (largest difference 16 vs 21) — attributed (unverified) to PIL-vs-OpenCV resize near the 0.3 threshold.
4.3 d1 trunk heads (deduplicated evaluation) — head_all_dedup.log (LOGGED; re-scored from saved artifacts for the headline rows, see 4.5)
| task | n | head (3,072-d feat) | d1 zero-shot | style-only | majority |
|---|---|---|---|---|---|
| T1 crop ID 17-way, probe (same campaign) | 187 | 91.4% [86.6, 94.7] | 18.7% [13.8, 24.9] | 27.8% [21.9, 34.6] | 0% (class-balanced; uninformative) |
| T1 crop ID, Artemis detection images | 299 | 31.1% [26.1, 36.6] | 0.3% | 0% | 0% |
| T2 healthy/diseased, PlantWild test | 644 | 87.4% [84.6, 89.8] | 80.3% [77.0, 83.2] | 70.7% [67.0, 74.0] | 59.0% |
| T2, PlantDoc cross-source | 2,523 | 90.8% [89.6, 91.9] | 84.7% [83.3, 86.1] | 72.1% [70.4, 73.9] | 66.7% |
| T3 9-way condition, PlantWild test | 639 | 68.1% [64.4, 71.6] | 43.5% | 30.8% | 41.3% |
| T3, PlantSeg test (same source as train) | 478 | 60.5% [56.0, 64.7] | 11.5% | 21.5% | 0% |
| T3, PlantDoc cross-source | 2,521 | 63.4% [61.5, 65.2] | 36.6% [34.8, 38.5] | 26.7% | 33.3% |
| T4 pest species 102-way (IP102 test) | 534 | 40.1% [36.0, 44.3] | n/a | 10.9% | 0.6% |
- T1 per-crop on Artemis (pre-dedup, n=100 each; ad-hoc script): bean 85%, cowpea 1%, sorghum 8%; 73/100 cowpea and 62/100 sorghum predicted "common bean". An always-"bean" classifier would score 33%; the head scored 31%. No demonstrated cross-campaign skill beyond beans. Probe per-crop: all ≥0.87 except sorghum 0.57. (Interpretation caveat C8: Artemis cowpea/sorghum are ~98% US images.)
- White-background analysis (feat+logit head, T2, PlantDoc): 96.1% on white-bg>0.30 (n=362) vs 90.3% on white-bg<0.05 (n=2,027; balanced 0.841): style helps but the head is far above the style-only control on the non-white subset too.
- Feature-variant selection:
featandfeat+logitwithin each other's CIs;logit-only clearly weaker; headline usesfeat(chosen after seeing results — a mild selection effect, noted).
4.4 Cassava (Uganda field) — eval_cassava.log, eval_multisource.log (LOGGED)
| test | n | result | comparison |
|---|---|---|---|
| 5-class head trained on cassava (random split; 0/600 eval imgs flagged as near-dups) | 300 | 60.3% [54.7, 65.7] | style 39.0%, majority 20% |
| PlantWild-trained healthy/diseased head → all cassava (400 H / 1,600 D) | 2,000 | balanced acc 0.605 (healthy recall 71%, diseased 50%) | d1 zero-shot balanced 0.607; majority-class acc 80% |
saved condition9 head, grouped healthy/blight/virus |
2,000 | 46.4% (balanced 0.553) | zero-shot 24.9% (bal. 0.414); majority 60% |
| healthy/diseased head trained on PlantWild + cassava train → cassava test | 300 | 83.3% (balanced 0.771) | PlantWild-only head same test 63.0% (bal. 0.625); PlantDoc 90.8→89.7%, PlantWild test 87.4→87.3% |
- 5-class per-class recall: blight 0.58, brown streak 0.57, green mottle 0.58, healthy 0.53, mosaic 0.75. Cassava test is 80% diseased → use balanced accuracy. Random split of one collection → in-domain optimism.
4.5 Saved heads re-scored from the exported NumPy files — (LOGGED, ad-hoc script in session; same numbers reproducible via export_heads.py + scoring snippet)
crop17: probe 92.5% (173/187), Artemis 30.8% (92/299); healthy_vs_diseased: PlantWild test 88.7% (571/644), PlantDoc 90.4% (2,280/2,523); condition9: PlantWild 69.6%, PlantSeg 66.1%, PlantDoc 63.4% (1,598/2,521); pest102: 42.7% (228/534). NumPy-vs-torch forward: max |Δlogit| < 1e-5, identical argmax.
4.6 Other measurements
- ONNX export parity (smoke weights, CPU): max |Δ| 0.003 on a (1,7,8400) output.
best.onnxtest mAP within 0.003 of torch. - Android: patched
llama-servercross-compiles (aarch64 ELF, API 28, 185 MB unstripped). Not run.
5. Negative / null results (keep — they belong in the paper)
- d1 zero-shot cannot recognise most field crops and is confidently wrong (systematic "maize" bias; 96/164 errors > 0.9 confidence); style-only statistics (27.8%) beat it on the same 17-way task.
- Heads trained on web/lab-style leaf photos do not transfer to field canopy photos (cassava cross-domain balanced accuracy 0.605 ≈ zero-shot 0.607), though they transfer between web-scraped sets (PlantWild→PlantDoc 90.8%).
- Crop ID head does not generalise to the Artemis campaign (cowpea 1%, sorghum 8%).
- TFLite export failed four times with two architectures (onnx2tf 1.22.3 + TF 2.15.1: YOLO11n at
/model.23/Mul_2and at C2PSA attention/model.10/m/m.0/attn/Mul; YOLOv8n at a Conv op). Also onnx2tf's sample-data download returned a corrupt file. ONNX is the only mobile format delivered. - CCMT not obtainable by script; DLCPD-25 Baidu-only; AgriPest never released.
- Detector misses tiny distant plants (recall 0.58 overall; 1/22 on one photo).
6. Not yet measured (do not claim)
On-device latency/memory/accuracy; behaviour under phone cameras different from the training cameras; detector performance stratified by plant size; calibration of head probabilities; multiple seeds/bootstrap CIs; sensitivity of T3 to the keyword mapping; cross-site crop ID from Safari (possible: sites/dates are in the path); any expert (agronomist) validation of any label; Tier-B (trunk) fine-tuning (needs PI approval); detector at higher resolution.
7. Corrections and process incidents (additive; never silently edited)
- C1 (2026-10-08). Model-card text summarised by a fetch tool said d1 GGUF has "no mmproj"; the repo lists
mmproj-d1-omni-600M-{BF16,F16,Q8_0}.gguf. Caught by listing the repo via the HF API. Plan assumption "needs mmproj conversion" dropped. - C2. README claimed COCO category/layout details that did not match S3 (
annotations/standard/<task>); found by listing prefixes. Safari bush OD ≡ Artemis bush OD (duplicate sets) found by comparing image stems (1,432 shared). - C3. First detector split (greedy date-group assignment) was class-skewed — val had no sorghum and almost no cowpea (26,562 bean boxes), test had only 833 bean boxes. Caught by printing boxes per class per split before training; re-split per crop (
resplit.py). - C4.
make_crop_set.pycrashed on a temp-file name collision (same image hash under several annotation sets). Fixed with per-thread temp names and de-dup on filename. - C5. Probe leakage: 8 training-set images were the same photos as probe images (found by comparing hash stems, not keys) plus 14 within-set duplicates; removed. Without this the probe would have been optimistic.
- C6. Cross-source duplicates: PlantDoc, PlantWild and PlantSeg share identical photos (84 PlantDoc images ≥0.95 and 65 ≥0.98 cosine to PlantWild/PlantSeg in the all-rows search; 55/2,578 flagged vs the training pools; top pairs confirmed identical by eye). Cross-source numbers were re-run with near-duplicates excluded (
train_head_v1_before_dedup.pypreserved for audit; logshead_crop.log,head_disease.logare pre-dedup). Effect: T2 PlantDoc 90.8→90.8%; T3 PlantDoc 63.7→63.4%; T3 PlantWild 70.3→68.1%; T3 PlantSeg 64.6→60.5% (−4.1 pts). An earlier docs sentence said "≤ ~3 points" — wrong, corrected to "up to ~4 points" indocs/MODEL_CARD.md. - C7.
diagnose.pyfirst run failed to parse its own JSON because my shell filtergrep -v warnremoved the"warnings"key line — an artifact of my observation channel, not a script bug. - C8. Interpretation correction (2026-10-09): the 31.1% Artemis "out-of-domain" figure was initially read as weak cross-campaign skill; the per-class split shows it is bean-only, and Artemis cowpea/sorghum are ~98% Colorado State University (US) images (metadata), so the test is US-vs-Africa as well as campaign-vs-campaign. The head's failure there cannot be attributed to campaign shift alone.
- C9. Licence of PlantSeg: a search snippet said CC BY-NC-ND 4.0; the Zenodo record's
license.idiscc-by-4.0. We cite the Zenodo record. PlantWild NC-ND confirmed from HF API metadata. - C10.
AGENT-REPORTEDsize for KaraAgro Dataverse ("~1.5 GB original") was wrong: Dataverse API shows 21 files, 41.2 GB (faw 13.8, healthy 15.4, maize_streak 12.0). Agent also cited 16,552 images; the datasheet states 15,565 instances (5,392 + 5,110 + 5,063). Not reconciled (different counting?). - C11. Process incident: a shell
/proccommand-line pattern kill matched my own shell (exit 144, the known trap). No damage (the server was gone and GPU memory freed); subsequent kills used saved PIDs /readlink /proc/PID/exe/ listening port. - C12.
eval_detector.pyfirst run crashed onr.seen(not an attribute in this Ultralytics version) after ~20 min of CPU eval; fixed; re-run produced the numbers in 4.2. - C13.
extract_features.pywas refactored (wrapped in__main__) after the extraction run sodiagnose.pycould import its constants. Logic unchanged; verified by CPU-path features matching stored GPU features (cosine 1.00000). The extraction itself ran on the pre-refactor file (git history has both states via the working copy; first committed version already post-patch of the dump logic). - C14. The probe "majority-class = 0%" rows are uninformative because the training classes are balanced; kept only for completeness.
- C15. Pest-task "zero-shot" is not defined (d1 has no species options); only concept-level: 65.8% of IP102 images have 'insect or pest damage' as their top condition concept (1,518/2,308).
8. Dataset search (2026-10-09) — what we need and what exists
Gaps from our results → candidate fixes
| gap | candidate resource | status |
|---|---|---|
| cross-campaign / cross-site crop ID | Safari itself (sites+dates in path → leave-one-site-out); Artemis bean (6 sites) | VERIFIED structure (S3 listing); not yet featurised |
| healthy field class, field maize disease/pest | KaraAgro AI Maize (Ghana), Harvard Dataverse doi:10.7910/DVN/CXUMDS, CC0 (Dataverse API CC0-1.0), 15,565 instances (healthy 5,392 / fall armyworm 5,110 / maize streak virus 5,063) with GPS + variety, 16 regions, May–Aug 2021, Android collection; datasheet mentions makesense.ai annotation; 41.2 GB total in 21 rar/zip parts |
VERIFIED (API + datasheet); one part (faw_01.zip, 2.27 GB) being fetched to inspect layout; rar tools not confirmed installed. Box annotations (92,934 objects; FAW egg/larva/frass/damage) are AGENT-REPORTED (datasetninja) |
| field bean disease severity | Artemis bean disease_score (1,144), cbb (364), disease_presence (64) |
VERIFIED (parquet); plot-level, one site, no healthy |
| tiny-plant / seedling detection | Plant Detection & Counting (Zenodo 4890370; CC BY 4.0; 844 MB; UAVmulticrop.zip), MatchPlant (Zenodo 14856123; CC BY 4.0; images 1.2 GB + annotation 0.2 MB) |
VERIFIED (Zenodo API: licence + files) — contents/format not inspected; UAV nadir, not phone |
| more boxed crops | GWHD 2021 (Zenodo 5092309; CC BY 4.0; 10.2 GB; wheat heads) | AGENT-REPORTED |
| African banana disease | Tanzania banana imagery (Zenodo 7670326; CC BY 4.0; 34 GB; healthy / black sigatoka / fusarium wilt) | VERIFIED (Zenodo API file list: HEALTHY-1..3, BLACK SIGATOKA-1.., FUSARIUM WILT-..) |
| Ghana crops incl. pests | CCMT (cashew, cassava, maize, tomato; 24,881 raw) — Mendeley blocks scripts | AGENT-REPORTED + our 3 failed API attempts |
| African maize/pest phone photos | TOM2024 (Burkina Faso; Mendeley 3d4yg89rtr), Eyes on the Ground (Lacuna; source.coop, CC BY-SA 4.0, 2.54 GB), AgMMU/AgroBench (VLM benchmarks; licences unresolved/gated) | AGENT-REPORTED |
| general crop breadth | iNatAg (HF, 4.7M images, 2.17 TB), Pl@ntNet-300K (Zenodo 4726653; 31.7 GB) | AGENT-REPORTED |
- Research sub-agent reports (three, 2026-10-09) are stored as task outputs; a fourth (African field disease sets) had not returned when this entry was written — add its results as a new entry; do not edit this table.
9. Open experiments (ordered by expected value; GPU-gated ones marked)
- Leave-one-site-out crop ID from Safari (features via CPU server ~6–9 s/img or GPU ~0.5 s/img after the pause). Resolves C8-style confounds; gives a defensible cross-campaign number.
- KaraAgro healthy/FAW/MSV field-maize heads with region (GPS) held-out splits; check duplicates/neighbours; use as field-healthy negatives for T2.
- Artemis-bean
disease_score/cbbordinal regression, grouped by plot, with metadata-only baseline (variety/date/viewpoint) to test shortcuts. - Detector v2: imgsz 960/1280, size-stratified recall, plus Safari instance/pseudo-instance sets converted to boxes for more crops (GPU).
- d1 features per detected crop (patch-level, not whole canopy) to avoid mixed-content images.
- MLP head, probability calibration, abstention thresholds; multiple seeds + bootstrap CIs; sensitivity of T3 to the keyword map.
- Tier-B trunk LoRA/fine-tune (needs PI's explicit approval; GPU; hand-written LFM2 forward since transformers is banned on the M40s).
- Android device latency/memory (needs device); ONNX Runtime Mobile for detector, patched llama.cpp for d1.
- Expert validation: a plant pathologist audit of ≥200 stratified images (labels and head predictions) — required before any disease claim is published.
10. Timeline (git is the record; times local)
- 2026-10-08 ~17:30 plan approved; data audit; d1 + mmproj downloaded (curl); upstream llama.cpp built (CPU)
- ~18:50 CUDA build; ~19:00 d1 probe 204 imgs F16 (1.75 s/img); Q8 repeat; reversed-order control — commit
2bbd028 - 19:15–21:11 detector training (GPU0, reservation, thermal guard) — scripts commit
79ee0ce; datasets, canonical mapping, style controls, patch —78986e2 - 21:11–23:36 d1 feature extraction (15,395 imgs) — detector results/artifacts
e216882 - 23:22 docs/model card/HOWTO/patch
b428996; 23:36 heads + dedup + saved heads186b2d0,148da71 - 2026-10-09 PI requests GPU pause; cassava evals, multi-source experiment,
diagnose.py, CPU-only server —5a9da35 - 2026-10-09 dataset search (this notebook, section 8); Safari site/date structure; Artemis bean metadata; KaraAgro verification.
11. ENTRY 2026-10-09 (b): dataset search results and verification (supersedes nothing; extends section 8)
Method. Three research sub-agents (web only) searched (A) African/tropical field disease sets, (B) pest/weed/plant-detection sets, (C) crop-ID and agricultural VQA/benchmark sets. Agents' claims are AGENT-REPORTED. I re-checked the key ones against primary APIs (Zenodo /api/records, Harvard Dataverse /api/datasets, HF /api/datasets) myself → VERIFIED. Raw agent reports are in the session task outputs; summarised here.
11.1 VERIFIED against primary APIs (2026-10-09)
| dataset | record | licence | size / files | crops · classes | notes |
|---|---|---|---|---|---|
| Common Beans Tanzania v2 | Zenodo 15685315 | CC BY 4.0 | 17.84 GB, 14 zips (healthyN, rust1-2, anthra…) | bean · healthy / rust / anthracnose | agent: 155,842 images, phone-in-field (Samsung M13, ODK); image counts look rounded → possible augmented copies; dedup required |
| Common Beans Tanzania v1 | Zenodo 8286126 (files) / 8286125 | CC BY 4.0 | 6.83 GB, 3 zips (anthra 1.76, healthy 2.73, rust 2.34 GB) | bean · same 3 classes | agent: 59,072 images |
| Maize Tanzania | Zenodo 15685236 | CC BY 4.0 | 39.65 GB, 26 zips (healthyN, mlnN, msvN) | maize · healthy / maize lethal necrosis / maize streak virus | agent: 243,539 listed images; repeated counts → augmentation suspected |
| Irish Potato Tanzania | Zenodo 8286529 | CC BY 4.0 | 7.17 GB, 3 zips | potato · healthy / early blight / late blight | agent: 58,709 images, Southern Highlands farms via ODK |
| Banana Tanzania | Zenodo 7670326 | CC BY 4.0 | 34.3 GB, 9 zips (HEALTHY-1..3, BLACK SIGATOKA-1.., FUSARIUM WILT-..) | banana · healthy / black sigatoka / fusarium wilt | image count not stated on record (agent ~16k from search only) |
| Maize EWA-BELT | Zenodo 17085836 | CC BY 4.0 | 0.85 GB, 4 zips | maize · healthy / northern leaf blight (E. turcicum) / MSV / MLN | image counts not stated; field vs controlled capture not verified |
| Cowpea EWA-BELT | Zenodo 17175464 | CC BY 4.0 | 0.44 GB, 2 zips | cowpea · healthy / brown rust | only cowpea disease set found; counts/capture not verified |
| Plant Detection & Counting (UAV) | Zenodo 4890370 | CC BY 4.0 | 844 MB (UAVmulticrop.zip) |
sunflower/sugarbeet/maize, boxes (agent: 189 imgs, 16,122 boxes) | UAV nadir, emergence stage |
| MatchPlant | Zenodo 14856123 | CC BY 4.0 | images 1.21 GB + annotations 0.2 MB + pretrained Faster R-CNN 346 MB | maize single-plant boxes (COCO) | UAV nadir |
| KaraAgro AI Maize (Ghana) | Harvard Dataverse doi:10.7910/DVN/CXUMDS (v4) | CC0 1.0 | 41.2 GB, 21 files (faw 13.8, healthy 15.4, maize_streak 12.0 GB; mostly .rar, some .zip) + datasheet | maize · healthy 5,392 / fall armyworm 5,110 / maize streak virus 5,063 (datasheet) | GPS + variety per image; 16 regions; May–Aug 2021; Android; makesense.ai annotation (box count 92,934 is AGENT-REPORTED); one season only |
| iBeans (Makerere) | HF AI-Lab-Makerere/beans (also beans) |
MIT | parquet + zips (agent: 1,296 images 500×500, 172 MB) | bean · angular leaf spot / bean rust / healthy | the agent's storage.googleapis.com/ibeans/*.zip URLs returned HTTP 403 (C16); HF copy is the usable source |
11.2 AGENT-REPORTED (not yet verified at the primary source)
- Wiesner-Hanks NLB maize (OSF p67rz): handheld 1,787 / boom 8,766 / drone 7,669 images of northern leaf blight, CC BY 4.0; files
osf.io/arwmy,er3zb,vfawp(untested). US photos. - GWHD 2021 (Zenodo 5092309): wheat head boxes, >6,000 images, CC BY 4.0, 10.2 GB.
- CropAndWeed: 8,034 images, 74 species, boxes + masks; custom non-commercial, no redistribution; HF
Voxel51/CropAndWeed11.6 GB. - PhenoBench (CC BY-SA 4.0, 7.6 GB), DeepWeeds (CC BY 4.0, 17.5k images, Google Drive), Aarhus Seedlings (CC BY-SA), WeedMap (licence unchecked).
- Pest sets with boxes: SambaGuard-v2 (HF
ndunge23, YOLO-format FAW subset of KaraAgro, 7,693 images, Apache-2.0 model/CC0 source); Wadhwani pest-management-opendata (bollworm trap images, S3/HF; licence scope unclear); TOM2024 (Burkina Faso phone photos, Mendeley 3d4yg89rtr, image-level); Cassava Whitefly (Mendeley 5g38399z9p, files not visible). - CCMT: no scriptable full copy; HF
yourspace/CCMTDatasetis a partial/subsampled copy of unknown provenance (agent: 2.2k rows, ~113 MB, preview all anthracnose) — do not trust without per-class counts. CCMT itself has white/dark/illuminated/real backgrounds (mixed, not purely field). - VLM/benchmark sets: AgMMU (HF, 746+746 eval questions, licence "cc" unresolved, 534–726 GB repo; eval JSON + images.tar.gz separable), AgroBench (HF gated, 3,745 images/4,342 QA per search), PlantVillageVQA (CC BY 4.0, lab backgrounds), Eyes on the Ground (Lacuna/IFPRI/KALRO, source.coop, CC BY-SA 4.0, 2.54 GB, Kenyan smartphone crop-damage images), iNatAg (HF, 4.7M images, 2.17 TB), Pl@ntNet-300K (Zenodo 4726653, 31.7 GB), Agri-Foundation-145k (Zenodo 18214758; merges PlantVillage/PlantDoc/Cassava/PlantSeg/PlantWild → duplicates what we have).
- Sets not found: CGIAR/OpenCayenne boxes; cassava mealybug; locust; stem/pod borer field sets; groundnut/sorghum/millet/yam/chickpea/pigeon-pea African field disease sets; Nuru banana BXW; bean-pod or soybean-pod box sets (public). Zindi competitions need login/rules.
11.3 Our own data, re-examined (VERIFIED by S3 listing / parquet)
- Safari site/date structure (section 2.1) supports leave-one-site-out crop ID with no new data.
- Artemis bean disease labels (1,574 rows) exist but are plot-level, one site, no healthy class (section 2.1).
- Artemis metadata also holds 73,801 open-flower yes/no and 26,002 pod-count image labels (bean) — usable for flower/pod presence heads (d1 'part' question) without manual labelling.
11.4 New corrections / observations from this entry
- C16. Agent-listed iBeans URLs (
storage.googleapis.com/ibeans/{train,validation,test}.zip) are HTTP 403 today; HF mirror used instead. - C17. Agent said KaraAgro "Dataverse original ~1.5 GB"; API says 41.2 GB (see C10). Agent's "16,552 images" vs datasheet "15,565": unreconciled.
- Observation O1. The Tanzanian Zenodo sets (beans, maize, potato, banana) appear to be the PlantVillage-Nuru/Penn State–IITA–NM-AIST family. Capture in the field is AGENT-REPORTED (paper says phone/ODK); we have not looked at a single image yet. Augmented copies are suspected from round per-zip counts; near-duplicate and group (farm/date) leakage must be checked before any split, as with PlantDoc/PlantWild.
- Observation O2. KaraAgro is the only candidate found that fills both gaps at once: a large healthy field class and field pest/disease labels with GPS for regional splits. Its limits: one crop (maize), one country, one 4-month season, class labels set by the collectors (annotation protocol not yet read).
- Plan (not executed): (1) fetch EWA-BELT maize+cowpea (1.3 GB) and HF beans (~0.2 GB), audit by eye, dedup; (2) sample one zip each from KaraAgro healthy/faw/msv (already: faw_01.zip, 2.27 GB downloading), Tanzanian beans v1, potato, maize (processing one zip at a time under the 26 GB free-disk limit: download → downscale ≤640 px → manifest → delete raw); (3) extract d1 features (CPU server ok during the GPU pause: ~6–9 s/img) or on GPU after the pause; (4) evaluate with region/farm/date-grouped splits and the same baselines/controls as section 4.
12. ENTRY 2026-10-09 (c): scope expansion to Amazon rainforest datasets + Kaggle detector-v2 run plan
Scope decision (mine; PI said only "expand it into Amazon Rainforest datasets too"). Interpreted as three strands that fit a ground-level plant-vision project and the PI's restoration interest: (A) Amazonian crops/agroforestry disease+pest imagery, (B) tree/plant species identification and regeneration imagery, (C) monitoring layers + data-governance requirements. Three research sub-agents, 2026-10-09; claims are AGENT-REPORTED unless marked VERIFIED (my own re-check against a primary API). This entry extends sections 8/11; nothing earlier is edited.
12.1 Verified by me (primary API, 2026-10-09)
- SelvaBox (HF
CanopyRS/SelvaBox): licence CC BY 4.0, not gated, 67 files (parquet tiles). Agent: 14 UAV rasters at 4.5 cm, 2,449 tiles, >83,000 crown boxes (Brazil ZF-2/Manaus, Ecuador Tiputini, Panama Agua Salud), binary crown labels only, 31.4 GB, curator/funder "to be added". - Soybean pests, Mato Grosso (HF mirror
Project-AgML/soybean_leaf_disease_classification_brazil): CC BY 4.0, parquet; agent: 6,410 images 500x500 with rotation augmentation baked in (caterpillar 3,309 / Diabrotica 2,205 / healthy 896); Mato Grosso is Cerrado-Amazon transition (agent's judgement, not the dataset's). - GBIF count query (
taxonKey=6Plantae,mediaType=StillImage, HUMAN_OBSERVATION, rough box lon -74..-50, lat -10..5 — a bounding box, not the biome boundary): 84,545 records; equals the agent's number. Agent: licences per photo — 70,302 CC BY-NC / 10,219 CC BY / 4,024 CC0; ~83k from the iNaturalist research-grade dataset. - HF
anvelezec/maderapp(claimed 25k Peruvian Amazon timber images, MIT): repo contains only.gitattributes+README.md— no images. - Not verified: my Zenodo API calls for CocoaMoniliaDataSet (17716661) and PlantCLEF 2020 (3658343) returned empty metadata (call failed; agent also reports its fetch of 17716661 timed out) → both remain
AGENT-REPORTED.
12.2 Strand A — Amazonian crop/agroforestry disease (AGENT-REPORTED unless noted)
- Finding: there is essentially no open, Amazon-biome, smallholder crop-disease image dataset. No public set found for açaí, Brazil nut, guaraná, cupuaçu, pupunha, rubber, oil palm, Amazonian banana/plantain, bean, rice or maize; none hosted by INPA, IIAP, INIA-Peru, AGROSAVIA, CATIE or CIFOR-ICRAF.
- Best leads: CocoaMoniliaDataSet (Zenodo 17716661; Colombia Santander/Antioquia, not Amazon; 1,953 smartphone field images, 4 classes incl. Monilia cycles; CC BY 4.0; ~6.2 GB); Peruvian Cocoa Fruits (IEEE DataPort 10.21227/ktfb-2132; Pichari, Cusco — VRAEM/Amazon watershed per agent; 3,104 images incl. witches' broom 94; 24.9 GB; access gated by IEEE subscription, no licence stated); Coffee by phytosanitary class (Mendeley mfpxg4y65r; Saposoa, San Martín, Peru (agent's inference); 1,500 images healthy/rust/leaf spot; CC BY 4.0); Digipathos (Embrapa; 2,326 images/171 disorders; cassava, black pepper; "free for academic research", licence unclear); Cocoa Diseases YOLOv4 (Kaggle/DatasetNinja; 312 images, 1,591 boxes; ODbL; Colombia); RoCoLe robusta (Mendeley c5yvn32dzg; Ecuador coast); soybean pests above.
- No dataset states Indigenous-community or consent terms (agent searched each).
12.3 Strand B — species ID / regeneration (AGENT-REPORTED unless noted)
- GBIF/iNaturalist Amazon export is the best ground-level source (scriptable via GBIF occurrence download API with a WKT polygon; per-photo licences; 83% of the 84,545 are NC — relevant to any redistribution). GBIF herbarium specimens: agent counts 524,053 specimen images in the box (NY, MO, US, RB, F, K). PlantCLEF 2020 (Zenodo 3658343; ~327k herbarium scans of ~1,000 Amazonian-Guianan species + field photos; 36 GB; CC BY 4.0; French Guiana herbarium, not "Amazon biome" per the page). TreeOfLife-10M/200M (CC0 on HF; global pretraining). Pl@ntNet-300K (global benchmark; Amazon relevance not shown). Wood-section sets (Mendeley 5fdycctbs9 864 images Pará; cc78ftcdf9 1,901 images 46 species).
- No open Amazon seedling / natural-regeneration image dataset found. UAV crowns: SelvaBox/SelvaMask (binary, no species). RAINFOR/ForestPlots/FATE: no open image data confirmed.
12.4 Strand C — monitoring layers and governance (AGENT-REPORTED; mostly search-only, many fetches failed)
- Layers: MapBiomas (30 m land cover; secondary vegetation modules; CC BY 4.0 per site), PRODES/DETER (INPE TerraBrasilis; page text CC BY-SA 4.0, data licence unconfirmed), ESA CCI Biomass (100 m), Hansen/GFW tree-cover loss (CC BY 4.0 via GFW API), Planet "Understanding the Amazon from Space" (Kaggle, 2017; rules apply), small Zenodo/MultiEarth Sentinel-2 forest-mask sets (licences unverified), ELDOR (UAV, Madre de Dios, arXiv). No open dataset pairing phone photos with Amazon restoration labels — the photo side would have to be built.
- Governance (agent from university/summary pages; not legal advice; interpretations flagged): CARE Principles (GIDA 2019; read via secondary summaries); Brazil Law 13.123/2015 — SisGen registration for access to genetic heritage / associated traditional knowledge, registration before publication; whether image-only identification research triggers SisGen is not established (agent: arguably not "access" to genetic heritage — interpretation; ask the institution's SisGen office/CGen); Andean Decision 391 (Bolivia, Colombia, Ecuador, Peru; scope articles not read); GBIF "Current Best Practices for Generalizing Sensitive Species Occurrence Data" (Chapman 2020, DOI 10.15468/doc-5jp4-5g10); FPIC (UNDRIP art. 32 / ILO 169) not fetched.
12.5 Implications recorded for the paper / project
- Evidence gap is itself a finding: open ground-level crop-disease imagery for the Amazon biome is nearly absent; the closest open sets are cacao/coffee in Colombia/Peru/Ecuador and soybean pests in the Mato Grosso transition.
- Any Amazon deployment needs new data collection with community agreements (FPIC/CARE), not just a download; coordinates should be generalised/stripped (EXIF GPS) before release.
- Licence profile of the best Amazon ground-level source (GBIF/iNat) is mostly non-commercial, which interacts with our model-release decisions (docs/MODEL_CARD.md §6).
- The existing pipeline can be reused as-is for the cacao/coffee/soybean sets (image-level classes → d1 trunk features → heads); expected failure mode (from sections 4.3–4.4): web/lab-trained heads do not transfer to field canopy photos, so in-domain Amazon field data matter most.
12.6 Kaggle detector-v2 run (PI request 2026-10-09 "continue the training via Kaggle notebook right now"; local GPUs paused)
- What: same YOLO11n, same classes, same
ds_v1split (train 5,687 / val 1,227 / test 1,246) and hyperparameters as v1, except imgsz 960 (v1: 640) and hardware/precision: Kaggle T4 with AMP on (v1: local M40, AMP off) → a two-factor change; any improvement cannot be attributed to resolution alone without a control (planned control: v1-at-960 inference and, if quota allows, a 640 T4/AMP run). - Setup: private Kaggle dataset
calebdeleeuw/agri-ds-v1-20261009(images+labels, hard-linked stage, zip dir-mode; upload ~0.9 MB/s ⇒ ~70 min for 3.84 GB); kernelsagri-det-v2-smoke-20261009(1 epoch, 5% data) thenagri-det-v2-960-20261009(60 epochs, patience 15); script fails fast if GPU compute capability < 7.0; evaluates val/test at conf 0.001/IoU 0.6 on Kaggle and exports ONNX at 960. Shared account quota ~30 GPU-h/week used by other sessions too; only these two kernels will be pushed. - Analysis prepared:
size_recall.py— recall by GT box size (<0.05%, 0.05-0.2%, 0.2-1%, 1-5%, >5% of image area) at IoU 0.5, conf 0.25, on the test split, run for v1@640, v1@960 (in progress) and later v2@960. - Results to be appended below when available; do not infer them here.
13. ENTRY 2026-10-09 (d): licence policy statement from the PI
PI statement (verbatim intent): all datasets may be used, including non-commercial (NC) licensed ones, because this is an academic non-profit project relying on fair-use exceptions. (Earlier, 2026-10-08, the PI said the same for training generally.)
- How this is applied: licence is not a gate for choosing training/evaluation data. Examples now in scope without further question: GBIF/iNaturalist photos under CC BY-NC (70,302 of the 84,545 Amazon-box records), PlantWild (CC BY-NC-ND), CropAndWeed (non-commercial), IP102 (academic-use original), IEEE DataPort/Mendeley/Zenodo sets per their access terms.
- What still gets recorded for every source: the published licence, exact URL/DOI, retrieval date and counts used (notebook section 2.4/11/12), so attribution and citation are correct and the paper can state the policy transparently.
- Kept separate (not decided by this statement): (a) redistribution of images (we publish manifests/scripts/metrics, not third-party images); (b) licences of released model artefacts (detector weights inherit Ultralytics AGPL-3.0; d1-derived artefacts fall under the LFM Open License v1.0); (c) access-control and consent terms for community or Indigenous data (CARE/FPIC; Brazil SisGen question in 12.4) — those are not copyright-licence questions and are unaffected.
- This is the project's stated position, not a legal opinion by the assistant; the paper should describe it as the authors' position and name the exceptions relied on only after the authors confirm them.
14. ENTRY 2026-10-09 (e): Kaggle detector-v2 — setup debugging and full-run launch (extends 12.6)
Smoke-test history (kernel agri-det-v2-smoke-20261009, versions 1-5; each failure cost ~5 min of T4 quota). All logs under ~/kaggle-runs/agri-det-v2-smoke-20261009/output/.
- v1 ERROR: Kaggle image is now Python 3.13.15, torch 2.11.0+cu128, numpy 2.1.3;
pip install ultralytics==8.3.0 onnxbacktracked through old wheels and failed building one (setup.py egg_info). GPU assigned: Tesla T4 (cc 7.5). - v2 ERROR: dataset not found at the guessed path; real mount is
/kaggle/input/datasets/calebdeleeuw/agri-ds-v1-20261009/{images,labels}/{train,val,test}. Fixed by walking/kaggle/inputand printing the tree. - v3 ERROR: ultralytics auto-enabled the W&B callback (wandb present in image) and it rejected
project="/kaggle/working/runs". Fixed:WANDB_MODE=disabled+ ultralytics settings off. - v4 ERROR: Ray Tune callback raised
AttributeError: ray.train._internal.session._get_sessionat the end of epoch 1 (training and validation had completed). Fixed by setting every integration flag individually (wandb, clearml, comet, mlflow, neptune, raytune, dvc, tensorboard-> False, confirmed in log). - v5 COMPLETE: ultralytics 8.3.0 installed
--no-deps(same version as local v1) withTORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1(torch >= 2.6 otherwise refuses pickled checkpoints); AMP check passed; 1 epoch on 5% data took 0.018 h (train 2.3 min wall incl. startup/eval); smoke metrics (val mAP50 0.0127, test mAP50 0.0151 — meaningless after 1 epoch/285 images, only proves the pipeline). ONNX export failed on Kaggle (No module named 'onnxscript'; torch 2.11 dynamo exporter) — worked around by exporting locally; addedonnxscriptto the kernel's installs for the full run. - Local compatibility checks (CPU, torch 1.13.1 + ultralytics 8.3.0): the Kaggle-trained
best.ptloads and exports to ONNX at imgsz 960 (opset 12, 10.78 MB, output (1, 7, 18900)); onnxruntime runs it. - Measured speed: ~2 it/s at imgsz 960, batch 16, AMP on T4 (6.8 GB GPU memory) -> ~3 min training + ~40 s validation per epoch -> ~3.5-4 h for 60 epochs (patience 15 may stop earlier).
- Dataset upload for the record: private dataset
calebdeleeuw/agri-ds-v1-20261009, 3.84 GB images.zip + 5.4 MB labels.zip, upload0.9-1.5 MB/s (46 min); the dataset also contains stale ultralytics*.cachelabel files from local runs (harmless; paths differ so ultralytics rescans).
Full run launched (2026-10-09 ~17:0x local): kernel calebdeleeuw/agri-det-v2-960-20261009, version 1, T4 requested via --accelerator NvidiaTeslaT4, EPOCHS=60, FRACTION=1.0, imgsz=960, batch=16, amp=True, workers=4, patience=15, seed=0, run name yolo11n_v2_960; script evaluates val+test at conf 0.001/IoU 0.6 and writes metrics.json. Differences from local v1 (both must be reported): imgsz 960 vs 640; T4+AMP vs M40 without AMP (also: torch 2.11 vs 1.13.1, numpy 2.1.3 vs 1.26.4; same ultralytics 8.3.0, same data/split/hyperparameters).
Planned controls/analysis once weights return: (1) re-evaluate v2 locally on CPU (eval_detector.py-style, imgsz 960) to confirm the Kaggle metrics reproduce on different hardware/torch; (2) size_recall.py for v1@640, v1@960 (inference-only control), v2@960; (3) if quota allows, a 640 T4/AMP control run to separate resolution from hardware/precision effects.
Results to be appended as a new entry; none are known at the time of writing.
15. ENTRY 2026-10-09 (f): detector v1 recall by plant size; KaraAgro part inspected (VERIFIED, our scripts)
15.1 Detector v1 — recall by ground-truth box size (size_recall.py; size_recall_v1_at640.json, size_recall_v1_at960.json)
Test split (1,246 images; 20,488 GT boxes), class-aware match at IoU >= 0.5, conf 0.25, NMS IoU 0.5, CPU. Size = box area as a fraction of image area.
| GT size bin | v1 inferred @640 (trained res.) | v1 inferred @960 (inference only) |
|---|---|---|
| < 0.05% (n=1,848) | 11.6% (214) | 21.6% (400) |
| 0.05-0.2% (n=5,938) | 38.6% (2,293) | 47.0% (2,789) |
| 0.2-1% (n=8,908) | 62.3% (5,553) | 67.6% (6,020) |
| 1-5% (n=3,158) | 82.8% (2,614) | 78.1% (2,466) |
| > 5% (n=636) | 70.3% (447) | 68.4% (435) |
| overall recall | 54.3% | 59.1% |
| precision @IoU 0.5 | 0.709 | 0.710 |
- Interpretation (LOGGED, not yet significance-tested): the tiny-plant failure is quantified — plants below 0.05% of the image are found 12% of the time at 640; simply running the same v1 weights at 960 raises recall 10 points in the two smallest bins at unchanged precision, at a small cost for the largest boxes (>5%: 70.3 -> 68.4%; 1-5%: 82.8 -> 78.1%). This is the inference-only control for the Kaggle v2 result: any v2 gain must be compared with this, not only with v1@640.
- These recall numbers (conf 0.25, IoU 0.5) differ from the mAP-eval recall 0.580 (conf 0.001, P/R at the F1-optimal threshold, IoU 0.5:0.95 averaging) — do not mix them in text. The size breakdown counts duplicate/overlapping GT boxes as separate targets; crowd boxes with ambiguous boundaries are therefore penalised.
15.2 KaraAgro AI Maize — faw_01.zip inspected (2.27 GB; testzip clean; /mnt/store1/agri/dl/karaagro_faw_01.zip)
- Contents: 2,213 images (2,013 .jpg + 200 .jpeg) and 2,211 Pascal-VOC XML files (Roboflow export:
<source><database>roboflow.ai</database>; filenames<UUID>-<time>_jpeg(.jpg).rf.<hash>.{jpg,xml}). - Augmentation duplicates: only 1,463 unique base photos (729 appear once, 726 twice, 8 four times) -> ~34% of files are augmented copies of the same photo. Any split must group by base id. The "16,552 images" figure reported by an agent (datasetninja) very likely counts augmented copies; the datasheet's 15,565 (healthy 5,392 / FAW 5,110 / MSV 5,063) may too — unique-photo counts are unknown for the other parts (healthy and MSV parts not inspected).
- Boxes (first 400 XMLs): 4,664 boxes in 4 classes —
fall-armyworm-larval-damage3,492,fall-armyworm-frass1,034,fall-armyworm-egg99,fall-armyworm-larva39 (class imbalance: larva/egg rare). Images are phone photos (e.g. 1536x2048 portrait, 1080x518) — real field captures. The datasheet says healthy and MSV are image-level status labels; whether healthy/MSV parts carry boxes is unverified. - Not yet done: no images viewed (no label audit); no GPS/variety metadata located in this part (datasheet says GPS per instance — where it lives is unknown; maybe a separate file in other parts); licence CC0 (Dataverse API).
16. ENTRY 2026-10-09 (g): detector v2 (Kaggle T4, imgsz 960) — Kaggle-side results [LOGGED; local re-score pending]
- Run: kernel
calebdeleeuw/agri-det-v2-960-20261009v1, T4, ~16:54 -> 18:55 local (COMPLETE), 118.6 min training wall-clock; 47 epochs run (early stop, patience 15), best epoch 32 (val mAP50-95 0.3437 during training; last epoch 0.305); the val curve was noisy/plateaued (every-6-epoch val mAP50-95: 0.088, 0.167, 0.250, 0.259, 0.294, 0.297, 0.313, 0.297). Same split/hyperparameters as v1 except imgsz 960 and T4+AMP (torch 2.11.0+cu128, numpy 2.1.3, ultralytics 8.3.0, Python 3.13.15). - Kaggle-side metrics (
artifacts/yolo11n_v2_960/metrics.json; conf 0.001, IoU 0.6, imgsz 960):split mAP50 mAP50-95 P R per-class AP50-95 (bean / cowpea / sorghum) val (1,227) 0.648 0.346 0.689 0.604 0.330 / 0.343 / 0.365 test (1,246) 0.691 0.385 0.683 0.650 0.360 / 0.404 / 0.390 - v1 (local, 640) for comparison: test mAP50 0.644 / mAP50-95 0.349 / R 0.580 (section 4.2). Raw difference: +0.047 mAP50, +0.036 mAP50-95, +0.070 recall, precision unchanged. Not yet attributable to resolution: (i) hardware/precision/software changed too (T4+AMP, torch 2.11), (ii) v1 was never evaluated at 960 (inference-resolution control queued:
eval_v1_at960_control.log), (iii) single seed each, no intervals; the test set is 1,246 images from few date/batch groups, so differences of this size need a group bootstrap before being called significant. - ONNX: Kaggle export succeeded this time (
best.onnx, 11.05 MB, opset 12, imgsz 960 static) after addingonnxscript; exported ONNX from the smoke run (output (1,7,18900)) was independently confirmed locally. v2 ONNX not yet re-scored. - Artifacts:
artifacts/yolo11n_v2_960/{best.pt,best.onnx,results.csv,args.yaml,metrics.json,kaggle_kernel_log.json,SHA256SUMS}; local copy ofbest.ptsha256 matches the download (356eb0b0...). - Queued, CPU-only (running):
run_v2_eval_queue.sh— (1) v2 @960 val+test (torch) + test (ONNX) re-score; (2) v1 weights @960 test control; (3) size-stratified recall for v2 @960 (compare with the v1@640/@960 tables in section 15.1). - The re-score numbers will be appended as a new entry; do not edit the Kaggle-side table above if they differ.
17. ENTRY 2026-10-09 (h): cross-site crop identification (leave-one-site-out) — first genuine cross-campaign result [LOGGED: loso_crop.log, loso_crop_results.json]
Data: safari_site set (section 11/12 plan): Image Safari images sampled from images/<site>/<date>/, <= 24 per (crop, site) with at most one image per date; **993 images, 18 crops, 14 sites, 55 (crop, site) pairs** (34 pairs at 24; thin pairs 1-5: cip/csir-ghana/iita-osogbo etc.). d1 features: same extraction as section 3.2 (F16, 448 px, 256 image tokens) but run on the **CPU-only server** (equivalent to GPU features, cosine 1.00000 on 3 images; ~10 s/image under CPU contention; 2 shards, 15,716 s total).
**Protocol (loso_crop.py):** for each held-out site S, train a linear head (3,072-d feat, wd chosen on a 20% random validation split of the training rows, class-weighted) on all other sites; test on S restricted to crops that also occur at another site (otherwise untestable). d1-feature near-duplicate flagging (cos >= 0.95) test-vs-train: 0 images flagged in every fold (sites share no near-identical photos). Baselines on the same test rows: style-only head, d1 zero-shot (cached option logits restricted to the training classes; crops not among d1's 24 options — finger millet, lentil — count as wrong), majority class.
Results:
| held-out site | n | head | style | zero-shot | majority |
|---|---|---|---|---|---|
| ciat-arusha | 206 | 54.9% [48.0, 61.5] | 9.2% | 6.8% | 11.7% |
| qed-lilongwe | 288 | 40.3% [34.8, 46.0] | 11.1% | 8.3% | 8.3% |
| cimmyt-kiboko | 118 | 33.1% [25.2, 42.0] | 6.8% | 8.5% | 20.3% |
| cimmyt-kibos | 45 | 37.8% [25.1, 52.4] | 8.9% | 0.0% | 53.3% |
| cimmyt-senegal | 36 | 80.6% [65.0, 90.2] | 38.9% | 5.6% | 38.9% |
| cip-nairobi | 55 | 23.6% [14.4, 36.3] | 0.0% | 3.6% | 0.0% |
| iita-kampala / iita-nambala | 26 / 26 | 84.6% / 88.5% | 23.1% / 7.7% | 92.3% / 92.3% | 3.8% / 0.0% |
| iita-kano | 24 | 8.3% [2.3, 25.8] | 0.0% | 0.0% | 0.0% |
| africa-rice-ci / -ibadan / -sn | 24 / 24 / 3 | 50.0% / 70.8% / 3 of 3 | 58.3% / 25.0% / 3 of 3 | 41.7% / 45.8% / 3 of 3 | 0% |
| cimmyt-njoro | 15 | 40.0% | 6.7% | 66.7% | 0% |
| csir-ghana / iita-osogbo | 5 / 2 | 5 of 5 / 0 of 2 | 0 / 0 | 0 / 0 | 0 / 0 |
| POOLED LOSO | 897 | 46.5% [43.2, 49.8] | 12.2% [10.2, 14.5] | 14.9% [12.8, 17.4] | 12.4% [10.4, 14.7] |
- Same rows, random 5-fold (same-site, optimistic reference): 67.0% [64.0, 69.8] (n=993). => random splits overstate cross-site accuracy by ~20 points on identical data.
- d1 zero-shot is penalised by crops it cannot name; restricted to coverable crops pooled it scores 134/803 = 16.7%. Where zero-shot does well (iita-kampala/nambala 92%) the test set is a single easy crop pair (banana vs another crop; not inspected in detail).
- Interpretation (LOGGED, not yet significance-tested): (i) a trunk-feature head carries real cross-site crop information (3-4x all controls), (ii) but absolute cross-site accuracy is modest (46%) and highly site-dependent (8% to 88%), (iii) the earlier 91% in-distribution probe figure (section 4.3, K3) overstated generalisation by roughly this same-site/cross-site gap, though the two protocols differ in training size (1,653 vs ~900 images), so the gap is an estimate, not a clean measurement.
Limitations: few images per (crop, site) (<= 24) and few dates per site in thin pairs; per-site n small (CIs wide); training pool changes each fold; crops with only one site can never be tested (african yam, chickpea, lentil, soybean); single seed; site is a proxy for camera/protocol/season/crop stage/variety — we cannot separate those factors; images were sampled at random from
images/(no content filtering — some may show little crop); no human label audit of this set (folder labels only). Follow-ups: per-fold confusion to see which crop pairs fail atiita-kano/cip-nairobi; more images per (crop, site) now that GPU extraction is allowed; add Artemis sites; leave-one-date-block-out within large sites; combine with the earlier safari_crop set under a site-aware split once its site info is recovered.
18. ENTRY 2026-10-09 (i): detector v2 — local re-score and the inference-resolution control [LOGGED: detector_eval_v2_960.json, detector_eval_v1_at960.json, eval_detector_v2_960.log, eval_v1_at960_control.log]
Local CPU re-score of the Kaggle-trained v2 weights (torch 1.13.1, ultralytics 8.3.0, imgsz 960, conf 0.001, IoU 0.6) reproduces the Kaggle-side metrics (section 16) to 3 decimals: val mAP50 0.648 / mAP50-95 0.346 / P 0.691 / R 0.603; test mAP50 0.691 / mAP50-95 0.385 / P 0.682 / R 0.650 (per class AP50-95: bean 0.360, cowpea 0.404, sorghum 0.390); ONNX test 0.690 / 0.383 / P 0.688 / R 0.647. So the evaluation is reproducible across hardware/torch/numpy versions; the weights are intact.
Control: v1 weights evaluated at imgsz 960 (no retraining), test split:
| model | mAP50 | mAP50-95 | P | R | AP50-95 bean / cowpea / sorghum |
|---|---|---|---|---|---|
| v1 @640 (as trained, section 4.2) | 0.644 | 0.349 | 0.681 | 0.580 | 0.328 / 0.366 / 0.352 |
| v1 weights @960 (control) | 0.664 | 0.373 | 0.681 | 0.609 | 0.318 / 0.431 / 0.370 |
| v2 @960 (trained @960; T4+AMP; torch 2.11) | 0.691 | 0.385 | 0.682 | 0.650 | 0.360 / 0.404 / 0.390 |
- Decomposition of the v1->v2 test gain (single seeds, no intervals): mAP50-95 +0.036 = +0.024 from inference resolution alone + +0.012 from training at 960 (confounded with T4/AMP/torch changes); mAP50 +0.047 = +0.020 + +0.027; recall +0.070 = +0.029 + +0.041. Precision unchanged (0.68). Per-class: v1@960 helps cowpea (+0.065) and sorghum (+0.018) but hurts bean (-0.010) — class-dependent; v2 recovers bean (+0.042 vs v1@960).
- Not yet claimable: that training at 960 improves over inference-at-960 (increment 0.012 mAP50-95 is likely inside seed/test-set noise; no bootstrap done), or that resolution (not T4/AMP) is the cause of the training increment.
- Running (GPU0, reservation
2dd90536): the clean ablationyolo11n_v1res960= v1's exact recipe/hardware (M40, AMP off, torch 1.13.1, seed 0, 60 epochs/patience 15) at imgsz 960; smoke test OK (11.6 GB GPU memory, ~1.2-1.5 it/s => ~5 min/epoch => ~4.5 h). Thermal guard scoped to the training PID (limit 91 C; 78 C seen at start). A 640 T4/AMP control (Kaggle) remains an option if quota allows. - Size-stratified recall for v2 @960 (
size_recall.py) still running on CPU; compare with section 15.1.
19. ENTRY 2026-10-09 (j): detector recall by plant size — v1@640 vs v1@960 vs v2@960 [LOGGED: size_recall_*.json]
Test split, 20,488 GT boxes, class-aware IoU >= 0.5, conf 0.25, NMS IoU 0.5, CPU, size_recall.py:
| GT box area (fraction of image) | n | v1 @640 | v1 weights @960 | v2 @960 |
|---|---|---|---|---|
| < 0.05% | 1,848 | 11.6% (214) | 21.6% (400) | 20.6% (381) |
| 0.05-0.2% | 5,938 | 38.6% | 47.0% | 48.3% (2,870) |
| 0.2-1% | 8,908 | 62.3% | 67.6% | 69.0% (6,145) |
| 1-5% | 3,158 | 82.8% | 78.1% | 84.8% (2,679) |
| > 5% | 636 | 70.3% | 68.4% | 70.9% (451) |
| overall recall | 20,488 | 54.3% | 59.1% | 61.1% |
| precision @IoU 0.5 | — | 0.709 | 0.710 | 0.731 |
- Reading (LOGGED; no intervals): (a) tiny-plant gains (<0.2% of the image) come from **inference resolution**: v1@960 already doubles recall in the smallest bin (11.6 -> 21.6%) and training at 960 does not improve it further (20.6%); (b) training at 960 improves mid/large boxes relative to v1@960 (1-5%: 78.1 -> 84.8%; overall +2.0 pts recall, +2.1 pts precision); (c) ~79% of plants smaller than 0.05% of the frame are still missed by the best model, so the tiny-plant limitation (section 4.2) is reduced, not solved — tiling/SAHI-style inference, a higher-resolution backbone input or a small-object head are candidate fixes (not tried).
- The overall-recall figures here (conf 0.25, IoU 0.5) must not be mixed with mAP-eval recall (conf 0.001): v2 mAP-eval R = 0.650 vs this 0.611.
- Caveat: GT includes overlapping and subjective boxes, so recall in dense stands is penalised; bins are by area share, not by pixel size — different image sizes (1920x1080 vs ~640x480 exports) map the same share to different pixel counts (not analysed).
- Copies of the JSONs are in
artifacts/.
20. ENTRY 2026-10-09 (k): KaraAgro AI Maize (Ghana) — manifest built, label noise measured [LOGGED: karaagro_manifest.py, karaagro_manifest.log]
Source/licence/access: Harvard Dataverse doi:10.7910/DVN/CXUMDS (v4), CC0 1.0 (Dataverse API); three parts fetched of 21 (faw_01.zip 2.27 GB, healthy_01.rar 2.34 GB, maize_streak_01.rar 1.91 GB; sizes matched the API); raw archives deleted after the manifest + 640-px copies were written (re-downloadable from the same file ids 6418125 / 6417970 / 6417320). RAR read with unrar-cffi in the agri-yolo venv (no system tool; torch unchanged at 1.13.1).
Structure (VERIFIED): Roboflow-exported phone photos with Pascal-VOC XML for every image; .rf.<hash> suffix marks Roboflow augmentation copies. Files vs unique base photos: faw_01 2,213 -> 1,463; healthy_01 2,338 -> 1,740; maize_streak_01 3,661 -> 2,023 (i.e. 34% / 26% / 45% of files are augmented duplicates). Dataset-level image counts quoted by third parties (16,552; datasheet 15,565) therefore overstate unique photos. Image sizes vary (e.g. 1536x2048 portrait, 810x1080, 3000x4000).
Boxes / classes (first 300 XMLs per part): FAW part: fall-armyworm-larval-damage 3,492 / -frass 1,034 / -egg 99 / -larva 39 (400-XML sample); healthy part: healthy-maize 1,304 + 106 with a byte-order-mark in the class name (healthy-maize), none-healthy 32, and maize-streak-disease 29; MSV part: only maize-streak-disease (605 boxes, ~2/image).
Label policy (mine, documented): image label derived from boxes, not folders — fall armyworm if any FAW box; else maize streak virus if any MSV box; else healthy if only healthy-maize/none-healthy; images with no usable box dropped; one representative per base photo (un-augmented original preferred); BOM stripped.
Result: 5,172 unique photos in the manifest: fall armyworm 1,455 (+1 in the healthy folder), healthy 1,610, maize streak virus 2,017 (+89 found inside the "healthy" folder); dropped: 52 with no usable label, 2 without XML. 5.2% (89/1,699) of the healthy folder's photos carry streak-virus boxes — folder labels are not reliable; 2 images carry mixed (healthy + disease) boxes. Split by md5 of the base id, 70/15/15: train 3,625 (MSV 1,482 / healthy 1,136 / FAW 1,007) / val 779 / test 768 (MSV 307 / healthy 235 / FAW 226). No GPS/region or collector field exists in these parts (the datasheet says GPS is recorded; it is not in the files we have) -> region-held-out evaluation is impossible; the base-photo split is the best available and still allows same-farm neighbours across splits (optimistic).
Label audit (AI, 6 FAW images, /mnt/store1/agri/probe/karaagro_faw_audit.jpg): boxes align with visible leaf damage/frass/larvae; boxes are generous; some photos show collectors' hands (privacy consideration) and black rotation borders (augmentation). No audit yet of the healthy/MSV parts' images.
Next (queued): d1 feature extraction for all 5,172 (GPU, after the M40 ablation finishes) -> heads (3-class image-level) with the standard controls; use as field-healthy negatives for the healthy-vs-diseased head (cassava/PlantDoc style confound), evaluate cross-domain transfer of the PlantWild-trained head to this set.
21. ENTRY 2026-10-09 (l): selective prediction / calibration; calibrated heads_v2 [LOGGED: selective.log, selective_results.json; artifacts/heads_v2]
Method (selective.py): for each head, fit on train (wd on val), fit a temperature T on the validation split (NLL grid 0.25..8), then on the deduplicated test set report ECE (15 bins) raw vs temperature-scaled and accuracy when abstaining on the lowest-confidence samples (confidence = scaled max-probability). Thresholds were not tuned on test; the coverage curves are descriptive.
| task (test) | n | acc @100% | @80% | @60% | @40% | @20% | ECE raw -> scaled | AURC |
|---|---|---|---|---|---|---|---|---|
| healthy/diseased PlantWild -> PlantDoc (dedup) | 2,523 | 90.8 | 96.2 | 97.7 | 98.7 | 99.4 | 0.059 -> 0.011 | 0.024 |
| healthy/diseased PlantWild -> cassava test (cross-domain) | 300 | 63.0 | 67.5 | 68.9 | 70.8 | 83.3 | 0.275 -> 0.164 | 0.274 |
| condition 9-way PlantWild+PlantSeg -> PlantDoc | 2,521 | 63.4 | 70.5 | 77.3 | 85.5 | 94.2 | 0.209 -> 0.023 | 0.178 |
| pest species 102-way (IP102 test) | 534 | 40.1 | 45.7 | 51.6 | 59.3 | 72.9 | 0.340 -> 0.044 | 0.414 |
| cassava 5-class (own head) | 300 | 60.3 | 66.2 | 70.0 | 73.3 | 78.3 | 0.249 -> 0.091 | 0.269 |
| crop ID leave-one-site-out (pooled; one global T = median of fold Ts) | 897 | 46.5 | 52.6 | 60.4 | 67.4 | 78.8 | 0.358 -> 0.096 | 0.342 |
- Reading (LOGGED, not yet significance-tested): (i) temperature scaling fixes in-distribution calibration (ECE 0.06-0.34 -> 0.01-0.04) but only partly under domain shift (cassava 0.275 -> 0.164, crop-LOSO 0.358 -> 0.096), i.e. confidence is least trustworthy exactly where accuracy is lowest; (ii) abstaining on the least confident 20% raises accuracy by ~5-6 points everywhere; at 40% coverage the multi-class tasks gain 20-25 points (condition 63.4 -> 85.5; pest 40.1 -> 59.3; crop-LOSO 46.5 -> 67.4). The cross-domain cassava head gains little (63.0 -> 70.8 at 40%), so abstention does not rescue domain shift.
- Artifacts:
artifacts/heads_v2/*.npz/.json= same four heads as v1 (weights identical: numpy-vs-torch max |dlogit| < 1e-5) plusT(crop17 2.20, healthy_vs_diseased 2.62, condition9 2.33, pest102 2.33) andconf_p20(20th percentile of scaled max-prob on validation: crop17 0.685, healthy 0.816, condition 0.443, pest 0.234) in the json. Calibration comes from the first-stage (train-only) model's validation split and is applied to the train+val refit (small mismatch; not re-verified).SHA256SUMSwritten.
22. ENTRY 2026-10-09 (m): new focus crops — maize, Amazonian medicinal plants, hemp/cannabis (PI request) — dataset search results
Scope (PI): "Corn, Amazonian medicine crops, and cannabis/hemp would be great ones to add focus on." Three research sub-agents (web only), 2026-10-09; AGENT-REPORTED unless marked. Licence policy (PI, section 13) applies to copyright licences; it does not waive traditional-knowledge, consent, or legal-status requirements.
22.1 MAIZE (data-rich; best-supported focus)
VERIFIED by me (primary API):
- Pretoria "Diseases of maize in the field" (Figshare 20237613, DOI 10.25403/UPresearchdata.20237613.v1): CC BY 4.0;
leaf_images.zip10.76 GB +Database.csv+ReadMe.txt; agent: 2,355 field leaf images, classes GLS / NCLB / common rust / southern rust / Phaeosphaeria leaf spot (only set found with southern rust); camera not stated. - Makerere maize (Harvard Dataverse 10.7910/DVN/LPGHKK): CC0 1.0; 7 files incl.
Healthy_1.rar2.33 GB,Healthy_2.rar1.99 GB,MLB_1.rar2.35 GB,MLB_2.rar1.58 GB,Maize_UG_Image_datasheet.pdf; agent (via DatasetNinja): 15,821 images, boxes for maize leaf blight and MSV, 5,326 images unannotated. AGENT-REPORTED: CCMT maize (7 classes incl. FAW/grasshopper/leaf beetle/blight/spot/streak; 5,389 raw; Mendeley blocked to scripts), TOM2024 Burkina Faso (4,734 maize images, 10 classes incl. FAW 600 + FAW-activity 616, stripe 2,190, rust 99, abiotic 77; phone, field; Mendeley 3d4yg89rtr), MLD Bangladesh (1,996 images: blight/FAW/gray spot/healthy; Mendeley 3myfctrgk3), further Bangladesh sets (Mendeley sb4wwjs8bz; vy629dngm8 with 7,500 augmented), Zindi FAW (2,699; login/terms), nutrient deficiency N/P/K/Mg (Mendeley 34gb2gr7p2, India), CornWeed (Zenodo 7961764; 3,574 labelled; 8.7 GB; CC BY 4.0), maize tassels UAV (Zenodo 4922074; 776 imgs/3,553 boxes; CC0), MSDD seedling counting, Intelinair kernels (AWS open data), white-maize kernel defects (YOLO, Harvard Dataverse), drought raw (Zenodo 10991581, 17.2 GB). Overlap warning: several "corn" Mendeley/Kaggle sets cite PlantVillage/PlantDoc as sources (duplicate risk — dedupe by d1-feature cosine). Gaps (agent): Stewart's wilt, downy mildew, smut; stem borer/cutworm boxes; labelled Fusarium/Aspergillus ear-rot field photos; weevil/storage pests; Zn deficiency/herbicide injury; open ear-counting set; CIMMYT/IITA portals and Brazil/Nepal sources not searched. Opportunity recorded: maize sets from four countries (Ghana KaraAgro, Uganda Makerere, South Africa Pretoria, Tanzania Zenodo 15685236 [+ EWA-BELT]) allow a leave-one-country-out disease evaluation — a stronger cross-source test than anything done so far. Our own Safari maize photos (5 sites/84 dates) add a healthy-field/crop-ID anchor.
22.2 AMAZONIAN MEDICINAL / ETHNOBOTANICAL PLANTS (identification + cultivation monitoring only)
- GBIF image availability (API, counts only): VERIFIED for 5 taxa: Croton lechleri 421 (rough Amazon box; 624 global), Bixa orellana 1,045 (7,098), Myrciaria dubia 222 (459), Uncaria tomentosa 42 (164), Euterpe oleracea 518 (834). AGENT-REPORTED for others: U. guianensis 371, Copaifera 740, Carapa guianensis 364, Handroanthus 1,195, Tabebuia 665, Paullinia cupana 52, E. precatoria 501, Plukenetia volubilis 223, Acmella oleracea 17, Ilex guayusa 84, Dipteryx odorata 214, Lepidium meyenii 37, Phyllanthus niruri 198, Banisteriopsis caapi 129, Psychotria viridis 235. "Rough Amazon box" = lon -80..-50, lat -18..8 — an upper bound (includes Andean, Cerrado-edge, Pacific slope). Mixed content (herbarium/field/cultivated); per-record licences.
- Datasets: no Amazon-specific labelled medicinal-plant image set found beyond GBIF/iNat exports and herbarium images (Reflora/JABOT/speciesLink via GBIF; PlantCLEF/Pl@ntNet are not Amazon-focused). No public disease/pest image set for guaraná, açaí, camu-camu, annatto, sacha inchi (only papers); proxy sets (guava anthracnose, beans) for transfer.
- Governance (agent; mostly secondary summaries; NOT legal advice; primary texts not retrieved): Brazil Law 13.123/2015 (genetic heritage + associated traditional knowledge; SisGen registration before publication/IP/commercialisation; PIC for identifiable-origin TK); Peru Law 27811 (collective knowledge of indigenous peoples; PIC via representative organisation); Andean Decision 391 (genetic resources; access contracts); Nagoya Protocol Art. 7 and 12; CARE; CITES Appendix II annotation #17 (in force 2024-11-25) for Handroanthus/Tabebuia/Roseodendron/Dipteryx — covers wood products, apparently not images (interpretation). Interpretation recorded by agent: photo-only identification probably is not "access to genetic heritage", but any attached uses/knowledge text may be associated TK -> keep use-text out of datasets or obtain consent; ask institutional counsel/SisGen. For B. caapi / P. viridis only image-availability and legal context were asked (no preparation/use information was requested or recorded).
- Implication: an Amazonian-medicinal module is feasible as species identification from GBIF/herbarium images; disease monitoring would need new, consented field data; publication is gated by governance steps, not by copyright licences (PI's fair-use position does not address them).
22.3 HEMP / CANNABIS (agronomic uses only)
- Finding: no public hemp/cannabis foliar-disease, pest or nutrient-deficiency dataset with a verified licence was found (powdery mildew, botrytis, septoria, fusarium, HLVd, mites, thrips etc. absent). Agent could not open Kaggle/Roboflow/Dryad/ResearchGate (403) — absence is not proof.
- Usable-but-small/off-target (AGENT-REPORTED; landing pages fetched): Mendeley 3md2tbx74c (greenhouse hemp water-stress, 378 images, 4 classes, CC BY 4.0, Spain, 2025; file listing empty); Univ. Costa Rica germination set (80,640 seedbed-cell crops of Finola/Kompolti; licence not stated); Thai cannabis cultivar set (Mendeley rd8c7fjrs8 / Zenodo 10635922; 14,094 phone field images, 8 cultivar classes; CC BY article); Zenodo 17783092 hemp root/shoot phenotyping (CC BY 4.0; 10.1 GB root scans); Adelaide APPF hemp phenotyping (CC BY-NC 4.0; contents unclear); HF
siccan/tricomas-semillero-cannabis(75 unlabeled trichome images). Roboflow projects (hemp1,canna: caterpillar/mealybug/normal;cannabis-classifier) are search-snippet only — must be opened and audited manually; Roboflow exports often contain augmented copies. - Deliberately excluded: datasets built to detect illicit cultivation (AMS-YOLO UAV cannabis detection, IEEE DataPort "Eyes in the Skies", satellite/police-site and national-forest grow detection) — outside this project's agronomic purpose.
- Regulatory context (agent; secondary sources; not legal advice): US 2018 Farm Bill hemp = C. sativa with <= 0.3% delta-9 THC dry weight (USDA tests total THC; a newer law may change the test — read the statute); EU 0.3% THC limit for CAP-eligible varieties; cannabis status varies by jurisdiction — check local/institutional rules before photographing new plants; avoid people and private property in images.
- Implication: a hemp module would need newly collected, lawful agronomic images (e.g. partner hemp farms/extension programs) — public data cover only cultivar ID, seedling stage and water stress.
22.4 Next steps (not yet executed)
- Maize: fetch (sequentially; 27 GB free) Pretoria (10.8 GB), Makerere
Healthy_1/MLB_1etc., then build a maize multi-country manifest with box/CSV-derived labels, base-photo dedup, d1-feature dedup; extract features (GPU pipeline already queued for KaraAgro/site2); run leave-one-country-out disease heads vs controls. - Medicinal: GBIF API export for chosen taxa with per-record licences; build a taxon-ID benchmark with site-aware splits; keep coordinates generalised; no TK text.
- Hemp: audit the open Mendeley/Zenodo sets; look for extension/partner sources; no illicit-cultivation datasets.
- Governance memo for the paper (section 7 of PAPER_NOTES) after reading primary legal texts.
Addendum to 21 (2026-10-09): diagnose.py now loads heads_v2 and reports calibrated probabilities plus an uncertain flag (scaled max-prob < validation 20th percentile). Check on stored features (healthy_vs_diseased head, PlantDoc deduped, n=2,523): accuracy when forced to answer 90.4%; answers 80.6% of images at 95.6% accuracy (unsure threshold 0.816, T=2.62) — consistent with the risk-coverage table. On one PlantDoc leaf the crop head returned uncertain (top 'yam' p=0.447 < 0.685). Not yet tested end-to-end through the d1 server (GPU pipeline is queued; CPU server is available).
Makerere maize datasheet (read 2026-10-09; /mnt/store1/agri/audit/makerere_maize_datasheet.pdf): Lacuna Fund project (same programme/protocol as KaraAgro Ghana); Makerere AI Lab + NaCRRI; 15,821 images = healthy 5,326 / maize streak virus 5,216 / maize leaf blight 5,279; Uganda, four regions, farmers' gardens, phones via the Adsurv app, May 2021 only; per-image attributes: variety, plant age, district, sub-county, GPS + accuracy, capture date (file location not yet found); cleaning removed blurry/direct-sunlight images; labelled with a VIA-based tool; datasheet states no ethical review was conducted; recommended splits: none. Shared classes with KaraAgro: healthy and MSV -> Ghana<->Uganda cross-country test on those two classes is possible; FAW (Ghana) and MLB (Uganda) are country-specific.
23. ENTRY 2026-10-09 (n): Makerere Uganda maize — manifest built; class/collection-day confound found [LOGGED: makerere_manifest.py, makerere_manifest.log]
Parts fetched (sizes matched the Dataverse API): Healthy_1.rar 2,327,480,189 B, MLB_1.rar 2,346,662,664 B, MSV_1.rar 1,817,700,375 B (of 7 files; Healthy_2, MLB_2, MSV_2 not fetched). Raw RARs kept for now (20 GB free); 640-px copies + manifest in /mnt/store1/agri/disease/makerere (650 MB).
Contents (VERIFIED): healthy 2,163 photos (no XML); MLB 2,650 photos + VOC XML; MSV 2,608 photos + VOC XML = 7,421 photos, no augmentation copies (first 400 healthy photos had 400 distinct content hashes). XML box classes: MLB only in the MLB folder, MSV only in the MSV folder, none in healthy -> folder labels agree with boxes (unlike KaraAgro's "healthy" folder, section 20).
Capture time from filenames (epoch ms): 9 capture days, 2021-05-18 .. 05-26. Class x day (photos):
| day | healthy | MLB | MSV |
|---|---|---|---|
| 05-18 | 671 | 992 | 8 |
| 05-19 | 390 | 627 | 0 |
| 05-20 | 756 | 622 | 0 |
| 05-21 | 346 | 403 | 146 |
| 05-22 | 0 | 6 | 119 |
| 05-23 | 0 | 0 | 1,046 |
| 05-24 | 0 | 0 | 442 |
| 05-25 | 0 | 0 | 462 |
| 05-26 | 0 | 0 | 385 |
- Confound: 2,335 of 2,608 MSV photos (90%) come from days with no healthy photos at all; healthy and MLB were collected together on 05-18..05-21. So for healthy-vs-MSV, class is almost perfectly confounded with collection day (and plausibly with district/field/crop stage/lighting) in this part. Any within-Makerere accuracy for healthy-vs-MSV is uninterpretable without a style-only control and must not be quoted as disease recognition. MLB-vs-healthy is better mixed (same days).
- Splits (day-grouped, my assignment, 70/15/15 target): train 3,245 / val 2,063 / test 2,113 photos; because there are only 9 days the split sizes deviate from 70/15/15 and class composition differs by split (e.g. test: MLB 992 / healthy 671 / MSV 450; val: MSV 1,046 / MLB 627 / healthy 390). Use only for exploratory work; cross-country (Ghana<->Uganda) is the meaningful test.
- Datasheet vs files: datasheet lists variety/plant age/district/sub-county/GPS per image; none of these fields exist inside the parts we have (only filenames + XML) — location/variety remain unavailable (the metadata may be in the unfetched parts or a separate file; not found).
- Extraction list:
/mnt/store1/agri/feats/lists/makerere.jsonl= up to 1,200 photos per class stratified over capture days (3,600 total); style-only features computed. GPU extraction pending (the running pipelinerun_extraction3.shcovers karaagro + safari_site2 only; a second pass is needed — do not edit the running launcher).
24. ENTRY 2026-10-09 (o): Pretoria "Diseases of maize in the field" (South Africa) — manifest built; session confound [LOGGED: pretoria_manifest.py, pretoria_manifest.log]
Source/licence: Figshare 20237613 (DOI 10.25403/UPresearchdata.20237613.v1), CC BY 4.0; leaf_images.zip 10,755,639,029 B, testzip clean, 2,355 images, all matched to Database.csv rows. Raw zip deleted after the manifest + <=1280-px/640-px copies (167 MB) were written (re-downloadable: Figshare file 36203652).
**Structure:** **flat folder — the README's description of folder names encoding date/location does not match the zip** (all images sit under leaf_images/), so site/date are unavailable. Original sizes 4032x3024 (564), 4288x2848 (300), 3840x5120 (253), 4752x3168 (241), ... (4,000-px field photos). Labels are **multi-label** (CSV multi-hot): per-image label counts 1: 1,464 / 2: 742 / 3: 134 / 4: 14 / 5: 1; class totals GLS 1,084, NCLB 554, PLS 493, CR 300, SR 39, UnidentifiedDisease 332, Other 324, NoFoliarSymptoms 285.
**Label policy (mine):** healthy = no-symptoms flag and no disease flag; single disease = exactly one of GLS/NCLB/PLS/CR/SR; else multiple (544) / unidentified (302) / other (49): kept in the manifest, excluded from single-label tasks. Resulting single-label counts: gray leaf spot 718, healthy 268, PLS 174, NCLB 170, common rust 120, **southern rust 10** (too few for any evaluation).
**Grouping/splits:** group = camera image number (CIMG####) -> 233 groups, but five groups hold most images (796, 414, 342, 308, 267) and the rest are singletons — the hash split first gave test = 36 images; re-split by balanced group sizes: train 1,587 / val 414 / test 354 images. Class composition per split is still lopsided (test: GLS 89, healthy 73, PLS 32, NCLB 22, CR 4, SR 1; val: GLS 181, healthy 40, PLS 15, NCLB 1, CR 0), i.e. disease class is largely tied to the large groups (likely collection sessions/fields), as in Makerere (section 23). Consequence: group-held-out evaluation cannot test most classes here; this set is better used as training data and as a cross-source/cross-country source or target with the style-only control, not as an in-dataset benchmark.
Not done: no image viewed (no label audit); unidentified/other semantics follow the README (other = tearing/insects/etc.).
Maize inventory so far (manifest rows): KaraAgro 5,172 (Ghana; FAW/healthy/MSV), Makerere 7,421 (Uganda; healthy/MLB/MSV; 9 days), Pretoria 2,355 (South Africa; GLS/NCLB/PLS/CR/SR/healthy/multi), plus PlantDoc/PlantWild/PlantSeg maize leaf classes and Safari maize photos (5 sites). Extraction status: KaraAgro + safari_site2 queued (GPU), Makerere list ready (second GPU pass), Pretoria list not yet built.
25. Tiled-inference post-processing sweep (2026-10-10) [VERIFIED: run by agent from tiled_cache_v2.pkl, 300 test images, v2 weights, CPU]
Script tiled_post.py v2 (cache tiled_cache_v2.pkl, full@960 + 640px tiles stride 480, raw conf>=0.10). Table (recall / precision / F1 / tiny<0.05% recall / n_pred):
- full-image only: 0.602 / 0.727 / 0.659 / 0.188 / 4115
- tile_conf .25, keep border, no merge: 0.658 / 0.565 / 0.608 / 0.296 / 5793
- tile_conf .25, drop border, no merge: 0.656 / 0.634 / 0.645 / 0.292 / 5137
- tile_conf .25, drop border, IoS-merge .7: 0.628 / 0.666 / 0.647 / 0.277 / 4688
- tile_conf .35, drop border, no merge: 0.626 / 0.671 / 0.648 / 0.243 / 4638
- tile_conf .5, drop border, no merge: 0.611 / 0.705 / 0.655 / 0.203 / 4303 (other cells in the run output.) Finding: NO configuration beats full-image-only on F1 (0.659); tiling is a recall-for-precision trade. Dropping tile-border boxes recovers ~7 precision points at ~0.2 recall points cost, the most useful single change. Best "recall mode": tile .25 + drop border (recall 0.656, tiny-plant recall 0.292 vs 0.188, precision 0.634). Caveats: single 300-image subset, no CIs, thresholds chosen on the same images (no held-out selection), "precision" is box-match at the evaluation's IoU rule with unlabelled plants counted as false positives (annotation is incomplete, so precision is a lower bound). Not yet done: v1res960 ablation evaluation; pipelines 3/4 still waiting at 00:2x.
26. Tiny CNN diagnoser, experiment E1 (2026-10-10) [LOGGED: artifacts/cnn/e1_pw_ps.log, e1_pw_ps_results.json; hardware: GPU1 M40 fp32, 1452 s]
New model family: MobileNetV3-Large (ImageNet-pretrained, 22 MB torch weights), fine-tuned end to end (train_cnn.py, 224 px squash-resized whole image, flips/affine-crop/brightness aug, AdamW + one-cycle, 14 epochs, class-weighted CE, label smoothing .05), two heads: healthy-vs-diseased (2) + coarse condition (12, loss only where a canon label exists). Plain torch/torchvision, no transformers. Image cache build_img_cache.py (54,328 images, none failed). d1-feature near-duplicates (dup_paths.json, 291 paths) excluded from evaluation.
E1 = train on PlantWild+PlantSeg train splits only; checkpoint chosen by val acc on the same sources (0.945).
| test set | n | healthy/diseased acc [Wilson 95%] | balanced | majority | 12-way condition acc |
| plantdoc (NEVER trained on, cross-source, deduped) | 2523 | 0.939 [0.929,0.948] | 0.929 | 0.667 | 0.780 |
| plantwild test (in-distribution) | 3610 | 0.928 | 0.926 | 0.569 | 0.839 |
| plantseg test (diseased only) | 2205 | 0.967 | - | 1.000 | 0.869 |
| makerere (maize, Uganda field) | 2113 | 0.805 [0.787,0.821] | 0.822 | 0.682 | 0.594 |
| cassava (Uganda field) | 300 | 0.690 | 0.681 | 0.800 | 0.27 |
| pretoria (maize, SA) | 354 | 0.703 | 0.737 | 0.794 | 0.570 |
| karaagro (maize, Ghana) | 768 | 0.546 [0.510,0.580] | 0.631 | 0.694 | 0.253 |
Reading: (1) on the cross-source web benchmark the CNN beats the earlier d1-trunk head (PlantDoc healthy/diseased 0.939 vs 0.908; condition 0.780 over 12 classes vs 0.634 over 9 classes). NOT like-for-like: the d1 head was trained on PlantWild only, labels sets differ (9 vs 12 classes), PlantDoc here is all splits after dedup. A matched comparison still has to be run (d1 head trained on pw+ps, same test rows, same label set). (2) Field-condition sets from tropical programmes are the weak point: KaraAgro balanced acc 0.631 and accuracy BELOW the majority baseline; Pretoria and Cassava also below majority accuracy. Web/lab-trained diagnosis does not transfer to these field distributions, matching the earlier d1-head cassava result (K-ledger). These sets are also confounded (class tied to collection session, see §19-21), so low numbers may partly reflect label/session structure. (3) No style-only control has been run for the CNN yet. (4) Single seed, no CIs across seeds.
Next: E3 leave-one-source-out (Makerere, KaraAgro held out while training on every other source incl. other field sets) and E2 all-sources model; then export ONNX + parity.
27. Matched d1-head vs CNN comparison (2026-10-10) [LOGGED: matched_d1_vs_cnn.log, artifacts/cnn/matched_d1_vs_cnn.log; CPU]
Resolves the "not like-for-like" caveat of §26. d1 trunk head (feat+logit, linear, wd chosen on val) trained on EXACTLY the E1 rows (plantwild+plantseg train), evaluated on EXACTLY the E1 PlantDoc rows (all splits, dup_paths excluded, n=2523), same 12-way condition label set (rows with canon label; masked).
- healthy vs diseased: d1 head 0.915 [0.904,0.925] (balanced 0.894) vs CNN 0.939 [0.929,0.948] (balanced 0.929). Intervals do not overlap but are close; single seed each.
- 12-way condition: d1 head 0.640 [0.621,0.659] vs CNN 0.780. Large gap. So the 22 MB end-to-end CNN beats the frozen 407 MB d1 trunk + head on this cross-source web benchmark, on both tasks. This weakens the case for d1 as the diagnoser backbone on this benchmark; d1's remaining advantages (zero-shot concept questions, no per-task training) are untested here. Caveat: no style-only control for either; 12-way label noise (canon keyword mapping, Claude-built) applies to both equally.
28. 960-px ablation result: resolution, not hardware (2026-10-10) [LOGGED: detector_eval_v1res960.json, eval_detector_v1res960.log; CPU eval]
yolo11n_v1res960 = the v1 recipe (M40, fp32, no AMP, same hyperparameters/seed/split) trained at imgsz 960 for 60 epochs. Held-out test (1,246 imgs, conf .001, iou .6, torch weights, CPU):
| model | train hw / AMP | train res | eval res | mAP50 | mAP50-95 | P | R |
| v1 | M40 / no | 640 | 640 | 0.644 | 0.349 | 0.681 | 0.580 |
| v1 weights | - | 640 | 960 | 0.664 | 0.373 | 0.681 | 0.609 |
| v1res960 | M40 / no | 960 | 960 | 0.689 | 0.398 | 0.704 | 0.628 |
| v2 (Kaggle) | T4 / AMP | 960 | 960 | 0.691 | 0.385 | 0.682 | 0.650 |
Conclusion: the v2 gain over v1 is attributable to image resolution (v1res960 matches v2 at mAP50 0.689 vs 0.691; mAP50-95 is even higher locally, 0.398 vs 0.385, differences of this size are within what a single-seed comparison cannot resolve). T4/AMP/torch version are NOT needed for the gain; the local M40 reproduces it. Training at 960 beyond inference-at-960 adds ~+0.025 mAP50 over v1 weights evaluated at 960. Note: the script's ONNX parity step failed for this run (exported at 640, evaluated at 960): script limitation, not a model problem; no ONNX figure for v1res960. Single seed; test set is dates held out but 3 crops only.
29. Pest-species CNN on IP102 (2026-10-10) [LOGGED: artifacts/cnn/pest_ip102.log, pest_ip102_results.json; GPU0 M40 fp32, 6.7 min]
train_cnn_pest.py: MobileNetV3-Large, same recipe as §26, single 97-class head (the manifest sample of IP102 contains 97 of the 102 classes), 30 epochs, train = official-train sample (2,627) minus a random 20% val; test = official-test sample restricted to images that went through the d1 near-duplicate check (534 after excluding 10 flagged and 295 unchecked) = the SAME 534 test images as the d1-head baseline in §T4 (line 121).
- CNN top-1 0.530 [0.488,0.572], top-5 0.732, balanced top-1 0.521; best val 0.524.
- d1 trunk head (earlier, trained on the 2,308-image extracted subset, ~1,764 train): top-1 0.401 [0.360,0.443]; chance ~1%. Intervals do not overlap (single seed, CNN had ~19% more training images, so not a perfectly matched training set). Absolute numbers are low versus published full-IP102 results (trained on 75k images); we only hold a 3.5k sample, so this is a data-limited figure. Next lever: fetch more of IP102 (disk 18 GB free) and/or higher resolution.
30. CNN leave-one-source-out: Makerere held out (2026-10-10) [LOGGED: artifacts/cnn/e3_loso_makerere.log, _results.json, style_control_loso.log; GPU1]
Train on plantwild, plantseg, plantdoc, cassava, karaagro, pretoria (train splits); Makerere (Uganda maize: healthy / leaf blight / MSV) never seen. Healthy-vs-diseased accuracy on Makerere test (n=2113): 0.969 [0.961,0.976], balanced 0.967 (majority 0.682); 12-way condition 0.869. Compare E1 (no field sources in training): 0.805. Adding KaraAgro (Ghana maize, shares MSV/healthy), Cassava (Uganda) and Pretoria to training raised held-out Makerere accuracy by ~16 points. Controls: style-only (37 image stats) logistic trained on the same sources and tested on the held-out Makerere test rows that have style features (n=861 subset): 0.634 [0.601,0.666], balanced 0.629, majority 0.652. So image statistics alone do not explain the CNN's 0.969. Caveats (all open): (a) KaraAgro and Makerere both contain maize streak virus and healthy maize, so this is "new country/camera, same diseases", not unseen-disease generalisation; (b) Makerere labels/sessions are confounded (class tied to collection days, §19-21): a held-out SOURCE removes day-leakage between train and test, but the CNN could still use non-style cues shared by KaraAgro (e.g. phone type, leaf framing); (c) single seed; (d) the style control was evaluated on a 861-row subset, not the exact 2,113 test rows. Anomaly to investigate: Pretoria (a TRAINING source in this run) scores only 0.514 on its own test split [0.462,0.566] (majority 0.794). Its hash-split imbalance and tiny healthy count were noted earlier (§21); do not read the Pretoria split as a reliable test.
31. CNN leave-one-source-out: KaraAgro held out (2026-10-10) [LOGGED: artifacts/cnn/e3_loso_karaagro.log, _results.json, style_control_loso.log; GPU1]
Train on plantwild, plantseg, plantdoc, cassava, makerere, pretoria; KaraAgro (Ghana maize: healthy / fall armyworm / MSV) never seen. Test n=768: healthy-vs-diseased 0.801 [0.771,0.828], balanced 0.805 (majority 0.694); 12-way condition 0.565. E1 (no field sources in training) scored 0.546 / balanced 0.631, i.e. below majority. Style-only control (same sources, held-out KaraAgro test rows with style features, n=768): 0.483 [0.448,0.518], balanced 0.524. Reading: more field data from other countries lifts held-out KaraAgro by ~25 points and beats both style-only and majority baselines, but 0.80 is far below the Makerere held-out figure (0.969, §30). KaraAgro's diseases (fall armyworm bites, MSV) are subtler in these photos than Makerere's, plus Makerere has the strongest session-confound (§19-21). Single seed; same caveats (a)-(d) as §30. Data notes added this session: (i) IP102 full re-upload fetched (18,969 imgs, 97 classes present, pHash test-vs-train dedup in train_cnn_pest.py); (ii) CCMT raw (Mendeley bwh3zbpkpv, CC BY 4.0): 25,215 of 25,220 listed raw .jpg downloaded (5 failed); filenames are NOT unique across folders (healthy*, leaf blight* collide across crops: 2,204 names/5,085 files), so those were re-fetched under uuid-suffixed names; the first pass had silently overwritten ~2.9k files. Crop is unknown for healthy and leaf blight; the 105k augmented .JPG copies were deliberately not used (augmentation leakage). Split is a filename hash and NOT leakage-free (consecutive shots), so CCMT numbers are optimistic when CCMT is in training; as an untouched external test it is clean with respect to the models trained so far.
32. External test on CCMT raw (Ghana; never trained on) (2026-10-10) [LOGGED: artifacts/cnn/*_ccmt_eval_all.json; eval_cnn_ccmt.py; GPU0]
25,122 CCMT raw images (93 unreadable skipped; all splits used because nothing was trained on CCMT; 87.1% diseased so ACCURACY IS NOT INFORMATIVE: majority = 0.871). Healthy-vs-diseased, models trained without CCMT:
| model | accuracy [95%] | healthy recall | diseased recall | balanced |
| e1 (plantwild+plantseg only) | 0.836 [0.832,0.841] | 0.885 | 0.829 | 0.857 |
| e3 (Makerere held out) | 0.859 [0.854,0.863] | 0.792 | 0.869 | 0.831 |
| e3 (KaraAgro held out) | 0.874 [0.870,0.878] | 0.892 | 0.871 | 0.882 |
Per crop (accuracy, e1 / makerere-held / karaagro-held): maize 0.63/0.76/0.75 (n=4,088: the weak crop; leaf beetle 0.5, leaf spot ~0.75, streak virus 0.40/0.95/0.93), cassava 0.80/0.84/0.86, cashew 0.89/0.88/0.89, tomato 0.93/0.95/0.94, unknown-crop (healthy/leaf blight mix) 0.90/0.87/0.92.
Reading: (1) The web-trained E1 model already reaches balanced 0.857 on CCMT, far better than on KaraAgro/Pretoria field sets (§26): CCMT images are mostly close-up single-leaf photos, closer to PlantWild than whole-plant field shots, so it is an easier distribution and should not be read as "field generalisation solved". (2) Adding Ghanaian/Ugandan maize training data (KaraAgro) raises MSV recall from 0.40 to 0.93 and maize accuracy 0.63 -> 0.75; this is expected as KaraAgro contains MSV, so it is partly in-domain knowledge transfer. (3) Maize leaf beetle and leaf spot remain poor in every model (0.5 / ~0.75): candidate for targeted data. (4) No style-only control computed on CCMT; no seeds. (5) Crop label unknown for 5.5k images.
33. CNN calibration and abstention (KaraAgro-held-out model) (2026-10-10) [LOGGED: artifacts/cnn/e3_loso_karaagro_calibration.json; calibrate_cnn.py; GPU0]
Temperature fitted on val rows of the 6 training sources (n=5,765): T = 0.832 (<1: the label-smoothed, dropout-trained net is under-confident in-distribution). Held-out KaraAgro (n=768): ECE raw 0.095 -> scaled 0.117 (WORSE); CCMT (n=25,122) ECE 0.032 -> 0.057 (worse). So source-val temperature scaling does not transfer to a shifted source (same lesson as the d1 heads, §calibration). Selective prediction still helps on the shifted sets, using max-softmax confidence: KaraAgro balanced accuracy 0.805 (all) -> 0.867 (top-80% confident) -> 0.875 (top-60%); CCMT 0.881 -> 0.920 -> 0.927. Cost: 20-40% of images get "unsure". Implication for the app: ship raw (unscaled) confidence with an abstain band; do not claim calibrated probabilities on new farms.
34. Pest-species CNN on full IP102 (2026-10-10) [LOGGED: artifacts/cnn/pest_ip102full.log, _results.json; GPU0 M40 fp32, 41.6 min]
Data: Zenodo 15546419 COCO re-upload, all 18,969 annotated images (train 15,171 / test 3,798), label = majority-vote annotation class; only 97 of the nominal 102 classes occur (the re-upload; not investigated). Test excludes 829 images that are perceptual-hash near-duplicates (dHash 64-bit, Hamming <= 6) of a training image -> n=2,969. Val = random 20% of the train split (so val can share near-duplicates with train; val 0.710 ~ test 0.726 suggests this is small). Class weights softened and clipped ((mean/count)^0.5 in [0.2,5]): the first launch with raw inverse-frequency weights diverged (epoch-1 loss 6.5, val 0.004) and was killed by PID; the small-IP102 run in §29 used the raw weights but had near-balanced classes (<=30/class) so it is unaffected. Result: top-1 0.726 [0.710,0.742], top-5 0.914, balanced top-1 0.537 (long-tailed classes; rare species poorly recognised), 30 epochs, 224 px, MobileNetV3-L. Single seed. For orientation (NOT verified from the primary source here): published IP102 baselines are in the ~0.5-0.7 top-1 range with larger CNNs on the official 75k set; this is a 19k subset of the images, so do not compare directly.
35. CNN E2: all sources (2026-10-10) [LOGGED: artifacts/cnn/e2_all.log, e2_all_results.json; GPU1]
Trained on train splits of plantwild, plantseg, plantdoc, cassava, karaagro, makerere, pretoria (14 epochs, best val 0.959). Within-source test splits (NOT independent of training-source sessions/days; KaraAgro/Makerere in-source tests are optimistic, see §19-21): plantdoc 0.991, karaagro 0.975, makerere 0.991, plantwild 0.931, plantseg 0.968, cassava 0.863 (bal 0.815, majority 0.800), pretoria 0.489 (majority 0.794; unchanged anomaly, hash-split group imbalance). This is the model intended for packaging; its generalisation estimate is the LOSO numbers (§30, §31) and the CCMT external test, NOT this table. E5 (adds CCMT to training) is running.
36. d1-head vs CNN under leave-one-source-out, matched rows (2026-10-10) [LOGGED: d1_loso.log, cnn_on_list_subset.log (copies in artifacts/cnn/)]
d1 trunk feature+logit linear head (d1_loso.py, CPU; trained on the d1-featurised subsets of the other 6 sources; first d1 features for KaraAgro/Makerere/Pretoria, extracted today) vs the CNN LOSO models, evaluated on EXACTLY the same held-out test rows (those in the d1 feature lists):
| held-out | n | d1 head acc [95%] / bal | CNN acc / bal | d1 style-only control |
| Makerere | 861 | 0.905 [0.883,0.923] / 0.915 | 0.969 / 0.967 | 0.634 / 0.629 |
| KaraAgro | 768 | 0.784 [0.753,0.812] / 0.805 | 0.801 / 0.805 | 0.483 / 0.524 |
Reading: the frozen 407 MB d1 trunk with a linear head is on par with the 22 MB end-to-end CNN on held-out KaraAgro (balanced accuracy identical, 0.805) and clearly worse on held-out Makerere (0.905 vs 0.969, intervals do not overlap). Both far exceed the style-only control, so neither is merely reading image statistics. The earlier cross-source web result (§27) favoured the CNN; field sources are more mixed. Caveats: CNN training sets were larger (full manifest vs d1 subsets: the CNN saw ~3x more training rows), single seed each. Pretoria results: see below if appended.
(§36 addendum, 2026-10-10) Pretoria held out, d1 head, n=280: acc 0.657 [0.600,0.710], balanced 0.684, majority 0.739; style-only 0.600 / 0.561. Below the majority baseline: Pretoria remains the least reliable source (§21). CNN LOSO for Pretoria not run.
37. Cross-site crop ID on a larger Safari set (safari_site2, 18 crops) (2026-10-10) [LOGGED: loso_crop2_safari_site2.log, loso_crop_results_safari_site2.json; CPU]
New d1 features for 2,156 images from 15 sites (extracted on GPU0 today; make_site_set2.py: up to ~N images per crop x site x date stratum, 18 crops). d1-trunk feature head, leave-one-site-out (train on all other sites; test crops must occur elsewhere; d1-feature dedup), 18-way crop ID:
- POOLED over 14 testable held-out sites (n=1,927): head 0.504 [0.482,0.526] | zero-shot d1 0.135 [0.120,0.151] | style-only 0.121 | majority 0.143.
- Same rows, same-site random 5-fold: 0.763 [0.744,0.780] -> random splits overstate cross-site accuracy by ~26 points.
- Per site is very uneven: banana-only sites iita-kampala / iita-nambala 0.89 / 0.93 (zero-shot d1 also 0.97 / 0.96 there: bananas are distinctive), but big mixed sites qed-lilongwe (n=714) 0.454, ciat-arusha (n=399) 0.591, cip-nairobi 0.250, cimmyt-kiboko 0.378. Reading: replicates the earlier 993-image result (§17) on a larger, 18-crop set: a trunk-feature head is well above zero-shot/style/majority across sites but far from deployment-grade. Class-per-site structure is not balanced (many crops occur at one site only and are untestable), so the pooled figure is dominated by qed-lilongwe and ciat-arusha. The combined (safari_site+site2) run is still computing at time of writing.
38. CNN E5: all sources + CCMT in training; split-protocol effect on CCMT (2026-10-10) [LOGGED: artifacts/cnn/e5_all_ccmt.log, _results.json; GPU1]
E5 = E2 plus CCMT raw train split (53,247 train images, 14 epochs, best val ~0.96). Within-source test rows: ccmt 0.989 [0.984,0.993] (balanced 0.988; n=2,492), karaagro 0.969, makerere 0.992, plantdoc 0.989, plantseg 0.954, plantwild 0.922, cassava 0.840 (bal 0.762), pretoria 0.559. Split-protocol effect (same CCMT images, same architecture): when CCMT was never trained on (§32, models e1/e3) accuracy was 0.836-0.874 / balanced 0.83-0.88; when CCMT's own hash-split train portion is in training, the held-out CCMT test portion scores 0.989 / balanced 0.988. The ~10-point gap is the leakage/session effect of random splits over consecutive field shots (CCMT raw images come from the same plants/rows), plus the benefit of in-domain data. Report CCMT in-source numbers only with that caveat; the external numbers (§32) are the honest estimate for a new farm. Same pattern for KaraAgro/Makerere (§31/30: 0.80/0.97 held-out vs 0.97/0.99 in-source). Slight cost of adding more sources: plantwild 0.931 -> 0.922, plantseg 0.968 -> 0.954 (single seed; within noise but consistent in sign).
39. Crop ID across sites: CNN vs d1 head, identical site-disjoint folds (2026-10-10) [LOGGED: artifacts/cnn/crop_sites.log, crop_sites_results.json, d1_crop_folds.log; CNN on GPU0 (~28 min), d1 on CPU]
Rows: safari_site + safari_site2 (3,149 images, 15 sites, 18 crops). Five SITE-disjoint folds (greedy size balance; safari_sites_meta.jsonl), test rows restricted to crops present in the fold's training set (pooled n=2,824). Fixed 15 epochs, no model selection on test.
- MobileNetV3-L end to end: 0.523 [0.504,0.541] (folds: 0.425 qed-lilongwe, 0.600 ciat-arusha, 0.531, 0.503, 0.652).
- d1 trunk feature+logit linear head: 0.518 [0.500,0.536].
- style-only control: 0.127 [0.115,0.140]. The two methods tie. Crop identity from field photos at unseen sites is ~52% for 18 crops with ~2.5k training images whichever backbone is used; it is data-limited (plus domain shift between sites/cameras), not backbone-limited. Large-site folds are the worst (qed-lilongwe 0.425, mixed 18-crop scenes). Note this differs slightly from §37 (leave-one-SITE-out, d1, 0.504) because folds group several sites. Next lever (not yet done): add web crop photos (GBIF/iNaturalist, any licence per PI policy) for the 18 crops as extra training data.
40. INT8 quantisation of the tiny CNN (2026-10-10) [LOGGED: quantize_cnn_onnx.py; per-run JSONs int8_{MinMax,Percentile,Entropy}_karaagro.json in the run dir; CPU]
Static QDQ INT8 (ORT, per-channel weights QInt8, activations QUInt8, opset-13 export, 200 calibration images from the training split), model e3_loso_karaagro, scored on held-out KaraAgro test (n=768): | calibration | size | acc | balanced | | fp32 | 11.9 MB | 0.801 | 0.805 | | MinMax | 3.44 MB | 0.355 | 0.483 (collapsed to chance) | | Entropy | 3.44 MB | 0.355 | 0.483 (collapsed) | | Percentile 99.99 | 3.44 MB | 0.814 | 0.806 | So INT8 is viable here but only with percentile calibration (naive MinMax/Entropy break the hardswish/SE activations of MobileNetV3). Single model, single calibration set; accuracy difference +0.013 is within noise (not an improvement claim). Latency on this box (old Xeon E5-2609 v2, no VNNI) INT8 was slower than fp32 (69 vs 54 ms/img multithread, noisy, other jobs running) -> NO speed claim; INT8's benefit here is size, and phone speed is untested.
41. Seed variance of the E1 CNN (3 seeds) (2026-10-10) [LOGGED: artifacts/cnn/e1_pw_ps_results.json (seed 0), e1_seed1_results.json, e1_seed2_results.json; GPU1]
Same recipe as §26 (train PlantWild+PlantSeg), seeds 0/1/2 (seed changes init of heads, shuffling, augmentation; best-val checkpoint each). Healthy-vs-diseased accuracy (seed0 / seed1 / seed2):
- plantdoc (cross-source, n=2523): 0.939 / 0.947 / 0.942 (mean 0.943, range 0.008) -> the CNN>d1-head gap (0.915, single run) is ~3.5x the seed range.
- plantwild test: 0.928 / 0.934 / 0.930. makerere: 0.805 / 0.841 / 0.806 (range 0.036). karaagro: 0.546 / 0.535 / 0.555. cassava: 0.690 / 0.650 / 0.667. pretoria: 0.703 / 0.568 / 0.613 (range 0.135: Pretoria is unusable as a precise test). Reading: in-distribution/cross-web numbers are stable to <1 point; tropical field-source numbers move 2-4 points with seed, small sources (Cassava n=300, Pretoria n=354) 4-14 points. Single-seed differences of that size on those sources (§26, §30, §31) must not be interpreted. The Makerere-held-out 0.969 and KaraAgro-held-out 0.801 (§30-31) are single-seed.
42. Amazonian / tropical useful-plant species ID from GBIF photos (2026-10-10) [LOGGED: artifacts/gbif/species_gbif.log, species_gbif_results.json, amazon_species_manifest_no_usernames.jsonl, gbif_fetch_amazon*.log; GPU1, 23 min]
Scope (PI focus crop #2, "Amazonian medicine crops"): agronomic/botanical IDENTIFICATION only. No traditional-knowledge text, no ethnobotanical uses, no coordinates stored, and visionary/sacred plants (e.g. Banisteriopsis, Psychotria) deliberately NOT included. Governance (CARE/FPIC/SisGen/Nagoya) is NOT waived by the licence stance (§22); this experiment is internal research on public GBIF records and no release of derived weights is implied.
Data: gbif_fetch.py (GBIF species/match then occurrence/search, HUMAN_OBSERVATION + StillImage, one image per occurrence, licence recorded per image, iNaturalist medium-size renditions). 18 taxa requested, 11 with >=40 photos kept: Ananas comosus 300, Bixa orellana 300, Euterpe oleracea 300, Manihot esculenta 299, Theobroma cacao 300, Euterpe precatoria 247, Bertholletia excelsa 166, Theobroma grandiflorum 150, Capsicum chinense 71, Carapa guianensis 58, Plukenetia volubilis 47 (n=2,238). Dropped for too few records via this query: Croton lechleri 7, Myrciaria dubia 18, Uncaria tomentosa 10, Paullinia cupana 20, Ilex guayusa 22, Lepidium meyenii 15, Cinchona officinalis 3 (earlier count of 421 C. lechleri in a box (§22) does not survive my filters: licence present, species-level match, one image/occurrence, human observation). Licences: 1,984 CC BY-NC, 154 CC BY, 38 CC0, 21 BY-NC-ND, 11 BY-NC-SA, 9 BY-SA (rest minor).
Method: MobileNetV3-L end to end, 224 px, 15 epochs, observer-GROUPED 5-fold (groups = recordedBy, 1,497 groups; GBIF 'unknown' observers each their own group) so the same photographer's near-identical shots never straddle train/test. Fold accuracies 0.855, 0.815, ... pooled 0.818 [0.801,0.833] (n=2,238; majority class 300/2238 = 0.134).
Per taxon recall (pooled over folds): Ananas 0.97, Bixa 0.92, Manihot 0.92, Theobroma cacao 0.84, Bertholletia 0.79, Plukenetia 0.79, T. grandiflorum 0.76, Euterpe precatoria 0.72, E. oleracea 0.70, Capsicum chinense 0.70, Carapa guianensis 0.24 (n=58).
Caveats: iNaturalist photos mix organs (fruit, leaf, trunk, whole tree) and settings; label noise from community IDs not audited; congeneric pairs (the two Euterpe, the two Theobroma) are confused as expected; GBIF observer grouping does not guarantee independence (same plant photographed by different observers); single seed; this is NOT disease/pest data; taxa chosen by the agent; absolute numbers say nothing about performance on field photos by farmers.
43. Hemp: Mendeley 3md2tbx74c checked (2026-10-10) [VERIFIED: Mendeley public API listing, no download]
The only open hemp set the earlier agent survey named as usable (§22.3) lists 1,253 files (91 MB, CC BY 4.0): 1,252 hourly greenhouse growth images ryb_C{1-5}_<date>_<hh>_<mm>.jpg of five plants from transplanting to day 20, plus one yolo*x-cls.pt model. The labelled water-stress train/test folder described on the landing page is NOT in the public file listing. => no labelled hemp stress/disease images are obtainable from it; nothing was downloaded or used. Hemp therefore remains the unfulfilled focus crop: it needs newly collected, lawful agronomic images from partner hemp farms/extension programmes (§22.3). No illicit-cultivation datasets were considered.
44. TTA and seed-ensemble: negligible gain (negative result) (2026-10-10) [LOGGED: eval_tta_ens_e1.log (artifacts/cnn/); GPU0]
E1 models (3 seeds). TTA = mean softmax over {identity, h-flip, v-flip, both}. Healthy-vs-diseased accuracy, single model plain -> TTA; 3-seed ensemble plain -> TTA: plantdoc 0.939/0.947/0.942 -> +0.000 to +0.003; ENS 0.948 -> 0.951 | makerere 0.805/0.841/0.806 -> -0.002 to +0.005; ENS 0.825 -> 0.823 | karaagro 0.546/0.535/0.555 -> -0.004 to +0.005; ENS 0.538 -> 0.540 | ccmt (n=25,122) 0.836/0.824/0.832 -> +0.001 to +0.003; ENS 0.836 -> 0.838 (balanced 0.861 -> 0.863). Neither TTA (3-4x latency) nor ensembling (3x size) moves the numbers beyond seed noise; the field-source errors are systematic (domain shift), not variance. Not adopted.
45. CCMT label audit (30 images) and EfficientNet-B0 comparison (2026-10-10) [VERIFIED: contact sheet viewed by the agent, scratchpad ccmt_audit.jpg (not committed); effb0 LOGGED artifacts/cnn/e1_effb0*]
Audit (agent, NOT an expert): random 5 images each from raw classes healthy, leaf blight, leaf beetle, streak virus, leaf spot, fall armyworm (seed 3). Content matches labels in all 30 (healthy leaves of cassava/tomato/maize; tomato and maize blight lesions; beetles/feeding holes; maize streak striping; leaf-spot lesions; caterpillars and a feeding-damage leaf). Observed ambiguity, not errors: "leaf beetle" and "fall armyworm" are PEST-present/feeding-damage images, so the healthy-vs-diseased head treats pests as "diseased"; "leaf spot" vs "streak virus" lesions are visually close on maize; one "leaf spot" image shows a maize tassel in frame. 93 of 25,215 files are truncated/unreadable (kept out of every evaluation). A 30-image sample cannot bound the label-noise rate (95% upper bound on error rate with 0/30 wrong ~ 9.5%). EfficientNet-B0 (same recipe/data as e1): 54.6 min training vs ~24 min for MobileNetV3-L; accuracies plantdoc 0.938, plantseg 0.969, plantwild 0.933, makerere 0.790, karaagro 0.497, cassava 0.707, pretoria 0.636, ccmt 0.810 (bal 0.850) vs MobileNetV3-L seed-0 0.939/0.967/0.928/0.805/0.546/0.690/0.703/-(0.836, bal 0.857). No advantage; 2.3x slower to train and larger on-device -> MobileNetV3-L retained.
46. Strong photometric/occlusion augmentation does not close the web->field gap (negative) (2026-10-10) [LOGGED: artifacts/cnn/e1_strong.log, e1_strong_results.json; GPU1]
--aug strong (saturation 0.4-1.6, per-channel gain 0.8-1.2, 10% grayscale, sensor noise, 30% blur, 50% cutout, plus the base flips/crops) on the E1 recipe (train PlantWild+PlantSeg, seed 0, 14 epochs). Held-out accuracy (strong vs base seeds 0/1/2): plantdoc 0.932 vs 0.939/0.947/0.942; karaagro 0.510 vs 0.546/0.535/0.555; makerere 0.814 vs 0.805/0.841/0.806; cassava 0.613 vs 0.690/0.650/0.667; pretoria 0.684 vs 0.703/0.568/0.613; ccmt 0.808 (bal 0.845) vs 0.836/0.824/0.832 (bal 0.857/0.849/0.856). No improvement beyond seed noise, ccmt/karaagro/cassava slightly worse. A planned second seed was cancelled (killed by PID after 25 s) because the first result was clearly not better. Conclusion: the web->field gap is about missing visual content (whole-plant field scenes, other symptom appearances), not photometric nuisance; adding field data (LOSO runs) is what helped.
47. Detector: 1280-px fine-tune (progressive resizing) (2026-10-10) [LOGGED: artifacts/yolo11n_ft1280/{results.csv,args.yaml,detector_eval_ft1280*.json,eval_detector_ft1280.log,size_recall_*.log,SHA256SUMS}; GPU0 M40 fp32, 25 epochs, 3.48 h, batch 8, lr0 0.002]
yolo11n_ft1280: start from the local 960-px v1res960 weights, fine-tune at native 1280 px (the source photos are mostly 1280x960), same split/hyperparameters otherwise. Held-out test (1,246 images, conf .001, IoU .6):
| model | train / eval px | mAP50 | mAP50-95 | P | R |
| v1 | 640 / 640 | 0.644 | 0.349 | 0.681 | 0.580 |
| v2 (Kaggle T4) | 960 / 960 | 0.691 | 0.385 | 0.682 | 0.650 |
| v1res960 (local M40) | 960 / 960 | 0.689 | 0.398 | 0.704 | 0.628 |
| ft1280 (this) | 1280 / 1280 | 0.704 | 0.428 | 0.723 | 0.627 |
| ft1280 weights evaluated at 960 | - / 960 | 0.678 | 0.400 | 0.723 | 0.591 |
ONNX (CPU, 1280 export) test: 0.704 / 0.426 (torch 0.704 / 0.428): parity holds. Per-class AP50-95 (test): bean 0.398, cowpea 0.478, sorghum 0.406. Val: 0.693 / 0.394.
Size-stratified recall at conf 0.25 (test GT boxes; class-aware IoU 0.5): overall recall / precision ft1280 0.603 / 0.747, v1res960 0.616 / 0.724, v2@960 0.611 / 0.731. Tiny plants (<0.05% of frame): ft1280 0.202, v1res960 0.225, v2 0.206 -> NO gain on the hardest bin; 0.05-0.2%: 0.462 / 0.500 / 0.483; 1-5%: 0.862 / 0.849 / 0.848.
Reading: the +0.03 mAP50-95 over 960-px training comes from better box quality and precision on medium/large plants, NOT from finding more tiny plants (tiny-plant recall at the 0.25 threshold is unchanged within noise). Running the 1280-trained weights at 960 loses ~0.03 mAP, so deployment must keep the 1280 input (2.8x the pixels of 640, i.e. slower on a phone: untested). Single seed; the fine-tune also received 25 extra epochs over v1res960, so resolution and extra training are confounded in the +0.03.
48. Input resolution does not help held-out field accuracy: 224 vs native 320 (negative) (2026-10-10) [LOGGED: artifacts/cnn/sub_r{224,320}_s{0,1}_results.json; GPU1; each pair uses identical images]
Design: a 320-px cache of 16,684 field-source images (KaraAgro all, Pretoria all, Cassava all, Makerere 45% sample, CCMT 15% sample; sub320_meta.jsonl, 5.1 GB). Train on makerere+pretoria+cassava+ccmt only (7,527 train images, NO web data, 15 epochs, seeds 0/1); KaraAgro is the held-out source (n=768). "224" = the same cached images area-downsampled on the GPU; "320" = native. Held-out KaraAgro accuracy / balanced:
- 224: seed0 0.807 / 0.741, seed1 0.846 / 0.791
- 320: seed0 0.797 / 0.700, seed1 0.801 / 0.715 No benefit from 320 (if anything lower, but the seed spread of 0.04 is as large as the gap). Other sources moved by <=0.02. Conclusion: the web/field gap is not a resolution problem for this model family; 224 is kept (320 costs ~2x training time and on-device compute). Side observation: the field-only model (no web data) reaches acc 0.807-0.846 on held-out KaraAgro but balanced 0.741-0.791, versus the web+field LOSO model acc 0.801 / balanced 0.805 (§31): web data adds healthy/diseased balance rather than accuracy. Caveat: 2 seeds, 15% CCMT sample.
49. Crop ID across sites: adding GBIF/iNaturalist web photos to training (2026-10-25) [LOGGED: artifacts/cnn/web_crop/{web_s0,web_s1,web_s2,ctrl_s1,ctrl_s2}*.log/_results.json, gbif_crops_fetch.log, gbif_crops_manifest_no_names.jsonl; ctrl_s0 = §39 crop_sites_results.json; GPU0, ~25 min/run]
Closes the "next lever" of §39. Data: gbif_fetch.py, 150 images per species (iNaturalist medium renditions, one per occurrence, licence recorded) for 16 of the 18 Safari crops = 2,235 images; NONE for african yam (Dioscorea rotundata: 0 records) or lentil (0); finger millet 38, pearl millet 97. Licences: 1,810 CC BY-NC, 116 CC BY, 79 BY-NC-ND, 44 CC0, remainder other/SA (policy §22: licence not a gate; images not redistributed; committed manifest has no observer/rightsHolder names). Agent contact-sheet check (36 images, maize/sorghum/potato/cowpea/rice/banana): content matches labels; scenes are garden/field-like, not expert-audited.
Method: train_cnn_crop_web.py = §39 recipe unchanged (MobileNetV3-L, 224 px, 15 epochs, same 5 site-disjoint folds), web rows added to every fold's TRAIN set only; the test set is identical to §39 (pooled n=2,824; seen crops computed from Safari rows only so web-only crops cannot change the test set). Control = same script with 0 web rows (MAXW=0), reproducing §39.
Pooled accuracy (Wilson 95%):
- control: seed0 0.523 [0.504,0.541] (§39 original run), seed1 0.533 [0.514,0.551], seed2 0.503 [0.485,0.522] -> mean 0.520
- +web: seed0 0.595 [0.577,0.613], seed1 0.603 [0.585,0.621], seed2 0.605 [0.587,0.623] -> mean 0.601 +8.1 points (every web seed is above every control seed). Seed spread within a condition is ~0.01-0.03, smaller than the effect. Caveats: seed-0 control is the §39 run, not re-run in this script (same code path, different file; test n identical). Web photos add roughly 14% more training images but also new CROP-CONTEXT diversity, so this does not separate "more data" from "more diverse data". Class balance shifts (13 crops get +150). Crops without web data (african yam, lentil) cannot benefit; per-crop recall was NOT computed (results.json holds per-site only) -> unknown whether the gain is concentrated in a few crops. Still single architecture; no expert labelling; field-site accuracy 0.60 for 18-way is not deployment-grade. Not yet done: per-crop breakdown; train a deployable all-data crop model with web photos; web photos for the disease/pest heads (this experiment is crop ID only).
50. Final all-data crop model crop18_web_v1, and is Qwen-Image-2.1 worth the same recipe? (2026-10-25) [LOGGED: artifacts/crop18_web_v1/{train.log,meta.json,onnx_parity.json,SHA256SUMS}; train_crop_final.py, export_crop18_onnx.py; GPU0, 6.3 min]
Model: the §49 recipe fitted once on ALL rows (5,384 = 3,149 Safari + 2,235 web, 18-way head, MobileNetV3-L, 224 px, 15 epochs, seed 0, same augmentation and class weights). Train-set accuracy 0.997 (NOT a generalisation estimate). There is no held-out set by construction; the honest estimate is the site-disjoint CV of §49 (~0.60 pooled, per-seed 0.595-0.605), so expect that or lower at a new site. African yam and lentil have only Safari images (88 and 77); finger millet has 38 web images. ONNX (opset 12, fp32, 11.9 MB; mean/std normalisation done outside the graph, input NCHW 224): max abs logit diff vs torch 8.6e-6, argmax identical on 4 random inputs (weak check, not an accuracy check). Not yet INT8-quantised (needs percentile calibration, §40). Qwen-Image-2.1 question (answered from web search, secondary sources, NOT verified against the model card): released 2026-09-20, a 7B diffusion-transformer image GENERATION/editing model, open weights on HF under a research-only licence (commercial use needs a separate Alibaba agreement), RGBA output, multi-reference editing. It is not an image classifier or backbone, so "the same recipe" (fine-tune a classifier on labelled photos, grouped CV) does not apply. Possible uses would be different recipes: (a) synthetic crop images for crops with no web photos (african yam, lentil, finger millet); (b) reference-conditioned edits to make disease variants. Against it: (1) the research-only licence leaves any model trained on its outputs with an unclear status for a nonprofit release; (2) generated images carry generator bias and no field-camera noise, and our own results show the style/domain gap, not data quantity, limits transfer (§17, §32, §46); (3) it cannot run on the M40s without breaking the pinned torch 1.13.1 and the box's ban on eager transformer-style loops, so it would need a rented cloud GPU; (4) whether a generated lesion is a real symptom of that disease would need an expert audit we do not have. Recommendation: not worth it now; fetching more real iNaturalist/GBIF photos (NEXT_ROUND items 2-3) is cheaper, licensed per image, and already shown to work. Revisit only as a small cloud-GPU experiment for the 2-3 crops with zero real photos, with synthetic images used for training only and a real-image test set.
51. Per-crop breakdown of the web-photo gain (2026-10-26) [LOGGED: artifacts/cnn/web_crop/perclass_pc_web_s0_vs_pc_ctrl_s0.json; perclass_breakdown.py, run_perclass_chain.sh; runs cnn_pc_web_s0, cnn_pc_ctrl_s0, GPU0]
Matched seed-0 pair re-run with predictions saved (same test set, n=2,824, site-disjoint folds). Pooled: web 0.605 (CI 0.587-0.623), control 0.536 (0.518-0.554). The control is 0.016 above the §39 seed-0 control (0.520) despite the same seed, so GPU runs are not bit-reproducible and single-run differences of ~0.02 are noise-level. Per-crop recall (control -> web, one seed, per-crop n 94-386 so individual deltas under ~0.05 are not distinguishable from noise): maize 0.135->0.474, cassava 0.000->0.230, groundnut +0.171, banana +0.151, common bean 0.043->0.191, pigeon pea +0.142, wheat +0.095, rice +0.092, potato +0.083; flat: pearl millet +0.033, sweet potato +0.011, finger millet -0.007, sorghum -0.034; worse: cowpea -0.084. Reading: the gain is concentrated in crops that were nearly unrecognised cross-site (maize, cassava, common bean), which is what a style/domain-diversity effect would predict, but this does NOT separate diversity from data quantity (control still open). Cowpea dropping is plausible confusion with the other web-rich legumes; not checked (no confusion matrix yet). Crops still weak after web photos: cassava 0.23, common bean 0.19, wheat 0.36, potato 0.44, maize 0.47. GBIF zero-record investigation (NEXT_ROUND item 2): lentil (Lens culinaris) has 1,882 still-image records but only ~101 HUMAN_OBSERVATION, and in the first 300 results of the matched taxon key (5350010) none had speciesKey equal to it (synonym/subspecies keys), so gbif_fetch.py's speciesKey filter returned 0; only ~32 human-observation records exist at all. Dioscorea rotundata: 84 images, 81 herbarium sheets, 3 field photos. D. alata fetches fine (40/40) but is a different species and not the Safari "african yam". Conclusion: web photos cannot supply these two crops; they need field data.
52. Scaling web photos from 150 to 500 per crop (2026-10-27) [LOGGED: artifacts/cnn/web_crop/web500_s{0,1,2}{.log,_results.json}, gbif500_manifest_no_names.jsonl, perclass_web500_s0_vs_pc_ctrl_s0.json; run_web500_chain.sh; GPU0, ~50 min per seed]
Data: gbif_fetch.py, up to 500 photos/species (6,216 rows after download: 500 for 9 crops, banana..wheat; common bean 427, groundnut 362, rice 345, cowpea 247, chickpea 200, pearl millet 97, finger millet 38; the cap was GBIF supply). Same recipe, test set (n=2,824, site-disjoint) and seeds as §49; the 150/crop set is a different, smaller fetch (its first records largely overlap this one). Pooled accuracy: web500 0.626 / 0.632 / 0.614 (mean 0.624); web150 0.595 / 0.603 / 0.605 (mean 0.601); control 0.536 (seed-0 rerun; §39 run 0.520) / 0.533 / 0.503 (mean of the three §49 controls 0.520). Seeds 0-2 only. The 500 vs 150 gain is +0.023 on means with per-seed values overlapping (web500 s2 0.614 > web150 max 0.605, but web150 s2 vs web500 s2 is the only same-seed margin of ~+0.01); with 3 seeds each and run-to-run noise ~0.01-0.02 (§51), treat it as a probable small gain, not established. Dose-response is monotone but with diminishing returns (0 -> 150: +0.08; 150 -> 500: +0.02). This still does not separate more data from more diverse data (needs the Safari-duplication control). Per-crop (web500 s0 vs pc_ctrl_s0, single seed): maize 0.135->0.556, cassava 0.000->0.310, common bean 0.043->0.319, groundnut +0.244, potato 0.352->0.570, pigeon pea +0.177, banana 0.958; worse: cowpea 0.605->0.454 (-0.151, larger than at 150/crop), finger millet -0.039, sorghum -0.034; wheat only +0.059 (0.320). Licences: of 6,216 rows, 5,634 carry CC BY-NC (4.0) per the manifest's licence field but ~580 have a nonstandard licence string or "all rights reserved" text; these must be filtered before any redistribution (not redistributed here; training-only policy unchanged). The manifest committed has no rightsHolder/recordedBy/path. Correction to §52 (2026-10-27, caught on re-read): the sentence about "the only same-seed margin" was wrong. Same-seed web500 minus web150: s0 +0.031, s1 +0.030, s2 +0.010; all three positive, 3 pairs only (seeds are matched by seed number, not by identical data order). Still too few seeds to call it established; "probable small gain" stands.
53. Data-vs-diversity control: duplicating Safari rows instead of adding web photos (2026-10-27) [LOGGED: artifacts/cnn/web_crop/dup500_s{0,1,2}{.log,_results.json}; run_dup_chain.sh, DUP env in train_cnn_crop_web.py; GPU0]
Closes the open control of §49/§52. Each fold's train set gets NO web photos; instead Safari train rows of each crop are resampled with replacement (training augmentation still applies per draw) up to the same per-crop extra counts as the 500/crop web set (6,216 extra rows; train_n ~8.9k, same as web500; test set and folds identical, n=2,824). Pooled accuracy: 0.529 / 0.532 / 0.518 (mean 0.526) vs no-extra control mean 0.520 (0.536/0.533/0.503 incl. the seed-0 rerun) vs web150 0.601 vs web500 0.624. So the gain from web photos is not explained by seeing more training rows or more gradient steps: matched-volume duplication of in-domain Safari photos gives ~+0.006 (inside seed noise), web photos +0.08 to +0.10. Interpretation limited to this architecture/recipe and 3 seeds: what helps is photo diversity (other cameras, sites, framing), not volume. Caveat: duplication cannot add crops absent from a fold's Safari training rows, whereas web photos can add crops with few Safari images; the test set is restricted to crops seen in Safari training, so that path does not inflate the web result. Per-crop effects of duplication were not examined.
54. Final all-data crop model v2: crop18_web500_v2 (2026-10-27) [LOGGED: artifacts/crop18_web500_v2/{train.log,meta.json,onnx_parity.json,SHA256SUMS,best.pt,crop18_fp32_op12.onnx}; GPU0, ~11 min]
The §50 recipe refit on all rows with the 500/crop web set: 9,365 rows (3,149 Safari + 6,216 web), seed 0, 15 epochs, 18-way head. Train accuracy 0.994 (not a generalisation estimate). Honest estimate is the site-disjoint CV of §52 (~0.62, per-seed 0.614-0.632; applies to the 14 crops with both Safari and web data; african yam and lentil have no web photos and remain Safari-only, so expect them to be weaker). ONNX opset 12 fp32, 11.9 MB, torch vs onnxruntime max abs logit diff 5.8e-6. crop18_web_v1 (150/crop) is kept; v2 is NOT yet wired into the phone page or infer_tiny.py, NOT INT8-quantised, NOT pushed to Hugging Face (left for Caleb to confirm). Only one seed of the final model exists.
55. Label-free target adaptation for the disease CNN: AdaBN and pseudo-labelling (both negative) (2026-10-27) [LOGGED: artifacts/cnn/adabn_{e3_loso_karaagro,e1_pw_ps,e3_loso_makerere}.json, pl_{ctrl,pseudo}_s0{.log,_results.json}; adabn_eval.py, run_pseudo_chain.sh, --init/--pseudo/--pthr added to train_cnn.py; GPU0]
Motivation: field-source disease accuracy is the weak spot (KaraAgro maize 0.80 held out; CCMT maize balanced 0.61 with the web-only model); what has moved it before is more field data from other farms (§30-38), and no new independent labelled field set is available (see audit below), so I tried methods that use only UNLABELLED images from the new farm. AdaBN (re-estimate BatchNorm statistics from N unlabelled target images, no weight change; scored on the remaining rows, 5 random draws, N=50/200/1000). Harness check: the frozen models reproduce the recorded numbers (KaraAgro-held-out 0.801 acc / 0.805 balanced). Change in balanced accuracy vs frozen on the same rows: KaraAgro (held-out model) -0.096 to -0.106; Makerere (held-out model) -0.094 to -0.104; web-only model on Makerere -0.137 to -0.166, on KaraAgro -0.031 to -0.038, on CCMT -0.014 to -0.027 (CCMT maize +0.016 to +0.026, cassava -0.04 to -0.09, other crops about -0.01 to -0.03). Worse almost everywhere; likely because source class balance differs strongly from the training mix and shifts the BN means (not tested). Not a lever. Pseudo-labelling / self-training (KaraAgro held out of labelled training; start from the e3 checkpoint; 4 more epochs lr 3e-4 with the same labelled sources; seed 0 only). Control (continued fine-tune, no pseudo-labels): acc 0.793 [0.763,0.820], balanced 0.800. With 3,028 of 4,404 unlabelled KaraAgro train/val images added at confidence >=0.9: acc 0.768 [0.737,0.797], balanced 0.803. The kept pseudo-labels are 0.878 correct against the (itself noisy, §20) KaraAgro labels, and under-represent the diseased class (58% vs 69% true). No gain on balanced accuracy, accuracy lower; single seed, CIs overlap, so the claim is only "no evidence of benefit". Audit of other public maize/cassava disease sets on Hugging Face (metadata only, nothing downloaded): Project-AgML/maize_disease_classification (CC BY 4.0, 9,356 images, Healthy/MLN/MSV) matches the Makerere set we hold (7,421 of ~9.4k photos; the dataset's "MLN" class corresponds in size to Makerere's "MLB", unverified without downloading); muAtarist/maize_foliar_diseases carries Cedara (South Africa) filenames, i.e. the Pretoria data we already use; the cassava sets listed (Engineer101, yt0609, andrewkatumba) look like the Kaggle cassava data already used (not verified). Conclusion: no accessible independent field set found; this is a metadata-level judgement, not a check of the images. Bottom line: with the current data, the cheap label-free adaptation ideas do not help. The only lever with evidence is new independent field data (other countries, cameras, seasons), which I could not source; crop-specialist heads (maize-only, cassava-only) remain untested.
56. New field data: Tanzania maize, swarm findings, AGY labelling (2026-10-27) [LOGGED: artifacts/cnn/tz_eval.json, cnn_tz_loso_karaagro_s{0,1}.log, artifacts/cnn/agy_safari/{gem,son}.log; tz_build_cache.py, tz_eval.py, run_tz_chain.sh, agy_label_batches.py]
Swarm (3 agents) findings: real independent field sets exist: Tanzania maize (HF, CC BY, 9,356 images, downloaded and verified, 16 parquet shards), Cameroon corn pests and Bangladesh seasonal corn (Mendeley, CC BY, queued, sizes not yet verified), large Tanzanian bean/banana/potato sets, MLD (downloaded). Only new cassava set is small (India). GBIF/iNaturalist pathogen photos are mostly herbarium/lab vouchers, so weak.
Correction to §55: I guessed Project-AgML/maize_disease_classification was a repackaging of Makerere data. Wrong: it is a different Tanzanian farm set (checked after download). Also the CCMT maize "balanced 0.61" per-crop figure in earlier text was affected by a per-crop balanced-accuracy artefact (few diseased rows per crop); read it with that caveat.
Zero-shot on Tanzania maize (majority 0.672): multi-source field models 0.92-0.95; web-only model 0.66 (below majority). The set is easy and in-distribution for field models.
Does adding Tanzania help the weak held-out sources? (KaraAgro held out, 14 epochs, 2 seeds, tanzania added to train): KaraAgro acc 0.768 / 0.822 (mean 0.795) vs baseline e3 0.801 / 0.768 (mean 0.785); CCMT 0.866 / 0.852 vs 0.851 (baseline seed 0); Pretoria 0.55 (unchanged, unusable split). Seed spread (~0.05) exceeds every difference: no measurable benefit for held-out disease accuracy. Tanzania itself is fit at 0.999 (trained on).
AGY labelling of 3,149 Safari photos (weak labels, training-only): Gemini 4 Argon labelled batches b000-b050 and Sonnet 5.5 b000-b025 validly; every later batch FAILED with RESOURCE_EXHAUSTED 429 individual quota (Sonnet resets in ~3 h, Gemini in ~105 h). Consensus on the 520 doubly-labelled photos: health agrees on 439 (84%, lower than the 94% on the pilot, these photos are harder/farther); condition agrees on only 50 of the diseased agreements. That is too little and too noisy to add to a 38k-row training set, so no training run used these labels. Not claimed: any accuracy gain.
Bottom line: the two directions tried tonight for disease accuracy (more same-region maize; AI weak labels) show no gain. Cassava and cross-country sets remain the untested lever. GPU reservation released.
57. AGY-consensus Safari weak labels as training data (2026-10-27) [LOGGED: artifacts/cnn/cnn_agy_loso_karaagro_s{0,1}.log; agy_safari_cache.py, run_agy_chain.sh]
Per Caleb's instruction, the 439 Safari photos where Gemini and Sonnet agree on healthy/diseased (316 healthy, 123 diseased; condition kept only for the 50 where they also agree) were added to training (29,974 rows vs 29,535). KaraAgro held out, 14 epochs, seeds 0/1. KaraAgro acc 0.802 / 0.758 (mean 0.780) vs baseline 0.801 / 0.768 (mean 0.785); CCMT 0.856 / 0.854 vs 0.851 / ~0.85. No measurable effect (seed spread ~0.05; 439 weak-label rows are 1.5% of training). Remaining 2,700 photos unlabelled because of the AGY quota; labels remain weak and training-only.
58. Before/after on a held-out portion of the AGY-labelled Safari photos (2026-10-27) [LOGGED: artifacts/cnn/cnn_agyho_{before,after}_s{0,1}.log; agy_safari_cache.py (HO=0), run_agy_ho_chain.sh]
Design: the 439 consensus-labelled photos split by Safari site fold: fold 0 (142 photos, 31 diseased) held out and never trained on; 297 photos train the "after" runs. All runs: KaraAgro also held out, 14 epochs, seeds 0/1, same recipe; "before" = no AGY rows. Held-out Safari fold (healthy/diseased vs the consensus label; majority class 0.782): before 0.796 / 0.768 (mean 0.782), after 0.838 / 0.831 (mean 0.835), +5.3 points; both "after" seeds above both "before" seeds, but n=142 CIs are wide (~[0.72,0.85] vs [0.76,0.89]) and overlap. Balanced acc 0.683/0.665 -> 0.745/0.718. KaraAgro (human labels, independent): before 0.798 / 0.773 (0.786), after 0.767 / 0.803 (0.785): no change. CCMT 0.862/0.855 -> 0.862/0.848: no change. Caveats: held-out labels are AI consensus on photos where both models agreed (easier subset, label noise unknown, so this measures agreement with the labellers, not truth); the gain is within-domain (same Safari stations/cameras), which fits the earlier finding that only same-domain data helps; it does not transfer to KaraAgro/CCMT.
59. Ecuadorian Amazon field photos, Claude-labelled, before/after (2026-10-27/28) [LOGGED: artifacts/cnn/cnn_ecu_{before,eco,ecocac}_s{0,1}.log; ecuador_fetch.py, ecuador_prep.py, ecuador_validate.py, ecuador_cache.py, cacao_ec_cache.py, run_ecuador_chain.sh; labels/ecuador_amazon/]
Data: GBIF/iNaturalist StillImage records, Ecuador Amazon polygon; 1,338 crop/agroforestry photos (30 taxa) + 2,000 random wild plants (the wild ones NOT labelled). No public disease-labelled Amazon set exists; the only one is a small cacao pod set (HF OtroGuille/Dataset_Cacao_Ecuador, 238 usable, provenance unverified, may not be Amazonian).
Labels: 1,318 crop photos by Claude (Sonnet) labellers, schema R1-R8, ~25% second-labeller overlap. Tranche 1 kappa 0.37-0.55 (no threshold for "diseased") -> added R8; later pooled health3 kappa 0.777 (92.9% agree), healthy-vs-diseased kappa 0.729 among usable (96.1%). Result 1,083 healthy / 101 diseased / 134 unusable. Same-model-family labellers, weak labels, not ground truth. Defects: A_p13 claimed 30 lines, wrote 28 (re-labelled 2); a stale validator run; free-text licence strings with creator names normalised before commit.
Training set (conf >= 0.5, A/B agree): 1,068 rows; train 799 healthy + 33 diseased, held out (by photographer hash) 218 healthy + 18 diseased. Low-confidence filtering dropped ~half the diseased, so training skews to obvious disease.
Process note: a stray gpusched wait task launched a second copy of the chain at 23:57; killed by PID within a minute, the other chain's logs were intact (all 6 runs exit 0).
Results (2 seeds each; seed0 / seed1):
| cond | ecuadorho acc (n=236, 18 diseased; majority=0.924) | ecuadorho bal | KaraAgro acc | CCMT acc |
| before | 0.758 / 0.775 | 0.716 / 0.726 | 0.788 / 0.784 | 0.875 / 0.850 |
| +ecuador | 0.886 / 0.894 | 0.658 / 0.637 | 0.801 / 0.768 | 0.862 / 0.840 |
| +ecuador+cacao | 0.873 / 0.915 | 0.727 / 0.725 | 0.806 / 0.779 | 0.873 / 0.849 |
Reading: raw held-out accuracy rises ~12-14 points, but every run is BELOW the always-healthy baseline (0.924), and balanced accuracy is flat or lower (eco) / flat (ecocac). The gain is the model learning that Amazon field photos are mostly healthy, not better disease detection; with 18 diseased rows nothing about disease recall can be claimed. KaraAgro (mean 0.786 / 0.785 / 0.793) and CCMT (0.863 / 0.851 / 0.861): no change, within seed noise. Consistent with §57-58: only same-domain data moves same-domain accuracy, and it does not transfer.
Conclusion: no evidence this data improves disease diagnosis on the key crops. Useful as a healthy-field-photo source; needs expert-verified disease labels (and far more diseased examples) to matter.
60. Zero-shot Qwen3.5-2B vision on maize photos (2026-11-05) [LOGGED: artifacts/qwen35_zeroshot/{run.py,results.jsonl,meta.json}]
Why: Roger (ai-ag-assistant-dev) asked whether AgriVision should be folded into the Qwen3.5 weights. Test: does the base Qwen3.5-2B (NobodyWho GGUF Q8_0 + mmproj-BF16, llama.cpp server on GPU0, no transformers, thinking off, temp 0) tell healthy from diseased maize with no training? Roger's fine-tuned natural-farming-v5 is text-only in Cactus format and was NOT tested; this is the base vision model. Set (seeded, balanced): Tanzania maize 40 healthy / 40 MLN / 40 MSV; KaraAgro 30 healthy / 30 FAW / 30 MSV. 210 photos, 768 px max side, ~1.6 s each. One prompt asking for JSON crop/status/problem. 0 parse failures. Results (healthy vs diseased; majority baseline 0.667 on both sets because of the balanced 1:2 design):
- Tanzania n=120: acc 0.717 [0.63, 0.79], healthy recall 38/40, MLN 34/40, MSV 14/40, balanced 0.775.
- KaraAgro n=90: acc 0.711 [0.61, 0.80], healthy 29/30, FAW 27/30, MSV 8/30, balanced 0.775.
- Crop named maize/corn: 187/210 (89%); one healthy Tanzania leaf came back "banana". Reading: zero-shot it finds obvious damage (necrosis, armyworm) and misses maize streak virus (22 of 70 right), calling it healthy. On KaraAgro it is near the field-trained CNN held out (balanced 0.805 vs 0.775, CIs overlap). On Tanzania it is well below the field-trained CNNs (0.92-0.95 on all 9,356, trained without Tanzania, see §56). Different subsets (210 sampled vs full sets), so only a rough comparison. Not shown: whether fine-tuning Qwen on our data would close the gap; phone speed (this ran on an M40 in ~1.6 s/photo, a Pixel 7 will be much slower); prompt sensitivity (one prompt tried). Implication for the question: Qwen3.5-2B is a plausible second opinion and chat layer, not a substitute for the small classifiers. Keeping them separate and passing the classifier output to Qwen as text remains the plan. GPU reservation released, server killed by PID.