EFFICIENCY OF DISTINCT DATA MINING ALGORITHMS FOR CLASSIFYING STRESS LEVEL IN PIGLETS FROM THEIR VOCALIZATION

Among the challenges of pig farming in today's competitive market, there is factor of the product traceability that ensures, among many points, animal welfare. Vocalization is a valuable tool to identify situations of stress in pigs, and it can be used in welfare records for traceability. The objective of this work was to identify stress in piglets using vocalization, calling this stress on three levels: no stress, moderate stress, and acute stress. An experiment was conducted on a commercial farm in the municipality of Holambra, São Paulo State , where vocalizations of twenty piglets were recorded during the castration procedure, and separated into two groups: without anesthesia and local anesthesia with lidocaine base. For the recording of acoustic signals, a unidirectional microphone was connected to a digital recorder, in which signals were digitized at a frequency of 44,100 Hz. For evaluation of sound signals, Praat ® software was used, and different data mining algorithms were applied using Weka ® software. The selection of attributes improved model accuracy, and the best attribute selection was used by applying Wrapper method, while the best classification algorithms were the k-NN and Naive Bayes. According to the results, it was possible to classify the level of stress in pigs through their vocalization.


INTRODUCTION
Pork is the most consumed type of meat in the world, but to attract today's increasingly demanding consumers, the pig industry seeks competitiveness of its products.Price, quality and biosafety comprise the current success tripod in food trading.The requirements for this market are becoming increasingly stringent and follow predominantly the standards set by international bodies.Among these requirements, there is the subject of animal welfare.Surgical castration is mandatory for male pigs aimed for slaughtering, however because it affects animal welfare, researchers seek less painful alternatives to this procedure.According to WHITE et al. (1995), local anesthesia can reduce the stress of pain caused by this procedure.However, there is disagreement on this issue (LEIDG et al., 2009).FITZPATRICK et al. (2006), indicate that methods to objectively measure pain and welfare in farm animals need to be very well studied in order to avoid incorrect results.
Many authors studied vocalization as a tool to measure animal welfare (MARX et al., 2003;NÄÄS et al., 2008;LEIDIG, et al., 2009).According to KRANENDONK et al. (2006), piglets of sows treated with cortisol, a major stress-related hormone, vocalized more than piglets from sows not treated with this hormone, when placed in a different environment.SILVA et al. (2008) developed an algorithm to identify the cough incidence site in the farm, using the arrival time of sound picked up by microphones distributed in different bays, and managed to locate the place of origin of the cough.
Data mining is a process of acquiring new knowledge from a database and is used as a technique for pattern recognition (HAN & KAMBER, 2006).The systematic collection of pig vocalization at different times during the castration procedure generates a supervised database of animal welfare associated with parameters that characterize each vocalization.From this database, it is possible to extract a pattern of well being according to the vocalization, using data mining techniques.
Thus, the objective of this study was to identify the level of stress in piglets from their vocalization.

Description of the experiment
Vocalization was recorded during surgical castration in two groups of 10 animals each, aged between three and four days old.In the first group, castration was performed without anesthesia, and in the second group, with local anesthesia.The technique chosen for castration was the scrotal method, in which the animal was first contained in a wooden box specific for castration with the dimensions 0.10 m wide, 0.10 m high and 0.30 m length.With the animal in the supine, asepsis was performed in the scrotum area with iodine, followed by a vertical incision in each testicle with a scalpel, being exteriorized and pulled up to expose the spermatic cord until its rupture.After removal of the testes, the wound was cleaned with iodine.
The experimental protocol was approved by the UNICAMP Ethics Committee under the number 2224-1/2011.For the group of animals that received anesthesia, 20% Lidocaine anesthetic was applied ten minutes before testes incision.Vocalizations were recorded in different stress situations (Table 1) during surgery.TABLE 1. Description of the stress conditions that the animals were exposed.

Signal Analyses
The sound signals recorded were edited and analyzed using Praat ® software.Firstly, the noises such as human speech or other sounds from the vocalization of pigs were excluded.Each signal was divided into three samples and for each, the maximum and minimum amplitude, the Pith frequency, and frequency of formants 1; 2; 3 and 4 were extracted.In addition to these features, the duration of the signal, and the average of three samples for each attribute were obtained from the amplitude range (which is the difference between the maximum and minimum amplitudes) (Table 2).Through analysis of variance of the means (p <0.05) performed in Minitab ® software, it was possible to perform discretization of the values for 29 attributes (Table 2) in three ranges: low, medium and high.The stress situations were also classified into three levels (no stress, moderate stress and acute stress).
From these results, data mining was performed on Weka ® Software.Initially, the attributes were ranked using infogain methods, which categorizes the attributes of information gain; gainration, which is also based on information gain, but this amount of information is sensitive to the targeted range of attribute values, and (CFS-correlation based feature selection), which selects attributes highly correlated with the class, and less correlated among themselves.From the selected attributes, J48 algorithms (decision tree) were executed based on the entropy of the attributes; k-NN (k-nearest neighbors), which determines the importance of a variable from the Euclidean distance; Naive Bayes (Bayesian classifier), multilayer perceptron (neural networks), which learns strong connections for some inputs and weak correlations for others, and SVM (Support Vector Machine).To compare the performance of algorithms, it was used the Roc (Receiver Operating Characteristic) curve, a graphical tool used for algorithm evaluation.The graph obtained describes the relationship between rates of true positives (TP rate) and false positives (FP rate) of the classifier.The classifiers inner to the "convex hull" have a lower precision rate than those that are contained in the "convex hull".The greater the area under the curve, the higher the precision of the model.

