Skip to main content
. 2025 Sep 2;25(17):5415. doi: 10.3390/s25175415
Algorithm 2: Offline GPD Model Fitting.
Require:
  • Trained encoder parameters ϕ and prototype set C=ckk=1K;

  • Complete training dataset Dtrain=xi,yii=1N;

  • Quantile q for determining the tail threshold (in this paper, q = 0.9).

Ensure:
  • Parameters for the global GPD model: threshold ωglobal, scale parameter σ, shape parameter ξ.

1 Initialize an empty list for distance scores: Dscores[].
2 Global Intra-class Distance Aggregation
3 For each sample xi,yi in Dtrain do:
4  Extract feature: ziEϕxi;
5  Retrieve the corresponding class prototype: cyiCyi;
6  Compute the squared Euclidean distance: dizicyi22;
7  Append distance to the list: diDscores.
8 End for
9 GPD Parameter Estimation
10  (a) Determine the Tail Threshold
11   ωglobalQuantileDscores,q;
12  (b) Extract Tail Data (Exceedances)
13   TglobaldωglobaldDscores, d>ωglobal;
14  (c) Fit GPD Model using Maximum Likelihood Estimation
15    σ,ξFitGPD_MLETglobal  .
16 Return ωglobal,σ,ξ