Expand operator samples for YOLO hard negatives
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-07 21:42:23 +02:00
parent e8d79fccbb
commit 89c5729d33
8 changed files with 288 additions and 23 deletions
+37 -12
View File
@@ -175,13 +175,18 @@ To prepare the documented operator samples reproducibly inside the all-in-one
runtime container, run:
```bash
docker exec -it geointel python /app/scripts/prepare_operator_real_data_samples.py --samples geel,mol,turnhout
docker exec -it geointel python3 /app/scripts/prepare_operator_real_data_samples.py
```
This writes GeoTIFF/GeoJSON pairs and `operator_samples_manifest.json` under
`/app/storage/operator-data` inside the container, which maps to
`storage/operator-data` in the Tower appdata checkout. The helper fetches only
the explicit documented AOIs, records Digitaal Vlaanderen attribution and
`storage/operator-data` in the Tower appdata checkout. The default corpus
contains reference AOIs for Geel, Mol, Turnhout, Herentals, Balen, Retie and
Westerlo plus background candidates for Postel-bos, Lommel-heide and
Kasterlee-bos. Normal reference AOIs still fail when GRB returns no buildings;
background candidates are explicitly marked with `sample_role` and may write an
empty reference FeatureCollection for negative-tile training. The helper fetches
only the explicit documented AOIs, records Digitaal Vlaanderen attribution and
reuses existing files by default. Use `--force` only when the local runtime
artifacts should be regenerated.
@@ -308,11 +313,11 @@ with overlapping raster windows:
```bash
docker exec -it geointel python3 /app/scripts/export_operator_yolo_tile_dataset.py \
--manifest-path /app/storage/operator-data/operator_samples_manifest.json \
--output-dir /app/storage/operator-data/yolo-building-tile-dataset \
--tile-size 192 \
--stride 96 \
--negative-keep-ratio 0.5 \
--val-samples turnhout \
--output-dir /app/storage/operator-data/yolo-building-tile-expanded160 \
--tile-size 160 \
--stride 80 \
--negative-keep-ratio 1.0 \
--val-samples turnhout,retie,kasterlee_bos \
--force
```
@@ -328,18 +333,38 @@ output directory:
```bash
docker exec \
-e OPERATOR_YOLO_DATASET_DIR=/app/storage/operator-data/yolo-building-tile-dataset \
-e OPERATOR_YOLO_DATASET_DIR=/app/storage/operator-data/yolo-building-tile-expanded160 \
-e YOLO_BASE_MODEL_PATH=/app/models/yolov8n.pt \
-e TRAIN_MODEL_OUTPUT_PATH=/app/models/geointel-building-tile-detector.pt \
-e TRAIN_EPOCHS=30 \
-e TRAIN_OUTPUT_DIR=/app/storage/training/operator-yolo \
-e TRAIN_RUN_NAME=geointel-building-yolov8n-expanded160e50 \
-e TRAIN_MODEL_OUTPUT_PATH=/app/models/geointel-building-yolov8n-expanded160e50.pt \
-e TRAIN_EPOCHS=50 \
-e TRAIN_IMGSZ=256 \
-e TRAIN_BATCH=4 \
-e TRAIN_BATCH=8 \
-e TRAIN_WORKERS=0 \
-e TRAIN_DEVICE=cpu \
-e PYTHON_BIN=python3 \
geointel bash /app/scripts/train_operator_yolo_detector.sh
```
Benchmark any trained candidate through the same persisted QA/QC matrix before
using it operationally:
```bash
OPERATOR_SAMPLE_MANIFEST_PATH=storage/operator-data/operator_samples_manifest.json \
OPERATOR_SAMPLE_SLUGS="geel mol turnhout retie kasterlee_bos" \
QUALITY_MODEL_ASSET_IDS="geointel-building-yolov8n-expanded160e50-pt geointel-building-yolov8n-tile30-pt yolov8s-building-segmentation-pt" \
QUALITY_TILE_SIZES="640" \
QUALITY_TILE_OVERLAPS="64" \
QUALITY_THRESHOLDS="0.25 0.15 0.05" \
MULTI_SAMPLE_OUTPUT_DIR=artifacts/detection-quality-matrix/multi-sample/expanded160e50-live \
bash scripts/run_multi_sample_detection_quality_matrix.sh http://192.168.10.150:1202
```
The expanded 50-epoch candidate improved dense Geel/Mol/Turnhout/Retie scores,
but the sparse Kasterlee-bos run still showed too many false positives. Treat it
as the best current experimental dense-AOI candidate, not as a V1 default.
Export calibration QA evidence for visual review:
```bash