Network Traffic Obfuscation against Traffic Classification
Algorithm 4
Improved MIM using method 2.
Input: classifier f; loss function J; original sample x; authentic label y; disturbance size α; fixed number of iterations n; number of iterations T; attenuation factor μ.
output: adversarial sample.
(1)
;
(2)
;
(3)
for to do
(4)
get gradient of func f with respect to ;
(5)
//update momentum
(6)
(7)
//update adversarial sample
(8)
(9)
if then
(10)
modify according to x;
(11)
end if
(12)
end for
(13)
//according to truncate ;
(14)
set all elements greater than 0 in the vector to ;