Skip to main content
. 2026 Sep 17;26(18):5898. doi: 10.3390/s26185898
Algorithm 1 STAG-GuardNet Training and Prediction Framework
  • Require: 

    Training set Dtr, validation set Dval, test set Dte, HHMAO population size M, iteration limit I, and candidate hyperparameter vector θ

  • Ensure: 

    Optimized configuration θ* and predicted attack-state probabilities

  •   1:

    Initialize HHMAO population P={θ(m)}m=1M

  •   2:

    for i=1 to I do

  •   3:

       for m=1 to M do

  •   4:

         Configure STAG-GuardNet using candidate θ(m) and initialize trainable network weights

  •   5:

         for each training epoch do

  •   6:

            for each mini-batch B⊂Dtr do

  •   7:

              Construct the telemetry-adaptive graph and compute graph aggregation P(t)

  •   8:

              Update attack memory M(t) and temporal representation T(t)

  •   9:

              Apply risk-aware attention and obtain predictions y^(t)

  • 10:

              Compute weighted cross-entropy loss L

  • 11:

              Update trainable network weights using Adam and backpropagation

  • 12:

            end for

  • 13:

         end for

  • 14:

         Evaluate θ(m) on Dval using the validation objective F(θ(m))

  • 15:

       end for

  • 16:

       Update candidate configurations using HHO exploration and MRFO refinement

  • 17:

    end for

  • 18:

    Select θ* with the best validation objective and fix the corresponding STAG-GuardNet configuration

  • 19:

    Perform the forward pass on Dte using the fixed trained model without HHMAO updates

  • 20:

    return θ* and test-set attack-state probabilities