Deep Convolutional Neural Network for Chicken Diseases Detection

For many years in the society, farmers rely on experts to diagnose and detect chicken diseases. As a result, farmers lose many domesticated birds due to late diagnoses or lack of reliable experts. With the available tools from artificial intelligence and machine learning based on computer vision and image analysis, the most common diseases affecting chicken can be identified easily from the images of chicken droppings. In this study, we propose a deep learning solution based on Convolution Neural Networks (CNN) to predict whether the faeces of chicken belong to either of the three classes. We also leverage the use of pre-trained models and develop a solution for the same problem. Based on the comparison, we show that the model developed from the XceptionNet outperforms other models for all metrics used. The experimental results show the apparent gain of transfer learning (validation accuracy of 94% using pretraining over its contender 93.67% developed CNN from fully training on the same dataset). In general, the developed fully trained CNN comes second when compared with the other model. The results show that pre-trained XceptionNet method has overall performance and highest prediction accuracy, and can be suitable for chicken disease detection application. Keywords—Image classification; Convolutional Neural Networks (CNNs); disease detection; transfer learning


I. INTRODUCTION
The poultry sector in Tanzania is economically significant, supporting up to 37 million households. The farmers in the country keep different birds, whereby chicken account for 96% of all livestock in the country [1], [2]. However, the growth rate of the poultry population is low, with an average of 2.6% annual growth in Tanzania mainland [1]. Production is greatly affected by different challenges like unreliable markets, scarce inputs [3], [4], shortage of timely extension information [5] and devastating diseases like Newcastle, Coccidiosis and Salmonella [6].
Coccidiosis is caused by parasites of the genus Eimeria that affects the intestinal tracts of poultry. Chicken are host to seven species of Eimeria. Coccidiosis is ranked as a leading cause of death in poultry with Eimeria tenella (E.tenella) among the most pathogenic parasite [7]. The typical diagnostic procedure involves counting the number of oocysts (expressed as oocysts per gram [opg]) in the droppings or examining the intestinal tract to determine the lesion scores [8].
Salmonella are bacterial pathogens of genus Salmonella that causes the disease to poultry and humans. Salmonella pullorum (SP) and Salmonella gallinarum (SG) pathogens cause pullorum disease and fowl typhoid in poultry, respectively. Salmonella enteritidis (SE) and Salmonella typhimurium (ST) strains are associated with human infections transmitted through the food-chain of poultry and poultry products [6]. Polymerase Chain Reaction (PCR) procedure is used for the detection and identification of the various Salmonella strains. The diseases have a significant negative economic impact on poultry farmers resulting to high economic losses.
Disease diagnostics in chicken involves different methods including counting the number of oocytes in the stool or intestinal scrapings [7], [8], isolation and identification and PCR procedures which takes several diseases to diagnose. The main way of transmission of the diseases is through contaminated feed, excretions from infected chicken or oral via the navel. The clinical signs in the infected chicken may be either digestive or respiratory. This work focuses on the digestive signs of the diseases because occurrence of the disease in the chicken influences the colour of the droppings.
The digestive clinical sign of chicken infected with coccidiosis is severe blood/ brown diarrhea; salmonella is white diarrhea.
Images are artefacts that depict visual perception. They have been used for diagnosis and detection in various fields including medical, agricultural and other fields [9], [10]. There are different existing image datasets that are on the cloud accessed when training different models. These datasets include Fashion-MNIST, CIFAR-10, ImageNet to mention a few. Various computer vision studies have used image datasets in either classification, detection, recognition and segmentation of different research problems. Recently, the character portrayal is commonly used in disease diagnostics using images. Different levels of features are captured and analyzed based on various aspects, including colour. Normally, classification quality depends on feature presentations in the images. Images are preprocessed (labelled and tuned) in order to maintain the realization of the former facts. Therefore, a data-driven approach for image classification is more robust towards the variety of image attributes and diseases. Albarqouni et al. [9] used breast cancer histology images for detection of breast cancer disease; also Zhang et al. [11] applied ultrasound images in the detection of ovarian tumours. Ashraf et al. [12] worked to improve disease diagnostics using different body parts image dataset. Similarly, In the agricultural field, researchers in [10], [13]- [15] have created and used leaf image datasets in the diagnosis of diseases in different plants like tomato, cassava, bananas and wheat. Classical machine learning techniques have been used in earlier studies for disease detection and classification. Sadeghi et al. [16] used Support Vector Machine (SVM) and Decision Tree to detect sick chickens infected with clostridium perfringens using the sound they make. In their study, vocals from both health and unhealthy chickens were taped. Facets were extracted and used to train the classifiers, whereby the accuracy of the neural network increased gradually up to 100%. Zhuang et al. [17] also used SVM approach to detect sick broilers infected with bird flu. Their work proposed an algorithm to classify the isolated inoculated broilers based on the analyzed structures and features, and the algorithm attained an accuracy rate of 99% when evaluated on the test data. Hepworth et al. [18] predicted the regularity occurrence of hock burn, swelling skin around the hock in broiler chicken. Data from farms were collected in a period of over 36 months and, learned variables of dependency were extracted, and a classifier was trained to attain an accuracy of 78%. In work by Hemalatha et al. [19] SVM was used to diagnose avian pox in chicken, images of chicken from the farm were collected then split into training and test sets. The classifier was trained on the data and obtained an accuracy of 92.7%.
Despite good prediction performance of the classical machine learning approaches, Ferentinos et al. [20] presented that traditional machine learning techniques are constrained in images and features processing. The deep learning techniques have gained more attention in computer vision and image classification, particularly in enhancing the performance of image classification and retrieval as opposed to traditional machine learning approaches. Therefore, in this research a Convolution Neural Network (CNN) is used due to the following reasons: (i) It involves multi-layer processing. (ii) It allows optimization of the extracted features. (iii) It is fast and requires less computational power. Deep Convolution Neural Networks (DCNN) enable the computer to interpret captured data objects (feature extraction and representation) for classification, localization and recognition to be automatically learned [21]. It has been used for early disease detection in both plants (crops) and animals [10].
Transfer learning (TL) refers to the use of a known model used in a previously known dataset to another application in the same machine learning domain. For computer vision, transfer learning is widely used in different applications. The most known and common pre-trained models include VGG, Resnet, Inceptionnet and other well-known models [22]. The idea of using pre-trained models makes a considerable revolution in the field of Artificial Intelligence enabling models to be developed from very little data. There are two main advantages when using TL [23]. First, it performs well on both large and smaller datasets. Secondly, it is easy to reduce overfitting of the model with larger dataset when it is applied to pre-trained model [23]. Since our problem is a computer vision problem, we use TL, and also we develop our CNN architecture, and compare the results with the best pre-trained model.
The objective of this research is to build a model for early detection and classification of diseases in chicken using our developed dataset of faecal images collected in different poultry farms and inoculation sites.
The rest of the paper is organized as follows: Section II describes the materials and methods used for the disease   TABLE I. DATASET SPLITTING TRAINING, VALIDATION AND TESTING  SETS.   Class  Image in each Class  Training  Validation  Test   Health  508  305  102  102  Coccidiosis  516  310  103  103  Salmonella  566  340  112  113  Total Images  1590  955  317  318 detection, Section III gives the results and discussion lastly, Section IV concludes the study and presents future work.

