Skip to main content
. 2023 Jul 11;23(14):6287. doi: 10.3390/s23146287
Algorithm 3: Adaptive Design Algorithm.
  • [k] = Adaptive(DNN classification results, RF classification results)

  • Input: CIFAR-100(test set), DNN, RF

  • Output: optimal parameter k for the secondary RF model

  • for k{1,100} do

  •     Set all the counters Na,Nb,,Nf to 0

  •     for image x∈ CIFAR-100 do

  •         if xSETcrc&DNN(x)RF(x,k) then

  •            Na++

  •         else

  •            Nd++

  •         end if

  •         if xSETmis&DNN(x)RF(x,k) then

  •            Nb++

  •         else

  •            Ne++

  •         end if

  •         if xSETadv&DNN(x)RF(x,k) then

  •            Nc++

  •         else

  •            Nf++

  •         end if

  •     end for

  •     Objective function f(k)=(Cd·Nd+Ce·Ne+Cf·NfCa·NaCb·NbCc·Nc)

  • end for

  • Among all f(k),k{1,100} find the minimum f(k*)

  • Return the optimal index k*