## Если точка не на коже, то удаляем её
'''Input''' : Pretrained CNN filters {<tex>w_1</tex>,..., <tex>w_5</tex>} Initial target state <tex>x_1</tex> '''Output''': Estimated target states <tex>x^*_t</tex> 1: Randomly initialize the last layer <tex>w_6</tex>. 2: Train a bounding box regression model. 3: Draw positive samples <tex>S^+_1</tex> and negative samples <tex>S^-_1</tex>. 4: Update {<tex>w_4, w_5, w_6</tex>} using <tex>S^+_1</tex> and <tex>S^-_1</tex>; 5: <tex>T_s</tex> <tex>\tau_sleftarrow</tex> {1} and <tex>T_l</tex> <tex>\leftarrow</tex> {1} . 6: '''repeat''' 7: Draw target candidate samples <tex>x^i_t</tex>; 8: Find the optimal target state <tex>x^*_t</tex> by Eq. (1). 9: '''if''' <tex>f^+(x^*_t)</tex> > 0.5 '''then''' 10: Draw training samples <tex>S^+_t</tex> and <tex>S^-_t</tex>. 11: <tex>T_s \leftarrow T_s \cup</tex> {<tex>t</tex>}, <tex>T_l \leftarrow T_l \cup</tex> {<tex>t</tex>}. 12: '''if''' |<tex>T_s</tex>| > <tex>\tau_s</tex> '''then''' <tex>T_s \leftarrow T_s</tex> \ {<tex>min_{\upsilon \in T_s} \upsilon</tex>}. 13: '''if''' |<tex>T_l</tex>| > <tex>\tau_l</tex> '''then''' <tex>T_l \leftarrowT_l</tex> \ {<tex>min_{\upsilon \in T_l} \upsilon</tex>}. 14: Adjust <tex>x^*_t</tex> using bounding box regression. 15: '''if''' <tex>f^+(x^*_t)</tex> < 0.5 '''then''' 16: Update {1<tex>w_4, w_5, w_6</tex>} using <tex>S^+_{\upsilon \in T_s} and <tex>S^-_{\upsilon \in T_s}. 17: '''else if''' <tex>t</tex> mod 10 = 0 '''then''' 18: Update {<tex>w_4, w_5, w_6</tex>} using <tex>S^+_{\upsilon \in T_l} and <tex>S^-_{\upsilon \in T_l}. 19: '''until''' end of sequence