Skip to main content
. 2025 Aug 13;25(16):5016. doi: 10.3390/s25165016
Algorithm 1 LA-EAD inference process
Input: input image I, EfficientAD model EAD, proposed extractor E, precomputed covariance matrix Σ, precomputed feature vector fm, precomputed normalization parameters μp, σp, μu and σu
Output: final anomaly score sfinal
  •   1:

    Extract features from the proposed extractor E

  •   2:

    Get output feature of the proposed extractor for I:

  •   3:

        fc,w,h=E(I)

  •   4:

    Compute global average pooled feature vector:

  •   5:

        ftest=(HW)1h=1Hw=1Wfc,w,h(asEquation(4))

  •   6:

    Calculate anomaly score su of the logical anomaly detection module:

  •   7:

    Compute Mahalanobis distance using precomputed fm and ftest:

  •   8:

        su=(ftestfm)TΣ1(ftestfm)(asEquation(8))

  •   9:

    Get anomaly score sp from EfficientAD

  • 10:

    Feed the image I into EfficientAD for the inference process and obtain the anomaly score:

  • 11:

        sp=EAD(I)

  • 12:

    Normalize and fuse scores

  • 13:

    Perform separate normalization on the sp and su, with the normalization parameters (mean and variance) calculated from the inference results of the validation subset. (following PUAD [24])

  • 14:

        spnorm=spμpσp,sunorm=suμuσu

  • 15:

    Compute final anomaly score:

  • 16:

        sfinal=spnorm+sunorm

  • 17:

    return sfinal