betaFeedback

WorksComputer Science

Decoding Frozen Vision Representations for Training-Free Few-Shot Pineapple Detection

Abstract

Few-shot object detection in agricultural imagery is hampered by dense vegetation, repeated patterns, and scarce annotations. We present a training-free detector that turns dense features from frozen visual foundation models directly into detections, without fine-tuning, a learned head, or external proposals: a whitened foreground-background direction estimated from annotated support images scores every query patch, and the score field is decoded with an adaptive threshold and support-derived geometry. We also test whether predicted relative depth can be fed directly to RGB-pretrained frozen encoders. On aerial pineapple imagery, the detector outperforms PET-DINO and GeCo2 at every evaluated support size; at K=40, predicted depth alone reaches 92% of the RGB performance with DINOv2, and RGB-depth fusion lowers counting error for both encoders. We release the Pineapple Plantation dataset (4,908 aerial frames, 1,995 annotated with 17,609 boxes, predicted depth, leakage-aware splits) and analyse transfer to two further agricultural datasets.

Introduction

Accurate crop counts are important for production forecasting, loss estimation, and harvest planning in large-scale agriculture. Pineapple cultivation is a particularly relevant setting: large volumes of imagery can be collected through low-altitude Unmanned Aerial Vehicle (UAV) flights, but manually annotating every plant remains costly [10, 20]. Pineapple crowns are also difficult to localize because they are embedded in dense foliage, partially occluded, and visually similar to the surrounding leaves. At the studied commercial plantation (Upala Agricola, one of the world’s largest exporters of fresh pineapple) in Costa Rica, counts are estimated by workers traversing selected field lines covering approximately 2–3% of the plantation. Our UAV flights at approximately 2 m were designed to emulate this sampling process while preserving the close-range view needed to distinguish individual crowns.

Figure 1. Training-free few-shot detection using frozen RGB+depth features. KK annotated support images define foreground/background patch prototypes whose similarity field localizes objects in unseen queries, without fine-tuning or learned detection heads. At K=40K=40, our method achieves 1.5× the Intersection over Union (IoU) F1 of the strongest baseline, while RGB+depth fusion reduces count Mean Absolute Error (MAE) for both encoders.

Reliable counting requires identifying individual plants rather than only estimating image-level density, we formulate the problem as few-shot Object Detection (OD): localize each pineapple crown from a small annotated support set and derive counts from the resulting detections.

Recent Visual Foundation Models (VFMs), including self-Distillation with NO labels (DINOv2) [14] and Agglomerative Model–Reduce All Domains Into One (AM-RADIO) [9, 17], provide transferable dense representations. Few-shot methods such as Prompt-Enriched Grounding DINO (PET-DINO) [6] and Generalized-Scale Object Counting (GeCo2) [16] exploit visual prompting for detection and counting, but rely primarily on red–green–blue (RGB) appearance, which can be ambiguous in dense vegetation. Although frozen visual representations encode geometric information, whether predicted depth can improve detection when processed by RGB-pretrained frozen encoders remains unclear.

We study whether frozen dense features can support few-shot pineapple detection and counting directly, while examining whether predicted depth provides complementary geometric information within the same frozen feature space. We evaluate DINOv2 [14] and AM-RADIO [9, 17]. From annotated support images, foreground and background patches are identified at multiple box-interior scales and summarized into a covariance-whitened prototype direction. Applying this direction to each query patch yields a spatial score field, which is separated with a support-selected two- or three-population Otsu criterion [15] and converted into individual detections using support-derived geometry. No query annotations, gradient updates, learned detection head, or external proposal model are required.

Each aerial image may contain multiple crowns, so we define the few-shot setting in terms of support images rather than individual object instances. Because RGB appearance can be ambiguous under dense foliage, we evaluate RGB, predicted relative depth, and RGB+depth fusion to determine how much geometric information can be exploited by frozen RGB-pretrained encoders for detection and counting. We test transfer to two additional agricultural datasets.

The main contributions are:

  • A training-free few-shot detector that converts frozen dense features directly into object detections and counts, without a learned head or external proposals.

  • A study of predicted relative depth as input to RGB-pretrained frozen encoders, including depth-only and RGB–depth fusion without cross-modal adaptation.

  • The Pineapple Plantation Dataset, comprising 4,908 aerial frames, including 1,995 annotated frames with 17,609 boxes, predicted depth, and leakage-aware splits.

  • An evaluation showing improved pineapple counting and detection over PET-DINO and GeCo2, scalability with additional support, domain-dependent transfer, and encoder-dependent benefits from RGB–depth fusion.

Related Work

Object Detection and Few-Shot Learning. Classical OD includes two-stage detectors such as Faster R-CNN [19] and single-stage detectors such as YOLO [18], both typically requiring substantial annotation. Few-shot learning reduces this burden by adapting from few examples, as in feature reweighting [11], two-stage fine-tuning [24], and prototype-based methods [22]. For detection, however, class recognition must also be coupled with localization.

Dense Representations and Foundation Models. Self-supervised transformers expose dense semantic and spatial structure [3]. LOST [21] and TokenCut [25] exploit this structure for unsupervised object discovery, while DINOv2 [14], AM-RADIO [17], and RADIOv2.5 [9] provide more general dense representations. These works motivate direct localization from frozen feature grids, but mainly address class-agnostic discovery rather than few-shot localization of a target class.

