From efd984efedb5cde44142e391b7f2f29730a04680 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Singh Date: Wed, 17 Jun 2026 14:54:34 +0530 Subject: [PATCH] fix(inference): increase NOT_A_FISH_THRESHOLD to 0.55 to reject non-fish images --- src/fusionInference.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fusionInference.js b/src/fusionInference.js index 5f54d10..f9cc8ca 100644 --- a/src/fusionInference.js +++ b/src/fusionInference.js @@ -51,7 +51,8 @@ const THRESHOLD_MODERATE = 0.35; // score >= 0.35 → Moderate, else Spoiled // the image is unlikely to be a fish (all-class uncertainty). // Note: the ONNX model was trained only on fish, so non-fish images may still // score above this — treat as a best-effort guard, not a hard detector. -const NOT_A_FISH_THRESHOLD = 0.36; +// Increased to 0.55 from 0.36 to better reject non-fish objects (e.g. human faces). +const NOT_A_FISH_THRESHOLD = 0.55; // Default model paths (relative to Vite public/ folder) const DEFAULT_MODEL_PATHS = {