In order to breed domestic animals, it is inevitable to record their productive traits. Increasing the accuracy in keeping records from domestic animals will increase the accuracy of the final assessment and, ultimately, will increase the genetic progress of breeding herds (Miller, 2010). Camel breeding is more difficult than other domestic animals due to the forceful nature of the animal and its breeding system. It is usually difficult and time consuming to approach a camel and keep the animal in good order to record its traits (Kuria et al. 2007). For example, weighing camels is difficult because of their large size and lack of proper handling. Presently, camels are mostly weighed through truck loading and in groups. In order to weigh camels individually, we need cranes to put camels on the scale and unload them after weighing; therefore, providing such facilities in the natural habitat of camels is a difficult task. In addition, the animal’s movements might reduce the speed and accuracy of weighing which might be dangerous and risk-taking for both livestock and the humans (Kuria et al. 2007). Recent advancements in modern technologies such as machine vision, which is used to measure the body weight and body size in both small and large scales and even to diagnose veterinary diseases, have facilitated the livestock recording process (Cihan et al. 2017; Wangchuk et al. 2017). The machine vision is one of the sub-branches of artificial intelligence technology, whereby the image different features can be used to examine changes in objects, individuals or plants and animals (Cihan et al. 2017). In animal breeding, the image processing technology has a good potential to identify and to estimate the weight and size of different animals, and yet several studies have been carried out to use this technology to estimate livestock growth changes (Burke et al. 2004). In this method, the livestock body weight and its body size were estimated by analyzing the changes in the number and the volume of the image pixels and the image intensity. These measures were then used to determine different levels of fat storage, body size and body weight of the livestock (Alvarez et al. 2017). Estimation of the weight and dimension of animals using image processing technology are based on using a linear relationship between the changes in animal size in the image and the weight variation in different period of its growth. Today, a numbers of mathematical equations are available to predict the live weight of the livestock through changes in their body size (Atta et al. 2004; Afolayan et al. 2006). For instance, Stajnko et al. (2008) estimated the live weight of cattle by measurement of body dimensions with thermographs and thermal image analysis. They found a statistically significant relationship (P<0.05) among wither height and hip height of cattle with their weight at different ages. They estimated the cattle weights with accuracy of 15 to 74% using the features extracted from thermal images. Wang et al. (2008) have investigated and predicted the pig's weight using image processing and artificial neural network. Besides, they could estimate the weight of the pigs with 3% error without using weighing scale and only by analyzing the top view images of pigs. Ozkaya and Bozkurt (2016) predicted body weight and estimated body measurements of Limousin cattle using digital image analysis. As their finding, the accuracy of models to determine the wither height, hip height, chest depth and body length were 98, 97, 94 and 90.6%, respectively. They developed an equation to estimate bodyweight using body dimensions with accuracy of 61.5%. Gomes et al. (2016) studied and developed equations to predict body and carcass weight and body fat content of young bulls using digital images. They found that chest width had significant correlation (0.85) with cattle weight (P<0.05). The accuracy of developed model for estimating the weight of Angus and Nelore cattle was 0.69 to 0.84, respectively. The prediction of body weight of beef cattle using traditional methods and digital image analysis system was compared by Bozkurt et al. (2006). The accuracy of models varied from 43.1 to 63.6% for different body size prediction. Their finding revealed that the prediction of digital image analysis system was very promising to predict body weight of beef cattle. According to our knowledge, no study has ever been conducted in Iran to estimate the camel's weight using digital image processing. Therefore, the present study aimed to investigate and introduce a method for estimating Kalkoohi camel weight using digital image processing method on a private farm in Qom province.
MATERIALS AND METHODS
In this study, Kalkoohi camels were studied on a camel breeding farm in Qom province, Iran. Kalkoohi tribe is rearing the Kalkoohi camels mainly for meat production in the deserts of Qom province and part of Varamin plain. The breeding conditions of the camels in the herd were ranch-farm based, so part of the daily feed of the camels was obtained from grazing on pasture around the farm and another part of the feed needs of camels was provided by forage supplied by the farmer. The studied herd consisted of one male and 25 female camels with their calves. During one year, the young and adult camels in the herd were weighed monthly using livestock weighing scales (digital weighing scales manufactured by PAND corp) and their weight was recorded. At the same time, for each weighing step, digital images were taken using canon SX 150 IS camera; photos were taken from a fixed distance (2 meters) of each camel. At the end of the experiment, 427 images of the camels in the herd were collected at different periods. Figure 1 shows how the weights of camels were recorded. Of the 427 photographs taken from camels, 351 images were selected and used in image processing.
Image processing steps
The purpose of image processing is to extract a series of numerical features from the images and use them for identification, estimation and categorization. In the first step of image processing, each photo was transferred to the computer’s memory and if necessary, it was edited and pre-processed to improve the picture’s quality. Some steps of image pre-processing were as follows: noise removal, removing shadows, contrast adjustment, image cropping, and converting color scale to gray scale image, resolution adjustment and image segmentation (Figure 2).
Figure 1 Sample frame used for weighing camels
Figure 2 Various images processing steps: (a) an image of camel in the RGB format; (b) an image of camel in the binary format and (c) an image of camel in the edge format
After pre-processing of each image, feature extraction performed using Graphical Unite Interference (GUI) of MATLAB software. Relatively, we have tried to extract the maximum possible features from an image. Accordingly, 22 different morphological features were extracted from the camel's images. These morphological features included the mean, standard deviation, distances, angles, the area and perimeter, major axis length, minor axis length, equivalent diameter, eccentricity and solidity. In order to estimate the body weight of the camels, all extracted features were not needed, and only some of them which were more relevant to body size and camel weight were selected as effective features. This was done by analyzing Pearson correlation coefficient in SPSS (2011) software.
In this study, the purpose of data mining was to explore the mathematical relationship between the extracted features of an image with the features related to the camel weights. Data mining steps were performed by means of neural network fitting tools (nf-tool) in MATLAB software. The "feed-forward neural network", trained via "back propagation" algorithm, was used for camel weight estimation. This kind of artificial neural network could be a good estimator for most linear and non-linear models (Menhaj, 2012). In the training process of the artificial neural network, the characteristics extracted from the images and the weights of the camels were used as input and output of the artificial neural network, respectively. The ANNs model with the highest accuracy (R2) and lowest error (MSE) was used as the final model to estimate the weight of camels. In the final artificial neural network, a total of 9 neurons, equal to 9 relevant features, were considered in the input layer; one neuron, equal to one output (estimated weight of camels), was considered in the output layer, and via trial and error procedure, 20 neurons were considered in the hidden layer assuming to obtain the highest accuracy of prediction (Figure 3). The transfer function in the hidden layer was a tangent-sigmoid function, and in the output layer was linear as shown in Figure 2. Out of 351 selected images in estimating the weight of the camels, 287 images were used for initial design (including training, validation and testing), and 64 images were used for final testing of the artificial neural network.
RESULTS AND DISCUSSION
Selecting effective features
In Table 1, the extracted features along with their coefficient correlation with the camel weights are presented. The 22 presented features in Table 1 were extracted from binary and edge images, separately. Nineteen out of 22 features extracted from the digital images had a significant correlation with the camel weights (P<0.05). The correlations between the weight of camels and extracted features, according to the nature of the studied features, varied from -0.91 to 0.97. The solidity and the convex area, among all extracted features from digital images, had the lowest and highest correlations with the camel weights, respectively. For estimating the body weight of camels, 9 features which had higher correlation with the camel weights were used as effective features and neural network inputs. The area, perimeter, equivalent diameter, major axis length, minor axis length, the number of non-zero elements and Euclidean distance were the major features used to estimate the weight of the camels. Morphological features of digital images are usually correlated with the size and dimension of the subjects in the images, on the other hand, weight gain of camels at different ages results in increasing the volume and dimensions of them; therefore, we could predict the positive and high correlation between the 9 extracted morphological features and body weight of the camels in different ages. As a result, changing the size and volume of the body of camels in different ages is a good measure for estimating their body weight.
Estimating the weight of camels using artificial neural network (ANN)
The results of this study showed that digital image processing and artificial neural network had a satisfactory performance in estimating the weight of Kalkoohi camels. The performance curve and accuracy of artificial neural network are presented in Figures 3 and 4, respectively. As shown in Figure 3, the best validation performance of neural network was obtained in epoch 6. This shows that neural network had a good performance because validation and test curves have similar and identical variations and there is no interaction between these curves at the point where the best performance is achieved. Based on Figure 4, the accuracy of artificial neural network during the training, validation, testing phases and in total were 0.991, 0.986, 0.989 and 0.989, respectively. These results indicated that developed ANN on the basis of using digital image features had the acceptable accuracy in estimating the weight of Kalkoohi camels.
Comparison of accurate weights of camels with the estimated weights using image analysis
In Table 2, the deviations of accurate weight of camels from the estimated weights using the image analysis and artificial neural network are presented. Introducing the 64 separate images as test to the final ANN model showed that the developed model can accurately estimate the weight of camels using morphological features extracted from digital images. Derived from the results of this study, the developed ANN model had the higher accuracy in estimating the weight of medium-sized camels (weighing from 130 to 230 kg) in comparison with heavy and small ones. As shown in Table 2, by increasing the average of camel weights more than 230 kg, the absolute and relative error of the model also significantly increases. For example, the mean deviation of camels weighing less than 130 kg was 1.6 kg, while the mean deviation of camels weighing over 230 kg was 9 kg. The correlation between the actual weight (scale measured) of camels and the estimated weights using the ANN model were 99%. In average, the total error of ANN model was 1.04%, and the weight of camels was estimated 2.21 kg less than their actual weight by artificial neural network model. The results of numerous studies in estimating the weight of different livestock, poultry and agricultural products show that the morphological features, in most cases, have a significant correlation with the changes in the size and weight of the subject. For example, Forbes (2000) investigates the feasibility of using the same digital profile images of fruit that are used in commercial packing houses for color sorting and blemish detection purposes to estimate the volumes of the corresponding individual pieces of fruit.
Figure 3 The neural network structure for weight estimation of camels based on digital images features
Table 1 Correlations between the camel weights and the extracted features from digital images
NNZ: non zero elements.
They reported that morphological feature such as the area; perimeter, curvature and Euclidean distance could be used as effective features to estimate the fruits weight. In a study by Tasdemir et al. (2011) the possibility of detecting body dimension of Holstein cows with image analysis was investigated. They used this measure to estimate the live weight of cows, and as their reports, the correlation coefficient between actual and estimated weights of Holstein cows was 99%. Negretti et al. (2007b) used image processing and regression equations to estimate the live weight of rabbits. According to their results, observed individual differences between meter and image analysis measurements were small, and a consequence correlation coefficients between these measurements was very high (0.92; P<0.01). Khojastehkey et al. (2015) investigated the possibility of using image analysis and ANN to estimate some pelt characteristics of new born lambs in Zandi sheep. They used successfully the morphological features of digital images such as area, perimeter, major axis length, minor axis length and Euclidean distance to estimate the pelt area of newborn lambs. They confirmed that morphological features extracted via image analysis are efficient to estimate the dimensions and size of new born lambs, too. All these reports are confirmed the results of present study in effectiveness of morphological features to estimate the live weight of Kalkoohi camels using image processing and ANN. In the present study, the accuracy of the ANN model in estimating the weight of Kalkoohi camels using the extracted features from digital images is in the range reported in other studies. In a study by Negretti et al. (2007a) the live weight of buffaloes was estimated based on the lateral area of animals obtained from image processing with an accuracy of 90%. As their finding, the estimated buffalo's weight via image processing was 1.08% higher than accurate buffalo's weights which measured using scale. In addition, Zhang et al. (2018) estimated the sheep body size parameters using image analysis tools with accuracy of 97%. The results of their study showed that the dimensions of a sheep could be accurately estimated via digital image analysis.. In the other study, Gomes et al. (2016) tried to develop equations to predict body and carcass weight and fat content of young bulls using digital images processing. The results revealed that chest circumference is highly correlated with the cattle weight (0.85) and the accuracy of the developed models for weight estimation of Angus and Nelore cattle was 0.69 and 0.84, respectively.
Figure 4 Performance curves of Artificial Neural Network for estimating the weight of camels
Figure 5 The accuracy of artificial neural network for estimating the weight of camels using extracted features from digital image: (a): training; (b): validation, (c): testing and (d): total
Table 2 Deviation of estimated weights based on the image analysis vs. scale-measured live weights of camels
H, the accuracy of the models designed by them was less than the accuracy of proposed model to predict the camel weight in the present study. Anglart (2010) used image processing and linear regression model to automatic estimation of body weight and body condition score in dairy cows. The correlation between the estimated live weight of cattle using image processing and their actual weights was 0.87, which was slightly lower than the correlations found between the accurate and estimated weights of Kalkoohi camels using image processing and ANN at present study. Norouzian and Vakili (2016) used artificial neural network to predict the lamb fat tail weight. They could estimate the fat tail weight by artificial neural network model with a precision of 85%. Seo et al. (2011) estimated the cattle weights using image processing technique with an error of 5% to 11.7%, and an average deviation of 21.8 kilograms. Additionally, Khojastehkey et al. (2016) could estimate the weight of newborn lambs through image processing and artificial neural network with an accuracy of 95%. Of course, in the accuracy of the model, there are many aspects such as image quality, the type of statistical model, number of records, nature of the trait and choosing the type of data mining tool is decisive. The image quality and process of camera calibration to get the actual value of animal's body dimension and body weight is very fundamental to the success of the analysis of this image, because the pixel values of the animal's image that captured greatly affects the actual value of the body weight and body length of the animals (Lasfeto and DaudLetik, 2017). These reports show that image processing and artificial neural network have the proper ability to estimate the weight and size of domestic animals. Comparison of these results with the results of the present study in estimating the camel weight shows that the proposed model to estimate the weight of Kalkoohi camels has an acceptable accuracy, and in comparison with other reports, in some cases even the precision of predicting model of present study is higher than others.
The results of this study demonstrated that digital image processing technology has good potential to estimating the weight of Kalkoohi camels. Due to the difficulty of weighing large livestock, such as camels, the use of recent weight estimation methods such as artificial intelligence, can facilitate the livestock weighing and reduce the damages to both livestock and humans during the process.
We would like to thank Mr Abdoli, the livestock breeder, for his cooperation during this project.