Skip to main content
. 2023 Jul 19;23(14):6507. doi: 10.3390/s23146507
Algorithm 2 CNN-based detection model.
  • 1:

    procedure Evaluate1DCNN(X, y, Sf)

  • 2:

        Input: X (network flows), y (labels), and Sf features

  • 3:

        Output: Performance evaluation metrics

  • 4:

        Define 1D CNN architecture: set activation function, normalization, regularization, and dropout layers

  • 5:

        Compile 1D CNN model

  • 6:

        Initialize batch size, optimizer, learning rate, number of epochs (n), early stopping criteria (esc)

  • 7:

        for i in 1 to n do

  • 8:

            while (esc)

  • 9:

            Train 1D CNN model using training data based on Sf features

  • 10:

            end while

  • 11:

        Evaluate the 1D CNN model and calculate metrics based on the predictions and y labels

  • 12:

        Return the calculated metrics