Few-Shot and Training-Free Detection. FS-DETR [2] and DE-ViT [30] use visual examples for few-shot detection without novel-class retraining. More recent approaches include PET-DINO [6] and GeCo2 [16], while Matcher [13] and ProtoSAM [1] combine frozen features with segmentation mechanisms. Training-free detection has also been explored with external proposal models such as Segment Anything Model (SAM) [4], frozen proposal classifiers [5], and direct training-free detection [27]. In contrast, our method operates directly on dense frozen features without an external proposal model or learned detection head.

Precision Agriculture. OD supports fruit detection, crop monitoring, and yield estimation [10, 20]. Agricultural appearance varies across crops, locations, acquisition conditions, and growth stages, and object-level annotation is costly to repeat. Few-shot and training-free approaches are therefore attractive for adapting detectors to new agricultural settings.

The Pineapple Plantation Dataset

The Pineapple Plantation Dataset is a temporally structured benchmark for few-shot object detection and counting in dense agricultural scenes. In commercial plantations, pineapple counts support plant-loss estimation and harvest planning and are commonly obtained through manual field sampling. To emulate this process, low-altitude UAV flights were conducted at approximately 2 m over a commercial pineapple plantation [28], preserving the close-range view needed to distinguish individual crowns. The dataset contains 4,908 aerial RGB frames, including 1,995 annotated frames with 17,609 pineapple bounding boxes, together with predicted relative-depth maps from Depth Anything v2 [29]. The imagery, annotations, depth maps, leakage-aware splits, and evaluation protocol are publicly available.

Annotations were manually created using Label Studio [23] by trained annotators without model assistance. Plants were labeled if crowns were fully or partially visible with identifiable foliage, while severely occluded plants were excluded. Lead authors performed a final quality check to ensure accurate box alignment and eliminate errors.

To reduce temporal leakage, each flight is divided into 60-frame blocks assigned to training, validation, or test, discarding 20-frame buffers and cross-session revisits. The resulting splits contain 3,536 training, 381 validation, and 346 test frames, including 1,500, 115, and 155 annotated frames with 14,097, 769, and 1,083 boxes, respectively. Evaluation uses fully annotated validation and test frames. Support images are sampled from distinct capture blocks to reduce the likelihood of observing the same plants across shots.

The dataset poses two challenges for counting: pineapple crowns have highly similar appearance to surrounding foliage, and they are frequently partially occluded by leaves, producing strong foreground–background ambiguity.

Methodology

Problem Setting and Overview

As illustrated in Figure 2, the proposed method follows a support-conditioned, training-free detection framework. An episode consists of a support set SK={(InR,InD,Bn)}n=1KS_K = \{(I_n^R, I_n^D, B_n)\}_{n=1}^{K}, where InRI_n^R denotes the RGB image, InDI_n^D its aligned depth map, and BnB_n the corresponding object bounding-box annotations. The support set accompanies unannotated query images from the same domain, for which the goal is to predict a set of bounding boxes.

Figure 2. Overview of the proposed training-free detector. Support annotations define a foreground–background prototype from a frozen encoder. The prototype is applied to the query image to produce a score field through dot-product similarity; an adaptive Otsu threshold separates foreground, and support-derived geometric information converts the resulting regions into bounding boxes. No fine-tuning or learned detection head is required.

A frozen encoder maps each image to a G×GG \times G grid of DD-dimensional patch tokens zij∈RDz_{ij} \in\mathbb{R}^{D}; class and register tokens are discarded. The frozen encoders are DINOv2-B with registers at 448×448448 \times448 and AM-RADIO v2.5-B at 512×512512 \times512, both producing a 32×3232 \times32 token grid (G=32G = 32). Depth maps hold relative depth scaled per image to 8 bits, brighter is nearer (min–max for Depth Anything v2, 1st–

99th percentile for Depth Anything 3); they are replicated across three channels and encoded exactly like RGB images, including the encoder’s input normalization. Tokens from each modality are ℓ2\ell_2-normalized; for RGB+D, the two token grids are concatenated and normalized again. The support annotations then define a prototype direction (Sec. 4.2) that turns each query into a score field, which is thresholded per image (Sec. 4.3) and converted into boxes with support-derived geometry (Sec. 4.4); Figure 2 summarizes these stages.

No gradient is computed, and no encoder or detector parameters are learned. All episode-specific quantities are estimated from the support set and refitted whenever it changes. The foreground threshold, however, is recomputed for every query image to account for image-to-image variation in illumination, plant density, and visible background.

Support-Conditioned Prototype

Patches near the center of an annotated box are more likely to describe the pineapple itself, whereas boundary patches often mix the plant with surrounding vegetation. To account for this variation, each ground-truth box defines concentric inner rectangles whose areas correspond to fractions a∈A={0.25,0.50,1.00}a \in\mathcal{A} = \{0.25, 0.50, 1.00\} of the original box. A patch whose center lies inside one of these rectangles is labelled as foreground at scale aa, forming Pa\mathcal{P}_a. Patches outside the foreground rectangle but inside the corresponding box enlarged by a factor of 1.15 are discarded as ambiguous. Patches outside all enlarged boxes form the background set N\mathcal{N}, shared across scales. The labelled descriptors at scale aa are La=Pa∪N\mathcal{L}_a = \mathcal{P}_a \cup\mathcal{N}.

