An AI-powered visual search application that finds similar images using deep learning embeddings and semantic similarity.
Built by: Mayank Bansal, Arnav Godara
Visual Search Engine is a web application that allows users to upload an image and instantly discover visually similar images from a database. Powered by ResNet50 neural networks and FAISS similarity search, it provides fast and accurate results without relying on text-based queries.
- Drag & Drop Interface - Intuitive, user-friendly design
- Real-time Search - Get results in seconds using efficient FAISS indexing
- Deep Learning - ResNet50 pre-trained model for feature extraction
- Semantic Similarity - Find images based on visual content, not metadata
- Responsive Design - Works seamlessly across devices
| Component | Technology |
|---|---|
| Backend | FastAPI (Python) |
| ML Model | ResNet50 (PyTorch) |
| Search Engine | FAISS (Facebook AI Similarity Search) |
| Frontend | HTML, CSS, JavaScript |
| Database | Pre-computed embeddings (NumPy) |
Visual Search Engine/
├── app.py # FastAPI server & API endpoints
├── index.html # Frontend interface
├── script.js # Client-side logic
├── style.css # UI styling
├── dataset/
│ └── images/ # Database of 1000+ images
├── embeddings.npy # Pre-computed image embeddings
├── faiss_index.bin # FAISS index for similarity search
└── image_paths.pkl # Image file paths mapping
- Image Upload → User uploads an image via the web interface
- Feature Extraction → ResNet50 generates a 2048-dimensional embedding
- Similarity Search → FAISS finds the 5 most similar images in the index
- Results Display → Matching images are displayed in the UI
- Python 3.7+
- Required packages (see below)
-
Clone or Download this repository
-
Install Dependencies
pip install fastapi uvicorn torch torchvision pillow numpy faiss-cpu
-
Run the Server
python app.py
The server will start at
http://127.0.0.1:8000 -
Access the Application
- Open
index.htmlin your browser or navigate to the server URL
- Open
Returns API status
Response: {"message": "API is running"}
Search for similar images
- Input: Image file (JPG, PNG, WEBP)
- Output: JSON with 5 most similar image URLs
{
"results": [
"http://127.0.0.1:8000/images/image1.jpg",
"http://127.0.0.1:8000/images/image2.jpg",
...
]
}Pre-trained deep neural network that extracts high-level visual features (2048 dimensions) from images, capturing semantic meaning.
Efficiently searches millions of vectors to find the most similar embeddings using optimized approximate nearest neighbor search.
Enabled for cross-origin requests, allowing the frontend to communicate with the backend seamlessly.
- Open the application in your browser
- Click the upload box or drag & drop an image
- Wait for processing (typically 1-2 seconds)
- View the 5 most visually similar images from the database
- Support for different ML models (VGG16, EfficientNet, Vision Transformers)
- Database management UI for adding/removing images
- Advanced filtering and sorting options
- User authentication and saved searches
- Performance optimization for larger datasets
- Mobile app version
This project is for educational and research purposes.
Last Updated: 2026