A. Experimental Setup
The model is generated from the Kaggle Environment, and we run the training set under TPU-v3.8 environment using python v3.7 in a 16 GB RAM computer. We avoid to alter the images since we have collected data using mobile phone cameras and assumption made is the end-user will use unaltered images for prediction. However, we stated earlier that the images need to be converted to either 224 × 224 or 512 × 512 pixels as shown in the Table II.

B. Dataset
In this work, we collected faecal images from small scale farmers and inoculation sites in Kilimanjaro and Arusha regions from February to June 2020. We used different mobile phone cameras with different resolutions and images were in a Joint Photographic Group (JPG) format. A total of 1590 images were collected and distributed to 3 class labels. Health 508 images, Coccidiosis 516 images and Salmonella 566 images. We managed to have a dataset that meets our exact specifications of different images, as shown in Fig. 1. The images were then split into training 60%, validation 20% and testing 204% that is 955 images for training, 317 images for validation and 318 images for testing as illustrated in Table I.

C. Pre-Processsing
Deep Learning is a class of machine learning algorithms inspired by the structure of the human brain. Deep Learning algorithms use complex, multilayered neural networks, where the level of abstraction increases gradually by non-linear transformations of input data. DL demonstrates a high ability to solve image classification problems since it learns from the image features. Image classification techniques are naturally based on two stages: one is the mining of features, and the other is the classification component.
Images in the dataset are labelled as per respective classes then converted into tensor records [24] in different resolutions 224 × 224 and 512 × 512 pixels and compressed in order to minimize training time. The advantage of resizing the images is to achieve reasonable resolution since a constant input dimensionality of the data is needed by CNN to train the optimized model [25].

