Curl Size and Pelt Color Determination of Zandi Lambs Using Image Processing and Artificial Neural Network

Document Type: Research Articles

Authors

1 Department of Animal Science Research, Qom Agricultural and Natural Resources Research and Education Center, Agricultural Research, Education and Extension Organization (AREEO), Qom, Iran

2 Department of Animal Science, Faculty of Agriculture, Ferdowsi University of Mashhad, Mashhad, Iran

3 Department of Animal Science, Qom Agricultural and Natural Resources Research and Education Center, Agricultural Research, Education and Extension Organization (AREEO), Qom, Iran

Abstract

In this study, a method based on using image processing and artificial neural network is introduced to determine pelt color and curl size of newborn lambs in Zandi sheep. The data was collected from 300 newborn lambs reared in the Zandi sheep breeding centre of Khojir, Tehran. Primarily, curl size and pelt color of new born lambs was recorded by experienced appraisers, and at the same time, several digital images were captured from the lateral side of each lamb. The features related to curl size and pelt color of lambs were extracted from digital images using image processing tools (IPT) of MATLAB software. To determining the pelt color, to classifying the pelts for curl size, and to estimating the curl size of pelt, three artificial neural networks were designed. The pelt color of the lambs was determined using an artificial neural network with a precision of 100%. The accuracy of the neural network which trained to classify the pelts on their curl size was 94.87%. The accuracy of the third neural network to estimate the curl size of pelts was 98.44%. The correlation between the curl size estimated using the artificial neural network and the curl size which measured by appraisers was 96.4% (P<0.01). The results of this study showed that there is a potential to use artificial intelligence as a substitute for human assessments in the recording of pelt traits.

Keywords


INTRODUCTION

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.

 

Image processing

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.

 

Feature extraction

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).

 

CONCLUSION

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.

 

ACKNOWLEDGEMENT

We are grateful to the honorable staff of Khojir sheep breeding station, especially Mr. Akbari Sharif for their sincerely cooperation.

Al-Hiary H., Bani-Ahmad S., Reyalat M., Braik M. and Alrahamneh Z. (2011). Fast and accurate detection and classification of plant diseases. Int. J. Computer Appl. 17, 31-38.

Alipasandi A., Ghaffari H. and Alibeyglu S.Z. (2013). Classification of three varieties of peach fruit using artificial neural network assisted with image processing techniques. Int. J. Agron. Plant Prod. 4, 2179-2186.

Banerjee K., Jasrai Y.T. and Jain N.K. (2012). An accessible and accurate image analysis for root length and leaf area estimation: A case application to Azadirachtaindica seedlings. American-Eurasian J. Agric. Environ. Sci. 12, 64-76.

Banumathi P. and Nasira G.M. (2012). Fabric inspection system using artificial neural networks. Int. J. Computer Engin. Sci. 2(5), 20-27.

Borah S., Hines E.L. and Bhuyan M. (2007). Wavelet transform based image texture analysis for size estimation applied to the sorting of tea granules. J. Food Engin. 79, 629-639.

Bunger L., Macfarlane J.M., Lambe N.R., Conington J., McLean K.A., Moore K., Glasbey C.A. and Simm G. (2011). Use of X-Ray Computed Tomography (CT) in UK Sheep Production and Breeding. CT Scan. Tech. Appl. 19, 329-348.

Burghardt T. (2008). Visual animal biometrics-automatic detection and individual identification by coat pattern. Ph D. Thesis. University of Bristol, Bristol, United Kingdom.

Caso V., Budak K., Georgiadis D., Schuknecht B. and Baumgartner R.W. (2005). Clinical significance of detection of multiple acute brain infarcts on diffusion weighted magnetic resonance imaging. J. Neurol. Neurosurg. Psychiatr. 76, 514-518.

Garcia E.R., Hernandez-Hernandez F., Zaraguza S.G.M. and Herrera S.G. (2009). Two new Methods for the estimation of leaf area using digital photography. Int. J. Agric. Biol. 11, 397-400.

