Artificial Intelligence 7 min read

Building an End-to-End Image Search System with Milvus and VGG

This article presents a complete image‑search solution that extracts visual features with the VGG16 model, stores them in the Milvus vector database, and provides a set of web APIs for training, querying, counting, searching, and deleting image vectors, all deployed via Docker containers.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Building an End-to-End Image Search System with Milvus and VGG

Background Image retrieval is widely used, with text‑based search relying on tags and content‑based search ("search by image") matching visual similarity for applications such as e‑commerce, design, media, surveillance, and search engines. This work builds an end‑to‑end image‑search pipeline using Milvus and the VGG feature‑extraction model.

System Overview The architecture consists of a web client, a web server, the VGG model for feature extraction, and Milvus as the vector store. The client sends HTTP requests to the server; the server invokes VGG to convert images into vectors, stores them in Milvus, and links the generated vector IDs to the original images kept in SQLite.

VGG Model VGG16, introduced by Oxford's Visual Geometry Group in 2014, demonstrates that deeper CNNs improve performance. It uses stacked 3×3 convolutions and 2×2 max‑pooling to build 16–19‑layer networks, making it a preferred choice for extracting CNN features in transfer‑learning tasks.

Milvus Vector Database Milvus is an open‑source vector database that integrates state‑of‑the‑art indexing techniques such as Faiss and SPTAG, and provides optimized IVF and NSG indexes for high‑speed similarity search on billions of vectors. Vectors are persisted as files in object storage, while queries operate primarily in memory.

API Calls

train API (POST) receives image paths, extracts features via vgg_extract_feat() , and inserts vectors with insert_vectors() , storing the vector‑ID‑to‑image mapping in SQLite.

process API (GET) reports the loading progress of images into Milvus.

count API (POST) returns the total number of vectors (i.e., images) currently stored in Milvus.

search API (POST) accepts a query image, extracts its feature with vgg_extract_feat(img_path) , performs similarity search via search_vectors() , and returns the top‑k most similar vector IDs, which are then matched to original images via SQLite.

delete API (POST) clears the Milvus collection, removing all stored vectors.

System Deployment The solution is containerized: Milvus, the web server, and the web client each run in separate Docker containers. After launching the containers, the service is reachable via http://localhost:8001 . A demo using ~10,000 images from the PASCAL VOC dataset shows successful retrieval of visually similar images (e.g., searching for “airplane”).

Conclusion The presented system enables testers to perform image similarity analysis without deep expertise in TensorFlow, PyTorch, or OpenCV, leveraging Milvus’s AI‑native vector storage and paving the way for Kubernetes‑based deployments.

AIdeep learningvector databaseMilvusimage retrievalVGG
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.