Research Article

ILCS: An Improved Lightweight Convolution Structure and Mixed Interactive Attention for Steel Surface Defect Classification

Algorithm 2

Top-k accuracy.
(i)Input: Total number of test set images ; list of scores , where is score vector in which each element is a score belonging to a certain class for an image; list of true classes of defects ; is the number of selected sort results.
Output: Top-k accuracy.
(1);
(2)fordo
(3)  ifthen//argsort() is a sort function of python
(4)   ;
(5)return.