A simple prototype could use the mean difference μa+−μa−\mu_a^+ - \mu_a^-. However, pineapples and surrounding vegetation share strong visual characteristics, particularly leaf appearance, so directions with large variation in both groups can receive excessive importance. We therefore account for the covariance of the labelled descriptors. The direction is computed independently at each foreground scale, normalized, and averaged across scales:

p=1∣A′∣∑a∈A′n⁡(Σ~a−1(μa+−μa−)),(1)\mathbf{p} = \frac{1}{\lvert\mathcal{A}'\rvert} \sum_{a \in\mathcal{A}'} \operatorname{n}\left(\widetilde{\boldsymbol{\Sigma}}_a^{-1}\left(\boldsymbol{\mu}_a^{+}-\boldsymbol{\mu}_a^{-}\right)\right), \tag*{(1)}

where μa±\boldsymbol{\mu}_a^{\pm} are the means of Pa\mathcal{P}_a and N\mathcal{N}, n⁡(⋅)\operatorname{n}(\cdot) denotes ℓ2\ell_2 normalization, Σ~a\widetilde{\boldsymbol{\Sigma}}_a is the regularized covariance of La\mathcal{L}_a, and A′⊆A\mathcal{A}' \subseteq\mathcal{A} retains the scales for which Pa\mathcal{P}_a is non-empty.

Because covariance is estimated from a limited number of support descriptors, poorly estimated directions can become overemphasized after inversion. We therefore regularize Σa\boldsymbol{\Sigma}_a by shrinkage toward a scaled identity matrix:

Σ~a=(1−αa)Σa+αatr⁡ΣaDI,αa=DD+∣La∣.(2)\widetilde{\boldsymbol{\Sigma}}_a = (1-\alpha_a)\boldsymbol{\Sigma}_a + \alpha_a \frac{\operatorname{tr}\boldsymbol{\Sigma}_a}{D}\mathbf{I}, \qquad\alpha_a = \frac{D}{D+\lvert\mathcal{L}_a\rvert}. \tag*{(2)}

The weight αa\alpha_a depends only on support-set information: with fewer labelled descriptors, regularization is stronger; as more support descriptors become available, more weight is given to the estimated covariance.

Each query patch receives the scalar score sij=zijTps_{ij} = \mathbf{z}_{ij}^{\mathsf{T}}\mathbf{p}, measuring its alignment with the support-conditioned prototype. These scores form a field S∈RG×G\mathbf{S} \in\mathbb{R}^{G \times G}.

Per-Image Foreground Separation

The score field S\mathbf{S} indicates how strongly each query patch aligns with the prototype. Because illumination, vegetation density, and visible background vary across images, an image-specific threshold is estimated independently for every query image using Otsu’s criterion [15].

Otsu partitions the scores into either C=2C=2 or C=3C=3 ordered groups. With C=2C=2, the scores are separated into background and foreground. With C=3C=3, an additional low-scoring background population, such as bare soil or sky, can be separated while preserving the highest-scoring group as foreground.

For either value of CC, Otsu determines C−1C-1 ordered boundaries t1<⋯<tC−1t_1 < \cdots< t_{C-1}. The highest boundary serves as the foreground threshold,

τO=tC−1,Mij=1[sij≥τO],(3)\tau_{\mathrm{O}} = t_{C-1}, \qquad M_{ij} = \mathbf{1}\left[s_{ij} \geq\tau_{\mathrm{O}}\right], \tag*{(3)}

where M\mathbf{M} is the resulting binary foreground mask. The choice between C=2C=2 and C=3C=3 is calibrated once on the support set at the beginning of each episode. Both alternatives are evaluated on the support images, and the configuration whose detections best reproduce the support annotations is retained, preferring C=2C=2 in case of a tie. The selected CC remains fixed for the episode, while τO\tau_{\mathrm{O}} is recomputed for every query image.

From Regions to Pineapple Instances

The binary mask identifies foreground patches but not individual pineapples: a single plant can form several disconnected regions, and some regions may still be false detections. The support set therefore provides object-scale and shape information for instance formation.

The median side length of the support boxes defines the typical object scale δ\delta on the G×GG \times G patch grid. A shape cost compares each candidate region with the support-box geometries. Let w\mathbf{w} denote the width and height of a candidate region and wb\mathbf{w}_b those of support box bb:

dS(w)=min⁡b∈BS∥log⁡(w/wb)∥2,(4)d_{\mathrm{S}}(\mathbf{w}) = \min_{b \in\mathcal{B}_{\mathrm{S}}} \left\lVert\log(\mathbf{w}/\mathbf{w}_b) \right\rVert_2, \tag*{(4)}

where lower values indicate greater similarity to the support geometry.

Each connected foreground region is a candidate instance. Disconnected regions separated by fewer than δ\delta cells are merged when their union provides a better geometric match than either region. The support-derived geometry therefore reconnects fragmented responses from the same plant.

Each resulting region rr is converted into a bounding box. Let wrA\mathbf{w}_r^{A} and crA\mathbf{c}_r^{A} denote the size and centre of the box enclosing its foreground activation. Matched support regions provide a median size correction γˉ\bar{\gamma} and normalized centre offset Δˉ\bar{\Delta}:

