The invention relates to the field of
computer vision recognition and transfer learning, and provides a
small sample and zero
sample image classification method based on metric learning and meta-learning, which comprises the following steps of: constructing a training
data set and a target task
data set; selecting a support set and a
test set from the training
data set; respectively inputting samples of the
test set and the support set into a
feature extraction network to obtain feature vectors; sequentially inputting the feature vectors of the
test set and the support set into a feature attention module and a
distance measurement module, calculating the category similarity of the test set sample and the support set sample, and updating the parameters of each module by utilizing a
loss function; repeating the above steps until the parameters of the networks of the modules converge, and completing the training of the modules; and enabling the to-be-tested picture and the training picture in the target task data set to sequentially pass through a
feature extraction network, a feature attention module and a
distance measurement module, and outputting a category
label with the highestcategory similarity with the test set to obtain a
classification result of the to-be-tested picture.