How adityaraj1910/marine-animal-classification works
Project Type and Purpose
• This is a full-stack web application:
• Frontend: TailwindCSS + HTML/JavaScript
• Backend: Flask (Python)
• ML inference: TensorFlow Keras models (InceptionV3, ResNet, VGG16)
• Purpose: allow users to upload marine animal images and receive a classification (23 classes) with confidence scores.
Main Architectural Components
a. Client (Web Browser)
• index.html (templates/index.html)
• JavaScript code for drag-and-drop, preview, AJAX calls
• TailwindCSS for styling (static/css)
b. Web Server / Flask App
• Entry point: app.py (or server.py)
• Route definitions (upload endpoint, health check)
• Jinja2 template rendering for GET /
• JSON response for POST /classify
c. Model Inference Modules
• inception_execution.py
• resnet_execution.py
• vgg16_execution.py
Each module:
• Loads pretrained Keras model + custom quantum-like layer
• Preprocesses the image (resize, scale)
• Runs model.predict and returns class + confidence
d. Data Storage
• Local file system for temporarily storing uploaded images
• “dataset” folder (used offline for training, not served in production)
e. Runtime Environment
• Python 3.8+ virtual environment
• requirements.txt (Flask, TensorFlow, etc.)
Component Interactions and Data Flow
1. User drags/drops an image → browser UI
2. Browser sends HTTP POST /classify with image via AJAX
3. Flask receives the request → saves temp image → forwards it to chosen inference module
4. Inference module loads model (cached in memory) → preprocesses image → predicts class
5. Model returns {label, confidence} → Flask wraps into JSON
6. Browser receives JSON → updates UI with results
Architectural Patterns and Principles
• MVC-style separation:
• Model: TensorFlow modules
• View: HTML + CSS + JS
• Controller: Flask route handlers
• Single-process monolith (no external microservices)
• Lazy model loading or warm-up on first request (optimization point)
• Clear separation between static assets and dynamic endpoints
Technologies and Frameworks
• Backend: Python + Flask + Jinja2
• ML: TensorFlow Keras (InceptionV3, ResNet, VGG16)
• Frontend: HTML5, JavaScript, TailwindCSS
• DevOps: requirements.txt for pip; run via python app.py