Milvus in IP Protection: Building a Trademark Similarity Search System With Milvus

In recent years, the issue of IP protection has come under the limelight as people's awareness of IP infringement is ever-increasing. Most notably, the multi-national technology giant Apple Inc. has been actively filing lawsuits against various companies for IP infringement, including trademark, patent, and design infringement. Apart from those most notorious cases, Apple Inc. also disputed a trademark application by Woolworths Limited, an Australian supermarket chain, on the grounds of trademark infringement in 2009.  Apple. Inc argued that the logo of the Australian brand, a stylized "w", resembles their own logo of an apple. Therefore, Apple Inc. took objection to the range of products, including electronic devices, that Woolworths applied to sell with the logo. The story ends with Woolworths amending its logo and Apple withdrawing its opposition. 

With the ever-increasing awareness of brand culture, companies are keeping a closer eye on any threats that will harm their intellectual properties (IP) rights. IP infringement includes:

  • Copyright infringement
  • Patent infringement
  • Trademark infringement
  • Design infringement
  • Cybersquatting
The aforementioned dispute between Apple and Woolworths is mainly over trademark infringement, precisely the similarity between the trademark images of the two entities. To refrain from becoming another Woolworths, an exhaustive trademark similarity search is a crucial step for applicants both prior to the filing as well as during the review of trademark applications. The most common resort is through a search on the United States Patent and Trademark Office (USPTO) database that contains all of the active and inactive trademark registrations and applications. Despite the not-so-charming UI, this search process is also deeply flawed by its text-based nature as it relies on words and Trademark Design codes (which are hand-annotated labels of design features) to search for images.


The text-based trademark search options offered by the Trademark Electronic Search System (TESS).

This article thereby intends to showcase how to build an efficient image-based trademark similarity search system using Milvus, an open-source vector database.

A Vector Similarity Search System for Trademarks

To build a vector similarity search system for trademarks, you need to go through the following steps:
  • Prepare a massive dataset of logos. Likely, the system can use a dataset like this.
  • Train an image feature extraction model using the dataset and data-driven models or AI algorithms.
  • Convert logos into vectors using the trained model or algorithm in Step 2.
  • Store the vectors and conduct vector similarity searches in Milvus, the open-source vector database.
The workflow of a vector similarity search system for trademarks.
To accelerate the process of feature extraction, you can deploy the trained AI model on multiple servers. However, you do not have to worry about data inconsistency if you use distributed service to process data because you can use Flask to ensure synchronized data processing.

When the system is built, your user only needs to upload an image of a logo, and then the system converts this new image into a new vector using the same AI model you trained. The system searches for similar vectors to the new vector in the Milvus database and returns the corresponding vector IDs. Ultimately, your user will be able to see all the results of similar logos to the one he or she has uploaded. The following screenshot is a demonstration of a vector similarity search system for trademarks. As you can see, the user uploaded the logo, the swoosh, of the sportswear brand Nike. The system returns all images that are similar to this logo.

In the following sections, let's take a closer look at the two major steps in building a vector similarity search system for trademarks: using AI models for image feature extraction, and using Milvus for vector similarity search. In our case, we used VGG16, a convolutional neural network (CNN), to extract image features and convert them into embedding vectors.

Using VGG16 For Image Feature Extraction