A full-stack image classification web application that identifies birds, plants, and animals using pretrained HuggingFace & BioCLIP machine learning models, with additional species information retrieved from internal datasets and an external LLM API when applicable.
The project focuses on backend architecture, service separation, and reliable API design rather than training custom ML models.
- Overview
- Application Snapshots
- Features
- Architecture
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Documentation
- Project Structure
- Testing
- License
Feather Scan is a three-service web application for classifying uploaded images as birds, plants, or animals.
It consists of a React frontend, an Express + TypeScript backend, and a FastAPI-based ML inference service. The backend handles authentication, validation, file uploads, saving user prediction history in the database, and mediates all communication with the ML service.
Inference uses pretrained Hugging Face and BioCLIP models, with bird predictions enriched using the Gemini API.
- Upload an image of (up to 5 MB) and classify it as a bird, plant, or animal
- Animal & plant species information retrieval from database, and bird species enrichment using Gemini API
- Confidence score & additional info returned with each prediction
- Clear separation between frontend, backend, and ML services
- Centralized request validation and file handling in the backend
- Backend-to-ML communication via HTTP REST APIs
- FastAPI-based ML inference service
- Automated backend tests using Jest and Supertest on push using Github Actions
Feather Scan follows a service-separated architecture to keep concerns isolated and the system easy to reason about.
graph TD
Client[Frontend<br/>React + Vite<br/>:5173]
Backend[Backend API<br/>Express + TypeScript<br/>:3000]
ML[ML Inference Service<br/>FastAPI<br/>:5000]
DB[(MongoDB)]
Auth[Firebase]
Info[JSON DB]
Client -->|POST /upload| Backend
Backend -->|JSON Response| Client
Backend -->|POST /predict| ML
ML -->|Prediction Result| Backend
ML -->|Fetch Species Info| Info
Backend -->|Validate & Store History| DB
Backend -->|Verify Token| Auth
- The client uploads an image along with the selected model type.
- Backend receives request; authentication is handled via Firebase. The backend verifies ID tokens and associates predictions with user history.
- The image is forwarded to the ML service for inference:
- Birds and plants use pretrained Hugging Face models.
- Animals use BioCLIP for zero-shot classification.
- For bird predictions, additional species information is generated using Gemini API.
- For animal & plant predictions, info is retrieved from a database based on predicted label.
- The backend returns a structured JSON response (label, confidence, info) to the client for display.
| Category | Model | Source | Type |
|---|---|---|---|
| Birds | chriamue/bird-species-classifier |
Hugging Face | Pretrained classifier |
| Plants | dima806/medicinal_plants_image_detection |
Hugging Face | Pretrained classifier |
| Animals | imageomics/bioclip-2 |
BioCLIP | Zero Shot |
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download
- Python (v3.9 or higher) - Download
- npm or yarn - Comes with Node.js
- pip - Python package manager
- Git - Version control
git clone https://github.com/devansh436/feather-scan.git
cd feather-scannpm installcd client
npm install
cd ..cd server
npm install
cd .. cd model
pip install -r requirements.txt
cd ..Create .env files in the respective directories:
VITE_API_BASE=http://localhost:3000
VITE_FIREBASE_API_KEY=<your-key>
VITE_FIREBASE_AUTH_DOMAIN=example-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=example-project-a1b2c3
VITE_FIREBASE_APP_ID=x:123456789:web:e1x1m1p1lePORT=3000
FAST_API_URL=http://localhost:5000/predict
MONGO_URI=<your-mongo-uri>GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_MODEL=gemini-2.5-flashFrom the root directory:
npm run devThis starts all three services simultaneously:
- π¨ Client: http://localhost:5173
- π Server: http://localhost:3000
- π€ Model: http://localhost:5000
Open your browser and navigate to:
http://localhost:5173

Accepts an image and model type, returns the predicted label and confidence.
Request
- contains auth token
multipart/form-datafile: image (jpg/png)modelType:bird | plant | animal
Response
{
"label": "bald eagle",
"type": "bird",
"confidence": 0.95,
"info": {
"name": "Bald Eagle",
"scientific_name": "Haliaeetus leucocephalus",
"habitat": "Near large bodies of open water, forests",
"origin": "North America",
"description": "A large bird of prey known for its white head and tail."
}
}API details are intentionally kept minimal, as the backend is not intended for third-party consumption.
feather-scan/
β
βββ client/ # Frontend React application
β βββ src/
β β βββ components/ # React components
β β βββ context/ # Auth context
β β βββ data.js/ # Static data
β β βββ lib/ # firebase setup
β β βββ services/ # API calls & auth functions
β β βββ pages/ # Page components
β β βββ App.jsx # Main app component
β β βββ main.jsx # Entry point
β βββ public/ # Static assets
β βββ package.json
β βββ vite.config.js # Vite configuration
β
βββ server/ # Backend Express API
β βββ src/
β β βββ __tests__/ # Testing setup & files
β β βββ routes/ # API routes
β β βββ config/ # Configure database, Auth & env variables
β β βββ controllers/ # Implementation of routes (History, Upload, User, etc.)
β β βββ middleware/ # Auth middleware
β β βββ models/ # User & History models
β β βββ validators/ # Model response validation via Zod
β β βββ app.ts # Express app using created routes
β β βββ index.ts # Server entry point
β βββ package.json
β βββ tsconfig.json # TypeScript config
β
βββ model/ # ML inference service
β βββ data/ # Static species data
β βββ main.py # FastAPI application
β βββ model.py # Model loading & inference
β βββ requirements.txt # Python dependencies
β
βββ .github/
β βββ workflows/ # CI/CD workflows
β βββ test.yml # Automated testing
β
βββ package.json # Root package (scripts)
βββ README.md
Run backend tests:
cd server
npm testTests are automatically run on push via GitHub Actions.
- Used pretrained ML models to focus on backend architecture and system integration.
- Isolated ML inference into a separate FastAPI service to keep the Node.js backend non-blocking.
- Centralized validation and file handling in the backend to avoid exposing the ML service.
- Implemented backend testing early using Jest and Supertest to ensure API stability.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by devansh436