D. Proposed Model
This study uses architectures designed for image classification including VGG [26], Resnet [27], XceptionNet [28] and Mobile net [29]. The VGG 16 and 19 refer to the number of weighted layers in each network, consisting of blocks with incremental convolution layers with a 3 × 3 size filters, a high number of parameters and requires a considerable amount of time to train [26]. A study by [30] proposed a TL strategy for image recognition using the VGG 16 architecture, where it was trained on a small dataset and achieved an accuracy of about 87%. They compared the results with training the same dataset on a fully untrained VGG 16 architecture and attained an accuracy of 46%. This supports the proposed argument on using a pre-trained CNN in our work. In addition, [31] used a pre-trained VGG 16 and 19 architectures on palm vein recognition problem with an accuracy of 90% and 92% respectively. Resnet architecture is built up with residual connections that are networks within networks. Different Resnets are available varying in numbers of layers, commonly used is the Resnet 50 that consists of 50 layers. Despite the fact that it has more layers than the VGG, it consumes less memory when training [27]. XceptionNet architecture optimizes the convolutions in inception so that they consume less memory during training [28]. MobileNet is an efficient architecture for models deployed in mobile devices. It consists of trivial separable layers of neural networks created from depth-wise distinguishable convolution filters. The mechanism behind each input network is from one convolution filter that is 1 × 1 convolutions [32]. A study conducted by [33] compared pretrained models including Resnet 50, Mobilenet and VGG 19 for diagnosis of Pneumonia disease. The architectures had an accuracy of 87%, 92% and 90% respectively. From the previous studies, it is evident that no architecture performs well on every problem; this motivates us to apply TL on pretrained models to solve our problem as well as develop model based on CNN architecture from scratch.
In this study, we propose two solutions which are based on convolutional neural network. In the first method we design the CNN from scratch and then we train the proposed CNN to obtain the model for chicken disease detection. Secondly, we leverage the use of transfer learning by optimizing through pre-training and fine-tuning the pre-trained models.
1) CNN architecture: Our proposed CNN architecture involves stacking of multi convolution layers, and the whole architecture is given in Fig. 2. In the first layer, the image with size either 224 × 224 RGB or 512 × 512 is fed to the stack of convolution layer as input. The convolutional layers have filters with the small receptive fields of 3 × 3 and are followed by max-pooling layer, which performs over a 2 × 2 pixel window. These layers form a single block, and we repeatedly apply the block by increasing the depth of filters in the network in such as 32, 64, 64, 128, 128, 256, 256, 512 for the full convolution blocks. In each block, the same padding is applied to maintain the height and the width shape of the output features maps matching the inputs features. ReLU activation is used for all layers; meanwhile,he uniform is considered for weight initialization for all blocks. During training, normal stochastic gradient descent is used to minimize the error, and in evaluation, we leverage log loss and accuracy as the metrics. We have noticed that some of the images from the dataset may contain more than one disease; hence categorical crossentropy loss function seems to fit our problem with the log loss as an evaluation metric. An output layer with three nodes and softmax activation is used since the problem is multi-class classification. Softmax is the right choice because the output from the node is the likelihood for the output to be either of the three classes. Schedule learning rate is used in the experiment with some callback features. 2) XceptionNet: For this study, we use XceptionNet, an interpretation of Inception modules in convolution neural networks, introduced in [28]. Our proposed method is the use of pre-trained models that were originally trained on very large datasets including, ImageNet. Using pre-trained models is an added advantage to researchers as it uses the minimum time during training as compared to fully trained models that are built from scratch. We select the XceptionNet architecture based on our problem because it gives the best results as compared to others, we also consider the weights, time consumed during training and accuracy it achieves [34].
The XceptionNet architecture performs depth-wise separable convolutional operations, whereby each channel has only one kernel to perform convolution; hence computational complexity is minimized. Each kernel is a 2-dimensional and is convoluted over a single channel. From the architecture, as a lightweight network, XceptionNet not only involves lesser number of residual blocks than other CNN models but also has a stronger classification impact over other CNN models because the number of parameters and weights is less. Most image recognition models have broad parameters and a large number of calculations that are not ideal for embedding in mobile devices. For the identification of chicken diseases, we must also consider how to quickly and accurately identify coccidiosis and salmonella in areas where there is limited access to robust tools for disease diagnosis. This is why we suggest XceptionNet architecture in our study.

