ImageClassifier is a machine learning project aimed at classifying images using the ResNet50 architecture. It leverages Kubernetes for deployment and scaling, ensuring high scalability and efficiency.
The core component of this project is the Dispatcher, a Dockerized container that serves as an access point to image classification deployments. A load testing script sends images to this Dispatcher service, which then forwards requests to the appropriate deployment through load balancing.
Custom metrics are collected by Prometheus, which the monitoring component uses to enable an autoscaler. This autoscaler adjusts the number of deployments based on the incoming request load.
- Accurate Classification: Achieves high accuracy with the ResNet50 architecture on various image datasets.
- Extensibility: Easily add new models and datasets.
- Scalable Deployment: Dispatcher is containerized with Docker and deployed in Kubernetes for easy scaling and management.
- Load Testing: Simulates real-world usage by sending images to the Dispatcher service.
- Dynamic Scaling: Uses Prometheus to fetch custom metrics, enabling the autoscaler to dynamically adjust the number of deployments based on request load.
- Python 3.x
- minikube
- Helm
- Prometheus Community
- Virtual Environment
-
Clone the repository:
git clone https://github.com/RoboTechP/ImageClassifier.git cd ImageClassifier
-
Run the model download script
python downloadmodel.py
-
Apply the Kubernetes deployment:
kubectl apply -f kubernetes/deployment.yaml
-
Create the Dispatcher service:
kubectl apply -f kubernetes/dispatcher-service.yaml
-
Run the load tester
cd loadGen python3 -m venv venv source venv/bin/activate pip install -r requirenments.txt python loadtester.py
-
Run the autoscaler
In the same virtual environment enabled terminalcd monitoring python autoscaler.py
kubernetes/
: Contains Kubernetes configuration filesloadGen/
: Contains the load testing scriptmonitoring/
: Contains the autoscaler script
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License