Gastelum-Barrios A., Borquez-Lopez R.A., Rico-Garcia E., Toledano-Ayala M. and Soto-Zarazua G.M. (2011). Tomato quality evaluation with image processing: A review. African J. Agric. Res. 6(14), 3333-3339.

Ghamari S. (2012). Classification of chickpea seeds using supervised and unsupervised artificial neural networks. African J. Agric. Res. 7(21), 3193-3201.

Goyal S. (2013). Predicting properties of cereals using artificial neural networks: A review. Sci. J. Crop Sci. 2, 95-115.

Harron W. and Dony R. (2009). Predicting quality measures in beef cattle using ultrasound imaging. Pp. 96-104 in Proc. IEEE Symp. Comput. Intell., Honolulu, Hawaii, USA.

Hossein-Zadeh N.G., Nejati-Javaremi A., Miraei-Ashtiani S.R. and Mehrabani-Yeganeh H. (2007). Effect of the threshold nature of traits on heritability estimates obtained by linear model. Pakistan J. Biol. Sci. 10, 145-147.

Junior Y.T., Silva E., Junior R.A.B., Lopes M.A., Damascene F.A. and Silva G.C.D.A.E. (2011). Digital surface area assessment of broiler chickens. Eng. Agric. Jaboticabal. 31, 468-476.

Krenker A., Bester J. and Kos A. (2011). Artificial Neural Networks-Methodological Advances and Biomedical Applications. In Tech, Shanghai, China.

Kulkarni D.A., Bhagyashree S.M. and Udupi G.R. (2010). Texture analysis of mammographic images. Int. J. Computer Appl. 5(6), 12-17.

Menhaj M.B. (2012). Computational Intelligence. Amir Kabir University Press, Tehran, Iran.

Negretti P., Bianconi G., Bartocci S. and Terramoccia S. (2007). Lateral trunk surface as a new parameter to estimate live body weight by visual image analysis. Italian J. Anim. Sci. 6, 1223-1225.

Onder H., Arı A., Ocak S., Eker S. and Tufekci H. (2010). Use of image analysis in animal science. J. Inf. Technol. Agric. 1, 1-4.

Pazoki A.R., Farokhi F. and Pazoki Z. (2014). Classification of rice grain varieties using two artificial neural networks (MLP and Neuro-Fuzzy). J. Anim. Plant Sci. 24, 336-343.

Phyu T.N. (2009). Survey of classification techniques in data mining. Pp. 24-31 in Proc. Int. Multi Conf. Eng. Computer Sci., Hong Kong, China.

Qian K., Li H., Cao H., Yu K. and Shen W. (2010). Measuring the blend ratio of wool/cashmere yarns based on image processing technology. Fibers. Text. Eastern Europe. 18, 35-38.

Schoeman S.J. and Albertin J.R. (1993). An evaluation of the subjective categorization of hair quality of pelt traits in Karakul lambs. South African J. Anim. Sci. 23, 88-91.

Sun J., Yao M., Xu B. and Bel P. (2011). Fabric wrinkle characterization and classification using modified wavelet coefficients and support-vector-machine classifiers. Text. Res. J. 81, 902-913.

Vilarrasaa E.R, Bungera L., Brotherstoneb S., Macfarlanea J.M., Lambea N.R., Matthewsc K.R., Haresignd W. and Roehea R. (2010). Genetic parameters for carcass dimensional measurements from video image analysis and their association with conformation and fat class scores. Livest. Sci. 128, 92-100.

Wang Q., Deng X., Ren Y., Ding Y., Xiong Ping Z., Wen Y. and Wang S. (2009). Egg freshness detection based on digital image technology. Sci. Res. Essay. 4(10), 1073-1079.

Yudkowsky E. (2008). Artificial Intelligence as a Positive and Negative Factor in Global Risk. Oxford University Press, New York.

Zaragoza L.E.O. (2009). Evaluation of the accuracy of simple body measurements for live weight prediction in growing-finishing pigs. MS Thesis. University of Illinois, Urbana, Illinois.