w^r=wrA⊙γˉ,\widehat{\mathbf{w}}_r = \mathbf{w}_r^{A} \odot\bar{\gamma},
c^r=crA+Δˉ⊙w^r.(5)\widehat{\mathbf{c}}_r = \mathbf{c}_r^{A} + \bar{\Delta} \odot\widehat{\mathbf{w}}_r. \tag*{(5)}

The corrected boxes are clipped to the image boundaries. Finally, candidate boxes are filtered using support-calibrated geometry and score prominence. The geometric acceptance threshold is selected to maximize support-set box F1. A region rr that fails it is still kept when its score peak is prominent, i.e. when

(max⁡(i,j)∈rsij−τO)(max⁡i,jsij−τO)\frac{\left(\max_{(i,j)\in r} s_{ij}-\tau_{\mathrm{O}}\right)}{\left(\max_{i,j} s_{ij}-\tau_{\mathrm{O}}\right)}

reaches the 15th percentile of the same ratio over the support objects. Thus, the final detections are obtained entirely from support-derived appearance and geometry, without query annotations.

Experiments

Protocol

Every result is an average over five paired support draws. A draw fixes one episode, a set of KK support images and their boxes, and all methods are scored on exactly that episode, so differences between methods never reflect differences between support sets. In each episode, KK support images are sampled from the training partition, and all held-out test images (PhenoBench: official validation set) serve as queries. Each support and query image is one fixed 544×544544 \times544 crop: the central full-height crop of a 960 × 544 pineapple frame (keeping boxes centred inside it and at least 35% visible), the 1024 × 1024 content window of AmodalAppleSize, or the full PhenoBench image, both resized to 544. No validation or test annotation contributes to prototype estimation, threshold configuration, geometric priors, or acceptance criteria. Support images come from distinct capture blocks, so no two shots observe the same plants; the Pineapple Plantation validation split does not contribute to reported results. The protocol evaluates K∈{1,2,4,10,20,40}K \in\{1, 2, 4, 10, 20, 40\}. Table 1 lists the annotated boxes this gives (3 to 200 on pineapple).

Table 1. Annotation budget per support size. Annotated boxes contained in the KK support images, i.e. the boxes every method receives, as the mean over the five paired support draws. Counts refer to the 544×544 support crops used by all methods. PhenoBench is evaluated up to K=20K=20 since support images come from distinct capture blocks, and its training split has only 21.

Dataset124102040
Pineapple Plantation39204899200
AmodalAppleSize37153265135
PhenoBench9213987172–

Evaluation reports IoU F1 under maximum-cardinality one-to-one matching at IoU ≥ 0.5 (metric focused on localization), and count MAE (metric focused on counting correctly). Two external few-shot detectors serve as baselines, PET-DINO [6] and GeCo2 [16], both run from released weights with no target-domain fine-tuning. GeCo2 takes its exemplars from the support images; following its release, each image is rescaled so that the mean exemplar side is 80 pixels, and detections are kept above 0.33 of the highest objectness score in the image. PET-DINO uses its default score threshold of 0.3. Choosing their thresholds on the support images instead (leave one image out, no query labels) is unstable for K≤2K \le2 and helps from K=4K = 4, mostly for PET-DINO (pineapple RGB 0.21 → 0.48 at K=40K = 40; PhenoBench RGB 0.32 → 0.51 at K=4K = 4); GeCo2 changes by at most 0.08. The pineapple ranking is unchanged at every KK and input, so we report the release defaults. Because both are native RGB models, their depth rows receive the predicted depth map replicated to three channels, and neither has an RGB + D path. On one NVIDIA L40S (batch size 1), encoder passes take 7–8 ms (AM-RADIO/DINOv2-B) and Depth Anything v2 takes 40 ms; fitting a support set takes 0.2–9 s on four CPU threads (K=1K = 1–40), and decoding a query 2–16 ms. An RGB+D query costs about 70 ms, against 0.1–0.8 s per query for PET-DINO and GeCo2.

Comparison with few-shot detectors

Table 2 reports the evaluation results. With DINOv2-B, the proposed detector leads at every support size and in every input condition, by 1.1× at K=1K = 1 and by 1.5× at K=40K = 40 against the stronger competitor; AM-RADIO

MethodInput124102040
PET-DINO [6]RGB0.177 ± 0.1000.191 ± 0.1350.199 ± 0.1150.212 ± 0.0650.224 ± 0.0610.210 ± 0.023
PET-DINO [6]Depth0.142 ± 0.1000.153 ± 0.1170.095 ± 0.0760.091 ± 0.0510.079 ± 0.0260.071 ± 0.019
GeCo2 [16]RGB0.319 ± 0.1660.328 ± 0.0700.339 ± 0.0490.362 ± 0.0450.373 ± 0.0260.371 ± 0.018
GeCo2 [16]Depth0.204 ± 0.1570.188 ± 0.0850.178 ± 0.0560.158 ± 0.0250.147 ± 0.0140.138 ± 0.003
Ours (AM-RADIO)RGB0.318 ± 0.1040.442 ± 0.0610.481 ± 0.0570.520 ± 0.0200.485 ± 0.0360.530 ± 0.027
Ours (AM-RADIO)Depth0.250 ± 0.1300.372 ± 0.0520.439 ± 0.0640.503 ± 0.0290.462 ± 0.0230.495 ± 0.022
Ours (AM-RADIO)RGB+D0.322 ± 0.0460.466 ± 0.0480.499 ± 0.0530.555 ± 0.0170.511 ± 0.0390.563 ± 0.024
Ours (DINOv2-B)RGB0.349 ± 0.1300.513 ± 0.0720.530 ± 0.0430.558 ± 0.0430.554 ± 0.0410.573 ± 0.028
Ours (DINOv2-B)Depth0.317 ± 0.0960.463 ± 0.0600.500 ± 0.0370.542 ± 0.0170.511 ± 0.0330.529 ± 0.017
Ours (DINOv2-B)RGB+D0.362 ± 0.1080.541 ± 0.0370.555 ± 0.0130.567 ± 0.0110.546 ± 0.0330.565 ± 0.016

