This code base contains the code used to pre-process and modeling images taken at 34 poultry farms in Tanzania. We have four classes: healthy, Coccidiosis (cocci
), Newcastle disease (ncd
), and Salmonella (salmo
).
The full published processed annotated dataset can be found on Zenodo. The dataset of poultry fecal images contains four classes for three main computer vision tasks:
- Object Detection
- Segmentation
- Image Classification
Data was collected using Open Data Kit (ODK) app on Android smartphones and stored on Google drive. Code use to for data pre-processing include:
download_files.py
: used Google Drive Downloader to download fecal images dataset from URLs captured by ODK.filelist_img.py
: used to produce a.csv
with a list of all files in a given folder. It maintains the original files names of downloaded image files before renaming them.rename_img.py
: used to rename files in a given folder in the formatclassname.filenumber.extension
e.g. healthy.25.jpg and produces a.csv
file containing a list of new filename and old filename.
We used a dataset of 1,500 images for modeling:
-
Image Classification baseline model on Keras
- Classifier for three classes of salmonella, coccidiosis and healthy.
- Accuracy of 94.12%
-
Machine Learning Application model for image classification of poultry diseases using TensorFlow Lite Model Maker.
- Used MobileNet architecture for training
- Accuracy of 96.8% training and 96.67% on testing
- MobileNet V1 had same accuracy as MobileNet V2 on test dataset
- Exported the
model.tflite
file of MobileNet V1 for deployment on Android.
Android Studio 4.1.3 for TensorFlow Lite model deployment:
- Added the
tflite
model to starter Android app - Built the project and produced the APK file for installation on Android smartphones.
- The final Android Project can be found here.