input : N training image patches {Xi}Ni=1 with ground truth density maps {DGTXi}Ni=1

output : Trained parameters {Θk}3k=1 for Rk and Θsw for the switch

Initialize Θk ∀ k with random Gaussian weights

Pretrain

{Rk}3k=1 for

Tpepochs :

Rk←fk(\raisebox0.0pt[11.199829pt][3.199951pt]\(⋅\);Θk) ;

/*Differential Training for Td epochs*/
/*Cki is count predicted by Rk for input Xi*/

/*CGTi is ground truth count for input Xi*/ for *t = 1 to Td* do

for *i = 1 to N* do

lbesti=argmink|Cki−CGTi|;

end for

end for

/*Coupled Training for Tc epochs*/

Initialize Θsw with VGG-16 weights ;

for *t = 1 to Tc* do

/*generate labels for training switch*/

for *i = 1 to N* do

lbesti=argmink|Cki−CGTi|;

end for

Strain={(Xi,lbesti)∣i∈[1,N]}

/*Training switch for 1 epoch*/

Train switch with Strain and update Θsw;

/*Switched Differential Training*/

for *i = 1 to N* do

/*Infer choice of Rk from switch*/

lswi=argmax fswitch(Xi;Θsw);

Backpropagate Rlswitchi and update Θlswi;

end for

end for

Comments

There are no comments yet.