Few-Shot Ordinal Learning for Day-Wise Freshness Estimation with Hyperspectral Fish Images

arXiv:2608.12230 · cs.CV, cs.AI, eess.IV, eess.SP · Submitted 2026-08-12 · Read on arXiv

Kazi Nabiul Alam, Pooneh Bagheri Zadeh, Akbar Sheikh-Akbari

Leeds Beckett University

cs.CV, cs.AI, eess.IV, eess.SP

Submitted: 2026-08-12

Updated: 2026-08-13

Comments: Accepted at EUSIPCO'2026

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 75/100

The gist: This paper introduces the first few-shot learning framework for hyperspectral imaging (HSI)-based food quality estimation, specifically for day-wise freshness prediction of fish fillets.

Terminology

Summary

This paper introduces the first few-shot learning framework for hyperspectral imaging (HSI)-based food quality estimation, specifically for day-wise freshness prediction of fish fillets. The authors note that All existing deep learning approaches for HSI-based freshness prediction operate under full supervision, requiring densely annotated training sets that are costly to obtain at the individual-product level. Their proposed method combines episodic training with CORAL-style ordinal regression and biologically grounded temporal regularization.

The methodology treats each fish fillet as a distinct episodic task, where Each fillet defines a task Ti split into a k-day support set Si and a query set Qi of remaining days. The backbone is a spectral-channel CNN that treats B spectral bands as input channels to a 2D CNN rather than using 3D convolutions, with four convolutional blocks (32→64→128→128 channels) and a 256-dimensional embedding, totaling 441K parameters and 2.37 GFLOPs. The CORAL ordinal head computes D−1 binary sub-tasks to determine threshold exceedance, with cumulative exceedance probabilities yielding the expected day via ŷ = 1 + Σσ(ok). The loss combines binary cross-entropy over all thresholds with two regularizers: monotonicity (Lmono) enforcing biologically plausible ascending predictions with margin δ=0.01, and embedding smoothness (Lsmooth) penalizing abrupt representational jumps between adjacent days.

Experiments use a custom salmon HSI dataset of 50 individually packaged fillets imaged daily over 16 days (D=16; day 6 = labelled expiry), with 462 spectral bands (386.88–1003.6 nm) at 128×128 resolution, reduced to B=256 channels after normalization and edge-band removal. Splitting is performed at the pack level to prevent data leakage: 30 training packs, 10 validation packs, and 10 test packs. Under a strict unseen-fillet protocol with k=3 support days, the method achieves a mean absolute error of 1.58 days and ±2-day accuracy of 72.3%, substantially outperforming scalar regression (MAE 1.95, ±2-day 56.9%) and label-distribution baselines (best LDL + temporal smooth: MAE 1.79, ±2-day 64.6%).

The ablation study under a reduced 15-epoch budget shows that Monotonicity (A4) yields the largest single gain (about 12% over the ordinal-only A2), while smoothness alone helps marginally; the full regularized model attains the best MAE (1.58) at full budget. Robustness analysis across support sizes shows k=3 is optimal (MAE 1.58, ±2-day 72.3%), with even 1-shot achieving 48.5% ±2-day accuracy. Qualitative analysis shows larger errors confined to mid-range days (5–9) where biochemical changes are subtlest. The authors acknowledge a limitation: the salmon HSI dataset is proprietary and not yet publicly available, which constrains reproducibility, though the framework is dataset-agnostic and planned for validation on public benchmarks.

Improvements for AI systems

Improvements to AI systems:

  1. Few-shot ordinal regression with temporal regularization: Replace standard supervised regression/classification heads with a CORAL-style ordinal head (D−1 binary thresholds) trained via episodic meta-learning, where each instance defines its own support/query split. Add a monotonicity loss (margin δ=0.01) to enforce biologically plausible monotonic predictions across time, and an embedding smoothness loss to penalize abrupt representational jumps between adjacent ordinal levels. This yields robust predictions with only k=3 support samples per new instance.

  2. Spectral-channel 2D CNN backbone: Use a 2D CNN that treats spectral bands as input channels (B=256) instead of 3D convolutions, with four convolutional blocks (32→64→128→128) and a 256-dim embedding. This reduces parameters (441K) and FLOPs (2.37G) while capturing spatial-spectral correlations efficiently, enabling deployment on edge devices for real-time quality assessment.

  3. Pack-level data splitting to prevent leakage: When training on multi-instance time-series data, split by physical pack/unit (e.g., 30/10/10 train/val/test packs) rather than random samples, ensuring the model never sees the same instance across splits. This yields realistic generalization to unseen fillets, improving trust in real-world deployment.

  4. Adaptive support-size selection: Dynamically choose the optimal number of support days (k=3 in this case) via validation, balancing information gain against overfitting. The system can automatically fall back to 1-shot (48.5% ±2-day accuracy) when fewer samples are available, making it practical for cold-chain monitoring with sparse sampling.

  5. Confidence-aware error localization: Use the ordinal threshold probabilities to flag predictions in mid-range days (5–9) as high-uncertainty, where biochemical changes are subtlest. The system can then trigger additional sensor readings or human inspection for those specific samples, improving overall quality assurance.

What the improved AI system can do:

  • Predict the freshness (day) of a new fish fillet from a single hyperspectral image with only 3 prior days of that fillet’s data, achieving MAE 1.58 days and 72.3% ±2-day accuracy—outperforming full-supervision baselines.

  • Operate without dense per-day annotations, reducing labeling cost by 80% (only k=3 support days needed per new product).

  • Provide monotonic, biologically plausible freshness trajectories (no non-sensical day reversals), which is critical for regulatory compliance.

  • Run on resource-constrained hardware (e.g., portable hyperspectral cameras) due to the lightweight 2D CNN backbone.

  • Extend to other perishable foods (meat, fruit) or any ordinal time-series regression task (e.g., battery degradation, drug shelf-life) by swapping the input channels and retraining on new datasets, since the framework is dataset-agnostic.

Abstract

Non-destructive food quality assessment has increasingly benefited from hyperspectral imaging (HSI), which captures spectral signatures linked to biochemical changes during storage. Estimating day-wise freshness, however, remains challenging owing to strong inter-fillet variability and scarce labelled data per product. All existing deep learning approaches for HSI-based freshness prediction operate under full supervision, requiring densely annotated training sets that are costly to obtain at the individual-product level. We introduce, to the best of our knowledge, the first few-shot learning framework for HSI-based food quality estimation. Each fillet defines a distinct episodic task, and a CORAL-style ordinal prediction head captures the ranked nature of freshness progression through cumulative threshold modelling. Biologically grounded monotonicity and embedding smoothness constraints further guide predictions toward plausible trajectories. On a 16-day salmon HSI dataset under a strict unseen-fillet protocol, our method achieves a mean absolute error of 1.58 days and 2-day accuracy of 72.3% with only three labelled days per fillet, substantially outperforming scalar regression and label-distribution baselines under an identical unseen-fillet protocol.

Related papers