AI/ML Microservice

AI Semantic Image Search

FastAPI Microservice Implementing CLIP Semantic Image Search - No Manual Tagging Required

#Python#FastAPI#PyTorch#CLIP#HuggingFace#Docker
Client
VisionBoarder - AI Vision Board Platform, Vancouver Canada
Languages
Python
Fig. 1 — AI Semantic Image Search featured view (click to expand)
01

The Problem

Business Impact

Vision board creation required manual image tagging and keyword-based search - making it impossible to find images by meaning. Users described what they wanted but couldn't find it.

Constraints

Microservice had to be stateless, horizontally scalable, and load the model once at startup for performance.

02

Technical Execution

Architectural Strategy

Built a FastAPI microservice implementing CLIP (Contrastive Language-Image Pre-training) models for high-speed semantic search across image catalogs.

Depth of Execution

User query is converted to a vector embedding. Query vector is compared against pre-computed image embeddings using cosine similarity. Supports batch processing, cross-modal search (text finds images), and multiple languages. Singleton model loading pattern for efficiency.

03

Results

  • Semantic search works across multiple languages with no manual tagging.
  • Cross-modal search - "eine Katze" finds the same images as "cat".
  • Model loads once at startup, minimizing inference latency.
Future Proofing

Containerized with Docker - horizontally scalable by spinning additional microservice instances behind a load balancer.