# L13 Neighbor-aware negative prompts

Status: preliminary experiment ready for review. [View the examples](../results/l13/) or [download measurements](../results/l13/neighbor-corrections.json). Reproduce using `YOLO_CONFIG_DIR=/tmp/diatom-yolo-config MPLCONFIGDIR=/tmp/mpl-diatom PYTHONDONTWRITEBYTECODE=1 /tmp/diatom-research-venv/bin/python research/l13_neighbor_prompt.py` and the MobileSAM checkpoint from R6.

For each of the 14 user-marked crossing candidates previously processed in R6, inspect the original positive-click mask for another provisional possible-diatom mark on the same focal plane. For each eligible mask, select the nearest such mark as a negative point and run MobileSAM with the original positive point and that negative point. Six masks met the rule. The remaining eight had no other same-plane possible-diatom marks inside the original mask. All points were supplied by the user; this is a simulated prompting strategy, not automatic specimen detection.

The revised mask excluded the chosen negative point in four of six cases and retained the positive point in all six. Summed across the six masks, the number of other same-plane provisional marks lying inside dropped from 18 to eight. These counts include repeated marks across overlapping masks and describe geometric prompt compliance, not specimen-level precision or recall. Some masks still include multiple candidates; one revised mask is only a small piece of the target-like region. The algorithm assumes two marks are different objects, which has not been checked by a specialist. A negative point can be placed on the target specimen itself.

Next compare this one-neighbor policy against user-chosen corrections and explicit boxes on independently annotated crowded fields. Measure full instance recovery, target loss and interaction time. Preserve the original and revised masks side by side and allow the user to undo a correction. Avoid presenting coordinate exclusion as a validated biological separation.
