A state-of-the-art deep learning project for classifying chicken diseases using fecal image analysis. This project implements a complete machine learning pipeline from data ingestion to model deployment, utilizing Convolutional Neural Networks (CNNs) for accurate disease detection.
- Project Overview
- Features
- Project Benefits
- Project Architecture
- Installation
- Usage
- Model Training and Evaluation
- Deployment
- License
Early detection of diseases in poultry farming is crucial for maintaining bird health and optimizing production. This project aims to automate the process of identifying chicken diseases through the analysis of fecal images, providing a quick and non-invasive diagnostic tool for farmers and veterinarians.
- Data ingestion pipeline for processing fecal images
- Custom CNN architecture based on VGG16 for image classification
- Transfer learning techniques for improved model performance
- Modular and scalable code structure
- CI/CD pipelines for AWS and Azure deployment
- Interactive web interface for real-time disease classification
This Chicken Disease Classification project offers several potential benefits to the poultry farming industry and beyond:
-
Early Disease Detection: Enables rapid identification of potential health issues in chicken flocks, allowing for timely intervention and treatment.
-
Cost-Effective Monitoring: Provides a non-invasive and cost-efficient method for regular health checks, reducing the need for expensive and time-consuming laboratory tests.
-
Improved Farm Management: Helps farmers make data-driven decisions about flock health, potentially improving overall farm productivity and profitability.
-
Scalable Solution: The modular architecture allows for easy scaling and adaptation to different farm sizes and types.
-
Reduced Antibiotic Use: By enabling early and accurate disease detection, the system may contribute to more targeted use of antibiotics, addressing concerns about antibiotic resistance.
-
Enhanced Food Safety: Indirectly contributes to food safety by promoting healthier flocks and potentially reducing the spread of diseases.
-
Research Tool: Serves as a valuable tool for veterinary researchers studying poultry diseases and their manifestations.
-
Technology Integration: Demonstrates the potential of AI and machine learning in agriculture, paving the way for further technological advancements in the field.
Chicken-Disease-Classification/
│
├── artifacts/ # Model artifacts and pipeline outputs
├── config/ # Configuration files
├── logs/ # Log files
├── research/ # Jupyter notebooks for experimentation
├── src/ # Source code
│ └── cnnClassifier/
│ ├── components/ # Individual pipeline components
│ ├── config/ # Configuration management
│ ├── constants/ # Project constants
│ ├── entity/ # Data models and schemas
│ ├── pipeline/ # ML pipeline modules
│ └── utils/ # Utility functions
│
├── static/ # Static files for web interface
├── templates/ # HTML templates
├── tests/ # Unit and integration tests
├── .dvcignore
├── .gitignore
├── app.py # Flask application
├── dvc.yaml # DVC pipeline configuration
├── params.yaml # Model parameters
├── requirements.txt # Project dependencies
└── setup.py # Package and distribution management
The PoultryPro web interface provides an intuitive and user-friendly way to interact with our AI-powered Chicken Health Analyzer. Here are some key features of the interface:
- Upload Image: Users can easily upload chicken fecal images for analysis.
- Instant Analysis: With a single click, the AI model analyzes the uploaded image.
- Clear Results Display: Analysis results are displayed in a clean, easy-to-read format.
- Responsive Design: The interface is designed to work seamlessly on various device sizes.
This screenshot shows the main interface of PoultryPro. It features a clean layout with an area to upload and display the image, and a section to show analysis results.
This screenshot demonstrates the analysis results for a sample image. The interface clearly displays the detected condition (in this case, "Coccidiosis") based on the AI model's analysis.
The web interface is designed to be intuitive, allowing users to quickly upload images and receive instant analysis results, making it an efficient tool for poultry health management.
-
Clone the repository:
git clone https://github.com/your-username/Chicken-Disease-Classification-Project.git cd Chicken-Disease-Classification-Project -
Create and activate a conda environment:
conda create -n cnncls python=3.8 -y conda activate cnncls
-
Install the required packages:
pip install -r requirements.txt
To run the application locally:
python app.pyNavigate to http://localhost:5000 in your web browser to access the interface.
We use DVC to manage our ML pipelines. Here are the main commands:
dvc init
dvc repro
dvc dag- Update
config.yaml - Update
params.yaml - Update the entity
- Update the configuration manager in
src/config - Update the components
- Update the pipeline
- Update
main.py - Update
dvc.yaml
- Set up user with programmatic access
- Assign following permissions:
- EC2 access: Allows management of virtual machines
- ECR: Elastic Container Registry to store docker images
Required Policies:
AmazonEC2ContainerRegistryFullAccessAmazonEC2FullAccess
Deployment Process Overview:
- Build docker image of the source code
- Push docker image to ECR
- Launch EC2 instance
- Pull image from ECR to EC2
- Launch docker image in EC2
- This will store/save your docker image
- Note the URI, e.g.,
566373416292.dkr.ecr.us-east-1.amazonaws.com/chicken
- Choose Ubuntu as the operating system
# Update and upgrade packages
sudo apt-get update -y
sudo apt-get upgrade
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker ubuntu
newgrp docker- In your GitHub repository, go to Settings > Actions > Runner
- Click on "New self-hosted runner"
- Choose the operating system
- Follow the command-line instructions provided
In your GitHub repository, go to Settings > Secrets and add the following:
AWS_ACCESS_KEY_ID=<your-access-key>
AWS_SECRET_ACCESS_KEY=<your-secret-key>
AWS_REGION=us-east-1
AWS_ECR_LOGIN_URI=566373416292.dkr.ecr.ap-south-1.amazonaws.com
ECR_REPOSITORY_NAME=simple-app
With these steps completed, your AWS CI/CD pipeline with GitHub Actions should be ready to deploy your application automatically when you push changes to your repository.
Azure provides a straightforward way to set up CI/CD deployment using GitHub Actions. Follow these steps to deploy your application:
- Create an Azure Container Registry
- Note down the login server name
Run these commands from your local terminal:
# Build the Docker image
docker build -t chickenapp.azurecr.io/chicken:latest .
# Login to your Azure Container Registry
docker login chickenapp.azurecr.io
# Push the image to ACR
docker push chickenapp.azurecr.io/chicken:latestf4897a40b880c27cdd046e1748f8eb0148668ba6
- Create a Web App in Azure
- Configure it to use the Docker Container from ACR
Azure can automatically set up GitHub Actions for your CI/CD pipeline:
- In the Azure portal, navigate to your Web App
- Go to the "Deployment Center" section
- Choose GitHub as your source control
- Authenticate and select your repository
- Azure will automatically generate and commit a GitHub Actions workflow file to your repository
- Build the Docker image of the Source Code
- Push the Docker image to Container Registry
- Launch the Web App Server in Azure
- Pull the Docker image from the container registry to Web App server and run
With these steps completed, your Azure CI/CD pipeline with GitHub Actions will automatically deploy your application when you push changes to your repository.
Note: Ensure that you keep any automatically generated files and credentials secure, as they may contain sensitive information about your Azure resources.
- Shivam Dali is a Data Science graduate student from Adelaide University. Connect with him on LinkedIn and explore more projects on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
- Krish Naik for the inspiring tutorial
- Medium Article - Read the detailed project review on Medium.
- GitHub Repository - Access the code and project files.
- LinkedIn - Connect with me on LinkedIn.
I followed this tutorial: End To End NLP Project Implementation With Deployment Github Action- Text Summarization- Krish Naik