Table 2. Pineapple test split, IoU F1. KK denotes the number of annotated support images. Mean ± standard deviation over five paired support draws; all methods receive identical episodes. Depth is predicted by Depth Anything v2; the two competitors are native RGB models, so their depth rows feed the predicted depth map as a three-channel image. Bold marks the best cell per input condition and support size.

matches GeCo2 on RGB at K=1K = 1 (0.318 vs. 0.319) and leads elsewhere. The curves differ in shape as well as in levels: the detector performance rises by 64% between one and forty support images, PET-DINO plateaus near 0.21, and GeCo2 rises only 16%, from 0.319 to 0.371. Figure 3 shows predictions at K=40K = 40.

Qualitative comparison on the Pineapple Plantation Dataset

Figure 3. Qualitative comparison on the Pineapple Plantation Dataset. Predictions from GeCo2, PET-DINO, and the proposed method with AM-RADIO (RA) and DINOv2-B (D2) are shown against the ground truth. All the methods used K=40K=40.

A slightly different trend can be observed for counting-based metrics such as MAE, as shown in Figure 4. At K=40K = 40, AM-RADIO achieves a lower MAE than DINOv2-B with the RGB+D modality, whereas DINOv2-B is lower at K=2K = 2–10 and the two are tied at K=1K = 1. Another important observation is that, for both models, RGB+D improves over

Figure 4. Counting error of the proposed detector on the pineapple test split against support size KK, for both frozen backbones and all three input conditions. Bars are the mean over 5 seeds and whiskers are ±1 s.d. Both baselines are worse than every bar and are omitted from the axis so that the conditions remain legible: over K=1K=1 to 40, PET-DINO ranges 3.03–3.16 (RGB) and 2.88–3.34 (depth), and GeCo2 ranges 2.96–3.25 (RGB) and 9.95–16.3 (depth); for K≥2K \ge2 their RGB error is two to three times ours.

RGB-only in terms of MAE, whereas the same benefit is consistent only for AM-RADIO for the IoU F1 score. In contrast, neither baseline counts better with more support: their RGB MAE stays near 3, and their depth MAE grows with KK. The deterioration is particularly relevant for the Pineapple Plantation Dataset, where accurate pineapple counting is an important agricultural application.

A shuffled-depth control tests whether fusion benefits

from aligned geometry rather than merely from a second feature stream (Table 3). Query-depth features are shuffled across capture blocks while preserving their distribution. Alignment improves counting MAE for both encoders and IoU F1 consistently for AM-RADIO, showing that spatially corresponding depth carries useful instance information.

EncoderDepth142040meanwins
|IoU F1 ↑|
DINOv2-Baligned0.3620.5550.5460.565
DINOv2-Bshuffled0.3700.5350.5240.579
DINOv2-BΔ−0.008+0.020+0.022−0.013+0.0093/6
AM-RADIOaligned0.3220.4990.5110.563
AM-RADIOshuffled0.3020.4370.4880.538
AM-RADIOΔ+0.020+0.062+0.023+0.025+0.0386/6
|count MAE ↓|
DINOv2-Baligned2.191.191.281.22
DINOv2-Bshuffled2.801.281.331.21
DINOv2-BΔ+0.60+0.09+0.05−0.01+0.185/6
AM-RADIOaligned2.191.441.151.10
AM-RADIOshuffled2.481.811.241.15
AM-RADIOΔ+0.29+0.37+0.09+0.06+0.186/6

Table 3. Shuffled-depth control, RGB + D, pineapple test. Each query keeps its RGB features but takes depth from another capture block, destroying only spatial correspondence. Δ is signed so positive favours aligned depth (aligned − shuffled for F1, shuffled − aligned for MAE). mean and wins span all six support sizes, including K=2K=2 and 10, not shown.

Component ablation and transfer domain

Two elements distinguish the proposed prototype and threshold from a plain mean-difference prototype with a two-class Otsu cut: whitening by the support covariance, and fitting the number of score populations on the support set. Table 4 adds them one at a time to the same pipeline. They contribute, and they compose. Fitting the class count alone adds +0.038 IoU F1 at K=40K=40, whitening alone +0.056, and together +0.091. The gain from whitening increases with support, from +0.014 at K=1K=1 to +0.056 at K=40K=40, because the covariance it inverts is better estimated as tokens accumulate, whereas the fitted class count helps right from the first shot. Row (e) isolates the shrinkage rule: replacing the token-to-dimension weight with a fixed α=0.15\alpha=0.15 costs 0.068 IoU F1 at K=1K = 1. This is the regime where a one-image covariance is underdetermined and a fixed weight under-regularises it.

