Research Article

SLAM: A Malware Detection Method Based on Sliding Local Attention Mechanism

Algorithm 3

Construct SLAM framework.
Input: input_vector, step_size
Output: output
  function MAKE_SLAM (input_vector)
   Initialize length
   Initialize CNN function from CNN layer
   Initialize Softmax function from Dense layer
   Initialize concatenate as a middle layer
   length = get the length of input_vector
   for (index = 0, index < length, index += step_size) do
    temp_tensor = SPLIT_TENSOR (input_vector, index, step_size)
    local_tensor = LOCAL_ATTENTION (temp_tensor, temp_tensor, temp_tensor)
    append local_tensor into concatenate
    end for
    tensor = CNN (concatenate)
    output = Softmax (tensor)
    return output
  end function