# 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/store1` both ~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 patch `patches/d1-trunk-export.patch` (17 added lines; sha256 `1762655d...13535`; verified to apply cleanly to `de7fa0a`). 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)}.gguf` from `LiquidAI/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.onnx` sha256 `4ee74a60...2c73`; `best.pt` `ea16ce6b...eef8`; heads and features have `SHA256SUMS` files. Copies re-hashed byte-identical (detector); feature backup `~/agri_feats_backup_20261008.tar` restore-verified 51/51 files. - **Compute-safety rules followed:** every GPU job under a `gpusched` reservation, pinned with `gpu0run`, thermal guard scoped to the job's own PID (limit 90–91 °C; peaks seen: 86 °C d1 inference, 83 °C detector training). No transformers `generate()` 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:** `/annotations//standard///` (Safari) and `Artemis//annotations////`. 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.py` class 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_plant` class 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//images///.jpg` (sites/dates per crop in `safari_sites_dates.json`, e.g. maize 5 sites/84 dates, sorghum 6/290, cowpea 3/169, sweet potato 3/207). **Artemis** paths: `Artemis//images//////.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_presence` 73,801; `pod_count` 26,002; `open_flower_count` 8,857; `plant_stand` 1,235; **`disease_score` 1,144** (two scales mixed: values 2–6 and 20–95); **`cbb` 364** (values 3–7, 1–9 scale); `disease_presence` 64; `als` 2. 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; cowpea `cowpea` and `cowpea_plant` merged). **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/systemone` with the image as a data URL; questions: `crop` (choice: 12 crops + "none or unclear"), `plant_visible` and `diseased` (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_norm` trunk state at each output row (n_embd_out 3→1027); `D1_DUMP_PATH` appends `[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_visible` returned 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: `feat` and `feat+logit` within each other's CIs; `logit`-only clearly weaker; headline uses `feat` (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.onnx` test mAP within 0.003 of torch. - Android: patched `llama-server` cross-compiles (aarch64 ELF, API 28, 185 MB unstripped). **Not run.** ## 5. Negative / null results (keep — they belong in the paper) 1. **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. 2. **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%). 3. **Crop ID head does not generalise to the Artemis campaign** (cowpea 1%, sorghum 8%). 4. **TFLite export failed** four times with two architectures (onnx2tf 1.22.3 + TF 2.15.1: YOLO11n at `/model.23/Mul_2` and 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. 5. **CCMT not obtainable by script;** DLCPD-25 Baidu-only; AgriPest never released. 6. **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/`); 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.py` crashed 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.py` preserved for audit; logs `head_crop.log`, `head_disease.log` are 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" in `docs/MODEL_CARD.md`. - **C7.** `diagnose.py` first run failed to parse its own JSON because my shell filter `grep -v warn` removed 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.id` is `cc-by-4.0`. We cite the Zenodo record. PlantWild NC-ND confirmed from HF API metadata. - **C10.** `AGENT-REPORTED` size 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 `/proc` command-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.py` first run crashed on `r.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.py` was refactored (wrapped in `__main__`) *after* the extraction run so `diagnose.py` could 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) 1. **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. 2. **KaraAgro healthy/FAW/MSV field-maize heads** with region (GPS) held-out splits; check duplicates/neighbours; use as field-healthy negatives for T2. 3. Artemis-bean `disease_score`/`cbb` ordinal regression, **grouped by plot**, with metadata-only baseline (variety/date/viewpoint) to test shortcuts. 4. Detector v2: imgsz 960/1280, size-stratified recall, plus Safari instance/pseudo-instance sets converted to boxes for more crops (**GPU**). 5. d1 features per detected crop (patch-level, not whole canopy) to avoid mixed-content images. 6. MLP head, probability calibration, abstention thresholds; multiple seeds + bootstrap CIs; sensitivity of T3 to the keyword map. 7. Tier-B trunk LoRA/fine-tune (**needs PI's explicit approval; GPU; hand-written LFM2 forward since transformers is banned on the M40s**). 8. Android device latency/memory (needs device); ONNX Runtime Mobile for detector, patched llama.cpp for d1. 9. 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 heads `186b2d0`, `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/CropAndWeed` 11.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/CCMTDataset` is 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=6` Plantae, `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 1. **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. 2. 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. 3. 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). 4. 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_v1` split (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); kernels `agri-det-v2-smoke-20261009` (1 epoch, 5% data) then `agri-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 onnx` backtracked 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/input` and 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_session` at 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) with `TORCH_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; added `onnxscript` to the kernel's installs for the full run. - **Local compatibility checks (CPU, torch 1.13.1 + ultralytics 8.3.0):** the Kaggle-trained `best.pt` loads 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, upload ~0.9-1.5 MB/s (~46 min); the dataset also contains stale ultralytics `*.cache` label 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: `roboflow.ai`; filenames `-