RESULTS AND DISCUSSION
Analysis of variance was performed for each of the attributes of the acoustic signals evaluated, and showed difference (p <0.05) in vocalizationof animals exposed to different conditions of stress (Figure 2) for the attribute representing variation of maximum and minimum signal amplitude.According to these results, there was no difference in the vocalization of piglets castrated with or without anesthesia (p <0.05).WHITE et al. (1995) found that piglets castrated without local anesthesia had a higher heart rate and vocalization with higher energy, suggesting that anesthesia could reduce castration stress.However, according to LEIDIG et al. (2009), local anesthesia may improve the well being of piglets during castration, but due to the period of animal manipulation, added to the stress of anesthesia application, this effect is uncertain.According to PUPPE et al. (2005), holding and castration altered the vocalization quality of the piglets, indicating detriment of welfare of these animals.
In this experiment, it was observed that the animals were relaxed, during weighing and release; on the other hand, they seemed highly excited at the time of holding, anesthesia and castration, and intermediately excited during the second weighing post-anesthesia and handling, which is in agreement with the vocalization results (Figure 2), suggesting three stress levels (Table 3).From the ranking of attributes obtained by applying the Info Gain, Gain Ration, CFS and Wrapper methods (Table 4),Wrapper was the one that selected a fewer number of attributes, contributing to lower analysis costs.The best classifiers were developed by k-NN and Naive Bayes (Figure 5), and the remaining ones were discarded, with k-NN being more efficient than Naive Bayes.However, it is noteworthy that the latter showed greater accuracy for the class without stress (0.705).Furthermore, implementation of this model has a lower computational cost, since it uses only three attributes: amplitude interval, mean of formant 3 and minimum amplitude.
In this research, the neural network was one of the algorithms that were discarded; however NÄÄS et al. ( 2008) developed an algorithm using artificial neural networks to classify vocalizations related stress.and allowing illustration of the knowledge acquired, with a decision tree generated (Figure 6).According to the decision tree, the gap or amplitude difference is the most important attribute to predict the level of stress.If the amplitude range is high or medium, the stress is severe.But if the amplitude range is low, it will depend on the average of the formant 3, which is the average when the stress is moderate, and low or high when the animal is not under stress.RISI (2010) identified the intensity level of injury of arthritis in pigs through the vocalization of these animals by analyzing sound intensity, fundamental frequency and formants 1 and 2. According to the author, the mean values of these attributes tend to decrease as the level of injury increases.On the other hand, DUPJAN et al. (2008) found differences in resonance frequencies in pig vocalization due to aversive stimulus.FIGURE 6. Decision tree obtained by the use of the Weka ® software.

CONCLUSIONS
In this research, it was possible to classify the level of stress in pigs by their vocalization.The use of selection attributes enabled to reduce the number of sound characteristics to build the model, improving its accuracy.
castration Performing the surgery the animals previously anesthetized Second weight Weighing the animal after castration Post-anesthesia second weight Weighing the animal treated with anesthesia, after castration Release Return of the animals in the stalls of origin For the recording of acoustic signals, it was used a system to capture the signals composed of a Yoga EM 9600 ® directional microphone (Figure 1A) positioned approximately 15 cm from the mouth of the animals.This microphone was connected to a Marantz PMD 660 digital recorder (Figure 1B) for digitization of voice signals at a frequency of 44,100 Hz. a b FIGURE 1. System for registering the sound composed by a Yoga EM 9600 ® directional microphone (a) and a Marantz ® PMD 660 digital sound recorder (b).

FIGURE 2 .
FIGURE 2. Schematic representation of the analysis of variance for the mean of the amplitude interval.The green line represents the data general mean, and the red lines indicate the inferior and superior limits.The black and red squares represent the mean values of management, and those in red color are outside of the limits and different of the general mean value; while those in black color are located within the limits and do not differ from the average values.

FIGURE 4 .
FIGURE 4. Precision level for each stage of stress of the distinct algorithms and selection methods.

FIGURE 5 .
FIGURE 5. ROC curve considering the class without stress as the most important one.

TABLE 2 .
Acoustic attributes and their units.

TABLE 3 .
Association between the stress condition and the corresponding stress level.

TABLE 4 .
Selection and classification of the vocal signals attributes (29) for the distinct methods of the attributes selection.
Note: Ranking from left to right