Evaluating Few-Shot Prompting of Gemma-4 Models for Fertilizer Timing and Spatial Deficiency Detection
Aryan Hemdev
Abstract
Fertilizer management in precision agriculture requires decisions about both when to apply fertilizer and where it may be needed within a field. This study investigates the performance of vision-language models (VLM) for 2 separate tasks: fertilizer timing and spatial deficiency detection. The temporal model uses structured information describing structured crop, soil, fertilizer, and weather to classify fertilizer application timing. The spatial model analyzes field imagery to identify regions associated with nutrient deficiency. Three Gemma-4 model variants were evaluated under multiple few-shot prompting conditions. For temporal recommendation, 75 records were reserved for evaluation, and 32 additional records were available as few-shot examples. Classification accuracy was evaluated from zero-shot to 30-shot prompting. The highest observed temporal accuracy was 89.33% (95% confidence interval [CI]: 80.3–94.5%), achieved by Gemma-4 e4b-mlx at both 25-shot and 30-shot prompting. For spatial deficiency detection, 30 image tiles were evaluated using a 16 × 16 grid representation, while 10 additional tiles were available as few-shot examples. The reported average cell-level accuracy reached 68.49% for Gemma-4 e2b at 8-shot prompting and for Gemma-4 12b at 2-, 4-, and 6-shot prompting, but this only matched a baseline that flags no cells. Gemma-4 e2b at 2 shot prompting showed the highest F1 score of 39.3% and highest IoU of 24.5%. Across both tasks, additional examples did not consistently improve accuracy. These experiments provide an initial evaluation of VLMs for complementary fertilizer-management decisions. The results should be interpreted in light of the dataset sizes, annotation procedures, and evaluation metrics used.
