Skip to main content
. 2026 Jun 23;16(13):1953. doi: 10.3390/diagnostics16131953
Algorithm 1 Ensemble fusion strategy with score normalization
Require:
  • 1:

    •        Test sample x

    •        Raw Shape Template Matching score: SSTMraw(x)∈R

    •        Raw TimeVAE anomaly score: SVAEraw(x)∈R

    •        Binary output from Enhanced DTW: DDTW(x)∈{0,1}

    •        Validation set V (for min-max bounds)

    •        Secondary fusion threshold: τfused

Ensure: Final binary decision Dfinal(x)∈{0,1}, where 1 denotes anomalous and 0 normal.
  • 2:

                         ▹ Step 0: Normalize raw scores to [0,1]

  • 3:

    SSTM←NormalizedSSTMraw(x)

  • 4:

    SVAE←NormalizedSVAEraw(x)

  • 5:

                          ▹ Step 1: Preserve all DTW positives

  • 6:

    if  DDTW(x)=1  then

  • 7:

         Dfinal←1

  • 8:

    else                ▹ Step 2: Fuse deep learning and shape scores

  • 9:

         Sfused←SSTM×SVAE             ▹ Step 3: Apply secondary threshold

  • 10:

          if Sfused>τfused then

  • 11:

             Dfinal←1

  • 12:

          else

  • 13:

             Dfinal←0

  • 14:

          end if

  • 15:

    end if

  • 16:

    return  Dfinal