Deep learning – disease detection in chicken faeces

Motivation

Chickens in commercial broiler farms suffer from a variety of disease. Given the density of the chicken population (typically 14-17 birds per m2), these diseases spread quickly. And given the amount of chickens per barn (30-50,000) and the number of hours per day available for a barn (probably <4h), there is a need to detect illnesses very fast and provide a remedy if possible.

The data

In a public dataset published on Kaggle 224×224 images have been collected in small to medium scale chicken farms in the Arusha and Kilimanjaro regions in Tanzania between September 2020 and February 2021. The dataset provides about 8000 annotated images in 4 classes: “Healthy”, “Coccidiosis” ,”New Castle Disease”, and “Salmonella”.

Digestive diseases in chickens

Illnesses in chicken barns can be roughly classified into

  • Respiratory diseases (e.g. cough, flu)
  • Skeleton-based diseases (e.g. lameness, pododermatitis)
  • Diseases that affect the digestive tract

Diseases that affect the digestive tract have by nature an impact on the conversion of feed into meat and are therefore very relevant for the well-being of the bird as well as for the financial performance of the barn.

The three diseases coccidiosis, New Castle disease and salmonella are the most common diseases that affect the digestive tract. Many farms vaccinate against the coccidiosis and New Castle disease because of their very strong impact on the birds. Salmonella on the other hand is the most critical public health issue arising from chicken production. Salmonella hospitalizes and kills more people in the U.S. than any other foodborne pathogen, with about 1.35 million illnesses, 26,500 hospitalizations and more than 400 deaths each year. While most people recover, some are left with long-term conditions like arthritis or irritable bowel syndrome [Shaji et al, 2023].

Recognising these illnesses while walking the barn is not an easy task. For this reason, an automated recognition system would be ideal (such as the ChickenBoy, see e.g. here). Alternatively, a simple mobile phone application with some statistical analysis might already be an excellent first step.

Results

We built a prototype classifaction system that correctly classifies the pictures with a 95%-97% F1-score for the different classes. We used transfer learning on a convolutional network based with EfficientNet.

In this unnormalised confusion matrix we show the result of testing the model on an 807 test images.

The vertical axis denotes the true label and the horizontal label the predicted label.

In total, 3% or 25 images were misclassified while the remainder was classified correctly.

On the right, some example pictures.

Next steps

Thanks to the large amounts of single images of good quality of faeces in the different classes, the classification task was very successful. We were able to identify all classes with an F1-score exceeding 95%. This was made possible by using data augmentation and the excellent EfficientNet.

Of course, the images are simple: there is a single dropping on each picture and the lighting conditions in most pictures are good. In practice, we have found that the search for a dropping in a picture is a significant task, in particular under normal lighting conditions in commercial broiler operations. However, this simple example shows that a disease detection based on feaces is feasible.

Logical next steps would be:

  • Acquisition of pictures directly from a camera, e.g. a mobile phone
  • Localisation of individual faeces, possibly scoring each dropping (for its likelihood to be a dropping) and analysing the best.
  • Creating a simple mobile phone app to classify the dropping and run some statistics
References

The code is available on github.