Skip to main content
. 2025 Sep 2;25(17):5415. doi: 10.3390/s25175415
Algorithm 3: Online Open-Set Recognition
Require:
  • Test sample: xtest;

  • Trained encoder parameters ϕ and prototype set C=ckk=1K;

  • Global GPD model parameters: threshold ωglobal, scale σξ (obtained from Algorithm 2);

  • Significance level  δw for decision-making (e.g., 0.01).

Ensure:
  • Predicted label y^{1,,K}{Unknown}.

1 //Compute Test Statistics:
2  Extract feature: ztestEϕxtest;
3  Compute distances to all prototypes: dkztestck22 for k=1,,K;
4  Find the minimum distance and its corresponding candidate class:
5 dminmindkk=1K, k^argminkdkk=1K.
6 //Decision Based on Extreme Value Model
7 If dminωglobal then:
8   dmin outside tail distribution, classify as known class: y^k^.
9 else
10   dmin falls into the tail distribution, perform hypothesis testing:
11   //(a) Compute p-value:
12 p-value1+ξ(dminωglobal)σ1/ξ;
13   //(b) Compare with Significance Level:
14   if p-value<δw then:
15    Low probability event occurs; reject null hypothesis:
16 classify as unknown: y^Unknown.
17    else
18    Null hypothesis cannot be rejected:
         classify as known class: y^k^.
19    end if
20 End if
21 Return y^