Table 4. Component ablation (DINOv2-B, RGB, pineapple test). IoU F1 over five paired draws. (a): neither contribution; (d): full method; (e): fixed α=0.15\alpha= 0.15 instead of token-to-dimension shrinkage. Bold: best per support size; shaded: final setting.

PrototypeOtsu142040
(a)cosineC=2C=20.3350.4920.4700.482
(b)cosinefitted0.3690.5170.5060.520
(c)whitenedC=2C=20.3490.5050.5160.538
(d)whitenedfitted0.3490.5300.5540.573
(e)whitenedα^\alphafitted0.2810.5250.5530.572

Table 4.

The instance decoder is ablated in the same way (Figure 5): starting from the connected regions of the Otsu mask, each support-derived stage of § 4.4 is added in turn (IoU F1 and MAE averaged over KK). Merging disconnected regions gives the largest gain (0.356 to 0.465 IoU F1, 4.46 to 2.48 MAE), and the size and centre correction adds little. The geometry acceptance threshold alone lowers IoU F1 to 0.380 while reducing MAE, because it also rejects true detections; the prominent-peak criterion recovers them, reaching 0.513 IoU F1 and 1.44 MAE. Table 5 isolates the frozen encoder: replacing DINOv2-B with an ImageNet-supervised ResNet-50 lowers IoU F1 at every support size, yet on pineapple the same pipeline still outperforms the strongest baseline from K=4K=4 onward (0.493 vs. 0.371 at K=40K=40), so the gains do not come from the foundation-model features alone.

Table 5. Frozen-encoder ablation (RGB IoU F1). Mean over five paired support draws. Our pipeline uses DINOv2-B or ImageNet-supervised ResNet-50 [8] (layer 3, 32×3232 \times32 grid) without modification. The strongest baseline per dataset is included; bold marks the best score per dataset and support size.

Method142040
Pineapple (aerial)
Ours, DINOv2-B0.3490.5300.5540.573
Ours, ResNet-500.1640.3510.4360.493
GeCo2 (strongest baseline)0.3190.3390.3730.371

Table 5.

Decoder ablation bar chart

Figure 5. Decoder ablation, DINOv2-B, RGB, pineapple test. Each row adds one stage of § 4.4; the bold row is the full decoder. Bars show IoU F1 (blue,↑\uparrow) and count MAE (orange, ↓\downarrow), averaged over five draws and all KK; each segment has its own scale.

The transfer beyond the aerial pineapple domain is evaluated under the same protocol on AmodalAppleSize [7], a ground-level RGB+D orchard dataset with heavy occlusion, and on PhenoBench [26], an aerial crop/weed benchmark with crops as the target class. PhenoBench has no depth, and the sensor depth released with AmodalAppleSize is valid for only 64% of pixels, so both use depth predicted by Depth Anything 3 [12] (Table 6), whereas pineapple keeps the Depth Anything v2 [29] maps released with its dataset. Recomputing the pineapple depth with Depth Anything 3 changes RGB+D IoU F1 by 0.00 (DINOv2-B) and −0.02-0.02 (AM-RADIO) on average. The resulting transfer remains domain-dependent. On PhenoBench RGB, GeCo2 is the strongest method at K=4K=4 and K=20K=20, but the proposed detector is the only evaluated method whose RGB performance improves substantially with additional support (0.369 to 0.422 for DINOv2-B, while GeCo2 drops from 0.518 to 0.480). More importantly for the aerial setting, depth alone preserves roughly 90% or more of the RGB IoU F1 of both encoders on Pineapple and PhenoBench, despite discarding appearance. RGB+D also often improves over RGB alone; on PhenoBench at K=20K=20, fusion improves both encoders (0.434 and 0.437), narrowing the gap to GeCo2. Collectively, the results show that geometry offers a complementary signal for aerial imagery.

Table 6. The same protocol on three benchmarks. IoU F1, mean over five paired support draws, with standard deviation shown in smaller type. Ours (D2) and Ours (RA) correspond to DINOv2-B and AM-RADIO, respectively. Depth: Depth Anything v2 [29] (pineapple), Depth Anything 3 [12] (others). Dashes denote unavailable RGB+D settings. Bold indicates the best result within each dataset and column. Shaded rows denote the proposed methods.

RGBDepthRGB+D
MethodK4K4K20K20K4K4K20K20K4K4K20K20
Pineapple (aerial)
PET-DINO0.199±\pm.110.224±\pm.060.095±\pm.070.079±\pm.02––
GeCo20.339±\pm.040.373±\pm.020.178±\pm.050.147±\pm.01––
Ours (D2)0.530±\pm.040.554±\pm.040.500±\pm.030.511±\pm.030.555±\pm.010.546±\pm.03
Ours (RA)0.481±\pm.050.485±\pm.050.439±\pm.060.462±\pm.020.499±\pm.050.511±\pm.03
AmodalAppleSize (ground-level)
PET-DINO0.749±\pm.010.769±\pm.000.285±\pm.030.214±\pm.04––
GeCo20.644±\pm.040.642±\pm.010.173±\pm.020.170±\pm.00––
Ours (D2)0.414±\pm.060.442±\pm.060.237±\pm.070.245±\pm.040.410±\pm.050.446±\pm.03
Ours (RA)0.402±\pm.060.437±\pm.040.156±\pm.030.209±\pm.010.415±\pm.030.441±\pm.03
PhenoBench (aerial)
PET-DINO0.317±\pm.110.228±\pm.040.515±\pm.070.476±\pm.03––
GeCo20.518±\pm.080.480±\pm.040.534±\pm.020.475±\pm.02––
Ours (D2)0.369±\pm.020.422±\pm.010.345±\pm.070.370±\pm.020.339±\pm.050.434±\pm.01
Ours (RA)0.318±\pm.020.406±\pm.010.358±\pm.060.389±\pm.010.378±\pm.030.437±\pm.01

