The production of decorative pelts from newborn lambs in many countries, including Iran, has been common from the past decades. The conventional method for assessing lamb pelts in these countries is based on using experienced evaluators (Schoeman and Albertin, 1993). In this method, different phenotypic traits associated with the pelt quality such as pelt color, pelt size, pelt pattern, and curl size are recorded by qualified evaluators in discrete ranks (Schoeman and Albertin, 1993). In the human assessment, due to differences in experience of individuals, the limitation of evaluation time, the lack of precise instrument, and the probability of changing the evaluator over the years, incidence of human errors in the recording process is inevitable (Vilarrasaa et al. 2010). Use of artificial intelligence techniques is one of the new appropriate solutions to increase the accuracy of visual assessments (Onder et al. 2010; Goyal, 2013). If the portion of human errors in the phenotypic variance is increased, the accuracy of breeding value estimations and genetic improvement in a population are decreased (Vilarrasaa et al. 2010). A good solution to reduce in the human recording errors may possibly is employment of automated measuring tools such as image processing methods and artificial intelligence techniques (Onder et al. 2010; Goyal, 2013). In a simple definition, artificial intelligence is the use of computers to do different things instead of humans. In other words, artificial intelligence includes any kind of computer system that can simulate the processes, learn the rules and relations, and be able to use knowledge for solving various problems (Burghardt, 2008; Yudkowsky, 2008; Goyal, 2013). One of the important steps in the use of artificial intelligence is the implementation of data mining processes, and artificial neural network is one of the most well-known and most widely used data mining tools (Phyu, 2009; Krenker et al. 2011). The structure of an artificial neural network consists of number of neurons which in relation to each other have ability to make decisions, prediction and diagnosis. Each neuron in artificial neural network is a data processing unit and acts like a neuron in the human brain. Each neuron receives a set of input data. In the next step, the input data is processed using mathematical functions of each neuron, and finally an output signal is produced. Due to the communication of neurons with each other an artificial neural network is built with variety of conditional functions. The neural network can get the raw data and categorizes them into two or more distinct groups or predicts new data after a series of multi-step processing operations (Goyal, 2013). In the recent two decades, use of artificial intelligence methods has been developed in military, medical, aerospace, identification, robotics and security systems for diagnosis (Burghardt, 2008). In medicine, image analysis has also helped to physicians to diagnose diseases and various stages of treatment for the analysis of radiographic images and various scans related to the brain and internal organs of the body (Caso et al. 2005; Kulkarni et al. 2010). Sun et al. (2011) classified 5 kinds of fabric wrinkles using digital image processing and support vector machine classifier with an accuracy of 75%. Banumathi and Nasira (2012) used image processing and artificial neural network to detect fabric inspection, and their results showed that the proposed method was applicable in textile industries for defect detection and classification. Al-Hiary et al. (2011) could identify and classify plant diseases using image processing and neural network with accuracy between 83 to 94%. Pazoki et al. (2014) classified 5 commercial rice types using image analysis and artificial neural network with an accuracy of 99 %. According to Qian et al. (2011) determined the number of cashmere fibers in the sheep wool using image processing and support vector machine classifier with an error of less than 5%. Wang et al. (2009) used digital image processing methods to detect the egg freshness in poultry. Also, Banerjee et al. (2012), using image processing technology estimated the leaf area of a medicinal plant with the accuracy of 98%. Harron and Dony (2009) presented an algorithm for determining the muscle and marbling percentage in fattening calves using ultrasonic image analysis and neural network with a precision of 91.7%. Negretti et al. (2007), used image processing to estimate the live weight of cattle with accuracy of 90%. As far as we know, as yet no study has been carried out on the use of artificial intelligence to determine the color and curl size of pelt in Zandi sheep. Therefore, in this research, for the first time, the use of artificial intelligence technology was examined to determine the curl size and pelt color in newborn lambs.
MATERIALS AND METHODS
Various steps of this study were as follow: determination of pelt quality in newborn lambs by assessors, digital photography, image processing and feature extraction, and finally use of artificial neural network to classify and diagnose of color and curl size of pelts.
Phenotypic recording and photography
This study was conducted in Zandi sheep breeding station (Khojir) at Tehran province. During the lambing period, 300 heads of newborn lambs of Zandi sheep were registered and evaluated by trained appraisers for different pelt traits either curl size or pelt color. The curl size was classified by appraisers in three categories: small, medium and large (Figure 1). In addition to human evaluation, the metric size of the curls on the pelt was measured, and the average curl size of one pelt was recorded as a curl size attribute for each lamb. The pelt color was classified in three categories: black, gray and bright gray (Figure 2). Simultaneously, some images were captured from lambs using canon digital camera SX 150 IS in natural light conditions with size of 4320 × 3240 pixels considering a fixed distance of 40 cm. Due to the varying in the photos quality, 170 images of 300 were selected and used for final evaluation of pelt quality. To select appropriate photos, conserving of curl and color diversity of pelts were considered.
All images were processed using image processing tools (IPT) of MATLAB 7.8.0 software. Image processing steps involve taking photos, image pre-processing and editing, image segmentation, feature extraction, and relevant feature selection. In Figure 3, different steps of image preparation and feature extraction have been shown.
Preparation and initial editing of images
To improve the quality of the images and prepare them, a number of pre-processing operations were performed on the photos.
Figure 1 Pelt curl in different sizes (from left to right: small, medium and large curles)
Figure 2 Pelts in different colors (left to right: black, gray and bright gray)
Figure 3 Steps of image processing
This operation involves converting color scale to grayscale, brightness adjustment, selecting the region of interest, using morphological operators to remove noise and unwarranted points, as well as detecting the edges. An example of the image preprocessing is shown in Figure 4.
Using graphical user interface (GUI) environment of MATLAB, 46 different morphological features were extracted from each digital image. Features of the digital image are some of information which is relevant for solving the computational task related to a definite characteristic. Features may be some specific parameters of the image such as angles, points, distance, or the other details. In digital images, each pixel has a numerical value. Therefore, in the process of extracting features, a digital image becomes a numerical matrix. And given the relationships existing between the components of this matrix, one can derive a series of numerical features that are unique and specific to the matrix. Some of the most important features included area, perimeter, major axis length, minor axis length, diameter, distance, eccentricity, and solidity. From the 46 extracted features, the effective characteristics which significantly related to the traits were selected using Eta coefficient and Pearson correlation for non-linear and linear association, respectively. Of the 46 extracted features, 10 features were used to estimate the curl size, 12 features were used to classify the size of the curl, and 4 features were used to recognize the color of pelts.
Figure 4 Steps of image preprocessing (a: RGB image; b: binary image (black and white) and c: edge detection)
Artificial neural network (ANNs) design
The neural pattern recognition tools (NPR Tool) of MATLAB was used to develop the artificial neural networks for curl size and color classification, and neural fitting tools (NF Tool) was used to curl size estimation. All artificial neural networks consist of number of neurons which in relation to each other in different layers. Each neuron has a conditional function and is a data processing unit which receives a set of input data (image features), processing it, and finally generates output signal (color detection, curl size classification or curl size estimation). All ANNs were multilayer feed forward which trained via back-propagation algorithm. In the first ANN total of 12 neurons equal to the 12 relevant features, were considered in the input layer; 3 neurons, equal to 3 different curl sizes (large, medium and small) were considered in the output layer, and via trial and error procedure 20 neurons were considered in the hidden layer (Figure 5). From a total of 249 photographs selected at this stage, 210 photographs were used for initial design of the network (including training, validation and test), and 39 photographs for the final test of the neural network. In the second ANN for estimate the curl size, the number of neurons considered in the input layer, hidden layer and output layer were 10, 20, and 1, respectively (Figure 6). From a total of 249 images, 200 pieces of pictures were used for network design and 49 images were used for the final test. In the third ANN for detecting 3 pelt colors (black, gray and bright gray) the number of neurons considered in the input layer, hidden layer and output layer were 4, 20 and 3, respectively (Figure 7). From a total of 230 photos, 200 photos were used for neural network training and 30 photos were used for the final test of the network.
Figure 5 The ANNs structure for curl size classification
Figure 6 The ANNs structure for curl size estimation
Figure 7 The ANNs structure for pelt color classification
RESULTS AND DISCUSSION
Pelt classification based on curl size
As shown in Table 1, the artificial neural network was developed to classification of curl size in small, medium and large scales without any confusion in the training, validation and testing phase. To test the neural network, total of 39 images (13 images from each small, medium and large size) were introduced to the ANN. According to Table 2, the accuracy of ANN to detect and classify of pelts with large, medium and small curl size was 100, 92.3, and 92.3%, respectively. The overall accuracy of the artificial neural network for curl size classification was 94.87%.
Pelt color detection and classification
As shown in Table 3, the artificial neural network was developed for pelt color classification (in black, dark gray and light gray scales) without any confusion in training, validation and testing phase. For this purpose, 56, 68, and 76 images in black, light gray and dark gray colors were provided to the artificial neural network, and the ANN could be trained without error. To test the fitted neural network, extracted features of 30 images were introduced to the neural network, and the artificial neural network detected and classified all the pelt colors, correctly (Table 4).
Table 1 Confusion matrix of ANN performance for curl size classification
Numbers in the diagonal array represent the correct classification, and numbers outside the diagonal array represent the wrong classification.
Table 2 The artificial neural network performance for curl size classification
Table 3 Confusion matrix of ANN performance for pelt color classification
Numbers in the diagonal array represent the correct classification, and numbers outside the diagonal array represent the wrong classification.
Table 4 The artificial neural network performance for pelt color classification
Estimation of curl size
As results, the accuracy of ANN in the training, validation and testing phase to estimate the curl size of pelts were 99.6%, 94.33%, and 97.9%, respectively. The overall accuracy of the artificial neural network for curl size estimation was 98.43% (Figure 8). To investigate the ANN performance in the practical test, the extracted features from 49 images were introduced to the neural network, and it estimates the curl size based on input information (Figure 9). The results showed that there is a positive and significant correlation (96.4%) between the curl size estimated via ANN with those measured by appraiser (P<0.01). Results revealed that use of ANN and image processing provides an inexpensive and simple method for the assessment the pelt quality of newborn lambs. The accuracy of the artificial neural network for the classification of pelt color and curl size in the present study is within the range of accuracy reported in other studies and is consistent with them. For example, the accuracy of ANNs model to classify the pelt quality at the present study are in agreement with results of Al-Hiary et al. (2011) to classify some plant diseases (accuracy of 83 to 94 %), higher than results of Borah et al. (2007) to classify tea granules (accuracy of 74.67% to 80%), and lower than results of Alipasandi et al. (2013) to separate ripe and unripe peaches (accuracy of 98.5% to 99.3%). However, the results showed that the accuracy of the artificial neural network for pelt color recognition was higher than curl size classification. On the other hand, the accuracy of the ANN for color and curl size classification was slightly different from the other reports. It could be related to differences in the studied subject, the quantity and quality of images used, and the data mining tools used. Zaragoza (2009), for example, reported that the accuracy of the regression model in assessing the live weight of the livestock using biometric data was higher than body size obtained from digital images (82% versus 26% for shoulder height).
Figure 8 Accuracy of ANN for curl size estimation in the training phase (a), validation (b), test (c) and total (d)
Figure 9 The relationship between the estimated and measured curl size on lamb pelts
Also, Bunger et al. (2011) reported that CT scanning is a minimally invasive in vivo technique that can provide higher accuracy estimations for carcass composition than ultrasonic method (99% and 65%, respectively). Several reports have shown that the nature of the trait, the number of observed categories, the number and type of features extracted from the images, and the kind of data mining tool effect on the classification accuracies in various studies (Gastelum-Barrios et al. 2011; Menhaj, 2012; Ghamari, 2012). Therefore, one of the main reasons for the higher accuracy of the neural networks designed to recognize the pelt color than curl size can be attributed to the less complexity of it. The accuracy of the proposed model to estimate the curl size in the present study are in agreement with the results reported by others in estimating similar quantities using artificial neural network and image processing. Banerjee et al. (2012), for example, estimated the leaf area of some medicinal plant using image processing with accuracy of 98%. Also, Garcia et al. (2009) estimated the area of tomato and corn leaves using image processing technology with accuracies of 98.1% and 96.2%, respectively. Moreover, Junior et al. (2011) estimated the surface area of the chicken body with accuracy of 99%. These reports confirm the results of the present study. The results showed that the use of ANN and image processing is an appropriate tool for estimating the curl size of Zandi lambs. By using image processing and artificial neural network, it is possible to estimate the curl size with more accuracy instead of categorizing the pelt of the lambs based on curl size. Therefore, due to the success of the proposed method for estimating the curl size, and high correlation between the measured and estimated curl size in the present study this method can be replaced with the human assessment method. Obviously, the fairly accurate estimation of the curl size using image processing compared to the classification of curl size in three groups small, medium and large is a better criterion for presenting the phenotypic variance of this trait. According to some reports, increasing the number of categories for a threshold trait leads to reducing the difference between actual and measured phenotypic variance, and this makes to increase the accuracy of breeding value estimation and help to the more genetic progress of studied population (Hossein-Zadeh et al. 2007).
The results of this study showed that the use of artificial intelligence in order to categorize the skin of the newborn lambs for curl size and skin color, as well as the estimation of curl size, had a satisfactory response. It is hoped that artificial intelligence technology would use as an alternative to humans in livestock recording in the future by providing the necessary hardware and software. Next to this issue, the use of this technology could be effective in many other fields in animal husbandry, such as determining the body condition score, type evaluation and carcass quality, to facilitate the animal registration and to increase the accuracy of the collected data.
We are grateful to the honorable staff of Khojir sheep breeding station, especially Mr. Akbari Sharif for their sincerely cooperation.