A. Experimental Data
The digestive signs of the diseases are significant for our study based on the data (chicken droppings images). We gathered the data in the field with the help of a veterinary officer to correctly identify the features in the data we need. We collected a dataset of 1590 images for both healthy and infected images, as shown in Table III. To make data more inclusive, we randomly generated the training and test sets as presented in Table I.

B. Classification Results and Analysis
When training the model, we augment the images by using different techniques in order to increase the size of the dataset. The significant number of dataset has two potential benefits: first, to avoid over-fitting and secondly to make the model learn from unseen datasets. The augmentation techniques used in our model are image flipping, image cropping and padding, and add random image saturation.
For the proposed model based on CNN architecture without using pre-trained model, we develop the model using the parameter specified in Table IV. The result shows the CNN perform better compared to www.ijacsa.thesai.org Basically, we use the XceptionNet with modification which is presented as follows; First, during training and class prediction, the first layer of XceptionNet is removed, and we set the input layer based on the image size pixel from our dataset. Also, the last layer is flattened, and Pool 2D is applied, followed by a dense layer with the softmax activation with 3 output nodes. The summary of parameters and hyperparameters used when training the pre-trained model is given in the Table VI. This section presents the results obtained after evaluating the performance of the pre-trained models. Table I briefly shows the summary of the dataset and how the data is split into the training set, validation set and the test set. We start by showing the performance of other pre-trained models used in our work, and then our proposed CNN architecture model, as shown in Table V. Since we use TPU-based framework, it only takes 3.95min for training our dataset. We run 50 epochs, and each epoch has 8 steps per epoch, which results in 50 × 8 iterations to complete the training process. In the Fig. 3(a) and Fig. 4(a), it can be seen that the accuracy of validation keeps increasing and converges in the 50 th epoch. The results show that the XceptionNet with the hyperparameters shown in the Table VI outperform other models using 0.04seconds for a single prediction .

IV. CONCLUSION
In this study, we present the novel chicken disease detection method using Transfer Learning approach on a pre-trained CNN. The key elements that can improve the performance of the extension officers and poultry farmers in the early detection of chicken diseases are the use of computer-aided instruments and accurate data. The creation of such image processing techniques that can assist farmers is a necessity of the present era. These methods are valuable to reduce the losses incurred and increase productivity, and it is clear that the diseases can be detected at an early stage before they lead to deaths of the chicken. Computer vision work has been trying to reduce the gap for the past few decades by designing automated systems that can process images for decision making using computers. Specifically, we generate the CNN model, which learns the hidden pattern among the different faecal images in our dataset. The supervised learning algorithm predicts the three categories which we named them as coccidiosis, health and salmonella.
The results obtained show the proposed model achieved up to 94% accuracy. In comparison to the VGG, Resnet and Mobile net architectures, our proposed solution outperforms them by far. The experimental findings indicate that our method works well on diseases detection in the chicken and can be used for robust diagnostics.
In the future, we aim to collect more faecal images to www.ijacsa.thesai.org expand the dataset hence room for future studies on other chicken diseases using the dataset. The developed model will be deployed in mobile devices for easy interaction by the endusers.