Table 6.

Dataset-specific object statistics explain the ranking differences. Pineapple crowns are relatively uniform in size (median 6.9 grid cells; 2.6×2.6 \times variation), so support-derived geometry transfers well across queries. AmodalAppleSize is harder because apples are heavily occluded and annotated with amodal boxes, while PhenoBench has much larger scale variation (13.9×13.9 \times) and many sub-cell objects (24%), making a single support-derived geometry unreliable. GeCo2 benefits there from exemplar rescaling. Conversely, PET-DINO and GeCo2 are weakest on pineapple, where visually similar surrounding foliage makes prompting alone less effective. Our method benefits from re-estimating the prototype, threshold, and geometry from each support set.

Conclusion

We presented a training-free detector that converts dense features from frozen visual foundation models directly into detections, without fine-tuning, a learned head, or external proposals. On our leakage-aware Pineapple Plantation Dataset, it improves with additional support and reaches 1.5×1.5 \times the IoU F1 of the strongest baseline at K=40K=40. With DINOv2-B, predicted depth alone retains 92% of RGB IoU F1 at K=40K=40, while RGB+depth fusion improves counting MAE for both encoders. Experiments on PhenoBench and AmodalAppleSize show that transfer is domain-dependent and sensitive to depth quality: the proposed detector is strongest when objects span several feature-grid cells and share a consistent geometry, as pineapple crowns do, while the prompt-based baselines remain stronger for heavily occluded fruit and for plants of widely varying size. These results establish frozen dense representations as a promising basis for annotation-efficient agricultural detection.

AM-RADIO heads

Our pipeline is agnostic to the choice of frozen encoder; accordingly, we evaluate it across six readout spaces: DINOv2-B, the AM-RADIO backbone, and AM-RADIO’s four distilled teacher heads (Figure 6). DINOv2-B achieves the highest IoU F1 score at every support size, while the four teacher heads fall within a very small margin of the AM-RADIO backbone at K=40K = 40. These results are consistent with the nature of these representation spaces. The AM-RADIO backbone jointly encodes information distilled from the four teacher spaces, which may explain why the individual teacher heads perform slightly below it in this use case.

Figure 6. Six frozen readout spaces, RGB, pineapple test. The plain DINOv2-B backbone leads at every support size; AM-RADIO’s distilled teacher heads neither help nor collapse, spanning 0.51–0.55 at K=40K=40.

Predicted depth alone is nearly as good as RGB for F1 score, and for MAE with DINOv2-B it stays within 0.04 of RGB for K≥10K \ge10. Depth reaches 0.529 against 0.573 at K=40K=40, and 92–97% of the RGB score for every K≥4K \ge4 in Table 2 (see also Figure 7). Although this is a monocular estimate produced from the same image rather than a measurement, a detector built on it alone recovers almost all of the accuracy. The estimator evidently concentrates the crown/canopy boundary into a channel where it survives our prototype and threshold better than the raw appearance does. For MAE, Figure 4 shows that depth alone stays close to RGB for DINOv2-B but trails it for AM-RADIO. RGB+D gives the lowest MAE of the three inputs at every KK except K=20K = 20 for DINOv2-B and except K=2K = 2 for AM-RADIO,

Figure 7. Pineapple test split. Detection quality (IoU F1, higher is better) against the number of support images for RGB, depth, and RGB+depth inputs. Bands are ±1 standard deviation over the five paired draws; the proposed detector appears on both frozen encoders (solid) against the two competitors (dashed). Performance generally increases with additional support, although the gains are not monotonic for every encoder and input condition. DINOv2-B rises from 0.349 to 0.573 IoU F1 on RGB, whereas PET-DINO is flat and GeCo2 improves only slightly on RGB (0.319 to 0.371) and degrades on depth.

and at K=40K = 40 AM-RADIO with RGB+D gives the lowest MAE of both encoders (1.10).

Qualitative comparison of Depth, RGB, GeCo2, PET-DINO, Ours (RA), and Ours (D2) on AmodalAppleSize

Figure 8. Qualitative comparison on the AmodalAppleSize [7] dataset. Predictions from GeCo2, PET-DINO, and the proposed method with AM-RADIO (RA) and DINOv2-B (D2) are shown against the ground truth. All the methods used K=20K=20.

Qualitative comparison of Depth, RGB, GeCo2, PET-DINO, Ours (RA), and Ours (D2) on PhenoBench

Figure 9. Qualitative comparison on the PhenoBench [26] dataset. Predictions from GeCo2, PET-DINO, and the proposed method with AM-RADIO (RA) and DINOv2-B (D2) are shown against the ground truth. All the methods used K=20K=20.

