This section builds the deployed system: architecture, dataset, training and quantisation, evaluation protocol, and finally backbone selection.
3.1. System Architecture
This work builds on IsPlanktonBIO [
9], which turns each sensor crop into a verified taxonomic label and, ultimately, a biomass estimate through a two-stage cascade. We adopt that cascade and add the two elements it lacks for autonomous edge operation: an OOD gate at each stage, and a scorer light enough to drive those gates without a memory-resident gallery. Our contribution is therefore this open-set extension together with its hardware–software partition on the Kria KV260, both shown in
Figure 2. Each raw crop is decoded and preprocessed on the ARM Cortex-A53 cores (processing system, PS) and passed directly to Stage-1, where a ResNet-50 backbone accelerated on the DPU (programmable logic, PL) assigns its taxonomic group and an OOD gate rejects the crop when its OOD score falls below a calibrated threshold. Both stages share the same OOD scorer, which computes that score as a cosine similarity for the FAISS baselines, or as a Linear Energy score for the deployed configuration. Crops that pass Stage-1 enter Stage-2, where an OpenCV (v4.8.0)
segment_and_crop routine delineates the object inside the crop. A boundary check then discards specimens the frame has truncated: the pipeline rejects any segmentation touching more than one image border, and accepts a single-border contact only when it spans at most 10% of the image width. An independently trained ResNet-50 verifier, with its own OOD gate, classifies the surviving segmentation. The object is accepted only when both gates pass
and the Stage-2 label agrees with the Stage-1 classification; the pipeline then estimates its biomass from the segmented area. This taxonomic agreement check, rather than a simple label hand-off, is what makes the cascade a
verification pipeline.
The workload is partitioned to keep the DPU saturated. The four Cortex-A53 cores host the decoding, preprocessing,
segment_and_crop, OOD-scoring and orchestration threads, while the PL DPU accelerates the two ResNet-50 backbone inferences; all models are quantised to INT8 for DPU execution. At runtime the system is a multithreaded producer–consumer pipeline (Producer, Consumer, DPU multiplexer and scorer threads, visible in Figure 5,
Section 4.2.2), with a semaphore-controlled count of in-flight images (
pipeline_depth) that we exploit in
Section 4.2.3. This partition is where the co-design constraint bites: the OOD scorer runs on the ARM cores in the interval between the two DPU calls, so it must be light enough not to stall the DPU. That requirement, rather than raw detection accuracy, is what motivates the Zero-LUT Linear Energy head over a FAISS look-up-table search (
Section 3.5 and
Section 4.2.2).
3.3. Model Training and Quantisation
Full training details are given in the IsPlanktonBIO preprint [
9]; we summarise the setup here, and in
Figure 3, so that the present study is self-contained. Both stages use a ResNet-50 encoder [
40] with a multi-layer perceptron (MLP) projection head, trained with the supervised-contrastive loss (SupCon) [
41] for 1000 epochs with stochastic gradient descent (SGD, momentum 0.9, weight decay
), a batch size of 32, and an initial learning rate of 0.016 (scaled linearly from the reference 0.5 at batch 1024) under a cosine schedule, with temperature
, on
inputs and the standard SupCon augmentations. The Stage-1 encoder is trained on full frames and the Stage-2 encoder on the OpenCV-segmented crops, with independent weights and per-stage channel normalisation. From the loss plateau (epochs 700–1000) we train a linear-probing head separately on each frozen checkpoint and select the checkpoint whose head maximises validation accuracy; the selected backbones reach ≈95% closed-set validation accuracy. For deployment, the encoders and linear heads are quantised to INT8 [
42,
43] by post-training quantisation (PTQ) with the AMD Vitis-AI quantiser (v3.5.0) [
16] and compiled to the DPU B4096 overlay. Every deployed INT8 backbone uses this PTQ path.
CIDER, the backbone evaluated alongside SupCon, follows its own reference implementation [
32]: a ResNet-50 encoder with the same 128-dimensional MLP projection head, trained per stage on the same splits for 500 epochs with SGD (Nesterov momentum 0.9, weight decay
), batch size 64, an initial learning rate of 0.1 under a cosine schedule, temperature
, and prototype exponential-moving-average factor
. Its objective combines the dispersion and compactness terms,
, with
. The 500-epoch budget, the temperature, the prototype factor and the embedding dimensionality are unmodified defaults of the CIDER reference implementation; we scaled down batch size and learning rate from their reference 512 and 0.5 to fit our single-GPU memory budget. CIDER’s encoder and head follow the same plain-PTQ path as SupCon’s, quantised via the Vitis-AI quantiser flow.
As an alternative end-to-end scorer, VOS [
33] was trained on the segmented in-distribution crops with the reference implementation’s default configuration: a from-scratch ResNet-50 optimised by SGD (learning rate 0.05, batch size 64, Nesterov momentum 0.9, weight decay
, cosine schedule) for 100 epochs, with virtual-outlier synthesis from epoch 40 (a per-class feature queue of 1000 samples, 10,000 Gaussian candidates per class, the single lowest-density sample kept as the virtual outlier, and energy-regularisation weight 0.1). SupCon’s 1000-epoch budget and CIDER’s 500-epoch budget are, like VOS’s, unmodified defaults of their reference implementations, not a chosen asymmetry: each cosine schedule anneals its learning rate to near zero by the model’s own final epoch, so none of the three runs is truncated mid-schedule. We therefore compare the two methods as their respective authors configure them rather than under a matched training budget; VOS is, moreover, the only scorer we grant quantisation-recovery: PTQ with fine-tuning (PTQ + FT) or quantisation-aware training (QAT). Plain PTQ, without recovery, collapses VOS’s Stage-2 classifier to a single class (Table 10), whereas it leaves the deployed LE + SupCon scorer close to lossless (Table 4).
3.4. Open-Set Evaluation Protocol
Because the cascade makes two coupled decisions per image, accept or reject (is this a known plankton class or an out-of-distribution input?) and which class, a single closed-set accuracy is insufficient. We therefore report four complementary perspectives, each computed per stage and end-to-end, following conventions consistent across all variants.
Criterion 1: closed-set classification. Accuracy and macro-averaged Precision, Recall and F1 over in-distribution (ID) images only, with no OOD gating. Macro averaging weights every class equally, the honest choice for a 78-class taxonomic problem with heavy class imbalance. This criterion isolates raw discriminative power but, by construction, ignores the rejection decision: an image rejected by the energy gate still contributes its predicted class, so a change that improves OOD rejection has no mechanical path to raise this number.
Criterion 2: OOD detection. Threshold-independent AUROC (Area Under the Receiver Operating Characteristic curve) and FPR95 (false-positive rate at 95% ID true-positive rate), the standard separability metrics.
Criterion 3: open-set classification (headline). We adopt the Open-Set Classification Rate (OSCR) curve of Dhamija et al. [
34]. Sweeping a score threshold
, the curve plots the Correct Classification Rate (CCR) against the False Positive Rate (FPR),
where
and
are the in-distribution and out-of-distribution test sets,
x is a query image, and
is its ground-truth class label.
is the raw classifier score (logit) the model assigns to class
c, one of the
C taxonomic classes, for image
x, so
picks out the class with the highest score.
is the OOD score, for which higher means more in-distribution: it can be computed either as the Linear Energy score defined in
Section 3.5, or as the cosine similarity adopted in the FAISS baselines.
is the threshold Equation (
1) sweeps: an image with
is rejected as out of distribution. The predicted label
and the score
are read off the same forward pass. Dhamija et al.’s original formulation always sets
to the maximum softmax probability; we generalise it so that
can be any OOD score, and neither of ours is a softmax probability. An ID sample therefore contributes to CCR only if it is
both accepted and correctly classified. Following Dhamija et al., we summarise the OSCR curve by reporting CCR at fixed operational leakage budgets,
and
, the most intuitive deployment-facing figures and our primary open-set metric. As the threshold relaxes, CCR rises toward the closed-set accuracy; the shortfall at a fixed leakage budget is precisely the classification performance forfeited to imperfect OOD rejection.
Criterion 4: calibrated operating point. At the deployed threshold we report the True Positive Rate (TPR), FPR, the True Negative Rate (TNR) and the False Negative Rate (FNR), and, most importantly, the accuracy on accepted images, the user-facing quality of the system actually running on the DPU. Admission at this operating point is a compound criterion, not a single score threshold: an image must pass its stage’s OOD gate, its segmentation must not touch the image border, and the Stage-2 label must agree with Stage-1 at the pipeline level. Table 17 decomposes the resulting rejection rate on the Kria deployment into these four mechanisms.
Stage conventions. Stage-1 is evaluated over all images. Stage-2 is evaluated conditionally, only on images that passed the Stage-1 gate; its OOD pool is therefore restricted to the hardest OOD cases that already survived Stage-1, making its OOD metrics a conservative lower bound that is not directly comparable to Stage-1. In particular, a lower Stage-2 AUROC or a higher Stage-2 FPR95 than Stage-1 reflects this harder, pre-filtered OOD population and must not be read as Stage-2 being a weaker detector. The pipeline uses the best available prediction (Stage-2 when reached, else Stage-1) and the conservative combined score , mirroring the two-gate accept logic in which an image is admitted only if both gates pass. Scores follow a common convention: whether a cosine similarity or an energy, higher means more in-distribution.
Statistical reporting. All metrics are point estimates on the fixed 6128-image test set. We quantify their sampling uncertainty with 95% bootstrap confidence intervals (CIs; 1000 resamples of the ID and OOD test sets), computed separately for the FP32 selection sweep (
Table 2 and
Table 3) and the INT8 deployment sweep (
Table 4,
Table 5,
Table 6,
Table 7,
Table 8 and
Table 9). Across the four FP32 scorers, half-widths range 0.8–0.9 pp for accuracy, 0.3–0.5 pp for AUROC, 1.0–1.5 pp for CCR@FPR and 2.6–3.8 pp for FPR95; for the INT8 variants, typical half-widths at the pipeline level are ±0.9 pp for accuracy, ±0.5 pp for AUROC, ±1.5 pp for CCR@FPR and ±3.5 pp for FPR95, with the conditional Stage-2 intervals wider on their smaller sample. Paired accuracy comparisons between variants use McNemar’s test on the same test images.
3.5. Backbone Selection and OOD Scoring Compatibility
We evaluated two contrastive training objectives as candidate backbones: Supervised Contrastive Learning (SupCon) [
41] and Compactness and DispErsion Regularised learning (CIDER) [
32]. Both architectures share a ResNet-50 encoder; they differ in the geometry of the learned embedding space and in the structure of the inference-time classification head.
When combined with a FAISS cosine-similarity (CS) scorer [
44], both backbones reach their strongest OOD separation (
Section 4.1), but only by keeping the memory-resident index that stalls the DPU. To satisfy the zero-external-memory deployment constraint, we evaluated the Energy Score [
28] as a GEMM-only OOD scorer for both backbones:
where
is the
c-th logit produced by the classification head. With the SupCon backbone,
is the output of a separately trained linear head (Linear Probing). With the CIDER backbone,
is the temperature-scaled cosine similarity between the query embedding and the
c-th class prototype, which we label the
prototype head. This second pairing proves problematic, for the reason set out next.
The difficulty is a geometric incompatibility rooted in the range of the logits each backbone feeds to the Energy Score. With CIDER the logits are the temperature-scaled cosine similarities to the class prototypes,
, which the unit-hypersphere geometry bounds to
(
at
). Because CIDER’s dispersion objective makes a single prototype dominate the sum, the LogSumExp in Equation (
2) approaches the largest logit and is therefore effectively capped at
. In-distribution objects, which align almost perfectly with their own prototype, should therefore concentrate at that ceiling, compressing the score’s dynamic range and leaving the OOD gate a narrow band to work in. SupCon, by contrast, classifies with an unbounded linear head, so in-distribution objects reach high energy while off-manifold OOD objects produce uniformly low logits, preserving a wide separating margin.
Section 4.1 tests this prediction, and asks whether the logit bound alone accounts for it.
This analysis identifies LE + SupCon, a SupCon backbone with a linear classification head, as the deployed architecture. Its OOD gate operates at TPR
95: we set the energy threshold to the 5th percentile of the in-distribution validation scores, so that 95% of legitimate ID samples pass the gate, matching the FPR95 convention used throughout the OOD literature. This is a per-stage target on the validation split rather than an end-to-end acceptance rate. The FP32/GPU evaluations (
Table 2 and
Table 3) use this TPR
95 operating point directly; for on-device deployment, however, we
recalibrate the Stage-1 and Stage-2 thresholds directly on the Kria INT8 model, because quantisation shifts the score distribution and FP32 thresholds do not transfer. Two compounding factors then separate the 95% target from what the deployed pipeline actually realises: both gates must independently pass, and the recalibrated threshold is evaluated on the test set rather than the validation split it was calibrated on (
Section 4 reports the resulting operating point). We emphasise that deploying LE + SupCon is a
deployability decision rather than a claim of OOD superiority: the FAISS cosine-similarity scorers separate OOD inputs more accurately (
Table 2), but only the energy head satisfies the platform’s zero-external-memory, DPU-friendly constraint.
Beyond these two post hoc scorers, we also evaluated VOS as an end-to-end alternative that would remove the FAISS LUT search from both stages of IsPlanktonBIO entirely (its training and quantisation are detailed in
Section 3.3). VOS estimates a class-conditional Gaussian over the penultimate-layer features, aggregates an object-level free energy via a class-reweighted LogSumExp in the spirit of Equation (
2), and adds a learned nonlinear transform together with a virtual-outlier regulariser sampled from the low-likelihood tails of that Gaussian. Unlike the two post hoc scorers, it requires virtual-outlier training, and its INT8 deployment exposes a quantisation preprocessing pitfall specific to background-dominated inputs. We report the full comparison, together with this deployment finding, in
Section 4.2.5 (
Table 10); it does not displace LE + SupCon, which we retain as the deployed configuration.