Production-grade, end-to-end MLOps system for bird disease classification using CNNs, TensorFlow, Flask, Docker, AWS ECR + EC2, and YAML-driven pipelines.
GitHub Repository https://github.com/pankaj2k9/MLOpsE2EBirdDiseaseClassificationDeepLearningProject.git
Live Inference Endpoint http://52.87.125.220/
This repository demonstrates a real-world MLOps workflow that mirrors industry practices used at FAANG-scale ML teams:
- Modular ML pipelines (data → model → evaluation)
- Config-driven experimentation
- Containerized inference service
- Cloud-native deployment (AWS ECR + EC2)
- CI/CD-ready structure
- Clear separation of research, training, and production
Bird diseases can cause large-scale losses in poultry farming. Early detection using image-based deep learning models can significantly reduce impact.
This system:
- Classifies bird diseases from images
- Exposes predictions via a REST API
- Is fully deployable in production environments
Data → Training Pipeline → Model Artifacts → Docker Image
→ AWS ECR → EC2 → Flask API → End User
- Training Pipeline: Modular Python pipelines
- Model: CNN (TensorFlow/Keras)
- Inference: Flask REST API
- Packaging: Docker
- Registry: AWS ECR
- Compute: AWS EC2
├── .github/workflows
│ └── cicd.yaml # CI/CD pipeline
│
├── artifacts # Generated pipeline outputs
├── config
│ └── config.yaml # Centralized configuration
│
├── logs # Pipeline logs
├── model
│ └── model.h5 # Trained CNN model
│
├── notebooks # Experimental notebooks
│ ├── 01_data_ingestion.ipynb
│ ├── 02_prepare_base_model.ipynb
│ ├── 03_model_trainer.ipynb
│ └── 04_model_evaluation.ipynb
│
├── src/cnnClassifier
│ ├── components # Core ML logic
│ ├── pipeline # Pipeline orchestration
│ ├── config # Config manager
│ ├── constants
│ ├── entity
│ └── utils
│
├── templates
│ └── index.html # UI template
│
├── app.py # Flask inference app
├── Dockerfile # Docker image definition
├── setup.py
├── requirements.txt
└── README.md
- Downloads dataset
- Extracts and stores versioned artifacts
- Loads pretrained CNN backbone
- Freezes layers
- Adds custom classifier head
- Trains CNN using TensorFlow
- Saves model as
model.h5
- Evaluates accuracy & loss
- Logs metrics for analysis
| Layer | Technology |
|---|---|
| Language | Python |
| ML Framework | TensorFlow / Keras |
| Model | CNN |
| Backend | Flask |
| Containerization | Docker |
| Registry | AWS ECR |
| Compute | AWS EC2 |
| CI/CD | GitHub Actions |
| Config | YAML |
git clone https://github.com/pankaj2k9/MLOpsE2EBirdDiseaseClassificationDeepLearningProject.git
cd MLOpsE2EBirdDiseaseClassificationDeepLearningProjectpython -m venv venv
source venv/bin/activatepip install -r requirements.txtpython src/cnnClassifier/pipeline/stage_01_data_ingestion.py
python src/cnnClassifier/pipeline/stage_02_prepare_base_model.py
python src/cnnClassifier/pipeline/stage_03_model_trainer.py
python src/cnnClassifier/pipeline/stage_04_evaluation.pypython app.pyAccess:
http://localhost:8080
docker build -t bird-disease-classifier .docker run -p 8080:8080 bird-disease-classifier- EC2 → Virtual Machine
- ECR → Docker Image Registry
Attach the following policies to your IAM user or role:
AmazonEC2ContainerRegistryFullAccess
AmazonEC2FullAccess
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
AWS_ECR_LOGIN_URI=
ECR_REPOSITORY_NAME=simple-appdocker build -t simple-app .aws ecr get-login-password --region us-east-1 \
| docker login --username AWS --password-stdin AWS_ECR_LOGIN_URIdocker tag simple-app:latest \
AWS_ECR_LOGIN_URI/simple-app:latestdocker push AWS_ECR_LOGIN_URI/simple-app:latestsudo apt-get update -y
sudo apt-get upgrade -ycurl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker ubuntu
newgrp dockerdocker pull AWS_ECR_LOGIN_URI/simple-app:latestdocker run -d -p 8080:8080 \
AWS_ECR_LOGIN_URI/simple-app:latesthttp://52.87.125.220/
| Layer | Purpose |
|---|---|
research/ |
Experimentation & prototyping |
src/ |
Production-ready pipelines |
artifacts/ |
Versioned ML outputs |
app.py |
Inference service |
- MLflow model registry
- Data & concept drift monitoring
- Canary deployments
- Auto-retraining
- GPU-enabled EC2
- Auth & rate-limiting
- Kubernetes (EKS)
Pankaj Kumar Pramanik AI & Data Engineer | MLOps | Deep Learning
🌐 Portfolio: https://pankajpramanik.com