The invention relates to the technical field of image recognition and anti-counterfeiting, and particularly discloses a two-dimensional code anti-counterfeiting
label printing source recognition method and
system aiming at the problem of sample imbalance. In order to solve the problem that in the prior art, due to the fact that sample categories are distributed unevenly, the recognition capacity of a model in a few categories of printers is insufficient, and the reliability and robustness of a
system are affected, the invention creatively provides a solution integrating multiple advanced technologies. The
perception and capture capability of the model on the fine texture features of the two-dimensional code is improved from multiple angles, so that the recognition sensitivity on the features of a few types of printers is enhanced; secondly, an optimized CLIP
fine tuning model is adopted, deep fusion of image and text multi-
modal features is achieved, visual and
semantic information in a two-dimensional code
label is fully utilized, and the discrimination ability of the model in different categories and complex environments is improved; and finally, designing and optimizing a
loss function, dynamically fusing
label smoothing and a contrast learning strategy, effectively relieving training deviation caused by
class imbalance, remarkably reducing excessive dependence of the model on
majority class samples, and improving identification accuracy of minority classes and fairness of the whole
system. Through the technical means, the identification
bottleneck caused by sample imbalance in two-dimensional code anti-counterfeit label printing source identification is solved, the reliability, robustness and fairness of the system in a real complex scene are remarkably improved, the misjudgment and missed judgment risks are reduced, and the method has wide application prospects and important practical value.