Font Size: a A A

Identification And Classification Methods Of Pig Behavior Based On Machine Learning

Posted on:2022-06-30Degree:DoctorType:Dissertation
Country:ChinaCandidate:M JinFull Text:PDF
GTID:1483306527491084Subject:Agricultural mechanization project
Abstract/Summary:PDF Full Text Request
With the rapid development of the large-scale and intensive breeding industry,accurate pig breeding supported by information technology and artificial intelligence is an inevitable requirement for the rapid development of modern pig breeding industry.Among them,the perception and analysis of individual pig behavior is the key to accurate pig breeding,and behavioral changes are the most direct response of pigs to changes in their growing environment.However,in the current pig farms,although the configuration of intelligent,automated feeding and environmental control equipment have been basically popularized,the intuition and experience of the feeders are mainly used to judge the changes in pigs' demand for environmental temperature and whether pigs' behavior is abnormal.This method not only consumes a lot of time and energy,but also often causes the aggravation of diseases and even death of pigs due to human negligence.Therefore,to explore the effective and accurate method of pig behavior of acquisition and identification,study the influence of ambient temperature on pig behavior changes,not only has high academic value,but also plays an important role in improving the level of pig welfare,guiding the environmental control strategy of piggery,improving the economic benefits of pig farms and promoting the rapid development of precision pig farming in China.This study considers the domestic and foreign research status and the urgent need of practical application,intelligent sensor detection technology,signal de-noising,data preprocessing,numerical simulation and the combination of machine learning algorithms,with three fattening pigs in different stages as the research object.Through theoretical analysis and field test of the above three pigs in low,moderate and high ambient temperatures to collect and pre-process the pigs' activity data of lying,standing,walking and exploring.Then these data were used to achieve pig behavior identification and classification,and the effects of ambient temperatures on pig's growth performance,physiological indexes and behavior are also studied.The main contents are as follows:(1)According to the size of experimental pigs in different fattening stages,an adjustable wearable pig behavior information collection device was designed,which integrated a triaxial acceleration sensor and a UWB positioning module.On the premise of guaranteeing the comfort of pigs,the data collection effects of the triaxial acceleration sensors fixed on different parts of the pig body were compared and analyzed to find the best fixed position.Meanwhile,the positioning accuracy when the UWB positioning module was fixed on the leg and back of pigs and the effect of the pig's walking speeds on the positioning accuracy were compared and analyzed.The experimental results showed that,when the tag was located on the pig's back,UWB system was performed better to complete the positioning process,and the positioning errors of pigs under different walking speed were within a reasonable range,which can meet the positioning demand of this study.Thereafter,the behavior data of pigs collected in real-time were transmitted to computer through the wireless transmission system,and thus realizing the real-time display and preservation of the collected data.(2)The wavelet denoising method which was suitable for dealing with the nonlinear and non-stationary signal was selected to process the behavioral signal of pigs in this study.On the basis of the existing soft and hard threshold function,the exponential function was introduced to improve the threshold function.SNR and Mean Square Error were adopted as evaluation indexes,several commonly used wavelet bases were combined with different decomposition levels,different threshold rules,different threshold functions and compared with the traditional EMD method.The results of pig behavior classification and identification showed that the performances of all four behaviors have been significantly improved by using wavelet denoised data to train the model.Specifically,the overall mean accuracy of pig A increased from 88.7% to 92.5%,the overall mean accuracy of pig B increased from 91.8% to 93.6%,the overall mean accuracy of pig C increased from 91.7%to 95.4%,and the overall mean accuracy of the three pigs at different temperatures was also improved from 83.7% to 90.1%.(3)To solve the problem that the classification and identification results of imbalanced data sets are biased,this study carried out optimization research from three aspects: feature extraction,data balance processing and classification algorithm improvement.Firstly,this study extracted the mean,median,peak,the first and the third quaternary values of acceleration data collected in X,Y and Z axes respectively to form a new 21-dimensional data set.Considering that the feature dimension of the data set after preliminary feature extraction was relatively high,it is easy to cause the problem of "dimension disaster",thus reducing the effect of classification and identification.Relief F and random forest algorithm were used to analyze the influence of each feature on the final classification and identification results and the ranking of importance.Noise features irrelevant to classification or small correlation were deleted and feature dimension reduction was performed on the 21-dimensional data set.The results showed that the 9-dimensional data set reduced by random forest algorithms had better classification and identification effect by BP neural network.Meanwhile,to further improve the effect of classification and identification,the data set after dimension-reduction was windowing based on three different time sliding window lengths(3s,4s and 5s)according to the duration of various pig behaviors.The results showed that when the window length was5 s,the classification and identification effect was the best.Compared with the window length of 3s and 4s,the overall mean accuracy was significantly improved,which was up to 8.3%.(4)This study proposed a new data over-sampling method-Adaptive Borderline Data Augmentation Algorithm(AD-BL-SMOTE),aiming at the imbalance degree of pig behavior data set and the deficiency of existing data over-sampling methods.AD-BLSMOTE realized the distinction of minority boundary samples and strengthened the data enhancement of the minority boundary samples that were difficult to classify.As a result,the number of newly synthesized minority samples increased,while the number of easily classified boundary minority samples synthesized new samples decreased.This algorithm could not only effectively avoid the overlap of samples while synthesizing new minority samples,but also will not have any influence on the data distribution of the majority class,which meets the research purpose of this study which only hopes to augment the data of the minority class without changing the original number of the majority class.Results verified the superiority of the proposed algorithm in this study.(5)Based on wavelet denoising and data set balancing,BP neural network in machine learning algorithm and Support Vector Machine based on Gray Wolf optimization algorithm(GWO-SVM)were used to classify and identify the balanced pig behavior data respectively from the classification algorithm improvement level,and the parameters of each algorithm were optimized.Among them,the identification effect of BP neural network was better.The average identification accuracy of pig A,pig B and pig C was92.5%,93.6% and 95.4%,respectively.The average accuracy of the main identification for all pigs at different temperatures was also improved to 90.1%.On the other hand,this study introduced Weighted Loss Function and penalty factor respectively to improve the Soft Max function and GWO-SVM algorithm in the neural network.Using the two improved algorithms,the original unbalanced data sets can be classified and identified directly without the need for balancing.The results showed that the average identification accuracy of pig A,pig B and pig C can reach 91.1%,92.3% and 94.1%,respectively.The average accuracy of the identification for all pigs at different temperatures was also improved to 87.6%.It can be seen that the method based on balanced preprocessing combined with traditional machine learning and the two methods which do not adopt balanced preprocessing but improve the machine learning algorithm can effectively improve the accuracy of classification and identification of all four behaviors in the imbalanced pig data sets.However,in general,to improve the accuracy of behavior classification and identification,the method of balancing before adopting BP neural network has the highest accuracy and the best effect,which can meet the requirements better of this study for the classification and identification of pigs' four behaviors: lying,standing,walking and exploring.(6)This paper studied the effects of temperature on growth performance,physiological indexes and behavior of pigs.In this study,the average daily feed intake,daily gain,the changes of core temperature,body surface temperature,respiration rate and other indexes of pigs in different fattening stages were analyzed under low,moderate and high ambient temperatures.As well as the correlation between the ambient temperature of piggery and the weighted surface temperature of pigs.In addition,the use of CFD numerical simulation method to simulate and analyze the distribution of temperature field in the pigsty under three different ambient temperatures.Combined with the UWB positioning system to collect the real-time positions of pigs in the piggery,and to obtain the activity ranges and trajectories of pig A,pig B and pig C under different ambient temperatures,as well as the movement speed changes of pigs in A day and the energy consumed by movement thus to analyze the effects of ambient temperature on pig's exercise amount,lying position and the time distribution of each behavior.
Keywords/Search Tags:Pig, Behavior classification, Wavelet de-noising, Feature extraction, Data balancing, Machine learning
PDF Full Text Request
Related items