The graphic element of a trademark is an important basis for the examiners to judge whether two trademarks are similar during trademark examination. However, due to the many possible interpretations of trademark graphic elements, different examiners may have different understandings of the same trademark graphic elements, resulting in rich semantic information in trademark images. Contrastive learning trains the model by maximizing the semantic information of positive samples, which can distinguish trademark images according to their unique semantic information, which is helpful for downstream tasks such as trademark retrieval. In order to fully understand the semantic information of trademark images, for the first time, introduced contrastive learning into the field of trademark retrieval. Firstly, a series of preprocessing methods that can enhance semantic information are used to preserve the semantic information contained in the trademark image; Then group the data according to the positive and negative sample views generated by the trademark image, and focus on learning the same semantic information between positive samples and the difference information between positive and negative samples; The extracted semantic information helps the model to distinguish whether the two trademark images are semantically similar, and ultimately improves the average accuracy of trademark retrieval. The test results on METU, a public million-level trademark dataset, show that compared with the existing state-of-the-art trademark retrieval methods, the proposed algorithm improves the mAP
@100 from 55.0% to 72.6%.