References

  1. [1]Lev Avzenberg, Raja Giryes, and Hayit Greenspan. ProtoSAM: One-shot medical image segmentation with foundational models. arXiv preprint arXiv:2407.07042, 2024. 2
  2. [2]Adrian Bulat et al. FS-DETR: Few-shot Detection Transformer with prompting and without re-training. In Proceedings of the IEEE/CVF ICCV, pages 11793–11802, 2023. 2arxiv.org/abs/2210.04845
  3. [3]Mathilde Caron et al. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF ICCV, 2021. 2arxiv.org/abs/2104.14294
  4. [4]Fabian Fallas-Moya et al. Object detection in pineapple fields drone imagery using few shot learning and the Segment Anything Model. In 2023 International Conference on Machine Learning and Applications (ICMLA). IEEE, 2023. 2
  5. [5]Fabian Fallas-Moya et al. Squeeze every bit of insight: Lever-aging few-shot models with a compact support set for domain transfer in object detection from pineapple fields. In CLEI, 2023. 2
  6. [6]Weifu Fu et al. PET-DINO: Unifying visual cues into Ground-ing DINO with prompt-enriched training. In Proceedings of the IEEE/CVF CVPR, pages 13039–13048, 2026. 2, 5, 6arxiv.org/abs/2604.00503
  7. [7]amodal segmentation masks for fruit detection, visibility and size estimation. Data in Brief, 52:110000, 2024. 7, 11
  8. [8]Kaiming He et al. Deep residual learning for image recognition. In Proceedings of the IEEE CVPR, pages 770–778, 2016. 7arxiv.org/abs/1512.03385
  9. [9]Greg Heinrich et al. RADIOv2.5: Improved baselines for agglomerative vision foundation models. In Proceedings of the IEEE/CVF CVPR, pages 22487–22497, 2025. 2arxiv.org/abs/2412.07679
  10. [10]Andreas Kamilaris et al. A review of the use of convolutional neural networks in agriculture. The Journal of Agricultural Science, 156(3):312–322, 2018. 1, 2
  11. [11]Bingyi Kang et al. Few-shot object detection via feature reweighting. In Proceedings of the IEEE/CVF ICCV, pages 8420–8429, 2019. 2arxiv.org/abs/1812.01866
  12. [12]Haotong Lin et al. Depth Anything 3: Recovering the visual space from any views. In ICLR, 2026. 7arxiv.org/abs/2511.10647
  13. [13]Yang Liu et al. Matcher: Segment anything with one shot using all-purpose feature matching. In ICLR, 2024. 2arxiv.org/abs/2305.13310
  14. [14]Maxime Oquab et al. DINOv2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023. 1, 2arxiv.org/abs/2304.07193
  15. [15]Nobuyuki Otsu. A threshold selection method from gray-level histograms. IEEE Transactions on Systems, Man, and Cybernetics, 9(1):62–66, 1979. 2, 4DOI
  16. [16]Jer Pelham et al. Generalized-scale object counting with gradual query aggregation. In AAAI, 2026. 2, 5, 6
  17. [17]Mike Ranzinger et al. AM-RADIO: Agglomerative vision foundation model – reduce all domains into one. In Proceedings of the IEEE/CVF CVPR, pages 12490–12500, 2024. 2arxiv.org/abs/2312.06709
  18. [18]Joseph Redmon et al. You only look once: Unified, real-time object detection. In Proceedings of the IEEE CVPR, 2016. 2arxiv.org/abs/1506.02640
  19. [19]Shaoqing Ren et al. Faster R-CNN: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 2arxiv.org/abs/1506.01497
  20. [20]Inkuy Sa et al. DeepFruits: A fruit detection system using deep neural networks. Sensors, 16(8):122, 2016. 1, 2DOI
  21. [21]Oriane Siméoni et al. Localizing objects with self-supervised transformers and no labels. arXiv preprint arXiv:2109.14279, 2021. 2arxiv.org/abs/2109.14279
  22. [22]Jake Snell et al. Prototypical networks for few-shot learning. In NeurIPS, 2017. 2arxiv.org/abs/1703.05175
  23. [23]Maxim Tkachenko et al. Label Studio: Data labeling software, 2020–2025. 2
  24. [24]Xin Wang et al. Frustratingly simple few-shot object detection. In Proceedings of the 37th International Conference on Machine Learning, 2020. 2arxiv.org/abs/2003.06957
  25. [25]Yangtao Wang et al. Self-supervised transformers for unsupervised object discovery using normalized cut. In Proceedings of the IEEE/CVF CVPR, 2022. 2arxiv.org/abs/2202.11539
  26. [26]Jan Weyler et al. PhenoBench: A large dataset and benchmarks for semantic image interpretation in the agricultural domain. IEEE Transactions on Pattern Analysis and Machine Intelligence, 46(12):9583–9594, 2024. 7, 11DOI
  27. [27]Danny Xie-Li et al. Simple object detection framework without training. In 2024 IEEE 6th International Conference on BioInspired Processing (BIP), pages 1–6. IEEE, 2024. 2
  28. [28]Danny Xie-Li et al. PineSORT: A simple online real-time tracking framework for drone videos in agriculture. In Proceedings of the IEEE/CVF CVPR Workshops, 2025. 2
  29. [29]Lihe Yang et al. Depth Anything V2, 2024. 2, 7arxiv.org/abs/2406.09414
  30. [30]Xinyu Zhang et al. Detect everything with few examples. In CoRL, pages 3986–4004. PMLR, 2025. 2

Paper details

vlnc:W_7n8ugbvt
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents